-
Notifications
You must be signed in to change notification settings - Fork 9
/
deskmenu-menu.h
124 lines (110 loc) · 3.93 KB
/
deskmenu-menu.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/*
* compiz-deskmenu is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* compiz-deskmenu is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Copyright 2008 Christopher Williams <christopherw@verizon.net>
*/
#include "deskmenu-common.h"
typedef struct Deskmenu Deskmenu;
typedef struct DeskmenuClass DeskmenuClass;
typedef struct DeskmenuItem DeskmenuItem;
GType deskmenu_get_type (void);
typedef enum
{
DESKMENU_ITEM_NONE = 0,
DESKMENU_ITEM_LAUNCHER,
DESKMENU_ITEM_WINDOWLIST,
DESKMENU_ITEM_DESKTOPLIST,
DESKMENU_ITEM_VIEWPORTLIST,
DESKMENU_ITEM_RELOAD,
DESKMENU_ITEM_DOCUMENTS //use native GTK+ support for recent documents
} DeskmenuItemType;
typedef enum
{
DESKMENU_ELEMENT_NONE = 0,
DESKMENU_ELEMENT_MENU,
DESKMENU_ELEMENT_ITEM,
DESKMENU_ELEMENT_SEPARATOR,
DESKMENU_ELEMENT_NAME,
DESKMENU_ELEMENT_ICON,
DESKMENU_ELEMENT_COMMAND,
DESKMENU_ELEMENT_THISVP,
DESKMENU_ELEMENT_MINIONLY,
DESKMENU_ELEMENT_WRAP,
DESKMENU_ELEMENT_VPICON,
DESKMENU_ELEMENT_AGE, //age of dox
DESKMENU_ELEMENT_QUANTITY, //# of dox
DESKMENU_ELEMENT_SORT //sort method
} DeskmenuElementType;
struct DeskmenuItem
{
DeskmenuItemType type;
DeskmenuElementType current_element;
GString *name;
gboolean name_exec;
gboolean command_pipe;
gboolean cache_output;
gboolean icon_file;
gboolean vpicon_file;
GString *icon;
GString *vpicon;
GString *command;
GString *wrap;
GString *thisvp;
GString *mini_only;
GString *sort_type; //get sort type for document items
GString *age; //get age limit for document items
GString *quantity; //get item limit for document items
};
struct Deskmenu
{
GObject parent;
#if HAVE_WNCK
DeskmenuWindowlist *windowlist;
#endif
gboolean pinnable;
GHashTable *file_cache;
};
struct DeskmenuClass
{
GObjectClass parent;
};
typedef struct DeskmenuObject
{
GtkWidget *menu;
GtkWidget *current_menu;
DeskmenuItem *current_item;
Deskmenu *deskmenu;
gboolean make_from_pipe;
GSList *pin_items;
GHookList *show_hooks;
} DeskmenuObject;
#define DESKMENU_TYPE (deskmenu_get_type ())
#define DESKMENU(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), DESKMENU_TYPE, Deskmenu))
#define DESKMENU_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DESKMENU_TYPE, DeskmenuClass))
#define IS_DESKMENU(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), DESKMENU_TYPE))
#define IS_DESKMENU_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DESKMENU_TYPE))
#define DESKMENU_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DESKMENU_TYPE, DeskMenu))
typedef enum
{
DESKMENU_ERROR_GENERIC
} DeskmenuError;
GQuark deskmenu_error_quark (void);
#define DESKMENU_ERROR deskmenu_error_quark ()
gboolean deskmenu_reload (Deskmenu *deskmenu, GError **error);
gboolean deskmenu_control (Deskmenu *deskmenu, gchar *filename, gchar *workingd, GError **error);
gboolean deskmenu_pin (Deskmenu *deskmenu, gboolean pin);
gboolean deskmenu_windowlist (Deskmenu *deskmenu, gboolean images, gboolean thisvp, gboolean mini_only);
gboolean deskmenu_vplist (Deskmenu *deskmenu, gboolean toggle_wrap, gboolean toggle_images, gboolean toggle_file, gchar *viewport_icon);
gboolean deskmenu_dplist (Deskmenu *deskmenu, gboolean toggle_images, gboolean toggle_file, gchar *viewport_icon);
gboolean deskmenu_documentlist (Deskmenu *deskmenu, gboolean images, gchar *command, int limit, int age, gchar *sort_type);