diff --git a/ChangeLog b/ChangeLog index c11cda9167..c370bfa8d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +Mon Nov 9 16:20:33 MET 1998 Sven Neumann + + * app/session.c: use gdk_window_get_root_origin to get the window + position + + * plug-ins/script-fu/script-fu-scripts.c + * plug-ins/script-fu/scripts/test-sphere.scm: small cosmetic fixes + Sun Nov 8 17:51:52 PST 1998 Manish Singh * Makefile.am diff --git a/app/gui/session.c b/app/gui/session.c index 3cd23c39c5..3730045f4b 100644 --- a/app/gui/session.c +++ b/app/gui/session.c @@ -30,10 +30,6 @@ openend images is planned, but I'm still not sure how to deal with dirty images. - There is a problem with the offset introduced by the window-manager adding - decorations to the windows. This is annoying and should be fixed somehow. - ( Update: I was promised that this will be fixed in gtk. ) - Dialogs are now reopened if the gimp is called with the command-line-option --restore-session or if the related entry is set in gimprc. Probably there should alternatively be a list of dialogs in the preferences @@ -92,14 +88,9 @@ session_get_window_info (GtkWidget *window, if ( !save_session_info || info == NULL || window->window == NULL ) return; - gdk_window_get_origin (window->window, &info->x, &info->y); + gdk_window_get_root_origin (window->window, &info->x, &info->y); gdk_window_get_size (window->window, &info->width, &info->height); - /* This is a very ugly hack to work against the offset - introduced by window decorations. - The problem should be handled in gtk ... */ - info->y += -20; - if ( we_are_exiting ) info->open = GTK_WIDGET_VISIBLE (window); diff --git a/app/session.c b/app/session.c index 3cd23c39c5..3730045f4b 100644 --- a/app/session.c +++ b/app/session.c @@ -30,10 +30,6 @@ openend images is planned, but I'm still not sure how to deal with dirty images. - There is a problem with the offset introduced by the window-manager adding - decorations to the windows. This is annoying and should be fixed somehow. - ( Update: I was promised that this will be fixed in gtk. ) - Dialogs are now reopened if the gimp is called with the command-line-option --restore-session or if the related entry is set in gimprc. Probably there should alternatively be a list of dialogs in the preferences @@ -92,14 +88,9 @@ session_get_window_info (GtkWidget *window, if ( !save_session_info || info == NULL || window->window == NULL ) return; - gdk_window_get_origin (window->window, &info->x, &info->y); + gdk_window_get_root_origin (window->window, &info->x, &info->y); gdk_window_get_size (window->window, &info->width, &info->height); - /* This is a very ugly hack to work against the offset - introduced by window decorations. - The problem should be handled in gtk ... */ - info->y += -20; - if ( we_are_exiting ) info->open = GTK_WIDGET_VISIBLE (window); diff --git a/plug-ins/script-fu/script-fu-interface.c b/plug-ins/script-fu/script-fu-interface.c index 1fa13b9a99..75fed58bed 100644 --- a/plug-ins/script-fu/script-fu-interface.c +++ b/plug-ins/script-fu/script-fu-interface.c @@ -197,30 +197,29 @@ static void script_fu_about_dialog_close (GtkWidget *widget, static gint script_fu_about_dialog_delete (GtkWidget *widget, GdkEvent *event, gpointer data); -static void script_fu_pattern_preview (gchar *name, - gint width, - gint height, - gint bytes, - gchar * mask_data, - gint closing, - gpointer udata); +static void script_fu_pattern_preview (gchar *name, + gint width, + gint height, + gint bytes, + gchar * mask_data, + gint closing, + gpointer udata); -static void script_fu_gradient_preview (gchar *name, - gint width, - gdouble * mask_data, - gint closing, - gpointer udata); - -static void script_fu_brush_preview (char *, /* Name */ - gdouble, /* opacity */ - gint, /* spacing */ - gint, /* paint_mode */ - gint, /* width */ - gint, /* height */ - gchar *, /* mask data */ - gint, /* dialog closing */ - gpointer /* user data */); +static void script_fu_gradient_preview (gchar *name, + gint width, + gdouble * mask_data, + gint closing, + gpointer udata); +static void script_fu_brush_preview (char *, /* Name */ + gdouble, /* opacity */ + gint, /* spacing */ + gint, /* paint_mode */ + gint, /* width */ + gint, /* height */ + gchar *, /* mask data */ + gint, /* dialog closing */ + gpointer /* user data */); /* @@ -1274,7 +1273,7 @@ script_fu_interface (SFScript *script) &script->arg_values[i].sfa_pattern); break; case SF_GRADIENT: - script->args_widgets[i] = gimp_gradient_select_widget("Script-fu Pattern Selection", + script->args_widgets[i] = gimp_gradient_select_widget("Script-Fu Gradient Selection", script->arg_values[i].sfa_gradient, script_fu_gradient_preview, &script->arg_values[i].sfa_gradient); @@ -1282,7 +1281,7 @@ script_fu_interface (SFScript *script) case SF_BRUSH: script->args_widgets[i] = - gimp_brush_select_widget("Script-fu brush Selection", + gimp_brush_select_widget("Script-Fu Brush Selection", script->arg_values[i].sfa_brush.name, script->arg_values[i].sfa_brush.opacity, script->arg_values[i].sfa_brush.spacing, @@ -1397,13 +1396,13 @@ script_fu_color_preview (GtkWidget *preview, static void -script_fu_pattern_preview(gchar *name, - gint width, - gint height, - gint bytes, - gchar * mask_data, - gint closing, - gpointer udata) +script_fu_pattern_preview (gchar *name, + gint width, + gint height, + gint bytes, + gchar * mask_data, + gint closing, + gpointer udata) { gchar ** pname = (gchar **) udata; g_free(*pname); @@ -2075,7 +2074,7 @@ script_fu_file_preview_callback (GtkWidget *widget, if (!file->dialog) { - file->dialog = gtk_file_selection_new ("Script-Fu File Selector"); + file->dialog = gtk_file_selection_new ("Script-Fu File Selection"); fs = GTK_FILE_SELECTION (file->dialog); gtk_signal_connect (GTK_OBJECT (fs->ok_button), "clicked", @@ -2146,7 +2145,7 @@ script_fu_font_preview_callback (GtkWidget *widget, if (!font->dialog) { - font->dialog = gtk_font_selection_dialog_new ("Script-Fu Font Selector"); + font->dialog = gtk_font_selection_dialog_new ("Script-Fu Font Selection"); fsd = GTK_FONT_SELECTION_DIALOG (font->dialog); gtk_signal_connect (GTK_OBJECT (fsd->ok_button), "clicked", @@ -2227,3 +2226,8 @@ script_fu_about_dialog_delete (GtkWidget *widget, return TRUE; } + + + + + diff --git a/plug-ins/script-fu/script-fu-scripts.c b/plug-ins/script-fu/script-fu-scripts.c index 1fa13b9a99..75fed58bed 100644 --- a/plug-ins/script-fu/script-fu-scripts.c +++ b/plug-ins/script-fu/script-fu-scripts.c @@ -197,30 +197,29 @@ static void script_fu_about_dialog_close (GtkWidget *widget, static gint script_fu_about_dialog_delete (GtkWidget *widget, GdkEvent *event, gpointer data); -static void script_fu_pattern_preview (gchar *name, - gint width, - gint height, - gint bytes, - gchar * mask_data, - gint closing, - gpointer udata); +static void script_fu_pattern_preview (gchar *name, + gint width, + gint height, + gint bytes, + gchar * mask_data, + gint closing, + gpointer udata); -static void script_fu_gradient_preview (gchar *name, - gint width, - gdouble * mask_data, - gint closing, - gpointer udata); - -static void script_fu_brush_preview (char *, /* Name */ - gdouble, /* opacity */ - gint, /* spacing */ - gint, /* paint_mode */ - gint, /* width */ - gint, /* height */ - gchar *, /* mask data */ - gint, /* dialog closing */ - gpointer /* user data */); +static void script_fu_gradient_preview (gchar *name, + gint width, + gdouble * mask_data, + gint closing, + gpointer udata); +static void script_fu_brush_preview (char *, /* Name */ + gdouble, /* opacity */ + gint, /* spacing */ + gint, /* paint_mode */ + gint, /* width */ + gint, /* height */ + gchar *, /* mask data */ + gint, /* dialog closing */ + gpointer /* user data */); /* @@ -1274,7 +1273,7 @@ script_fu_interface (SFScript *script) &script->arg_values[i].sfa_pattern); break; case SF_GRADIENT: - script->args_widgets[i] = gimp_gradient_select_widget("Script-fu Pattern Selection", + script->args_widgets[i] = gimp_gradient_select_widget("Script-Fu Gradient Selection", script->arg_values[i].sfa_gradient, script_fu_gradient_preview, &script->arg_values[i].sfa_gradient); @@ -1282,7 +1281,7 @@ script_fu_interface (SFScript *script) case SF_BRUSH: script->args_widgets[i] = - gimp_brush_select_widget("Script-fu brush Selection", + gimp_brush_select_widget("Script-Fu Brush Selection", script->arg_values[i].sfa_brush.name, script->arg_values[i].sfa_brush.opacity, script->arg_values[i].sfa_brush.spacing, @@ -1397,13 +1396,13 @@ script_fu_color_preview (GtkWidget *preview, static void -script_fu_pattern_preview(gchar *name, - gint width, - gint height, - gint bytes, - gchar * mask_data, - gint closing, - gpointer udata) +script_fu_pattern_preview (gchar *name, + gint width, + gint height, + gint bytes, + gchar * mask_data, + gint closing, + gpointer udata) { gchar ** pname = (gchar **) udata; g_free(*pname); @@ -2075,7 +2074,7 @@ script_fu_file_preview_callback (GtkWidget *widget, if (!file->dialog) { - file->dialog = gtk_file_selection_new ("Script-Fu File Selector"); + file->dialog = gtk_file_selection_new ("Script-Fu File Selection"); fs = GTK_FILE_SELECTION (file->dialog); gtk_signal_connect (GTK_OBJECT (fs->ok_button), "clicked", @@ -2146,7 +2145,7 @@ script_fu_font_preview_callback (GtkWidget *widget, if (!font->dialog) { - font->dialog = gtk_font_selection_dialog_new ("Script-Fu Font Selector"); + font->dialog = gtk_font_selection_dialog_new ("Script-Fu Font Selection"); fsd = GTK_FONT_SELECTION_DIALOG (font->dialog); gtk_signal_connect (GTK_OBJECT (fsd->ok_button), "clicked", @@ -2227,3 +2226,8 @@ script_fu_about_dialog_delete (GtkWidget *widget, return TRUE; } + + + + + diff --git a/plug-ins/script-fu/scripts/test-sphere.scm b/plug-ins/script-fu/scripts/test-sphere.scm index 4d1f6e76f7..99f5e3db01 100644 --- a/plug-ins/script-fu/scripts/test-sphere.scm +++ b/plug-ins/script-fu/scripts/test-sphere.scm @@ -76,10 +76,23 @@ ; The vaule returned when the script is invoked is a string containing the ; gradient name. If the above selection was not altered the string would ; contain "Deep_Sea" +; +; ---------------------------------------------------------------------- +; +; SF-FILENAME +; Only useful in interactive mode. It will create a widget in the control +; dialog. The widget consists of a button containing the name of a file. +; If the button is pressed a file selection dialog will popup. +; +; Usage:- +; SF-FILENAME "Environment Map" (string-append "" gimp-data-dir "/scripts/beavis.jpg" +; +; The vaule returned when the script is invoked is a string containing the +; filename. ; -(define (script-fu-test-sphere radius light shadow bg-color sphere-color brush text pattern gradient font size) +(define (script-fu-test-sphere radius light shadow bg-color sphere-color brush text pattern gradient font size filename) (let* ((width (* radius 3.75)) (height (* radius 2.5)) (img (car (gimp-image-new width height RGB))) @@ -157,6 +170,7 @@ SF-PATTERN "Pattern" "Maple Leaves" SF-GRADIENT "Gradient" "Deep_Sea" SF-FONT "Font" "-freefont-agate-normal-r-normal-*-24-*-*-*-p-*-*-*" - SF-ADJUSTMENT "Font size (in pixels)" '(50 1 1000 1 10 0 1)) + SF-ADJUSTMENT "Font size (in pixels)" '(50 1 1000 1 10 0 1) + SF-FILENAME "Environment Map" (string-append "" gimp-data-dir "/scripts/beavis.jpg"))