2006-12-10 05:33:38 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-06-30 03:25:03 +08:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimpbrushfactoryview.c
|
2001-10-18 00:11:28 +08:00
|
|
|
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
|
2001-06-30 03:25:03 +08:00
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-06-30 03:25:03 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-06-30 03:25:03 +08:00
|
|
|
* (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
|
2009-01-18 06:28:01 +08:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2001-06-30 03:25:03 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2012-03-30 01:19:01 +08:00
|
|
|
#include <gegl.h>
|
2001-06-30 03:25:03 +08:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
#include "libgimpwidgets/gimpwidgets.h"
|
|
|
|
|
|
|
|
#include "widgets-types.h"
|
|
|
|
|
|
|
|
#include "core/gimpcontainer.h"
|
|
|
|
#include "core/gimpcontext.h"
|
|
|
|
#include "core/gimpbrush.h"
|
|
|
|
#include "core/gimpbrushgenerated.h"
|
|
|
|
#include "core/gimpdatafactory.h"
|
|
|
|
|
|
|
|
#include "gimpbrushfactoryview.h"
|
2011-04-19 03:04:05 +08:00
|
|
|
#include "gimpcontainerview.h"
|
2011-10-10 03:45:02 +08:00
|
|
|
#include "gimpmenufactory.h"
|
2011-04-19 03:04:05 +08:00
|
|
|
#include "gimpspinscale.h"
|
2004-08-26 06:31:44 +08:00
|
|
|
#include "gimpviewrenderer.h"
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2003-03-26 00:38:19 +08:00
|
|
|
#include "gimp-intl.h"
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
|
2010-09-27 04:38:01 +08:00
|
|
|
static void gimp_brush_factory_view_dispose (GObject *object);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
static void gimp_brush_factory_view_select_item (GimpContainerEditor *editor,
|
2004-08-26 06:31:44 +08:00
|
|
|
GimpViewable *viewable);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
static void gimp_brush_factory_view_spacing_changed (GimpBrush *brush,
|
2004-08-26 06:31:44 +08:00
|
|
|
GimpBrushFactoryView *view);
|
2001-06-30 03:25:03 +08:00
|
|
|
static void gimp_brush_factory_view_spacing_update (GtkAdjustment *adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
GimpBrushFactoryView *view);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
G_DEFINE_TYPE (GimpBrushFactoryView, gimp_brush_factory_view,
|
2006-05-15 17:46:31 +08:00
|
|
|
GIMP_TYPE_DATA_FACTORY_VIEW)
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2005-12-20 06:37:49 +08:00
|
|
|
#define parent_class gimp_brush_factory_view_parent_class
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_class_init (GimpBrushFactoryViewClass *klass)
|
|
|
|
{
|
2010-09-27 04:38:01 +08:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2005-12-20 06:37:49 +08:00
|
|
|
GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2010-09-27 04:38:01 +08:00
|
|
|
object_class->dispose = gimp_brush_factory_view_dispose;
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
editor_class->select_item = gimp_brush_factory_view_select_item;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_init (GimpBrushFactoryView *view)
|
|
|
|
{
|
|
|
|
view->spacing_adjustment =
|
2011-04-19 03:04:05 +08:00
|
|
|
GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 1.0, 5000.0,
|
|
|
|
1.0, 10.0, 0.0));
|
2002-03-09 03:00:44 +08:00
|
|
|
|
2011-04-19 03:04:05 +08:00
|
|
|
view->spacing_scale = gimp_spin_scale_new (view->spacing_adjustment,
|
|
|
|
_("Spacing"), 1);
|
|
|
|
gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (view->spacing_scale),
|
|
|
|
1.0, 200.0);
|
|
|
|
gimp_help_set_help_data (view->spacing_scale,
|
|
|
|
_("Percentage of width of brush"),
|
|
|
|
NULL);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2005-05-28 00:51:39 +08:00
|
|
|
g_signal_connect (view->spacing_adjustment, "value-changed",
|
2004-08-26 06:31:44 +08:00
|
|
|
G_CALLBACK (gimp_brush_factory_view_spacing_update),
|
|
|
|
view);
|
2001-06-30 03:25:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-09-27 04:38:01 +08:00
|
|
|
gimp_brush_factory_view_dispose (GObject *object)
|
2001-06-30 03:25:03 +08:00
|
|
|
{
|
2004-05-11 01:16:50 +08:00
|
|
|
GimpBrushFactoryView *view = GIMP_BRUSH_FACTORY_VIEW (object);
|
|
|
|
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (object);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
if (view->spacing_changed_handler_id)
|
|
|
|
{
|
2008-12-20 21:21:03 +08:00
|
|
|
GimpDataFactory *factory;
|
|
|
|
GimpContainer *container;
|
2004-05-11 01:16:50 +08:00
|
|
|
|
2008-12-20 21:21:03 +08:00
|
|
|
factory = gimp_data_factory_view_get_data_factory (GIMP_DATA_FACTORY_VIEW (editor));
|
|
|
|
container = gimp_data_factory_get_container (factory);
|
2004-05-11 01:16:50 +08:00
|
|
|
|
|
|
|
gimp_container_remove_handler (container,
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
view->spacing_changed_handler_id);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
view->spacing_changed_handler_id = 0;
|
2001-10-17 19:33:43 +08:00
|
|
|
}
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2010-09-27 04:38:01 +08:00
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
2001-06-30 03:25:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2004-09-27 18:45:49 +08:00
|
|
|
gimp_brush_factory_view_new (GimpViewType view_type,
|
|
|
|
GimpDataFactory *factory,
|
|
|
|
GimpContext *context,
|
|
|
|
gboolean change_brush_spacing,
|
|
|
|
gint view_size,
|
|
|
|
gint view_border_width,
|
|
|
|
GimpMenuFactory *menu_factory)
|
2001-06-30 03:25:03 +08:00
|
|
|
{
|
|
|
|
GimpBrushFactoryView *factory_view;
|
|
|
|
GimpContainerEditor *editor;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
|
2011-10-10 02:40:56 +08:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
2004-08-26 06:31:44 +08:00
|
|
|
g_return_val_if_fail (view_size > 0 &&
|
|
|
|
view_size <= GIMP_VIEWABLE_MAX_PREVIEW_SIZE, NULL);
|
|
|
|
g_return_val_if_fail (view_border_width >= 0 &&
|
|
|
|
view_border_width <= GIMP_VIEW_MAX_BORDER_WIDTH,
|
2003-04-08 20:39:02 +08:00
|
|
|
NULL);
|
2011-10-10 03:45:02 +08:00
|
|
|
g_return_val_if_fail (menu_factory == NULL ||
|
|
|
|
GIMP_IS_MENU_FACTORY (menu_factory), NULL);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2011-10-10 01:08:31 +08:00
|
|
|
factory_view = g_object_new (GIMP_TYPE_BRUSH_FACTORY_VIEW,
|
2011-10-10 03:04:49 +08:00
|
|
|
"view-type", view_type,
|
|
|
|
"data-factory", factory,
|
|
|
|
"context", context,
|
|
|
|
"view-size", view_size,
|
|
|
|
"view-border-width", view_border_width,
|
2011-10-10 03:45:02 +08:00
|
|
|
"menu-factory", menu_factory,
|
|
|
|
"menu-identifier", "<Brushes>",
|
|
|
|
"ui-path", "/brushes-popup",
|
2011-10-10 04:12:32 +08:00
|
|
|
"action-group", "brushes",
|
2011-10-10 01:08:31 +08:00
|
|
|
NULL);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
factory_view->change_brush_spacing = change_brush_spacing;
|
|
|
|
|
|
|
|
editor = GIMP_CONTAINER_EDITOR (factory_view);
|
|
|
|
|
2011-04-19 03:04:05 +08:00
|
|
|
gtk_box_pack_end (GTK_BOX (editor->view), factory_view->spacing_scale,
|
2002-03-08 08:27:45 +08:00
|
|
|
FALSE, FALSE, 0);
|
2011-04-19 03:04:05 +08:00
|
|
|
gtk_widget_show (factory_view->spacing_scale);
|
2002-03-08 08:27:45 +08:00
|
|
|
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
factory_view->spacing_changed_handler_id =
|
2008-12-20 05:58:17 +08:00
|
|
|
gimp_container_add_handler (gimp_data_factory_get_container (factory), "spacing-changed",
|
include the new "paint-funcs/paint-funcs-types.h".
2001-11-28 Michael Natterer <mitch@gimp.org>
* app/base/base-types.h: include the new
"paint-funcs/paint-funcs-types.h".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs-types.h: new file. Includes
"base/base-types.h".
* app/paint-funcs/paint-funcs.[ch]: removed the enums here,
include "paint-funcs-types.h".
* app/widgets/widgets-types.h: include "display/display-types.h"
* app/display/display-types.h: include "widgets/widgets-types.h".
* app/tools/tools-types.h: include "display/display-types.h"
* app/gui/gui-types.h: include "tools/tools-types.h".
The order of namespaces/dependencies should be (but is not):
(base, paint-funcs) -> (core, file, xcf, pdb) ->
(widgets, display) -> tools -> gui
* app/path.c: include "tools/tools-types.h".
* app/core/Makefile.am
* app/core/gimpimage-guides.[ch]
* app/core/gimpimage-merge.[ch]
* app/core/gimpimage-resize.[ch]
* app/core/gimpimage-scale.[ch]: new files.
* app/core/gimpimage.[ch]: removed the stuff which is in the new
files. Reordered all functions in both the .h and .c files,
commented the groups of functions.
* app/core/gimpcontainer.c: create the handler_id using a counter,
not the address of a pointer, because the address *may* be the
same twice, added debugging output.
* app/core/gimpviewable.[ch]: added primitive support for getting
a preview GdkPixbuf.
* app/nav_window.c
* app/undo.c
* app/undo_history.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-mask.[ch]
* app/display/gimpdisplay.c
* app/display/gimpdisplayshell-callbacks.c
* app/display/gimpdisplayshell-dnd.c
* app/display/gimpdisplayshell-render.c
* app/display/gimpdisplayshell-scale.c
* app/display/gimpdisplayshell-scroll.c
* app/gui/image-commands.c
* app/gui/info-window.c
* app/gui/layers-commands.c
* app/gui/palette-import-dialog.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpeditselectiontool.c
* app/tools/gimpmeasuretool.c
* app/tools/gimpmovetool.c
* app/widgets/gimpcontainerview-utils.c
* app/xcf/xcf-load.c: changed accordingly, some cleanup.
* tools/pdbgen/pdb/guides.pdb
* tools/pdbgen/pdb/image.pdb: changed accordingly, reordered functions.
* app/plug_in.c: set the labels of the "Repeat" and "Re-Show" menu
items to the name of the last plug-in (Fixes #50986).
* app/display/gimpdisplayshell.[ch]: set the labels of "Undo" and
"Redo" to the resp. undo names. Much simplified the WM icon stuff
by removing most code and using gimp_viewable_get_new_preview_pixbuf().
* app/widgets/gimpbrushfactoryview.c: forgot to assign the GQuark
returned by gimp_container_add_handler().
* app/pdb/guides_cmds.c
* app/pdb/image_cmds.c
* libgimp/gimpimage_pdb.[ch]: regenerated.
2001-11-29 01:51:06 +08:00
|
|
|
G_CALLBACK (gimp_brush_factory_view_spacing_changed),
|
|
|
|
factory_view);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
return GTK_WIDGET (factory_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_select_item (GimpContainerEditor *editor,
|
2004-08-26 06:31:44 +08:00
|
|
|
GimpViewable *viewable)
|
2001-06-30 03:25:03 +08:00
|
|
|
{
|
2004-05-11 01:16:50 +08:00
|
|
|
GimpBrushFactoryView *view = GIMP_BRUSH_FACTORY_VIEW (editor);
|
|
|
|
GimpContainer *container;
|
2003-02-27 02:08:26 +08:00
|
|
|
gboolean spacing_sensitive = FALSE;
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
if (GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item)
|
|
|
|
GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item (editor, viewable);
|
|
|
|
|
2004-05-11 01:16:50 +08:00
|
|
|
container = gimp_container_view_get_container (editor->view);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2004-05-11 01:16:50 +08:00
|
|
|
if (viewable && gimp_container_have (container, GIMP_OBJECT (viewable)))
|
2001-06-30 03:25:03 +08:00
|
|
|
{
|
2004-03-18 02:49:44 +08:00
|
|
|
GimpBrush *brush = GIMP_BRUSH (viewable);
|
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-25 05:27:11 +08:00
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
spacing_sensitive = TRUE;
|
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_block_by_func (view->spacing_adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_factory_view_spacing_update,
|
|
|
|
view);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
gtk_adjustment_set_value (view->spacing_adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_get_spacing (brush));
|
2001-06-30 03:25:03 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_unblock_by_func (view->spacing_adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_factory_view_spacing_update,
|
|
|
|
view);
|
2001-06-30 03:25:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (view->spacing_scale, spacing_sensitive);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_spacing_changed (GimpBrush *brush,
|
2004-08-26 06:31:44 +08:00
|
|
|
GimpBrushFactoryView *view)
|
2001-06-30 03:25:03 +08:00
|
|
|
{
|
2004-05-11 01:16:50 +08:00
|
|
|
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (view);
|
|
|
|
GimpContext *context;
|
|
|
|
|
|
|
|
context = gimp_container_view_get_context (editor->view);
|
|
|
|
|
|
|
|
if (brush == gimp_context_get_brush (context))
|
2001-06-30 03:25:03 +08:00
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_block_by_func (view->spacing_adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_factory_view_spacing_update,
|
|
|
|
view);
|
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-25 05:27:11 +08:00
|
|
|
|
2001-06-30 03:25:03 +08:00
|
|
|
gtk_adjustment_set_value (view->spacing_adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_get_spacing (brush));
|
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-25 05:27:11 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_unblock_by_func (view->spacing_adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_factory_view_spacing_update,
|
|
|
|
view);
|
2001-06-30 03:25:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_spacing_update (GtkAdjustment *adjustment,
|
2004-08-26 06:31:44 +08:00
|
|
|
GimpBrushFactoryView *view)
|
2001-06-30 03:25:03 +08:00
|
|
|
{
|
2004-05-11 01:16:50 +08:00
|
|
|
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (view);
|
|
|
|
GimpContext *context;
|
|
|
|
GimpBrush *brush;
|
|
|
|
|
|
|
|
context = gimp_container_view_get_context (editor->view);
|
|
|
|
|
|
|
|
brush = gimp_context_get_brush (context);
|
2001-06-30 03:25:03 +08:00
|
|
|
|
|
|
|
if (brush && view->change_brush_spacing)
|
|
|
|
{
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_block_by_func (brush,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_factory_view_spacing_changed,
|
|
|
|
view);
|
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-25 05:27:11 +08:00
|
|
|
|
2008-06-29 21:41:24 +08:00
|
|
|
gimp_brush_set_spacing (brush, gtk_adjustment_get_value (adjustment));
|
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-25 05:27:11 +08:00
|
|
|
|
2003-01-06 06:07:10 +08:00
|
|
|
g_signal_handlers_unblock_by_func (brush,
|
2004-08-26 06:31:44 +08:00
|
|
|
gimp_brush_factory_view_spacing_changed,
|
|
|
|
view);
|
2001-06-30 03:25:03 +08:00
|
|
|
}
|
|
|
|
}
|