summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/gtk_custom_menu.h
diff options
context:
space:
mode:
authorerg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 21:34:04 +0000
committererg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-25 21:34:04 +0000
commit9c8f1501112092eba0e1c411c2c196487eb61b00 (patch)
tree38a5b7452b7bb9d9a5334eb3740f4cdc1fe8da51 /chrome/browser/gtk/gtk_custom_menu.h
parent66761b95332549f825999e482c17c94675275f49 (diff)
downloadchromium_src-9c8f1501112092eba0e1c411c2c196487eb61b00.zip
chromium_src-9c8f1501112092eba0e1c411c2c196487eb61b00.tar.gz
chromium_src-9c8f1501112092eba0e1c411c2c196487eb61b00.tar.bz2
Reapply r50859 with chromeos fixes.
GTK: First draft of the unified cut/copy/paste and +/-/Fullscreen menu items. Adds special menu item types that allow shoving buttons into them, along with tracking which button is selected. We now are halfway to the mocks that the chrome-ui-leads sent out. Review URL: http://codereview.chromium.org/2800015 BUG=45757 TEST=none Review URL: http://codereview.chromium.org/2879002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50896 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/gtk_custom_menu.h')
-rw-r--r--chrome/browser/gtk/gtk_custom_menu.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/chrome/browser/gtk/gtk_custom_menu.h b/chrome/browser/gtk/gtk_custom_menu.h
new file mode 100644
index 0000000..a2fc757
--- /dev/null
+++ b/chrome/browser/gtk/gtk_custom_menu.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_GTK_GTK_CUSTOM_MENU_H_
+#define CHROME_BROWSER_GTK_GTK_CUSTOM_MENU_H_
+
+// GtkCustomMenu is a GtkMenu subclass that can contain, and collaborates with,
+// GtkCustomMenuItem instances. GtkCustomMenuItem is a GtkMenuItem that can
+// have buttons and other normal widgets embeded in it. GtkCustomMenu exists
+// only to override most of the button/motion/move callback functions so
+// that the normal GtkMenu implementation doesn't handle events related to
+// GtkCustomMenuItem items.
+//
+// For a more through overview of this system, see the comments in
+// gtk_custom_menu_item.h.
+
+#include <gdk/gdk.h>
+#include <gtk/gtk.h>
+#include <gtk/gtkmenuitem.h>
+
+G_BEGIN_DECLS
+
+#define GTK_TYPE_CUSTOM_MENU \
+ (gtk_custom_menu_get_type())
+#define GTK_CUSTOM_MENU(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_CUSTOM_MENU, GtkCustomMenu))
+#define GTK_CUSTOM_MENU_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST((klass), GTK_TYPE_CUSTOM_MENU, GtkCustomMenuClass))
+#define GTK_IS_CUSTOM_MENU(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE((obj), GTK_TYPE_CUSTOM_MENU))
+#define GTK_IS_CUSTOM_MENU_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE((klass), GTK_TYPE_CUSTOM_MENU))
+#define GTK_CUSTOM_MENU_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS((obj), GTK_TYPE_CUSTOM_MENU, GtkCustomMenuClass))
+
+typedef struct _GtkCustomMenu GtkCustomMenu;
+typedef struct _GtkCustomMenuClass GtkCustomMenuClass;
+
+struct _GtkCustomMenu {
+ GtkMenu menu;
+};
+
+struct _GtkCustomMenuClass {
+ GtkMenuClass parent_class;
+};
+
+GType gtk_custom_menu_get_type(void) G_GNUC_CONST;
+GtkWidget* gtk_custom_menu_new();
+
+G_END_DECLS
+
+#endif // CHROME_BROWSER_GTK_GTK_CUSTOM_MENU_H_