2006-12-09 21:33:38 +00:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
2001-06-29 19:25:03 +00:00
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
|
|
|
* gimpbrushfactoryview.c
|
2001-10-17 16:11:28 +00:00
|
|
|
* Copyright (C) 2001 Michael Natterer <mitch@gimp.org>
|
2001-06-29 19:25:03 +00:00
|
|
|
*
|
2009-01-17 22:28:01 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2001-06-29 19:25:03 +00:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-17 22:28:01 +00:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2001-06-29 19:25:03 +00: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
|
2018-07-11 23:27:07 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2001-06-29 19:25:03 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2012-03-29 19:19:01 +02:00
|
|
|
#include <gegl.h>
|
2001-06-29 19:25:03 +00: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-18 21:04:05 +02:00
|
|
|
#include "gimpcontainerview.h"
|
2019-02-11 20:51:28 +01:00
|
|
|
#include "gimpeditor.h"
|
2011-10-09 21:45:02 +02:00
|
|
|
#include "gimpmenufactory.h"
|
2004-08-25 22:31:44 +00:00
|
|
|
#include "gimpviewrenderer.h"
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2003-03-25 16:38:19 +00:00
|
|
|
#include "gimp-intl.h"
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2021-04-28 02:04:41 +02:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SPACING_CHANGED,
|
|
|
|
LAST_SIGNAL
|
|
|
|
};
|
|
|
|
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2010-09-26 22:38:01 +02:00
|
|
|
static void gimp_brush_factory_view_dispose (GObject *object);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
static void gimp_brush_factory_view_select_item (GimpContainerEditor *editor,
|
2004-08-25 22:31:44 +00:00
|
|
|
GimpViewable *viewable);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
static void gimp_brush_factory_view_spacing_changed (GimpBrush *brush,
|
2004-08-25 22:31:44 +00:00
|
|
|
GimpBrushFactoryView *view);
|
2001-06-29 19:25:03 +00:00
|
|
|
static void gimp_brush_factory_view_spacing_update (GtkAdjustment *adjustment,
|
2004-08-25 22:31:44 +00:00
|
|
|
GimpBrushFactoryView *view);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
|
2005-12-19 22:37:49 +00:00
|
|
|
G_DEFINE_TYPE (GimpBrushFactoryView, gimp_brush_factory_view,
|
2006-05-15 09:46:31 +00:00
|
|
|
GIMP_TYPE_DATA_FACTORY_VIEW)
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2005-12-19 22:37:49 +00:00
|
|
|
#define parent_class gimp_brush_factory_view_parent_class
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2021-04-28 02:04:41 +02:00
|
|
|
static guint gimp_brush_factory_view_signals[LAST_SIGNAL] = { 0 };
|
|
|
|
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_class_init (GimpBrushFactoryViewClass *klass)
|
|
|
|
{
|
2010-09-26 22:38:01 +02:00
|
|
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
2005-12-19 22:37:49 +00:00
|
|
|
GimpContainerEditorClass *editor_class = GIMP_CONTAINER_EDITOR_CLASS (klass);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2010-09-26 22:38:01 +02:00
|
|
|
object_class->dispose = gimp_brush_factory_view_dispose;
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
editor_class->select_item = gimp_brush_factory_view_select_item;
|
2021-04-28 02:04:41 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GimpBrushFactoryView::spacing-changed:
|
|
|
|
* @view: the #GimpBrushFactoryView.
|
|
|
|
*
|
|
|
|
* Emitted when the spacing changed.
|
|
|
|
*/
|
|
|
|
gimp_brush_factory_view_signals[SPACING_CHANGED] =
|
|
|
|
g_signal_new ("spacing-changed",
|
|
|
|
G_TYPE_FROM_CLASS (klass),
|
|
|
|
G_SIGNAL_RUN_FIRST,
|
|
|
|
G_STRUCT_OFFSET (GimpBrushFactoryViewClass, spacing_changed),
|
|
|
|
NULL, NULL, NULL,
|
|
|
|
G_TYPE_NONE, 0);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_init (GimpBrushFactoryView *view)
|
|
|
|
{
|
2018-06-24 18:15:16 +02:00
|
|
|
view->spacing_adjustment = gtk_adjustment_new (0.0, 1.0, 5000.0,
|
|
|
|
1.0, 10.0, 0.0);
|
2002-03-08 19:00:44 +00:00
|
|
|
|
2011-04-18 21:04:05 +02: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-29 19:25:03 +00:00
|
|
|
|
2005-05-27 16:51:39 +00:00
|
|
|
g_signal_connect (view->spacing_adjustment, "value-changed",
|
2004-08-25 22:31:44 +00:00
|
|
|
G_CALLBACK (gimp_brush_factory_view_spacing_update),
|
|
|
|
view);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2010-09-26 22:38:01 +02:00
|
|
|
gimp_brush_factory_view_dispose (GObject *object)
|
2001-06-29 19:25:03 +00:00
|
|
|
{
|
2004-05-10 17:16:50 +00:00
|
|
|
GimpBrushFactoryView *view = GIMP_BRUSH_FACTORY_VIEW (object);
|
|
|
|
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (object);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
if (view->spacing_changed_handler_id)
|
|
|
|
{
|
2008-12-20 13:21:03 +00:00
|
|
|
GimpDataFactory *factory;
|
|
|
|
GimpContainer *container;
|
2004-05-10 17:16:50 +00:00
|
|
|
|
2008-12-20 13:21:03 +00:00
|
|
|
factory = gimp_data_factory_view_get_data_factory (GIMP_DATA_FACTORY_VIEW (editor));
|
|
|
|
container = gimp_data_factory_get_container (factory);
|
2004-05-10 17:16:50 +00: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-28 17:51:06 +00:00
|
|
|
view->spacing_changed_handler_id);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
view->spacing_changed_handler_id = 0;
|
2001-10-17 11:33:43 +00:00
|
|
|
}
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2010-09-26 22:38:01 +02:00
|
|
|
G_OBJECT_CLASS (parent_class)->dispose (object);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget *
|
2004-09-27 10:45:49 +00: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-29 19:25:03 +00:00
|
|
|
{
|
|
|
|
GimpBrushFactoryView *factory_view;
|
|
|
|
GimpContainerEditor *editor;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GIMP_IS_DATA_FACTORY (factory), NULL);
|
2011-10-09 20:40:56 +02:00
|
|
|
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
|
2004-08-25 22:31:44 +00: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 12:39:02 +00:00
|
|
|
NULL);
|
2011-10-09 21:45:02 +02:00
|
|
|
g_return_val_if_fail (menu_factory == NULL ||
|
|
|
|
GIMP_IS_MENU_FACTORY (menu_factory), NULL);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2011-10-09 19:08:31 +02:00
|
|
|
factory_view = g_object_new (GIMP_TYPE_BRUSH_FACTORY_VIEW,
|
2011-10-09 21:04:49 +02:00
|
|
|
"view-type", view_type,
|
|
|
|
"data-factory", factory,
|
|
|
|
"context", context,
|
|
|
|
"view-size", view_size,
|
|
|
|
"view-border-width", view_border_width,
|
2011-10-09 21:45:02 +02:00
|
|
|
"menu-factory", menu_factory,
|
|
|
|
"menu-identifier", "<Brushes>",
|
|
|
|
"ui-path", "/brushes-popup",
|
2011-10-09 22:12:32 +02:00
|
|
|
"action-group", "brushes",
|
2011-10-09 19:08:31 +02:00
|
|
|
NULL);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
factory_view->change_brush_spacing = change_brush_spacing;
|
|
|
|
|
|
|
|
editor = GIMP_CONTAINER_EDITOR (factory_view);
|
|
|
|
|
2019-02-11 20:51:28 +01:00
|
|
|
gimp_editor_add_action_button (GIMP_EDITOR (editor->view),
|
|
|
|
"brushes", "brushes-open-as-image",
|
|
|
|
NULL);
|
|
|
|
|
2011-04-18 21:04:05 +02:00
|
|
|
gtk_box_pack_end (GTK_BOX (editor->view), factory_view->spacing_scale,
|
2002-03-08 00:27:45 +00:00
|
|
|
FALSE, FALSE, 0);
|
Issue #9270: Change GimpBrushSelect to choose only brush.
gimp_brushes_popup() was triggering a popup allowing to change not only
the brush, but also the "paint mode", the opacity and the spacing. As
far as I could see, this was used nowhere for the paint mode and
opacity.
As for the spacing, it looks like gfig was indeed getting this data,
except that the GimpBrushSelect was disabling the effect on this scale
by setting change_brush_spacing to FALSE when calling
gimp_brush_factory_view_new(), and even setting this to TRUE, it was not
working fine anyway. Rather than debugging this, let's simplify the API.
Such settings seems like additional paint settings which don't have to
be in the brush selection. If someone wants people to also select an
opacity, spacing or paint mode, it would be much more efficient to add
separate plug-in arguments for these.
Additionally, I fix GimpBrushFactoryView not to show the spacing scale
when change_brush_spacing was set to FALSE anyway. This is just a bogus
widget then, which can only confuse people.
2024-09-06 18:02:16 +02:00
|
|
|
gtk_widget_set_visible (factory_view->spacing_scale, change_brush_spacing);
|
2002-03-08 00:27:45 +00: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-28 17:51:06 +00:00
|
|
|
factory_view->spacing_changed_handler_id =
|
2008-12-19 21:58:17 +00: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-28 17:51:06 +00:00
|
|
|
G_CALLBACK (gimp_brush_factory_view_spacing_changed),
|
|
|
|
factory_view);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
return GTK_WIDGET (factory_view);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_select_item (GimpContainerEditor *editor,
|
2004-08-25 22:31:44 +00:00
|
|
|
GimpViewable *viewable)
|
2001-06-29 19:25:03 +00:00
|
|
|
{
|
2004-05-10 17:16:50 +00:00
|
|
|
GimpBrushFactoryView *view = GIMP_BRUSH_FACTORY_VIEW (editor);
|
|
|
|
GimpContainer *container;
|
2003-02-26 18:08:26 +00:00
|
|
|
gboolean spacing_sensitive = FALSE;
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
if (GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item)
|
|
|
|
GIMP_CONTAINER_EDITOR_CLASS (parent_class)->select_item (editor, viewable);
|
|
|
|
|
2004-05-10 17:16:50 +00:00
|
|
|
container = gimp_container_view_get_container (editor->view);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2004-05-10 17:16:50 +00:00
|
|
|
if (viewable && gimp_container_have (container, GIMP_OBJECT (viewable)))
|
2001-06-29 19:25:03 +00:00
|
|
|
{
|
2004-03-17 18:49:44 +00: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-24 21:27:11 +00:00
|
|
|
|
2001-06-29 19:25:03 +00:00
|
|
|
spacing_sensitive = TRUE;
|
|
|
|
|
2003-01-05 22:07:10 +00:00
|
|
|
g_signal_handlers_block_by_func (view->spacing_adjustment,
|
2004-08-25 22:31:44 +00:00
|
|
|
gimp_brush_factory_view_spacing_update,
|
|
|
|
view);
|
2001-06-29 19:25:03 +00:00
|
|
|
|
|
|
|
gtk_adjustment_set_value (view->spacing_adjustment,
|
2004-08-25 22:31:44 +00:00
|
|
|
gimp_brush_get_spacing (brush));
|
2001-06-29 19:25:03 +00:00
|
|
|
|
2003-01-05 22:07:10 +00:00
|
|
|
g_signal_handlers_unblock_by_func (view->spacing_adjustment,
|
2004-08-25 22:31:44 +00:00
|
|
|
gimp_brush_factory_view_spacing_update,
|
|
|
|
view);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_set_sensitive (view->spacing_scale, spacing_sensitive);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_spacing_changed (GimpBrush *brush,
|
2004-08-25 22:31:44 +00:00
|
|
|
GimpBrushFactoryView *view)
|
2001-06-29 19:25:03 +00:00
|
|
|
{
|
2004-05-10 17:16:50 +00: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-29 19:25:03 +00:00
|
|
|
{
|
2003-01-05 22:07:10 +00:00
|
|
|
g_signal_handlers_block_by_func (view->spacing_adjustment,
|
2004-08-25 22:31:44 +00: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-24 21:27:11 +00:00
|
|
|
|
2001-06-29 19:25:03 +00:00
|
|
|
gtk_adjustment_set_value (view->spacing_adjustment,
|
2004-08-25 22:31:44 +00: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-24 21:27:11 +00:00
|
|
|
|
2003-01-05 22:07:10 +00:00
|
|
|
g_signal_handlers_unblock_by_func (view->spacing_adjustment,
|
2004-08-25 22:31:44 +00:00
|
|
|
gimp_brush_factory_view_spacing_update,
|
|
|
|
view);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gimp_brush_factory_view_spacing_update (GtkAdjustment *adjustment,
|
2004-08-25 22:31:44 +00:00
|
|
|
GimpBrushFactoryView *view)
|
2001-06-29 19:25:03 +00:00
|
|
|
{
|
2004-05-10 17:16:50 +00: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-29 19:25:03 +00:00
|
|
|
|
|
|
|
if (brush && view->change_brush_spacing)
|
|
|
|
{
|
2003-01-05 22:07:10 +00:00
|
|
|
g_signal_handlers_block_by_func (brush,
|
2004-08-25 22:31:44 +00: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-24 21:27:11 +00:00
|
|
|
|
2008-06-29 13:41:24 +00: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-24 21:27:11 +00:00
|
|
|
|
2003-01-05 22:07:10 +00:00
|
|
|
g_signal_handlers_unblock_by_func (brush,
|
2004-08-25 22:31:44 +00:00
|
|
|
gimp_brush_factory_view_spacing_changed,
|
|
|
|
view);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|
2021-04-28 02:04:41 +02:00
|
|
|
g_signal_emit (view, gimp_brush_factory_view_signals[SPACING_CHANGED], 0);
|
2001-06-29 19:25:03 +00:00
|
|
|
}
|