Merge lp:~awn-core/awn/gutted-core-icons into lp:awn/0.4
- gutted-core-icons
- Merge into trunk
Proposed by
Michal Hruby
Status: | Merged |
---|---|
Merged at revision: | 715 |
Proposed branch: | lp:~awn-core/awn/gutted-core-icons |
Merge into: | lp:awn/0.4 |
Diff against target: |
1656 lines (+612/-569) 19 files modified
Makefile.am (+0/-2) applets/quick-prefs/applet.vala (+3/-3) applets/taskmanager/dock-manager-api.vala (+2/-2) configure.in (+6/-19) src/Makefile.am (+31/-16) src/awn-app-dbus.xml (+0/-16) src/awn-app.c (+0/-223) src/awn-app.h (+0/-83) src/awn-app.vala (+162/-0) src/awn-background-lucido.c (+1/-1) src/awn-background.c (+10/-1) src/awn-main.c (+2/-5) src/awn-monitor.c (+12/-0) src/awn-panel-dbus.xml (+0/-102) src/awn-panel-dispatcher.vala (+222/-0) src/awn-panel.c (+100/-86) src/awn-panel.h (+14/-8) src/awn-panel.vapi (+47/-0) tests/Makefile.am (+0/-2) |
To merge this branch: | bzr merge lp:~awn-core/awn/gutted-core-icons |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Awn-core | Pending | ||
Review via email: mp+30352@code.launchpad.net |
Commit message
Description of the change
Implements support for on-the-fly addition and removal of panels.
To post a comment you must log in.
- 1928. By Michal Hruby
-
Merge 1940
Revision history for this message
Alberto Aldegheri (albyrock87) wrote : | # |
Revision history for this message
Michal Hruby (mhr3) wrote : | # |
As a reminder for me, here are a couple of things I noticed that don't work:
- Setting applet / docklet flags via DBus
- DBus method GetSnapshot doesn't return anything
- 1929. By Michal Hruby
-
A few DBus fixes
- 1930. By Michal Hruby
-
Fix compability with vala 0.9.x
- 1931. By Michal Hruby
-
Fix critical in Lucido, clip drawing to background helper surface
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'Makefile.am' | |||
2 | --- Makefile.am 2010-03-09 21:10:09 +0000 | |||
3 | +++ Makefile.am 2010-07-24 23:31:47 +0000 | |||
4 | @@ -1,8 +1,6 @@ | |||
5 | 1 | NULL = | 1 | NULL = |
6 | 2 | 2 | ||
7 | 3 | if HAVE_VALA | ||
8 | 4 | VALA_BINDINGS = bindings/vala | 3 | VALA_BINDINGS = bindings/vala |
9 | 5 | endif | ||
10 | 6 | 4 | ||
11 | 7 | SUBDIRS = \ | 5 | SUBDIRS = \ |
12 | 8 | libawn \ | 6 | libawn \ |
13 | 9 | 7 | ||
14 | === modified file 'applets/quick-prefs/applet.vala' | |||
15 | --- applets/quick-prefs/applet.vala 2010-05-28 21:49:08 +0000 | |||
16 | +++ applets/quick-prefs/applet.vala 2010-07-24 23:31:47 +0000 | |||
17 | @@ -54,9 +54,9 @@ | |||
18 | 54 | 54 | ||
19 | 55 | public PrefsApplet (string canonical_name, string uid, int panel_id) | 55 | public PrefsApplet (string canonical_name, string uid, int panel_id) |
20 | 56 | { | 56 | { |
24 | 57 | this.canonical_name = canonical_name; | 57 | GLib.Object (canonical_name: canonical_name, |
25 | 58 | this.uid = uid; | 58 | uid: uid, |
26 | 59 | this.panel_id = panel_id; | 59 | panel_id: panel_id); |
27 | 60 | } | 60 | } |
28 | 61 | 61 | ||
29 | 62 | construct | 62 | construct |
30 | 63 | 63 | ||
31 | === modified file 'applets/taskmanager/dock-manager-api.vala' | |||
32 | --- applets/taskmanager/dock-manager-api.vala 2010-04-11 12:41:57 +0000 | |||
33 | +++ applets/taskmanager/dock-manager-api.vala 2010-07-24 23:31:47 +0000 | |||
34 | @@ -66,7 +66,7 @@ | |||
35 | 66 | }); | 66 | }); |
36 | 67 | */ | 67 | */ |
37 | 68 | 68 | ||
39 | 69 | var conn = Bus.get (BusType.SESSION); | 69 | var conn = DBus.Bus.get (DBus.BusType.SESSION); |
40 | 70 | string obj_path = "/org/freedesktop/DockManager"; | 70 | string obj_path = "/org/freedesktop/DockManager"; |
41 | 71 | conn.register_object (obj_path, this); | 71 | conn.register_object (obj_path, this); |
42 | 72 | } | 72 | } |
43 | @@ -244,7 +244,7 @@ | |||
44 | 244 | { | 244 | { |
45 | 245 | this.icon = icon; | 245 | this.icon = icon; |
46 | 246 | 246 | ||
48 | 247 | var conn = Bus.get (BusType.SESSION); | 247 | var conn = DBus.Bus.get (DBus.BusType.SESSION); |
49 | 248 | this.object_path = "/org/freedesktop/DockManager/Item%d".printf (counter++); | 248 | this.object_path = "/org/freedesktop/DockManager/Item%d".printf (counter++); |
50 | 249 | conn.register_object (this.object_path, this); | 249 | conn.register_object (this.object_path, this); |
51 | 250 | 250 | ||
52 | 251 | 251 | ||
53 | === modified file 'configure.in' | |||
54 | --- configure.in 2010-04-11 17:06:01 +0000 | |||
55 | +++ configure.in 2010-07-24 23:31:47 +0000 | |||
56 | @@ -60,20 +60,11 @@ | |||
57 | 60 | dnl Vala support | 60 | dnl Vala support |
58 | 61 | dnl ============================================== | 61 | dnl ============================================== |
59 | 62 | 62 | ||
72 | 63 | AC_ARG_WITH(vala, AS_HELP_STRING([--with-vala],[Enables installation of the Vala bindings]),,[with_vala=yes]) | 63 | VALA_PROG_VALAC(0.8.1) |
73 | 64 | 64 | if test "$USE_MAINTAINER_MODE" = "yes"; then | |
74 | 65 | if test "$with_vala" != "no"; then | 65 | AC_PATH_PROG(VALA_GEN_INTROSPECT, vala-gen-introspect, vala-gen-introspect, []) |
75 | 66 | VALA_PROG_VALAC(0.7.10) | 66 | AC_PATH_PROG(VAPIGEN, vapigen, vapigen, []) |
64 | 67 | if test -n "$VALAC"; then | ||
65 | 68 | if test "$USE_MAINTAINER_MODE" = "yes"; then | ||
66 | 69 | AC_PATH_PROG(VALA_GEN_INTROSPECT, vala-gen-introspect, vala-gen-introspect, []) | ||
67 | 70 | AC_PATH_PROG(VAPIGEN, vapigen, vapigen, []) | ||
68 | 71 | fi | ||
69 | 72 | else | ||
70 | 73 | with_vala=no | ||
71 | 74 | fi | ||
76 | 75 | fi | 67 | fi |
77 | 76 | AM_CONDITIONAL(HAVE_VALA, test -n "$VALAC") | ||
78 | 77 | 68 | ||
79 | 78 | dnl ============================================== | 69 | dnl ============================================== |
80 | 79 | dnl Check for Python modules | 70 | dnl Check for Python modules |
81 | @@ -145,10 +136,8 @@ | |||
82 | 145 | LDA_DEFSDIR=`$PKG_CONFIG --variable=defsdir desktop-agnostic` | 136 | LDA_DEFSDIR=`$PKG_CONFIG --variable=defsdir desktop-agnostic` |
83 | 146 | AC_SUBST(LDA_DEFSDIR) | 137 | AC_SUBST(LDA_DEFSDIR) |
84 | 147 | 138 | ||
89 | 148 | if test "$with_vala" != "no"; then | 139 | LDA_VAPIDIR="`$PKG_CONFIG --variable=vapidir desktop-agnostic`" |
90 | 149 | LDA_VAPIDIR="`$PKG_CONFIG --variable=vapidir desktop-agnostic`" | 140 | AC_SUBST(LDA_VAPIDIR) |
87 | 150 | AC_SUBST(LDA_VAPIDIR) | ||
88 | 151 | fi | ||
91 | 152 | 141 | ||
92 | 153 | AC_CHECK_LIB(m, lround) | 142 | AC_CHECK_LIB(m, lround) |
93 | 154 | 143 | ||
94 | @@ -238,7 +227,5 @@ | |||
95 | 238 | echo "" | 227 | echo "" |
96 | 239 | echo " prefix: ${prefix}" | 228 | echo " prefix: ${prefix}" |
97 | 240 | echo "" | 229 | echo "" |
98 | 241 | echo " Vala Support: ${with_vala}" | ||
99 | 242 | echo "" | ||
100 | 243 | echo " Documentation: ${enable_gtk_doc}" | 230 | echo " Documentation: ${enable_gtk_doc}" |
101 | 244 | echo "" | 231 | echo "" |
102 | 245 | 232 | ||
103 | === modified file 'src/Makefile.am' | |||
104 | --- src/Makefile.am 2010-05-16 19:12:31 +0000 | |||
105 | +++ src/Makefile.am 2010-07-24 23:31:47 +0000 | |||
106 | @@ -13,6 +13,30 @@ | |||
107 | 13 | -I$(builddir) \ | 13 | -I$(builddir) \ |
108 | 14 | $(NULL) | 14 | $(NULL) |
109 | 15 | 15 | ||
110 | 16 | VALA_FILES = \ | ||
111 | 17 | awn-panel-dispatcher.vala \ | ||
112 | 18 | awn-app.vala \ | ||
113 | 19 | $(NULL) | ||
114 | 20 | |||
115 | 21 | VALA_FLAGS = \ | ||
116 | 22 | $(top_builddir)/bindings/vala/awn.vapi \ | ||
117 | 23 | awn-panel.vapi \ | ||
118 | 24 | --pkg dbus-glib-1 \ | ||
119 | 25 | --pkg gtk+-2.0 \ | ||
120 | 26 | --pkg desktop-agnostic-cfg \ | ||
121 | 27 | $(NULL) | ||
122 | 28 | |||
123 | 29 | awn-core.vala.stamp: $(VALA_FILES) | ||
124 | 30 | $(foreach vala_file,$(VALA_FILES),\ | ||
125 | 31 | $(VALAC) -C -H $(vala_file:.vala=.h) $(vala_file) $(VALA_FLAGS) && \ | ||
126 | 32 | $(SED) -i -r 's/^#include <(awn.+h)>$$/#include "\1"/' $(vala_file:.vala=.)[ch] || exit 1;) | ||
127 | 33 | touch "$@" | ||
128 | 34 | |||
129 | 35 | VALA_GENERATED_FILES = \ | ||
130 | 36 | $(VALA_FILES:.vala=.c) \ | ||
131 | 37 | $(VALA_FILES:.vala=.h) \ | ||
132 | 38 | $(NULL) | ||
133 | 39 | |||
134 | 16 | bin_PROGRAMS = avant-window-navigator | 40 | bin_PROGRAMS = avant-window-navigator |
135 | 17 | 41 | ||
136 | 18 | avant_window_navigator_LDADD = \ | 42 | avant_window_navigator_LDADD = \ |
137 | @@ -22,9 +46,6 @@ | |||
138 | 22 | 46 | ||
139 | 23 | avant_window_navigator_SOURCES = \ | 47 | avant_window_navigator_SOURCES = \ |
140 | 24 | awn-main.c \ | 48 | awn-main.c \ |
141 | 25 | awn-app.c \ | ||
142 | 26 | awn-app.h \ | ||
143 | 27 | awn-app-glue.h \ | ||
144 | 28 | awn-applet-manager.c \ | 49 | awn-applet-manager.c \ |
145 | 29 | awn-applet-manager.h \ | 50 | awn-applet-manager.h \ |
146 | 30 | awn-applet-proxy.c \ | 51 | awn-applet-proxy.c \ |
147 | @@ -50,7 +71,6 @@ | |||
148 | 50 | awn-monitor.h \ | 71 | awn-monitor.h \ |
149 | 51 | awn-panel.c \ | 72 | awn-panel.c \ |
150 | 52 | awn-panel.h \ | 73 | awn-panel.h \ |
151 | 53 | awn-panel-glue.h \ | ||
152 | 54 | awn-separator.c \ | 74 | awn-separator.c \ |
153 | 55 | awn-separator.h \ | 75 | awn-separator.h \ |
154 | 56 | awn-throbber.c \ | 76 | awn-throbber.c \ |
155 | @@ -62,27 +82,22 @@ | |||
156 | 62 | inlinepixbufs.h \ | 82 | inlinepixbufs.h \ |
157 | 63 | xutils.h \ | 83 | xutils.h \ |
158 | 64 | xutils.c \ | 84 | xutils.c \ |
159 | 85 | $(VALA_GENERATED_FILES) \ | ||
160 | 65 | $(NULL) | 86 | $(NULL) |
161 | 66 | 87 | ||
162 | 67 | # DBus glue | ||
163 | 68 | awn-app-glue.h: awn-app-dbus.xml Makefile | ||
164 | 69 | $(QUIET_GEN)$(LIBTOOL) --mode=execute $(DBUS_GLIB_BIN)/dbus-binding-tool --prefix=awn_app --mode=glib-server --output=$@ $< | ||
165 | 70 | |||
166 | 71 | awn-panel-glue.h: awn-panel-dbus.xml Makefile | ||
167 | 72 | $(QUIET_GEN)$(LIBTOOL) --mode=execute $(DBUS_GLIB_BIN)/dbus-binding-tool --prefix=awn_panel --mode=glib-server --output=$@ $< | ||
168 | 73 | |||
169 | 74 | BUILT_SOURCES = \ | 88 | BUILT_SOURCES = \ |
172 | 75 | awn-app-glue.h \ | 89 | awn-core.vala.stamp \ |
171 | 76 | awn-panel-glue.h \ | ||
173 | 77 | $(MARSHALFILES) \ | 90 | $(MARSHALFILES) \ |
174 | 78 | $(NULL) | 91 | $(NULL) |
175 | 79 | 92 | ||
177 | 80 | CLEANFILES = $(BUILT_SOURCES) | 93 | CLEANFILES = \ |
178 | 94 | $(BUILT_SOURCES) \ | ||
179 | 95 | $(VALA_GENERATED_FILES) \ | ||
180 | 96 | $(NULL) | ||
181 | 81 | 97 | ||
182 | 82 | EXTRA_DIST = \ | 98 | EXTRA_DIST = \ |
183 | 83 | awn-app-dbus.xml \ | ||
184 | 84 | awn-panel-dbus.xml \ | ||
185 | 85 | awn-marshal.list \ | 99 | awn-marshal.list \ |
186 | 100 | $(VALA_GENERATED_FILES) \ | ||
187 | 86 | $(NULL) | 101 | $(NULL) |
188 | 87 | 102 | ||
189 | 88 | # vim: set ts=8 sts=8 sw=8 : | 103 | # vim: set ts=8 sts=8 sw=8 : |
190 | 89 | 104 | ||
191 | === removed file 'src/awn-app-dbus.xml' | |||
192 | --- src/awn-app-dbus.xml 2009-11-09 00:45:42 +0000 | |||
193 | +++ src/awn-app-dbus.xml 1970-01-01 00:00:00 +0000 | |||
194 | @@ -1,16 +0,0 @@ | |||
195 | 1 | <?xml version="1.0"?> | ||
196 | 2 | <node name="/org/awnproject/Awn/App"> | ||
197 | 3 | <interface name="org.awnproject.Awn.App"> | ||
198 | 4 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="awn_app"/> | ||
199 | 5 | |||
200 | 6 | <method name="GetPanels"> | ||
201 | 7 | <arg name="panels" type="ao" direction="out" /> | ||
202 | 8 | </method> | ||
203 | 9 | |||
204 | 10 | <method name="RemovePanel"> | ||
205 | 11 | <arg name="panel_id" type="i" direction="in" /> | ||
206 | 12 | </method> | ||
207 | 13 | |||
208 | 14 | </interface> | ||
209 | 15 | </node> | ||
210 | 16 | |||
211 | 17 | 0 | ||
212 | === removed file 'src/awn-app.c' | |||
213 | --- src/awn-app.c 2010-04-09 23:58:31 +0000 | |||
214 | +++ src/awn-app.c 1970-01-01 00:00:00 +0000 | |||
215 | @@ -1,223 +0,0 @@ | |||
216 | 1 | /* | ||
217 | 2 | * Copyright (C) 2008 Neil J. Patel <njpatel@gmail.com> | ||
218 | 3 | * | ||
219 | 4 | * This program is free software; you can redistribute it and/or | ||
220 | 5 | * modify it under the terms of the GNU General Public | ||
221 | 6 | * License as published by the Free Software Foundation; either | ||
222 | 7 | * version 2 of the License, or (at your option) any later version. | ||
223 | 8 | * | ||
224 | 9 | * This library is distributed in the hope that it will be useful, | ||
225 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
226 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
227 | 12 | * Lesser General Public License for more details. | ||
228 | 13 | * | ||
229 | 14 | * You should have received a copy of the GNU General Public | ||
230 | 15 | * License along with this library; if not, write to the | ||
231 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
232 | 17 | * Boston, MA 02111-1307, USA. | ||
233 | 18 | * | ||
234 | 19 | * Authored by Neil Jagdish Patel <njpatel@gmail.com> | ||
235 | 20 | * | ||
236 | 21 | */ | ||
237 | 22 | |||
238 | 23 | /* | ||
239 | 24 | * AwnApp is the 'controller' for the panel. It will launch the panel with the | ||
240 | 25 | * correct settings. | ||
241 | 26 | * | ||
242 | 27 | * In the future, AwnApp will be responsible for launching each Awn panel | ||
243 | 28 | * separately, and dealing with the configuration backend for each panel. | ||
244 | 29 | */ | ||
245 | 30 | |||
246 | 31 | #include <glib.h> | ||
247 | 32 | |||
248 | 33 | #include <stdio.h> | ||
249 | 34 | #include <string.h> | ||
250 | 35 | |||
251 | 36 | #include <dbus/dbus-glib.h> | ||
252 | 37 | #include <dbus/dbus-glib-bindings.h> | ||
253 | 38 | |||
254 | 39 | #include <libawn/libawn.h> | ||
255 | 40 | |||
256 | 41 | #include "awn-app.h" | ||
257 | 42 | #include "awn-defines.h" | ||
258 | 43 | #include "awn-panel.h" | ||
259 | 44 | #include "awn-app-glue.h" | ||
260 | 45 | #include <libawn/awn-utils.h> | ||
261 | 46 | |||
262 | 47 | |||
263 | 48 | G_DEFINE_TYPE (AwnApp, awn_app, G_TYPE_OBJECT) | ||
264 | 49 | |||
265 | 50 | #define AWN_APP_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE(obj, \ | ||
266 | 51 | AWN_TYPE_APP, AwnAppPrivate)) | ||
267 | 52 | |||
268 | 53 | struct _AwnAppPrivate | ||
269 | 54 | { | ||
270 | 55 | DBusGConnection *connection; | ||
271 | 56 | DesktopAgnosticConfigClient *client; | ||
272 | 57 | |||
273 | 58 | GHashTable *panels; | ||
274 | 59 | }; | ||
275 | 60 | |||
276 | 61 | /* GObject functions */ | ||
277 | 62 | static void | ||
278 | 63 | awn_app_finalize (GObject *app) | ||
279 | 64 | { | ||
280 | 65 | AwnAppPrivate *priv; | ||
281 | 66 | |||
282 | 67 | g_return_if_fail (AWN_IS_APP (app)); | ||
283 | 68 | priv = AWN_APP (app)->priv; | ||
284 | 69 | |||
285 | 70 | g_object_unref (priv->client); | ||
286 | 71 | |||
287 | 72 | G_OBJECT_CLASS (awn_app_parent_class)->finalize (app); | ||
288 | 73 | } | ||
289 | 74 | |||
290 | 75 | static void | ||
291 | 76 | awn_app_class_init (AwnAppClass *klass) | ||
292 | 77 | { | ||
293 | 78 | GObjectClass *obj_class = G_OBJECT_CLASS (klass); | ||
294 | 79 | |||
295 | 80 | obj_class->finalize = awn_app_finalize; | ||
296 | 81 | |||
297 | 82 | g_type_class_add_private (obj_class, sizeof (AwnAppPrivate)); | ||
298 | 83 | |||
299 | 84 | dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), | ||
300 | 85 | &dbus_glib_awn_app_object_info); | ||
301 | 86 | } | ||
302 | 87 | |||
303 | 88 | static void | ||
304 | 89 | awn_app_init (AwnApp *app) | ||
305 | 90 | { | ||
306 | 91 | AwnAppPrivate *priv; | ||
307 | 92 | GError *error = NULL; | ||
308 | 93 | GValueArray *panels = NULL; | ||
309 | 94 | |||
310 | 95 | priv = app->priv = AWN_APP_GET_PRIVATE (app); | ||
311 | 96 | |||
312 | 97 | priv->panels = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); | ||
313 | 98 | |||
314 | 99 | priv->client = awn_config_get_default (0, &error); | ||
315 | 100 | |||
316 | 101 | if (error) | ||
317 | 102 | { | ||
318 | 103 | g_warning ("Unable to retrieve the configuration client: %s", | ||
319 | 104 | error->message); | ||
320 | 105 | g_error_free (error); | ||
321 | 106 | gtk_main_quit (); | ||
322 | 107 | } | ||
323 | 108 | |||
324 | 109 | gtk_window_set_default_icon_name ("avant-window-navigator"); | ||
325 | 110 | |||
326 | 111 | /* Grab a connection to the bus */ | ||
327 | 112 | priv->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); | ||
328 | 113 | if (priv->connection == NULL) | ||
329 | 114 | { | ||
330 | 115 | g_warning ("Unable to make connection to the D-Bus session bus: %s", | ||
331 | 116 | error->message); | ||
332 | 117 | g_error_free (error); | ||
333 | 118 | gtk_main_quit (); | ||
334 | 119 | } | ||
335 | 120 | |||
336 | 121 | panels = desktop_agnostic_config_client_get_list (priv->client, | ||
337 | 122 | AWN_GROUP_PANELS, | ||
338 | 123 | AWN_PANELS_IDS, | ||
339 | 124 | &error); | ||
340 | 125 | |||
341 | 126 | if (error) | ||
342 | 127 | { | ||
343 | 128 | g_error ("Unable to retrieve panels config value: %s", | ||
344 | 129 | error->message); | ||
345 | 130 | g_error_free (error); | ||
346 | 131 | return; | ||
347 | 132 | } | ||
348 | 133 | |||
349 | 134 | if (panels->n_values == 0) | ||
350 | 135 | { | ||
351 | 136 | gboolean is_gconf = FALSE; | ||
352 | 137 | GType config_type = desktop_agnostic_config_get_type (NULL); | ||
353 | 138 | |||
354 | 139 | if (config_type) | ||
355 | 140 | { | ||
356 | 141 | const gchar *config_backend = g_type_name (config_type); | ||
357 | 142 | is_gconf = strstr (config_backend, "GConf") != NULL; | ||
358 | 143 | } | ||
359 | 144 | g_error ("No panels to create! %s", is_gconf ? | ||
360 | 145 | "\n** Please check that the gconf-schema is installed." | ||
361 | 146 | "\n** You might also try to run `killall gconfd-2`." : ""); | ||
362 | 147 | return; | ||
363 | 148 | } | ||
364 | 149 | |||
365 | 150 | // FIXME: we could check here if there are any values in the panel_list | ||
366 | 151 | // and show a "Restart gconfd-2? dialog" if there aren't | ||
367 | 152 | |||
368 | 153 | for (guint i=0; i < panels->n_values; i++) | ||
369 | 154 | { | ||
370 | 155 | GtkWidget *panel; | ||
371 | 156 | |||
372 | 157 | GValue *value = g_value_array_get_nth (panels, i); | ||
373 | 158 | |||
374 | 159 | gint panel_id = g_value_get_int (value); | ||
375 | 160 | panel = awn_panel_new_with_panel_id (panel_id); | ||
376 | 161 | |||
377 | 162 | gchar *object_path = g_strdup_printf (AWN_DBUS_PANEL_PATH "%d", panel_id); | ||
378 | 163 | |||
379 | 164 | dbus_g_connection_register_g_object (priv->connection, | ||
380 | 165 | object_path, G_OBJECT (panel)); | ||
381 | 166 | |||
382 | 167 | g_hash_table_insert (priv->panels, object_path, panel); | ||
383 | 168 | |||
384 | 169 | gtk_widget_show (panel); | ||
385 | 170 | } | ||
386 | 171 | |||
387 | 172 | g_value_array_free (panels); | ||
388 | 173 | } | ||
389 | 174 | |||
390 | 175 | gboolean | ||
391 | 176 | awn_app_remove_panel (AwnApp *app, gint panel_id, GError *error) | ||
392 | 177 | { | ||
393 | 178 | // remove the panel for real once we do multiple panels | ||
394 | 179 | if (panel_id == AWN_PANEL_ID_DEFAULT) | ||
395 | 180 | { | ||
396 | 181 | gtk_main_quit (); | ||
397 | 182 | } | ||
398 | 183 | |||
399 | 184 | return TRUE; | ||
400 | 185 | } | ||
401 | 186 | |||
402 | 187 | gboolean | ||
403 | 188 | awn_app_get_panels (AwnApp *app, GPtrArray **panels) | ||
404 | 189 | { | ||
405 | 190 | AwnAppPrivate *priv; | ||
406 | 191 | GList *list, *l; | ||
407 | 192 | |||
408 | 193 | priv = app->priv; | ||
409 | 194 | |||
410 | 195 | *panels = g_ptr_array_sized_new (g_hash_table_size (priv->panels)); | ||
411 | 196 | |||
412 | 197 | list = l = g_hash_table_get_keys (priv->panels); // list should be freed | ||
413 | 198 | |||
414 | 199 | while (list) | ||
415 | 200 | { | ||
416 | 201 | g_ptr_array_add (*panels, g_strdup (list->data)); | ||
417 | 202 | |||
418 | 203 | list = list->next; | ||
419 | 204 | } | ||
420 | 205 | |||
421 | 206 | g_list_free (l); | ||
422 | 207 | |||
423 | 208 | return TRUE; | ||
424 | 209 | } | ||
425 | 210 | |||
426 | 211 | AwnApp* | ||
427 | 212 | awn_app_get_default (void) | ||
428 | 213 | { | ||
429 | 214 | static AwnApp *app = NULL; | ||
430 | 215 | |||
431 | 216 | if (app == NULL) | ||
432 | 217 | { | ||
433 | 218 | app = g_object_new (AWN_TYPE_APP, NULL); | ||
434 | 219 | } | ||
435 | 220 | |||
436 | 221 | return app; | ||
437 | 222 | } | ||
438 | 223 | |||
439 | 224 | 0 | ||
440 | === removed file 'src/awn-app.h' | |||
441 | --- src/awn-app.h 2009-11-09 00:45:42 +0000 | |||
442 | +++ src/awn-app.h 1970-01-01 00:00:00 +0000 | |||
443 | @@ -1,83 +0,0 @@ | |||
444 | 1 | /* | ||
445 | 2 | * Copyright (C) 2008 Neil Jagdish Patel | ||
446 | 3 | * | ||
447 | 4 | * This program is free software; you can redistribute it and/or | ||
448 | 5 | * modify it under the terms of the GNU General Public | ||
449 | 6 | * License as published by the Free Software Foundation; either | ||
450 | 7 | * version 2 of the License, or (at your option) any later version. | ||
451 | 8 | * | ||
452 | 9 | * This library is distributed in the hope that it will be useful, | ||
453 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
454 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
455 | 12 | * Lesser General Public License for more details. | ||
456 | 13 | * | ||
457 | 14 | * You should have received a copy of the GNU General Public | ||
458 | 15 | * License along with this library; if not, write to the | ||
459 | 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, | ||
460 | 17 | * Boston, MA 02111-1307, USA. | ||
461 | 18 | * | ||
462 | 19 | * Authored by Neil Jagdish Patel <njpatel@gmail.com> | ||
463 | 20 | * | ||
464 | 21 | */ | ||
465 | 22 | |||
466 | 23 | #ifndef _HAVE_AWN_APP_H | ||
467 | 24 | #define _HAVE_AWN_APP_H | ||
468 | 25 | |||
469 | 26 | #include <glib.h> | ||
470 | 27 | #include <gtk/gtk.h> | ||
471 | 28 | |||
472 | 29 | G_BEGIN_DECLS | ||
473 | 30 | |||
474 | 31 | #define AWN_TYPE_APP (awn_app_get_type ()) | ||
475 | 32 | |||
476 | 33 | #define AWN_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \ | ||
477 | 34 | AWN_TYPE_APP, AwnApp)) | ||
478 | 35 | |||
479 | 36 | #define AWN_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \ | ||
480 | 37 | AWN_TYPE_APP, AwnAppClass)) | ||
481 | 38 | |||
482 | 39 | #define AWN_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \ | ||
483 | 40 | AWN_TYPE_APP)) | ||
484 | 41 | |||
485 | 42 | #define AWN_IS_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \ | ||
486 | 43 | AWN_TYPE_APP)) | ||
487 | 44 | |||
488 | 45 | #define AWN_APP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \ | ||
489 | 46 | AWN_TYPE_APP, AwnAppClass)) | ||
490 | 47 | |||
491 | 48 | typedef struct _AwnApp AwnApp; | ||
492 | 49 | typedef struct _AwnAppClass AwnAppClass; | ||
493 | 50 | typedef struct _AwnAppPrivate AwnAppPrivate; | ||
494 | 51 | |||
495 | 52 | |||
496 | 53 | struct _AwnApp | ||
497 | 54 | { | ||
498 | 55 | GObject parent; | ||
499 | 56 | |||
500 | 57 | /*< private >*/ | ||
501 | 58 | AwnAppPrivate *priv; | ||
502 | 59 | }; | ||
503 | 60 | |||
504 | 61 | struct _AwnAppClass | ||
505 | 62 | { | ||
506 | 63 | /*< private >*/ | ||
507 | 64 | GObjectClass parent_class; | ||
508 | 65 | |||
509 | 66 | /*< private >*/ | ||
510 | 67 | void (*_awn_app_1) (void); | ||
511 | 68 | void (*_awn_app_2) (void); | ||
512 | 69 | void (*_awn_app_3) (void); | ||
513 | 70 | void (*_awn_app_4) (void); | ||
514 | 71 | }; | ||
515 | 72 | |||
516 | 73 | GType awn_app_get_type (void) G_GNUC_CONST; | ||
517 | 74 | |||
518 | 75 | AwnApp * awn_app_get_default (void); | ||
519 | 76 | |||
520 | 77 | gboolean awn_app_remove_panel (AwnApp *app, gint panel_id, GError *error); | ||
521 | 78 | |||
522 | 79 | gboolean awn_app_get_panels (AwnApp *app, GPtrArray **panels); | ||
523 | 80 | |||
524 | 81 | G_END_DECLS | ||
525 | 82 | |||
526 | 83 | #endif /* _HAVE_AWN_APP_H */ | ||
527 | 84 | 0 | ||
528 | === added file 'src/awn-app.vala' | |||
529 | --- src/awn-app.vala 1970-01-01 00:00:00 +0000 | |||
530 | +++ src/awn-app.vala 2010-07-24 23:31:47 +0000 | |||
531 | @@ -0,0 +1,162 @@ | |||
532 | 1 | /* | ||
533 | 2 | * Copyright (C) 2010 Michal Hruby <michal.mhr@gmail.com> | ||
534 | 3 | * | ||
535 | 4 | * This program is free software; you can redistribute it and/or modify | ||
536 | 5 | * it under the terms of the GNU General Public License as published by | ||
537 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
538 | 7 | * (at your option) any later version. | ||
539 | 8 | * | ||
540 | 9 | * This program is distributed in the hope that it will be useful, | ||
541 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
542 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
543 | 12 | * GNU General Public License for more details. | ||
544 | 13 | * | ||
545 | 14 | * You should have received a copy of the GNU General Public License | ||
546 | 15 | * along with this program; if not, write to the Free Software | ||
547 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
548 | 17 | * | ||
549 | 18 | * Authored by Michal Hruby <michal.mhr@gmail.com> | ||
550 | 19 | * | ||
551 | 20 | */ | ||
552 | 21 | |||
553 | 22 | using DBus; | ||
554 | 23 | |||
555 | 24 | namespace Awn | ||
556 | 25 | { | ||
557 | 26 | [DBus (name="org.awnproject.Awn.App")] | ||
558 | 27 | public interface AppDBusInterface: GLib.Object | ||
559 | 28 | { | ||
560 | 29 | public abstract ObjectPath[] get_panels () throws DBus.Error; | ||
561 | 30 | public abstract void remove_panel (int panel_id) throws DBus.Error; | ||
562 | 31 | } | ||
563 | 32 | |||
564 | 33 | public class Application: GLib.Object, AppDBusInterface | ||
565 | 34 | { | ||
566 | 35 | private static Application instance; | ||
567 | 36 | |||
568 | 37 | private HashTable<string, Panel> panels; | ||
569 | 38 | private Connection connection; | ||
570 | 39 | private DesktopAgnostic.Config.Client client; | ||
571 | 40 | |||
572 | 41 | private Application () | ||
573 | 42 | { | ||
574 | 43 | this.panels = new HashTable<string, Panel>.full (str_hash, str_equal, | ||
575 | 44 | g_free, g_object_unref); | ||
576 | 45 | this.client = Config.get_default (0); | ||
577 | 46 | |||
578 | 47 | Gtk.Window.set_default_icon_name ("avant-window-navigator"); | ||
579 | 48 | |||
580 | 49 | this.connection = DBus.Bus.get (DBus.BusType.SESSION); | ||
581 | 50 | this.connection.register_object ("/org/awnproject/Awn", this); | ||
582 | 51 | |||
583 | 52 | try | ||
584 | 53 | { | ||
585 | 54 | var panel_ids = this.client.get_list ("panels", "panel_list"); | ||
586 | 55 | |||
587 | 56 | if (panel_ids.n_values == 0) | ||
588 | 57 | { | ||
589 | 58 | bool is_gconf = false; | ||
590 | 59 | Type config_type = DesktopAgnostic.Config.get_type (); | ||
591 | 60 | if (config_type > 0) | ||
592 | 61 | { | ||
593 | 62 | is_gconf = config_type.name ().str ("GConf") != null; | ||
594 | 63 | } | ||
595 | 64 | error ("No panels to create! %s", is_gconf ? | ||
596 | 65 | "\n** Please check that the gconf-schema is installed." + | ||
597 | 66 | "\n** You might want to try running `killall gconfd-2`." : ""); | ||
598 | 67 | } | ||
599 | 68 | |||
600 | 69 | foreach (Value val in panel_ids) | ||
601 | 70 | { | ||
602 | 71 | int panel_id = val.get_int (); | ||
603 | 72 | string path = "/org/awnproject/Awn/Panel%d".printf (panel_id); | ||
604 | 73 | |||
605 | 74 | Panel panel = new Panel.with_panel_id (panel_id); | ||
606 | 75 | |||
607 | 76 | this.panels.insert ((owned)path, panel); | ||
608 | 77 | |||
609 | 78 | panel.show (); | ||
610 | 79 | } | ||
611 | 80 | |||
612 | 81 | this.client.notify_add ("panels", "panel_list", this.panels_changed); | ||
613 | 82 | } | ||
614 | 83 | catch (GLib.Error e) | ||
615 | 84 | { | ||
616 | 85 | error ("Unable to retrieve panels config value: %s", e.message); | ||
617 | 86 | } | ||
618 | 87 | } | ||
619 | 88 | |||
620 | 89 | private void panels_changed (string key, string group, Value val) | ||
621 | 90 | { | ||
622 | 91 | List<unowned Panel> untouched_panels = new List<unowned Panel> (); | ||
623 | 92 | foreach (var p in this.panels.get_values ()) | ||
624 | 93 | { | ||
625 | 94 | untouched_panels.append (p); | ||
626 | 95 | } | ||
627 | 96 | |||
628 | 97 | unowned ValueArray arr = (ValueArray) val.get_boxed (); | ||
629 | 98 | foreach (Value v in arr) | ||
630 | 99 | { | ||
631 | 100 | int panel_id = v.get_int (); | ||
632 | 101 | string path = "/org/awnproject/Awn/Panel%d".printf (panel_id); | ||
633 | 102 | unowned Panel? p = this.panels.lookup (path); | ||
634 | 103 | |||
635 | 104 | if (p == null) | ||
636 | 105 | { | ||
637 | 106 | var panel = new Panel.with_panel_id (panel_id); | ||
638 | 107 | this.panels.insert ((owned)path, panel); | ||
639 | 108 | |||
640 | 109 | panel.show (); | ||
641 | 110 | } | ||
642 | 111 | else | ||
643 | 112 | { | ||
644 | 113 | untouched_panels.remove (p); | ||
645 | 114 | } | ||
646 | 115 | } | ||
647 | 116 | |||
648 | 117 | foreach (unowned Panel p in untouched_panels) | ||
649 | 118 | { | ||
650 | 119 | string path = "/org/awnproject/Awn/Panel%d".printf (p.panel_id); | ||
651 | 120 | this.panels.remove (path); | ||
652 | 121 | p.destroy (); | ||
653 | 122 | } | ||
654 | 123 | } | ||
655 | 124 | |||
656 | 125 | public ObjectPath[] get_panels () throws DBus.Error | ||
657 | 126 | { | ||
658 | 127 | var keys = this.panels.get_keys (); | ||
659 | 128 | keys.sort (strcmp); | ||
660 | 129 | |||
661 | 130 | ObjectPath[] paths = new ObjectPath[keys.length ()]; | ||
662 | 131 | int i = 0; | ||
663 | 132 | foreach (unowned string path in keys) | ||
664 | 133 | { | ||
665 | 134 | paths[i++] = new ObjectPath (path); | ||
666 | 135 | } | ||
667 | 136 | |||
668 | 137 | return paths; | ||
669 | 138 | } | ||
670 | 139 | |||
671 | 140 | public void remove_panel (int panel_id) throws DBus.Error | ||
672 | 141 | { | ||
673 | 142 | if (panel_id == 1) | ||
674 | 143 | { | ||
675 | 144 | Gtk.main_quit (); | ||
676 | 145 | } | ||
677 | 146 | else | ||
678 | 147 | { | ||
679 | 148 | // TODO | ||
680 | 149 | } | ||
681 | 150 | } | ||
682 | 151 | |||
683 | 152 | public static unowned Application get_default () | ||
684 | 153 | { | ||
685 | 154 | if (instance == null) | ||
686 | 155 | { | ||
687 | 156 | instance = new Application (); | ||
688 | 157 | } | ||
689 | 158 | return instance; | ||
690 | 159 | } | ||
691 | 160 | } | ||
692 | 161 | } | ||
693 | 162 | |||
694 | 0 | 163 | ||
695 | === modified file 'src/awn-background-lucido.c' | |||
696 | --- src/awn-background-lucido.c 2010-07-16 10:51:33 +0000 | |||
697 | +++ src/awn-background-lucido.c 2010-07-24 23:31:47 +0000 | |||
698 | @@ -160,6 +160,7 @@ | |||
699 | 160 | g_return_if_fail (manager); | 160 | g_return_if_fail (manager); |
700 | 161 | g_signal_connect_swapped (manager, "applets-refreshed", | 161 | g_signal_connect_swapped (manager, "applets-refreshed", |
701 | 162 | G_CALLBACK (awn_background_lucido_applets_refreshed), bg); | 162 | G_CALLBACK (awn_background_lucido_applets_refreshed), bg); |
702 | 163 | awn_background_lucido_applets_refreshed (AWN_BACKGROUND (bg)); | ||
703 | 163 | } | 164 | } |
704 | 164 | 165 | ||
705 | 165 | static void | 166 | static void |
706 | @@ -234,7 +235,6 @@ | |||
707 | 234 | priv->tid = 0; | 235 | priv->tid = 0; |
708 | 235 | priv->pos = g_array_new (FALSE, TRUE, sizeof (gfloat)); | 236 | priv->pos = g_array_new (FALSE, TRUE, sizeof (gfloat)); |
709 | 236 | priv->pos_size = 0; | 237 | priv->pos_size = 0; |
710 | 237 | awn_background_lucido_applets_refreshed (AWN_BACKGROUND (bg)); | ||
711 | 238 | } | 238 | } |
712 | 239 | 239 | ||
713 | 240 | AwnBackground * | 240 | AwnBackground * |
714 | 241 | 241 | ||
715 | === modified file 'src/awn-background.c' | |||
716 | --- src/awn-background.c 2010-07-16 10:51:33 +0000 | |||
717 | +++ src/awn-background.c 2010-07-24 23:31:47 +0000 | |||
718 | @@ -714,7 +714,7 @@ | |||
719 | 714 | 714 | ||
720 | 715 | void | 715 | void |
721 | 716 | awn_background_draw (AwnBackground *bg, | 716 | awn_background_draw (AwnBackground *bg, |
723 | 717 | cairo_t *cr, | 717 | cairo_t *cr, |
724 | 718 | GtkPositionType position, | 718 | GtkPositionType position, |
725 | 719 | GdkRectangle *area) | 719 | GdkRectangle *area) |
726 | 720 | { | 720 | { |
727 | @@ -735,9 +735,12 @@ | |||
728 | 735 | if (klass->get_needs_redraw (bg, position, area)) | 735 | if (klass->get_needs_redraw (bg, position, area)) |
729 | 736 | { | 736 | { |
730 | 737 | cairo_t *temp_cr; | 737 | cairo_t *temp_cr; |
731 | 738 | gdouble clip_x1, clip_x2, clip_y1, clip_y2; | ||
732 | 738 | gint full_width = area->x + area->width; | 739 | gint full_width = area->x + area->width; |
733 | 739 | gint full_height = area->y + area->height; | 740 | gint full_height = area->y + area->height; |
734 | 740 | 741 | ||
735 | 742 | cairo_clip_extents (cr, &clip_x1, &clip_y1, &clip_x2, &clip_y2); | ||
736 | 743 | |||
737 | 741 | gboolean realloc_needed = bg->helper_surface == NULL || | 744 | gboolean realloc_needed = bg->helper_surface == NULL || |
738 | 742 | cairo_image_surface_get_width (bg->helper_surface) != full_width || | 745 | cairo_image_surface_get_width (bg->helper_surface) != full_width || |
739 | 743 | cairo_image_surface_get_height (bg->helper_surface) != full_height; | 746 | cairo_image_surface_get_height (bg->helper_surface) != full_height; |
740 | @@ -753,10 +756,16 @@ | |||
741 | 753 | full_width, | 756 | full_width, |
742 | 754 | full_height); | 757 | full_height); |
743 | 755 | temp_cr = cairo_create (bg->helper_surface); | 758 | temp_cr = cairo_create (bg->helper_surface); |
744 | 759 | cairo_rectangle (temp_cr, clip_x1, clip_y1, | ||
745 | 760 | clip_x2-clip_x1, clip_y2-clip_y1); | ||
746 | 761 | cairo_clip (temp_cr); | ||
747 | 756 | } | 762 | } |
748 | 757 | else | 763 | else |
749 | 758 | { | 764 | { |
750 | 759 | temp_cr = cairo_create (bg->helper_surface); | 765 | temp_cr = cairo_create (bg->helper_surface); |
751 | 766 | cairo_rectangle (temp_cr, clip_x1, clip_y1, | ||
752 | 767 | clip_x2-clip_x1, clip_y2-clip_y1); | ||
753 | 768 | cairo_clip (temp_cr); | ||
754 | 760 | cairo_set_operator (temp_cr, CAIRO_OPERATOR_CLEAR); | 769 | cairo_set_operator (temp_cr, CAIRO_OPERATOR_CLEAR); |
755 | 761 | cairo_paint (temp_cr); | 770 | cairo_paint (temp_cr); |
756 | 762 | cairo_set_operator (temp_cr, CAIRO_OPERATOR_OVER); | 771 | cairo_set_operator (temp_cr, CAIRO_OPERATOR_OVER); |
757 | 763 | 772 | ||
758 | === modified file 'src/awn-main.c' | |||
759 | --- src/awn-main.c 2010-04-21 22:03:42 +0000 | |||
760 | +++ src/awn-main.c 2010-07-24 23:31:47 +0000 | |||
761 | @@ -70,7 +70,7 @@ | |||
762 | 70 | gint | 70 | gint |
763 | 71 | main (gint argc, gchar *argv[]) | 71 | main (gint argc, gchar *argv[]) |
764 | 72 | { | 72 | { |
766 | 73 | AwnApp *app; | 73 | AwnApplication *app; |
767 | 74 | GOptionContext *context; | 74 | GOptionContext *context; |
768 | 75 | DBusGConnection *connection; | 75 | DBusGConnection *connection; |
769 | 76 | DBusGProxy *proxy; | 76 | DBusGProxy *proxy; |
770 | @@ -147,10 +147,7 @@ | |||
771 | 147 | textdomain (GETTEXT_PACKAGE); | 147 | textdomain (GETTEXT_PACKAGE); |
772 | 148 | 148 | ||
773 | 149 | /* Launch Awn */ | 149 | /* Launch Awn */ |
778 | 150 | app = awn_app_get_default (); | 150 | app = awn_application_get_default (); |
775 | 151 | dbus_g_connection_register_g_object (connection, | ||
776 | 152 | AWN_DBUS_APP_PATH, | ||
777 | 153 | G_OBJECT (app)); | ||
779 | 154 | 151 | ||
780 | 155 | g_unsetenv ("DESKTOP_AUTOSTART_ID"); | 152 | g_unsetenv ("DESKTOP_AUTOSTART_ID"); |
781 | 156 | gtk_main (); | 153 | gtk_main (); |
782 | 157 | 154 | ||
783 | === modified file 'src/awn-monitor.c' | |||
784 | --- src/awn-monitor.c 2010-05-29 17:17:22 +0000 | |||
785 | +++ src/awn-monitor.c 2010-07-24 23:31:47 +0000 | |||
786 | @@ -242,6 +242,18 @@ | |||
787 | 242 | 242 | ||
788 | 243 | priv = AWN_MONITOR_GET_PRIVATE (object); | 243 | priv = AWN_MONITOR_GET_PRIVATE (object); |
789 | 244 | 244 | ||
790 | 245 | if (priv->size_signal_id) | ||
791 | 246 | { | ||
792 | 247 | g_signal_handler_disconnect (priv->screen, priv->size_signal_id); | ||
793 | 248 | priv->size_signal_id = 0; | ||
794 | 249 | } | ||
795 | 250 | |||
796 | 251 | if (priv->monitors_signal_id) | ||
797 | 252 | { | ||
798 | 253 | g_signal_handler_disconnect (priv->screen, priv->monitors_signal_id); | ||
799 | 254 | priv->monitors_signal_id = 0; | ||
800 | 255 | } | ||
801 | 256 | |||
802 | 245 | desktop_agnostic_config_client_unbind_all_for_object (priv->client, | 257 | desktop_agnostic_config_client_unbind_all_for_object (priv->client, |
803 | 246 | object, NULL); | 258 | object, NULL); |
804 | 247 | 259 | ||
805 | 248 | 260 | ||
806 | === removed file 'src/awn-panel-dbus.xml' | |||
807 | --- src/awn-panel-dbus.xml 2010-01-01 12:50:38 +0000 | |||
808 | +++ src/awn-panel-dbus.xml 1970-01-01 00:00:00 +0000 | |||
809 | @@ -1,102 +0,0 @@ | |||
810 | 1 | <?xml version="1.0"?> | ||
811 | 2 | <node name="/org/awnproject/Awn/Panel"> | ||
812 | 3 | <interface name="org.awnproject.Awn.Panel"> | ||
813 | 4 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="awn_panel"/> | ||
814 | 5 | |||
815 | 6 | <!-- Methods --> | ||
816 | 7 | <method name="AddApplet"> | ||
817 | 8 | <arg name="desktop_file" type="s" direction="in" /> | ||
818 | 9 | </method> | ||
819 | 10 | |||
820 | 11 | <method name="DeleteApplet"> | ||
821 | 12 | <arg name="uid" type="s" direction="in" /> | ||
822 | 13 | </method> | ||
823 | 14 | |||
824 | 15 | <method name="SetAppletFlags"> | ||
825 | 16 | <arg name="uid" type="s" direction="in" /> | ||
826 | 17 | <arg name="flags" type="i" direction="in" /> | ||
827 | 18 | </method> | ||
828 | 19 | |||
829 | 20 | <method name="InhibitAutohide"> | ||
830 | 21 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
831 | 22 | <arg name="app_name" type="s" direction="in" /> | ||
832 | 23 | <arg name="reason" type="s" direction="in" /> | ||
833 | 24 | <arg name="cookie" type="u" direction="out" /> | ||
834 | 25 | </method> | ||
835 | 26 | |||
836 | 27 | <method name="UninhibitAutohide"> | ||
837 | 28 | <arg name="cookie" type="u" direction="in" /> | ||
838 | 29 | </method> | ||
839 | 30 | |||
840 | 31 | <method name="GetInhibitors"> | ||
841 | 32 | <arg name="inhibitors" type="as" direction="out" /> | ||
842 | 33 | </method> | ||
843 | 34 | |||
844 | 35 | <method name="DockletRequest"> | ||
845 | 36 | <annotation name="org.freedesktop.DBus.GLib.Async" value=""/> | ||
846 | 37 | <arg name="min_size" type="i" direction="in" /> | ||
847 | 38 | <arg name="shrink" type="b" direction="in" /> | ||
848 | 39 | <arg name="expand" type="b" direction="in" /> | ||
849 | 40 | <arg name="window_id" type="x" direction="out" /> | ||
850 | 41 | </method> | ||
851 | 42 | |||
852 | 43 | <method name="GetSnapshot"> | ||
853 | 44 | <arg name="pixbuf" type="v" direction="out" /> | ||
854 | 45 | </method> | ||
855 | 46 | |||
856 | 47 | <!-- Signals --> | ||
857 | 48 | <signal name="SizeChanged"> | ||
858 | 49 | <arg name="size" type="i" /> | ||
859 | 50 | </signal> | ||
860 | 51 | |||
861 | 52 | <signal name="PositionChanged"> | ||
862 | 53 | <arg name="position" type="i" /> | ||
863 | 54 | </signal> | ||
864 | 55 | |||
865 | 56 | <signal name="OffsetChanged"> | ||
866 | 57 | <arg name="offset" type="i" /> | ||
867 | 58 | </signal> | ||
868 | 59 | |||
869 | 60 | <signal name="PropertyChanged"> | ||
870 | 61 | <arg name="uid" type="s" /> | ||
871 | 62 | <arg name="prop-name" type="s" /> | ||
872 | 63 | <arg name="value" type="v" /> | ||
873 | 64 | </signal> | ||
874 | 65 | |||
875 | 66 | <signal name="DestroyNotify"></signal> | ||
876 | 67 | |||
877 | 68 | <signal name="DestroyApplet"> | ||
878 | 69 | <arg name="uid" type="s" /> | ||
879 | 70 | </signal> | ||
880 | 71 | |||
881 | 72 | <!-- Properties --> | ||
882 | 73 | <property name="Size" type="i" access="read" /> | ||
883 | 74 | <property name="MaxSize" type="i" access="read" /> | ||
884 | 75 | <property name="Position" type="i" access="read" /> | ||
885 | 76 | <property name="Offset" type="i" access="read" /> | ||
886 | 77 | <property name="PathType" type="i" access="read" /> | ||
887 | 78 | <property name="OffsetModifier" type="d" access="read" /> | ||
888 | 79 | <property name="PanelXid" type="x" access="read" /> | ||
889 | 80 | |||
890 | 81 | </interface> | ||
891 | 82 | |||
892 | 83 | <interface name="org.awnproject.Awn.UA"> | ||
893 | 84 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="awn_panel"/> | ||
894 | 85 | |||
895 | 86 | <!-- Methods --> | ||
896 | 87 | <method name="add_applet"> | ||
897 | 88 | <annotation name="org.freedesktop.DBus.GLib.CSymbol" value="awn_panel_ua_add_applet"/> | ||
898 | 89 | <arg name="name" type="s" direction="in" /> | ||
899 | 90 | <arg name="uid" type="x" direction="in" /> | ||
900 | 91 | <arg name="width" type="i" direction="in" /> | ||
901 | 92 | <arg name="height" type="i" direction="in" /> | ||
902 | 93 | <arg name="size_type" type="s" direction="in" /> | ||
903 | 94 | </method> | ||
904 | 95 | |||
905 | 96 | <method name="get_all_server_flags"> | ||
906 | 97 | <arg name="name" type="s" direction="in" /> | ||
907 | 98 | <arg name="hash" type="a{ss}" direction="out" /> | ||
908 | 99 | </method> | ||
909 | 100 | |||
910 | 101 | </interface> | ||
911 | 102 | </node> | ||
912 | 103 | 0 | ||
913 | === added file 'src/awn-panel-dispatcher.vala' | |||
914 | --- src/awn-panel-dispatcher.vala 1970-01-01 00:00:00 +0000 | |||
915 | +++ src/awn-panel-dispatcher.vala 2010-07-24 23:31:47 +0000 | |||
916 | @@ -0,0 +1,222 @@ | |||
917 | 1 | /* | ||
918 | 2 | * Copyright (C) 2010 Michal Hruby <michal.mhr@gmail.com> | ||
919 | 3 | * | ||
920 | 4 | * This program is free software; you can redistribute it and/or modify | ||
921 | 5 | * it under the terms of the GNU General Public License as published by | ||
922 | 6 | * the Free Software Foundation; either version 2 of the License, or | ||
923 | 7 | * (at your option) any later version. | ||
924 | 8 | * | ||
925 | 9 | * This program is distributed in the hope that it will be useful, | ||
926 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
927 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
928 | 12 | * GNU General Public License for more details. | ||
929 | 13 | * | ||
930 | 14 | * You should have received a copy of the GNU General Public License | ||
931 | 15 | * along with this program; if not, write to the Free Software | ||
932 | 16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
933 | 17 | * | ||
934 | 18 | * Authored by Michal Hruby <michal.mhr@gmail.com> | ||
935 | 19 | * | ||
936 | 20 | */ | ||
937 | 21 | |||
938 | 22 | namespace Awn | ||
939 | 23 | { | ||
940 | 24 | public struct ImageStruct | ||
941 | 25 | { | ||
942 | 26 | int width; | ||
943 | 27 | int height; | ||
944 | 28 | int rowstride; | ||
945 | 29 | bool has_alpha; | ||
946 | 30 | int bits_per_sample; | ||
947 | 31 | int num_channels; | ||
948 | 32 | char[] pixel_data; | ||
949 | 33 | } | ||
950 | 34 | |||
951 | 35 | [DBus (name="org.awnproject.Awn.Panel")] | ||
952 | 36 | public interface PanelDBusInterface: Object | ||
953 | 37 | { | ||
954 | 38 | public abstract void add_applet (string desktop_file) throws DBus.Error; | ||
955 | 39 | public abstract void delete_applet (string uid) throws DBus.Error; | ||
956 | 40 | |||
957 | 41 | public abstract int64 docklet_request (int min_size, | ||
958 | 42 | bool shrink, | ||
959 | 43 | bool expand) throws DBus.Error; | ||
960 | 44 | |||
961 | 45 | public abstract string[] get_inhibitors () throws DBus.Error; | ||
962 | 46 | public abstract ImageStruct get_snapshot () throws DBus.Error; | ||
963 | 47 | |||
964 | 48 | public abstract uint inhibit_autohide (DBus.BusName sender, | ||
965 | 49 | string app_name, | ||
966 | 50 | string reason) throws DBus.Error; | ||
967 | 51 | public abstract void uninhibit_autohide (uint cookie) throws DBus.Error; | ||
968 | 52 | |||
969 | 53 | // FIXME: do we really need this? | ||
970 | 54 | public abstract void set_applet_flags (string uid, | ||
971 | 55 | int flags) throws DBus.Error; | ||
972 | 56 | |||
973 | 57 | public abstract double offset_modifier { get; } | ||
974 | 58 | public abstract int max_size { get; } | ||
975 | 59 | public abstract int offset { get; set; } | ||
976 | 60 | public abstract int path_type { get; } | ||
977 | 61 | public abstract int position { get; set; } | ||
978 | 62 | public abstract int size { get; set; } | ||
979 | 63 | public abstract int64 panel_xid { get; } | ||
980 | 64 | |||
981 | 65 | public signal void destroy_applet (string uid); | ||
982 | 66 | public signal void destroy_notify (); | ||
983 | 67 | public signal void property_changed (string prop_name, Value value); | ||
984 | 68 | } | ||
985 | 69 | |||
986 | 70 | public class PanelDispatcher: Object, PanelDBusInterface | ||
987 | 71 | { | ||
988 | 72 | public unowned Panel panel { get; construct; } | ||
989 | 73 | |||
990 | 74 | public PanelDispatcher (Panel panel) | ||
991 | 75 | { | ||
992 | 76 | Object (panel: panel); | ||
993 | 77 | |||
994 | 78 | panel.size_changed.connect ( (p, s) => | ||
995 | 79 | { | ||
996 | 80 | this.property_changed ("size", s); | ||
997 | 81 | }); | ||
998 | 82 | panel.position_changed.connect ( (p, pos) => | ||
999 | 83 | { | ||
1000 | 84 | this.property_changed ("position", pos); | ||
1001 | 85 | }); | ||
1002 | 86 | panel.offset_changed.connect ( (p, o) => | ||
1003 | 87 | { | ||
1004 | 88 | this.property_changed ("offset", o); | ||
1005 | 89 | }); | ||
1006 | 90 | panel.property_changed.connect ( (p, pn, v) => | ||
1007 | 91 | { | ||
1008 | 92 | this.property_changed (pn, v); | ||
1009 | 93 | }); | ||
1010 | 94 | |||
1011 | 95 | var conn = DBus.Bus.get (DBus.BusType.SESSION); | ||
1012 | 96 | string obj_path = "/org/awnproject/Awn/Panel%d".printf(panel.panel_id); | ||
1013 | 97 | conn.register_object (obj_path, this); | ||
1014 | 98 | } | ||
1015 | 99 | |||
1016 | 100 | public void add_applet (string desktop_file) throws DBus.Error | ||
1017 | 101 | { | ||
1018 | 102 | panel.add_applet (desktop_file); | ||
1019 | 103 | } | ||
1020 | 104 | public void delete_applet (string uid) throws DBus.Error | ||
1021 | 105 | { | ||
1022 | 106 | panel.delete_applet (uid); | ||
1023 | 107 | } | ||
1024 | 108 | |||
1025 | 109 | // FIXME: break this API and add the docklet flags from | ||
1026 | 110 | // set_applet_flags () method here | ||
1027 | 111 | public int64 docklet_request (int min_size, bool shrink, bool expand) throws DBus.Error | ||
1028 | 112 | { | ||
1029 | 113 | return panel.docklet_request (min_size, shrink, expand); | ||
1030 | 114 | } | ||
1031 | 115 | |||
1032 | 116 | public string[] get_inhibitors () throws DBus.Error | ||
1033 | 117 | { | ||
1034 | 118 | string[] reasons = panel.get_inhibitors (); | ||
1035 | 119 | |||
1036 | 120 | return reasons; | ||
1037 | 121 | } | ||
1038 | 122 | |||
1039 | 123 | public ImageStruct get_snapshot () throws DBus.Error | ||
1040 | 124 | { | ||
1041 | 125 | var result = ImageStruct (); | ||
1042 | 126 | panel.get_snapshot (out result.width, | ||
1043 | 127 | out result.height, | ||
1044 | 128 | out result.rowstride, | ||
1045 | 129 | out result.has_alpha, | ||
1046 | 130 | out result.bits_per_sample, | ||
1047 | 131 | out result.num_channels, | ||
1048 | 132 | out result.pixel_data); | ||
1049 | 133 | |||
1050 | 134 | return result; | ||
1051 | 135 | } | ||
1052 | 136 | |||
1053 | 137 | public uint inhibit_autohide (DBus.BusName sender, | ||
1054 | 138 | string app_name, | ||
1055 | 139 | string reason) throws DBus.Error | ||
1056 | 140 | { | ||
1057 | 141 | return panel.inhibit_autohide (sender, app_name, reason); | ||
1058 | 142 | } | ||
1059 | 143 | |||
1060 | 144 | public void uninhibit_autohide (uint cookie) throws DBus.Error | ||
1061 | 145 | { | ||
1062 | 146 | panel.uninhibit_autohide (cookie); | ||
1063 | 147 | } | ||
1064 | 148 | |||
1065 | 149 | public void set_applet_flags (string uid, int flags) throws DBus.Error | ||
1066 | 150 | { | ||
1067 | 151 | panel.set_applet_flags (uid, flags); | ||
1068 | 152 | } | ||
1069 | 153 | |||
1070 | 154 | public double offset_modifier | ||
1071 | 155 | { | ||
1072 | 156 | get | ||
1073 | 157 | { | ||
1074 | 158 | return panel.offset_modifier; | ||
1075 | 159 | } | ||
1076 | 160 | } | ||
1077 | 161 | |||
1078 | 162 | public int max_size | ||
1079 | 163 | { | ||
1080 | 164 | get | ||
1081 | 165 | { | ||
1082 | 166 | return panel.max_size; | ||
1083 | 167 | } | ||
1084 | 168 | } | ||
1085 | 169 | |||
1086 | 170 | public int offset | ||
1087 | 171 | { | ||
1088 | 172 | get | ||
1089 | 173 | { | ||
1090 | 174 | return panel.offset; | ||
1091 | 175 | } | ||
1092 | 176 | set | ||
1093 | 177 | { | ||
1094 | 178 | panel.offset = value; | ||
1095 | 179 | } | ||
1096 | 180 | } | ||
1097 | 181 | |||
1098 | 182 | public int path_type | ||
1099 | 183 | { | ||
1100 | 184 | get | ||
1101 | 185 | { | ||
1102 | 186 | return panel.path_type; | ||
1103 | 187 | } | ||
1104 | 188 | } | ||
1105 | 189 | |||
1106 | 190 | public int position | ||
1107 | 191 | { | ||
1108 | 192 | get | ||
1109 | 193 | { | ||
1110 | 194 | return panel.position; | ||
1111 | 195 | } | ||
1112 | 196 | set | ||
1113 | 197 | { | ||
1114 | 198 | panel.position = value; | ||
1115 | 199 | } | ||
1116 | 200 | } | ||
1117 | 201 | |||
1118 | 202 | public int size | ||
1119 | 203 | { | ||
1120 | 204 | get | ||
1121 | 205 | { | ||
1122 | 206 | return panel.size; | ||
1123 | 207 | } | ||
1124 | 208 | set | ||
1125 | 209 | { | ||
1126 | 210 | panel.size = value; | ||
1127 | 211 | } | ||
1128 | 212 | } | ||
1129 | 213 | |||
1130 | 214 | public int64 panel_xid | ||
1131 | 215 | { | ||
1132 | 216 | get | ||
1133 | 217 | { | ||
1134 | 218 | return panel.panel_xid; | ||
1135 | 219 | } | ||
1136 | 220 | } | ||
1137 | 221 | } | ||
1138 | 222 | } | ||
1139 | 0 | 223 | ||
1140 | === modified file 'src/awn-panel.c' | |||
1141 | --- src/awn-panel.c 2010-07-07 15:40:09 +0000 | |||
1142 | +++ src/awn-panel.c 2010-07-24 23:31:47 +0000 | |||
1143 | @@ -48,6 +48,7 @@ | |||
1144 | 48 | #include "awn-defines.h" | 48 | #include "awn-defines.h" |
1145 | 49 | #include "awn-marshal.h" | 49 | #include "awn-marshal.h" |
1146 | 50 | #include "awn-monitor.h" | 50 | #include "awn-monitor.h" |
1147 | 51 | #include "awn-panel-dispatcher.h" | ||
1148 | 51 | #include "awn-throbber.h" | 52 | #include "awn-throbber.h" |
1149 | 52 | #include "awn-x.h" | 53 | #include "awn-x.h" |
1150 | 53 | 54 | ||
1151 | @@ -68,6 +69,7 @@ | |||
1152 | 68 | GHashTable *inhibits; | 69 | GHashTable *inhibits; |
1153 | 69 | guint startup_inhibit_cookie; | 70 | guint startup_inhibit_cookie; |
1154 | 70 | 71 | ||
1155 | 72 | AwnPanelDispatcher *dbus_proxy; | ||
1156 | 71 | AwnBackground *bg; | 73 | AwnBackground *bg; |
1157 | 72 | 74 | ||
1158 | 73 | GtkWidget *alignment; | 75 | GtkWidget *alignment; |
1159 | @@ -296,7 +298,9 @@ | |||
1160 | 296 | GdkEventButton *event); | 298 | GdkEventButton *event); |
1161 | 297 | static gboolean awn_panel_resize_timeout (gpointer data); | 299 | static gboolean awn_panel_resize_timeout (gpointer data); |
1162 | 298 | 300 | ||
1164 | 299 | static void awn_panel_add (GtkContainer *window, | 301 | static void awn_panel_add (GtkContainer *window, |
1165 | 302 | GtkWidget *widget); | ||
1166 | 303 | static void awn_panel_remove (GtkContainer *window, | ||
1167 | 300 | GtkWidget *widget); | 304 | GtkWidget *widget); |
1168 | 301 | 305 | ||
1169 | 302 | static void awn_panel_set_offset (AwnPanel *panel, | 306 | static void awn_panel_set_offset (AwnPanel *panel, |
1170 | @@ -362,6 +366,11 @@ | |||
1171 | 362 | static gboolean awn_panel_set_drag_proxy (AwnPanel *panel, | 366 | static gboolean awn_panel_set_drag_proxy (AwnPanel *panel, |
1172 | 363 | gboolean check_mouse_pos); | 367 | gboolean check_mouse_pos); |
1173 | 364 | 368 | ||
1174 | 369 | static void dbus_inhibitor_lost (AwnDBusWatcher *watcher, | ||
1175 | 370 | gchar *name, | ||
1176 | 371 | AwnInhibitItem *item); | ||
1177 | 372 | |||
1178 | 373 | |||
1179 | 365 | /* | 374 | /* |
1180 | 366 | * GOBJECT CODE | 375 | * GOBJECT CODE |
1181 | 367 | */ | 376 | */ |
1182 | @@ -494,6 +503,7 @@ | |||
1183 | 494 | return priv->dnd_proxy_win != NULL; | 503 | return priv->dnd_proxy_win != NULL; |
1184 | 495 | } | 504 | } |
1185 | 496 | 505 | ||
1186 | 506 | #if !GTK_CHECK_VERSION(2, 19, 5) | ||
1187 | 497 | static gboolean | 507 | static gboolean |
1188 | 498 | awn_panel_drag_motion (GtkWidget *widget, GdkDragContext *context, | 508 | awn_panel_drag_motion (GtkWidget *widget, GdkDragContext *context, |
1189 | 499 | gint x, gint y, guint time_) | 509 | gint x, gint y, guint time_) |
1190 | @@ -512,6 +522,7 @@ | |||
1191 | 512 | 522 | ||
1192 | 513 | return TRUE; | 523 | return TRUE; |
1193 | 514 | } | 524 | } |
1194 | 525 | #endif | ||
1195 | 515 | 526 | ||
1196 | 516 | static gboolean | 527 | static gboolean |
1197 | 517 | on_startup_complete (AwnPanel *panel) | 528 | on_startup_complete (AwnPanel *panel) |
1198 | @@ -606,6 +617,9 @@ | |||
1199 | 606 | G_CALLBACK (on_window_state_event), NULL); | 617 | G_CALLBACK (on_window_state_event), NULL); |
1200 | 607 | g_signal_connect (panel, "delete-event", | 618 | g_signal_connect (panel, "delete-event", |
1201 | 608 | G_CALLBACK (gtk_true), NULL); | 619 | G_CALLBACK (gtk_true), NULL); |
1202 | 620 | |||
1203 | 621 | /* DBus interface */ | ||
1204 | 622 | priv->dbus_proxy = awn_panel_dispatcher_new (AWN_PANEL (object)); | ||
1205 | 609 | 623 | ||
1206 | 610 | /* Contents */ | 624 | /* Contents */ |
1207 | 611 | priv->manager = awn_applet_manager_new_from_config (priv->client); | 625 | priv->manager = awn_applet_manager_new_from_config (priv->client); |
1208 | @@ -1299,6 +1313,11 @@ | |||
1209 | 1299 | { | 1313 | { |
1210 | 1300 | AwnInhibitItem *item = data; | 1314 | AwnInhibitItem *item = data; |
1211 | 1301 | 1315 | ||
1212 | 1316 | // remove the dbus watcher | ||
1213 | 1317 | g_signal_handlers_disconnect_by_func (awn_dbus_watcher_get_default (), | ||
1214 | 1318 | G_CALLBACK (dbus_inhibitor_lost), | ||
1215 | 1319 | item); | ||
1216 | 1320 | |||
1217 | 1302 | if (item->description) g_free (item->description); | 1321 | if (item->description) g_free (item->description); |
1218 | 1303 | 1322 | ||
1219 | 1304 | g_free (item); | 1323 | g_free (item); |
1220 | @@ -1352,7 +1371,7 @@ | |||
1221 | 1352 | static gboolean awn_panel_check_mouse_pos (AwnPanel *panel, | 1371 | static gboolean awn_panel_check_mouse_pos (AwnPanel *panel, |
1222 | 1353 | MouseCheckType check_type) | 1372 | MouseCheckType check_type) |
1223 | 1354 | { | 1373 | { |
1225 | 1355 | g_return_val_if_fail(AWN_IS_PANEL(panel), FALSE); | 1374 | g_return_val_if_fail (AWN_IS_PANEL (panel), FALSE); |
1226 | 1356 | 1375 | ||
1227 | 1357 | GtkWidget *widget = GTK_WIDGET (panel); | 1376 | GtkWidget *widget = GTK_WIDGET (panel); |
1228 | 1358 | AwnPanelPrivate *priv = panel->priv; | 1377 | AwnPanelPrivate *priv = panel->priv; |
1229 | @@ -1361,8 +1380,14 @@ | |||
1230 | 1361 | 1380 | ||
1231 | 1362 | gint x, y, window_x, window_y, width, height; | 1381 | gint x, y, window_x, window_y, width, height; |
1232 | 1363 | /* FIXME: probably needs some love to work on multiple monitors */ | 1382 | /* FIXME: probably needs some love to work on multiple monitors */ |
1233 | 1383 | panel_win = gtk_widget_get_window (widget); | ||
1234 | 1384 | |||
1235 | 1385 | if (!panel_win) | ||
1236 | 1386 | { | ||
1237 | 1387 | return FALSE; | ||
1238 | 1388 | } | ||
1239 | 1389 | |||
1240 | 1364 | gdk_display_get_pointer (gdk_display_get_default (), NULL, &x, &y, NULL); | 1390 | gdk_display_get_pointer (gdk_display_get_default (), NULL, &x, &y, NULL); |
1241 | 1365 | panel_win = gtk_widget_get_window (widget); | ||
1242 | 1366 | gdk_window_get_root_origin (panel_win, &window_x, &window_y); | 1391 | gdk_window_get_root_origin (panel_win, &window_x, &window_y); |
1243 | 1367 | 1392 | ||
1244 | 1368 | switch (check_type) | 1393 | switch (check_type) |
1245 | @@ -1535,7 +1560,7 @@ | |||
1246 | 1535 | static gboolean | 1560 | static gboolean |
1247 | 1536 | autohide_start_timeout (gpointer data) | 1561 | autohide_start_timeout (gpointer data) |
1248 | 1537 | { | 1562 | { |
1250 | 1538 | g_return_val_if_fail(AWN_IS_PANEL(data), FALSE); | 1563 | g_return_val_if_fail (AWN_IS_PANEL (data), FALSE); |
1251 | 1539 | gboolean signal_ret = FALSE; | 1564 | gboolean signal_ret = FALSE; |
1252 | 1540 | 1565 | ||
1253 | 1541 | AwnPanel *panel = AWN_PANEL (data); | 1566 | AwnPanel *panel = AWN_PANEL (data); |
1254 | @@ -1733,6 +1758,12 @@ | |||
1255 | 1733 | priv->resize_timer_id = 0; | 1758 | priv->resize_timer_id = 0; |
1256 | 1734 | } | 1759 | } |
1257 | 1735 | 1760 | ||
1258 | 1761 | if (priv->dbus_proxy) | ||
1259 | 1762 | { | ||
1260 | 1763 | g_object_unref (priv->dbus_proxy); | ||
1261 | 1764 | priv->dbus_proxy = NULL; | ||
1262 | 1765 | } | ||
1263 | 1766 | |||
1264 | 1736 | desktop_agnostic_config_client_unbind_all_for_object (priv->client, | 1767 | desktop_agnostic_config_client_unbind_all_for_object (priv->client, |
1265 | 1737 | object, NULL); | 1768 | object, NULL); |
1266 | 1738 | 1769 | ||
1267 | @@ -1750,11 +1781,15 @@ | |||
1268 | 1750 | priv->inhibits = NULL; | 1781 | priv->inhibits = NULL; |
1269 | 1751 | } | 1782 | } |
1270 | 1752 | 1783 | ||
1271 | 1784 | if (priv->monitor) | ||
1272 | 1785 | { | ||
1273 | 1786 | g_object_unref (priv->monitor); | ||
1274 | 1787 | priv->monitor = NULL; | ||
1275 | 1788 | } | ||
1276 | 1789 | |||
1277 | 1753 | G_OBJECT_CLASS (awn_panel_parent_class)->finalize (object); | 1790 | G_OBJECT_CLASS (awn_panel_parent_class)->finalize (object); |
1278 | 1754 | } | 1791 | } |
1279 | 1755 | 1792 | ||
1280 | 1756 | #include "awn-panel-glue.h" | ||
1281 | 1757 | |||
1282 | 1758 | static void | 1793 | static void |
1283 | 1759 | awn_panel_class_init (AwnPanelClass *klass) | 1794 | awn_panel_class_init (AwnPanelClass *klass) |
1284 | 1760 | { | 1795 | { |
1285 | @@ -1769,6 +1804,7 @@ | |||
1286 | 1769 | obj_class->set_property = awn_panel_set_property; | 1804 | obj_class->set_property = awn_panel_set_property; |
1287 | 1770 | 1805 | ||
1288 | 1771 | cont_class->add = awn_panel_add; | 1806 | cont_class->add = awn_panel_add; |
1289 | 1807 | cont_class->remove = awn_panel_remove; | ||
1290 | 1772 | 1808 | ||
1291 | 1773 | wid_class->expose_event = awn_panel_expose; | 1809 | wid_class->expose_event = awn_panel_expose; |
1292 | 1774 | wid_class->show = awn_panel_show; | 1810 | wid_class->show = awn_panel_show; |
1293 | @@ -2024,9 +2060,6 @@ | |||
1294 | 2024 | 0); | 2060 | 0); |
1295 | 2025 | 2061 | ||
1296 | 2026 | g_type_class_add_private (obj_class, sizeof (AwnPanelPrivate)); | 2062 | g_type_class_add_private (obj_class, sizeof (AwnPanelPrivate)); |
1297 | 2027 | |||
1298 | 2028 | dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass), | ||
1299 | 2029 | &dbus_glib_awn_panel_object_info); | ||
1300 | 2030 | } | 2063 | } |
1301 | 2031 | 2064 | ||
1302 | 2032 | static gboolean | 2065 | static gboolean |
1303 | @@ -2927,6 +2960,28 @@ | |||
1304 | 2927 | } | 2960 | } |
1305 | 2928 | 2961 | ||
1306 | 2929 | static void | 2962 | static void |
1307 | 2963 | awn_panel_remove (GtkContainer *panel, GtkWidget *widget) | ||
1308 | 2964 | { | ||
1309 | 2965 | AwnPanelPrivate *priv; | ||
1310 | 2966 | |||
1311 | 2967 | g_return_if_fail (AWN_IS_PANEL (panel)); | ||
1312 | 2968 | g_return_if_fail (GTK_IS_WIDGET (widget)); | ||
1313 | 2969 | priv = AWN_PANEL (panel)->priv; | ||
1314 | 2970 | |||
1315 | 2971 | if (widget == priv->eventbox) | ||
1316 | 2972 | { | ||
1317 | 2973 | /* the eventbox was added using the base method, | ||
1318 | 2974 | so it also has to be removed using that way */ | ||
1319 | 2975 | GtkContainerClass *klass = GTK_CONTAINER_CLASS (awn_panel_parent_class); | ||
1320 | 2976 | klass->remove (GTK_CONTAINER (panel), widget); | ||
1321 | 2977 | } | ||
1322 | 2978 | else | ||
1323 | 2979 | { | ||
1324 | 2980 | gtk_container_remove (GTK_CONTAINER (priv->viewport), widget); | ||
1325 | 2981 | } | ||
1326 | 2982 | } | ||
1327 | 2983 | |||
1328 | 2984 | static void | ||
1329 | 2930 | on_theme_changed (AwnBackground *bg, AwnPanel *panel) | 2985 | on_theme_changed (AwnBackground *bg, AwnPanel *panel) |
1330 | 2931 | { | 2986 | { |
1331 | 2932 | g_return_if_fail (AWN_IS_BACKGROUND (bg)); | 2987 | g_return_if_fail (AWN_IS_BACKGROUND (bg)); |
1332 | @@ -3213,9 +3268,9 @@ | |||
1333 | 3213 | if (offset_mod != 1.0) | 3268 | if (offset_mod != 1.0) |
1334 | 3214 | { | 3269 | { |
1335 | 3215 | GValue mod_value = {0}; | 3270 | GValue mod_value = {0}; |
1337 | 3216 | g_value_init (&mod_value, G_TYPE_FLOAT); | 3271 | g_value_init (&mod_value, G_TYPE_DOUBLE); |
1338 | 3217 | /* FIXME: we also need to calculate our dimensions based on offset_mod */ | 3272 | /* FIXME: we also need to calculate our dimensions based on offset_mod */ |
1340 | 3218 | g_value_set_float (&mod_value, offset_mod); | 3273 | g_value_set_double (&mod_value, offset_mod); |
1341 | 3219 | 3274 | ||
1342 | 3220 | priv->offset_mod = offset_mod; | 3275 | priv->offset_mod = offset_mod; |
1343 | 3221 | g_object_notify (G_OBJECT (panel), "offset-modifier"); | 3276 | g_object_notify (G_OBJECT (panel), "offset-modifier"); |
1344 | @@ -3674,11 +3729,11 @@ | |||
1345 | 3674 | awn_panel_uninhibit_autohide (item->panel, item->cookie); | 3729 | awn_panel_uninhibit_autohide (item->panel, item->cookie); |
1346 | 3675 | } | 3730 | } |
1347 | 3676 | 3731 | ||
1349 | 3677 | void | 3732 | guint |
1350 | 3678 | awn_panel_inhibit_autohide (AwnPanel *panel, | 3733 | awn_panel_inhibit_autohide (AwnPanel *panel, |
1351 | 3734 | const gchar *sender, | ||
1352 | 3679 | const gchar *app_name, | 3735 | const gchar *app_name, |
1355 | 3680 | const gchar *reason, | 3736 | const gchar *reason) |
1354 | 3681 | DBusGMethodInvocation *context) | ||
1356 | 3682 | { | 3737 | { |
1357 | 3683 | AwnPanelPrivate *priv = panel->priv; | 3738 | AwnPanelPrivate *priv = panel->priv; |
1358 | 3684 | 3739 | ||
1359 | @@ -3686,7 +3741,6 @@ | |||
1360 | 3686 | 3741 | ||
1361 | 3687 | // watch the sender on dbus and remove all its inhibits when it | 3742 | // watch the sender on dbus and remove all its inhibits when it |
1362 | 3688 | // disappears (to be sure that we don't misbehave due to crashing app) | 3743 | // disappears (to be sure that we don't misbehave due to crashing app) |
1363 | 3689 | gchar *sender = dbus_g_method_get_sender (context); | ||
1364 | 3690 | gchar *detailed_signal = g_strdup_printf ("name-disappeared::%s", sender); | 3744 | gchar *detailed_signal = g_strdup_printf ("name-disappeared::%s", sender); |
1365 | 3691 | g_signal_connect (awn_dbus_watcher_get_default (), detailed_signal, | 3745 | g_signal_connect (awn_dbus_watcher_get_default (), detailed_signal, |
1366 | 3692 | G_CALLBACK (dbus_inhibitor_lost), | 3746 | G_CALLBACK (dbus_inhibitor_lost), |
1367 | @@ -3694,9 +3748,8 @@ | |||
1368 | 3694 | GINT_TO_POINTER (cookie))); | 3748 | GINT_TO_POINTER (cookie))); |
1369 | 3695 | 3749 | ||
1370 | 3696 | g_free (detailed_signal); | 3750 | g_free (detailed_signal); |
1371 | 3697 | g_free (sender); | ||
1372 | 3698 | 3751 | ||
1374 | 3699 | dbus_g_method_return (context, cookie); | 3752 | return cookie; |
1375 | 3700 | } | 3753 | } |
1376 | 3701 | 3754 | ||
1377 | 3702 | gboolean | 3755 | gboolean |
1378 | @@ -3709,11 +3762,6 @@ | |||
1379 | 3709 | 3762 | ||
1380 | 3710 | if (!item) return TRUE; // we could set an error | 3763 | if (!item) return TRUE; // we could set an error |
1381 | 3711 | 3764 | ||
1382 | 3712 | // remove the dbus watcher | ||
1383 | 3713 | g_signal_handlers_disconnect_by_func (awn_dbus_watcher_get_default (), | ||
1384 | 3714 | G_CALLBACK (dbus_inhibitor_lost), | ||
1385 | 3715 | item); | ||
1386 | 3716 | |||
1387 | 3717 | g_hash_table_remove (priv->inhibits, GINT_TO_POINTER (cookie)); | 3765 | g_hash_table_remove (priv->inhibits, GINT_TO_POINTER (cookie)); |
1388 | 3718 | 3766 | ||
1389 | 3719 | if (g_hash_table_size (priv->inhibits) == 0) | 3767 | if (g_hash_table_size (priv->inhibits) == 0) |
1390 | @@ -3730,13 +3778,14 @@ | |||
1391 | 3730 | return TRUE; | 3778 | return TRUE; |
1392 | 3731 | } | 3779 | } |
1393 | 3732 | 3780 | ||
1396 | 3733 | gboolean | 3781 | GStrv |
1397 | 3734 | awn_panel_get_inhibitors (AwnPanel *panel, GStrv *reasons) | 3782 | awn_panel_get_inhibitors (AwnPanel *panel) |
1398 | 3735 | { | 3783 | { |
1399 | 3736 | AwnPanelPrivate *priv = panel->priv; | 3784 | AwnPanelPrivate *priv = panel->priv; |
1400 | 3737 | GList *list, *l; | 3785 | GList *list, *l; |
1401 | 3786 | GStrv reasons; | ||
1402 | 3738 | 3787 | ||
1404 | 3739 | *reasons = g_new0 (char*, g_hash_table_size (priv->inhibits) + 1); | 3788 | reasons = g_new0 (char*, g_hash_table_size (priv->inhibits) + 1); |
1405 | 3740 | 3789 | ||
1406 | 3741 | list = l = g_hash_table_get_values (priv->inhibits); // list should be freed | 3790 | list = l = g_hash_table_get_values (priv->inhibits); // list should be freed |
1407 | 3742 | int i=0; | 3791 | int i=0; |
1408 | @@ -3744,14 +3793,14 @@ | |||
1409 | 3744 | while (list) | 3793 | while (list) |
1410 | 3745 | { | 3794 | { |
1411 | 3746 | AwnInhibitItem *item = list->data; | 3795 | AwnInhibitItem *item = list->data; |
1413 | 3747 | (*reasons)[i++] = g_strdup (item->description); | 3796 | reasons[i++] = g_strdup (item->description); |
1414 | 3748 | 3797 | ||
1415 | 3749 | list = list->next; | 3798 | list = list->next; |
1416 | 3750 | } | 3799 | } |
1417 | 3751 | 3800 | ||
1418 | 3752 | g_list_free (l); | 3801 | g_list_free (l); |
1419 | 3753 | 3802 | ||
1421 | 3754 | return TRUE; | 3803 | return reasons; |
1422 | 3755 | } | 3804 | } |
1423 | 3756 | 3805 | ||
1424 | 3757 | static void | 3806 | static void |
1425 | @@ -3945,12 +3994,12 @@ | |||
1426 | 3945 | gtk_widget_hide (priv->docklet_closer); | 3994 | gtk_widget_hide (priv->docklet_closer); |
1427 | 3946 | } | 3995 | } |
1428 | 3947 | 3996 | ||
1430 | 3948 | void | 3997 | gint64 |
1431 | 3949 | awn_panel_docklet_request (AwnPanel *panel, | 3998 | awn_panel_docklet_request (AwnPanel *panel, |
1432 | 3950 | gint min_size, | 3999 | gint min_size, |
1433 | 3951 | gboolean shrink, | 4000 | gboolean shrink, |
1434 | 3952 | gboolean expand, | 4001 | gboolean expand, |
1436 | 3953 | DBusGMethodInvocation *context) | 4002 | GError **error) |
1437 | 3954 | { | 4003 | { |
1438 | 3955 | AwnPanelPrivate *priv = panel->priv; | 4004 | AwnPanelPrivate *priv = panel->priv; |
1439 | 3956 | GtkAllocation alloc; | 4005 | GtkAllocation alloc; |
1440 | @@ -4035,50 +4084,23 @@ | |||
1441 | 4035 | 4084 | ||
1442 | 4036 | window_id = gtk_socket_get_id (GTK_SOCKET (priv->docklet)); | 4085 | window_id = gtk_socket_get_id (GTK_SOCKET (priv->docklet)); |
1443 | 4037 | 4086 | ||
1482 | 4038 | dbus_g_method_return (context, window_id); | 4087 | return window_id; |
1445 | 4039 | } | ||
1446 | 4040 | |||
1447 | 4041 | static void | ||
1448 | 4042 | value_array_append_int (GValueArray *array, gint i) | ||
1449 | 4043 | { | ||
1450 | 4044 | GValue *value = g_new0 (GValue, 1); | ||
1451 | 4045 | |||
1452 | 4046 | g_value_init (value, G_TYPE_INT); | ||
1453 | 4047 | g_value_set_int (value, i); | ||
1454 | 4048 | |||
1455 | 4049 | g_value_array_append (array, value); | ||
1456 | 4050 | } | ||
1457 | 4051 | |||
1458 | 4052 | static void | ||
1459 | 4053 | value_array_append_bool (GValueArray *array, gboolean b) | ||
1460 | 4054 | { | ||
1461 | 4055 | GValue *value = g_new0 (GValue, 1); | ||
1462 | 4056 | |||
1463 | 4057 | g_value_init (value, G_TYPE_BOOLEAN); | ||
1464 | 4058 | g_value_set_boolean (value, b); | ||
1465 | 4059 | |||
1466 | 4060 | g_value_array_append (array, value); | ||
1467 | 4061 | } | ||
1468 | 4062 | |||
1469 | 4063 | static void | ||
1470 | 4064 | value_array_append_array (GValueArray *array, guchar *data, gsize data_len) | ||
1471 | 4065 | { | ||
1472 | 4066 | GArray *byte_array; | ||
1473 | 4067 | GValue *value = g_new0 (GValue, 1); | ||
1474 | 4068 | |||
1475 | 4069 | byte_array = g_array_sized_new (FALSE, FALSE, sizeof(guchar), data_len); | ||
1476 | 4070 | g_array_append_vals (byte_array, data, data_len); | ||
1477 | 4071 | |||
1478 | 4072 | g_value_init (value, dbus_g_type_get_collection ("GArray", G_TYPE_CHAR)); | ||
1479 | 4073 | g_value_take_boxed (value, byte_array); | ||
1480 | 4074 | |||
1481 | 4075 | g_value_array_append (array, value); | ||
1483 | 4076 | } | 4088 | } |
1484 | 4077 | 4089 | ||
1485 | 4078 | gboolean | 4090 | gboolean |
1487 | 4079 | awn_panel_get_snapshot (AwnPanel *panel, GValue *value, GError **error) | 4091 | awn_panel_get_snapshot (AwnPanel *panel, |
1488 | 4092 | gint *width, | ||
1489 | 4093 | gint *height, | ||
1490 | 4094 | gint *rowstride, | ||
1491 | 4095 | gboolean *has_alpha, | ||
1492 | 4096 | gint *bits_per_sample, | ||
1493 | 4097 | gint *num_channels, | ||
1494 | 4098 | gchar **pixels, | ||
1495 | 4099 | gint *pixels_length, | ||
1496 | 4100 | GError **error) | ||
1497 | 4080 | { | 4101 | { |
1498 | 4081 | GdkRectangle rect; | 4102 | GdkRectangle rect; |
1499 | 4103 | guint data_len; | ||
1500 | 4082 | g_return_val_if_fail (AWN_IS_PANEL (panel), FALSE); | 4104 | g_return_val_if_fail (AWN_IS_PANEL (panel), FALSE); |
1501 | 4083 | 4105 | ||
1502 | 4084 | awn_panel_get_draw_rect (panel, &rect, 0, 0); | 4106 | awn_panel_get_draw_rect (panel, &rect, 0, 0); |
1503 | @@ -4102,28 +4124,20 @@ | |||
1504 | 4102 | cairo_surface_flush (surface); | 4124 | cairo_surface_flush (surface); |
1505 | 4103 | 4125 | ||
1506 | 4104 | // stuff the pixbuf to our out param | 4126 | // stuff the pixbuf to our out param |
1512 | 4105 | gint width = rect.width; | 4127 | *width = rect.width; |
1513 | 4106 | gint height = rect.height; | 4128 | *height = rect.height; |
1514 | 4107 | gint rowstride = cairo_image_surface_get_stride (surface); | 4129 | *rowstride = cairo_image_surface_get_stride (surface); |
1515 | 4108 | gint n_channels = 4; | 4130 | *has_alpha = TRUE; |
1516 | 4109 | gint bits_per_sample = 8; | 4131 | *bits_per_sample = 8; |
1517 | 4132 | *num_channels = 4; | ||
1518 | 4133 | |||
1519 | 4134 | data_len = rect.height * cairo_image_surface_get_stride (surface); | ||
1520 | 4110 | //gint image_len = (height - 1) * rowstride + width * | 4135 | //gint image_len = (height - 1) * rowstride + width * |
1521 | 4111 | // ((n_channels * bits_per_sample + 7) / 8); | 4136 | // ((n_channels * bits_per_sample + 7) / 8); |
1522 | 4112 | 4137 | ||
1523 | 4113 | guchar *image = cairo_image_surface_get_data (surface); | 4138 | guchar *image = cairo_image_surface_get_data (surface); |
1537 | 4114 | 4139 | *pixels = g_memdup (image, data_len); | |
1538 | 4115 | GValueArray *image_struct = g_value_array_new (1); | 4140 | *pixels_length = data_len; |
1526 | 4116 | |||
1527 | 4117 | value_array_append_int (image_struct, width); | ||
1528 | 4118 | value_array_append_int (image_struct, height); | ||
1529 | 4119 | value_array_append_int (image_struct, rowstride); | ||
1530 | 4120 | value_array_append_bool (image_struct, TRUE); | ||
1531 | 4121 | value_array_append_int (image_struct, bits_per_sample); | ||
1532 | 4122 | value_array_append_int (image_struct, n_channels); | ||
1533 | 4123 | value_array_append_array (image_struct, image, height * rowstride); | ||
1534 | 4124 | |||
1535 | 4125 | g_value_init (value, G_TYPE_VALUE_ARRAY); | ||
1536 | 4126 | g_value_take_boxed (value, image_struct); | ||
1539 | 4127 | 4141 | ||
1540 | 4128 | cairo_surface_destroy (surface); | 4142 | cairo_surface_destroy (surface); |
1541 | 4129 | 4143 | ||
1542 | 4130 | 4144 | ||
1543 | === modified file 'src/awn-panel.h' | |||
1544 | --- src/awn-panel.h 2010-07-07 15:34:01 +0000 | |||
1545 | +++ src/awn-panel.h 2010-07-24 23:31:47 +0000 | |||
1546 | @@ -94,27 +94,33 @@ | |||
1547 | 94 | gint flags, | 94 | gint flags, |
1548 | 95 | GError **error); | 95 | GError **error); |
1549 | 96 | 96 | ||
1551 | 97 | void awn_panel_inhibit_autohide (AwnPanel *panel, | 97 | guint awn_panel_inhibit_autohide (AwnPanel *panel, |
1552 | 98 | const gchar *sender, | ||
1553 | 98 | const gchar *app_name, | 99 | const gchar *app_name, |
1556 | 99 | const gchar *reason, | 100 | const gchar *reason); |
1555 | 100 | DBusGMethodInvocation *context); | ||
1557 | 101 | 101 | ||
1558 | 102 | gboolean awn_panel_uninhibit_autohide (AwnPanel *panel, | 102 | gboolean awn_panel_uninhibit_autohide (AwnPanel *panel, |
1559 | 103 | guint cookie); | 103 | guint cookie); |
1560 | 104 | 104 | ||
1563 | 105 | gboolean awn_panel_get_inhibitors (AwnPanel *panel, | 105 | GStrv awn_panel_get_inhibitors (AwnPanel *panel); |
1562 | 106 | GStrv *reasons); | ||
1564 | 107 | 106 | ||
1566 | 108 | void awn_panel_docklet_request (AwnPanel *panel, | 107 | gint64 awn_panel_docklet_request (AwnPanel *panel, |
1567 | 109 | gint min_size, | 108 | gint min_size, |
1568 | 110 | gboolean shrink, | 109 | gboolean shrink, |
1569 | 111 | gboolean expand, | 110 | gboolean expand, |
1571 | 112 | DBusGMethodInvocation *context); | 111 | GError **error); |
1572 | 113 | 112 | ||
1573 | 114 | gboolean awn_panel_get_docklet_mode (AwnPanel *panel); | 113 | gboolean awn_panel_get_docklet_mode (AwnPanel *panel); |
1574 | 115 | 114 | ||
1575 | 116 | gboolean awn_panel_get_snapshot (AwnPanel *panel, | 115 | gboolean awn_panel_get_snapshot (AwnPanel *panel, |
1577 | 117 | GValue *value, | 116 | gint *width, |
1578 | 117 | gint *height, | ||
1579 | 118 | gint *rowstride, | ||
1580 | 119 | gboolean *has_alpha, | ||
1581 | 120 | gint *bits_per_sample, | ||
1582 | 121 | gint *num_channels, | ||
1583 | 122 | gchar **pixels, | ||
1584 | 123 | gint *pixels_length, | ||
1585 | 118 | GError **error); | 124 | GError **error); |
1586 | 119 | 125 | ||
1587 | 120 | gboolean awn_panel_get_all_server_flags(AwnPanel *panel, | 126 | gboolean awn_panel_get_all_server_flags(AwnPanel *panel, |
1588 | 121 | 127 | ||
1589 | === added file 'src/awn-panel.vapi' | |||
1590 | --- src/awn-panel.vapi 1970-01-01 00:00:00 +0000 | |||
1591 | +++ src/awn-panel.vapi 2010-07-24 23:31:47 +0000 | |||
1592 | @@ -0,0 +1,47 @@ | |||
1593 | 1 | /* awn-panel.vapi stub (manually generated) */ | ||
1594 | 2 | |||
1595 | 3 | [CCode (cprefix = "Awn", lower_case_cprefix = "awn_")] | ||
1596 | 4 | namespace Awn { | ||
1597 | 5 | [CCode (cheader_filename = "awn-panel.h")] | ||
1598 | 6 | public class Panel : Gtk.Window, Atk.Implementor, Gtk.Buildable { | ||
1599 | 7 | [CCode (type = "GtkWidget*", has_construct_function = false)] | ||
1600 | 8 | public Panel.with_panel_id (int panel_id); | ||
1601 | 9 | public bool add_applet (string desktop_file) throws GLib.Error; | ||
1602 | 10 | public bool delete_applet (string uid) throws GLib.Error; | ||
1603 | 11 | public bool set_applet_flags (string uid, int flags) throws GLib.Error; | ||
1604 | 12 | public uint inhibit_autohide (string sender, string app_name, string reason); | ||
1605 | 13 | public bool uninhibit_autohide (uint cookie); | ||
1606 | 14 | |||
1607 | 15 | [CCode (array_length = false, array_null_terminated = true)] | ||
1608 | 16 | public string[] get_inhibitors (); | ||
1609 | 17 | |||
1610 | 18 | public bool get_snapshot (out int width, out int height, out int rowstride, out bool has_alpha, out int bits_per_sample, out int num_channels, out char[] pixel_data) throws GLib.Error; | ||
1611 | 19 | |||
1612 | 20 | public int64 docklet_request (int min_size, bool shrink, bool expand) throws GLib.Error; | ||
1613 | 21 | |||
1614 | 22 | [NoAccessorMethod] | ||
1615 | 23 | public int panel_id { get; construct; } | ||
1616 | 24 | [NoAccessorMethod] | ||
1617 | 25 | public int64 panel_xid { get; } | ||
1618 | 26 | [NoAccessorMethod] | ||
1619 | 27 | public int position { get; set construct; } | ||
1620 | 28 | [NoAccessorMethod] | ||
1621 | 29 | public int size { get; set construct; } | ||
1622 | 30 | [NoAccessorMethod] | ||
1623 | 31 | public int offset { get; set construct; } | ||
1624 | 32 | [NoAccessorMethod] | ||
1625 | 33 | public int max_size { get; } | ||
1626 | 34 | [NoAccessorMethod] | ||
1627 | 35 | public int path_type { get; set construct; } | ||
1628 | 36 | [NoAccessorMethod] | ||
1629 | 37 | public float offset_modifier { get; set construct; } | ||
1630 | 38 | |||
1631 | 39 | public virtual signal void size_changed (int size); | ||
1632 | 40 | public virtual signal void position_changed (int position); | ||
1633 | 41 | public virtual signal void offset_changed (int offset); | ||
1634 | 42 | public virtual signal void property_changed (string prop_name, GLib.Value val); | ||
1635 | 43 | |||
1636 | 44 | public virtual signal void destroy_applet (string uid); | ||
1637 | 45 | public virtual signal void destroy_notify (); | ||
1638 | 46 | } | ||
1639 | 47 | } | ||
1640 | 0 | 48 | ||
1641 | === modified file 'tests/Makefile.am' | |||
1642 | --- tests/Makefile.am 2010-01-11 21:30:13 +0000 | |||
1643 | +++ tests/Makefile.am 2010-07-24 23:31:47 +0000 | |||
1644 | @@ -41,7 +41,6 @@ | |||
1645 | 41 | test-taskmanager-dnd.py \ | 41 | test-taskmanager-dnd.py \ |
1646 | 42 | test-taskmanager-windows.py | 42 | test-taskmanager-windows.py |
1647 | 43 | 43 | ||
1648 | 44 | if HAVE_VALA | ||
1649 | 45 | noinst_PROGRAMS += test-vala-awn-dialog | 44 | noinst_PROGRAMS += test-vala-awn-dialog |
1650 | 46 | 45 | ||
1651 | 47 | VALA_FILES = \ | 46 | VALA_FILES = \ |
1652 | @@ -58,4 +57,3 @@ | |||
1653 | 58 | 57 | ||
1654 | 59 | EXTRA_DIST += $(VALA_FILES) | 58 | EXTRA_DIST += $(VALA_FILES) |
1655 | 60 | CLEANFILES = test-vala-awn-dialog.c | 59 | CLEANFILES = test-vala-awn-dialog.c |
1656 | 61 | endif |
If those warnigs are not important, I approve :)
awn-panel- dispatcher. vala:84. 18-84.52: warning: unhandled error `DBus.Error' SESSION) ;
^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^ dispatcher. vala:91. 7-91.37: warning: unhandled error `GLib.Error' add_applet (desktop_file); ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^ dispatcher. vala:95. 7-95.31: warning: unhandled error `GLib.Error' delete_ applet (uid); ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^ dispatcher. vala:100. 14-100. 61: warning: unhandled error `GLib.Error' request (min_size, shrink, expand);
^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^ dispatcher. vala:113. 7-113.34: warning: unhandled error `GLib.Error' get_snapshot (out val); ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^^^^ vala:45. 21-45.42: warning: unhandled error `GLib.Error'
^ ^^^^^^^ ^^^^^^^ ^^^^^^^ vala:49. 25-49.49: warning: unhandled error `DBus.Error' connection = Bus.get (BusType.SESSION);
var conn = DBus.Bus.get (DBus.BusType.
awn-panel-
panel.
^
awn-panel-
panel.
^
awn-panel-
return panel.docklet_
awn-panel-
panel.
^
Compilation succeeded - 5 warning(s)
awn-app.
this.client = Config.get_default (0);
awn-app.
this.