mirror of https://github.com/GNOME/gimp.git
app/Makefile.am removed.
2001-02-03 Michael Natterer <mitch@gimp.org> * app/Makefile.am * app/gimpset.[ch]: removed. * app/gimpcontainer.[ch]: some minor fixes, cleanup. * app/context_manager.[ch]: made the "image_context" a GimpContainer and moved it here... * app/appenv.h * app/main.c: ...from here. * app/app_procs.c * app/colormap_dialog.[ch] * app/commands.c * app/gimage.c * app/gimpcontext.c * app/gimpimage.c * app/info_window.c * app/lc_dialog.c * app/lut_funcs.c * app/module_db.c * app/nav_window.c * app/palette_import.c * app/paths_dialog.c * app/pixel_region.c * app/scale.c * app/scroll.c * app/selection.c * app/temp_buf.c * app/undo.c * app/pdb/procedural_db.c * app/tools/by_color_select.c * app/tools/clone.c * app/tools/color_balance.c * app/tools/color_picker.c * app/tools/convolve.c * app/tools/crop.c * app/tools/curves.c * app/tools/paint_core.c * app/tools/transform_core.c: s/GimpSet/GimpContainer/g, removed many useless #include "appenv.h". * app/gimpdrawablepreview.c * app/gdisplay.c: found two badly crashing bugs i have introduced with my last changes here.
This commit is contained in:
parent
7c85e907b6
commit
c46bdc37f0
48
ChangeLog
48
ChangeLog
|
@ -1,3 +1,51 @@
|
|||
2001-02-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
* app/gimpset.[ch]: removed.
|
||||
|
||||
* app/gimpcontainer.[ch]: some minor fixes, cleanup.
|
||||
|
||||
* app/context_manager.[ch]: made the "image_context" a GimpContainer
|
||||
and moved it here...
|
||||
|
||||
* app/appenv.h
|
||||
* app/main.c: ...from here.
|
||||
|
||||
* app/app_procs.c
|
||||
* app/colormap_dialog.[ch]
|
||||
* app/commands.c
|
||||
* app/gimage.c
|
||||
* app/gimpcontext.c
|
||||
* app/gimpimage.c
|
||||
* app/info_window.c
|
||||
* app/lc_dialog.c
|
||||
* app/lut_funcs.c
|
||||
* app/module_db.c
|
||||
* app/nav_window.c
|
||||
* app/palette_import.c
|
||||
* app/paths_dialog.c
|
||||
* app/pixel_region.c
|
||||
* app/scale.c
|
||||
* app/scroll.c
|
||||
* app/selection.c
|
||||
* app/temp_buf.c
|
||||
* app/undo.c
|
||||
* app/pdb/procedural_db.c
|
||||
* app/tools/by_color_select.c
|
||||
* app/tools/clone.c
|
||||
* app/tools/color_balance.c
|
||||
* app/tools/color_picker.c
|
||||
* app/tools/convolve.c
|
||||
* app/tools/crop.c
|
||||
* app/tools/curves.c
|
||||
* app/tools/paint_core.c
|
||||
* app/tools/transform_core.c: s/GimpSet/GimpContainer/g, removed
|
||||
many useless #include "appenv.h".
|
||||
|
||||
* app/gimpdrawablepreview.c
|
||||
* app/gdisplay.c: found two badly crashing bugs i have introduced
|
||||
with my last changes here.
|
||||
|
||||
2001-02-03 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/Makefile.am
|
||||
|
|
|
@ -150,8 +150,6 @@ gimp_SOURCES = \
|
|||
gimpprogress.h \
|
||||
gimprc.c \
|
||||
gimprc.h \
|
||||
gimpset.c \
|
||||
gimpset.h \
|
||||
gimpui.c \
|
||||
gimpui.h \
|
||||
gimpunit.c \
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brush_select.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "color_area.h"
|
||||
#include "commands.h"
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
|
|
|
@ -60,7 +60,6 @@
|
|||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpparasite.h"
|
||||
#include "gimpset.h"
|
||||
#include "global_edit.h"
|
||||
#include "gradient_select.h"
|
||||
#include "gradient.h"
|
||||
|
@ -526,9 +525,6 @@ app_init (void)
|
|||
if (!no_interface && !no_splash && win_initstatus)
|
||||
splash_text_draw (logo_area);
|
||||
|
||||
/* Create the context of all existing images */
|
||||
image_context = gimp_set_new (GIMP_TYPE_IMAGE, TRUE);
|
||||
|
||||
/* Initialize the context system before loading any data */
|
||||
context_manager_init ();
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ typedef enum
|
|||
ERROR_CONSOLE
|
||||
} MessageHandlerType;
|
||||
|
||||
|
||||
extern gboolean no_interface;
|
||||
extern gboolean no_splash;
|
||||
extern gboolean no_splash_image;
|
||||
|
@ -36,15 +37,14 @@ extern gboolean use_debug_handler;
|
|||
extern gboolean console_messages;
|
||||
extern gboolean restore_session;
|
||||
extern gboolean double_speed;
|
||||
extern gboolean we_are_exiting; /* this is used in session_get_window_info() */
|
||||
extern GimpSet *image_context;
|
||||
extern gboolean we_are_exiting; /* this is used in session_get_window_info() */
|
||||
|
||||
extern MessageHandlerType message_handler;
|
||||
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
gchar * quote_spaces (gchar *string);
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __APPENV_H__ */
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "color_transfer.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gimplut.h"
|
||||
#include "gimphistogram.h"
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "pixel_region.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "paint_funcs.h"
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
#include "colormaps.h"
|
||||
#include "color_area.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpset.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
|
@ -117,7 +117,7 @@ static void index_adjustment_change_cb (GtkAdjustment *adjustment,
|
|||
static void hex_entry_change_cb (GtkEntry *entry,
|
||||
GimpColormapDialog *ipal);
|
||||
|
||||
static void set_addrem_cb (GimpSet *set,
|
||||
static void container_addrem_cb (GimpContainer *container,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal);
|
||||
static void image_rename_cb (GimpImage *img,
|
||||
|
@ -223,7 +223,7 @@ gimp_colormap_dialog_init (GimpColormapDialog *colormap_dialog)
|
|||
}
|
||||
|
||||
GimpColormapDialog *
|
||||
gimp_colormap_dialog_create (GimpSet *context)
|
||||
gimp_colormap_dialog_create (GimpContainer *context)
|
||||
{
|
||||
GimpColormapDialog *ipal;
|
||||
GtkWidget *vbox;
|
||||
|
@ -237,7 +237,7 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
GtkAccelGroup *accel_group;
|
||||
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
g_return_val_if_fail (GIMP_IS_SET (context), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (context), NULL);
|
||||
|
||||
ipal = gtk_type_new (GIMP_TYPE_COLORMAP_DIALOG);
|
||||
|
||||
|
@ -251,14 +251,14 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
|
||||
ipal->image = NULL;
|
||||
ipal->context = context;
|
||||
ipal->cmap_changed_handler = gimp_set_add_handler (context,
|
||||
"colormap_changed",
|
||||
image_cmap_change_cb,
|
||||
ipal);
|
||||
ipal->rename_handler = gimp_set_add_handler (context,
|
||||
"name_changed",
|
||||
image_rename_cb,
|
||||
ipal);
|
||||
ipal->cmap_changed_handler = gimp_container_add_handler (context,
|
||||
"colormap_changed",
|
||||
image_cmap_change_cb,
|
||||
ipal);
|
||||
ipal->rename_handler = gimp_container_add_handler (context,
|
||||
"name_changed",
|
||||
image_rename_cb,
|
||||
ipal);
|
||||
|
||||
accel_group = gtk_accel_group_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (ipal), "indexed_color_palette", "Gimp");
|
||||
|
@ -372,10 +372,10 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
ipal_update_image_list (ipal);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (context), "add",
|
||||
GTK_SIGNAL_FUNC (set_addrem_cb),
|
||||
GTK_SIGNAL_FUNC (container_addrem_cb),
|
||||
ipal);
|
||||
gtk_signal_connect (GTK_OBJECT (context), "remove",
|
||||
GTK_SIGNAL_FUNC (set_addrem_cb),
|
||||
GTK_SIGNAL_FUNC (container_addrem_cb),
|
||||
ipal);
|
||||
|
||||
return ipal;
|
||||
|
@ -802,9 +802,9 @@ hex_entry_change_cb (GtkEntry *entry,
|
|||
}
|
||||
|
||||
static void
|
||||
set_addrem_cb (GimpSet *set,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal)
|
||||
container_addrem_cb (GimpContainer *set,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal)
|
||||
{
|
||||
ipal_update_image_list (ipal);
|
||||
}
|
||||
|
@ -878,7 +878,8 @@ ipal_set_image (GimpColormapDialog *ipal,
|
|||
if (!ipal->image)
|
||||
gtk_signal_handler_unblock (GTK_OBJECT (ipal->palette),
|
||||
ipal->event_handler);
|
||||
g_return_if_fail (gimp_set_have (ipal->context, gimage));
|
||||
g_return_if_fail (gimp_container_lookup (ipal->context,
|
||||
GIMP_OBJECT (gimage)));
|
||||
g_return_if_fail (gimp_image_base_type (gimage) == INDEXED);
|
||||
ipal->image = gimage;
|
||||
ipal_draw (ipal);
|
||||
|
@ -1139,7 +1140,7 @@ create_image_menu (GimpColormapDialog *ipal,
|
|||
|
||||
*default_index = -1;
|
||||
|
||||
gimp_set_foreach (ipal->context, create_image_menu_cb, &data);
|
||||
gimp_container_foreach (ipal->context, create_image_menu_cb, &data);
|
||||
|
||||
if (!data.num_items)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ struct _GimpColormapDialog
|
|||
GtkWidget *image_menu;
|
||||
GtkWidget *popup_menu;
|
||||
GtkOptionMenu *option_menu;
|
||||
GimpSet *context;
|
||||
GimpContainer *context;
|
||||
guint event_handler;
|
||||
gint xn;
|
||||
gint yn;
|
||||
|
@ -68,7 +68,7 @@ struct _GimpColormapDialogClass
|
|||
|
||||
|
||||
GtkType gimp_colormap_dialog_get_type (void);
|
||||
GimpColormapDialog * gimp_colormap_dialog_create (GimpSet* context);
|
||||
GimpColormapDialog * gimp_colormap_dialog_create (GimpContainer *context);
|
||||
|
||||
void gimp_colormap_dialog_selected (GimpColormapDialog *colormap_dialog);
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brush_select.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "color_area.h"
|
||||
#include "commands.h"
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
|
|
|
@ -26,14 +26,22 @@
|
|||
#include "cursorutil.h"
|
||||
#include "context_manager.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
#include "tools/paint_options.h"
|
||||
#include "tools/tools.h"
|
||||
|
||||
|
||||
static GimpContext * global_tool_context;
|
||||
/*
|
||||
* the list of all images
|
||||
*/
|
||||
GimpContainer *image_context = NULL;
|
||||
|
||||
|
||||
static GimpContext *global_tool_context = NULL;
|
||||
|
||||
#define PAINT_OPTIONS_MASK GIMP_CONTEXT_OPACITY_MASK | \
|
||||
GIMP_CONTEXT_PAINT_MODE_MASK
|
||||
|
@ -124,6 +132,10 @@ context_manager_init (void)
|
|||
GimpContext *user_context;
|
||||
gint i;
|
||||
|
||||
/* Create the context of all existing images */
|
||||
image_context = gimp_container_new (GIMP_TYPE_IMAGE,
|
||||
GIMP_CONTAINER_POLICY_WEAK);
|
||||
|
||||
/* Implicitly create the standard context */
|
||||
standard_context = gimp_context_get_standard ();
|
||||
|
||||
|
|
|
@ -20,6 +20,12 @@
|
|||
#define __CONTEXT_MANAGER_H__
|
||||
|
||||
|
||||
/*
|
||||
* the list of all images
|
||||
*/
|
||||
extern GimpContainer *image_context;
|
||||
|
||||
|
||||
void context_manager_init (void);
|
||||
void context_manager_free (void);
|
||||
|
||||
|
|
|
@ -286,6 +286,9 @@ gimp_container_remove (GimpContainer *container,
|
|||
}
|
||||
}
|
||||
|
||||
container->children = g_list_remove (container->children, object);
|
||||
container->num_children--;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (object));
|
||||
|
||||
switch (container->policy)
|
||||
|
@ -302,9 +305,6 @@ gimp_container_remove (GimpContainer *container,
|
|||
break;
|
||||
}
|
||||
|
||||
container->children = g_list_remove (container->children, object);
|
||||
container->num_children--;
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[REMOVE], object);
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (object));
|
||||
|
@ -313,16 +313,13 @@ gimp_container_remove (GimpContainer *container,
|
|||
}
|
||||
|
||||
const GList *
|
||||
gimp_container_lookup (GimpContainer *container,
|
||||
GimpObject *object)
|
||||
gimp_container_lookup (const GimpContainer *container,
|
||||
const GimpObject *object)
|
||||
{
|
||||
g_return_val_if_fail (container != NULL, NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL);
|
||||
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_CHECK_TYPE (object, container->children_type), NULL);
|
||||
|
||||
return g_list_find (container->children, object);
|
||||
return g_list_find (container->children, (gpointer) object);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -369,11 +366,14 @@ gimp_container_add_handler (GimpContainer *container,
|
|||
|
||||
g_free (key);
|
||||
|
||||
container->handlers = g_list_prepend (container->handlers, handler);
|
||||
|
||||
for (list = container->children; list; list = g_list_next (list))
|
||||
{
|
||||
object = GTK_OBJECT (list->data);
|
||||
|
||||
handler_id = gtk_signal_connect (object, signame,
|
||||
handler_id = gtk_signal_connect (object,
|
||||
handler->signame,
|
||||
handler->func,
|
||||
handler->user_data);
|
||||
|
||||
|
@ -420,14 +420,14 @@ gimp_container_remove_handler (GimpContainer *container,
|
|||
|
||||
if (handler_id)
|
||||
{
|
||||
gtk_signal_disconnect (object, handler->quark);
|
||||
gtk_signal_disconnect (object, handler_id);
|
||||
|
||||
gtk_object_set_data_by_id (object, handler->quark, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
container->handlers = g_list_remove (container->handlers, handler);
|
||||
|
||||
g_free (handler->signame);
|
||||
g_free (handler);
|
||||
|
||||
container->handlers = g_list_remove (container->handlers, handler);
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ gboolean gimp_container_add (GimpContainer *container,
|
|||
gboolean gimp_container_remove (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
|
||||
const GList * gimp_container_lookup (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
const GList * gimp_container_lookup (const GimpContainer *container,
|
||||
const GimpObject *object);
|
||||
void gimp_container_foreach (GimpContainer *container,
|
||||
GFunc func,
|
||||
gpointer user_data);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpbrushlist.h"
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
|
@ -2261,19 +2261,16 @@ void
|
|||
gdisplays_delete (void)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
GSList *list;
|
||||
|
||||
/* traverse the linked list of displays */
|
||||
for (list = display_list; list; list = g_slist_next (list))
|
||||
/* destroying the shell removes the GDisplay from the list, so
|
||||
* do a while loop "around" the first element to get them all
|
||||
*/
|
||||
while (display_list)
|
||||
{
|
||||
gdisp = (GDisplay *) list->data;
|
||||
gdisp = (GDisplay *) display_list->data;
|
||||
|
||||
gtk_widget_destroy (gdisp->shell);
|
||||
}
|
||||
|
||||
/* free up linked list data */
|
||||
g_slist_free (display_list);
|
||||
display_list = NULL;
|
||||
}
|
||||
|
||||
GDisplay *
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpset.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
|
||||
|
@ -345,7 +345,7 @@ info_window_change_display (GimpContext *context, /* NOT USED */
|
|||
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (gimage && gimp_set_have (image_context, gimage))
|
||||
if (gimage && gimp_container_lookup (image_context, GIMP_OBJECT (gimage)))
|
||||
{
|
||||
iwd->gdisp = gdisp;
|
||||
info_window_update (gdisp);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "module_db.h"
|
||||
#include "gimprc.h"
|
||||
#include "datafiles.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimpcontainer.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpmodule.h"
|
||||
|
@ -135,8 +135,8 @@ typedef struct
|
|||
} BrowserState;
|
||||
|
||||
/* global set of module_info pointers */
|
||||
static GimpSet *modules;
|
||||
static GimpSetHandlerId modules_handler;
|
||||
static GimpContainer *modules;
|
||||
static GQuark modules_handler_id;
|
||||
|
||||
/* If the inhibit state of any modules changes, we might need to
|
||||
* re-write the modulerc.
|
||||
|
@ -159,41 +159,41 @@ static gboolean need_to_rewrite_modulerc = FALSE;
|
|||
|
||||
|
||||
/* prototypes */
|
||||
static void module_initialize (const gchar *filename);
|
||||
static void mod_load (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static void mod_unload (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static gboolean mod_idle_unref (ModuleInfo *mod);
|
||||
static ModuleInfo * module_find_by_path (const gchar *fullpath);
|
||||
static void module_initialize (const gchar *filename);
|
||||
static void mod_load (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static void mod_unload (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static gboolean mod_idle_unref (ModuleInfo *mod);
|
||||
static ModuleInfo * module_find_by_path (const gchar *fullpath);
|
||||
|
||||
#ifdef DUMP_DB
|
||||
static void print_module_info (gpointer data,
|
||||
gpointer user_data);
|
||||
static void print_module_info (gpointer data,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
|
||||
static void browser_popdown_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_destroy_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_info_update (ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_add (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_remove (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_init (BrowserState *st,
|
||||
GtkWidget *table);
|
||||
static void browser_select_callback (GtkWidget *widget,
|
||||
GtkWidget *child);
|
||||
static void browser_load_unload_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_refresh_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void make_list_item (gpointer data,
|
||||
gpointer user_data);
|
||||
static void browser_popdown_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_destroy_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_info_update (ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_add (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_remove (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_init (BrowserState *st,
|
||||
GtkWidget *table);
|
||||
static void browser_select_callback (GtkWidget *widget,
|
||||
GtkWidget *child);
|
||||
static void browser_load_unload_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_refresh_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void make_list_item (gpointer data,
|
||||
gpointer user_data);
|
||||
|
||||
static void gimp_module_ref (ModuleInfo *mod);
|
||||
static void gimp_module_unref (ModuleInfo *mod);
|
||||
|
@ -215,13 +215,14 @@ module_db_init (void)
|
|||
|
||||
/* Load and initialize gimp modules */
|
||||
|
||||
modules = gimp_set_new (MODULE_INFO_TYPE, FALSE);
|
||||
modules = gimp_container_new (MODULE_INFO_TYPE,
|
||||
GIMP_CONTAINER_POLICY_WEAK);
|
||||
|
||||
if (g_module_supported ())
|
||||
datafiles_read_directories (module_path,
|
||||
module_initialize, 0 /* no flags */);
|
||||
#ifdef DUMP_DB
|
||||
gimp_set_foreach (modules, print_module_info, NULL);
|
||||
gimp_container_foreach (modules, print_module_info, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -262,7 +263,7 @@ module_db_write_modulerc (void)
|
|||
gboolean saved = FALSE;
|
||||
|
||||
str = g_string_new (NULL);
|
||||
gimp_set_foreach (modules, add_to_inhibit_string, str);
|
||||
gimp_container_foreach (modules, add_to_inhibit_string, str);
|
||||
if (str->len > 0)
|
||||
p = str->str + 1;
|
||||
else
|
||||
|
@ -293,7 +294,7 @@ module_db_free (void)
|
|||
need_to_rewrite_modulerc = FALSE;
|
||||
}
|
||||
}
|
||||
gimp_set_foreach (modules, free_a_single_module, NULL);
|
||||
gimp_container_foreach (modules, free_a_single_module, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -338,7 +339,7 @@ module_db_browser_new (void)
|
|||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (listbox),
|
||||
st->list);
|
||||
|
||||
gimp_set_foreach (modules, make_list_item, st);
|
||||
gimp_container_foreach (modules, make_list_item, st);
|
||||
|
||||
gtk_widget_show (st->list);
|
||||
|
||||
|
@ -374,10 +375,11 @@ module_db_browser_new (void)
|
|||
gtk_signal_connect (GTK_OBJECT (st->list), "select_child",
|
||||
browser_select_callback, NULL);
|
||||
|
||||
/* hook the gimpset signals so we can refresh the display
|
||||
* appropriately. */
|
||||
modules_handler =
|
||||
gimp_set_add_handler (modules, "modified", browser_info_update, st);
|
||||
/* hook the GimpContainer signals so we can refresh the display
|
||||
* appropriately.
|
||||
*/
|
||||
modules_handler_id =
|
||||
gimp_container_add_handler (modules, "modified", browser_info_update, st);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (modules), "add",
|
||||
browser_info_add, st);
|
||||
|
@ -629,7 +631,7 @@ module_initialize (const gchar *filename)
|
|||
mod->state = ST_UNLOADED_OK;
|
||||
}
|
||||
|
||||
gimp_set_add (modules, mod);
|
||||
gimp_container_add (modules, GIMP_OBJECT (mod));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -797,7 +799,7 @@ browser_destroy_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (modules), data);
|
||||
gimp_set_remove_handler (modules, modules_handler);
|
||||
gimp_container_remove_handler (modules, modules_handler_id);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
|
@ -1003,21 +1005,22 @@ make_list_item (gpointer data,
|
|||
|
||||
|
||||
static void
|
||||
browser_info_add (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
browser_info_add (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
{
|
||||
make_list_item (mod, st);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
browser_info_remove (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
browser_info_remove (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
{
|
||||
GList *dlist, *free_list;
|
||||
GtkWidget *list_item;
|
||||
GList *dlist;
|
||||
GList *free_list;
|
||||
GtkWidget *list_item;
|
||||
ModuleInfo *i;
|
||||
|
||||
dlist = gtk_container_children (GTK_CONTAINER (st->list));
|
||||
|
@ -1081,7 +1084,7 @@ module_db_module_remove (gpointer data,
|
|||
{
|
||||
ModuleInfo *mod = data;
|
||||
|
||||
gimp_set_remove (modules, mod);
|
||||
gimp_container_remove (modules, GIMP_OBJECT (mod));
|
||||
|
||||
module_info_free (mod);
|
||||
}
|
||||
|
@ -1113,7 +1116,7 @@ module_find_by_path (const char *fullpath)
|
|||
cl.found = NULL;
|
||||
cl.search_key = fullpath;
|
||||
|
||||
gimp_set_foreach (modules, module_db_path_cmp, &cl);
|
||||
gimp_container_foreach (modules, module_db_path_cmp, &cl);
|
||||
|
||||
return cl.found;
|
||||
}
|
||||
|
@ -1127,7 +1130,7 @@ browser_refresh_callback (GtkWidget *widget,
|
|||
GSList *kill_list = NULL;
|
||||
|
||||
/* remove modules we don't have on disk anymore */
|
||||
gimp_set_foreach (modules, module_db_module_ondisk, &kill_list);
|
||||
gimp_container_foreach (modules, module_db_module_ondisk, &kill_list);
|
||||
g_slist_foreach (kill_list, module_db_module_remove, NULL);
|
||||
g_slist_free (kill_list);
|
||||
kill_list = NULL;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
|
@ -458,9 +458,9 @@ palette_import_image_count (ImportType type)
|
|||
}
|
||||
|
||||
static void
|
||||
palette_import_image_new (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
palette_import_image_new (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! import_dialog)
|
||||
return;
|
||||
|
@ -488,9 +488,9 @@ palette_import_image_new (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
palette_import_image_destroyed (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
palette_import_image_destroyed (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! import_dialog)
|
||||
return;
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpimage.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "scale.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "boundary.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -2261,19 +2261,16 @@ void
|
|||
gdisplays_delete (void)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
GSList *list;
|
||||
|
||||
/* traverse the linked list of displays */
|
||||
for (list = display_list; list; list = g_slist_next (list))
|
||||
/* destroying the shell removes the GDisplay from the list, so
|
||||
* do a while loop "around" the first element to get them all
|
||||
*/
|
||||
while (display_list)
|
||||
{
|
||||
gdisp = (GDisplay *) list->data;
|
||||
gdisp = (GDisplay *) display_list->data;
|
||||
|
||||
gtk_widget_destroy (gdisp->shell);
|
||||
}
|
||||
|
||||
/* free up linked list data */
|
||||
g_slist_free (display_list);
|
||||
display_list = NULL;
|
||||
}
|
||||
|
||||
GDisplay *
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpimage.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "scale.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "boundary.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimage.h"
|
||||
#include "gimppreviewcache.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimprc.h"
|
||||
#include "nav_window.h"
|
||||
#include "scroll.h"
|
||||
|
@ -1325,7 +1325,7 @@ nav_window_change_display (GimpContext *context, /* NOT USED */
|
|||
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (gimage && gimp_set_have (image_context, gimage))
|
||||
if (gimage && gimp_container_lookup (image_context, GIMP_OBJECT (gimage)))
|
||||
{
|
||||
iwd->gdisp = gdisp;
|
||||
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimage.h"
|
||||
#include "gimppreviewcache.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimprc.h"
|
||||
#include "nav_window.h"
|
||||
#include "scroll.h"
|
||||
|
@ -1325,7 +1325,7 @@ nav_window_change_display (GimpContext *context, /* NOT USED */
|
|||
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (gimage && gimp_set_have (image_context, gimage))
|
||||
if (gimage && gimp_container_lookup (image_context, GIMP_OBJECT (gimage)))
|
||||
{
|
||||
iwd->gdisp = gdisp;
|
||||
|
||||
|
|
|
@ -2261,19 +2261,16 @@ void
|
|||
gdisplays_delete (void)
|
||||
{
|
||||
GDisplay *gdisp;
|
||||
GSList *list;
|
||||
|
||||
/* traverse the linked list of displays */
|
||||
for (list = display_list; list; list = g_slist_next (list))
|
||||
/* destroying the shell removes the GDisplay from the list, so
|
||||
* do a while loop "around" the first element to get them all
|
||||
*/
|
||||
while (display_list)
|
||||
{
|
||||
gdisp = (GDisplay *) list->data;
|
||||
gdisp = (GDisplay *) display_list->data;
|
||||
|
||||
gtk_widget_destroy (gdisp->shell);
|
||||
}
|
||||
|
||||
/* free up linked list data */
|
||||
g_slist_free (display_list);
|
||||
display_list = NULL;
|
||||
}
|
||||
|
||||
GDisplay *
|
||||
|
|
10
app/gimage.c
10
app/gimage.c
|
@ -22,14 +22,14 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdrawable.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimplayer.h"
|
||||
#include "gimpset.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "paint_funcs.h"
|
||||
#include "palette_import.h"
|
||||
|
@ -87,7 +87,7 @@ gimage_new (gint width,
|
|||
GTK_SIGNAL_FUNC (gimage_cmap_change_handler),
|
||||
NULL);
|
||||
|
||||
gimp_set_add (image_context, gimage);
|
||||
gimp_container_add (image_context, GIMP_OBJECT (gimage));
|
||||
|
||||
return gimage;
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ invalidate_cb (gpointer image,
|
|||
void
|
||||
gimage_invalidate_previews (void)
|
||||
{
|
||||
gimp_set_foreach (image_context, invalidate_cb, NULL);
|
||||
gimp_container_foreach (image_context, invalidate_cb, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -292,5 +292,5 @@ void
|
|||
gimage_foreach (GFunc func,
|
||||
gpointer user_data)
|
||||
{
|
||||
gimp_set_foreach (image_context, func, user_data);
|
||||
gimp_container_foreach (image_context, func, user_data);
|
||||
}
|
||||
|
|
|
@ -286,6 +286,9 @@ gimp_container_remove (GimpContainer *container,
|
|||
}
|
||||
}
|
||||
|
||||
container->children = g_list_remove (container->children, object);
|
||||
container->num_children--;
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (object));
|
||||
|
||||
switch (container->policy)
|
||||
|
@ -302,9 +305,6 @@ gimp_container_remove (GimpContainer *container,
|
|||
break;
|
||||
}
|
||||
|
||||
container->children = g_list_remove (container->children, object);
|
||||
container->num_children--;
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (container), container_signals[REMOVE], object);
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (object));
|
||||
|
@ -313,16 +313,13 @@ gimp_container_remove (GimpContainer *container,
|
|||
}
|
||||
|
||||
const GList *
|
||||
gimp_container_lookup (GimpContainer *container,
|
||||
GimpObject *object)
|
||||
gimp_container_lookup (const GimpContainer *container,
|
||||
const GimpObject *object)
|
||||
{
|
||||
g_return_val_if_fail (container != NULL, NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (container), NULL);
|
||||
|
||||
g_return_val_if_fail (object != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_CHECK_TYPE (object, container->children_type), NULL);
|
||||
|
||||
return g_list_find (container->children, object);
|
||||
return g_list_find (container->children, (gpointer) object);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -369,11 +366,14 @@ gimp_container_add_handler (GimpContainer *container,
|
|||
|
||||
g_free (key);
|
||||
|
||||
container->handlers = g_list_prepend (container->handlers, handler);
|
||||
|
||||
for (list = container->children; list; list = g_list_next (list))
|
||||
{
|
||||
object = GTK_OBJECT (list->data);
|
||||
|
||||
handler_id = gtk_signal_connect (object, signame,
|
||||
handler_id = gtk_signal_connect (object,
|
||||
handler->signame,
|
||||
handler->func,
|
||||
handler->user_data);
|
||||
|
||||
|
@ -420,14 +420,14 @@ gimp_container_remove_handler (GimpContainer *container,
|
|||
|
||||
if (handler_id)
|
||||
{
|
||||
gtk_signal_disconnect (object, handler->quark);
|
||||
gtk_signal_disconnect (object, handler_id);
|
||||
|
||||
gtk_object_set_data_by_id (object, handler->quark, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
container->handlers = g_list_remove (container->handlers, handler);
|
||||
|
||||
g_free (handler->signame);
|
||||
g_free (handler);
|
||||
|
||||
container->handlers = g_list_remove (container->handlers, handler);
|
||||
}
|
||||
|
|
|
@ -78,8 +78,8 @@ gboolean gimp_container_add (GimpContainer *container,
|
|||
gboolean gimp_container_remove (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
|
||||
const GList * gimp_container_lookup (GimpContainer *container,
|
||||
GimpObject *object);
|
||||
const GList * gimp_container_lookup (const GimpContainer *container,
|
||||
const GimpObject *object);
|
||||
void gimp_container_foreach (GimpContainer *container,
|
||||
GFunc func,
|
||||
gpointer user_data);
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpbrush.h"
|
||||
#include "gimpbrushlist.h"
|
||||
|
|
|
@ -122,7 +122,7 @@ gimp_drawable_preview_private (GimpDrawable *drawable,
|
|||
break;
|
||||
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
|
||||
type = INDEXED;
|
||||
bytes = (gimp_drawable_bytes (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
bytes = (gimp_drawable_type (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -3914,7 +3914,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
gint x, y, w, h;
|
||||
gint x1, y1, x2, y2;
|
||||
gint bytes;
|
||||
gint construct_flag;
|
||||
gboolean construct_flag;
|
||||
gint visible[MAX_CHANNELS] = {1, 1, 1, 1};
|
||||
gint off_x, off_y;
|
||||
|
||||
|
@ -3965,7 +3965,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
}
|
||||
}
|
||||
|
||||
construct_flag = 0;
|
||||
construct_flag = FALSE;
|
||||
|
||||
while (reverse_list)
|
||||
{
|
||||
|
@ -4051,7 +4051,7 @@ gimp_image_construct_composite_preview (GimpImage *gimage,
|
|||
break;
|
||||
}
|
||||
|
||||
construct_flag = 1;
|
||||
construct_flag = TRUE;
|
||||
|
||||
reverse_list = g_slist_next (reverse_list);
|
||||
}
|
||||
|
|
426
app/gimpset.c
426
app/gimpset.c
|
@ -1,426 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995-1997 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "apptypes.h"
|
||||
#include "gimpset.h"
|
||||
|
||||
|
||||
/* Yep, this can be optimized quite a lot */
|
||||
|
||||
typedef struct _GimpSetHandler
|
||||
{
|
||||
const gchar *signame;
|
||||
GtkSignalFunc func;
|
||||
gpointer user_data;
|
||||
} GimpSetHandler;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
gpointer object;
|
||||
GArray *handlers;
|
||||
guint destroy_handler;
|
||||
} Node;
|
||||
|
||||
enum
|
||||
{
|
||||
ADD,
|
||||
REMOVE,
|
||||
ACTIVE_CHANGED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
|
||||
static Node * gimp_set_find_node (GimpSet *set,
|
||||
gpointer object);
|
||||
static Node * gimp_set_node_new (GimpSet *set,
|
||||
gpointer object);
|
||||
static void gimp_set_node_free (GimpSet *set,
|
||||
Node *node);
|
||||
|
||||
|
||||
static guint gimp_set_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static GimpObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
static void
|
||||
gimp_set_destroy (GtkObject *object)
|
||||
{
|
||||
GimpSet *set = GIMP_SET (object);
|
||||
GSList *list;
|
||||
|
||||
for (list = set->list; list; list = list->next)
|
||||
gimp_set_node_free (set, list->data);
|
||||
|
||||
g_slist_free (set->list);
|
||||
g_array_free (set->handlers, TRUE);
|
||||
|
||||
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_set_init (GimpSet *set)
|
||||
{
|
||||
set->list = NULL;
|
||||
set->type = GTK_TYPE_OBJECT;
|
||||
set->handlers = g_array_new (FALSE, FALSE, sizeof (GimpSetHandler));
|
||||
set->active_element = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_set_class_init (GimpSetClass* klass)
|
||||
{
|
||||
GtkObjectClass *object_class;
|
||||
|
||||
object_class = (GtkObjectClass *) klass;
|
||||
|
||||
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
|
||||
|
||||
gimp_set_signals[ADD]=
|
||||
gtk_signal_new ("add",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpSetClass,
|
||||
add),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
GTK_TYPE_POINTER);
|
||||
|
||||
gimp_set_signals[REMOVE]=
|
||||
gtk_signal_new ("remove",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpSetClass,
|
||||
remove),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
GTK_TYPE_POINTER);
|
||||
|
||||
gimp_set_signals[ACTIVE_CHANGED]=
|
||||
gtk_signal_new ("active_changed",
|
||||
GTK_RUN_FIRST,
|
||||
object_class->type,
|
||||
GTK_SIGNAL_OFFSET (GimpSetClass,
|
||||
active_changed),
|
||||
gtk_marshal_NONE__POINTER,
|
||||
GTK_TYPE_NONE, 1,
|
||||
GTK_TYPE_POINTER);
|
||||
|
||||
gtk_object_class_add_signals (object_class, gimp_set_signals, LAST_SIGNAL);
|
||||
|
||||
object_class->destroy = gimp_set_destroy;
|
||||
|
||||
klass->add = NULL;
|
||||
klass->remove = NULL;
|
||||
klass->active_changed = NULL;
|
||||
}
|
||||
|
||||
GtkType
|
||||
gimp_set_get_type (void)
|
||||
{
|
||||
static GtkType set_type = 0;
|
||||
|
||||
if (! set_type)
|
||||
{
|
||||
GtkTypeInfo set_info =
|
||||
{
|
||||
"GimpSet",
|
||||
sizeof (GimpSet),
|
||||
sizeof (GimpSetClass),
|
||||
(GtkClassInitFunc) gimp_set_class_init,
|
||||
(GtkObjectInitFunc) gimp_set_init,
|
||||
/* reserved_1 */ NULL,
|
||||
/* reserved_2 */ NULL,
|
||||
(GtkClassInitFunc) NULL
|
||||
};
|
||||
|
||||
set_type = gtk_type_unique (GIMP_TYPE_OBJECT, &set_info);
|
||||
}
|
||||
|
||||
return set_type;
|
||||
}
|
||||
|
||||
|
||||
GimpSet *
|
||||
gimp_set_new (GtkType type,
|
||||
gboolean weak)
|
||||
{
|
||||
GimpSet *set;
|
||||
|
||||
/* untyped sets must not be weak, since we can't attach a
|
||||
* destroy handler
|
||||
*/
|
||||
g_assert (!(type == GTK_TYPE_NONE && weak == TRUE));
|
||||
|
||||
set = gtk_type_new (GIMP_TYPE_SET);
|
||||
set->type = type;
|
||||
set->weak = weak;
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_set_destroy_cb (GtkObject *object,
|
||||
gpointer data)
|
||||
{
|
||||
GimpSet *set = GIMP_SET (data);
|
||||
|
||||
gimp_set_remove (set, object);
|
||||
}
|
||||
|
||||
static Node *
|
||||
gimp_set_find_node (GimpSet *set,
|
||||
gpointer object)
|
||||
{
|
||||
GSList *list = set->list;
|
||||
|
||||
for (list = set->list; list; list = list->next)
|
||||
{
|
||||
Node *node = list->data;
|
||||
|
||||
if (node->object == object)
|
||||
return node;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Node *
|
||||
gimp_set_node_new (GimpSet *set,
|
||||
gpointer object)
|
||||
{
|
||||
gint i;
|
||||
Node *node = g_new (Node, 1);
|
||||
|
||||
node->object = object;
|
||||
node->handlers = g_array_new (FALSE, FALSE, sizeof (guint));
|
||||
g_array_set_size (node->handlers, set->handlers->len);
|
||||
|
||||
for (i = 0; i < node->handlers->len; i++)
|
||||
{
|
||||
GimpSetHandler *handler =
|
||||
&g_array_index (set->handlers, GimpSetHandler, i);
|
||||
|
||||
if (handler->signame)
|
||||
g_array_index (node->handlers, guint, i)
|
||||
= gtk_signal_connect (GTK_OBJECT (object),
|
||||
handler->signame,
|
||||
handler->func,
|
||||
handler->user_data);
|
||||
}
|
||||
|
||||
if (set->weak)
|
||||
node->destroy_handler =
|
||||
gtk_signal_connect (GTK_OBJECT (object), "destroy",
|
||||
GTK_SIGNAL_FUNC (gimp_set_destroy_cb),
|
||||
set);
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_set_node_free (GimpSet *set,
|
||||
Node *node)
|
||||
{
|
||||
gint i;
|
||||
GimpObject *object = node->object;
|
||||
|
||||
for (i = 0; i < set->handlers->len; i++)
|
||||
{
|
||||
GimpSetHandler *handler =
|
||||
&g_array_index (set->handlers, GimpSetHandler, i);
|
||||
|
||||
if (handler->signame)
|
||||
gtk_signal_disconnect (GTK_OBJECT (object),
|
||||
g_array_index (node->handlers, guint, i));
|
||||
}
|
||||
|
||||
if (set->weak)
|
||||
gtk_signal_disconnect (GTK_OBJECT (object),
|
||||
node->destroy_handler);
|
||||
|
||||
g_array_free (node->handlers, TRUE);
|
||||
g_free (node);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_set_add (GimpSet *set,
|
||||
gpointer object)
|
||||
{
|
||||
g_return_val_if_fail (set, FALSE);
|
||||
|
||||
if (set->type != GTK_TYPE_NONE)
|
||||
g_return_val_if_fail (GTK_CHECK_TYPE (object, set->type), FALSE);
|
||||
|
||||
if (gimp_set_find_node (set, object))
|
||||
return FALSE;
|
||||
|
||||
set->list = g_slist_prepend (set->list, gimp_set_node_new (set, object));
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (set), gimp_set_signals[ADD], object);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_set_remove (GimpSet *set,
|
||||
gpointer object)
|
||||
{
|
||||
Node *node;
|
||||
|
||||
g_return_val_if_fail (set, FALSE);
|
||||
|
||||
node = gimp_set_find_node (set, object);
|
||||
g_return_val_if_fail (node, FALSE);
|
||||
|
||||
gimp_set_node_free (set, node);
|
||||
set->list = g_slist_remove (set->list, node);
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (set), gimp_set_signals[REMOVE], object);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_set_have (GimpSet *set,
|
||||
gpointer object)
|
||||
{
|
||||
return (gimp_set_find_node (set, object) != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_set_foreach (GimpSet *set,
|
||||
GFunc func,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
for (list = set->list; list; list = list->next)
|
||||
{
|
||||
Node *node = list->data;
|
||||
|
||||
func (node->object, user_data);
|
||||
}
|
||||
}
|
||||
|
||||
GtkType
|
||||
gimp_set_type (GimpSet* set)
|
||||
{
|
||||
return set->type;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_set_set_active (GimpSet *set,
|
||||
gpointer object)
|
||||
{
|
||||
if (object != set->active_element && gimp_set_have (set, object))
|
||||
{
|
||||
set->active_element = object;
|
||||
gtk_signal_emit (GTK_OBJECT (set),
|
||||
gimp_set_signals[ACTIVE_CHANGED],
|
||||
object);
|
||||
}
|
||||
}
|
||||
|
||||
gpointer
|
||||
gimp_set_get_active (GimpSet *set)
|
||||
{
|
||||
if (gimp_set_have (set, set->active_element))
|
||||
return set->active_element;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GimpSetHandlerId
|
||||
gimp_set_add_handler (GimpSet *set,
|
||||
const gchar *signame,
|
||||
GtkSignalFunc handler,
|
||||
gpointer user_data)
|
||||
{
|
||||
GimpSetHandler set_handler;
|
||||
GSList *list;
|
||||
guint a;
|
||||
|
||||
g_assert (signame);
|
||||
|
||||
/* you can't set a handler on something that's not a GTK object */
|
||||
g_assert (set->type != GTK_TYPE_NONE);
|
||||
|
||||
set_handler.signame = signame;
|
||||
set_handler.func = handler;
|
||||
set_handler.user_data = user_data;
|
||||
|
||||
for (a = 0; a < set->handlers->len; a++)
|
||||
if (! g_array_index (set->handlers, GimpSetHandler, a).signame)
|
||||
break;
|
||||
|
||||
if (a < set->handlers->len)
|
||||
{
|
||||
g_array_index (set->handlers, GimpSetHandler, a) = set_handler;
|
||||
|
||||
for (list = set->list; list; list = list->next)
|
||||
{
|
||||
Node *node = list->data;
|
||||
guint i = gtk_signal_connect (GTK_OBJECT (node->object), signame,
|
||||
handler,
|
||||
user_data);
|
||||
g_array_index (node->handlers, guint, a) = i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_array_append_val (set->handlers, set_handler);
|
||||
|
||||
for (list = set->list; list; list = list->next)
|
||||
{
|
||||
Node *node = list->data;
|
||||
|
||||
guint i = gtk_signal_connect (GTK_OBJECT(node->object), signame,
|
||||
handler,
|
||||
user_data);
|
||||
g_array_append_val (node->handlers, i);
|
||||
}
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
void
|
||||
gimp_set_remove_handler (GimpSet *set,
|
||||
GimpSetHandlerId id)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
/* you can't remove a signal handler on something that's not a GTK object */
|
||||
g_return_if_fail (set->type != GTK_TYPE_NONE);
|
||||
|
||||
for (list = set->list; list; list = list->next)
|
||||
{
|
||||
Node *node = list->data;
|
||||
|
||||
gtk_signal_disconnect (GTK_OBJECT (node->object),
|
||||
g_array_index (node->handlers, guint, id));
|
||||
}
|
||||
|
||||
g_array_index (set->handlers, GimpSetHandler, id).signame = NULL;
|
||||
}
|
100
app/gimpset.h
100
app/gimpset.h
|
@ -1,100 +0,0 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* 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
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GIMP_SET_H__
|
||||
#define __GIMP_SET_H__
|
||||
|
||||
|
||||
#include "gimpobject.h"
|
||||
|
||||
|
||||
/* GimpSet - a (usually) typed set of objects with signals for adding
|
||||
* and removing of stuff. If it is weak, destroyed objects get removed
|
||||
* automatically. If it is not, it refs them so they won't be freed
|
||||
* till they are removed. (Though they can be destroyed, of course).
|
||||
*
|
||||
* If GTK_TYPE_NONE is specified at gimpset creation time, no type
|
||||
* checking is performed by gimp_set_add() and the
|
||||
* gimp_set_{add,remove}_handler() functions should not be used. It
|
||||
* is also illegal to ask for a weak untyped gimpset.
|
||||
*/
|
||||
|
||||
#define GIMP_TYPE_SET (gimp_set_get_type ())
|
||||
#define GIMP_SET(obj) (GTK_CHECK_CAST ((obj), GIMP_TYPE_SET, GimpSet))
|
||||
#define GIMP_SET_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GIMP_TYPE_SET, GimpSetClass))
|
||||
#define GIMP_IS_SET(obj) (GTK_CHECK_TYPE ((obj), GIMP_TYPE_SET))
|
||||
#define GIMP_IS_SET_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_SET))
|
||||
|
||||
|
||||
typedef struct _GimpSetClass GimpSetClass;
|
||||
|
||||
struct _GimpSet
|
||||
{
|
||||
GimpObject parent_instance;
|
||||
|
||||
GtkType type;
|
||||
GSList *list;
|
||||
GArray *handlers;
|
||||
gboolean weak;
|
||||
gpointer active_element;
|
||||
};
|
||||
|
||||
struct _GimpSetClass
|
||||
{
|
||||
GimpObjectClass parent_class;
|
||||
|
||||
void (* add) (GimpSet *gimpset,
|
||||
gpointer object);
|
||||
void (* remove) (GimpSet *gimpset,
|
||||
gpointer object);
|
||||
void (* active_changed) (GimpSet *gimpset,
|
||||
gpointer object);
|
||||
};
|
||||
|
||||
|
||||
GtkType gimp_set_get_type (void);
|
||||
GimpSet * gimp_set_new (GtkType type,
|
||||
gboolean weak);
|
||||
|
||||
GtkType gimp_set_type (GimpSet *set);
|
||||
|
||||
gboolean gimp_set_add (GimpSet *gimpset,
|
||||
gpointer object);
|
||||
gboolean gimp_set_remove (GimpSet *gimpset,
|
||||
gpointer object);
|
||||
|
||||
gboolean gimp_set_have (GimpSet *gimpset,
|
||||
gpointer object);
|
||||
void gimp_set_foreach (GimpSet *gimpset,
|
||||
GFunc func,
|
||||
gpointer user_data);
|
||||
gint gimp_set_size (GimpSet *gimpset);
|
||||
|
||||
void gimp_set_set_active (GimpSet *gimpset,
|
||||
gpointer object);
|
||||
gpointer gimp_set_get_active (GimpSet *gimpset);
|
||||
|
||||
GimpSetHandlerId gimp_set_add_handler (GimpSet *set,
|
||||
const gchar *signame,
|
||||
GtkSignalFunc handler,
|
||||
gpointer user_data);
|
||||
void gimp_set_remove_handler (GimpSet *set,
|
||||
GimpSetHandlerId id);
|
||||
|
||||
|
||||
#endif /* __GIMP_SET_H__ */
|
|
@ -38,9 +38,9 @@
|
|||
#include "colormaps.h"
|
||||
#include "color_area.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpset.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
|
@ -117,7 +117,7 @@ static void index_adjustment_change_cb (GtkAdjustment *adjustment,
|
|||
static void hex_entry_change_cb (GtkEntry *entry,
|
||||
GimpColormapDialog *ipal);
|
||||
|
||||
static void set_addrem_cb (GimpSet *set,
|
||||
static void container_addrem_cb (GimpContainer *container,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal);
|
||||
static void image_rename_cb (GimpImage *img,
|
||||
|
@ -223,7 +223,7 @@ gimp_colormap_dialog_init (GimpColormapDialog *colormap_dialog)
|
|||
}
|
||||
|
||||
GimpColormapDialog *
|
||||
gimp_colormap_dialog_create (GimpSet *context)
|
||||
gimp_colormap_dialog_create (GimpContainer *context)
|
||||
{
|
||||
GimpColormapDialog *ipal;
|
||||
GtkWidget *vbox;
|
||||
|
@ -237,7 +237,7 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
GtkAccelGroup *accel_group;
|
||||
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
g_return_val_if_fail (GIMP_IS_SET (context), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (context), NULL);
|
||||
|
||||
ipal = gtk_type_new (GIMP_TYPE_COLORMAP_DIALOG);
|
||||
|
||||
|
@ -251,14 +251,14 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
|
||||
ipal->image = NULL;
|
||||
ipal->context = context;
|
||||
ipal->cmap_changed_handler = gimp_set_add_handler (context,
|
||||
"colormap_changed",
|
||||
image_cmap_change_cb,
|
||||
ipal);
|
||||
ipal->rename_handler = gimp_set_add_handler (context,
|
||||
"name_changed",
|
||||
image_rename_cb,
|
||||
ipal);
|
||||
ipal->cmap_changed_handler = gimp_container_add_handler (context,
|
||||
"colormap_changed",
|
||||
image_cmap_change_cb,
|
||||
ipal);
|
||||
ipal->rename_handler = gimp_container_add_handler (context,
|
||||
"name_changed",
|
||||
image_rename_cb,
|
||||
ipal);
|
||||
|
||||
accel_group = gtk_accel_group_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (ipal), "indexed_color_palette", "Gimp");
|
||||
|
@ -372,10 +372,10 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
ipal_update_image_list (ipal);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (context), "add",
|
||||
GTK_SIGNAL_FUNC (set_addrem_cb),
|
||||
GTK_SIGNAL_FUNC (container_addrem_cb),
|
||||
ipal);
|
||||
gtk_signal_connect (GTK_OBJECT (context), "remove",
|
||||
GTK_SIGNAL_FUNC (set_addrem_cb),
|
||||
GTK_SIGNAL_FUNC (container_addrem_cb),
|
||||
ipal);
|
||||
|
||||
return ipal;
|
||||
|
@ -802,9 +802,9 @@ hex_entry_change_cb (GtkEntry *entry,
|
|||
}
|
||||
|
||||
static void
|
||||
set_addrem_cb (GimpSet *set,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal)
|
||||
container_addrem_cb (GimpContainer *set,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal)
|
||||
{
|
||||
ipal_update_image_list (ipal);
|
||||
}
|
||||
|
@ -878,7 +878,8 @@ ipal_set_image (GimpColormapDialog *ipal,
|
|||
if (!ipal->image)
|
||||
gtk_signal_handler_unblock (GTK_OBJECT (ipal->palette),
|
||||
ipal->event_handler);
|
||||
g_return_if_fail (gimp_set_have (ipal->context, gimage));
|
||||
g_return_if_fail (gimp_container_lookup (ipal->context,
|
||||
GIMP_OBJECT (gimage)));
|
||||
g_return_if_fail (gimp_image_base_type (gimage) == INDEXED);
|
||||
ipal->image = gimage;
|
||||
ipal_draw (ipal);
|
||||
|
@ -1139,7 +1140,7 @@ create_image_menu (GimpColormapDialog *ipal,
|
|||
|
||||
*default_index = -1;
|
||||
|
||||
gimp_set_foreach (ipal->context, create_image_menu_cb, &data);
|
||||
gimp_container_foreach (ipal->context, create_image_menu_cb, &data);
|
||||
|
||||
if (!data.num_items)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ struct _GimpColormapDialog
|
|||
GtkWidget *image_menu;
|
||||
GtkWidget *popup_menu;
|
||||
GtkOptionMenu *option_menu;
|
||||
GimpSet *context;
|
||||
GimpContainer *context;
|
||||
guint event_handler;
|
||||
gint xn;
|
||||
gint yn;
|
||||
|
@ -68,7 +68,7 @@ struct _GimpColormapDialogClass
|
|||
|
||||
|
||||
GtkType gimp_colormap_dialog_get_type (void);
|
||||
GimpColormapDialog * gimp_colormap_dialog_create (GimpSet* context);
|
||||
GimpColormapDialog * gimp_colormap_dialog_create (GimpContainer *context);
|
||||
|
||||
void gimp_colormap_dialog_selected (GimpColormapDialog *colormap_dialog);
|
||||
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brush_select.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "color_area.h"
|
||||
#include "commands.h"
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
|
|
|
@ -29,13 +29,13 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "about_dialog.h"
|
||||
#include "app_procs.h"
|
||||
#include "brush_select.h"
|
||||
#include "colormap_dialog.h"
|
||||
#include "color_area.h"
|
||||
#include "commands.h"
|
||||
#include "context_manager.h"
|
||||
#include "convert.h"
|
||||
#include "desaturate.h"
|
||||
#include "devices.h"
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpset.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
|
||||
|
@ -345,7 +345,7 @@ info_window_change_display (GimpContext *context, /* NOT USED */
|
|||
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (gimage && gimp_set_have (image_context, gimage))
|
||||
if (gimage && gimp_container_lookup (image_context, GIMP_OBJECT (gimage)))
|
||||
{
|
||||
iwd->gdisp = gdisp;
|
||||
info_window_update (gdisp);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "module_db.h"
|
||||
#include "gimprc.h"
|
||||
#include "datafiles.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimpcontainer.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpmodule.h"
|
||||
|
@ -135,8 +135,8 @@ typedef struct
|
|||
} BrowserState;
|
||||
|
||||
/* global set of module_info pointers */
|
||||
static GimpSet *modules;
|
||||
static GimpSetHandlerId modules_handler;
|
||||
static GimpContainer *modules;
|
||||
static GQuark modules_handler_id;
|
||||
|
||||
/* If the inhibit state of any modules changes, we might need to
|
||||
* re-write the modulerc.
|
||||
|
@ -159,41 +159,41 @@ static gboolean need_to_rewrite_modulerc = FALSE;
|
|||
|
||||
|
||||
/* prototypes */
|
||||
static void module_initialize (const gchar *filename);
|
||||
static void mod_load (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static void mod_unload (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static gboolean mod_idle_unref (ModuleInfo *mod);
|
||||
static ModuleInfo * module_find_by_path (const gchar *fullpath);
|
||||
static void module_initialize (const gchar *filename);
|
||||
static void mod_load (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static void mod_unload (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static gboolean mod_idle_unref (ModuleInfo *mod);
|
||||
static ModuleInfo * module_find_by_path (const gchar *fullpath);
|
||||
|
||||
#ifdef DUMP_DB
|
||||
static void print_module_info (gpointer data,
|
||||
gpointer user_data);
|
||||
static void print_module_info (gpointer data,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
|
||||
static void browser_popdown_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_destroy_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_info_update (ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_add (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_remove (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_init (BrowserState *st,
|
||||
GtkWidget *table);
|
||||
static void browser_select_callback (GtkWidget *widget,
|
||||
GtkWidget *child);
|
||||
static void browser_load_unload_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_refresh_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void make_list_item (gpointer data,
|
||||
gpointer user_data);
|
||||
static void browser_popdown_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_destroy_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_info_update (ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_add (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_remove (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_init (BrowserState *st,
|
||||
GtkWidget *table);
|
||||
static void browser_select_callback (GtkWidget *widget,
|
||||
GtkWidget *child);
|
||||
static void browser_load_unload_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_refresh_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void make_list_item (gpointer data,
|
||||
gpointer user_data);
|
||||
|
||||
static void gimp_module_ref (ModuleInfo *mod);
|
||||
static void gimp_module_unref (ModuleInfo *mod);
|
||||
|
@ -215,13 +215,14 @@ module_db_init (void)
|
|||
|
||||
/* Load and initialize gimp modules */
|
||||
|
||||
modules = gimp_set_new (MODULE_INFO_TYPE, FALSE);
|
||||
modules = gimp_container_new (MODULE_INFO_TYPE,
|
||||
GIMP_CONTAINER_POLICY_WEAK);
|
||||
|
||||
if (g_module_supported ())
|
||||
datafiles_read_directories (module_path,
|
||||
module_initialize, 0 /* no flags */);
|
||||
#ifdef DUMP_DB
|
||||
gimp_set_foreach (modules, print_module_info, NULL);
|
||||
gimp_container_foreach (modules, print_module_info, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -262,7 +263,7 @@ module_db_write_modulerc (void)
|
|||
gboolean saved = FALSE;
|
||||
|
||||
str = g_string_new (NULL);
|
||||
gimp_set_foreach (modules, add_to_inhibit_string, str);
|
||||
gimp_container_foreach (modules, add_to_inhibit_string, str);
|
||||
if (str->len > 0)
|
||||
p = str->str + 1;
|
||||
else
|
||||
|
@ -293,7 +294,7 @@ module_db_free (void)
|
|||
need_to_rewrite_modulerc = FALSE;
|
||||
}
|
||||
}
|
||||
gimp_set_foreach (modules, free_a_single_module, NULL);
|
||||
gimp_container_foreach (modules, free_a_single_module, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -338,7 +339,7 @@ module_db_browser_new (void)
|
|||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (listbox),
|
||||
st->list);
|
||||
|
||||
gimp_set_foreach (modules, make_list_item, st);
|
||||
gimp_container_foreach (modules, make_list_item, st);
|
||||
|
||||
gtk_widget_show (st->list);
|
||||
|
||||
|
@ -374,10 +375,11 @@ module_db_browser_new (void)
|
|||
gtk_signal_connect (GTK_OBJECT (st->list), "select_child",
|
||||
browser_select_callback, NULL);
|
||||
|
||||
/* hook the gimpset signals so we can refresh the display
|
||||
* appropriately. */
|
||||
modules_handler =
|
||||
gimp_set_add_handler (modules, "modified", browser_info_update, st);
|
||||
/* hook the GimpContainer signals so we can refresh the display
|
||||
* appropriately.
|
||||
*/
|
||||
modules_handler_id =
|
||||
gimp_container_add_handler (modules, "modified", browser_info_update, st);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (modules), "add",
|
||||
browser_info_add, st);
|
||||
|
@ -629,7 +631,7 @@ module_initialize (const gchar *filename)
|
|||
mod->state = ST_UNLOADED_OK;
|
||||
}
|
||||
|
||||
gimp_set_add (modules, mod);
|
||||
gimp_container_add (modules, GIMP_OBJECT (mod));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -797,7 +799,7 @@ browser_destroy_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (modules), data);
|
||||
gimp_set_remove_handler (modules, modules_handler);
|
||||
gimp_container_remove_handler (modules, modules_handler_id);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
|
@ -1003,21 +1005,22 @@ make_list_item (gpointer data,
|
|||
|
||||
|
||||
static void
|
||||
browser_info_add (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
browser_info_add (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
{
|
||||
make_list_item (mod, st);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
browser_info_remove (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
browser_info_remove (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
{
|
||||
GList *dlist, *free_list;
|
||||
GtkWidget *list_item;
|
||||
GList *dlist;
|
||||
GList *free_list;
|
||||
GtkWidget *list_item;
|
||||
ModuleInfo *i;
|
||||
|
||||
dlist = gtk_container_children (GTK_CONTAINER (st->list));
|
||||
|
@ -1081,7 +1084,7 @@ module_db_module_remove (gpointer data,
|
|||
{
|
||||
ModuleInfo *mod = data;
|
||||
|
||||
gimp_set_remove (modules, mod);
|
||||
gimp_container_remove (modules, GIMP_OBJECT (mod));
|
||||
|
||||
module_info_free (mod);
|
||||
}
|
||||
|
@ -1113,7 +1116,7 @@ module_find_by_path (const char *fullpath)
|
|||
cl.found = NULL;
|
||||
cl.search_key = fullpath;
|
||||
|
||||
gimp_set_foreach (modules, module_db_path_cmp, &cl);
|
||||
gimp_container_foreach (modules, module_db_path_cmp, &cl);
|
||||
|
||||
return cl.found;
|
||||
}
|
||||
|
@ -1127,7 +1130,7 @@ browser_refresh_callback (GtkWidget *widget,
|
|||
GSList *kill_list = NULL;
|
||||
|
||||
/* remove modules we don't have on disk anymore */
|
||||
gimp_set_foreach (modules, module_db_module_ondisk, &kill_list);
|
||||
gimp_container_foreach (modules, module_db_module_ondisk, &kill_list);
|
||||
g_slist_foreach (kill_list, module_db_module_remove, NULL);
|
||||
g_slist_free (kill_list);
|
||||
kill_list = NULL;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
|
@ -458,9 +458,9 @@ palette_import_image_count (ImportType type)
|
|||
}
|
||||
|
||||
static void
|
||||
palette_import_image_new (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
palette_import_image_new (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! import_dialog)
|
||||
return;
|
||||
|
@ -488,9 +488,9 @@ palette_import_image_new (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
palette_import_image_destroyed (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
palette_import_image_destroyed (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! import_dialog)
|
||||
return;
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "gimage_mask.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpset.h"
|
||||
#include "image_render.h"
|
||||
#include "lc_dialogP.h"
|
||||
#include "menus.h"
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpset.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
|
||||
|
@ -345,7 +345,7 @@ info_window_change_display (GimpContext *context, /* NOT USED */
|
|||
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (gimage && gimp_set_have (image_context, gimage))
|
||||
if (gimage && gimp_container_lookup (image_context, GIMP_OBJECT (gimage)))
|
||||
{
|
||||
iwd->gdisp = gdisp;
|
||||
info_window_update (gdisp);
|
||||
|
|
|
@ -25,14 +25,14 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimppreviewcache.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpset.h"
|
||||
#include "image_render.h"
|
||||
#include "lc_dialog.h"
|
||||
#include "lc_dialogP.h"
|
||||
|
@ -50,23 +50,23 @@
|
|||
|
||||
|
||||
/* local function prototypes */
|
||||
static void lc_dialog_update (GimpImage *gimage);
|
||||
static void lc_dialog_image_menu_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void lc_dialog_auto_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static gint lc_dialog_close_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void lc_dialog_add_callback (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data);
|
||||
static void lc_dialog_remove_callback (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data);
|
||||
static void lc_dialog_change_image (GimpContext *context,
|
||||
GimpImage *gimage,
|
||||
gpointer data);
|
||||
static void lc_dialog_help_func (const gchar *help_data);
|
||||
static void lc_dialog_update (GimpImage *gimage);
|
||||
static void lc_dialog_image_menu_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void lc_dialog_auto_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static gint lc_dialog_close_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void lc_dialog_add_callback (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data);
|
||||
static void lc_dialog_remove_callback (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data);
|
||||
static void lc_dialog_change_image (GimpContext *context,
|
||||
GimpImage *gimage,
|
||||
gpointer data);
|
||||
static void lc_dialog_help_func (const gchar *help_data);
|
||||
|
||||
static void lc_dialog_image_menu_preview_update_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
@ -354,7 +354,8 @@ lc_dialog_image_menu_preview_update_callback (GtkWidget *widget,
|
|||
gimage = (GimpImage *) gtk_object_get_data (GTK_OBJECT (widget),
|
||||
"menu_preview_gimage");
|
||||
|
||||
if (menu_preview && gimage && gimage_to_update == gimage)
|
||||
if (menu_preview && gimage && gimage_to_update == gimage &&
|
||||
gimp_container_lookup (image_context, (GimpObject *) gimage))
|
||||
{
|
||||
/* Must update the preview? */
|
||||
lc_dialog_fill_preview_with_thumb (menu_preview,
|
||||
|
@ -438,7 +439,7 @@ lc_dialog_fill_preview_with_thumb (GtkWidget *widget,
|
|||
gint height)
|
||||
{
|
||||
guchar *drawable_data;
|
||||
TempBuf *buf;
|
||||
TempBuf *buf = NULL;
|
||||
gint bpp;
|
||||
gint x, y;
|
||||
guchar *src;
|
||||
|
@ -715,9 +716,9 @@ lc_dialog_close_callback (GtkWidget *widget,
|
|||
}
|
||||
|
||||
static void
|
||||
lc_dialog_add_callback (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
lc_dialog_add_callback (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! lc_dialog)
|
||||
return;
|
||||
|
@ -726,9 +727,9 @@ lc_dialog_add_callback (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
lc_dialog_remove_callback (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
lc_dialog_remove_callback (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! lc_dialog)
|
||||
return;
|
||||
|
@ -744,7 +745,7 @@ lc_dialog_change_image (GimpContext *context,
|
|||
if (! lc_dialog || ! lc_dialog->auto_follow_active)
|
||||
return;
|
||||
|
||||
if (gimage && gimp_set_have (image_context, gimage))
|
||||
if (gimage && gimp_container_lookup (image_context, GIMP_OBJECT (gimage)))
|
||||
{
|
||||
lc_dialog_update (gimage);
|
||||
lc_dialog_update_image_list ();
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gimplut.h"
|
||||
#include "gimphistogram.h"
|
||||
|
||||
|
|
|
@ -79,8 +79,6 @@ gboolean console_messages = FALSE;
|
|||
gboolean restore_session = FALSE;
|
||||
gboolean double_speed = FALSE;
|
||||
|
||||
GimpSet *image_context = NULL;
|
||||
|
||||
MessageHandlerType message_handler = CONSOLE;
|
||||
|
||||
gchar *prog_name = NULL; /* The path name we are invoked with */
|
||||
|
|
115
app/module_db.c
115
app/module_db.c
|
@ -41,7 +41,7 @@
|
|||
#include "module_db.h"
|
||||
#include "gimprc.h"
|
||||
#include "datafiles.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimpcontainer.h"
|
||||
|
||||
#include "libgimp/gimpenv.h"
|
||||
#include "libgimp/gimpmodule.h"
|
||||
|
@ -135,8 +135,8 @@ typedef struct
|
|||
} BrowserState;
|
||||
|
||||
/* global set of module_info pointers */
|
||||
static GimpSet *modules;
|
||||
static GimpSetHandlerId modules_handler;
|
||||
static GimpContainer *modules;
|
||||
static GQuark modules_handler_id;
|
||||
|
||||
/* If the inhibit state of any modules changes, we might need to
|
||||
* re-write the modulerc.
|
||||
|
@ -159,41 +159,41 @@ static gboolean need_to_rewrite_modulerc = FALSE;
|
|||
|
||||
|
||||
/* prototypes */
|
||||
static void module_initialize (const gchar *filename);
|
||||
static void mod_load (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static void mod_unload (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static gboolean mod_idle_unref (ModuleInfo *mod);
|
||||
static ModuleInfo * module_find_by_path (const gchar *fullpath);
|
||||
static void module_initialize (const gchar *filename);
|
||||
static void mod_load (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static void mod_unload (ModuleInfo *mod,
|
||||
gboolean verbose);
|
||||
static gboolean mod_idle_unref (ModuleInfo *mod);
|
||||
static ModuleInfo * module_find_by_path (const gchar *fullpath);
|
||||
|
||||
#ifdef DUMP_DB
|
||||
static void print_module_info (gpointer data,
|
||||
gpointer user_data);
|
||||
static void print_module_info (gpointer data,
|
||||
gpointer user_data);
|
||||
#endif
|
||||
|
||||
static void browser_popdown_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_destroy_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_info_update (ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_add (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_remove (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_init (BrowserState *st,
|
||||
GtkWidget *table);
|
||||
static void browser_select_callback (GtkWidget *widget,
|
||||
GtkWidget *child);
|
||||
static void browser_load_unload_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_refresh_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void make_list_item (gpointer data,
|
||||
gpointer user_data);
|
||||
static void browser_popdown_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_destroy_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_info_update (ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_add (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_remove (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st);
|
||||
static void browser_info_init (BrowserState *st,
|
||||
GtkWidget *table);
|
||||
static void browser_select_callback (GtkWidget *widget,
|
||||
GtkWidget *child);
|
||||
static void browser_load_unload_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void browser_refresh_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
static void make_list_item (gpointer data,
|
||||
gpointer user_data);
|
||||
|
||||
static void gimp_module_ref (ModuleInfo *mod);
|
||||
static void gimp_module_unref (ModuleInfo *mod);
|
||||
|
@ -215,13 +215,14 @@ module_db_init (void)
|
|||
|
||||
/* Load and initialize gimp modules */
|
||||
|
||||
modules = gimp_set_new (MODULE_INFO_TYPE, FALSE);
|
||||
modules = gimp_container_new (MODULE_INFO_TYPE,
|
||||
GIMP_CONTAINER_POLICY_WEAK);
|
||||
|
||||
if (g_module_supported ())
|
||||
datafiles_read_directories (module_path,
|
||||
module_initialize, 0 /* no flags */);
|
||||
#ifdef DUMP_DB
|
||||
gimp_set_foreach (modules, print_module_info, NULL);
|
||||
gimp_container_foreach (modules, print_module_info, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -262,7 +263,7 @@ module_db_write_modulerc (void)
|
|||
gboolean saved = FALSE;
|
||||
|
||||
str = g_string_new (NULL);
|
||||
gimp_set_foreach (modules, add_to_inhibit_string, str);
|
||||
gimp_container_foreach (modules, add_to_inhibit_string, str);
|
||||
if (str->len > 0)
|
||||
p = str->str + 1;
|
||||
else
|
||||
|
@ -293,7 +294,7 @@ module_db_free (void)
|
|||
need_to_rewrite_modulerc = FALSE;
|
||||
}
|
||||
}
|
||||
gimp_set_foreach (modules, free_a_single_module, NULL);
|
||||
gimp_container_foreach (modules, free_a_single_module, NULL);
|
||||
}
|
||||
|
||||
|
||||
|
@ -338,7 +339,7 @@ module_db_browser_new (void)
|
|||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (listbox),
|
||||
st->list);
|
||||
|
||||
gimp_set_foreach (modules, make_list_item, st);
|
||||
gimp_container_foreach (modules, make_list_item, st);
|
||||
|
||||
gtk_widget_show (st->list);
|
||||
|
||||
|
@ -374,10 +375,11 @@ module_db_browser_new (void)
|
|||
gtk_signal_connect (GTK_OBJECT (st->list), "select_child",
|
||||
browser_select_callback, NULL);
|
||||
|
||||
/* hook the gimpset signals so we can refresh the display
|
||||
* appropriately. */
|
||||
modules_handler =
|
||||
gimp_set_add_handler (modules, "modified", browser_info_update, st);
|
||||
/* hook the GimpContainer signals so we can refresh the display
|
||||
* appropriately.
|
||||
*/
|
||||
modules_handler_id =
|
||||
gimp_container_add_handler (modules, "modified", browser_info_update, st);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (modules), "add",
|
||||
browser_info_add, st);
|
||||
|
@ -629,7 +631,7 @@ module_initialize (const gchar *filename)
|
|||
mod->state = ST_UNLOADED_OK;
|
||||
}
|
||||
|
||||
gimp_set_add (modules, mod);
|
||||
gimp_container_add (modules, GIMP_OBJECT (mod));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -797,7 +799,7 @@ browser_destroy_callback (GtkWidget *widget,
|
|||
gpointer data)
|
||||
{
|
||||
gtk_signal_disconnect_by_data (GTK_OBJECT (modules), data);
|
||||
gimp_set_remove_handler (modules, modules_handler);
|
||||
gimp_container_remove_handler (modules, modules_handler_id);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
|
@ -1003,21 +1005,22 @@ make_list_item (gpointer data,
|
|||
|
||||
|
||||
static void
|
||||
browser_info_add (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
browser_info_add (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
{
|
||||
make_list_item (mod, st);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
browser_info_remove (GimpSet *set,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
browser_info_remove (GimpContainer *container,
|
||||
ModuleInfo *mod,
|
||||
BrowserState *st)
|
||||
{
|
||||
GList *dlist, *free_list;
|
||||
GtkWidget *list_item;
|
||||
GList *dlist;
|
||||
GList *free_list;
|
||||
GtkWidget *list_item;
|
||||
ModuleInfo *i;
|
||||
|
||||
dlist = gtk_container_children (GTK_CONTAINER (st->list));
|
||||
|
@ -1081,7 +1084,7 @@ module_db_module_remove (gpointer data,
|
|||
{
|
||||
ModuleInfo *mod = data;
|
||||
|
||||
gimp_set_remove (modules, mod);
|
||||
gimp_container_remove (modules, GIMP_OBJECT (mod));
|
||||
|
||||
module_info_free (mod);
|
||||
}
|
||||
|
@ -1113,7 +1116,7 @@ module_find_by_path (const char *fullpath)
|
|||
cl.found = NULL;
|
||||
cl.search_key = fullpath;
|
||||
|
||||
gimp_set_foreach (modules, module_db_path_cmp, &cl);
|
||||
gimp_container_foreach (modules, module_db_path_cmp, &cl);
|
||||
|
||||
return cl.found;
|
||||
}
|
||||
|
@ -1127,7 +1130,7 @@ browser_refresh_callback (GtkWidget *widget,
|
|||
GSList *kill_list = NULL;
|
||||
|
||||
/* remove modules we don't have on disk anymore */
|
||||
gimp_set_foreach (modules, module_db_module_ondisk, &kill_list);
|
||||
gimp_container_foreach (modules, module_db_module_ondisk, &kill_list);
|
||||
g_slist_foreach (kill_list, module_db_module_remove, NULL);
|
||||
g_slist_free (kill_list);
|
||||
kill_list = NULL;
|
||||
|
|
|
@ -27,16 +27,16 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "dialog_handler.h"
|
||||
#include "info_dialog.h"
|
||||
#include "info_window.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimage.h"
|
||||
#include "gimppreviewcache.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimprc.h"
|
||||
#include "nav_window.h"
|
||||
#include "scroll.h"
|
||||
|
@ -1325,7 +1325,7 @@ nav_window_change_display (GimpContext *context, /* NOT USED */
|
|||
|
||||
gimage = gdisp->gimage;
|
||||
|
||||
if (gimage && gimp_set_have (image_context, gimage))
|
||||
if (gimage && gimp_container_lookup (image_context, GIMP_OBJECT (gimage)))
|
||||
{
|
||||
iwd->gdisp = gdisp;
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "context_manager.h"
|
||||
#include "gimage.h"
|
||||
#include "gimpcontext.h"
|
||||
#include "gimpimage.h"
|
||||
|
@ -458,9 +458,9 @@ palette_import_image_count (ImportType type)
|
|||
}
|
||||
|
||||
static void
|
||||
palette_import_image_new (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
palette_import_image_new (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! import_dialog)
|
||||
return;
|
||||
|
@ -488,9 +488,9 @@ palette_import_image_new (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
palette_import_image_destroyed (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
palette_import_image_destroyed (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
if (! import_dialog)
|
||||
return;
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "gimage_mask.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpset.h"
|
||||
#include "image_render.h"
|
||||
#include "lc_dialogP.h"
|
||||
#include "menus.h"
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "context_manager.h"
|
||||
#include "plug_in.h"
|
||||
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
@ -472,9 +473,9 @@ id_cmp_func (gconstpointer id1,
|
|||
}
|
||||
|
||||
static void
|
||||
add_cb (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
add_cb (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
|
@ -486,15 +487,15 @@ add_cb (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
remove_cb (GimpSet *set,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
remove_cb (GimpContainer *container,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
id = (guint *) gtk_object_get_data (GTK_OBJECT (image), "pdb_id");
|
||||
|
||||
gtk_object_remove_data (GTK_OBJECT(image), "pdb_id");
|
||||
gtk_object_remove_data (GTK_OBJECT (image), "pdb_id");
|
||||
g_hash_table_remove (image_hash, id);
|
||||
g_free (id);
|
||||
}
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "context_manager.h"
|
||||
#include "plug_in.h"
|
||||
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
@ -472,9 +473,9 @@ id_cmp_func (gconstpointer id1,
|
|||
}
|
||||
|
||||
static void
|
||||
add_cb (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
add_cb (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
|
@ -486,15 +487,15 @@ add_cb (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
remove_cb (GimpSet *set,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
remove_cb (GimpContainer *container,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
id = (guint *) gtk_object_get_data (GTK_OBJECT (image), "pdb_id");
|
||||
|
||||
gtk_object_remove_data (GTK_OBJECT(image), "pdb_id");
|
||||
gtk_object_remove_data (GTK_OBJECT (image), "pdb_id");
|
||||
g_hash_table_remove (image_hash, id);
|
||||
g_free (id);
|
||||
}
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "context_manager.h"
|
||||
#include "plug_in.h"
|
||||
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
@ -472,9 +473,9 @@ id_cmp_func (gconstpointer id1,
|
|||
}
|
||||
|
||||
static void
|
||||
add_cb (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
add_cb (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
|
@ -486,15 +487,15 @@ add_cb (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
remove_cb (GimpSet *set,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
remove_cb (GimpContainer *container,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
id = (guint *) gtk_object_get_data (GTK_OBJECT (image), "pdb_id");
|
||||
|
||||
gtk_object_remove_data (GTK_OBJECT(image), "pdb_id");
|
||||
gtk_object_remove_data (GTK_OBJECT (image), "pdb_id");
|
||||
g_hash_table_remove (image_hash, id);
|
||||
g_free (id);
|
||||
}
|
||||
|
|
|
@ -26,9 +26,10 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "app_procs.h"
|
||||
#include "context_manager.h"
|
||||
#include "plug_in.h"
|
||||
|
||||
#include "procedural_db.h"
|
||||
|
||||
#include "libgimp/gimpparasite.h"
|
||||
|
@ -472,9 +473,9 @@ id_cmp_func (gconstpointer id1,
|
|||
}
|
||||
|
||||
static void
|
||||
add_cb (GimpSet *set,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
add_cb (GimpContainer *container,
|
||||
GimpImage *gimage,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
|
@ -486,15 +487,15 @@ add_cb (GimpSet *set,
|
|||
}
|
||||
|
||||
static void
|
||||
remove_cb (GimpSet *set,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
remove_cb (GimpContainer *container,
|
||||
GimpImage *image,
|
||||
gpointer data)
|
||||
{
|
||||
guint *id;
|
||||
|
||||
id = (guint *) gtk_object_get_data (GTK_OBJECT (image), "pdb_id");
|
||||
|
||||
gtk_object_remove_data (GTK_OBJECT(image), "pdb_id");
|
||||
gtk_object_remove_data (GTK_OBJECT (image), "pdb_id");
|
||||
g_hash_table_remove (image_hash, id);
|
||||
g_free (id);
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gimpprogress.h"
|
||||
#include "gimprc.h"
|
||||
#include "pixel_region.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gdisplay_ops.h"
|
||||
#include "gimpimage.h"
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "gdisplay.h"
|
||||
#include "scale.h"
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "boundary.h"
|
||||
#include "colormaps.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "paint_funcs.h"
|
||||
|
|
|
@ -26,17 +26,17 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "boundary.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "draw_core.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimpui.h"
|
||||
#include "gdisplay.h"
|
||||
#include "paint_funcs.h"
|
||||
|
@ -1142,11 +1142,13 @@ by_color_select_close_callback (GtkWidget *widget,
|
|||
|
||||
gimp_dialog_hide (bcd->shell);
|
||||
|
||||
if (bcd->gimage && gimp_set_have (image_context, bcd->gimage))
|
||||
if (bcd->gimage && gimp_container_lookup (image_context,
|
||||
GIMP_OBJECT (bcd->gimage)))
|
||||
{
|
||||
bcd->gimage->by_color_select = FALSE;
|
||||
bcd->gimage = NULL;
|
||||
}
|
||||
|
||||
bcd->gimage = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "color_transfer.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -26,17 +26,17 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "boundary.h"
|
||||
#include "context_manager.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "draw_core.h"
|
||||
#include "gimage_mask.h"
|
||||
#include "gimpchannel.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimprc.h"
|
||||
#include "gimpset.h"
|
||||
#include "gimpui.h"
|
||||
#include "gdisplay.h"
|
||||
#include "paint_funcs.h"
|
||||
|
@ -1142,11 +1142,13 @@ by_color_select_close_callback (GtkWidget *widget,
|
|||
|
||||
gimp_dialog_hide (bcd->shell);
|
||||
|
||||
if (bcd->gimage && gimp_set_have (image_context, bcd->gimage))
|
||||
if (bcd->gimage && gimp_container_lookup (image_context,
|
||||
GIMP_OBJECT (bcd->gimage)))
|
||||
{
|
||||
bcd->gimage->by_color_select = FALSE;
|
||||
bcd->gimage = NULL;
|
||||
}
|
||||
|
||||
bcd->gimage = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "color_transfer.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimage.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "drawable.h"
|
||||
#include "gdisplay.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "brush_scale.h"
|
||||
#include "cursorutil.h"
|
||||
#include "devices.h"
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "cursorutil.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
|
||||
#include "apptypes.h"
|
||||
|
||||
#include "appenv.h"
|
||||
#include "draw_core.h"
|
||||
#include "drawable.h"
|
||||
#include "floating_sel.h"
|
||||
|
|
|
@ -38,9 +38,9 @@
|
|||
#include "colormaps.h"
|
||||
#include "color_area.h"
|
||||
#include "gdisplay.h"
|
||||
#include "gimpcontainer.h"
|
||||
#include "gimpdnd.h"
|
||||
#include "gimpimage.h"
|
||||
#include "gimpset.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
|
@ -117,7 +117,7 @@ static void index_adjustment_change_cb (GtkAdjustment *adjustment,
|
|||
static void hex_entry_change_cb (GtkEntry *entry,
|
||||
GimpColormapDialog *ipal);
|
||||
|
||||
static void set_addrem_cb (GimpSet *set,
|
||||
static void container_addrem_cb (GimpContainer *container,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal);
|
||||
static void image_rename_cb (GimpImage *img,
|
||||
|
@ -223,7 +223,7 @@ gimp_colormap_dialog_init (GimpColormapDialog *colormap_dialog)
|
|||
}
|
||||
|
||||
GimpColormapDialog *
|
||||
gimp_colormap_dialog_create (GimpSet *context)
|
||||
gimp_colormap_dialog_create (GimpContainer *context)
|
||||
{
|
||||
GimpColormapDialog *ipal;
|
||||
GtkWidget *vbox;
|
||||
|
@ -237,7 +237,7 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
GtkAccelGroup *accel_group;
|
||||
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
g_return_val_if_fail (GIMP_IS_SET (context), NULL);
|
||||
g_return_val_if_fail (GIMP_IS_CONTAINER (context), NULL);
|
||||
|
||||
ipal = gtk_type_new (GIMP_TYPE_COLORMAP_DIALOG);
|
||||
|
||||
|
@ -251,14 +251,14 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
|
||||
ipal->image = NULL;
|
||||
ipal->context = context;
|
||||
ipal->cmap_changed_handler = gimp_set_add_handler (context,
|
||||
"colormap_changed",
|
||||
image_cmap_change_cb,
|
||||
ipal);
|
||||
ipal->rename_handler = gimp_set_add_handler (context,
|
||||
"name_changed",
|
||||
image_rename_cb,
|
||||
ipal);
|
||||
ipal->cmap_changed_handler = gimp_container_add_handler (context,
|
||||
"colormap_changed",
|
||||
image_cmap_change_cb,
|
||||
ipal);
|
||||
ipal->rename_handler = gimp_container_add_handler (context,
|
||||
"name_changed",
|
||||
image_rename_cb,
|
||||
ipal);
|
||||
|
||||
accel_group = gtk_accel_group_new ();
|
||||
gtk_window_set_wmclass (GTK_WINDOW (ipal), "indexed_color_palette", "Gimp");
|
||||
|
@ -372,10 +372,10 @@ gimp_colormap_dialog_create (GimpSet *context)
|
|||
ipal_update_image_list (ipal);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (context), "add",
|
||||
GTK_SIGNAL_FUNC (set_addrem_cb),
|
||||
GTK_SIGNAL_FUNC (container_addrem_cb),
|
||||
ipal);
|
||||
gtk_signal_connect (GTK_OBJECT (context), "remove",
|
||||
GTK_SIGNAL_FUNC (set_addrem_cb),
|
||||
GTK_SIGNAL_FUNC (container_addrem_cb),
|
||||
ipal);
|
||||
|
||||
return ipal;
|
||||
|
@ -802,9 +802,9 @@ hex_entry_change_cb (GtkEntry *entry,
|
|||
}
|
||||
|
||||
static void
|
||||
set_addrem_cb (GimpSet *set,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal)
|
||||
container_addrem_cb (GimpContainer *set,
|
||||
GimpImage *image,
|
||||
GimpColormapDialog *ipal)
|
||||
{
|
||||
ipal_update_image_list (ipal);
|
||||
}
|
||||
|
@ -878,7 +878,8 @@ ipal_set_image (GimpColormapDialog *ipal,
|
|||
if (!ipal->image)
|
||||
gtk_signal_handler_unblock (GTK_OBJECT (ipal->palette),
|
||||
ipal->event_handler);
|
||||
g_return_if_fail (gimp_set_have (ipal->context, gimage));
|
||||
g_return_if_fail (gimp_container_lookup (ipal->context,
|
||||
GIMP_OBJECT (gimage)));
|
||||
g_return_if_fail (gimp_image_base_type (gimage) == INDEXED);
|
||||
ipal->image = gimage;
|
||||
ipal_draw (ipal);
|
||||
|
@ -1139,7 +1140,7 @@ create_image_menu (GimpColormapDialog *ipal,
|
|||
|
||||
*default_index = -1;
|
||||
|
||||
gimp_set_foreach (ipal->context, create_image_menu_cb, &data);
|
||||
gimp_container_foreach (ipal->context, create_image_menu_cb, &data);
|
||||
|
||||
if (!data.num_items)
|
||||
{
|
||||
|
|
|
@ -45,7 +45,7 @@ struct _GimpColormapDialog
|
|||
GtkWidget *image_menu;
|
||||
GtkWidget *popup_menu;
|
||||
GtkOptionMenu *option_menu;
|
||||
GimpSet *context;
|
||||
GimpContainer *context;
|
||||
guint event_handler;
|
||||
gint xn;
|
||||
gint yn;
|
||||
|
@ -68,7 +68,7 @@ struct _GimpColormapDialogClass
|
|||
|
||||
|
||||
GtkType gimp_colormap_dialog_get_type (void);
|
||||
GimpColormapDialog * gimp_colormap_dialog_create (GimpSet* context);
|
||||
GimpColormapDialog * gimp_colormap_dialog_create (GimpContainer *context);
|
||||
|
||||
void gimp_colormap_dialog_selected (GimpColormapDialog *colormap_dialog);
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ gimp_drawable_preview_private (GimpDrawable *drawable,
|
|||
break;
|
||||
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
|
||||
type = INDEXED;
|
||||
bytes = (gimp_drawable_bytes (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
bytes = (gimp_drawable_type (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ gimp_drawable_preview_private (GimpDrawable *drawable,
|
|||
break;
|
||||
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
|
||||
type = INDEXED;
|
||||
bytes = (gimp_drawable_bytes (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
bytes = (gimp_drawable_type (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ gimp_drawable_preview_private (GimpDrawable *drawable,
|
|||
break;
|
||||
case INDEXED_GIMAGE: case INDEXEDA_GIMAGE:
|
||||
type = INDEXED;
|
||||
bytes = (gimp_drawable_bytes (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
bytes = (gimp_drawable_type (drawable) == INDEXED_GIMAGE) ? 3 : 4;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue