Commit da345388 authored by Manish Singh's avatar Manish Singh
Browse files

Added tooltips preferences support

update mkbrush.scm

-Yosh
parent 04758bf0
Sat Dec 13 23:37:59 PST 1997 Manish Singh <yosh@gimp.org>
* mkbrush.scm updated
* Added support for tooltips in preferences
Sun Dec 14 00:06:00 CST 1997 Shawn T. Amundson <amundson@gimp.org>
* configure.in: Changed gimp lib dir to lib/gimp/MAJOR.MINOR
......
......@@ -114,6 +114,7 @@ static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
static int old_no_cursor_updating;
static int old_show_tool_tips;
static int old_cubic_interpolation;
static int old_confirm_on_close;
static int old_default_width;
......@@ -582,6 +583,11 @@ file_prefs_ok_callback (GtkWidget *widget,
gtk_widget_destroy (dlg);
prefs_dlg = NULL;
if (show_tool_tips)
gtk_tooltips_enable (tool_tips);
else
gtk_tooltips_disable (tool_tips);
}
static void
......@@ -631,6 +637,11 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "cursor-updating");
remove = g_list_append (remove, "no-cursor-updating");
}
if (show_tool_tips != old_show_tool_tips)
{
update = g_list_append (update, "show-tool-tips");
remove = g_list_append (remove, "dont-show-tool-tips");
}
if (cubic_interpolation != old_cubic_interpolation)
update = g_list_append (update, "cubic-interpolation");
if (confirm_on_close != old_confirm_on_close)
......@@ -742,6 +753,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
show_tool_tips = old_show_tool_tips;
cubic_interpolation = old_cubic_interpolation;
confirm_on_close = old_confirm_on_close;
default_width = old_default_width;
......@@ -791,6 +803,8 @@ file_prefs_toggle_callback (GtkWidget *widget,
auto_save = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&no_cursor_updating)
no_cursor_updating = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&show_tool_tips)
show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&cubic_interpolation)
cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&confirm_on_close)
......@@ -949,6 +963,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_auto_save = auto_save;
old_preview_size = preview_size;
old_no_cursor_updating = no_cursor_updating;
old_show_tool_tips = show_tool_tips;
old_cubic_interpolation = cubic_interpolation;
old_confirm_on_close = confirm_on_close;
old_default_width = default_width;
......@@ -1249,6 +1264,15 @@ file_pref_cmd_callback (GtkWidget *widget,
&no_cursor_updating);
gtk_widget_show (button);
button = gtk_check_button_new_with_label("Show tool tips");
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button),
show_tool_tips);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) file_prefs_toggle_callback,
&show_tool_tips);
gtk_widget_show (button);
hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
......
......@@ -114,6 +114,7 @@ static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
static int old_no_cursor_updating;
static int old_show_tool_tips;
static int old_cubic_interpolation;
static int old_confirm_on_close;
static int old_default_width;
......@@ -582,6 +583,11 @@ file_prefs_ok_callback (GtkWidget *widget,
gtk_widget_destroy (dlg);
prefs_dlg = NULL;
if (show_tool_tips)
gtk_tooltips_enable (tool_tips);
else
gtk_tooltips_disable (tool_tips);
}
static void
......@@ -631,6 +637,11 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "cursor-updating");
remove = g_list_append (remove, "no-cursor-updating");
}
if (show_tool_tips != old_show_tool_tips)
{
update = g_list_append (update, "show-tool-tips");
remove = g_list_append (remove, "dont-show-tool-tips");
}
if (cubic_interpolation != old_cubic_interpolation)
update = g_list_append (update, "cubic-interpolation");
if (confirm_on_close != old_confirm_on_close)
......@@ -742,6 +753,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
show_tool_tips = old_show_tool_tips;
cubic_interpolation = old_cubic_interpolation;
confirm_on_close = old_confirm_on_close;
default_width = old_default_width;
......@@ -791,6 +803,8 @@ file_prefs_toggle_callback (GtkWidget *widget,
auto_save = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&no_cursor_updating)
no_cursor_updating = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&show_tool_tips)
show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&cubic_interpolation)
cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&confirm_on_close)
......@@ -949,6 +963,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_auto_save = auto_save;
old_preview_size = preview_size;
old_no_cursor_updating = no_cursor_updating;
old_show_tool_tips = show_tool_tips;
old_cubic_interpolation = cubic_interpolation;
old_confirm_on_close = confirm_on_close;
old_default_width = default_width;
......@@ -1249,6 +1264,15 @@ file_pref_cmd_callback (GtkWidget *widget,
&no_cursor_updating);
gtk_widget_show (button);
button = gtk_check_button_new_with_label("Show tool tips");
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button),
show_tool_tips);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) file_prefs_toggle_callback,
&show_tool_tips);
gtk_widget_show (button);
hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
......
......@@ -24,6 +24,7 @@ typedef void (*QueryFunc) (GtkWidget *, gpointer, gpointer);
/* externed variables */
extern GtkWidget *tool_widgets[];
extern GtkWidget *popup_shell;
extern GtkTooltips *tool_tips;
/* function declarations */
GtkWidget * create_pixmap_widget (GdkWindow *, char **, int, int);
......
......@@ -24,6 +24,7 @@ typedef void (*QueryFunc) (GtkWidget *, gpointer, gpointer);
/* externed variables */
extern GtkWidget *tool_widgets[];
extern GtkWidget *popup_shell;
extern GtkTooltips *tool_tips;
/* function declarations */
GtkWidget * create_pixmap_widget (GdkWindow *, char **, int, int);
......
......@@ -111,7 +111,7 @@ int default_height = 256;
int default_type = RGB;
int show_tips = TRUE;
int last_tip = -1;
int show_tool_tips = FALSE;
int show_tool_tips = TRUE;
static int get_next_token (void);
static int peek_next_token (void);
......@@ -215,6 +215,7 @@ static ParseFunc funcs[] =
{ "plug-in-def", TT_XPLUGINDEF, NULL, NULL },
{ "menu-path", TT_XMENUPATH, NULL, NULL },
{ "show-tool-tips", TT_BOOLEAN, &show_tool_tips, NULL },
{ "dont-show-tool-tips", TT_BOOLEAN, NULL, &show_tool_tips },
};
static int nfuncs = sizeof (funcs) / sizeof (funcs[0]);
......
......@@ -114,6 +114,7 @@ static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
static int old_no_cursor_updating;
static int old_show_tool_tips;
static int old_cubic_interpolation;
static int old_confirm_on_close;
static int old_default_width;
......@@ -582,6 +583,11 @@ file_prefs_ok_callback (GtkWidget *widget,
gtk_widget_destroy (dlg);
prefs_dlg = NULL;
if (show_tool_tips)
gtk_tooltips_enable (tool_tips);
else
gtk_tooltips_disable (tool_tips);
}
static void
......@@ -631,6 +637,11 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "cursor-updating");
remove = g_list_append (remove, "no-cursor-updating");
}
if (show_tool_tips != old_show_tool_tips)
{
update = g_list_append (update, "show-tool-tips");
remove = g_list_append (remove, "dont-show-tool-tips");
}
if (cubic_interpolation != old_cubic_interpolation)
update = g_list_append (update, "cubic-interpolation");
if (confirm_on_close != old_confirm_on_close)
......@@ -742,6 +753,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
show_tool_tips = old_show_tool_tips;
cubic_interpolation = old_cubic_interpolation;
confirm_on_close = old_confirm_on_close;
default_width = old_default_width;
......@@ -791,6 +803,8 @@ file_prefs_toggle_callback (GtkWidget *widget,
auto_save = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&no_cursor_updating)
no_cursor_updating = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&show_tool_tips)
show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&cubic_interpolation)
cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&confirm_on_close)
......@@ -949,6 +963,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_auto_save = auto_save;
old_preview_size = preview_size;
old_no_cursor_updating = no_cursor_updating;
old_show_tool_tips = show_tool_tips;
old_cubic_interpolation = cubic_interpolation;
old_confirm_on_close = confirm_on_close;
old_default_width = default_width;
......@@ -1249,6 +1264,15 @@ file_pref_cmd_callback (GtkWidget *widget,
&no_cursor_updating);
gtk_widget_show (button);
button = gtk_check_button_new_with_label("Show tool tips");
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button),
show_tool_tips);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) file_prefs_toggle_callback,
&show_tool_tips);
gtk_widget_show (button);
hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
......
......@@ -114,6 +114,7 @@ static int old_allow_resize_windows;
static int old_auto_save;
static int old_preview_size;
static int old_no_cursor_updating;
static int old_show_tool_tips;
static int old_cubic_interpolation;
static int old_confirm_on_close;
static int old_default_width;
......@@ -582,6 +583,11 @@ file_prefs_ok_callback (GtkWidget *widget,
gtk_widget_destroy (dlg);
prefs_dlg = NULL;
if (show_tool_tips)
gtk_tooltips_enable (tool_tips);
else
gtk_tooltips_disable (tool_tips);
}
static void
......@@ -631,6 +637,11 @@ file_prefs_save_callback (GtkWidget *widget,
update = g_list_append (update, "cursor-updating");
remove = g_list_append (remove, "no-cursor-updating");
}
if (show_tool_tips != old_show_tool_tips)
{
update = g_list_append (update, "show-tool-tips");
remove = g_list_append (remove, "dont-show-tool-tips");
}
if (cubic_interpolation != old_cubic_interpolation)
update = g_list_append (update, "cubic-interpolation");
if (confirm_on_close != old_confirm_on_close)
......@@ -742,6 +753,7 @@ file_prefs_cancel_callback (GtkWidget *widget,
allow_resize_windows = old_allow_resize_windows;
auto_save = old_auto_save;
no_cursor_updating = old_no_cursor_updating;
show_tool_tips = old_show_tool_tips;
cubic_interpolation = old_cubic_interpolation;
confirm_on_close = old_confirm_on_close;
default_width = old_default_width;
......@@ -791,6 +803,8 @@ file_prefs_toggle_callback (GtkWidget *widget,
auto_save = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&no_cursor_updating)
no_cursor_updating = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&show_tool_tips)
show_tool_tips = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&cubic_interpolation)
cubic_interpolation = GTK_TOGGLE_BUTTON (widget)->active;
else if (data==&confirm_on_close)
......@@ -949,6 +963,7 @@ file_pref_cmd_callback (GtkWidget *widget,
old_auto_save = auto_save;
old_preview_size = preview_size;
old_no_cursor_updating = no_cursor_updating;
old_show_tool_tips = show_tool_tips;
old_cubic_interpolation = cubic_interpolation;
old_confirm_on_close = confirm_on_close;
old_default_width = default_width;
......@@ -1249,6 +1264,15 @@ file_pref_cmd_callback (GtkWidget *widget,
&no_cursor_updating);
gtk_widget_show (button);
button = gtk_check_button_new_with_label("Show tool tips");
gtk_toggle_button_set_state (GTK_TOGGLE_BUTTON (button),
show_tool_tips);
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
gtk_signal_connect (GTK_OBJECT (button), "toggled",
(GtkSignalFunc) file_prefs_toggle_callback,
&show_tool_tips);
gtk_widget_show (button);
hbox = gtk_hbox_new (FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
gtk_widget_show (hbox);
......
......@@ -24,6 +24,7 @@ typedef void (*QueryFunc) (GtkWidget *, gpointer, gpointer);
/* externed variables */
extern GtkWidget *tool_widgets[];
extern GtkWidget *popup_shell;
extern GtkTooltips *tool_tips;
/* function declarations */
GtkWidget * create_pixmap_widget (GdkWindow *, char **, int, int);
......
......@@ -139,7 +139,7 @@
# Tooltips
# Comment this out to disable the tooltips in the toolbox
(show-tool-tips)
# (dont-show-tool-tips)
# Controlling ruler visibility
# The default behavior is for rulers to be ON
......
......@@ -139,7 +139,7 @@
# Tooltips
# Comment this out to disable the tooltips in the toolbox
(show-tool-tips)
# (dont-show-tool-tips)
# Controlling ruler visibility
# The default behavior is for rulers to be ON
......
......@@ -4,13 +4,6 @@
; Make-Brush - a script for the script-fu program
; by Seth Burgess 1997 <sjburges@ou.edu>
;
; ======================================================================
; NOTE: This will crash with an ugly error if home dir is not set correctly,
; or ~/.gimp/brushes/ is not writable. To change it from /home/seth
; permanently, change the value on the next to last line to reflect
; your home directory. Be sure to escape the quotes!
; ======================================================================
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
......@@ -37,7 +30,9 @@
(old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(set! data-dir (car (gimp-gimprc-query "gimp_dir")))
; construct variables
(data-dir (car (gimp-gimprc-query "gimp_dir")))
(filename (string-append data-dir
"/brushes/r"
(number->string width)
......@@ -65,7 +60,7 @@
(gimp-edit-fill img drawable)
(file-gbr-save 1 img drawable filename "" spacing desc)
(gimp-brushes-refresh) ; My own modification! You'll need my diff.
(gimp-brushes-refresh)
(gimp-brushes-set-brush desc)
; Terminate, restoring old bg.
......@@ -79,7 +74,7 @@
)
)
; Register with the GDB
; Register with the PDB
(script-fu-register "script-fu-make-brush-rectangular"
"<Toolbox>/Xtns/Script-Fu/Make Brush/Rectangular"
......@@ -91,7 +86,7 @@
SF-VALUE "Description" "\"Rectangle\""
SF-VALUE "Width" "20"
SF-VALUE "Height" "20"
SF-VALUE "Spacking" "20"
SF-VALUE "Spacing" "20"
)
......@@ -108,7 +103,7 @@
(old-fg-color (car (gimp-palette-get-foreground)))
(old-bg-color (car (gimp-palette-get-background)))
(set! data-dir (car (gimp-gimprc-query "gimp_dir")))
(data-dir (car (gimp-gimprc-query "gimp_dir")))
(filename (string-append data-dir
"/brushes/r"
(number->string width)
......@@ -143,7 +138,7 @@
(gimp-edit-fill img drawable)
(file-gbr-save 1 img drawable filename "" 25 desc)
(gimp-brushes-refresh) ; My own modification! You'll need my diff.
(gimp-brushes-refresh)
(gimp-brushes-set-brush desc)
; Terminate, restoring old bg.
......@@ -157,7 +152,7 @@
)
)
; Register with the GDB
; Register with the PDB
(script-fu-register "script-fu-make-brush-rectangular-feathered"
"<Toolbox>/Xtns/Script-Fu/Make Brush/Rectangular, Feathered"
......@@ -186,9 +181,9 @@
; Construct variables...
(set! data-dir (car (gimp-gimprc-query "gimp_dir")))
(data-dir (car (gimp-gimprc-query "gimp_dir")))
(filename (string-append data-dir
"/brushes/r"
"/brushes/e"
(number->string width)
"x"
(number->string height)
......@@ -214,7 +209,7 @@
(gimp-edit-fill img drawable)
(file-gbr-save 1 img drawable filename "" spacing desc)
(gimp-brushes-refresh) ; My own modification! You'll need my diff.
(gimp-brushes-refresh)
(gimp-brushes-set-brush desc)
; Terminate, restoring old bg.
......@@ -228,7 +223,7 @@
)
)
; Register with the GDB
; Register with the PDB
(script-fu-register "script-fu-make-brush-elliptical"
"<Toolbox>/Xtns/Script-Fu/Make Brush/Elliptical"
......@@ -258,9 +253,9 @@
(old-bg-color (car (gimp-palette-get-background)))
; Construct variables...
(set! data-dir (car (gimp-gimprc-query "gimp_dir")))
(data-dir (car (gimp-gimprc-query "gimp_dir")))
(filename (string-append data-dir
"/brushes/r"
"/brushes/e"
(number->string width)
"x"
(number->string height)
......@@ -294,7 +289,7 @@
(gimp-edit-fill img drawable)
(file-gbr-save 1 img drawable filename "" spacing desc)
(gimp-brushes-refresh) ; My own modification! You'll need my diff.
(gimp-brushes-refresh)
(gimp-brushes-set-brush desc)
; Terminate, restoring old bg.
......@@ -308,7 +303,7 @@
)
)
; Register with the GDB
; Register with the PDB
(script-fu-register "script-fu-make-brush-elliptical-feathered"
"<Toolbox>/Xtns/Script-Fu/Make Brush/Elliptical, Feathered"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment