From b1af71cf86662b728836abbb230c544e33e813d0 Mon Sep 17 00:00:00 2001 From: GMT 1999 Austin Donnelly Date: Mon, 25 Jan 1999 21:11:44 +0000 Subject: [PATCH] create modules/ directory in user's ~/.gimp-1.1 dir include description of Mon Jan 25 20:40:26 GMT 1999 Austin Donnelly * user_install: create modules/ directory in user's ~/.gimp-1.1 dir * app/install.c: include description of ~/.gimp-1.1/modules, plus scroll info back to top when done inserting text since it looks nicer. Also make window that holds result of running user_install a little larger so we see all messages at once. * app/gdisplay.h: FUNSCALE_{X,Y} macros for floating point unscales. * app/scale.c: show rulers in real-world units (inches/cm/pixels) if dot-for-dot is turned off, plus smoother ruler updates by using FUNSCALE so we don't jump in pixel steps at high magnification factors. * app/interface.c: don't set the ruler metrics for now - it's easier to do the calculations in pixels. Need to rethink this a little anyway. * docs/parasites.txt: added jpeg parasite info. --- ChangeLog | 20 ++++++++ app/core/gimpprojection.h | 4 ++ app/dialogs/user-install-dialog.c | 23 ++++++++-- app/display/gimpdisplay-scale.c | 69 ++++++++++++++++++++++------ app/display/gimpdisplay.h | 4 ++ app/display/gimpdisplayshell-draw.c | 7 ++- app/display/gimpdisplayshell-scale.c | 69 ++++++++++++++++++++++------ app/display/gimpdisplayshell.c | 7 ++- app/gdisplay.h | 4 ++ app/gui/user-install-dialog.c | 23 ++++++++-- app/install.c | 23 ++++++++-- app/interface.c | 7 ++- app/scale.c | 69 ++++++++++++++++++++++------ app/user_install.c | 23 ++++++++-- data/misc/user_install | 2 + docs/parasites.txt | 10 +++- user_install | 2 + 17 files changed, 304 insertions(+), 62 deletions(-) diff --git a/ChangeLog b/ChangeLog index b99807d26b..e9a69775d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +Mon Jan 25 20:40:26 GMT 1999 Austin Donnelly + + * user_install: create modules/ directory in user's ~/.gimp-1.1 dir + * app/install.c: include description of ~/.gimp-1.1/modules, plus + scroll info back to top when done inserting text since it + looks nicer. Also make window that holds result of running + user_install a little larger so we see all messages at once. + + * app/gdisplay.h: FUNSCALE_{X,Y} macros for floating point + unscales. + * app/scale.c: show rulers in real-world units (inches/cm/pixels) + if dot-for-dot is turned off, plus smoother ruler updates by + using FUNSCALE so we don't jump in pixel steps at high + magnification factors. + * app/interface.c: don't set the ruler metrics for now - it's + easier to do the calculations in pixels. Need to rethink this + a little anyway. + + * docs/parasites.txt: added jpeg parasite info. + Sat Jan 23 20:36:06 GMT 1999 Austin Donnelly * app/color_select.c: don't try and gdk_window_get_size() when we diff --git a/app/core/gimpprojection.h b/app/core/gimpprojection.h index 1245c7bb3c..9295c21d1e 100644 --- a/app/core/gimpprojection.h +++ b/app/core/gimpprojection.h @@ -52,6 +52,10 @@ /* unscale values */ #define UNSCALEX(g,x) ((int)(x / SCALEFACTOR_X(g))) #define UNSCALEY(g,y) ((int)(y / SCALEFACTOR_Y(g))) +/* (and float-returning versions) */ +#define FUNSCALEX(g,x) ((x / SCALEFACTOR_X(g))) +#define FUNSCALEY(g,y) ((y / SCALEFACTOR_Y(g))) + diff --git a/app/dialogs/user-install-dialog.c b/app/dialogs/user-install-dialog.c index aa11d6675b..7b8953f4f0 100644 --- a/app/dialogs/user-install-dialog.c +++ b/app/dialogs/user-install-dialog.c @@ -192,11 +192,11 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tPaths to search for brushes, palettes, gradients\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tpatterns, and plug-ins are also configured here.\n"), -1); + _("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("pluginrc\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tPlug-ins and extensions are extern programs run by\n"), -1); + _("\t\tPlug-ins and extensions are external programs run by\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tthe GIMP which provide additional functionality.\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -299,6 +299,18 @@ install_help (InstallCallback callback) _("\t\twide GIMP plug-in directories when searching for\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tplug-ins.\n"), -1); + gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, + _("modules\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThis subdirectory can be used to store user created,\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\ttemporary, or otherwise non-system-supported DLL modules. \n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThe default gimprc file checks this subdirectory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tin addition to the system-wide GIMP module directory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\twhen searching for modules to load when initialising.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("scripts\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -322,6 +334,9 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tGIMP sessions and can be destroyed with impunity.\n"), -1); + /* scroll back to the top */ + gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0); + gtk_widget_show (vsb); gtk_widget_show (text); gtk_widget_show (table); @@ -389,7 +404,7 @@ install_run (InstallCallback callback) vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); vsb = gtk_vscrollbar_new (vadj); text = gtk_text_new (NULL, vadj); - gtk_widget_set_usize (text, 384, 256); + gtk_widget_set_usize (text, 384, 356); table = gtk_table_new (1, 2, FALSE); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); @@ -447,6 +462,8 @@ install_run (InstallCallback callback) g_snprintf (buffer, sizeof(buffer), "%s/user_install %s %s", DATADIR, DATADIR, gimp_directory ()); + /* urk - should really use something better than popen(), since + * we can't tell if the installation script failed --austin */ if ((pfp = popen (buffer, "r")) != NULL) { while (fgets (buffer, 2048, pfp)) diff --git a/app/display/gimpdisplay-scale.c b/app/display/gimpdisplay-scale.c index cc61282514..bb82235283 100644 --- a/app/display/gimpdisplay-scale.c +++ b/app/display/gimpdisplay-scale.c @@ -158,6 +158,37 @@ change_scale (GDisplay *gdisp, } +/* scale image coord to realworld units (cm, inches, pixels) */ +static gdouble +img2real (GDisplay *g, gboolean xdir, gdouble a) +{ + float res; + + if (g->dot_for_dot) + return a; + + if (xdir) + res = monitor_xres; + else + res = monitor_yres; + + switch (ruler_units) { + case GTK_PIXELS: + return a; + + case GTK_INCHES: + return a / res; + + case GTK_CENTIMETERS: + return a * 2.54 / res; + + default: + g_warning ("unknown ruler_units %d, can't happen", ruler_units); + return a; + } +} + + void setup_scale (GDisplay *gdisp) { @@ -168,8 +199,8 @@ setup_scale (GDisplay *gdisp) sx = SCALEX(gdisp, gdisp->gimage->width); sy = SCALEY(gdisp, gdisp->gimage->height); - stepx = SCALEX(gdisp, 1); - stepy = SCALEY(gdisp, 1); + stepx = SCALEFACTOR_X(gdisp); + stepy = SCALEFACTOR_Y(gdisp); gdisp->hsbdata->value = gdisp->offset_x; gdisp->hsbdata->upper = sx; @@ -190,37 +221,47 @@ setup_scale (GDisplay *gdisp) vruler = GTK_RULER (gdisp->vrule); hruler->lower = 0; - hruler->upper = UNSCALEX (gdisp, gdisp->disp_width); - hruler->max_size = MAXIMUM (gdisp->gimage->width, gdisp->gimage->height); + hruler->upper = img2real (gdisp, TRUE, FUNSCALEX (gdisp, gdisp->disp_width)); + hruler->max_size = img2real (gdisp, TRUE, MAXIMUM (gdisp->gimage->width, + gdisp->gimage->height)); vruler->lower = 0; - vruler->upper = UNSCALEY (gdisp, gdisp->disp_height); - vruler->max_size = MAXIMUM (gdisp->gimage->width, gdisp->gimage->height); + vruler->upper = img2real(gdisp, FALSE, FUNSCALEY(gdisp, gdisp->disp_height)); + vruler->max_size = img2real (gdisp, FALSE, MAXIMUM (gdisp->gimage->width, + gdisp->gimage->height)); if (sx < gdisp->disp_width) { gdisp->disp_xoffset = (gdisp->disp_width - sx) / 2; - hruler->lower -= UNSCALEX (gdisp, (double) gdisp->disp_xoffset); - hruler->upper -= UNSCALEX (gdisp, (double) gdisp->disp_xoffset); + hruler->lower -= img2real(gdisp, TRUE, + FUNSCALEX(gdisp,(double) gdisp->disp_xoffset)); + hruler->upper -= img2real(gdisp, TRUE, + FUNSCALEX(gdisp,(double) gdisp->disp_xoffset)); } else { gdisp->disp_xoffset = 0; - hruler->lower += UNSCALEX (gdisp, (double) gdisp->offset_x); - hruler->upper += UNSCALEX (gdisp, (double) gdisp->offset_x); + hruler->lower += img2real (gdisp, TRUE, + FUNSCALEX (gdisp, (double) gdisp->offset_x)); + hruler->upper += img2real (gdisp, TRUE, + FUNSCALEX (gdisp, (double) gdisp->offset_x)); } if (sy < gdisp->disp_height) { gdisp->disp_yoffset = (gdisp->disp_height - sy) / 2; - vruler->lower -= UNSCALEY (gdisp, (double) gdisp->disp_yoffset); - vruler->upper -= UNSCALEY (gdisp, (double) gdisp->disp_yoffset); + vruler->lower -= img2real(gdisp, FALSE, + FUNSCALEY(gdisp,(double) gdisp->disp_yoffset)); + vruler->upper -= img2real(gdisp, FALSE, + FUNSCALEY(gdisp,(double) gdisp->disp_yoffset)); } else { gdisp->disp_yoffset = 0; - vruler->lower += UNSCALEY (gdisp, (double) gdisp->offset_y); - vruler->upper += UNSCALEY (gdisp, (double) gdisp->offset_y); + vruler->lower += img2real (gdisp, FALSE, + FUNSCALEY (gdisp, (double) gdisp->offset_y)); + vruler->upper += img2real (gdisp, FALSE, + FUNSCALEY (gdisp, (double) gdisp->offset_y)); } gtk_widget_draw (GTK_WIDGET (hruler), NULL); diff --git a/app/display/gimpdisplay.h b/app/display/gimpdisplay.h index 1245c7bb3c..9295c21d1e 100644 --- a/app/display/gimpdisplay.h +++ b/app/display/gimpdisplay.h @@ -52,6 +52,10 @@ /* unscale values */ #define UNSCALEX(g,x) ((int)(x / SCALEFACTOR_X(g))) #define UNSCALEY(g,y) ((int)(y / SCALEFACTOR_Y(g))) +/* (and float-returning versions) */ +#define FUNSCALEX(g,x) ((x / SCALEFACTOR_X(g))) +#define FUNSCALEY(g,y) ((y / SCALEFACTOR_Y(g))) + diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c index 74733a978e..79d5925d6f 100644 --- a/app/display/gimpdisplayshell-draw.c +++ b/app/display/gimpdisplayshell-draw.c @@ -648,7 +648,10 @@ create_display_shell (GDisplay* gdisp, gdisp->hrule = gtk_hruler_new (); gtk_widget_set_events (GTK_WIDGET (gdisp->hrule), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); - gtk_ruler_set_metric (GTK_RULER (gdisp->hrule), ruler_units); + /* Still need to sort out the best way of using this metrics stuff. + * For the moment, we do everything in terms of pixels + * -- austin 25/Jan/99 */ + /*gtk_ruler_set_metric (GTK_RULER (gdisp->hrule), ruler_units);*/ gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event", (GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->hrule)->klass)->motion_notify_event, GTK_OBJECT (gdisp->hrule)); @@ -659,7 +662,7 @@ create_display_shell (GDisplay* gdisp, gdisp->vrule = gtk_vruler_new (); gtk_widget_set_events (GTK_WIDGET (gdisp->vrule), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); - gtk_ruler_set_metric (GTK_RULER (gdisp->vrule), ruler_units); + /*gtk_ruler_set_metric (GTK_RULER (gdisp->vrule), ruler_units);*/ gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event", (GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->vrule)->klass)->motion_notify_event, GTK_OBJECT (gdisp->vrule)); diff --git a/app/display/gimpdisplayshell-scale.c b/app/display/gimpdisplayshell-scale.c index cc61282514..bb82235283 100644 --- a/app/display/gimpdisplayshell-scale.c +++ b/app/display/gimpdisplayshell-scale.c @@ -158,6 +158,37 @@ change_scale (GDisplay *gdisp, } +/* scale image coord to realworld units (cm, inches, pixels) */ +static gdouble +img2real (GDisplay *g, gboolean xdir, gdouble a) +{ + float res; + + if (g->dot_for_dot) + return a; + + if (xdir) + res = monitor_xres; + else + res = monitor_yres; + + switch (ruler_units) { + case GTK_PIXELS: + return a; + + case GTK_INCHES: + return a / res; + + case GTK_CENTIMETERS: + return a * 2.54 / res; + + default: + g_warning ("unknown ruler_units %d, can't happen", ruler_units); + return a; + } +} + + void setup_scale (GDisplay *gdisp) { @@ -168,8 +199,8 @@ setup_scale (GDisplay *gdisp) sx = SCALEX(gdisp, gdisp->gimage->width); sy = SCALEY(gdisp, gdisp->gimage->height); - stepx = SCALEX(gdisp, 1); - stepy = SCALEY(gdisp, 1); + stepx = SCALEFACTOR_X(gdisp); + stepy = SCALEFACTOR_Y(gdisp); gdisp->hsbdata->value = gdisp->offset_x; gdisp->hsbdata->upper = sx; @@ -190,37 +221,47 @@ setup_scale (GDisplay *gdisp) vruler = GTK_RULER (gdisp->vrule); hruler->lower = 0; - hruler->upper = UNSCALEX (gdisp, gdisp->disp_width); - hruler->max_size = MAXIMUM (gdisp->gimage->width, gdisp->gimage->height); + hruler->upper = img2real (gdisp, TRUE, FUNSCALEX (gdisp, gdisp->disp_width)); + hruler->max_size = img2real (gdisp, TRUE, MAXIMUM (gdisp->gimage->width, + gdisp->gimage->height)); vruler->lower = 0; - vruler->upper = UNSCALEY (gdisp, gdisp->disp_height); - vruler->max_size = MAXIMUM (gdisp->gimage->width, gdisp->gimage->height); + vruler->upper = img2real(gdisp, FALSE, FUNSCALEY(gdisp, gdisp->disp_height)); + vruler->max_size = img2real (gdisp, FALSE, MAXIMUM (gdisp->gimage->width, + gdisp->gimage->height)); if (sx < gdisp->disp_width) { gdisp->disp_xoffset = (gdisp->disp_width - sx) / 2; - hruler->lower -= UNSCALEX (gdisp, (double) gdisp->disp_xoffset); - hruler->upper -= UNSCALEX (gdisp, (double) gdisp->disp_xoffset); + hruler->lower -= img2real(gdisp, TRUE, + FUNSCALEX(gdisp,(double) gdisp->disp_xoffset)); + hruler->upper -= img2real(gdisp, TRUE, + FUNSCALEX(gdisp,(double) gdisp->disp_xoffset)); } else { gdisp->disp_xoffset = 0; - hruler->lower += UNSCALEX (gdisp, (double) gdisp->offset_x); - hruler->upper += UNSCALEX (gdisp, (double) gdisp->offset_x); + hruler->lower += img2real (gdisp, TRUE, + FUNSCALEX (gdisp, (double) gdisp->offset_x)); + hruler->upper += img2real (gdisp, TRUE, + FUNSCALEX (gdisp, (double) gdisp->offset_x)); } if (sy < gdisp->disp_height) { gdisp->disp_yoffset = (gdisp->disp_height - sy) / 2; - vruler->lower -= UNSCALEY (gdisp, (double) gdisp->disp_yoffset); - vruler->upper -= UNSCALEY (gdisp, (double) gdisp->disp_yoffset); + vruler->lower -= img2real(gdisp, FALSE, + FUNSCALEY(gdisp,(double) gdisp->disp_yoffset)); + vruler->upper -= img2real(gdisp, FALSE, + FUNSCALEY(gdisp,(double) gdisp->disp_yoffset)); } else { gdisp->disp_yoffset = 0; - vruler->lower += UNSCALEY (gdisp, (double) gdisp->offset_y); - vruler->upper += UNSCALEY (gdisp, (double) gdisp->offset_y); + vruler->lower += img2real (gdisp, FALSE, + FUNSCALEY (gdisp, (double) gdisp->offset_y)); + vruler->upper += img2real (gdisp, FALSE, + FUNSCALEY (gdisp, (double) gdisp->offset_y)); } gtk_widget_draw (GTK_WIDGET (hruler), NULL); diff --git a/app/display/gimpdisplayshell.c b/app/display/gimpdisplayshell.c index 74733a978e..79d5925d6f 100644 --- a/app/display/gimpdisplayshell.c +++ b/app/display/gimpdisplayshell.c @@ -648,7 +648,10 @@ create_display_shell (GDisplay* gdisp, gdisp->hrule = gtk_hruler_new (); gtk_widget_set_events (GTK_WIDGET (gdisp->hrule), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); - gtk_ruler_set_metric (GTK_RULER (gdisp->hrule), ruler_units); + /* Still need to sort out the best way of using this metrics stuff. + * For the moment, we do everything in terms of pixels + * -- austin 25/Jan/99 */ + /*gtk_ruler_set_metric (GTK_RULER (gdisp->hrule), ruler_units);*/ gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event", (GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->hrule)->klass)->motion_notify_event, GTK_OBJECT (gdisp->hrule)); @@ -659,7 +662,7 @@ create_display_shell (GDisplay* gdisp, gdisp->vrule = gtk_vruler_new (); gtk_widget_set_events (GTK_WIDGET (gdisp->vrule), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); - gtk_ruler_set_metric (GTK_RULER (gdisp->vrule), ruler_units); + /*gtk_ruler_set_metric (GTK_RULER (gdisp->vrule), ruler_units);*/ gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event", (GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->vrule)->klass)->motion_notify_event, GTK_OBJECT (gdisp->vrule)); diff --git a/app/gdisplay.h b/app/gdisplay.h index 1245c7bb3c..9295c21d1e 100644 --- a/app/gdisplay.h +++ b/app/gdisplay.h @@ -52,6 +52,10 @@ /* unscale values */ #define UNSCALEX(g,x) ((int)(x / SCALEFACTOR_X(g))) #define UNSCALEY(g,y) ((int)(y / SCALEFACTOR_Y(g))) +/* (and float-returning versions) */ +#define FUNSCALEX(g,x) ((x / SCALEFACTOR_X(g))) +#define FUNSCALEY(g,y) ((y / SCALEFACTOR_Y(g))) + diff --git a/app/gui/user-install-dialog.c b/app/gui/user-install-dialog.c index aa11d6675b..7b8953f4f0 100644 --- a/app/gui/user-install-dialog.c +++ b/app/gui/user-install-dialog.c @@ -192,11 +192,11 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tPaths to search for brushes, palettes, gradients\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tpatterns, and plug-ins are also configured here.\n"), -1); + _("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("pluginrc\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tPlug-ins and extensions are extern programs run by\n"), -1); + _("\t\tPlug-ins and extensions are external programs run by\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tthe GIMP which provide additional functionality.\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -299,6 +299,18 @@ install_help (InstallCallback callback) _("\t\twide GIMP plug-in directories when searching for\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tplug-ins.\n"), -1); + gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, + _("modules\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThis subdirectory can be used to store user created,\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\ttemporary, or otherwise non-system-supported DLL modules. \n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThe default gimprc file checks this subdirectory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tin addition to the system-wide GIMP module directory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\twhen searching for modules to load when initialising.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("scripts\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -322,6 +334,9 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tGIMP sessions and can be destroyed with impunity.\n"), -1); + /* scroll back to the top */ + gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0); + gtk_widget_show (vsb); gtk_widget_show (text); gtk_widget_show (table); @@ -389,7 +404,7 @@ install_run (InstallCallback callback) vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); vsb = gtk_vscrollbar_new (vadj); text = gtk_text_new (NULL, vadj); - gtk_widget_set_usize (text, 384, 256); + gtk_widget_set_usize (text, 384, 356); table = gtk_table_new (1, 2, FALSE); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); @@ -447,6 +462,8 @@ install_run (InstallCallback callback) g_snprintf (buffer, sizeof(buffer), "%s/user_install %s %s", DATADIR, DATADIR, gimp_directory ()); + /* urk - should really use something better than popen(), since + * we can't tell if the installation script failed --austin */ if ((pfp = popen (buffer, "r")) != NULL) { while (fgets (buffer, 2048, pfp)) diff --git a/app/install.c b/app/install.c index aa11d6675b..7b8953f4f0 100644 --- a/app/install.c +++ b/app/install.c @@ -192,11 +192,11 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tPaths to search for brushes, palettes, gradients\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tpatterns, and plug-ins are also configured here.\n"), -1); + _("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("pluginrc\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tPlug-ins and extensions are extern programs run by\n"), -1); + _("\t\tPlug-ins and extensions are external programs run by\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tthe GIMP which provide additional functionality.\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -299,6 +299,18 @@ install_help (InstallCallback callback) _("\t\twide GIMP plug-in directories when searching for\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tplug-ins.\n"), -1); + gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, + _("modules\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThis subdirectory can be used to store user created,\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\ttemporary, or otherwise non-system-supported DLL modules. \n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThe default gimprc file checks this subdirectory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tin addition to the system-wide GIMP module directory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\twhen searching for modules to load when initialising.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("scripts\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -322,6 +334,9 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tGIMP sessions and can be destroyed with impunity.\n"), -1); + /* scroll back to the top */ + gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0); + gtk_widget_show (vsb); gtk_widget_show (text); gtk_widget_show (table); @@ -389,7 +404,7 @@ install_run (InstallCallback callback) vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); vsb = gtk_vscrollbar_new (vadj); text = gtk_text_new (NULL, vadj); - gtk_widget_set_usize (text, 384, 256); + gtk_widget_set_usize (text, 384, 356); table = gtk_table_new (1, 2, FALSE); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); @@ -447,6 +462,8 @@ install_run (InstallCallback callback) g_snprintf (buffer, sizeof(buffer), "%s/user_install %s %s", DATADIR, DATADIR, gimp_directory ()); + /* urk - should really use something better than popen(), since + * we can't tell if the installation script failed --austin */ if ((pfp = popen (buffer, "r")) != NULL) { while (fgets (buffer, 2048, pfp)) diff --git a/app/interface.c b/app/interface.c index 74733a978e..79d5925d6f 100644 --- a/app/interface.c +++ b/app/interface.c @@ -648,7 +648,10 @@ create_display_shell (GDisplay* gdisp, gdisp->hrule = gtk_hruler_new (); gtk_widget_set_events (GTK_WIDGET (gdisp->hrule), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); - gtk_ruler_set_metric (GTK_RULER (gdisp->hrule), ruler_units); + /* Still need to sort out the best way of using this metrics stuff. + * For the moment, we do everything in terms of pixels + * -- austin 25/Jan/99 */ + /*gtk_ruler_set_metric (GTK_RULER (gdisp->hrule), ruler_units);*/ gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event", (GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->hrule)->klass)->motion_notify_event, GTK_OBJECT (gdisp->hrule)); @@ -659,7 +662,7 @@ create_display_shell (GDisplay* gdisp, gdisp->vrule = gtk_vruler_new (); gtk_widget_set_events (GTK_WIDGET (gdisp->vrule), GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK); - gtk_ruler_set_metric (GTK_RULER (gdisp->vrule), ruler_units); + /*gtk_ruler_set_metric (GTK_RULER (gdisp->vrule), ruler_units);*/ gtk_signal_connect_object (GTK_OBJECT (gdisp->shell), "motion_notify_event", (GtkSignalFunc) GTK_WIDGET_CLASS (GTK_OBJECT (gdisp->vrule)->klass)->motion_notify_event, GTK_OBJECT (gdisp->vrule)); diff --git a/app/scale.c b/app/scale.c index cc61282514..bb82235283 100644 --- a/app/scale.c +++ b/app/scale.c @@ -158,6 +158,37 @@ change_scale (GDisplay *gdisp, } +/* scale image coord to realworld units (cm, inches, pixels) */ +static gdouble +img2real (GDisplay *g, gboolean xdir, gdouble a) +{ + float res; + + if (g->dot_for_dot) + return a; + + if (xdir) + res = monitor_xres; + else + res = monitor_yres; + + switch (ruler_units) { + case GTK_PIXELS: + return a; + + case GTK_INCHES: + return a / res; + + case GTK_CENTIMETERS: + return a * 2.54 / res; + + default: + g_warning ("unknown ruler_units %d, can't happen", ruler_units); + return a; + } +} + + void setup_scale (GDisplay *gdisp) { @@ -168,8 +199,8 @@ setup_scale (GDisplay *gdisp) sx = SCALEX(gdisp, gdisp->gimage->width); sy = SCALEY(gdisp, gdisp->gimage->height); - stepx = SCALEX(gdisp, 1); - stepy = SCALEY(gdisp, 1); + stepx = SCALEFACTOR_X(gdisp); + stepy = SCALEFACTOR_Y(gdisp); gdisp->hsbdata->value = gdisp->offset_x; gdisp->hsbdata->upper = sx; @@ -190,37 +221,47 @@ setup_scale (GDisplay *gdisp) vruler = GTK_RULER (gdisp->vrule); hruler->lower = 0; - hruler->upper = UNSCALEX (gdisp, gdisp->disp_width); - hruler->max_size = MAXIMUM (gdisp->gimage->width, gdisp->gimage->height); + hruler->upper = img2real (gdisp, TRUE, FUNSCALEX (gdisp, gdisp->disp_width)); + hruler->max_size = img2real (gdisp, TRUE, MAXIMUM (gdisp->gimage->width, + gdisp->gimage->height)); vruler->lower = 0; - vruler->upper = UNSCALEY (gdisp, gdisp->disp_height); - vruler->max_size = MAXIMUM (gdisp->gimage->width, gdisp->gimage->height); + vruler->upper = img2real(gdisp, FALSE, FUNSCALEY(gdisp, gdisp->disp_height)); + vruler->max_size = img2real (gdisp, FALSE, MAXIMUM (gdisp->gimage->width, + gdisp->gimage->height)); if (sx < gdisp->disp_width) { gdisp->disp_xoffset = (gdisp->disp_width - sx) / 2; - hruler->lower -= UNSCALEX (gdisp, (double) gdisp->disp_xoffset); - hruler->upper -= UNSCALEX (gdisp, (double) gdisp->disp_xoffset); + hruler->lower -= img2real(gdisp, TRUE, + FUNSCALEX(gdisp,(double) gdisp->disp_xoffset)); + hruler->upper -= img2real(gdisp, TRUE, + FUNSCALEX(gdisp,(double) gdisp->disp_xoffset)); } else { gdisp->disp_xoffset = 0; - hruler->lower += UNSCALEX (gdisp, (double) gdisp->offset_x); - hruler->upper += UNSCALEX (gdisp, (double) gdisp->offset_x); + hruler->lower += img2real (gdisp, TRUE, + FUNSCALEX (gdisp, (double) gdisp->offset_x)); + hruler->upper += img2real (gdisp, TRUE, + FUNSCALEX (gdisp, (double) gdisp->offset_x)); } if (sy < gdisp->disp_height) { gdisp->disp_yoffset = (gdisp->disp_height - sy) / 2; - vruler->lower -= UNSCALEY (gdisp, (double) gdisp->disp_yoffset); - vruler->upper -= UNSCALEY (gdisp, (double) gdisp->disp_yoffset); + vruler->lower -= img2real(gdisp, FALSE, + FUNSCALEY(gdisp,(double) gdisp->disp_yoffset)); + vruler->upper -= img2real(gdisp, FALSE, + FUNSCALEY(gdisp,(double) gdisp->disp_yoffset)); } else { gdisp->disp_yoffset = 0; - vruler->lower += UNSCALEY (gdisp, (double) gdisp->offset_y); - vruler->upper += UNSCALEY (gdisp, (double) gdisp->offset_y); + vruler->lower += img2real (gdisp, FALSE, + FUNSCALEY (gdisp, (double) gdisp->offset_y)); + vruler->upper += img2real (gdisp, FALSE, + FUNSCALEY (gdisp, (double) gdisp->offset_y)); } gtk_widget_draw (GTK_WIDGET (hruler), NULL); diff --git a/app/user_install.c b/app/user_install.c index aa11d6675b..7b8953f4f0 100644 --- a/app/user_install.c +++ b/app/user_install.c @@ -192,11 +192,11 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tPaths to search for brushes, palettes, gradients\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tpatterns, and plug-ins are also configured here.\n"), -1); + _("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("pluginrc\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, - _("\t\tPlug-ins and extensions are extern programs run by\n"), -1); + _("\t\tPlug-ins and extensions are external programs run by\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tthe GIMP which provide additional functionality.\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -299,6 +299,18 @@ install_help (InstallCallback callback) _("\t\twide GIMP plug-in directories when searching for\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tplug-ins.\n"), -1); + gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, + _("modules\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThis subdirectory can be used to store user created,\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\ttemporary, or otherwise non-system-supported DLL modules. \n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tThe default gimprc file checks this subdirectory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\tin addition to the system-wide GIMP module directory\n"), -1); + gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, + _("\t\twhen searching for modules to load when initialising.\n"), -1); gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL, _("scripts\n"), -1); gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, @@ -322,6 +334,9 @@ install_help (InstallCallback callback) gtk_text_insert (GTK_TEXT (text), font, NULL, NULL, _("\t\tGIMP sessions and can be destroyed with impunity.\n"), -1); + /* scroll back to the top */ + gtk_adjustment_set_value (GTK_ADJUSTMENT (vadj), 0.0); + gtk_widget_show (vsb); gtk_widget_show (text); gtk_widget_show (table); @@ -389,7 +404,7 @@ install_run (InstallCallback callback) vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); vsb = gtk_vscrollbar_new (vadj); text = gtk_text_new (NULL, vadj); - gtk_widget_set_usize (text, 384, 256); + gtk_widget_set_usize (text, 384, 356); table = gtk_table_new (1, 2, FALSE); gtk_table_set_col_spacing (GTK_TABLE (table), 0, 2); @@ -447,6 +462,8 @@ install_run (InstallCallback callback) g_snprintf (buffer, sizeof(buffer), "%s/user_install %s %s", DATADIR, DATADIR, gimp_directory ()); + /* urk - should really use something better than popen(), since + * we can't tell if the installation script failed --austin */ if ((pfp = popen (buffer, "r")) != NULL) { while (fgets (buffer, 2048, pfp)) diff --git a/data/misc/user_install b/data/misc/user_install index 8ce2765494..208f23ebf5 100755 --- a/data/misc/user_install +++ b/data/misc/user_install @@ -29,6 +29,8 @@ echo "mkdir $2/patterns" mkdir $2/patterns echo "mkdir $2/plug-ins" mkdir $2/plug-ins +echo "mkdir $2/modules" +mkdir $2/modules echo "mkdir $2/gfig" mkdir $2/gfig echo "mkdir $2/tmp" diff --git a/docs/parasites.txt b/docs/parasites.txt index 6a99e0a3c9..62a1649b2f 100644 --- a/docs/parasites.txt +++ b/docs/parasites.txt @@ -14,6 +14,7 @@ It does not need to concern users. *** PREFIXES: "tiff" : The standard GIMP TIFF plugin +"jpeg" : The standard GIMP JPEG plugin "gimp" : For common and standard parasites @@ -24,10 +25,15 @@ It does not need to concern users. human-readable text in unspecified 8-bit ASCII. It includes a trailing \0 string terminator. The size of the parasite data may not exceed 241 bytes. - This parasite attaches to images only. + This parasite attaches to images only. It is + persistent, which means it is saved in XCF files. "tiff-save-options" : The TiffSaveVals structure from the TIFF plugin. - This parasite attaches to images only. + This parasite attaches to images only. It is + not persistent. +"jpeg-save-options" : The JpegSaveVals structure from the JPEG + plugin. This parasite attaches to images only. + It is not persistent. ------------------------------------------------------------------ diff --git a/user_install b/user_install index 8ce2765494..208f23ebf5 100755 --- a/user_install +++ b/user_install @@ -29,6 +29,8 @@ echo "mkdir $2/patterns" mkdir $2/patterns echo "mkdir $2/plug-ins" mkdir $2/plug-ins +echo "mkdir $2/modules" +mkdir $2/modules echo "mkdir $2/gfig" mkdir $2/gfig echo "mkdir $2/tmp"