summaryrefslogtreecommitdiff
path: root/tools/glade/glade/glade_menu_editor.h
blob: 96e0d55512fde581f930709197e2338183827991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138

/*  Gtk+ User Interface Builder
 *  Copyright (C) 1998  Damon Chaplin
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef GLADE_MENU_EDITOR_H
#define GLADE_MENU_EDITOR_H


#include <gdk/gdk.h>
#include <gtk/gtkmenushell.h>
#include <gtk/gtkwindow.h>

#include "glade_project.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


#define GLADE_MENU_EDITOR(obj)          GTK_CHECK_CAST (obj, glade_menu_editor_get_type (), GladeMenuEditor)
#define GLADE_MENU_EDITOR_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, glade_menu_editor_get_type (), GladeMenuEditorClass)
#define GLADE_IS_MENU_EDITOR(obj)       GTK_CHECK_TYPE (obj, glade_menu_editor_get_type ())


typedef struct _GladeMenuEditor       GladeMenuEditor;
typedef struct _GladeMenuEditorClass  GladeMenuEditorClass;

struct _GladeMenuEditor
{
  GtkWindow window;

  GtkWidget *clist;

  GtkWidget *stock_label;
  GtkWidget *stock_combo;
  GtkWidget *icon_label;
  GtkWidget *icon_widget;
  GtkWidget *icon_button;

  GtkWidget *label_label;
  GtkWidget *label_entry;
  GtkWidget *name_label;
  GtkWidget *name_entry;
  GtkWidget *handler_label;
  GtkWidget *handler_entry;
  GtkWidget *tooltip_label;
  GtkWidget *tooltip_entry;
  GtkWidget *type_frame;
  GtkWidget *normal_radiobutton;
  GtkWidget *check_radiobutton;
  GtkWidget *radio_radiobutton;
  GtkWidget *right_justify_label;
  GtkWidget *right_justify_togglebutton;
  GtkWidget *state_label;
  GtkWidget *state_togglebutton;
  GtkWidget *group_label;
  GtkWidget *group_combo;
  GtkWidget *accel_frame;
  GtkWidget *accel_key_entry;
  GtkWidget *accel_ctrl_checkbutton;
  GtkWidget *accel_shift_checkbutton;
  GtkWidget *accel_alt_checkbutton;
  GtkWidget *up_button;
  GtkWidget *down_button;
  GtkWidget *left_button;
  GtkWidget *right_button;
  GtkWidget *add_button;
  GtkWidget *add_child_button;
  GtkWidget *add_separator_button;
  GtkWidget *delete_button;

  GtkWidget *ok_button;
  GtkWidget *apply_button;
  GtkWidget *cancel_button;

  /* This is our key selection dialog, used for selecting accelerator keys. */
  GtkWidget *keys_dialog;

  /* This is our file selection dialog, used for selecting icons. */
  GtkWidget *filesel;

  /* This is the menu widget we are editing and the project it is in. */
  GladeProject *project;
  GtkMenuShell *menu;

  /* This is set if Glade is compiled with GNOME support and the project has
     GNOME support turned on. We use the GnomeUIInfo stuff for menus in GNOME,
     rather than the GTK+ stock system. */
  gboolean gnome_support;

  /* This is the id of the handler connected to the menu widget's destroy
     signal, so we can destroy the menu editor if the menu is destroyed. */
  guint menu_destroy_handler_id;

  /* This is TRUE if we are updating the entry fields and so should ignore
     changed signals. */
  gboolean updating_widgets;

  /* The list of GTK+ stock items. */
  GSList *stock_items;
};

struct _GladeMenuEditorClass
{
  GtkWindowClass parent_class;
};


GType      glade_menu_editor_get_type    (void);

/* This creates a menu editor to edit the given menubar or popup menu in
   the given project. When the user selects the 'OK' or 'Apply' buttons,
   the menu widget will be updated. If the menu is destroyed, the menu editor
   is automatically destroyed as well. */
GtkWidget* glade_menu_editor_new         (GladeProject    *project,
					  GtkMenuShell    *menu);

#ifdef __cplusplus
}
#endif /* __cplusplus */


#endif /* GLADE_MENU_EDITOR_H */