Commit ac98e8fa authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

app/Makefile.am app/lc_dialog.[ch] app/lc_dialogP.h new files

1999-06-06  Michael Natterer  <mitschel@cs.tu-berlin.de>

	* app/Makefile.am
	* app/lc_dialog.[ch]
	* app/lc_dialogP.h
	* app/paths_dialogP.h: new files

	* app/channels_dialog.[ch]
	* app/layers_dialog.[ch]
	* app/layers_dialogP.h
	* app/paths_dialog.[ch]
	* app/menus.[ch]
	* app/file_new_dialog.c: modified

	- Moved the toplevel L&C dialog code to lc_dialog.[ch]. Only
	  these files need knowledge about how to create/update/...
	  the sub-dialogs, so the corresp. functions are defined in
	  lc_dialogP.h.
	- The popup menus are now created by menus.c. The command
	  callbacks are defined in [layers|channels|paths]_dialog.h.
	- Private functions to be used by "friend files" are defined in
	  [layers|paths]_dialogP.h.
	- Changed the order of the ops_buttons in the paths dialog to
	  match the order in the layers and channels dialogs.
	- The paint mode menu and preview stuff still needs to go out of
	  layers_dialog.[ch].
	- I'm not sure about the keybindings in the layer dialog's "Stack"
	  submenu because the list widget has it's own idea of PageUp/Down.
	- Hopefully fixed the update problem with new images by calling
	  lc_dialog_flush() after creating a new image.

	* app/app_procs.c
	* app/bezier_select.c
	* app/commands.c
	* app/floating_sel.c
	* app/gdisplay.c
	* app/gimage.c
	* app/gimage_mask.c
	* app/paint_core.c
	* app/preferences_dialog.c
	* app/transform_core.c
	* app/undo.c: changed #include's according to the new L&C file
	structure.
parent 6cd82f05
1999-06-06 Michael Natterer <mitschel@cs.tu-berlin.de>
* app/Makefile.am
* app/lc_dialog.[ch]
* app/lc_dialogP.h
* app/paths_dialogP.h: new files
* app/channels_dialog.[ch]
* app/layers_dialog.[ch]
* app/layers_dialogP.h
* app/paths_dialog.[ch]
* app/menus.[ch]
* app/file_new_dialog.c: modified
- Moved the toplevel L&C dialog code to lc_dialog.[ch]. Only
these files need knowledge about how to create/update/...
the sub-dialogs, so the corresp. functions are defined in
lc_dialogP.h.
- The popup menus are now created by menus.c. The command
callbacks are defined in [layers|channels|paths]_dialog.h.
- Private functions to be used by "friend files" are defined in
[layers|paths]_dialogP.h.
- Changed the order of the ops_buttons in the paths dialog to
match the order in the layers and channels dialogs.
- The paint mode menu and preview stuff still needs to go out of
layers_dialog.[ch].
- I'm not sure about the keybindings in the layer dialog's "Stack"
submenu because the list widget has it's own idea of PageUp/Down.
- Hopefully fixed the update problem with new images by calling
lc_dialog_flush() after creating a new image.
* app/app_procs.c
* app/bezier_select.c
* app/commands.c
* app/floating_sel.c
* app/gdisplay.c
* app/gimage.c
* app/gimage_mask.c
* app/paint_core.c
* app/preferences_dialog.c
* app/transform_core.c
* app/undo.c: changed #include's according to the new L&C file
structure.
Sun Jun 6 17:22:16 BST 1999 Adam D. Moss <adam@gimp.org>
* fileops.c gimprc.c gimprc.h preferences_dialog.c:
......
......@@ -250,7 +250,10 @@ gimp_SOURCES = \
layer_select.h \
layers_dialog.c \
layers_dialog.h \
layers_dialogP.h \
layers_dialogP.h \
lc_dialog.c \
lc_dialog.h \
lc_dialogP.h \
levels.c \
levels.h \
lut_funcs.c \
......@@ -287,8 +290,9 @@ gimp_SOURCES = \
parasitelistF.h \
parasitelistP.h \
paths_cmds.c \
paths_dialog.h \
paths_dialog.c \
paths_dialog.h \
paths_dialogP.h \
pathsP.h \
pattern_header.h \
pattern_select.c \
......
......@@ -24,7 +24,6 @@
#include "brightness_contrast.h"
#include "gimpbrushlist.h"
#include "by_color_select.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "colormap_dialog.i.h"
#include "color_area.h"
......@@ -52,7 +51,7 @@
#include "info_window.h"
#include "interface.h"
#include "invert.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "levels.h"
#include "module_db.h"
......@@ -76,8 +75,7 @@ typedef struct
} ImageResize;
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, int);
extern void layers_dialog_layer_merge_query (GImage *, int);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
......
......@@ -62,7 +62,7 @@
#include "image_render.h"
#include "interface.h"
#include "internal_procs.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "levels.h"
#include "menus.h"
#include "paint_funcs.h"
......
......@@ -34,7 +34,7 @@
#include "actionarea.h"
#include "bezier_select.h"
#include "bezier_selectP.h"
#include "paths_dialog.h"
#include "paths_dialogP.h"
#include "selection_options.h"
#include "libgimp/gimpintl.h"
......
This diff is collapsed.
......@@ -15,10 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CHANNELS_DIALOG_H__
#define __CHANNELS_DIALOG_H__
#ifndef __CHANNELS_DIALOG_H__
#define __CHANNELS_DIALOG_H__
void channels_dialog_update_image_list (void);
void channels_dialog_flush (void);
void channels_dialog_new_channel_callback (GtkWidget *, gpointer);
void channels_dialog_raise_channel_callback (GtkWidget *, gpointer);
void channels_dialog_lower_channel_callback (GtkWidget *, gpointer);
void channels_dialog_duplicate_channel_callback (GtkWidget *, gpointer);
void channels_dialog_delete_channel_callback (GtkWidget *, gpointer);
void channels_dialog_channel_to_sel_callback (GtkWidget *, gpointer);
void channels_dialog_add_channel_to_sel_callback (GtkWidget *, gpointer);
void channels_dialog_sub_channel_from_sel_callback (GtkWidget *, gpointer);
void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *, gpointer);
#endif /* __CHANNELS_DIALOG_H__ */
#endif /* __CHANNELS_DIALOG_H__ */
......@@ -24,7 +24,6 @@
#include "brightness_contrast.h"
#include "gimpbrushlist.h"
#include "by_color_select.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "colormap_dialog.i.h"
#include "color_area.h"
......@@ -52,7 +51,7 @@
#include "info_window.h"
#include "interface.h"
#include "invert.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "levels.h"
#include "module_db.h"
......@@ -76,8 +75,7 @@ typedef struct
} ImageResize;
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, int);
extern void layers_dialog_layer_merge_query (GImage *, int);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
......
......@@ -26,7 +26,6 @@
#include "gimage_mask.h"
#include "interface.h"
#include "layer.h"
#include "layers_dialog.h"
#include "paint_core.h"
#include "paint_options.h"
#include "undo.h"
......
......@@ -20,7 +20,6 @@
#include "appenv.h"
#include "by_color_select.h"
#include "channel.h"
#include "channels_dialog.h"
#include "drawable.h"
#include "errors.h"
#include "floating_sel.h"
......
......@@ -19,7 +19,6 @@
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "channels_dialog.h"
#include "drawable.h"
#include "layer.h"
#include "errors.h"
......
......@@ -20,7 +20,6 @@
#include <string.h>
#include "appenv.h"
#include "buildmenu.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
......@@ -35,11 +34,10 @@
#include "image_render.h"
#include "info_window.h"
#include "interface.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "menus.h"
#include "draw_core.h"
#include "bezier_selectP.h"
#include "paths_dialog.h"
#include "plug_in.h"
#include "scale.h"
#include "scroll.h"
......@@ -2073,12 +2071,8 @@ gdisplays_flush_whenever (gboolean now)
list = g_slist_next (list);
}
/* for convenience, we call the layers dialog flush here */
layers_dialog_flush ();
/* for convenience, we call the channels dialog flush here */
channels_dialog_flush ();
/* for convenience, we call the paths dialog flush here */
paths_dialog_flush();
/* for convenience, we call the L&C flush here */
lc_dialog_flush ();
flushing = FALSE;
}
......
......@@ -22,6 +22,7 @@
#include "gimprc.h"
#include "global_edit.h"
#include "interface.h"
#include "lc_dialog.h"
#include "plug_in.h"
#include "tile_manager_pvt.h"
#include "gdisplay.h"
......@@ -144,6 +145,13 @@ file_new_create_image (NewImageValues *vals)
gimage_clean_all (gimage);
gdisplay = gdisplay_new (gimage, 0x0101);
/* Update L&C because the last automatic update at image creation
* time happened when the new image had no layers at all
*
* TODO: make L&C aware of the image's "repaint" signal
*/
lc_dialog_flush ();
}
g_free (vals);
......
......@@ -23,7 +23,7 @@
#include "gimprc.h"
#include "image_render.h"
#include "interface.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "paint_options.h"
#include "session.h"
......
......@@ -20,7 +20,6 @@
#include <string.h>
#include "appenv.h"
#include "buildmenu.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
......@@ -35,11 +34,10 @@
#include "image_render.h"
#include "info_window.h"
#include "interface.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "menus.h"
#include "draw_core.h"
#include "bezier_selectP.h"
#include "paths_dialog.h"
#include "plug_in.h"
#include "scale.h"
#include "scroll.h"
......@@ -2073,12 +2071,8 @@ gdisplays_flush_whenever (gboolean now)
list = g_slist_next (list);
}
/* for convenience, we call the layers dialog flush here */
layers_dialog_flush ();
/* for convenience, we call the channels dialog flush here */
channels_dialog_flush ();
/* for convenience, we call the paths dialog flush here */
paths_dialog_flush();
/* for convenience, we call the L&C flush here */
lc_dialog_flush ();
flushing = FALSE;
}
......
......@@ -22,6 +22,7 @@
#include "gimprc.h"
#include "global_edit.h"
#include "interface.h"
#include "lc_dialog.h"
#include "plug_in.h"
#include "tile_manager_pvt.h"
#include "gdisplay.h"
......@@ -144,6 +145,13 @@ file_new_create_image (NewImageValues *vals)
gimage_clean_all (gimage);
gdisplay = gdisplay_new (gimage, 0x0101);
/* Update L&C because the last automatic update at image creation
* time happened when the new image had no layers at all
*
* TODO: make L&C aware of the image's "repaint" signal
*/
lc_dialog_flush ();
}
g_free (vals);
......
......@@ -19,7 +19,6 @@
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "channels_dialog.h"
#include "drawable.h"
#include "layer.h"
#include "errors.h"
......
......@@ -20,7 +20,6 @@
#include <string.h>
#include "appenv.h"
#include "buildmenu.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "cursorutil.h"
#include "disp_callbacks.h"
......@@ -35,11 +34,10 @@
#include "image_render.h"
#include "info_window.h"
#include "interface.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "menus.h"
#include "draw_core.h"
#include "bezier_selectP.h"
#include "paths_dialog.h"
#include "plug_in.h"
#include "scale.h"
#include "scroll.h"
......@@ -2073,12 +2071,8 @@ gdisplays_flush_whenever (gboolean now)
list = g_slist_next (list);
}
/* for convenience, we call the layers dialog flush here */
layers_dialog_flush ();
/* for convenience, we call the channels dialog flush here */
channels_dialog_flush ();
/* for convenience, we call the paths dialog flush here */
paths_dialog_flush();
/* for convenience, we call the L&C flush here */
lc_dialog_flush ();
flushing = FALSE;
}
......
#include "gimpimageP.h"
#include "gimage.h"
#include "gimpimage.h"
#include "channels_dialog.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "drawable.h"
#include "gdisplay.h"
......
......@@ -26,7 +26,6 @@
#include "gimage_mask.h"
#include "interface.h"
#include "layer.h"
#include "layers_dialog.h"
#include "paint_core.h"
#include "paint_options.h"
#include "undo.h"
......
This diff is collapsed.
......@@ -15,10 +15,17 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CHANNELS_DIALOG_H__
#define __CHANNELS_DIALOG_H__
#ifndef __CHANNELS_DIALOG_H__
#define __CHANNELS_DIALOG_H__
void channels_dialog_update_image_list (void);
void channels_dialog_flush (void);
void channels_dialog_new_channel_callback (GtkWidget *, gpointer);
void channels_dialog_raise_channel_callback (GtkWidget *, gpointer);
void channels_dialog_lower_channel_callback (GtkWidget *, gpointer);
void channels_dialog_duplicate_channel_callback (GtkWidget *, gpointer);
void channels_dialog_delete_channel_callback (GtkWidget *, gpointer);
void channels_dialog_channel_to_sel_callback (GtkWidget *, gpointer);
void channels_dialog_add_channel_to_sel_callback (GtkWidget *, gpointer);
void channels_dialog_sub_channel_from_sel_callback (GtkWidget *, gpointer);
void channels_dialog_intersect_channel_with_sel_callback(GtkWidget *, gpointer);
#endif /* __CHANNELS_DIALOG_H__ */
#endif /* __CHANNELS_DIALOG_H__ */
......@@ -24,7 +24,6 @@
#include "brightness_contrast.h"
#include "gimpbrushlist.h"
#include "by_color_select.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "colormap_dialog.i.h"
#include "color_area.h"
......@@ -52,7 +51,7 @@
#include "info_window.h"
#include "interface.h"
#include "invert.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "levels.h"
#include "module_db.h"
......@@ -76,8 +75,7 @@ typedef struct
} ImageResize;
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, int);
extern void layers_dialog_layer_merge_query (GImage *, int);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
......
......@@ -22,6 +22,7 @@
#include "gimprc.h"
#include "global_edit.h"
#include "interface.h"
#include "lc_dialog.h"
#include "plug_in.h"
#include "tile_manager_pvt.h"
#include "gdisplay.h"
......@@ -144,6 +145,13 @@ file_new_create_image (NewImageValues *vals)
gimage_clean_all (gimage);
gdisplay = gdisplay_new (gimage, 0x0101);
/* Update L&C because the last automatic update at image creation
* time happened when the new image had no layers at all
*
* TODO: make L&C aware of the image's "repaint" signal
*/
lc_dialog_flush ();
}
g_free (vals);
......
......@@ -24,7 +24,6 @@
#include "brightness_contrast.h"
#include "gimpbrushlist.h"
#include "by_color_select.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "colormap_dialog.i.h"
#include "color_area.h"
......@@ -52,7 +51,7 @@
#include "info_window.h"
#include "interface.h"
#include "invert.h"
#include "layers_dialog.h"
#include "lc_dialog.h"
#include "layer_select.h"
#include "levels.h"
#include "module_db.h"
......@@ -76,8 +75,7 @@ typedef struct
} ImageResize;
/* external functions */
extern void layers_dialog_layer_merge_query (GImage *, int);
extern void layers_dialog_layer_merge_query (GImage *, int);
/* local functions */
static void image_resize_callback (GtkWidget *, gpointer);
......
This diff is collapsed.
......@@ -15,15 +15,28 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __LAYERS_DIALOG_H__
#define __LAYERS_DIALOG_H__
#ifndef __LAYERS_DIALOG_H__
#define __LAYERS_DIALOG_H__
#include "gimpimageF.h"
void layers_dialog_previous_layer_callback (GtkWidget *, gpointer);
void layers_dialog_next_layer_callback (GtkWidget *, gpointer);
void layers_dialog_raise_layer_callback (GtkWidget *, gpointer);
void layers_dialog_lower_layer_callback (GtkWidget *, gpointer);
void layers_dialog_raise_layer_to_top_callback (GtkWidget *, gpointer);
void layers_dialog_lower_layer_to_bottom_callback (GtkWidget *, gpointer);
void layers_dialog_new_layer_callback (GtkWidget *, gpointer);
void layers_dialog_duplicate_layer_callback (GtkWidget *, gpointer);
void layers_dialog_delete_layer_callback (GtkWidget *, gpointer);
void layers_dialog_scale_layer_callback (GtkWidget *, gpointer);
void layers_dialog_resize_layer_callback (GtkWidget *, gpointer);
void layers_dialog_add_layer_mask_callback (GtkWidget *, gpointer);
void layers_dialog_apply_layer_mask_callback (GtkWidget *, gpointer);
void layers_dialog_anchor_layer_callback (GtkWidget *, gpointer);
void layers_dialog_merge_layers_callback (GtkWidget *, gpointer);
void layers_dialog_merge_down_callback (GtkWidget *, gpointer);
void layers_dialog_flatten_image_callback (GtkWidget *, gpointer);
void layers_dialog_alpha_select_callback (GtkWidget *, gpointer);
void layers_dialog_mask_select_callback (GtkWidget *, gpointer);
void layers_dialog_add_alpha_channel_callback (GtkWidget *, gpointer);
void lc_dialog_create (GimpImage*);
void lc_dialog_update_image_list (void);
void lc_dialog_free (void);
void lc_dialog_rebuild (int);
void layers_dialog_flush (void);
#endif /* __LAYERS_DIALOG_H__ */
#endif /* __LAYERS_DIALOG_H__ */
......@@ -19,13 +19,16 @@
#include <stdlib.h>
#include <string.h>
#include "appenv.h"
#include "channels_dialog.h"
#include "colormaps.h"
#include "commands.h"
#include "fileops.h"
#include "general.h"
#include "gimprc.h"
#include "interface.h"
#include "layers_dialog.h"
#include "menus.h"
#include "paths_dialog.h"
#include "paint_funcs.h"
#include "procedural_db.h"
#include "scale.h"
......@@ -168,6 +171,7 @@ static const GtkItemFactoryEntry image_entries[] =
{ N_("/Layers/Alpha To Selection"), NULL, layers_alpha_select_cmd_callback, 0 },
{ N_("/Layers/Mask To Selection"), NULL, layers_mask_select_cmd_callback, 0 },
{ N_("/Layers/Add Alpha Channel"), NULL, layers_add_alpha_channel_cmd_callback, 0 },
{ N_("/Layers/---"), NULL, NULL, 0, "<Separator>" },
/* these are built on the fly */
......@@ -240,13 +244,74 @@ static const GtkItemFactoryEntry save_entries[] =
static guint n_save_entries = sizeof (save_entries) / sizeof (save_entries[0]);
static GtkItemFactory *save_factory = NULL;
static const GtkItemFactoryEntry layers_entries[] =
{
{ N_("/New Layer"), "<control>N", layers_dialog_new_layer_callback, 0 },
{ N_("/Stack/Previous Layer"), "Prior", layers_dialog_previous_layer_callback, 0 },
{ N_("/Stack/Next Layer"), "Next", layers_dialog_next_layer_callback, 0 },
{ N_("/Stack/Raise Layer"), "<shift>Prior", layers_dialog_raise_layer_callback, 0 },
{ N_("/Stack/Lower Layer"), "<shift>Next", layers_dialog_lower_layer_callback, 0 },
{ N_("/Stack/Layer to Top"), "<control>Prior", layers_dialog_raise_layer_to_top_callback, 0 },
{ N_("/Stack/Layer to Bottom"), "<control>Next", layers_dialog_lower_layer_to_bottom_callback, 0 },
{ N_("/Duplicate Layer"), "<control>C", layers_dialog_duplicate_layer_callback, 0 },
{ N_("/Delete Layer"), "<control>X", layers_dialog_delete_layer_callback, 0 },
{ N_("/Anchor Layer"), "<control>H", layers_dialog_anchor_layer_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Scale Layer"), "<control>S", layers_dialog_scale_layer_callback, 0 },
{ N_("/Resize Layer"), "<control>R", layers_dialog_resize_layer_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Merge Visible Layers"), "<control>M", layers_dialog_merge_layers_callback, 0 },
{ N_("/Merge Down"), "<control><shift>M", layers_dialog_merge_down_callback, 0 },
{ N_("/Flatten Image"), NULL, layers_dialog_flatten_image_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Add Layer Mask"), NULL, layers_dialog_add_layer_mask_callback, 0 },
{ N_("/Apply Layer Mask"), NULL, layers_dialog_apply_layer_mask_callback, 0 },
{ N_("/Alpha to Selection"), NULL, layers_dialog_alpha_select_callback, 0 },
{ N_("/Mask to Selection"), NULL, layers_dialog_mask_select_callback, 0 },
{ N_("/Add Alpha Channel"), NULL, layers_dialog_add_alpha_channel_callback, 0 }
};
static guint n_layers_entries = sizeof (layers_entries) / sizeof (layers_entries[0]);
static GtkItemFactory *layers_factory = NULL;
static const GtkItemFactoryEntry channels_entries[] =
{
{ N_("/New Channel"), "<control>N", channels_dialog_new_channel_callback, 0 },
{ N_("/Raise Channel"), "<control>F", channels_dialog_raise_channel_callback, 0 },
{ N_("/Lower Channel"), "<control>B", channels_dialog_lower_channel_callback, 0 },
{ N_("/Duplicate Channel"), "<control>C", channels_dialog_duplicate_channel_callback, 0 },
{ N_("/Delete Channel"), "<control>X", channels_dialog_delete_channel_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Channel to Selection"), "<control>S", channels_dialog_channel_to_sel_callback, 0 },
{ N_("/Add to Selection"), NULL, channels_dialog_add_channel_to_sel_callback, 0 },
{ N_("/Subtract From Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 },
{ N_("/Intersect With Selection"), NULL, channels_dialog_sub_channel_from_sel_callback, 0 }
};
static guint n_channels_entries = sizeof (channels_entries) / sizeof (channels_entries[0]);
static GtkItemFactory *channels_factory = NULL;
static const GtkItemFactoryEntry paths_entries[] =
{
{ N_("/New Path"), "<control>N", paths_dialog_new_path_callback, 0 },
{ N_("/Duplicate Path"), "<control>U", paths_dialog_dup_path_callback, 0 },
{ N_("/Delete Path"), "<control>X", paths_dialog_delete_path_callback, 0 },
{ N_("/Path to Selection"), "<control>S", paths_dialog_path_to_sel_callback, 0 },
{ N_("/Stroke Path"), "<control>T", paths_dialog_stroke_path_callback, 0 },
{ "/---", NULL, NULL, 0, "<Separator>" },
{ N_("/Copy Path"), "<control>C", paths_dialog_copy_path_callback, 0 },
{ N_("/Paste Path"), "<control>V", paths_dialog_paste_path_callback, 0 },
{ N_("/Import Path"), "<control>I", paths_dialog_import_path_callback, 0 },
{ N_("/Export Path"), "<control>E", paths_dialog_export_path_callback, 0 }
};
static guint n_paths_entries = sizeof (paths_entries) / sizeof (paths_entries[0]);
static GtkItemFactory *paths_factory = NULL;
static int initialize = TRUE;
extern int num_tools;
void
menus_get_toolbox_menubar (GtkWidget **menubar,
GtkAccelGroup **accel_group)
menus_get_toolbox_menubar (GtkWidget **menubar,
GtkAccelGroup **accel_group)
{
if (initialize)
menus_init ();
......@@ -258,8 +323,8 @@ menus_get_toolbox_menubar (GtkWidget **menubar,
}
void
menus_get_image_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
menus_get_image_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
{
if (initialize)
menus_init ();
......@@ -271,8 +336,8 @@ menus_get_image_menu (GtkWidget **menu,
}
void
menus_get_load_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
menus_get_load_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
{
if (initialize)
menus_init ();
......@@ -284,8 +349,8 @@ menus_get_load_menu (GtkWidget **menu,
}
void
menus_get_save_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
menus_get_save_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
{
if (initialize)
menus_init ();
......@@ -296,9 +361,48 @@ menus_get_save_menu (GtkWidget **menu,
*accel_group = save_factory->accel_group;
}
void
menus_get_layers_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
{
if (initialize)
menus_init ();
if (menu)
*menu = layers_factory->widget;
if (accel_group)
*accel_group = layers_factory->accel_group;
}
void
menus_get_channels_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
{
if (initialize)
menus_init ();
if (menu)
*menu = channels_factory->widget;
if (accel_group)
*accel_group = channels_factory->accel_group;
}
void
menus_get_paths_menu (GtkWidget **menu,
GtkAccelGroup **accel_group)
{
if (initialize)
menus_init ();
if (menu)
*menu = paths_factory->widget;
if (accel_group)
*accel_group = paths_factory->accel_group;
}
void
menus_create (GtkMenuEntry *entries,
int nmenu_entries)
int n_menu_entries)
{
GtkItemFactory *ifactory;
GtkWidget *menu_item;
......@@ -308,10 +412,10 @@ menus_create (GtkMenuEntry *entries,
if (initialize)
menus_init ();
gtk_item_factory_create_menu_entries (nmenu_entries, entries);
gtk_item_factory_create_menu_entries (n_menu_entries, entries);
for (i = 0; i < nmenu_entries; i++)
if (!strncmp(entries[i].path, "<Image>", 7))
for (i = 0; i < n_menu_entries; i++)
if (! strncmp (entries[i].path, "<Image>", 7))
redo_image_menu = TRUE;
if (redo_image_menu)
......@@ -344,7 +448,6 @@ menus_tools_create (ToolInfo *tool_info)
&entry,
(gpointer)tool_info,
2);
}
void
......@@ -418,6 +521,9 @@ menus_quit (void)
gtk_object_unref (GTK_OBJECT (image_factory));
gtk_object_unref (GTK_OBJECT (load_factory));
gtk_object_unref (GTK_OBJECT (save_factory));
gtk_object_unref (GTK_OBJECT (layers_factory));
gtk_object_unref (GTK_OBJECT (channels_factory));
gtk_object_unref (GTK_OBJECT (paths_factory));
}
}
......@@ -586,27 +692,29 @@ translate_entries (const GtkItemFactoryEntry *entries, gint n)
gint i;
GtkItemFactoryEntry *ret;
ret=g_malloc( sizeof(GtkItemFactoryEntry) * n );
for (i=0; i<n; i++) {