Merge lp:~cairo-dock-team/cairo-dock-plug-ins/ubuntu into lp:ubuntu/maverick/cairo-dock-plug-ins
- ubuntu
- Merge into maverick
Status: | Merged |
---|---|
Merged at revision: | 18 |
Proposed branch: | lp:~cairo-dock-team/cairo-dock-plug-ins/ubuntu |
Merge into: | lp:ubuntu/maverick/cairo-dock-plug-ins |
Diff against target: |
32384 lines (+9649/-7804) 108 files modified
CMakeLists.txt (+15/-16) Dbus/src/applet-dbus.c (+11/-7) Dbus/src/interface-applet-methods.c (+2/-2) Dbus/src/interface-applet-object.c (+2/-2) Dbus/src/interface-applet-signals.c (+1/-1) Folders/src/applet-notifications.c (+6/-6) GMenu/src/applet-util.c (+1/-1) Indicator-applet/indicator-applet.c (+23/-7) MeMenu/src/applet-me.c (+4/-4) MeMenu/src/applet-menu.c (+1/-1) Messaging-Menu/src/applet-menu.c (+4/-4) Messaging-Menu/src/applet-messaging.c (+3/-3) RSSreader/src/applet-draw.c (+1/-0) Remote-Control/CMakeLists.txt (+2/-0) Remote-Control/data/CMakeLists.txt (+11/-0) Remote-Control/data/Remote-Control.conf.in (+14/-0) Remote-Control/data/arrows.svg (+289/-0) Remote-Control/src/CMakeLists.txt (+40/-0) Remote-Control/src/applet-config.c (+51/-0) Remote-Control/src/applet-config.h (+30/-0) Remote-Control/src/applet-icon-finder.c (+257/-0) Remote-Control/src/applet-icon-finder.h (+40/-0) Remote-Control/src/applet-init.c (+66/-0) Remote-Control/src/applet-init.h (+31/-0) Remote-Control/src/applet-notifications.c (+480/-0) Remote-Control/src/applet-notifications.h (+45/-0) Remote-Control/src/applet-session.c (+154/-0) Remote-Control/src/applet-session.h (+38/-0) Remote-Control/src/applet-struct.h (+51/-0) Scooby-Do/data/CMakeLists.txt (+0/-1) Scooby-Do/data/Scooby-Do.conf.in (+0/-3) Scooby-Do/data/arrows.svg (+0/-289) Scooby-Do/src/applet-appli-finder.h (+0/-2) Scooby-Do/src/applet-config.c (+0/-9) Scooby-Do/src/applet-draw.c (+3/-50) Scooby-Do/src/applet-icon-finder.c (+9/-209) Scooby-Do/src/applet-icon-finder.h (+0/-1) Scooby-Do/src/applet-init.c (+10/-16) Scooby-Do/src/applet-notifications.c (+85/-364) Scooby-Do/src/applet-notifications.h (+0/-4) Scooby-Do/src/applet-search.c (+1/-1) Scooby-Do/src/applet-session.c (+51/-53) Scooby-Do/src/applet-session.h (+3/-5) Scooby-Do/src/applet-struct.h (+2/-33) Status-Notifier/src/applet-draw.c (+13/-12) Status-Notifier/src/applet-host.c (+19/-19) Status-Notifier/src/applet-init.c (+4/-1) Status-Notifier/src/applet-item.c (+32/-38) Status-Notifier/src/applet-notifications.c (+5/-6) System-Monitor/src/applet-config.c (+0/-7) System-Monitor/src/applet-struct.h (+12/-2) clock/src/CMakeLists.txt (+2/-1) clock/src/applet-backend-default.c (+34/-6) clock/src/applet-backend-ical.c (+5/-3) clock/src/applet-calendar.c (+91/-0) clock/src/applet-calendar.h (+2/-0) clock/src/applet-config.c (+1/-0) clock/src/applet-draw.c (+15/-384) clock/src/applet-draw.h (+0/-12) clock/src/applet-init.c (+1/-6) clock/src/applet-struct.h (+3/-0) clock/src/applet-timer.c (+506/-0) clock/src/applet-timer.h (+35/-0) debian/changelog (+46/-0) debian/control (+3/-3) dock-rendering/src/rendering-rainbow.c (+14/-14) kde-integration/src/applet-vfs.c (+2/-1) mail/src/cd-mail-applet-etpan.c (+1/-1) mail/src/cd-mail-applet-notifications.c (+29/-9) musicPlayer/src/applet-draw.c (+12/-9) musicPlayer/src/applet-mpris.c (+14/-4) musicPlayer/src/applet-rhythmbox.c (+1/-1) netspeed/data/netspeed (+1/-1) po/ar.po (+366/-258) po/cairo-dock.pot (+375/-379) po/cs.po (+2/-2) po/de.po (+2/-2) po/en.po (+2/-2) po/es.po (+478/-431) po/et.po (+421/-412) po/fr.po (+481/-438) po/hu.po (+2/-2) po/it.po (+477/-431) po/ja.po (+2/-2) po/nl.po (+473/-427) po/pt.po (+493/-481) po/pt_BR.po (+489/-447) po/ru.po (+472/-426) po/sk.po (+2/-2) po/sr.po (+366/-258) po/sv.po (+2/-2) po/tr.po (+2/-2) po/uk.po (+481/-433) po/zh_CN.po (+922/-805) po/zh_TW.po (+477/-430) shortcuts/src/applet-bookmarks.c (+4/-4) shortcuts/src/applet-drives.c (+9/-9) shortcuts/src/applet-load-icons.c (+7/-7) shortcuts/src/applet-notifications.c (+2/-2) slider/src/applet-notifications.c (+13/-10) switcher/src/applet-draw.c (+58/-51) systray/src/systray-init.c (+1/-1) terminal/src/terminal-widget.c (+2/-2) tomboy/src/tomboy-notifications.c (+18/-4) weather/src/applet-notifications.c (+4/-4) weblets/src/applet-notifications.c (+1/-1) wifi/src/applet-notifications.c (+2/-2) xfce-integration/src/applet-utils.c (+1/-1) |
To merge this branch: | bzr merge lp:~cairo-dock-team/cairo-dock-plug-ins/ubuntu |
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Matthieu Baerts | Approve | ||
Didier Roche-Tolomelli | Approve | ||
Review via email: mp+36278@code.launchpad.net |
This proposal supersedes a proposal from 2010-09-16.
Commit message
Description of the change
Didier Roche-Tolomelli (didrocks) wrote : | # |
Didier Roche-Tolomelli (didrocks) wrote : | # |
ok, approved. Please don't use "maverick" in debian/changelog as long as it's unreleased…
For instance, I'm adding one line there and the bzr history won't be clear enough. Can you pull lp:~didrocks/cairo-dock-plug-ins/fix-abi-transition, please?
- 18. By Didier Roche-Tolomelli
-
debian/control: depends on latest libindicator-dev (LP: #637692)
Matthieu Baerts (matttbe) wrote : | # |
@Didier: Thank you :)
- 19. By Matthieu Baerts
-
* New Upstream Version (LP: #653702)
* Fixed a few bugs:
- All .mo files aren't installed into the right directory (LP: #653336)
- Dbus: Fixed a crash when exiting Cairo-Dock
- Indicator: Some modifications needed for the latest
version of libindicator
- RSSreader: Prevented a crash if myDrawContext != NULL
- Clock: Prevented a crash if myDrawContext != NULL
- Switcher:
- Prevented a crash if myDrawContext != NULL
- Fixed a crash if the plugin is launched much time before the WM
- musicPlayer:
- Used the right image set from the config panel
- MPRIS plugin: fixed a bug with the tracknumber
- Systray: not drawn outside the screen.
- tomboy: not popup a dialogue inside the screen
- xfce-integration: displayed a window when logout applet is launched
* debian/control:
- Updated the version of cairo-dock-dev and cairo-dock-core
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2010-09-07 00:39:20 +0000 |
3 | +++ CMakeLists.txt 2010-10-02 18:13:46 +0000 |
4 | @@ -10,7 +10,7 @@ |
5 | ########### project ############### |
6 | |
7 | project ("cairo-dock-plugins") |
8 | -set (VERSION "2.2.0-0rc1") |
9 | +set (VERSION "2.2.0-4") |
10 | |
11 | add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall |
12 | if (NOT ${CMAKE_BUILD_TYPE}) |
13 | @@ -23,7 +23,7 @@ |
14 | set (CPACK_SOURCE_GENERATOR "TGZ") |
15 | set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}") |
16 | set (CPACK_SOURCE_IGNORE_FILES |
17 | - "/build/;/.bzr/;bzrignore$;/misc/;/en_GB.po$;~$;${CPACK_SOURCE_IGNORE_FILES}") |
18 | + "/build/;/.bzr/;bzrignore$;/misc/;en_GB.po$;~$;${CPACK_SOURCE_IGNORE_FILES}") |
19 | include (CPack) |
20 | |
21 | add_custom_target( dist |
22 | @@ -45,34 +45,33 @@ |
23 | |
24 | set (PACKAGE ${CMAKE_PROJECT_NAME}) |
25 | set (GETTEXT_PACKAGE ${PACKAGE}) |
26 | + # CMAKE_INSTALL_PREFIX = /usr |
27 | execute_process( |
28 | - COMMAND pkg-config cairo-dock --variable=pluginsdir |
29 | + COMMAND pkg-config cairo-dock --variable=pluginsdir # /usr/lib/cairo-dock |
30 | OUTPUT_VARIABLE pluginsdir) |
31 | STRING (REGEX REPLACE "\n" "" pluginsdir ${pluginsdir}) # la commande rajoute un retour chariot ... |
32 | execute_process( |
33 | - COMMAND pkg-config cairo-dock --variable=pluginsdatadir |
34 | + COMMAND pkg-config cairo-dock --variable=pluginsdatadir # /usr/share/cairo-dock/plug-ins |
35 | OUTPUT_VARIABLE pluginsdatadir) |
36 | STRING (REGEX REPLACE "\n" "" pluginsdatadir ${pluginsdatadir}) |
37 | execute_process( |
38 | - COMMAND pkg-config --modversion cairo-dock |
39 | + COMMAND pkg-config --modversion cairo-dock # 2.2.0-3 |
40 | OUTPUT_VARIABLE dock_version) |
41 | STRING (REGEX REPLACE "\n" "" dock_version ${dock_version}) |
42 | -if (NOT "${dock_version}" STREQUAL "${VERSION}") |
43 | +if (NOT "${dock_version}" STREQUAL "${VERSION}") # Version |
44 | MESSAGE (FATAL_ERROR "warning : version mismatch with the core : " ${VERSION} <> ${dock_version}) |
45 | endif() |
46 | set (GETTEXT_PLUGINS "cairo-dock-plugins") |
47 | |
48 | -if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND "${LIB_SUFFIX}" STREQUAL "" AND "${FORCE_NOT_LIB64}" STREQUAL "" ) |
49 | - set (libdir lib64/cairo-dock) |
50 | -elseif( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT "${FORCE_NOT_LIB64}" STREQUAL "" ) |
51 | - set (libdir lib${LIB_SUFFIX}/cairo-dock) |
52 | +if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT "${FORCE_LIB64}" STREQUAL "") # 64bits and force install in lib64 |
53 | + set (libdir ${CMAKE_INSTALL_PREFIX}/lib64) |
54 | else() |
55 | - set (libdir lib${LIB_SUFFIX}/cairo-dock) |
56 | + set (libdir ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) # /usr/lib |
57 | endif() |
58 | |
59 | -if (NOT "${pluginsdir}" STREQUAL "${CMAKE_INSTALL_PREFIX}/${libdir}") |
60 | - message (STATUS "Warning : plug-ins should be installed in the same place asthe dock, that is to say in ${pluginsdir}") |
61 | - STRING (REGEX REPLACE "/${libdir}" "" CMAKE_INSTALL_PREFIX ${pluginsdir}) |
62 | +if (NOT "${pluginsdir}" STREQUAL "${libdir}/cairo-dock") |
63 | + message (STATUS "Warning : plug-ins should be installed in the same directory as the core, that is to say in ${pluginsdir}") |
64 | + STRING (REGEX REPLACE "/${libdir}/cairo-dock" "" CMAKE_INSTALL_PREFIX ${pluginsdir}) |
65 | endif() |
66 | set (localedir "${CMAKE_INSTALL_PREFIX}/share/locale") |
67 | set (gaugesdir "${CMAKE_INSTALL_PREFIX}/share/cairo-dock/gauges") |
68 | @@ -559,7 +558,7 @@ |
69 | add_subdirectory (terminal) |
70 | endif() |
71 | |
72 | -############# OY ################# |
73 | +############# TOMBOY ################# |
74 | set (GETTEXT_TOMBOY ${GETTEXT_PLUGINS}) |
75 | set (VERSION_TOMBOY "1.3.0") |
76 | set (PACKAGE_TOMBOY "cd-tomboy") |
77 | @@ -643,6 +642,6 @@ |
78 | set (VERSION_REMOTE_CONTROL "0.0.1") |
79 | set (PACKAGE_REMOTE_CONTROL "cd-Remote-Control") |
80 | set (remote_controldatadir "${pluginsdatadir}/Remote-Control") |
81 | - configure_file (Remote-Control/data/Remote-Control.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/Remote-Control/data/Remote-Control.conf) |
82 | + configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Remote-Control/data/Remote-Control.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Remote-Control/data/Remote-Control.conf) |
83 | add_subdirectory (Remote-Control) |
84 | endif() |
85 | |
86 | === modified file 'Dbus/src/applet-dbus.c' |
87 | --- Dbus/src/applet-dbus.c 2010-09-07 00:39:20 +0000 |
88 | +++ Dbus/src/applet-dbus.c 2010-10-02 18:13:46 +0000 |
89 | @@ -282,9 +282,13 @@ |
90 | } |
91 | } |
92 | if (pDbusApplet->pSubApplet != NULL) |
93 | + { |
94 | g_object_unref (pDbusApplet->pSubApplet); |
95 | - g_object_unref (pDbusApplet); |
96 | + pDbusApplet->pSubApplet = NULL; |
97 | + } |
98 | + ///g_object_unref (pDbusApplet); |
99 | } |
100 | + g_list_foreach (myData.pAppletList, (GFunc)g_object_unref, NULL); |
101 | g_list_free (myData.pAppletList); |
102 | myData.pAppletList = NULL; |
103 | |
104 | @@ -434,7 +438,7 @@ |
105 | gpointer invocation_hint G_GNUC_UNUSED, |
106 | gpointer marshal_data) |
107 | { |
108 | - g_print ("%s ()\n", __func__); |
109 | + //g_print ("%s ()\n", __func__); |
110 | typedef void (*GMarshalFunc_VOID__INT_STRING) (gpointer data1, |
111 | gint arg_1, |
112 | gchar *arg_2, |
113 | @@ -468,7 +472,7 @@ |
114 | gpointer invocation_hint G_GNUC_UNUSED, |
115 | gpointer marshal_data) |
116 | { |
117 | - g_print ("%s ()\n", __func__); |
118 | + //g_print ("%s ()\n", __func__); |
119 | typedef void (*GMarshalFunc_VOID__BOOLEAN_STRING) (gpointer data1, |
120 | gboolean arg_1, |
121 | gchar *arg_2, |
122 | @@ -502,7 +506,7 @@ |
123 | gpointer invocation_hint G_GNUC_UNUSED, |
124 | gpointer marshal_data) |
125 | { |
126 | - g_print ("%s ()\n", __func__); |
127 | + //g_print ("%s ()\n", __func__); |
128 | typedef void (*GMarshalFunc_VOID__STRING_STRING) (gpointer data1, |
129 | gchar *arg_1, |
130 | gchar *arg_2, |
131 | @@ -536,7 +540,7 @@ |
132 | gpointer invocation_hint G_GNUC_UNUSED, |
133 | gpointer marshal_data) |
134 | { |
135 | - g_print ("%s ()\n", __func__); |
136 | + //g_print ("%s ()\n", __func__); |
137 | typedef void (*GMarshalFunc_VOID__VALUE) (gpointer data1, |
138 | GValue *arg_1, |
139 | gpointer data2); |
140 | @@ -568,7 +572,7 @@ |
141 | gpointer invocation_hint G_GNUC_UNUSED, |
142 | gpointer marshal_data) |
143 | { |
144 | - g_print ("%s ()\n", __func__); |
145 | + //g_print ("%s ()\n", __func__); |
146 | typedef void (*GMarshalFunc_VOID__INT_VALUE) (gpointer data1, |
147 | gint arg_1, |
148 | GValue *arg_2, |
149 | @@ -602,7 +606,7 @@ |
150 | gpointer invocation_hint G_GNUC_UNUSED, |
151 | gpointer marshal_data) |
152 | { |
153 | - g_print ("%s ()\n", __func__); |
154 | + //g_print ("%s ()\n", __func__); |
155 | typedef void (*GMarshalFunc_VOID__VALUE_STRING) (gpointer data1, |
156 | GValue *arg_1, |
157 | gchar *arg_2, |
158 | |
159 | === modified file 'Dbus/src/interface-applet-methods.c' |
160 | --- Dbus/src/interface-applet-methods.c 2010-08-07 01:43:25 +0000 |
161 | +++ Dbus/src/interface-applet-methods.c 2010-10-02 18:13:46 +0000 |
162 | @@ -1145,7 +1145,7 @@ |
163 | } |
164 | if (! cShortkeys[i]) // raccourci non trouve dans la nouvelle liste => on l'enleve |
165 | { |
166 | - g_print (" shortkey '%s' not wanted anymore\n", key); |
167 | + //g_print (" shortkey '%s' not wanted anymore\n", key); |
168 | cd_keybinder_unbind (key, (CDBindkeyHandler) cd_dbus_applet_emit_on_shortkey); |
169 | pDbusApplet->pShortkeyList = g_list_delete_link (pDbusApplet->pShortkeyList, sk); |
170 | } |
171 | @@ -1165,7 +1165,7 @@ |
172 | } |
173 | if (! sk) // raccourci non encore lie => on lie. |
174 | { |
175 | - g_print (" shortkey '%s' wanted\n", cShortkey); |
176 | + //g_print (" shortkey '%s' wanted\n", cShortkey); |
177 | bCouldBind = cd_keybinder_bind (cShortkey, (CDBindkeyHandler) cd_dbus_applet_emit_on_shortkey, pDbusApplet); |
178 | if (bCouldBind) |
179 | pDbusApplet->pShortkeyList = g_list_prepend (pDbusApplet->pShortkeyList, g_strdup (cShortkey)); |
180 | |
181 | === modified file 'Dbus/src/interface-applet-object.c' |
182 | --- Dbus/src/interface-applet-object.c 2010-08-07 01:43:25 +0000 |
183 | +++ Dbus/src/interface-applet-object.c 2010-10-02 18:13:46 +0000 |
184 | @@ -78,7 +78,7 @@ |
185 | for (a = myData.pAppletList; a != NULL; a = a->next) |
186 | { |
187 | pDbusApplet = a->data; |
188 | - if (strcmp (cModuleName, pDbusApplet->cModuleName) == 0) |
189 | + if (pDbusApplet->cModuleName && strcmp (cModuleName, pDbusApplet->cModuleName) == 0) |
190 | break ; |
191 | } |
192 | return (a ? pDbusApplet : NULL); |
193 | @@ -92,7 +92,7 @@ |
194 | for (a = myData.pAppletList; a != NULL; a = a->next) |
195 | { |
196 | pDbusApplet = a->data; |
197 | - if (strcmp (cModuleName, pDbusApplet->cModuleName) == 0) |
198 | + if (pDbusApplet->cModuleName && strcmp (cModuleName, pDbusApplet->cModuleName) == 0) |
199 | break ; |
200 | } |
201 | myData.pAppletList = g_list_delete_link (myData.pAppletList, a); |
202 | |
203 | === modified file 'Dbus/src/interface-applet-signals.c' |
204 | --- Dbus/src/interface-applet-signals.c 2010-08-07 01:43:25 +0000 |
205 | +++ Dbus/src/interface-applet-signals.c 2010-10-02 18:13:46 +0000 |
206 | @@ -632,7 +632,7 @@ |
207 | } |
208 | |
209 | const gchar *cText = gtk_entry_get_text (GTK_ENTRY (pEntry)); |
210 | - g_print (" -> %s\n", cText); |
211 | + //g_print (" -> %s\n", cText); |
212 | g_value_set_string (&v, cText); |
213 | _emit_answer_dialog (pDbusApplet, pDialog, iClickedButton, &v); |
214 | } |
215 | |
216 | === modified file 'Folders/src/applet-notifications.c' |
217 | --- Folders/src/applet-notifications.c 2010-09-07 00:39:20 +0000 |
218 | +++ Folders/src/applet-notifications.c 2010-10-02 18:13:46 +0000 |
219 | @@ -51,10 +51,10 @@ |
220 | } |
221 | else if (CD_APPLET_CLICKED_ICON != NULL) |
222 | { |
223 | - g_print ("clic on %s\n", CD_APPLET_CLICKED_ICON->cBaseURI); |
224 | + //g_print ("clic on %s\n", CD_APPLET_CLICKED_ICON->cBaseURI); |
225 | if (CD_APPLET_CLICKED_ICON->iVolumeID == -1) |
226 | { |
227 | - g_print ("folder\n"); |
228 | + //g_print ("folder\n"); |
229 | |
230 | /// lister le repertoire dans un thread. |
231 | |
232 | @@ -350,7 +350,7 @@ |
233 | app[1] = CD_APPLET_CLICKED_CONTAINER; |
234 | app[2] = myApplet; |
235 | app[3] = g_strdup (pAppInfo[1]); |
236 | - g_print (" + %s (%s ; %s)\n", pAppInfo[0], pAppInfo[1], pAppInfo[2]); |
237 | + //g_print (" + %s (%s ; %s)\n", pAppInfo[0], pAppInfo[1], pAppInfo[2]); |
238 | myData.pAppList = g_list_prepend (myData.pAppList, app); |
239 | |
240 | if (pAppInfo[2] != NULL) |
241 | @@ -364,7 +364,7 @@ |
242 | g_list_free (pApps); |
243 | } |
244 | else |
245 | - g_print ("no apps list for '%s'\n", CD_APPLET_CLICKED_ICON->cBaseURI); |
246 | + //g_print ("no apps list for '%s'\n", CD_APPLET_CLICKED_ICON->cBaseURI); |
247 | |
248 | CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU); |
249 | CD_APPLET_ADD_IN_MENU_WITH_STOCK_AND_DATA (D_("Properties"), GTK_STOCK_PROPERTIES, _cd_folders_show_file_properties, CD_APPLET_MY_MENU, data); |
250 | @@ -381,7 +381,7 @@ |
251 | |
252 | gboolean cd_folders_on_drop_data (gpointer data, const gchar *cReceivedData, Icon *icon, double fOrder, CairoContainer *pContainer) |
253 | { |
254 | - g_print ("Folders received '%s'\n", cReceivedData); |
255 | + //g_print ("Folders received '%s'\n", cReceivedData); |
256 | |
257 | if (fOrder == CAIRO_DOCK_LAST_ORDER) // lachage sur une icone. |
258 | return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
259 | @@ -394,7 +394,7 @@ |
260 | |
261 | if (g_file_test (cPath, G_FILE_TEST_IS_DIR)) |
262 | { |
263 | - g_print (" ajout d'un repertoire...\n"); |
264 | + //g_print (" ajout d'un repertoire...\n"); |
265 | CairoDockModule *pModule = cairo_dock_find_module_from_name ("Folders"); |
266 | g_return_val_if_fail (pModule != NULL, CAIRO_DOCK_LET_PASS_NOTIFICATION); |
267 | |
268 | |
269 | === modified file 'GMenu/src/applet-util.c' |
270 | --- GMenu/src/applet-util.c 2010-08-07 01:43:25 +0000 |
271 | +++ GMenu/src/applet-util.c 2010-10-02 18:13:46 +0000 |
272 | @@ -188,7 +188,7 @@ |
273 | else |
274 | cCommandExpanded = g_strdup (cCommand); |
275 | #endif //CD_EXPAND_FIELD_CODES |
276 | - g_print ("cCommandExpanded : %s\n", cCommandExpanded); |
277 | + //g_print ("cCommandExpanded : %s\n", cCommandExpanded); |
278 | return cCommandExpanded; |
279 | } |
280 | static void _launch_from_file (const gchar *cDesktopFilePath) |
281 | |
282 | === modified file 'Indicator-applet/indicator-applet.c' |
283 | --- Indicator-applet/indicator-applet.c 2010-09-07 00:39:20 +0000 |
284 | +++ Indicator-applet/indicator-applet.c 2010-10-02 18:13:46 +0000 |
285 | @@ -123,7 +123,7 @@ |
286 | g_object_unref (pIndicator->pServiceProxy); |
287 | g_print ("destroy menu...\n"); |
288 | if (pIndicator->pMenu) |
289 | - g_object_ref_sink (pIndicator->pMenu); |
290 | + g_object_unref (pIndicator->pMenu); |
291 | g_print ("done.\n"); |
292 | g_free (pIndicator); |
293 | } |
294 | @@ -140,14 +140,30 @@ |
295 | if (cStatusIcon == NULL) |
296 | return; |
297 | |
298 | - gchar *cIconPath = cairo_dock_search_icon_s_path (cStatusIcon); |
299 | + const gchar *cIconName = cStatusIcon; |
300 | + gchar *tmp_icon_name = NULL; |
301 | + gchar *cIconPath = cairo_dock_search_icon_s_path (cIconName); // on regarde si l'icone sera trouvee. |
302 | gchar *cIconPathFallback = NULL; |
303 | + if (cIconPath == NULL) // l'icone ne sera pas trouvee, on regarde si ce n'est pas une icone en carton d'Ubuntu. |
304 | + { |
305 | + gchar *str = g_strstr_len (cIconName, -1, "-panel"); |
306 | + if (str) |
307 | + { |
308 | + tmp_icon_name = g_strndup (cIconName, str - cIconName); |
309 | + cIconName = tmp_icon_name; |
310 | + cIconPath = cairo_dock_search_icon_s_path (cIconName); |
311 | + } |
312 | + } |
313 | if (cIconPath == NULL) // l'icone ne sera pas trouvee, on met une icone par defaut. |
314 | - cIconPathFallback = g_strdup_printf ("%s/%s.svg", myApplet->pModule->pVisitCard->cShareDataDir, cStatusIcon); |
315 | - |
316 | - g_print ("set %s\n", cIconPathFallback ? cIconPathFallback : cStatusIcon); |
317 | - CD_APPLET_SET_IMAGE_ON_MY_ICON (cIconPathFallback ? cIconPathFallback : cStatusIcon); |
318 | - |
319 | + { |
320 | + gboolean bAddSuffix = (!g_str_has_suffix (cIconName, ".png") && !g_str_has_suffix (cIconName, ".svg")); |
321 | + cIconPathFallback = g_strdup_printf ("%s/%s%s", myApplet->pModule->pVisitCard->cShareDataDir, cIconName, bAddSuffix ? ".svg" : ""); |
322 | + } |
323 | + |
324 | + g_print ("set %s\n", cIconPathFallback ? cIconPathFallback : cIconName); |
325 | + CD_APPLET_SET_IMAGE_ON_MY_ICON (cIconPathFallback ? cIconPathFallback : cIconName); |
326 | + |
327 | + g_free (tmp_icon_name); |
328 | g_free (cIconPath); |
329 | g_free (cIconPathFallback); |
330 | } |
331 | |
332 | === modified file 'MeMenu/src/applet-me.c' |
333 | --- MeMenu/src/applet-me.c 2010-08-07 01:43:25 +0000 |
334 | +++ MeMenu/src/applet-me.c 2010-10-02 18:13:46 +0000 |
335 | @@ -46,14 +46,14 @@ |
336 | static void |
337 | username_cb (DBusGProxy * proxy, const char * username, GError *error, CairoDockModuleInstance *myApplet) |
338 | { |
339 | - g_print (" + new username: '%s'\n", username); |
340 | + //g_print (" + new username: '%s'\n", username); |
341 | CD_APPLET_SET_NAME_FOR_MY_ICON (username); // username peut etre NULL ou vide, c'est pas genant. |
342 | } |
343 | |
344 | static void |
345 | username_changed (DBusGProxy * proxy, gchar * username, CairoDockModuleInstance *myApplet) |
346 | { |
347 | - g_print ("Changing username: '%s'\n", username); |
348 | + //g_print ("Changing username: '%s'\n", username); |
349 | |
350 | return username_cb(proxy, username, NULL, myApplet); |
351 | } |
352 | @@ -63,7 +63,7 @@ |
353 | { |
354 | g_return_if_fail(icons != NULL); |
355 | g_return_if_fail(icons[0] != '\0'); |
356 | - g_print (" + new icon: '%s'\n", icons); |
357 | + //g_print (" + new icon: '%s'\n", icons); |
358 | |
359 | cd_indicator_set_icon (myData.pIndicator, icons); |
360 | CD_APPLET_REDRAW_MY_ICON; |
361 | @@ -74,7 +74,7 @@ |
362 | static void |
363 | status_icon_changed (DBusGProxy * proxy, gchar * icon, CairoDockModuleInstance *myApplet) |
364 | { |
365 | - g_print ("Changing status icon: '%s'\n", icon); |
366 | + //g_print ("Changing status icon: '%s'\n", icon); |
367 | |
368 | return status_icon_cb(proxy, icon, NULL, myApplet); |
369 | } |
370 | |
371 | === modified file 'MeMenu/src/applet-menu.c' |
372 | --- MeMenu/src/applet-menu.c 2010-08-07 01:43:25 +0000 |
373 | +++ MeMenu/src/applet-menu.c 2010-10-02 18:13:46 +0000 |
374 | @@ -56,7 +56,7 @@ |
375 | g_value_init (&value, G_TYPE_STRING); |
376 | g_value_set_static_string (&value, gtk_entry_get_text (entry)); |
377 | |
378 | - g_print ("user typed: %s\n", g_value_get_string (&value)); |
379 | + //g_print ("user typed: %s\n", g_value_get_string (&value)); |
380 | dbusmenu_menuitem_handle_event (mi, "send", &value, gtk_get_current_event_time()); |
381 | } |
382 | |
383 | |
384 | === modified file 'Messaging-Menu/src/applet-menu.c' |
385 | --- Messaging-Menu/src/applet-menu.c 2010-08-07 01:43:25 +0000 |
386 | +++ Messaging-Menu/src/applet-menu.c 2010-10-02 18:13:46 +0000 |
387 | @@ -67,7 +67,7 @@ |
388 | static gboolean |
389 | new_application_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client) |
390 | { |
391 | - g_print ("%s ()\n", __func__); |
392 | + //g_print ("%s ()\n", __func__); |
393 | GtkMenuItem * gmi = GTK_MENU_ITEM(gtk_image_menu_item_new()); |
394 | |
395 | gint padding = 4; |
396 | @@ -86,7 +86,7 @@ |
397 | gtk_widget_show(icon); |
398 | |
399 | /* Application name in a label */ |
400 | - g_print (" name : %s\n", dbusmenu_menuitem_property_get(newitem, APPLICATION_MENUITEM_PROP_NAME)); |
401 | + //g_print (" name : %s\n", dbusmenu_menuitem_property_get(newitem, APPLICATION_MENUITEM_PROP_NAME)); |
402 | GtkWidget * label = gtk_label_new(dbusmenu_menuitem_property_get(newitem, APPLICATION_MENUITEM_PROP_NAME)); |
403 | gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5); |
404 | gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, padding); |
405 | @@ -131,7 +131,7 @@ |
406 | static void |
407 | indicator_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, indicator_item_t * mi_data) |
408 | { |
409 | - g_print ("%s (%s)\n", __func__, prop); |
410 | + //g_print ("%s (%s)\n", __func__, prop); |
411 | if (!g_strcmp0(prop, INDICATOR_MENUITEM_PROP_LABEL)) { |
412 | /* Set the main label */ |
413 | gtk_label_set_text(GTK_LABEL(mi_data->label), g_value_get_string(value)); |
414 | @@ -180,7 +180,7 @@ |
415 | static gboolean |
416 | new_indicator_item (DbusmenuMenuitem * newitem, DbusmenuMenuitem * parent, DbusmenuClient * client) |
417 | { |
418 | - g_print ("%s ()\n", __func__); |
419 | + //g_print ("%s ()\n", __func__); |
420 | g_return_val_if_fail(DBUSMENU_IS_MENUITEM(newitem), FALSE); |
421 | g_return_val_if_fail(DBUSMENU_IS_GTKCLIENT(client), FALSE); |
422 | /* Note: not checking parent, it's reasonable for it to be NULL */ |
423 | |
424 | === modified file 'Messaging-Menu/src/applet-messaging.c' |
425 | --- Messaging-Menu/src/applet-messaging.c 2010-08-07 01:43:25 +0000 |
426 | +++ Messaging-Menu/src/applet-messaging.c 2010-10-02 18:13:46 +0000 |
427 | @@ -38,7 +38,7 @@ |
428 | static void |
429 | attention_changed_cb (DBusGProxy * proxy, gboolean dot, CairoDockModuleInstance *myApplet) |
430 | { |
431 | - g_print ("%s (attention : %d)\n", __func__, dot); |
432 | + //g_print ("%s (attention : %d)\n", __func__, dot); |
433 | if (dot) |
434 | { |
435 | cd_indicator_set_icon (myData.pIndicator, "indicator-messages-new"); |
436 | @@ -58,7 +58,7 @@ |
437 | static void |
438 | icon_changed_cb (DBusGProxy * proxy, gboolean hidden, CairoDockModuleInstance *myApplet) |
439 | { |
440 | - g_print ("%s (hidden : %d)\n", __func__, hidden); |
441 | + //g_print ("%s (hidden : %d)\n", __func__, hidden); |
442 | if (hidden) |
443 | { |
444 | myIcon->fAlpha = .5; |
445 | @@ -116,7 +116,7 @@ |
446 | |
447 | void cd_messaging_on_disconnect (CairoDockModuleInstance *myApplet) |
448 | { |
449 | - g_print ("disconnected\n"); |
450 | + //g_print ("disconnected\n"); |
451 | cd_indicator_set_icon (myData.pIndicator, DEFAULT_ICON); // If we're disconnecting, go back to offline. |
452 | } |
453 | |
454 | |
455 | === modified file 'RSSreader/src/applet-draw.c' |
456 | --- RSSreader/src/applet-draw.c 2010-08-07 01:43:25 +0000 |
457 | +++ RSSreader/src/applet-draw.c 2010-10-02 18:13:46 +0000 |
458 | @@ -30,6 +30,7 @@ |
459 | { |
460 | if (iWidth < 20 || iHeight < 20) // inutile de dessiner tant que le desklet n'a pas atteint sa taille definitive. |
461 | return; |
462 | + g_return_if_fail (myDrawContext != NULL); |
463 | cd_debug ("%s (%dx%d)", __func__, iWidth, iHeight); |
464 | PangoLayout *pLayout = pango_cairo_create_layout (myDrawContext); |
465 | PangoRectangle ink, log; |
466 | |
467 | === added directory 'Remote-Control' |
468 | === added file 'Remote-Control/CMakeLists.txt' |
469 | --- Remote-Control/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
470 | +++ Remote-Control/CMakeLists.txt 2010-10-02 18:13:46 +0000 |
471 | @@ -0,0 +1,2 @@ |
472 | +add_subdirectory(src) |
473 | +add_subdirectory(data) |
474 | |
475 | === added directory 'Remote-Control/data' |
476 | === added file 'Remote-Control/data/CMakeLists.txt' |
477 | --- Remote-Control/data/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
478 | +++ Remote-Control/data/CMakeLists.txt 2010-10-02 18:13:46 +0000 |
479 | @@ -0,0 +1,11 @@ |
480 | +########### subdirs if any ############### |
481 | + |
482 | + |
483 | +########### install files ############### |
484 | + |
485 | +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Remote-Control.conf |
486 | + preview.jpg |
487 | + icon.png |
488 | + arrows.svg |
489 | + DESTINATION ${remote_controldatadir}) |
490 | + |
491 | |
492 | === added file 'Remote-Control/data/Remote-Control.conf.in' |
493 | --- Remote-Control/data/Remote-Control.conf.in 1970-01-01 00:00:00 +0000 |
494 | +++ Remote-Control/data/Remote-Control.conf.in 2010-10-02 18:13:46 +0000 |
495 | @@ -0,0 +1,14 @@ |
496 | +#!en;@VERSION_REMOTE_CONTROL@ |
497 | + |
498 | +#[gtk-preferences] |
499 | +[Configuration] |
500 | + |
501 | +#k Shortkey to trigger the applet: |
502 | +shortkey = <Control>F9 |
503 | + |
504 | +#a+ Animation of the current icon : |
505 | +animation=pulse |
506 | + |
507 | +#I[0;2000] Duration of the stop animation : |
508 | +#{In ms.} |
509 | +stop duration = 800 |
510 | |
511 | === added file 'Remote-Control/data/arrows.svg' |
512 | --- Remote-Control/data/arrows.svg 1970-01-01 00:00:00 +0000 |
513 | +++ Remote-Control/data/arrows.svg 2010-10-02 18:13:46 +0000 |
514 | @@ -0,0 +1,289 @@ |
515 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
516 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> |
517 | +<svg |
518 | + xmlns:dc="http://purl.org/dc/elements/1.1/" |
519 | + xmlns:cc="http://creativecommons.org/ns#" |
520 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
521 | + xmlns:svg="http://www.w3.org/2000/svg" |
522 | + xmlns="http://www.w3.org/2000/svg" |
523 | + xmlns:xlink="http://www.w3.org/1999/xlink" |
524 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
525 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
526 | + width="128" |
527 | + height="128" |
528 | + id="svg2391" |
529 | + sodipodi:version="0.32" |
530 | + inkscape:version="0.46" |
531 | + version="1.0" |
532 | + sodipodi:docname="arrows.svg" |
533 | + inkscape:output_extension="org.inkscape.output.svg.inkscape"> |
534 | + <defs |
535 | + id="defs2393"> |
536 | + <linearGradient |
537 | + id="linearGradient2076"> |
538 | + <stop |
539 | + id="stop2078" |
540 | + offset="0.0000000" |
541 | + style="stop-color:#afd9ed;stop-opacity:1.0000000;" /> |
542 | + <stop |
543 | + id="stop2080" |
544 | + offset="1.0000000" |
545 | + style="stop-color:#cfc3db;stop-opacity:1.0000000;" /> |
546 | + </linearGradient> |
547 | + <linearGradient |
548 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
549 | + gradientUnits="userSpaceOnUse" |
550 | + id="linearGradient2082" |
551 | + x1="12.615197" |
552 | + x2="48.374069" |
553 | + xlink:href="#linearGradient2076" |
554 | + y1="25.909756" |
555 | + y2="62.720371" /> |
556 | + <linearGradient |
557 | + id="linearGradient2088"> |
558 | + <stop |
559 | + id="stop2090" |
560 | + offset="0.0000000" |
561 | + style="stop-color:#87a8b7;stop-opacity:1.0000000;" /> |
562 | + <stop |
563 | + id="stop2092" |
564 | + offset="1.0000000" |
565 | + style="stop-color:#7f718e;stop-opacity:1.0000000;" /> |
566 | + </linearGradient> |
567 | + <linearGradient |
568 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
569 | + gradientUnits="userSpaceOnUse" |
570 | + id="linearGradient2086" |
571 | + x1="12.615197" |
572 | + x2="48.374069" |
573 | + xlink:href="#linearGradient2088" |
574 | + y1="25.909756" |
575 | + y2="62.720371" /> |
576 | + <inkscape:perspective |
577 | + sodipodi:type="inkscape:persp3d" |
578 | + inkscape:vp_x="0 : 526.18109 : 1" |
579 | + inkscape:vp_y="0 : 1000 : 0" |
580 | + inkscape:vp_z="744.09448 : 526.18109 : 1" |
581 | + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" |
582 | + id="perspective2399" /> |
583 | + <linearGradient |
584 | + inkscape:collect="always" |
585 | + xlink:href="#linearGradient2088" |
586 | + id="linearGradient2420" |
587 | + gradientUnits="userSpaceOnUse" |
588 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
589 | + x1="12.615197" |
590 | + y1="25.909756" |
591 | + x2="48.374069" |
592 | + y2="62.720371" /> |
593 | + <linearGradient |
594 | + inkscape:collect="always" |
595 | + xlink:href="#linearGradient2076" |
596 | + id="linearGradient2422" |
597 | + gradientUnits="userSpaceOnUse" |
598 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
599 | + x1="12.615197" |
600 | + y1="25.909756" |
601 | + x2="48.374069" |
602 | + y2="62.720371" /> |
603 | + <linearGradient |
604 | + inkscape:collect="always" |
605 | + xlink:href="#linearGradient2088" |
606 | + id="linearGradient2434" |
607 | + gradientUnits="userSpaceOnUse" |
608 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
609 | + x1="12.615197" |
610 | + y1="25.909756" |
611 | + x2="48.374069" |
612 | + y2="62.720371" /> |
613 | + <linearGradient |
614 | + inkscape:collect="always" |
615 | + xlink:href="#linearGradient2076" |
616 | + id="linearGradient2436" |
617 | + gradientUnits="userSpaceOnUse" |
618 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
619 | + x1="12.615197" |
620 | + y1="25.909756" |
621 | + x2="48.374069" |
622 | + y2="62.720371" /> |
623 | + <linearGradient |
624 | + inkscape:collect="always" |
625 | + xlink:href="#linearGradient2088" |
626 | + id="linearGradient2448" |
627 | + gradientUnits="userSpaceOnUse" |
628 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
629 | + x1="12.615197" |
630 | + y1="25.909756" |
631 | + x2="48.374069" |
632 | + y2="62.720371" /> |
633 | + <linearGradient |
634 | + inkscape:collect="always" |
635 | + xlink:href="#linearGradient2076" |
636 | + id="linearGradient2450" |
637 | + gradientUnits="userSpaceOnUse" |
638 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
639 | + x1="12.615197" |
640 | + y1="25.909756" |
641 | + x2="48.374069" |
642 | + y2="62.720371" /> |
643 | + <linearGradient |
644 | + inkscape:collect="always" |
645 | + xlink:href="#linearGradient2088" |
646 | + id="linearGradient2462" |
647 | + gradientUnits="userSpaceOnUse" |
648 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
649 | + x1="12.615197" |
650 | + y1="25.909756" |
651 | + x2="48.374069" |
652 | + y2="62.720371" /> |
653 | + <linearGradient |
654 | + inkscape:collect="always" |
655 | + xlink:href="#linearGradient2076" |
656 | + id="linearGradient2464" |
657 | + gradientUnits="userSpaceOnUse" |
658 | + gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
659 | + x1="12.615197" |
660 | + y1="25.909756" |
661 | + x2="48.374069" |
662 | + y2="62.720371" /> |
663 | + </defs> |
664 | + <sodipodi:namedview |
665 | + id="base" |
666 | + pagecolor="#ffffff" |
667 | + bordercolor="#666666" |
668 | + borderopacity="1.0" |
669 | + inkscape:pageopacity="0.0" |
670 | + inkscape:pageshadow="2" |
671 | + inkscape:zoom="1.3277206" |
672 | + inkscape:cx="117.47785" |
673 | + inkscape:cy="-15.977159" |
674 | + inkscape:document-units="px" |
675 | + inkscape:current-layer="layer1" |
676 | + showgrid="false" |
677 | + showguides="true" |
678 | + inkscape:guide-bbox="true" |
679 | + inkscape:window-width="641" |
680 | + inkscape:window-height="719" |
681 | + inkscape:window-x="293" |
682 | + inkscape:window-y="0" /> |
683 | + <metadata |
684 | + id="metadata2396"> |
685 | + <rdf:RDF> |
686 | + <cc:Work |
687 | + rdf:about=""> |
688 | + <dc:format>image/svg+xml</dc:format> |
689 | + <dc:type |
690 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
691 | + </cc:Work> |
692 | + </rdf:RDF> |
693 | + </metadata> |
694 | + <g |
695 | + inkscape:label="Calque 1" |
696 | + inkscape:groupmode="layer" |
697 | + id="layer1"> |
698 | + <g |
699 | + id="g2409" |
700 | + transform="matrix(0,0.8161651,-1.764176,0,125.43391,77.398373)"> |
701 | + <path |
702 | + d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
703 | + id="path2084" |
704 | + style="fill:url(#linearGradient2420);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
705 | + <path |
706 | + d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
707 | + id="rect1303" |
708 | + style="fill:url(#linearGradient2422);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
709 | + <path |
710 | + d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
711 | + id="path2096" |
712 | + style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
713 | + <rect |
714 | + height="1" |
715 | + id="rect2098" |
716 | + rx="0.5" |
717 | + ry="0.5" |
718 | + style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
719 | + transform="scale(-1,-1)" |
720 | + width="23" |
721 | + x="-27.270832" |
722 | + y="-28" /> |
723 | + </g> |
724 | + <g |
725 | + id="g2424" |
726 | + transform="matrix(0,-0.8161651,-1.6782543,0,122.04356,52.382073)"> |
727 | + <path |
728 | + d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
729 | + id="path2426" |
730 | + style="fill:url(#linearGradient2434);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
731 | + <path |
732 | + d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
733 | + id="path2428" |
734 | + style="fill:url(#linearGradient2436);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
735 | + <path |
736 | + d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
737 | + id="path2430" |
738 | + style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
739 | + <rect |
740 | + height="1" |
741 | + id="rect2432" |
742 | + rx="0.5" |
743 | + ry="0.5" |
744 | + style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
745 | + transform="scale(-1,-1)" |
746 | + width="23" |
747 | + x="-27.270832" |
748 | + y="-28" /> |
749 | + </g> |
750 | + <g |
751 | + id="g2438" |
752 | + transform="matrix(-0.8161651,0,0,-1.6496137,51.134197,122.05924)"> |
753 | + <path |
754 | + d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
755 | + id="path2440" |
756 | + style="fill:url(#linearGradient2448);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
757 | + <path |
758 | + d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
759 | + id="path2442" |
760 | + style="fill:url(#linearGradient2450);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
761 | + <path |
762 | + d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
763 | + id="path2444" |
764 | + style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
765 | + <rect |
766 | + height="1" |
767 | + id="rect2446" |
768 | + rx="0.5" |
769 | + ry="0.5" |
770 | + style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
771 | + transform="scale(-1,-1)" |
772 | + width="23" |
773 | + x="-27.270832" |
774 | + y="-28" /> |
775 | + </g> |
776 | + <g |
777 | + id="g2452" |
778 | + transform="matrix(0.8161651,0,0,-1.6496137,77.748214,121.52667)"> |
779 | + <path |
780 | + d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
781 | + id="path2454" |
782 | + style="fill:url(#linearGradient2462);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
783 | + <path |
784 | + d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
785 | + id="path2456" |
786 | + style="fill:url(#linearGradient2464);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
787 | + <path |
788 | + d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
789 | + id="path2458" |
790 | + style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
791 | + <rect |
792 | + height="1" |
793 | + id="rect2460" |
794 | + rx="0.5" |
795 | + ry="0.5" |
796 | + style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
797 | + transform="scale(-1,-1)" |
798 | + width="23" |
799 | + x="-27.270832" |
800 | + y="-28" /> |
801 | + </g> |
802 | + </g> |
803 | +</svg> |
804 | |
805 | === added file 'Remote-Control/data/icon.png' |
806 | Binary files Remote-Control/data/icon.png 1970-01-01 00:00:00 +0000 and Remote-Control/data/icon.png 2010-10-02 18:13:46 +0000 differ |
807 | === added file 'Remote-Control/data/preview.jpg' |
808 | Binary files Remote-Control/data/preview.jpg 1970-01-01 00:00:00 +0000 and Remote-Control/data/preview.jpg 2010-10-02 18:13:46 +0000 differ |
809 | === added directory 'Remote-Control/src' |
810 | === added file 'Remote-Control/src/CMakeLists.txt' |
811 | --- Remote-Control/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
812 | +++ Remote-Control/src/CMakeLists.txt 2010-10-02 18:13:46 +0000 |
813 | @@ -0,0 +1,40 @@ |
814 | + |
815 | +########### sources ############### |
816 | + |
817 | +SET(MODULE_SRCS |
818 | + applet-struct.h |
819 | + applet-init.c applet-init.h |
820 | + applet-config.c applet-config.h |
821 | + applet-session.c applet-session.h |
822 | + applet-icon-finder.c applet-icon-finder.h |
823 | + applet-notifications.c applet-notifications.h |
824 | +) |
825 | + |
826 | +add_library(${PACKAGE_REMOTE_CONTROL} SHARED ${MODULE_SRCS}) |
827 | + |
828 | +########### compil ############### |
829 | +add_definitions (-DMY_APPLET_SHARE_DATA_DIR="${remote_controldatadir}") |
830 | +add_definitions (-DMY_APPLET_PREVIEW_FILE="preview.jpg") |
831 | +add_definitions (-DMY_APPLET_CONF_FILE="Remote-Control.conf") |
832 | +add_definitions (-DMY_APPLET_USER_DATA_DIR="Remote-Control") |
833 | +add_definitions (-DMY_APPLET_VERSION="${VERSION_REMOTE_CONTROL}") |
834 | +add_definitions (-DMY_APPLET_GETTEXT_DOMAIN="${GETTEXT_REMOTE_CONTROL}") |
835 | +add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}") |
836 | +add_definitions (-DMY_APPLET_ICON_FILE="icon.png") |
837 | +### uncomment the following line to allow multi-instance applet. |
838 | +#add_definitions (-DCD_APPLET_MULTI_INSTANCE="1") |
839 | +### uncomment the following line to allow extended OpenGL drawing. |
840 | +#add_definitions (-DGL_GLEXT_PROTOTYPES="1") |
841 | + |
842 | +include_directories ( |
843 | + ${PACKAGE_INCLUDE_DIRS}) |
844 | + |
845 | +link_directories ( |
846 | + ${PACKAGE_LIBRARY_DIRS}) |
847 | + |
848 | +target_link_libraries (${PACKAGE_REMOTE_CONTROL} |
849 | + ${PACKAGE_LIBRARIES}) |
850 | + |
851 | +########### install files ############### |
852 | + |
853 | +install(TARGETS ${PACKAGE_REMOTE_CONTROL} DESTINATION ${pluginsdir}) |
854 | |
855 | === added file 'Remote-Control/src/applet-config.c' |
856 | --- Remote-Control/src/applet-config.c 1970-01-01 00:00:00 +0000 |
857 | +++ Remote-Control/src/applet-config.c 2010-10-02 18:13:46 +0000 |
858 | @@ -0,0 +1,51 @@ |
859 | +/** |
860 | +* This file is a part of the Cairo-Dock project |
861 | +* |
862 | +* Copyright : (C) see the 'copyright' file. |
863 | +* E-mail : see the 'copyright' file. |
864 | +* |
865 | +* This program is free software; you can redistribute it and/or |
866 | +* modify it under the terms of the GNU General Public License |
867 | +* as published by the Free Software Foundation; either version 3 |
868 | +* of the License, or (at your option) any later version. |
869 | +* |
870 | +* This program is distributed in the hope that it will be useful, |
871 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
872 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
873 | +* GNU General Public License for more details. |
874 | +* You should have received a copy of the GNU General Public License |
875 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
876 | +*/ |
877 | + |
878 | +#include <string.h> |
879 | +#include <cairo-dock.h> |
880 | + |
881 | +#include "applet-struct.h" |
882 | +#include "applet-notifications.h" |
883 | +#include "applet-config.h" |
884 | + |
885 | + |
886 | +//\_________________ Here you have to get all your parameters from the conf file. Use the macros CD_CONFIG_GET_BOOLEAN, CD_CONFIG_GET_INTEGER, CD_CONFIG_GET_STRING, etc. myConfig has been reseted to 0 at this point. This function is called at the beginning of init and reload. |
887 | +CD_APPLET_GET_CONFIG_BEGIN |
888 | + myConfig.cShortkeyNav = CD_CONFIG_GET_STRING ("Configuration", "shortkey"); |
889 | + myConfig.iCloseDuration = CD_CONFIG_GET_INTEGER ("Configuration", "stop duration"); |
890 | + myConfig.cIconAnimation = CD_CONFIG_GET_STRING ("Configuration", "animation"); |
891 | + |
892 | +CD_APPLET_GET_CONFIG_END |
893 | + |
894 | + |
895 | +//\_________________ Here you have to free all ressources allocated for myConfig. This one will be reseted to 0 at the end of this function. This function is called right before you get the applet's config, and when your applet is stopped, in the end. |
896 | +CD_APPLET_RESET_CONFIG_BEGIN |
897 | + if (myConfig.cShortkeyNav) |
898 | + { |
899 | + cd_keybinder_unbind (myConfig.cShortkeyNav, (CDBindkeyHandler) cd_do_on_shortkey_nav); |
900 | + g_free (myConfig.cShortkeyNav); |
901 | + } |
902 | + |
903 | +CD_APPLET_RESET_CONFIG_END |
904 | + |
905 | + |
906 | +//\_________________ Here you have to free all ressources allocated for myData. This one will be reseted to 0 at the end of this function. This function is called when your applet is stopped, in the very end. |
907 | +CD_APPLET_RESET_DATA_BEGIN |
908 | + |
909 | +CD_APPLET_RESET_DATA_END |
910 | |
911 | === added file 'Remote-Control/src/applet-config.h' |
912 | --- Remote-Control/src/applet-config.h 1970-01-01 00:00:00 +0000 |
913 | +++ Remote-Control/src/applet-config.h 2010-10-02 18:13:46 +0000 |
914 | @@ -0,0 +1,30 @@ |
915 | +/** |
916 | +* This file is a part of the Cairo-Dock project |
917 | +* |
918 | +* Copyright : (C) see the 'copyright' file. |
919 | +* E-mail : see the 'copyright' file. |
920 | +* |
921 | +* This program is free software; you can redistribute it and/or |
922 | +* modify it under the terms of the GNU General Public License |
923 | +* as published by the Free Software Foundation; either version 3 |
924 | +* of the License, or (at your option) any later version. |
925 | +* |
926 | +* This program is distributed in the hope that it will be useful, |
927 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
928 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
929 | +* GNU General Public License for more details. |
930 | +* You should have received a copy of the GNU General Public License |
931 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
932 | +*/ |
933 | + |
934 | + |
935 | +#ifndef __APPLET_CONFIG__ |
936 | +#define __APPLET_CONFIG__ |
937 | + |
938 | +#include <cairo-dock.h> |
939 | + |
940 | + |
941 | +CD_APPLET_CONFIG_H |
942 | + |
943 | + |
944 | +#endif |
945 | |
946 | === added file 'Remote-Control/src/applet-icon-finder.c' |
947 | --- Remote-Control/src/applet-icon-finder.c 1970-01-01 00:00:00 +0000 |
948 | +++ Remote-Control/src/applet-icon-finder.c 2010-10-02 18:13:46 +0000 |
949 | @@ -0,0 +1,257 @@ |
950 | +/** |
951 | +* This file is a part of the Cairo-Dock project |
952 | +* |
953 | +* Copyright : (C) see the 'copyright' file. |
954 | +* E-mail : see the 'copyright' file. |
955 | +* |
956 | +* This program is free software; you can redistribute it and/or |
957 | +* modify it under the terms of the GNU General Public License |
958 | +* as published by the Free Software Foundation; either version 3 |
959 | +* of the License, or (at your option) any later version. |
960 | +* |
961 | +* This program is distributed in the hope that it will be useful, |
962 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
963 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
964 | +* GNU General Public License for more details. |
965 | +* You should have received a copy of the GNU General Public License |
966 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
967 | +*/ |
968 | + |
969 | +#include <stdlib.h> |
970 | +#include <string.h> |
971 | + |
972 | +#include "applet-struct.h" |
973 | +#include "applet-session.h" |
974 | +#include "applet-notifications.h" |
975 | +#include "applet-icon-finder.h" |
976 | + |
977 | +static inline gboolean _cd_do_icon_match (Icon *pIcon, const gchar *cCommandPrefix, int length) |
978 | +{ |
979 | + gboolean bMatch = FALSE; |
980 | + if (pIcon->cBaseURI != NULL) |
981 | + { |
982 | + gchar *cFile = g_path_get_basename (pIcon->cCommand); |
983 | + bMatch = (cFile && g_ascii_strncasecmp (cCommandPrefix, cFile, length) == 0); |
984 | + g_free (cFile); |
985 | + } |
986 | + else if (pIcon->cCommand) |
987 | + { |
988 | + bMatch = (g_ascii_strncasecmp (cCommandPrefix, pIcon->cCommand, length) == 0); |
989 | + if (!bMatch) |
990 | + { |
991 | + gchar *str = strchr (pIcon->cCommand, '-'); // on se limite au 1er tiret. |
992 | + if (str && *(str-1) != ' ') // on verifie qu'il n'est pas un tiret d'option |
993 | + { |
994 | + str ++; |
995 | + bMatch = (g_strncasecmp (str, cCommandPrefix, length) == 0); |
996 | + } |
997 | + if (!bMatch && pIcon->cName) |
998 | + bMatch = (g_ascii_strncasecmp (cCommandPrefix, pIcon->cName, length) == 0); |
999 | + } |
1000 | + } |
1001 | + return bMatch; |
1002 | +} |
1003 | + |
1004 | +static void _find_icon_in_dock_with_command (Icon *pIcon, CairoDock *pDock, gpointer *data) |
1005 | +{ |
1006 | + gchar *cCommandPrefix = data[0]; |
1007 | + int length = GPOINTER_TO_INT (data[1]); |
1008 | + Icon *pAfterIcon = data[2]; |
1009 | + Icon **pFoundIcon = data[3]; |
1010 | + CairoDock **pFoundDock = data[4]; |
1011 | + Icon **pFirstIcon = data[5]; |
1012 | + CairoDock **pFirstParentDock = data[6]; |
1013 | + if (pDock == g_pMainDock || *pFoundIcon != NULL) // on a deja cherche dans le main dock, ou deja trouve ce qu'on cherchait. |
1014 | + return ; |
1015 | + |
1016 | + gboolean bFound = _cd_do_icon_match (pIcon, cCommandPrefix, length); |
1017 | + if (bFound) |
1018 | + { |
1019 | + if (pAfterIcon == NULL) |
1020 | + { |
1021 | + *pFoundIcon = pIcon; |
1022 | + *pFoundDock = pDock; |
1023 | + } |
1024 | + else |
1025 | + { |
1026 | + if (*pFirstIcon == NULL) // on garde une trace de la 1ere icone pour boucler dans la liste. |
1027 | + { |
1028 | + *pFirstIcon = pIcon; |
1029 | + *pFirstParentDock = g_pMainDock; |
1030 | + } |
1031 | + if (pIcon == pAfterIcon) |
1032 | + { |
1033 | + data[2] = NULL; |
1034 | + } |
1035 | + } |
1036 | + } |
1037 | +} |
1038 | +Icon *cd_do_search_icon_by_command (const gchar *cCommandPrefix, Icon *pAfterIcon, CairoDock **pDock) |
1039 | +{ |
1040 | + g_return_val_if_fail (cCommandPrefix != NULL, NULL); |
1041 | + |
1042 | + //\_________________ on cherche en premier dans le main dock, car il est deja visible. |
1043 | + int length = strlen (cCommandPrefix); |
1044 | + Icon *pIcon, *pFirstIcon = NULL; |
1045 | + CairoDock *pParentDock, *pFirstParentDock = NULL; |
1046 | + GList *ic; |
1047 | + for (ic = g_pMainDock->icons; ic != NULL; ic = ic->next) |
1048 | + { |
1049 | + pIcon = ic->data; |
1050 | + if (pIcon->cCommand && g_ascii_strncasecmp (cCommandPrefix, pIcon->cCommand, length) == 0) |
1051 | + { |
1052 | + if (pAfterIcon == NULL) |
1053 | + { |
1054 | + *pDock = g_pMainDock; |
1055 | + return pIcon; |
1056 | + } |
1057 | + else |
1058 | + { |
1059 | + if (pFirstIcon == NULL) // on garde une trace de la 1ere icone pour boucler dans la liste. |
1060 | + { |
1061 | + pFirstIcon = pIcon; |
1062 | + pFirstParentDock = g_pMainDock; |
1063 | + } |
1064 | + if (pIcon == pAfterIcon) |
1065 | + { |
1066 | + pAfterIcon = NULL; |
1067 | + } |
1068 | + } |
1069 | + } |
1070 | + } |
1071 | + |
1072 | + //\_________________ si on a rien trouve on cherche dans tous les docks. |
1073 | + pIcon = NULL; |
1074 | + *pDock = NULL; |
1075 | + gpointer data[7]; |
1076 | + data[0] = (gchar *)cCommandPrefix; |
1077 | + data[1] = GINT_TO_POINTER (length); |
1078 | + data[2] = pAfterIcon; |
1079 | + data[3] = &pIcon; |
1080 | + data[4] = pDock; |
1081 | + data[5] = &pFirstIcon; |
1082 | + data[6] = &pFirstParentDock; |
1083 | + cairo_dock_foreach_icons_in_docks ((CairoDockForeachIconFunc) _find_icon_in_dock_with_command, data); |
1084 | + |
1085 | + if (pIcon == NULL) |
1086 | + { |
1087 | + pIcon = pFirstIcon; |
1088 | + *pDock = pFirstParentDock; |
1089 | + } |
1090 | + return pIcon; |
1091 | +} |
1092 | + |
1093 | + |
1094 | +void cd_do_change_current_icon (Icon *pIcon, CairoDock *pDock) |
1095 | +{ |
1096 | + //\_________________ on gere le cachage et le montrage du dock precedent et actuel. |
1097 | + if (myData.pCurrentDock != NULL && pDock != myData.pCurrentDock) // on remet au repos le dock precedemment anime. |
1098 | + { |
1099 | + cairo_dock_emit_leave_signal (CAIRO_CONTAINER (myData.pCurrentDock)); |
1100 | + cairo_dock_remove_notification_func_on_container (CAIRO_CONTAINER (myData.pCurrentDock), CAIRO_DOCK_RENDER_DOCK, (CairoDockNotificationFunc) cd_do_render, NULL); |
1101 | + cairo_dock_remove_notification_func_on_container (CAIRO_CONTAINER (myData.pCurrentDock), CAIRO_DOCK_UPDATE_DOCK, (CairoDockNotificationFunc) cd_do_update_container, NULL); |
1102 | + } |
1103 | + if (pDock != NULL && pDock != myData.pCurrentDock) // on montre le nouveau dock |
1104 | + { |
1105 | + if (pDock != NULL) |
1106 | + { |
1107 | + if (pDock->iRefCount > 0) |
1108 | + { |
1109 | + CairoDock *pParentDock = NULL; |
1110 | + Icon *pPointingIcon = cairo_dock_search_icon_pointing_on_dock (pDock, &pParentDock); |
1111 | + if (pPointingIcon != NULL) |
1112 | + { |
1113 | + cairo_dock_show_subdock (pPointingIcon, pParentDock); // utile pour le montrage des sous-docks au clic. |
1114 | + } |
1115 | + } |
1116 | + else |
1117 | + { |
1118 | + /// utile de faire ca si on entre dedans ?... |
1119 | + if (pDock->bAutoHide) |
1120 | + cairo_dock_start_showing (pDock); |
1121 | + if (pDock->iVisibility == CAIRO_DOCK_VISI_KEEP_BELOW) |
1122 | + cairo_dock_pop_up (pDock); |
1123 | + } |
1124 | + cairo_dock_emit_enter_signal (CAIRO_CONTAINER (pDock)); |
1125 | + } |
1126 | + |
1127 | + cairo_dock_register_notification_on_container (CAIRO_CONTAINER (pDock), |
1128 | + CAIRO_DOCK_UPDATE_DOCK, |
1129 | + (CairoDockNotificationFunc) cd_do_update_container, |
1130 | + CAIRO_DOCK_RUN_AFTER, NULL); |
1131 | + cairo_dock_register_notification_on_container (CAIRO_CONTAINER (pDock), |
1132 | + CAIRO_DOCK_RENDER_DOCK, |
1133 | + (CairoDockNotificationFunc) cd_do_render, |
1134 | + CAIRO_DOCK_RUN_AFTER, NULL); |
1135 | + } |
1136 | + if (pDock != NULL) |
1137 | + { |
1138 | + gtk_window_present (GTK_WINDOW (pDock->container.pWidget)); |
1139 | + } |
1140 | + |
1141 | + //\_________________ on gere l'allumage et l'eteignage de l'icone precedente et actuelle. |
1142 | + if (myData.pCurrentIcon != NULL && pIcon != myData.pCurrentIcon) // on remet au repos l'icone precedemment anime. |
1143 | + { |
1144 | + myData.bIgnoreIconState = TRUE; |
1145 | + cairo_dock_stop_icon_animation (myData.pCurrentIcon); |
1146 | + myData.bIgnoreIconState = FALSE; |
1147 | + cairo_dock_redraw_icon (myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); /// utile ?... |
1148 | + } |
1149 | + if (pIcon != NULL && myData.pCurrentIcon != pIcon) // on anime la nouvelle icone. |
1150 | + { |
1151 | + int x = pIcon->fXAtRest + pIcon->fWidth/2 + (- pDock->fFlatDockWidth + pDock->iMaxDockWidth)/2; |
1152 | + int y = pIcon->fDrawY + pIcon->fHeight/2 * pIcon->fScale; |
1153 | + if (1||myData.pCurrentDock != pDock) |
1154 | + { |
1155 | + cairo_dock_emit_motion_signal (pDock, |
1156 | + x, |
1157 | + y); |
1158 | + } |
1159 | + else |
1160 | + { |
1161 | + myData.iPrevMouseX = myData.iMouseX; |
1162 | + myData.iPrevMouseY = myData.iMouseY; |
1163 | + myData.iMotionCount = 10; |
1164 | + } |
1165 | + myData.iMouseX = x; |
1166 | + myData.iMouseY = y; |
1167 | + cairo_dock_request_icon_animation (pIcon, pDock, myConfig.cIconAnimation, 1e6); // interrompt l'animation de "mouse over". |
1168 | + cairo_dock_launch_animation (CAIRO_CONTAINER (pDock)); |
1169 | + //if (myAccessibility.bShowSubDockOnClick) |
1170 | + // cairo_dock_show_subdock (pIcon, pDock, FALSE); |
1171 | + } |
1172 | + |
1173 | + myData.pCurrentDock = pDock; |
1174 | + myData.pCurrentIcon = pIcon; |
1175 | + if (myData.pCurrentDock == NULL) |
1176 | + gtk_window_present (GTK_WINDOW (g_pMainDock->container.pWidget)); |
1177 | +} |
1178 | + |
1179 | + |
1180 | +void cd_do_search_current_icon (gboolean bLoopSearch) |
1181 | +{ |
1182 | + //\_________________ on cherche un lanceur correspondant. |
1183 | + CairoDock *pDock; |
1184 | + Icon *pIcon = cd_do_search_icon_by_command (myData.sCurrentText->str, (bLoopSearch ? myData.pCurrentIcon : NULL), &pDock); |
1185 | + cd_debug ("found icon : %s\n", pIcon ? pIcon->cName : "none"); |
1186 | + |
1187 | + //\_________________ on gere le changement d'icone/dock. |
1188 | + cd_do_change_current_icon (pIcon, pDock); |
1189 | +} |
1190 | + |
1191 | + |
1192 | +gboolean cairo_dock_emit_motion_signal (CairoDock *pDock, int iMouseX, int iMouseY) |
1193 | +{ |
1194 | + static gboolean bReturn; |
1195 | + static GdkEventMotion motion; |
1196 | + motion.state = 0; |
1197 | + motion.x = iMouseX; |
1198 | + motion.y = iMouseY; |
1199 | + motion.x_root = pDock->container.iWindowPositionX + pDock->container.iMouseX; |
1200 | + motion.y_root = pDock->container.iWindowPositionY + pDock->container.iMouseY; |
1201 | + motion.time = 0; |
1202 | + motion.window = pDock->container.pWidget->window; |
1203 | + motion.device = gdk_device_get_core_pointer (); |
1204 | + g_signal_emit_by_name (pDock->container.pWidget, "motion-notify-event", &motion, &bReturn); |
1205 | + return FALSE; |
1206 | +} |
1207 | |
1208 | === added file 'Remote-Control/src/applet-icon-finder.h' |
1209 | --- Remote-Control/src/applet-icon-finder.h 1970-01-01 00:00:00 +0000 |
1210 | +++ Remote-Control/src/applet-icon-finder.h 2010-10-02 18:13:46 +0000 |
1211 | @@ -0,0 +1,40 @@ |
1212 | +/** |
1213 | +* This file is a part of the Cairo-Dock project |
1214 | +* |
1215 | +* Copyright : (C) see the 'copyright' file. |
1216 | +* E-mail : see the 'copyright' file. |
1217 | +* |
1218 | +* This program is free software; you can redistribute it and/or |
1219 | +* modify it under the terms of the GNU General Public License |
1220 | +* as published by the Free Software Foundation; either version 3 |
1221 | +* of the License, or (at your option) any later version. |
1222 | +* |
1223 | +* This program is distributed in the hope that it will be useful, |
1224 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1225 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1226 | +* GNU General Public License for more details. |
1227 | +* You should have received a copy of the GNU General Public License |
1228 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1229 | +*/ |
1230 | + |
1231 | + |
1232 | +#ifndef __APPLET_ICON_FINDER__ |
1233 | +#define __APPLET_ICON_FINDER__ |
1234 | + |
1235 | +#include <cairo-dock.h> |
1236 | +#include "applet-struct.h" |
1237 | + |
1238 | + |
1239 | +Icon *cd_do_search_icon_by_command (const gchar *cCommandPrefix, Icon *pAfterIcon, CairoDock **pDock); |
1240 | + |
1241 | + |
1242 | +void cd_do_change_current_icon (Icon *pIcon, CairoDock *pDock); |
1243 | + |
1244 | + |
1245 | +void cd_do_search_current_icon (gboolean bLoopSearch); |
1246 | + |
1247 | + |
1248 | +gboolean cairo_dock_emit_motion_signal (CairoDock *pDock, int iMouseX, int iMouseY); |
1249 | + |
1250 | + |
1251 | +#endif |
1252 | |
1253 | === added file 'Remote-Control/src/applet-init.c' |
1254 | --- Remote-Control/src/applet-init.c 1970-01-01 00:00:00 +0000 |
1255 | +++ Remote-Control/src/applet-init.c 2010-10-02 18:13:46 +0000 |
1256 | @@ -0,0 +1,66 @@ |
1257 | +/** |
1258 | +* This file is a part of the Cairo-Dock project |
1259 | +* |
1260 | +* Copyright : (C) see the 'copyright' file. |
1261 | +* E-mail : see the 'copyright' file. |
1262 | +* |
1263 | +* This program is free software; you can redistribute it and/or |
1264 | +* modify it under the terms of the GNU General Public License |
1265 | +* as published by the Free Software Foundation; either version 3 |
1266 | +* of the License, or (at your option) any later version. |
1267 | +* |
1268 | +* This program is distributed in the hope that it will be useful, |
1269 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1270 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1271 | +* GNU General Public License for more details. |
1272 | +* You should have received a copy of the GNU General Public License |
1273 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1274 | +*/ |
1275 | + |
1276 | +#include "stdlib.h" |
1277 | + |
1278 | +#include "applet-struct.h" |
1279 | +#include "applet-config.h" |
1280 | +#include "applet-notifications.h" |
1281 | +#include "applet-session.h" |
1282 | +#include "applet-init.h" |
1283 | + |
1284 | + |
1285 | +CD_APPLET_DEFINE_BEGIN (("Remote-Control"), |
1286 | + 2, 2, 0, |
1287 | + CAIRO_DOCK_CATEGORY_APPLET_FUN, |
1288 | + ("This plug-in lets you control your dock from the keyboard,\n" |
1289 | + " or even a remote controller.\n" |
1290 | + "Press the shortcut (by default CTRL + F9),\n" |
1291 | + " then use the arrows to navigate into the docks and sub-docks,\n" |
1292 | + " or type the name of a launcher and press Tab to automatically jump to the next suitable launcher\n" |
1293 | + "Press Enter to click on the icon, Shift+Enter for Shift+click, Alt+Enter for middle click, and Ctrl+Enter for left click\n" |
1294 | + "Escape or the same shortkey will cancel."), |
1295 | + "Fabounet (Fabrice Rey)") |
1296 | + CD_APPLET_DEFINE_COMMON_APPLET_INTERFACE |
1297 | + CD_APPLET_SET_CONTAINER_TYPE (CAIRO_DOCK_MODULE_IS_PLUGIN); |
1298 | +CD_APPLET_DEFINE_END |
1299 | + |
1300 | + |
1301 | +//\___________ Here is where you initiate your applet. myConfig is already set at this point, and also myIcon, myContainer, myDock, myDesklet (and myDrawContext if you're in dock mode). The macro CD_APPLET_MY_CONF_FILE and CD_APPLET_MY_KEY_FILE can give you access to the applet's conf-file and its corresponding key-file (also available during reload). If you're in desklet mode, myDrawContext is still NULL, and myIcon's buffers has not been filled, because you may not need them then (idem when reloading). |
1302 | +CD_APPLET_INIT_BEGIN |
1303 | + cd_keybinder_bind (myConfig.cShortkeyNav, (CDBindkeyHandler) cd_do_on_shortkey_nav, myApplet); |
1304 | + |
1305 | +CD_APPLET_INIT_END |
1306 | + |
1307 | + |
1308 | +//\___________ Here is where you stop your applet. myConfig and myData are still valid, but will be reseted to 0 at the end of the function. In the end, your applet will go back to its original state, as if it had never been activated. |
1309 | +CD_APPLET_STOP_BEGIN |
1310 | + cd_do_exit_session (); |
1311 | + |
1312 | +CD_APPLET_STOP_END |
1313 | + |
1314 | + |
1315 | +//\___________ The reload occurs in 2 occasions : when the user changes the applet's config, and when the user reload the cairo-dock's config or modify the desklet's size. The macro CD_APPLET_MY_CONFIG_CHANGED can tell you this. myConfig has already been reloaded at this point if you're in the first case, myData is untouched. You also have the macro CD_APPLET_MY_CONTAINER_TYPE_CHANGED that can tell you if you switched from dock/desklet to desklet/dock mode. |
1316 | +CD_APPLET_RELOAD_BEGIN |
1317 | + if (CD_APPLET_MY_CONFIG_CHANGED) |
1318 | + { |
1319 | + cd_keybinder_bind (myConfig.cShortkeyNav, (CDBindkeyHandler) cd_do_on_shortkey_nav, myApplet); // shortkey were unbinded during reset_config. |
1320 | + |
1321 | + } |
1322 | +CD_APPLET_RELOAD_END |
1323 | |
1324 | === added file 'Remote-Control/src/applet-init.h' |
1325 | --- Remote-Control/src/applet-init.h 1970-01-01 00:00:00 +0000 |
1326 | +++ Remote-Control/src/applet-init.h 2010-10-02 18:13:46 +0000 |
1327 | @@ -0,0 +1,31 @@ |
1328 | +/** |
1329 | +* This file is a part of the Cairo-Dock project |
1330 | +* |
1331 | +* Copyright : (C) see the 'copyright' file. |
1332 | +* E-mail : see the 'copyright' file. |
1333 | +* |
1334 | +* This program is free software; you can redistribute it and/or |
1335 | +* modify it under the terms of the GNU General Public License |
1336 | +* as published by the Free Software Foundation; either version 3 |
1337 | +* of the License, or (at your option) any later version. |
1338 | +* |
1339 | +* This program is distributed in the hope that it will be useful, |
1340 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1341 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1342 | +* GNU General Public License for more details. |
1343 | +* You should have received a copy of the GNU General Public License |
1344 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1345 | +*/ |
1346 | + |
1347 | + |
1348 | +#ifndef __APPLET_INIT__ |
1349 | +#define __APPLET_INIT__ |
1350 | + |
1351 | + |
1352 | +#include <cairo-dock.h> |
1353 | + |
1354 | + |
1355 | +CD_APPLET_H |
1356 | + |
1357 | + |
1358 | +#endif |
1359 | |
1360 | === added file 'Remote-Control/src/applet-notifications.c' |
1361 | --- Remote-Control/src/applet-notifications.c 1970-01-01 00:00:00 +0000 |
1362 | +++ Remote-Control/src/applet-notifications.c 2010-10-02 18:13:46 +0000 |
1363 | @@ -0,0 +1,480 @@ |
1364 | +/** |
1365 | +* This file is a part of the Cairo-Dock project |
1366 | +* |
1367 | +* Copyright : (C) see the 'copyright' file. |
1368 | +* E-mail : see the 'copyright' file. |
1369 | +* |
1370 | +* This program is free software; you can redistribute it and/or |
1371 | +* modify it under the terms of the GNU General Public License |
1372 | +* as published by the Free Software Foundation; either version 3 |
1373 | +* of the License, or (at your option) any later version. |
1374 | +* |
1375 | +* This program is distributed in the hope that it will be useful, |
1376 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1377 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1378 | +* GNU General Public License for more details. |
1379 | +* You should have received a copy of the GNU General Public License |
1380 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1381 | +*/ |
1382 | + |
1383 | +#include <stdlib.h> |
1384 | +#include <string.h> |
1385 | +#include <math.h> |
1386 | +#include <gdk/gdkkeysyms.h> |
1387 | + |
1388 | +#include "applet-struct.h" |
1389 | +#include "applet-icon-finder.h" |
1390 | +#include "applet-session.h" |
1391 | +#include "applet-notifications.h" |
1392 | + |
1393 | +#define _alpha_prompt(k,n) cos (G_PI/2*fabs ((double) ((k % (2*n)) - n) / n)); |
1394 | + |
1395 | +const int s_iNbPromptAnimationSteps = 40; |
1396 | + |
1397 | + |
1398 | +static inline int _orient_arrow (CairoContainer *pContainer, int iKeyVal) |
1399 | +{ |
1400 | + switch (iKeyVal) |
1401 | + { |
1402 | + case GDK_Up : |
1403 | + if (pContainer->bIsHorizontal) |
1404 | + { |
1405 | + if (!pContainer->bDirectionUp) |
1406 | + iKeyVal = GDK_Down; |
1407 | + } |
1408 | + else |
1409 | + { |
1410 | + iKeyVal = GDK_Left; |
1411 | + } |
1412 | + break; |
1413 | + |
1414 | + case GDK_Down : |
1415 | + if (pContainer->bIsHorizontal) |
1416 | + { |
1417 | + if (!pContainer->bDirectionUp) |
1418 | + iKeyVal = GDK_Up; |
1419 | + } |
1420 | + else |
1421 | + { |
1422 | + iKeyVal = GDK_Right; |
1423 | + } |
1424 | + break; |
1425 | + |
1426 | + case GDK_Left : |
1427 | + if (!pContainer->bIsHorizontal) |
1428 | + { |
1429 | + if (pContainer->bDirectionUp) |
1430 | + iKeyVal = GDK_Up; |
1431 | + else |
1432 | + iKeyVal = GDK_Down; |
1433 | + } |
1434 | + break; |
1435 | + |
1436 | + case GDK_Right : |
1437 | + if (!pContainer->bIsHorizontal) |
1438 | + { |
1439 | + if (pContainer->bDirectionUp) |
1440 | + iKeyVal = GDK_Down; |
1441 | + else |
1442 | + iKeyVal = GDK_Up; |
1443 | + } |
1444 | + break; |
1445 | + default: |
1446 | + break; |
1447 | + |
1448 | + } |
1449 | + return iKeyVal; |
1450 | +} |
1451 | +static void _find_next_dock (CairoDock *pDock, gpointer *data) |
1452 | +{ |
1453 | + if (data[3] == NULL) // first root dock in the list. |
1454 | + data[3] = pDock; |
1455 | + if (data[0] == pDock) // this dock is the current one, we'll take the next one. |
1456 | + data[2] = GINT_TO_POINTER (TRUE); |
1457 | + else if (data[2]) // we take this one. |
1458 | + data[1] = pDock; |
1459 | +} |
1460 | +gboolean cd_do_key_pressed (gpointer pUserData, CairoContainer *pContainer, guint iKeyVal, guint iModifierType, const gchar *string) |
1461 | +{ |
1462 | + g_return_val_if_fail (cd_do_session_is_running (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
1463 | + |
1464 | + const gchar *cKeyName = gdk_keyval_name (iKeyVal); |
1465 | + guint32 iUnicodeChar = gdk_keyval_to_unicode (iKeyVal); |
1466 | + cd_debug ("+ cKeyName : %s (%c, %s)\n", cKeyName, iUnicodeChar, string); |
1467 | + |
1468 | + if (iKeyVal == GDK_Escape) // on clot la session. |
1469 | + { |
1470 | + cd_do_close_session (); |
1471 | + } |
1472 | + else if (iKeyVal == GDK_space && myData.sCurrentText->len == 0) // pas d'espace en debut de chaine. |
1473 | + { |
1474 | + // on rejette. |
1475 | + } |
1476 | + else if (iKeyVal >= GDK_Shift_L && iKeyVal <= GDK_Hyper_R) // on n'ecrit pas les modificateurs. |
1477 | + { |
1478 | + // on rejette. |
1479 | + } |
1480 | + else if (iKeyVal == GDK_Menu) // emulation du clic droit. |
1481 | + { |
1482 | + if (myData.pCurrentIcon != NULL && myData.pCurrentDock != NULL) |
1483 | + { |
1484 | + myData.bIgnoreIconState = TRUE; |
1485 | + cairo_dock_stop_icon_animation (myData.pCurrentIcon); // car on va perdre le focus. |
1486 | + myData.bIgnoreIconState = FALSE; |
1487 | + |
1488 | + GtkWidget *menu = cairo_dock_build_menu (myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); |
1489 | + cairo_dock_popup_menu_on_icon (menu, myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); |
1490 | + } |
1491 | + } |
1492 | + else if (iKeyVal == GDK_BackSpace) // on efface la derniere lettre. |
1493 | + { |
1494 | + if (myData.sCurrentText->len > 0) |
1495 | + { |
1496 | + cd_debug ("on efface la derniere lettre de %s (%d)\n", myData.sCurrentText->str, myData.sCurrentText->len); |
1497 | + |
1498 | + g_string_truncate (myData.sCurrentText, myData.sCurrentText->len-1); |
1499 | + |
1500 | + // on relance la recherche. |
1501 | + if (myData.pCurrentIcon == NULL) // sinon l'icone actuelle convient toujours. |
1502 | + cd_do_search_current_icon (FALSE); |
1503 | + } |
1504 | + } |
1505 | + else if (iKeyVal == GDK_Tab) // jump to next icon. |
1506 | + { |
1507 | + if (myData.sCurrentText->len > 0) |
1508 | + { |
1509 | + gboolean bPrevious = iModifierType & GDK_SHIFT_MASK; |
1510 | + // on cherche l'icone suivante. |
1511 | + cd_do_search_current_icon (TRUE); // pCurrentIcon peut etre NULL si elle s'est faite detruire pendant la recherche, auquel cas on cherchera juste normalement. |
1512 | + } |
1513 | + } |
1514 | + else if (iKeyVal == GDK_Return) |
1515 | + { |
1516 | + if (myData.pCurrentIcon != NULL && myData.pCurrentDock != NULL) |
1517 | + { |
1518 | + cd_debug ("on clique sur l'icone '%s' [%d, %d]\n", myData.pCurrentIcon->cName, iModifierType, GDK_SHIFT_MASK); |
1519 | + |
1520 | + myData.bIgnoreIconState = TRUE; |
1521 | + if (iModifierType & GDK_MOD1_MASK) // ALT |
1522 | + { |
1523 | + myData.bIgnoreIconState = TRUE; |
1524 | + cairo_dock_stop_icon_animation (myData.pCurrentIcon); // car aucune animation ne va la remplacer. |
1525 | + myData.bIgnoreIconState = FALSE; |
1526 | + cairo_dock_notify (CAIRO_DOCK_MIDDLE_CLICK_ICON, myData.pCurrentIcon, myData.pCurrentDock); |
1527 | + } |
1528 | + else if (iModifierType & GDK_CONTROL_MASK) // CTRL |
1529 | + { |
1530 | + myData.bIgnoreIconState = TRUE; |
1531 | + cairo_dock_stop_icon_animation (myData.pCurrentIcon); // car on va perdre le focus. |
1532 | + myData.bIgnoreIconState = FALSE; |
1533 | + |
1534 | + myData.pCurrentDock->bMenuVisible = TRUE; |
1535 | + GtkWidget *menu = cairo_dock_build_menu (myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); |
1536 | + cairo_dock_popup_menu_on_icon (menu, myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); |
1537 | + } |
1538 | + else if (myData.pCurrentIcon != NULL) |
1539 | + { |
1540 | + cairo_dock_notify (CAIRO_DOCK_CLICK_ICON, myData.pCurrentIcon, myData.pCurrentDock, iModifierType); |
1541 | + if (CAIRO_DOCK_IS_APPLI (myData.pCurrentIcon)) |
1542 | + myData.iPreviouslyActiveWindow = 0; |
1543 | + } |
1544 | + if (myData.pCurrentIcon != NULL) |
1545 | + cairo_dock_start_icon_animation (myData.pCurrentIcon, myData.pCurrentDock); |
1546 | + myData.bIgnoreIconState = FALSE; |
1547 | + myData.pCurrentIcon = NULL; // sinon on va interrompre l'animation en fermant la session. |
1548 | + } |
1549 | + cd_do_close_session (); |
1550 | + } |
1551 | + else if (iKeyVal == GDK_Left || iKeyVal == GDK_Right || iKeyVal == GDK_Up || iKeyVal == GDK_Down) |
1552 | + { |
1553 | + iKeyVal = _orient_arrow (pContainer, iKeyVal); |
1554 | + if (iKeyVal == GDK_Up) |
1555 | + { |
1556 | + if (myData.pCurrentIcon != NULL && myData.pCurrentIcon->pSubDock != NULL) |
1557 | + { |
1558 | + cd_debug ("on monte dans le sous-dock %s\n", myData.pCurrentIcon->cName); |
1559 | + Icon *pIcon = cairo_dock_get_first_icon (myData.pCurrentIcon->pSubDock->icons); |
1560 | + cd_do_change_current_icon (pIcon, myData.pCurrentIcon->pSubDock); |
1561 | + } |
1562 | + } |
1563 | + else if (iKeyVal == GDK_Down) |
1564 | + { |
1565 | + if (myData.pCurrentDock != NULL && myData.pCurrentDock->iRefCount > 0) |
1566 | + { |
1567 | + CairoDock *pParentDock = NULL; |
1568 | + Icon *pPointingIcon = cairo_dock_search_icon_pointing_on_dock (myData.pCurrentDock, &pParentDock); |
1569 | + if (pPointingIcon != NULL) |
1570 | + { |
1571 | + cd_debug ("on redescend dans le dock parent via %s\n", pPointingIcon->cName); |
1572 | + cd_do_change_current_icon (pPointingIcon, pParentDock); |
1573 | + } |
1574 | + } |
1575 | + } |
1576 | + else if (iKeyVal == GDK_Left) |
1577 | + { |
1578 | + if (myData.pCurrentDock == NULL) // on initialise le deplacement. |
1579 | + { |
1580 | + myData.pCurrentDock = g_pMainDock; |
1581 | + int n = g_list_length (g_pMainDock->icons); |
1582 | + if (n > 0) |
1583 | + { |
1584 | + myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n-1) / 2); |
1585 | + if (CAIRO_DOCK_IS_SEPARATOR (myData.pCurrentIcon) && n > 1) |
1586 | + myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n+1) / 2); |
1587 | + } |
1588 | + } |
1589 | + if (myData.pCurrentDock->icons != NULL) |
1590 | + { |
1591 | + Icon *pPrevIcon = cairo_dock_get_previous_icon (myData.pCurrentDock->icons, myData.pCurrentIcon); |
1592 | + if (CAIRO_DOCK_IS_SEPARATOR (pPrevIcon)) |
1593 | + pPrevIcon = cairo_dock_get_previous_icon (myData.pCurrentDock->icons, pPrevIcon); |
1594 | + if (pPrevIcon == NULL) // pas trouve ou bien 1ere icone. |
1595 | + { |
1596 | + pPrevIcon = cairo_dock_get_last_icon (myData.pCurrentDock->icons); |
1597 | + } |
1598 | + |
1599 | + cd_debug ("on se deplace a gauche sur %s\n", pPrevIcon ? pPrevIcon->cName : "none"); |
1600 | + cd_do_change_current_icon (pPrevIcon, myData.pCurrentDock); |
1601 | + } |
1602 | + } |
1603 | + else // Gdk_Right. |
1604 | + { |
1605 | + if (myData.pCurrentDock == NULL) // on initialise le deplacement. |
1606 | + { |
1607 | + myData.pCurrentDock = g_pMainDock; |
1608 | + int n = g_list_length (g_pMainDock->icons); |
1609 | + if (n > 0) |
1610 | + { |
1611 | + myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n-1) / 2); |
1612 | + if (CAIRO_DOCK_IS_SEPARATOR (myData.pCurrentIcon) && n > 1) |
1613 | + myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n+1) / 2); |
1614 | + } |
1615 | + } |
1616 | + if (myData.pCurrentDock->icons != NULL) |
1617 | + { |
1618 | + Icon *pNextIcon = cairo_dock_get_next_icon (myData.pCurrentDock->icons, myData.pCurrentIcon); |
1619 | + if (CAIRO_DOCK_IS_SEPARATOR (pNextIcon)) |
1620 | + pNextIcon = cairo_dock_get_next_icon (myData.pCurrentDock->icons, pNextIcon); |
1621 | + if (pNextIcon == NULL) // pas trouve ou bien 1ere icone. |
1622 | + { |
1623 | + pNextIcon = cairo_dock_get_first_icon (myData.pCurrentDock->icons); |
1624 | + } |
1625 | + |
1626 | + cd_debug ("on se deplace a gauche sur %s\n", pNextIcon ? pNextIcon->cName : "none"); |
1627 | + cd_do_change_current_icon (pNextIcon, myData.pCurrentDock); |
1628 | + } |
1629 | + } |
1630 | + } |
1631 | + else if (iKeyVal == GDK_Page_Down || iKeyVal == GDK_Page_Up || iKeyVal == GDK_Home || iKeyVal == GDK_End) |
1632 | + { |
1633 | + if (iModifierType & GDK_CONTROL_MASK) // changement de dock principal |
1634 | + { |
1635 | + gpointer data[4] = {myData.pCurrentDock, NULL, GINT_TO_POINTER (FALSE), NULL}; |
1636 | + cairo_dock_foreach_root_docks ((GFunc) _find_next_dock, data); |
1637 | + CairoDock *pNextDock = data[1]; |
1638 | + if (pNextDock == NULL) |
1639 | + pNextDock = data[3]; |
1640 | + if (pNextDock != NULL) |
1641 | + { |
1642 | + Icon *pNextIcon = NULL; |
1643 | + int n = g_list_length (pNextDock->icons); |
1644 | + if (n > 0) |
1645 | + { |
1646 | + pNextIcon = g_list_nth_data (pNextDock->icons, (n-1) / 2); |
1647 | + if (CAIRO_DOCK_IS_SEPARATOR (pNextIcon) && n > 1) |
1648 | + pNextIcon = g_list_nth_data (pNextDock->icons, (n+1) / 2); |
1649 | + } |
1650 | + cd_do_change_current_icon (pNextIcon, pNextDock); |
1651 | + } |
1652 | + } |
1653 | + |
1654 | + Icon *pIcon = (iKeyVal == GDK_Page_Up || iKeyVal == GDK_Home ? cairo_dock_get_first_icon (myData.pCurrentDock->icons) : cairo_dock_get_last_icon (myData.pCurrentDock->icons)); |
1655 | + cd_debug ("on se deplace a l'extremite sur %s\n", pIcon ? pIcon->cName : "none"); |
1656 | + cd_do_change_current_icon (pIcon, myData.pCurrentDock); |
1657 | + } |
1658 | + else if (string) /// utiliser l'unichar ... |
1659 | + { |
1660 | + cd_debug ("string:'%s'\n", string); |
1661 | + g_string_append_c (myData.sCurrentText, *string); |
1662 | + |
1663 | + cd_do_search_current_icon (FALSE); |
1664 | + } |
1665 | + |
1666 | + return CAIRO_DOCK_INTERCEPT_NOTIFICATION; |
1667 | +} |
1668 | + |
1669 | + |
1670 | +void cd_do_on_shortkey_nav (const char *keystring, gpointer data) |
1671 | +{ |
1672 | + if (! cd_do_session_is_running ()) |
1673 | + { |
1674 | + cd_do_open_session (); |
1675 | + } |
1676 | + else |
1677 | + { |
1678 | + cd_do_close_session (); |
1679 | + } |
1680 | +} |
1681 | + |
1682 | + |
1683 | +gboolean cd_do_update_container (gpointer pUserData, CairoContainer *pContainer, gboolean *bContinueAnimation) |
1684 | +{ |
1685 | + g_return_val_if_fail (!cd_do_session_is_off (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
1686 | + |
1687 | + if (myData.iMotionCount != 0) |
1688 | + { |
1689 | + myData.iMotionCount --; |
1690 | + double f = (double) myData.iMotionCount / 10; |
1691 | + cairo_dock_emit_motion_signal (CAIRO_DOCK (pContainer), |
1692 | + f * myData.iPrevMouseX + (1-f) * myData.iMouseX, |
1693 | + f * myData.iPrevMouseY + (1-f) * myData.iMouseY); |
1694 | + *bContinueAnimation = TRUE; |
1695 | + } |
1696 | + |
1697 | + int iDeltaT = cairo_dock_get_animation_delta_t (pContainer); |
1698 | + if (cd_do_session_is_closing ()) |
1699 | + { |
1700 | + //\___________________ animation de fermeture de la session (disparition des lettres ou du prompt). |
1701 | + myData.iCloseTime -= iDeltaT; |
1702 | + if (myData.iCloseTime <= 0) |
1703 | + cd_do_exit_session (); |
1704 | + else |
1705 | + *bContinueAnimation = TRUE; |
1706 | + cairo_dock_redraw_container (pContainer); |
1707 | + } |
1708 | + else if (cd_do_session_is_running ()) |
1709 | + { |
1710 | + //\___________________ animation du prompt. |
1711 | + myData.iPromptAnimationCount ++; |
1712 | + *bContinueAnimation = TRUE; |
1713 | + |
1714 | + cairo_dock_redraw_container (pContainer); |
1715 | + } |
1716 | + |
1717 | + return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
1718 | +} |
1719 | + |
1720 | + |
1721 | +gboolean cd_do_check_icon_stopped (gpointer pUserData, Icon *pIcon) |
1722 | +{ |
1723 | + if (pIcon == myData.pCurrentIcon && ! myData.bIgnoreIconState) |
1724 | + { |
1725 | + cd_debug ("notre icone vient de se faire stopper\n"); |
1726 | + myData.pCurrentIcon = NULL; |
1727 | + myData.pCurrentDock = NULL; |
1728 | + |
1729 | + // eventuellement emuler un TAB pour trouver la suivante ... |
1730 | + } |
1731 | + |
1732 | + return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
1733 | +} |
1734 | + |
1735 | + |
1736 | +static void _check_dock_is_active (gchar *cDockName, CairoDock *pDock, Window *data) |
1737 | +{ |
1738 | + Window xActiveWindow = data[0]; |
1739 | + if (GDK_WINDOW_XID (pDock->container.pWidget->window) == xActiveWindow) |
1740 | + data[1] = 1; |
1741 | +} |
1742 | +gboolean cd_do_check_active_dock (gpointer pUserData, Window *XActiveWindow) |
1743 | +{ |
1744 | + if (myData.sCurrentText == NULL || XActiveWindow == NULL) |
1745 | + return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
1746 | + Window data[2] = {*XActiveWindow, 0}; |
1747 | + cairo_dock_foreach_docks ((GHFunc) _check_dock_is_active, data); |
1748 | + |
1749 | + if (data[1] == 0) |
1750 | + gtk_window_present (GTK_WINDOW (g_pMainDock->container.pWidget)); |
1751 | + return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
1752 | +} |
1753 | + |
1754 | + |
1755 | +static void _render_cairo (CairoContainer *pContainer, cairo_t *pCairoContext) |
1756 | +{ |
1757 | + double fAlpha; |
1758 | + if (myData.iCloseTime != 0) // animation de fin |
1759 | + fAlpha = (double) myData.iCloseTime / myConfig.iCloseDuration; |
1760 | + else |
1761 | + fAlpha = 1.; |
1762 | + |
1763 | + if (myData.pArrowImage->pSurface != NULL) |
1764 | + { |
1765 | + double fFrameWidth = myData.pArrowImage->iWidth; |
1766 | + double fFrameHeight = myData.pArrowImage->iHeight; |
1767 | + |
1768 | + double fDockOffsetX, fDockOffsetY; // Offset du coin haut gauche du prompt. |
1769 | + if (pContainer->bIsHorizontal) |
1770 | + { |
1771 | + fDockOffsetX = (pContainer->iWidth - fFrameWidth) / 2; |
1772 | + fDockOffsetY = (pContainer->iHeight - fFrameHeight) / 2; |
1773 | + } |
1774 | + else |
1775 | + { |
1776 | + fDockOffsetY = (pContainer->iWidth - fFrameWidth) / 2; |
1777 | + fDockOffsetX = (pContainer->iHeight - fFrameHeight) / 2; |
1778 | + } |
1779 | + |
1780 | + fAlpha *= _alpha_prompt (myData.iPromptAnimationCount, s_iNbPromptAnimationSteps); |
1781 | + |
1782 | + if (fAlpha != 0) |
1783 | + { |
1784 | + cairo_translate (pCairoContext, fDockOffsetX, fDockOffsetY); |
1785 | + cairo_dock_draw_surface (pCairoContext, myData.pArrowImage->pSurface, fFrameWidth, fFrameHeight, pContainer->bDirectionUp, pContainer->bIsHorizontal, fAlpha); |
1786 | + } |
1787 | + } |
1788 | +} |
1789 | + |
1790 | +static void _render_opengl (CairoContainer *pContainer) |
1791 | +{ |
1792 | + double fAlpha; |
1793 | + if (myData.iCloseTime != 0) // animation de fin |
1794 | + fAlpha = (double) myData.iCloseTime / myConfig.iCloseDuration; |
1795 | + else |
1796 | + fAlpha = 1.; |
1797 | + |
1798 | + if (myData.pArrowImage->iTexture != 0) |
1799 | + { |
1800 | + double fFrameWidth = myData.pArrowImage->iWidth; |
1801 | + double fFrameHeight = myData.pArrowImage->iHeight; |
1802 | + |
1803 | + double fDockOffsetX, fDockOffsetY; // Offset du coin haut gauche du prompt. |
1804 | + fDockOffsetX = (pContainer->iWidth - fFrameWidth) / 2; |
1805 | + fDockOffsetY = (pContainer->iHeight - fFrameHeight) / 2; |
1806 | + |
1807 | + fAlpha *= _alpha_prompt (myData.iPromptAnimationCount, s_iNbPromptAnimationSteps); |
1808 | + |
1809 | + if (fAlpha != 0) |
1810 | + { |
1811 | + glPushMatrix (); |
1812 | + |
1813 | + cairo_dock_set_container_orientation_opengl (pContainer); |
1814 | + |
1815 | + glTranslatef (pContainer->iWidth/2, pContainer->iHeight/2, 0.); |
1816 | + |
1817 | + _cairo_dock_enable_texture (); |
1818 | + _cairo_dock_set_blend_alpha (); |
1819 | + |
1820 | + _cairo_dock_apply_texture_at_size_with_alpha (myData.pArrowImage->iTexture, fFrameWidth, fFrameHeight, fAlpha); |
1821 | + |
1822 | + _cairo_dock_disable_texture (); |
1823 | + |
1824 | + glPopMatrix(); |
1825 | + } |
1826 | + } |
1827 | +} |
1828 | + |
1829 | +gboolean cd_do_render (gpointer pUserData, CairoContainer *pContainer, cairo_t *pCairoContext) |
1830 | +{ |
1831 | + g_return_val_if_fail (!cd_do_session_is_off (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
1832 | + |
1833 | + if (pCairoContext != NULL) |
1834 | + { |
1835 | + _render_cairo (pContainer, pCairoContext); |
1836 | + } |
1837 | + else |
1838 | + { |
1839 | + _render_opengl (pContainer); |
1840 | + } |
1841 | + |
1842 | + return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
1843 | +} |
1844 | |
1845 | === added file 'Remote-Control/src/applet-notifications.h' |
1846 | --- Remote-Control/src/applet-notifications.h 1970-01-01 00:00:00 +0000 |
1847 | +++ Remote-Control/src/applet-notifications.h 2010-10-02 18:13:46 +0000 |
1848 | @@ -0,0 +1,45 @@ |
1849 | +/** |
1850 | +* This file is a part of the Cairo-Dock project |
1851 | +* |
1852 | +* Copyright : (C) see the 'copyright' file. |
1853 | +* E-mail : see the 'copyright' file. |
1854 | +* |
1855 | +* This program is free software; you can redistribute it and/or |
1856 | +* modify it under the terms of the GNU General Public License |
1857 | +* as published by the Free Software Foundation; either version 3 |
1858 | +* of the License, or (at your option) any later version. |
1859 | +* |
1860 | +* This program is distributed in the hope that it will be useful, |
1861 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1862 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1863 | +* GNU General Public License for more details. |
1864 | +* You should have received a copy of the GNU General Public License |
1865 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1866 | +*/ |
1867 | + |
1868 | + |
1869 | +#ifndef __APPLET_NOTIFICATIONS__ |
1870 | +#define __APPLET_NOTIFICATIONS__ |
1871 | + |
1872 | +#include <cairo-dock.h> |
1873 | + |
1874 | + |
1875 | +gboolean cd_do_key_pressed (gpointer pUserData, CairoContainer *pContainer, guint iKeyVal, guint iModifierType, const gchar *string); |
1876 | + |
1877 | + |
1878 | +void cd_do_on_shortkey_nav (const char *keystring, gpointer data); |
1879 | + |
1880 | + |
1881 | +gboolean cd_do_update_container (gpointer pUserData, CairoContainer *pContainer, gboolean *bContinueAnimation); |
1882 | + |
1883 | + |
1884 | +gboolean cd_do_check_icon_stopped (gpointer pUserData, Icon *pIcon); |
1885 | + |
1886 | + |
1887 | +gboolean cd_do_check_active_dock (gpointer pUserData, Window *XActiveWindow); |
1888 | + |
1889 | + |
1890 | +gboolean cd_do_render (gpointer pUserData, CairoContainer *pContainer, cairo_t *pCairoContext); |
1891 | + |
1892 | + |
1893 | +#endif |
1894 | |
1895 | === added file 'Remote-Control/src/applet-session.c' |
1896 | --- Remote-Control/src/applet-session.c 1970-01-01 00:00:00 +0000 |
1897 | +++ Remote-Control/src/applet-session.c 2010-10-02 18:13:46 +0000 |
1898 | @@ -0,0 +1,154 @@ |
1899 | +/** |
1900 | +* This file is a part of the Cairo-Dock project |
1901 | +* |
1902 | +* Copyright : (C) see the 'copyright' file. |
1903 | +* E-mail : see the 'copyright' file. |
1904 | +* |
1905 | +* This program is free software; you can redistribute it and/or |
1906 | +* modify it under the terms of the GNU General Public License |
1907 | +* as published by the Free Software Foundation; either version 3 |
1908 | +* of the License, or (at your option) any later version. |
1909 | +* |
1910 | +* This program is distributed in the hope that it will be useful, |
1911 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1912 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1913 | +* GNU General Public License for more details. |
1914 | +* You should have received a copy of the GNU General Public License |
1915 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1916 | +*/ |
1917 | + |
1918 | +#include <stdlib.h> |
1919 | +#include <string.h> |
1920 | + |
1921 | +#include "applet-struct.h" |
1922 | +#include "applet-notifications.h" |
1923 | +#include "applet-icon-finder.h" |
1924 | +#include "applet-session.h" |
1925 | + |
1926 | + |
1927 | +void cd_do_open_session (void) |
1928 | +{ |
1929 | + if (cd_do_session_is_running ()) // session already running |
1930 | + return; |
1931 | + |
1932 | + // register to draw on dock. |
1933 | + /**if (cd_do_session_is_off ()) |
1934 | + { |
1935 | + cairo_dock_register_notification_on_container (CAIRO_CONTAINER (g_pMainDock), |
1936 | + CAIRO_DOCK_UPDATE_DOCK, |
1937 | + (CairoDockNotificationFunc) cd_do_update_container, |
1938 | + CAIRO_DOCK_RUN_AFTER, NULL); |
1939 | + cairo_dock_register_notification_on_container (CAIRO_CONTAINER (g_pMainDock), |
1940 | + CAIRO_DOCK_RENDER_DOCK, |
1941 | + (CairoDockNotificationFunc) cd_do_render, |
1942 | + CAIRO_DOCK_RUN_AFTER, NULL); |
1943 | + }*/ |
1944 | + |
1945 | + // wait for keyboard input. |
1946 | + cairo_dock_register_notification (CAIRO_DOCK_KEY_PRESSED, (CairoDockNotificationFunc) cd_do_key_pressed, CAIRO_DOCK_RUN_AFTER, NULL); |
1947 | + cairo_dock_register_notification (CAIRO_DOCK_STOP_ICON, (CairoDockNotificationFunc) cd_do_check_icon_stopped, CAIRO_DOCK_RUN_AFTER, NULL); |
1948 | + cairo_dock_register_notification (CAIRO_DOCK_WINDOW_ACTIVATED, (CairoDockNotificationFunc) cd_do_check_active_dock, CAIRO_DOCK_RUN_AFTER, NULL); |
1949 | + |
1950 | + myData.sCurrentText = g_string_sized_new (20); |
1951 | + myData.iPromptAnimationCount = 0; |
1952 | + if (myData.pArrowImage == NULL) |
1953 | + { |
1954 | + myData.pArrowImage = cairo_dock_create_image_buffer (MY_APPLET_SHARE_DATA_DIR"/arrows.svg", |
1955 | + g_pMainDock->iMaxDockHeight, |
1956 | + g_pMainDock->iMaxDockHeight, |
1957 | + CAIRO_DOCK_KEEP_RATIO); |
1958 | + } |
1959 | + |
1960 | + // set initial position. |
1961 | + myData.pCurrentDock = NULL; |
1962 | + myData.pCurrentIcon = NULL; |
1963 | + |
1964 | + CairoDock *pDock = g_pMainDock; |
1965 | + Icon *pIcon = NULL; |
1966 | + int n = g_list_length (g_pMainDock->icons); |
1967 | + if (n > 0) |
1968 | + { |
1969 | + pIcon = g_list_nth_data (pDock->icons, (n-1) / 2); |
1970 | + if (CAIRO_DOCK_IS_SEPARATOR (pIcon) && n > 1) |
1971 | + pIcon = g_list_nth_data (pDock->icons, (n+1) / 2); |
1972 | + } |
1973 | + cd_do_change_current_icon (pIcon, pDock); |
1974 | + |
1975 | + // show main dock. |
1976 | + myData.bIgnoreIconState = TRUE; |
1977 | + cairo_dock_emit_enter_signal (CAIRO_CONTAINER (g_pMainDock)); |
1978 | + myData.bIgnoreIconState = FALSE; |
1979 | + |
1980 | + // give focus to main dock for inputs. |
1981 | + myData.iPreviouslyActiveWindow = cairo_dock_get_active_xwindow (); |
1982 | + |
1983 | + ///gtk_window_present (GTK_WINDOW (g_pMainDock->container.pWidget)); |
1984 | + gtk_window_present_with_time (GTK_WINDOW (g_pMainDock->container.pWidget), gdk_x11_get_server_time (g_pMainDock->container.pWidget->window)); // pour eviter la prevention du vol de focus. |
1985 | + cairo_dock_freeze_docks (TRUE); |
1986 | + |
1987 | + // launch animation. |
1988 | + cairo_dock_launch_animation (CAIRO_CONTAINER (g_pMainDock)); |
1989 | + |
1990 | + myData.iSessionState = 2; |
1991 | +} |
1992 | + |
1993 | +void cd_do_close_session (void) |
1994 | +{ |
1995 | + if (! cd_do_session_is_running ()) // session not running |
1996 | + return; |
1997 | + |
1998 | + // no more keyboard input. |
1999 | + cairo_dock_remove_notification_func (CAIRO_DOCK_KEY_PRESSED, (CairoDockNotificationFunc) cd_do_key_pressed, NULL); |
2000 | + cairo_dock_remove_notification_func (CAIRO_DOCK_STOP_ICON, (CairoDockNotificationFunc) cd_do_check_icon_stopped, NULL); |
2001 | + cairo_dock_remove_notification_func (CAIRO_DOCK_WINDOW_ACTIVATED, (CairoDockNotificationFunc) cd_do_check_active_dock, NULL); |
2002 | + |
2003 | + g_string_free (myData.sCurrentText, TRUE); |
2004 | + myData.sCurrentText = NULL; |
2005 | + |
2006 | + // give back focus. |
2007 | + if (myData.iPreviouslyActiveWindow != 0) |
2008 | + { |
2009 | + // ne le faire que si on a encore le focus, sinon c'est que l'utilisateur a change lui-meme de fenetre... |
2010 | + Window iActiveWindow = cairo_dock_get_active_xwindow (); |
2011 | + if (myData.pCurrentDock && iActiveWindow == GDK_WINDOW_XID (myData.pCurrentDock->container.pWidget->window)) |
2012 | + cairo_dock_show_xwindow (myData.iPreviouslyActiveWindow); |
2013 | + |
2014 | + myData.iPreviouslyActiveWindow = 0; |
2015 | + } |
2016 | + |
2017 | + // reset session state. |
2018 | + if (myData.pCurrentIcon != NULL) |
2019 | + { |
2020 | + myData.bIgnoreIconState = TRUE; |
2021 | + cairo_dock_stop_icon_animation (myData.pCurrentIcon); |
2022 | + myData.bIgnoreIconState = FALSE; |
2023 | + myData.pCurrentIcon = NULL; |
2024 | + } |
2025 | + |
2026 | + if (myData.pCurrentDock != NULL) |
2027 | + { |
2028 | + cairo_dock_emit_leave_signal (CAIRO_CONTAINER (myData.pCurrentDock)); |
2029 | + } |
2030 | + |
2031 | + // launch closing animation. |
2032 | + myData.iCloseTime = myConfig.iCloseDuration; |
2033 | + cairo_dock_launch_animation (CAIRO_CONTAINER (g_pMainDock)); |
2034 | + cairo_dock_freeze_docks (FALSE); |
2035 | + |
2036 | + myData.iSessionState = 1; |
2037 | +} |
2038 | + |
2039 | + |
2040 | +void cd_do_exit_session (void) |
2041 | +{ |
2042 | + if (cd_do_session_is_off ()) // session already off |
2043 | + return; |
2044 | + |
2045 | + cd_do_close_session (); |
2046 | + |
2047 | + myData.iCloseTime = 0; |
2048 | + |
2049 | + cd_do_change_current_icon (NULL, NULL); |
2050 | + |
2051 | + myData.iSessionState = 0; |
2052 | +} |
2053 | |
2054 | === added file 'Remote-Control/src/applet-session.h' |
2055 | --- Remote-Control/src/applet-session.h 1970-01-01 00:00:00 +0000 |
2056 | +++ Remote-Control/src/applet-session.h 2010-10-02 18:13:46 +0000 |
2057 | @@ -0,0 +1,38 @@ |
2058 | +/** |
2059 | +* This file is a part of the Cairo-Dock project |
2060 | +* |
2061 | +* Copyright : (C) see the 'copyright' file. |
2062 | +* E-mail : see the 'copyright' file. |
2063 | +* |
2064 | +* This program is free software; you can redistribute it and/or |
2065 | +* modify it under the terms of the GNU General Public License |
2066 | +* as published by the Free Software Foundation; either version 3 |
2067 | +* of the License, or (at your option) any later version. |
2068 | +* |
2069 | +* This program is distributed in the hope that it will be useful, |
2070 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2071 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2072 | +* GNU General Public License for more details. |
2073 | +* You should have received a copy of the GNU General Public License |
2074 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2075 | +*/ |
2076 | + |
2077 | +#ifndef __APPLET_SESSION__ |
2078 | +#define __APPLET_SESSION__ |
2079 | + |
2080 | +#include <cairo-dock.h> |
2081 | +#include "applet-struct.h" |
2082 | + |
2083 | + |
2084 | +void cd_do_open_session (void); |
2085 | + |
2086 | +void cd_do_close_session (void); |
2087 | + |
2088 | +void cd_do_exit_session (void); |
2089 | + |
2090 | +#define cd_do_session_is_running(...) (myData.iSessionState == 2) |
2091 | +#define cd_do_session_is_closing(...) (myData.iSessionState == 1) |
2092 | +#define cd_do_session_is_off(...) (myData.iSessionState == 0) |
2093 | + |
2094 | + |
2095 | +#endif |
2096 | |
2097 | === added file 'Remote-Control/src/applet-struct.h' |
2098 | --- Remote-Control/src/applet-struct.h 1970-01-01 00:00:00 +0000 |
2099 | +++ Remote-Control/src/applet-struct.h 2010-10-02 18:13:46 +0000 |
2100 | @@ -0,0 +1,51 @@ |
2101 | +/** |
2102 | +* This file is a part of the Cairo-Dock project |
2103 | +* |
2104 | +* Copyright : (C) see the 'copyright' file. |
2105 | +* E-mail : see the 'copyright' file. |
2106 | +* |
2107 | +* This program is free software; you can redistribute it and/or |
2108 | +* modify it under the terms of the GNU General Public License |
2109 | +* as published by the Free Software Foundation; either version 3 |
2110 | +* of the License, or (at your option) any later version. |
2111 | +* |
2112 | +* This program is distributed in the hope that it will be useful, |
2113 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2114 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2115 | +* GNU General Public License for more details. |
2116 | +* You should have received a copy of the GNU General Public License |
2117 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2118 | +*/ |
2119 | + |
2120 | + |
2121 | +#ifndef __CD_APPLET_STRUCT__ |
2122 | +#define __CD_APPLET_STRUCT__ |
2123 | + |
2124 | +#include <cairo-dock.h> |
2125 | + |
2126 | +//\___________ structure containing the applet's configuration parameters. |
2127 | +struct _AppletConfig { |
2128 | + gchar *cShortkeyNav; |
2129 | + gchar *cIconAnimation; |
2130 | + gint iCloseDuration; |
2131 | + } ; |
2132 | + |
2133 | +//\___________ structure containing the applet's data, like surfaces, dialogs, results of calculus, etc. |
2134 | +struct _AppletData { |
2135 | + gint iSessionState; // 0:no session, 1: session closing, 2: session running |
2136 | + GString *sCurrentText; |
2137 | + CairoDockImageBuffer *pArrowImage; |
2138 | + gint iPromptAnimationCount; |
2139 | + gint iCloseTime; |
2140 | + Window iPreviouslyActiveWindow; |
2141 | + Icon *pCurrentIcon; |
2142 | + CairoDock *pCurrentDock; |
2143 | + gboolean bIgnoreIconState; |
2144 | + |
2145 | + int iPrevMouseX, iPrevMouseY; |
2146 | + int iMouseX, iMouseY; |
2147 | + int iMotionCount; |
2148 | + } ; |
2149 | + |
2150 | + |
2151 | +#endif |
2152 | |
2153 | === modified file 'Scooby-Do/data/CMakeLists.txt' |
2154 | --- Scooby-Do/data/CMakeLists.txt 2010-08-07 01:43:25 +0000 |
2155 | +++ Scooby-Do/data/CMakeLists.txt 2010-10-02 18:13:46 +0000 |
2156 | @@ -9,7 +9,6 @@ |
2157 | install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Scooby-Do.conf |
2158 | preview.jpg |
2159 | icon.png |
2160 | - arrows.svg |
2161 | active-button.svg |
2162 | inactive-button.svg |
2163 | internet.png |
2164 | |
2165 | === modified file 'Scooby-Do/data/Scooby-Do.conf.in' |
2166 | --- Scooby-Do/data/Scooby-Do.conf.in 2010-08-07 01:43:25 +0000 |
2167 | +++ Scooby-Do/data/Scooby-Do.conf.in 2010-10-02 18:13:46 +0000 |
2168 | @@ -6,9 +6,6 @@ |
2169 | #k Shortkey to enable/disable the finder mode: |
2170 | shortkey search = <Control>Return |
2171 | |
2172 | -#k Shortkey to enable/disable the navigation mode: |
2173 | -shortkey = <Control>F9 |
2174 | - |
2175 | #i[10;200] Maximum number of results : |
2176 | #{Maximum number of mails that will be previewed. Put -1 to show the maximum possible.} |
2177 | nb results = 80 |
2178 | |
2179 | === removed file 'Scooby-Do/data/arrows.svg' |
2180 | --- Scooby-Do/data/arrows.svg 2009-10-05 19:27:17 +0000 |
2181 | +++ Scooby-Do/data/arrows.svg 1970-01-01 00:00:00 +0000 |
2182 | @@ -1,289 +0,0 @@ |
2183 | -<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
2184 | -<!-- Created with Inkscape (http://www.inkscape.org/) --> |
2185 | -<svg |
2186 | - xmlns:dc="http://purl.org/dc/elements/1.1/" |
2187 | - xmlns:cc="http://creativecommons.org/ns#" |
2188 | - xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
2189 | - xmlns:svg="http://www.w3.org/2000/svg" |
2190 | - xmlns="http://www.w3.org/2000/svg" |
2191 | - xmlns:xlink="http://www.w3.org/1999/xlink" |
2192 | - xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" |
2193 | - xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" |
2194 | - width="128" |
2195 | - height="128" |
2196 | - id="svg2391" |
2197 | - sodipodi:version="0.32" |
2198 | - inkscape:version="0.46" |
2199 | - version="1.0" |
2200 | - sodipodi:docname="arrows.svg" |
2201 | - inkscape:output_extension="org.inkscape.output.svg.inkscape"> |
2202 | - <defs |
2203 | - id="defs2393"> |
2204 | - <linearGradient |
2205 | - id="linearGradient2076"> |
2206 | - <stop |
2207 | - id="stop2078" |
2208 | - offset="0.0000000" |
2209 | - style="stop-color:#afd9ed;stop-opacity:1.0000000;" /> |
2210 | - <stop |
2211 | - id="stop2080" |
2212 | - offset="1.0000000" |
2213 | - style="stop-color:#cfc3db;stop-opacity:1.0000000;" /> |
2214 | - </linearGradient> |
2215 | - <linearGradient |
2216 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
2217 | - gradientUnits="userSpaceOnUse" |
2218 | - id="linearGradient2082" |
2219 | - x1="12.615197" |
2220 | - x2="48.374069" |
2221 | - xlink:href="#linearGradient2076" |
2222 | - y1="25.909756" |
2223 | - y2="62.720371" /> |
2224 | - <linearGradient |
2225 | - id="linearGradient2088"> |
2226 | - <stop |
2227 | - id="stop2090" |
2228 | - offset="0.0000000" |
2229 | - style="stop-color:#87a8b7;stop-opacity:1.0000000;" /> |
2230 | - <stop |
2231 | - id="stop2092" |
2232 | - offset="1.0000000" |
2233 | - style="stop-color:#7f718e;stop-opacity:1.0000000;" /> |
2234 | - </linearGradient> |
2235 | - <linearGradient |
2236 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
2237 | - gradientUnits="userSpaceOnUse" |
2238 | - id="linearGradient2086" |
2239 | - x1="12.615197" |
2240 | - x2="48.374069" |
2241 | - xlink:href="#linearGradient2088" |
2242 | - y1="25.909756" |
2243 | - y2="62.720371" /> |
2244 | - <inkscape:perspective |
2245 | - sodipodi:type="inkscape:persp3d" |
2246 | - inkscape:vp_x="0 : 526.18109 : 1" |
2247 | - inkscape:vp_y="0 : 1000 : 0" |
2248 | - inkscape:vp_z="744.09448 : 526.18109 : 1" |
2249 | - inkscape:persp3d-origin="372.04724 : 350.78739 : 1" |
2250 | - id="perspective2399" /> |
2251 | - <linearGradient |
2252 | - inkscape:collect="always" |
2253 | - xlink:href="#linearGradient2088" |
2254 | - id="linearGradient2420" |
2255 | - gradientUnits="userSpaceOnUse" |
2256 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
2257 | - x1="12.615197" |
2258 | - y1="25.909756" |
2259 | - x2="48.374069" |
2260 | - y2="62.720371" /> |
2261 | - <linearGradient |
2262 | - inkscape:collect="always" |
2263 | - xlink:href="#linearGradient2076" |
2264 | - id="linearGradient2422" |
2265 | - gradientUnits="userSpaceOnUse" |
2266 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
2267 | - x1="12.615197" |
2268 | - y1="25.909756" |
2269 | - x2="48.374069" |
2270 | - y2="62.720371" /> |
2271 | - <linearGradient |
2272 | - inkscape:collect="always" |
2273 | - xlink:href="#linearGradient2088" |
2274 | - id="linearGradient2434" |
2275 | - gradientUnits="userSpaceOnUse" |
2276 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
2277 | - x1="12.615197" |
2278 | - y1="25.909756" |
2279 | - x2="48.374069" |
2280 | - y2="62.720371" /> |
2281 | - <linearGradient |
2282 | - inkscape:collect="always" |
2283 | - xlink:href="#linearGradient2076" |
2284 | - id="linearGradient2436" |
2285 | - gradientUnits="userSpaceOnUse" |
2286 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
2287 | - x1="12.615197" |
2288 | - y1="25.909756" |
2289 | - x2="48.374069" |
2290 | - y2="62.720371" /> |
2291 | - <linearGradient |
2292 | - inkscape:collect="always" |
2293 | - xlink:href="#linearGradient2088" |
2294 | - id="linearGradient2448" |
2295 | - gradientUnits="userSpaceOnUse" |
2296 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
2297 | - x1="12.615197" |
2298 | - y1="25.909756" |
2299 | - x2="48.374069" |
2300 | - y2="62.720371" /> |
2301 | - <linearGradient |
2302 | - inkscape:collect="always" |
2303 | - xlink:href="#linearGradient2076" |
2304 | - id="linearGradient2450" |
2305 | - gradientUnits="userSpaceOnUse" |
2306 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
2307 | - x1="12.615197" |
2308 | - y1="25.909756" |
2309 | - x2="48.374069" |
2310 | - y2="62.720371" /> |
2311 | - <linearGradient |
2312 | - inkscape:collect="always" |
2313 | - xlink:href="#linearGradient2088" |
2314 | - id="linearGradient2462" |
2315 | - gradientUnits="userSpaceOnUse" |
2316 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,63.3302,67.13542)" |
2317 | - x1="12.615197" |
2318 | - y1="25.909756" |
2319 | - x2="48.374069" |
2320 | - y2="62.720371" /> |
2321 | - <linearGradient |
2322 | - inkscape:collect="always" |
2323 | - xlink:href="#linearGradient2076" |
2324 | - id="linearGradient2464" |
2325 | - gradientUnits="userSpaceOnUse" |
2326 | - gradientTransform="matrix(-1.186331,0,0,-0.780016,61.16353,67.13542)" |
2327 | - x1="12.615197" |
2328 | - y1="25.909756" |
2329 | - x2="48.374069" |
2330 | - y2="62.720371" /> |
2331 | - </defs> |
2332 | - <sodipodi:namedview |
2333 | - id="base" |
2334 | - pagecolor="#ffffff" |
2335 | - bordercolor="#666666" |
2336 | - borderopacity="1.0" |
2337 | - inkscape:pageopacity="0.0" |
2338 | - inkscape:pageshadow="2" |
2339 | - inkscape:zoom="1.3277206" |
2340 | - inkscape:cx="117.47785" |
2341 | - inkscape:cy="-15.977159" |
2342 | - inkscape:document-units="px" |
2343 | - inkscape:current-layer="layer1" |
2344 | - showgrid="false" |
2345 | - showguides="true" |
2346 | - inkscape:guide-bbox="true" |
2347 | - inkscape:window-width="641" |
2348 | - inkscape:window-height="719" |
2349 | - inkscape:window-x="293" |
2350 | - inkscape:window-y="0" /> |
2351 | - <metadata |
2352 | - id="metadata2396"> |
2353 | - <rdf:RDF> |
2354 | - <cc:Work |
2355 | - rdf:about=""> |
2356 | - <dc:format>image/svg+xml</dc:format> |
2357 | - <dc:type |
2358 | - rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> |
2359 | - </cc:Work> |
2360 | - </rdf:RDF> |
2361 | - </metadata> |
2362 | - <g |
2363 | - inkscape:label="Calque 1" |
2364 | - inkscape:groupmode="layer" |
2365 | - id="layer1"> |
2366 | - <g |
2367 | - id="g2409" |
2368 | - transform="matrix(0,0.8161651,-1.764176,0,125.43391,77.398373)"> |
2369 | - <path |
2370 | - d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
2371 | - id="path2084" |
2372 | - style="fill:url(#linearGradient2420);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2373 | - <path |
2374 | - d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
2375 | - id="rect1303" |
2376 | - style="fill:url(#linearGradient2422);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2377 | - <path |
2378 | - d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
2379 | - id="path2096" |
2380 | - style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
2381 | - <rect |
2382 | - height="1" |
2383 | - id="rect2098" |
2384 | - rx="0.5" |
2385 | - ry="0.5" |
2386 | - style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
2387 | - transform="scale(-1,-1)" |
2388 | - width="23" |
2389 | - x="-27.270832" |
2390 | - y="-28" /> |
2391 | - </g> |
2392 | - <g |
2393 | - id="g2424" |
2394 | - transform="matrix(0,-0.8161651,-1.6782543,0,122.04356,52.382073)"> |
2395 | - <path |
2396 | - d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
2397 | - id="path2426" |
2398 | - style="fill:url(#linearGradient2434);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2399 | - <path |
2400 | - d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
2401 | - id="path2428" |
2402 | - style="fill:url(#linearGradient2436);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2403 | - <path |
2404 | - d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
2405 | - id="path2430" |
2406 | - style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
2407 | - <rect |
2408 | - height="1" |
2409 | - id="rect2432" |
2410 | - rx="0.5" |
2411 | - ry="0.5" |
2412 | - style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
2413 | - transform="scale(-1,-1)" |
2414 | - width="23" |
2415 | - x="-27.270832" |
2416 | - y="-28" /> |
2417 | - </g> |
2418 | - <g |
2419 | - id="g2438" |
2420 | - transform="matrix(-0.8161651,0,0,-1.6496137,51.134197,122.05924)"> |
2421 | - <path |
2422 | - d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
2423 | - id="path2440" |
2424 | - style="fill:url(#linearGradient2448);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2425 | - <path |
2426 | - d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
2427 | - id="path2442" |
2428 | - style="fill:url(#linearGradient2450);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2429 | - <path |
2430 | - d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
2431 | - id="path2444" |
2432 | - style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
2433 | - <rect |
2434 | - height="1" |
2435 | - id="rect2446" |
2436 | - rx="0.5" |
2437 | - ry="0.5" |
2438 | - style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
2439 | - transform="scale(-1,-1)" |
2440 | - width="23" |
2441 | - x="-27.270832" |
2442 | - y="-28" /> |
2443 | - </g> |
2444 | - <g |
2445 | - id="g2452" |
2446 | - transform="matrix(0.8161651,0,0,-1.6496137,77.748214,121.52667)"> |
2447 | - <path |
2448 | - d="M 32.186126,52.104166 C 32.931029,52.568927 46.362619,43.287677 47.107522,42.822916 C 47.852425,42.358155 62,34.471188 62,33.541666 C 62,32.612144 47.852425,24.693927 47.107522,24.229166 C 46.362619,23.764405 32.931028,14.483154 32.186126,14.947916 C 31.736229,15.228616 31.839046,20.824428 31.983704,26.041666 L 5.900179,26.041666 C 5.643855,26.041666 5.4375,26.264666 5.4375,26.541666 L 5.4375,40.541666 C 5.4375,40.818666 5.643855,41.041666 5.900179,41.041666 L 31.983704,41.041666 C 31.839045,46.258903 31.73623,51.823466 32.186126,52.104166 z" |
2449 | - id="path2454" |
2450 | - style="fill:url(#linearGradient2462);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2451 | - <path |
2452 | - d="M 30.019459,52.104166 C 30.764362,52.568927 44.195952,43.287677 44.940855,42.822916 C 45.685758,42.358155 59.833333,34.471188 59.833333,33.541666 C 59.833333,32.612144 45.685758,24.693927 44.940855,24.229166 C 44.195952,23.764405 30.764361,14.483154 30.019459,14.947916 C 29.569562,15.228616 29.672379,20.824428 29.817037,26.041666 L 3.733512,26.041666 C 3.477188,26.041666 3.270833,26.264666 3.270833,26.541666 L 3.270833,40.541666 C 3.270833,40.818666 3.477188,41.041666 3.733512,41.041666 L 29.817037,41.041666 C 29.672378,46.258903 29.569563,51.823466 30.019459,52.104166 z" |
2453 | - id="path2456" |
2454 | - style="fill:url(#linearGradient2464);fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" /> |
2455 | - <path |
2456 | - d="M 56,32.498092 C 56,32.498092 46.143163,28.758884 45.393163,27.459846 C 44.643163,26.160808 31.765602,20.067541 32.131627,18.701516 C 32.497652,17.33549 43.893163,24.86177 43.893163,24.86177 C 43.893163,24.86177 52.611644,28.295956 56,32.498092 z" |
2457 | - id="path2458" |
2458 | - style="fill:#d0f1fc;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> |
2459 | - <rect |
2460 | - height="1" |
2461 | - id="rect2460" |
2462 | - rx="0.5" |
2463 | - ry="0.5" |
2464 | - style="fill:#d0f1fc;fill-opacity:1;stroke:none;stroke-width:0.375;stroke-miterlimit:4;stroke-opacity:1" |
2465 | - transform="scale(-1,-1)" |
2466 | - width="23" |
2467 | - x="-27.270832" |
2468 | - y="-28" /> |
2469 | - </g> |
2470 | - </g> |
2471 | -</svg> |
2472 | |
2473 | === modified file 'Scooby-Do/src/applet-appli-finder.h' |
2474 | --- Scooby-Do/src/applet-appli-finder.h 2009-10-05 19:27:17 +0000 |
2475 | +++ Scooby-Do/src/applet-appli-finder.h 2010-10-02 18:13:46 +0000 |
2476 | @@ -17,11 +17,9 @@ |
2477 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2478 | */ |
2479 | |
2480 | - |
2481 | #ifndef __APPLET_APPLI_FINDER__ |
2482 | #define __APPLET_APPLI_FINDER__ |
2483 | |
2484 | - |
2485 | #include <cairo-dock.h> |
2486 | #include "applet-struct.h" |
2487 | |
2488 | |
2489 | === modified file 'Scooby-Do/src/applet-config.c' |
2490 | --- Scooby-Do/src/applet-config.c 2010-08-07 01:43:25 +0000 |
2491 | +++ Scooby-Do/src/applet-config.c 2010-10-02 18:13:46 +0000 |
2492 | @@ -60,7 +60,6 @@ |
2493 | |
2494 | //\_________________ Here you have to get all your parameters from the conf file. Use the macros CD_CONFIG_GET_BOOLEAN, CD_CONFIG_GET_INTEGER, CD_CONFIG_GET_STRING, etc. myConfig has been reseted to 0 at this point. This function is called at the beginning of init and reload. |
2495 | CD_APPLET_GET_CONFIG_BEGIN |
2496 | - myConfig.cShortkeyNav = CD_CONFIG_GET_STRING ("Configuration", "shortkey"); |
2497 | myConfig.cShortkeySearch = CD_CONFIG_GET_STRING ("Configuration", "shortkey search"); |
2498 | myConfig.iAppearanceDuration = CD_CONFIG_GET_INTEGER ("Configuration", "appear duration"); |
2499 | myConfig.iCloseDuration = CD_CONFIG_GET_INTEGER ("Configuration", "stop duration"); |
2500 | @@ -126,10 +125,6 @@ |
2501 | |
2502 | //\_________________ Here you have to free all ressources allocated for myConfig. This one will be reseted to 0 at the end of this function. This function is called right before you get the applet's config, and when your applet is stopped, in the end. |
2503 | CD_APPLET_RESET_CONFIG_BEGIN |
2504 | - //g_print ("%s / %s\n", myConfig.cShortkeyNav, myConfig.cShortkeySearch); |
2505 | - if (myConfig.cShortkeyNav) |
2506 | - cd_keybinder_unbind (myConfig.cShortkeyNav, (CDBindkeyHandler) cd_do_on_shortkey_nav); |
2507 | - g_free (myConfig.cShortkeyNav); |
2508 | if (myConfig.cShortkeySearch) |
2509 | cd_keybinder_unbind (myConfig.cShortkeySearch, (CDBindkeyHandler) cd_do_on_shortkey_search); |
2510 | g_free (myConfig.cShortkeySearch); |
2511 | @@ -154,10 +149,6 @@ |
2512 | cairo_surface_destroy (myData.pPromptSurface); |
2513 | if (myData.iPromptTexture != 0) |
2514 | _cairo_dock_delete_texture (myData.iPromptTexture); |
2515 | - if (myData.pArrowSurface != NULL) |
2516 | - cairo_surface_destroy (myData.pArrowSurface); |
2517 | - if (myData.iArrowTexture != 0) |
2518 | - _cairo_dock_delete_texture (myData.iArrowTexture); |
2519 | if (myData.pScoobySurface != NULL) |
2520 | cairo_surface_destroy (myData.pScoobySurface); |
2521 | if (myData.pActiveButtonSurface != NULL) |
2522 | |
2523 | === modified file 'Scooby-Do/src/applet-draw.c' |
2524 | --- Scooby-Do/src/applet-draw.c 2010-08-07 01:43:25 +0000 |
2525 | +++ Scooby-Do/src/applet-draw.c 2010-10-02 18:13:46 +0000 |
2526 | @@ -91,7 +91,7 @@ |
2527 | |
2528 | if (myData.pCharList == NULL && myData.pListingHistory == NULL) // aucune lettre de tapee => on montre le prompt. |
2529 | { |
2530 | - if (! myData.bNavigationMode && myData.pPromptSurface != NULL) |
2531 | + if (myData.pPromptSurface != NULL) |
2532 | { |
2533 | double fFrameWidth = myData.iPromptWidth; |
2534 | double fFrameHeight = myData.iPromptHeight; |
2535 | @@ -105,30 +105,11 @@ |
2536 | if (fAlpha != 0) |
2537 | { |
2538 | cairo_translate (pCairoContext, fDockOffsetX, fDockOffsetY); |
2539 | - cairo_dock_draw_surface (pCairoContext, myData.pArrowSurface, fFrameWidth, fFrameHeight, pMainDock->container.bDirectionUp, pMainDock->container.bIsHorizontal, fAlpha); |
2540 | + cairo_dock_draw_surface (pCairoContext, myData.pPromptSurface, fFrameWidth, fFrameHeight, pMainDock->container.bDirectionUp, pMainDock->container.bIsHorizontal, fAlpha); |
2541 | //cairo_set_source_surface (pCairoContext, myData.pPromptSurface, 0., 0.); |
2542 | //cairo_paint_with_alpha (pCairoContext, fAlpha); |
2543 | } |
2544 | } |
2545 | - else if (myData.bNavigationMode && myData.pArrowSurface != NULL) |
2546 | - { |
2547 | - double fFrameWidth = myData.iArrowWidth; |
2548 | - double fFrameHeight = myData.iArrowHeight; |
2549 | - |
2550 | - double fDockOffsetX, fDockOffsetY; // Offset du coin haut gauche du prompt. |
2551 | - fDockOffsetX = (pMainDock->container.iWidth - fFrameWidth) / 2; |
2552 | - fDockOffsetY = (pMainDock->container.iHeight - fFrameHeight) / 2; |
2553 | - |
2554 | - fAlpha *= _alpha_prompt (myData.iPromptAnimationCount, s_iNbPromptAnimationSteps); |
2555 | - |
2556 | - if (fAlpha != 0) |
2557 | - { |
2558 | - cairo_translate (pCairoContext, fDockOffsetX, fDockOffsetY); |
2559 | - cairo_dock_draw_surface (pCairoContext, myData.pArrowSurface, fFrameWidth, fFrameHeight, pMainDock->container.bDirectionUp, pMainDock->container.bIsHorizontal, fAlpha); |
2560 | - //cairo_set_source_surface (pCairoContext, myData.pArrowSurface, 0., 0.); |
2561 | - //cairo_paint_with_alpha (pCairoContext, fAlpha); |
2562 | - } |
2563 | - } |
2564 | } |
2565 | else // si du texte a ete entre, on le dessine, ainsi que eventuellement la liste des icones correspondantes. |
2566 | { |
2567 | @@ -282,7 +263,7 @@ |
2568 | |
2569 | if (myData.pCharList == NULL && myData.pListingHistory == NULL) // aucune lettre de tapee => on montre le prompt. |
2570 | { |
2571 | - if (! myData.bNavigationMode && myData.iPromptTexture != 0) |
2572 | + if (myData.iPromptTexture != 0) |
2573 | { |
2574 | double fFrameWidth = myData.iPromptWidth; |
2575 | double fFrameHeight = myData.iPromptHeight; |
2576 | @@ -310,34 +291,6 @@ |
2577 | glPopMatrix(); |
2578 | } |
2579 | } |
2580 | - else if (myData.bNavigationMode && myData.iArrowTexture != 0) |
2581 | - { |
2582 | - double fFrameWidth = myData.iArrowWidth; |
2583 | - double fFrameHeight = myData.iArrowHeight; |
2584 | - |
2585 | - double fDockOffsetX, fDockOffsetY; // Offset du coin haut gauche du prompt. |
2586 | - fDockOffsetX = (pMainDock->container.iWidth - fFrameWidth) / 2; |
2587 | - fDockOffsetY = (pMainDock->container.iHeight - fFrameHeight) / 2; |
2588 | - |
2589 | - fAlpha *= _alpha_prompt (myData.iPromptAnimationCount, s_iNbPromptAnimationSteps); |
2590 | - |
2591 | - if (fAlpha != 0) |
2592 | - { |
2593 | - glPushMatrix (); |
2594 | - if (! pMainDock->container.bIsHorizontal) |
2595 | - glRotatef (pMainDock->container.bDirectionUp ? 90. : -90., 0., 0., 1.); |
2596 | - glTranslatef (pMainDock->container.iWidth/2, pMainDock->container.iHeight/2, 0.); |
2597 | - |
2598 | - _cairo_dock_enable_texture (); |
2599 | - _cairo_dock_set_blend_alpha (); |
2600 | - |
2601 | - _cairo_dock_apply_texture_at_size_with_alpha (myData.iArrowTexture, fFrameWidth, fFrameHeight, fAlpha); |
2602 | - |
2603 | - _cairo_dock_disable_texture (); |
2604 | - |
2605 | - glPopMatrix(); |
2606 | - } |
2607 | - } |
2608 | } |
2609 | else // si du texte a ete entre, on le dessine, ainsi que eventuellement la liste des icones correspondantes. |
2610 | { |
2611 | |
2612 | === modified file 'Scooby-Do/src/applet-icon-finder.c' |
2613 | --- Scooby-Do/src/applet-icon-finder.c 2010-08-07 01:43:25 +0000 |
2614 | +++ Scooby-Do/src/applet-icon-finder.c 2010-10-02 18:13:46 +0000 |
2615 | @@ -52,197 +52,6 @@ |
2616 | return bMatch; |
2617 | } |
2618 | |
2619 | -static void _find_icon_in_dock_with_command (Icon *pIcon, CairoDock *pDock, gpointer *data) |
2620 | -{ |
2621 | - gchar *cCommandPrefix = data[0]; |
2622 | - int length = GPOINTER_TO_INT (data[1]); |
2623 | - Icon *pAfterIcon = data[2]; |
2624 | - Icon **pFoundIcon = data[3]; |
2625 | - CairoDock **pFoundDock = data[4]; |
2626 | - Icon **pFirstIcon = data[5]; |
2627 | - CairoDock **pFirstParentDock = data[6]; |
2628 | - if (pDock == g_pMainDock || *pFoundIcon != NULL) // on a deja cherche dans le main dock, ou deja trouve ce qu'on cherchait. |
2629 | - return ; |
2630 | - |
2631 | - gboolean bFound = _cd_do_icon_match (pIcon, cCommandPrefix, length); |
2632 | - if (bFound) |
2633 | - { |
2634 | - if (pAfterIcon == NULL) |
2635 | - { |
2636 | - *pFoundIcon = pIcon; |
2637 | - *pFoundDock = pDock; |
2638 | - } |
2639 | - else |
2640 | - { |
2641 | - if (*pFirstIcon == NULL) // on garde une trace de la 1ere icone pour boucler dans la liste. |
2642 | - { |
2643 | - *pFirstIcon = pIcon; |
2644 | - *pFirstParentDock = g_pMainDock; |
2645 | - } |
2646 | - if (pIcon == pAfterIcon) |
2647 | - { |
2648 | - data[2] = NULL; |
2649 | - } |
2650 | - } |
2651 | - } |
2652 | -} |
2653 | -Icon *cd_do_search_icon_by_command (const gchar *cCommandPrefix, Icon *pAfterIcon, CairoDock **pDock) |
2654 | -{ |
2655 | - g_return_val_if_fail (cCommandPrefix != NULL, NULL); |
2656 | - |
2657 | - //\_________________ on cherche en premier dans le main dock, car il est deja visible. |
2658 | - int length = strlen (cCommandPrefix); |
2659 | - Icon *pIcon, *pFirstIcon = NULL; |
2660 | - CairoDock *pParentDock, *pFirstParentDock = NULL; |
2661 | - GList *ic; |
2662 | - for (ic = g_pMainDock->icons; ic != NULL; ic = ic->next) |
2663 | - { |
2664 | - pIcon = ic->data; |
2665 | - if (pIcon->cCommand && g_ascii_strncasecmp (cCommandPrefix, pIcon->cCommand, length) == 0) |
2666 | - { |
2667 | - if (pAfterIcon == NULL) |
2668 | - { |
2669 | - *pDock = g_pMainDock; |
2670 | - return pIcon; |
2671 | - } |
2672 | - else |
2673 | - { |
2674 | - if (pFirstIcon == NULL) // on garde une trace de la 1ere icone pour boucler dans la liste. |
2675 | - { |
2676 | - pFirstIcon = pIcon; |
2677 | - pFirstParentDock = g_pMainDock; |
2678 | - } |
2679 | - if (pIcon == pAfterIcon) |
2680 | - { |
2681 | - pAfterIcon = NULL; |
2682 | - } |
2683 | - } |
2684 | - } |
2685 | - } |
2686 | - |
2687 | - //\_________________ si on a rien trouve on cherche dans tous les docks. |
2688 | - pIcon = NULL; |
2689 | - *pDock = NULL; |
2690 | - gpointer data[7]; |
2691 | - data[0] = (gchar *)cCommandPrefix; |
2692 | - data[1] = GINT_TO_POINTER (length); |
2693 | - data[2] = pAfterIcon; |
2694 | - data[3] = &pIcon; |
2695 | - data[4] = pDock; |
2696 | - data[5] = &pFirstIcon; |
2697 | - data[6] = &pFirstParentDock; |
2698 | - cairo_dock_foreach_icons_in_docks ((CairoDockForeachIconFunc) _find_icon_in_dock_with_command, data); |
2699 | - |
2700 | - if (pIcon == NULL) |
2701 | - { |
2702 | - pIcon = pFirstIcon; |
2703 | - *pDock = pFirstParentDock; |
2704 | - } |
2705 | - return pIcon; |
2706 | -} |
2707 | - |
2708 | - |
2709 | -void cd_do_change_current_icon (Icon *pIcon, CairoDock *pDock) |
2710 | -{ |
2711 | - //\_________________ on gere le cachage et le montrage du dock precedent et actuel. |
2712 | - if (myData.pCurrentDock != NULL && pDock != myData.pCurrentDock && myData.pCurrentDock != g_pMainDock) // on remet au repos dock precedemment anime. |
2713 | - { |
2714 | - cairo_dock_emit_leave_signal (myData.pCurrentDock); |
2715 | - } |
2716 | - if (pDock != NULL && pDock != g_pMainDock && pDock != myData.pCurrentDock) // on montre le nouveau dock |
2717 | - { |
2718 | - if (pDock != NULL) |
2719 | - { |
2720 | - if (pDock->iRefCount > 0) |
2721 | - { |
2722 | - CairoDock *pParentDock = NULL; |
2723 | - Icon *pPointingIcon = cairo_dock_search_icon_pointing_on_dock (pDock, &pParentDock); |
2724 | - if (pPointingIcon != NULL) |
2725 | - { |
2726 | - cairo_dock_show_subdock (pPointingIcon, pParentDock); // utile pour le montrage des sous-docks au clic. |
2727 | - } |
2728 | - } |
2729 | - else |
2730 | - { |
2731 | - ///cairo_dock_pop_up (pDock); |
2732 | - } |
2733 | - cairo_dock_emit_enter_signal (pDock); |
2734 | - } |
2735 | - } |
2736 | - if (pDock != NULL) |
2737 | - { |
2738 | - |
2739 | - gtk_window_present (GTK_WINDOW (pDock->container.pWidget)); |
2740 | - } |
2741 | - |
2742 | - //\_________________ on gere l'allumage et l'eteignage de l'icone precedente et actuelle. |
2743 | - if (myData.pCurrentIcon != NULL && pIcon != myData.pCurrentIcon) // on remet au repos l'icone precedemment anime. |
2744 | - { |
2745 | - myData.bIgnoreIconState = TRUE; |
2746 | - cairo_dock_stop_icon_animation (myData.pCurrentIcon); |
2747 | - myData.bIgnoreIconState = FALSE; |
2748 | - cairo_dock_redraw_icon (myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); /// utile ?... |
2749 | - } |
2750 | - if (pIcon != NULL && myData.pCurrentIcon != pIcon) // on anime la nouvelle icone. |
2751 | - { |
2752 | - int x = pIcon->fXAtRest + pIcon->fWidth/2 + (- pDock->fFlatDockWidth + pDock->iMaxDockWidth)/2; |
2753 | - int y = pIcon->fDrawY + pIcon->fHeight/2 * pIcon->fScale; |
2754 | - if (1||myData.pCurrentDock != pDock) |
2755 | - { |
2756 | - cairo_dock_emit_motion_signal (pDock, |
2757 | - x, |
2758 | - y); |
2759 | - } |
2760 | - else |
2761 | - { |
2762 | - myData.iPrevMouseX = myData.iMouseX; |
2763 | - myData.iPrevMouseY = myData.iMouseY; |
2764 | - myData.iMotionCount = 10; |
2765 | - } |
2766 | - myData.iMouseX = x; |
2767 | - myData.iMouseY = y; |
2768 | - cairo_dock_request_icon_animation (pIcon, pDock, myConfig.cIconAnimation, 1e6); // interrompt l'animation de "mouse over". |
2769 | - cairo_dock_launch_animation (CAIRO_CONTAINER (pDock)); |
2770 | - //if (myAccessibility.bShowSubDockOnClick) |
2771 | - // cairo_dock_show_subdock (pIcon, pDock, FALSE); |
2772 | - } |
2773 | - |
2774 | - myData.pCurrentDock = pDock; |
2775 | - myData.pCurrentIcon = pIcon; |
2776 | - if (myData.pCurrentDock == NULL) |
2777 | - gtk_window_present (GTK_WINDOW (g_pMainDock->container.pWidget)); |
2778 | -} |
2779 | - |
2780 | - |
2781 | -void cd_do_search_current_icon (gboolean bLoopSearch) |
2782 | -{ |
2783 | - //\_________________ on cherche un lanceur correspondant. |
2784 | - CairoDock *pDock; |
2785 | - Icon *pIcon = cd_do_search_icon_by_command (myData.sCurrentText->str, (bLoopSearch ? myData.pCurrentIcon : NULL), &pDock); |
2786 | - cd_debug ("found icon : %s\n", pIcon ? pIcon->cName : "none"); |
2787 | - |
2788 | - //\_________________ on gere le changement d'icone/dock. |
2789 | - cd_do_change_current_icon (pIcon, pDock); |
2790 | -} |
2791 | - |
2792 | - |
2793 | -gboolean cairo_dock_emit_motion_signal (CairoDock *pDock, int iMouseX, int iMouseY) |
2794 | -{ |
2795 | - static gboolean bReturn; |
2796 | - static GdkEventMotion motion; |
2797 | - motion.state = 0; |
2798 | - motion.x = iMouseX; |
2799 | - motion.y = iMouseY; |
2800 | - motion.x_root = pDock->container.iWindowPositionX + pDock->container.iMouseX; |
2801 | - motion.y_root = pDock->container.iWindowPositionY + pDock->container.iMouseY; |
2802 | - motion.time = 0; |
2803 | - motion.window = pDock->container.pWidget->window; |
2804 | - motion.device = gdk_device_get_core_pointer (); |
2805 | - g_signal_emit_by_name (pDock->container.pWidget, "motion-notify-event", &motion, &bReturn); |
2806 | - return FALSE; |
2807 | -} |
2808 | - |
2809 | - |
2810 | |
2811 | static inline void _cd_do_search_matching_icons_in_dock (CairoDock *pDock) |
2812 | { |
2813 | @@ -270,7 +79,7 @@ |
2814 | return; |
2815 | cd_debug ("%s (%s)\n", __func__, myData.sCurrentText->str); |
2816 | gchar *str = strchr (myData.sCurrentText->str, ' '); // on ne compte pas les arguments d'une eventuelle commande deja tapee. |
2817 | - int length = myData.sCurrentText->len; |
2818 | + guint length = myData.sCurrentText->len; |
2819 | if (str != NULL) |
2820 | { |
2821 | g_string_set_size (myData.sCurrentText, str - myData.sCurrentText->str + 1); |
2822 | @@ -279,22 +88,13 @@ |
2823 | |
2824 | if (myData.pMatchingIcons == NULL) |
2825 | { |
2826 | - if (myData.bSessionStartedAutomatically) // on cherche dans le dock courant. |
2827 | - { |
2828 | - cd_debug ("on cherche dans le dock\n"); |
2829 | - _cd_do_search_matching_icons_in_dock (myData.pCurrentDock); |
2830 | - myData.pMatchingIcons = g_list_reverse (myData.pMatchingIcons); |
2831 | - } |
2832 | - else |
2833 | - { |
2834 | - cd_debug ("on cherche tout\n"); |
2835 | - // on parcours tous les docks. |
2836 | - cairo_dock_foreach_icons_in_docks ((CairoDockForeachIconFunc) _cd_do_search_in_one_dock, NULL); |
2837 | - myData.pMatchingIcons = g_list_reverse (myData.pMatchingIcons); |
2838 | - |
2839 | - // on rajoute les icones ne venant pas du dock. |
2840 | - cd_do_find_matching_applications (); |
2841 | - } |
2842 | + cd_debug ("on cherche tout\n"); |
2843 | + // on parcours tous les docks. |
2844 | + cairo_dock_foreach_icons_in_docks ((CairoDockForeachIconFunc) _cd_do_search_in_one_dock, NULL); |
2845 | + myData.pMatchingIcons = g_list_reverse (myData.pMatchingIcons); |
2846 | + |
2847 | + // on rajoute les icones ne venant pas du dock. |
2848 | + cd_do_find_matching_applications (); |
2849 | } |
2850 | else // optimisation : on peut se contenter de chercher parmi les icones deja trouvees. |
2851 | { |
2852 | @@ -317,7 +117,7 @@ |
2853 | myData.iCurrentMatchingOffset = 0; |
2854 | if (myData.pCurrentApplicationToLoad != NULL) // on va continuer le chargement sur la sous-liste. |
2855 | myData.pCurrentApplicationToLoad = myData.pMatchingIcons; // comme l'ordre de la liste n'a pas ete altere, on n'est sur de ne pas sauter d'icone. |
2856 | - cairo_dock_redraw_container (CAIRO_CONTAINER (myData.pCurrentDock)); |
2857 | + cairo_dock_redraw_container (CAIRO_CONTAINER (g_pMainDock)); |
2858 | //g_print ("%d / %d\n", length , myData.sCurrentText->len); |
2859 | if (length != myData.sCurrentText->len) |
2860 | g_string_set_size (myData.sCurrentText, length); |
2861 | |
2862 | === modified file 'Scooby-Do/src/applet-icon-finder.h' |
2863 | --- Scooby-Do/src/applet-icon-finder.h 2009-10-05 19:27:17 +0000 |
2864 | +++ Scooby-Do/src/applet-icon-finder.h 2010-10-02 18:13:46 +0000 |
2865 | @@ -17,7 +17,6 @@ |
2866 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
2867 | */ |
2868 | |
2869 | - |
2870 | #ifndef __APPLET_ICON_FINDER__ |
2871 | #define __APPLET_ICON_FINDER__ |
2872 | |
2873 | |
2874 | === modified file 'Scooby-Do/src/applet-init.c' |
2875 | --- Scooby-Do/src/applet-init.c 2010-08-07 01:43:25 +0000 |
2876 | +++ Scooby-Do/src/applet-init.c 2010-10-02 18:13:46 +0000 |
2877 | @@ -36,22 +36,18 @@ |
2878 | CD_APPLET_DEFINE_BEGIN ("Scooby-Do", |
2879 | 2, 1, 4, |
2880 | CAIRO_DOCK_CATEGORY_APPLET_SYSTEM, |
2881 | - N_("This plug-in allows you to make different actions directly from the keyboard.\n" |
2882 | - "It has 2 modes, each one being triggered by a keyboard shortcut:\n\n" |
2883 | - "- the finder mode (default shortcut : CTRL + Enter) :\n" |
2884 | - " It lets you find and launch applications, files, recent files, firefox bookmarks, commands, and even calculations.\n" |
2885 | - " Type what you want to search, the results will be displayed in real time.\n" |
2886 | - " The first results of each category are displayed in the main listing.\n" |
2887 | - " Use the up/down arrows to navigate inside the list,\n" |
2888 | - " and use the left/right arrows to enter into a category, or to display more actions (when a little arrow is drawn next to text).\n" |
2889 | - " Once inside a category, you can filter the results by typing some letters.\n" |
2890 | - " Press Enter to validate, maintain SHIFT or ALT to keep the list of results opened.\n\n" |
2891 | - "- the navigation mode (default shortcut : CTRL + F9) :\n" |
2892 | - " use the arrows to navigate into the docks and sub-docks,\n" |
2893 | - " or type the name of a launcher and press Tab to automatically jump to the next suitable launcher\n" |
2894 | - " press Enter to click on the icon, Shift+Enter for Shift+click, Alt+Enter for middle click, and Ctrl+Enter for left click\n" |
2895 | + ("This plug-in allows you to make different actions directly from the keyboard.\n" |
2896 | + "It is triggered by a keyboard shortcut (by default: CTRL + Enter):\n" |
2897 | + "It lets you find and launch applications, files, recent files, firefox bookmarks, commands, and even calculations.\n" |
2898 | + "Type what you want to search, the results will be displayed in real time.\n" |
2899 | + "The first results of each category are displayed in the main listing.\n" |
2900 | + "Use the up/down arrows to navigate inside the list,\n" |
2901 | + " and use the left/right arrows to enter into a category, or to display more actions (when a little arrow is drawn next to text).\n" |
2902 | + "Once inside a category, you can filter the results by typing some letters.\n" |
2903 | + "Press Enter to validate, maintain SHIFT or ALT to keep the list of results opened.\n" |
2904 | "Escape or the same shortkey will cancel."), |
2905 | "Fabounet (Fabrice Rey)") |
2906 | + CD_APPLET_DEFINE_COMMON_APPLET_INTERFACE |
2907 | CD_APPLET_SET_CONTAINER_TYPE (CAIRO_DOCK_MODULE_IS_PLUGIN); |
2908 | CD_APPLET_DEFINE_END |
2909 | |
2910 | @@ -70,7 +66,6 @@ |
2911 | CD_APPLET_INIT_BEGIN |
2912 | cairo_dock_register_notification (CAIRO_DOCK_KEY_PRESSED, (CairoDockNotificationFunc) cd_do_key_pressed, CAIRO_DOCK_RUN_AFTER, NULL); |
2913 | |
2914 | - cd_keybinder_bind (myConfig.cShortkeyNav, (CDBindkeyHandler) cd_do_on_shortkey_nav, myApplet); |
2915 | cd_keybinder_bind (myConfig.cShortkeySearch, (CDBindkeyHandler) cd_do_on_shortkey_search, myApplet); |
2916 | |
2917 | _register_backends (); |
2918 | @@ -97,7 +92,6 @@ |
2919 | cd_do_destroy_listing (myData.pListing); |
2920 | myData.pListing = NULL; |
2921 | |
2922 | - cd_keybinder_bind (myConfig.cShortkeyNav, (CDBindkeyHandler) cd_do_on_shortkey_nav, myApplet); // shortkey were unbinded during reset_config. |
2923 | cd_keybinder_bind (myConfig.cShortkeySearch, (CDBindkeyHandler) cd_do_on_shortkey_search, myApplet); // shortkey were unbinded during reset_config. |
2924 | |
2925 | if (myData.sCurrentText != NULL) // peu probable. |
2926 | |
2927 | === modified file 'Scooby-Do/src/applet-notifications.c' |
2928 | --- Scooby-Do/src/applet-notifications.c 2010-08-07 01:43:25 +0000 |
2929 | +++ Scooby-Do/src/applet-notifications.c 2010-10-02 18:13:46 +0000 |
2930 | @@ -32,7 +32,7 @@ |
2931 | |
2932 | gboolean cd_do_render (gpointer pUserData, CairoContainer *pContainer, cairo_t *pCairoContext) |
2933 | { |
2934 | - g_return_val_if_fail (cd_do_session_is_running (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
2935 | + g_return_val_if_fail (!cd_do_session_is_off (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
2936 | |
2937 | if (pCairoContext != NULL) |
2938 | { |
2939 | @@ -49,17 +49,7 @@ |
2940 | |
2941 | gboolean cd_do_update_container (gpointer pUserData, CairoContainer *pContainer, gboolean *bContinueAnimation) |
2942 | { |
2943 | - g_return_val_if_fail (cd_do_session_is_running (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
2944 | - |
2945 | - if (myData.iMotionCount != 0) |
2946 | - { |
2947 | - myData.iMotionCount --; |
2948 | - double f = (double) myData.iMotionCount / 10; |
2949 | - cairo_dock_emit_motion_signal (CAIRO_DOCK (pContainer), |
2950 | - f * myData.iPrevMouseX + (1-f) * myData.iMouseX, |
2951 | - f * myData.iPrevMouseY + (1-f) * myData.iMouseY); |
2952 | - *bContinueAnimation = TRUE; |
2953 | - } |
2954 | + g_return_val_if_fail (!cd_do_session_is_off (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
2955 | |
2956 | int iDeltaT = cairo_dock_get_animation_delta_t (pContainer); |
2957 | if (cd_do_session_is_closing ()) |
2958 | @@ -72,7 +62,7 @@ |
2959 | *bContinueAnimation = TRUE; |
2960 | cairo_dock_redraw_container (pContainer); |
2961 | } |
2962 | - else if (cd_do_session_is_waiting_for_input ()) |
2963 | + else if (cd_do_session_is_running ()) |
2964 | { |
2965 | if (myData.pCharList == NULL) |
2966 | { |
2967 | @@ -137,31 +127,6 @@ |
2968 | }*/ |
2969 | |
2970 | |
2971 | -gboolean cd_do_check_icon_stopped (gpointer pUserData, Icon *pIcon) |
2972 | -{ |
2973 | - if (pIcon == myData.pCurrentIcon && ! myData.bIgnoreIconState) |
2974 | - { |
2975 | - cd_debug ("notre icone vient de se faire stopper\n"); |
2976 | - myData.pCurrentIcon = NULL; |
2977 | - myData.pCurrentDock = NULL; |
2978 | - |
2979 | - // eventuellement emuler un TAB pour trouver la suivante ... |
2980 | - } |
2981 | - if (myData.pMatchingIcons != NULL) |
2982 | - { |
2983 | - myData.pMatchingIcons = g_list_remove (myData.pMatchingIcons, pIcon); |
2984 | - if (myData.pCurrentMatchingElement && myData.pCurrentMatchingElement->data == pIcon) |
2985 | - myData.pCurrentMatchingElement = NULL; |
2986 | - if (myData.pCurrentApplicationToLoad && myData.pCurrentApplicationToLoad->data == pIcon) |
2987 | - { |
2988 | - myData.pCurrentApplicationToLoad = myData.pCurrentApplicationToLoad->next; |
2989 | - } |
2990 | - } |
2991 | - |
2992 | - return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
2993 | -} |
2994 | - |
2995 | - |
2996 | static void _check_dock_is_active (gchar *cDockName, CairoDock *pDock, Window *data) |
2997 | { |
2998 | Window xActiveWindow = data[0]; |
2999 | @@ -170,6 +135,8 @@ |
3000 | } |
3001 | gboolean cd_do_check_active_dock (gpointer pUserData, Window *XActiveWindow) |
3002 | { |
3003 | + g_return_val_if_fail (cd_do_session_is_running (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
3004 | + |
3005 | if (myData.sCurrentText == NULL || XActiveWindow == NULL) |
3006 | return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
3007 | Window data[2] = {*XActiveWindow, 0}; |
3008 | @@ -181,73 +148,10 @@ |
3009 | } |
3010 | |
3011 | |
3012 | -static void _place_menu (GtkMenu *menu, |
3013 | - gint *x, |
3014 | - gint *y, |
3015 | - gboolean *push_in, |
3016 | - gpointer user_data) |
3017 | -{ |
3018 | - /// gerer les docks verticaux ... |
3019 | - *x = myData.pCurrentDock->container.iWindowPositionX + myData.pCurrentDock->container.iMouseX; |
3020 | - *y = myData.pCurrentDock->container.iWindowPositionY; |
3021 | - *push_in = TRUE; |
3022 | -} |
3023 | - |
3024 | -static inline int _orient_arrow (CairoContainer *pContainer, int iKeyVal) |
3025 | -{ |
3026 | - switch (iKeyVal) |
3027 | - { |
3028 | - case GDK_Up : |
3029 | - if (pContainer->bIsHorizontal) |
3030 | - { |
3031 | - if (!pContainer->bDirectionUp) |
3032 | - iKeyVal = GDK_Down; |
3033 | - } |
3034 | - else |
3035 | - { |
3036 | - iKeyVal = GDK_Left; |
3037 | - } |
3038 | - break; |
3039 | - |
3040 | - case GDK_Down : |
3041 | - if (pContainer->bIsHorizontal) |
3042 | - { |
3043 | - if (!pContainer->bDirectionUp) |
3044 | - iKeyVal = GDK_Up; |
3045 | - } |
3046 | - else |
3047 | - { |
3048 | - iKeyVal = GDK_Right; |
3049 | - } |
3050 | - break; |
3051 | - |
3052 | - case GDK_Left : |
3053 | - if (!pContainer->bIsHorizontal) |
3054 | - { |
3055 | - if (pContainer->bDirectionUp) |
3056 | - iKeyVal = GDK_Up; |
3057 | - else |
3058 | - iKeyVal = GDK_Down; |
3059 | - } |
3060 | - break; |
3061 | - |
3062 | - case GDK_Right : |
3063 | - if (!pContainer->bIsHorizontal) |
3064 | - { |
3065 | - if (pContainer->bDirectionUp) |
3066 | - iKeyVal = GDK_Down; |
3067 | - else |
3068 | - iKeyVal = GDK_Up; |
3069 | - } |
3070 | - break; |
3071 | - default: |
3072 | - break; |
3073 | - |
3074 | - } |
3075 | - return iKeyVal; |
3076 | -} |
3077 | gboolean cd_do_key_pressed (gpointer pUserData, CairoContainer *pContainer, guint iKeyVal, guint iModifierType, const gchar *string) |
3078 | { |
3079 | + g_return_val_if_fail (cd_do_session_is_running (), CAIRO_DOCK_LET_PASS_NOTIFICATION); |
3080 | + |
3081 | if (myData.sCurrentText == NULL) |
3082 | return CAIRO_DOCK_LET_PASS_NOTIFICATION; |
3083 | |
3084 | @@ -267,30 +171,6 @@ |
3085 | { |
3086 | // on rejette. |
3087 | } |
3088 | - else if (iKeyVal == GDK_Menu) // emulation du clic droit. |
3089 | - { |
3090 | - if (myData.bNavigationMode) |
3091 | - { |
3092 | - if (myData.pCurrentIcon != NULL) |
3093 | - { |
3094 | - myData.bIgnoreIconState = TRUE; |
3095 | - cairo_dock_stop_icon_animation (myData.pCurrentIcon); // car on va perdre le focus. |
3096 | - myData.bIgnoreIconState = FALSE; |
3097 | - } |
3098 | - if (myData.pCurrentDock == NULL) |
3099 | - myData.pCurrentDock = g_pMainDock; |
3100 | - myData.pCurrentDock->bMenuVisible = TRUE; |
3101 | - GtkWidget *menu = cairo_dock_build_menu (myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); |
3102 | - gtk_widget_show_all (menu); |
3103 | - gtk_menu_popup (GTK_MENU (menu), |
3104 | - NULL, |
3105 | - NULL, |
3106 | - (GtkMenuPositionFunc) _place_menu, // pour positionner le menu sur le dock plutot que sur la souris. |
3107 | - NULL, |
3108 | - 1, |
3109 | - gtk_get_current_event_time ()); |
3110 | - } |
3111 | - } |
3112 | else if (iKeyVal == GDK_BackSpace) // on efface la derniere lettre. |
3113 | { |
3114 | if (myData.iNbValidCaracters > 0) |
3115 | @@ -303,38 +183,31 @@ |
3116 | cd_do_delete_invalid_caracters (); |
3117 | |
3118 | // on relance la recherche. |
3119 | - if (myData.bNavigationMode) |
3120 | - { |
3121 | - if (myData.pCurrentIcon == NULL) // sinon l'icone actuelle convient toujours. |
3122 | - cd_do_search_current_icon (FALSE); |
3123 | - } |
3124 | - else // mode recherche. |
3125 | - { |
3126 | - if (myData.pListingHistory == NULL) // recherche principale. |
3127 | - { |
3128 | - g_list_free (myData.pMatchingIcons); |
3129 | - myData.pMatchingIcons = NULL; |
3130 | - cd_do_search_matching_icons (); |
3131 | - if (myData.pMatchingIcons == NULL && myData.sCurrentText->len > 0) // on n'a trouve aucun programme, on cherche des entrees. |
3132 | - { |
3133 | - if (myData.iSidLoadExternAppliIdle != 0) |
3134 | - { |
3135 | - g_source_remove (myData.iSidLoadExternAppliIdle); |
3136 | - myData.iSidLoadExternAppliIdle = 0; |
3137 | - } |
3138 | - cd_do_launch_all_backends (); |
3139 | - } |
3140 | - else // on a trouve au moins un programme, on cache le listing des fichiers. |
3141 | - { |
3142 | - |
3143 | - cd_do_hide_listing (); |
3144 | - } |
3145 | - } |
3146 | - else // sous-recherche => on filtre. |
3147 | - { |
3148 | - cd_do_filter_current_listing (); |
3149 | - } |
3150 | - } |
3151 | + if (myData.pListingHistory == NULL) // recherche principale. |
3152 | + { |
3153 | + g_list_free (myData.pMatchingIcons); |
3154 | + myData.pMatchingIcons = NULL; |
3155 | + cd_do_search_matching_icons (); |
3156 | + if (myData.pMatchingIcons == NULL && myData.sCurrentText->len > 0) // on n'a trouve aucun programme, on cherche des entrees. |
3157 | + { |
3158 | + if (myData.iSidLoadExternAppliIdle != 0) |
3159 | + { |
3160 | + g_source_remove (myData.iSidLoadExternAppliIdle); |
3161 | + myData.iSidLoadExternAppliIdle = 0; |
3162 | + } |
3163 | + cd_do_launch_all_backends (); |
3164 | + } |
3165 | + else // on a trouve au moins un programme, on cache le listing des fichiers. |
3166 | + { |
3167 | + |
3168 | + cd_do_hide_listing (); |
3169 | + } |
3170 | + } |
3171 | + else // sous-recherche => on filtre. |
3172 | + { |
3173 | + cd_do_filter_current_listing (); |
3174 | + } |
3175 | + |
3176 | |
3177 | // on repositionne les caracteres et on anime tout ca. |
3178 | cd_do_launch_appearance_animation (); |
3179 | @@ -345,176 +218,45 @@ |
3180 | if (myData.iNbValidCaracters > 0) |
3181 | { |
3182 | gboolean bPrevious = iModifierType & GDK_SHIFT_MASK; |
3183 | - if (myData.bNavigationMode) |
3184 | + if (myData.pMatchingIcons != NULL) |
3185 | { |
3186 | - // on cherche l'icone suivante. |
3187 | - cd_do_search_current_icon (TRUE); // pCurrentIcon peut etre NULL si elle s'est faite detruire pendant la recherche, auquel cas on cherchera juste normalement. |
3188 | + cd_do_select_previous_next_matching_icon (!bPrevious); |
3189 | } |
3190 | - else |
3191 | + else |
3192 | { |
3193 | - if (myData.pMatchingIcons != NULL) |
3194 | - { |
3195 | - cd_do_select_previous_next_matching_icon (!bPrevious); |
3196 | - } |
3197 | - else |
3198 | - { |
3199 | - // faire un truc ?... |
3200 | - } |
3201 | + // faire un truc ?... |
3202 | } |
3203 | } |
3204 | } |
3205 | else if (iKeyVal == GDK_Return) |
3206 | { |
3207 | cd_debug ("Enter (%s)\n", myData.cSearchText); |
3208 | - if (myData.bNavigationMode) |
3209 | - { |
3210 | - if (myData.pCurrentIcon != NULL && myData.pCurrentDock != NULL) |
3211 | - { |
3212 | - cd_debug ("on clique sur l'icone '%s' [%d, %d]\n", myData.pCurrentIcon->cName, iModifierType, GDK_SHIFT_MASK); |
3213 | - |
3214 | - myData.bIgnoreIconState = TRUE; |
3215 | - if (iModifierType & GDK_MOD1_MASK) // ALT |
3216 | - { |
3217 | - myData.bIgnoreIconState = TRUE; |
3218 | - cairo_dock_stop_icon_animation (myData.pCurrentIcon); // car aucune animation ne va la remplacer. |
3219 | - myData.bIgnoreIconState = FALSE; |
3220 | - cairo_dock_notify (CAIRO_DOCK_MIDDLE_CLICK_ICON, myData.pCurrentIcon, myData.pCurrentDock); |
3221 | - } |
3222 | - else if (iModifierType & GDK_CONTROL_MASK) // CTRL |
3223 | - { |
3224 | - myData.bIgnoreIconState = TRUE; |
3225 | - cairo_dock_stop_icon_animation (myData.pCurrentIcon); // car on va perdre le focus. |
3226 | - myData.bIgnoreIconState = FALSE; |
3227 | - |
3228 | - myData.pCurrentDock->bMenuVisible = TRUE; |
3229 | - GtkWidget *menu = cairo_dock_build_menu (myData.pCurrentIcon, CAIRO_CONTAINER (myData.pCurrentDock)); |
3230 | - gtk_widget_show_all (menu); |
3231 | - gtk_menu_popup (GTK_MENU (menu), |
3232 | - NULL, |
3233 | - NULL, |
3234 | - NULL, |
3235 | - NULL, |
3236 | - 1, |
3237 | - gtk_get_current_event_time ()); |
3238 | - } |
3239 | - else if (myData.pCurrentIcon != NULL) |
3240 | - cairo_dock_notify (CAIRO_DOCK_CLICK_ICON, myData.pCurrentIcon, myData.pCurrentDock, iModifierType); |
3241 | - if (myData.pCurrentIcon != NULL) |
3242 | - cairo_dock_start_icon_animation (myData.pCurrentIcon, myData.pCurrentDock); |
3243 | - myData.bIgnoreIconState = FALSE; |
3244 | - myData.pCurrentIcon = NULL; // sinon on va interrompre l'animation en fermant la session. |
3245 | - } |
3246 | + if (myData.pMatchingIcons != NULL) // on a une appli a lancer. |
3247 | + { |
3248 | + Icon *pIcon = (myData.pCurrentMatchingElement ? myData.pCurrentMatchingElement->data : myData.pMatchingIcons->data); |
3249 | + cairo_dock_launch_command (pIcon->cCommand); |
3250 | + } |
3251 | + else if (myData.pListing && myData.pListing->pCurrentEntry) // pas d'appli mais une entree => on l'execute. |
3252 | + { |
3253 | + CDEntry *pEntry = myData.pListing->pCurrentEntry->data; |
3254 | + cd_debug ("on valide l'entree '%s ; %s'\n", pEntry->cName, pEntry->cPath); |
3255 | + if (pEntry->execute) |
3256 | + pEntry->execute (pEntry); |
3257 | + else |
3258 | + return CAIRO_DOCK_INTERCEPT_NOTIFICATION; |
3259 | + } |
3260 | + else if (myData.iNbValidCaracters > 0) // pas d'entree mais du texte => on l'execute tel quel. |
3261 | + { |
3262 | + cd_debug ("on execute '%s'\n", myData.sCurrentText->str); |
3263 | + cairo_dock_launch_command (myData.sCurrentText->str); |
3264 | + } |
3265 | + |
3266 | + if (!(iModifierType & GDK_CONTROL_MASK) && !(iModifierType & GDK_MOD1_MASK) && !(iModifierType & GDK_SHIFT_MASK)) |
3267 | cd_do_close_session (); |
3268 | - } |
3269 | - else // mode recherche. |
3270 | - { |
3271 | - if (myData.pMatchingIcons != NULL) // on a une appli a lancer. |
3272 | - { |
3273 | - Icon *pIcon = (myData.pCurrentMatchingElement ? myData.pCurrentMatchingElement->data : myData.pMatchingIcons->data); |
3274 | - cairo_dock_launch_command (pIcon->cCommand); |
3275 | - } |
3276 | - else if (myData.pListing && myData.pListing->pCurrentEntry) // pas d'appli mais une entree => on l'execute. |
3277 | - { |
3278 | - CDEntry *pEntry = myData.pListing->pCurrentEntry->data; |
3279 | - cd_debug ("on valide l'entree '%s ; %s'\n", pEntry->cName, pEntry->cPath); |
3280 | - if (pEntry->execute) |
3281 | - pEntry->execute (pEntry); |
3282 | - else |
3283 | - return CAIRO_DOCK_INTERCEPT_NOTIFICATION; |
3284 | - } |
3285 | - else if (myData.iNbValidCaracters > 0) // pas d'entree mais du texte => on l'execute tel quel. |
3286 | - { |
3287 | - cd_debug ("on execute '%s'\n", myData.sCurrentText->str); |
3288 | - cairo_dock_launch_command (myData.sCurrentText->str); |
3289 | - } |
3290 | - |
3291 | - if (!(iModifierType & GDK_CONTROL_MASK) && !(iModifierType & GDK_MOD1_MASK) && !(iModifierType & GDK_SHIFT_MASK)) |
3292 | - cd_do_close_session (); |
3293 | - } |
3294 | } |
3295 | else if (iKeyVal == GDK_Left || iKeyVal == GDK_Right || iKeyVal == GDK_Up || iKeyVal == GDK_Down) |
3296 | { |
3297 | - if (myData.bNavigationMode) |
3298 | - { |
3299 | - iKeyVal = _orient_arrow (pContainer, iKeyVal); |
3300 | - if (iKeyVal == GDK_Up) |
3301 | - { |
3302 | - if (myData.pCurrentIcon != NULL && myData.pCurrentIcon->pSubDock != NULL) |
3303 | - { |
3304 | - cd_debug ("on monte dans le sous-dock %s\n", myData.pCurrentIcon->cName); |
3305 | - Icon *pIcon = cairo_dock_get_first_icon (myData.pCurrentIcon->pSubDock->icons); |
3306 | - cd_do_change_current_icon (pIcon, myData.pCurrentIcon->pSubDock); |
3307 | - } |
3308 | - } |
3309 | - else if (iKeyVal == GDK_Down) |
3310 | - { |
3311 | - if (myData.pCurrentDock != NULL && myData.pCurrentDock->iRefCount > 0) |
3312 | - { |
3313 | - CairoDock *pParentDock = NULL; |
3314 | - Icon *pPointingIcon = cairo_dock_search_icon_pointing_on_dock (myData.pCurrentDock, &pParentDock); |
3315 | - if (pPointingIcon != NULL) |
3316 | - { |
3317 | - cd_debug ("on redescend dans le dock parent via %s\n", pPointingIcon->cName); |
3318 | - cd_do_change_current_icon (pPointingIcon, pParentDock); |
3319 | - } |
3320 | - } |
3321 | - } |
3322 | - else if (iKeyVal == GDK_Left) |
3323 | - { |
3324 | - if (myData.pCurrentDock == NULL) // on initialise le deplacement. |
3325 | - { |
3326 | - myData.pCurrentDock = g_pMainDock; |
3327 | - int n = g_list_length (g_pMainDock->icons); |
3328 | - if (n > 0) |
3329 | - { |
3330 | - myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n-1) / 2); |
3331 | - if (CAIRO_DOCK_IS_SEPARATOR (myData.pCurrentIcon) && n > 1) |
3332 | - myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n+1) / 2); |
3333 | - } |
3334 | - } |
3335 | - if (myData.pCurrentDock->icons != NULL) |
3336 | - { |
3337 | - Icon *pPrevIcon = cairo_dock_get_previous_icon (myData.pCurrentDock->icons, myData.pCurrentIcon); |
3338 | - if (CAIRO_DOCK_IS_SEPARATOR (pPrevIcon)) |
3339 | - pPrevIcon = cairo_dock_get_previous_icon (myData.pCurrentDock->icons, pPrevIcon); |
3340 | - if (pPrevIcon == NULL) // pas trouve ou bien 1ere icone. |
3341 | - { |
3342 | - pPrevIcon = cairo_dock_get_last_icon (myData.pCurrentDock->icons); |
3343 | - } |
3344 | - |
3345 | - cd_debug ("on se deplace a gauche sur %s\n", pPrevIcon ? pPrevIcon->cName : "none"); |
3346 | - cd_do_change_current_icon (pPrevIcon, myData.pCurrentDock); |
3347 | - } |
3348 | - } |
3349 | - else // Gdk_Right. |
3350 | - { |
3351 | - if (myData.pCurrentDock == NULL) // on initialise le deplacement. |
3352 | - { |
3353 | - myData.pCurrentDock = g_pMainDock; |
3354 | - int n = g_list_length (g_pMainDock->icons); |
3355 | - if (n > 0) |
3356 | - { |
3357 | - myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n-1) / 2); |
3358 | - if (CAIRO_DOCK_IS_SEPARATOR (myData.pCurrentIcon) && n > 1) |
3359 | - myData.pCurrentIcon = g_list_nth_data (g_pMainDock->icons, (n+1) / 2); |
3360 | - } |
3361 | - } |
3362 | - if (myData.pCurrentDock->icons != NULL) |
3363 | - { |
3364 | - Icon *pNextIcon = cairo_dock_get_next_icon (myData.pCurrentDock->icons, myData.pCurrentIcon); |
3365 | - if (CAIRO_DOCK_IS_SEPARATOR (pNextIcon)) |
3366 | - pNextIcon = cairo_dock_get_next_icon (myData.pCurrentDock->icons, pNextIcon); |
3367 | - if (pNextIcon == NULL) // pas trouve ou bien 1ere icone. |
3368 | - { |
3369 | - pNextIcon = cairo_dock_get_first_icon (myData.pCurrentDock->icons); |
3370 | - } |
3371 | - |
3372 | - cd_debug ("on se deplace a gauche sur %s\n", pNextIcon ? pNextIcon->cName : "none"); |
3373 | - cd_do_change_current_icon (pNextIcon, myData.pCurrentDock); |
3374 | - } |
3375 | - } |
3376 | - } |
3377 | - else if (myData.pMatchingIcons != NULL) |
3378 | + if (myData.pMatchingIcons != NULL) |
3379 | { |
3380 | cd_do_select_previous_next_matching_icon (iKeyVal == GDK_Right || iKeyVal == GDK_Down); |
3381 | } |
3382 | @@ -540,15 +282,7 @@ |
3383 | } |
3384 | else if (iKeyVal == GDK_Page_Down || iKeyVal == GDK_Page_Up || iKeyVal == GDK_Home || iKeyVal == GDK_End) |
3385 | { |
3386 | - if (myData.bNavigationMode) |
3387 | - { |
3388 | - if (myData.pCurrentDock == NULL) // on initialise le deplacement. |
3389 | - myData.pCurrentDock = g_pMainDock; |
3390 | - Icon *pIcon = (iKeyVal == GDK_Page_Up || iKeyVal == GDK_Home ? cairo_dock_get_first_icon (myData.pCurrentDock->icons) : cairo_dock_get_last_icon (myData.pCurrentDock->icons)); |
3391 | - cd_debug ("on se deplace a l'extremite sur %s\n", pIcon ? pIcon->cName : "none"); |
3392 | - cd_do_change_current_icon (pIcon, myData.pCurrentDock); |
3393 | - } |
3394 | - else if (myData.pListing != NULL) |
3395 | + if (myData.pListing != NULL) |
3396 | { |
3397 | if (iKeyVal == GDK_Page_Down || iKeyVal == GDK_Page_Up) |
3398 | cd_do_select_prev_next_page_in_listing (iKeyVal == GDK_Page_Down); // TRUE <=> next page |
3399 | @@ -558,7 +292,7 @@ |
3400 | } |
3401 | else if (iKeyVal >= GDK_F1 && iKeyVal <= GDK_F9) |
3402 | { |
3403 | - if (! myData.bNavigationMode && myData.pListing != NULL && GTK_WIDGET_VISIBLE (myData.pListing->container.pWidget)) |
3404 | + if (myData.pListing != NULL && GTK_WIDGET_VISIBLE (myData.pListing->container.pWidget)) |
3405 | { |
3406 | cd_debug ("modification du filtre : option n°%d", iKeyVal - GDK_F1); |
3407 | cd_do_activate_filter_option (iKeyVal - GDK_F1); |
3408 | @@ -568,7 +302,7 @@ |
3409 | else if (string) /// utiliser l'unichar ... |
3410 | { |
3411 | cd_debug ("string:'%s'\n", string); |
3412 | - int iNbNewChar = 0; |
3413 | + guint iNbNewChar = 0; |
3414 | if ((iModifierType & GDK_CONTROL_MASK) && iUnicodeChar == 'v') // CTRL+v |
3415 | { |
3416 | cd_debug ("CTRL+v\n"); |
3417 | @@ -597,30 +331,25 @@ |
3418 | myData.iNbValidCaracters = myData.sCurrentText->len; // l'utilisateur valide la nouvelle lettre ainsi que celles precedemment ajoutee par completion. |
3419 | } |
3420 | |
3421 | - if (myData.bNavigationMode) // on cherche un lanceur correspondant. |
3422 | + |
3423 | + // on cherche la liste des icones qui correspondent. |
3424 | + if (myData.pListingHistory == NULL) |
3425 | { |
3426 | - cd_do_search_current_icon (FALSE); |
3427 | + //if (! (myData.bFoundNothing || (myData.pListing && myData.pListing->pEntries))) // on n'est pas deja dans une recherche de fichiers |
3428 | + if (myData.iNbValidCaracters == iNbNewChar || myData.pMatchingIcons != NULL) // 1er ajout de lettre ou precedente recherche d'icones fructueuse => on remet ca. |
3429 | + { |
3430 | + cd_do_search_matching_icons (); |
3431 | + } |
3432 | + |
3433 | + // si on n'a trouve aucun lanceur, on lance la recherche dans les backends. |
3434 | + if (myData.pMatchingIcons == NULL) |
3435 | + { |
3436 | + cd_do_launch_all_backends (); |
3437 | + } |
3438 | } |
3439 | - else // on cherche la liste des icones qui correspondent. |
3440 | + else |
3441 | { |
3442 | - if (myData.pListingHistory == NULL) |
3443 | - { |
3444 | - //if (! (myData.bFoundNothing || (myData.pListing && myData.pListing->pEntries))) // on n'est pas deja dans une recherche de fichiers |
3445 | - if (myData.iNbValidCaracters == iNbNewChar || myData.pMatchingIcons != NULL) // 1er ajout de lettre ou precedente recherche d'icones fructueuse => on remet ca. |
3446 | - { |
3447 | - cd_do_search_matching_icons (); |
3448 | - } |
3449 | - |
3450 | - // si on n'a trouve aucun lanceur, on lance la recherche dans les backends. |
3451 | - if (myData.pMatchingIcons == NULL) |
3452 | - { |
3453 | - cd_do_launch_all_backends (); |
3454 | - } |
3455 | - } |
3456 | - else |
3457 | - { |
3458 | - cd_do_filter_current_listing (); |
3459 | - } |
3460 | + cd_do_filter_current_listing (); |
3461 | } |
3462 | |
3463 | // on rajoute une surface/texture pour la/les nouvelle(s) lettre(s). |
3464 | @@ -636,22 +365,14 @@ |
3465 | } |
3466 | |
3467 | |
3468 | -#define _cd_do_on_shortkey(bNewModeNav) \ |
3469 | - if (myData.sCurrentText == NULL) { \ |
3470 | - myData.bNavigationMode = bNewModeNav; \ |
3471 | - cd_do_open_session (); } \ |
3472 | - else { \ |
3473 | - cd_do_close_session (); \ |
3474 | - if (myData.bNavigationMode != bNewModeNav) { \ |
3475 | - cd_do_open_session (); \ |
3476 | - myData.bNavigationMode = bNewModeNav; } } |
3477 | - |
3478 | -void cd_do_on_shortkey_nav (const char *keystring, gpointer data) |
3479 | -{ |
3480 | - _cd_do_on_shortkey (TRUE); |
3481 | -} |
3482 | - |
3483 | void cd_do_on_shortkey_search (const char *keystring, gpointer data) |
3484 | { |
3485 | - _cd_do_on_shortkey (FALSE); |
3486 | + if (! cd_do_session_is_running ()) |
3487 | + { |
3488 | + cd_do_open_session (); |
3489 | + } |
3490 | + else |
3491 | + { |
3492 | + cd_do_close_session (); |
3493 | + } |
3494 | } |
3495 | |
3496 | === modified file 'Scooby-Do/src/applet-notifications.h' |
3497 | --- Scooby-Do/src/applet-notifications.h 2009-10-05 19:27:17 +0000 |
3498 | +++ Scooby-Do/src/applet-notifications.h 2010-10-02 18:13:46 +0000 |
3499 | @@ -35,16 +35,12 @@ |
3500 | //gboolean cd_do_enter_container (gpointer pUserData, CairoContainer *pContainer, gboolean *bStartAnimation); |
3501 | |
3502 | |
3503 | -gboolean cd_do_check_icon_stopped (gpointer pUserData, Icon *pIcon); |
3504 | - |
3505 | - |
3506 | gboolean cd_do_check_active_dock (gpointer pUserData, Window *XActiveWindow); |
3507 | |
3508 | |
3509 | gboolean cd_do_key_pressed (gpointer pUserData, CairoContainer *pContainer, guint iKeyVal, guint iModifierType, const gchar *string); |
3510 | |
3511 | |
3512 | -void cd_do_on_shortkey_nav (const char *keystring, gpointer data); |
3513 | void cd_do_on_shortkey_search (const char *keystring, gpointer data); |
3514 | |
3515 | |
3516 | |
3517 | === modified file 'Scooby-Do/src/applet-search.c' |
3518 | --- Scooby-Do/src/applet-search.c 2010-08-07 01:43:25 +0000 |
3519 | +++ Scooby-Do/src/applet-search.c 2010-10-02 18:13:46 +0000 |
3520 | @@ -70,7 +70,7 @@ |
3521 | pBackend->bFoundNothing = FALSE; |
3522 | pBackend->bTooManyResults = FALSE; |
3523 | |
3524 | - if (! cd_do_session_is_waiting_for_input () || myData.pListingHistory != NULL) // on a quitte la session ou on a choisi une entree en cours de route. |
3525 | + if (! cd_do_session_is_running () || myData.pListingHistory != NULL) // on a quitte la session ou on a choisi une entree en cours de route. |
3526 | { |
3527 | cd_debug (" on a quitte la session ou on a choisi une entree en cours de route\n"); |
3528 | _discard_results (pBackend); |
3529 | |
3530 | === modified file 'Scooby-Do/src/applet-session.c' |
3531 | --- Scooby-Do/src/applet-session.c 2010-08-07 01:43:25 +0000 |
3532 | +++ Scooby-Do/src/applet-session.c 2010-10-02 18:13:46 +0000 |
3533 | @@ -29,22 +29,34 @@ |
3534 | |
3535 | void cd_do_open_session (void) |
3536 | { |
3537 | - // on termine l'animation de fin de la precedente session. |
3538 | + if (cd_do_session_is_running ()) // session already running |
3539 | + return; |
3540 | + |
3541 | + // on termine la precedente session. |
3542 | cd_do_exit_session (); |
3543 | cd_do_stop_all_backends (); // on le fait maintenant pour ne pas bloquer au exit. |
3544 | |
3545 | - // on s'abonne aux notifications dont on aura besoin pour la session. |
3546 | - cairo_dock_register_notification_on_container (CAIRO_CONTAINER (g_pMainDock), CAIRO_DOCK_UPDATE_DOCK, (CairoDockNotificationFunc) cd_do_update_container, CAIRO_DOCK_RUN_AFTER, NULL); |
3547 | - cairo_dock_register_notification_on_container (CAIRO_CONTAINER (g_pMainDock), CAIRO_DOCK_RENDER_DOCK, (CairoDockNotificationFunc) cd_do_render, CAIRO_DOCK_RUN_AFTER, NULL); |
3548 | - cairo_dock_register_notification (CAIRO_DOCK_STOP_ICON, (CairoDockNotificationFunc) cd_do_check_icon_stopped, CAIRO_DOCK_RUN_AFTER, NULL); |
3549 | + // register to draw on dock. |
3550 | + if (cd_do_session_is_off ()) |
3551 | + { |
3552 | + cairo_dock_register_notification_on_container (CAIRO_CONTAINER (g_pMainDock), |
3553 | + CAIRO_DOCK_UPDATE_DOCK, |
3554 | + (CairoDockNotificationFunc) cd_do_update_container, |
3555 | + CAIRO_DOCK_RUN_AFTER, NULL); |
3556 | + cairo_dock_register_notification_on_container (CAIRO_CONTAINER (g_pMainDock), |
3557 | + CAIRO_DOCK_RENDER_DOCK, |
3558 | + (CairoDockNotificationFunc) cd_do_render, |
3559 | + CAIRO_DOCK_RUN_AFTER, NULL); |
3560 | + } |
3561 | + |
3562 | + // wait for keyboard input. |
3563 | + cairo_dock_register_notification (CAIRO_DOCK_KEY_PRESSED, (CairoDockNotificationFunc) cd_do_key_pressed, CAIRO_DOCK_RUN_AFTER, NULL); |
3564 | cairo_dock_register_notification (CAIRO_DOCK_WINDOW_ACTIVATED, (CairoDockNotificationFunc) cd_do_check_active_dock, CAIRO_DOCK_RUN_AFTER, NULL); |
3565 | - //cairo_dock_register_notification (CAIRO_DOCK_ENTER_DOCK, (CairoDockNotificationFunc) cd_do_enter_container, CAIRO_DOCK_RUN_FIRST, NULL); |
3566 | |
3567 | - // on se met en attente de texte. |
3568 | myData.sCurrentText = g_string_sized_new (20); |
3569 | myConfig.labelDescription.iSize = myConfig.fFontSizeRatio * g_pMainDock->iMaxDockHeight; |
3570 | myData.iPromptAnimationCount = 0; |
3571 | - if (! myData.bNavigationMode && myData.pPromptSurface == NULL) |
3572 | + if (myData.pPromptSurface == NULL) |
3573 | { |
3574 | cairo_t *pCairoContext = cairo_dock_create_context_from_window (CAIRO_CONTAINER (g_pMainDock)); |
3575 | myData.pPromptSurface = cairo_dock_create_surface_from_text (D_("Enter your search"), &myConfig.labelDescription, &myData.iPromptWidth, &myData.iPromptHeight); |
3576 | @@ -54,22 +66,9 @@ |
3577 | myData.iPromptTexture = cairo_dock_create_texture_from_surface (myData.pPromptSurface); |
3578 | } |
3579 | } |
3580 | - else if (myData.bNavigationMode && myData.pArrowSurface == NULL) |
3581 | - { |
3582 | - cairo_t *pCairoContext = cairo_dock_create_context_from_window (CAIRO_CONTAINER (g_pMainDock)); |
3583 | - myData.pArrowSurface = cairo_dock_create_surface_for_icon (MY_APPLET_SHARE_DATA_DIR"/arrows.svg", g_pMainDock->iMaxDockHeight, g_pMainDock->iMaxDockHeight); |
3584 | - myData.iArrowWidth = g_pMainDock->iMaxDockHeight; |
3585 | - myData.iArrowHeight = g_pMainDock->iMaxDockHeight; |
3586 | - cairo_destroy (pCairoContext); |
3587 | - if (g_bUseOpenGL) |
3588 | - { |
3589 | - myData.iArrowTexture = cairo_dock_create_texture_from_surface (myData.pArrowSurface); |
3590 | - } |
3591 | - } |
3592 | + |
3593 | // on montre le main dock. |
3594 | - myData.bIgnoreIconState = TRUE; |
3595 | - cairo_dock_emit_enter_signal (g_pMainDock); |
3596 | - myData.bIgnoreIconState = FALSE; |
3597 | + cairo_dock_emit_enter_signal (CAIRO_CONTAINER (g_pMainDock)); |
3598 | |
3599 | // le main dock prend le focus. |
3600 | myData.iPreviouslyActiveWindow = cairo_dock_get_active_xwindow (); |
3601 | @@ -81,24 +80,23 @@ |
3602 | |
3603 | // On lance l'animation d'attente. |
3604 | cairo_dock_launch_animation (CAIRO_CONTAINER (g_pMainDock)); |
3605 | + |
3606 | + myData.iSessionState = 2; |
3607 | } |
3608 | |
3609 | void cd_do_close_session (void) |
3610 | { |
3611 | - // on ne veut plus de texte. |
3612 | + if (! cd_do_session_is_running ()) // session not running |
3613 | + return; |
3614 | + |
3615 | + // no more keyboard input. |
3616 | + cairo_dock_remove_notification_func (CAIRO_DOCK_KEY_PRESSED, (CairoDockNotificationFunc) cd_do_key_pressed, NULL); |
3617 | + cairo_dock_remove_notification_func (CAIRO_DOCK_WINDOW_ACTIVATED, (CairoDockNotificationFunc) cd_do_check_active_dock, NULL); |
3618 | + |
3619 | g_string_free (myData.sCurrentText, TRUE); |
3620 | myData.sCurrentText = NULL; |
3621 | myData.iNbValidCaracters = 0; |
3622 | |
3623 | - // on remet a zero la session. |
3624 | - if (myData.pCurrentIcon != NULL) |
3625 | - { |
3626 | - myData.bIgnoreIconState = TRUE; |
3627 | - cairo_dock_stop_icon_animation (myData.pCurrentIcon); |
3628 | - myData.bIgnoreIconState = FALSE; |
3629 | - myData.pCurrentIcon = NULL; |
3630 | - } |
3631 | - |
3632 | // on cache les resultats |
3633 | cd_do_hide_listing (); |
3634 | |
3635 | @@ -106,16 +104,7 @@ |
3636 | myData.cSearchText = NULL; |
3637 | myData.iCurrentFilter = 0; |
3638 | |
3639 | - if (myData.pCurrentDock != NULL) |
3640 | - { |
3641 | - //cairo_dock_leave_from_main_dock (myData.pCurrentDock); /// voir avec un emit_leave_signal ... |
3642 | - cairo_dock_emit_leave_signal (myData.pCurrentDock); |
3643 | - myData.pCurrentDock = NULL; |
3644 | - } |
3645 | - if (myData.pCurrentDock != g_pMainDock) |
3646 | - { |
3647 | - cairo_dock_emit_leave_signal (g_pMainDock); |
3648 | - } |
3649 | + cairo_dock_emit_leave_signal (CAIRO_CONTAINER (g_pMainDock)); |
3650 | |
3651 | // on redonne le focus a l'ancienne fenetre. |
3652 | if (myData.iPreviouslyActiveWindow != 0) |
3653 | @@ -131,20 +120,26 @@ |
3654 | myData.iCloseTime = myConfig.iCloseDuration; |
3655 | cairo_dock_launch_animation (CAIRO_CONTAINER (g_pMainDock)); |
3656 | cairo_dock_freeze_docks (FALSE); |
3657 | + |
3658 | + myData.iSessionState = 1; |
3659 | } |
3660 | |
3661 | void cd_do_exit_session (void) |
3662 | { |
3663 | + if (cd_do_session_is_off ()) // session already off |
3664 | + return; |
3665 | + |
3666 | + |
3667 | + cd_do_close_session (); |
3668 | + |
3669 | + myData.iCloseTime = 0; |
3670 | + |
3671 | cairo_dock_remove_notification_func_on_container (CAIRO_CONTAINER (g_pMainDock), CAIRO_DOCK_RENDER_DOCK, (CairoDockNotificationFunc) cd_do_render, NULL); |
3672 | cairo_dock_remove_notification_func_on_container (CAIRO_CONTAINER (g_pMainDock), CAIRO_DOCK_UPDATE_DOCK, (CairoDockNotificationFunc) cd_do_update_container, NULL); |
3673 | - cairo_dock_remove_notification_func (CAIRO_DOCK_STOP_ICON, (CairoDockNotificationFunc) cd_do_check_icon_stopped, NULL); |
3674 | - cairo_dock_remove_notification_func (CAIRO_DOCK_WINDOW_ACTIVATED, (CairoDockNotificationFunc) cd_do_check_active_dock, NULL); |
3675 | - //cairo_dock_remove_notification_func (CAIRO_DOCK_ENTER_DOCK, (CairoDockNotificationFunc) cd_do_enter_container, NULL); |
3676 | - |
3677 | - // arreter les backends... |
3678 | - |
3679 | - |
3680 | - myData.iCloseTime = 0; |
3681 | + |
3682 | + /// arreter les backends... |
3683 | + |
3684 | + |
3685 | if (myData.pCharList != NULL) |
3686 | { |
3687 | cd_do_free_char_list (myData.pCharList); |
3688 | @@ -179,6 +174,8 @@ |
3689 | myData.iPreviousMatchingOffset = 0; |
3690 | myData.iCurrentMatchingOffset = 0; |
3691 | } |
3692 | + |
3693 | + myData.iSessionState = 0; |
3694 | } |
3695 | |
3696 | |
3697 | @@ -214,7 +211,8 @@ |
3698 | CDChar *pChar; |
3699 | cairo_t *pCairoContext = cairo_dock_create_context_from_window (CAIRO_CONTAINER (g_pMainDock)); |
3700 | int iDeltaT = cairo_dock_get_animation_delta_t (g_pMainDock); |
3701 | - int i, iOffsetX=0; |
3702 | + guint i; |
3703 | + int iOffsetX=0; |
3704 | for (i = myData.iNbValidCaracters-0; i < myData.sCurrentText->len; i++) |
3705 | { |
3706 | //g_print (" on charge la lettre '%c' (%d) tex:%d\n", myData.sCurrentText->str[i], i, bLoadTexture); |
3707 | @@ -297,7 +295,7 @@ |
3708 | // on efface les lettres precedentes jusqu'a la derniere position validee. |
3709 | CDChar *pChar; |
3710 | GList *c = g_list_last (myData.pCharList), *c_prev; |
3711 | - int i; |
3712 | + guint i; |
3713 | for (i = myData.iNbValidCaracters; i < myData.sCurrentText->len && c != NULL; i ++) |
3714 | { |
3715 | //g_print ("on efface '%c'\n", myData.sCurrentText->str[i]); |
3716 | |
3717 | === modified file 'Scooby-Do/src/applet-session.h' |
3718 | --- Scooby-Do/src/applet-session.h 2009-10-05 19:27:17 +0000 |
3719 | +++ Scooby-Do/src/applet-session.h 2010-10-02 18:13:46 +0000 |
3720 | @@ -31,11 +31,9 @@ |
3721 | |
3722 | void cd_do_exit_session (void); |
3723 | |
3724 | -#define cd_do_session_is_waiting_for_input(...) (myData.sCurrentText != NULL) |
3725 | -#define cd_do_session_is_closing(...) (myData.iCloseTime != 0) |
3726 | -#define cd_do_session_is_running(...) (cd_do_session_is_waiting_for_input () || cd_do_session_is_closing ()) |
3727 | -#define cd_do_session_is_in_navigation_mode(...) (myData.pCharList == NULL) |
3728 | -#define cd_do_session_is_in_selection_mode(...) (myData.pCharList != NUUL) |
3729 | +#define cd_do_session_is_running(...) (myData.iSessionState == 2) |
3730 | +#define cd_do_session_is_closing(...) (myData.iSessionState == 1) |
3731 | +#define cd_do_session_is_off(...) (myData.iSessionState == 0) |
3732 | |
3733 | void cd_do_free_char (CDChar *pChar); |
3734 | void cd_do_free_char_list (GList *pCharList); |
3735 | |
3736 | === modified file 'Scooby-Do/src/applet-struct.h' |
3737 | --- Scooby-Do/src/applet-struct.h 2010-02-14 00:51:22 +0000 |
3738 | +++ Scooby-Do/src/applet-struct.h 2010-10-02 18:13:46 +0000 |
3739 | @@ -23,30 +23,11 @@ |
3740 | |
3741 | #include <cairo-dock.h> |
3742 | |
3743 | -/**Le concept de ce plug-in est le suivant : |
3744 | - * - l'utilisateur l'active par la combinaison de touches pre-definie : |
3745 | - * => mode navigation : les fleches deplacent l'icone courante |
3746 | - * une lettre deplace sur la 1ere icone correspondante au mot courant |
3747 | - * TAB deplace sur l'icone suivante corespondante au mot courant |
3748 | - * la completion est automatique |
3749 | - * si aucune icone n'est trouvee, la completion elargie est utilisee. |
3750 | - * => mode recherche : les fleches deplacent parmi la liste d'icones correspondantes |
3751 | - * une lettre reduit/elargit la liste courante |
3752 | - * les icones de la liste sont affichees dans le dock principal, zoomees si necessaire |
3753 | - * completion: idem |
3754 | - * - l'utilisateur appuie sur une lettre en ayant la souris dans un dock ayant le focus : |
3755 | - * => le mode navigation est active avec cette 1ere lettre |
3756 | - * seule le dock courant est pris en compte |
3757 | - * en cas de sortie du dock, la session est terminee |
3758 | - * la completion est automatique sur les icones trouvees seulement. |
3759 | - * */ |
3760 | - |
3761 | //\___________ structure containing the applet's configuration parameters. |
3762 | struct _AppletConfig { |
3763 | gdouble fFontSizeRatio; // 1 <=> taille du dock |
3764 | gboolean bTextOnTop; |
3765 | CairoDockLabelDescription labelDescription; |
3766 | - gchar *cShortkeyNav; |
3767 | gchar *cShortkeySearch; |
3768 | gchar *cIconAnimation; |
3769 | gdouble pFrameColor[4]; |
3770 | @@ -167,31 +148,19 @@ |
3771 | |
3772 | //\___________ structure containing the applet's data, like surfaces, dialogs, results of calculation, etc. |
3773 | struct _AppletData { |
3774 | + gint iSessionState; // 0:no session, 1: session closing, 2: session running |
3775 | GString *sCurrentText; |
3776 | - gint iStopCount; |
3777 | - gint iNbValidCaracters; |
3778 | + guint iNbValidCaracters; |
3779 | Window iPreviouslyActiveWindow; |
3780 | - Icon *pCurrentIcon; |
3781 | - CairoDock *pCurrentDock; |
3782 | gint iTextWidth, iTextHeight; |
3783 | gint iCloseTime; |
3784 | GList *pCharList; |
3785 | - gboolean bIgnoreIconState; |
3786 | gint iAppearanceTime; |
3787 | |
3788 | - gint iPrevMouseX, iPrevMouseY; |
3789 | - gint iMouseX, iMouseY; |
3790 | - gint iMotionCount; |
3791 | - |
3792 | - gboolean bNavigationMode; |
3793 | - gboolean bSessionStartedAutomatically; |
3794 | gint iPromptAnimationCount; |
3795 | cairo_surface_t *pPromptSurface; |
3796 | gint iPromptWidth, iPromptHeight; |
3797 | GLuint iPromptTexture; |
3798 | - cairo_surface_t *pArrowSurface; |
3799 | - gint iArrowWidth, iArrowHeight; |
3800 | - GLuint iArrowTexture; |
3801 | |
3802 | GList *pMatchingIcons; |
3803 | GList *pCurrentMatchingElement; |
3804 | |
3805 | === modified file 'Status-Notifier/src/applet-draw.c' |
3806 | --- Status-Notifier/src/applet-draw.c 2010-09-07 00:39:20 +0000 |
3807 | +++ Status-Notifier/src/applet-draw.c 2010-10-02 18:13:46 +0000 |
3808 | @@ -62,13 +62,13 @@ |
3809 | myData.iItemSize = iSize; |
3810 | } |
3811 | } |
3812 | - g_print ("satus_notifier : %dx%d\n", myData.iNbLines, myData.iNbColumns); |
3813 | + //g_print ("satus_notifier : %dx%d\n", myData.iNbLines, myData.iNbColumns); |
3814 | } |
3815 | |
3816 | |
3817 | void cd_satus_notifier_draw_compact_icon (void) |
3818 | { |
3819 | - g_print ("%s ()\n", __func__); |
3820 | + //g_print ("%s ()\n", __func__); |
3821 | int iWidth, iHeight; |
3822 | CD_APPLET_GET_MY_ICON_EXTENT (&iWidth, &iHeight); |
3823 | |
3824 | @@ -133,13 +133,13 @@ |
3825 | |
3826 | void cd_satus_notifier_reload_compact_mode (void) |
3827 | { |
3828 | - g_print ("%s ()\n", __func__); |
3829 | + //g_print ("%s ()\n", __func__); |
3830 | // re-compute the grid. |
3831 | int iPrevSize = myData.iItemSize; |
3832 | cd_satus_notifier_compute_grid (); |
3833 | |
3834 | // reload surfaces if their size has changed. |
3835 | - g_print (" size: %d -> %d\n", iPrevSize, myData.iItemSize); |
3836 | + //g_print (" size: %d -> %d\n", iPrevSize, myData.iItemSize); |
3837 | CDStatusNotifierItem *pItem; |
3838 | GList *it; |
3839 | for (it = myData.pItems; it != NULL; it = it->next) |
3840 | @@ -172,9 +172,10 @@ |
3841 | return NULL; |
3842 | |
3843 | int iMouseX, iMouseY; |
3844 | - iMouseX = myContainer->iMouseX; |
3845 | - iMouseY = myContainer->iMouseY; |
3846 | + iMouseX = myContainer->iMouseX - myIcon->fDrawX; |
3847 | + iMouseY = myContainer->iMouseY - myIcon->fDrawY; |
3848 | |
3849 | + //g_print ("%s (%d;%d)\n", __func__, iMouseX, iMouseY); |
3850 | // get index on the grid. |
3851 | int iWidth, iHeight; |
3852 | CD_APPLET_GET_MY_ICON_EXTENT (&iWidth, &iHeight); |
3853 | @@ -194,17 +195,17 @@ |
3854 | pItem = it->data; |
3855 | if (pItem->pSurface != NULL && pItem->iStatus != CD_STATUS_PASSIVE) |
3856 | { |
3857 | - j ++; |
3858 | - if (j == myData.iNbColumns) // next line. |
3859 | - { |
3860 | - j = 0; |
3861 | - i ++; |
3862 | - } |
3863 | if (i == line && j == col) |
3864 | { |
3865 | pFoundItem = pItem; |
3866 | break; |
3867 | } |
3868 | + j ++; |
3869 | + if (j == myData.iNbColumns) // next line. |
3870 | + { |
3871 | + j = 0; |
3872 | + i ++; |
3873 | + } |
3874 | } |
3875 | } |
3876 | |
3877 | |
3878 | === modified file 'Status-Notifier/src/applet-host.c' |
3879 | --- Status-Notifier/src/applet-host.c 2010-09-07 00:39:20 +0000 |
3880 | +++ Status-Notifier/src/applet-host.c 2010-10-02 18:13:46 +0000 |
3881 | @@ -49,7 +49,7 @@ |
3882 | gpointer invocation_hint G_GNUC_UNUSED, |
3883 | gpointer marshal_data) |
3884 | { |
3885 | - g_print ("%s ()\n", __func__); |
3886 | + //g_print ("%s ()\n", __func__); |
3887 | typedef void (*GMarshalFunc_VOID__STRING_INT_STRING_STRING_STRING_STRING_STRING) ( |
3888 | gpointer data1, |
3889 | gchar *arg_1, |
3890 | @@ -169,7 +169,7 @@ |
3891 | static void on_new_item (DBusGProxy *proxy_watcher, const gchar *cService, CairoDockModuleInstance *myApplet) |
3892 | { |
3893 | CD_APPLET_ENTER; |
3894 | - g_print ("%s (%s)\n", __func__, cService); |
3895 | + //g_print ("%s (%s)\n", __func__, cService); |
3896 | |
3897 | _add_new_item (cService, NULL, -1); // on suppose que leur indicator-application ne mettra jamais -1 comme position. |
3898 | |
3899 | @@ -179,7 +179,7 @@ |
3900 | static void on_removed_item (DBusGProxy *proxy_watcher, const gchar *cService, CairoDockModuleInstance *myApplet) |
3901 | { |
3902 | CD_APPLET_ENTER; |
3903 | - g_print ("%s (%s)\n", __func__, cService); |
3904 | + //g_print ("%s (%s)\n", __func__, cService); |
3905 | |
3906 | gchar *str = strchr (cService, '/'); |
3907 | if (str) |
3908 | @@ -193,7 +193,7 @@ |
3909 | static void on_new_application (DBusGProxy *proxy_watcher, const gchar *cIconName, gint iPosition, const gchar *cAdress, const gchar *cObjectPath, const gchar *cIconThemePath, const gchar *cLabel, const gchar *cLabelGuide, CairoDockModuleInstance *myApplet) |
3910 | { |
3911 | CD_APPLET_ENTER; |
3912 | - g_print ("%s (%s, %s, %s, %s, %d)\n", __func__, cAdress, cObjectPath, cIconName, cIconThemePath, iPosition); |
3913 | + //g_print ("%s (%s, %s, %s, %s, %d)\n", __func__, cAdress, cObjectPath, cIconName, cIconThemePath, iPosition); |
3914 | |
3915 | _add_new_item (cAdress, cObjectPath, iPosition); |
3916 | |
3917 | @@ -203,7 +203,7 @@ |
3918 | static void on_removed_application (DBusGProxy *proxy_watcher, gint iPosition, CairoDockModuleInstance *myApplet) |
3919 | { |
3920 | CD_APPLET_ENTER; |
3921 | - g_print ("%s (%d)\n", __func__, iPosition); |
3922 | + //g_print ("%s (%d)\n", __func__, iPosition); |
3923 | |
3924 | _remove_item (NULL, iPosition); |
3925 | |
3926 | @@ -217,7 +217,7 @@ |
3927 | |
3928 | static void _on_get_applications_from_service (DBusGProxy *proxy, DBusGProxyCall *call_id, CairoDockModuleInstance *myApplet) |
3929 | { |
3930 | - g_print ("%s ()\n", __func__); |
3931 | + //g_print ("%s ()\n", __func__); |
3932 | CD_APPLET_ENTER; |
3933 | myData.pGetApplicationsCall = NULL; |
3934 | |
3935 | @@ -252,7 +252,7 @@ |
3936 | GValueArray *va; |
3937 | GValue *v; |
3938 | CDStatusNotifierItem *pItem=NULL; |
3939 | - g_print ("%d apps in the systray\n", pApplications->len); |
3940 | + //g_print ("%d apps in the systray\n", pApplications->len); |
3941 | for (i = 0; i < pApplications->len; i ++) |
3942 | { |
3943 | va = pApplications->pdata[i]; |
3944 | @@ -295,14 +295,14 @@ |
3945 | if (v && G_VALUE_HOLDS_STRING (v)) |
3946 | cLabelGuide = g_value_get_string (v); |
3947 | |
3948 | - g_print (" + item {%s ; %d ; %s ; %s ; %s ; %s ; %s}\n", |
3949 | + /*g_print (" + item {%s ; %d ; %s ; %s ; %s ; %s ; %s}\n", |
3950 | cIconName, |
3951 | iPosition, |
3952 | cAdress, |
3953 | cObjectPath, |
3954 | cIconThemePath, |
3955 | cLabel, |
3956 | - cLabelGuide); |
3957 | + cLabelGuide);*/ |
3958 | |
3959 | pItem = cd_satus_notifier_create_item (cAdress, cObjectPath); |
3960 | if (! pItem) |
3961 | @@ -326,7 +326,7 @@ |
3962 | |
3963 | static void _cd_satus_notifier_get_indicator_application (void) |
3964 | { |
3965 | - g_print ("%s ()\n", __func__); |
3966 | + //g_print ("%s ()\n", __func__); |
3967 | // get the service |
3968 | myData.pProxyIndicatorApplicationService = cairo_dock_create_new_session_proxy ( |
3969 | CD_INDICATOR_APPLICATION_ADDR, |
3970 | @@ -364,7 +364,7 @@ |
3971 | |
3972 | static void _on_get_applications_from_watcher (DBusGProxy *proxy, DBusGProxyCall *call_id, CairoDockModuleInstance *myApplet) |
3973 | { |
3974 | - g_print ("%s ()\n", __func__); |
3975 | + //g_print ("%s ()\n", __func__); |
3976 | CD_APPLET_ENTER; |
3977 | myData.pGetApplicationsCall = NULL; |
3978 | |
3979 | @@ -408,7 +408,7 @@ |
3980 | } |
3981 | else // un watcher asocial comme celui d'Ubuntu, on essaye avec l'"indicator-application". |
3982 | { |
3983 | - g_print ("this watcher is not so friendly, let's try the 'application indicator'\n"); |
3984 | + //g_print ("this watcher is not so friendly, let's try the 'application indicator'\n"); |
3985 | _cd_satus_notifier_get_indicator_application (); |
3986 | } |
3987 | CD_APPLET_LEAVE (); |
3988 | @@ -416,7 +416,7 @@ |
3989 | |
3990 | static void _on_register_host (DBusGProxy *proxy, DBusGProxyCall *call_id, CairoDockModuleInstance *myApplet) |
3991 | { |
3992 | - g_print ("%s ()\n", __func__); |
3993 | + //g_print ("%s ()\n", __func__); |
3994 | CD_APPLET_ENTER; |
3995 | GError *erreur = NULL; |
3996 | gboolean bSuccess = dbus_g_proxy_end_call (proxy, |
3997 | @@ -433,7 +433,7 @@ |
3998 | |
3999 | if (bSuccess) // il y'a un watcher. |
4000 | { |
4001 | - g_print ("found a friendly watcher, now ask for the items...\n"); |
4002 | + //g_print ("found a friendly watcher, now ask for the items...\n"); |
4003 | // get the items |
4004 | DBusGProxy *pProxyWatcherProps = cairo_dock_create_new_session_proxy ( |
4005 | CD_STATUS_NOTIFIER_WATCHER_ADDR, |
4006 | @@ -460,7 +460,7 @@ |
4007 | } |
4008 | else // pas de watcher, ou un asocial comme celui d'Ubuntu, on essaye avec l'"indicator-application". |
4009 | { |
4010 | - g_print ("no friendy watcher, let's try the 'application indicator'\n"); |
4011 | + //g_print ("no friendy watcher, let's try the 'application indicator'\n"); |
4012 | _cd_satus_notifier_get_indicator_application (); |
4013 | } |
4014 | CD_APPLET_LEAVE (); |
4015 | @@ -468,7 +468,7 @@ |
4016 | static void _cd_satus_notifier_register_host (void) |
4017 | { |
4018 | // register to the watcher. |
4019 | - g_print ("registering to the watcher...\n"); |
4020 | + //g_print ("registering to the watcher...\n"); |
4021 | myData.pRegisterHostCall = dbus_g_proxy_begin_call (myData.pProxyWatcher, "RegisterNotificationHost", |
4022 | (DBusGProxyCallNotify)_on_register_host, |
4023 | myApplet, |
4024 | @@ -500,18 +500,18 @@ |
4025 | // Register the service name on the bus. |
4026 | pid_t pid = getpid (); |
4027 | myData.cHostName = g_strdup_printf (CD_STATUS_NOTIFIER_HOST_ADDR"-%d", pid); |
4028 | - g_print ("registering name '%s' on the bus ...\n", myData.cHostName); |
4029 | + //g_print ("registering name '%s' on the bus ...\n", myData.cHostName); |
4030 | cairo_dock_register_service_name (myData.cHostName); |
4031 | |
4032 | // get the watcher. |
4033 | - g_print ("getting the watcher ...\n"); |
4034 | + //g_print ("getting the watcher ...\n"); |
4035 | myData.pProxyWatcher = cairo_dock_create_new_session_proxy ( |
4036 | CD_STATUS_NOTIFIER_WATCHER_ADDR, |
4037 | CD_STATUS_NOTIFIER_WATCHER_OBJ, |
4038 | CD_STATUS_NOTIFIER_WATCHER_IFACE); /// dbus_g_proxy_new_for_name_owner ?... |
4039 | if (myData.pProxyWatcher == NULL) // no watcher yet, let's try again in a few moment. |
4040 | { |
4041 | - g_print ("no watcher yet, let's try again in a few moment\n"); |
4042 | + //g_print ("no watcher yet, let's try again in a few moment\n"); |
4043 | myData.iSidGetWatcher = g_timeout_add (1000., (GSourceFunc)_get_watcher, myApplet); |
4044 | return; |
4045 | } |
4046 | |
4047 | === modified file 'Status-Notifier/src/applet-init.c' |
4048 | --- Status-Notifier/src/applet-init.c 2010-09-07 00:39:20 +0000 |
4049 | +++ Status-Notifier/src/applet-init.c 2010-10-02 18:13:46 +0000 |
4050 | @@ -32,7 +32,7 @@ |
4051 | CD_APPLET_DEFINITION (N_("Status Notifier"), |
4052 | 2, 2, 0, |
4053 | CAIRO_DOCK_CATEGORY_APPLET_DESKTOP, |
4054 | - N_("A <b>notification area</b> for your dock\n" |
4055 | + ("A <b>notification area</b> for your dock\n" |
4056 | "Also called 'systray'.\n" |
4057 | "It is designed to work on any desktop that supports the latest systray specifications (KDE, Gnome, etc)"), |
4058 | "Fabounet (Fabrice Rey)") |
4059 | @@ -43,6 +43,9 @@ |
4060 | if (! cairo_dock_reserve_data_slot (myApplet)) |
4061 | return; |
4062 | |
4063 | + if (myConfig.bCompactMode) |
4064 | + CD_APPLET_SET_STATIC_ICON; |
4065 | + |
4066 | if (myDesklet) |
4067 | { |
4068 | CD_APPLET_SET_DESKLET_RENDERER ("Simple"); |
4069 | |
4070 | === modified file 'Status-Notifier/src/applet-item.c' |
4071 | --- Status-Notifier/src/applet-item.c 2010-09-07 00:39:20 +0000 |
4072 | +++ Status-Notifier/src/applet-item.c 2010-10-02 18:13:46 +0000 |
4073 | @@ -140,11 +140,11 @@ |
4074 | static void on_new_item_icon (DBusGProxy *proxy_item, CDStatusNotifierItem *pItem) |
4075 | { |
4076 | CD_APPLET_ENTER; |
4077 | - g_print ("%s ()\n", __func__); |
4078 | + //g_print ("%s ()\n", __func__); |
4079 | |
4080 | g_free (pItem->cIconName); |
4081 | pItem->cIconName = cairo_dock_dbus_get_property_as_string (pItem->pProxyProps, CD_STATUS_NOTIFIER_ITEM_IFACE, "IconName"); |
4082 | - g_print (" new icon : %s\n", pItem->cIconName); |
4083 | + //g_print (" new icon : %s\n", pItem->cIconName); |
4084 | |
4085 | if (pItem->iStatus != CD_STATUS_NEEDS_ATTENTION) |
4086 | { |
4087 | @@ -156,11 +156,11 @@ |
4088 | static void on_new_item_attention_icon (DBusGProxy *proxy_item, CDStatusNotifierItem *pItem) |
4089 | { |
4090 | CD_APPLET_ENTER; |
4091 | - g_print ("%s ()\n", __func__); |
4092 | + //g_print ("%s ()\n", __func__); |
4093 | |
4094 | g_free (pItem->cAttentionIconName); |
4095 | pItem->cAttentionIconName = cairo_dock_dbus_get_property_as_string (pItem->pProxyProps, CD_STATUS_NOTIFIER_ITEM_IFACE, "AttentionIconName"); |
4096 | - g_print (" new attention icon : %s\n", pItem->cAttentionIconName); |
4097 | + //g_print (" new attention icon : %s\n", pItem->cAttentionIconName); |
4098 | |
4099 | if (pItem->iStatus == CD_STATUS_NEEDS_ATTENTION) |
4100 | { |
4101 | @@ -172,7 +172,7 @@ |
4102 | static void on_new_item_status (DBusGProxy *proxy_item, const gchar *cStatus, CDStatusNotifierItem *pItem) |
4103 | { |
4104 | CD_APPLET_ENTER; |
4105 | - g_print ("%s (%s)\n", __func__, cStatus); |
4106 | + //g_print ("%s (%s)\n", __func__, cStatus); |
4107 | |
4108 | // get the new status |
4109 | CDStatusEnum iPrevStatus = pItem->iStatus; |
4110 | @@ -213,7 +213,7 @@ |
4111 | static void on_new_item_label (DBusGProxy *proxy_item, const gchar *cLabel, const gchar *cLabelGuide, CDStatusNotifierItem *pItem) |
4112 | { |
4113 | CD_APPLET_ENTER; |
4114 | - g_print ("%s (%s, %s)\n", __func__, cLabel, cLabelGuide); |
4115 | + //g_print ("%s (%s, %s)\n", __func__, cLabel, cLabelGuide); |
4116 | |
4117 | g_free (pItem->cLabel); |
4118 | pItem->cLabel = g_strdup (cLabel); |
4119 | @@ -227,7 +227,7 @@ |
4120 | static void on_new_item_theme_path (DBusGProxy *proxy_item, const gchar *cNewThemePath, CDStatusNotifierItem *pItem) |
4121 | { |
4122 | CD_APPLET_ENTER; |
4123 | - g_print ("%s (%s)\n", __func__, cNewThemePath); |
4124 | + //g_print ("%s (%s)\n", __func__, cNewThemePath); |
4125 | |
4126 | g_free (pItem->cIconThemePath); |
4127 | pItem->cIconThemePath = g_strdup (cNewThemePath); |
4128 | @@ -241,11 +241,11 @@ |
4129 | static void on_new_item_title (DBusGProxy *proxy_item, CDStatusNotifierItem *pItem) |
4130 | { |
4131 | CD_APPLET_ENTER; |
4132 | - g_print ("%s ()\n", __func__); |
4133 | + //g_print ("%s ()\n", __func__); |
4134 | |
4135 | g_free (pItem->cTitle); |
4136 | pItem->cTitle = cairo_dock_dbus_get_property_as_string (pItem->pProxyProps, CD_STATUS_NOTIFIER_ITEM_IFACE, "Title"); |
4137 | - g_print (" new title : %s\n", pItem->cTitle); |
4138 | + //g_print (" new title : %s\n", pItem->cTitle); |
4139 | |
4140 | //cairo_dock_set_icon_name (cTitle, pIcon, CAIRO_CONTAINER (myIcon->pSubDock)); |
4141 | |
4142 | @@ -255,11 +255,11 @@ |
4143 | static void on_new_item_overlay_icon (DBusGProxy *proxy_item, CDStatusNotifierItem *pItem) |
4144 | { |
4145 | CD_APPLET_ENTER; |
4146 | - g_print ("%s ()\n", __func__); |
4147 | + //g_print ("%s ()\n", __func__); |
4148 | |
4149 | g_free (pItem->cOverlayIconName); |
4150 | pItem->cOverlayIconName = cairo_dock_dbus_get_property_as_string (pItem->pProxyProps, CD_STATUS_NOTIFIER_ITEM_IFACE, "OverlayIconName"); |
4151 | - g_print (" new overlay : %s\n", pItem->cOverlayIconName); |
4152 | + //g_print (" new overlay : %s\n", pItem->cOverlayIconName); |
4153 | |
4154 | /*if (pIcon->pIconBuffer) |
4155 | { |
4156 | @@ -284,7 +284,7 @@ |
4157 | static void on_new_item_tooltip (DBusGProxy *proxy_item, CDStatusNotifierItem *pItem) |
4158 | { |
4159 | CD_APPLET_ENTER; |
4160 | - g_print ("%s ()\n", __func__); |
4161 | + //g_print ("%s ()\n", __func__); |
4162 | |
4163 | cd_free_tooltip (pItem->pToolTip); |
4164 | pItem->pToolTip = NULL; |
4165 | @@ -308,7 +308,7 @@ |
4166 | if (pItem->bInvalid) |
4167 | return; |
4168 | CD_APPLET_ENTER; |
4169 | - g_print ("this item (%s) was suddenly removed\n", __func__, pItem->cService); |
4170 | + //g_print ("this item (%s) was suddenly removed\n", __func__, pItem->cService); |
4171 | |
4172 | myData.pItems = g_list_remove (myData.pItems, pItem); |
4173 | |
4174 | @@ -356,7 +356,7 @@ |
4175 | gchar *str = strchr (cService, '/'); |
4176 | if (str) |
4177 | *str = '\0'; |
4178 | - g_print ("%s (%s)\n", __func__, cService); |
4179 | + //g_print ("%s (%s)\n", __func__, cService); |
4180 | |
4181 | // special case for Ubuntu indicators: we don't know their object path. |
4182 | if (cObjectPath != NULL && strncmp (cObjectPath, CD_INDICATOR_APPLICATION_ITEM_OBJ, strlen (CD_INDICATOR_APPLICATION_ITEM_OBJ)) == 0) |
4183 | @@ -377,9 +377,9 @@ |
4184 | DBUS_INTERFACE_PROPERTIES); |
4185 | if (pProxyItemProp == NULL) |
4186 | return NULL; |
4187 | - g_print ("owner : %s\n", dbus_g_proxy_get_bus_name (pProxyItemProp)); |
4188 | + //g_print ("owner : %s\n", dbus_g_proxy_get_bus_name (pProxyItemProp)); |
4189 | |
4190 | - g_print ("getting properties ...\n"); |
4191 | + //g_print ("getting properties ...\n"); |
4192 | GHashTable *hProps = cairo_dock_dbus_get_all_properties (pProxyItemProp, CD_STATUS_NOTIFIER_ITEM_IFACE); |
4193 | if (hProps == NULL) |
4194 | return NULL; |
4195 | @@ -392,7 +392,7 @@ |
4196 | { |
4197 | cId = g_value_get_string (v); |
4198 | } |
4199 | - g_print (" ID '%s'\n", cId); |
4200 | + //g_print (" ID '%s'\n", cId); |
4201 | |
4202 | const gchar *cCategory = NULL; |
4203 | v = g_hash_table_lookup (hProps, "Category"); // (ApplicationStatus, Communications, SystemServices, Hardware) -> fOrder |
4204 | @@ -400,7 +400,7 @@ |
4205 | { |
4206 | cCategory = g_value_get_string (v); |
4207 | } |
4208 | - g_print (" Category '%s'\n", cCategory); |
4209 | + //g_print (" Category '%s'\n", cCategory); |
4210 | |
4211 | const gchar *cStatus = NULL; |
4212 | v = g_hash_table_lookup (hProps, "Status"); // (Passive, Active, NeedsAttention) -> demands attention |
4213 | @@ -408,7 +408,7 @@ |
4214 | { |
4215 | cStatus = g_value_get_string (v); |
4216 | } |
4217 | - g_print (" Status '%s'\n", cStatus); |
4218 | + //g_print (" Status '%s'\n", cStatus); |
4219 | |
4220 | const gchar *cIconName = NULL; |
4221 | v = g_hash_table_lookup (hProps, "IconName"); // -> cIFileName |
4222 | @@ -416,7 +416,7 @@ |
4223 | { |
4224 | cIconName = g_value_get_string (v); |
4225 | } |
4226 | - g_print (" IconName '%s'\n", cIconName); |
4227 | + //g_print (" IconName '%s'\n", cIconName); |
4228 | |
4229 | const gchar *cIconThemePath = NULL; |
4230 | v = g_hash_table_lookup (hProps, "IconThemePath"); |
4231 | @@ -424,7 +424,7 @@ |
4232 | { |
4233 | cIconThemePath = g_value_get_string (v); |
4234 | } |
4235 | - g_print (" IconThemePath '%s'\n", cIconThemePath); |
4236 | + //g_print (" IconThemePath '%s'\n", cIconThemePath); |
4237 | |
4238 | const gchar *cAttentionIconName = NULL; |
4239 | v = g_hash_table_lookup (hProps, "AttentionIconName"); // -> keep for demands of attention |
4240 | @@ -432,7 +432,7 @@ |
4241 | { |
4242 | cAttentionIconName = g_value_get_string (v); |
4243 | } |
4244 | - g_print (" AttentionIconName '%s'\n", cAttentionIconName); |
4245 | + //g_print (" AttentionIconName '%s'\n", cAttentionIconName); |
4246 | |
4247 | // properties supported by Ubuntu. |
4248 | const gchar *cMenuPath = NULL; |
4249 | @@ -441,7 +441,7 @@ |
4250 | { |
4251 | cMenuPath = (gchar*) g_value_get_boxed (v); |
4252 | } |
4253 | - g_print (" cMenuPath '%s'\n", cMenuPath); |
4254 | + //g_print (" cMenuPath '%s'\n", cMenuPath); |
4255 | |
4256 | const gchar *cLabel = NULL; |
4257 | v = g_hash_table_lookup (hProps, "XAyatanaLabel"); |
4258 | @@ -449,7 +449,7 @@ |
4259 | { |
4260 | cLabel = g_value_get_string (v); |
4261 | } |
4262 | - g_print (" cLabel '%s'\n", cLabel); |
4263 | + //g_print (" cLabel '%s'\n", cLabel); |
4264 | |
4265 | const gchar *cLabelGuide = NULL; |
4266 | v = g_hash_table_lookup (hProps, "XAyatanaLabelGuide"); |
4267 | @@ -457,7 +457,7 @@ |
4268 | { |
4269 | cLabelGuide = g_value_get_string (v); |
4270 | } |
4271 | - g_print (" cLabelGuide '%s'\n", cLabelGuide); |
4272 | + //g_print (" cLabelGuide '%s'\n", cLabelGuide); |
4273 | |
4274 | // properties supported by KDE. |
4275 | const gchar *cTitle = NULL; |
4276 | @@ -466,7 +466,7 @@ |
4277 | { |
4278 | cTitle = g_value_get_string (v); |
4279 | } |
4280 | - g_print (" Title '%s\n", cTitle); |
4281 | + //g_print (" Title '%s\n", cTitle); |
4282 | |
4283 | v = g_hash_table_lookup (hProps, "WindowId"); |
4284 | guint iWindowId = 0; |
4285 | @@ -474,7 +474,7 @@ |
4286 | { |
4287 | iWindowId = g_value_get_uint (v); |
4288 | } |
4289 | - g_print (" WindowId '%d'\n", iWindowId); |
4290 | + //g_print (" WindowId '%d'\n", iWindowId); |
4291 | |
4292 | const gchar *cOverlayIconName = NULL; |
4293 | v = g_hash_table_lookup (hProps, "OverlayIconName"); // -> emblem |
4294 | @@ -482,7 +482,7 @@ |
4295 | { |
4296 | cOverlayIconName = g_value_get_string (v); |
4297 | } |
4298 | - g_print (" OverlayIconName '%s'\n", cOverlayIconName); |
4299 | + //g_print (" OverlayIconName '%s'\n", cOverlayIconName); |
4300 | |
4301 | const gchar *cAttentionMovieName = NULL; |
4302 | v = g_hash_table_lookup (hProps, "AttentionMovieName"); // -> idem |
4303 | @@ -490,7 +490,7 @@ |
4304 | { |
4305 | cAttentionMovieName = g_value_get_string (v); |
4306 | } |
4307 | - g_print (" AttentionMovieName '%s'\n", cAttentionMovieName); |
4308 | + //g_print (" AttentionMovieName '%s'\n", cAttentionMovieName); |
4309 | |
4310 | GValueArray *pToolTipTab = NULL; |
4311 | v = g_hash_table_lookup (hProps, "ToolTip"); |
4312 | @@ -532,15 +532,9 @@ |
4313 | { |
4314 | cd_satus_notifier_add_theme_path (pItem->cIconThemePath); |
4315 | } |
4316 | - /*if (myConfig.bCompactMode && myData.iItemSize != 0 && pItem->iStatus != CD_STATUS_PASSIVE) |
4317 | - { |
4318 | - gchar *cIconPath = cd_satus_notifier_search_item_icon_s_path (pItem); |
4319 | - if (cIconPath != NULL) |
4320 | - { |
4321 | - pItem->pSurface = cairo_dock_create_surface_from_icon (cIconPath, myData.iItemSize, myData.iItemSize); |
4322 | - g_free (cIconPath); |
4323 | - } |
4324 | - }*/ |
4325 | + |
4326 | + if (pItem->cMenuPath != NULL) |
4327 | + pItem->pMenu = dbusmenu_gtkmenu_new ((gchar *)pItem->cService, (gchar *)pItem->cMenuPath); |
4328 | |
4329 | //\_________________ track any changes in the item. |
4330 | // signals supported by both. |
4331 | |
4332 | === modified file 'Status-Notifier/src/applet-notifications.c' |
4333 | --- Status-Notifier/src/applet-notifications.c 2010-09-07 00:39:20 +0000 |
4334 | +++ Status-Notifier/src/applet-notifications.c 2010-10-02 18:13:46 +0000 |
4335 | @@ -39,7 +39,7 @@ |
4336 | *x = pContainer->iWindowPositionY + (pContainer->bDirectionUp ? 0 : pContainer->iHeight); |
4337 | *y = pContainer->iWindowPositionX + pIcon->fDrawX + pIcon->fWidth * pIcon->fScale/2; |
4338 | } |
4339 | - g_print ("click position : %d;%d\n", *x, *y); |
4340 | + //g_print ("click position : %d;%d\n", *x, *y); |
4341 | } |
4342 | static inline gboolean _emit_click (CDStatusNotifierItem *pItem, Icon *pIcon, CairoContainer *pContainer, const gchar *cSignal) |
4343 | { |
4344 | @@ -54,7 +54,7 @@ |
4345 | G_TYPE_INVALID); |
4346 | if (erreur != NULL) |
4347 | { |
4348 | - g_print ("method %s failed (%s)\n", cSignal, erreur->message); |
4349 | + //g_print ("method %s failed (%s)\n", cSignal, erreur->message); |
4350 | g_error_free (erreur); |
4351 | return FALSE; |
4352 | } |
4353 | @@ -84,13 +84,12 @@ |
4354 | |
4355 | CD_APPLET_ON_CLICK_BEGIN |
4356 | CDStatusNotifierItem *pItem = _get_item (CD_APPLET_CLICKED_ICON, CD_APPLET_CLICKED_CONTAINER); |
4357 | + //g_print ("click on item '%s'\n", pItem?pItem->cService:"none"); |
4358 | if (pItem != NULL) |
4359 | { |
4360 | gboolean r = _emit_click (pItem, CD_APPLET_CLICKED_ICON, CD_APPLET_CLICKED_CONTAINER, "Activate"); |
4361 | if (!r) |
4362 | { |
4363 | - CDStatusNotifierItem *pItem = cd_satus_notifier_get_item_from_icon (CD_APPLET_CLICKED_ICON); |
4364 | - g_return_val_if_fail (pItem != NULL, CAIRO_DOCK_LET_PASS_NOTIFICATION); |
4365 | if (pItem->cId != NULL) |
4366 | { |
4367 | cairo_dock_launch_command (pItem->cId); // lancer une nouvelle fois l'appli montre sa fenetre (enfin, generalement). |
4368 | @@ -121,7 +120,7 @@ |
4369 | G_TYPE_INVALID); |
4370 | if (erreur != NULL) |
4371 | { |
4372 | - g_print ("method %s failed (%s)\n", "Scroll", erreur->message); |
4373 | + //g_print ("method %s failed (%s)\n", "Scroll", erreur->message); |
4374 | g_error_free (erreur); |
4375 | } |
4376 | } |
4377 | @@ -173,7 +172,7 @@ |
4378 | if (pItemData != NULL && pItemData->pToolTip != NULL) |
4379 | { |
4380 | myDialogs.dialogTextDescription.bUseMarkup = TRUE; |
4381 | - g_print ("pItemData->pToolTip->cMessage : %s\n", pItemData->pToolTip->cMessage); |
4382 | + //g_print ("pItemData->pToolTip->cMessage : %s\n", pItemData->pToolTip->cMessage); |
4383 | gchar *cText = g_strdup_printf ("<b>%s</b>\n%s", pItemData->pToolTip->cTitle, pItemData->pToolTip->cMessage); |
4384 | gchar *cIconPath = NULL; |
4385 | if (pItemData->pToolTip->cIconName) |
4386 | |
4387 | === modified file 'System-Monitor/src/applet-config.c' |
4388 | --- System-Monitor/src/applet-config.c 2010-08-07 01:43:25 +0000 |
4389 | +++ System-Monitor/src/applet-config.c 2010-10-02 18:13:46 +0000 |
4390 | @@ -48,12 +48,6 @@ |
4391 | CD_CONFIG_GET_COLOR_RVB ("Configuration", "high color", myConfig.fHigholor); |
4392 | CD_CONFIG_GET_COLOR ("Configuration", "bg color", myConfig.fBgColor); |
4393 | |
4394 | - /*myConfig.fAlpha = CD_CONFIG_GET_DOUBLE ("Configuration", "watermark alpha"); |
4395 | - if (myConfig.fAlpha != 0) |
4396 | - { |
4397 | - myConfig.cWatermarkImagePath = CD_CONFIG_GET_FILE_PATH ("Configuration", "watermark image", MY_APPLET_ICON_FILE); |
4398 | - }*/ |
4399 | - |
4400 | myConfig.iLowerLimit = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("Configuration", "llt", 50); |
4401 | myConfig.iUpperLimit = MAX (myConfig.iLowerLimit+1, CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("Configuration", "ult", 110)); |
4402 | myConfig.iAlertLimit = CD_CONFIG_GET_INTEGER_WITH_DEFAULT ("Configuration", "alt", 100); |
4403 | @@ -102,7 +96,6 @@ |
4404 | g_free (myConfig.cGThemePath); |
4405 | g_free (myConfig.defaultTitle); |
4406 | cairo_dock_free_label_description (myConfig.pTopTextDescription); |
4407 | - g_free (myConfig.cWatermarkImagePath); |
4408 | g_free (myConfig.cSystemMonitorCommand); |
4409 | g_free (myConfig.cSystemMonitorClass); |
4410 | CD_APPLET_RESET_CONFIG_END |
4411 | |
4412 | === modified file 'System-Monitor/src/applet-struct.h' |
4413 | --- System-Monitor/src/applet-struct.h 2010-08-07 01:43:25 +0000 |
4414 | +++ System-Monitor/src/applet-struct.h 2010-10-02 18:13:46 +0000 |
4415 | @@ -34,6 +34,14 @@ |
4416 | CD_SYSMONITOR_NB_TYPES |
4417 | } CDSysmonitorDisplayType; |
4418 | |
4419 | +typedef struct { |
4420 | + gint iLowerLimit; |
4421 | + gint iUpperLimit; |
4422 | + gint iAlertLimit; |
4423 | + gboolean bAlert; |
4424 | + gboolean bAlertSound; |
4425 | + } CDAlertParam; |
4426 | + |
4427 | struct _AppletConfig { |
4428 | gchar *defaultTitle; |
4429 | gint iCheckInterval; |
4430 | @@ -46,8 +54,6 @@ |
4431 | |
4432 | CairoDockInfoDisplay iInfoDisplay; |
4433 | gchar *cGThemePath; |
4434 | - gchar *cWatermarkImagePath; |
4435 | - gdouble fAlpha; |
4436 | |
4437 | CDSysmonitorDisplayType iDisplayType; |
4438 | CairoDockTypeGraph iGraphType; |
4439 | @@ -108,6 +114,10 @@ |
4440 | gdouble fPrevRamPercent, fPrevSwapPercent; |
4441 | gdouble fGpuTempPercent; |
4442 | gdouble fPrevGpuTempPercent; |
4443 | + gdouble fCpuTempPercent; |
4444 | + gdouble fPrevCpuTempPercent; |
4445 | + gdouble fFanSpeedPercent; |
4446 | + gdouble fPrevFanSpeedPercent; |
4447 | gboolean bNeedsUpdate; |
4448 | gint iTimerCount; |
4449 | // end of shared memory. |
4450 | |
4451 | === modified file 'clock/src/CMakeLists.txt' |
4452 | --- clock/src/CMakeLists.txt 2010-08-07 01:43:25 +0000 |
4453 | +++ clock/src/CMakeLists.txt 2010-10-02 18:13:46 +0000 |
4454 | @@ -4,9 +4,10 @@ |
4455 | SET(cd-clock_LIB_SRCS |
4456 | applet-struct.h |
4457 | applet-init.c applet-init.h |
4458 | - applet-draw.c applet-draw.h |
4459 | applet-config.c applet-config.h |
4460 | applet-notifications.c applet-notifications.h |
4461 | + applet-draw.c applet-draw.h |
4462 | + applet-timer.c applet-timer.h |
4463 | applet-theme.c applet-theme.h |
4464 | applet-calendar.c applet-calendar.h |
4465 | applet-task-editor.c applet-task-editor.h |
4466 | |
4467 | === modified file 'clock/src/applet-backend-default.c' |
4468 | --- clock/src/applet-backend-default.c 2010-08-07 01:43:25 +0000 |
4469 | +++ clock/src/applet-backend-default.c 2010-10-02 18:13:46 +0000 |
4470 | @@ -45,46 +45,72 @@ |
4471 | } |
4472 | gchar *cFile = g_strdup_printf ("%s/%s", cDirPath, "tasks.conf"); |
4473 | GKeyFile *pKeyFile = cairo_dock_open_key_file (cFile); |
4474 | - g_free (cFile); |
4475 | + |
4476 | g_free (cDirPath); |
4477 | if (pKeyFile == NULL) // encore aucune taches. |
4478 | + { |
4479 | + g_free (cFile); |
4480 | return NULL; |
4481 | + } |
4482 | |
4483 | gsize length=0; |
4484 | gchar **pGroupList = g_key_file_get_groups (pKeyFile, &length); |
4485 | if (pGroupList == NULL) |
4486 | { |
4487 | g_key_file_free (pKeyFile); |
4488 | + g_free (cFile); |
4489 | return NULL; |
4490 | } |
4491 | |
4492 | CDClockTask *pTask; |
4493 | gchar *cTaskID; |
4494 | GList *pTaskList = NULL; |
4495 | + guint iMonth = myData.currentTime.tm_mon; |
4496 | + guint iYear = myData.currentTime.tm_year + 1900; |
4497 | + guint y, m, freq; |
4498 | + gboolean bUpdateFile = FALSE; |
4499 | guint i; |
4500 | for (i = 0; i < length; i ++) |
4501 | { |
4502 | cTaskID = pGroupList[i]; |
4503 | + |
4504 | + // discard tasks older than 1 year (clean the file too). |
4505 | + y = g_key_file_get_integer (pKeyFile, cTaskID, "year", NULL); |
4506 | + m = g_key_file_get_integer (pKeyFile, cTaskID, "month", NULL); |
4507 | + freq = g_key_file_get_integer (pKeyFile, cTaskID, "freq", NULL); |
4508 | + if (freq == CD_TASK_DONT_REPEAT && (iYear < y -1 || iYear == y - 1 && iMonth < m)) |
4509 | + { |
4510 | + g_key_file_remove_group (pKeyFile, cTaskID, NULL); |
4511 | + bUpdateFile = TRUE; |
4512 | + g_free (cTaskID); |
4513 | + continue; |
4514 | + } |
4515 | + |
4516 | + // append the task. |
4517 | pTask = g_new0 (CDClockTask, 1); |
4518 | - //g_print ("+ task %s\n", cTaskID); |
4519 | - |
4520 | pTask->cID = cTaskID; |
4521 | pTask->iDay = g_key_file_get_integer (pKeyFile, cTaskID, "day", NULL); |
4522 | - pTask->iMonth = g_key_file_get_integer (pKeyFile, cTaskID, "month", NULL); |
4523 | - pTask->iYear = g_key_file_get_integer (pKeyFile, cTaskID, "year", NULL); |
4524 | + pTask->iMonth = m; |
4525 | + pTask->iYear = y; |
4526 | pTask->cTitle = g_key_file_get_string (pKeyFile, cTaskID, "title", NULL); |
4527 | pTask->cText = g_key_file_get_string (pKeyFile, cTaskID, "text", NULL); |
4528 | pTask->cTags = g_key_file_get_string (pKeyFile, cTaskID, "tags", NULL); |
4529 | pTask->iHour = g_key_file_get_integer (pKeyFile, cTaskID, "hour", NULL); |
4530 | pTask->iMinute = g_key_file_get_integer (pKeyFile, cTaskID, "minute", NULL); |
4531 | - pTask->iFrequency = g_key_file_get_integer (pKeyFile, cTaskID, "freq", NULL); |
4532 | + pTask->iFrequency = freq; |
4533 | + pTask->bAcknowledged = g_key_file_get_boolean (pKeyFile, cTaskID, "ack", NULL); |
4534 | |
4535 | pTaskList = g_list_prepend (pTaskList, pTask); |
4536 | s_iCounter = MAX (s_iCounter, atoi (cTaskID)); |
4537 | } |
4538 | |
4539 | g_free (pGroupList); // les elements sont les IDs et sont integres dans les taches. |
4540 | + |
4541 | + if (bUpdateFile) |
4542 | + cairo_dock_write_keys_to_file (pKeyFile, cFile); |
4543 | + |
4544 | g_key_file_free (pKeyFile); |
4545 | + g_free (cFile); |
4546 | return pTaskList; |
4547 | } |
4548 | |
4549 | @@ -107,6 +133,7 @@ |
4550 | g_key_file_set_integer (pKeyFile, pTask->cID, "hour", pTask->iHour); |
4551 | g_key_file_set_integer (pKeyFile, pTask->cID, "minute", pTask->iMinute); |
4552 | g_key_file_set_integer (pKeyFile, pTask->cID, "freq", pTask->iFrequency); |
4553 | + g_key_file_set_boolean (pKeyFile, pTask->cID, "ack", pTask->bAcknowledged); |
4554 | |
4555 | cairo_dock_write_keys_to_file (pKeyFile, cFile); |
4556 | g_free (cFile); |
4557 | @@ -143,6 +170,7 @@ |
4558 | g_key_file_set_integer (pKeyFile, pTask->cID, "hour", pTask->iHour); |
4559 | g_key_file_set_integer (pKeyFile, pTask->cID, "minute", pTask->iMinute); |
4560 | g_key_file_set_integer (pKeyFile, pTask->cID, "freq", pTask->iFrequency); |
4561 | + g_key_file_set_boolean (pKeyFile, pTask->cID, "ack", pTask->bAcknowledged); |
4562 | |
4563 | cairo_dock_write_keys_to_file (pKeyFile, cFile); |
4564 | g_free (cFile); |
4565 | |
4566 | === modified file 'clock/src/applet-backend-ical.c' |
4567 | --- clock/src/applet-backend-ical.c 2010-08-07 01:43:25 +0000 |
4568 | +++ clock/src/applet-backend-ical.c 2010-10-02 18:13:46 +0000 |
4569 | @@ -173,7 +173,7 @@ |
4570 | pTask->iYear = liCalStartDate.year; |
4571 | pTask->iHour = liCalStartDate.hour; |
4572 | pTask->iMinute = liCalStartDate.minute; |
4573 | - |
4574 | + |
4575 | pTask->iFrequency = CD_TASK_DONT_REPEAT; |
4576 | // TODO: really do the frequency management. If possible. |
4577 | icalproperty *rrule = NULL; |
4578 | @@ -191,6 +191,8 @@ |
4579 | pTask->cText = g_strdup(icalcomponent_get_description(piCalComponent)); |
4580 | pTask->cTags = g_strdup(icalcomponent_get_comment(piCalComponent)); |
4581 | |
4582 | + pTask->bAcknowledged = TRUE; /// a recuperer si possible ... |
4583 | + |
4584 | pTaskList = g_list_prepend (pTaskList, pTask); |
4585 | } |
4586 | |
4587 | @@ -293,7 +295,7 @@ |
4588 | |
4589 | static gboolean delete_task (CDClockTask *pTask, CairoDockModuleInstance *myApplet) |
4590 | { |
4591 | - g_print ("%s (%s)\n", __func__, pTask->cTitle); |
4592 | + //g_print ("%s (%s)\n", __func__, pTask->cTitle); |
4593 | |
4594 | if( !_assert_data() ) return FALSE; |
4595 | if( pTask == NULL ) return FALSE; |
4596 | @@ -314,7 +316,7 @@ |
4597 | |
4598 | static gboolean update_task (CDClockTask *pTask, CairoDockModuleInstance *myApplet) |
4599 | { |
4600 | - g_print ("%s (%s, '%s')\n", __func__, pTask->cTitle, pTask->cText); |
4601 | + //g_print ("%s (%s, '%s')\n", __func__, pTask->cTitle, pTask->cText); |
4602 | //if( !delete_task (pTask, myApplet) ) return FALSE; |
4603 | if( !create_task (pTask, myApplet) ) return FALSE; |
4604 | |
4605 | |
4606 | === modified file 'clock/src/applet-calendar.c' |
4607 | --- clock/src/applet-calendar.c 2010-08-07 01:43:25 +0000 |
4608 | +++ clock/src/applet-calendar.c 2010-10-02 18:13:46 +0000 |
4609 | @@ -131,6 +131,7 @@ |
4610 | void cd_clock_remove_task_from_list (CDClockTask *pTask, CairoDockModuleInstance *myApplet) |
4611 | { |
4612 | myData.pTasks = g_list_remove (myData.pTasks, pTask); |
4613 | + myData.pMissedTasks = g_list_remove (myData.pMissedTasks, pTask); |
4614 | myData.pNextTask = cd_clock_get_next_scheduled_task (myApplet); |
4615 | myData.pNextAnniversary = cd_clock_get_next_anniversary (myApplet); |
4616 | } |
4617 | @@ -154,8 +155,10 @@ |
4618 | { |
4619 | g_list_foreach (myData.pTasks, (GFunc)cd_clock_free_task, NULL); |
4620 | g_list_free (myData.pTasks); |
4621 | + g_list_free (myData.pMissedTasks); |
4622 | myData.pTasks = NULL; |
4623 | myData.pNextTask = NULL; |
4624 | + myData.pMissedTasks = NULL; |
4625 | } |
4626 | |
4627 | CDClockTask *cd_clock_get_task_by_id (const gchar *cID, CairoDockModuleInstance *myApplet) |
4628 | @@ -384,6 +387,94 @@ |
4629 | } |
4630 | |
4631 | |
4632 | +GList *cd_clock_get_missed_tasks (CairoDockModuleInstance *myApplet) |
4633 | +{ |
4634 | + GList *pTaskList = NULL; |
4635 | + guint iDay = myData.currentTime.tm_mday; |
4636 | + guint iMonth = myData.currentTime.tm_mon; |
4637 | + guint iYear = myData.currentTime.tm_year + 1900; |
4638 | + guint iHour = myData.currentTime.tm_hour; |
4639 | + guint iMinute = myData.currentTime.tm_min; |
4640 | + |
4641 | + GDate* pCurrentDate = g_date_new_dmy (iDay, iMonth + 1, iYear); |
4642 | + GDate* pDate = g_date_new (); |
4643 | + guint d, m, y; |
4644 | + int iDelta; |
4645 | + CDClockTask *pTask; |
4646 | + GList *t; |
4647 | + for (t = myData.pTasks; t != NULL; t = t->next) |
4648 | + { |
4649 | + pTask = t->data; |
4650 | + if (pTask->bAcknowledged) |
4651 | + continue; |
4652 | + |
4653 | + switch (pTask->iFrequency) |
4654 | + { |
4655 | + case CD_TASK_DONT_REPEAT: |
4656 | + default: |
4657 | + d = pTask->iDay; |
4658 | + m = pTask->iMonth+1; |
4659 | + y = pTask->iYear; |
4660 | + g_date_set_dmy (pDate, d, m, y); |
4661 | + iDelta = g_date_days_between (pCurrentDate, pDate); |
4662 | + break; |
4663 | + |
4664 | + case CD_TASK_EACH_MONTH: |
4665 | + d = pTask->iDay; |
4666 | + m = iMonth+1; |
4667 | + y = iYear; |
4668 | + g_date_set_dmy (pDate, d, m, y); |
4669 | + iDelta = g_date_days_between (pCurrentDate, pDate); |
4670 | + if (iDelta > 0) // pDate est apres pCurrentDate => on teste le mois d'avant. |
4671 | + { |
4672 | + if (iMonth > 0) |
4673 | + { |
4674 | + m = iMonth; |
4675 | + g_date_set_dmy (pDate, d, m, y); |
4676 | + } |
4677 | + else |
4678 | + { |
4679 | + m = 12; |
4680 | + y = pTask->iYear - 1; |
4681 | + g_date_set_dmy (pDate, d, m, y); |
4682 | + } |
4683 | + iDelta = g_date_days_between (pCurrentDate, pDate); |
4684 | + } |
4685 | + break; |
4686 | + |
4687 | + case CD_TASK_EACH_YEAR: |
4688 | + d = pTask->iDay; |
4689 | + m = pTask->iMonth+1; |
4690 | + y = iYear; |
4691 | + g_date_set_dmy (pDate, d, m, y); |
4692 | + iDelta = g_date_days_between (pCurrentDate, pDate); |
4693 | + //g_print ("iDelta : %d/%d/%d -> %d (%s)\n", d, m, y, iDelta, pTask->cTitle); |
4694 | + if (iDelta > 0) // pDate est apres pCurrentDate => on teste l'annee d'avant. |
4695 | + { |
4696 | + y = iYear - 1; |
4697 | + g_date_set_dmy (pDate, d, m, y); |
4698 | + iDelta = g_date_days_between (pCurrentDate, pDate); |
4699 | + } |
4700 | + break; |
4701 | + } |
4702 | + |
4703 | + if (iDelta <= 0 && iDelta > -7) |
4704 | + { |
4705 | + if (iDelta == 0) // today's task, check time |
4706 | + { |
4707 | + if (pTask->iHour > iHour || (pTask->iHour == iHour && pTask->iMinute > iMinute)) // it's in the future, skip it. |
4708 | + continue; |
4709 | + } |
4710 | + pTaskList = g_list_prepend (pTaskList, pTask); |
4711 | + } // on n'arrete pas le parcours si iDelta > 7 pour prendre en compte aussi les anniv. |
4712 | + } |
4713 | + g_date_free (pCurrentDate); |
4714 | + g_date_free (pDate); |
4715 | + |
4716 | + return pTaskList; |
4717 | +} |
4718 | + |
4719 | + |
4720 | ////////////// |
4721 | // CALENDAR // |
4722 | ////////////// |
4723 | |
4724 | === modified file 'clock/src/applet-calendar.h' |
4725 | --- clock/src/applet-calendar.h 2010-08-07 01:43:25 +0000 |
4726 | +++ clock/src/applet-calendar.h 2010-10-02 18:13:46 +0000 |
4727 | @@ -52,6 +52,8 @@ |
4728 | |
4729 | CDClockTask *cd_clock_get_next_anniversary (CairoDockModuleInstance *myApplet); |
4730 | |
4731 | +GList *cd_clock_get_missed_tasks (CairoDockModuleInstance *myApplet); |
4732 | + |
4733 | |
4734 | void cd_clock_update_calendar_marks (CairoDockModuleInstance *myApplet); |
4735 | |
4736 | |
4737 | === modified file 'clock/src/applet-config.c' |
4738 | --- clock/src/applet-config.c 2010-09-07 00:39:20 +0000 |
4739 | +++ clock/src/applet-config.c 2010-10-02 18:13:46 +0000 |
4740 | @@ -24,6 +24,7 @@ |
4741 | #include "applet-draw.h" |
4742 | #include "applet-theme.h" |
4743 | #include "applet-calendar.h" |
4744 | +#include "applet-timer.h" |
4745 | #include "applet-config.h" |
4746 | |
4747 | #define CD_CLOCK_TIMEZONE_DIR "/usr/share/zoneinfo" |
4748 | |
4749 | === modified file 'clock/src/applet-draw.c' |
4750 | --- clock/src/applet-draw.c 2010-09-07 00:39:20 +0000 |
4751 | +++ clock/src/applet-draw.c 2010-10-02 18:13:46 +0000 |
4752 | @@ -24,383 +24,19 @@ |
4753 | #include <math.h> |
4754 | |
4755 | #include "applet-struct.h" |
4756 | -#include "applet-config.h" |
4757 | -#include "applet-digital.h" //Digital html like renderer |
4758 | -#include "applet-calendar.h" |
4759 | +//#include "applet-digital.h" //Digital html like renderer |
4760 | #include "applet-draw.h" |
4761 | |
4762 | #define CD_CLOCK_DATE_BUFFER_LENGTH 50 |
4763 | static char s_cDateBuffer[CD_CLOCK_DATE_BUFFER_LENGTH+1]; |
4764 | |
4765 | - |
4766 | -void cd_clock_free_alarm (CDClockAlarm *pAlarm) |
4767 | -{ |
4768 | - g_free (pAlarm->cMessage); |
4769 | - g_free (pAlarm); |
4770 | -} |
4771 | - |
4772 | -static void _set_warning_repetition (int iClickedButton, GtkWidget *pInteractiveWidget, CDClockTask *pTask, CairoDialog *pDialog); |
4773 | -static gboolean _task_warning (CDClockTask *pTask, const gchar *cMessage) |
4774 | -{ |
4775 | - cd_debug ("%s (%s)", __func__, cMessage); |
4776 | - CairoDockModuleInstance *myApplet = pTask->pApplet; |
4777 | - |
4778 | - GtkWidget *pScale = gtk_hscale_new_with_range (1, 60, 1); // 1mn-60mn et 1 cran/mn. |
4779 | - gtk_scale_set_digits (GTK_SCALE (pScale), 0); |
4780 | - gtk_range_set_value (GTK_RANGE (pScale), pTask->iWarningDelay != 0 ? pTask->iWarningDelay : 15); // 15mn par defaut. |
4781 | - gtk_widget_set (pScale, "width-request", CAIRO_DIALOG_MIN_SCALE_WIDTH, NULL); |
4782 | - |
4783 | - GtkWidget *pExtendedWidget = gtk_hbox_new (FALSE, 0); |
4784 | - GtkWidget *label = gtk_label_new (D_("1mn")); |
4785 | - GtkWidget *pAlign = gtk_alignment_new (1., 1., 0., 0.); |
4786 | - gtk_container_add (GTK_CONTAINER (pAlign), label); |
4787 | - gtk_box_pack_start (GTK_BOX (pExtendedWidget), pAlign, FALSE, FALSE, 0); |
4788 | - gtk_box_pack_start (GTK_BOX (pExtendedWidget), pScale, FALSE, FALSE, 0); |
4789 | - label = gtk_label_new (D_("1h")); |
4790 | - pAlign = gtk_alignment_new (1., 1., 0., 0.); |
4791 | - gtk_container_add (GTK_CONTAINER (pAlign), label); |
4792 | - gtk_box_pack_start (GTK_BOX (pExtendedWidget), pAlign, FALSE, FALSE, 0); |
4793 | - |
4794 | - cairo_dock_dialog_unreference (pTask->pWarningDialog); |
4795 | - myDialogs.dialogTextDescription.bUseMarkup = TRUE; |
4796 | - pTask->pWarningDialog = cairo_dock_show_dialog_full (cMessage, |
4797 | - myIcon, myContainer, |
4798 | - (pTask->iWarningDelay != 0 ? MIN (pTask->iWarningDelay-.1, 15.) : 15) * 60e3, // on laisse le dialogue visible le plus longtemps possible, jusqu'a 15mn. |
4799 | - MY_APPLET_SHARE_DATA_DIR"/icon-task.png", |
4800 | - pExtendedWidget, |
4801 | - (CairoDockActionOnAnswerFunc) _set_warning_repetition, |
4802 | - pTask, |
4803 | - NULL); |
4804 | - myDialogs.dialogTextDescription.bUseMarkup = FALSE; |
4805 | - |
4806 | - CD_APPLET_DEMANDS_ATTENTION (NULL, 3600); // ~ 1h, pour si on loupe le dialogue. |
4807 | - return TRUE; |
4808 | -} |
4809 | -static gboolean _task_warning_repeat (CDClockTask *pTask, const gchar *cMessage) |
4810 | -{ |
4811 | - gchar *cText = g_strdup_printf ("%s %d:%02d\n<b>%s</b>\n %s\n\n%s", |
4812 | - D_("The following task was scheduled at"), pTask->iHour, pTask->iMinute, |
4813 | - pTask->cTitle?pTask->cTitle:D_("No title"), |
4814 | - pTask->cText?pTask->cText:"", |
4815 | - D_("Repeat this message every:")); |
4816 | - _task_warning (pTask, cText); |
4817 | - g_free (cText); |
4818 | - return TRUE; |
4819 | -} |
4820 | -static void _set_warning_repetition (int iClickedButton, GtkWidget *pInteractiveWidget, CDClockTask *pTask, CairoDialog *pDialog) |
4821 | -{ |
4822 | - cd_debug ("%s (%d)", __func__, iClickedButton); |
4823 | - GList *cl = gtk_container_get_children (GTK_CONTAINER (pInteractiveWidget)); |
4824 | - g_return_if_fail (cl != NULL && cl->next != NULL); |
4825 | - GtkWidget *pScale = cl->next->data; |
4826 | - g_return_if_fail (pScale != NULL); |
4827 | - |
4828 | - int dt = gtk_range_get_value (GTK_RANGE (pScale)); |
4829 | - if (dt == 0 || (iClickedButton != 0 && iClickedButton != -1)) |
4830 | - { |
4831 | - if (pTask->iSidWarning != 0) |
4832 | - { |
4833 | - g_source_remove (pTask->iSidWarning); |
4834 | - pTask->iSidWarning = 0; |
4835 | - } |
4836 | - } |
4837 | - else |
4838 | - { |
4839 | - if (pTask->iSidWarning != 0 && dt != pTask->iWarningDelay) |
4840 | - { |
4841 | - g_source_remove (pTask->iSidWarning); |
4842 | - pTask->iSidWarning = 0; |
4843 | - } |
4844 | - if (pTask->iSidWarning == 0) |
4845 | - { |
4846 | - pTask->iSidWarning = g_timeout_add_seconds (dt*60, (GSourceFunc) _task_warning_repeat, pTask); |
4847 | - pTask->iWarningDelay = dt; |
4848 | - } |
4849 | - } |
4850 | - pTask->pWarningDialog = NULL; |
4851 | - CairoDockModuleInstance *myApplet = pTask->pApplet; |
4852 | - CD_APPLET_STOP_DEMANDING_ATTENTION; |
4853 | -} |
4854 | - |
4855 | -static inline void _get_current_time (time_t epoch, CairoDockModuleInstance *myApplet) |
4856 | -{ |
4857 | - if (myConfig.cLocation != NULL) |
4858 | - { |
4859 | - g_setenv ("TZ", myConfig.cLocation, TRUE); |
4860 | - tzset (); |
4861 | - } |
4862 | - localtime_r (&epoch, &myData.currentTime); |
4863 | - if (myConfig.cLocation != NULL) |
4864 | - { |
4865 | - if (myData.cSystemLocation != NULL) |
4866 | - g_setenv ("TZ", myData.cSystemLocation, TRUE); |
4867 | - else |
4868 | - g_unsetenv ("TZ"); |
4869 | - } |
4870 | -} |
4871 | - |
4872 | -void cd_clock_init_time (CairoDockModuleInstance *myApplet) |
4873 | -{ |
4874 | - time_t epoch = (time_t) time (NULL); |
4875 | - _get_current_time (epoch, myApplet); |
4876 | -} |
4877 | - |
4878 | -gboolean cd_clock_update_with_time (CairoDockModuleInstance *myApplet) |
4879 | -{ |
4880 | - CD_APPLET_ENTER; |
4881 | - //\________________ On recupere l'heure courante. |
4882 | - time_t epoch = (time_t) time (NULL); |
4883 | - _get_current_time (epoch, myApplet); |
4884 | - |
4885 | - //\________________ On change la date si necessaire. |
4886 | - int iWidth, iHeight; |
4887 | - CD_APPLET_GET_MY_ICON_EXTENT (&iWidth, &iHeight); |
4888 | - gboolean bNewDate = (myData.currentTime.tm_mday != myData.iLastCheckedDay || myData.currentTime.tm_mon != myData.iLastCheckedMonth || myData.currentTime.tm_year != myData.iLastCheckedYear); |
4889 | - if (bNewDate) |
4890 | - { |
4891 | - strftime (s_cDateBuffer, CD_CLOCK_DATE_BUFFER_LENGTH, "%a %d %b", &myData.currentTime); |
4892 | - myData.iLastCheckedDay = myData.currentTime.tm_mday; |
4893 | - myData.iLastCheckedMonth = myData.currentTime.tm_mon; |
4894 | - myData.iLastCheckedYear = myData.currentTime.tm_year; |
4895 | - } |
4896 | - if (CD_APPLET_MY_CONTAINER_IS_OPENGL && myConfig.bOldStyle && myConfig.iShowDate == CAIRO_DOCK_INFO_ON_ICON) |
4897 | - { |
4898 | - if (bNewDate || myData.iDateTexture == 0) |
4899 | - { |
4900 | - strftime (s_cDateBuffer, CD_CLOCK_DATE_BUFFER_LENGTH, "%a %d %b", &myData.currentTime); |
4901 | - |
4902 | - if (myData.iDateTexture != 0) |
4903 | - _cairo_dock_delete_texture (myData.iDateTexture); |
4904 | - |
4905 | - double fScale = (double) iWidth / (double) myData.DimensionData.width; |
4906 | - CairoDockLabelDescription labelDescription; |
4907 | - labelDescription.iSize = 10; |
4908 | - labelDescription.cFont = (gchar*)"Sans"; // on peut caster car on ne liberera rien. |
4909 | - labelDescription.iWeight = cairo_dock_get_pango_weight_from_1_9 (5); |
4910 | - labelDescription.iStyle = PANGO_STYLE_NORMAL; |
4911 | - labelDescription.fColorStart[0] = myConfig.fDateColor[0]; |
4912 | - labelDescription.fColorStart[1] = myConfig.fDateColor[1]; |
4913 | - labelDescription.fColorStart[2] = myConfig.fDateColor[2]; |
4914 | - memcpy (&labelDescription.fColorStop[0], &labelDescription.fColorStart[0], sizeof (labelDescription.fColorStop)); |
4915 | - labelDescription.fBackgroundColor[3] = 0; |
4916 | - labelDescription.bOutlined = FALSE; |
4917 | - labelDescription.iMargin = 0; |
4918 | - cairo_surface_t *pDateSurface = cairo_dock_create_surface_from_text_full (s_cDateBuffer, |
4919 | - &labelDescription, |
4920 | - fScale, |
4921 | - iWidth, |
4922 | - &myData.iDateWidth, &myData.iDateHeight, |
4923 | - NULL, NULL); |
4924 | - myData.iDateWidth *= fScale; |
4925 | - myData.iDateHeight *= fScale; |
4926 | - //g_print ("date : %dx%d\n", myData.iDateWidth, myData.iDateHeight); |
4927 | - myData.iDateTexture = cairo_dock_create_texture_from_surface (pDateSurface); |
4928 | - cairo_surface_destroy (pDateSurface); |
4929 | - } |
4930 | - } |
4931 | - if (bNewDate && myConfig.iShowDate == CAIRO_DOCK_INFO_ON_LABEL) |
4932 | - { |
4933 | - CD_APPLET_SET_NAME_FOR_MY_ICON (s_cDateBuffer); |
4934 | - } |
4935 | - |
4936 | - //\________________ On dessine avec cette heure. |
4937 | - myData.iSmoothAnimationStep = 0; |
4938 | - if (myConfig.bOldStyle) |
4939 | - { |
4940 | - if (CD_APPLET_MY_CONTAINER_IS_OPENGL) |
4941 | - cd_clock_render_analogic_to_texture (myApplet, iWidth, iHeight, &myData.currentTime, 0.); |
4942 | - else |
4943 | - cd_clock_draw_analogic (myApplet, iWidth, iHeight, &myData.currentTime); |
4944 | - } |
4945 | - else |
4946 | - { |
4947 | - cd_clock_draw_text (myApplet, iWidth, iHeight, &myData.currentTime); |
4948 | - if (CD_APPLET_MY_CONTAINER_IS_OPENGL) // on ne sait pas bien dessiner du texte, donc on le fait en cairo, et on transfere tout sur notre texture. |
4949 | - cairo_dock_update_icon_texture (myIcon); |
4950 | - } |
4951 | - |
4952 | - if (myDock && ! CD_APPLET_MY_CONTAINER_IS_OPENGL) // les reflets pour cairo. |
4953 | - { |
4954 | - CD_APPLET_UPDATE_REFLECT_ON_MY_ICON; |
4955 | - } |
4956 | - |
4957 | - //\________________ On redessine notre icone. |
4958 | - CD_APPLET_REDRAW_MY_ICON; |
4959 | - |
4960 | - //\________________ On teste les alarmes et les taches. |
4961 | - if (!myConfig.bShowSeconds || myData.currentTime.tm_min != myData.iLastCheckedMinute) // un g_timeout de 1min ne s'effectue pas forcement a exectement 1 minute d'intervalle, et donc pourrait "sauter" la minute de l'alarme, d'ou le test sur bShowSeconds dans le cas ou l'applet ne verifie que chaque minute. |
4962 | - { |
4963 | - myData.iLastCheckedMinute = myData.currentTime.tm_min; |
4964 | - |
4965 | - // les alarmes. |
4966 | - CDClockAlarm *pAlarm; |
4967 | - guint i; |
4968 | - for (i = 0; i < myConfig.pAlarms->len; i ++) |
4969 | - { |
4970 | - pAlarm = g_ptr_array_index (myConfig.pAlarms, i); |
4971 | - |
4972 | - if (myData.currentTime.tm_hour == pAlarm->iHour && myData.currentTime.tm_min == pAlarm->iMinute) |
4973 | - { |
4974 | - gboolean bShowAlarm = FALSE, bRemoveAlarm = FALSE; |
4975 | - if (pAlarm->iDayOfWeek > 0) |
4976 | - { |
4977 | - if (pAlarm->iDayOfWeek == 1) |
4978 | - bShowAlarm = TRUE; |
4979 | - else if (pAlarm->iDayOfWeek - 1 == myData.currentTime.tm_wday) |
4980 | - bShowAlarm = TRUE; |
4981 | - else if (myData.currentTime.tm_wday == 0 || myData.currentTime.tm_wday == 6) // week-end |
4982 | - { |
4983 | - if (pAlarm->iDayOfWeek == 9) |
4984 | - bShowAlarm = TRUE; |
4985 | - } |
4986 | - else if (pAlarm->iDayOfWeek == 8) |
4987 | - bShowAlarm = TRUE; |
4988 | - } |
4989 | - else if (pAlarm->iDayOfMonth > 0) |
4990 | - bShowAlarm = (pAlarm->iDayOfMonth - 1 == myData.currentTime.tm_mday); |
4991 | - else // c'est une alarme qui ne se repete pas. |
4992 | - { |
4993 | - bShowAlarm = TRUE; |
4994 | - bRemoveAlarm = TRUE; |
4995 | - } |
4996 | - |
4997 | - if (bShowAlarm) |
4998 | - { |
4999 | - cd_message ("Dring ! %s", pAlarm->cMessage); |
5000 | - cairo_dock_show_temporary_dialog (pAlarm->cMessage, myIcon, myContainer, 60e3); |
resubmit proposal as canonical branch wasn't up to date.
Weirdly, Unmerged revisions doesn't seem to update.