Statistics
| Revision:

root / src / menu.h @ 543

History | View | Annotate | Download (2.7 kB)

1 1 hiro
/*
2 1 hiro
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 1 hiro
 * Copyright (C) 1999-2004 Hiroyuki Yamamoto
4 1 hiro
 *
5 1 hiro
 * This program is free software; you can redistribute it and/or modify
6 1 hiro
 * it under the terms of the GNU General Public License as published by
7 1 hiro
 * the Free Software Foundation; either version 2 of the License, or
8 1 hiro
 * (at your option) any later version.
9 1 hiro
 *
10 1 hiro
 * This program is distributed in the hope that it will be useful,
11 1 hiro
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1 hiro
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 1 hiro
 * GNU General Public License for more details.
14 1 hiro
 *
15 1 hiro
 * You should have received a copy of the GNU General Public License
16 1 hiro
 * along with this program; if not, write to the Free Software
17 1 hiro
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 1 hiro
 */
19 1 hiro
20 1 hiro
#ifndef __MENU_H__
21 1 hiro
#define __MENU_H__
22 1 hiro
23 1 hiro
#include <glib.h>
24 1 hiro
#include <gtk/gtkwidget.h>
25 1 hiro
#include <gtk/gtkitemfactory.h>
26 1 hiro
#include <gtk/gtkmenu.h>
27 1 hiro
#include <gtk/gtkmenushell.h>
28 1 hiro
#include <gtk/gtkoptionmenu.h>
29 1 hiro
30 1 hiro
#define MENU_VAL_ID "Sylpheed::Menu::ValueID"
31 1 hiro
32 1 hiro
#define MENUITEM_ADD(menu, menuitem, label, data)                 \
33 1 hiro
{                                                                 \
34 1 hiro
        if (label)                                                 \
35 1 hiro
                menuitem = gtk_menu_item_new_with_label(label);         \
36 1 hiro
        else {                                                         \
37 1 hiro
                menuitem = gtk_menu_item_new();                         \
38 1 hiro
                gtk_widget_set_sensitive(menuitem, FALSE);         \
39 1 hiro
        }                                                         \
40 1 hiro
        gtk_widget_show(menuitem);                                 \
41 1 hiro
        gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);         \
42 1 hiro
        if (data)                                                 \
43 1 hiro
                g_object_set_data(G_OBJECT(menuitem),                 \
44 1 hiro
                                  MENU_VAL_ID,                         \
45 1 hiro
                                  GINT_TO_POINTER(data));         \
46 1 hiro
}
47 1 hiro
48 1 hiro
#define menu_set_insensitive_all(menu_shell) \
49 1 hiro
        menu_set_sensitive_all(menu_shell, FALSE);
50 1 hiro
51 1 hiro
GtkWidget *menubar_create        (GtkWidget                *window,
52 1 hiro
                                 GtkItemFactoryEntry        *entries,
53 1 hiro
                                 guint                         n_entries,
54 1 hiro
                                 const gchar                *path,
55 1 hiro
                                 gpointer                 data);
56 1 hiro
GtkWidget *menu_create_items        (GtkItemFactoryEntry        *entries,
57 1 hiro
                                 guint                         n_entries,
58 1 hiro
                                 const gchar                *path,
59 1 hiro
                                 GtkItemFactory               **factory,
60 1 hiro
                                 gpointer                 data);
61 1 hiro
62 1 hiro
GString *menu_factory_get_rc        (const gchar                *path);
63 1 hiro
void menu_factory_clear_rc        (const gchar                *rc_str);
64 1 hiro
void menu_factory_copy_rc        (const gchar                *src_path,
65 1 hiro
                                 const gchar                *dest_path);
66 1 hiro
67 1 hiro
void menu_set_sensitive                (GtkItemFactory                *ifactory,
68 1 hiro
                                 const gchar                *path,
69 1 hiro
                                 gboolean                 sensitive);
70 1 hiro
void menu_set_sensitive_all        (GtkMenuShell                *menu_shell,
71 1 hiro
                                 gboolean                 sensitive);
72 1 hiro
73 1 hiro
void menu_set_active                (GtkItemFactory                *ifactory,
74 1 hiro
                                 const gchar                *path,
75 1 hiro
                                 gboolean                 is_active);
76 1 hiro
77 1 hiro
void menu_button_position        (GtkMenu                *menu,
78 1 hiro
                                 gint                        *x,
79 1 hiro
                                 gint                        *y,
80 1 hiro
                                 gboolean                *push_in,
81 1 hiro
                                 gpointer                 user_data);
82 1 hiro
83 1 hiro
gint menu_find_option_menu_index(GtkOptionMenu                *optmenu,
84 1 hiro
                                 gpointer                 data,
85 1 hiro
                                 GCompareFunc                 func);
86 1 hiro
87 1 hiro
gint menu_get_option_menu_active_index
88 1 hiro
                                (GtkOptionMenu                *optmenu);
89 1 hiro
90 1 hiro
#endif /* __MENU_H__ */