mirror of https://github.com/GNOME/gimp.git
Add default to Cancel button, remove unset GTK_RECEIVES_DEFAULT from
Sat Feb 20 16:12:33 CST 1999 Shawn T. Amundson <amundson@gimp.org> * app/tips_dialog.c: Add default to Cancel button, remove unset GTK_RECEIVES_DEFAULT from prev/next buttons (they are like toolbar buttons), changed abreviated prev to previous, prev/next button are now same size, cancel button is in a button box. Added vboxes where necessary to prevent prev/next and check button from filling vertically. * app/app_procs.c: when splashscreen dialog is larger than the logo, (due to huge font), center logo. * app/file_new_dialog.c: patch from Marco Lamb <lm@geocities.com> disallows resizing, changes vertical expanding of widgets to not occur * app/palette.c: patch from Marco Lamb <lm@geocities.com>. Makes +/- buttons for zoom pixmaps (eventually, these can be replaced with a magnifying glass with a little +/- I think), so that they no longer expand as they did before. I modified his patch so it did not create a misused toolbar. I did some other stuff here too, moved Close button to the left, made it the window's default, and unset GTK_RECEIVES_DEFAULT off of the non-bottom buttons. * app/actionarea.c: another patch from Marco Lamb <lm@geocities.com>. This one changes buttons to be put in a button box which is right justified. If we decide later that spread is better, we can change this easy enough. * app/tools/zoom_in.xpm, app/tools/zoom_out.xpm: + and - graphics. * libgimp/gimpunit.h libgimp/gimpunit.c: New files from Michael Natterer <mitschel@cs.tu-berlin.de>, gimp_unit_* routines. * app/gimage.h app/gimpimage.h app/gimpimage.c app/gimpimageP.h app/xcf.c: Patches from Michael Natterer <mitschel@cs.tu-berlin.de>, which keep a unit assocated with an image.
This commit is contained in:
parent
a27cedc001
commit
df051bd37f
42
ChangeLog
42
ChangeLog
|
@ -1,3 +1,45 @@
|
|||
Sat Feb 20 16:12:33 CST 1999 Shawn T. Amundson <amundson@gimp.org>
|
||||
|
||||
* app/tips_dialog.c: Add default to Cancel button, remove
|
||||
unset GTK_RECEIVES_DEFAULT from prev/next buttons (they
|
||||
are like toolbar buttons), changed abreviated prev to
|
||||
previous, prev/next button are now same size, cancel button
|
||||
is in a button box. Added vboxes where necessary to prevent
|
||||
prev/next and check button from filling vertically.
|
||||
|
||||
* app/app_procs.c: when splashscreen dialog is larger than the
|
||||
logo, (due to huge font), center logo.
|
||||
|
||||
* app/file_new_dialog.c: patch from Marco Lamb <lm@geocities.com>
|
||||
disallows resizing, changes vertical expanding of widgets to
|
||||
not occur
|
||||
|
||||
* app/palette.c: patch from Marco Lamb <lm@geocities.com>. Makes
|
||||
+/- buttons for zoom pixmaps (eventually, these can be replaced
|
||||
with a magnifying glass with a little +/- I think), so that they
|
||||
no longer expand as they did before. I modified his patch so it
|
||||
did not create a misused toolbar. I did some other stuff here too,
|
||||
moved Close button to the left, made it the window's default,
|
||||
and unset GTK_RECEIVES_DEFAULT off of the non-bottom buttons.
|
||||
|
||||
* app/actionarea.c: another patch from Marco Lamb <lm@geocities.com>.
|
||||
This one changes buttons to be put in a button box which is right
|
||||
justified. If we decide later that spread is better, we can
|
||||
change this easy enough.
|
||||
|
||||
* app/tools/zoom_in.xpm, app/tools/zoom_out.xpm: + and - graphics.
|
||||
|
||||
* libgimp/gimpunit.h
|
||||
libgimp/gimpunit.c: New files from Michael Natterer
|
||||
<mitschel@cs.tu-berlin.de>, gimp_unit_* routines.
|
||||
|
||||
* app/gimage.h
|
||||
app/gimpimage.h
|
||||
app/gimpimage.c
|
||||
app/gimpimageP.h
|
||||
app/xcf.c: Patches from Michael Natterer <mitschel@cs.tu-berlin.de>,
|
||||
which keep a unit assocated with an image.
|
||||
|
||||
1999-02-21 Tor Lillqvist <tml@iki.fi>
|
||||
|
||||
First batch of changes to merge the Win32 version. This will be
|
||||
|
|
|
@ -29,14 +29,28 @@ build_action_area (GtkDialog * dlg,
|
|||
{
|
||||
GtkWidget *button;
|
||||
int i;
|
||||
GList* children;
|
||||
GtkWidget* hbbox;
|
||||
|
||||
gtk_container_border_width (GTK_CONTAINER (dlg->action_area), 2);
|
||||
gtk_box_set_homogeneous (GTK_BOX (dlg->action_area), FALSE);
|
||||
children = gtk_container_children (GTK_CONTAINER (dlg->action_area));
|
||||
if (children == NULL) {
|
||||
/* add a right packed hbbox */
|
||||
hbbox = gtk_hbutton_box_new();
|
||||
gtk_button_box_set_spacing(GTK_BUTTON_BOX (hbbox), 4);
|
||||
gtk_box_pack_end(GTK_BOX (dlg->action_area), hbbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show(hbbox);
|
||||
} else {
|
||||
/* get the hbbox */
|
||||
hbbox = (GtkWidget*)(g_list_first(children)->data);
|
||||
}
|
||||
|
||||
for (i = 0; i < num_actions; i++)
|
||||
{
|
||||
button = gtk_button_new_with_label (gettext(actions[i].label));
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start (GTK_BOX (dlg->action_area), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbbox), button, FALSE, FALSE, 0);
|
||||
|
||||
if (actions[i].callback)
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
|
|
|
@ -358,6 +358,7 @@ make_initialization_status_window(void)
|
|||
if (no_splash == FALSE)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *logo_hbox;
|
||||
GtkStyle *style;
|
||||
|
||||
win_initstatus = gtk_window_new(GTK_WINDOW_DIALOG);
|
||||
|
@ -376,6 +377,9 @@ make_initialization_status_window(void)
|
|||
|
||||
vbox = gtk_vbox_new(FALSE, 4);
|
||||
gtk_container_add(GTK_CONTAINER(win_initstatus), vbox);
|
||||
|
||||
logo_hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX(vbox), logo_hbox, FALSE, TRUE, 0);
|
||||
|
||||
logo_area = gtk_drawing_area_new ();
|
||||
|
||||
|
@ -384,7 +388,7 @@ make_initialization_status_window(void)
|
|||
logo_area_width = ( logo_width > LOGO_WIDTH_MIN ) ? logo_width : LOGO_WIDTH_MIN;
|
||||
logo_area_height = ( logo_height > LOGO_HEIGHT_MIN ) ? logo_height : LOGO_HEIGHT_MIN;
|
||||
gtk_drawing_area_size (GTK_DRAWING_AREA (logo_area), logo_area_width, logo_area_height);
|
||||
gtk_box_pack_start_defaults(GTK_BOX(vbox), logo_area);
|
||||
gtk_box_pack_start (GTK_BOX(logo_hbox), logo_area, TRUE, FALSE, 0);
|
||||
|
||||
label1 = gtk_label_new("");
|
||||
gtk_box_pack_start_defaults(GTK_BOX(vbox), label1);
|
||||
|
@ -395,6 +399,7 @@ make_initialization_status_window(void)
|
|||
gtk_box_pack_start_defaults(GTK_BOX(vbox), pbar);
|
||||
|
||||
gtk_widget_show(vbox);
|
||||
gtk_widget_show(logo_hbox);
|
||||
gtk_widget_show(logo_area);
|
||||
gtk_widget_show(label1);
|
||||
gtk_widget_show(label2);
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -485,6 +485,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
gtk_window_set_wmclass (GTK_WINDOW (vals->dlg), "new_image", "Gimp");
|
||||
gtk_window_set_title (GTK_WINDOW (vals->dlg), _("New Image"));
|
||||
gtk_window_set_position (GTK_WINDOW (vals->dlg), GTK_WIN_POS_MOUSE);
|
||||
gtk_window_set_policy(GTK_WINDOW (vals->dlg), FALSE, FALSE, FALSE);
|
||||
|
||||
/* handle the wm close signal */
|
||||
gtk_signal_connect (GTK_OBJECT (vals->dlg), "delete_event",
|
||||
|
@ -619,7 +620,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
if (vals->unit != 1.0)
|
||||
gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), 1);
|
||||
gtk_table_attach (GTK_TABLE (table), optionmenu , 2, 3, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
||||
gtk_widget_show(optionmenu);
|
||||
|
||||
/* resolution frame */
|
||||
|
@ -697,7 +698,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
|
||||
button = gtk_radio_button_new_with_label (NULL, _("RGB"));
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) RGB);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
(GtkSignalFunc) file_new_toggle_callback,
|
||||
|
@ -708,7 +709,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
|
||||
button = gtk_radio_button_new_with_label (group, _("Grayscale"));
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) GRAY);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
(GtkSignalFunc) file_new_toggle_callback,
|
||||
|
|
|
@ -30,10 +30,14 @@ tips_dialog_create ()
|
|||
GtkWidget *vbox;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *hbox2;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *vbox_bbox2;
|
||||
GtkWidget *bbox2;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *button_close;
|
||||
GtkWidget *button_next;
|
||||
GtkWidget *button_prev;
|
||||
GtkWidget *vbox_check;
|
||||
GtkWidget *button_check;
|
||||
guchar * temp;
|
||||
guchar * src;
|
||||
|
@ -81,6 +85,18 @@ tips_dialog_create ()
|
|||
gtk_container_set_border_width (GTK_CONTAINER (hbox2), 10);
|
||||
gtk_box_pack_end (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0);
|
||||
gtk_widget_show (hbox2);
|
||||
|
||||
bbox = gtk_hbutton_box_new ();
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), bbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (bbox);
|
||||
|
||||
vbox_bbox2 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), vbox_bbox2, FALSE, FALSE, 15);
|
||||
gtk_widget_show (vbox_bbox2);
|
||||
|
||||
bbox2 = gtk_hbox_new (TRUE, 5);
|
||||
gtk_box_pack_end (GTK_BOX (vbox_bbox2), bbox2, TRUE, FALSE, 0);
|
||||
gtk_widget_show(bbox2);
|
||||
|
||||
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
gtk_preview_size (GTK_PREVIEW (preview), wilber_width, wilber_height);
|
||||
|
@ -106,33 +122,41 @@ tips_dialog_create ()
|
|||
gtk_box_pack_start (GTK_BOX (hbox1), tips_label, TRUE, TRUE, 3);
|
||||
gtk_widget_show (tips_label);
|
||||
|
||||
button_close = gtk_button_new_with_label (_("Close"));
|
||||
gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_dialog_hide), NULL);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_close, FALSE, TRUE, 0);
|
||||
gtk_widget_show (button_close);
|
||||
|
||||
button_next = gtk_button_new_with_label (_("Next Tip"));
|
||||
gtk_signal_connect (GTK_OBJECT (button_next), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "next");
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_next, FALSE, TRUE, 0);
|
||||
gtk_widget_show (button_next);
|
||||
|
||||
button_prev = gtk_button_new_with_label (_("Prev. Tip"));
|
||||
button_prev = gtk_button_new_with_label (_("Previous Tip"));
|
||||
GTK_WIDGET_UNSET_FLAGS (button_prev, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_prev), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "prev");
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_prev, FALSE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (bbox2), button_prev);
|
||||
gtk_widget_show (button_prev);
|
||||
|
||||
button_next = gtk_button_new_with_label (_("Next Tip"));
|
||||
GTK_WIDGET_UNSET_FLAGS (button_next, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_next), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "next");
|
||||
gtk_container_add (GTK_CONTAINER (bbox2), button_next);
|
||||
gtk_widget_show (button_next);
|
||||
|
||||
button_close = gtk_button_new_with_label (_("Close"));
|
||||
GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
|
||||
gtk_window_set_default (GTK_WINDOW (tips_dialog), button_close);
|
||||
gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_dialog_hide), NULL);
|
||||
gtk_container_add (GTK_CONTAINER (bbox), button_close);
|
||||
gtk_widget_show (button_close);
|
||||
|
||||
vbox_check = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), vbox_check, FALSE, TRUE, 0);
|
||||
gtk_widget_show (vbox_check);
|
||||
|
||||
button_check = gtk_check_button_new_with_label (_("Show tip next time"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_check),
|
||||
show_tips);
|
||||
gtk_signal_connect (GTK_OBJECT (button_check), "toggled",
|
||||
GTK_SIGNAL_FUNC (tips_toggle_update),
|
||||
(gpointer) &show_tips);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), button_check, FALSE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox_check), button_check, TRUE, FALSE, 0);
|
||||
gtk_widget_show (button_check);
|
||||
|
||||
old_show_tips = show_tips;
|
||||
|
|
|
@ -485,6 +485,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
gtk_window_set_wmclass (GTK_WINDOW (vals->dlg), "new_image", "Gimp");
|
||||
gtk_window_set_title (GTK_WINDOW (vals->dlg), _("New Image"));
|
||||
gtk_window_set_position (GTK_WINDOW (vals->dlg), GTK_WIN_POS_MOUSE);
|
||||
gtk_window_set_policy(GTK_WINDOW (vals->dlg), FALSE, FALSE, FALSE);
|
||||
|
||||
/* handle the wm close signal */
|
||||
gtk_signal_connect (GTK_OBJECT (vals->dlg), "delete_event",
|
||||
|
@ -619,7 +620,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
if (vals->unit != 1.0)
|
||||
gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), 1);
|
||||
gtk_table_attach (GTK_TABLE (table), optionmenu , 2, 3, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
||||
gtk_widget_show(optionmenu);
|
||||
|
||||
/* resolution frame */
|
||||
|
@ -697,7 +698,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
|
||||
button = gtk_radio_button_new_with_label (NULL, _("RGB"));
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) RGB);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
(GtkSignalFunc) file_new_toggle_callback,
|
||||
|
@ -708,7 +709,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
|
||||
button = gtk_radio_button_new_with_label (group, _("Grayscale"));
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) GRAY);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
(GtkSignalFunc) file_new_toggle_callback,
|
||||
|
|
|
@ -52,6 +52,8 @@ gimage_foreach (GFunc func, gpointer user_data);
|
|||
#define gimage_set_filename gimp_image_set_filename
|
||||
#define gimage_set_resolution gimp_image_set_resolution
|
||||
#define gimage_get_resolution gimp_image_get_resolution
|
||||
#define gimage_set_unit gimp_image_set_unit
|
||||
#define gimage_get_unit gimp_image_get_unit
|
||||
#define gimage_set_save_proc gimp_image_set_save_proc
|
||||
#define gimage_get_save_proc gimp_image_get_save_proc
|
||||
#define gimage_resize gimp_image_resize
|
||||
|
|
|
@ -164,6 +164,7 @@ static void gimp_image_init (GimpImage *gimage)
|
|||
gimp_matrix_identity(gimage->transform);
|
||||
gimage->xresolution = 72.0; /* maybe should be rc-supplied default? */
|
||||
gimage->yresolution = 72.0;
|
||||
gimage->unit = UNIT_PIXEL;
|
||||
gimage->save_proc= NULL;
|
||||
}
|
||||
|
||||
|
@ -327,6 +328,21 @@ gimp_image_get_resolution (GimpImage *gimage,
|
|||
*yresolution = gimage->yresolution;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_unit (GimpImage *gimage,
|
||||
GUnit unit)
|
||||
{
|
||||
gimage->unit = unit;
|
||||
}
|
||||
|
||||
GUnit
|
||||
gimp_image_get_unit (GimpImage *gimage)
|
||||
{
|
||||
return gimage->unit;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gimp_image_set_save_proc (GimpImage *gimage, PlugInProcDef *proc)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include "channel.h"
|
||||
#include "layer.h"
|
||||
#include <libgimp/parasiteF.h>
|
||||
#include <libgimp/gimpunit.h>
|
||||
#include "plug_in.h"
|
||||
#include "temp_buf.h"
|
||||
#include "tile_manager.h"
|
||||
|
@ -102,18 +103,20 @@ GtkType gimp_image_get_type(void);
|
|||
|
||||
/* function declarations */
|
||||
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
GimpImage * gimp_image_new (int, int, int);
|
||||
void gimp_image_set_filename (GimpImage *, char *);
|
||||
void gimp_image_set_resolution (GimpImage *, float, float);
|
||||
void gimp_image_get_resolution (GimpImage *,
|
||||
float *,
|
||||
float *);
|
||||
void gimp_image_set_unit (GimpImage *, GUnit);
|
||||
GUnit gimp_image_get_unit (GimpImage *);
|
||||
void gimp_image_set_save_proc (GimpImage *, PlugInProcDef *);
|
||||
PlugInProcDef * gimp_image_get_save_proc (GimpImage *);
|
||||
void gimp_image_resize (GimpImage *, int, int, int, int);
|
||||
void gimp_image_scale (GimpImage *, int, int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
GimpImage * gimp_image_get_named (char *);
|
||||
GimpImage * gimp_image_get_ID (int);
|
||||
TileManager * gimp_image_shadow (GimpImage *, int, int, int);
|
||||
void gimp_image_free_shadow (GimpImage *);
|
||||
void gimp_image_apply_image (GimpImage *, GimpDrawable *,
|
||||
|
|
|
@ -24,6 +24,7 @@ struct _GimpImage
|
|||
int width, height; /* width and height attributes */
|
||||
float xresolution; /* image x-res, in dpi */
|
||||
float yresolution; /* image y-res, in dpi */
|
||||
GUnit unit; /* image unit */
|
||||
int base_type; /* base gimp_image type */
|
||||
|
||||
unsigned char * cmap; /* colormap--for indexed */
|
||||
|
|
|
@ -485,6 +485,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
gtk_window_set_wmclass (GTK_WINDOW (vals->dlg), "new_image", "Gimp");
|
||||
gtk_window_set_title (GTK_WINDOW (vals->dlg), _("New Image"));
|
||||
gtk_window_set_position (GTK_WINDOW (vals->dlg), GTK_WIN_POS_MOUSE);
|
||||
gtk_window_set_policy(GTK_WINDOW (vals->dlg), FALSE, FALSE, FALSE);
|
||||
|
||||
/* handle the wm close signal */
|
||||
gtk_signal_connect (GTK_OBJECT (vals->dlg), "delete_event",
|
||||
|
@ -619,7 +620,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
if (vals->unit != 1.0)
|
||||
gtk_option_menu_set_history (GTK_OPTION_MENU (optionmenu), 1);
|
||||
gtk_table_attach (GTK_TABLE (table), optionmenu , 2, 3, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
||||
gtk_widget_show(optionmenu);
|
||||
|
||||
/* resolution frame */
|
||||
|
@ -697,7 +698,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
|
||||
button = gtk_radio_button_new_with_label (NULL, _("RGB"));
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) RGB);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
(GtkSignalFunc) file_new_toggle_callback,
|
||||
|
@ -708,7 +709,7 @@ file_new_cmd_callback (GtkWidget *widget,
|
|||
|
||||
button = gtk_radio_button_new_with_label (group, _("Grayscale"));
|
||||
group = gtk_radio_button_group (GTK_RADIO_BUTTON (button));
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (radio_box), button, FALSE, TRUE, 0);
|
||||
gtk_object_set_user_data (GTK_OBJECT (button), (gpointer) GRAY);
|
||||
gtk_signal_connect (GTK_OBJECT (button), "toggled",
|
||||
(GtkSignalFunc) file_new_toggle_callback,
|
||||
|
|
|
@ -49,6 +49,9 @@
|
|||
#include "palette_select.h"
|
||||
#include "dialog_handler.h"
|
||||
|
||||
#include "tools/zoom_in.xpm"
|
||||
#include "tools/zoom_out.xpm"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define ENTRY_WIDTH 12
|
||||
|
@ -2136,10 +2139,7 @@ redraw_palette(PaletteP palette)
|
|||
if (n_entries % palette->columns)
|
||||
nrows += 1;
|
||||
|
||||
vsize = nrows*(SPACING + (gint)(ENTRY_HEIGHT*palette->zoom_factor))+1;
|
||||
|
||||
if(vsize < PREVIEW_HEIGHT)
|
||||
vsize = PREVIEW_HEIGHT;
|
||||
vsize = nrows*(SPACING + (gint)(ENTRY_HEIGHT*palette->zoom_factor))+SPACING;
|
||||
|
||||
parent = palette->color_area->parent;
|
||||
gtk_widget_ref(palette->color_area);
|
||||
|
@ -2147,7 +2147,7 @@ redraw_palette(PaletteP palette)
|
|||
|
||||
new_pre_width = (gint)(ENTRY_WIDTH*palette->zoom_factor);
|
||||
new_pre_width = (new_pre_width+SPACING)*palette->columns+SPACING;
|
||||
|
||||
|
||||
gtk_preview_size(GTK_PREVIEW(palette->color_area),
|
||||
new_pre_width, /*PREVIEW_WIDTH,*/
|
||||
vsize);
|
||||
|
@ -2234,6 +2234,7 @@ create_palette_dialog (gint vert)
|
|||
GtkWidget *dialog_vbox3;
|
||||
GtkWidget *hbox3;
|
||||
GtkWidget *hbox4;
|
||||
GtkWidget *hbox5;
|
||||
GtkWidget *vbox4;
|
||||
GtkWidget *palette_scrolledwindow;
|
||||
GtkWidget *palette_region;
|
||||
|
@ -2253,10 +2254,14 @@ create_palette_dialog (gint vert)
|
|||
GtkWidget *close_button;
|
||||
GtkWidget *refresh_button;
|
||||
GtkWidget *clist_scrolledwindow;
|
||||
GtkWidget *plus_button;
|
||||
GtkWidget *minus_button;
|
||||
PaletteP palette;
|
||||
GdkColormap *colormap;
|
||||
GtkWidget* button_plus;
|
||||
GtkWidget* button_minus;
|
||||
GtkWidget* pixmapwid;
|
||||
GdkPixmap* pixmap;
|
||||
GdkBitmap* mask;
|
||||
GtkStyle* style;
|
||||
|
||||
palette = g_malloc (sizeof (_Palette));
|
||||
|
||||
|
@ -2358,18 +2363,38 @@ create_palette_dialog (gint vert)
|
|||
palette);
|
||||
|
||||
/* + and - buttons */
|
||||
plus_button = gtk_button_new_with_label ("+");
|
||||
minus_button = gtk_button_new_with_label ("-");
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), minus_button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), plus_button, TRUE, TRUE, 0);
|
||||
gtk_widget_show(plus_button);
|
||||
gtk_widget_show(minus_button);
|
||||
gtk_signal_connect (GTK_OBJECT (plus_button), "clicked",
|
||||
(GtkSignalFunc) palette_zoomin,
|
||||
(gpointer) palette);
|
||||
gtk_signal_connect (GTK_OBJECT (minus_button), "clicked",
|
||||
(GtkSignalFunc) palette_zoomout,
|
||||
(gpointer) palette);
|
||||
style = gtk_widget_get_style(palette_dialog);
|
||||
gtk_widget_realize(palette_dialog);
|
||||
|
||||
button_plus = gtk_button_new ();
|
||||
GTK_WIDGET_UNSET_FLAGS (button_plus, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_plus), "clicked",
|
||||
GTK_SIGNAL_FUNC (palette_zoomin), (gpointer) palette);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), button_plus, FALSE, FALSE, 0);
|
||||
|
||||
button_minus = gtk_button_new ();
|
||||
GTK_WIDGET_UNSET_FLAGS (button_minus, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_minus), "clicked",
|
||||
GTK_SIGNAL_FUNC (palette_zoomout), (gpointer) palette);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), button_minus, FALSE, FALSE, 0);
|
||||
|
||||
pixmap = gdk_pixmap_create_from_xpm_d(palette_dialog->window, &mask,
|
||||
&style->bg[GTK_STATE_NORMAL],
|
||||
zoom_in_xpm);
|
||||
pixmapwid = gtk_pixmap_new(pixmap, mask);
|
||||
gtk_container_add (GTK_CONTAINER (button_plus), pixmapwid);
|
||||
gtk_widget_show (pixmapwid);
|
||||
|
||||
pixmap = gdk_pixmap_create_from_xpm_d(palette_dialog->window, &mask,
|
||||
&style->bg[GTK_STATE_NORMAL],
|
||||
zoom_out_xpm);
|
||||
pixmapwid = gtk_pixmap_new(pixmap, mask);
|
||||
gtk_container_add (GTK_CONTAINER (button_minus), pixmapwid);
|
||||
gtk_widget_show (pixmapwid);
|
||||
|
||||
gtk_widget_show (button_plus);
|
||||
gtk_widget_show (button_minus);
|
||||
|
||||
|
||||
/* clist preview of palettes */
|
||||
clist_scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
|
||||
|
@ -2438,6 +2463,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (vbuttonbox2), 17, 0);
|
||||
|
||||
new_palette = gtk_button_new_with_label (_("New"));
|
||||
GTK_WIDGET_UNSET_FLAGS (new_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (new_palette), "clicked",
|
||||
(GtkSignalFunc) palette_new_entries_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2446,6 +2472,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), new_palette);
|
||||
|
||||
delete_palette = gtk_button_new_with_label (_("Delete"));
|
||||
GTK_WIDGET_UNSET_FLAGS (delete_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (delete_palette), "clicked",
|
||||
(GtkSignalFunc) palette_delete_entries_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2453,6 +2480,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), delete_palette);
|
||||
|
||||
save_palettes = gtk_button_new_with_label (_("Save"));
|
||||
GTK_WIDGET_UNSET_FLAGS (save_palettes, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (save_palettes), "clicked",
|
||||
(GtkSignalFunc) palette_save_palettes_callback,
|
||||
(gpointer) NULL);
|
||||
|
@ -2460,6 +2488,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), save_palettes);
|
||||
|
||||
import_palette = gtk_button_new_with_label (_("Import"));
|
||||
GTK_WIDGET_UNSET_FLAGS (import_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (import_palette), "clicked",
|
||||
(GtkSignalFunc) palette_import_dialog_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2467,6 +2496,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), import_palette);
|
||||
|
||||
merge_palette = gtk_button_new_with_label (_("Merge"));
|
||||
GTK_WIDGET_UNSET_FLAGS (merge_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (merge_palette), "clicked",
|
||||
(GtkSignalFunc) palette_merge_dialog_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2483,47 +2513,45 @@ create_palette_dialog (gint vert)
|
|||
gtk_widget_show (alignment2);
|
||||
gtk_box_pack_start (GTK_BOX (dialog_action_area3), alignment2, TRUE, TRUE, 0);
|
||||
|
||||
hbox5 = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (alignment2), hbox5);
|
||||
gtk_widget_show (hbox5);
|
||||
|
||||
hbuttonbox3 = gtk_hbutton_box_new ();
|
||||
gtk_object_set_data (GTK_OBJECT (palette_dialog), "hbuttonbox3", hbuttonbox3);
|
||||
gtk_widget_show (hbuttonbox3);
|
||||
gtk_container_add (GTK_CONTAINER (alignment2), hbuttonbox3);
|
||||
gtk_widget_set_usize (hbuttonbox3, 153, 37);
|
||||
gtk_container_border_width (GTK_CONTAINER (hbuttonbox3), 8);
|
||||
gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox3), 85, 26);
|
||||
gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (hbuttonbox3), 4, 0);
|
||||
gtk_box_pack_end (GTK_BOX(hbox5), hbuttonbox3, FALSE, FALSE, 0);
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox3), 4);
|
||||
|
||||
close_button = gtk_button_new_with_label (_("Close"));
|
||||
gtk_signal_connect(GTK_OBJECT(close_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_close_callback), (gpointer)palette);
|
||||
|
||||
gtk_widget_show (close_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), close_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (close_button), 4);
|
||||
GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_grab_default (close_button);
|
||||
gtk_signal_connect (GTK_OBJECT (palette->shell), "delete_event",
|
||||
GTK_SIGNAL_FUNC (palette_dialog_delete_callback),
|
||||
palette);
|
||||
|
||||
close_button = gtk_button_new_with_label (_("Close"));
|
||||
GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_DEFAULT);
|
||||
gtk_window_set_default (GTK_WINDOW (palette->shell), close_button);
|
||||
gtk_signal_connect(GTK_OBJECT(close_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_close_callback), (gpointer)palette);
|
||||
|
||||
if(!vert)
|
||||
{
|
||||
refresh_button = gtk_button_new_with_label (_("refresh"));
|
||||
refresh_button = gtk_button_new_with_label (_("Refresh"));
|
||||
gtk_signal_connect(GTK_OBJECT(refresh_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_refresh_callback), (gpointer)palette);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (refresh_button), 9);
|
||||
}
|
||||
else
|
||||
{
|
||||
refresh_button = gtk_button_new_with_label (_("Edit"));
|
||||
gtk_signal_connect(GTK_OBJECT(refresh_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_edit_palette_callback), (gpointer)palette);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (refresh_button), 9);
|
||||
}
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (refresh_button, GTK_CAN_DEFAULT);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), close_button);
|
||||
gtk_widget_show (close_button);
|
||||
|
||||
gtk_widget_realize(palette->shell);
|
||||
palette->gc = gdk_gc_new(palette->shell->window);
|
||||
|
||||
|
|
|
@ -30,10 +30,14 @@ tips_dialog_create ()
|
|||
GtkWidget *vbox;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *hbox2;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *vbox_bbox2;
|
||||
GtkWidget *bbox2;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *button_close;
|
||||
GtkWidget *button_next;
|
||||
GtkWidget *button_prev;
|
||||
GtkWidget *vbox_check;
|
||||
GtkWidget *button_check;
|
||||
guchar * temp;
|
||||
guchar * src;
|
||||
|
@ -81,6 +85,18 @@ tips_dialog_create ()
|
|||
gtk_container_set_border_width (GTK_CONTAINER (hbox2), 10);
|
||||
gtk_box_pack_end (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0);
|
||||
gtk_widget_show (hbox2);
|
||||
|
||||
bbox = gtk_hbutton_box_new ();
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), bbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (bbox);
|
||||
|
||||
vbox_bbox2 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), vbox_bbox2, FALSE, FALSE, 15);
|
||||
gtk_widget_show (vbox_bbox2);
|
||||
|
||||
bbox2 = gtk_hbox_new (TRUE, 5);
|
||||
gtk_box_pack_end (GTK_BOX (vbox_bbox2), bbox2, TRUE, FALSE, 0);
|
||||
gtk_widget_show(bbox2);
|
||||
|
||||
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
gtk_preview_size (GTK_PREVIEW (preview), wilber_width, wilber_height);
|
||||
|
@ -106,33 +122,41 @@ tips_dialog_create ()
|
|||
gtk_box_pack_start (GTK_BOX (hbox1), tips_label, TRUE, TRUE, 3);
|
||||
gtk_widget_show (tips_label);
|
||||
|
||||
button_close = gtk_button_new_with_label (_("Close"));
|
||||
gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_dialog_hide), NULL);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_close, FALSE, TRUE, 0);
|
||||
gtk_widget_show (button_close);
|
||||
|
||||
button_next = gtk_button_new_with_label (_("Next Tip"));
|
||||
gtk_signal_connect (GTK_OBJECT (button_next), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "next");
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_next, FALSE, TRUE, 0);
|
||||
gtk_widget_show (button_next);
|
||||
|
||||
button_prev = gtk_button_new_with_label (_("Prev. Tip"));
|
||||
button_prev = gtk_button_new_with_label (_("Previous Tip"));
|
||||
GTK_WIDGET_UNSET_FLAGS (button_prev, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_prev), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "prev");
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_prev, FALSE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (bbox2), button_prev);
|
||||
gtk_widget_show (button_prev);
|
||||
|
||||
button_next = gtk_button_new_with_label (_("Next Tip"));
|
||||
GTK_WIDGET_UNSET_FLAGS (button_next, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_next), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "next");
|
||||
gtk_container_add (GTK_CONTAINER (bbox2), button_next);
|
||||
gtk_widget_show (button_next);
|
||||
|
||||
button_close = gtk_button_new_with_label (_("Close"));
|
||||
GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
|
||||
gtk_window_set_default (GTK_WINDOW (tips_dialog), button_close);
|
||||
gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_dialog_hide), NULL);
|
||||
gtk_container_add (GTK_CONTAINER (bbox), button_close);
|
||||
gtk_widget_show (button_close);
|
||||
|
||||
vbox_check = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), vbox_check, FALSE, TRUE, 0);
|
||||
gtk_widget_show (vbox_check);
|
||||
|
||||
button_check = gtk_check_button_new_with_label (_("Show tip next time"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_check),
|
||||
show_tips);
|
||||
gtk_signal_connect (GTK_OBJECT (button_check), "toggled",
|
||||
GTK_SIGNAL_FUNC (tips_toggle_update),
|
||||
(gpointer) &show_tips);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), button_check, FALSE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox_check), button_check, TRUE, FALSE, 0);
|
||||
gtk_widget_show (button_check);
|
||||
|
||||
old_show_tips = show_tips;
|
||||
|
|
108
app/palette.c
108
app/palette.c
|
@ -49,6 +49,9 @@
|
|||
#include "palette_select.h"
|
||||
#include "dialog_handler.h"
|
||||
|
||||
#include "tools/zoom_in.xpm"
|
||||
#include "tools/zoom_out.xpm"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define ENTRY_WIDTH 12
|
||||
|
@ -2136,10 +2139,7 @@ redraw_palette(PaletteP palette)
|
|||
if (n_entries % palette->columns)
|
||||
nrows += 1;
|
||||
|
||||
vsize = nrows*(SPACING + (gint)(ENTRY_HEIGHT*palette->zoom_factor))+1;
|
||||
|
||||
if(vsize < PREVIEW_HEIGHT)
|
||||
vsize = PREVIEW_HEIGHT;
|
||||
vsize = nrows*(SPACING + (gint)(ENTRY_HEIGHT*palette->zoom_factor))+SPACING;
|
||||
|
||||
parent = palette->color_area->parent;
|
||||
gtk_widget_ref(palette->color_area);
|
||||
|
@ -2147,7 +2147,7 @@ redraw_palette(PaletteP palette)
|
|||
|
||||
new_pre_width = (gint)(ENTRY_WIDTH*palette->zoom_factor);
|
||||
new_pre_width = (new_pre_width+SPACING)*palette->columns+SPACING;
|
||||
|
||||
|
||||
gtk_preview_size(GTK_PREVIEW(palette->color_area),
|
||||
new_pre_width, /*PREVIEW_WIDTH,*/
|
||||
vsize);
|
||||
|
@ -2234,6 +2234,7 @@ create_palette_dialog (gint vert)
|
|||
GtkWidget *dialog_vbox3;
|
||||
GtkWidget *hbox3;
|
||||
GtkWidget *hbox4;
|
||||
GtkWidget *hbox5;
|
||||
GtkWidget *vbox4;
|
||||
GtkWidget *palette_scrolledwindow;
|
||||
GtkWidget *palette_region;
|
||||
|
@ -2253,10 +2254,14 @@ create_palette_dialog (gint vert)
|
|||
GtkWidget *close_button;
|
||||
GtkWidget *refresh_button;
|
||||
GtkWidget *clist_scrolledwindow;
|
||||
GtkWidget *plus_button;
|
||||
GtkWidget *minus_button;
|
||||
PaletteP palette;
|
||||
GdkColormap *colormap;
|
||||
GtkWidget* button_plus;
|
||||
GtkWidget* button_minus;
|
||||
GtkWidget* pixmapwid;
|
||||
GdkPixmap* pixmap;
|
||||
GdkBitmap* mask;
|
||||
GtkStyle* style;
|
||||
|
||||
palette = g_malloc (sizeof (_Palette));
|
||||
|
||||
|
@ -2358,18 +2363,38 @@ create_palette_dialog (gint vert)
|
|||
palette);
|
||||
|
||||
/* + and - buttons */
|
||||
plus_button = gtk_button_new_with_label ("+");
|
||||
minus_button = gtk_button_new_with_label ("-");
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), minus_button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), plus_button, TRUE, TRUE, 0);
|
||||
gtk_widget_show(plus_button);
|
||||
gtk_widget_show(minus_button);
|
||||
gtk_signal_connect (GTK_OBJECT (plus_button), "clicked",
|
||||
(GtkSignalFunc) palette_zoomin,
|
||||
(gpointer) palette);
|
||||
gtk_signal_connect (GTK_OBJECT (minus_button), "clicked",
|
||||
(GtkSignalFunc) palette_zoomout,
|
||||
(gpointer) palette);
|
||||
style = gtk_widget_get_style(palette_dialog);
|
||||
gtk_widget_realize(palette_dialog);
|
||||
|
||||
button_plus = gtk_button_new ();
|
||||
GTK_WIDGET_UNSET_FLAGS (button_plus, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_plus), "clicked",
|
||||
GTK_SIGNAL_FUNC (palette_zoomin), (gpointer) palette);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), button_plus, FALSE, FALSE, 0);
|
||||
|
||||
button_minus = gtk_button_new ();
|
||||
GTK_WIDGET_UNSET_FLAGS (button_minus, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_minus), "clicked",
|
||||
GTK_SIGNAL_FUNC (palette_zoomout), (gpointer) palette);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), button_minus, FALSE, FALSE, 0);
|
||||
|
||||
pixmap = gdk_pixmap_create_from_xpm_d(palette_dialog->window, &mask,
|
||||
&style->bg[GTK_STATE_NORMAL],
|
||||
zoom_in_xpm);
|
||||
pixmapwid = gtk_pixmap_new(pixmap, mask);
|
||||
gtk_container_add (GTK_CONTAINER (button_plus), pixmapwid);
|
||||
gtk_widget_show (pixmapwid);
|
||||
|
||||
pixmap = gdk_pixmap_create_from_xpm_d(palette_dialog->window, &mask,
|
||||
&style->bg[GTK_STATE_NORMAL],
|
||||
zoom_out_xpm);
|
||||
pixmapwid = gtk_pixmap_new(pixmap, mask);
|
||||
gtk_container_add (GTK_CONTAINER (button_minus), pixmapwid);
|
||||
gtk_widget_show (pixmapwid);
|
||||
|
||||
gtk_widget_show (button_plus);
|
||||
gtk_widget_show (button_minus);
|
||||
|
||||
|
||||
/* clist preview of palettes */
|
||||
clist_scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
|
||||
|
@ -2438,6 +2463,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (vbuttonbox2), 17, 0);
|
||||
|
||||
new_palette = gtk_button_new_with_label (_("New"));
|
||||
GTK_WIDGET_UNSET_FLAGS (new_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (new_palette), "clicked",
|
||||
(GtkSignalFunc) palette_new_entries_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2446,6 +2472,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), new_palette);
|
||||
|
||||
delete_palette = gtk_button_new_with_label (_("Delete"));
|
||||
GTK_WIDGET_UNSET_FLAGS (delete_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (delete_palette), "clicked",
|
||||
(GtkSignalFunc) palette_delete_entries_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2453,6 +2480,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), delete_palette);
|
||||
|
||||
save_palettes = gtk_button_new_with_label (_("Save"));
|
||||
GTK_WIDGET_UNSET_FLAGS (save_palettes, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (save_palettes), "clicked",
|
||||
(GtkSignalFunc) palette_save_palettes_callback,
|
||||
(gpointer) NULL);
|
||||
|
@ -2460,6 +2488,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), save_palettes);
|
||||
|
||||
import_palette = gtk_button_new_with_label (_("Import"));
|
||||
GTK_WIDGET_UNSET_FLAGS (import_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (import_palette), "clicked",
|
||||
(GtkSignalFunc) palette_import_dialog_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2467,6 +2496,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), import_palette);
|
||||
|
||||
merge_palette = gtk_button_new_with_label (_("Merge"));
|
||||
GTK_WIDGET_UNSET_FLAGS (merge_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (merge_palette), "clicked",
|
||||
(GtkSignalFunc) palette_merge_dialog_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2483,47 +2513,45 @@ create_palette_dialog (gint vert)
|
|||
gtk_widget_show (alignment2);
|
||||
gtk_box_pack_start (GTK_BOX (dialog_action_area3), alignment2, TRUE, TRUE, 0);
|
||||
|
||||
hbox5 = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (alignment2), hbox5);
|
||||
gtk_widget_show (hbox5);
|
||||
|
||||
hbuttonbox3 = gtk_hbutton_box_new ();
|
||||
gtk_object_set_data (GTK_OBJECT (palette_dialog), "hbuttonbox3", hbuttonbox3);
|
||||
gtk_widget_show (hbuttonbox3);
|
||||
gtk_container_add (GTK_CONTAINER (alignment2), hbuttonbox3);
|
||||
gtk_widget_set_usize (hbuttonbox3, 153, 37);
|
||||
gtk_container_border_width (GTK_CONTAINER (hbuttonbox3), 8);
|
||||
gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox3), 85, 26);
|
||||
gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (hbuttonbox3), 4, 0);
|
||||
gtk_box_pack_end (GTK_BOX(hbox5), hbuttonbox3, FALSE, FALSE, 0);
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox3), 4);
|
||||
|
||||
close_button = gtk_button_new_with_label (_("Close"));
|
||||
gtk_signal_connect(GTK_OBJECT(close_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_close_callback), (gpointer)palette);
|
||||
|
||||
gtk_widget_show (close_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), close_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (close_button), 4);
|
||||
GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_grab_default (close_button);
|
||||
gtk_signal_connect (GTK_OBJECT (palette->shell), "delete_event",
|
||||
GTK_SIGNAL_FUNC (palette_dialog_delete_callback),
|
||||
palette);
|
||||
|
||||
close_button = gtk_button_new_with_label (_("Close"));
|
||||
GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_DEFAULT);
|
||||
gtk_window_set_default (GTK_WINDOW (palette->shell), close_button);
|
||||
gtk_signal_connect(GTK_OBJECT(close_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_close_callback), (gpointer)palette);
|
||||
|
||||
if(!vert)
|
||||
{
|
||||
refresh_button = gtk_button_new_with_label (_("refresh"));
|
||||
refresh_button = gtk_button_new_with_label (_("Refresh"));
|
||||
gtk_signal_connect(GTK_OBJECT(refresh_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_refresh_callback), (gpointer)palette);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (refresh_button), 9);
|
||||
}
|
||||
else
|
||||
{
|
||||
refresh_button = gtk_button_new_with_label (_("Edit"));
|
||||
gtk_signal_connect(GTK_OBJECT(refresh_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_edit_palette_callback), (gpointer)palette);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (refresh_button), 9);
|
||||
}
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (refresh_button, GTK_CAN_DEFAULT);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), close_button);
|
||||
gtk_widget_show (close_button);
|
||||
|
||||
gtk_widget_realize(palette->shell);
|
||||
palette->gc = gdk_gc_new(palette->shell->window);
|
||||
|
||||
|
|
|
@ -30,10 +30,14 @@ tips_dialog_create ()
|
|||
GtkWidget *vbox;
|
||||
GtkWidget *hbox1;
|
||||
GtkWidget *hbox2;
|
||||
GtkWidget *bbox;
|
||||
GtkWidget *vbox_bbox2;
|
||||
GtkWidget *bbox2;
|
||||
GtkWidget *preview;
|
||||
GtkWidget *button_close;
|
||||
GtkWidget *button_next;
|
||||
GtkWidget *button_prev;
|
||||
GtkWidget *vbox_check;
|
||||
GtkWidget *button_check;
|
||||
guchar * temp;
|
||||
guchar * src;
|
||||
|
@ -81,6 +85,18 @@ tips_dialog_create ()
|
|||
gtk_container_set_border_width (GTK_CONTAINER (hbox2), 10);
|
||||
gtk_box_pack_end (GTK_BOX (vbox), hbox2, FALSE, TRUE, 0);
|
||||
gtk_widget_show (hbox2);
|
||||
|
||||
bbox = gtk_hbutton_box_new ();
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), bbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (bbox);
|
||||
|
||||
vbox_bbox2 = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), vbox_bbox2, FALSE, FALSE, 15);
|
||||
gtk_widget_show (vbox_bbox2);
|
||||
|
||||
bbox2 = gtk_hbox_new (TRUE, 5);
|
||||
gtk_box_pack_end (GTK_BOX (vbox_bbox2), bbox2, TRUE, FALSE, 0);
|
||||
gtk_widget_show(bbox2);
|
||||
|
||||
preview = gtk_preview_new (GTK_PREVIEW_COLOR);
|
||||
gtk_preview_size (GTK_PREVIEW (preview), wilber_width, wilber_height);
|
||||
|
@ -106,33 +122,41 @@ tips_dialog_create ()
|
|||
gtk_box_pack_start (GTK_BOX (hbox1), tips_label, TRUE, TRUE, 3);
|
||||
gtk_widget_show (tips_label);
|
||||
|
||||
button_close = gtk_button_new_with_label (_("Close"));
|
||||
gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_dialog_hide), NULL);
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_close, FALSE, TRUE, 0);
|
||||
gtk_widget_show (button_close);
|
||||
|
||||
button_next = gtk_button_new_with_label (_("Next Tip"));
|
||||
gtk_signal_connect (GTK_OBJECT (button_next), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "next");
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_next, FALSE, TRUE, 0);
|
||||
gtk_widget_show (button_next);
|
||||
|
||||
button_prev = gtk_button_new_with_label (_("Prev. Tip"));
|
||||
button_prev = gtk_button_new_with_label (_("Previous Tip"));
|
||||
GTK_WIDGET_UNSET_FLAGS (button_prev, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_prev), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "prev");
|
||||
gtk_box_pack_end (GTK_BOX (hbox2), button_prev, FALSE, TRUE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (bbox2), button_prev);
|
||||
gtk_widget_show (button_prev);
|
||||
|
||||
button_next = gtk_button_new_with_label (_("Next Tip"));
|
||||
GTK_WIDGET_UNSET_FLAGS (button_next, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_next), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_show_next),
|
||||
(gpointer) "next");
|
||||
gtk_container_add (GTK_CONTAINER (bbox2), button_next);
|
||||
gtk_widget_show (button_next);
|
||||
|
||||
button_close = gtk_button_new_with_label (_("Close"));
|
||||
GTK_WIDGET_SET_FLAGS (button_close, GTK_CAN_DEFAULT);
|
||||
gtk_window_set_default (GTK_WINDOW (tips_dialog), button_close);
|
||||
gtk_signal_connect (GTK_OBJECT (button_close), "clicked",
|
||||
GTK_SIGNAL_FUNC (tips_dialog_hide), NULL);
|
||||
gtk_container_add (GTK_CONTAINER (bbox), button_close);
|
||||
gtk_widget_show (button_close);
|
||||
|
||||
vbox_check = gtk_vbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), vbox_check, FALSE, TRUE, 0);
|
||||
gtk_widget_show (vbox_check);
|
||||
|
||||
button_check = gtk_check_button_new_with_label (_("Show tip next time"));
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button_check),
|
||||
show_tips);
|
||||
gtk_signal_connect (GTK_OBJECT (button_check), "toggled",
|
||||
GTK_SIGNAL_FUNC (tips_toggle_update),
|
||||
(gpointer) &show_tips);
|
||||
gtk_box_pack_start (GTK_BOX (hbox2), button_check, FALSE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox_check), button_check, TRUE, FALSE, 0);
|
||||
gtk_widget_show (button_check);
|
||||
|
||||
old_show_tips = show_tips;
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
/* XPM */
|
||||
static char * zoom_in_xpm[] = {
|
||||
"20 19 3 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #7F7F7F",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" . ",
|
||||
" .+ ",
|
||||
" .+ ",
|
||||
" .+ ",
|
||||
" .+ ",
|
||||
" ........... ",
|
||||
" ++++.++++++ ",
|
||||
" .+ ",
|
||||
" .+ ",
|
||||
" .+ ",
|
||||
" .+ ",
|
||||
" + ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
|
@ -0,0 +1,26 @@
|
|||
/* XPM */
|
||||
static char * zoom_out_xpm[] = {
|
||||
"20 20 3 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #7F7F7F",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ........... ",
|
||||
" +++++++++++ ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
|
@ -49,6 +49,9 @@
|
|||
#include "palette_select.h"
|
||||
#include "dialog_handler.h"
|
||||
|
||||
#include "tools/zoom_in.xpm"
|
||||
#include "tools/zoom_out.xpm"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
#define ENTRY_WIDTH 12
|
||||
|
@ -2136,10 +2139,7 @@ redraw_palette(PaletteP palette)
|
|||
if (n_entries % palette->columns)
|
||||
nrows += 1;
|
||||
|
||||
vsize = nrows*(SPACING + (gint)(ENTRY_HEIGHT*palette->zoom_factor))+1;
|
||||
|
||||
if(vsize < PREVIEW_HEIGHT)
|
||||
vsize = PREVIEW_HEIGHT;
|
||||
vsize = nrows*(SPACING + (gint)(ENTRY_HEIGHT*palette->zoom_factor))+SPACING;
|
||||
|
||||
parent = palette->color_area->parent;
|
||||
gtk_widget_ref(palette->color_area);
|
||||
|
@ -2147,7 +2147,7 @@ redraw_palette(PaletteP palette)
|
|||
|
||||
new_pre_width = (gint)(ENTRY_WIDTH*palette->zoom_factor);
|
||||
new_pre_width = (new_pre_width+SPACING)*palette->columns+SPACING;
|
||||
|
||||
|
||||
gtk_preview_size(GTK_PREVIEW(palette->color_area),
|
||||
new_pre_width, /*PREVIEW_WIDTH,*/
|
||||
vsize);
|
||||
|
@ -2234,6 +2234,7 @@ create_palette_dialog (gint vert)
|
|||
GtkWidget *dialog_vbox3;
|
||||
GtkWidget *hbox3;
|
||||
GtkWidget *hbox4;
|
||||
GtkWidget *hbox5;
|
||||
GtkWidget *vbox4;
|
||||
GtkWidget *palette_scrolledwindow;
|
||||
GtkWidget *palette_region;
|
||||
|
@ -2253,10 +2254,14 @@ create_palette_dialog (gint vert)
|
|||
GtkWidget *close_button;
|
||||
GtkWidget *refresh_button;
|
||||
GtkWidget *clist_scrolledwindow;
|
||||
GtkWidget *plus_button;
|
||||
GtkWidget *minus_button;
|
||||
PaletteP palette;
|
||||
GdkColormap *colormap;
|
||||
GtkWidget* button_plus;
|
||||
GtkWidget* button_minus;
|
||||
GtkWidget* pixmapwid;
|
||||
GdkPixmap* pixmap;
|
||||
GdkBitmap* mask;
|
||||
GtkStyle* style;
|
||||
|
||||
palette = g_malloc (sizeof (_Palette));
|
||||
|
||||
|
@ -2358,18 +2363,38 @@ create_palette_dialog (gint vert)
|
|||
palette);
|
||||
|
||||
/* + and - buttons */
|
||||
plus_button = gtk_button_new_with_label ("+");
|
||||
minus_button = gtk_button_new_with_label ("-");
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), minus_button, TRUE, TRUE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), plus_button, TRUE, TRUE, 0);
|
||||
gtk_widget_show(plus_button);
|
||||
gtk_widget_show(minus_button);
|
||||
gtk_signal_connect (GTK_OBJECT (plus_button), "clicked",
|
||||
(GtkSignalFunc) palette_zoomin,
|
||||
(gpointer) palette);
|
||||
gtk_signal_connect (GTK_OBJECT (minus_button), "clicked",
|
||||
(GtkSignalFunc) palette_zoomout,
|
||||
(gpointer) palette);
|
||||
style = gtk_widget_get_style(palette_dialog);
|
||||
gtk_widget_realize(palette_dialog);
|
||||
|
||||
button_plus = gtk_button_new ();
|
||||
GTK_WIDGET_UNSET_FLAGS (button_plus, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_plus), "clicked",
|
||||
GTK_SIGNAL_FUNC (palette_zoomin), (gpointer) palette);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), button_plus, FALSE, FALSE, 0);
|
||||
|
||||
button_minus = gtk_button_new ();
|
||||
GTK_WIDGET_UNSET_FLAGS (button_minus, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (button_minus), "clicked",
|
||||
GTK_SIGNAL_FUNC (palette_zoomout), (gpointer) palette);
|
||||
gtk_box_pack_start (GTK_BOX (hbox4), button_minus, FALSE, FALSE, 0);
|
||||
|
||||
pixmap = gdk_pixmap_create_from_xpm_d(palette_dialog->window, &mask,
|
||||
&style->bg[GTK_STATE_NORMAL],
|
||||
zoom_in_xpm);
|
||||
pixmapwid = gtk_pixmap_new(pixmap, mask);
|
||||
gtk_container_add (GTK_CONTAINER (button_plus), pixmapwid);
|
||||
gtk_widget_show (pixmapwid);
|
||||
|
||||
pixmap = gdk_pixmap_create_from_xpm_d(palette_dialog->window, &mask,
|
||||
&style->bg[GTK_STATE_NORMAL],
|
||||
zoom_out_xpm);
|
||||
pixmapwid = gtk_pixmap_new(pixmap, mask);
|
||||
gtk_container_add (GTK_CONTAINER (button_minus), pixmapwid);
|
||||
gtk_widget_show (pixmapwid);
|
||||
|
||||
gtk_widget_show (button_plus);
|
||||
gtk_widget_show (button_minus);
|
||||
|
||||
|
||||
/* clist preview of palettes */
|
||||
clist_scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
|
||||
|
@ -2438,6 +2463,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (vbuttonbox2), 17, 0);
|
||||
|
||||
new_palette = gtk_button_new_with_label (_("New"));
|
||||
GTK_WIDGET_UNSET_FLAGS (new_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (new_palette), "clicked",
|
||||
(GtkSignalFunc) palette_new_entries_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2446,6 +2472,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), new_palette);
|
||||
|
||||
delete_palette = gtk_button_new_with_label (_("Delete"));
|
||||
GTK_WIDGET_UNSET_FLAGS (delete_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (delete_palette), "clicked",
|
||||
(GtkSignalFunc) palette_delete_entries_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2453,6 +2480,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), delete_palette);
|
||||
|
||||
save_palettes = gtk_button_new_with_label (_("Save"));
|
||||
GTK_WIDGET_UNSET_FLAGS (save_palettes, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (save_palettes), "clicked",
|
||||
(GtkSignalFunc) palette_save_palettes_callback,
|
||||
(gpointer) NULL);
|
||||
|
@ -2460,6 +2488,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), save_palettes);
|
||||
|
||||
import_palette = gtk_button_new_with_label (_("Import"));
|
||||
GTK_WIDGET_UNSET_FLAGS (import_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (import_palette), "clicked",
|
||||
(GtkSignalFunc) palette_import_dialog_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2467,6 +2496,7 @@ create_palette_dialog (gint vert)
|
|||
gtk_container_add (GTK_CONTAINER (vbuttonbox2), import_palette);
|
||||
|
||||
merge_palette = gtk_button_new_with_label (_("Merge"));
|
||||
GTK_WIDGET_UNSET_FLAGS (merge_palette, GTK_RECEIVES_DEFAULT);
|
||||
gtk_signal_connect (GTK_OBJECT (merge_palette), "clicked",
|
||||
(GtkSignalFunc) palette_merge_dialog_callback,
|
||||
(gpointer) palette);
|
||||
|
@ -2483,47 +2513,45 @@ create_palette_dialog (gint vert)
|
|||
gtk_widget_show (alignment2);
|
||||
gtk_box_pack_start (GTK_BOX (dialog_action_area3), alignment2, TRUE, TRUE, 0);
|
||||
|
||||
hbox5 = gtk_hbox_new (FALSE, 0);
|
||||
gtk_container_add (GTK_CONTAINER (alignment2), hbox5);
|
||||
gtk_widget_show (hbox5);
|
||||
|
||||
hbuttonbox3 = gtk_hbutton_box_new ();
|
||||
gtk_object_set_data (GTK_OBJECT (palette_dialog), "hbuttonbox3", hbuttonbox3);
|
||||
gtk_widget_show (hbuttonbox3);
|
||||
gtk_container_add (GTK_CONTAINER (alignment2), hbuttonbox3);
|
||||
gtk_widget_set_usize (hbuttonbox3, 153, 37);
|
||||
gtk_container_border_width (GTK_CONTAINER (hbuttonbox3), 8);
|
||||
gtk_button_box_set_child_size (GTK_BUTTON_BOX (hbuttonbox3), 85, 26);
|
||||
gtk_button_box_set_child_ipadding (GTK_BUTTON_BOX (hbuttonbox3), 4, 0);
|
||||
gtk_box_pack_end (GTK_BOX(hbox5), hbuttonbox3, FALSE, FALSE, 0);
|
||||
gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox3), 4);
|
||||
|
||||
close_button = gtk_button_new_with_label (_("Close"));
|
||||
gtk_signal_connect(GTK_OBJECT(close_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_close_callback), (gpointer)palette);
|
||||
|
||||
gtk_widget_show (close_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), close_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (close_button), 4);
|
||||
GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_DEFAULT);
|
||||
gtk_widget_grab_default (close_button);
|
||||
gtk_signal_connect (GTK_OBJECT (palette->shell), "delete_event",
|
||||
GTK_SIGNAL_FUNC (palette_dialog_delete_callback),
|
||||
palette);
|
||||
|
||||
close_button = gtk_button_new_with_label (_("Close"));
|
||||
GTK_WIDGET_SET_FLAGS (close_button, GTK_CAN_DEFAULT);
|
||||
gtk_window_set_default (GTK_WINDOW (palette->shell), close_button);
|
||||
gtk_signal_connect(GTK_OBJECT(close_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_close_callback), (gpointer)palette);
|
||||
|
||||
if(!vert)
|
||||
{
|
||||
refresh_button = gtk_button_new_with_label (_("refresh"));
|
||||
refresh_button = gtk_button_new_with_label (_("Refresh"));
|
||||
gtk_signal_connect(GTK_OBJECT(refresh_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_refresh_callback), (gpointer)palette);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (refresh_button), 9);
|
||||
}
|
||||
else
|
||||
{
|
||||
refresh_button = gtk_button_new_with_label (_("Edit"));
|
||||
gtk_signal_connect(GTK_OBJECT(refresh_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(palette_edit_palette_callback), (gpointer)palette);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_container_border_width (GTK_CONTAINER (refresh_button), 9);
|
||||
}
|
||||
|
||||
GTK_WIDGET_SET_FLAGS (refresh_button, GTK_CAN_DEFAULT);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), refresh_button);
|
||||
gtk_widget_show (refresh_button);
|
||||
gtk_container_add (GTK_CONTAINER (hbuttonbox3), close_button);
|
||||
gtk_widget_show (close_button);
|
||||
|
||||
gtk_widget_realize(palette->shell);
|
||||
palette->gc = gdk_gc_new(palette->shell->window);
|
||||
|
||||
|
|
34
app/xcf.c
34
app/xcf.c
|
@ -38,6 +38,7 @@
|
|||
#include <libgimp/parasiteP.h>
|
||||
#include <libgimp/parasite.h>
|
||||
#include "parasitelist.h"
|
||||
#include <libgimp/gimpunit.h>
|
||||
|
||||
/* #define SWAP_FROM_FILE */
|
||||
|
||||
|
@ -65,7 +66,8 @@ typedef enum
|
|||
PROP_GUIDES = 18,
|
||||
PROP_RESOLUTION = 19,
|
||||
PROP_TATTOO = 20,
|
||||
PROP_PARASITES = 21
|
||||
PROP_PARASITES = 21,
|
||||
PROP_UNIT = 22
|
||||
} PropType;
|
||||
|
||||
typedef enum
|
||||
|
@ -608,6 +610,8 @@ xcf_save_image_props (XcfInfo *info,
|
|||
if (parasite_list_length(gimage->parasites) > 0)
|
||||
xcf_save_prop (info, PROP_PARASITES, gimage->parasites);
|
||||
|
||||
xcf_save_prop (info, PROP_UNIT, gimage->unit);
|
||||
|
||||
xcf_save_prop (info, PROP_END);
|
||||
}
|
||||
|
||||
|
@ -968,6 +972,19 @@ xcf_save_prop (XcfInfo *info,
|
|||
}
|
||||
}
|
||||
break;
|
||||
case PROP_UNIT:
|
||||
{
|
||||
guint32 unit;
|
||||
|
||||
unit = va_arg (args, guint32);
|
||||
|
||||
size = 4;
|
||||
|
||||
info->cp += xcf_write_int32 (info->fp, (guint32*) &prop_type, 1);
|
||||
info->cp += xcf_write_int32 (info->fp, &size, 1);
|
||||
info->cp += xcf_write_int32 (info->fp, &unit, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
va_end (args);
|
||||
|
@ -1597,6 +1614,21 @@ xcf_load_image_props (XcfInfo *info,
|
|||
g_message(_("Error detected while loading an image's parasites"));
|
||||
}
|
||||
break;
|
||||
case PROP_UNIT:
|
||||
{
|
||||
guint32 unit;
|
||||
|
||||
info->cp += xcf_read_int32 (info->fp, &unit, 1);
|
||||
|
||||
if ( (unit < 0) || (unit >= gimp_unit_get_number_of_units()) )
|
||||
{
|
||||
g_message(_("Warning, unit out of range in XCF file, falling back to pixels"));
|
||||
unit = UNIT_PIXEL;
|
||||
}
|
||||
|
||||
gimage->unit = unit;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_message (_("unexpected/unknown image property: %d (skipping)"), prop_type);
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
#include <libgimp/parasiteP.h>
|
||||
#include <libgimp/parasite.h>
|
||||
#include "parasitelist.h"
|
||||
#include <libgimp/gimpunit.h>
|
||||
|
||||
/* #define SWAP_FROM_FILE */
|
||||
|
||||
|
@ -65,7 +66,8 @@ typedef enum
|
|||
PROP_GUIDES = 18,
|
||||
PROP_RESOLUTION = 19,
|
||||
PROP_TATTOO = 20,
|
||||
PROP_PARASITES = 21
|
||||
PROP_PARASITES = 21,
|
||||
PROP_UNIT = 22
|
||||
} PropType;
|
||||
|
||||
typedef enum
|
||||
|
@ -608,6 +610,8 @@ xcf_save_image_props (XcfInfo *info,
|
|||
if (parasite_list_length(gimage->parasites) > 0)
|
||||
xcf_save_prop (info, PROP_PARASITES, gimage->parasites);
|
||||
|
||||
xcf_save_prop (info, PROP_UNIT, gimage->unit);
|
||||
|
||||
xcf_save_prop (info, PROP_END);
|
||||
}
|
||||
|
||||
|
@ -968,6 +972,19 @@ xcf_save_prop (XcfInfo *info,
|
|||
}
|
||||
}
|
||||
break;
|
||||
case PROP_UNIT:
|
||||
{
|
||||
guint32 unit;
|
||||
|
||||
unit = va_arg (args, guint32);
|
||||
|
||||
size = 4;
|
||||
|
||||
info->cp += xcf_write_int32 (info->fp, (guint32*) &prop_type, 1);
|
||||
info->cp += xcf_write_int32 (info->fp, &size, 1);
|
||||
info->cp += xcf_write_int32 (info->fp, &unit, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
va_end (args);
|
||||
|
@ -1597,6 +1614,21 @@ xcf_load_image_props (XcfInfo *info,
|
|||
g_message(_("Error detected while loading an image's parasites"));
|
||||
}
|
||||
break;
|
||||
case PROP_UNIT:
|
||||
{
|
||||
guint32 unit;
|
||||
|
||||
info->cp += xcf_read_int32 (info->fp, &unit, 1);
|
||||
|
||||
if ( (unit < 0) || (unit >= gimp_unit_get_number_of_units()) )
|
||||
{
|
||||
g_message(_("Warning, unit out of range in XCF file, falling back to pixels"));
|
||||
unit = UNIT_PIXEL;
|
||||
}
|
||||
|
||||
gimage->unit = unit;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_message (_("unexpected/unknown image property: %d (skipping)"), prop_type);
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@ libgimpi_a_SOURCES = \
|
|||
gimpmatrix.h \
|
||||
gimpprotocol.c \
|
||||
gimpprotocol.h \
|
||||
gimpunit.c \
|
||||
gimpunit.h \
|
||||
gimpwire.c \
|
||||
gimpwire.h \
|
||||
gserialize.c \
|
||||
|
@ -79,6 +81,7 @@ gimpinclude_HEADERS = \
|
|||
gimpmenu.h \
|
||||
gimpmodule.h \
|
||||
gimpui.h \
|
||||
gimpunit.h \
|
||||
gimpintl.h \
|
||||
gserialize.h \
|
||||
parasite.h \
|
||||
|
|
|
@ -0,0 +1,114 @@
|
|||
/* gimpunit.c
|
||||
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gimpunit.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
/* internal structures */
|
||||
|
||||
typedef struct {
|
||||
float factor;
|
||||
gint digits;
|
||||
gchar *symbol;
|
||||
gchar *abbreviation;
|
||||
gchar *singular;
|
||||
gchar *plural;
|
||||
} GimpUnitDef;
|
||||
|
||||
static GimpUnitDef gimp_unit_defs[UNIT_END] =
|
||||
{
|
||||
/* 'pseudo' unit */
|
||||
{ 0.0, 0, "px", "px", N_("pixel"), N_("pixels") },
|
||||
|
||||
/* 'standard' units */
|
||||
{ 1.0, 2, "''", "in", N_("inch"), N_("inches") },
|
||||
{ 2.54, 2, "cm", "cm", N_("centimeter"), N_("centimeters") },
|
||||
|
||||
/* 'professional' units */
|
||||
{ 72.0, 0, "pt", "pt", N_("point"), N_("points") },
|
||||
{ 6.0, 1, "pc", "pc", N_("pica"), N_("picas") },
|
||||
|
||||
/* convenience units */
|
||||
{ 25.4, 1, "mm", "mm", N_("millimeter"), N_("millimeters") },
|
||||
{ 0.0254, 4, "m", "m", N_("meter"), N_("meters") },
|
||||
{ 1.0/12.0, 4, "'", "ft", N_("foot"), N_("feet") },
|
||||
{ 1.0/36.0, 4, "yd", "yd", N_("yard"), N_("yards") }
|
||||
};
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
gfloat
|
||||
gimp_unit_get_factor (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].factor );
|
||||
|
||||
return gimp_unit_defs[unit].factor;
|
||||
}
|
||||
|
||||
|
||||
gint
|
||||
gimp_unit_get_digits (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].digits );
|
||||
|
||||
return gimp_unit_defs[unit].digits;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_symbol (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].symbol );
|
||||
|
||||
return gimp_unit_defs[unit].symbol;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_abbreviation (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].abbreviation );
|
||||
|
||||
return gimp_unit_defs[unit].abbreviation;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_singular (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gettext(gimp_unit_defs[UNIT_INCH].singular) );
|
||||
|
||||
return gettext(gimp_unit_defs[unit].singular);
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_plural (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gettext(gimp_unit_defs[UNIT_INCH].plural) );
|
||||
|
||||
return gettext(gimp_unit_defs[unit].plural);
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
/* gimpunit.h
|
||||
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMPUNIT_H__
|
||||
#define __GIMPUNIT_H__
|
||||
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* I've put this here and not to libgimp/gimpenums.h, because if this
|
||||
* file includes libgimp/gimpenums.h there is a name clash wherever
|
||||
* someone includes libgimp/gimpunit.h and app/gimpimage.h
|
||||
* (the constants RGB, GRAY and INDEXED are defined in both
|
||||
* gimpenums.h and gimpimage.h) (is this a bug? don't know...)
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
UNIT_PIXEL = 0,
|
||||
UNIT_INCH = 1,
|
||||
UNIT_CM = 2,
|
||||
UNIT_POINT = 3,
|
||||
UNIT_PICA = 4,
|
||||
UNIT_MM = 5,
|
||||
UNIT_METER = 6,
|
||||
UNIT_FOOT = 7,
|
||||
UNIT_YARD = 8,
|
||||
UNIT_END
|
||||
} GUnit;
|
||||
|
||||
|
||||
#define gimp_unit_get_number_of_units() UNIT_END
|
||||
|
||||
/* the following functions fall back to inch (not pixel, as pixel is not
|
||||
* a 'real' unit) if the value passed is out of range
|
||||
*/
|
||||
|
||||
/* the meaning of 'factor' is:
|
||||
* distance_in_units == ( factor * distance_in_inches )
|
||||
*
|
||||
* returns 0 for unit == UNIT_PIXEL as we don't have resolution info here
|
||||
*/
|
||||
gfloat gimp_unit_get_factor (GUnit unit);
|
||||
|
||||
/* the following function gives a hint how many digits a spinbutton
|
||||
* should provide to get approximately the accuracy of an inch-spinbutton
|
||||
* with two digits.
|
||||
*
|
||||
* returns 0 for unit == UNIT_PIXEL as we don't have resolution info here
|
||||
*/
|
||||
gint gimp_unit_get_digits (GUnit unit);
|
||||
|
||||
const gchar * gimp_unit_get_symbol (GUnit unit);
|
||||
const gchar * gimp_unit_get_abbreviation (GUnit unit);
|
||||
const gchar * gimp_unit_get_singular (GUnit unit);
|
||||
const gchar * gimp_unit_get_plural (GUnit unit);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMPUNIT_H__ */
|
|
@ -0,0 +1,114 @@
|
|||
/* gimpunit.c
|
||||
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gimpunit.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
/* internal structures */
|
||||
|
||||
typedef struct {
|
||||
float factor;
|
||||
gint digits;
|
||||
gchar *symbol;
|
||||
gchar *abbreviation;
|
||||
gchar *singular;
|
||||
gchar *plural;
|
||||
} GimpUnitDef;
|
||||
|
||||
static GimpUnitDef gimp_unit_defs[UNIT_END] =
|
||||
{
|
||||
/* 'pseudo' unit */
|
||||
{ 0.0, 0, "px", "px", N_("pixel"), N_("pixels") },
|
||||
|
||||
/* 'standard' units */
|
||||
{ 1.0, 2, "''", "in", N_("inch"), N_("inches") },
|
||||
{ 2.54, 2, "cm", "cm", N_("centimeter"), N_("centimeters") },
|
||||
|
||||
/* 'professional' units */
|
||||
{ 72.0, 0, "pt", "pt", N_("point"), N_("points") },
|
||||
{ 6.0, 1, "pc", "pc", N_("pica"), N_("picas") },
|
||||
|
||||
/* convenience units */
|
||||
{ 25.4, 1, "mm", "mm", N_("millimeter"), N_("millimeters") },
|
||||
{ 0.0254, 4, "m", "m", N_("meter"), N_("meters") },
|
||||
{ 1.0/12.0, 4, "'", "ft", N_("foot"), N_("feet") },
|
||||
{ 1.0/36.0, 4, "yd", "yd", N_("yard"), N_("yards") }
|
||||
};
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
gfloat
|
||||
gimp_unit_get_factor (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].factor );
|
||||
|
||||
return gimp_unit_defs[unit].factor;
|
||||
}
|
||||
|
||||
|
||||
gint
|
||||
gimp_unit_get_digits (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].digits );
|
||||
|
||||
return gimp_unit_defs[unit].digits;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_symbol (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].symbol );
|
||||
|
||||
return gimp_unit_defs[unit].symbol;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_abbreviation (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].abbreviation );
|
||||
|
||||
return gimp_unit_defs[unit].abbreviation;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_singular (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gettext(gimp_unit_defs[UNIT_INCH].singular) );
|
||||
|
||||
return gettext(gimp_unit_defs[unit].singular);
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_plural (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gettext(gimp_unit_defs[UNIT_INCH].plural) );
|
||||
|
||||
return gettext(gimp_unit_defs[unit].plural);
|
||||
}
|
|
@ -0,0 +1,114 @@
|
|||
/* gimpunit.c
|
||||
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "gimpunit.h"
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
/* internal structures */
|
||||
|
||||
typedef struct {
|
||||
float factor;
|
||||
gint digits;
|
||||
gchar *symbol;
|
||||
gchar *abbreviation;
|
||||
gchar *singular;
|
||||
gchar *plural;
|
||||
} GimpUnitDef;
|
||||
|
||||
static GimpUnitDef gimp_unit_defs[UNIT_END] =
|
||||
{
|
||||
/* 'pseudo' unit */
|
||||
{ 0.0, 0, "px", "px", N_("pixel"), N_("pixels") },
|
||||
|
||||
/* 'standard' units */
|
||||
{ 1.0, 2, "''", "in", N_("inch"), N_("inches") },
|
||||
{ 2.54, 2, "cm", "cm", N_("centimeter"), N_("centimeters") },
|
||||
|
||||
/* 'professional' units */
|
||||
{ 72.0, 0, "pt", "pt", N_("point"), N_("points") },
|
||||
{ 6.0, 1, "pc", "pc", N_("pica"), N_("picas") },
|
||||
|
||||
/* convenience units */
|
||||
{ 25.4, 1, "mm", "mm", N_("millimeter"), N_("millimeters") },
|
||||
{ 0.0254, 4, "m", "m", N_("meter"), N_("meters") },
|
||||
{ 1.0/12.0, 4, "'", "ft", N_("foot"), N_("feet") },
|
||||
{ 1.0/36.0, 4, "yd", "yd", N_("yard"), N_("yards") }
|
||||
};
|
||||
|
||||
|
||||
/* public functions */
|
||||
|
||||
gfloat
|
||||
gimp_unit_get_factor (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].factor );
|
||||
|
||||
return gimp_unit_defs[unit].factor;
|
||||
}
|
||||
|
||||
|
||||
gint
|
||||
gimp_unit_get_digits (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].digits );
|
||||
|
||||
return gimp_unit_defs[unit].digits;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_symbol (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].symbol );
|
||||
|
||||
return gimp_unit_defs[unit].symbol;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_abbreviation (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gimp_unit_defs[UNIT_INCH].abbreviation );
|
||||
|
||||
return gimp_unit_defs[unit].abbreviation;
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_singular (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gettext(gimp_unit_defs[UNIT_INCH].singular) );
|
||||
|
||||
return gettext(gimp_unit_defs[unit].singular);
|
||||
}
|
||||
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_plural (GUnit unit)
|
||||
{
|
||||
g_return_val_if_fail ( (unit >= UNIT_PIXEL) && (unit < UNIT_END),
|
||||
gettext(gimp_unit_defs[UNIT_INCH].plural) );
|
||||
|
||||
return gettext(gimp_unit_defs[unit].plural);
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
/* gimpunit.h
|
||||
* Copyright (C) 1999 Michael Natterer <mitschel@cs.tu-berlin.de>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMPUNIT_H__
|
||||
#define __GIMPUNIT_H__
|
||||
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
|
||||
/* I've put this here and not to libgimp/gimpenums.h, because if this
|
||||
* file includes libgimp/gimpenums.h there is a name clash wherever
|
||||
* someone includes libgimp/gimpunit.h and app/gimpimage.h
|
||||
* (the constants RGB, GRAY and INDEXED are defined in both
|
||||
* gimpenums.h and gimpimage.h) (is this a bug? don't know...)
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
UNIT_PIXEL = 0,
|
||||
UNIT_INCH = 1,
|
||||
UNIT_CM = 2,
|
||||
UNIT_POINT = 3,
|
||||
UNIT_PICA = 4,
|
||||
UNIT_MM = 5,
|
||||
UNIT_METER = 6,
|
||||
UNIT_FOOT = 7,
|
||||
UNIT_YARD = 8,
|
||||
UNIT_END
|
||||
} GUnit;
|
||||
|
||||
|
||||
#define gimp_unit_get_number_of_units() UNIT_END
|
||||
|
||||
/* the following functions fall back to inch (not pixel, as pixel is not
|
||||
* a 'real' unit) if the value passed is out of range
|
||||
*/
|
||||
|
||||
/* the meaning of 'factor' is:
|
||||
* distance_in_units == ( factor * distance_in_inches )
|
||||
*
|
||||
* returns 0 for unit == UNIT_PIXEL as we don't have resolution info here
|
||||
*/
|
||||
gfloat gimp_unit_get_factor (GUnit unit);
|
||||
|
||||
/* the following function gives a hint how many digits a spinbutton
|
||||
* should provide to get approximately the accuracy of an inch-spinbutton
|
||||
* with two digits.
|
||||
*
|
||||
* returns 0 for unit == UNIT_PIXEL as we don't have resolution info here
|
||||
*/
|
||||
gint gimp_unit_get_digits (GUnit unit);
|
||||
|
||||
const gchar * gimp_unit_get_symbol (GUnit unit);
|
||||
const gchar * gimp_unit_get_abbreviation (GUnit unit);
|
||||
const gchar * gimp_unit_get_singular (GUnit unit);
|
||||
const gchar * gimp_unit_get_plural (GUnit unit);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GIMPUNIT_H__ */
|
Loading…
Reference in New Issue