~awn-core/awn/trunk-rewrite

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
125
126
127
128
129
130
131
132
133
/*
 *  Copyright (C) 2008 Neil Jagdish Patel <njpatel@gmail.com>
 *
 *  This program 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.
 *
 *  This program 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, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA.
 *
 *  Author : Neil Jagdish Patel <njpatel@gmail.com>
*/

#ifndef	_AWN_PANEL_H
#define	_AWN_PANEL_H

#include <glib.h>
#include <gtk/gtk.h>

#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>

#include <libdesktop-agnostic/config.h>
#include <libawn/libawn.h>

G_BEGIN_DECLS

#define AWN_TYPE_PANEL (awn_panel_get_type())

#define AWN_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AWN_TYPE_PANEL, \
        AwnPanel))

#define AWN_PANEL_CLASS(obj)	(G_TYPE_CHECK_CLASS_CAST ((obj), AWN_PANEL, \
        AwnPanelClass))

#define AWN_IS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AWN_TYPE_PANEL))

#define AWN_IS_PANEL_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), \
        AWN_TYPE_PANEL))

#define AWN_PANEL_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj), \
        AWN_TYPE_PANEL, AwnPanelClass))

typedef struct _AwnPanel AwnPanel;
typedef struct _AwnPanelClass AwnPanelClass;
typedef struct _AwnPanelPrivate AwnPanelPrivate;

struct _AwnPanel 
{
  GtkWindow parent;

  /*< private >*/
  AwnPanelPrivate *priv;
};

struct _AwnPanelClass 
{
  GtkWindowClass parent_class;

  /*< signals >*/
  void (*size_changed)     (AwnPanel *panel, gint size);
  void (*position_changed) (AwnPanel *panel, GtkPositionType position);
  void (*offset_changed)   (AwnPanel *panel, gint offset);
  void (*property_changed) (AwnPanel *panel,
                            const gchar *prop_name, GValue *value);
  void (*destroy_notify)   (AwnPanel *panel);
  void (*destroy_applet)   (AwnPanel *panel, const gchar *uid);

  gboolean (*autohide_start) (AwnPanel *panel);
  void     (*autohide_end)   (AwnPanel *panel);
};

GType       awn_panel_get_type            (void) G_GNUC_CONST;

GtkWidget * awn_panel_new_with_panel_id   (gint panel_id);

gboolean    awn_panel_add_applet          (AwnPanel        *panel,
                                           gchar           *desktop_file,
                                           GError         **error);

gboolean    awn_panel_delete_applet       (AwnPanel        *panel,
                                           gchar           *uid,
                                           GError         **error);

gboolean    awn_panel_set_applet_flags    (AwnPanel         *panel,
                                           const gchar      *uid,
                                           gint              flags,
                                           GError          **error);

void        awn_panel_inhibit_autohide    (AwnPanel *panel,
                                           const gchar *app_name,
                                           const gchar *reason,
                                           DBusGMethodInvocation *context);

gboolean    awn_panel_uninhibit_autohide  (AwnPanel         *panel,
                                           guint             cookie);

gboolean    awn_panel_get_inhibitors      (AwnPanel         *panel,
                                           GStrv            *reasons);

void        awn_panel_docklet_request     (AwnPanel         *panel,
                                           gint              min_size,
                                           gboolean          shrink,
                                           gboolean          expand,
                                           DBusGMethodInvocation *context);

gboolean    awn_panel_get_snapshot        (AwnPanel *panel,
                                           GValue *value,
                                           GError **error);

gboolean    awn_panel_get_all_server_flags(AwnPanel *panel,
                                           GHashTable **hash,
                                           gchar     *name,
                                           GError   **error);

gboolean    awn_panel_ua_add_applet       (AwnPanel *panel,
                                           gchar *name, glong xid,
                                           gint width, gint height,
                                           gchar *size_type,
                                           GError **error);

G_END_DECLS


#endif /* _AWN_PANEL_H */