]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktoolbar.h
Fix a C99ism
[~andy/gtk] / gtk / gtktoolbar.h
index 87d570383a2263d9ef66a1b12fa3c183d73f43cb..e80134d2008fa5a89682a010a3ed8be36de02f4c 100644 (file)
@@ -2,7 +2,7 @@
  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  * GtkToolbar copyright (C) Federico Mena
  *
- * Copyright (C) 2002 Anders Carlsson <andersca@codefactory.se>
+ * Copyright (C) 2002 Anders Carlsson <andersca@gnome.org>
  * Copyright (C) 2002 James Henstridge <james@daa.com.au>
  * Copyright (C) 2003 Soeren Sandmann <sandmann@daimi.au.dk>
  * 
@@ -45,7 +45,7 @@
 #include <gtk/gtkpixmap.h>
 #include <gtk/gtksignal.h>
 
-#endif
+#endif /* GTK_DISABLE_DEPRECATED */
 
 G_BEGIN_DECLS
 
@@ -55,8 +55,6 @@ G_BEGIN_DECLS
 #define GTK_IS_TOOLBAR(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TOOLBAR))
 #define GTK_IS_TOOLBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLBAR))
 #define GTK_TOOLBAR_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TOOLBAR, GtkToolbarClass))
-#define GTK_TOOLBAR_GET_PRIVATE(o)  (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_TOOLBAR, GtkToolbarPrivate))
-
 
 #ifndef GTK_DISABLE_DEPRECATED
 typedef enum
@@ -78,14 +76,14 @@ struct _GtkToolbarChild
   GtkWidget *label;
 };
 
+#endif /* GTK_DISABLE_DEPRECATED */
+
 typedef enum
 {
   GTK_TOOLBAR_SPACE_EMPTY,
   GTK_TOOLBAR_SPACE_LINE
 } GtkToolbarSpaceStyle;
 
-#endif /* GTK_DISABLE_DEPRECATED */
-
 typedef struct _GtkToolbar           GtkToolbar;
 typedef struct _GtkToolbarClass      GtkToolbarClass;
 typedef struct _GtkToolbarPrivate    GtkToolbarPrivate;
@@ -94,19 +92,21 @@ struct _GtkToolbar
 {
   GtkContainer container;
 
+  /*< public >*/
   gint             num_children;
   GList           *children;
   GtkOrientation   orientation;
   GtkToolbarStyle  style;
   GtkIconSize      icon_size;
-
+  
   GtkTooltips     *tooltips;
   
+  /*< private >*/
   gint             button_maxw;                /* maximum width of homogeneous children */
   gint             button_maxh;                /* maximum height of homogeneous children */
 
-  guint            style_set_connection;
-  guint            icon_size_connection;
+  guint            _gtk_reserved1;
+  guint            _gtk_reserved2;
 
   guint            style_set : 1;
   guint            icon_size_set : 1;
@@ -115,55 +115,72 @@ struct _GtkToolbar
 struct _GtkToolbarClass
 {
   GtkContainerClass parent_class;
-
+  
   /* signals */
-  void (* orientation_changed) (GtkToolbar       *toolbar,
-                               GtkOrientation    orientation);
-  void (* style_changed)       (GtkToolbar       *toolbar,
-                               GtkToolbarStyle   style);
-  void (* popup_context_menu)  (GtkToolbar       *toolbar);
-
+  void     (* orientation_changed) (GtkToolbar       *toolbar,
+                                   GtkOrientation    orientation);
+  void     (* style_changed)       (GtkToolbar       *toolbar,
+                                   GtkToolbarStyle   style);
+  gboolean (* popup_context_menu)  (GtkToolbar       *toolbar,
+                                   gint              x,
+                                   gint              y,
+                                   gint              button_number);
+  
   /* Padding for future expansion */
   void (*_gtk_reserved1) (void);
   void (*_gtk_reserved2) (void);
   void (*_gtk_reserved3) (void);
 };
 
-GType           gtk_toolbar_get_type        (void) G_GNUC_CONST;
-GtkWidget*      gtk_toolbar_new             (void);
-
-void            gtk_toolbar_insert           (GtkToolbar      *toolbar,
-                                             GtkToolItem     *item,
-                                             gint             pos);
-gint            gtk_toolbar_get_item_index   (GtkToolbar      *toolbar,
-                                             GtkToolItem     *item);
-gint           gtk_toolbar_get_n_items      (GtkToolbar      *toolbar);
-GtkToolItem *   gtk_toolbar_get_nth_item     (GtkToolbar      *toolbar,
-                                             gint             n);
-gint            gtk_toolbar_get_drop_index   (GtkToolbar      *toolbar,
-                                             gint             x,
-                                             gint             y);
-void            gtk_toolbar_set_show_arrow   (GtkToolbar      *toolbar,
-                                             gboolean         show_arrow);
-void            gtk_toolbar_set_orientation  (GtkToolbar      *toolbar,
-                                             GtkOrientation   orientation);
-void            gtk_toolbar_set_tooltips     (GtkToolbar      *toolbar,
-                                             gboolean         enable);
-void            gtk_toolbar_unset_icon_size  (GtkToolbar      *toolbar);
-gboolean        gtk_toolbar_get_show_arrow   (GtkToolbar      *toolbar);
-GtkOrientation  gtk_toolbar_get_orientation  (GtkToolbar      *toolbar);
-GtkToolbarStyle gtk_toolbar_get_style        (GtkToolbar      *toolbar);
-GtkIconSize     gtk_toolbar_get_icon_size    (GtkToolbar      *toolbar);
-gboolean        gtk_toolbar_get_tooltips     (GtkToolbar      *toolbar);
-GtkReliefStyle  gtk_toolbar_get_relief_style (GtkToolbar      *toolbar);
-
+GType           gtk_toolbar_get_type         (void) G_GNUC_CONST;
+GtkWidget*      gtk_toolbar_new                     (void);
+void            gtk_toolbar_insert                  (GtkToolbar      *toolbar,
+                                                    GtkToolItem     *item,
+                                                    gint             pos);
+gint            gtk_toolbar_get_item_index          (GtkToolbar      *toolbar,
+                                                    GtkToolItem     *item);
+gint            gtk_toolbar_get_n_items             (GtkToolbar      *toolbar);
+GtkToolItem *   gtk_toolbar_get_nth_item            (GtkToolbar      *toolbar,
+                                                    gint             n);
+gboolean        gtk_toolbar_get_show_arrow          (GtkToolbar      *toolbar);
+void            gtk_toolbar_set_show_arrow          (GtkToolbar      *toolbar,
+                                                    gboolean         show_arrow);
+GtkOrientation  gtk_toolbar_get_orientation         (GtkToolbar      *toolbar);
+void            gtk_toolbar_set_orientation         (GtkToolbar      *toolbar,
+                                                    GtkOrientation   orientation);
+gboolean        gtk_toolbar_get_tooltips            (GtkToolbar      *toolbar);
+void            gtk_toolbar_set_tooltips            (GtkToolbar      *toolbar,
+                                                    gboolean         enable);
+GtkToolbarStyle gtk_toolbar_get_style               (GtkToolbar      *toolbar);
+void            gtk_toolbar_set_style               (GtkToolbar      *toolbar,
+                                                    GtkToolbarStyle  style);
+void            gtk_toolbar_unset_style             (GtkToolbar      *toolbar);
+GtkIconSize     gtk_toolbar_get_icon_size           (GtkToolbar      *toolbar);
+GtkReliefStyle  gtk_toolbar_get_relief_style        (GtkToolbar      *toolbar);
+gint            gtk_toolbar_get_drop_index          (GtkToolbar      *toolbar,
+                                                    gint             x,
+                                                    gint             y);
+void            gtk_toolbar_set_drop_highlight_item (GtkToolbar      *toolbar,
+                                                    GtkToolItem     *tool_item,
+                                                    gint             index_);
+
+/* internal functions */
+gchar *         _gtk_toolbar_elide_underscores      (const gchar     *original);
+void            _gtk_toolbar_paint_space_line       (GtkWidget       *widget,
+                                                    GtkToolbar      *toolbar,
+                                                    GdkRectangle    *area,
+                                                    GtkAllocation   *allocation);
+gint            _gtk_toolbar_get_default_space_size (void);
+void            _gtk_toolbar_rebuild_menu           (GtkToolbar      *toolbar);
+
+
+/* deprecated */
 #ifndef GTK_DISABLE_DEPRECATED
+void       gtk_toolbar_set_icon_size   (GtkToolbar      *toolbar,
+                                       GtkIconSize      icon_size);
+void       gtk_toolbar_unset_icon_size (GtkToolbar      *toolbar);
+
 /* Simple button items */
-void       gtk_toolbar_set_style     (GtkToolbar      *toolbar,
-                                     GtkToolbarStyle  style);
-void       gtk_toolbar_set_icon_size (GtkToolbar      *toolbar,
-                                     GtkIconSize      icon_size);
-void       gtk_toolbar_unset_style   (GtkToolbar      *toolbar);
 GtkWidget* gtk_toolbar_append_item   (GtkToolbar      *toolbar,
                                      const char      *text,
                                      const char      *tooltip_text,