Commit d4ccd85a authored by GMT 1998 Andy Thomas's avatar GMT 1998 Andy Thomas Committed by Andy Thomas

app/gradient.c app/gradient.h app/internal_procs.c app/plug_in.c


Sat Oct 31 14:57:40 GMT 1998 Andy Thomas <alt@picnic.demon.co.uk>

	* app/gradient.c
	* app/gradient.h
	* app/internal_procs.c
	* app/plug_in.c
	* app/session.c
	* app/session.h
	* libgimp/Makefile.am
	* libgimp/gimpmenu.h
	* libgimp/app/gimprc.c
	* libgimp/libgimpmenu.c
	* plug-ins/script-fu/scripts/test-sphere.scm
	* plug-ins/script-fu/script-fu-enums.h
	* plug-ins/script-fu/script-fu.c
	* plug-ins/script-fu/script-fu-scripts.c

	New file:-

	* libgimp/gimpgradientmenu.c

	New gradient selector widget (smaller than the editor). This can now
	be controlled via the PDB.

	New widget which gives easy way to do gradient selections. This
	new widget is used by script-fu (see the test->sphere script).

	gradient.c needs to be split up (source is almost already split
	I will complete this RSN).
parent 064e081c
Sat Oct 31 14:57:40 GMT 1998 Andy Thomas <alt@picnic.demon.co.uk>
* app/gradient.c
* app/gradient.h
* app/internal_procs.c
* app/plug_in.c
* app/session.c
* app/session.h
* libgimp/Makefile.am
* libgimp/gimpmenu.h
* libgimp/app/gimprc.c
* libgimp/libgimpmenu.c
* plug-ins/script-fu/scripts/test-sphere.scm
* plug-ins/script-fu/script-fu-enums.h
* plug-ins/script-fu/script-fu.c
* plug-ins/script-fu/script-fu-scripts.c
New file:-
* libgimp/gimpgradientmenu.c
New gradient selector widget (smaller than the editor). This can now
be controlled via the PDB.
New widget which gives easy way to do gradient selections. This
new widget is used by script-fu (see the test->sphere script).
gradient.c needs to be split up (source is almost already split
I will complete this RSN).
Sat Oct 31 01:37:23 CET 1998 Marc Lehmann <pcg@goof.com>
* configure.in: make perl use the GLIB_CFLAGS/LIBS vars properly.
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -254,7 +254,7 @@ static SessionInfo *session_infos[] =
&palette_session_info,
&brush_select_session_info,
&pattern_select_session_info,
&gradient_editor_session_info,
&gradient_select_session_info,
&device_status_session_info,
&error_console_session_info
};
......
This diff is collapsed.
......@@ -36,6 +36,7 @@ void grad_get_color_at(double pos, double *r, double *g, double *b, double *a);
void grad_create_gradient_editor(void);
void grad_free_gradient_editor(void);
void gradients_check_dialogs(void);
/***** Procedural database exports *****/
......@@ -45,6 +46,9 @@ extern ProcRecord gradients_get_active_proc;
extern ProcRecord gradients_set_active_proc;
extern ProcRecord gradients_sample_uniform_proc;
extern ProcRecord gradients_sample_custom_proc;
extern ProcRecord gradients_close_popup_proc;
extern ProcRecord gradients_set_popup_proc;
extern ProcRecord gradients_popup_proc;
extern ProcRecord gradients_get_gradient_data_proc;
#endif
This diff is collapsed.
......@@ -36,6 +36,7 @@ void grad_get_color_at(double pos, double *r, double *g, double *b, double *a);
void grad_create_gradient_editor(void);
void grad_free_gradient_editor(void);
void gradients_check_dialogs(void);
/***** Procedural database exports *****/
......@@ -45,6 +46,9 @@ extern ProcRecord gradients_get_active_proc;
extern ProcRecord gradients_set_active_proc;
extern ProcRecord gradients_sample_uniform_proc;
extern ProcRecord gradients_sample_custom_proc;
extern ProcRecord gradients_close_popup_proc;
extern ProcRecord gradients_set_popup_proc;
extern ProcRecord gradients_popup_proc;
extern ProcRecord gradients_get_gradient_data_proc;
#endif
This diff is collapsed.
......@@ -36,6 +36,7 @@ void grad_get_color_at(double pos, double *r, double *g, double *b, double *a);
void grad_create_gradient_editor(void);
void grad_free_gradient_editor(void);
void gradients_check_dialogs(void);
/***** Procedural database exports *****/
......@@ -45,6 +46,9 @@ extern ProcRecord gradients_get_active_proc;
extern ProcRecord gradients_set_active_proc;
extern ProcRecord gradients_sample_uniform_proc;
extern ProcRecord gradients_sample_custom_proc;
extern ProcRecord gradients_close_popup_proc;
extern ProcRecord gradients_set_popup_proc;
extern ProcRecord gradients_popup_proc;
extern ProcRecord gradients_get_gradient_data_proc;
#endif
......@@ -55,7 +55,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
......@@ -210,7 +210,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -77,7 +77,7 @@ SessionInfo brush_select_session_info =
{ "brush-select", (GtkItemFactoryCallback)dialogs_brushes_cmd_callback, 150, 180, 0, 0, FALSE };
SessionInfo pattern_select_session_info =
{ "pattern-select", (GtkItemFactoryCallback)dialogs_patterns_cmd_callback, 160, 180, 0, 0, FALSE };
SessionInfo gradient_editor_session_info =
SessionInfo gradient_select_session_info =
{ "gradient-editor", (GtkItemFactoryCallback)dialogs_gradient_editor_cmd_callback, 170, 180, 0, 0, FALSE };
SessionInfo device_status_session_info =
{ "device-status", (GtkItemFactoryCallback)dialogs_device_status_cmd_callback, 0, 600, 0, 0, FALSE };
......
......@@ -43,7 +43,7 @@ extern SessionInfo tool_options_session_info;
extern SessionInfo palette_session_info;
extern SessionInfo brush_select_session_info;
extern SessionInfo pattern_select_session_info;
extern SessionInfo gradient_editor_session_info;
extern SessionInfo gradient_select_session_info;
extern SessionInfo device_status_session_info;
extern SessionInfo error_console_session_info;
......
......@@ -80,7 +80,7 @@ internal_procs_init ()
{
gfloat pcount = 0;
/* grep -c procedural_db_register internal_procs.c */
gfloat total_pcount = 245;
gfloat total_pcount = 249;
app_init_update_status("Internal Procedures", "Tool procedures",
pcount/total_pcount);
......@@ -356,6 +356,10 @@ internal_procs_init ()
procedural_db_register (&gradients_set_active_proc); pcount++;
procedural_db_register (&gradients_sample_uniform_proc); pcount++;
procedural_db_register (&gradients_sample_custom_proc); pcount++;
procedural_db_register (&gradients_popup_proc); pcount++;
procedural_db_register (&gradients_close_popup_proc); pcount++;
procedural_db_register (&gradients_set_popup_proc); pcount++;
procedural_db_register (&gradients_get_gradient_data_proc); pcount++;
app_init_update_status(NULL, "Image procedures",
pcount/total_pcount);
......
......@@ -55,7 +55,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
......@@ -210,7 +210,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
......
......@@ -55,7 +55,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
......@@ -210,7 +210,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -52,6 +52,7 @@
#include "general.h"
#include "gimage.h"
#include "gimprc.h"
#include "gradient.h"
#include "interface.h"
#include "menus.h"
#include "pattern_select.h" /* Needed for closing pattern dialogs */
......@@ -1066,6 +1067,7 @@ plug_in_close (PlugIn *plug_in,
/* Close any dialogs that this plugin might have opened */
brushes_check_dialogs();
patterns_check_dialogs();
gradients_check_dialogs();
open_plug_ins = g_slist_remove (open_plug_ins, plug_in);
}
......
......@@ -77,7 +77,7 @@ SessionInfo brush_select_session_info =
{ "brush-select", (GtkItemFactoryCallback)dialogs_brushes_cmd_callback, 150, 180, 0, 0, FALSE };
SessionInfo pattern_select_session_info =
{ "pattern-select", (GtkItemFactoryCallback)dialogs_patterns_cmd_callback, 160, 180, 0, 0, FALSE };
SessionInfo gradient_editor_session_info =
SessionInfo gradient_select_session_info =
{ "gradient-editor", (GtkItemFactoryCallback)dialogs_gradient_editor_cmd_callback, 170, 180, 0, 0, FALSE };
SessionInfo device_status_session_info =
{ "device-status", (GtkItemFactoryCallback)dialogs_device_status_cmd_callback, 0, 600, 0, 0, FALSE };
......
......@@ -43,7 +43,7 @@ extern SessionInfo tool_options_session_info;
extern SessionInfo palette_session_info;
extern SessionInfo brush_select_session_info;
extern SessionInfo pattern_select_session_info;
extern SessionInfo gradient_editor_session_info;
extern SessionInfo gradient_select_session_info;
extern SessionInfo device_status_session_info;
extern SessionInfo error_console_session_info;
......
This diff is collapsed.
......@@ -36,6 +36,7 @@ void grad_get_color_at(double pos, double *r, double *g, double *b, double *a);
void grad_create_gradient_editor(void);
void grad_free_gradient_editor(void);
void gradients_check_dialogs(void);
/***** Procedural database exports *****/
......@@ -45,6 +46,9 @@ extern ProcRecord gradients_get_active_proc;
extern ProcRecord gradients_set_active_proc;
extern ProcRecord gradients_sample_uniform_proc;
extern ProcRecord gradients_sample_custom_proc;
extern ProcRecord gradients_close_popup_proc;
extern ProcRecord gradients_set_popup_proc;
extern ProcRecord gradients_popup_proc;
extern ProcRecord gradients_get_gradient_data_proc;
#endif
......@@ -55,7 +55,7 @@ static GtkItemFactoryEntry toolbox_entries[] =
{ N_("/File/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/File/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/File/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/File/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/File/Dialogs/Tool Options..."), "<control><shift>T", dialogs_tools_options_cmd_callback, 0 },
{ N_("/File/Dialogs/Input Devices..."), NULL, dialogs_input_devices_cmd_callback, 0 },
......@@ -210,7 +210,7 @@ static GtkItemFactoryEntry image_entries[] =
{ N_("/Dialogs/Brushes..."), "<control><shift>B", dialogs_brushes_cmd_callback, 0 },
{ N_("/Dialogs/Patterns..."), "<control><shift>P", dialogs_patterns_cmd_callback, 0 },
{ N_("/Dialogs/Palette..."), "<control>P", dialogs_palette_cmd_callback, 0 },
{ N_("/Dialogs/Gradient Editor..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Gradient..."), "<control>G", dialogs_gradient_editor_cmd_callback, 0 },
{ N_("/Dialogs/Layers & Channels..."), "<control>L", dialogs_lc_cmd_callback, 0 },
{ N_("/Dialogs/Indexed Palette..."), NULL, dialogs_indexed_palette_cmd_callback, 0 },
{ N_("/Dialogs/Tool Options..."), NULL, dialogs_tools_options_cmd_callback, 0 },
......
......@@ -52,6 +52,7 @@ libgimp_la_SOURCES = \
libgimpui_la_SOURCES = \
gimpmenu.c \
gimpbrushmenu.c \
gimpgradientmenu.c \
gimppatternmenu.c
gimpinclude_HEADERS = \
......
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
* Copyright (C) 1998 Andy Thomas
*
* 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 <stdio.h>
#include <string.h>
#include "gimp.h"
#include "gimpui.h"
/* Idea is to have a function to call that returns a widget that
* completely controls the selection of a gradient.
* you get a widget returned that you can use in a table say.
* In:- Initial gradient name. Null means use current selection.
* pointer to func to call when gradient changes (GRunGradientCallback).
* Returned:- Pointer to a widget that you can use in UI.
*
* Widget simply made up of a preview widget (20x40) containing the gradient
* which can be clicked on to changed the gradient selection.
*/
#define GSEL_DATA_KEY "__gsel_data"
#define CELL_SIZE_HEIGHT 18
#define CELL_SIZE_WIDTH 84
#define GRAD_CHECK_SIZE_SM 4
#define GRAD_CHECK_DARK (1.0 / 3.0)
#define GRAD_CHECK_LIGHT (2.0 / 3.0)
struct __gradients_sel {
gchar * dname;
GRunGradientCallback cback;
GtkWidget *gradient_preview;
GtkWidget *button;
GtkWidget *gradient_popup_pnt;
gint width;
gchar *gradient_name; /* Local copy */
gdouble *grad_data; /* local copy */
gint sample_size;
gpointer udata;
};
typedef struct __gradients_sel GSelect, * GSelectP;
static void
gradient_pre_update(GtkWidget *gradient_preview,
gint width_data,
gdouble *grad_data)
{
gint x,y;
gdouble *src;
double r, g, b, a;
double c0, c1;
guchar *p0, *p1,*even,*odd;
gint width = width_data/4;
/* Draw the gradient */
src = grad_data;
p0 = even = g_malloc(width*3);
p1 = odd = g_malloc(width*3);
for (x = 0; x < width; x++) {
r = src[x*4+0];
g = src[x*4+1];
b = src[x*4+2];
a = src[x*4+3];
if ((x / GRAD_CHECK_SIZE_SM) & 1) {
c0 = GRAD_CHECK_LIGHT;
c1 = GRAD_CHECK_DARK;
} else {
c0 = GRAD_CHECK_DARK;
c1 = GRAD_CHECK_LIGHT;
} /* else */
*p0++ = (c0 + (r - c0) * a) * 255.0;
*p0++ = (c0 + (g - c0) * a) * 255.0;
*p0++ = (c0 + (b - c0) * a) * 255.0;