2001-03-11 17:24:47 +00:00
|
|
|
/* The GIMP -- an image manipulation program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2001-04-22 00:38:56 +00:00
|
|
|
* gimplayerlistview.c
|
2001-10-17 16:11:28 +00:00
|
|
|
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
|
2001-04-22 00:38:56 +00:00
|
|
|
*
|
2001-03-11 17:24:47 +00:00
|
|
|
* 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 "libgimpmath/gimpmath.h"
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
2001-05-08 03:48:54 +00:00
|
|
|
#include "widgets-types.h"
|
2001-03-11 17:24:47 +00:00
|
|
|
|
2001-05-09 02:32:03 +00:00
|
|
|
#include "core/gimpcontainer.h"
|
|
|
|
#include "core/gimpdrawable.h"
|
|
|
|
#include "core/gimplayer.h"
|
|
|
|
|
2001-10-13 12:52:30 +00:00
|
|
|
#include "display/gimpdisplay-foreach.h"
|
2001-09-25 23:23:09 +00:00
|
|
|
|
2001-05-08 03:48:54 +00:00
|
|
|
#include "gimpdnd.h"
|
|
|
|
#include "gimplayerlistview.h"
|
2001-05-25 16:04:54 +00:00
|
|
|
#include "gimplistitem.h"
|
|
|
|
#include "gimpwidgets-constructors.h"
|
2001-05-08 03:48:54 +00:00
|
|
|
|
2001-03-11 17:24:47 +00:00
|
|
|
#include "libgimp/gimpintl.h"
|
|
|
|
|
|
|
|
|
|
|
|
static void gimp_layer_list_view_class_init (GimpLayerListViewClass *klass);
|
|
|
|
static void gimp_layer_list_view_init (GimpLayerListView *view);
|
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
static void gimp_layer_list_view_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
static void gimp_layer_list_view_set_container (GimpContainerView *view,
|
|
|
|
GimpContainer *container);
|
|
|
|
static void gimp_layer_list_view_select_item (GimpContainerView *view,
|
|
|
|
GimpViewable *item,
|
|
|
|
gpointer insert_data);
|
|
|
|
|
|
|
|
static void gimp_layer_list_view_anchor_clicked (GtkWidget *widget,
|
|
|
|
GimpLayerListView *view);
|
|
|
|
|
|
|
|
static void gimp_layer_list_view_paint_mode_menu_callback
|
|
|
|
(GtkWidget *widget,
|
|
|
|
GimpLayerListView *view);
|
|
|
|
static void gimp_layer_list_view_preserve_button_toggled
|
|
|
|
(GtkWidget *widget,
|
|
|
|
GimpLayerListView *view);
|
|
|
|
static void gimp_layer_list_view_opacity_scale_changed
|
|
|
|
(GtkAdjustment *adjustment,
|
|
|
|
GimpLayerListView *view);
|
|
|
|
|
2001-03-11 20:01:14 +00:00
|
|
|
static void gimp_layer_list_view_layer_signal_handler
|
|
|
|
(GimpLayer *layer,
|
|
|
|
GimpLayerListView *view);
|
2001-03-11 17:24:47 +00:00
|
|
|
static void gimp_layer_list_view_update_options (GimpLayerListView *view,
|
|
|
|
GimpLayer *layer);
|
|
|
|
|
|
|
|
|
|
|
|
static GimpDrawableListViewClass *parent_class = NULL;
|
|
|
|
|
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
GType
|
2001-03-11 17:24:47 +00:00
|
|
|
gimp_layer_list_view_get_type (void)
|
|
|
|
{
|
2001-08-04 20:38:54 +00:00
|
|
|
static GType view_type = 0;
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
if (! view_type)
|
|
|
|
{
|
2001-10-17 11:33:43 +00:00
|
|
|
static const GTypeInfo view_info =
|
2001-03-11 17:24:47 +00:00
|
|
|
{
|
2001-10-17 11:33:43 +00:00
|
|
|
sizeof (GimpLayerListViewClass),
|
|
|
|
NULL, /* base_init */
|
|
|
|
NULL, /* base_finalize */
|
|
|
|
(GClassInitFunc) gimp_layer_list_view_class_init,
|
|
|
|
NULL, /* class_finalize */
|
|
|
|
NULL, /* class_data */
|
|
|
|
sizeof (GimpLayerListView),
|
|
|
|
0, /* n_preallocs */
|
|
|
|
(GInstanceInitFunc) gimp_layer_list_view_init,
|
2001-03-11 17:24:47 +00:00
|
|
|
};
|
|
|
|
|
2001-10-17 11:33:43 +00:00
|
|
|
view_type = g_type_register_static (GIMP_TYPE_DRAWABLE_LIST_VIEW,
|
|
|
|
"GimpLayerListView",
|
|
|
|
&view_info, 0);
|
2001-03-11 17:24:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return view_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_class_init (GimpLayerListViewClass *klass)
|
|
|
|
{
|
2001-08-04 20:38:54 +00:00
|
|
|
GtkWidgetClass *widget_class;
|
2001-03-11 17:24:47 +00:00
|
|
|
GimpContainerViewClass *container_view_class;
|
|
|
|
|
2001-10-13 12:52:30 +00:00
|
|
|
widget_class = GTK_WIDGET_CLASS (klass);
|
|
|
|
container_view_class = GIMP_CONTAINER_VIEW_CLASS (klass);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
widget_class->style_set = gimp_layer_list_view_style_set;
|
|
|
|
|
2001-03-11 17:24:47 +00:00
|
|
|
container_view_class->set_container = gimp_layer_list_view_set_container;
|
|
|
|
container_view_class->select_item = gimp_layer_list_view_select_item;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_init (GimpLayerListView *view)
|
|
|
|
{
|
|
|
|
GimpDrawableListView *drawable_view;
|
|
|
|
GtkWidget *hbox;
|
2001-07-20 10:07:51 +00:00
|
|
|
GtkWidget *abox;
|
2001-03-11 17:24:47 +00:00
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *slider;
|
|
|
|
|
|
|
|
drawable_view = GIMP_DRAWABLE_LIST_VIEW (view);
|
|
|
|
|
|
|
|
view->options_box = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_start (GTK_BOX (view), view->options_box, FALSE, FALSE, 0);
|
|
|
|
gtk_box_reorder_child (GTK_BOX (view), view->options_box, 0);
|
|
|
|
gtk_widget_show (view->options_box);
|
|
|
|
|
2001-07-20 10:07:51 +00:00
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
2001-03-11 17:24:47 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (view->options_box), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
/* Paint mode menu */
|
|
|
|
|
|
|
|
label = gtk_label_new (_("Mode:"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
view->paint_mode_menu =
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
gimp_paint_mode_menu_new (G_CALLBACK (gimp_layer_list_view_paint_mode_menu_callback),
|
|
|
|
view,
|
|
|
|
FALSE,
|
|
|
|
NORMAL_MODE);
|
2001-07-20 10:07:51 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), view->paint_mode_menu, FALSE, FALSE, 0);
|
2001-03-11 17:24:47 +00:00
|
|
|
gtk_widget_show (view->paint_mode_menu);
|
|
|
|
|
2001-03-12 04:40:17 +00:00
|
|
|
gimp_help_set_help_data (view->paint_mode_menu,
|
|
|
|
NULL, "#paint_mode_menu");
|
|
|
|
|
2001-03-11 17:24:47 +00:00
|
|
|
/* Preserve transparency toggle */
|
|
|
|
|
2001-07-20 10:07:51 +00:00
|
|
|
abox = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), abox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (abox);
|
|
|
|
|
2001-03-11 17:24:47 +00:00
|
|
|
view->preserve_trans_toggle =
|
2001-07-20 10:07:51 +00:00
|
|
|
gtk_toggle_button_new_with_label (_("Keep Trans."));
|
|
|
|
gtk_container_add (GTK_CONTAINER (abox), view->preserve_trans_toggle);
|
2001-03-11 17:24:47 +00:00
|
|
|
gtk_widget_show (view->preserve_trans_toggle);
|
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
g_signal_connect (G_OBJECT (view->preserve_trans_toggle), "toggled",
|
|
|
|
G_CALLBACK (gimp_layer_list_view_preserve_button_toggled),
|
|
|
|
view);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
2001-03-12 04:40:17 +00:00
|
|
|
gimp_help_set_help_data (view->preserve_trans_toggle,
|
|
|
|
_("Keep Transparency"), "#keep_trans_button");
|
|
|
|
|
2001-07-20 10:07:51 +00:00
|
|
|
hbox = gtk_hbox_new (FALSE, 4);
|
2001-03-11 17:24:47 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (view->options_box), hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (hbox);
|
|
|
|
|
|
|
|
/* Opacity scale */
|
|
|
|
|
|
|
|
label = gtk_label_new (_("Opacity:"));
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
view->opacity_adjustment =
|
|
|
|
GTK_ADJUSTMENT (gtk_adjustment_new (100.0, 0.0, 100.0, 1.0, 1.0, 0.0));
|
|
|
|
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
g_signal_connect (G_OBJECT (view->opacity_adjustment), "value_changed",
|
|
|
|
G_CALLBACK (gimp_layer_list_view_opacity_scale_changed),
|
|
|
|
view);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
slider = gtk_hscale_new (view->opacity_adjustment);
|
|
|
|
gtk_scale_set_value_pos (GTK_SCALE (slider), GTK_POS_RIGHT);
|
|
|
|
gtk_box_pack_start (GTK_BOX (hbox), slider, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (slider);
|
|
|
|
|
2001-03-12 04:40:17 +00:00
|
|
|
gimp_help_set_help_data (slider, NULL, "#opacity_scale");
|
|
|
|
|
2001-03-11 17:24:47 +00:00
|
|
|
/* Anchor button */
|
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
view->anchor_button =
|
|
|
|
gimp_container_view_add_button (GIMP_CONTAINER_VIEW (view),
|
|
|
|
GIMP_STOCK_ANCHOR,
|
|
|
|
_("Anchor"), NULL,
|
|
|
|
G_CALLBACK (gimp_layer_list_view_anchor_clicked),
|
|
|
|
NULL,
|
|
|
|
view);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
gtk_box_reorder_child (GTK_BOX (GIMP_CONTAINER_VIEW (view)->button_box),
|
|
|
|
view->anchor_button, 5);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
gimp_container_view_enable_dnd (GIMP_CONTAINER_VIEW (view),
|
|
|
|
GTK_BUTTON (view->anchor_button),
|
|
|
|
GIMP_TYPE_LAYER);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
gtk_widget_set_sensitive (view->options_box, FALSE);
|
|
|
|
gtk_widget_set_sensitive (view->anchor_button, FALSE);
|
|
|
|
|
|
|
|
view->mode_changed_handler_id = 0;
|
|
|
|
view->opacity_changed_handler_id = 0;
|
|
|
|
view->preserve_trans_changed_handler_id = 0;
|
|
|
|
}
|
|
|
|
|
2001-08-04 20:38:54 +00:00
|
|
|
static void
|
|
|
|
gimp_layer_list_view_style_set (GtkWidget *widget,
|
|
|
|
GtkStyle *prev_style)
|
|
|
|
{
|
2001-08-07 00:06:06 +00:00
|
|
|
GimpLayerListView *layer_view;
|
|
|
|
gint content_spacing;
|
|
|
|
gint button_spacing;
|
|
|
|
|
|
|
|
layer_view = GIMP_LAYER_LIST_VIEW (widget);
|
2001-08-04 20:38:54 +00:00
|
|
|
|
|
|
|
gtk_widget_style_get (widget,
|
|
|
|
"content_spacing",
|
|
|
|
&content_spacing,
|
|
|
|
"button_spacing",
|
|
|
|
&button_spacing,
|
|
|
|
NULL);
|
|
|
|
|
2001-08-07 00:06:06 +00:00
|
|
|
gtk_box_set_spacing (GTK_BOX (layer_view->options_box), content_spacing);
|
2001-08-04 20:38:54 +00:00
|
|
|
|
|
|
|
if (GTK_WIDGET_CLASS (parent_class)->style_set)
|
|
|
|
GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
|
|
|
|
}
|
|
|
|
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
/* GimpContainerView methods */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_set_container (GimpContainerView *view,
|
|
|
|
GimpContainer *container)
|
|
|
|
{
|
|
|
|
GimpLayerListView *layer_view;
|
|
|
|
|
|
|
|
layer_view = GIMP_LAYER_LIST_VIEW (view);
|
|
|
|
|
|
|
|
if (view->container)
|
|
|
|
{
|
|
|
|
gimp_container_remove_handler (view->container,
|
|
|
|
layer_view->mode_changed_handler_id);
|
|
|
|
gimp_container_remove_handler (view->container,
|
|
|
|
layer_view->opacity_changed_handler_id);
|
|
|
|
gimp_container_remove_handler (view->container,
|
|
|
|
layer_view->preserve_trans_changed_handler_id);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GIMP_CONTAINER_VIEW_CLASS (parent_class)->set_container)
|
|
|
|
GIMP_CONTAINER_VIEW_CLASS (parent_class)->set_container (view, container);
|
|
|
|
|
|
|
|
if (view->container)
|
|
|
|
{
|
|
|
|
layer_view->mode_changed_handler_id =
|
|
|
|
gimp_container_add_handler (view->container, "mode_changed",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
G_CALLBACK (gimp_layer_list_view_layer_signal_handler),
|
2001-03-11 17:24:47 +00:00
|
|
|
view);
|
|
|
|
layer_view->opacity_changed_handler_id =
|
|
|
|
gimp_container_add_handler (view->container, "opacity_changed",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
G_CALLBACK (gimp_layer_list_view_layer_signal_handler),
|
2001-03-11 17:24:47 +00:00
|
|
|
view);
|
|
|
|
layer_view->preserve_trans_changed_handler_id =
|
|
|
|
gimp_container_add_handler (view->container, "preserve_trans_changed",
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
G_CALLBACK (gimp_layer_list_view_layer_signal_handler),
|
2001-03-11 17:24:47 +00:00
|
|
|
view);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_select_item (GimpContainerView *view,
|
|
|
|
GimpViewable *item,
|
|
|
|
gpointer insert_data)
|
|
|
|
{
|
2001-05-06 22:29:48 +00:00
|
|
|
GimpDrawableListView *drawable_view;
|
|
|
|
GimpLayerListView *list_view;
|
2001-05-08 01:32:25 +00:00
|
|
|
gboolean options_sensitive = FALSE;
|
|
|
|
gboolean anchor_sensitive = FALSE;
|
|
|
|
gboolean raise_sensitive = FALSE;
|
2001-03-11 17:24:47 +00:00
|
|
|
|
2001-05-06 22:29:48 +00:00
|
|
|
list_view = GIMP_LAYER_LIST_VIEW (view);
|
|
|
|
drawable_view = GIMP_DRAWABLE_LIST_VIEW (view);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
if (GIMP_CONTAINER_VIEW_CLASS (parent_class)->select_item)
|
|
|
|
GIMP_CONTAINER_VIEW_CLASS (parent_class)->select_item (view,
|
|
|
|
item,
|
|
|
|
insert_data);
|
|
|
|
|
|
|
|
if (item)
|
|
|
|
{
|
|
|
|
gimp_layer_list_view_update_options (list_view, GIMP_LAYER (item));
|
|
|
|
|
|
|
|
options_sensitive = TRUE;
|
|
|
|
|
|
|
|
if (gimp_layer_is_floating_sel (GIMP_LAYER (item)))
|
|
|
|
{
|
|
|
|
anchor_sensitive = TRUE;
|
2001-08-07 00:06:06 +00:00
|
|
|
|
|
|
|
gtk_widget_set_sensitive (drawable_view->lower_button, FALSE);
|
|
|
|
gtk_widget_set_sensitive (drawable_view->duplicate_button, FALSE);
|
|
|
|
gtk_widget_set_sensitive (drawable_view->edit_button, FALSE);
|
2001-03-11 17:24:47 +00:00
|
|
|
}
|
2001-05-08 01:32:25 +00:00
|
|
|
else
|
2001-05-06 22:29:48 +00:00
|
|
|
{
|
2001-05-08 01:32:25 +00:00
|
|
|
if (gimp_drawable_has_alpha (GIMP_DRAWABLE (item)) &&
|
|
|
|
gimp_container_get_child_index (view->container,
|
|
|
|
GIMP_OBJECT (item)))
|
|
|
|
{
|
|
|
|
raise_sensitive = TRUE;
|
|
|
|
}
|
2001-05-06 22:29:48 +00:00
|
|
|
}
|
2001-03-11 17:24:47 +00:00
|
|
|
}
|
|
|
|
|
2001-08-07 00:06:06 +00:00
|
|
|
gtk_widget_set_sensitive (list_view->options_box, options_sensitive);
|
|
|
|
gtk_widget_set_sensitive (drawable_view->raise_button, raise_sensitive);
|
|
|
|
gtk_widget_set_sensitive (list_view->anchor_button, anchor_sensitive);
|
2001-03-11 17:24:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* "Anchor" functions */
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_anchor_clicked (GtkWidget *widget,
|
|
|
|
GimpLayerListView *view)
|
|
|
|
{
|
|
|
|
GimpDrawableListView *drawable_view;
|
|
|
|
GimpDrawable *drawable;
|
|
|
|
|
|
|
|
drawable_view = GIMP_DRAWABLE_LIST_VIEW (view);
|
|
|
|
|
|
|
|
drawable = drawable_view->get_drawable_func (drawable_view->gimage);
|
|
|
|
|
|
|
|
if (drawable)
|
2001-08-04 20:38:54 +00:00
|
|
|
g_print ("anchor \"%s\"\n", GIMP_OBJECT (drawable)->name);
|
2001-03-11 17:24:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-06-26 12:09:43 +00:00
|
|
|
/* Paint Mode, Opacity and Preserve trans. callbacks */
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
#define BLOCK() \
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
g_signal_handlers_block_by_func (G_OBJECT (layer), \
|
2001-03-11 17:24:47 +00:00
|
|
|
gimp_layer_list_view_layer_signal_handler, view)
|
|
|
|
|
|
|
|
#define UNBLOCK() \
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
g_signal_handlers_unblock_by_func (G_OBJECT (layer), \
|
2001-03-11 17:24:47 +00:00
|
|
|
gimp_layer_list_view_layer_signal_handler, view)
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_paint_mode_menu_callback (GtkWidget *widget,
|
|
|
|
GimpLayerListView *view)
|
|
|
|
{
|
|
|
|
GimpDrawableListView *drawable_view;
|
|
|
|
GimpLayer *layer;
|
|
|
|
|
|
|
|
drawable_view = GIMP_DRAWABLE_LIST_VIEW (view);
|
|
|
|
|
|
|
|
layer = (GimpLayer *) drawable_view->get_drawable_func (drawable_view->gimage);
|
|
|
|
|
|
|
|
if (layer)
|
|
|
|
{
|
|
|
|
LayerModeEffects mode;
|
|
|
|
|
|
|
|
mode = (LayerModeEffects)
|
2001-11-22 13:01:26 +00:00
|
|
|
GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget),
|
|
|
|
"gimp-item-data"));
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
if (gimp_layer_get_mode (layer) != mode)
|
|
|
|
{
|
|
|
|
BLOCK();
|
|
|
|
gimp_layer_set_mode (layer, mode);
|
|
|
|
UNBLOCK();
|
|
|
|
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_preserve_button_toggled (GtkWidget *widget,
|
|
|
|
GimpLayerListView *view)
|
|
|
|
{
|
|
|
|
GimpDrawableListView *drawable_view;
|
|
|
|
GimpLayer *layer;
|
|
|
|
|
|
|
|
drawable_view = GIMP_DRAWABLE_LIST_VIEW (view);
|
|
|
|
|
|
|
|
layer = (GimpLayer *) drawable_view->get_drawable_func (drawable_view->gimage);
|
|
|
|
|
|
|
|
if (layer)
|
|
|
|
{
|
|
|
|
gboolean preserve_trans;
|
|
|
|
|
|
|
|
preserve_trans = GTK_TOGGLE_BUTTON (widget)->active;
|
|
|
|
|
|
|
|
if (gimp_layer_get_preserve_trans (layer) != preserve_trans)
|
|
|
|
{
|
|
|
|
BLOCK();
|
|
|
|
gimp_layer_set_preserve_trans (layer, preserve_trans);
|
|
|
|
UNBLOCK();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_opacity_scale_changed (GtkAdjustment *adjustment,
|
|
|
|
GimpLayerListView *view)
|
|
|
|
{
|
|
|
|
GimpDrawableListView *drawable_view;
|
|
|
|
GimpLayer *layer;
|
|
|
|
|
|
|
|
drawable_view = GIMP_DRAWABLE_LIST_VIEW (view);
|
|
|
|
|
|
|
|
layer = (GimpLayer *) drawable_view->get_drawable_func (drawable_view->gimage);
|
|
|
|
|
|
|
|
if (layer)
|
|
|
|
{
|
|
|
|
gdouble opacity;
|
|
|
|
|
|
|
|
opacity = adjustment->value / 100.0;
|
|
|
|
|
|
|
|
if (gimp_layer_get_opacity (layer) != opacity)
|
|
|
|
{
|
|
|
|
BLOCK();
|
|
|
|
gimp_layer_set_opacity (layer, opacity);
|
|
|
|
UNBLOCK();
|
|
|
|
|
|
|
|
gdisplays_flush ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef BLOCK
|
|
|
|
#undef UNBLOCK
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_layer_list_view_layer_signal_handler (GimpLayer *layer,
|
|
|
|
GimpLayerListView *view)
|
|
|
|
{
|
|
|
|
GimpDrawableListView *drawable_view;
|
|
|
|
|
|
|
|
drawable_view = GIMP_DRAWABLE_LIST_VIEW (view);
|
|
|
|
|
|
|
|
if (drawable_view->get_drawable_func (drawable_view->gimage) ==
|
|
|
|
(GimpDrawable *) layer)
|
|
|
|
{
|
|
|
|
gimp_layer_list_view_update_options (view, layer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-03-11 20:01:14 +00:00
|
|
|
|
|
|
|
#define BLOCK(object,function) \
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
g_signal_handlers_block_by_func (G_OBJECT (object), \
|
|
|
|
(function), view)
|
2001-03-11 20:01:14 +00:00
|
|
|
|
|
|
|
#define UNBLOCK(object,function) \
|
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
2001-07-24 Michael Natterer <mitch@gimp.org>
Port to glib/gtk+ 2.0 episode I (every segfault has it's beginning)
* configure.in: require glib/gtk+ >= 1.3.7, commented out the
gtkxmhtml stuff.
From now on, you will need glib, pango, atk and gtk+ HEAD from CVS
to hack or use GIMP HEAD.
Beware, it crashes randomly :)
* app/core/Makefile.am
* app/core/gimpmarshal.list: new file plus rules to generate
gimpmarshal.[ch] from it.
* app/core/*
* app/tools/*
* app/widgets/*
* libgimpwidgets/*: started to use the glib object system. All
core/ objects are still gtk objects however. All signals are
created using g_signal_new(). There are many gtk+ artefacts left.
Finally, we will _not_ use the gtk_signal_foo() wrappers and
friends any more.
* app/colormaps.c
* app/devices.[ch]
* app/disp_callbacks.c
* app/errorconsole.c
* app/file-save.[ch]
* app/interface.c
* app/module_db.c
* app/nav_window.c
* app/ops_buttons.c
* app/scroll.c
* app/user_install.c
* app/gui/about-dialog.c
* app/gui/brush-editor.c
* app/gui/brushes-commands.c
* app/gui/color-notebook.c
* app/gui/colormap-dialog.c
* app/gui/dialogs-commands.c
* app/gui/dialogs-constructors.c
* app/gui/file-commands.c
* app/gui/file-dialog-utils.c
* app/gui/file-new-dialog.c
* app/gui/file-open-dialog.[ch]
* app/gui/file-save-dialog.c
* app/gui/gradient-editor.c
* app/gui/gradients-commands.c
* app/gui/image-commands.c
* app/gui/info-dialog.[ch]
* app/gui/layer-select.c
* app/gui/layers-commands.c
* app/gui/menus.c
* app/gui/offset-dialog.c
* app/gui/palette-editor.c
* app/gui/palettes-commands.c
* app/gui/patterns-commands.c
* app/gui/preferences-dialog.c
* app/gui/resize-dialog.[ch]
* app/gui/splash.c
* app/gui/tips-dialog.c
* app/gui/tool-options-dialog.c
* app/gui/toolbox.c
* app/gui/tools-commands.c
* libgimp/gimpbrushmenu.c
* libgimp/gimpmenu.c
* libgimp/gimppatternmenu.c
* libgimp/gimpui.c
* libgimpbase/gimpenv.c: tons and tons of changes like "const
gchar*", switch from GdkDeviceInfo to GdkDevice (very incomplete
and currently disables), lots of s/gtk_signal/g_signal/,
removal/replacement of deprecated stuff,
s/GtkSignalFunc/GCallback/ and lots of small changes and fixes
while I was on it, zillions of warnings left...
* modules/Makefile.am: disabled the water color selector
temporarily (XInput issues).
* plug-ins/Makefile.am
* plug-ins/common/.cvsignore
* plug-ins/common/Makefile.am
* plug-ins/common/plugin-defs.pl: simply excluded all plug-ins
which did not build (including Script-Fu). They are trivial to
fix.
2001-07-24 21:27:11 +00:00
|
|
|
g_signal_handlers_unblock_by_func (G_OBJECT (object), \
|
|
|
|
(function), view)
|
2001-03-11 20:01:14 +00:00
|
|
|
|
2001-03-11 17:24:47 +00:00
|
|
|
static void
|
|
|
|
gimp_layer_list_view_update_options (GimpLayerListView *view,
|
|
|
|
GimpLayer *layer)
|
|
|
|
{
|
|
|
|
gimp_option_menu_set_history (GTK_OPTION_MENU (view->paint_mode_menu),
|
|
|
|
GINT_TO_POINTER (layer->mode));
|
|
|
|
|
|
|
|
if (layer->preserve_trans !=
|
|
|
|
GTK_TOGGLE_BUTTON (view->preserve_trans_toggle)->active)
|
|
|
|
{
|
2001-03-11 20:01:14 +00:00
|
|
|
BLOCK (view->preserve_trans_toggle,
|
|
|
|
gimp_layer_list_view_preserve_button_toggled);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->preserve_trans_toggle),
|
|
|
|
layer->preserve_trans);
|
|
|
|
|
2001-03-11 20:01:14 +00:00
|
|
|
UNBLOCK (view->preserve_trans_toggle,
|
|
|
|
gimp_layer_list_view_preserve_button_toggled);
|
2001-03-11 17:24:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((gdouble) layer->opacity / 2.55 != view->opacity_adjustment->value)
|
|
|
|
{
|
2001-03-11 20:01:14 +00:00
|
|
|
BLOCK (view->opacity_adjustment,
|
|
|
|
gimp_layer_list_view_opacity_scale_changed);
|
2001-03-11 17:24:47 +00:00
|
|
|
|
|
|
|
gtk_adjustment_set_value (view->opacity_adjustment, layer->opacity / 2.55);
|
|
|
|
|
2001-03-11 20:01:14 +00:00
|
|
|
UNBLOCK (view->opacity_adjustment,
|
|
|
|
gimp_layer_list_view_opacity_scale_changed);
|
2001-03-11 17:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
2001-03-11 20:01:14 +00:00
|
|
|
|
|
|
|
#undef BLOCK
|
|
|
|
#undef UNBLOCK
|