~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to gtk/gtkmenu.h

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GTK - The GIMP Toolkit
 
2
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Lesser General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Lesser General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public
 
15
 * License along with this library; if not, write to the
 
16
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 
17
 * Boston, MA 02111-1307, USA.
 
18
 */
 
19
 
 
20
/*
 
21
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
 
22
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 
23
 * files for a list of changes.  These files are distributed with
 
24
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
 
25
 */
 
26
 
 
27
#ifndef __GTK_MENU_H__
 
28
#define __GTK_MENU_H__
 
29
 
 
30
 
 
31
#include <gdk/gdk.h>
 
32
#include <gtk/gtkaccelgroup.h>
 
33
#include <gtk/gtkmenushell.h>
 
34
 
 
35
 
 
36
G_BEGIN_DECLS
 
37
 
 
38
#define GTK_TYPE_MENU                   (gtk_menu_get_type ())
 
39
#define GTK_MENU(obj)                   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU, GtkMenu))
 
40
#define GTK_MENU_CLASS(klass)           (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU, GtkMenuClass))
 
41
#define GTK_IS_MENU(obj)                (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU))
 
42
#define GTK_IS_MENU_CLASS(klass)        (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU))
 
43
#define GTK_MENU_GET_CLASS(obj)         (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU, GtkMenuClass))
 
44
 
 
45
 
 
46
typedef struct _GtkMenu       GtkMenu;
 
47
typedef struct _GtkMenuClass  GtkMenuClass;
 
48
 
 
49
typedef void (*GtkMenuPositionFunc) (GtkMenu   *menu,
 
50
                                     gint      *x,
 
51
                                     gint      *y,
 
52
                                     gboolean  *push_in,
 
53
                                     gpointer   user_data);
 
54
typedef void (*GtkMenuDetachFunc)   (GtkWidget *attach_widget,
 
55
                                     GtkMenu   *menu);
 
56
 
 
57
struct _GtkMenu
 
58
{
 
59
  GtkMenuShell menu_shell;
 
60
  
 
61
  GtkWidget *parent_menu_item;
 
62
  GtkWidget *old_active_menu_item;
 
63
 
 
64
  GtkAccelGroup *accel_group;
 
65
  gchar         *accel_path;
 
66
  GtkMenuPositionFunc position_func;
 
67
  gpointer position_func_data;
 
68
 
 
69
  guint toggle_size;
 
70
  /* Do _not_ touch these widgets directly. We hide the reference
 
71
   * count from the toplevel to the menu, so it must be restored
 
72
   * before operating on these widgets
 
73
   */
 
74
  GtkWidget *toplevel;
 
75
  
 
76
  GtkWidget *tearoff_window;
 
77
  GtkWidget *tearoff_hbox;
 
78
  GtkWidget *tearoff_scrollbar;
 
79
  GtkAdjustment *tearoff_adjustment;
 
80
 
 
81
  GdkWindow *view_window;
 
82
  GdkWindow *bin_window;
 
83
 
 
84
  gint scroll_offset;
 
85
  gint saved_scroll_offset;
 
86
  gint scroll_step;
 
87
  guint timeout_id;
 
88
  
 
89
  /* When a submenu of this menu is popped up, motion in this
 
90
   * region is ignored
 
91
   */
 
92
  GdkRegion *navigation_region;
 
93
  guint navigation_timeout;
 
94
 
 
95
  guint needs_destruction_ref_count : 1;
 
96
  guint torn_off : 1;
 
97
  /* The tearoff is active when it is torn off and the not-torn-off
 
98
   * menu is not popped up.
 
99
   */
 
100
  guint tearoff_active : 1; 
 
101
 
 
102
  guint scroll_fast : 1;
 
103
 
 
104
  guint upper_arrow_visible : 1;
 
105
  guint lower_arrow_visible : 1;
 
106
  guint upper_arrow_prelight : 1;
 
107
  guint lower_arrow_prelight : 1;
 
108
};
 
109
 
 
110
struct _GtkMenuClass
 
111
{
 
112
  GtkMenuShellClass parent_class;
 
113
 
 
114
  /* Padding for future expansion */
 
115
  void (*_gtk_reserved1) (void);
 
116
  void (*_gtk_reserved2) (void);
 
117
  void (*_gtk_reserved3) (void);
 
118
  void (*_gtk_reserved4) (void);
 
119
};
 
120
 
 
121
 
 
122
GType      gtk_menu_get_type              (void) G_GNUC_CONST;
 
123
GtkWidget* gtk_menu_new                   (void);
 
124
 
 
125
/* Display the menu onscreen */
 
126
void       gtk_menu_popup                 (GtkMenu             *menu,
 
127
                                           GtkWidget           *parent_menu_shell,
 
128
                                           GtkWidget           *parent_menu_item,
 
129
                                           GtkMenuPositionFunc  func,
 
130
                                           gpointer             data,
 
131
                                           guint                button,
 
132
                                           guint32              activate_time);
 
133
 
 
134
/* Position the menu according to its position function. Called
 
135
 * from gtkmenuitem.c when a menu-item changes its allocation
 
136
 */
 
137
void       gtk_menu_reposition            (GtkMenu             *menu);
 
138
 
 
139
void       gtk_menu_popdown               (GtkMenu             *menu);
 
140
 
 
141
/* Keep track of the last menu item selected. (For the purposes
 
142
 * of the option menu
 
143
 */
 
144
GtkWidget* gtk_menu_get_active            (GtkMenu             *menu);
 
145
void       gtk_menu_set_active            (GtkMenu             *menu,
 
146
                                           guint                index_);
 
147
 
 
148
/* set/get the accelerator group that holds global accelerators (should
 
149
 * be added to the corresponding toplevel with gtk_window_add_accel_group().
 
150
 */
 
151
void           gtk_menu_set_accel_group   (GtkMenu             *menu,
 
152
                                           GtkAccelGroup       *accel_group);
 
153
GtkAccelGroup* gtk_menu_get_accel_group   (GtkMenu             *menu);
 
154
void           gtk_menu_set_accel_path    (GtkMenu             *menu,
 
155
                                           const gchar         *accel_path);
 
156
 
 
157
/* A reference count is kept for a widget when it is attached to
 
158
 * a particular widget. This is typically a menu item; it may also
 
159
 * be a widget with a popup menu - for instance, the Notebook widget.
 
160
 */
 
161
void       gtk_menu_attach_to_widget      (GtkMenu             *menu,
 
162
                                           GtkWidget           *attach_widget,
 
163
                                           GtkMenuDetachFunc    detacher);
 
164
void       gtk_menu_detach                (GtkMenu             *menu);
 
165
 
 
166
/* This should be dumped in favor of data set when the menu is popped
 
167
 * up - that is currently in the ItemFactory code, but should be
 
168
 * in the Menu code.
 
169
 */
 
170
GtkWidget* gtk_menu_get_attach_widget     (GtkMenu             *menu);
 
171
 
 
172
void       gtk_menu_set_tearoff_state     (GtkMenu             *menu,
 
173
                                           gboolean             torn_off);
 
174
gboolean   gtk_menu_get_tearoff_state     (GtkMenu             *menu);
 
175
 
 
176
/* This sets the window manager title for the window that
 
177
 * appears when a menu is torn off
 
178
 */
 
179
void       gtk_menu_set_title             (GtkMenu             *menu,
 
180
                                           const gchar         *title);
 
181
G_CONST_RETURN gchar *gtk_menu_get_title  (GtkMenu             *menu);
 
182
 
 
183
void       gtk_menu_reorder_child         (GtkMenu             *menu,
 
184
                                           GtkWidget           *child,
 
185
                                           gint                position);
 
186
 
 
187
void       gtk_menu_set_screen            (GtkMenu             *menu,
 
188
                                           GdkScreen           *screen);
 
189
 
 
190
void       gtk_menu_attach                (GtkMenu             *menu,
 
191
                                           GtkWidget           *child,
 
192
                                           guint                left_attach,
 
193
                                           guint                right_attach,
 
194
                                           guint                top_attach,
 
195
                                           guint                bottom_attach);
 
196
 
 
197
void       gtk_menu_set_monitor           (GtkMenu             *menu,
 
198
                                           gint                 monitor_num);
 
199
GList*     gtk_menu_get_for_attach_widget (GtkWidget           *widget); 
 
200
 
 
201
#ifndef GTK_DISABLE_DEPRECATED
 
202
#define gtk_menu_append(menu,child)     gtk_menu_shell_append  ((GtkMenuShell *)(menu),(child))
 
203
#define gtk_menu_prepend(menu,child)    gtk_menu_shell_prepend ((GtkMenuShell *)(menu),(child))
 
204
#define gtk_menu_insert(menu,child,pos) gtk_menu_shell_insert ((GtkMenuShell *)(menu),(child),(pos))
 
205
#endif /* GTK_DISABLE_DEPRECATED */
 
206
 
 
207
G_END_DECLS
 
208
 
 
209
#endif /* __GTK_MENU_H__ */