diff --git a/app/actions/Makefile.am b/app/actions/Makefile.am index f6c267b863..8c573b2944 100644 --- a/app/actions/Makefile.am +++ b/app/actions/Makefile.am @@ -117,6 +117,8 @@ libappactions_a_SOURCES = \ layers-actions.h \ layers-commands.c \ layers-commands.h \ + mypaint-brushes-actions.c \ + mypaint-brushes-actions.h \ palette-editor-actions.c \ palette-editor-actions.h \ palette-editor-commands.c \ diff --git a/app/actions/actions.c b/app/actions/actions.c index f931113820..507607915a 100644 --- a/app/actions/actions.c +++ b/app/actions/actions.c @@ -76,6 +76,7 @@ #include "image-actions.h" #include "images-actions.h" #include "layers-actions.h" +#include "mypaint-brushes-actions.h" #include "palette-editor-actions.h" #include "palettes-actions.h" #include "patterns-actions.h" @@ -190,6 +191,9 @@ static const GimpActionFactoryEntry action_groups[] = { "layers", N_("Layers"), GIMP_STOCK_LAYER, layers_actions_setup, layers_actions_update }, + { "mypaint-brushes", N_("MyPaint Brushes"), GIMP_STOCK_MYPAINT_BRUSH, + mypaint_brushes_actions_setup, + mypaint_brushes_actions_update }, { "palette-editor", N_("Palette Editor"), GIMP_STOCK_PALETTE, palette_editor_actions_setup, palette_editor_actions_update }, diff --git a/app/actions/dialogs-actions.c b/app/actions/dialogs-actions.c index 23e7893d58..a0fbf456a5 100644 --- a/app/actions/dialogs-actions.c +++ b/app/actions/dialogs-actions.c @@ -151,6 +151,12 @@ const GimpStringActionEntry dialogs_dockable_actions[] = "gimp-dynamics-editor", GIMP_HELP_DYNAMICS_EDITOR_DIALOG }, + { "dialogs-mypaint-brushes", GIMP_STOCK_MYPAINT_BRUSH, + NC_("dialogs-action", "_MyPaint Brushes"), "Y", + NC_("dialogs-action", "Open the mypaint brushes dialog"), + "gimp-mypaint-brush-grid|gimp-mapyint-brush-list", + GIMP_HELP_MYPAINT_BRUSH_DIALOG }, + { "dialogs-patterns", GIMP_STOCK_PATTERN, NC_("dialogs-action", "P_atterns"), "P", NC_("dialogs-action", "Open the patterns dialog"), diff --git a/app/actions/mypaint-brushes-actions.c b/app/actions/mypaint-brushes-actions.c new file mode 100644 index 0000000000..0eeb45f7a5 --- /dev/null +++ b/app/actions/mypaint-brushes-actions.c @@ -0,0 +1,142 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 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, see . + */ + +#include "config.h" + +#include +#include + +#include "libgimpwidgets/gimpwidgets.h" + +#include "actions-types.h" + +#include "core/gimpcontext.h" +#include "core/gimpmybrush.h" + +#include "widgets/gimpactiongroup.h" +#include "widgets/gimphelp-ids.h" + +#include "actions.h" +#include "data-commands.h" +#include "mypaint-brushes-actions.h" + +#include "gimp-intl.h" + + +static const GimpActionEntry mypaint_brushes_actions[] = +{ + { "mypaint-brushes-popup", GIMP_STOCK_MYPAINT_BRUSH, + NC_("mypaint-brushes-action", "MyPaint Brushes Menu"), NULL, NULL, NULL, + GIMP_HELP_MYPAINT_BRUSH_DIALOG }, + + { "mypaint-brushes-new", "document-new", + NC_("mypaint-brushes-action", "_New MyPaint Brush"), NULL, + NC_("mypaint-brushes-action", "Create a new MyPaint brush"), + G_CALLBACK (data_new_cmd_callback), + GIMP_HELP_MYPAINT_BRUSH_NEW }, + + { "mypaint-brushes-duplicate", GIMP_STOCK_DUPLICATE, + NC_("mypaint-brushes-action", "D_uplicate MyPaint Brush"), NULL, + NC_("mypaint-brushes-action", "Duplicate this MyPaint brush"), + G_CALLBACK (data_duplicate_cmd_callback), + GIMP_HELP_MYPAINT_BRUSH_DUPLICATE }, + + { "mypaint-brushes-copy-location", "edit-copy", + NC_("mypaint-brushes-action", "Copy MyPaint Brush _Location"), NULL, + NC_("mypaint-brushes-action", "Copy MyPaint brush file location to clipboard"), + G_CALLBACK (data_copy_location_cmd_callback), + GIMP_HELP_MYPAINT_BRUSH_COPY_LOCATION }, + + { "mypaint-brushes-show-in-file-manager", "gtk-directory", + NC_("mypaint-brushes-action", "Show in _File Manager"), NULL, + NC_("mypaint-brushes-action", "Show MyPaint brush file location in the file manager"), + G_CALLBACK (data_show_in_file_manager_cmd_callback), + GIMP_HELP_MYPAINT_BRUSH_SHOW_IN_FILE_MANAGER }, + + { "mypaint-brushes-delete", "edit-delete", + NC_("mypaint-brushes-action", "_Delete MyPaint Brush"), NULL, + NC_("mypaint-brushes-action", "Delete this MyPaint brush"), + G_CALLBACK (data_delete_cmd_callback), + GIMP_HELP_MYPAINT_BRUSH_DELETE }, + + { "mypaint-brushes-refresh", "view-refresh", + NC_("mypaint-brushes-action", "_Refresh MyPaint Brushes"), NULL, + NC_("mypaint-brushes-action", "Refresh MyPaint brushes"), + G_CALLBACK (data_refresh_cmd_callback), + GIMP_HELP_MYPAINT_BRUSH_REFRESH } +}; + +static const GimpStringActionEntry mypaint_brushes_edit_actions[] = +{ + { "mypaint-brushes-edit", "gtk-edit", + NC_("mypaint-brushes-action", "_Edit MyPaint Brush..."), NULL, + NC_("mypaint-bruahes-action", "Edit MyPaint brush"), + "gimp-mypaint-bruah-editor", + GIMP_HELP_MYPAINT_BRUSH_EDIT } +}; + + +void +mypaint_brushes_actions_setup (GimpActionGroup *group) +{ + gimp_action_group_add_actions (group, "mypaint-brushes-action", + mypaint_brushes_actions, + G_N_ELEMENTS (mypaint_brushes_actions)); + + gimp_action_group_add_string_actions (group, "mypaint-brushes-action", + mypaint_brushes_edit_actions, + G_N_ELEMENTS (mypaint_brushes_edit_actions), + G_CALLBACK (data_edit_cmd_callback)); +} + +void +mypaint_brushes_actions_update (GimpActionGroup *group, + gpointer user_data) +{ + GimpContext *context = action_data_get_context (user_data); + GimpMybrush *brush = NULL; + GimpData *data = NULL; + GFile *file = NULL; + + if (context) + { + brush = gimp_context_get_mybrush (context); + + if (action_data_sel_count (user_data) > 1) + { + brush = NULL; + } + + if (brush) + { + data = GIMP_DATA (brush); + + file = gimp_data_get_file (data); + } + } + +#define SET_SENSITIVE(action,condition) \ + gimp_action_group_set_action_sensitive (group, action, (condition) != 0) + + SET_SENSITIVE ("mypaint-brushes-edit", brush && FALSE); + SET_SENSITIVE ("mypaint-brushes-duplicate", brush && GIMP_DATA_GET_CLASS (data)->duplicate); + SET_SENSITIVE ("mypaint-brushes-copy-location", file); + SET_SENSITIVE ("mypaint-brushes-show-in-file-manager", file); + SET_SENSITIVE ("mypaint-brushes-delete", brush && gimp_data_is_deletable (data)); + +#undef SET_SENSITIVE +} diff --git a/app/actions/mypaint-brushes-actions.h b/app/actions/mypaint-brushes-actions.h new file mode 100644 index 0000000000..9babba5ae7 --- /dev/null +++ b/app/actions/mypaint-brushes-actions.h @@ -0,0 +1,27 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 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, see . + */ + +#ifndef __MYPAINT_BRUSHES_ACTIONS_H__ +#define __MYPAINT_BRUSHES_ACTIONS_H__ + + +void mypaint_brushes_actions_setup (GimpActionGroup *group); +void mypaint_brushes_actions_update (GimpActionGroup *group, + gpointer data); + + +#endif /* __MYPAINT_BRUSHES_ACTIONS_H__ */ diff --git a/app/core/Makefile.am b/app/core/Makefile.am index 3c6a2337aa..8448ff9fda 100644 --- a/app/core/Makefile.am +++ b/app/core/Makefile.am @@ -302,6 +302,10 @@ libappcore_a_sources = \ gimplist.h \ gimpmaskundo.c \ gimpmaskundo.h \ + gimpmybrush.c \ + gimpmybrush.h \ + gimpmybrush-load.c \ + gimpmybrush-load.h \ gimpobject.c \ gimpobject.h \ gimppaintinfo.c \ diff --git a/app/core/core-enums.h b/app/core/core-enums.h index 9ee78675ba..0bdf5f292c 100644 --- a/app/core/core-enums.h +++ b/app/core/core-enums.h @@ -556,14 +556,15 @@ typedef enum /*< pdb-skip, skip >*/ GIMP_CONTEXT_PROP_PAINT_MODE = 9, GIMP_CONTEXT_PROP_BRUSH = 10, GIMP_CONTEXT_PROP_DYNAMICS = 11, - GIMP_CONTEXT_PROP_PATTERN = 12, - GIMP_CONTEXT_PROP_GRADIENT = 13, - GIMP_CONTEXT_PROP_PALETTE = 14, - GIMP_CONTEXT_PROP_TOOL_PRESET = 15, - GIMP_CONTEXT_PROP_FONT = 16, - GIMP_CONTEXT_PROP_BUFFER = 17, - GIMP_CONTEXT_PROP_IMAGEFILE = 18, - GIMP_CONTEXT_PROP_TEMPLATE = 19, + GIMP_CONTEXT_PROP_MYBRUSH = 12, + GIMP_CONTEXT_PROP_PATTERN = 13, + GIMP_CONTEXT_PROP_GRADIENT = 14, + GIMP_CONTEXT_PROP_PALETTE = 15, + GIMP_CONTEXT_PROP_TOOL_PRESET = 16, + GIMP_CONTEXT_PROP_FONT = 17, + GIMP_CONTEXT_PROP_BUFFER = 18, + GIMP_CONTEXT_PROP_IMAGEFILE = 19, + GIMP_CONTEXT_PROP_TEMPLATE = 20, GIMP_CONTEXT_PROP_LAST = GIMP_CONTEXT_PROP_TEMPLATE } GimpContextPropType; @@ -581,14 +582,15 @@ typedef enum /*< pdb-skip, skip >*/ GIMP_CONTEXT_PROP_MASK_PAINT_MODE = 1 << 9, GIMP_CONTEXT_PROP_MASK_BRUSH = 1 << 10, GIMP_CONTEXT_PROP_MASK_DYNAMICS = 1 << 11, - GIMP_CONTEXT_PROP_MASK_PATTERN = 1 << 12, - GIMP_CONTEXT_PROP_MASK_GRADIENT = 1 << 13, - GIMP_CONTEXT_PROP_MASK_PALETTE = 1 << 14, - GIMP_CONTEXT_PROP_MASK_TOOL_PRESET = 1 << 15, - GIMP_CONTEXT_PROP_MASK_FONT = 1 << 16, - GIMP_CONTEXT_PROP_MASK_BUFFER = 1 << 17, - GIMP_CONTEXT_PROP_MASK_IMAGEFILE = 1 << 18, - GIMP_CONTEXT_PROP_MASK_TEMPLATE = 1 << 19, + GIMP_CONTEXT_PROP_MASK_MYBRUSH = 1 << 12, + GIMP_CONTEXT_PROP_MASK_PATTERN = 1 << 13, + GIMP_CONTEXT_PROP_MASK_GRADIENT = 1 << 14, + GIMP_CONTEXT_PROP_MASK_PALETTE = 1 << 15, + GIMP_CONTEXT_PROP_MASK_TOOL_PRESET = 1 << 16, + GIMP_CONTEXT_PROP_MASK_FONT = 1 << 17, + GIMP_CONTEXT_PROP_MASK_BUFFER = 1 << 18, + GIMP_CONTEXT_PROP_MASK_IMAGEFILE = 1 << 19, + GIMP_CONTEXT_PROP_MASK_TEMPLATE = 1 << 20, /* aliases */ GIMP_CONTEXT_PROP_MASK_PAINT = (GIMP_CONTEXT_PROP_MASK_FOREGROUND | @@ -604,6 +606,7 @@ typedef enum /*< pdb-skip, skip >*/ GIMP_CONTEXT_PROP_MASK_DISPLAY | GIMP_CONTEXT_PROP_MASK_TOOL | GIMP_CONTEXT_PROP_MASK_PAINT_INFO | + GIMP_CONTEXT_PROP_MASK_MYBRUSH | GIMP_CONTEXT_PROP_MASK_PALETTE | GIMP_CONTEXT_PROP_MASK_FONT | GIMP_CONTEXT_PROP_MASK_BUFFER | diff --git a/app/core/core-types.h b/app/core/core-types.h index 018857c77d..e660c89efe 100644 --- a/app/core/core-types.h +++ b/app/core/core-types.h @@ -133,6 +133,7 @@ typedef struct _GimpCurve GimpCurve; typedef struct _GimpDynamics GimpDynamics; typedef struct _GimpDynamicsOutput GimpDynamicsOutput; typedef struct _GimpGradient GimpGradient; +typedef struct _GimpMybrush GimpMybrush; typedef struct _GimpPalette GimpPalette; typedef struct _GimpPaletteMru GimpPaletteMru; typedef struct _GimpPattern GimpPattern; diff --git a/app/core/gimp.c b/app/core/gimp.c index 4cc2f2ffae..1fbb40b2bc 100644 --- a/app/core/gimp.c +++ b/app/core/gimp.c @@ -70,6 +70,8 @@ #include "gimpimagefile.h" #include "gimplist.h" #include "gimpmarshal.h" +#include "gimpmybrush-load.h" +#include "gimpmybrush.h" #include "gimppalette-load.h" #include "gimppalette.h" #include "gimpparasitelist.h" @@ -331,6 +333,9 @@ gimp_dispose (GObject *object) if (gimp->dynamics_factory) gimp_data_factory_data_free (gimp->dynamics_factory); + if (gimp->mybrush_factory) + gimp_data_factory_data_free (gimp->mybrush_factory); + if (gimp->pattern_factory) gimp_data_factory_data_free (gimp->pattern_factory); @@ -359,6 +364,8 @@ gimp_finalize (GObject *object) gimp_brush_get_standard (gimp->user_context)); standards = g_list_prepend (standards, gimp_dynamics_get_standard (gimp->user_context)); + standards = g_list_prepend (standards, + gimp_mybrush_get_standard (gimp->user_context)); standards = g_list_prepend (standards, gimp_pattern_get_standard (gimp->user_context)); standards = g_list_prepend (standards, @@ -416,6 +423,12 @@ gimp_finalize (GObject *object) gimp->dynamics_factory = NULL; } + if (gimp->mybrush_factory) + { + g_object_unref (gimp->mybrush_factory); + gimp->mybrush_factory = NULL; + } + if (gimp->pattern_factory) { g_object_unref (gimp->pattern_factory); @@ -580,6 +593,8 @@ gimp_get_memsize (GimpObject *object, gui_size); memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->dynamics_factory), gui_size); + memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->mybrush_factory), + gui_size); memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->pattern_factory), gui_size); memsize += gimp_object_get_memsize (GIMP_OBJECT (gimp->gradient_factory), @@ -635,6 +650,11 @@ gimp_real_initialize (Gimp *gimp, { gimp_dynamics_load, GIMP_DYNAMICS_FILE_EXTENSION, TRUE } }; + static const GimpDataFactoryLoaderEntry mybrush_loader_entries[] = + { + { gimp_mybrush_load, GIMP_MYBRUSH_FILE_EXTENSION, FALSE } + }; + static const GimpDataFactoryLoaderEntry pattern_loader_entries[] = { { gimp_pattern_load, GIMP_PATTERN_FILE_EXTENSION, FALSE }, @@ -689,6 +709,17 @@ gimp_real_initialize (Gimp *gimp, gimp_object_set_static_name (GIMP_OBJECT (gimp->dynamics_factory), "dynamics factory"); + gimp->mybrush_factory = + gimp_data_factory_new (gimp, + GIMP_TYPE_MYBRUSH, + "mypaint-brush-path", "mypaint-brush-path-writable", + mybrush_loader_entries, + G_N_ELEMENTS (mybrush_loader_entries), + NULL, + NULL); + gimp_object_set_static_name (GIMP_OBJECT (gimp->mybrush_factory), + "mypaint brush factory"); + gimp->pattern_factory = gimp_data_factory_new (gimp, GIMP_TYPE_PATTERN, @@ -813,6 +844,7 @@ gimp_real_exit (Gimp *gimp, gimp_data_factory_data_save (gimp->brush_factory); gimp_data_factory_data_save (gimp->dynamics_factory); + gimp_data_factory_data_save (gimp->mybrush_factory); gimp_data_factory_data_save (gimp->pattern_factory); gimp_data_factory_data_save (gimp->gradient_factory); gimp_data_factory_data_save (gimp->palette_factory); @@ -1055,6 +1087,11 @@ gimp_restore (Gimp *gimp, gimp_data_factory_data_init (gimp->dynamics_factory, gimp->user_context, gimp->no_data); + /* initialize the list of mypaint brushes */ + status_callback (NULL, _("MyPaint Brushes"), 0.25); + gimp_data_factory_data_init (gimp->mybrush_factory, gimp->user_context, + gimp->no_data); + /* initialize the list of gimp patterns */ status_callback (NULL, _("Patterns"), 0.3); gimp_data_factory_data_init (gimp->pattern_factory, gimp->user_context, @@ -1101,6 +1138,8 @@ gimp_restore (Gimp *gimp, gimp_data_factory_get_container (gimp->brush_factory)); gimp_tag_cache_add_container (gimp->tag_cache, gimp_data_factory_get_container (gimp->dynamics_factory)); + gimp_tag_cache_add_container (gimp->tag_cache, + gimp_data_factory_get_container (gimp->mybrush_factory)); gimp_tag_cache_add_container (gimp->tag_cache, gimp_data_factory_get_container (gimp->pattern_factory)); gimp_tag_cache_add_container (gimp->tag_cache, @@ -1118,6 +1157,7 @@ gimp_restore (Gimp *gimp, */ gimp_data_factory_data_clean (gimp->brush_factory); gimp_data_factory_data_clean (gimp->dynamics_factory); + gimp_data_factory_data_clean (gimp->mybrush_factory); gimp_data_factory_data_clean (gimp->pattern_factory); gimp_data_factory_data_clean (gimp->palette_factory); gimp_data_factory_data_clean (gimp->gradient_factory); diff --git a/app/core/gimp.h b/app/core/gimp.h index cd8d9d9d98..b560822cb6 100644 --- a/app/core/gimp.h +++ b/app/core/gimp.h @@ -94,6 +94,7 @@ struct _Gimp GimpDataFactory *brush_factory; GimpDataFactory *dynamics_factory; + GimpDataFactory *mybrush_factory; GimpDataFactory *pattern_factory; GimpDataFactory *gradient_factory; GimpDataFactory *palette_factory; diff --git a/app/core/gimpcontext.c b/app/core/gimpcontext.c index daca6e65cd..ffa286d7a9 100644 --- a/app/core/gimpcontext.c +++ b/app/core/gimpcontext.c @@ -44,6 +44,7 @@ #include "gimpgradient.h" #include "gimpimage.h" #include "gimpmarshal.h" +#include "gimpmybrush.h" #include "gimppaintinfo.h" #include "gimppalette.h" #include "gimppattern.h" @@ -177,6 +178,17 @@ static void gimp_context_dynamics_list_thaw (GimpContainer *container, static void gimp_context_real_set_dynamics (GimpContext *context, GimpDynamics *dynamics); +/* mybrush */ +static void gimp_context_mybrush_dirty (GimpMybrush *brush, + GimpContext *context); +static void gimp_context_mybrush_removed (GimpContainer *brush_list, + GimpMybrush *brush, + GimpContext *context); +static void gimp_context_mybrush_list_thaw (GimpContainer *container, + GimpContext *context); +static void gimp_context_real_set_mybrush (GimpContext *context, + GimpMybrush *brush); + /* pattern */ static void gimp_context_pattern_dirty (GimpPattern *pattern, GimpContext *context); @@ -297,6 +309,7 @@ enum PAINT_MODE_CHANGED, BRUSH_CHANGED, DYNAMICS_CHANGED, + MYBRUSH_CHANGED, PATTERN_CHANGED, GRADIENT_CHANGED, PALETTE_CHANGED, @@ -323,6 +336,7 @@ static const gchar * const gimp_context_prop_names[] = "paint-mode", "brush", "dynamics", + "mybrush", "pattern", "gradient", "palette", @@ -354,6 +368,7 @@ static GType gimp_context_prop_types[] = 0, 0, 0, + 0, 0 }; @@ -478,6 +493,16 @@ gimp_context_class_init (GimpContextClass *klass) G_TYPE_NONE, 1, GIMP_TYPE_DYNAMICS); + gimp_context_signals[MYBRUSH_CHANGED] = + g_signal_new ("mybrush-changed", + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GimpContextClass, mybrush_changed), + NULL, NULL, + gimp_marshal_VOID__OBJECT, + G_TYPE_NONE, 1, + GIMP_TYPE_MYBRUSH); + gimp_context_signals[PATTERN_CHANGED] = g_signal_new ("pattern-changed", G_TYPE_FROM_CLASS (klass), @@ -586,6 +611,7 @@ gimp_context_class_init (GimpContextClass *klass) klass->paint_mode_changed = NULL; klass->brush_changed = NULL; klass->dynamics_changed = NULL; + klass->mybrush_changed = NULL; klass->pattern_changed = NULL; klass->gradient_changed = NULL; klass->palette_changed = NULL; @@ -601,6 +627,7 @@ gimp_context_class_init (GimpContextClass *klass) gimp_context_prop_types[GIMP_CONTEXT_PROP_PAINT_INFO] = GIMP_TYPE_PAINT_INFO; gimp_context_prop_types[GIMP_CONTEXT_PROP_BRUSH] = GIMP_TYPE_BRUSH; gimp_context_prop_types[GIMP_CONTEXT_PROP_DYNAMICS] = GIMP_TYPE_DYNAMICS; + gimp_context_prop_types[GIMP_CONTEXT_PROP_MYBRUSH] = GIMP_TYPE_MYBRUSH; gimp_context_prop_types[GIMP_CONTEXT_PROP_PATTERN] = GIMP_TYPE_PATTERN; gimp_context_prop_types[GIMP_CONTEXT_PROP_GRADIENT] = GIMP_TYPE_GRADIENT; gimp_context_prop_types[GIMP_CONTEXT_PROP_PALETTE] = GIMP_TYPE_PALETTE; @@ -678,6 +705,12 @@ gimp_context_class_init (GimpContextClass *klass) GIMP_TYPE_DYNAMICS, GIMP_PARAM_STATIC_STRINGS); + GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_MYBRUSH, + gimp_context_prop_names[GIMP_CONTEXT_PROP_MYBRUSH], + NULL, + GIMP_TYPE_MYBRUSH, + GIMP_PARAM_STATIC_STRINGS); + GIMP_CONFIG_INSTALL_PROP_OBJECT (object_class, GIMP_CONTEXT_PROP_PATTERN, gimp_context_prop_names[GIMP_CONTEXT_PROP_PATTERN], NULL, @@ -752,6 +785,9 @@ gimp_context_init (GimpContext *context) context->dynamics = NULL; context->dynamics_name = NULL; + context->mybrush = NULL; + context->mybrush_name = NULL; + context->pattern = NULL; context->pattern_name = NULL; @@ -837,6 +873,14 @@ gimp_context_constructed (GObject *object) G_CALLBACK (gimp_context_dynamics_list_thaw), object, 0); + container = gimp_data_factory_get_container (gimp->mybrush_factory); + g_signal_connect_object (container, "remove", + G_CALLBACK (gimp_context_mybrush_removed), + object, 0); + g_signal_connect_object (container, "thaw", + G_CALLBACK (gimp_context_mybrush_list_thaw), + object, 0); + container = gimp_data_factory_get_container (gimp->pattern_factory); g_signal_connect_object (container, "remove", G_CALLBACK (gimp_context_pattern_removed), @@ -934,6 +978,12 @@ gimp_context_dispose (GObject *object) context->dynamics = NULL; } + if (context->mybrush) + { + g_object_unref (context->mybrush); + context->mybrush = NULL; + } + if (context->pattern) { g_object_unref (context->pattern); @@ -1018,6 +1068,12 @@ gimp_context_finalize (GObject *object) context->dynamics_name = NULL; } + if (context->mybrush_name) + { + g_free (context->mybrush_name); + context->mybrush_name = NULL; + } + if (context->pattern_name) { g_free (context->pattern_name); @@ -1112,6 +1168,9 @@ gimp_context_set_property (GObject *object, case GIMP_CONTEXT_PROP_DYNAMICS: gimp_context_set_dynamics (context, g_value_get_object (value)); break; + case GIMP_CONTEXT_PROP_MYBRUSH: + gimp_context_set_mybrush (context, g_value_get_object (value)); + break; case GIMP_CONTEXT_PROP_PATTERN: gimp_context_set_pattern (context, g_value_get_object (value)); break; @@ -1195,6 +1254,9 @@ gimp_context_get_property (GObject *object, case GIMP_CONTEXT_PROP_DYNAMICS: g_value_set_object (value, gimp_context_get_dynamics (context)); break; + case GIMP_CONTEXT_PROP_MYBRUSH: + g_value_set_object (value, gimp_context_get_mybrush (context)); + break; case GIMP_CONTEXT_PROP_PATTERN: g_value_set_object (value, gimp_context_get_pattern (context)); break; @@ -1236,6 +1298,7 @@ gimp_context_get_memsize (GimpObject *object, memsize += gimp_string_get_memsize (context->paint_name); memsize += gimp_string_get_memsize (context->brush_name); memsize += gimp_string_get_memsize (context->dynamics_name); + memsize += gimp_string_get_memsize (context->mybrush_name); memsize += gimp_string_get_memsize (context->pattern_name); memsize += gimp_string_get_memsize (context->palette_name); memsize += gimp_string_get_memsize (context->tool_preset_name); @@ -1297,6 +1360,7 @@ gimp_context_serialize_property (GimpConfig *config, case GIMP_CONTEXT_PROP_PAINT_INFO: case GIMP_CONTEXT_PROP_BRUSH: case GIMP_CONTEXT_PROP_DYNAMICS: + case GIMP_CONTEXT_PROP_MYBRUSH: case GIMP_CONTEXT_PROP_PATTERN: case GIMP_CONTEXT_PROP_GRADIENT: case GIMP_CONTEXT_PROP_PALETTE: @@ -1364,6 +1428,12 @@ gimp_context_deserialize_property (GimpConfig *object, name_loc = &context->dynamics_name; break; + case GIMP_CONTEXT_PROP_MYBRUSH: + container = gimp_data_factory_get_container (context->gimp->mybrush_factory); + current = (GimpObject *) context->mybrush; + name_loc = &context->mybrush_name; + break; + case GIMP_CONTEXT_PROP_PATTERN: container = gimp_data_factory_get_container (context->gimp->pattern_factory); current = (GimpObject *) context->pattern; @@ -1690,6 +1760,14 @@ gimp_context_copy_property (GimpContext *src, dest_name_loc = &dest->dynamics_name; break; + case GIMP_CONTEXT_PROP_MYBRUSH: + gimp_context_real_set_mybrush (dest, src->mybrush); + object = src->mybrush; + standard_object = gimp_mybrush_get_standard (src); + src_name = src->mybrush_name; + dest_name_loc = &dest->mybrush_name; + break; + case GIMP_CONTEXT_PROP_PATTERN: gimp_context_real_set_pattern (dest, src->pattern); object = src->pattern; @@ -2807,6 +2885,130 @@ gimp_context_real_set_dynamics (GimpContext *context, } +/*****************************************************************************/ +/* mybrush *****************************************************************/ + +GimpMybrush * +gimp_context_get_mybrush (GimpContext *context) +{ + g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL); + + return context->mybrush; +} + +void +gimp_context_set_mybrush (GimpContext *context, + GimpMybrush *brush) +{ + g_return_if_fail (GIMP_IS_CONTEXT (context)); + g_return_if_fail (! brush || GIMP_IS_MYBRUSH (brush)); + context_find_defined (context, GIMP_CONTEXT_PROP_MYBRUSH); + + gimp_context_real_set_mybrush (context, brush); +} + +void +gimp_context_mybrush_changed (GimpContext *context) +{ + g_return_if_fail (GIMP_IS_CONTEXT (context)); + + g_signal_emit (context, + gimp_context_signals[MYBRUSH_CHANGED], 0, + context->mybrush); +} + +/* the active mybrush was modified */ +static void +gimp_context_mybrush_dirty (GimpMybrush *brush, + GimpContext *context) +{ + g_free (context->mybrush_name); + context->mybrush_name = g_strdup (gimp_object_get_name (brush)); + + g_signal_emit (context, gimp_context_signals[PROP_NAME_CHANGED], 0, + GIMP_CONTEXT_PROP_MYBRUSH); +} + +/* the global mybrush list is there again after refresh */ +static void +gimp_context_mybrush_list_thaw (GimpContainer *container, + GimpContext *context) +{ + GimpMybrush *brush; + + if (! context->mybrush_name) + context->mybrush_name = g_strdup (context->gimp->config->default_mypaint_brush); + + brush = gimp_context_find_object (context, container, + context->mybrush_name, + gimp_mybrush_get_standard (context)); + + gimp_context_real_set_mybrush (context, brush); +} + +/* the active mybrush disappeared */ +static void +gimp_context_mybrush_removed (GimpContainer *container, + GimpMybrush *brush, + GimpContext *context) +{ + if (brush == context->mybrush) + { + context->mybrush = NULL; + + g_signal_handlers_disconnect_by_func (brush, + gimp_context_mybrush_dirty, + context); + g_object_unref (brush); + + if (! gimp_container_frozen (container)) + gimp_context_mybrush_list_thaw (container, context); + } +} + +static void +gimp_context_real_set_mybrush (GimpContext *context, + GimpMybrush *brush) +{ + if (context->mybrush == brush) + return; + + if (context->mybrush_name && + brush != GIMP_MYBRUSH (gimp_mybrush_get_standard (context))) + { + g_free (context->mybrush_name); + context->mybrush_name = NULL; + } + + /* disconnect from the old mybrush's signals */ + if (context->mybrush) + { + g_signal_handlers_disconnect_by_func (context->mybrush, + gimp_context_mybrush_dirty, + context); + g_object_unref (context->mybrush); + } + + context->mybrush = brush; + + if (brush) + { + g_object_ref (brush); + + g_signal_connect_object (brush, "name-changed", + G_CALLBACK (gimp_context_mybrush_dirty), + context, + 0); + + if (brush != GIMP_MYBRUSH (gimp_mybrush_get_standard (context))) + context->mybrush_name = g_strdup (gimp_object_get_name (brush)); + } + + g_object_notify (G_OBJECT (context), "mybrush"); + gimp_context_mybrush_changed (context); +} + + /*****************************************************************************/ /* pattern *****************************************************************/ diff --git a/app/core/gimpcontext.h b/app/core/gimpcontext.h index 0406a95c87..43d08c1792 100644 --- a/app/core/gimpcontext.h +++ b/app/core/gimpcontext.h @@ -76,6 +76,9 @@ struct _GimpContext GimpDynamics *dynamics; gchar *dynamics_name; + GimpMybrush *mybrush; + gchar *mybrush_name; + GimpPattern *pattern; gchar *pattern_name; @@ -127,6 +130,8 @@ struct _GimpContextClass GimpBrush *brush); void (* dynamics_changed) (GimpContext *context, GimpDynamics *dynamics); + void (* mybrush_changed) (GimpContext *context, + GimpMybrush *brush); void (* pattern_changed) (GimpContext *context, GimpPattern *pattern); void (* gradient_changed) (GimpContext *context, @@ -299,6 +304,13 @@ void gimp_context_set_dynamics (GimpContext *context, void gimp_context_dynamics_changed (GimpContext *context); +/* mybrush */ +GimpMybrush * gimp_context_get_mybrush (GimpContext *context); +void gimp_context_set_mybrush (GimpContext *context, + GimpMybrush *brush); +void gimp_context_mybrush_changed (GimpContext *context); + + /* pattern */ GimpPattern * gimp_context_get_pattern (GimpContext *context); void gimp_context_set_pattern (GimpContext *context, diff --git a/app/core/gimpmybrush-load.c b/app/core/gimpmybrush-load.c new file mode 100644 index 0000000000..1a25e6bd58 --- /dev/null +++ b/app/core/gimpmybrush-load.c @@ -0,0 +1,83 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * gimpbrush-load.c + * + * 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 3 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, see . + */ + +#include "config.h" + +#include +#include + +#include "libgimpbase/gimpbase.h" + +#include "core-types.h" + +#include "gimpmybrush.h" +#include "gimpmybrush-load.h" + +#include "gimp-intl.h" + + +/* public functions */ + +GList * +gimp_mybrush_load (GimpContext *context, + GFile *file, + GInputStream *input, + GError **error) +{ + GimpBrush *brush = NULL; + GdkPixbuf *pixbuf; + gchar *path; + gchar *basename; + gchar *preview_filename; + + g_return_val_if_fail (G_IS_FILE (file), NULL); + g_return_val_if_fail (G_IS_INPUT_STREAM (input), NULL); + g_return_val_if_fail (error == NULL || *error == NULL, NULL); + + path = g_file_get_path (file); + basename = g_strndup (path, strlen (path) - 4); + g_free (path); + + preview_filename = g_strconcat (basename, "_prev.png", NULL); + g_free (basename); + + pixbuf = gdk_pixbuf_new_from_file_at_size (preview_filename, + 48, 48, NULL); + + if (pixbuf) + { + basename = g_file_get_basename (file); + + brush = g_object_new (GIMP_TYPE_MYBRUSH, + "name", gimp_filename_to_utf8 (basename), + "mime-type", "image/x-gimp-myb", + "icon-pixbuf", pixbuf, + NULL); + + g_free (basename); + g_object_unref (pixbuf); + } + + g_free (preview_filename); + + if (! brush) + return NULL; + + return g_list_prepend (NULL, brush); +} diff --git a/app/core/gimpmybrush-load.h b/app/core/gimpmybrush-load.h new file mode 100644 index 0000000000..c277a64be3 --- /dev/null +++ b/app/core/gimpmybrush-load.h @@ -0,0 +1,31 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 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, see . + */ + +#ifndef __GIMP_MYBRUSH_LOAD_H__ +#define __GIMP_MYBRUSH_LOAD_H__ + + +#define GIMP_MYBRUSH_FILE_EXTENSION ".myb" + + +GList * gimp_mybrush_load (GimpContext *context, + GFile *file, + GInputStream *input, + GError **error); + + +#endif /* __GIMP_MYBRUSH_LOAD_H__ */ diff --git a/app/core/gimpmybrush.c b/app/core/gimpmybrush.c new file mode 100644 index 0000000000..df0f3cae23 --- /dev/null +++ b/app/core/gimpmybrush.c @@ -0,0 +1,222 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 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, see . + */ + +#include "config.h" + +#include +#include +#include + +#include "core-types.h" + +#include "gimpmybrush.h" +#include "gimpmybrush-load.h" +#include "gimptagged.h" + +#include "gimp-intl.h" + + +struct _GimpMybrushPrivate +{ + gpointer dummy; +}; + + +static void gimp_mybrush_tagged_iface_init (GimpTaggedInterface *iface); + +static void gimp_mybrush_finalize (GObject *object); +static void gimp_mybrush_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec); +static void gimp_mybrush_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec); + +static gint64 gimp_mybrush_get_memsize (GimpObject *object, + gint64 *gui_size); + +static gchar * gimp_mybrush_get_description (GimpViewable *viewable, + gchar **tooltip); + +static void gimp_mybrush_dirty (GimpData *data); +static const gchar * gimp_mybrush_get_extension (GimpData *data); + +static gchar * gimp_mybrush_get_checksum (GimpTagged *tagged); + + +G_DEFINE_TYPE_WITH_CODE (GimpMybrush, gimp_mybrush, GIMP_TYPE_DATA, + G_IMPLEMENT_INTERFACE (GIMP_TYPE_TAGGED, + gimp_mybrush_tagged_iface_init)) + +#define parent_class gimp_mybrush_parent_class + + +static void +gimp_mybrush_class_init (GimpMybrushClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + GimpObjectClass *gimp_object_class = GIMP_OBJECT_CLASS (klass); + GimpViewableClass *viewable_class = GIMP_VIEWABLE_CLASS (klass); + GimpDataClass *data_class = GIMP_DATA_CLASS (klass); + + object_class->finalize = gimp_mybrush_finalize; + object_class->get_property = gimp_mybrush_get_property; + object_class->set_property = gimp_mybrush_set_property; + + gimp_object_class->get_memsize = gimp_mybrush_get_memsize; + + viewable_class->default_icon_name = "gimp-tool-mybrush"; + viewable_class->get_description = gimp_mybrush_get_description; + + data_class->dirty = gimp_mybrush_dirty; + data_class->get_extension = gimp_mybrush_get_extension; + + g_type_class_add_private (klass, sizeof (GimpMybrushPrivate)); +} + +static void +gimp_mybrush_tagged_iface_init (GimpTaggedInterface *iface) +{ + iface->get_checksum = gimp_mybrush_get_checksum; +} + +static void +gimp_mybrush_init (GimpMybrush *brush) +{ + brush->priv = G_TYPE_INSTANCE_GET_PRIVATE (brush, + GIMP_TYPE_MYBRUSH, + GimpMybrushPrivate); +} + +static void +gimp_mybrush_finalize (GObject *object) +{ + GimpMybrush *brush = GIMP_MYBRUSH (object); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +gimp_mybrush_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + GimpMybrush *brush = GIMP_MYBRUSH (object); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static void +gimp_mybrush_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + GimpMybrush *brush = GIMP_MYBRUSH (object); + + switch (property_id) + { + default: + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); + break; + } +} + +static gint64 +gimp_mybrush_get_memsize (GimpObject *object, + gint64 *gui_size) +{ + GimpMybrush *brush = GIMP_MYBRUSH (object); + gint64 memsize = 0; + + return memsize + GIMP_OBJECT_CLASS (parent_class)->get_memsize (object, + gui_size); +} + +static gchar * +gimp_mybrush_get_description (GimpViewable *viewable, + gchar **tooltip) +{ + GimpMybrush *brush = GIMP_MYBRUSH (viewable); + + return g_strdup_printf ("%s", + gimp_object_get_name (brush)); +} + +static void +gimp_mybrush_dirty (GimpData *data) +{ + GimpMybrush *brush = GIMP_MYBRUSH (data); + + GIMP_DATA_CLASS (parent_class)->dirty (data); +} + +static const gchar * +gimp_mybrush_get_extension (GimpData *data) +{ + return GIMP_MYBRUSH_FILE_EXTENSION; +} + +static gchar * +gimp_mybrush_get_checksum (GimpTagged *tagged) +{ + GimpMybrush *brush = GIMP_MYBRUSH (tagged); + gchar *checksum_string = NULL; + + return checksum_string; +} + +/* public functions */ + +GimpData * +gimp_mybrush_new (GimpContext *context, + const gchar *name) +{ + g_return_val_if_fail (name != NULL, NULL); + + return g_object_new (GIMP_TYPE_MYBRUSH, + "name", name, + "mime-type", "image/x-gimp-myb", + NULL); +} + +GimpData * +gimp_mybrush_get_standard (GimpContext *context) +{ + static GimpData *standard_mybrush = NULL; + + if (! standard_mybrush) + { + standard_mybrush = gimp_mybrush_new (context, "Standard"); + + gimp_data_clean (standard_mybrush); + gimp_data_make_internal (standard_mybrush, "gimp-mybrush-standard"); + + g_object_add_weak_pointer (G_OBJECT (standard_mybrush), + (gpointer *) &standard_mybrush); + } + + return standard_mybrush; +} diff --git a/app/core/gimpmybrush.h b/app/core/gimpmybrush.h new file mode 100644 index 0000000000..b01f02385f --- /dev/null +++ b/app/core/gimpmybrush.h @@ -0,0 +1,56 @@ +/* GIMP - The GNU Image Manipulation Program + * Copyright (C) 1995 Spencer Kimball and Peter Mattis + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 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, see . + */ + +#ifndef __GIMP_MYBRUSH_H__ +#define __GIMP_MYBRUSH_H__ + + +#include "gimpdata.h" + + +#define GIMP_TYPE_MYBRUSH (gimp_mybrush_get_type ()) +#define GIMP_MYBRUSH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_MYBRUSH, GimpMybrush)) +#define GIMP_MYBRUSH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_MYBRUSH, GimpMybrushClass)) +#define GIMP_IS_MYBRUSH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GIMP_TYPE_MYBRUSH)) +#define GIMP_IS_MYBRUSH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MYBRUSH)) +#define GIMP_MYBRUSH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MYBRUSH, GimpMybrushClass)) + + +typedef struct _GimpMybrushPrivate GimpMybrushPrivate; +typedef struct _GimpMybrushClass GimpMybrushClass; + +struct _GimpMybrush +{ + GimpData parent_instance; + + GimpMybrushPrivate *priv; +}; + +struct _GimpMybrushClass +{ + GimpDataClass parent_class; +}; + + +GType gimp_mybrush_get_type (void) G_GNUC_CONST; + +GimpData * gimp_mybrush_new (GimpContext *context, + const gchar *name); +GimpData * gimp_mybrush_get_standard (GimpContext *context); + + +#endif /* __GIMP_MYBRUSH_H__ */ diff --git a/app/dialogs/dialogs-constructors.c b/app/dialogs/dialogs-constructors.c index 267625f8e5..bed8d830ba 100644 --- a/app/dialogs/dialogs-constructors.c +++ b/app/dialogs/dialogs-constructors.c @@ -386,6 +386,22 @@ dialogs_dynamics_list_view_new (GimpDialogFactory *factory, gimp_dialog_factory_get_menu_factory (factory)); } +GtkWidget * +dialogs_mypaint_brush_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size) +{ + return gimp_data_factory_view_new (GIMP_VIEW_TYPE_LIST, + context->gimp->mybrush_factory, + context, + view_size, 1, + gimp_dialog_factory_get_menu_factory (factory), + "", + "/mypaint-brushes-popup", + "mypaint-brushes"); +} + GtkWidget * dialogs_pattern_list_view_new (GimpDialogFactory *factory, GimpContext *context, @@ -526,6 +542,22 @@ dialogs_brush_grid_view_new (GimpDialogFactory *factory, gimp_dialog_factory_get_menu_factory (factory)); } +GtkWidget * +dialogs_mypaint_brush_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size) +{ + return gimp_data_factory_view_new (GIMP_VIEW_TYPE_GRID, + context->gimp->mybrush_factory, + context, + view_size, 1, + gimp_dialog_factory_get_menu_factory (factory), + "", + "/mypaint-brushes-popup", + "mypaint-brushes"); +} + GtkWidget * dialogs_pattern_grid_view_new (GimpDialogFactory *factory, GimpContext *context, diff --git a/app/dialogs/dialogs-constructors.h b/app/dialogs/dialogs-constructors.h index 53b8d53f61..8f457a1922 100644 --- a/app/dialogs/dialogs-constructors.h +++ b/app/dialogs/dialogs-constructors.h @@ -21,261 +21,268 @@ /* toplevel dialogs */ -GtkWidget * dialogs_image_new_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_file_open_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_file_open_location_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_file_save_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_file_export_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_preferences_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_input_devices_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_keyboard_shortcuts_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_module_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_palette_import_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_tips_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_about_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_action_search_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_error_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_close_all_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_quit_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_image_new_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_file_open_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_file_open_location_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_file_save_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_file_export_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_preferences_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_input_devices_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_keyboard_shortcuts_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_module_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_palette_import_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_tips_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_about_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_action_search_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_error_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_close_all_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_quit_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); /* docks */ -GtkWidget * dialogs_toolbox_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_toolbox_dock_window_new - (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_dock_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_dock_window_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_toolbox_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_toolbox_dock_window_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_dock_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_dock_window_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); /* dockables */ -GtkWidget * dialogs_tool_options_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_device_status_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_error_console_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_cursor_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_tool_options_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_device_status_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_error_console_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_cursor_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); -GtkWidget * dialogs_image_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_brush_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_dynamics_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_pattern_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_gradient_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_palette_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_font_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_buffer_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_tool_preset_list_view_new - (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_document_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_template_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_image_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_brush_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_dynamics_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_mypaint_brush_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_pattern_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_gradient_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_palette_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_font_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_buffer_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_tool_preset_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_document_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_template_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); -GtkWidget * dialogs_image_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_brush_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_pattern_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_gradient_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_palette_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_font_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_buffer_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_document_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_template_grid_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_image_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_brush_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_mypaint_brush_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_pattern_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_gradient_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_palette_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_font_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_buffer_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_document_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_template_grid_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); -GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_vectors_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_path_list_view_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_colormap_editor_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_histogram_editor_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_selection_editor_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_undo_editor_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_sample_point_editor_new(GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_layer_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_channel_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_vectors_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_path_list_view_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_colormap_editor_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_histogram_editor_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_selection_editor_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_undo_editor_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_sample_point_editor_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); -GtkWidget * dialogs_navigation_editor_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_navigation_editor_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); -GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); +GtkWidget * dialogs_color_editor_new (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); + +GtkWidget * dialogs_brush_editor_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_dynamics_editor_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); +GtkWidget * dialogs_tool_preset_editor_get (GimpDialogFactory *factory, + GimpContext *context, + GimpUIManager *ui_manager, + gint view_size); -GtkWidget * dialogs_brush_editor_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_dynamics_editor_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_gradient_editor_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_palette_editor_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); -GtkWidget * dialogs_tool_preset_editor_get (GimpDialogFactory *factory, - GimpContext *context, - GimpUIManager *ui_manager, - gint view_size); #endif /* __DIALOGS_CONSTRUCTORS_H__ */ diff --git a/app/dialogs/dialogs.c b/app/dialogs/dialogs.c index 17eae74e54..a6bcf65dbb 100644 --- a/app/dialogs/dialogs.c +++ b/app/dialogs/dialogs.c @@ -160,13 +160,13 @@ GimpContainer *global_recent_docks = NULL; FALSE /* image_window */, \ FALSE /* dockable */} -#define LISTGRID(id, name, blurb, icon_name, help_id, view_size) \ +#define LISTGRID(id, new_func, name, blurb, icon_name, help_id, view_size) \ { "gimp-"#id"-list" /* identifier */, \ name /* name */, \ blurb /* blurb */, \ icon_name /* icon_name */, \ help_id /* help_id */, \ - dialogs_##id##_list_view_new /* new_func */, \ + dialogs_##new_func##_list_view_new /* new_func */, \ NULL /* restore_func */, \ view_size /* view_size */, \ FALSE /* singleton */, \ @@ -181,7 +181,7 @@ GimpContainer *global_recent_docks = NULL; blurb /* blurb */, \ icon_name /* icon_name */, \ help_id /* help_id */, \ - dialogs_##id##_grid_view_new /* new_func */, \ + dialogs_##new_func##_grid_view_new /* new_func */, \ NULL /* restore_func */, \ view_size /* view_size */, \ FALSE /* singleton */, \ @@ -321,29 +321,43 @@ static const GimpDialogFactoryEntry entries[] = dialogs_cursor_view_new, 0, TRUE), /* list & grid views */ - LISTGRID (image, N_("Images"), NULL, GIMP_STOCK_IMAGES, + LISTGRID (image, image, + N_("Images"), NULL, GIMP_STOCK_IMAGES, GIMP_HELP_IMAGE_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LISTGRID (brush, N_("Brushes"), NULL, GIMP_STOCK_BRUSH, + LISTGRID (brush, brush, + N_("Brushes"), NULL, GIMP_STOCK_BRUSH, GIMP_HELP_BRUSH_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LISTGRID (pattern, N_("Patterns"), NULL, GIMP_STOCK_PATTERN, + LISTGRID (mypaint-brush, mypaint_brush, + N_("MyPaint Brushes"), NULL, GIMP_STOCK_MYPAINT_BRUSH, + GIMP_HELP_MYPAINT_BRUSH_DIALOG, GIMP_VIEW_SIZE_LARGE), + LISTGRID (pattern, pattern, + N_("Patterns"), NULL, GIMP_STOCK_PATTERN, GIMP_HELP_PATTERN_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LISTGRID (gradient, N_("Gradients"), NULL, GIMP_STOCK_GRADIENT, + LISTGRID (gradient, gradient, + N_("Gradients"), NULL, GIMP_STOCK_GRADIENT, GIMP_HELP_GRADIENT_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LISTGRID (palette, N_("Palettes"), NULL, GIMP_STOCK_PALETTE, + LISTGRID (palette, palette, + N_("Palettes"), NULL, GIMP_STOCK_PALETTE, GIMP_HELP_PALETTE_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LISTGRID (font, N_("Fonts"), NULL, GIMP_STOCK_FONT, + LISTGRID (font, font, + N_("Fonts"), NULL, GIMP_STOCK_FONT, GIMP_HELP_FONT_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LISTGRID (buffer, N_("Buffers"), NULL, GIMP_STOCK_BUFFER, + LISTGRID (buffer, buffer, + N_("Buffers"), NULL, GIMP_STOCK_BUFFER, GIMP_HELP_BUFFER_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LISTGRID (document, N_("History"), N_("Document History"), "document-open-recent", + LISTGRID (document, document, + N_("History"), N_("Document History"), "document-open-recent", GIMP_HELP_DOCUMENT_DIALOG, GIMP_VIEW_SIZE_LARGE), - LISTGRID (template, N_("Templates"), N_("Image Templates"), GIMP_STOCK_TEMPLATE, + LISTGRID (template, template, + N_("Templates"), N_("Image Templates"), GIMP_STOCK_TEMPLATE, GIMP_HELP_TEMPLATE_DIALOG, GIMP_VIEW_SIZE_SMALL), /* Some things do not have grids, so just list */ - LIST (dynamics, dynamics, N_("Paint Dynamics"), NULL, GIMP_STOCK_DYNAMICS, + LIST (dynamics, dynamics, + N_("Paint Dynamics"), NULL, GIMP_STOCK_DYNAMICS, GIMP_HELP_DYNAMICS_DIALOG, GIMP_VIEW_SIZE_MEDIUM), - LIST (tool-preset, tool_preset, N_("Tool Presets"), NULL, GIMP_STOCK_TOOL_PRESET, + LIST (tool-preset, tool_preset, + N_("Tool Presets"), NULL, GIMP_STOCK_TOOL_PRESET, GIMP_HELP_TOOL_PRESET_DIALOG, GIMP_VIEW_SIZE_MEDIUM), /* image related */ diff --git a/app/menus/menus.c b/app/menus/menus.c index 3b1a9036b5..0f3c4b3e17 100644 --- a/app/menus/menus.c +++ b/app/menus/menus.c @@ -207,6 +207,14 @@ menus_init (Gimp *gimp, "dynamics-menu.xml", plug_in_menus_setup, NULL); + gimp_menu_factory_manager_register (global_menu_factory, "", + "mypaint-brushes", + "plug-in", + NULL, + "/mypaint-brushes-popup", + "mypaint-brushes-menu.xml", plug_in_menus_setup, + NULL); + gimp_menu_factory_manager_register (global_menu_factory, "", "patterns", "plug-in", diff --git a/app/tools/gimpmybrushtool.c b/app/tools/gimpmybrushtool.c index 6756c55935..75e99dad2a 100644 --- a/app/tools/gimpmybrushtool.c +++ b/app/tools/gimpmybrushtool.c @@ -71,7 +71,8 @@ gimp_mybrush_tool_register (GimpToolRegisterCallback callback, GIMP_CONTEXT_PROP_MASK_FOREGROUND | GIMP_CONTEXT_PROP_MASK_BACKGROUND | GIMP_CONTEXT_PROP_MASK_OPACITY | - GIMP_CONTEXT_PROP_MASK_PAINT_MODE, + GIMP_CONTEXT_PROP_MASK_PAINT_MODE | + GIMP_CONTEXT_PROP_MYBRUSH, "gimp-mybrush-tool", _("MyPaint Brush"), _("MyPaint Brush Tool: Use MyPaint brushes in GIMP"), diff --git a/app/widgets/gimphelp-ids.h b/app/widgets/gimphelp-ids.h index 96a178b7c5..e5436a1091 100644 --- a/app/widgets/gimphelp-ids.h +++ b/app/widgets/gimphelp-ids.h @@ -356,6 +356,15 @@ #define GIMP_HELP_DYNAMICS_DELETE "gimp-dynamics-delete" #define GIMP_HELP_DYNAMICS_REFRESH "gimp-dynamics-refresh" +#define GIMP_HELP_MYPAINT_BRUSH_DIALOG "gimp-mypaint-brush-dialog" +#define GIMP_HELP_MYPAINT_BRUSH_EDIT "gimp-mypaint-brush-edit" +#define GIMP_HELP_MYPAINT_BRUSH_NEW "gimp-mypaint-brush-new" +#define GIMP_HELP_MYPAINT_BRUSH_DUPLICATE "gimp-mypaint-brush-duplicate" +#define GIMP_HELP_MYPAINT_BRUSH_COPY_LOCATION "gimp-mypaint-brush-copy-location" +#define GIMP_HELP_MYPAINT_BRUSH_SHOW_IN_FILE_MANAGER "gimp-mypaint-brush-show-in-file-manager" +#define GIMP_HELP_MYPAINT_BRUSH_DELETE "gimp-mypaint-brush-delete" +#define GIMP_HELP_MYPAINT_BRUSH_REFRESH "gimp-mypaint-brush-refresh" + #define GIMP_HELP_PATTERN_DIALOG "gimp-pattern-dialog" #define GIMP_HELP_PATTERN_EDIT "gimp-pattern-edit" #define GIMP_HELP_PATTERN_OPEN_AS_IMAGE "gimp-pattern-open-as-image" diff --git a/libgimpwidgets/gimpicons.h b/libgimpwidgets/gimpicons.h index 1a0a285ffb..ea1e638e13 100644 --- a/libgimpwidgets/gimpicons.h +++ b/libgimpwidgets/gimpicons.h @@ -290,6 +290,7 @@ G_BEGIN_DECLS #define GIMP_STOCK_DETACH GTK_STOCK_CONVERT #define GIMP_STOCK_FONT GTK_STOCK_SELECT_FONT #define GIMP_STOCK_GRADIENT GIMP_STOCK_TOOL_BLEND +#define GIMP_STOCK_MYPAINT_BRUSH GIMP_STOCK_TOOL_MYBRUSH #define GIMP_STOCK_PALETTE GTK_STOCK_SELECT_COLOR #define GIMP_STOCK_PATTERN GIMP_STOCK_TOOL_BUCKET_FILL #define GIMP_STOCK_CONTROLLER_MOUSE GIMP_STOCK_CURSOR diff --git a/menus/Makefile.am b/menus/Makefile.am index 01548f6fd0..ae01b5f188 100644 --- a/menus/Makefile.am +++ b/menus/Makefile.am @@ -25,6 +25,7 @@ menudata_DATA = \ gradients-menu.xml \ images-menu.xml \ layers-menu.xml \ + mypaint-brushes-menu.xml \ palette-editor-menu.xml \ palettes-menu.xml \ patterns-menu.xml \ diff --git a/menus/dialogs-menuitems.xml b/menus/dialogs-menuitems.xml index bf06bcbce7..373f49835a 100644 --- a/menus/dialogs-menuitems.xml +++ b/menus/dialogs-menuitems.xml @@ -18,6 +18,7 @@ + diff --git a/menus/mypaint-brushes-menu.xml b/menus/mypaint-brushes-menu.xml new file mode 100644 index 0000000000..e4ac5424eb --- /dev/null +++ b/menus/mypaint-brushes-menu.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + +