gtkmenushell.h 5.37 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
Elliot Lee's avatar
Elliot Lee committed
2 3 4
 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
 *
 * This library is free software; you can redistribute it and/or
5
 * modify it under the terms of the GNU Lesser General Public
Elliot Lee's avatar
Elliot Lee committed
6 7 8 9 10
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * 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.
Elliot Lee's avatar
Elliot Lee committed
13
 *
14
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
Elliot Lee's avatar
Elliot Lee committed
16
 */
17 18

/*
19
 * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
20 21
 * file for a list of people on the GTK+ Team.  See the ChangeLog
 * files for a list of changes.  These files are distributed with
22
 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 24
 */

Elliot Lee's avatar
Elliot Lee committed
25 26 27
#ifndef __GTK_MENU_SHELL_H__
#define __GTK_MENU_SHELL_H__

28 29 30 31
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

Elliot Lee's avatar
Elliot Lee committed
32 33
#include <gtk/gtkcontainer.h>

34
G_BEGIN_DECLS
Elliot Lee's avatar
Elliot Lee committed
35

36 37 38 39 40
#define GTK_TYPE_MENU_SHELL             (gtk_menu_shell_get_type ())
#define GTK_MENU_SHELL(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShell))
#define GTK_MENU_SHELL_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
#define GTK_IS_MENU_SHELL(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_MENU_SHELL))
#define GTK_IS_MENU_SHELL_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_MENU_SHELL))
Manish Singh's avatar
Manish Singh committed
41
#define GTK_MENU_SHELL_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_MENU_SHELL, GtkMenuShellClass))
Elliot Lee's avatar
Elliot Lee committed
42 43


44 45 46
typedef struct _GtkMenuShell        GtkMenuShell;
typedef struct _GtkMenuShellClass   GtkMenuShellClass;
typedef struct _GtkMenuShellPrivate GtkMenuShellPrivate;
Elliot Lee's avatar
Elliot Lee committed
47 48 49 50

struct _GtkMenuShell
{
  GtkContainer container;
Tim Janik's avatar
Tim Janik committed
51

52 53
  /*< private >*/
  GtkMenuShellPrivate *priv;
Elliot Lee's avatar
Elliot Lee committed
54 55 56 57 58
};

struct _GtkMenuShellClass
{
  GtkContainerClass parent_class;
59

Elliot Lee's avatar
Elliot Lee committed
60
  guint submenu_placement : 1;
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77

  void     (*deactivate)       (GtkMenuShell *menu_shell);
  void     (*selection_done)   (GtkMenuShell *menu_shell);

  void     (*move_current)     (GtkMenuShell *menu_shell,
                                GtkMenuDirectionType direction);
  void     (*activate_current) (GtkMenuShell *menu_shell,
                                gboolean      force_hide);
  void     (*cancel)           (GtkMenuShell *menu_shell);
  void     (*select_item)      (GtkMenuShell *menu_shell,
                                GtkWidget    *menu_item);
  void     (*insert)           (GtkMenuShell *menu_shell,
                                GtkWidget    *child,
                                gint          position);
  gint     (*get_popup_delay)  (GtkMenuShell *menu_shell);
  gboolean (*move_selected)    (GtkMenuShell *menu_shell,
                                gint          distance);
78 79 80 81

  /* Padding for future expansion */
  void (*_gtk_reserved1) (void);
  void (*_gtk_reserved2) (void);
82 83
  void (*_gtk_reserved3) (void);
  void (*_gtk_reserved4) (void);
Elliot Lee's avatar
Elliot Lee committed
84 85 86
};


87
GDK_AVAILABLE_IN_ALL
88 89
GType    gtk_menu_shell_get_type       (void) G_GNUC_CONST;

90
GDK_AVAILABLE_IN_ALL
91 92
void     gtk_menu_shell_append         (GtkMenuShell *menu_shell,
                                        GtkWidget    *child);
93
GDK_AVAILABLE_IN_ALL
94 95
void     gtk_menu_shell_prepend        (GtkMenuShell *menu_shell,
                                        GtkWidget    *child);
96
GDK_AVAILABLE_IN_ALL
97 98 99
void     gtk_menu_shell_insert         (GtkMenuShell *menu_shell,
                                        GtkWidget    *child,
                                        gint          position);
100
GDK_AVAILABLE_IN_ALL
101
void     gtk_menu_shell_deactivate     (GtkMenuShell *menu_shell);
102
GDK_AVAILABLE_IN_ALL
103 104
void     gtk_menu_shell_select_item    (GtkMenuShell *menu_shell,
                                        GtkWidget    *menu_item);
105
GDK_AVAILABLE_IN_ALL
106
void     gtk_menu_shell_deselect       (GtkMenuShell *menu_shell);
107
GDK_AVAILABLE_IN_ALL
108 109 110
void     gtk_menu_shell_activate_item  (GtkMenuShell *menu_shell,
                                        GtkWidget    *menu_item,
                                        gboolean      force_deactivate);
111
GDK_AVAILABLE_IN_ALL
112 113
void     gtk_menu_shell_select_first   (GtkMenuShell *menu_shell,
                                        gboolean      search_sensitive);
114
GDK_AVAILABLE_IN_ALL
115
void     gtk_menu_shell_cancel         (GtkMenuShell *menu_shell);
116
GDK_AVAILABLE_IN_ALL
117
gboolean gtk_menu_shell_get_take_focus (GtkMenuShell *menu_shell);
118
GDK_AVAILABLE_IN_ALL
119 120
void     gtk_menu_shell_set_take_focus (GtkMenuShell *menu_shell,
                                        gboolean      take_focus);
121

122
GDK_AVAILABLE_IN_ALL
123
GtkWidget *gtk_menu_shell_get_selected_item (GtkMenuShell *menu_shell);
124
GDK_AVAILABLE_IN_ALL
125 126
GtkWidget *gtk_menu_shell_get_parent_shell  (GtkMenuShell *menu_shell);

127 128 129 130 131 132
GDK_AVAILABLE_IN_3_6
void       gtk_menu_shell_bind_model   (GtkMenuShell *menu_shell,
                                        GMenuModel   *model,
                                        const gchar  *action_namespace,
                                        gboolean      with_separators);

133 134
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkMenuShell, g_object_unref)

135
G_END_DECLS
Elliot Lee's avatar
Elliot Lee committed
136 137

#endif /* __GTK_MENU_SHELL_H__ */