~unity-api-team/hud/lp-1288025

« back to all changes in this revision

Viewing changes to src/window-menu.h

Tags: upstream-13.04.0
ImportĀ upstreamĀ versionĀ 13.04.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
An implementation of indicator object showing menus from applications.
3
 
 
4
 
Copyright 2012 Canonical Ltd.
5
 
 
6
 
Authors:
7
 
    Ted Gould <ted@canonical.com>
8
 
 
9
 
This program is free software: you can redistribute it and/or modify it 
10
 
under the terms of the GNU General Public License version 3, as published 
11
 
by the Free Software Foundation.
12
 
 
13
 
This program is distributed in the hope that it will be useful, but 
14
 
WITHOUT ANY WARRANTY; without even the implied warranties of 
15
 
MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR 
16
 
PURPOSE.  See the GNU General Public License for more details.
17
 
 
18
 
You should have received a copy of the GNU General Public License along 
19
 
with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 
*/
21
 
 
22
 
#ifndef __WINDOW_MENU_H__
23
 
#define __WINDOW_MENU_H__
24
 
 
25
 
#include <glib-object.h>
26
 
#include <libindicator/indicator-object.h>
27
 
 
28
 
G_BEGIN_DECLS
29
 
 
30
 
#define WINDOW_MENU_TYPE             (window_menu_get_type ())
31
 
#define WINDOW_MENU(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), WINDOW_MENU_TYPE, WindowMenu))
32
 
#define WINDOW_MENU_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), WINDOW_MENU_TYPE, WindowMenuClass))
33
 
#define IS_WINDOW_MENU(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), WINDOW_MENU_TYPE))
34
 
#define IS_WINDOW_MENU_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE ((klass), WINDOW_MENU_TYPE))
35
 
#define WINDOW_MENU_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), WINDOW_MENU_TYPE, WindowMenuClass))
36
 
 
37
 
#define WINDOW_MENU_SIGNAL_ENTRY_ADDED    "entry-added"
38
 
#define WINDOW_MENU_SIGNAL_ENTRY_REMOVED  "entry-removed"
39
 
#define WINDOW_MENU_SIGNAL_ERROR_STATE    "error-state"
40
 
#define WINDOW_MENU_SIGNAL_STATUS_CHANGED "status-changed"
41
 
#define WINDOW_MENU_SIGNAL_SHOW_MENU      "show-menu"
42
 
#define WINDOW_MENU_SIGNAL_A11Y_UPDATE    "a11y-update"
43
 
 
44
 
typedef enum _WindowMenuStatus WindowMenuStatus;
45
 
enum _WindowMenuStatus {
46
 
        WINDOW_MENU_STATUS_NORMAL,
47
 
        WINDOW_MENU_STATUS_ACTIVE
48
 
};
49
 
 
50
 
typedef struct _WindowMenu      WindowMenu;
51
 
typedef struct _WindowMenuClass WindowMenuClass;
52
 
 
53
 
struct _WindowMenuClass {
54
 
        GObjectClass parent_class;
55
 
 
56
 
        /* Virtual Funcs */
57
 
        GList *          (*get_entries)      (WindowMenu * wm);
58
 
        guint            (*get_location)     (WindowMenu * wm, IndicatorObjectEntry * entry);
59
 
 
60
 
        guint            (*get_xid)          (WindowMenu * wm);
61
 
 
62
 
        gboolean         (*get_error_state)  (WindowMenu * wm);
63
 
        WindowMenuStatus (*get_status)       (WindowMenu * wm);
64
 
        void             (*entry_restore)    (WindowMenu * wm, IndicatorObjectEntry * entry);
65
 
 
66
 
        void             (*entry_activate)   (WindowMenu * wm, IndicatorObjectEntry * entry, guint timestamp);
67
 
 
68
 
        /* Signals */
69
 
        void (*entry_added)    (WindowMenu * wm, IndicatorObjectEntry * entry, gpointer user_data);
70
 
        void (*entry_removed)  (WindowMenu * wm, IndicatorObjectEntry * entry, gpointer user_data);
71
 
 
72
 
        void (*error_state)    (WindowMenu * wm, gboolean state, gpointer user_data);
73
 
        void (*status_changed) (WindowMenu * wm, WindowMenuStatus status, gpointer user_data);
74
 
 
75
 
        void (*show_menu)      (WindowMenu * wm, IndicatorObjectEntry * entry, guint timestamp, gpointer user_data);
76
 
        void (*a11y_update)    (WindowMenu * wm, IndicatorObjectEntry * entry, gpointer user_data);
77
 
};
78
 
 
79
 
struct _WindowMenu {
80
 
        GObject parent;
81
 
};
82
 
 
83
 
GType window_menu_get_type (void);
84
 
 
85
 
GList * window_menu_get_entries (WindowMenu * wm);
86
 
guint window_menu_get_location (WindowMenu * wm, IndicatorObjectEntry * entry);
87
 
 
88
 
guint window_menu_get_xid (WindowMenu * wm);
89
 
 
90
 
gboolean window_menu_get_error_state (WindowMenu * wm);
91
 
WindowMenuStatus window_menu_get_status (WindowMenu * wm);
92
 
void window_menu_entry_restore (WindowMenu * wm, IndicatorObjectEntry * entry);
93
 
 
94
 
void window_menu_entry_activate (WindowMenu * wm, IndicatorObjectEntry * entry, guint timestamp);
95
 
 
96
 
G_END_DECLS
97
 
 
98
 
#endif