Merge lp:~unity-team/unity/unity.dbusmenu-quicklists into lp:unity

Proposed by Gord Allott
Status: Superseded
Proposed branch: lp:~unity-team/unity/unity.dbusmenu-quicklists
Merge into: lp:unity
Diff against target: 2826 lines (+1733/-644)
25 files modified
configure.ac (+1/-0)
targets/mutter/Makefile.am (+1/-0)
targets/mutter/expose-manager.vala (+25/-23)
targets/mutter/plugin.vala (+4/-3)
targets/unity/Makefile.am (+1/-0)
tests/ui/Makefile.am (+1/-0)
tests/ui/test-automate.vala (+10/-9)
tests/ui/test-quicklist.vala (+3/-1)
tests/unit/Makefile.am (+1/-0)
tests/unit/test-launcher.vala (+1/-1)
unity-private/Makefile.am (+6/-1)
unity-private/launcher/application-controller.vala (+166/-17)
unity-private/launcher/quicklist-check-menu-item.vala (+228/-0)
unity-private/launcher/quicklist-controller.vala (+294/-120)
unity-private/launcher/quicklist-image-menu-item.vala (+23/-0)
unity-private/launcher/quicklist-menu-item.vala (+225/-0)
unity-private/launcher/quicklist-radio-menu-item.vala (+230/-0)
unity-private/launcher/quicklist-seperator-menu-item.vala (+117/-0)
unity-private/launcher/quicklist-view.vala (+0/-299)
unity-private/launcher/scrollerchild-controller.vala (+28/-32)
unity/Makefile.am (+1/-0)
vapi/Bamf-0.2.vapi (+136/-135)
vapi/Dbusmenu-Glib-0.2.vapi (+173/-0)
vapi/clutk-0.3.vapi (+55/-1)
vapi/indicator.vapi (+3/-2)
To merge this branch: bzr merge lp:~unity-team/unity/unity.dbusmenu-quicklists
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Abstain
Review via email: mp+29457@code.launchpad.net

This proposal has been superseded by a proposal from 2010-07-15.

Description of the change

builds quicklists based off dbusmenu's, namely one for the bottom half one for the top. top part of the menu is based on Indicator desktop shortcuts api. the only desktop shortcuts that should show up are those that use the Unity identifier so nothing is there right now until desktop files are modified.

Known issues:
  Wrong rendering for the menu items, not using the unity menu item rendering because nothing shows up when i do, need Mirco to take a look at that. So its just using Ctk.MenuItem rendering
  Menu's sometimes jump to the right, long time Unity.QuicklistView bug, not sure what is going on, need Mirco to take a look also.
  Arrow is in the wrong position when menu is opened. Bug in the menu view rendering, hoping its fixed with mirco's resizing menus addition.]

Testing:
  No tests right now, had to disable the previous tests built on quicklists (because the api changed). need to spend friday/thursday building new ones.

To post a comment you must log in.
Revision history for this message
Gord Allott (gordallott) wrote :

requires lp:~unity-team/clutk/clutk.menuitems now, some ctk menu bugfixes in there

Revision history for this message
Neil J. Patel (njpatel) wrote :

Code looks fine, but let's wait until the issues you've mentioned are fixed today/tomorrow and the clutk.menuitem branch is approved and merged.

review: Abstain

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2010-07-13 15:04:53 +0000
+++ configure.ac 2010-07-14 16:07:41 +0000
@@ -97,6 +97,7 @@
97 clutter-gtk-0.10 >= 0.1097 clutter-gtk-0.10 >= 0.10
98 clutk-0.3 >= 0.3.2698 clutk-0.3 >= 0.3.26
99 dbus-glib-199 dbus-glib-1
100 dbusmenu-glib >= 0.3.4
100 dee-1.0 >= 0.2.0101 dee-1.0 >= 0.2.0
101 glib-2.0 >= $GLIB_REQUIRED102 glib-2.0 >= $GLIB_REQUIRED
102 gobject-2.0 >= $GLIB_REQUIRED103 gobject-2.0 >= $GLIB_REQUIRED
103104
=== modified file 'targets/mutter/Makefile.am'
--- targets/mutter/Makefile.am 2010-06-21 07:33:51 +0000
+++ targets/mutter/Makefile.am 2010-07-14 16:07:41 +0000
@@ -39,6 +39,7 @@
39 --pkg clutter-gtk-0.10 \39 --pkg clutter-gtk-0.10 \
40 --pkg clutk-0.3 \40 --pkg clutk-0.3 \
41 --pkg dbus-glib-1 \41 --pkg dbus-glib-1 \
42 --pkg Dbusmenu-Glib-0.2 \
42 --pkg dee-1.0 \43 --pkg dee-1.0 \
43 --pkg gtk+-2.0 \44 --pkg gtk+-2.0 \
44 --pkg gee-1.0 \45 --pkg gee-1.0 \
4546
=== modified file 'targets/mutter/expose-manager.vala'
--- targets/mutter/expose-manager.vala 2010-06-10 20:47:05 +0000
+++ targets/mutter/expose-manager.vala 2010-07-14 16:07:41 +0000
@@ -132,11 +132,11 @@
132132
133 public void start_expose (SList<Clutter.Actor> windows)133 public void start_expose (SList<Clutter.Actor> windows)
134 {134 {
135 var controller = Launcher.QuicklistController.get_default ();135 var controller = Launcher.QuicklistController.get_current_menu ();
136 if (controller.menu_is_open ())136 if (controller.is_menu_open ())
137 {137 {
138 controller.menu.destroy.connect (this.end_expose);138 controller.get_view ().destroy.connect (this.end_expose);
139 this.menu_in_hover_close_state = controller.menu.get_close_on_leave ();139 this.menu_in_hover_close_state = controller.get_view ().get_close_on_leave ();
140 }140 }
141 exposed_windows = new List<ExposeClone> ();141 exposed_windows = new List<ExposeClone> ();
142142
@@ -152,44 +152,46 @@
152152
153 foreach (Clutter.Actor actor in windows)153 foreach (Clutter.Actor actor in windows)
154 {154 {
155 if (!(actor is Mutter.Window) || 155 if (!(actor is Mutter.Window) ||
156 ((actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.NORMAL &&156 ((actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.NORMAL &&
157 (actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.DIALOG &&157 (actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.DIALOG &&
158 (actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.MODAL_DIALOG))158 (actor as Mutter.Window).get_window_type () != Mutter.MetaCompWindowType.MODAL_DIALOG))
159 continue;159 continue;
160 160
161 ExposeClone clone = new ExposeClone (actor);161 ExposeClone clone = new ExposeClone (actor);
162 clone.set_position (actor.x, actor.y);162 clone.set_position (actor.x, actor.y);
163 clone.set_size (actor.width, actor.height);163 clone.set_size (actor.width, actor.height);
164 exposed_windows.append (clone);164 exposed_windows.append (clone);
165 clone.reactive = true;165 clone.reactive = true;
166 166
167 expose_group.add_actor (clone);167 expose_group.add_actor (clone);
168 168
169 clone.hovered_opacity = hovered_opacity;169 clone.hovered_opacity = hovered_opacity;
170 clone.unhovered_opacity = unhovered_opacity;170 clone.unhovered_opacity = unhovered_opacity;
171 clone.opacity = unhovered_opacity;171 clone.opacity = unhovered_opacity;
172 clone.darken = darken;172 clone.darken = darken;
173 173
174 clone.enter_event.connect (() => {174 clone.enter_event.connect (() => {
175 var ql_controller = Launcher.QuicklistController.get_default ();175 var ql_controller = Launcher.QuicklistController.get_current_menu ();
176 if (ql_controller.menu_is_open () && this.menu_in_hover_close_state)176 if (ql_controller.state == Launcher.QuicklistControllerState.MENU
177 && this.menu_in_hover_close_state)
177 {178 {
178 ql_controller.menu.set_close_on_leave (false);179 ql_controller.get_view ().set_close_on_leave (false);
179 }180 }
180 return false;181 return false;
181 });182 });
182183
183 clone.leave_event.connect (() => {184 clone.leave_event.connect (() => {
184 var ql_controller = Launcher.QuicklistController.get_default ();185 var ql_controller = Launcher.QuicklistController.get_current_menu ();
185 if (ql_controller.menu_is_open () && this.menu_in_hover_close_state)186 if (ql_controller.state == Launcher.QuicklistControllerState.MENU
187 && this.menu_in_hover_close_state)
186 {188 {
187 ql_controller.menu.set_close_on_leave (true);189 ql_controller.get_view ().set_close_on_leave (true);
188 }190 }
189 return false;191 return false;
190 });192 });
191 }193 }
192 194
193 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();195 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();
194 foreach (Mutter.Window w in mutter_windows)196 foreach (Mutter.Window w in mutter_windows)
195 {197 {
@@ -214,11 +216,11 @@
214216
215 public void end_expose ()217 public void end_expose ()
216 {218 {
217 var controller = Launcher.QuicklistController.get_default ();219 var controller = Launcher.QuicklistController.get_current_menu ();
218 if (controller.menu_is_open ())220 if (controller.is_menu_open ())
219 {221 {
220 controller.menu.destroy.disconnect (this.end_expose);222 controller.get_view ().destroy.disconnect (this.end_expose);
221 controller.close_menu ();223 controller.state = Launcher.QuicklistControllerState.CLOSED;
222 }224 }
223225
224 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();226 unowned GLib.List<Mutter.Window> mutter_windows = owner.plugin.get_windows ();
@@ -521,9 +523,9 @@
521523
522 unowned Clutter.Actor actor = this.stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, (int) x, (int) y);524 unowned Clutter.Actor actor = this.stage.get_actor_at_pos (Clutter.PickMode.REACTIVE, (int) x, (int) y);
523525
524 unowned Clutter.Actor? menu = null;526 Clutter.Actor? menu = null;
525 if (Unity.Launcher.QuicklistController.get_default ().menu_is_open ())527 if (Unity.Launcher.QuicklistController.get_current_menu ().is_menu_open ())
526 menu = Unity.Launcher.QuicklistController.get_default ().menu;528 menu = Unity.Launcher.QuicklistController.get_current_menu ().get_view ();
527 if (menu != null)529 if (menu != null)
528 {530 {
529 if (x > menu.x && x < menu.x + menu.width && y > menu.y && y < menu.y + menu.height)531 if (x > menu.x && x < menu.x + menu.width && y > menu.y && y < menu.y + menu.height)
530532
=== modified file 'targets/mutter/plugin.vala'
--- targets/mutter/plugin.vala 2010-07-08 13:48:39 +0000
+++ targets/mutter/plugin.vala 2010-07-14 16:07:41 +0000
@@ -318,9 +318,10 @@
318 {318 {
319 this.launcher.get_view ().hide ();319 this.launcher.get_view ().hide ();
320 this.panel.hide ();320 this.panel.hide ();
321 var menu = Unity.Launcher.QuicklistController.get_default ();321 var menu = Unity.Launcher.QuicklistController.get_current_menu ();
322 if (menu.menu_is_open ())322 if (menu.is_menu_open ())
323 menu.close_menu ();323 menu.state = Unity.Launcher.QuicklistControllerState.CLOSED;
324
324 fullscreen_obstruction = true;325 fullscreen_obstruction = true;
325 }326 }
326 else327 else
327328
=== modified file 'targets/unity/Makefile.am'
--- targets/unity/Makefile.am 2010-06-10 00:17:10 +0000
+++ targets/unity/Makefile.am 2010-07-14 16:07:41 +0000
@@ -37,6 +37,7 @@
37 --pkg config \37 --pkg config \
38 --pkg dee-1.0 \38 --pkg dee-1.0 \
39 --pkg dbus-glib-1 \39 --pkg dbus-glib-1 \
40 --pkg Dbusmenu-Glib-0.2 \
40 --pkg gtk+-2.0 \41 --pkg gtk+-2.0 \
41 --pkg gdk-2.0 \42 --pkg gdk-2.0 \
42 --pkg gee-1.0 \43 --pkg gee-1.0 \
4344
=== modified file 'tests/ui/Makefile.am'
--- tests/ui/Makefile.am 2010-06-10 00:17:10 +0000
+++ tests/ui/Makefile.am 2010-07-14 16:07:41 +0000
@@ -28,6 +28,7 @@
28 --pkg clutter-1.0 \28 --pkg clutter-1.0 \
29 --pkg clutter-gtk-0.10 \29 --pkg clutter-gtk-0.10 \
30 --pkg dbus-glib-1 \30 --pkg dbus-glib-1 \
31 --pkg Dbusmenu-Glib-0.2 \
31 --pkg dee-1.0 \32 --pkg dee-1.0 \
32 --pkg gtk+-2.0 \33 --pkg gtk+-2.0 \
33 --pkg gdk-2.0 \34 --pkg gdk-2.0 \
3435
=== modified file 'tests/ui/test-automate.vala'
--- tests/ui/test-automate.vala 2010-06-08 22:55:07 +0000
+++ tests/ui/test-automate.vala 2010-07-14 16:07:41 +0000
@@ -74,13 +74,14 @@
7474
75 private void test_automation ()75 private void test_automation ()
76 {76 {
77/*
77 ObjectRegistry registry = ObjectRegistry.get_default ();78 ObjectRegistry registry = ObjectRegistry.get_default ();
7879
79 Logging.init_fatal_handler ();80 Logging.init_fatal_handler ();
8081
81 QuicklistController qlcontroller = QuicklistController.get_default ();82 QuicklistController qlcontroller = QuicklistController.get_default ();
82 ScrollerModel scroller = registry.lookup ("UnityScrollerModel").get(0) as ScrollerModel;83 ScrollerModel scroller = registry.lookup ("UnityScrollerModel").get(0) as ScrollerModel;
83 84
84 gTimer = new GLib.Timer();85 gTimer = new GLib.Timer();
85 int DT = 2500;86 int DT = 2500;
86 stdout.printf("\n");87 stdout.printf("\n");
@@ -95,36 +96,36 @@
95 Clutter.Animation? anim;96 Clutter.Animation? anim;
96 launcher.opacity = 255;97 launcher.opacity = 255;
9798
98 99
99 gTimer.start ();100 gTimer.start ();
100 anim = launcher.animate (Clutter.AnimationMode.EASE_IN_SINE, 2500, "opacity", 0);101 anim = launcher.animate (Clutter.AnimationMode.EASE_IN_SINE, 2500, "opacity", 0);
101 //anim.started.connect (on_animation_started);102 //anim.started.connect (on_animation_started);
102 anim.completed.connect (on_animation_completed);103 anim.completed.connect (on_animation_completed);
103 dir.do_wait_for_animation (launcher);104 dir.do_wait_for_animation (launcher);
104 105
105 float dt = (float)gTimer.elapsed ();106 float dt = (float)gTimer.elapsed ();
106 float dt0 = (float)DT/1000.0f;107 float dt0 = (float)DT/1000.0f;
107 stdout.printf("Expected Duration: %2.3f, Observed Duration: %2.3f, Error: %2.3f%%\n", dt0, dt,108 stdout.printf("Expected Duration: %2.3f, Observed Duration: %2.3f, Error: %2.3f%%\n", dt0, dt,
108 (dt - dt0)*100.0f/dt0);109 (dt - dt0)*100.0f/dt0);
109 110
110 gTimer.start ();111 gTimer.start ();
111 anim = launcher.animate (Clutter.AnimationMode.EASE_IN_SINE, 2500, "opacity", 255);112 anim = launcher.animate (Clutter.AnimationMode.EASE_IN_SINE, 2500, "opacity", 255);
112 //anim.started.connect (on_animation_started);113 //anim.started.connect (on_animation_started);
113 anim.completed.connect (on_animation_completed);114 anim.completed.connect (on_animation_completed);
114 dir.do_wait_for_animation (launcher);115 dir.do_wait_for_animation (launcher);
115 116
116 dt = (float)gTimer.elapsed ();117 dt = (float)gTimer.elapsed ();
117 dt0 = (float)DT/1000.0f;118 dt0 = (float)DT/1000.0f;
118 stdout.printf("Expected Duration: %2.3f, Observed Duration: %2.3f, Error: %2.3f%%\n", dt0, dt,119 stdout.printf("Expected Duration: %2.3f, Observed Duration: %2.3f, Error: %2.3f%%\n", dt0, dt,
119 (dt - dt0)*100.0f/dt0);120 (dt - dt0)*100.0f/dt0);
120121
121 122
122 //dir.do_wait_for_timeout (5000);123 //dir.do_wait_for_timeout (5000);
123 }124 }
124 125
125 //debug ("After Animation"); 126 //debug ("After Animation");
126 /* Clean up */
127 qlcontroller.close_menu ();127 qlcontroller.close_menu ();
128*/
128 }129 }
129 }130 }
130}131}
131132
=== modified file 'tests/ui/test-quicklist.vala'
--- tests/ui/test-quicklist.vala 2010-06-03 13:14:06 +0000
+++ tests/ui/test-quicklist.vala 2010-07-14 16:07:41 +0000
@@ -60,6 +60,7 @@
6060
61 private void test_controller_show_label ()61 private void test_controller_show_label ()
62 {62 {
63/*
63 string img = TESTDIR + "/data/quicklist_controller_show_label.png";64 string img = TESTDIR + "/data/quicklist_controller_show_label.png";
64 ObjectRegistry registry = ObjectRegistry.get_default ();65 ObjectRegistry registry = ObjectRegistry.get_default ();
6566
@@ -76,8 +77,9 @@
7677
77 assert (Utils.compare_snapshot (stage, img, 54, 30, 200, 50));78 assert (Utils.compare_snapshot (stage, img, 54, 30, 200, 50));
7879
79 /* Clean up */
80 qlcontroller.close_menu ();80 qlcontroller.close_menu ();
81 */
81 }82 }
83
82 }84 }
83}85}
8486
=== modified file 'tests/unit/Makefile.am'
--- tests/unit/Makefile.am 2010-06-29 13:01:44 +0000
+++ tests/unit/Makefile.am 2010-07-14 16:07:41 +0000
@@ -30,6 +30,7 @@
30 --pkg clutter-1.0 \30 --pkg clutter-1.0 \
31 --pkg clutter-gtk-0.10 \31 --pkg clutter-gtk-0.10 \
32 --pkg dbus-glib-1 \32 --pkg dbus-glib-1 \
33 --pkg Dbusmenu-Glib-0.2 \
33 --pkg dee-1.0 \34 --pkg dee-1.0 \
34 --pkg gtk+-2.0 \35 --pkg gtk+-2.0 \
35 --pkg gdk-2.0 \36 --pkg gdk-2.0 \
3637
=== modified file 'tests/unit/test-launcher.vala'
--- tests/unit/test-launcher.vala 2010-06-16 20:43:20 +0000
+++ tests/unit/test-launcher.vala 2010-07-14 16:07:41 +0000
@@ -101,7 +101,7 @@
101 return test_user_visible;101 return test_user_visible;
102 }102 }
103103
104 public override string view_type ()104 public override unowned string view_type ()
105 {105 {
106 return "test";106 return "test";
107 }107 }
108108
=== modified file 'unity-private/Makefile.am'
--- unity-private/Makefile.am 2010-06-21 10:10:30 +0000
+++ unity-private/Makefile.am 2010-07-14 16:07:41 +0000
@@ -41,9 +41,9 @@
41 --pkg clutter-1.0 \41 --pkg clutter-1.0 \
42 --pkg clutter-gtk-0.10 \42 --pkg clutter-gtk-0.10 \
43 --pkg config \43 --pkg config \
44 --pkg dbus-glib-1 \
45 --pkg cogl-1.0 \44 --pkg cogl-1.0 \
46 --pkg dbus-glib-1 \45 --pkg dbus-glib-1 \
46 --pkg Dbusmenu-Glib-0.2\
47 --pkg dee-1.0 \47 --pkg dee-1.0 \
48 --pkg gconf-2.0 \48 --pkg gconf-2.0 \
49 --pkg gdk-2.0 \49 --pkg gdk-2.0 \
@@ -103,7 +103,12 @@
103 launcher/application-controller.vala \103 launcher/application-controller.vala \
104 launcher/launcher.vala \104 launcher/launcher.vala \
105 launcher/launcher-child.vala \105 launcher/launcher-child.vala \
106 launcher/quicklist-check-menu-item.vala \
106 launcher/quicklist-controller.vala \107 launcher/quicklist-controller.vala \
108 launcher/quicklist-image-menu-item.vala \
109 launcher/quicklist-menu-item.vala \
110 launcher/quicklist-radio-menu-item.vala \
111 launcher/quicklist-seperator-menu-item.vala \
107 launcher/quicklist-view.vala \112 launcher/quicklist-view.vala \
108 launcher/scrollerchild-controller.vala \113 launcher/scrollerchild-controller.vala \
109 launcher/scrollerchild.vala \114 launcher/scrollerchild.vala \
110115
=== modified file 'unity-private/launcher/application-controller.vala'
--- unity-private/launcher/application-controller.vala 2010-07-08 13:48:39 +0000
+++ unity-private/launcher/application-controller.vala 2010-07-14 16:07:41 +0000
@@ -157,18 +157,21 @@
157 public class ApplicationController : ScrollerChildController157 public class ApplicationController : ScrollerChildController
158 {158 {
159 public string desktop_file { get; private set; }159 public string desktop_file { get; private set; }
160 160
161 private KeyFile desktop_keyfile;161 private KeyFile desktop_keyfile;
162 private string icon_name;162 private string icon_name;
163 private Unity.ThemeFilePath theme_file_path;163 private Unity.ThemeFilePath theme_file_path;
164 private Bamf.Application? app = null;164 private Bamf.Application? app = null;
165 private Dbusmenu.Client menu_client;
166 private Dbusmenu.Menuitem cached_menu;
167 private int menu_items_realized_counter;
165168
166 private bool is_favorite = false;169 private bool is_favorite = false;
167170
168 public ApplicationController (string? desktop_file_, ScrollerChild child_)171 public ApplicationController (string? desktop_file_, ScrollerChild child_)
169 {172 {
170 Object (child: child_);173 Object (child: child_);
171 174
172 if (desktop_file_ != null)175 if (desktop_file_ != null)
173 {176 {
174 desktop_file = desktop_file_;177 desktop_file = desktop_file_;
@@ -200,21 +203,25 @@
200 }203 }
201 }204 }
202205
203 //connect to our quicklist signals so that we can expose and de-expose206 notify["menu"].connect (on_notify_menu);
204 // windows at the correct time207 }
205 var controller = QuicklistController.get_default ();208
206 controller.menu_state_changed.connect ((open) => {209 public override QuicklistController get_menu_controller ()
207 if (controller.get_attached_actor () == child && app != null)210 {
208 {211 QuicklistController new_menu = new ApplicationQuicklistController (this);
209 // this is a menu relating to us212 return new_menu;
210 if (open)213 }
211 {214
212 Unity.global_shell.expose_xids (app.get_xids ());215 private void on_notify_menu ()
213 }216 {
214 else217 menu.notify["state"].connect (() => {
215 {218 if (menu.state == QuicklistControllerState.MENU)
216 Unity.global_shell.stop_expose ();219 {
217 }220 Unity.global_shell.expose_xids (app.get_xids ());
221 }
222 else
223 {
224 Unity.global_shell.stop_expose ();
218 }225 }
219 });226 });
220 }227 }
@@ -240,6 +247,19 @@
240 }247 }
241 }248 }
242249
250 public bool is_sticky ()
251 {
252 if (desktop_file == "" || desktop_file == null)
253 return false;
254
255 var favorites = Unity.Favorites.get_default ();
256 string uid = favorites.find_uid_for_desktop_file (desktop_file);
257 if (uid != null && uid != "")
258 return true;
259 else
260 return false;
261 }
262
243 public void close_windows ()263 public void close_windows ()
244 {264 {
245 if (app is Bamf.Application)265 if (app is Bamf.Application)
@@ -295,6 +315,134 @@
295 }315 }
296 }316 }
297317
318 public override void get_menu_actions (ScrollerChildController.menu_cb callback)
319 {
320
321 // first check to see if we have a cached client, if we do, just re-use that
322 if (menu_client is Dbusmenu.Client && cached_menu is Dbusmenu.Menuitem)
323 {
324 callback (cached_menu);
325 }
326
327 // check for a menu from bamf
328 if (app is Bamf.Application)
329 {
330 GLib.List<Bamf.View> views = app.get_children ();
331 foreach (Bamf.View view in views)
332 {
333 if (view is Bamf.Indicator)
334 {
335 string path = (view as Bamf.Indicator).get_dbus_menu_path ();
336 string remote_address = (view as Bamf.Indicator).get_remote_address ();
337 string remote_path = (view as Bamf.Indicator).get_remote_path ();
338
339 // Yes, right here, i have lambda's inside lambda's... shutup.
340 menu_client = new Dbusmenu.Client (remote_address, path);
341 menu_client.layout_updated.connect (() => {
342 var menu = menu_client.get_root ();
343 cached_menu = menu;
344 if (menu is Dbusmenu.Menuitem == false)
345 warning (@"Didn't get a menu for path: $path - address: $remote_address");
346
347 unowned GLib.List<Dbusmenu.Menuitem> menu_items = menu.get_children ();
348 menu_items_realized_counter = (int)menu_items.length ();
349 foreach (Dbusmenu.Menuitem menuitem in menu_items)
350 {
351 menuitem.realized.connect (() =>
352 {
353 menu_items_realized_counter -= 1;
354 if (menu_items_realized_counter < 1)
355 {
356 callback (menu);
357 }
358
359 });
360 }
361 });
362 }
363 }
364 }
365
366
367 if (desktop_file == "" || desktop_file == null)
368 {
369 callback (null);
370 }
371
372 // find our desktop shortcuts
373 Indicator.DesktopShortcuts shortcuts = new Indicator.DesktopShortcuts (desktop_file, "Unity");
374 unowned string [] nicks = shortcuts.get_nicks ();
375
376 if (nicks.length < 1)
377 callback (null);
378
379 Dbusmenu.Menuitem root = new Dbusmenu.Menuitem ();
380 root.set_root (true);
381
382 foreach (string nick in nicks)
383 {
384 string local_nick = nick.dup ();
385 unowned string name = shortcuts.nick_get_name (local_nick);
386 string local_name = name.dup ();
387
388 Dbusmenu.Menuitem shortcut_item = new Dbusmenu.Menuitem ();
389 shortcut_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, local_name);
390 shortcut_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true);
391 shortcut_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true);
392 shortcut_item.item_activated.connect ((timestamp) => {
393 shortcuts.nick_exec (local_nick);
394 });
395 root.child_append (shortcut_item);
396
397 }
398 callback (root);
399 }
400
401
402 public override void get_menu_navigation (ScrollerChildController.menu_cb callback)
403 {
404
405 // build a dbusmenu that represents our generic application handling items
406 Dbusmenu.Menuitem root = new Dbusmenu.Menuitem ();
407 root.set_root (true);
408
409 if (desktop_file != null)
410 {
411 Dbusmenu.Menuitem pinning_item = new Dbusmenu.Menuitem ();
412 if (is_sticky ())
413 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Remove from launcher");
414 else
415 pinning_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Add to launcher");
416
417 pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true);
418 pinning_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true);
419 pinning_item.item_activated.connect ((timestamp) => {
420 set_sticky (!is_sticky ());
421 });
422
423 root.child_append (pinning_item);
424 }
425
426 if (app is Bamf.Application)
427 {
428 Dbusmenu.Menuitem app_item = new Dbusmenu.Menuitem ();
429 app_item.property_set (Dbusmenu.MENUITEM_PROP_LABEL, "Quit...");
430 app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_ENABLED, true);
431 app_item.property_set_bool (Dbusmenu.MENUITEM_PROP_VISIBLE, true);
432
433 app_item.item_activated.connect ((timestamp) => {
434 if (app is Bamf.Application)
435 {
436 Array<uint32> xids = app.get_xids ();
437 Unity.global_shell.close_xids (xids);
438 }
439 });
440 root.child_append (app_item);
441 }
442
443 callback (root);
444 }
445
298 public override Gee.ArrayList<ShortcutItem> get_menu_shortcuts ()446 public override Gee.ArrayList<ShortcutItem> get_menu_shortcuts ()
299 {447 {
300 // get the desktop file448 // get the desktop file
@@ -530,6 +678,7 @@
530 Gtk.IconTheme theme = Gtk.IconTheme.get_default ();678 Gtk.IconTheme theme = Gtk.IconTheme.get_default ();
531 theme_file_path.add_icon_theme (theme);679 theme_file_path.add_icon_theme (theme);
532 theme = new Gtk.IconTheme ();680 theme = new Gtk.IconTheme ();
681
533 theme.set_custom_theme ("unity-icon-theme");682 theme.set_custom_theme ("unity-icon-theme");
534 theme_file_path.add_icon_theme (theme);683 theme_file_path.add_icon_theme (theme);
535 theme.set_custom_theme ("Web");684 theme.set_custom_theme ("Web");
536685
=== added file 'unity-private/launcher/quicklist-check-menu-item.vala'
--- unity-private/launcher/quicklist-check-menu-item.vala 1970-01-01 00:00:00 +0000
+++ unity-private/launcher/quicklist-check-menu-item.vala 2010-07-14 16:07:41 +0000
@@ -0,0 +1,228 @@
1/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
2/*
3 * Copyright (C) 2010 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by Gordon Allott <gord.allott@canonical.com>,
18 *
19 */
20
21namespace Unity.Launcher
22{
23 public class QuicklistCheckMenuItem : Ctk.CheckMenuItem
24 {
25 Ctk.LayerActor item_background;
26 int old_width;
27 int old_height;
28 string old_label;
29
30 private override void
31 paint ()
32 {
33 this.item_background.paint ();
34 }
35
36
37 public override void
38 get_preferred_height (float for_width,
39 out float min_height_p,
40 out float natural_height_p)
41 {
42 min_height_p = (float) Ctk.em_to_pixel (ITEM_HEIGHT);
43 natural_height_p = min_height_p;
44 }
45
46 public override void
47 get_preferred_width (float for_height,
48 out float min_width_p,
49 out float natural_width_p)
50 {
51 int width;
52 int height;
53 Gtk.Settings settings = Gtk.Settings.get_default ();
54 Unity.QuicklistRendering.Item.get_text_extents (settings.gtk_font_name,
55 this.label + " ☐",
56 out width,
57 out height);
58 min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN);
59 natural_width_p = min_width_p;
60 }
61
62 private override void
63 allocate (Clutter.ActorBox box,
64 Clutter.AllocationFlags flags)
65 {
66 int w;
67 int h;
68 Clutter.Color white_color = Clutter.Color () {
69 red = 255,
70 green = 255,
71 blue = 255,
72 alpha = 255
73 };
74
75 base.allocate (box, flags);
76
77 w = (int) (box.x2 - box.x1);
78 h = (int) (box.y2 - box.y1);
79
80 // exit early if the allocation-width/height didn't change, this is needed
81 // because clutter triggers calling allocate even if nothing changed
82 if ((old_width == w) && (old_height == h))
83 return;
84
85 // store the new width/height
86 old_width = w;
87 old_height = h;
88
89 // before creating a new CtkLayerActor make sure we don't leak any memory
90 if (this.item_background is Ctk.LayerActor)
91 this.item_background.unparent ();
92 this.item_background = new Ctk.LayerActor (w, h);
93
94 Ctk.Layer normal_layer = new Ctk.Layer (w,
95 h,
96 Ctk.LayerRepeatMode.NONE,
97 Ctk.LayerRepeatMode.NONE);
98 Ctk.Layer selected_layer = new Ctk.Layer (w,
99 h,
100 Ctk.LayerRepeatMode.NONE,
101 Ctk.LayerRepeatMode.NONE);
102
103 Cairo.Surface normal_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
104 w,
105 h);
106 Cairo.Surface selected_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
107 w,
108 h);
109
110 Cairo.Context normal_cr = new Cairo.Context (normal_surf);
111 Cairo.Context selected_cr = new Cairo.Context (selected_surf);
112 Gtk.Settings settings = Gtk.Settings.get_default ();
113
114 string formatted_label = label;
115 if (active)
116 formatted_label = formatted_label + " ☑";
117 else
118 formatted_label = formatted_label + " ☐";
119
120 Unity.QuicklistRendering.Item.normal_mask (normal_cr,
121 w,
122 h,
123 settings.gtk_font_name,
124 formatted_label);
125 Unity.QuicklistRendering.Item.selected_mask (selected_cr,
126 w,
127 h,
128 settings.gtk_font_name,
129 formatted_label);
130
131 normal_layer.set_mask_from_surface (normal_surf);
132 normal_layer.set_color (white_color);
133
134 selected_layer.set_mask_from_surface (selected_surf);
135 selected_layer.set_color (white_color);
136
137 this.item_background.add_layer (normal_layer);
138 this.item_background.add_layer (selected_layer);
139
140 this.item_background.get_layer(0).set_enabled (true);
141 this.item_background.get_layer(1).set_enabled (false);
142 this.item_background.do_queue_redraw ();
143
144 this.item_background.set_parent (this);
145 this.item_background.map ();
146 this.item_background.show ();
147 }
148
149 private bool _on_enter (Clutter.Event event)
150 {
151 this.item_background.get_layer(0).set_enabled (false);
152 this.item_background.get_layer(1).set_enabled (true);
153
154 // Ensure we are associated with a stage before queuing a draw to
155 // avoid a rather annoying (but rare) crash in clutter
156 if (this.get_stage () is Clutter.Stage)
157 this.do_queue_redraw ();
158 return false;
159 }
160
161 private bool _on_leave (Clutter.Event event)
162 {
163 this.item_background.get_layer(0).set_enabled (true);
164 this.item_background.get_layer(1).set_enabled (false);
165 if (this.get_stage () is Clutter.Stage)
166 this.do_queue_redraw ();
167 return false;
168 }
169
170 private void _on_label_changed ()
171 {
172 // if the contents of the label didn't really change exit early
173 if (old_label == this.label)
174 return;
175
176 old_label = this.label;
177 }
178
179 private bool _on_mouse_down (Clutter.Event event)
180 {
181 this.notify["label"].disconnect (this._on_label_changed);
182 this.enter_event.disconnect (this._on_enter);
183 this.leave_event.disconnect (this._on_leave);
184 this.button_press_event.disconnect (this._on_mouse_down);
185 this.activated ();
186 return true;
187 }
188
189 ~QuicklistMenuItem ()
190 {
191 this.notify["label"].disconnect (this._on_label_changed);
192 this.enter_event.disconnect (this._on_enter);
193 this.leave_event.disconnect (this._on_leave);
194 this.button_press_event.disconnect (this._on_mouse_down);
195 }
196
197 construct
198 {
199 Ctk.Padding padding = Ctk.Padding () {
200 left = (int) Ctk.em_to_pixel (MARGIN),
201 right = (int) Ctk.em_to_pixel (MARGIN),
202 top = (int) Ctk.em_to_pixel (MARGIN),
203 bottom = (int) Ctk.em_to_pixel (MARGIN)
204 };
205 this.set_padding (padding);
206 this.notify["label"].connect (this._on_label_changed);
207 this.enter_event.connect (this._on_enter);
208 this.leave_event.connect (this._on_leave);
209 this.button_press_event.connect (this._on_mouse_down);
210
211 this.reactive = true;
212
213 old_width = 0;
214 old_height = 0;
215 old_label = "";
216 }
217
218 public QuicklistCheckMenuItem ()
219 {
220 Object (label: "");
221 }
222
223 public QuicklistCheckMenuItem.with_label (string label)
224 {
225 Object (label: label);
226 }
227 }
228}
0229
=== modified file 'unity-private/launcher/quicklist-controller.vala'
--- unity-private/launcher/quicklist-controller.vala 2010-06-04 13:39:25 +0000
+++ unity-private/launcher/quicklist-controller.vala 2010-07-14 16:07:41 +0000
@@ -19,134 +19,308 @@
19 */19 */
20namespace Unity.Launcher20namespace Unity.Launcher
21{21{
22 public static QuicklistController? ql_controler_singleton;22 public static QuicklistController? ql_controller_singleton;
2323
24 public class QuicklistController : Object24 public enum QuicklistControllerState {
25 {25 LABEL,
2626 MENU,
27 public static unowned QuicklistController get_default ()27 CLOSED
28 {28 }
29 if (Unity.Launcher.ql_controler_singleton == null) {29
30 Unity.Launcher.ql_controler_singleton= new QuicklistController ();30 public abstract class QuicklistController : Object
31 }31 {
32 return Unity.Launcher.ql_controler_singleton;32 protected Ctk.Menu? menu;
33 }33 public ScrollerChildController attached_controller {get; construct;}
3434 private QuicklistControllerState _state;
35 public weak Ctk.Menu menu;35 public QuicklistControllerState state {
36 public bool is_in_label = false;36 get { return _state; }
37 public bool is_in_menu = false;37 set
3838 {
39 public signal void menu_state_changed (bool open);39 if (value == QuicklistControllerState.LABEL ||
4040 value == QuicklistControllerState.MENU)
41 public QuicklistController ()41 {
42 // check our singleton for a previous menu
43 if (ql_controller_singleton != this && ql_controller_singleton != null)
44 {
45 var tmp_qlc = ql_controller_singleton; //ref the controller
46 tmp_qlc.state = QuicklistControllerState.CLOSED;
47 if (tmp_qlc.get_view () != null)
48 warning ("old menu not destroyed when opening new menu");
49 }
50
51 ql_controller_singleton = this;
52 }
53
54 if (value == QuicklistControllerState.CLOSED)
55 {
56 if (menu is Ctk.Menu)
57 {
58 menu.destroy ();
59 menu = null;
60
61 }
62 ql_controller_singleton = null;
63 }
64
65 _state = value;
66 }
67 }
68
69 public abstract Ctk.Menu? get_view ();
70
71 public static unowned QuicklistController get_current_menu ()
72 {
73 // returns the current controller, thou does not own this!
74 return ql_controller_singleton;
75 }
76
77
78 public static bool is_menu_open ()
79 {
80 // returns true if a menu is open
81 if (ql_controller_singleton is QuicklistController)
82 return ql_controller_singleton.state == QuicklistControllerState.MENU;
83
84 return false;
85 }
86
87 public static bool do_menus_match (QuicklistController menu)
88 {
89 // returns true if the given menu matches ql_controller_singleton
90 return menu == ql_controller_singleton;
91 }
92 }
93
94
95 public class ApplicationQuicklistController : QuicklistController
96 {
97 public ApplicationQuicklistController (ApplicationController scroller_child)
98 {
99 Object (attached_controller: scroller_child);
100 }
101
102 construct
42 {103 {
43 Unity.Testing.ObjectRegistry.get_default ().register ("QuicklistController",104 Unity.Testing.ObjectRegistry.get_default ().register ("QuicklistController",
44 this);105 this);
45 }106
46107 new_menu ();
47 construct108 notify["state"].connect (on_state_change);
48 {109 state = QuicklistControllerState.LABEL;
49 var drag_controller = Drag.Controller.get_default ();110 }
50 drag_controller.drag_start.connect (this.on_unity_drag_start);111
51 }112 private void new_menu ()
52113 {
53 private void on_unity_drag_start (Drag.Model model)114 menu = new QuicklistMenu () as Ctk.Menu;
54 {
55 if (this.menu_is_open ())
56 this.menu.destroy ();
57 }
58
59 public void show_label (string label, Ctk.Actor attached_widget)
60 {
61 if (this.menu_is_open ())
62 this.menu.destroy ();
63
64 var menu = new QuicklistMenu () as Ctk.Menu;
65 menu.destroy.connect (() => {115 menu.destroy.connect (() => {
66 if (is_in_menu)
67 menu_state_changed (false);
68 });
69 this.menu = menu;
70 this.menu.destroy.connect (() => {
71 Unity.global_shell.remove_fullscreen_request (this);116 Unity.global_shell.remove_fullscreen_request (this);
72 });117 });
73 this.menu.set_swallow_clicks (Unity.global_shell.menus_swallow_events);118 menu.set_swallow_clicks (Unity.global_shell.menus_swallow_events);
74 this.menu.set_detect_clicks (false);119 menu.set_detect_clicks (false);
75120 menu.attach_to_actor (attached_controller.child as Ctk.Actor);
76 //make label121 ((attached_controller).child.get_stage () as Clutter.Stage).add_actor (menu);
77 var menuitem = new QuicklistMenuItem (label);
78 menuitem.activated.connect (this.close_menu);
79 menuitem.reactive = true;
80 this.menu.append (menuitem, true);
81 this.menu.attach_to_actor (attached_widget);
82 (attached_widget.get_stage () as Clutter.Stage).add_actor (this.menu);
83122
84 float x;123 float x;
85 float y;124 float y;
86 this.menu.get_position (out x, out y);125 menu.get_position (out x, out y);
87 this.menu.set_position (x - (float) 22.0f, y - 1.0f);126 menu.set_position (x - (float) 22.0f, y - 1.0f);
88 this.is_in_label = true;127 }
89 }128
90129 private void on_state_change ()
91 private Gee.ArrayList<ShortcutItem> prefix_cache;130 {
92 private Gee.ArrayList<ShortcutItem> affix_cache;131 if (state == QuicklistControllerState.CLOSED) return;
93132 if (menu == null)
94 public void show_menu (Gee.ArrayList<ShortcutItem> prefix_shortcuts,133 {
95 Gee.ArrayList<ShortcutItem> affix_shortcuts,134 new_menu ();
96 bool hide_on_leave)135 warning ("state change called on menu when menu does not exist");
97 {136 }
98 this.prefix_cache = prefix_shortcuts;137 if (state == QuicklistControllerState.LABEL)
99 this.affix_cache = affix_shortcuts;138 {
100139 // just build a menu with a label for the name
101 this.is_in_label = false;140 menu.remove_all ();
102 Unity.global_shell.add_fullscreen_request (this);141 string label = attached_controller.name;
103 this.menu.close_on_leave = hide_on_leave;142
104 foreach (ShortcutItem shortcut in prefix_shortcuts)143 var menuitem = new QuicklistMenuItem.with_label (label);
105 {144 menuitem.activated.connect (() => {
106 var label = shortcut.get_name ();145 state = QuicklistControllerState.CLOSED;
107 var menuitem = new QuicklistMenuItem (label);146 });
108 this.menu.prepend (menuitem, false);147
109 menuitem.activated.connect (shortcut.activated);148 menu.append (menuitem, true);
110 menuitem.activated.connect (this.close_menu);149 }
111 }150 else if (state == QuicklistControllerState.MENU)
112151 {
113 /* Only add the separator if there are shortcuts beneath */152
114 if (affix_shortcuts.size > 0)153 // grab the top menu
115 {154 attached_controller.get_menu_actions ((top_menu) => {
116 Unity.Launcher.QuicklistMenuSeperator separator = new Unity.Launcher.QuicklistMenuSeperator ();155 if (top_menu is Dbusmenu.Menuitem)
117 this.menu.append (separator, false);156 if (top_menu.get_root ())
118 }157 {
119158 //returns a correct root menu
120 foreach (ShortcutItem shortcut in affix_shortcuts)159 unowned GLib.List<Dbusmenu.Menuitem> menu_items = top_menu.get_children ();
121 {160 if (menu_items != null)
122 var label = shortcut.get_name ();161 {
123 var menuitem = new QuicklistMenuItem (label);162 var separator = new Unity.Launcher.QuicklistMenuSeperator ();
124 this.menu.append (menuitem, false);163 menu.prepend (separator, false);
125 menuitem.activated.connect (shortcut.activated);164 }
126 menuitem.activated.connect (this.close_menu);165 menu_items.reverse ();
127 }166 foreach (Dbusmenu.Menuitem menuitem in menu_items)
128 this.menu.set_detect_clicks (true);167 {
129 menu_state_changed (true);168 var view_menuitem = menu_item_from_dbusmenuitem (menuitem);
130 }169 if (view_menuitem != null)
131170 menu.prepend (view_menuitem, false);
132 public void close_menu ()171 }
133 {172 menu_items.reverse ();
134 if (this.menu is Ctk.Menu)173 }
135 {174 else
136 this.menu.destroy ();175 {
137 }176 warning ("menu given not a root item");
138 this.is_in_label = false;177 }
139 this.is_in_menu = false;178 });
140 }179
141180 // grab the bottom menu
142 public bool menu_is_open ()181 attached_controller.get_menu_navigation ((bottom_menu) => {
143 {182 if (bottom_menu is Dbusmenu.Menuitem)
144 return this.menu is Ctk.Menu;183 if (bottom_menu.get_root ())
145 }184 {
146185 // add a separator for funsies, also because its in the spec (but mostly the fun part)
147 public Ctk.Actor get_attached_actor ()186 var separator = new Unity.Launcher.QuicklistMenuSeperator ();
148 {187 menu.append (separator, false);
149 return this.menu.get_attached_actor ();188 //returns a correct root menu
150 }189 unowned GLib.List<Dbusmenu.Menuitem> menu_items = bottom_menu.get_children ();
190 foreach (Dbusmenu.Menuitem menuitem in menu_items)
191 {
192 var view_menuitem = menu_item_from_dbusmenuitem (menuitem);
193 if (view_menuitem != null)
194 menu.append (view_menuitem, false);
195 }
196 }
197 else
198 {
199 warning ("menu given not a root item");
200 }
201 });
202
203 float x;
204 float y;
205 menu.get_position (out x, out y);
206 if (x > 60-22)
207 menu.set_position (x - (float) 22.0f, y - 1.0f);
208 }
209 }
210
211 public override Ctk.Menu? get_view ()
212 {
213 return menu;
214 }
215
216 private Ctk.MenuItem? menu_item_from_dbusmenuitem (Dbusmenu.Menuitem dbusmenuitem)
217 {
218 string label = "UNDEFINED";
219 label = dbusmenuitem.property_get (Dbusmenu.MENUITEM_PROP_LABEL);
220 string type = "label";
221 string check_type = dbusmenuitem.property_get (Dbusmenu.MENUITEM_PROP_TOGGLE_TYPE);
222
223 if (check_type == Dbusmenu.MENUITEM_TOGGLE_CHECK)
224 {
225 type = "check";
226 }
227
228 if (check_type == Dbusmenu.MENUITEM_TOGGLE_RADIO)
229 {
230 type = "radio";
231 }
232
233 if (dbusmenuitem.property_get ("type") == Dbusmenu.CLIENT_TYPES_SEPARATOR)
234 {
235 type = "seperator";
236 }
237
238 if (dbusmenuitem.property_get (Dbusmenu.MENUITEM_PROP_ICON_NAME) != null)
239 {
240 type = "stock_image";
241 }
242
243 Ctk.MenuItem menuitem;
244
245 if (type == "label")
246 {
247 menuitem = new QuicklistMenuItem.with_label (label);
248 }
249
250 else if (type == "check" || type == "radio")
251 {
252 if (type == "check")
253 menuitem = new QuicklistCheckMenuItem.with_label (label);
254 else
255 menuitem = new QuicklistRadioMenuItem.with_label (null, label);
256
257 int checked = dbusmenuitem.property_get_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE);
258 if (checked == Dbusmenu.MENUITEM_TOGGLE_STATE_CHECKED)
259 (menuitem as Ctk.CheckMenuItem).set_active (true);
260
261 (menuitem as Ctk.CheckMenuItem).toggled.connect (() =>
262 {
263 int is_checked = ((menuitem as Ctk.CheckMenuItem).get_active ()) ?
264 Dbusmenu.MENUITEM_TOGGLE_STATE_CHECKED : Dbusmenu.MENUITEM_TOGGLE_STATE_UNCHECKED;
265
266 dbusmenuitem.property_set_int (Dbusmenu.MENUITEM_PROP_TOGGLE_STATE, is_checked);
267 });
268
269 dbusmenuitem.property_changed.connect ((property_name, value) => {
270 if (property_name == Dbusmenu.MENUITEM_PROP_TOGGLE_STATE)
271 {
272 int* value_weak = (int*)(value);
273 (menuitem as Ctk.CheckMenuItem).set_active (
274 (*value_weak == Dbusmenu.MENUITEM_TOGGLE_STATE_CHECKED) ? true : false
275 );
276 }
277 });
278 }
279
280 else if (type == "seperator")
281 {
282 menuitem = new QuicklistMenuSeperator ();
283 }
284
285 else
286 {
287 warning ("not a menu item we understand (yet)");
288 return null;
289 }
290
291 //connect to property changes*
292 dbusmenuitem.property_changed.connect ((property_name, value) => {
293 if (property_name == Dbusmenu.MENUITEM_PROP_LABEL)
294 {
295 string* value_weak = (string*)value;
296 menuitem.set_label (value_weak);
297 }
298 else if (property_name == Dbusmenu.MENUITEM_PROP_ENABLED)
299 {
300 bool* value_weak = (bool*)value;
301 menuitem.set_reactive (*value_weak);
302 }
303 });
304
305 menuitem.reactive = dbusmenuitem.property_get_bool (Dbusmenu.MENUITEM_PROP_ENABLED);
306 menuitem.activated.connect (() => {
307 debug ("item was activated...");
308 dbusmenuitem.handle_event ("clicked", null, Clutter.get_current_event_time ());
309 //dbusmenuitem.item_activated (Clutter.get_current_event_time ());
310 });
311
312 menuitem.activated.connect (() => {
313 Idle.add (() => {
314 state = QuicklistControllerState.CLOSED;
315 return false;
316 });
317 });
318
319 // add more menu item types here (check, radio, image) as views are made
320 // right now we can just represent all menuitems as labels
321
322 return menuitem as Ctk.MenuItem;
323 }
324
151 }325 }
152}326}
153327
=== added file 'unity-private/launcher/quicklist-image-menu-item.vala'
--- unity-private/launcher/quicklist-image-menu-item.vala 1970-01-01 00:00:00 +0000
+++ unity-private/launcher/quicklist-image-menu-item.vala 2010-07-14 16:07:41 +0000
@@ -0,0 +1,23 @@
1/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
2/*
3 * Copyright (C) 2010 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by Gordon Allott <gord.allott@canonical.com>,
18 *
19 */
20
21namespace Unity.Launcher
22{
23}
024
=== added file 'unity-private/launcher/quicklist-menu-item.vala'
--- unity-private/launcher/quicklist-menu-item.vala 1970-01-01 00:00:00 +0000
+++ unity-private/launcher/quicklist-menu-item.vala 2010-07-14 16:07:41 +0000
@@ -0,0 +1,225 @@
1/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
2/*
3 * Copyright (C) 2010 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by Gordon Allott <gord.allott@canonical.com>,
18 * Mirco "MacSlow" Müller <mirco.mueller@canonical.com>
19 *
20 */
21
22namespace Unity.Launcher
23{
24 // we subclass Ctk.MenuItem here because we need to adapt it's appearance
25 public class QuicklistMenuItem : Ctk.MenuItem
26 {
27 Ctk.LayerActor item_background;
28 int old_width;
29 int old_height;
30 string old_label;
31
32 private override void
33 paint ()
34 {
35 this.item_background.paint ();
36 }
37
38
39 public override void
40 get_preferred_height (float for_width,
41 out float min_height_p,
42 out float natural_height_p)
43 {
44 min_height_p = (float) Ctk.em_to_pixel (ITEM_HEIGHT);
45 natural_height_p = min_height_p;
46 }
47
48 public override void
49 get_preferred_width (float for_height,
50 out float min_width_p,
51 out float natural_width_p)
52 {
53 int width;
54 int height;
55 Gtk.Settings settings = Gtk.Settings.get_default ();
56 Unity.QuicklistRendering.Item.get_text_extents (settings.gtk_font_name,
57 this.label,
58 out width,
59 out height);
60 min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN);
61 natural_width_p = min_width_p;
62 }
63
64 private override void
65 allocate (Clutter.ActorBox box,
66 Clutter.AllocationFlags flags)
67 {
68 int w;
69 int h;
70 Clutter.Color white_color = Clutter.Color () {
71 red = 255,
72 green = 255,
73 blue = 255,
74 alpha = 255
75 };
76
77 base.allocate (box, flags);
78
79 w = (int) (box.x2 - box.x1);
80 h = (int) (box.y2 - box.y1);
81
82 // exit early if the allocation-width/height didn't change, this is needed
83 // because clutter triggers calling allocate even if nothing changed
84 if ((old_width == w) && (old_height == h))
85 return;
86
87 // store the new width/height
88 old_width = w;
89 old_height = h;
90
91 // before creating a new CtkLayerActor make sure we don't leak any memory
92 if (this.item_background is Ctk.LayerActor)
93 this.item_background.unparent ();
94 this.item_background = new Ctk.LayerActor (w, h);
95
96 Ctk.Layer normal_layer = new Ctk.Layer (w,
97 h,
98 Ctk.LayerRepeatMode.NONE,
99 Ctk.LayerRepeatMode.NONE);
100 Ctk.Layer selected_layer = new Ctk.Layer (w,
101 h,
102 Ctk.LayerRepeatMode.NONE,
103 Ctk.LayerRepeatMode.NONE);
104
105 Cairo.Surface normal_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
106 w,
107 h);
108 Cairo.Surface selected_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
109 w,
110 h);
111
112 Cairo.Context normal_cr = new Cairo.Context (normal_surf);
113 Cairo.Context selected_cr = new Cairo.Context (selected_surf);
114 Gtk.Settings settings = Gtk.Settings.get_default ();
115
116 Unity.QuicklistRendering.Item.normal_mask (normal_cr,
117 w,
118 h,
119 settings.gtk_font_name,
120 this.label);
121 Unity.QuicklistRendering.Item.selected_mask (selected_cr,
122 w,
123 h,
124 settings.gtk_font_name,
125 this.label);
126
127 normal_layer.set_mask_from_surface (normal_surf);
128 normal_layer.set_color (white_color);
129
130 selected_layer.set_mask_from_surface (selected_surf);
131 selected_layer.set_color (white_color);
132
133 this.item_background.add_layer (normal_layer);
134 this.item_background.add_layer (selected_layer);
135
136 this.item_background.get_layer(0).set_enabled (true);
137 this.item_background.get_layer(1).set_enabled (false);
138 this.item_background.do_queue_redraw ();
139
140 this.item_background.set_parent (this);
141 this.item_background.map ();
142 this.item_background.show ();
143 }
144
145 private bool _on_enter (Clutter.Event event)
146 {
147 this.item_background.get_layer(0).set_enabled (false);
148 this.item_background.get_layer(1).set_enabled (true);
149
150 // Ensure we are associated with a stage before queuing a draw to
151 // avoid a rather annoying (but rare) crash in clutter
152 if (this.get_stage () is Clutter.Stage)
153 this.do_queue_redraw ();
154 return false;
155 }
156
157 private bool _on_leave (Clutter.Event event)
158 {
159 this.item_background.get_layer(0).set_enabled (true);
160 this.item_background.get_layer(1).set_enabled (false);
161 if (this.get_stage () is Clutter.Stage)
162 this.do_queue_redraw ();
163 return false;
164 }
165
166 private void _on_label_changed ()
167 {
168 // if the contents of the label didn't really change exit early
169 if (old_label == this.label)
170 return;
171
172 old_label = this.label;
173 }
174
175 private bool _on_mouse_down (Clutter.Event event)
176 {
177 this.notify["label"].disconnect (this._on_label_changed);
178 this.enter_event.disconnect (this._on_enter);
179 this.leave_event.disconnect (this._on_leave);
180 this.button_press_event.disconnect (this._on_mouse_down);
181 this.activated ();
182 return true;
183 }
184
185 ~QuicklistMenuItem ()
186 {
187 this.notify["label"].disconnect (this._on_label_changed);
188 this.enter_event.disconnect (this._on_enter);
189 this.leave_event.disconnect (this._on_leave);
190 this.button_press_event.disconnect (this._on_mouse_down);
191 }
192
193 construct
194 {
195 Ctk.Padding padding = Ctk.Padding () {
196 left = (int) Ctk.em_to_pixel (MARGIN),
197 right = (int) Ctk.em_to_pixel (MARGIN),
198 top = (int) Ctk.em_to_pixel (MARGIN),
199 bottom = (int) Ctk.em_to_pixel (MARGIN)
200 };
201 this.set_padding (padding);
202
203 this.notify["label"].connect (this._on_label_changed);
204 this.enter_event.connect (this._on_enter);
205 this.leave_event.connect (this._on_leave);
206 this.button_press_event.connect (this._on_mouse_down);
207
208 this.reactive = true;
209
210 old_width = 0;
211 old_height = 0;
212 old_label = "";
213 }
214
215 public QuicklistMenuItem ()
216 {
217 Object (label: "");
218 }
219
220 public QuicklistMenuItem.with_label (string label)
221 {
222 Object (label: label);
223 }
224 }
225}
0226
=== added file 'unity-private/launcher/quicklist-radio-menu-item.vala'
--- unity-private/launcher/quicklist-radio-menu-item.vala 1970-01-01 00:00:00 +0000
+++ unity-private/launcher/quicklist-radio-menu-item.vala 2010-07-14 16:07:41 +0000
@@ -0,0 +1,230 @@
1/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
2/*
3 * Copyright (C) 2010 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by Gordon Allott <gord.allott@canonical.com>,
18 *
19 */
20
21namespace Unity.Launcher
22{
23 public class QuicklistRadioMenuItem : Ctk.RadioMenuItem
24 {
25 Ctk.LayerActor item_background;
26 int old_width;
27 int old_height;
28 string old_label;
29
30 private override void
31 paint ()
32 {
33 this.item_background.paint ();
34 }
35
36
37 public override void
38 get_preferred_height (float for_width,
39 out float min_height_p,
40 out float natural_height_p)
41 {
42 min_height_p = (float) Ctk.em_to_pixel (ITEM_HEIGHT);
43 natural_height_p = min_height_p;
44 }
45
46 public override void
47 get_preferred_width (float for_height,
48 out float min_width_p,
49 out float natural_width_p)
50 {
51 int width;
52 int height;
53 Gtk.Settings settings = Gtk.Settings.get_default ();
54 Unity.QuicklistRendering.Item.get_text_extents (settings.gtk_font_name,
55 this.label + " ☐",
56 out width,
57 out height);
58 min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN);
59 natural_width_p = min_width_p;
60 }
61
62 private override void
63 allocate (Clutter.ActorBox box,
64 Clutter.AllocationFlags flags)
65 {
66 int w;
67 int h;
68 Clutter.Color white_color = Clutter.Color () {
69 red = 255,
70 green = 255,
71 blue = 255,
72 alpha = 255
73 };
74
75 base.allocate (box, flags);
76
77 w = (int) (box.x2 - box.x1);
78 h = (int) (box.y2 - box.y1);
79
80 // exit early if the allocation-width/height didn't change, this is needed
81 // because clutter triggers calling allocate even if nothing changed
82 if ((old_width == w) && (old_height == h))
83 return;
84
85 // store the new width/height
86 old_width = w;
87 old_height = h;
88
89 // before creating a new CtkLayerActor make sure we don't leak any memory
90 if (this.item_background is Ctk.LayerActor)
91 this.item_background.unparent ();
92 this.item_background = new Ctk.LayerActor (w, h);
93
94 Ctk.Layer normal_layer = new Ctk.Layer (w,
95 h,
96 Ctk.LayerRepeatMode.NONE,
97 Ctk.LayerRepeatMode.NONE);
98 Ctk.Layer selected_layer = new Ctk.Layer (w,
99 h,
100 Ctk.LayerRepeatMode.NONE,
101 Ctk.LayerRepeatMode.NONE);
102
103 Cairo.Surface normal_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
104 w,
105 h);
106 Cairo.Surface selected_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
107 w,
108 h);
109
110 Cairo.Context normal_cr = new Cairo.Context (normal_surf);
111 Cairo.Context selected_cr = new Cairo.Context (selected_surf);
112 Gtk.Settings settings = Gtk.Settings.get_default ();
113
114 string formatted_label = label;
115 if (active)
116 formatted_label = formatted_label + " ◉";
117 else
118 formatted_label = formatted_label + " ○";
119
120 Unity.QuicklistRendering.Item.normal_mask (normal_cr,
121 w,
122 h,
123 settings.gtk_font_name,
124 formatted_label);
125 Unity.QuicklistRendering.Item.selected_mask (selected_cr,
126 w,
127 h,
128 settings.gtk_font_name,
129 formatted_label);
130
131 normal_layer.set_mask_from_surface (normal_surf);
132 normal_layer.set_color (white_color);
133
134 selected_layer.set_mask_from_surface (selected_surf);
135 selected_layer.set_color (white_color);
136
137 this.item_background.add_layer (normal_layer);
138 this.item_background.add_layer (selected_layer);
139
140 this.item_background.get_layer(0).set_enabled (true);
141 this.item_background.get_layer(1).set_enabled (false);
142 this.item_background.do_queue_redraw ();
143
144 this.item_background.set_parent (this);
145 this.item_background.map ();
146 this.item_background.show ();
147 }
148
149 private bool _on_enter (Clutter.Event event)
150 {
151 this.item_background.get_layer(0).set_enabled (false);
152 this.item_background.get_layer(1).set_enabled (true);
153
154 // Ensure we are associated with a stage before queuing a draw to
155 // avoid a rather annoying (but rare) crash in clutter
156 if (this.get_stage () is Clutter.Stage)
157 this.do_queue_redraw ();
158 return false;
159 }
160
161 private bool _on_leave (Clutter.Event event)
162 {
163 this.item_background.get_layer(0).set_enabled (true);
164 this.item_background.get_layer(1).set_enabled (false);
165 if (this.get_stage () is Clutter.Stage)
166 this.do_queue_redraw ();
167 return false;
168 }
169
170 private void _on_label_changed ()
171 {
172 // if the contents of the label didn't really change exit early
173 if (old_label == this.label)
174 return;
175
176 old_label = this.label;
177 }
178
179 private bool _on_mouse_down (Clutter.Event event)
180 {
181 this.notify["label"].disconnect (this._on_label_changed);
182 this.enter_event.disconnect (this._on_enter);
183 this.leave_event.disconnect (this._on_leave);
184 this.button_press_event.disconnect (this._on_mouse_down);
185 this.activated ();
186 return true;
187 }
188
189 ~QuicklistMenuItem ()
190 {
191 this.notify["label"].disconnect (this._on_label_changed);
192 this.enter_event.disconnect (this._on_enter);
193 this.leave_event.disconnect (this._on_leave);
194 this.button_press_event.disconnect (this._on_mouse_down);
195 }
196
197 construct
198 {
199 Ctk.Padding padding = Ctk.Padding () {
200 left = (int) Ctk.em_to_pixel (MARGIN),
201 right = (int) Ctk.em_to_pixel (MARGIN),
202 top = (int) Ctk.em_to_pixel (MARGIN),
203 bottom = (int) Ctk.em_to_pixel (MARGIN)
204 };
205 this.set_padding (padding);
206 this.notify["label"].connect (this._on_label_changed);
207 this.enter_event.connect (this._on_enter);
208 this.leave_event.connect (this._on_leave);
209 this.button_press_event.connect (this._on_mouse_down);
210
211 this.reactive = true;
212
213 old_width = 0;
214 old_height = 0;
215 old_label = "";
216 }
217
218 public QuicklistRadioMenuItem (GLib.SList? group)
219 {
220 Object (label: "",
221 group: group);
222 }
223
224 public QuicklistRadioMenuItem.with_label (GLib.SList? group, string label)
225 {
226 Object (label: label,
227 group: group);
228 }
229 }
230}
0231
=== added file 'unity-private/launcher/quicklist-seperator-menu-item.vala'
--- unity-private/launcher/quicklist-seperator-menu-item.vala 1970-01-01 00:00:00 +0000
+++ unity-private/launcher/quicklist-seperator-menu-item.vala 2010-07-14 16:07:41 +0000
@@ -0,0 +1,117 @@
1/* -*- Mode: vala; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- */
2/*
3 * Copyright (C) 2010 Canonical Ltd
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *
17 * Authored by Gordon Allott <gord.allott@canonical.com>,
18 * Mirco "MacSlow" Müller <mirco.mueller@canonical.com>
19 *
20 */
21
22namespace Unity.Launcher
23{
24 // we subclass Ctk.MenuSeperator here because we need to adapt it's appearance
25 public class QuicklistMenuSeperator : Ctk.MenuSeperator
26 {
27 Ctk.LayerActor seperator_background;
28 int old_width;
29 int old_height;
30
31 private override void
32 paint ()
33 {
34 this.seperator_background.paint ();
35 }
36
37 public override void
38 get_preferred_height (float for_width,
39 out float min_height_p,
40 out float natural_height_p)
41 {
42 min_height_p = (float) Ctk.em_to_pixel (GAP);
43 natural_height_p = min_height_p;
44 }
45
46 public override void
47 get_preferred_width (float for_height,
48 out float min_width_p,
49 out float natural_width_p)
50 {
51 min_width_p = (float) Ctk.em_to_pixel (2 * MARGIN);
52 natural_width_p = min_width_p;
53 }
54
55 private override void
56 allocate (Clutter.ActorBox box,
57 Clutter.AllocationFlags flags)
58 {
59 int w;
60 int h;
61
62 base.allocate (box, flags);
63 w = (int) (box.x2 - box.x1);
64 h = (int) (box.y2 - box.y1);
65
66 // exit early if the allocation-width/height didn't change, this is needed
67 // because clutter triggers calling allocate even if nothing changed
68 if ((old_width == w) && (old_height == h))
69 return;
70
71 this.seperator_background = new Ctk.LayerActor (w, h);
72
73 Ctk.Layer layer = new Ctk.Layer (w,
74 h,
75 Ctk.LayerRepeatMode.NONE,
76 Ctk.LayerRepeatMode.NONE);
77 Cairo.Surface fill_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
78 w,
79 h);
80 Cairo.Surface image_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
81 w,
82 h);
83 Cairo.Context fill_cr = new Cairo.Context (fill_surf);
84 Cairo.Context image_cr = new Cairo.Context (image_surf);
85
86 Unity.QuicklistRendering.Seperator.fill_mask (fill_cr);
87 Unity.QuicklistRendering.Seperator.image_background (image_cr, w, h);
88
89 layer.set_mask_from_surface (fill_surf);
90 layer.set_image_from_surface (image_surf);
91 layer.set_opacity (255);
92
93 this.seperator_background.add_layer (layer);
94
95 //this.set_background (this.seperator_background);
96 this.seperator_background.set_opacity (255);
97
98 this.seperator_background.set_parent (this);
99 this.seperator_background.map ();
100 this.seperator_background.show ();
101 }
102
103 construct
104 {
105 Ctk.Padding padding = Ctk.Padding () {
106 left = (int) Ctk.em_to_pixel (MARGIN),
107 right = (int) Ctk.em_to_pixel (MARGIN),
108 top = (int) Ctk.em_to_pixel (MARGIN),
109 bottom = (int) Ctk.em_to_pixel (MARGIN)
110 };
111 this.set_padding (padding);
112
113 old_width = 0;
114 old_height = 0;
115 }
116 }
117}
0118
=== modified file 'unity-private/launcher/quicklist-view.vala'
--- unity-private/launcher/quicklist-view.vala 2010-06-30 14:23:06 +0000
+++ unity-private/launcher/quicklist-view.vala 2010-07-14 16:07:41 +0000
@@ -39,305 +39,6 @@
39 const float ANCHOR_WIDTH = 0.75f;39 const float ANCHOR_WIDTH = 0.75f;
40 const float ANCHOR_WIDTH_ABS = 10.0f;40 const float ANCHOR_WIDTH_ABS = 10.0f;
4141
42 // we subclass Ctk.MenuSeperator here because we need to adapt it's appearance
43 public class QuicklistMenuSeperator : Ctk.MenuSeperator
44 {
45 Ctk.LayerActor seperator_background;
46 int old_width;
47 int old_height;
48
49 private override void
50 paint ()
51 {
52 this.seperator_background.paint ();
53 }
54
55 public override void
56 get_preferred_height (float for_width,
57 out float min_height_p,
58 out float natural_height_p)
59 {
60 min_height_p = (float) Ctk.em_to_pixel (GAP);
61 natural_height_p = min_height_p;
62 }
63
64 public override void
65 get_preferred_width (float for_height,
66 out float min_width_p,
67 out float natural_width_p)
68 {
69 min_width_p = (float) Ctk.em_to_pixel (2 * MARGIN);
70 natural_width_p = min_width_p;
71 }
72
73 private override void
74 allocate (Clutter.ActorBox box,
75 Clutter.AllocationFlags flags)
76 {
77 int w;
78 int h;
79
80 base.allocate (box, flags);
81 w = (int) (box.x2 - box.x1);
82 h = (int) (box.y2 - box.y1);
83
84 // exit early if the allocation-width/height didn't change, this is needed
85 // because clutter triggers calling allocate even if nothing changed
86 if ((old_width == w) && (old_height == h))
87 return;
88
89 // before creating a new CtkLayerActor make sure we don't leak any memory
90 if (this.seperator_background is Ctk.LayerActor)
91 this.seperator_background.destroy ();
92
93 this.seperator_background = new Ctk.LayerActor (w, h);
94
95 Ctk.Layer layer = new Ctk.Layer (w,
96 h,
97 Ctk.LayerRepeatMode.NONE,
98 Ctk.LayerRepeatMode.NONE);
99 Cairo.Surface fill_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
100 w,
101 h);
102 Cairo.Surface image_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
103 w,
104 h);
105 Cairo.Context fill_cr = new Cairo.Context (fill_surf);
106 Cairo.Context image_cr = new Cairo.Context (image_surf);
107
108 Unity.QuicklistRendering.Seperator.fill_mask (fill_cr);
109 Unity.QuicklistRendering.Seperator.image_background (image_cr, w, h);
110
111 layer.set_mask_from_surface (fill_surf);
112 layer.set_image_from_surface (image_surf);
113 layer.set_opacity (255);
114
115 this.seperator_background.add_layer (layer);
116
117 //this.set_background (this.seperator_background);
118 this.seperator_background.set_opacity (255);
119
120 this.seperator_background.set_parent (this);
121 this.seperator_background.map ();
122 this.seperator_background.show ();
123 }
124
125 construct
126 {
127 Ctk.Padding padding = Ctk.Padding () {
128 left = (int) Ctk.em_to_pixel (MARGIN),
129 right = (int) Ctk.em_to_pixel (MARGIN),
130 top = (int) Ctk.em_to_pixel (MARGIN),
131 bottom = (int) Ctk.em_to_pixel (MARGIN)
132 };
133 this.set_padding (padding);
134
135 old_width = 0;
136 old_height = 0;
137 }
138 }
139
140 // we subclass Ctk.MenuItem here because we need to adapt it's appearance
141 public class QuicklistMenuItem : Ctk.Actor
142 {
143 Ctk.LayerActor item_background;
144 int old_width;
145 int old_height;
146 string old_label;
147
148 private override void
149 paint ()
150 {
151 this.item_background.paint ();
152 }
153
154 public override void
155 get_preferred_height (float for_width,
156 out float min_height_p,
157 out float natural_height_p)
158 {
159 min_height_p = (float) Ctk.em_to_pixel (ITEM_HEIGHT);
160 natural_height_p = min_height_p;
161 }
162
163 public override void
164 get_preferred_width (float for_height,
165 out float min_width_p,
166 out float natural_width_p)
167 {
168 int width;
169 int height;
170 Gtk.Settings settings = Gtk.Settings.get_default ();
171 Unity.QuicklistRendering.Item.get_text_extents (settings.gtk_font_name,
172 this.label,
173 out width,
174 out height);
175 min_width_p = (float) width + (float) Ctk.em_to_pixel (2 * MARGIN);
176 natural_width_p = min_width_p;
177 }
178
179 private override void
180 allocate (Clutter.ActorBox box,
181 Clutter.AllocationFlags flags)
182 {
183 int w;
184 int h;
185 Clutter.Color white_color = Clutter.Color () {
186 red = 255,
187 green = 255,
188 blue = 255,
189 alpha = 255
190 };
191
192 base.allocate (box, flags);
193
194 w = (int) (box.x2 - box.x1);
195 h = (int) (box.y2 - box.y1);
196
197 // exit early if the allocation-width/height didn't change, this is needed
198 // because clutter triggers calling allocate even if nothing changed
199 if ((old_width == w) && (old_height == h))
200 return;
201
202 // store the new width/height
203 old_width = w;
204 old_height = h;
205
206 // before creating a new CtkLayerActor make sure we don't leak any memory
207 if (this.item_background is Ctk.LayerActor)
208 this.item_background.unparent ();
209 this.item_background = new Ctk.LayerActor (w, h);
210
211 Ctk.Layer normal_layer = new Ctk.Layer (w,
212 h,
213 Ctk.LayerRepeatMode.NONE,
214 Ctk.LayerRepeatMode.NONE);
215 Ctk.Layer selected_layer = new Ctk.Layer (w,
216 h,
217 Ctk.LayerRepeatMode.NONE,
218 Ctk.LayerRepeatMode.NONE);
219
220 Cairo.Surface normal_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
221 w,
222 h);
223 Cairo.Surface selected_surf = new Cairo.ImageSurface (Cairo.Format.ARGB32,
224 w,
225 h);
226
227 Cairo.Context normal_cr = new Cairo.Context (normal_surf);
228 Cairo.Context selected_cr = new Cairo.Context (selected_surf);
229 Gtk.Settings settings = Gtk.Settings.get_default ();
230
231 Unity.QuicklistRendering.Item.normal_mask (normal_cr,
232 w,
233 h,
234 settings.gtk_font_name,
235 this.label);
236 Unity.QuicklistRendering.Item.selected_mask (selected_cr,
237 w,
238 h,
239 settings.gtk_font_name,
240 this.label);
241
242 normal_layer.set_mask_from_surface (normal_surf);
243 normal_layer.set_color (white_color);
244
245 selected_layer.set_mask_from_surface (selected_surf);
246 selected_layer.set_color (white_color);
247
248 this.item_background.add_layer (normal_layer);
249 this.item_background.add_layer (selected_layer);
250
251 this.item_background.get_layer(0).set_enabled (true);
252 this.item_background.get_layer(1).set_enabled (false);
253 this.item_background.do_queue_redraw ();
254
255 this.item_background.set_parent (this);
256 this.item_background.map ();
257 this.item_background.show ();
258 }
259
260 private bool _on_enter (Clutter.Event event)
261 requires (this is QuicklistMenuItem)
262 {
263 this.item_background.get_layer(0).set_enabled (false);
264 this.item_background.get_layer(1).set_enabled (true);
265
266 // Ensure we are associated with a stage before queuing a draw to
267 // avoid a rather annoying (but rare) crash in clutter
268 if (this.get_stage () is Clutter.Stage)
269 this.do_queue_redraw ();
270 return false;
271 }
272
273 private bool _on_leave (Clutter.Event event)
274 requires (this is QuicklistMenuItem)
275 {
276 this.item_background.get_layer(0).set_enabled (true);
277 this.item_background.get_layer(1).set_enabled (false);
278 if (this.get_stage () is Clutter.Stage)
279 this.do_queue_redraw ();
280 return false;
281 }
282
283 private void _on_label_changed ()
284 {
285 // if the contents of the label didn't really change exit early
286 if (old_label == this.label)
287 return;
288
289 old_label = this.label;
290 }
291
292 public signal void activated ();
293 public string label {get; construct;}
294
295 private bool _on_mouse_down (Clutter.Event event)
296 {
297 this.notify["label"].disconnect (this._on_label_changed);
298 this.enter_event.disconnect (this._on_enter);
299 this.leave_event.disconnect (this._on_leave);
300 this.button_press_event.disconnect (this._on_mouse_down);
301 this.activated ();
302 return true;
303 }
304
305 public QuicklistMenuItem (string label)
306 {
307 Object (label:label);
308 }
309
310 ~QuicklistMenuItem ()
311 {
312 this.notify["label"].disconnect (this._on_label_changed);
313 this.enter_event.disconnect (this._on_enter);
314 this.leave_event.disconnect (this._on_leave);
315 this.button_press_event.disconnect (this._on_mouse_down);
316 }
317
318 construct
319 {
320 Ctk.Padding padding = Ctk.Padding () {
321 left = (int) Ctk.em_to_pixel (MARGIN),
322 right = (int) Ctk.em_to_pixel (MARGIN),
323 top = (int) Ctk.em_to_pixel (MARGIN),
324 bottom = (int) Ctk.em_to_pixel (MARGIN)
325 };
326 this.set_padding (padding);
327
328 this.notify["label"].connect (this._on_label_changed);
329 this.enter_event.connect (this._on_enter);
330 this.leave_event.connect (this._on_leave);
331 this.button_press_event.connect (this._on_mouse_down);
332
333 this.reactive = true;
334
335 old_width = 0;
336 old_height = 0;
337 old_label = "";
338 }
339 }
340
341 // we call this instead of Ctk.Menu so you can alter this to look right42 // we call this instead of Ctk.Menu so you can alter this to look right
342 public class QuicklistMenu : Ctk.Menu43 public class QuicklistMenu : Ctk.Menu
343 {44 {
34445
=== modified file 'unity-private/launcher/scrollerchild-controller.vala'
--- unity-private/launcher/scrollerchild-controller.vala 2010-06-24 11:22:50 +0000
+++ unity-private/launcher/scrollerchild-controller.vala 2010-07-14 16:07:41 +0000
@@ -47,6 +47,8 @@
47 protected float click_start_pos = 0.0f;47 protected float click_start_pos = 0.0f;
48 protected int drag_sensitivity = 7;48 protected int drag_sensitivity = 7;
4949
50 protected QuicklistController? menu {get; set;}
51
50 public ScrollerChildController (ScrollerChild child_)52 public ScrollerChildController (ScrollerChild child_)
51 {53 {
52 Object (child: child_);54 Object (child: child_);
@@ -70,7 +72,13 @@
7072
71 public abstract Gee.ArrayList<ShortcutItem> get_menu_shortcuts ();73 public abstract Gee.ArrayList<ShortcutItem> get_menu_shortcuts ();
72 public abstract Gee.ArrayList<ShortcutItem> get_menu_shortcut_actions ();74 public abstract Gee.ArrayList<ShortcutItem> get_menu_shortcut_actions ();
75
76 public delegate void menu_cb (Dbusmenu.Menuitem? menu);
77 public abstract void get_menu_actions (menu_cb callback);
78 public abstract void get_menu_navigation (menu_cb callback);
79
73 public abstract void activate ();80 public abstract void activate ();
81 public abstract QuicklistController get_menu_controller ();
7482
75 private bool on_leave_event (Clutter.Event event)83 private bool on_leave_event (Clutter.Event event)
76 {84 {
@@ -110,11 +118,14 @@
110 button_down == true &&118 button_down == true &&
111 event.button.time - last_press_time < 500)119 event.button.time - last_press_time < 500)
112 {120 {
113 var controller = QuicklistController.get_default ();121 if (menu is QuicklistController)
114 if (controller.is_in_label || controller.menu_is_open ())122 {
115 {123 if (menu.state == QuicklistControllerState.LABEL ||
116 controller.close_menu ();124 menu.state == QuicklistControllerState.MENU)
117 }125 {
126 menu.state = QuicklistControllerState.CLOSED;
127 }
128 }
118129
119 activate ();130 activate ();
120 }131 }
@@ -134,49 +145,34 @@
134 //no tooltips on drag145 //no tooltips on drag
135 if (Unity.Drag.Controller.get_default ().is_dragging) return;146 if (Unity.Drag.Controller.get_default ().is_dragging) return;
136147
137 var controller = QuicklistController.get_default ();148 if (menu is QuicklistController == false)
138 if (controller.menu_is_open () && controller.get_attached_actor () != child)149 {
150 menu = get_menu_controller ();
151 }
152
153 if (menu.state == QuicklistControllerState.MENU
154 && QuicklistController.is_menu_open ()
155 && QuicklistController.do_menus_match (menu))
139 {156 {
140 // there is a menu open already, attach to the destroy so we can157 // there is a menu open already, attach to the destroy so we can
141 // re-ensure later158 // re-ensure later
142 controller.menu.destroy.connect (ensure_menu_state);159 QuicklistController.get_current_menu ().get_view ().destroy.connect (ensure_menu_state);
143 return;160 return;
144 }161 }
145162
146 if (menu_state == ScrollerChildControllerMenuState.NO_MENU)163 if (menu_state == ScrollerChildControllerMenuState.NO_MENU)
147 {164 {
148 if (controller.is_in_label || controller.menu_is_open ())165 menu.state = QuicklistControllerState.CLOSED;
149 {
150 controller.close_menu ();
151 }
152 }166 }
153167
154 if (menu_state == ScrollerChildControllerMenuState.LABEL)168 if (menu_state == ScrollerChildControllerMenuState.LABEL)
155 {169 {
156 if (!controller.menu_is_open ())170 menu.state = QuicklistControllerState.LABEL;
157 {
158 if(Unity.Panel.search_entry_has_focus == false)
159 controller.show_label (name, child);
160 }
161 }171 }
162172
163 if (menu_state == ScrollerChildControllerMenuState.MENU)173 if (menu_state == ScrollerChildControllerMenuState.MENU)
164 {174 {
165 if (controller.is_in_label)175 menu.state = QuicklistControllerState.MENU;
166 {
167 Gee.ArrayList<ShortcutItem> shortcuts = get_menu_shortcuts ();
168 Gee.ArrayList<ShortcutItem> actions = get_menu_shortcut_actions ();
169 if (shortcuts.size > 0 || actions.size > 0)
170 {
171 controller.show_menu (shortcuts,
172 actions,
173 false);
174 }
175 else
176 {
177 menu_state = ScrollerChildControllerMenuState.LABEL;
178 }
179 }
180 }176 }
181 }177 }
182178
183179
=== modified file 'unity/Makefile.am'
--- unity/Makefile.am 2010-07-05 21:46:45 +0000
+++ unity/Makefile.am 2010-07-14 16:07:41 +0000
@@ -44,6 +44,7 @@
44 --pkg clutter-1.0 \44 --pkg clutter-1.0 \
45 --pkg clutk-0.3 \45 --pkg clutk-0.3 \
46 --pkg dbus-glib-1 \46 --pkg dbus-glib-1 \
47 --pkg Dbusmenu-Glib-0.2 \
47 --pkg dee-1.0 \48 --pkg dee-1.0 \
48 --pkg gconf-2.0 \49 --pkg gconf-2.0 \
49 --pkg gtk+-2.0 \50 --pkg gtk+-2.0 \
5051
=== modified file 'vapi/Bamf-0.2.vapi'
--- vapi/Bamf-0.2.vapi 2010-06-17 11:18:16 +0000
+++ vapi/Bamf-0.2.vapi 2010-07-14 16:07:41 +0000
@@ -2,139 +2,140 @@
22
3[CCode (cprefix = "Bamf", lower_case_cprefix = "bamf_")]3[CCode (cprefix = "Bamf", lower_case_cprefix = "bamf_")]
4namespace Bamf {4namespace Bamf {
5 [CCode (cheader_filename = "libbamf/libbamf.h")]5 [CCode (cheader_filename = "libbamf/libbamf.h")]
6 public class Application : Bamf.View {6 public class Application : Bamf.View {
7 public weak Bamf.View parent;7 public weak Bamf.View parent;
8 public Bamf.ApplicationPrivate priv;8 public Bamf.ApplicationPrivate priv;
9 public unowned string get_application_type ();9 public unowned string get_application_type ();
10 public unowned string get_desktop_file ();10 public unowned string get_desktop_file ();
11 public unowned GLib.List get_windows ();11 public unowned GLib.List<weak Bamf.Window> get_windows ();
12 public GLib.Array get_xids ();12 public GLib.Array get_xids ();
13 public signal void window_added (Bamf.View object);13 public signal void window_added (Bamf.View object);
14 public signal void window_removed (Bamf.View object);14 public signal void window_removed (Bamf.View object);
15 }15 }
16 [CCode (cheader_filename = "libbamf/libbamf.h")]16 [CCode (cheader_filename = "libbamf/libbamf.h")]
17 public class Control : GLib.Object {17 public class Control : GLib.Object {
18 public weak GLib.Object parent;18 public weak GLib.Object parent;
19 public Bamf.ControlPrivate priv;19 public Bamf.ControlPrivate priv;
20 public static Bamf.Control get_default ();20 public static Bamf.Control get_default ();
21 public void insert_desktop_file (string desktop_file);21 public void insert_desktop_file (string desktop_file);
22 public void register_application_for_pid (string application, int32 pid);22 public void register_application_for_pid (string application, int32 pid);
23 public void register_tab_provider (string path);23 public void register_tab_provider (string path);
24 }24 }
25 [CCode (cheader_filename = "libbamf/libbamf.h")]25 [CCode (cheader_filename = "libbamf/libbamf.h")]
26 public class Factory : GLib.Object {26 public class Indicator : Bamf.View {
27 public weak GLib.Object parent;27 public weak Bamf.View parent;
28 public Bamf.FactoryPrivate priv;28 public Bamf.IndicatorPrivate priv;
29 public static Bamf.Factory get_default ();29 public unowned string get_dbus_menu_path ();
30 public Bamf.View view_for_path (string path);30 public unowned string get_remote_address ();
31 }31 public unowned string get_remote_path ();
32 [CCode (cheader_filename = "libbamf/libbamf.h")]32 }
33 public class Matcher : GLib.Object {33 [CCode (cheader_filename = "libbamf/libbamf.h")]
34 public weak GLib.Object parent;34 public class Matcher : GLib.Object {
35 public Bamf.MatcherPrivate priv;35 public weak GLib.Object parent;
36 public bool application_is_running (string application);36 public Bamf.MatcherPrivate priv;
37 public Bamf.Application get_active_application ();37 public bool application_is_running (string application);
38 public Bamf.Window get_active_window ();38 public Bamf.Application get_active_application ();
39 public unowned Bamf.Application get_application_for_xid (uint32 xid);39 public Bamf.Window get_active_window ();
40 public unowned GLib.List get_applications ();40 public Bamf.Application get_application_for_xid (uint32 xid);
41 public static unowned Bamf.Matcher get_default ();41 public GLib.List<weak uint32> get_applications ();
42 public unowned GLib.List get_running_applications ();42 public static unowned Bamf.Matcher get_default ();
43 public unowned GLib.List get_tabs ();43 public GLib.List<weak Bamf.Application> get_running_applications ();
44 public GLib.Array get_xids_for_application (string application);44 public GLib.List<weak Bamf.View> get_tabs ();
45 public signal void active_application_changed (GLib.Object object, GLib.Object p0);45 public GLib.Array get_xids_for_application (string application);
46 public signal void active_window_changed (GLib.Object object, GLib.Object p0);46 public signal void active_application_changed (GLib.Object object, GLib.Object p0);
47 public signal void view_closed (GLib.Object object);47 public signal void active_window_changed (GLib.Object object, GLib.Object p0);
48 public signal void view_opened (GLib.Object object);48 public signal void view_closed (GLib.Object object);
49 }49 public signal void view_opened (GLib.Object object);
50 [CCode (cheader_filename = "libbamf/libbamf.h")]50 }
51 public class Tab : Bamf.View {51 [CCode (cheader_filename = "libbamf/libbamf.h")]
52 public weak Bamf.View parent;52 public class Tab : Bamf.View {
53 public Bamf.TabPrivate priv;53 public weak Bamf.View parent;
54 [CCode (has_construct_function = false)]54 public Bamf.TabPrivate priv;
55 public Tab (owned string id, owned string uri);55 [CCode (has_construct_function = false)]
56 public string get_id ();56 public Tab (owned string id, owned string uri);
57 public string get_preview ();57 public string get_id ();
58 public string get_uri ();58 public string get_preview ();
59 public void set_preview (owned string uri);59 public string get_uri ();
60 public void set_uri (owned string uri);60 public void set_preview (owned string uri);
61 public virtual void show ();61 public void set_uri (owned string uri);
62 public string id { get; set construct; }62 public virtual void show ();
63 public string preview { get; set; }63 public string id { get; set construct; }
64 public string uri { get; set construct; }64 public string preview { get; set; }
65 public signal void preview_updated ();65 public string uri { get; set construct; }
66 public signal void uri_changed (string object, string p0);66 public signal void preview_updated ();
67 }67 public signal void uri_changed (string object, string p0);
68 [CCode (cheader_filename = "libbamf/libbamf.h")]68 }
69 public class TabSource : GLib.Object {69 [CCode (cheader_filename = "libbamf/libbamf.h")]
70 public weak GLib.Object parent;70 public class TabSource : GLib.Object {
71 public Bamf.TabSourcePrivate priv;71 public weak GLib.Object parent;
72 public string[] get_tab_ids ();72 public Bamf.TabSourcePrivate priv;
73 public GLib.Array get_tab_preview (owned string tab_id);73 public string[] get_tab_ids ();
74 public string get_tab_uri (owned string tab_id);74 public GLib.Array get_tab_preview (owned string tab_id);
75 public uint32 get_tab_xid (owned string tab_id);75 public string get_tab_uri (owned string tab_id);
76 public virtual void show_tab (owned string tab_id);76 public uint32 get_tab_xid (owned string tab_id);
77 public virtual string[] tab_ids ();77 public virtual void show_tab (owned string tab_id);
78 public virtual GLib.Array tab_preview (owned string tab_id);78 public virtual string[] tab_ids ();
79 public virtual string tab_uri (owned string tab_id);79 public virtual GLib.Array tab_preview (owned string tab_id);
80 public virtual uint32 tab_xid (owned string tab_id);80 public virtual string tab_uri (owned string tab_id);
81 public string id { get; set construct; }81 public virtual uint32 tab_xid (owned string tab_id);
82 public signal void tab_closed (string object);82 public string id { get; set construct; }
83 public signal void tab_opened (string object);83 public signal void tab_closed (string object);
84 public signal void tab_uri_changed (string object, string p0, string p1);84 public signal void tab_opened (string object);
85 }85 public signal void tab_uri_changed (string object, string p0, string p1);
86 [CCode (cheader_filename = "libbamf/libbamf.h")]86 }
87 public class View : GLib.Object {87 [CCode (cheader_filename = "libbamf/libbamf.h")]
88 public weak GLib.Object parent;88 public class View : GLib.Object {
89 public Bamf.ViewPrivate priv;89 public weak GLib.Object parent;
90 public virtual GLib.List get_children ();90 public Bamf.ViewPrivate priv;
91 public virtual string get_icon ();91 public virtual GLib.List get_children ();
92 public virtual string get_name ();92 public virtual string get_icon ();
93 public string get_view_type ();93 public virtual string get_name ();
94 public virtual bool is_active ();94 public string get_view_type ();
95 public virtual bool is_running ();95 public virtual bool is_active ();
96 public virtual bool is_urgent ();96 public virtual bool is_running ();
97 public bool user_visible ();97 public virtual bool is_urgent ();
98 public virtual string view_type ();98 public bool user_visible ();
99 public string path { get; set construct; }99 public virtual unowned string view_type ();
100 public signal void active_changed (bool object);100 public string path { get; set construct; }
101 public signal void child_added (Bamf.View object);101 public signal void active_changed (bool object);
102 public signal void child_removed (Bamf.View object);102 public signal void child_added (Bamf.View object);
103 public signal void closed ();103 public signal void child_removed (Bamf.View object);
104 public signal void running_changed (bool object);104 public signal void closed ();
105 public signal void urgent_changed (bool object);105 public signal void running_changed (bool object);
106 public signal void user_visible_changed (bool object);106 public signal void urgent_changed (bool object);
107 }107 public signal void user_visible_changed (bool object);
108 [CCode (cheader_filename = "libbamf/libbamf.h")]108 }
109 public class Window : Bamf.View {109 [CCode (cheader_filename = "libbamf/libbamf.h")]
110 public weak Bamf.View parent;110 public class Window : Bamf.View {
111 public Bamf.WindowPrivate priv;111 public weak Bamf.View parent;
112 public Bamf.Window get_transient ();112 public Bamf.WindowPrivate priv;
113 public uint32 get_xid ();113 public Bamf.Window get_transient ();
114 public time_t last_active ();114 public uint32 get_xid ();
115 }115 public time_t last_active ();
116 [CCode (type_id = "BAMF_TYPE_APPLICATION_PRIVATE", cheader_filename = "libbamf/libbamf.h")]116 }
117 public struct ApplicationPrivate {117 [CCode (type_id = "BAMF_TYPE_APPLICATION_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
118 }118 public struct ApplicationPrivate {
119 [CCode (type_id = "BAMF_TYPE_CONTROL_PRIVATE", cheader_filename = "libbamf/libbamf.h")]119 }
120 public struct ControlPrivate {120 [CCode (type_id = "BAMF_TYPE_CONTROL_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
121 }121 public struct ControlPrivate {
122 [CCode (type_id = "BAMF_TYPE_FACTORY_PRIVATE", cheader_filename = "libbamf/libbamf.h")]122 }
123 public struct FactoryPrivate {123 [CCode (type_id = "BAMF_TYPE_INDICATOR_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
124 }124 public struct IndicatorPrivate {
125 [CCode (type_id = "BAMF_TYPE_MATCHER_PRIVATE", cheader_filename = "libbamf/libbamf.h")]125 }
126 public struct MatcherPrivate {126 [CCode (type_id = "BAMF_TYPE_MATCHER_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
127 }127 public struct MatcherPrivate {
128 [CCode (type_id = "BAMF_TYPE_TAB_PRIVATE", cheader_filename = "libbamf/libbamf.h")]128 }
129 public struct TabPrivate {129 [CCode (type_id = "BAMF_TYPE_TAB_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
130 }130 public struct TabPrivate {
131 [CCode (type_id = "BAMF_TYPE_TAB_SOURCE_PRIVATE", cheader_filename = "libbamf/libbamf.h")]131 }
132 public struct TabSourcePrivate {132 [CCode (type_id = "BAMF_TYPE_TAB_SOURCE_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
133 }133 public struct TabSourcePrivate {
134 [CCode (type_id = "BAMF_TYPE_VIEW_PRIVATE", cheader_filename = "libbamf/libbamf.h")]134 }
135 public struct ViewPrivate {135 [CCode (type_id = "BAMF_TYPE_VIEW_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
136 }136 public struct ViewPrivate {
137 [CCode (type_id = "BAMF_TYPE_WINDOW_PRIVATE", cheader_filename = "libbamf/libbamf.h")]137 }
138 public struct WindowPrivate {138 [CCode (type_id = "BAMF_TYPE_WINDOW_PRIVATE", cheader_filename = "libbamf/libbamf.h")]
139 }139 public struct WindowPrivate {
140 }
140}141}
141142
=== added file 'vapi/Dbusmenu-Glib-0.2.vapi'
--- vapi/Dbusmenu-Glib-0.2.vapi 1970-01-01 00:00:00 +0000
+++ vapi/Dbusmenu-Glib-0.2.vapi 2010-07-14 16:07:41 +0000
@@ -0,0 +1,173 @@
1/* Dbusmenu-Glib-0.2.vapi generated by vapigen, do not modify. */
2
3[CCode (cprefix = "Dbusmenu", lower_case_cprefix = "dbusmenu_")]
4namespace Dbusmenu {
5 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
6 public class Client : GLib.Object {
7 public weak GLib.Object parent;
8 [CCode (has_construct_function = false)]
9 public Client (string name, string object);
10 public bool add_type_handler (string type, Dbusmenu.ClientTypeHandler newfunc);
11 public Dbusmenu.Menuitem get_root ();
12 public void send_about_to_show (int id, void* cb, void* cb_data);
13 public void send_event (int id, string name, GLib.Value value, uint timestamp);
14 public string dbus_name { get; construct; }
15 public string dbus_object { get; construct; }
16 public signal void layout_updated ();
17 public signal void new_menuitem (GLib.Object object);
18 public signal void root_changed (GLib.Object object);
19 }
20 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
21 public class Menuitem : GLib.Object {
22 public weak GLib.Object parent;
23 [CCode (has_construct_function = false)]
24 public Menuitem ();
25 public bool child_add_position (Dbusmenu.Menuitem child, uint position);
26 public bool child_append (Dbusmenu.Menuitem child);
27 public bool child_delete (Dbusmenu.Menuitem child);
28 public Dbusmenu.Menuitem child_find (int id);
29 public bool child_prepend (Dbusmenu.Menuitem child);
30 public bool child_reorder (Dbusmenu.Menuitem child, uint position);
31 public Dbusmenu.Menuitem find_id (int id);
32 public void @foreach (void* func, void* data);
33 public unowned GLib.List get_children ();
34 public int get_id ();
35 public uint get_position (Dbusmenu.Menuitem parent);
36 public uint get_position_realized (Dbusmenu.Menuitem parent);
37 public bool get_root ();
38 public virtual void handle_event (string name, GLib.Value? value, uint timestamp);
39 public GLib.HashTable properties_copy ();
40 public GLib.List properties_list ();
41 public bool property_exist (string property);
42 public unowned string property_get (string property);
43 public bool property_get_bool (string property);
44 public int property_get_int (string property);
45 public GLib.Value property_get_value (string property);
46 public void property_remove (string property);
47 public bool property_set (string property, string value);
48 public bool property_set_bool (string property, bool value);
49 public bool property_set_int (string property, int value);
50 public bool property_set_value (string property, GLib.Value value);
51 public virtual void send_about_to_show (Dbusmenu.menuitem_about_to_show_cb cb, void* cb_data);
52 public void set_root (bool root);
53 public GLib.List take_children ();
54 [CCode (has_construct_function = false)]
55 public Menuitem.with_id (int id);
56 public int id { get; construct; }
57 public signal void child_added (GLib.Object object, uint p0);
58 public signal void child_moved (GLib.Object object, uint p0, uint p1);
59 public signal void child_removed (GLib.Object object);
60 public signal void item_activated (uint object);
61 public signal void property_changed (string property_name, void* value);
62 public signal void realized ();
63 }
64 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
65 public class MenuitemProxy : Dbusmenu.Menuitem {
66 public weak Dbusmenu.Menuitem parent;
67 [CCode (has_construct_function = false)]
68 public MenuitemProxy (Dbusmenu.Menuitem mi);
69 public Dbusmenu.Menuitem get_wrapped ();
70 public Dbusmenu.Menuitem menu_item { get; construct; }
71 }
72 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
73 public class Server : GLib.Object {
74 public weak GLib.Object parent;
75 [CCode (has_construct_function = false)]
76 public Server (string object);
77 public void set_root (Dbusmenu.Menuitem root);
78 public string dbus_object { get; construct; }
79 public Dbusmenu.Menuitem root_node { get; set; }
80 public uint version { get; }
81 public signal void item_property_updated (int object, string p0, GLib.Value p1);
82 public signal void item_updated (int object);
83 public signal void layout_updated (uint object, int p0);
84 }
85 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h", has_target = false)]
86 public delegate bool ClientTypeHandler (Dbusmenu.Menuitem newitem, Dbusmenu.Menuitem parent, Dbusmenu.Client client);
87 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h", has_target = false)]
88 public delegate void menuitem_about_to_show_cb (Dbusmenu.Menuitem mi, void* user_data);
89 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h", has_target = false)]
90 public delegate void menuitem_buildxml_slot_t (Dbusmenu.Menuitem mi, ref unowned string[] stringarray);
91 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
92 public const string CLIENT_PROP_DBUS_NAME;
93 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
94 public const string CLIENT_PROP_DBUS_OBJECT;
95 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
96 public const string CLIENT_SIGNAL_LAYOUT_UPDATED;
97 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
98 public const string CLIENT_SIGNAL_NEW_MENUITEM;
99 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
100 public const string CLIENT_SIGNAL_ROOT_CHANGED;
101 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
102 public const string CLIENT_TYPES_DEFAULT;
103 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
104 public const string CLIENT_TYPES_IMAGE;
105 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
106 public const string CLIENT_TYPES_SEPARATOR;
107 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
108 public const string MENUITEM_CHILD_DISPLAY_SUBMENU;
109 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
110 public const string MENUITEM_ICON_NAME_BLANK;
111 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
112 public const string MENUITEM_PROP_CHILD_DISPLAY;
113 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
114 public const string MENUITEM_PROP_ENABLED;
115 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
116 public const string MENUITEM_PROP_ICON_DATA;
117 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
118 public const string MENUITEM_PROP_ICON_NAME;
119 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
120 public const string MENUITEM_PROP_LABEL;
121 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
122 public const string MENUITEM_PROP_SHORTCUT;
123 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
124 public const string MENUITEM_PROP_TOGGLE_STATE;
125 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
126 public const string MENUITEM_PROP_TOGGLE_TYPE;
127 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
128 public const string MENUITEM_PROP_TYPE;
129 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
130 public const string MENUITEM_PROP_VISIBLE;
131 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
132 public const string MENUITEM_SHORTCUT_ALT;
133 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
134 public const string MENUITEM_SHORTCUT_CONTROL;
135 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
136 public const string MENUITEM_SHORTCUT_SHIFT;
137 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
138 public const string MENUITEM_SHORTCUT_SUPER;
139 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
140 public const string MENUITEM_SIGNAL_CHILD_ADDED;
141 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
142 public const string MENUITEM_SIGNAL_CHILD_MOVED;
143 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
144 public const string MENUITEM_SIGNAL_CHILD_REMOVED;
145 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
146 public const string MENUITEM_SIGNAL_ITEM_ACTIVATED;
147 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
148 public const string MENUITEM_SIGNAL_PROPERTY_CHANGED;
149 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
150 public const string MENUITEM_SIGNAL_REALIZED;
151 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
152 public const string MENUITEM_TOGGLE_CHECK;
153 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
154 public const string MENUITEM_TOGGLE_RADIO;
155 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
156 public const int MENUITEM_TOGGLE_STATE_CHECKED;
157 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
158 public const int MENUITEM_TOGGLE_STATE_UNCHECKED;
159 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
160 public const int MENUITEM_TOGGLE_STATE_UNKNOWN;
161 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
162 public const string SERVER_PROP_DBUS_OBJECT;
163 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
164 public const string SERVER_PROP_ROOT_NODE;
165 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
166 public const string SERVER_PROP_VERSION;
167 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
168 public const string SERVER_SIGNAL_ID_PROP_UPDATE;
169 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
170 public const string SERVER_SIGNAL_ID_UPDATE;
171 [CCode (cheader_filename = "libdbusmenu-glib/client.h,libdbusmenu-glib/menuitem-proxy.h,libdbusmenu-glib/menuitem.h,libdbusmenu-glib/server.h")]
172 public const string SERVER_SIGNAL_LAYOUT_UPDATED;
173}
0174
=== modified file 'vapi/clutk-0.3.vapi'
--- vapi/clutk-0.3.vapi 2010-07-06 16:13:23 +0000
+++ vapi/clutk-0.3.vapi 2010-07-14 16:07:41 +0000
@@ -85,6 +85,20 @@
85 public virtual signal void show_context_menu (uint event_time);85 public virtual signal void show_context_menu (uint event_time);
86 }86 }
87 [CCode (cheader_filename = "clutk/clutk.h")]87 [CCode (cheader_filename = "clutk/clutk.h")]
88 public class CheckMenuItem : Ctk.MenuItem, Clutter.Scriptable, Ctk.Focusable, Clutter.Container {
89 [CCode (has_construct_function = false)]
90 public CheckMenuItem ();
91 public bool get_active ();
92 public bool get_inconsistent ();
93 public void set_active (bool is_active);
94 public void set_inconsistent (bool setting);
95 [CCode (has_construct_function = false)]
96 public CheckMenuItem.with_label (string label);
97 public bool active { get; set; }
98 public bool inconsistent { get; set; }
99 public virtual signal void toggled ();
100 }
101 [CCode (cheader_filename = "clutk/clutk.h")]
88 public class Effect : GLib.InitiallyUnowned {102 public class Effect : GLib.InitiallyUnowned {
89 public unowned Clutter.Animation animate (ulong mode, uint duration, ...);103 public unowned Clutter.Animation animate (ulong mode, uint duration, ...);
90 public unowned Clutter.Actor get_actor ();104 public unowned Clutter.Actor get_actor ();
@@ -212,6 +226,16 @@
212 public string stock_id { owned get; set; }226 public string stock_id { owned get; set; }
213 }227 }
214 [CCode (cheader_filename = "clutk/clutk.h")]228 [CCode (cheader_filename = "clutk/clutk.h")]
229 public class ImageMenuItem : Ctk.MenuItem, Clutter.Scriptable, Ctk.Focusable, Clutter.Container {
230 [CCode (has_construct_function = false)]
231 public ImageMenuItem ();
232 public unowned Gdk.Pixbuf get_image ();
233 public void set_image (Gdk.Pixbuf pixbuf);
234 [CCode (has_construct_function = false)]
235 public ImageMenuItem.with_label (string label);
236 public Gdk.Pixbuf image { get; set; }
237 }
238 [CCode (cheader_filename = "clutk/clutk.h")]
215 public class Layer : GLib.Object {239 public class Layer : GLib.Object {
216 [CCode (has_construct_function = false)]240 [CCode (has_construct_function = false)]
217 public Layer (uint width, uint height, Ctk.LayerRepeatMode image_repeat, Ctk.LayerRepeatMode mask_repeat);241 public Layer (uint width, uint height, Ctk.LayerRepeatMode image_repeat, Ctk.LayerRepeatMode mask_repeat);
@@ -318,11 +342,39 @@
318 public virtual signal void activated ();342 public virtual signal void activated ();
319 }343 }
320 [CCode (cheader_filename = "clutk/clutk.h")]344 [CCode (cheader_filename = "clutk/clutk.h")]
321 public class MenuSeperator : Ctk.Actor, Clutter.Scriptable, Ctk.Focusable {345 public class MenuSeperator : Ctk.MenuItem, Clutter.Scriptable, Ctk.Focusable, Clutter.Container {
322 [CCode (has_construct_function = false)]346 [CCode (has_construct_function = false)]
323 public MenuSeperator ();347 public MenuSeperator ();
324 }348 }
325 [Compact]349 [Compact]
350 [CCode (cheader_filename = "clutk/clutk.h")]
351 public class ProjectedTextureVertex {
352 public Cogl.Color color;
353 public float q;
354 public float r;
355 public float s;
356 public float t;
357 public float w;
358 public float x;
359 public float y;
360 public float z;
361 }
362 [CCode (cheader_filename = "clutk/clutk.h")]
363 public class RadioMenuItem : Ctk.CheckMenuItem, Clutter.Scriptable, Ctk.Focusable, Clutter.Container {
364 [CCode (has_construct_function = false)]
365 public RadioMenuItem (GLib.SList group);
366 public unowned GLib.SList get_group ();
367 public void set_group (GLib.SList group);
368 [CCode (has_construct_function = false)]
369 public RadioMenuItem.with_label (GLib.SList group, string label);
370 public void* group { get; set; }
371 public virtual signal void group_changed ();
372 }
373 [Compact]
374 [CCode (cheader_filename = "clutk/clutk.h")]
375 public class RadioMenuItemClass {
376 }
377 [Compact]
326 [CCode (type_id = "CTK_TYPE_RENDER_TARGET", cheader_filename = "clutk/clutk.h")]378 [CCode (type_id = "CTK_TYPE_RENDER_TARGET", cheader_filename = "clutk/clutk.h")]
327 public class RenderTarget {379 public class RenderTarget {
328 [CCode (has_construct_function = false)]380 [CCode (has_construct_function = false)]
@@ -511,5 +563,7 @@
511 [CCode (cheader_filename = "clutk/clutk.h")]563 [CCode (cheader_filename = "clutk/clutk.h")]
512 public static double pixel_to_em (int pixel_value);564 public static double pixel_to_em (int pixel_value);
513 [CCode (cheader_filename = "clutk/clutk.h")]565 [CCode (cheader_filename = "clutk/clutk.h")]
566 public static void render_projected_polygon (Ctk.ProjectedTextureVertex V, uint tex_id, int window_w, int window_h);
567 [CCode (cheader_filename = "clutk/clutk.h")]
514 public static void surface_blur (Cairo.Surface surface, uint radius);568 public static void surface_blur (Cairo.Surface surface, uint radius);
515}569}
516570
=== modified file 'vapi/indicator.vapi'
--- vapi/indicator.vapi 2010-06-03 17:13:55 +0000
+++ vapi/indicator.vapi 2010-07-14 16:07:41 +0000
@@ -2,11 +2,12 @@
22
3[CCode (cprefix = "Indicator", lower_case_cprefix = "indicator_")]3[CCode (cprefix = "Indicator", lower_case_cprefix = "indicator_")]
4namespace Indicator {4namespace Indicator {
5 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h")]5 [CCode (cheader_filename = "gtk/gtk.h,libindicator/indicator.h,libindicator/indicator-object.h,libindicator/indicator-service.h,libindicator/indicator-service-manager.h,libindicator/indicator-desktop-shortcuts.h")]
6 public class DesktopShortcuts : GLib.Object {6 public class DesktopShortcuts : GLib.Object {
7 [CCode (has_construct_function = false)]7 [CCode (has_construct_function = false)]
8 public DesktopShortcuts (string file, string identity);8 public DesktopShortcuts (string file, string identity);
9 public unowned string get_nicks ();9 [CCode (array_length = false, array_null_terminated = true)]
10 public unowned string[] get_nicks ();
10 public bool nick_exec (string nick);11 public bool nick_exec (string nick);
11 public unowned string nick_get_name (string nick);12 public unowned string nick_get_name (string nick);
12 public string desktop_file { construct; }13 public string desktop_file { construct; }