Merge lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.4.0-0beta2 into lp:ubuntu/oneiric/cairo-dock-plug-ins
- Oneiric (11.10)
- 2.4.0-0beta2
- Merge into oneiric
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 21 | ||||||||
Proposed branch: | lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.4.0-0beta2 | ||||||||
Merge into: | lp:ubuntu/oneiric/cairo-dock-plug-ins | ||||||||
Diff against target: |
333793 lines (+140404/-109035) 302 files modified
Animated-icons/data/Animated-icons.conf.in (+1/-1) Animated-icons/src/applet-wobbly.c (+1/-1) CMakeLists.txt (+345/-88) Cairo-Penguin/data/Cairo-Penguin.conf.in (+5/-6) Clipper/data/Clipper.conf.in (+6/-7) Clipper/src/applet-clipboard.c (+3/-0) Composite-Manager/CMakeLists.txt (+2/-0) Composite-Manager/data/CMakeLists.txt (+10/-0) Composite-Manager/data/Composite-Manager.conf.in (+137/-0) Composite-Manager/src/CMakeLists.txt (+39/-0) Composite-Manager/src/applet-composite-manager.c (+535/-0) Composite-Manager/src/applet-composite-manager.h (+46/-0) Composite-Manager/src/applet-config.c (+63/-0) Composite-Manager/src/applet-config.h (+30/-0) Composite-Manager/src/applet-init.c (+73/-0) Composite-Manager/src/applet-init.h (+31/-0) Composite-Manager/src/applet-notifications.c (+170/-0) Composite-Manager/src/applet-notifications.h (+35/-0) Composite-Manager/src/applet-struct.h (+83/-0) Dbus/data/Dbus.conf.in (+1/-1) Dbus/demos/demo_vala/demo_vala.conf (+101/-0) Dbus/interfaces/python/CDApplet.py (+58/-36) Dbus/interfaces/python/CMakeLists.txt (+1/-1) Dbus/interfaces/python/CairoDock.py (+111/-0) Dbus/interfaces/python/setup.py (+1/-1) Dbus/interfaces/vala/CMakeLists.txt (+5/-1) Dbus/src/applet-dbus.c (+67/-30) Dbus/src/dbus-main-spec.h (+425/-182) Dbus/src/dbus_introspectable.xml (+44/-36) Dbus/src/interface-applet-methods.c (+15/-9) Dbus/src/interface-applet-signals.c (+1/-1) Dbus/src/interface-main-methods.c (+1221/-344) Dbus/src/interface-main-methods.h (+36/-26) Disks/data/Disks.conf.in (+14/-24) Disks/src/applet-config.c (+4/-23) Disks/src/applet-config.h (+0/-2) Disks/src/applet-disks.c (+170/-77) Disks/src/applet-disks.h (+3/-0) Disks/src/applet-init.c (+48/-11) Disks/src/applet-struct.h (+4/-0) Doncky/data/Doncky.conf.in (+5/-6) Folders/data/Folders.conf.in (+5/-6) Folders/src/applet-config.c (+2/-2) Folders/src/applet-init.c (+5/-2) Folders/src/applet-notifications.c (+55/-30) Folders/src/applet-struct.h (+1/-1) GMenu/data/CMakeLists.txt (+2/-1) GMenu/data/GMenu.conf.in (+11/-7) GMenu/data/system-log-out.svg (+57/-0) GMenu/data/system-shutdown.svg (+50/-0) GMenu/src/applet-config.c (+1/-0) GMenu/src/applet-init.c (+5/-1) GMenu/src/applet-menu-callbacks.c (+62/-29) GMenu/src/applet-menu.c (+12/-0) GMenu/src/applet-recent.c (+8/-1) GMenu/src/applet-struct.h (+10/-0) Impulse/CMakeLists.txt (+2/-0) Impulse/data/CMakeLists.txt (+11/-0) Impulse/data/Impulse.conf.in (+158/-0) Impulse/data/impulse-error.svg (+713/-0) Impulse/data/impulse-running.svg (+375/-0) Impulse/data/impulse-stopped.svg (+347/-0) Impulse/src/CMakeLists.txt (+43/-0) Impulse/src/Impulse.c (+305/-0) Impulse/src/Impulse.h (+36/-0) Impulse/src/applet-config.c (+58/-0) Impulse/src/applet-config.h (+30/-0) Impulse/src/applet-impulse.c (+328/-0) Impulse/src/applet-impulse.h (+33/-0) Impulse/src/applet-init.c (+138/-0) Impulse/src/applet-init.h (+31/-0) Impulse/src/applet-notifications.c (+58/-0) Impulse/src/applet-notifications.h (+40/-0) Impulse/src/applet-struct.h (+67/-0) MeMenu/data/MeMenu.conf.in (+4/-5) MeMenu/src/applet-init.c (+4/-1) Messaging-Menu/data/Messaging-Menu.conf.in (+5/-6) Messaging-Menu/src/applet-init.c (+4/-1) Messaging-Menu/src/applet-menu.c (+5/-0) Network-Monitor/data/Network-Monitor.conf.in (+4/-5) RSSreader/data/RSSreader.conf.in (+4/-5) RSSreader/src/applet-config.c (+2/-0) RSSreader/src/applet-init.c (+4/-1) Recent-Events/data/Recent-Events.conf.in (+6/-7) Recent-Events/src/applet-dialog.c (+29/-13) Recent-Events/src/applet-search.c (+2/-1) Remote-Control/data/Remote-Control.conf.in (+1/-1) Scooby-Do/data/Scooby-Do.conf.in (+1/-1) Status-Notifier/CMakeLists.txt (+4/-0) Status-Notifier/data/Status-Notifier.conf.in (+8/-6) Status-Notifier/src/CMakeLists.txt (+3/-0) Status-Notifier/src/applet-config.c (+1/-0) Status-Notifier/src/applet-draw.c (+26/-6) Status-Notifier/src/applet-host-ias.c (+523/-0) Status-Notifier/src/applet-host-ias.h (+33/-0) Status-Notifier/src/applet-host-kde.c (+325/-0) Status-Notifier/src/applet-host-kde.h (+30/-0) Status-Notifier/src/applet-host.c (+28/-690) Status-Notifier/src/applet-host.h (+7/-1) Status-Notifier/src/applet-init.c (+1/-1) Status-Notifier/src/applet-item.c (+10/-4) Status-Notifier/src/applet-notifications.c (+43/-23) Status-Notifier/src/applet-struct.h (+3/-0) Status-Notifier/watcher/CMakeLists.txt (+18/-0) Status-Notifier/watcher/org.kde.StatusNotifierWatcher.xml (+42/-0) Status-Notifier/watcher/status-notifier-watcher.py (+131/-0) System-Monitor/data/System-Monitor.conf.in (+5/-6) System-Monitor/src/applet-monitor.c (+6/-6) System-Monitor/src/applet-top.c (+1/-0) Toons/data/Toons.conf.in (+4/-5) Toons/src/applet-init.c (+5/-1) Xgamma/data/Xgamma.conf.in (+4/-5) Xgamma/src/applet-init.c (+1/-0) alsaMixer/data/AlsaMixer.conf.in (+4/-5) alsaMixer/src/applet-init.c (+1/-0) alsaMixer/src/applet-mixer.c (+2/-0) alsaMixer/src/applet-notifications.c (+10/-1) clock/data/clock.conf.in (+6/-5) clock/src/applet-init.c (+1/-0) clock/src/applet-notifications.c (+5/-2) compiz-icon/CMakeLists.txt (+0/-14) compiz-icon/data/0.svg (+0/-264) compiz-icon/data/1.svg (+0/-325) compiz-icon/data/2.svg (+0/-396) compiz-icon/data/3.svg (+0/-2146) compiz-icon/data/4.svg (+0/-1023) compiz-icon/data/CMakeLists.txt (+0/-19) compiz-icon/data/broken.svg (+0/-598) compiz-icon/data/compiz (+0/-21) compiz-icon/data/compiz-icon.conf.in (+0/-184) compiz-icon/data/compiz-kill (+0/-28) compiz-icon/data/default.svg (+0/-278) compiz-icon/data/other.svg (+0/-256) compiz-icon/src/CMakeLists.txt (+0/-89) compiz-icon/src/applet-compiz.c (+0/-169) compiz-icon/src/applet-compiz.h (+0/-42) compiz-icon/src/applet-config.c (+0/-89) compiz-icon/src/applet-config.h (+0/-30) compiz-icon/src/applet-init.c (+0/-103) compiz-icon/src/applet-init.h (+0/-31) compiz-icon/src/applet-load-icon.c (+0/-106) compiz-icon/src/applet-load-icon.h (+0/-32) compiz-icon/src/applet-notifications.c (+0/-204) compiz-icon/src/applet-notifications.h (+0/-35) compiz-icon/src/applet-struct.h (+0/-94) copyright (+7/-0) debian/cairo-dock-plug-ins.install (+1/-0) debian/changelog (+31/-0) debian/control (+10/-6) debian/copyright (+10/-3) debian/patches/01-ubuntuone-fix_upstream-version-2.3.0~2.1.patch (+0/-36) debian/patches/02-weather-fix_upstream-version-2.3.0~2.2.patch (+0/-41) desklet-rendering/data/desklet-rendering.conf.in (+1/-1) desklet-rendering/src/CMakeLists.txt (+1/-60) desklet-rendering/src/rendering-desklet-panel.c (+614/-0) desklet-rendering/src/rendering-desklet-panel.h (+46/-0) desklet-rendering/src/rendering-desklet-slide.c (+0/-3) desklet-rendering/src/rendering-init.c (+5/-3) dialog-rendering/data/dialog-rendering.conf.in (+1/-1) dialog-rendering/src/applet-decorator-tooltip.c (+3/-3) dialog-rendering/src/applet-init.c (+2/-2) dnd2share/data/dnd2share.conf.in (+6/-7) dnd2share/src/applet-backend-ubuntuone.c (+1/-1) dnd2share/src/applet-backend-uppix.c (+1/-1) dnd2share/src/applet-notifications.c (+19/-1) dock-rendering/data/rendering.conf.in (+2/-2) dock-rendering/src/rendering-3D-plane.c (+9/-2) dock-rendering/src/rendering-curve.c (+8/-2) dock-rendering/src/rendering-diapo-simple.c (+89/-8) dock-rendering/src/rendering-init.c (+2/-2) dock-rendering/src/rendering-panel.c (+12/-1) dock-rendering/src/rendering-parabole.c (+5/-2) dock-rendering/src/rendering-rainbow.c (+3/-0) drop-indicator/data/drop_indicator.conf.in (+1/-1) drop-indicator/src/applet-init.c (+1/-1) drop-indicator/src/applet-notifications.c (+170/-163) dustbin/data/dustbin.conf.in (+5/-6) generate-new-applet.sh (+13/-3) gnome-integration-old/src/applet-init.c (+2/-2) gnome-integration/src/applet-init.c (+2/-2) gnome-integration/src/applet-utils.c (+15/-3) gvfs-integration/cairo-dock-gio-vfs.c (+75/-31) icon-effect/data/icon-effect.conf.in (+1/-1) illusion/data/illusion.conf.in (+1/-1) kde-integration/src/applet-init.c (+2/-2) keyboard-indicator/data/keyboard-indicator.conf.in (+5/-6) logout/data/CMakeLists.txt (+12/-3) logout/data/icon-scheduling.svg (+238/-0) logout/data/locked.svg (+60/-0) logout/data/logout.conf.in (+6/-7) logout/data/logout.sh (+22/-0) logout/data/system-guest.svg (+40/-0) logout/data/system-hibernate.svg (+31/-0) logout/data/system-log-out.svg (+57/-0) logout/data/system-restart.svg (+201/-0) logout/data/system-shutdown.svg (+28/-0) logout/data/system-suspend.svg (+142/-0) logout/src/CMakeLists.txt (+11/-49) logout/src/applet-config.c (+1/-0) logout/src/applet-init.c (+12/-6) logout/src/applet-logout.c (+525/-0) logout/src/applet-logout.h (+44/-0) logout/src/applet-notifications.c (+39/-172) logout/src/applet-struct.h (+23/-0) mail/data/mail.conf.in (+5/-6) motion-blur/data/motion_blur.conf.in (+1/-1) musicPlayer/data/musicPlayer.conf.in (+6/-7) musicPlayer/src/applet-audacious.c (+43/-31) musicPlayer/src/applet-init.c (+4/-1) musicPlayer/src/applet-notifications.c (+1/-1) musicPlayer/src/applet-rhythmbox.c (+16/-9) netspeed/data/netspeed.conf.in (+5/-6) po/CMakeLists.txt (+1/-1) po/ar.po (+2762/-3928) po/cairo-dock.pot (+2050/-2136) po/cs.po (+3771/-3956) po/de.po (+4084/-4034) po/el.po (+3746/-3998) po/en_GB.po (+6532/-3879) po/es.po (+5221/-4023) po/et.po (+2938/-3975) po/eu.po (+2783/-3920) po/fr.po (+7175/-3965) po/hu.po (+3520/-3985) po/id.po (+2738/-3920) po/it.po (+7654/-3947) po/ja.po (+6295/-3836) po/nl.po (+7511/-3979) po/pl.po (+2117/-2215) po/pt.po (+4435/-4024) po/pt_BR.po (+6821/-3967) po/ru.po (+6799/-3894) po/sk.po (+6216/-3906) po/sr.po (+2946/-3928) po/sv.po (+4485/-3934) po/tr.po (+3178/-3935) po/uk.po (+6610/-3905) po/zh_CN.po (+4946/-3936) po/zh_TW.po (+5678/-3824) powermanager/data/powermanager.conf.in (+5/-12) powermanager/src/CMakeLists.txt (+14/-56) powermanager/src/powermanager-common.c (+231/-0) powermanager/src/powermanager-common.h (+35/-0) powermanager/src/powermanager-config.c (+4/-3) powermanager/src/powermanager-dbus.c (+517/-483) powermanager/src/powermanager-dbus.h (+6/-6) powermanager/src/powermanager-draw.c (+139/-130) powermanager/src/powermanager-init.c (+40/-63) powermanager/src/powermanager-menu-functions.c (+9/-11) powermanager/src/powermanager-proc-acpi.c (+225/-0) powermanager/src/powermanager-proc-acpi.h (+32/-0) powermanager/src/powermanager-struct.h (+54/-14) powermanager/src/powermanager-sys-class.c (+204/-0) powermanager/src/powermanager-sys-class.h (+32/-0) powermanager/src/powermanager-upower.c (+243/-0) powermanager/src/powermanager-upower.h (+38/-0) quick-browser/data/quick-browser.conf.in (+5/-6) quick-browser/src/applet-init.c (+4/-1) quick-browser/src/applet-menu.c (+6/-0) shared-images/CMakeLists.txt (+9/-0) shared-images/expose-desktops.svg (+894/-0) shared-images/expose-windows.svg (+1478/-0) shared-images/show-desktop.svg (+1127/-0) shared-images/widget-layer.svg (+631/-0) shortcuts/data/shortcuts.conf.in (+6/-7) shortcuts/src/applet-init.c (+1/-4) show-mouse/data/show_mouse.conf.in (+1/-1) showDesktop/data/showDesktop.conf.in (+8/-9) showDesktop/src/applet-notifications.c (+24/-14) slider/data/slider.conf.in (+5/-6) stack/data/stack.conf.in (+6/-7) stack/src/applet-init.c (+2/-4) stack/src/applet-load-icons.c (+21/-13) stack/src/applet-notifications.c (+6/-3) stack/src/applet-stack.c (+18/-1) switcher/data/switcher.conf.in (+4/-5) switcher/src/applet-desktops.c (+31/-12) switcher/src/applet-desktops.h (+2/-2) switcher/src/applet-draw.c (+3/-0) switcher/src/applet-init.c (+32/-52) switcher/src/applet-load-icons.c (+0/-1) switcher/src/applet-notifications.c (+9/-9) switcher/src/applet-struct.h (+1/-1) systray/data/systray.conf.in (+5/-6) systray/src/systray-interface.c (+1/-0) template/data/CMakeLists.txt (+0/-2) template/data/template.conf.in (+5/-6) template/src/CMakeLists.txt (+1/-1) terminal/data/terminal.conf.in (+6/-7) terminal/src/terminal-callbacks.c (+15/-0) terminal/src/terminal-widget.c (+18/-0) tomboy/data/tomboy.conf.in (+5/-6) weather/data/weather.conf.in (+6/-7) weather/src/applet-init.c (+1/-0) weather/src/applet-load-icons.c (+5/-2) weblets/data/weblets.conf.in (+5/-6) wifi/data/wifi.conf.in (+5/-6) xfce-integration/data/CMakeLists.txt (+4/-0) xfce-integration/data/lock-screen.sh (+11/-0) xfce-integration/src/CMakeLists.txt (+1/-1) xfce-integration/src/applet-init.c (+3/-3) xfce-integration/src/applet-utils.c (+3/-3) |
||||||||
To merge this branch: | bzr merge lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.4.0-0beta2 | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Kees Cook | Approve | ||
Review via email: mp+70953@code.launchpad.net |
Commit message
Description of the change
Hello,
The Cairo-Dock team proposes a new version of its Cairo-Dock package.
This is the Upstream (short) ChangeLog:
* Upstream (short) ChangeLog:
- A new Help applet has been added to help our beloved user.
- Improved integration in the XFCE and LXDE desktop.
- Improved the classifying of our files in the source code
and in share/cairo-dock directory.
- Launchers and applications now uses the linked .desktop file.
- Fixed a few bugs as usual
Please note that this new version fixes also this bug #811579 (Cairo-Dock Plug-Ins needs to be recompiled to fix a dependency issues).
**We are currently not able to install cairo-dock-plug-ins packages due to this problem.**
This branch should be ready to be pushed on lp:ubuntu/cairo-dock-plug-ins (except the UNRELEASED version in debian/changelog)
Please upload this version before the FF.
Thank you for your help
PS: Don't forget to upload these plug-ins AND Cairo-Dock ( LP: #823513 )
PSĀ²: is it possible to wait for 15-30 min in order to compile this cairo-dock-plug-ins package with the new cairo-dock (core) packages.
Preview Diff
1 | === modified file 'Animated-icons/data/Animated-icons.conf.in' |
2 | --- Animated-icons/data/Animated-icons.conf.in 2011-04-20 20:46:51 +0000 |
3 | +++ Animated-icons/data/Animated-icons.conf.in 2011-08-09 20:07:46 +0000 |
4 | @@ -1,4 +1,4 @@ |
5 | -#!en;@VERSION_ANIMATED_ICONS@ |
6 | +#@VERSION_ANIMATED_ICONS@ |
7 | |
8 | #[gtk-preferences] |
9 | [Global] |
10 | |
11 | === modified file 'Animated-icons/src/applet-wobbly.c' |
12 | --- Animated-icons/src/applet-wobbly.c 2011-04-20 20:46:51 +0000 |
13 | +++ Animated-icons/src/applet-wobbly.c 2011-08-09 20:07:46 +0000 |
14 | @@ -473,7 +473,7 @@ |
15 | |
16 | ///glActiveTextureARB(GL_TEXTURE0_ARB); // Go pour le multitexturing 1ere passe |
17 | glBindTexture(GL_TEXTURE_2D, pIcon->iIconTexture); |
18 | - glColor4f(1.0f, 1.0f, 1.0f, myIconsParam.fAlbedo * pIcon->fAlpha); // transparence du reflet. |
19 | + glColor4f(1.0f, 1.0f, 1.0f, myIconsParam.fAlbedo * pIcon->fAlpha / 2); // transparence du reflet. |
20 | glBlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, |
21 | GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
22 | glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); |
23 | |
24 | === modified file 'CMakeLists.txt' |
25 | --- CMakeLists.txt 2011-07-05 13:45:43 +0000 |
26 | +++ CMakeLists.txt 2011-08-09 20:07:46 +0000 |
27 | @@ -10,7 +10,7 @@ |
28 | ########### project ############### |
29 | |
30 | project ("cairo-dock-plugins") |
31 | -set (VERSION "2.3.0~3") |
32 | +set (VERSION "2.4.0~0beta2") |
33 | |
34 | add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall |
35 | if (NOT ${CMAKE_BUILD_TYPE}) |
36 | @@ -22,11 +22,11 @@ |
37 | |
38 | set (CPACK_SOURCE_GENERATOR "TGZ") |
39 | set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}") |
40 | -set (CPACK_SOURCE_IGNORE_FILES |
41 | +set (CPACK_SOURCE_IGNORE_FILES |
42 | "/build/;/.bzr/;bzrignore$;/misc/;~$;${CPACK_SOURCE_IGNORE_FILES}") |
43 | include (CPack) |
44 | |
45 | -add_custom_target( dist |
46 | +add_custom_target(dist |
47 | COMMAND ${CMAKE_MAKE_PROGRAM} package_source) |
48 | add_custom_target(dist-bzr |
49 | COMMAND bzr export ${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz |
50 | @@ -48,21 +48,25 @@ |
51 | |
52 | # get plug-ins install dir |
53 | execute_process( |
54 | - COMMAND pkg-config cairo-dock --variable=pluginsdir # /usr/lib/cairo-dock |
55 | + COMMAND pkg-config gldi --variable=pluginsdir # /usr/lib/cairo-dock |
56 | OUTPUT_VARIABLE pluginsdir) |
57 | STRING (REGEX REPLACE "\n" "" pluginsdir ${pluginsdir}) # la commande rajoute un retour chariot ... |
58 | # get plug-ins data dir |
59 | execute_process( |
60 | - COMMAND pkg-config cairo-dock --variable=pluginsdatadir # /usr/share/cairo-dock/plug-ins |
61 | + COMMAND pkg-config gldi --variable=pluginsdatadir # /usr/share/cairo-dock/plug-ins |
62 | OUTPUT_VARIABLE pluginsdatadir) |
63 | STRING (REGEX REPLACE "\n" "" pluginsdatadir ${pluginsdatadir}) |
64 | # check that version matches with the core |
65 | execute_process( |
66 | - COMMAND pkg-config --modversion cairo-dock # 2.2.0-3 |
67 | + COMMAND pkg-config --modversion gldi # 2.2.0-3 |
68 | OUTPUT_VARIABLE dock_version) |
69 | STRING (REGEX REPLACE "\n" "" dock_version ${dock_version}) |
70 | if (NOT "${dock_version}" STREQUAL "${VERSION}") # Version |
71 | - MESSAGE (FATAL_ERROR "warning : version mismatch with the core : " ${VERSION} <> ${dock_version}) |
72 | + if ("${PACKAGEMENT}" STREQUAL "") |
73 | + MESSAGE (FATAL_ERROR "Error : version mismatch with the core : " ${VERSION} <> ${dock_version}) |
74 | + else () |
75 | + MESSAGE (WARNING "Warning : version mismatch with the core : " ${VERSION} <> ${dock_version}) |
76 | + endif () |
77 | endif() |
78 | |
79 | #if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT "${FORCE_LIB64}" STREQUAL "") # 64bits and force install in lib64 |
80 | @@ -76,7 +80,9 @@ |
81 | GET_FILENAME_COMPONENT(libdir "${pluginsdir}/.." ABSOLUTE) # /usr/lib |
82 | GET_FILENAME_COMPONENT(prefix "${pluginsdir}/../.." ABSOLUTE) # /usr |
83 | if (NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${prefix}") |
84 | - message (STATUS "Warning : plug-ins should be installed in the same directory as the core, that is to say in ${pluginsdir}") |
85 | + message (STATUS "It seems that the current CMAKE_INSTALL_PREFIX flag is not the same that you have used with the core.") |
86 | + message (STATUS " It will be replaced by this value: ${prefix}") |
87 | + message (WARNING "Plug-ins should be installed in the same directory as the core, that is to say in ${pluginsdir}") |
88 | set (CMAKE_INSTALL_PREFIX "${prefix}") |
89 | #set (libdir "${CMAKE_INSTALL_PREFIX}/${libname}/cairo-dock") |
90 | endif() |
91 | @@ -88,6 +94,10 @@ |
92 | |
93 | set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") # additionnal FindPackage files |
94 | |
95 | +set (MODULES_MISSING "") |
96 | +set (MODULES_INTEGRATION_MISSING "") |
97 | +set (PROGRAMS_MISSING "") |
98 | + |
99 | ########### dependancies ############### |
100 | |
101 | message ("") |
102 | @@ -96,7 +106,10 @@ |
103 | message (STATUS "=====================") |
104 | message ("") |
105 | |
106 | -pkg_check_modules ("PACKAGE" REQUIRED "gtk+-2.0" "gthread-2.0" "cairo" "librsvg-2.0" "dbus-1" "dbus-glib-1" "libxml-2.0" "gtkglext-1.0" "cairo-dock") |
107 | +pkg_check_modules ("PACKAGE" REQUIRED "gtk+-2.0" "gthread-2.0" "cairo" "librsvg-2.0" "dbus-1" "dbus-glib-1" "libxml-2.0" "gtkglext-1.0") |
108 | +pkg_check_modules ("GLDI" REQUIRED "gldi") # we don't want to link with gldi |
109 | +set (PACKAGE_INCLUDE_DIRS "${GLDI_INCLUDE_DIRS}") |
110 | +#message (STATUS "PACKAGE: ${PACKAGE_INCLUDE_DIRS}") |
111 | |
112 | ############# GLIB ################# |
113 | pkg_check_modules (GLIB glib-2.0) |
114 | @@ -107,14 +120,17 @@ |
115 | STRING (REGEX REPLACE "-.*" "" GLIB_NANO "${GLIB_NANO}") |
116 | |
117 | ############# ALSA_MIXER ################# |
118 | +message (STATUS "> AlsaMixer:") |
119 | set (with_alsa "no") |
120 | if (NOT "${enable-alsa-mixer}" STREQUAL "no") |
121 | pkg_check_modules (ALSA_MIXER_PACKAGE alsa) |
122 | if ("${ALSA_MIXER_PACKAGE_FOUND}" STREQUAL "") |
123 | message (STATUS "Could not find alsa; Cairo-Dock won't be built with AlsaMixer applet.") |
124 | + message (WARNING "This module is required to compile AlsaMixer applet: alsa") |
125 | + set (MODULES_MISSING "${MODULES_MISSING} alsa") |
126 | else() |
127 | set (GETTEXT_ALSA_MIXER ${GETTEXT_PLUGINS}) |
128 | - set (VERSION_ALSA_MIXER "1.0.12") |
129 | + set (VERSION_ALSA_MIXER "1.0.13") |
130 | set (PACKAGE_ALSA_MIXER "cd-AlsaMixer") |
131 | set (with_alsa "yes") |
132 | set (alsa_mixerdatadir "${pluginsdatadir}/AlsaMixer") |
133 | @@ -124,6 +140,7 @@ |
134 | endif() |
135 | |
136 | ############# ANIMATED ICONS ################# |
137 | +message (STATUS "> Animated Icons:") |
138 | set (GETTEXT_ANIMATED_ICONS ${GETTEXT_PLUGINS}) |
139 | set (VERSION_ANIMATED_ICONS "1.0.10") |
140 | set (PACKAGE_ANIMATED_ICONS "cd-Animated-icons") |
141 | @@ -132,8 +149,9 @@ |
142 | add_subdirectory (Animated-icons) |
143 | |
144 | ############# CAIRO_PENGUIN ################# |
145 | +message (STATUS "> Cairo Penguin:") |
146 | set (GETTEXT_CAIRO_PENGUIN ${GETTEXT_PLUGINS}) |
147 | -set (VERSION_CAIRO_PENGUIN "1.1.8") |
148 | +set (VERSION_CAIRO_PENGUIN "1.1.9") |
149 | set (PACKAGE_CAIRO_PENGUIN "cd-Cairo-Penguin") |
150 | set (cairo_penguinuserdirname "Cairo-Penguin") |
151 | set (cairo_penguindatadir "${pluginsdatadir}/Cairo-Penguin") |
152 | @@ -141,54 +159,64 @@ |
153 | add_subdirectory (Cairo-Penguin) |
154 | |
155 | ############# CLIPPER ################# |
156 | +message (STATUS "> Clipper:") |
157 | set (GETTEXT_CLIPPER ${GETTEXT_PLUGINS}) |
158 | -set (VERSION_CLIPPER "1.1.4") |
159 | +set (VERSION_CLIPPER "1.1.5") |
160 | set (PACKAGE_CLIPPER "cd-Clipper") |
161 | set (Clipperdatadir "${pluginsdatadir}/Clipper") |
162 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Clipper/data/Clipper.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Clipper/data/Clipper.conf) |
163 | add_subdirectory (Clipper) |
164 | |
165 | ############# CLOCK ################# |
166 | +message (STATUS "> Clock:") |
167 | set (with_ical "yes") |
168 | pkg_check_modules ("LIBICAL_PACKAGE" "libical") |
169 | if ("${LIBICAL_PACKAGE_FOUND}" STREQUAL "") |
170 | set (with_ical "no") |
171 | message (STATUS "Could not find libical; Clock plugin won't be built with iCal support.") |
172 | + message (WARNING "This module is required to compile Clock applet with iCal support: libical") |
173 | + set (MODULES_MISSING "${MODULES_MISSING} libical") |
174 | endif() |
175 | set (GETTEXT_CLOCK ${GETTEXT_PLUGINS}) |
176 | -set (VERSION_CLOCK "2.1.2") |
177 | +set (VERSION_CLOCK "2.1.3") |
178 | set (PACKAGE_CLOCK "cd-clock") |
179 | set (clockuserdirname "clock") |
180 | set (clockdatadir "${pluginsdatadir}/clock") |
181 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/clock/data/clock.conf.in ${CMAKE_CURRENT_BINARY_DIR}/clock/data/clock.conf) |
182 | add_subdirectory (clock) |
183 | |
184 | -############# COMPIZ_ICON ################# |
185 | -set (GETTEXT_COMPIZ_ICON ${GETTEXT_PLUGINS}) |
186 | -set (VERSION_COMPIZ_ICON "1.1.6") |
187 | -set (PACKAGE_COMPIZ_ICON "cd-compiz-icon") |
188 | -set (compiz_icondatadir "${pluginsdatadir}/compiz-icon") |
189 | -configure_file (${CMAKE_CURRENT_SOURCE_DIR}/compiz-icon/data/compiz-icon.conf.in ${CMAKE_CURRENT_BINARY_DIR}/compiz-icon/data/compiz-icon.conf) |
190 | -add_subdirectory (compiz-icon) |
191 | +############# COMPOSITE_MANAGER ################# |
192 | +message (STATUS "> Coposite Manager:") |
193 | +set (GETTEXT_COMPOSITE_MANAGER ${GETTEXT_PLUGINS}) |
194 | +set (VERSION_COMPOSITE_MANAGER "1.0.0") |
195 | +set (PACKAGE_COMPOSITE_MANAGER "cd-Composite-Manager") |
196 | +set (composite_managerdatadir "${pluginsdatadir}/Composite-Manager") |
197 | +configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Composite-Manager/data/Composite-Manager.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Composite-Manager/data/Composite-Manager.conf) |
198 | +add_subdirectory (Composite-Manager) |
199 | |
200 | ############# DBUS ################# |
201 | +message (STATUS "> DBus:") |
202 | +message (STATUS "* Python:") |
203 | find_program (PYTHON_EXECUTABLE python) |
204 | EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print sys.version" OUTPUT_VARIABLE PYTHON_VERSION) |
205 | -if ("${PYTHON_VERSION}" STREQUAL "") |
206 | - message (STATUS "Could not find Python, won't install Python interface.") |
207 | - set (with_python "no") |
208 | -else() |
209 | +if ("${PYTHON_VERSION}" STREQUAL "") |
210 | + message (STATUS "Could not find Python, won't install Python interface.") |
211 | + message (WARNING "This program is required to compile DBus applet with Python interface: python (version 2)") |
212 | + set (PROGRAMS_MISSING "${PROGRAMS_MISSING} python") |
213 | + set (with_python "no") |
214 | +else() |
215 | STRING (REGEX REPLACE "\n" "" PYTHON_VERSION ${PYTHON_VERSION}) |
216 | - message (STATUS "Python Version: ${PYTHON_VERSION}") |
217 | - GET_FILENAME_COMPONENT(DEBIAN_VERSION /etc/debian_version ABSOLUTE) |
218 | - if (EXISTS ${DEBIAN_VERSION}) |
219 | - message (STATUS " will use '--install-layout deb' with 'python setup.py install'") |
220 | + message (STATUS "Python Version: ${PYTHON_VERSION}") |
221 | + GET_FILENAME_COMPONENT(DEBIAN_VERSION /etc/debian_version ABSOLUTE) |
222 | + if (EXISTS ${DEBIAN_VERSION}) |
223 | + message (STATUS " will use '--install-layout deb' with 'python setup.py install'") |
224 | set (DEBIAN_INSTALL_LAYOUT "--install-layout deb") |
225 | endif() |
226 | set (PYTHON_FOUND "TRUE") |
227 | - set (with_python "yes") |
228 | + set (with_python "yes") |
229 | endif() |
230 | |
231 | +message (STATUS "* Ruby:") |
232 | # find_package(Ruby) found libs of ruby-dev but we only need a directory where we can install ruby libs. |
233 | find_program (RUBY_EXECUTABLE ruby) |
234 | EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']" |
235 | @@ -196,6 +224,8 @@ |
236 | message (STATUS "RUBY_LIBRARY: ${RUBY_LIB_DIR}") |
237 | if ("${RUBY_LIB_DIR}" STREQUAL "" OR "${RUBY_LIB_DIR}" STREQUAL "nil") |
238 | message (STATUS "Could not find ruby libs, won't install Ruby interface.") |
239 | + message (WARNING "This program is required to compile DBus applet with Ruby interface: ruby") |
240 | + set (PROGRAMS_MISSING "${PROGRAMS_MISSING} ruby") |
241 | set (with_ruby "no") |
242 | else() |
243 | string (REGEX REPLACE "lib/ruby/[0-9].[0-9]" "" RUBY_LIB_DIR_INSTALL "${RUBY_LIB_DIR}") |
244 | @@ -206,6 +236,7 @@ |
245 | set (with_ruby "yes") |
246 | endif() |
247 | |
248 | +message (STATUS "* Mono:") |
249 | #find_package (Mono) |
250 | find_program (GMCS_EXECUTABLE gmcs) |
251 | if ("${GMCS_EXECUTABLE}" STREQUAL "" OR NOT EXISTS ${GMCS_EXECUTABLE}) |
252 | @@ -215,6 +246,8 @@ |
253 | pkg_check_modules (MONO_PACKAGE glib-sharp-2.0 ndesk-dbus-1.0 ndesk-dbus-glib-1.0) |
254 | if ("${MONO_PACKAGE_FOUND}" STREQUAL "") |
255 | message (STATUS "Could not find glib-sharp-2.0, ndesk-dbus-1.0 or ndesk-dbus-glib-1.0; won't be built Mono interface.") |
256 | + message (WARNING "These modules are required to compile DBus applet with Mono interface: glib-sharp-2.0, ndesk-dbus-1.0 and ndesk-dbus-glib-1.0") |
257 | + set (MODULES_MISSING "${MODULES_MISSING} glib-sharp-2.0 ndesk-dbus-1.0 ndesk-dbus-glib-1.0") |
258 | set (with_mono "no") |
259 | else() |
260 | set (MONO_FOUND "TRUE") |
261 | @@ -222,6 +255,7 @@ |
262 | endif() |
263 | endif() |
264 | |
265 | +message (STATUS "* Vala:") |
266 | # Valac is only riquired to convert vala files to C files. |
267 | # So we can directly use produced files (c, h, vapi) without using valac. |
268 | set (with_vala "yes") |
269 | @@ -243,7 +277,7 @@ |
270 | |
271 | STRING (REGEX REPLACE "\\..*" "" VALA_MAJOR "${VALA_VERSION}") |
272 | # message (STATUS "VALA_MAJOR : ${VALA_MAJOR}") |
273 | - |
274 | + |
275 | STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" VALA_MINOR "${VALA_VERSION}") # 0.1.7 => 1.7 |
276 | STRING (REGEX REPLACE "\\.[0-9]*" "" VALA_MINOR "${VALA_MINOR}") |
277 | # message (STATUS "VALA_MINOR : ${VALA_MINOR}") |
278 | @@ -252,13 +286,18 @@ |
279 | STRING (REGEX REPLACE "-.*" "" VALA_NANO "${VALA_NANO}") |
280 | # message (STATUS "VALA_NANO : ${VALA_NANO}") |
281 | |
282 | - if (${VALA_MAJOR} GREATER 0 OR ${VALA_MINOR} GREATER 9) # vala > 0.10 |
283 | - message (STATUS " Vala compiler OK (>= 0.10).") |
284 | + if (${VALA_MAJOR} GREATER 0 OR ${VALA_MINOR} GREATER 9) # vala >= 0.10 |
285 | + # AND (${VALA_MAJOR} LESS 1 AND ${VALA_MINOR} LESS 13)) # and <= 0.12 |
286 | + message (STATUS " Vala compiler OK (>= 0.10).")# and <= 0.12).") |
287 | set (VALAC_FOUND "TRUE") |
288 | set (with_valac "yes") |
289 | else() |
290 | - message (STATUS "Vala compiler is too old (0.10 required), won't build Vala interface.") |
291 | + message (STATUS "Vala compiler is too old (0.10 required) or too new (> 0.12), won't build Vala interface.") |
292 | endif() |
293 | +else() |
294 | + message (STATUS "Could not find ValaC, won't build Vala interface with the version of your distribution.") |
295 | + message (WARNING "This program is required to compile DBus applet with Python interface: valac (version > 0.10)") |
296 | + set (PROGRAMS_MISSING "${PROGRAMS_MISSING} valac") |
297 | endif() |
298 | |
299 | |
300 | @@ -270,6 +309,7 @@ |
301 | add_subdirectory (Dbus) |
302 | |
303 | ############# DESKLET_RENDERING ################# |
304 | +message (STATUS "> Desklet Rendering:") |
305 | set (GETTEXT_DESKLET_RENDERING ${GETTEXT_PLUGINS}) |
306 | set (VERSION_DESKLET_RENDERING "1.5.6") |
307 | set (PACKAGE_DESKLET_RENDERING "cd-desklet-rendering") |
308 | @@ -278,6 +318,7 @@ |
309 | add_subdirectory (desklet-rendering) |
310 | |
311 | ############# DIALOG_RENDERING ################# |
312 | +message (STATUS "> Dialog Rendering:") |
313 | set (GETTEXT_DIALOG_RENDERING ${GETTEXT_PLUGINS}) |
314 | set (VERSION_DIALOG_RENDERING "0.5.1") |
315 | set (PACKAGE_DIALOG_RENDERING "cd-dialog-rendering") |
316 | @@ -288,8 +329,9 @@ |
317 | ############# DISKS ################# |
318 | set (with_disks "no") |
319 | if ("${enable-disks}" STREQUAL "yes") |
320 | + message (STATUS "> Disks:") |
321 | set (GETTEXT_DISKS ${GETTEXT_PLUGINS}) |
322 | - set (VERSION_DISKS "0.0.2") |
323 | + set (VERSION_DISKS "0.0.3") |
324 | set (PACKAGE_DISKS "cd-disks") |
325 | set (with_disks "yes") |
326 | set (disksdatadir "${pluginsdatadir}/Disks") |
327 | @@ -298,6 +340,7 @@ |
328 | endif() |
329 | |
330 | ############# DND2SHARE ################# |
331 | +message (STATUS "> DND2Share:") |
332 | set (GETTEXT_DND2SHARE ${GETTEXT_PLUGINS}) |
333 | set (VERSION_DND2SHARE "1.0.6") |
334 | set (PACKAGE_DND2SHARE "cd-dnd2share") |
335 | @@ -306,6 +349,7 @@ |
336 | add_subdirectory (dnd2share) |
337 | |
338 | ############# DOCK RENDERING ################# |
339 | +message (STATUS "> Dock Rendering:") |
340 | set (GETTEXT_RENDERING ${GETTEXT_PLUGINS}) |
341 | set (VERSION_RENDERING "1.5.9") |
342 | set (PACKAGE_RENDERING "cd-rendering") |
343 | @@ -316,8 +360,9 @@ |
344 | ############# DONCKY ################# |
345 | set (with_doncky "no") |
346 | if ("${enable-doncky}" STREQUAL "yes") |
347 | + message (STATUS "> Doncky:") |
348 | set (GETTEXT_DONCKY ${GETTEXT_PLUGINS}) |
349 | - set (VERSION_DONCKY "0.0.4") |
350 | + set (VERSION_DONCKY "0.0.5") |
351 | set (PACKAGE_DONCKY "cd-doncky") |
352 | set (with_doncky "yes") |
353 | set (donckydatadir "${pluginsdatadir}/Doncky") |
354 | @@ -326,6 +371,7 @@ |
355 | endif() |
356 | |
357 | ############# DROP INDICATOR ################# |
358 | +message (STATUS "> Drop Indicator:") |
359 | set (GETTEXT_DROP_INDICATOR ${GETTEXT_PLUGINS}) |
360 | set (VERSION_DROP_INDICATOR "1.1.4") |
361 | set (PACKAGE_DROP_INDICATOR "cd-drop_indicator") |
362 | @@ -334,8 +380,9 @@ |
363 | add_subdirectory (drop-indicator) |
364 | |
365 | ############# DUSTBIN ################# |
366 | +message (STATUS "> Dustbin:") |
367 | set (GETTEXT_DUSTBIN ${GETTEXT_PLUGINS}) |
368 | -set (VERSION_DUSTBIN "2.3.1") |
369 | +set (VERSION_DUSTBIN "2.3.2") |
370 | set (PACKAGE_DUSTBIN "cd-dustbin") |
371 | set (dustbinuserdirname "dustbin") |
372 | set (dustbindatadir "${pluginsdatadir}/dustbin") |
373 | @@ -343,22 +390,26 @@ |
374 | add_subdirectory (dustbin) |
375 | |
376 | ############# FOLDERS ################# |
377 | +message (STATUS "> Folders:") |
378 | set (GETTEXT_FOLDERS ${GETTEXT_PLUGINS}) |
379 | -set (VERSION_FOLDERS "0.2.1") |
380 | +set (VERSION_FOLDERS "0.2.2") |
381 | set (PACKAGE_FOLDERS "cd-Folders") |
382 | set (foldersdatadir "${pluginsdatadir}/Folders") |
383 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Folders/data/Folders.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Folders/data/Folders.conf) |
384 | add_subdirectory (Folders) |
385 | |
386 | ############# GMENU ################# |
387 | +message (STATUS "> GMenu:") |
388 | set (with_gmenu "no") |
389 | if (NOT "${enable-gmenu}" STREQUAL "no") |
390 | pkg_check_modules (GMENU_PACKAGE libgnome-menu) |
391 | if ("${GMENU_PACKAGE_FOUND}" STREQUAL "") |
392 | message (STATUS "Could not find libgnome-menu; Cairo-Dock won't be built with GMenu applet.") |
393 | + message (WARNING "This module is required to compile GMenu applet: libgnome-menu") |
394 | + set (MODULES_MISSING "${MODULES_MISSING} libgnome-menu") |
395 | else() |
396 | set (GETTEXT_GMENU ${GETTEXT_PLUGINS}) |
397 | - set (VERSION_GMENU "1.1.6") |
398 | + set (VERSION_GMENU "1.1.8") |
399 | set (PACKAGE_GMENU "cd-GMenu") |
400 | set (with_gmenu "yes") |
401 | set (gmenudatadir "${pluginsdatadir}/GMenu") |
402 | @@ -368,15 +419,19 @@ |
403 | endif() |
404 | |
405 | ############# GVFS-INTEGRATION ################# |
406 | +message (STATUS "> GVFS-Integration:") |
407 | pkg_check_modules ("LIBGIO" "gio-2.0") |
408 | add_subdirectory (gvfs-integration) |
409 | |
410 | ############# GNOME-INTEGRATION ################# |
411 | +message (STATUS "> Gnome-Integration:") |
412 | set (with_gnome_integration "no") |
413 | if (NOT "${enable-gnome-integration}" STREQUAL "no") |
414 | pkg_check_modules (GNOME_INTEGRATION gio-2.0) |
415 | if ("${GNOME_INTEGRATION_FOUND}" STREQUAL "") |
416 | message (STATUS "Could not find gio; Cairo-Dock won't be built with Gnome>=2.22 support.") |
417 | + message (STATUS "This module is required to compile Gnome-Integration applet: gio-2.0") |
418 | + set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gio-2.0") |
419 | else() |
420 | set (VERSION_GNOME_INTEGRATION "1.0.3") |
421 | set (PACKAGE_GNOME_INTEGRATION "cd_gnome-integration") |
422 | @@ -389,9 +444,13 @@ |
423 | ############# GNOME-INTEGRATION-OLD ################# |
424 | set (with_gnome_integration_old "no") |
425 | if ("${enable-old-gnome-integration}" STREQUAL "yes") |
426 | + message (STATUS "> Gnome-Integration:") |
427 | + message (WARNING "This applet is deprecated") |
428 | pkg_check_modules (OLD_GNOME_INTEGRATION gnome-vfs-2.0 libgnomeui-2.0) |
429 | if ("${OLD_GNOME_INTEGRATION_FOUND}" STREQUAL "") |
430 | message (STATUS "Could not find gnome-vfs and/or gnomeui; Cairo-Dock won't be built with Gnome<2.22 support.") |
431 | + message (STATUS "These modules are required to compile Gnome-Integration-Old applet: gnome-vfs-2.0 libgnomeui-2.0") |
432 | + set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gnome-vfs-2.0 libgnomeui-2.0") |
433 | else() |
434 | set (VERSION_GNOME_INTEGRATION_OLD "1.0.4") |
435 | set (PACKAGE_GNOME_INTEGRATION_OLD "cd_gnome-integration-old") |
436 | @@ -401,7 +460,8 @@ |
437 | endif() |
438 | endif() |
439 | |
440 | -############# ICON EFFECT ################# |
441 | +############# ICON EFFECTS ################# |
442 | +message (STATUS "> Icon Effects:") |
443 | set (GETTEXT_ICON_EFFECTS ${GETTEXT_PLUGINS}) |
444 | set (VERSION_ICON_EFFECTS "1.2.4") |
445 | set (PACKAGE_ICON_EFFECTS "cd-icon-effect") |
446 | @@ -409,11 +469,32 @@ |
447 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/icon-effect/data/icon-effect.conf.in ${CMAKE_CURRENT_BINARY_DIR}/icon-effect/data/icon-effect.conf) |
448 | add_subdirectory (icon-effect) |
449 | |
450 | +############# IMPULSE ################# |
451 | +set (with_impulse "no") |
452 | +if ("${enable-impulse}" STREQUAL "yes") |
453 | + message (STATUS "> Impulse:") |
454 | + pkg_check_modules (IMPULSE_PACKAGES libpulse fftw3) |
455 | + if ("${IMPULSE_PACKAGES_FOUND}" STREQUAL "") |
456 | + message (STATUS "Could not find libpulse; Cairo-Dock won't be built with Impulse applet.") |
457 | + message (WARNING "These modules are required to compile Impulse applet: libpulse fftw3") |
458 | + set (MODULES_MISSING "${MODULES_MISSING} libpulse fftw3") |
459 | + else() |
460 | + set (GETTEXT_IMPULSE ${GETTEXT_PLUGINS}) |
461 | + set (VERSION_IMPULSE "0.0.3") |
462 | + set (PACKAGE_IMPULSE "cd-Impulse") |
463 | + set (with_impulse "yes") |
464 | + set (impulsedatadir "${pluginsdatadir}/Impulse") |
465 | + configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Impulse/data/Impulse.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Impulse/data/Impulse.conf) |
466 | + add_subdirectory (Impulse) |
467 | + endif() |
468 | +endif() |
469 | + |
470 | ############# INDICATOR-APPLET ################# |
471 | -# Note: the names of dbusmenu-glib and dbusmenu-gtk have changed... |
472 | +message (STATUS "> Indicator-Applet:") |
473 | +# Note: the names of dbusmenu-glib, dbusmenu-gtk and indicator have changed... |
474 | pkg_check_modules (DBUSMENU_04 QUIET dbusmenu-glib-0.4) |
475 | pkg_check_modules (DBUSMENU_GTK_04 QUIET dbusmenu-gtk-0.4) |
476 | -pkg_check_modules (INDICATOR_APPLET indicator libido-0.1) |
477 | +pkg_check_modules (INDICATOR_04 QUIET indicator-0.4) |
478 | if ("${DBUSMENU_04_FOUND}" STREQUAL "1") |
479 | pkg_check_modules (DBUSMENU dbusmenu-glib-0.4) |
480 | else() |
481 | @@ -424,29 +505,45 @@ |
482 | else() |
483 | pkg_check_modules (DBUSMENU_GTK dbusmenu-gtk) |
484 | endif() |
485 | +if ("${INDICATOR_04_FOUND}" STREQUAL "1") |
486 | + pkg_check_modules (INDICATOR_APPLET indicator-0.4 libido-0.1) |
487 | +else() |
488 | + pkg_check_modules (INDICATOR_APPLET indicator libido-0.1) |
489 | +endif() |
490 | + |
491 | if ("${INDICATOR_APPLET_FOUND}" STREQUAL "1" AND "${DBUSMENU_FOUND}" STREQUAL "1" AND "${DBUSMENU_GTK_FOUND}" STREQUAL "1") |
492 | - message (STATUS "DBUSMENU_VERSION : ${DBUSMENU_VERSION}") |
493 | - |
494 | + #message (STATUS "DBUSMENU_VERSION : ${DBUSMENU_VERSION}") |
495 | + |
496 | STRING (REGEX REPLACE "\\..*" "" DBUSMENU_MAJOR "${DBUSMENU_VERSION}") |
497 | # message (STATUS "DBUSMENU_MAJOR : ${DBUSMENU_MAJOR}") |
498 | - |
499 | + |
500 | STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" DBUSMENU_MINOR "${DBUSMENU_VERSION}") # 0.1.7 => 1.7 |
501 | STRING (REGEX REPLACE "\\.[0-9]*" "" DBUSMENU_MINOR "${DBUSMENU_MINOR}") |
502 | # message (STATUS "DBUSMENU_MINOR : ${DBUSMENU_MINOR}") |
503 | - |
504 | + |
505 | STRING (REGEX REPLACE ".*\\." "" DBUSMENU_NANO "${DBUSMENU_VERSION}") |
506 | STRING (REGEX REPLACE "-.*" "" DBUSMENU_NANO "${DBUSMENU_NANO}") |
507 | # message (STATUS "DBUSMENU_NANO : ${DBUSMENU_NANO}") |
508 | - |
509 | - execute_process( |
510 | - COMMAND pkg-config --variable=iconsdir indicator |
511 | - OUTPUT_VARIABLE INDICATORICONSDIR) |
512 | + |
513 | + if ("${INDICATOR_04_FOUND}" STREQUAL "1") |
514 | + execute_process( |
515 | + COMMAND pkg-config --variable=iconsdir indicator-0.4 |
516 | + OUTPUT_VARIABLE INDICATORICONSDIR) |
517 | + else() |
518 | + execute_process( |
519 | + COMMAND pkg-config --variable=iconsdir indicator |
520 | + OUTPUT_VARIABLE INDICATORICONSDIR) |
521 | + endif() |
522 | STRING (REGEX REPLACE "\n" "" INDICATORICONSDIR ${INDICATORICONSDIR}) # la commande rajoute un retour chariot ... |
523 | add_subdirectory (Indicator-applet) |
524 | set (with_indicator "yes") |
525 | +else() |
526 | + message (WARNING "These modules are required to compile Indicators applet (MeMenu and Messaging-Menu): indicator(-0.4), libido-0.1, dbusmenu-glib(-0.4), dbusmenu-gtk(-0.4)") |
527 | + set (MODULES_MISSING "${MODULES_MISSING} indicator(-0.4) libido-0.1 dbusmenu-glib(-0.4) dbusmenu-gtk(-0.4)") |
528 | endif() |
529 | |
530 | ############# ILLUSION ################# |
531 | +message (STATUS "> Illusion:") |
532 | set (GETTEXT_ILLUSION ${GETTEXT_PLUGINS}) |
533 | set (VERSION_ILLUSION "1.0.7") |
534 | set (PACKAGE_ILLUSION "cd-illusion") |
535 | @@ -455,13 +552,75 @@ |
536 | add_subdirectory (illusion) |
537 | |
538 | ############# KDE-INTEGRATION ################# |
539 | +message (STATUS "> KDE-Integration:") |
540 | set (with_kde_integration "no") |
541 | -if (NOT "${enable-kde-integration}" STREQUAL "no") |
542 | +set (with_kde_integration2 "no") |
543 | +if ("${enable-kde-integration2}" STREQUAL "yes") |
544 | + #find_package(KDE4) |
545 | + find_package(Qt4) |
546 | + if (QT4_FOUND) |
547 | + message (STATUS " * Qt Includes: ${QT_INCLUDES}") |
548 | + message (STATUS " * Qt Definitions: ${QT_DEFINITIONS}") |
549 | + message (STATUS " * QtCore Library: ${QT_QTCORE_LIBRARY} / ${PACKAGE_LIBRARIES}") |
550 | + else() |
551 | + message (STATUS " * Qt unavailable") |
552 | + endif() |
553 | + |
554 | + find_path(KDECORE_INCLUDE_DIR "kdecore_export.h") |
555 | + find_library(KDECORE_LIBRARY NAMES "kdecore") |
556 | + GET_FILENAME_COMPONENT(KDECORE_LIBRARY ${KDECORE_LIBRARY} PATH) |
557 | + |
558 | + find_path(KIO_INCLUDE_DIR "kio_export.h" PATH_SUFFIXES "kio") |
559 | + find_library(KIO_LIBRARY NAMES "kio") |
560 | + GET_FILENAME_COMPONENT(KIO_LIBRARY ${KIO_LIBRARY} PATH) |
561 | + |
562 | + find_path(KDE_INCLUDE_DIR "KDirWatch" PATH_SUFFIXES "KDE") |
563 | + |
564 | + if (NOT "${KDECORE_LIBRARY}" STREQUAL "") |
565 | + message (STATUS " * KDECORE Dir: ${KDECORE_INCLUDE_DIR}") |
566 | + message (STATUS " * KDECORE Library: ${KDECORE_LIBRARY}") |
567 | + else() |
568 | + message (STATUS " * KDECORE unavailable") |
569 | + endif() |
570 | + if (NOT "${KIO_LIBRARY}" STREQUAL "") |
571 | + message (STATUS " * KIO Dir: ${KIO_INCLUDE_DIR}") |
572 | + message (STATUS " * KIO Library: ${KIO_LIBRARY}") |
573 | + else() |
574 | + message (STATUS " * KIO unavailable") |
575 | + endif() |
576 | + if (NOT "${KDE_LIBRARY}" STREQUAL "") ## always empty? |
577 | + message (STATUS " * KDE4 Dir: ${KDE_INCLUDE_DIR}") |
578 | + message (STATUS " * KDE4 Library: ${KDE_LIBRARY}") |
579 | + else() |
580 | + message (STATUS " * KDE4 unavailable") |
581 | + endif() |
582 | + |
583 | + if (QT4_FOUND |
584 | + AND KDECORE_INCLUDE_DIR |
585 | + AND KDECORE_LIBRARY |
586 | + AND KIO_INCLUDE_DIR |
587 | + AND KIO_LIBRARY |
588 | + AND KDE_INCLUDE_DIR) |
589 | + message (STATUS "KDE: OK") |
590 | + set (VERSION_KDE_INTEGRATION "0.0.3") |
591 | + set (PACKAGE_KDE_INTEGRATION "cd_kde-integration") |
592 | + set (with_kde_integration2 "yes") |
593 | + set (kde_integrationdatadir "${pluginsdatadir}/kde-integration2") |
594 | + add_subdirectory ("kde-integration2") |
595 | + else() |
596 | + message (STATUS "Could not find kde libs; Cairo-Dock won't be built with KDE support.") |
597 | + message (STATUS "These libraries are required to compile KDE experimental applet: kdecore, kio, kde4") |
598 | + set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} kdecore, kio, kde4") |
599 | + endif() |
600 | +elseif (NOT "${enable-kde-integration}" STREQUAL "no") |
601 | pkg_check_modules (KDE_INTEGRATION gio-2.0) |
602 | - if ("${KDE_INTEGRATION_FOUND}" STREQUAL "") |
603 | - message (STATUS "Could not find kde libs; Cairo-Dock won't be built with KDE support.") |
604 | + message (STATUS "KDE_INTEGRATION_FOUND: ${KDE_INTEGRATION_FOUND}") |
605 | + if (NOT KDE_INTEGRATION_FOUND) |
606 | + message (STATUS "Could not find gio; Cairo-Dock won't be built with KDE support.") |
607 | + message (STATUS "This module is required to compile KDE-Integration applet: gio-2.0") |
608 | + set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gio-2.0") |
609 | else() |
610 | - set (VERSION_KDE_INTEGRATION "0.0.2") |
611 | + set (VERSION_KDE_INTEGRATION "1.0.3") |
612 | set (PACKAGE_KDE_INTEGRATION "cd_kde-integration") |
613 | set (with_kde_integration "yes") |
614 | set (kde_integrationdatadir "${pluginsdatadir}/kde-integration") |
615 | @@ -470,13 +629,16 @@ |
616 | endif() |
617 | |
618 | ############# KEYBOARD_INDICATOR ################# |
619 | +message (STATUS "> Keyboard-Indicator:") |
620 | set (with_keyboard_indicator "no") |
621 | pkg_check_modules (KEYBOARD_INDICATOR_PACKAGE libxklavier) |
622 | if ("${KEYBOARD_INDICATOR_PACKAGE_FOUND}" STREQUAL "") |
623 | message (STATUS "Could not find libxklavier; Cairo-Dock won't be built with keyboard-indicator applet.") |
624 | + message (WARNING "This module is required to compile Keyboard-Indicator applet: libxklavier") |
625 | + set (MODULES_MISSING "${MODULES_MISSING} libxklavier") |
626 | else() |
627 | set (GETTEXT_KEYBOARD_INDICATOR ${GETTEXT_PLUGINS}) |
628 | - set (VERSION_KEYBOARD_INDICATOR "1.1.3") |
629 | + set (VERSION_KEYBOARD_INDICATOR "1.1.4") |
630 | set (PACKAGE_KEYBOARD_INDICATOR "cd-keyboard-indicator") |
631 | set (with_keyboard_indicator "yes") |
632 | set (keyboard_indicatordatadir "${pluginsdatadir}/keyboard-indicator") |
633 | @@ -485,20 +647,32 @@ |
634 | endif() |
635 | |
636 | ############# LOGOUT ################# |
637 | +message (STATUS "> LogOut:") |
638 | +pkg_check_modules (UPOWER upower-glib) # useful for Powermanager too. |
639 | +if (${UPOWER_FOUND}) |
640 | + set (with_upower_support "yes") |
641 | +else() |
642 | + set (with_upower_support "no") |
643 | + message (STATUS "Could not find upower-glib; LogOut and PowerManager plugin won't be built with UPower support.") |
644 | + message (WARNING "This module is required to compile LogOut and PowerManager applet with UPower support: upower-glib") |
645 | + set (MODULES_MISSING "${MODULES_MISSING} upower-glib") |
646 | +endif() |
647 | set (GETTEXT_LOGOUT ${GETTEXT_PLUGINS}) |
648 | -set (VERSION_LOGOUT "1.2.10") |
649 | +set (VERSION_LOGOUT "1.2.11") |
650 | set (PACKAGE_LOGOUT "cd-logout") |
651 | set (logoutdatadir "${pluginsdatadir}/logout") |
652 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/logout/data/logout.conf.in ${CMAKE_CURRENT_BINARY_DIR}/logout/data/logout.conf) |
653 | add_subdirectory (logout) |
654 | |
655 | ############# MAIL ################# |
656 | +message (STATUS "> Mail:") |
657 | set (with_mail "no") |
658 | # find the compilation flags |
659 | +find_program (LIBETPAN_CONFIG_EXECUTABLE libetpan-config) |
660 | execute_process( |
661 | - COMMAND libetpan-config --cflags |
662 | + COMMAND ${LIBETPAN_CONFIG_EXECUTABLE} --cflags |
663 | OUTPUT_VARIABLE MAIL_PACKAGE_CFLAGS) |
664 | -if (NOT "${MAIL_PACKAGE_CFLAGS}" STREQUAL "") # if we don't want to use it, we don't want to have an error |
665 | +if (NOT "${MAIL_PACKAGE_CFLAGS}" STREQUAL "") # if there is a problem with the previous, we don't want to have a lot of errors |
666 | STRING (REGEX MATCHALL "-I[^ ]+ " TMP_VARIABLE "${MAIL_PACKAGE_CFLAGS}") # first extract the "-I" options |
667 | STRING (REGEX REPLACE ";" "" TMP_VARIABLE "${TMP_VARIABLE}") |
668 | STRING (REGEX REPLACE " $" "" TMP_VARIABLE "${TMP_VARIABLE}") |
669 | @@ -506,7 +680,7 @@ |
670 | endif() |
671 | # find the link flags |
672 | execute_process( |
673 | - COMMAND libetpan-config --libs |
674 | + COMMAND ${LIBETPAN_CONFIG_EXECUTABLE} --libs |
675 | OUTPUT_VARIABLE MAIL_PACKAGE_LIBS) |
676 | if (NOT "${MAIL_PACKAGE_LIBS}" STREQUAL "") |
677 | # find the link libraries |
678 | @@ -521,13 +695,15 @@ |
679 | endif() |
680 | if ("${MAIL_PACKAGE_LIBS}" STREQUAL "") |
681 | message (STATUS "warning : Could not find libetpan; Cairo-Dock won't be built with Mail applet.") |
682 | + message (WARNING "This module is required to compile Mail applet: libetpan") |
683 | + set (PROGRAMS_MISSING "${PROGRAMS_MISSING} libetpan-config") |
684 | else() |
685 | message (STATUS "libetpan found. Using the following options:") |
686 | message (STATUS " Include directories: ${MAIL_PACKAGE_INCLUDE_DIRS}") |
687 | message (STATUS " Link directories: ${MAIL_PACKAGE_LIBRARY_DIRS}") |
688 | message (STATUS " Link libraries: ${MAIL_PACKAGE_LIBRARIES}") |
689 | set (GETTEXT_MAIL ${GETTEXT_PLUGINS}) |
690 | - set (VERSION_MAIL "1.0.8") |
691 | + set (VERSION_MAIL "1.0.9") |
692 | set (PACKAGE_MAIL "cd-mail") |
693 | set (maildatadir "${pluginsdatadir}/mail") |
694 | set (with_mail "yes") |
695 | @@ -535,7 +711,8 @@ |
696 | add_subdirectory ("mail") |
697 | endif() |
698 | |
699 | -############# MEMENU ################# |
700 | +############# DISTRIBUTION ################# |
701 | +message (STATUS "> Distribution:") |
702 | # We try to detect if the user is on Ubuntu to know which bus we have to use... |
703 | execute_process( |
704 | COMMAND lsb_release -i |
705 | @@ -573,11 +750,17 @@ |
706 | endif() |
707 | endif() |
708 | |
709 | -set (INDICATOR_OLD_NAMES 0) |
710 | if (NOT "${DISTRO_ID}" STREQUAL "") |
711 | message (STATUS "DISTRO_ID: ${DISTRO_ID}, DISTRO_RELEASE: ${DISTRO_RELEASE}") |
712 | endif() |
713 | -if ("${DISTRO_ID}" STREQUAL "Ubuntu") |
714 | + |
715 | +############# INDICATOR_NAME ################# |
716 | +message (STATUS "> Indicator Names:") |
717 | +set (INDICATOR_OLD_NAMES 0) |
718 | +if ("${force_old_indicator_names}" STREQUAL "yes") |
719 | + set (INDICATOR_OLD_NAMES 1) |
720 | + message (STATUS "Indicators: use old Ayatana Dbus names (forced)") |
721 | +elseif ("${DISTRO_ID}" STREQUAL "Ubuntu") |
722 | STRING (REGEX REPLACE "\\..*" "" DISTRO_RELEASE_MAJOR ${DISTRO_RELEASE}) |
723 | # message (STATUS "DISTRO_RELEASE_MAJOR: ${DISTRO_RELEASE_MAJOR}") |
724 | if (${DISTRO_RELEASE_MAJOR} LESS 11) # from 11.04, new names are used. |
725 | @@ -586,10 +769,12 @@ |
726 | endif() |
727 | endif() |
728 | |
729 | +############# MEMENU ################# |
730 | set (with_me_menu "no") |
731 | if ("${with_indicator}" STREQUAL "yes") |
732 | + message (STATUS "> MeMenu:") |
733 | set (GETTEXT_MEMENU ${GETTEXT_PLUGINS}) |
734 | - set (VERSION_MEMENU "1.0.1") |
735 | + set (VERSION_MEMENU "1.0.2") |
736 | set (PACKAGE_MEMENU "cd-MeMenu") |
737 | set (memenudatadir "${pluginsdatadir}/MeMenu") |
738 | set (with_me_menu "yes") |
739 | @@ -600,8 +785,9 @@ |
740 | ############# MESSAGING_MENU ################# |
741 | set (with_messaging_menu "no") |
742 | if ("${with_indicator}" STREQUAL "yes") |
743 | + message (STATUS "> Messaging-Menu:") |
744 | set (GETTEXT_MESSAGING_MENU ${GETTEXT_PLUGINS}) |
745 | - set (VERSION_MESSAGING_MENU "1.0.1") |
746 | + set (VERSION_MESSAGING_MENU "1.0.2") |
747 | set (PACKAGE_MESSAGING_MENU "cd-Messaging-Menu") |
748 | set (with_messaging_menu "yes") |
749 | set (messaging_menudatadir "${pluginsdatadir}/Messaging-Menu") |
750 | @@ -610,6 +796,7 @@ |
751 | endif() |
752 | |
753 | ############# MOTION BLUR ################# |
754 | +message (STATUS "> Motion Blur:") |
755 | set (GETTEXT_MOTION_BLUR ${GETTEXT_PLUGINS}) |
756 | set (VERSION_MOTION_BLUR "1.0.4") |
757 | set (PACKAGE_MOTION_BLUR "cd-motion_blur") |
758 | @@ -618,16 +805,18 @@ |
759 | add_subdirectory (motion-blur) |
760 | |
761 | ############# MUSICPLAYER ################# |
762 | +message (STATUS "> MusicPlayer:") |
763 | set (GETTEXT_MUSICPLAYER ${GETTEXT_PLUGINS}) |
764 | -set (VERSION_MUSICPLAYER "1.0.7") |
765 | +set (VERSION_MUSICPLAYER "1.0.8") |
766 | set (PACKAGE_MUSICPLAYER "cd-musicPlayer") |
767 | set (musicplayerdatadir "${pluginsdatadir}/musicPlayer") |
768 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/musicPlayer/data/musicPlayer.conf.in ${CMAKE_CURRENT_BINARY_DIR}/musicPlayer/data/musicPlayer.conf) |
769 | add_subdirectory (musicPlayer) |
770 | |
771 | ############# NETSPEED ################# |
772 | +message (STATUS "> NetSpeed:") |
773 | set (GETTEXT_NETSPEED ${GETTEXT_PLUGINS}) |
774 | -set (VERSION_NETSPEED "1.2.5") |
775 | +set (VERSION_NETSPEED "1.2.6") |
776 | set (PACKAGE_NETSPEED "cd-netspeed") |
777 | set (netspeeddatadir "${pluginsdatadir}/netspeed") |
778 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/netspeed/data/netspeed.conf.in ${CMAKE_CURRENT_BINARY_DIR}/netspeed/data/netspeed.conf) |
779 | @@ -636,8 +825,9 @@ |
780 | ############# NETWORK_MONITOR ################# |
781 | set (with_network_monitor "no") |
782 | if ("${enable-network-monitor}" STREQUAL "yes") |
783 | + message (STATUS "> Network Monitor:") |
784 | set (GETTEXT_NETWORK_MONITOR ${GETTEXT_PLUGINS}) |
785 | - set (VERSION_NETWORK_MONITOR "0.2.3") |
786 | + set (VERSION_NETWORK_MONITOR "0.2.4") |
787 | set (PACKAGE_NETWORK_MONITOR "cd-network-monitor") |
788 | set (with_network_monitor "yes") |
789 | set (network_monitordatadir "${pluginsdatadir}/Network-Monitor") |
790 | @@ -646,29 +836,34 @@ |
791 | endif() |
792 | |
793 | ############# POWERMANAGER ################# |
794 | +message (STATUS "> PowerManager:") |
795 | set (GETTEXT_POWERMANAGER ${GETTEXT_PLUGINS}) |
796 | -set (VERSION_POWERMANAGER "1.3.4") |
797 | +set (VERSION_POWERMANAGER "1.3.5") |
798 | set (PACKAGE_POWERMANAGER "cd-powermanager") |
799 | set (powermanagerdatadir "${pluginsdatadir}/powermanager") |
800 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/powermanager/data/powermanager.conf.in ${CMAKE_CURRENT_BINARY_DIR}/powermanager/data/powermanager.conf) |
801 | add_subdirectory (powermanager) |
802 | |
803 | ############# QUICK BROWSER ################# |
804 | +message (STATUS "> Quick Browser:") |
805 | set (GETTEXT_QUICK_BROWSER ${GETTEXT_PLUGINS}) |
806 | -set (VERSION_QUICK_BROWSER "1.0.8") |
807 | +set (VERSION_QUICK_BROWSER "1.0.9") |
808 | set (PACKAGE_QUICK_BROWSER "cd-quick-browser") |
809 | set (quick_browserdatadir "${pluginsdatadir}/quick_browser") |
810 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/quick-browser/data/quick-browser.conf.in ${CMAKE_CURRENT_BINARY_DIR}/quick-browser/data/quick-browser.conf) |
811 | add_subdirectory (quick-browser) |
812 | |
813 | ############# RECENT-EVENTS ################# |
814 | +message (STATUS "> Recent-Events:") |
815 | set (with_recent_events "no") |
816 | pkg_check_modules (RECENT_EVENTS zeitgeist-1.0) |
817 | if ("${RECENT_EVENTS_FOUND}" STREQUAL "") |
818 | message (STATUS "Could not find libzeitgeist; Cairo-Dock won't be built with Zeitgeist support.") |
819 | + message (WARNING "This module is required to compile Recent-Events applet: zeitgeist-1.0") |
820 | + set (MODULES_MISSING "${MODULES_MISSING} zeitgeist-1.0") |
821 | else() |
822 | set (GETTEXT_RECENT_EVENTS ${GETTEXT_PLUGINS}) |
823 | - set (VERSION_RECENT_EVENTS "0.0.2") |
824 | + set (VERSION_RECENT_EVENTS "1.0.0") |
825 | set (PACKAGE_RECENT_EVENTS "cd-Recent-Events") |
826 | set (with_recent_events "yes") |
827 | set (recent_eventsdatadir "${pluginsdatadir}/Recent-Events") |
828 | @@ -677,6 +872,7 @@ |
829 | endif() |
830 | |
831 | ############# REMOTE_CONTROL ################# |
832 | +message (STATUS "> Remote Control:") |
833 | set (GETTEXT_REMOTE_CONTROL ${GETTEXT_PLUGINS}) |
834 | set (VERSION_REMOTE_CONTROL "0.0.2") |
835 | set (PACKAGE_REMOTE_CONTROL "cd-Remote-Control") |
836 | @@ -685,8 +881,9 @@ |
837 | add_subdirectory (Remote-Control) |
838 | |
839 | ############# RSSREADER ################# |
840 | +message (STATUS "> RSSreader:") |
841 | set (GETTEXT_RSS_READER ${GETTEXT_PLUGINS}) |
842 | -set (VERSION_RSS_READER "1.0.3") |
843 | +set (VERSION_RSS_READER "1.0.4") |
844 | set (PACKAGE_RSS_READER "cd-rssreader") |
845 | set (rss_readerdatadir "${pluginsdatadir}/RSSreader") |
846 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/RSSreader/data/RSSreader.conf.in ${CMAKE_CURRENT_BINARY_DIR}/RSSreader/data/RSSreader.conf) |
847 | @@ -695,6 +892,7 @@ |
848 | ############# SCOOBY_DO ################# |
849 | set (with_scooby_do "no") |
850 | if ("${enable-scooby-do}" STREQUAL "yes") |
851 | + message (STATUS "> Scooby-Do:") |
852 | set (GETTEXT_SCOOBY_DO ${GETTEXT_PLUGINS}) |
853 | set (VERSION_SCOOBY_DO "0.1.1") |
854 | set (PACKAGE_SCOOBY_DO "cd-scooby-do") |
855 | @@ -704,29 +902,38 @@ |
856 | add_subdirectory (Scooby-Do) |
857 | endif() |
858 | |
859 | +############# SHARED-IMAGES ################# |
860 | +set (shared_imagesdatadir "${pluginsdatadir}/shared-images") |
861 | +add_subdirectory (shared-images) |
862 | + |
863 | ############# SHORTCUTS ################# |
864 | +message (STATUS "> Shortcuts:") |
865 | set (GETTEXT_SHORTCUTS ${GETTEXT_PLUGINS}) |
866 | -set (VERSION_SHORTCUTS "1.3.1") |
867 | +set (VERSION_SHORTCUTS "1.3.2") |
868 | set (PACKAGE_SHORTCUTS "cd-shortcuts") |
869 | set (shortcutsdatadir "${pluginsdatadir}/shortcuts") |
870 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/shortcuts/data/shortcuts.conf.in ${CMAKE_CURRENT_BINARY_DIR}/shortcuts/data/shortcuts.conf) |
871 | add_subdirectory (shortcuts) |
872 | |
873 | ############# SHOW DESKTOP ################# |
874 | +message (STATUS "> ShowDesktop:") |
875 | set (with_xrandr "yes") |
876 | pkg_check_modules (SHOW_DESKTOP_XRANDR xrandr) |
877 | if ("${SHOW_DESKTOP_XRANDR_FOUND}" STREQUAL "") |
878 | message (STATUS "Could not find xrandr; ShowDesktop won't be built with screen resolution abilities.") |
879 | + message (WARNING "This module is required to compile ShowDesktop applet with xRandr support: xrandr") |
880 | + set (MODULES_MISSING "${MODULES_MISSING} xrandr") |
881 | set (with_xrandr "no") |
882 | endif() |
883 | set (GETTEXT_SHOW_DESKTOP ${GETTEXT_PLUGINS}) |
884 | -set (VERSION_SHOW_DESKTOP "1.2.4") |
885 | +set (VERSION_SHOW_DESKTOP "1.2.5") |
886 | set (PACKAGE_SHOW_DESKTOP "cd-showDesktop") |
887 | set (show_desktopdatadir "${pluginsdatadir}/showDesktop") |
888 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/showDesktop/data/showDesktop.conf.in ${CMAKE_CURRENT_BINARY_DIR}/showDesktop/data/showDesktop.conf) |
889 | add_subdirectory (showDesktop) |
890 | |
891 | ############# SHOW MOUSE ################# |
892 | +message (STATUS "> Show Mouse:") |
893 | set (GETTEXT_SHOW_MOUSE ${GETTEXT_PLUGINS}) |
894 | set (VERSION_SHOW_MOUSE "1.0.4") |
895 | set (PACKAGE_SHOW_MOUSE "cd-show_mouse") |
896 | @@ -735,33 +942,41 @@ |
897 | add_subdirectory (show-mouse) |
898 | |
899 | ############# SLIDER ################# |
900 | +message (STATUS "> Slider:") |
901 | set (with_exif "yes") |
902 | pkg_check_modules (EXIF libexif) |
903 | if ("${EXIF_FOUND}" STREQUAL "") |
904 | message (STATUS "Could not find libexif; Slider won't be able to rotate the images accordingly to their exif data.") |
905 | + message (WARNING "This module is required to compile Slider applet with Exif support: libexif") |
906 | + set (MODULES_MISSING "${MODULES_MISSING} libexif") |
907 | set (with_exif "no") |
908 | endif() |
909 | set (GETTEXT_SLIDER ${GETTEXT_PLUGINS}) |
910 | -set (VERSION_SLIDER "2.0.8") |
911 | +set (VERSION_SLIDER "2.0.9") |
912 | set (PACKAGE_SLIDER "cd-slider") |
913 | set (sliderdatadir "${pluginsdatadir}/slider") |
914 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/slider/data/slider.conf.in ${CMAKE_CURRENT_BINARY_DIR}/slider/data/slider.conf) |
915 | add_subdirectory (slider) |
916 | |
917 | ############# STACK ################# |
918 | +message (STATUS "> Stack:") |
919 | set (GETTEXT_STACK ${GETTEXT_PLUGINS}) |
920 | -set (VERSION_STACK "0.3.1") |
921 | +set (VERSION_STACK "0.3.2") |
922 | set (PACKAGE_STACK "cd-stack") |
923 | set (stackdatadir "${pluginsdatadir}/stack") |
924 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/stack/data/stack.conf.in ${CMAKE_CURRENT_BINARY_DIR}/stack/data/stack.conf) |
925 | add_subdirectory (stack) |
926 | |
927 | ############# STATUS NOTIFIER ################# |
928 | +message (STATUS "> Status Notifier:") |
929 | if ("${DBUSMENU_GTK_FOUND}" STREQUAL "") |
930 | message (STATUS "Could not find Status-Notifier libs; Cairo-Dock won't be built with Status-Notifier support.") |
931 | + message (WARNING "This module is required to compile Status Notifier applet: dbusmenu-gtk(-0.4)") |
932 | + # set (MODULES_MISSING "${MODULES_MISSING} dbusmenu-gtk(-0.4)") # it should already be in the list. |
933 | + set (with_status_notifier "no") |
934 | else() |
935 | set (GETTEXT_STATUS_NOTIFIER ${GETTEXT_PLUGINS}) |
936 | - set (VERSION_STATUS_NOTIFIER "0.1.3") |
937 | + set (VERSION_STATUS_NOTIFIER "0.1.4") |
938 | set (PACKAGE_STATUS_NOTIFIER "cd-status-notifier") |
939 | set (with_status_notifier "yes") |
940 | set (status_notifierdatadir "${pluginsdatadir}/Status-Notifier") |
941 | @@ -770,43 +985,51 @@ |
942 | endif() |
943 | |
944 | ############# SWITCHER ################# |
945 | +message (STATUS "> Switcher:") |
946 | set (GETTEXT_SWITCHER ${GETTEXT_PLUGINS}) |
947 | -set (VERSION_SWITCHER "2.1.6") |
948 | +set (VERSION_SWITCHER "2.1.7") |
949 | set (PACKAGE_SWITCHER "cd-switcher") |
950 | set (switcherdatadir "${pluginsdatadir}/switcher") |
951 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/switcher/data/switcher.conf.in ${CMAKE_CURRENT_BINARY_DIR}/switcher/data/switcher.conf) |
952 | add_subdirectory (switcher) |
953 | |
954 | ############# SYSTEM MONITOR ################# |
955 | +message (STATUS "> System Monitor:") |
956 | set (with_sensors "yes") |
957 | find_package (Sensors) |
958 | if (NOT "${SENSORS_FOUND}" STREQUAL "TRUE") |
959 | message (STATUS "Could not find libsensors; System-Monitor won't be able to monitor fan speed and CPU temperature.") |
960 | + message (WARNING "This package is required to compile System Monitor applet with Sensors support: sensors") |
961 | + set (PROGRAMS_MISSING "${PROGRAMS_MISSING} sensors") |
962 | set (with_sensors "no") |
963 | endif() |
964 | set (GETTEXT_SYSTEM_MONITOR ${GETTEXT_PLUGINS}) |
965 | -set (VERSION_SYSTEM_MONITOR "1.0.6") |
966 | +set (VERSION_SYSTEM_MONITOR "1.0.7") |
967 | set (PACKAGE_SYSTEM_MONITOR "cd-system-monitor") |
968 | set (system_monitordatadir "${pluginsdatadir}/System-monitor") |
969 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/System-Monitor/data/System-Monitor.conf.in ${CMAKE_CURRENT_BINARY_DIR}/System-Monitor/data/System-Monitor.conf) |
970 | add_subdirectory (System-Monitor) |
971 | |
972 | ############# SYSTRAY ################# |
973 | +message (STATUS "> Systray:") |
974 | set (GETTEXT_SYSTRAY ${GETTEXT_PLUGINS}) |
975 | -set (VERSION_SYSTRAY "0.2.2") |
976 | +set (VERSION_SYSTRAY "0.2.3") |
977 | set (PACKAGE_SYSTRAY "cd-systray") |
978 | set (systraydatadir "${pluginsdatadir}/systray") |
979 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/systray/data/systray.conf.in ${CMAKE_CURRENT_BINARY_DIR}/systray/data/systray.conf) |
980 | add_subdirectory (systray) |
981 | |
982 | ############# TERMINAL ################# |
983 | +message (STATUS "> Terminal:") |
984 | pkg_check_modules (TERMINAL_PACKAGE vte) |
985 | if ("${TERMINAL_PACKAGE_FOUND}" STREQUAL "") |
986 | message (STATUS "Could not find libvte; Cairo-Dock won't be built with terminal applet.") |
987 | + message (WARNING "This module is required to compile Terminal applet: vte") |
988 | + set (MODULES_MISSING "${MODULES_MISSING} vte") |
989 | set (with_terminal "no") |
990 | else() |
991 | set (GETTEXT_TERMINAL ${GETTEXT_PLUGINS}) |
992 | - set (VERSION_TERMINAL "1.0.10") |
993 | + set (VERSION_TERMINAL "1.0.11") |
994 | set (PACKAGE_TERMINAL "cd-terminal") |
995 | set (with_terminal "yes") |
996 | set (terminaldatadir "${pluginsdatadir}/terminal") |
997 | @@ -815,16 +1038,18 @@ |
998 | endif() |
999 | |
1000 | ############# TOMBOY ################# |
1001 | +message (STATUS "> Tomboy:") |
1002 | set (GETTEXT_TOMBOY ${GETTEXT_PLUGINS}) |
1003 | -set (VERSION_TOMBOY "1.3.1") |
1004 | +set (VERSION_TOMBOY "1.3.2") |
1005 | set (PACKAGE_TOMBOY "cd-tomboy") |
1006 | set (tomboydatadir "${pluginsdatadir}/tomboy") |
1007 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/tomboy/data/tomboy.conf.in ${CMAKE_CURRENT_BINARY_DIR}/tomboy/data/tomboy.conf) |
1008 | add_subdirectory (tomboy) |
1009 | |
1010 | ############# TOONS ################# |
1011 | +message (STATUS "> Toons:") |
1012 | set (GETTEXT_TOONS ${GETTEXT_PLUGINS}) |
1013 | -set (VERSION_TOONS "1.0.8") |
1014 | +set (VERSION_TOONS "1.0.9") |
1015 | set (PACKAGE_TOONS "cd-Toons") |
1016 | set (toonsdatadir "${pluginsdatadir}/Toons") |
1017 | set (toonsuserdirname "Toons") |
1018 | @@ -832,8 +1057,9 @@ |
1019 | add_subdirectory (Toons) |
1020 | |
1021 | ############# WEATHER ################# |
1022 | +message (STATUS "> Weather:") |
1023 | set (GETTEXT_WEATHER ${GETTEXT_PLUGINS}) |
1024 | -set (VERSION_WEATHER "1.2.10") |
1025 | +set (VERSION_WEATHER "1.2.11") |
1026 | set (PACKAGE_WEATHER "cd-weather") |
1027 | set (weatherdatadir "${pluginsdatadir}/weather") |
1028 | set (weatheruserdirname "weather") |
1029 | @@ -841,14 +1067,17 @@ |
1030 | add_subdirectory (weather) |
1031 | |
1032 | ############# WEBLETS ################# |
1033 | +message (STATUS "> Weblets:") |
1034 | set (with_weblets "no") |
1035 | if (NOT "${enable-weblets}" STREQUAL "no") |
1036 | pkg_check_modules (WEBKIT webkit-1.0) |
1037 | if ("${WEBKIT_FOUND}" STREQUAL "") |
1038 | message (STATUS "Could not find webkit-1.0; Cairo-Dock won't be built with Weblets applet.") |
1039 | + message (WARNING "This module is required to compile Weblets applet: webkit-1.0") |
1040 | + set (MODULES_MISSING "${MODULES_MISSING} webkit-1.0") |
1041 | else() |
1042 | set (GETTEXT_WEBLETS ${GETTEXT_PLUGINS}) |
1043 | - set (VERSION_WEBLETS "0.0.10") |
1044 | + set (VERSION_WEBLETS "0.0.11") |
1045 | set (PACKAGE_WEBLETS "cd-weblets") |
1046 | set (webletsdatadir "${pluginsdatadir}/weblets") |
1047 | set (with_weblets "yes") |
1048 | @@ -858,20 +1087,24 @@ |
1049 | endif() |
1050 | |
1051 | ############# WIFI ################# |
1052 | +message (STATUS "> WiFi:") |
1053 | set (GETTEXT_WIFI ${GETTEXT_PLUGINS}) |
1054 | -set (VERSION_WIFI "1.2.6") |
1055 | +set (VERSION_WIFI "1.2.7") |
1056 | set (PACKAGE_WIFI "cd-wifi") |
1057 | set (wifidatadir "${pluginsdatadir}/wifi") |
1058 | configure_file (${CMAKE_CURRENT_SOURCE_DIR}/wifi/data/wifi.conf.in ${CMAKE_CURRENT_BINARY_DIR}/wifi/data/wifi.conf) |
1059 | add_subdirectory (wifi) |
1060 | |
1061 | ############# XFCE-INTEGRATION ################# |
1062 | +message (STATUS "> XFCE-Integration:") |
1063 | set (with_xfce_integration "no") |
1064 | if (NOT "${enable-xfce-integration}" STREQUAL "no") |
1065 | pkg_check_modules (XFCE_INTEGRATION_THUNAR thunar-vfs-1) |
1066 | pkg_check_modules (XFCE_INTEGRATION_GVFS gio-2.0) |
1067 | if ("${XFCE_INTEGRATION_THUNAR_FOUND}" STREQUAL "" AND "${XFCE_INTEGRATION_GVFS_FOUND}" STREQUAL "") |
1068 | message (STATUS "Could find neither thunar-vfs or libgio-2.0; Cairo-Dock won't be built with XFCE support.") |
1069 | + message (STATUS "This module is required to compile XFCE-Integration applet: gio-2.0 (or thunar-vfs-1)") |
1070 | + set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gio-2.0") |
1071 | else() |
1072 | set (VERSION_XFCE_INTEGRATION "1.0.3") |
1073 | set (PACKAGE_XFCE_INTEGRATION "cd_xfce-integration") |
1074 | @@ -882,13 +1115,16 @@ |
1075 | endif() |
1076 | |
1077 | ############# XGAMMA ################# |
1078 | +message (STATUS "> XGamma:") |
1079 | pkg_check_modules (XGAMMA_PACKAGE x11 xxf86vm) |
1080 | if ("${XGAMMA_PACKAGE_FOUND}" STREQUAL "") |
1081 | message (STATUS "Could not find xxf86vm; Cairo-Dock won't be built with Xgamma applet.") |
1082 | + message (WARNING "These modules are required to compile XGamma applet: x11 and xxf86vm") |
1083 | + set (MODULES_MISSING "${MODULES_MISSING} x11 xxf86vm") |
1084 | set (with_xgamma "no") |
1085 | else() |
1086 | set (GETTEXT_XGAMMA ${GETTEXT_PLUGINS}) |
1087 | - set (VERSION_XGAMMA "1.2.0") |
1088 | + set (VERSION_XGAMMA "1.2.1") |
1089 | set (PACKAGE_XGAMMA "cd-Xgamma") |
1090 | set (with_xgamma "yes") |
1091 | set (xgammadatadir "${pluginsdatadir}/Xgamma") |
1092 | @@ -926,16 +1162,37 @@ |
1093 | message (STATUS " - with Weblets applet: ${with_weblets}") |
1094 | message (STATUS " - with Xgamma applet: ${with_xgamma}") |
1095 | message (STATUS " - with Recent-Events applet: ${with_recent_events}") |
1096 | +message (STATUS " - with UPower support: ${with_upower_support}") |
1097 | message (STATUS " - with Python interface: ${with_python}") |
1098 | message (STATUS " - with Ruby interface: ${with_ruby}") |
1099 | message (STATUS " - with Mono interface: ${with_mono}") |
1100 | message (STATUS " - with Vala interface: ${with_vala}") |
1101 | -message (STATUS " - with Vala Translator (valac) : ${with_valac}") |
1102 | +message (STATUS " - with Vala Translator (valac): ${with_valac}") |
1103 | message (STATUS "Unstable:") |
1104 | message (STATUS " - with Disks applet: ${with_disks}") |
1105 | message (STATUS " - with Doncky applet: ${with_doncky}") |
1106 | +message (STATUS " - with Impulse applet: ${with_impulse}") |
1107 | +message (STATUS " - with KDE experimental support: ${with_kde_integration2}") |
1108 | message (STATUS " - with Network-Monitor applet: ${with_network_monitor}") |
1109 | message (STATUS " - with Scooby-Do applet: ${with_scooby_do}") |
1110 | -message (STATUS "Unsupported:") |
1111 | +message (STATUS "Deprecated:") |
1112 | message (STATUS " - with old Gnome support: ${with_gnome_integration_old}") |
1113 | + |
1114 | +if (NOT "${MODULES_MISSING}" STREQUAL "") |
1115 | + message ("") |
1116 | + message (STATUS "WARNING: It seems that one (or more) module(s) is (are) missing:${MODULES_MISSING}") |
1117 | + message (STATUS "It can be interesting to install them (even more if you're a maintainer of Cairo-Dock's packages).") |
1118 | +endif () |
1119 | + |
1120 | +if (NOT "${PROGRAMS_MISSING}" STREQUAL "") |
1121 | + message ("") |
1122 | + message (STATUS "WARNING: It seems that one (or more) program(s) or package(s) is (are) missing:${PROGRAMS_MISSING}") |
1123 | + message (STATUS "It can be interesting to install them (even more if you're a maintainer of Cairo-Dock's packages).") |
1124 | +endif () |
1125 | + |
1126 | +if (NOT "${MODULES_INTEGRATION_MISSING}" STREQUAL "") |
1127 | + message ("") |
1128 | + message (STATUS "WARNING: It seems that one (or more) module(s) for the integration with the system is (are) missing:${MODULES_INTEGRATION_MISSING}") |
1129 | + message (STATUS "It's maybe not required for the user but it's recommended to install them if you're a maintainer of Cairo-Dock's packages.") |
1130 | +endif () |
1131 | message ("") |
1132 | |
1133 | === modified file 'Cairo-Penguin/data/Cairo-Penguin.conf.in' |
1134 | --- Cairo-Penguin/data/Cairo-Penguin.conf.in 2011-04-20 20:46:51 +0000 |
1135 | +++ Cairo-Penguin/data/Cairo-Penguin.conf.in 2011-08-09 20:07:46 +0000 |
1136 | @@ -1,9 +1,9 @@ |
1137 | -#!en;@VERSION_CAIRO_PENGUIN@ |
1138 | +#@VERSION_CAIRO_PENGUIN@ |
1139 | |
1140 | #[gtk-about] |
1141 | [Icon] |
1142 | |
1143 | -#F[Applet] |
1144 | +#F[Icon] |
1145 | frame_maininfo= |
1146 | |
1147 | #d Name of the dock it belongs to: |
1148 | @@ -11,13 +11,12 @@ |
1149 | |
1150 | #s Name of the icon as it will appear in its caption in the dock: |
1151 | name = |
1152 | - |
1153 | -#F[Display] |
1154 | -frame_display= |
1155 | + #v |
1156 | +sep_display= |
1157 | |
1158 | icon = |
1159 | |
1160 | -#j+[0;128] Icon size for busy penguin: |
1161 | +#j+[0;128] Desired icon size for this applet |
1162 | #{Set to 0 to use the default applet size} |
1163 | icon size = 0;0 |
1164 | |
1165 | |
1166 | === modified file 'Clipper/data/Clipper.conf.in' |
1167 | --- Clipper/data/Clipper.conf.in 2011-04-20 20:46:51 +0000 |
1168 | +++ Clipper/data/Clipper.conf.in 2011-08-09 20:07:46 +0000 |
1169 | @@ -1,23 +1,22 @@ |
1170 | -#!en;@VERSION_CLIPPER@ |
1171 | +#@VERSION_CLIPPER@ |
1172 | |
1173 | #[gtk-about] |
1174 | [Icon] |
1175 | |
1176 | -#F[Applet] |
1177 | +#F[Icon] |
1178 | frame_maininfo= |
1179 | |
1180 | #d Name of the dock it belongs to: |
1181 | dock name = |
1182 | |
1183 | #s Name of the icon as it will appear in its caption in the dock: |
1184 | -name = Clipboard |
1185 | - |
1186 | -#F[Display] |
1187 | -frame_display= |
1188 | +name = |
1189 | + #v |
1190 | +sep_display= |
1191 | |
1192 | #S+ Image filename: |
1193 | #{Leave empty to use the default one.} |
1194 | -icon = |
1195 | +icon=accessories-text-editor.svg |
1196 | |
1197 | #j+[0;128] Desired icon size for this applet |
1198 | #{Set to 0 to use the default applet size} |
1199 | |
1200 | === modified file 'Clipper/src/applet-clipboard.c' |
1201 | --- Clipper/src/applet-clipboard.c 2011-04-20 20:46:51 +0000 |
1202 | +++ Clipper/src/applet-clipboard.c 2011-08-09 20:07:46 +0000 |
1203 | @@ -451,6 +451,9 @@ |
1204 | pImage = gtk_image_new_from_pixbuf (pixbuf); |
1205 | g_free (cIconFilePath); |
1206 | g_object_unref (pixbuf); |
1207 | +#if (GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION >= 16) |
1208 | + gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (pMenuItem), TRUE); |
1209 | +#endif |
1210 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (pMenuItem), pImage); |
1211 | } |
1212 | gtk_menu_shell_append (GTK_MENU_SHELL (pMenu), pMenuItem); |
1213 | |
1214 | === added directory 'Composite-Manager' |
1215 | === added file 'Composite-Manager/CMakeLists.txt' |
1216 | --- Composite-Manager/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
1217 | +++ Composite-Manager/CMakeLists.txt 2011-08-09 20:07:46 +0000 |
1218 | @@ -0,0 +1,2 @@ |
1219 | +add_subdirectory(src) |
1220 | +add_subdirectory(data) |
1221 | |
1222 | === added directory 'Composite-Manager/data' |
1223 | === added file 'Composite-Manager/data/CMakeLists.txt' |
1224 | --- Composite-Manager/data/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
1225 | +++ Composite-Manager/data/CMakeLists.txt 2011-08-09 20:07:46 +0000 |
1226 | @@ -0,0 +1,10 @@ |
1227 | + |
1228 | +########### install files ############### |
1229 | + |
1230 | +install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Composite-Manager.conf |
1231 | + preview.jpg |
1232 | + icon.png |
1233 | + composite-on.png |
1234 | + composite-off.png |
1235 | + DESTINATION ${composite_managerdatadir}) |
1236 | + |
1237 | |
1238 | === added file 'Composite-Manager/data/Composite-Manager.conf.in' |
1239 | --- Composite-Manager/data/Composite-Manager.conf.in 1970-01-01 00:00:00 +0000 |
1240 | +++ Composite-Manager/data/Composite-Manager.conf.in 2011-08-09 20:07:46 +0000 |
1241 | @@ -0,0 +1,137 @@ |
1242 | +#@VERSION_COMPOSITE_MANAGER@ |
1243 | + |
1244 | +#[gtk-about] |
1245 | +[Icon] |
1246 | + |
1247 | +#F[Icon] |
1248 | +frame_maininfo= |
1249 | + |
1250 | +#d Name of the dock it belongs to: |
1251 | +dock name = |
1252 | + |
1253 | +#s Name of the icon as it will appear in its caption in the dock: |
1254 | +name = |
1255 | + #v |
1256 | +sep_display= |
1257 | + |
1258 | +icon = |
1259 | + |
1260 | +#j[0;128] Desired icon size for this applet |
1261 | +#{Set to 0 to use the default applet size} |
1262 | +icon size = 0;0 |
1263 | + |
1264 | +order= |
1265 | + |
1266 | +#F[Applet's Handbook] |
1267 | +frame_hand= |
1268 | +#A |
1269 | +handbook=Composite-Manager |
1270 | + |
1271 | + |
1272 | +#[gtk-convert] |
1273 | +[Desklet] |
1274 | + |
1275 | +#X[Position] |
1276 | +frame_pos = |
1277 | + |
1278 | +#b Lock position? |
1279 | +#{If locked, the desklet cannot be moved by simply dragging it with the left mouse button. It can still be moved with ALT + left-click.} |
1280 | +locked = false |
1281 | + |
1282 | +#j+[24;512] Desklet dimensions (width x height): |
1283 | +#{Depending on your WindowManager, you may be able to resize this with ALT + middle-click or ALT + left-click.} |
1284 | +size = 96;96 |
1285 | + |
1286 | +#i[-2048;2048] Desklet position (x, y): |
1287 | +#{Depending on your WindowManager, you may be able to move this with ALT + left-click.. Negative values are counted from the right/bottom of the screen} |
1288 | +x position=0 |
1289 | +#i[-2048;2048] ... |
1290 | +y position=0 |
1291 | + |
1292 | +#I[-180;180] Rotation: |
1293 | +#{You can quickly rotate the desklet with the mouse, by dragging the little buttons on its left and top sides.} |
1294 | +rotation = 0 |
1295 | + |
1296 | +#X[Visibility] |
1297 | +frame_visi = |
1298 | + |
1299 | +#b Is detached from the dock |
1300 | +initially detached=false |
1301 | +#l[Normal;Keep above;Keep below;Keep on widget layer;Reserve space] Visibility: |
1302 | +#{for CompizFusion's "widget layer", set behaviour in Compiz to: (class=Cairo-dock & type=utility)} |
1303 | +accessibility=0 |
1304 | +#b Should be visible on all desktops? |
1305 | +sticky=true |
1306 | + |
1307 | + |
1308 | +#F[Decorations;gtk-orientation-portrait] |
1309 | +frame_deco= |
1310 | + |
1311 | +#o+ Choose a decoration theme for this desklet: |
1312 | +#{Choose 'Custom decorations' to define your own decorations below.} |
1313 | +decorations = default |
1314 | + |
1315 | +#v |
1316 | +sep_deco = |
1317 | + |
1318 | +#S+ Background image: |
1319 | +#{Image to be displayed below drawings, e.g. a frame. Leave empty for no image.} |
1320 | +bg desklet = |
1321 | +#e+[0;1] Background transparency: |
1322 | +bg alpha = 1 |
1323 | +#i+[0;256] Left offset: |
1324 | +#{in pixels. Use this to adjust the left position of drawings.} |
1325 | +left offset = 0 |
1326 | +#i+[0;256] Top offset: |
1327 | +#{in pixels. Use this to adjust the top position of drawings.} |
1328 | +top offset = 0 |
1329 | +#i+[0;256] Right offset: |
1330 | +#{in pixels. Use this to adjust the right position of drawings.} |
1331 | +right offset = 0 |
1332 | +#i+[0;256] Bottom offset: |
1333 | +#{in pixels. Use this to adjust the bottom position of drawings.} |
1334 | +bottom offset = 0 |
1335 | +#S+ Foreground image: |
1336 | +#{Image to be displayed above the drawings, e.g. a reflection. Leave empty for no image.} |
1337 | +fg desklet = |
1338 | +#e+[0;1] Foreground tansparency: |
1339 | +fg alpha = 1 |
1340 | + |
1341 | + |
1342 | +#[gtk-preferences] |
1343 | +[Configuration] |
1344 | + |
1345 | +#F[Style;gtk-color-picker] |
1346 | +frame_style = |
1347 | + |
1348 | +#S+ Image when composite is active: |
1349 | +#{Leave empty to use the default one.} |
1350 | +icon on = |
1351 | + |
1352 | +#S+ Image when composite is inactive: |
1353 | +#{Leave empty to use the default one.} |
1354 | +icon off = |
1355 | + |
1356 | + |
1357 | +#F[Behaviour;gtk-execute] |
1358 | +frame_behav = |
1359 | + |
1360 | +#E[;Compiz;KWin;Xfwm;Metacity] Composite window-manager: |
1361 | +#{Let empty to use the default one. Alternatively, you can set any command you want.} |
1362 | +compositor = |
1363 | + |
1364 | +#E[;Compiz;KWin;Xfwm;Metacity] Fallback window-manager: |
1365 | +#{Let empty to use the default one. Alternatively, you can set any command you want.} |
1366 | +fallback = |
1367 | + |
1368 | +#b Ask before switching: |
1369 | +ask = true |
1370 | + |
1371 | +#v |
1372 | +sep_act= |
1373 | + |
1374 | +#l[Edit Window-Manager settings;Reload Window-Manager;Show desktop;Expose all the desktops;Expose all the windows;Show the Widget Layer] Action on middle-click: |
1375 | +action on click = 0 |
1376 | + |
1377 | +#k Shortkey to toggle the composite ON/OFF: |
1378 | +shortkey = <Control>F12 |
1379 | |
1380 | === added file 'Composite-Manager/data/composite-off.png' |
1381 | Binary files Composite-Manager/data/composite-off.png 1970-01-01 00:00:00 +0000 and Composite-Manager/data/composite-off.png 2011-08-09 20:07:46 +0000 differ |
1382 | === added file 'Composite-Manager/data/composite-on.png' |
1383 | Binary files Composite-Manager/data/composite-on.png 1970-01-01 00:00:00 +0000 and Composite-Manager/data/composite-on.png 2011-08-09 20:07:46 +0000 differ |
1384 | === added file 'Composite-Manager/data/icon.png' |
1385 | Binary files Composite-Manager/data/icon.png 1970-01-01 00:00:00 +0000 and Composite-Manager/data/icon.png 2011-08-09 20:07:46 +0000 differ |
1386 | === added file 'Composite-Manager/data/preview.jpg' |
1387 | Binary files Composite-Manager/data/preview.jpg 1970-01-01 00:00:00 +0000 and Composite-Manager/data/preview.jpg 2011-08-09 20:07:46 +0000 differ |
1388 | === added directory 'Composite-Manager/src' |
1389 | === added file 'Composite-Manager/src/CMakeLists.txt' |
1390 | --- Composite-Manager/src/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
1391 | +++ Composite-Manager/src/CMakeLists.txt 2011-08-09 20:07:46 +0000 |
1392 | @@ -0,0 +1,39 @@ |
1393 | + |
1394 | +########### sources ############### |
1395 | + |
1396 | +SET(MODULE_SRCS |
1397 | + applet-struct.h |
1398 | + applet-init.c applet-init.h |
1399 | + applet-config.c applet-config.h |
1400 | + applet-composite-manager.c applet-composite-manager.h |
1401 | + applet-notifications.c applet-notifications.h |
1402 | +) |
1403 | + |
1404 | +add_library(${PACKAGE_COMPOSITE_MANAGER} SHARED ${MODULE_SRCS}) |
1405 | + |
1406 | +########### compil ############### |
1407 | +add_definitions (-DMY_APPLET_SHARE_DATA_DIR="${composite_managerdatadir}") |
1408 | +add_definitions (-DMY_APPLET_PREVIEW_FILE="preview.jpg") |
1409 | +add_definitions (-DMY_APPLET_CONF_FILE="Composite-Manager.conf") |
1410 | +add_definitions (-DMY_APPLET_USER_DATA_DIR="Composite-Manager") |
1411 | +add_definitions (-DMY_APPLET_VERSION="${VERSION_COMPOSITE_MANAGER}") |
1412 | +add_definitions (-DMY_APPLET_GETTEXT_DOMAIN="${GETTEXT_COMPOSITE_MANAGER}") |
1413 | +add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}") |
1414 | +add_definitions (-DMY_APPLET_ICON_FILE="icon.png") |
1415 | +### uncomment the following line to allow multi-instance applet. |
1416 | +#add_definitions (-DCD_APPLET_MULTI_INSTANCE="1") |
1417 | +### uncomment the following line to allow extended OpenGL drawing. |
1418 | +#add_definitions (-DGL_GLEXT_PROTOTYPES="1") |
1419 | + |
1420 | +include_directories ( |
1421 | + ${PACKAGE_INCLUDE_DIRS}) |
1422 | + |
1423 | +link_directories ( |
1424 | + ${PACKAGE_LIBRARY_DIRS}) |
1425 | + |
1426 | +target_link_libraries (${PACKAGE_COMPOSITE_MANAGER} |
1427 | + ${PACKAGE_LIBRARIES}) |
1428 | + |
1429 | +########### install files ############### |
1430 | + |
1431 | +install(TARGETS ${PACKAGE_COMPOSITE_MANAGER} DESTINATION ${pluginsdir}) |
1432 | |
1433 | === added file 'Composite-Manager/src/applet-composite-manager.c' |
1434 | --- Composite-Manager/src/applet-composite-manager.c 1970-01-01 00:00:00 +0000 |
1435 | +++ Composite-Manager/src/applet-composite-manager.c 2011-08-09 20:07:46 +0000 |
1436 | @@ -0,0 +1,535 @@ |
1437 | +/** |
1438 | +* This file is a part of the Cairo-Dock project |
1439 | +* |
1440 | +* Copyright : (C) see the 'copyright' file. |
1441 | +* E-mail : see the 'copyright' file. |
1442 | +* |
1443 | +* This program is free software; you can redistribute it and/or |
1444 | +* modify it under the terms of the GNU General Public License |
1445 | +* as published by the Free Software Foundation; either version 3 |
1446 | +* of the License, or (at your option) any later version. |
1447 | +* |
1448 | +* This program is distributed in the hope that it will be useful, |
1449 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1450 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1451 | +* GNU General Public License for more details. |
1452 | +* You should have received a copy of the GNU General Public License |
1453 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1454 | +*/ |
1455 | + |
1456 | +#define _BSD_SOURCE |
1457 | +#include <string.h> |
1458 | +#include <stdlib.h> |
1459 | +#include <stdio.h> |
1460 | +#include <unistd.h> |
1461 | +#include <glib/gstdio.h> |
1462 | +#include <cairo-dock.h> |
1463 | + |
1464 | +#include "applet-struct.h" |
1465 | +#include "applet-composite-manager.h" |
1466 | + |
1467 | + |
1468 | + /////////////////// |
1469 | + /// WM BACKENDS /// |
1470 | +/////////////////// |
1471 | + |
1472 | +static CDWM *_get_wm_by_name (const gchar *cName) |
1473 | +{ |
1474 | + int i; |
1475 | + for (i = 0; i < NB_WM; i ++) |
1476 | + { |
1477 | + if (strcmp (cName, myData.pWmList[i].cName) == 0) |
1478 | + return &myData.pWmList[i]; |
1479 | + } |
1480 | + return NULL; |
1481 | +} |
1482 | +static CDWM *_get_wm_by_index (CDWMIndex n) |
1483 | +{ |
1484 | + if (n < NB_WM) |
1485 | + return &myData.pWmList[n]; |
1486 | + else |
1487 | + return NULL; |
1488 | +} |
1489 | + |
1490 | +static void _set_metacity_composite (gboolean bActive) |
1491 | +{ |
1492 | + int r; |
1493 | + if (bActive) |
1494 | + r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true"); |
1495 | + else |
1496 | + r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false"); |
1497 | +} |
1498 | +static void _set_xfwm_composite (gboolean bActive) |
1499 | +{ |
1500 | + int r; |
1501 | + if (bActive) |
1502 | + r = system ("xfconf-query -c xfwm4 -p '/general/use_compositing' -t 'bool' -s 'true'"); |
1503 | + else |
1504 | + r = system ("xfconf-query -c xfwm4 -p '/general/use_compositing' -t 'bool' -s 'false'"); |
1505 | +} |
1506 | +static void _set_kwin_composite (gboolean bActive) |
1507 | +{ |
1508 | + int r; |
1509 | + if (bActive) |
1510 | + r = system ("if test \"`qdbus org.kde.kwin /KWin compositingActive`\" = \"false\";then qdbus org.kde.kwin /KWin toggleCompositing; fi"); // not active, so activating |
1511 | + else |
1512 | + r = system ("if test \"`qdbus org.kde.kwin /KWin compositingActive`\" = \"true\"; then qdbus org.kde.kwin /KWin toggleCompositing; fi"); // active, so deactivating |
1513 | +} |
1514 | +static void _define_known_wms (void) |
1515 | +{ |
1516 | + myData.pWmList[CD_COMPIZ].cName = "Compiz"; |
1517 | + myData.pWmList[CD_COMPIZ].cCommand = "compiz --replace"; |
1518 | + myData.pWmList[CD_COMPIZ].activate_composite = NULL; |
1519 | + myData.pWmList[CD_COMPIZ].cConfigTool = "ccsm"; |
1520 | + |
1521 | + myData.pWmList[CD_KWIN].cName = "KWin"; |
1522 | + myData.pWmList[CD_KWIN].cCommand = "kwin --replace"; |
1523 | + myData.pWmList[CD_KWIN].activate_composite = _set_kwin_composite; |
1524 | + myData.pWmList[CD_KWIN].cConfigTool = NULL; /// TODO: find the config tool... |
1525 | + |
1526 | + myData.pWmList[CD_XFWM].cName = "Xfwm"; |
1527 | + myData.pWmList[CD_XFWM].cCommand = "xfwm4 --replace"; |
1528 | + myData.pWmList[CD_XFWM].activate_composite = _set_xfwm_composite; |
1529 | + myData.pWmList[CD_XFWM].cConfigTool = "xfwm4-settings"; // there is also xfwm4-tweaks-settings, wish they merge both ... |
1530 | + |
1531 | + myData.pWmList[CD_METACITY].cName = "Metacity"; |
1532 | + myData.pWmList[CD_METACITY].cCommand = "metacity --replace"; |
1533 | + myData.pWmList[CD_METACITY].activate_composite = _set_metacity_composite; |
1534 | + myData.pWmList[CD_METACITY].cConfigTool = "gconf-editor /apps/metacity"; |
1535 | + |
1536 | + myData.pWmList[CD_CUSTOM_WMFB].cName = "Fallback"; |
1537 | + myData.pWmList[CD_CUSTOM_WMFB].cCommand = NULL; |
1538 | + myData.pWmList[CD_CUSTOM_WMFB].activate_composite = NULL; |
1539 | + myData.pWmList[CD_CUSTOM_WMFB].bIsAvailable = TRUE; |
1540 | + |
1541 | + myData.pWmList[CD_CUSTOM_WMC].cName = "Composite"; |
1542 | + myData.pWmList[CD_CUSTOM_WMC].cCommand = NULL; |
1543 | + myData.pWmList[CD_CUSTOM_WMC].activate_composite = NULL; |
1544 | + myData.pWmList[CD_CUSTOM_WMC].bIsAvailable = TRUE; |
1545 | +} |
1546 | + |
1547 | +static void _check_available_wms (gchar *cWhich) |
1548 | +{ |
1549 | + if (cWhich == NULL) // no known WM is present, skip the check. |
1550 | + return; |
1551 | + |
1552 | + CDWM *wm; |
1553 | + wm = _get_wm_by_index (CD_COMPIZ); |
1554 | + wm->bIsAvailable = (strstr (cWhich, "compiz") != NULL); |
1555 | + wm = _get_wm_by_index (CD_KWIN); |
1556 | + wm->bIsAvailable = (strstr (cWhich, "kwin") != NULL); |
1557 | + wm = _get_wm_by_index (CD_XFWM); |
1558 | + wm->bIsAvailable = (strstr (cWhich, "xfwm4") != NULL); |
1559 | + wm = _get_wm_by_index (CD_METACITY); |
1560 | + wm->bIsAvailable = (strstr (cWhich, "metacity") != NULL); |
1561 | +} |
1562 | + |
1563 | +static CDWMIndex _check_current_wm (gchar *cPs) |
1564 | +{ |
1565 | + if (cPs == NULL) // no known WM is present, skip the check. |
1566 | + return -1; |
1567 | + |
1568 | + if (strstr (cPs, "compiz") != NULL) |
1569 | + return CD_COMPIZ; |
1570 | + if (strstr (cPs, "kwin") != NULL) |
1571 | + return CD_KWIN; |
1572 | + if (strstr (cPs, "xfwm4") != NULL) |
1573 | + return CD_XFWM; |
1574 | + if (strstr (cPs, "metacity") != NULL) |
1575 | + return CD_METACITY; |
1576 | + |
1577 | + return -1; |
1578 | +} |
1579 | + |
1580 | + |
1581 | + //////////////////////// |
1582 | + /// COMPOSITE SIGNAL /// |
1583 | +//////////////////////// |
1584 | + |
1585 | +static void _on_composited_changed (GdkScreen *pScreen, gpointer data) |
1586 | +{ |
1587 | + myData.bIsComposited = gdk_screen_is_composited (pScreen); |
1588 | + cd_draw_current_state (); |
1589 | +} |
1590 | +static void _start_watching_composite_state (void) |
1591 | +{ |
1592 | + // get the current state. |
1593 | + GdkScreen *pScreen = gdk_screen_get_default (); |
1594 | + myData.bIsComposited = gdk_screen_is_composited (pScreen); |
1595 | + |
1596 | + // draw it. |
1597 | + cd_draw_current_state (); |
1598 | + |
1599 | + // listen for future changes. |
1600 | + g_signal_connect (G_OBJECT (pScreen), "composited-changed", G_CALLBACK(_on_composited_changed), NULL); |
1601 | +} |
1602 | + |
1603 | + |
1604 | + /////////////////// |
1605 | + /// PREFERED WM /// |
1606 | +/////////////////// |
1607 | + |
1608 | +static CDWM *_get_prefered_wmc (CDWMIndex iCurrentWm) |
1609 | +{ |
1610 | + g_print ("%s (%s, %d)\n", __func__, myConfig.cWmCompositor, iCurrentWm); |
1611 | + CDWM *wm; |
1612 | + if (myConfig.cWmCompositor != NULL) // a composite WM is defined. |
1613 | + { |
1614 | + wm = _get_wm_by_name (myConfig.cWmCompositor); |
1615 | + if (wm == NULL) // not one of the known WM -> define and take the custom one. |
1616 | + { |
1617 | + wm = _get_wm_by_index (CD_CUSTOM_WMC); |
1618 | + g_free ((gchar*)wm->cCommand); |
1619 | + wm->cCommand = g_strdup (myConfig.cWmCompositor); |
1620 | + return wm; |
1621 | + } |
1622 | + else if (wm->bIsAvailable) |
1623 | + return wm; |
1624 | + } |
1625 | + |
1626 | + // no WM defined, or the one defined is not available -> check if a suitable one is running. |
1627 | + if (iCurrentWm < NB_WM) // one of the know WM is running |
1628 | + { |
1629 | + if (myData.bIsComposited) // and it provides composite => let's take it! |
1630 | + { |
1631 | + wm = _get_wm_by_index (iCurrentWm); |
1632 | + if (wm->bIsAvailable) // just to be sure. |
1633 | + return wm; |
1634 | + } |
1635 | + } |
1636 | + |
1637 | + // no succes so far, take the most suitable one. |
1638 | + int index[NB_COMPOSITE_WM] = {CD_COMPIZ, CD_KWIN, CD_XFWM, CD_METACITY}; // in this order by default. |
1639 | + switch (g_iDesktopEnv) |
1640 | + { |
1641 | + case CAIRO_DOCK_GNOME: |
1642 | + index[1] = CD_METACITY; |
1643 | + index[3] = CD_KWIN; |
1644 | + break; |
1645 | + case CAIRO_DOCK_XFCE: |
1646 | + index[1] = CD_XFWM; |
1647 | + index[2] = CD_KWIN; |
1648 | + break; |
1649 | + case CAIRO_DOCK_KDE: |
1650 | + default: |
1651 | + break; |
1652 | + } |
1653 | + int i; |
1654 | + for (i = 0; i < NB_COMPOSITE_WM; i ++) |
1655 | + { |
1656 | + wm = _get_wm_by_index (index[i]); |
1657 | + g_print (" %d) %s, %d\n", index[i], wm->cName, wm->bIsAvailable); |
1658 | + if (wm->bIsAvailable) |
1659 | + return wm; |
1660 | + } |
1661 | + return NULL; |
1662 | +} |
1663 | + |
1664 | +static CDWM *_get_prefered_wmfb (CDWMIndex iCurrentWm) |
1665 | +{ |
1666 | + g_print ("%s (%s, %d)\n", __func__, myConfig.cWmFallback, iCurrentWm); |
1667 | + CDWM *wm; |
1668 | + if (myConfig.cWmFallback != NULL) // a fallback WM is defined. |
1669 | + { |
1670 | + wm = _get_wm_by_name (myConfig.cWmFallback); |
1671 | + if (wm == NULL) // not one of the known WM -> define and take the custom one. |
1672 | + { |
1673 | + wm = _get_wm_by_index (CD_CUSTOM_WMFB); |
1674 | + g_free ((gchar*)wm->cCommand); |
1675 | + wm->cCommand = g_strdup (myConfig.cWmFallback); |
1676 | + return wm; |
1677 | + } |
1678 | + else if (wm->bIsAvailable) |
1679 | + return wm; |
1680 | + } |
1681 | + |
1682 | + // no WM defined, or the one defined is not available -> check if a suitable one is running. |
1683 | + if (iCurrentWm < NB_WM) // one of the know WM is running |
1684 | + { |
1685 | + if (!myData.bIsComposited) // and it is a fallback => let's take it! |
1686 | + { |
1687 | + wm = _get_wm_by_index (iCurrentWm); |
1688 | + g_print ("current wm: %d, %d\n", iCurrentWm, wm->bIsAvailable); |
1689 | + if (wm->bIsAvailable) // just to be sure. |
1690 | + return wm; |
1691 | + } |
1692 | + } |
1693 | + |
1694 | + // no succes so far, take the most suitable one. |
1695 | + int index[NB_FALLBACK_WM] = {CD_METACITY, CD_XFWM, CD_KWIN}; // in this order by default. |
1696 | + switch (g_iDesktopEnv) |
1697 | + { |
1698 | + case CAIRO_DOCK_GNOME: |
1699 | + index[0] = CD_METACITY; |
1700 | + index[1] = CD_XFWM; |
1701 | + break; |
1702 | + case CAIRO_DOCK_XFCE: |
1703 | + index[0] = CD_XFWM; |
1704 | + index[1] = CD_METACITY; |
1705 | + break; |
1706 | + case CAIRO_DOCK_KDE: |
1707 | + index[0] = CD_KWIN; |
1708 | + index[1] = CD_METACITY; |
1709 | + index[2] = CD_XFWM; |
1710 | + break; |
1711 | + } |
1712 | + int i; |
1713 | + for (i = 0; i < NB_FALLBACK_WM; i ++) |
1714 | + { |
1715 | + wm = _get_wm_by_index (index[i]); |
1716 | + g_print (" %s (%d)\n", wm->cName, wm->bIsAvailable); |
1717 | + if (wm->bIsAvailable) |
1718 | + return wm; |
1719 | + } |
1720 | + return NULL; |
1721 | +} |
1722 | + |
1723 | +static inline gchar *_get_running_wm (void) |
1724 | +{ |
1725 | + return cairo_dock_launch_command_sync ("pgrep -l \"kwin$|compiz$|xfwm4$|metacity$\""); // -l = write the name of the program (not the command next to the PID in 'ps -ef'. we add a '$' after the names to avoid listing things like compiz-decorator or xfwm4-settings |
1726 | +} |
1727 | +static void _define_prefered_wms (gchar *cPs) |
1728 | +{ |
1729 | + // get the compositor and fallback WMs |
1730 | + CDWMIndex iCurrentWm = _check_current_wm (cPs); |
1731 | + myData.wmc = _get_prefered_wmc (iCurrentWm); |
1732 | + myData.wmfb = _get_prefered_wmfb (iCurrentWm); |
1733 | + g_print ("***** WM: %s / %s\n", myData.wmc?myData.wmc->cName:NULL, myData.wmfb?myData.wmfb->cName:NULL); |
1734 | +} |
1735 | +void cd_define_prefered_wms (void) |
1736 | +{ |
1737 | + gchar *ps = _get_running_wm (); |
1738 | + _define_prefered_wms (ps); |
1739 | + g_free (ps); |
1740 | +} |
1741 | + |
1742 | + ///////////////// |
1743 | + /// INIT/STOP /// |
1744 | +///////////////// |
1745 | + |
1746 | +static void _check_wms (CDSharedMemory *pSharedMemory) |
1747 | +{ |
1748 | + pSharedMemory->which = cairo_dock_launch_command_sync ("which compiz kwin xfwm4 metacity"); |
1749 | + |
1750 | + pSharedMemory->ps = _get_running_wm (); |
1751 | +} |
1752 | +static void _update_from_data (CDSharedMemory *pSharedMemory) |
1753 | +{ |
1754 | + _check_available_wms (pSharedMemory->which); |
1755 | + |
1756 | + _define_prefered_wms (pSharedMemory->ps); // we do it once we know the current state. |
1757 | + |
1758 | + cairo_dock_discard_task (myData.pTask); |
1759 | + myData.pTask = NULL; |
1760 | +} |
1761 | + |
1762 | +static void _free_shared_memory (CDSharedMemory *pSharedMemory) |
1763 | +{ |
1764 | + g_free (pSharedMemory->which); |
1765 | + g_free (pSharedMemory->ps); |
1766 | + g_free (pSharedMemory); |
1767 | +} |
1768 | +void cd_init_wms (void) |
1769 | +{ |
1770 | + _define_known_wms (); |
1771 | + |
1772 | + _start_watching_composite_state (); |
1773 | + |
1774 | + CDSharedMemory *pSharedMemory = g_new0 (CDSharedMemory, 1); |
1775 | + myData.pTask = cairo_dock_new_task_full (0, // one-shot |
1776 | + (CairoDockGetDataAsyncFunc) _check_wms, |
1777 | + (CairoDockUpdateSyncFunc) _update_from_data, |
1778 | + (GFreeFunc) _free_shared_memory, |
1779 | + pSharedMemory); |
1780 | + cairo_dock_launch_task_delayed (myData.pTask, 3000); // 3s delay, since we don't need these info right away. |
1781 | +} |
1782 | + |
1783 | + |
1784 | +void cd_stop_wms (void) |
1785 | +{ |
1786 | + // discard task. |
1787 | + cairo_dock_discard_task (myData.pTask); |
1788 | + |
1789 | + // stop listening |
1790 | + GdkScreen *pScreen = gdk_screen_get_default (); |
1791 | + g_signal_handlers_disconnect_by_func (G_OBJECT(pScreen), _on_composited_changed, NULL); |
1792 | + |
1793 | + // reset custom WMs. |
1794 | + CDWM *wm; |
1795 | + wm = _get_wm_by_index (CD_CUSTOM_WMC); |
1796 | + g_free ((gchar*)wm->cCommand); |
1797 | + wm = _get_wm_by_index (CD_CUSTOM_WMFB); |
1798 | + g_free ((gchar*)wm->cCommand); |
1799 | +} |
1800 | + |
1801 | + |
1802 | + //////////// |
1803 | + /// DRAW /// |
1804 | +//////////// |
1805 | + |
1806 | +void cd_draw_current_state (void) |
1807 | +{ |
1808 | + g_print ("%s (%d)\n", __func__, myData.bIsComposited); |
1809 | + if (myData.bIsComposited) |
1810 | + CD_APPLET_SET_USER_IMAGE_ON_MY_ICON (myConfig.cIconCompositeON, "composite-on.png"); |
1811 | + else |
1812 | + CD_APPLET_SET_USER_IMAGE_ON_MY_ICON (myConfig.cIconCompositeOFF, "composite-off.png"); |
1813 | +} |
1814 | + |
1815 | + |
1816 | + ///////////////////// |
1817 | + /// TOGGLE ON/OFF /// |
1818 | +///////////////////// |
1819 | + |
1820 | +static gboolean _activate_composite_delayed (gpointer data) |
1821 | +{ |
1822 | + if (data) |
1823 | + { |
1824 | + if (myData.wmc->activate_composite != NULL) |
1825 | + myData.wmc->activate_composite (TRUE); |
1826 | + } |
1827 | + else |
1828 | + { |
1829 | + if (myData.wmfb->activate_composite != NULL) |
1830 | + myData.wmfb->activate_composite (FALSE); |
1831 | + } |
1832 | + return FALSE; |
1833 | +} |
1834 | + |
1835 | +static gboolean _wm_is_running (CDWM *wm) |
1836 | +{ |
1837 | + const gchar *cCommand = wm->cCommand; |
1838 | + gchar *cWhich = g_strdup_printf ("pgrep %s$", cCommand); // see above for the '$' character. |
1839 | + gchar *str = strchr (cWhich+6, ' '); // remove any parameter to the command, we just want the program name. |
1840 | + if (str) // a space is found. |
1841 | + { |
1842 | + *str = '$'; |
1843 | + *(str+1) = '\0'; |
1844 | + } |
1845 | + gchar *cResult = cairo_dock_launch_command_sync (cWhich); |
1846 | + gboolean bIsRunning = (cResult != NULL && *cResult != '\0'); |
1847 | + |
1848 | + g_free (cWhich); |
1849 | + g_free (cResult); |
1850 | + return bIsRunning; |
1851 | +} |
1852 | + |
1853 | +static void cd_turn_composite_on (void) |
1854 | +{ |
1855 | + if (myData.wmc == NULL) // no compositor. |
1856 | + { |
1857 | + cairo_dock_show_temporary_dialog_with_icon (D_("No compositor is available."), myIcon, myContainer, 6000, "same icon"); |
1858 | + return; |
1859 | + } |
1860 | + |
1861 | + // if not already launched, launch it. |
1862 | + if (! _wm_is_running (myData.wmc)) // not running |
1863 | + { |
1864 | + cairo_dock_launch_command (myData.wmc->cCommand); |
1865 | + g_timeout_add_seconds (2, _activate_composite_delayed, GINT_TO_POINTER (1)); // let the WM start for 2s. |
1866 | + } |
1867 | + else // already running, just toggle composite ON. |
1868 | + { |
1869 | + if (myData.wmc->activate_composite != NULL) |
1870 | + myData.wmc->activate_composite (TRUE); |
1871 | + else |
1872 | + cairo_dock_show_temporary_dialog_with_icon (D_("No compositor is available."), myIcon, myContainer, 6000, "same icon"); |
1873 | + } |
1874 | +} |
1875 | + |
1876 | +static void cd_turn_composite_off (void) |
1877 | +{ |
1878 | + if (myData.wmfb == NULL) // no fallback. |
1879 | + { |
1880 | + cairo_dock_show_temporary_dialog_with_icon (D_("No fallback is available."), myIcon, myContainer, 6000, "same icon"); |
1881 | + return; |
1882 | + } |
1883 | + |
1884 | + // if not already launched, launch it. |
1885 | + if (! _wm_is_running (myData.wmfb)) // not running |
1886 | + { |
1887 | + cairo_dock_launch_command (myData.wmfb->cCommand); |
1888 | + g_timeout_add_seconds (2, _activate_composite_delayed, 0); // let the WM start for 2s. |
1889 | + } |
1890 | + else // already running, just toggle composite OFF. |
1891 | + { |
1892 | + if (myData.wmfb->activate_composite != NULL) |
1893 | + myData.wmfb->activate_composite (FALSE); |
1894 | + else |
1895 | + cairo_dock_show_temporary_dialog_with_icon (D_("No fallback is available."), myIcon, myContainer, 6000, "same icon"); |
1896 | + } |
1897 | +} |
1898 | + |
1899 | +void cd_toggle_composite (void) |
1900 | +{ |
1901 | + if (myData.bIsComposited) |
1902 | + cd_turn_composite_off (); |
1903 | + else |
1904 | + cd_turn_composite_on (); |
1905 | +} |
1906 | + |
1907 | + |
1908 | + /////////////////// |
1909 | + /// CONFIG TOOL /// |
1910 | +/////////////////// |
1911 | + |
1912 | +static const gchar *_get_config_tool (void) |
1913 | +{ |
1914 | + if (myData.bIsComposited && myData.wmc) |
1915 | + { |
1916 | + return myData.wmc->cConfigTool; |
1917 | + } |
1918 | + else if (!myData.bIsComposited && myData.wmfb) |
1919 | + { |
1920 | + return myData.wmfb->cConfigTool; |
1921 | + } |
1922 | + return NULL; |
1923 | +} |
1924 | +void cd_open_wm_config (void) |
1925 | +{ |
1926 | + const gchar *cConfigTool = _get_config_tool (); |
1927 | + |
1928 | + if (cConfigTool != NULL) |
1929 | + { |
1930 | + gchar *cmd = g_strdup_printf ("which %s", cConfigTool); |
1931 | + gchar *cResult = cairo_dock_launch_command_sync (cmd); |
1932 | + g_free (cmd); |
1933 | + if (cResult == NULL || *cResult != '/') |
1934 | + { |
1935 | + gchar *msg = g_strdup_printf (D_("You need to install '%s'"), cConfigTool); |
1936 | + cairo_dock_show_temporary_dialog_with_icon (msg, myIcon, myContainer, 6000, "same icon"); |
1937 | + g_free (msg); |
1938 | + } |
1939 | + else |
1940 | + { |
1941 | + cairo_dock_launch_command (cConfigTool); |
1942 | + } |
1943 | + } |
1944 | + else |
1945 | + { |
1946 | + cairo_dock_show_temporary_dialog_with_icon (D_("No configuration tool is available."), myIcon, myContainer, 6000, "same icon"); |
1947 | + } |
1948 | +} |
1949 | + |
1950 | + |
1951 | +static const gchar *_get_command (void) |
1952 | +{ |
1953 | + if (myData.bIsComposited && myData.wmc) |
1954 | + { |
1955 | + return myData.wmc->cCommand; |
1956 | + } |
1957 | + else if (!myData.bIsComposited && myData.wmfb) |
1958 | + { |
1959 | + return myData.wmfb->cCommand; |
1960 | + } |
1961 | + return NULL; |
1962 | +} |
1963 | + |
1964 | +void cd_reload_wm (void) |
1965 | +{ |
1966 | + const gchar *cCommand = _get_command (); |
1967 | + if (cCommand != NULL) |
1968 | + { |
1969 | + cairo_dock_launch_command (cCommand); |
1970 | + } |
1971 | +} |
1972 | |
1973 | === added file 'Composite-Manager/src/applet-composite-manager.h' |
1974 | --- Composite-Manager/src/applet-composite-manager.h 1970-01-01 00:00:00 +0000 |
1975 | +++ Composite-Manager/src/applet-composite-manager.h 2011-08-09 20:07:46 +0000 |
1976 | @@ -0,0 +1,46 @@ |
1977 | +/** |
1978 | +* This file is a part of the Cairo-Dock project |
1979 | +* |
1980 | +* Copyright : (C) see the 'copyright' file. |
1981 | +* E-mail : see the 'copyright' file. |
1982 | +* |
1983 | +* This program is free software; you can redistribute it and/or |
1984 | +* modify it under the terms of the GNU General Public License |
1985 | +* as published by the Free Software Foundation; either version 3 |
1986 | +* of the License, or (at your option) any later version. |
1987 | +* |
1988 | +* This program is distributed in the hope that it will be useful, |
1989 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
1990 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1991 | +* GNU General Public License for more details. |
1992 | +* You should have received a copy of the GNU General Public License |
1993 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
1994 | +*/ |
1995 | + |
1996 | +#ifndef __APPLET_COMPOSITE_MANAGER__ |
1997 | +#define __APPLET_COMPOSITE_MANAGER__ |
1998 | + |
1999 | +#include <cairo-dock.h> |
2000 | + |
2001 | + |
2002 | +void cd_init_wms (void); |
2003 | + |
2004 | +void cd_stop_wms (void); |
2005 | + |
2006 | + |
2007 | +void cd_define_prefered_wms (void); |
2008 | + |
2009 | + |
2010 | +void cd_draw_current_state (void); |
2011 | + |
2012 | + |
2013 | +void cd_toggle_composite (void); |
2014 | + |
2015 | + |
2016 | +void cd_open_wm_config (void); |
2017 | + |
2018 | + |
2019 | +void cd_reload_wm (void); |
2020 | + |
2021 | + |
2022 | +#endif |
2023 | |
2024 | === added file 'Composite-Manager/src/applet-config.c' |
2025 | --- Composite-Manager/src/applet-config.c 1970-01-01 00:00:00 +0000 |
2026 | +++ Composite-Manager/src/applet-config.c 2011-08-09 20:07:46 +0000 |
2027 | @@ -0,0 +1,63 @@ |
2028 | +/** |
2029 | +* This file is a part of the Cairo-Dock project |
2030 | +* |
2031 | +* Copyright : (C) see the 'copyright' file. |
2032 | +* E-mail : see the 'copyright' file. |
2033 | +* |
2034 | +* This program is free software; you can redistribute it and/or |
2035 | +* modify it under the terms of the GNU General Public License |
2036 | +* as published by the Free Software Foundation; either version 3 |
2037 | +* of the License, or (at your option) any later version. |
2038 | +* |
2039 | +* This program is distributed in the hope that it will be useful, |
2040 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2041 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2042 | +* GNU General Public License for more details. |
2043 | +* You should have received a copy of the GNU General Public License |
2044 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2045 | +*/ |
2046 | + |
2047 | +#include <cairo-dock.h> |
2048 | + |
2049 | +#include "applet-struct.h" |
2050 | +#include "applet-composite-manager.h" |
2051 | +#include "applet-config.h" |
2052 | + |
2053 | + |
2054 | +static void _cd_on_keybinding_pull (const char *keystring, gpointer user_data) |
2055 | +{ |
2056 | + cd_toggle_composite (); |
2057 | +} |
2058 | + |
2059 | +CD_APPLET_GET_CONFIG_BEGIN |
2060 | + myConfig.cWmCompositor = CD_CONFIG_GET_STRING ("Configuration", "compositor"); |
2061 | + myConfig.cWmFallback = CD_CONFIG_GET_STRING ("Configuration", "fallback"); |
2062 | + |
2063 | + myConfig.cIconCompositeON = CD_CONFIG_GET_STRING ("Configuration", "icon on"); |
2064 | + myConfig.cIconCompositeOFF = CD_CONFIG_GET_STRING ("Configuration", "icon off"); |
2065 | + |
2066 | + myConfig.bAskBeforeSwitching = CD_CONFIG_GET_BOOLEAN ("Configuration", "ask"); |
2067 | + |
2068 | + myConfig.iActionOnMiddleClick = CD_CONFIG_GET_INTEGER ("Configuration", "action on click"); |
2069 | + |
2070 | + myConfig.cShortCut = CD_CONFIG_GET_STRING ("Configuration", "shortkey"); |
2071 | + cd_keybinder_bind (myConfig.cShortCut, (CDBindkeyHandler)_cd_on_keybinding_pull, (gpointer)NULL); |
2072 | +CD_APPLET_GET_CONFIG_END |
2073 | + |
2074 | + |
2075 | +CD_APPLET_RESET_CONFIG_BEGIN |
2076 | + g_free (myConfig.cWmCompositor); |
2077 | + g_free (myConfig.cWmFallback); |
2078 | + g_free (myConfig.cIconCompositeON); |
2079 | + g_free (myConfig.cIconCompositeOFF); |
2080 | + if (myConfig.cShortCut) |
2081 | + { |
2082 | + cd_keybinder_unbind(myConfig.cShortCut, (CDBindkeyHandler)_cd_on_keybinding_pull); |
2083 | + g_free (myConfig.cShortCut); |
2084 | + } |
2085 | +CD_APPLET_RESET_CONFIG_END |
2086 | + |
2087 | + |
2088 | +CD_APPLET_RESET_DATA_BEGIN |
2089 | + |
2090 | +CD_APPLET_RESET_DATA_END |
2091 | |
2092 | === added file 'Composite-Manager/src/applet-config.h' |
2093 | --- Composite-Manager/src/applet-config.h 1970-01-01 00:00:00 +0000 |
2094 | +++ Composite-Manager/src/applet-config.h 2011-08-09 20:07:46 +0000 |
2095 | @@ -0,0 +1,30 @@ |
2096 | +/** |
2097 | +* This file is a part of the Cairo-Dock project |
2098 | +* |
2099 | +* Copyright : (C) see the 'copyright' file. |
2100 | +* E-mail : see the 'copyright' file. |
2101 | +* |
2102 | +* This program is free software; you can redistribute it and/or |
2103 | +* modify it under the terms of the GNU General Public License |
2104 | +* as published by the Free Software Foundation; either version 3 |
2105 | +* of the License, or (at your option) any later version. |
2106 | +* |
2107 | +* This program is distributed in the hope that it will be useful, |
2108 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2109 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2110 | +* GNU General Public License for more details. |
2111 | +* You should have received a copy of the GNU General Public License |
2112 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2113 | +*/ |
2114 | + |
2115 | + |
2116 | +#ifndef __APPLET_CONFIG__ |
2117 | +#define __APPLET_CONFIG__ |
2118 | + |
2119 | +#include <cairo-dock.h> |
2120 | + |
2121 | + |
2122 | +CD_APPLET_CONFIG_H |
2123 | + |
2124 | + |
2125 | +#endif |
2126 | |
2127 | === added file 'Composite-Manager/src/applet-init.c' |
2128 | --- Composite-Manager/src/applet-init.c 1970-01-01 00:00:00 +0000 |
2129 | +++ Composite-Manager/src/applet-init.c 2011-08-09 20:07:46 +0000 |
2130 | @@ -0,0 +1,73 @@ |
2131 | +/** |
2132 | +* This file is a part of the Cairo-Dock project |
2133 | +* |
2134 | +* Copyright : (C) see the 'copyright' file. |
2135 | +* E-mail : see the 'copyright' file. |
2136 | +* |
2137 | +* This program is free software; you can redistribute it and/or |
2138 | +* modify it under the terms of the GNU General Public License |
2139 | +* as published by the Free Software Foundation; either version 3 |
2140 | +* of the License, or (at your option) any later version. |
2141 | +* |
2142 | +* This program is distributed in the hope that it will be useful, |
2143 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2144 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2145 | +* GNU General Public License for more details. |
2146 | +* You should have received a copy of the GNU General Public License |
2147 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2148 | +*/ |
2149 | + |
2150 | +#include "applet-config.h" |
2151 | +#include "applet-notifications.h" |
2152 | +#include "applet-struct.h" |
2153 | +#include "applet-composite-manager.h" |
2154 | +#include "applet-init.h" |
2155 | + |
2156 | + |
2157 | +CD_APPLET_DEFINITION (N_("Composite-Manager"), |
2158 | + 2, 3, 0, |
2159 | + CAIRO_DOCK_CATEGORY_APPLET_DESKTOP, |
2160 | + N_("This applet allows you to <b>toggle the composite ON/OFF</b>.\n" |
2161 | + "The composite is what allows transparency on the desktop, but it can slow down your PC, especially during games.\n" |
2162 | + "<b>Click</b> on the icon to switch the composite ON/OFF. You can define a <b>shortcut</b> for this action.\n" |
2163 | + "The applet also lets you acces to some actions of the Window-Manager, from <b>middle-click and the menu</b>.\n" |
2164 | + "You can define in the configuration a Window-Manager that will provide the composite, and another as a fallback."), |
2165 | + "Fabounet") |
2166 | + |
2167 | + |
2168 | +CD_APPLET_INIT_BEGIN |
2169 | + if (myDesklet) |
2170 | + { |
2171 | + CD_APPLET_SET_DESKLET_RENDERER ("Simple"); |
2172 | + } |
2173 | + |
2174 | + cd_init_wms (); |
2175 | + |
2176 | + CD_APPLET_REGISTER_FOR_CLICK_EVENT; |
2177 | + CD_APPLET_REGISTER_FOR_MIDDLE_CLICK_EVENT; |
2178 | + CD_APPLET_REGISTER_FOR_BUILD_MENU_EVENT; |
2179 | +CD_APPLET_INIT_END |
2180 | + |
2181 | + |
2182 | +CD_APPLET_STOP_BEGIN |
2183 | + cd_stop_wms (); |
2184 | + |
2185 | + CD_APPLET_UNREGISTER_FOR_CLICK_EVENT; |
2186 | + CD_APPLET_UNREGISTER_FOR_MIDDLE_CLICK_EVENT; |
2187 | + CD_APPLET_UNREGISTER_FOR_BUILD_MENU_EVENT; |
2188 | +CD_APPLET_STOP_END |
2189 | + |
2190 | + |
2191 | +CD_APPLET_RELOAD_BEGIN |
2192 | + if (CD_APPLET_MY_CONFIG_CHANGED) |
2193 | + { |
2194 | + if (myDesklet && CD_APPLET_MY_CONTAINER_TYPE_CHANGED) // we are now in a desklet, set a renderer. |
2195 | + { |
2196 | + CD_APPLET_SET_DESKLET_RENDERER ("Simple"); |
2197 | + } |
2198 | + |
2199 | + cd_define_prefered_wms (); |
2200 | + |
2201 | + cd_draw_current_state (); |
2202 | + } |
2203 | +CD_APPLET_RELOAD_END |
2204 | |
2205 | === added file 'Composite-Manager/src/applet-init.h' |
2206 | --- Composite-Manager/src/applet-init.h 1970-01-01 00:00:00 +0000 |
2207 | +++ Composite-Manager/src/applet-init.h 2011-08-09 20:07:46 +0000 |
2208 | @@ -0,0 +1,31 @@ |
2209 | +/** |
2210 | +* This file is a part of the Cairo-Dock project |
2211 | +* |
2212 | +* Copyright : (C) see the 'copyright' file. |
2213 | +* E-mail : see the 'copyright' file. |
2214 | +* |
2215 | +* This program is free software; you can redistribute it and/or |
2216 | +* modify it under the terms of the GNU General Public License |
2217 | +* as published by the Free Software Foundation; either version 3 |
2218 | +* of the License, or (at your option) any later version. |
2219 | +* |
2220 | +* This program is distributed in the hope that it will be useful, |
2221 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2222 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2223 | +* GNU General Public License for more details. |
2224 | +* You should have received a copy of the GNU General Public License |
2225 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2226 | +*/ |
2227 | + |
2228 | + |
2229 | +#ifndef __APPLET_INIT__ |
2230 | +#define __APPLET_INIT__ |
2231 | + |
2232 | + |
2233 | +#include <cairo-dock.h> |
2234 | + |
2235 | + |
2236 | +CD_APPLET_H |
2237 | + |
2238 | + |
2239 | +#endif |
2240 | |
2241 | === added file 'Composite-Manager/src/applet-notifications.c' |
2242 | --- Composite-Manager/src/applet-notifications.c 1970-01-01 00:00:00 +0000 |
2243 | +++ Composite-Manager/src/applet-notifications.c 2011-08-09 20:07:46 +0000 |
2244 | @@ -0,0 +1,170 @@ |
2245 | +/** |
2246 | +* This file is a part of the Cairo-Dock project |
2247 | +* |
2248 | +* Copyright : (C) see the 'copyright' file. |
2249 | +* E-mail : see the 'copyright' file. |
2250 | +* |
2251 | +* This program is free software; you can redistribute it and/or |
2252 | +* modify it under the terms of the GNU General Public License |
2253 | +* as published by the Free Software Foundation; either version 3 |
2254 | +* of the License, or (at your option) any later version. |
2255 | +* |
2256 | +* This program is distributed in the hope that it will be useful, |
2257 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2258 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2259 | +* GNU General Public License for more details. |
2260 | +* You should have received a copy of the GNU General Public License |
2261 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2262 | +*/ |
2263 | + |
2264 | +#define _BSD_SOURCE |
2265 | +#include <stdlib.h> |
2266 | +#include <stdio.h> |
2267 | +#include <string.h> |
2268 | +#include <unistd.h> |
2269 | +#include <glib/gi18n.h> |
2270 | +#include <glib/gstdio.h> |
2271 | + |
2272 | +#include "applet-struct.h" |
2273 | +#include "applet-notifications.h" |
2274 | +#include "applet-composite-manager.h" |
2275 | + |
2276 | +static void _on_answer (int iClickedButton, GtkWidget *pInteractiveWidget, gpointer data, CairoDialog *pDialog) |
2277 | +{ |
2278 | + if (iClickedButton == 0 || iClickedButton == -1) // ok or Enter |
2279 | + { |
2280 | + cd_toggle_composite (); |
2281 | + } |
2282 | +} |
2283 | + |
2284 | +CD_APPLET_ON_CLICK_BEGIN |
2285 | + if (myConfig.bAskBeforeSwitching) |
2286 | + { |
2287 | + cairo_dock_show_dialog_full (D_("Toggle composite?"), myIcon, myContainer, 0, "same icon", NULL, (CairoDockActionOnAnswerFunc)_on_answer, NULL, NULL); |
2288 | + } |
2289 | + else |
2290 | + { |
2291 | + cd_toggle_composite (); |
2292 | + } |
2293 | +CD_APPLET_ON_CLICK_END |
2294 | + |
2295 | + |
2296 | +static void _cd_show_desktop (void) |
2297 | +{ |
2298 | + gboolean bDesktopIsVisible = cairo_dock_desktop_is_visible (); |
2299 | + cairo_dock_show_hide_desktop (! bDesktopIsVisible); |
2300 | +} |
2301 | +static void _cd_expose_windows (void) |
2302 | +{ |
2303 | + cairo_dock_wm_present_windows (); |
2304 | +} |
2305 | +static gboolean _cd_expose_windows_idle (gpointer data) |
2306 | +{ |
2307 | + _cd_expose_windows (); |
2308 | + return FALSE; |
2309 | +} |
2310 | +static void _cd_expose_desktops (void) |
2311 | +{ |
2312 | + cairo_dock_wm_present_desktops (); |
2313 | +} |
2314 | +static void _cd_show_widget_layer (void) |
2315 | +{ |
2316 | + cairo_dock_wm_show_widget_layer (); |
2317 | +} |
2318 | + |
2319 | +CD_APPLET_ON_MIDDLE_CLICK_BEGIN |
2320 | + switch (myConfig.iActionOnMiddleClick) |
2321 | + { |
2322 | + |
2323 | + case CD_EDIT_CONFIG: |
2324 | + { |
2325 | + cd_open_wm_config(); |
2326 | + } |
2327 | + break; |
2328 | + case CD_RELOAD_WM: |
2329 | + { |
2330 | + cd_reload_wm(); |
2331 | + } |
2332 | + break; |
2333 | + case CD_SHOW_DESKTOP: |
2334 | + { |
2335 | + _cd_show_desktop (); |
2336 | + } |
2337 | + break; |
2338 | + case CD_EXPOSE_DESKTOPS: |
2339 | + { |
2340 | + _cd_expose_desktops (); |
2341 | + } |
2342 | + break; |
2343 | + case CD_EXPOSE_WINDOWS: |
2344 | + { |
2345 | + // ok this is just crazy: if you call the Scale dbus method of Compiz before the middle button is released, it doesn't work. |
2346 | + g_timeout_add (300, _cd_expose_windows_idle, NULL); |
2347 | + } |
2348 | + break; |
2349 | + case CD_SHOW_WIDGET_LAYER: |
2350 | + { |
2351 | + _cd_show_widget_layer (); |
2352 | + } |
2353 | + break; |
2354 | + default: // shouldn't happen. |
2355 | + cd_warning ("problem in the config!"); |
2356 | + break; |
2357 | + } |
2358 | +CD_APPLET_ON_MIDDLE_CLICK_END |
2359 | + |
2360 | + |
2361 | +CD_APPLET_ON_BUILD_MENU_BEGIN |
2362 | + gchar *cLabel; |
2363 | + |
2364 | + cLabel = (myConfig.iActionOnMiddleClick == CD_EDIT_CONFIG ? g_strdup_printf ("%s (%s)", D_("Edit Window-Manager settings"), D_("middle-click")) : g_strdup (D_("Edit Window-Manager settings"))); |
2365 | + CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, |
2366 | + GTK_STOCK_EDIT, |
2367 | + cd_open_wm_config, |
2368 | + CD_APPLET_MY_MENU); |
2369 | + g_free (cLabel); |
2370 | + |
2371 | + cLabel = (myConfig.iActionOnMiddleClick == CD_RELOAD_WM ? g_strdup_printf ("%s (%s)", D_("Reload Window-Manager"), D_("middle-click")) : g_strdup (D_("Reload Window-Manager"))); |
2372 | + CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, |
2373 | + GTK_STOCK_REFRESH, |
2374 | + cd_reload_wm, |
2375 | + CD_APPLET_MY_MENU); |
2376 | + g_free (cLabel); |
2377 | + |
2378 | + CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU); |
2379 | + |
2380 | + cLabel = (myConfig.iActionOnMiddleClick == CD_SHOW_DESKTOP ? g_strdup_printf ("%s (%s)", D_("Show desktop"), D_("middle-click")) : g_strdup (D_("Show desktop"))); |
2381 | + CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, |
2382 | + MY_APPLET_SHARE_DATA_DIR"/../shared-images/show-desktop.svg", |
2383 | + _cd_show_desktop, |
2384 | + CD_APPLET_MY_MENU); |
2385 | + g_free (cLabel); |
2386 | + |
2387 | + if (cairo_dock_wm_can_present_desktops ()) |
2388 | + { |
2389 | + cLabel = (myConfig.iActionOnMiddleClick == CD_EXPOSE_DESKTOPS ? g_strdup_printf ("%s (%s)", D_("Expose all the desktops"), D_("middle-click")) : g_strdup (D_("Expose all the desktops"))); |
2390 | + CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, |
2391 | + MY_APPLET_SHARE_DATA_DIR"/../shared-images/expose-desktops.svg", |
2392 | + _cd_expose_desktops, |
2393 | + CD_APPLET_MY_MENU); |
2394 | + g_free (cLabel); |
2395 | + } |
2396 | + if (cairo_dock_wm_can_present_windows ()) |
2397 | + { |
2398 | + cLabel = (myConfig.iActionOnMiddleClick == CD_EXPOSE_WINDOWS ? g_strdup_printf ("%s (%s)", D_("Expose all the windows"), D_("middle-click")) : g_strdup (D_("Expose all the windows"))); |
2399 | + CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, |
2400 | + MY_APPLET_SHARE_DATA_DIR"/../shared-images/expose-windows.svg", |
2401 | + _cd_expose_windows, |
2402 | + CD_APPLET_MY_MENU); |
2403 | + g_free (cLabel); |
2404 | + } |
2405 | + if (cairo_dock_wm_can_show_widget_layer ()) |
2406 | + { |
2407 | + cLabel = (myConfig.iActionOnMiddleClick == CD_SHOW_WIDGET_LAYER ? g_strdup_printf ("%s (%s)", D_("Show the Widget Layer"), D_("middle-click")) : g_strdup (D_("Show the Widget Layer"))); |
2408 | + CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel, |
2409 | + GTK_STOCK_LEAVE_FULLSCREEN, |
2410 | + _cd_show_widget_layer, |
2411 | + CD_APPLET_MY_MENU); |
2412 | + g_free (cLabel); |
2413 | + } |
2414 | +CD_APPLET_ON_BUILD_MENU_END |
2415 | |
2416 | === added file 'Composite-Manager/src/applet-notifications.h' |
2417 | --- Composite-Manager/src/applet-notifications.h 1970-01-01 00:00:00 +0000 |
2418 | +++ Composite-Manager/src/applet-notifications.h 2011-08-09 20:07:46 +0000 |
2419 | @@ -0,0 +1,35 @@ |
2420 | +/** |
2421 | +* This file is a part of the Cairo-Dock project |
2422 | +* |
2423 | +* Copyright : (C) see the 'copyright' file. |
2424 | +* E-mail : see the 'copyright' file. |
2425 | +* |
2426 | +* This program is free software; you can redistribute it and/or |
2427 | +* modify it under the terms of the GNU General Public License |
2428 | +* as published by the Free Software Foundation; either version 3 |
2429 | +* of the License, or (at your option) any later version. |
2430 | +* |
2431 | +* This program is distributed in the hope that it will be useful, |
2432 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2433 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2434 | +* GNU General Public License for more details. |
2435 | +* You should have received a copy of the GNU General Public License |
2436 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2437 | +*/ |
2438 | + |
2439 | + |
2440 | +#ifndef __APPLET_NOTIFICATIONS__ |
2441 | +#define __APPLET_NOTIFICATIONS__ |
2442 | + |
2443 | + |
2444 | +#include <cairo-dock.h> |
2445 | + |
2446 | + |
2447 | + |
2448 | +CD_APPLET_ON_CLICK_H |
2449 | + |
2450 | +CD_APPLET_ON_BUILD_MENU_H |
2451 | + |
2452 | +CD_APPLET_ON_MIDDLE_CLICK_H |
2453 | + |
2454 | +#endif |
2455 | |
2456 | === added file 'Composite-Manager/src/applet-struct.h' |
2457 | --- Composite-Manager/src/applet-struct.h 1970-01-01 00:00:00 +0000 |
2458 | +++ Composite-Manager/src/applet-struct.h 2011-08-09 20:07:46 +0000 |
2459 | @@ -0,0 +1,83 @@ |
2460 | +/** |
2461 | +* This file is a part of the Cairo-Dock project |
2462 | +* |
2463 | +* Copyright : (C) see the 'copyright' file. |
2464 | +* E-mail : see the 'copyright' file. |
2465 | +* |
2466 | +* This program is free software; you can redistribute it and/or |
2467 | +* modify it under the terms of the GNU General Public License |
2468 | +* as published by the Free Software Foundation; either version 3 |
2469 | +* of the License, or (at your option) any later version. |
2470 | +* |
2471 | +* This program is distributed in the hope that it will be useful, |
2472 | +* but WITHOUT ANY WARRANTY; without even the implied warranty of |
2473 | +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2474 | +* GNU General Public License for more details. |
2475 | +* You should have received a copy of the GNU General Public License |
2476 | +* along with this program. If not, see <http://www.gnu.org/licenses/>. |
2477 | +*/ |
2478 | + |
2479 | + |
2480 | +#ifndef __CD_APPLET_STRUCT__ |
2481 | +#define __CD_APPLET_STRUCT__ |
2482 | + |
2483 | +#include <cairo-dock.h> |
2484 | + |
2485 | +typedef struct _CDWM { |
2486 | + const gchar *cName; |
2487 | + const gchar *cCommand; |
2488 | + const gchar *cConfigTool; |
2489 | + gboolean bIsAvailable; |
2490 | + void (*activate_composite) (gboolean bActive); |
2491 | +} CDWM; |
2492 | + |
2493 | +typedef enum { |
2494 | + CD_COMPIZ, |
2495 | + CD_KWIN, |
2496 | + CD_XFWM, |
2497 | + CD_METACITY, |
2498 | + CD_CUSTOM_WMFB, |
2499 | + CD_CUSTOM_WMC, |
2500 | + NB_WM |
2501 | +} CDWMIndex; |
2502 | + |
2503 | +#define NB_COMPOSITE_WM 4 // 4 of them can do composite |
2504 | +#define NB_FALLBACK_WM 3 // 3 of them can do without |
2505 | + |
2506 | +typedef enum { |
2507 | + CD_EDIT_CONFIG, |
2508 | + CD_RELOAD_WM, |
2509 | + CD_SHOW_DESKTOP, |
2510 | + CD_EXPOSE_DESKTOPS, |
2511 | + CD_EXPOSE_WINDOWS, |
2512 | + CD_SHOW_WIDGET_LAYER, |
2513 | + CD_NB_ACTIONS |
2514 | + } CDWMAction; |
2515 | + |
2516 | +//\___________ structure containing the applet's configuration parameters. |
2517 | +struct _AppletConfig { |
2518 | + gchar *cWmCompositor; |
2519 | + gchar *cWmFallback; |
2520 | + gchar *cIconCompositeON; |
2521 | + gchar *cIconCompositeOFF; |
2522 | + gboolean bAskBeforeSwitching; |
2523 | + CDWMAction iActionOnMiddleClick; |
2524 | + gchar *cShortCut; |
2525 | +} ; |
2526 | + |
2527 | +typedef struct { |
2528 | + gchar *which; |
2529 | + gchar *ps; |
2530 | + } CDSharedMemory; |
2531 | + |
2532 | +//\___________ structure containing the applet's data, like surfaces, dialogs, results of calculus, etc. |
2533 | +struct _AppletData { |
2534 | + CairoDockTask *pTask; |
2535 | + CDWM pWmList[NB_WM]; |
2536 | + gboolean bIsComposited; |
2537 | + CDWM *wmc; |
2538 | + CDWM *wmfb; |
2539 | +} ; |
2540 | + |
2541 | + |
2542 | +#endif |
2543 | |
2544 | === modified file 'Dbus/data/Dbus.conf.in' |
2545 | --- Dbus/data/Dbus.conf.in 2011-04-20 20:46:51 +0000 |
2546 | +++ Dbus/data/Dbus.conf.in 2011-08-09 20:07:46 +0000 |
2547 | @@ -1,4 +1,4 @@ |
2548 | -#!en;@VERSION_DBUS@ |
2549 | +#@VERSION_DBUS@ |
2550 | |
2551 | #[gtk-preferences] |
2552 | [Configuration] |
2553 | |
2554 | === added file 'Dbus/demos/demo_vala/demo_vala.conf' |
2555 | --- Dbus/demos/demo_vala/demo_vala.conf 1970-01-01 00:00:00 +0000 |
2556 | +++ Dbus/demos/demo_vala/demo_vala.conf 2011-08-09 20:07:46 +0000 |
2557 | @@ -0,0 +1,101 @@ |
2558 | +#!en;0.0.2 |
2559 | + |
2560 | +#[gtk-about] |
2561 | +[Icon] |
2562 | +#j+[0;128] Desired icon size for this applet |
2563 | +#{Set to 0 to use the default applet size} |
2564 | +icon size = 0;0 |
2565 | + |
2566 | +#s Name of the icon as it will appear in its label in the dock : |
2567 | +name = Dbus Applet |
2568 | + |
2569 | +#S+ Image's filename : |
2570 | +#{Let empty to use the default one.} |
2571 | +icon = |
2572 | + |
2573 | +#d Name of the dock it belongs to: |
2574 | +dock name = |
2575 | + |
2576 | +order= |
2577 | + |
2578 | +#F[Applet's Handbook] |
2579 | +frame_hand= |
2580 | +#A |
2581 | +handbook=demo_vala |
2582 | + |
2583 | +#[gtk-convert] |
2584 | +[Desklet] |
2585 | + |
2586 | +#j+[48;512] Desklet's dimension (width x height) : |
2587 | +#{Depending on your WindowManager, you can resize it with ALT + middle_click or ALT + left_click for exemple.} |
2588 | +size = 164;96 |
2589 | + |
2590 | +#i[-2048;2048] Desklet's position (x ; y) : |
2591 | +#{Depending on your WindowManager, you can move it with ALT + left_click} |
2592 | +x position=0 |
2593 | +#i[-2048;2048] ... |
2594 | +y position=0 |
2595 | + |
2596 | +#b Is detached from the dock ? |
2597 | +initially detached=false |
2598 | +#l[Normal;Keep above;Keep below;On Widget Layer;Reserve space] Accessibility : |
2599 | +#{for CompizFusion's "widget layer", set behaviour in Compiz to: (class=Cairo-dock & type=utility)} |
2600 | +accessibility=0 |
2601 | +#b Should be visible on all desktops ? |
2602 | +sticky=true |
2603 | + |
2604 | +#b Lock position ? |
2605 | +#{If locked, the desklet can't be moved by simply dragging it with the left mouse button. Of course you can still move it with ALT + left_click.} |
2606 | +locked = false |
2607 | + |
2608 | +#I[-180;180] Rotation : |
2609 | +#{in degrees.} |
2610 | +rotation = 0 |
2611 | + |
2612 | +use size= |
2613 | + |
2614 | +#F[Decorations;gtk-orientation-portrait] |
2615 | +frame_deco= |
2616 | + |
2617 | +#o+ Choose a decoration theme for this desklet : |
2618 | +#{Choose the 'personnal' one to define your own decorations below.} |
2619 | +decorations = default |
2620 | + |
2621 | +#v |
2622 | +sep_deco = |
2623 | + |
2624 | +#S+ Background image : |
2625 | +#{It's an image that will be displayed below the drawings, like a frame for exemple. Let empty to not use any.} |
2626 | +bg desklet = |
2627 | +#e+[0;1] Background tansparency : |
2628 | +bg alpha = 1 |
2629 | +#i+[0;256] Left offset : |
2630 | +#{in pixels. Use this to adjust the left position of the drawings.} |
2631 | +left offset = 0 |
2632 | +#i+[0;256] Top offset : |
2633 | +#{in pixels. Use this to adjust the top position of the drawings.} |
2634 | +top offset = 0 |
2635 | +#i+[0;256] Right offset : |
2636 | +#{in pixels. Use this to adjust the right position of the drawings.} |
2637 | +right offset = 0 |
2638 | +#i+[0;256] Bottom offset : |
2639 | +#{in pixels. Use this to adjust the bottom position of the drawings.} |
2640 | +bottom offset = 0 |
2641 | +#S+ Foreground image : |
2642 | +#{It's an image that will be displayed above the drawings, like a reflect for exemple. Let empty to not use any.} |
2643 | +fg desklet = |
2644 | +#e+[0;1] Foreground tansparency : |
2645 | +fg alpha = 1 |
2646 | + |
2647 | +#[gtk-preferences] |
2648 | +[Configuration] |
2649 | + |
2650 | +#h+[/usr/share/cairo-dock/gauges;gauges;gauges] Choose one of the available themes :/ |
2651 | +theme = Turbo-night |
2652 | + |
2653 | +#i[10;100] Max value : |
2654 | +max value = 100 |
2655 | + |
2656 | +#b Yes / No ? |
2657 | +yesno = false |
2658 | + |
2659 | |
2660 | === modified file 'Dbus/interfaces/python/CDApplet.py' |
2661 | --- Dbus/interfaces/python/CDApplet.py 2011-04-20 20:46:51 +0000 |
2662 | +++ Dbus/interfaces/python/CDApplet.py 2011-08-09 20:07:46 +0000 |
2663 | @@ -1,4 +1,4 @@ |
2664 | -# This is a part of the external demo applet for Cairo-Dock |
2665 | +# This is a part of the external applets for Cairo-Dock |
2666 | # Copyright : (C) 2010-2011 by Fabounet |
2667 | # E-mail : fabounet@glx-dock.org |
2668 | # |
2669 | @@ -24,41 +24,59 @@ |
2670 | import ConfigParser |
2671 | import gobject |
2672 | import glib |
2673 | +import gettext |
2674 | import dbus |
2675 | from dbus.mainloop.glib import DBusGMainLoop |
2676 | |
2677 | DBusGMainLoop(set_as_default=True) |
2678 | |
2679 | +INSTALL_PREFIX = os.path.abspath("..") # applets are launched from their install directory, so ".." is the folder containing all applets. |
2680 | + |
2681 | +GETTEXT_NAME = 'cairo-dock-plugins-extra' |
2682 | +LOCALE_DIR = INSTALL_PREFIX + '/locale' # user version of /usr/share/locale |
2683 | +gettext.textdomain(GETTEXT_NAME) |
2684 | +gettext.bind_textdomain_codeset (GETTEXT_NAME, 'UTF-8'); |
2685 | +gettext.bindtextdomain(GETTEXT_NAME, LOCALE_DIR) |
2686 | +_ = lambda x: gettext.dgettext(GETTEXT_NAME,x) |
2687 | + |
2688 | #################### |
2689 | ### Applet class ### |
2690 | #################### |
2691 | class CDApplet: |
2692 | |
2693 | + ############# |
2694 | + ### Enums ### |
2695 | + ############# |
2696 | + # orientation |
2697 | BOTTOM = 0 |
2698 | TOP = 1 |
2699 | RIGHT = 2 |
2700 | LEFT = 3 |
2701 | - |
2702 | + # container type |
2703 | DOCK = 0 |
2704 | DESKLET = 1 |
2705 | - |
2706 | + # emblem position |
2707 | UPPER_LEFT = 0 |
2708 | LOWER_RIGHT = 1 |
2709 | LOWER_LEFT = 2 |
2710 | UPPER_RIGHT = 3 |
2711 | MIDDLE = 4 |
2712 | - |
2713 | + # menu item types |
2714 | MENU_ENTRY = 0 |
2715 | MENU_SUB_MENU = 1 |
2716 | MENU_SEPARATOR = 2 |
2717 | MENU_CHECKBOX = 3 |
2718 | MENU_RADIO_BUTTON = 4 |
2719 | - |
2720 | + # main menu ID |
2721 | MAIN_MENU_ID = 0 |
2722 | - |
2723 | + # dialog key pressed |
2724 | DIALOG_KEY_ENTER = -1 |
2725 | DIALOG_KEY_ESCAPE = -2 |
2726 | |
2727 | + ##################### |
2728 | + ### INIT AND DBUS ### |
2729 | + ##################### |
2730 | + |
2731 | def __init__(self): |
2732 | """ initialize the applet. Must be called by any class that inheritates from it. |
2733 | It defines the following: |
2734 | @@ -74,14 +92,44 @@ |
2735 | self.loop = None |
2736 | self._bEnded = False |
2737 | self._cMenuIconId = None |
2738 | - self.cAppletName = sys.argv[0][2:] |
2739 | + self.cAppletName = sys.argv[0][2:] # the command is ./applet_name |
2740 | self.cBusPath = sys.argv[2] |
2741 | self.cConfFile = sys.argv[3] |
2742 | self.cParentAppName = sys.argv[4] |
2743 | + self.cShareDataDir = INSTALL_PREFIX + '/' + self.cAppletName |
2744 | |
2745 | self._get_config() |
2746 | self._connect_to_dock() |
2747 | |
2748 | + def _connect_to_dock(self): |
2749 | + # get our applet on the bus. |
2750 | + bus = dbus.SessionBus() |
2751 | + try: |
2752 | + applet_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath) |
2753 | + except: |
2754 | + print ">>> object '"+self.cBusPath+"' can't be found on the bus, exit.\nMake sure that Cairo-Dock is running" |
2755 | + sys.exit(2) |
2756 | + self.icon = dbus.Interface(applet_object, "org.cairodock.CairoDock.applet") # this object represents our icon inside the dock or a desklet. |
2757 | + sub_icons_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath+"/sub_icons") |
2758 | + self.sub_icons = dbus.Interface(sub_icons_object, "org.cairodock.CairoDock.subapplet") # this object represents the list of icons contained in our sub-dock, or in our desklet. We'll add them one by one later, giving them a unique ID, which will be used to identify each of them. |
2759 | + # connect to signals. |
2760 | + self.icon.connect_to_signal("on_click", self.on_click) # when the user left-clicks on our icon. |
2761 | + self.icon.connect_to_signal("on_middle_click", self.on_middle_click) # when the user middle-clicks on our icon. |
2762 | + self.icon.connect_to_signal("on_build_menu", self._on_build_menu) # when the user right-clicks on our applet (which builds the menu) |
2763 | + self.icon.connect_to_signal("on_menu_select", self._on_menu_select) # when the user selects an entry of this menu. |
2764 | + self.icon.connect_to_signal("on_scroll", self.on_scroll) # when the user scroll up or down on our icon. |
2765 | + self.icon.connect_to_signal("on_drop_data", self.on_drop_data) # when the user drops something on our icon. |
2766 | + self.icon.connect_to_signal("on_answer_dialog", self.on_answer_dialog) # when the user answer a question. |
2767 | + self.icon.connect_to_signal("on_shortkey", self.on_shortkey) # when the user press the shortkey. |
2768 | + self.icon.connect_to_signal("on_change_focus", self.on_change_focus) # when the window's focus changes. |
2769 | + self.icon.connect_to_signal("on_stop_module", self._on_stop) # when the user deactivate our applet (or the DBus plug-in, or when the Cairo-Dock is stopped). |
2770 | + self.icon.connect_to_signal("on_reload_module", self._on_reload) # when the user changes something in our config, or when the desklet is resized (with no change in the config). |
2771 | + self.sub_icons.connect_to_signal("on_click_sub_icon", self.on_click_sub_icon) # when the user left-clicks on a sub-icon. |
2772 | + self.sub_icons.connect_to_signal("on_middle_click_sub_icon", self.on_middle_click_sub_icon) |
2773 | + self.sub_icons.connect_to_signal("on_scroll_sub_icon", self.on_scroll_sub_icon) |
2774 | + self.sub_icons.connect_to_signal("on_build_menu_sub_icon", self._on_build_menu_sub_icon) |
2775 | + self.sub_icons.connect_to_signal("on_drop_data_sub_icon", self.on_drop_data_sub_icon) |
2776 | + |
2777 | def run(self): |
2778 | """ start the applet and enter the main loop; we never get out of this function """ |
2779 | self.begin() |
2780 | @@ -94,6 +142,7 @@ |
2781 | ################################## |
2782 | ### callbacks on the main icon ### |
2783 | ################################## |
2784 | + |
2785 | def on_click(self,iState): |
2786 | """ action on click """ |
2787 | pass |
2788 | @@ -148,6 +197,7 @@ |
2789 | ################################## |
2790 | ### callbacks on the sub-icons ### |
2791 | ################################## |
2792 | + |
2793 | def on_click_sub_icon(self, iState, cIconID): |
2794 | """ action on click on one of our sub-icons""" |
2795 | pass |
2796 | @@ -183,6 +233,7 @@ |
2797 | ############################### |
2798 | ### callbacks on the applet ### |
2799 | ############################### |
2800 | + |
2801 | def begin(self): |
2802 | """ action when the applet is started """ |
2803 | pass |
2804 | @@ -215,32 +266,3 @@ |
2805 | keyfile.read(self.cConfFile) |
2806 | self.get_config(keyfile) |
2807 | |
2808 | - def _connect_to_dock(self): |
2809 | - # get our applet on the bus. |
2810 | - #~ applet_path = "/org/cairodock/CairoDock/"+self.cAppletName # path where our object is stored on the bus. |
2811 | - bus = dbus.SessionBus() |
2812 | - try: |
2813 | - applet_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath) |
2814 | - except: |
2815 | - print ">>> object '"+self.cBusPath+"' can't be found on the bus, exit.\nMake sure that the 'Dbus' plug-in is activated in Cairo-Dock" |
2816 | - sys.exit(2) |
2817 | - self.icon = dbus.Interface(applet_object, "org.cairodock.CairoDock.applet") # this object represents our icon inside the dock or a desklet. |
2818 | - sub_icons_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath+"/sub_icons") |
2819 | - self.sub_icons = dbus.Interface(sub_icons_object, "org.cairodock.CairoDock.subapplet") # this object represents the list of icons contained in our sub-dock, or in our desklet. We'll add them one by one later, giving them a unique ID, which will be used to identify each of them. |
2820 | - # connect to signals. |
2821 | - self.icon.connect_to_signal("on_click", self.on_click) # when the user left-clicks on our icon. |
2822 | - self.icon.connect_to_signal("on_middle_click", self.on_middle_click) # when the user middle-clicks on our icon. |
2823 | - self.icon.connect_to_signal("on_build_menu", self._on_build_menu) # when the user right-clicks on our applet (which builds the menu) |
2824 | - self.icon.connect_to_signal("on_menu_select", self._on_menu_select) # when the user selects an entry of this menu. |
2825 | - self.icon.connect_to_signal("on_scroll", self.on_scroll) # when the user scroll up or down on our icon. |
2826 | - self.icon.connect_to_signal("on_drop_data", self.on_drop_data) # when the user drops something on our icon. |
2827 | - self.icon.connect_to_signal("on_answer_dialog", self.on_answer_dialog) # when the user answer a question. |
2828 | - self.icon.connect_to_signal("on_shortkey", self.on_shortkey) # when the user press the shortkey. |
2829 | - self.icon.connect_to_signal("on_change_focus", self.on_change_focus) # when the window's focus changes. |
2830 | - self.icon.connect_to_signal("on_stop_module", self._on_stop) # when the user deactivate our applet (or the DBus plug-in, or when the Cairo-Dock is stopped). |
2831 | - self.icon.connect_to_signal("on_reload_module", self._on_reload) # when the user changes something in our config, or when the desklet is resized (with no change in the config). |
2832 | - self.sub_icons.connect_to_signal("on_click_sub_icon", self.on_click_sub_icon) # when the user left-clicks on a sub-icon. |
2833 | - self.sub_icons.connect_to_signal("on_middle_click_sub_icon", self.on_middle_click_sub_icon) |
2834 | - self.sub_icons.connect_to_signal("on_scroll_sub_icon", self.on_scroll_sub_icon) |
2835 | - self.sub_icons.connect_to_signal("on_build_menu_sub_icon", self._on_build_menu_sub_icon) |
2836 | - self.sub_icons.connect_to_signal("on_drop_data_sub_icon", self.on_drop_data_sub_icon) |
2837 | |
2838 | === modified file 'Dbus/interfaces/python/CMakeLists.txt' |
2839 | --- Dbus/interfaces/python/CMakeLists.txt 2011-04-20 20:46:51 +0000 |
2840 | +++ Dbus/interfaces/python/CMakeLists.txt 2011-08-09 20:07:46 +0000 |
2841 | @@ -3,7 +3,7 @@ |
2842 | |
2843 | if (NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") |
2844 | # copy *.py to current binary dir (cleaner) |
2845 | - execute_process(COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/setup.py" "${CMAKE_CURRENT_SOURCE_DIR}/CDApplet.py" ${CMAKE_CURRENT_BINARY_DIR}) |
2846 | + execute_process(COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/setup.py" "${CMAKE_CURRENT_SOURCE_DIR}/CDApplet.py" "${CMAKE_CURRENT_SOURCE_DIR}/CairoDock.py" ${CMAKE_CURRENT_BINARY_DIR}) |
2847 | exec_program("${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}" ARGS "setup.py" "-q" "build") |
2848 | endif() |
2849 | # Run a custom script with 'make install' |
2850 | |
2851 | === added file 'Dbus/interfaces/python/CairoDock.py' |
2852 | --- Dbus/interfaces/python/CairoDock.py 1970-01-01 00:00:00 +0000 |
2853 | +++ Dbus/interfaces/python/CairoDock.py 2011-08-09 20:07:46 +0000 |
2854 | @@ -0,0 +1,111 @@ |
2855 | +# This is a part of the Cairo-Dock plug-ins. |
2856 | +# Copyright : (C) 2010-2011 by Fabounet |
2857 | +# E-mail : fabounet@glx-dock.org |
2858 | +# |
2859 | +# This program is free software; you can redistribute it and/or |
2860 | +# modify it under the terms of the GNU General Public License |
2861 | +# as published by the Free Software Foundation; either version 2 |
2862 | +# of the License, or (at your option) any later version. |
2863 | +# |
2864 | +# This program is distributed in the hope that it will be useful, |
2865 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2866 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2867 | +# GNU General Public License for more details. |
2868 | +# http://www.gnu.org/licenses/licenses.html#GPL |
2869 | + |
2870 | +# Base class for Cairo-Dock's main interface. |
2871 | + |
2872 | +#################### |
2873 | +### dependancies ### |
2874 | +#################### |
2875 | +import os.path |
2876 | +import dbus |
2877 | +import re |
2878 | + |
2879 | +USER_CONFIG_DIR = os.path.abspath("~/.config") |
2880 | + |
2881 | + |
2882 | +################## |
2883 | +### Main class ### |
2884 | +################## |
2885 | +class CairoDock: |
2886 | + |
2887 | + ############# |
2888 | + ### Enums ### |
2889 | + ############# |
2890 | + # orientation |
2891 | + BOTTOM = 0 |
2892 | + TOP = 1 |
2893 | + RIGHT = 2 |
2894 | + LEFT = 3 |
2895 | + # container type |
2896 | + DOCK = "Dock" |
2897 | + DESKLET = "Desklet" |
2898 | + # emblem position |
2899 | + UPPER_LEFT = 0 |
2900 | + LOWER_RIGHT = 1 |
2901 | + LOWER_LEFT = 2 |
2902 | + UPPER_RIGHT = 3 |
2903 | + MIDDLE = 4 |
2904 | + # module category |
2905 | + CATEGORY_BEHAVIOR = 0 |
2906 | + CATEGORY_THEME = 1 |
2907 | + CATEGORY_APPLET_FILES = 2 |
2908 | + CATEGORY_APPLET_INTERNET = 3 |
2909 | + CATEGORY_APPLET_DESKTOP = 4 |
2910 | + CATEGORY_APPLET_ACCESSORY = 5 |
2911 | + CATEGORY_APPLET_SYSTEM = 6 |
2912 | + CATEGORY_APPLET_FUN = 7 |
2913 | + # module type |
2914 | + CAN_DOCK = 1 |
2915 | + CAN_DESKLET = 2 |
2916 | + # icon type |
2917 | + TYPE_LAUNCHER = "Launcher" |
2918 | + TYPE_APPLICATION = "Application" |
2919 | + TYPE_APPLET = "Applet" |
2920 | + TYPE_SEPARATOR = "Separator" |
2921 | + TYPE_CONTAINER = "Container" |
2922 | + TYPE_CLASS_CONTAINER = "Class-Container" |
2923 | + TYPE_OTHER = "Other" |
2924 | + # toggle dock visibility |
2925 | + HIDE_DOCK = 0 |
2926 | + SHOW_DOCK = 1 |
2927 | + TOGGLE_DOCK = 2 |
2928 | + |
2929 | + ##################### |
2930 | + ### INIT AND DBUS ### |
2931 | + ##################### |
2932 | + |
2933 | + def __init__(self, app_name="cairo-dock"): |
2934 | + """ Initialize the interface. |
2935 | + It defines the following: |
2936 | + - cDataDir: main dir |
2937 | + - cCurrentThemeDir: current theme dir |
2938 | + - cConfFile : path to the global config file |
2939 | + """ |
2940 | + self.dock = None |
2941 | + self.cAppName = app_name |
2942 | + self.cDataDir = USER_CONFIG_DIR + '/' + app_name |
2943 | + self.cCurrentThemeDir = self.cDataDir + '/current_theme' |
2944 | + self.cLaunchersDir = self.cCurrentThemeDir + '/launchers' |
2945 | + self.cPluginsDir = self.cCurrentThemeDir + '/plug-ins' |
2946 | + self.cConfFile = self.cCurrentThemeDir + '/' + app_name + '.conf' |
2947 | + |
2948 | + self._connect() |
2949 | + |
2950 | + def _connect(self): |
2951 | + # get gldi on the bus. |
2952 | + bus = dbus.SessionBus() |
2953 | + |
2954 | + name1 = self.cAppName.replace('-','') # -> cairodock |
2955 | + name2 = re.sub('-[a-z]', lambda x: x.group(0).upper(), self.cAppName) |
2956 | + name2 = re.sub('^[a-z]', lambda x: x.group(0).upper(), name2) # -> CairoDock |
2957 | + name2 = name2.replace('-','') # -> CairoDock |
2958 | + cBusPath = '/org/'+name1+'/'+name2 |
2959 | + try: |
2960 | + dbus_object = bus.get_object("org.cairodock.CairoDock", cBusPath) |
2961 | + except: |
2962 | + print ">>> object '"+cBusPath+"' can't be found on the bus, exit.\nMake sure that Cairo-Dock is running" |
2963 | + return |
2964 | + self.iface = dbus.Interface(dbus_object, "org.cairodock.CairoDock") # this object represents gldi. |
2965 | + |
2966 | |
2967 | === modified file 'Dbus/interfaces/python/setup.py' |
2968 | --- Dbus/interfaces/python/setup.py 2011-04-20 20:46:51 +0000 |
2969 | +++ Dbus/interfaces/python/setup.py 2011-08-09 20:07:46 +0000 |
2970 | @@ -21,5 +21,5 @@ |
2971 | author_email='fabounet@glx-dock.org', |
2972 | description='Python interface for Cairo-Dock', |
2973 | url='https://launchpad.net/cairo-dock', |
2974 | - py_modules=['CDApplet'] |
2975 | + py_modules=['CDApplet', 'CairoDock'] |
2976 | ) |
2977 | |
2978 | === modified file 'Dbus/interfaces/vala/CMakeLists.txt' |
2979 | --- Dbus/interfaces/vala/CMakeLists.txt 2011-04-20 20:46:51 +0000 |
2980 | +++ Dbus/interfaces/vala/CMakeLists.txt 2011-08-09 20:07:46 +0000 |
2981 | @@ -13,9 +13,13 @@ |
2982 | else() |
2983 | set (VALA_DIR ${CMAKE_CURRENT_BINARY_DIR}) |
2984 | endif() |
2985 | + if (${VALA_MAJOR} LESS 1 AND ${VALA_MINOR} LESS 13) |
2986 | + set (DISABLE_DBUS_TRANSFORMATION "--disable-dbus-transformation") |
2987 | + endif() |
2988 | # first, precompile the Vala code into C code. |
2989 | execute_process(COMMAND |
2990 | - ${VALAC_EXE} -q -C --disable-warnings --disable-dbus-transformation |
2991 | + ${VALAC_EXE} -q -C |
2992 | + --disable-warnings ${DISABLE_DBUS_TRANSFORMATION} |
2993 | --pkg gio-2.0 |
2994 | --vapi=${VALA_DIR}/src/${CDAPPLET}.vapi |
2995 | --header=${VALA_DIR}/src/${CDAPPLET}.h |
2996 | |
2997 | === modified file 'Dbus/src/applet-dbus.c' |
2998 | --- Dbus/src/applet-dbus.c 2011-04-20 20:46:51 +0000 |
2999 | +++ Dbus/src/applet-dbus.c 2011-08-09 20:07:46 +0000 |
3000 | @@ -38,6 +38,7 @@ |
3001 | #define __USE_POSIX |
3002 | #include <signal.h> // kill |
3003 | #include <glib.h> |
3004 | +#include <glib/gstdio.h> |
3005 | #include <dbus/dbus-glib.h> |
3006 | #include <dbus/dbus-glib-bindings.h> |
3007 | |
3008 | @@ -47,6 +48,9 @@ |
3009 | #include "interface-applet-signals.h" |
3010 | #include "applet-dbus.h" |
3011 | |
3012 | +#define DISTANT_DIR "2.4.0" |
3013 | +#define GETTEXT_NAME_EXTRAS "cairo-dock-plugins-extra" |
3014 | +#define LOCALE_DIR_NAME "locale" |
3015 | |
3016 | /////////////////// |
3017 | /// MAIN OBJECT /// |
3018 | @@ -82,7 +86,6 @@ |
3019 | |
3020 | //\_____________ On initialise l'icone. |
3021 | cd_dbus_action_on_init_module (pModuleInstance); |
3022 | - |
3023 | //\_____________ On cree l'objet sur le bus. |
3024 | dbusApplet *pDbusApplet = cd_dbus_create_remote_applet_object (pModuleInstance); |
3025 | g_return_if_fail (pDbusApplet != NULL); |
3026 | @@ -91,7 +94,12 @@ |
3027 | if (pKeyFile != NULL) |
3028 | { |
3029 | if (cairo_dock_conf_file_needs_update (pKeyFile, pModuleInstance->pModule->pVisitCard->cModuleVersion)) |
3030 | - cairo_dock_flush_conf_file (pKeyFile, pModuleInstance->cConfFilePath, pModuleInstance->pModule->pVisitCard->cShareDataDir, pModuleInstance->pModule->pVisitCard->cConfFileName); |
3031 | + { |
3032 | + ///cairo_dock_flush_conf_file (pKeyFile, pModuleInstance->cConfFilePath, pModuleInstance->pModule->pVisitCard->cShareDataDir, pModuleInstance->pModule->pVisitCard->cConfFileName); |
3033 | + gchar *cTemplate = g_strdup_printf ("%s/%s", pModuleInstance->pModule->pVisitCard->cShareDataDir, pModuleInstance->pModule->pVisitCard->cConfFileName); |
3034 | + cairo_dock_upgrade_conf_file (pModuleInstance->cConfFilePath, pKeyFile, cTemplate); |
3035 | + g_free (cTemplate); |
3036 | + } |
3037 | } |
3038 | |
3039 | //\_____________ On (re)lance l'executable de l'applet. |
3040 | @@ -122,7 +130,7 @@ |
3041 | pVisitCard->iMinorVersionNeeded = 1; |
3042 | pVisitCard->iMicroVersionNeeded = 1; |
3043 | pVisitCard->cPreviewFilePath = cShareDataDir ? g_strdup_printf ("%s/preview", cShareDataDir) : NULL; |
3044 | - pVisitCard->cGettextDomain = g_strdup_printf ("cd-%s", cModuleName); |
3045 | + pVisitCard->cGettextDomain = g_strdup (GETTEXT_NAME_EXTRAS); |
3046 | pVisitCard->cUserDataDir = g_strdup (cModuleName); |
3047 | pVisitCard->cShareDataDir = g_strdup (cShareDataDir); |
3048 | pVisitCard->cConfFileName = g_strdup_printf ("%s.conf", cModuleName); |
3049 | @@ -219,16 +227,17 @@ |
3050 | return bActivationOk; |
3051 | } |
3052 | |
3053 | -static void _cd_dbus_register_all_applets_in_dir (const gchar *cDirPath) |
3054 | +static gboolean _cd_dbus_register_all_applets_in_dir (const gchar *cDirPath) |
3055 | { |
3056 | + gboolean bAppletRegistered = FALSE; |
3057 | const gchar *cFileName; |
3058 | gchar *cThirdPartyPath = g_strdup_printf ("%s/%s", cDirPath, CD_DBUS_APPLETS_FOLDER); |
3059 | |
3060 | - GDir *dir = g_dir_open (cThirdPartyPath, 0, NULL); // si le repertoire n'existe pas, on ne veut de warning. |
3061 | + GDir *dir = g_dir_open (cThirdPartyPath, 0, NULL); // si le repertoire n'existe pas, on ne veut pas de warning. |
3062 | if (dir == NULL) |
3063 | { |
3064 | g_free (cThirdPartyPath); |
3065 | - return ; |
3066 | + return bAppletRegistered; |
3067 | } |
3068 | |
3069 | do |
3070 | @@ -236,12 +245,14 @@ |
3071 | cFileName = g_dir_read_name (dir); |
3072 | if (cFileName == NULL) |
3073 | break ; |
3074 | - |
3075 | - cd_dbus_register_module_in_dir (cFileName, cThirdPartyPath); |
3076 | + |
3077 | + if (strcmp (cFileName, LOCALE_DIR_NAME) != 0) |
3078 | + bAppletRegistered |= cd_dbus_register_module_in_dir (cFileName, cThirdPartyPath); |
3079 | } |
3080 | while (1); |
3081 | g_dir_close (dir); |
3082 | g_free (cThirdPartyPath); |
3083 | + return bAppletRegistered; |
3084 | } |
3085 | |
3086 | |
3087 | @@ -253,19 +264,23 @@ |
3088 | { |
3089 | const gchar *cSharePackagesDir = MY_APPLET_SHARE_DATA_DIR"/"CD_DBUS_APPLETS_FOLDER; |
3090 | gchar *cUserPackagesDir = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CD_DBUS_APPLETS_FOLDER); |
3091 | - gchar *cDistantPackagesDir = g_strdup_printf ("%s/%d.%d.%d", CD_DBUS_APPLETS_FOLDER, g_iMajorVersion, g_iMinorVersion, g_iMicroVersion); |
3092 | - gchar *cPath = cairo_dock_get_package_path (cModuleName, cSharePackagesDir, cUserPackagesDir, cDistantPackagesDir, CAIRO_DOCK_UPDATED_PACKAGE); |
3093 | + ///gchar *cDistantPackagesDir = g_strdup_printf ("%s/%d.%d.%d", CD_DBUS_APPLETS_FOLDER, g_iMajorVersion, g_iMinorVersion, g_iMicroVersion); |
3094 | + const gchar *cDistantPackagesDir = CD_DBUS_APPLETS_FOLDER"/"DISTANT_DIR; |
3095 | + gchar *cPath = cairo_dock_get_package_path (cModuleName, |
3096 | + cSharePackagesDir, |
3097 | + cUserPackagesDir, |
3098 | + cDistantPackagesDir, |
3099 | + CAIRO_DOCK_UPDATED_PACKAGE); |
3100 | cd_debug ("*** update of the applet '%s' -> got '%s'\n", cModuleName, cPath); |
3101 | g_free (cPath); |
3102 | g_free (cUserPackagesDir); |
3103 | - g_free (cDistantPackagesDir); |
3104 | + //g_free (cDistantPackagesDir); |
3105 | } |
3106 | static gboolean _apply_package_update (gchar *cModuleName) |
3107 | { |
3108 | CairoDockModule *pModule = cairo_dock_find_module_from_name (cModuleName); |
3109 | - g_return_val_if_fail (pModule != NULL, TRUE); |
3110 | |
3111 | - if (pModule->pInstancesList != NULL) // applet active => on la recharge. |
3112 | + if (pModule && pModule->pInstancesList != NULL) // applet active => reload it (pModule can be NULL in case of "locale"). |
3113 | { |
3114 | cd_debug ("*** applet '%s' is active, reload it", cModuleName); |
3115 | CairoDockModuleInstance *pModuleInstance = pModule->pInstancesList->data; |
3116 | @@ -424,8 +439,8 @@ |
3117 | const gchar *cProgName = g_get_prgname (); |
3118 | g_return_if_fail (cProgName != NULL); |
3119 | int n = strlen (cProgName); |
3120 | - gchar *cName1 = g_new0 (gchar, n+1); |
3121 | - gchar *cName2 = g_new0 (gchar, n+1); |
3122 | + gchar *cName1 = g_new0 (gchar, n+1); // prog name without '-' and '_' |
3123 | + gchar *cName2 = g_new0 (gchar, n+1); // same but with upper char after the '-' and '_' |
3124 | int i, k=0; |
3125 | for (i = 0; i < n; i ++) |
3126 | { |
3127 | @@ -450,25 +465,47 @@ |
3128 | cairo_dock_register_service_name ("org.cairodock.CairoDock"); /// what happens if the gldi instance that had registered the name quits while a 2nd instance remains ? do we need to queue ?... |
3129 | |
3130 | //\____________ create the main object on the bus. |
3131 | - myData.pMainObject = g_object_new (cd_dbus_main_get_type(), NULL); // appelle cd_dbus_main_class_init() et cd_dbus_main_init(). |
3132 | + myData.pMainObject = g_object_new (cd_dbus_main_get_type(), NULL); // call cd_dbus_main_class_init() and cd_dbus_main_init(). |
3133 | |
3134 | //\____________ register the applets installed in the default folders. |
3135 | - _cd_dbus_register_all_applets_in_dir (MY_APPLET_SHARE_DATA_DIR); |
3136 | - |
3137 | - _cd_dbus_register_all_applets_in_dir (g_cCairoDockDataDir); |
3138 | + gboolean bAppletRegistered = FALSE; |
3139 | + bAppletRegistered |= _cd_dbus_register_all_applets_in_dir (MY_APPLET_SHARE_DATA_DIR); |
3140 | + |
3141 | + bAppletRegistered |= _cd_dbus_register_all_applets_in_dir (g_cCairoDockDataDir); |
3142 | + |
3143 | + //\____________ internationalize the applets. |
3144 | + gchar *cLocaleDir = g_strdup_printf ("%s/"CD_DBUS_APPLETS_FOLDER"/"LOCALE_DIR_NAME, g_cCairoDockDataDir); // user version of /usr/share/locale |
3145 | + if (! g_file_test (cLocaleDir, G_FILE_TEST_EXISTS)) // translations not downloaded yet. |
3146 | + { |
3147 | + gchar *cUserAppletsFolder = g_strdup_printf ("%s/"CD_DBUS_APPLETS_FOLDER, g_cCairoDockDataDir); |
3148 | + if (! g_file_test (cUserAppletsFolder, G_FILE_TEST_EXISTS)) |
3149 | + { |
3150 | + if (g_mkdir (cUserAppletsFolder, 7*8*8+7*8+5) != 0) // create an empty folder; since there is no date file, the "locale" package will be seen as "to be updated" by the package manager, and will therefore download it. |
3151 | + cd_warning ("couldn't create '%s'; third-party applets can't be added", cUserAppletsFolder); |
3152 | + } |
3153 | + g_free (cUserAppletsFolder); |
3154 | + |
3155 | + if (g_mkdir (cLocaleDir, 7*8*8+7*8+5) != 0) // create an empty folder; since there is no date file, the "locale" package will be seen as "to be updated" by the package manager, and will therefore download it. |
3156 | + cd_warning ("couldn't create '%s'; applets won't be translated", cLocaleDir); |
3157 | + } |
3158 | + bindtextdomain (GETTEXT_NAME_EXTRAS, cLocaleDir); // bind the applets' domain to the user locale folder. |
3159 | + bind_textdomain_codeset (GETTEXT_NAME_EXTRAS, "UTF-8"); |
3160 | + g_free (cLocaleDir); |
3161 | |
3162 | //\____________ download in background the list of existing applets. |
3163 | - const gchar *cSharePackagesDir = NULL; // MY_APPLET_SHARE_DATA_DIR"/"CD_DBUS_APPLETS_FOLDER; |
3164 | - gchar *cUserPackagesDir = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CD_DBUS_APPLETS_FOLDER); |
3165 | - gchar *cDistantPackagesDir = g_strdup_printf ("%s/%d.%d.%d", CD_DBUS_APPLETS_FOLDER, g_iMajorVersion, g_iMinorVersion, g_iMicroVersion); |
3166 | - myData.pGetListTask = cairo_dock_list_packages_async (cSharePackagesDir, |
3167 | - cUserPackagesDir, |
3168 | - cDistantPackagesDir, |
3169 | - (CairoDockGetPackagesFunc) _on_got_list, |
3170 | - NULL, // data |
3171 | - NULL); // table |
3172 | - g_free (cUserPackagesDir); |
3173 | - g_free (cDistantPackagesDir); |
3174 | + if (bAppletRegistered) // only if some third-party applets are present on the disk. |
3175 | + { |
3176 | + const gchar *cSharePackagesDir = NULL; // no share data dir, since we can't write in /usr |
3177 | + gchar *cUserPackagesDir = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CD_DBUS_APPLETS_FOLDER); |
3178 | + const gchar *cDistantPackagesDir = CD_DBUS_APPLETS_FOLDER"/"DISTANT_DIR; |
3179 | + myData.pGetListTask = cairo_dock_list_packages_async (cSharePackagesDir, |
3180 | + cUserPackagesDir, |
3181 | + cDistantPackagesDir, |
3182 | + (CairoDockGetPackagesFunc) _on_got_list, |
3183 | + NULL, // data |
3184 | + NULL); // table |
3185 | + g_free (cUserPackagesDir); |
3186 | + } |
3187 | } |
3188 | |
3189 | |
3190 | |
3191 | === modified file 'Dbus/src/dbus-main-spec.h' |
3192 | --- Dbus/src/dbus-main-spec.h 2011-04-20 20:46:51 +0000 |
3193 | +++ Dbus/src/dbus-main-spec.h 2011-08-09 20:07:46 +0000 |
3194 | @@ -55,105 +55,193 @@ |
3195 | #endif /* !G_ENABLE_DEBUG */ |
3196 | |
3197 | |
3198 | -/* BOOLEAN:STRING,INT,STRING,STRING,STRING,POINTER */ |
3199 | -extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER (GClosure *closure, |
3200 | - GValue *return_value, |
3201 | - guint n_param_values, |
3202 | - const GValue *param_values, |
3203 | - gpointer invocation_hint, |
3204 | - gpointer marshal_data); |
3205 | -void |
3206 | -dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER (GClosure *closure, |
3207 | - GValue *return_value G_GNUC_UNUSED, |
3208 | - guint n_param_values, |
3209 | - const GValue *param_values, |
3210 | - gpointer invocation_hint G_GNUC_UNUSED, |
3211 | - gpointer marshal_data) |
3212 | -{ |
3213 | - typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER) (gpointer data1, |
3214 | - gpointer arg_1, |
3215 | - gint arg_2, |
3216 | - gpointer arg_3, |
3217 | - gpointer arg_4, |
3218 | - gpointer arg_5, |
3219 | - gpointer arg_6, |
3220 | - gpointer data2); |
3221 | - register GMarshalFunc_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER callback; |
3222 | - register GCClosure *cc = (GCClosure*) closure; |
3223 | - register gpointer data1, data2; |
3224 | - gboolean v_return; |
3225 | - |
3226 | - g_return_if_fail (return_value != NULL); |
3227 | - g_return_if_fail (n_param_values == 7); |
3228 | - |
3229 | - if (G_CCLOSURE_SWAP_DATA (closure)) |
3230 | - { |
3231 | - data1 = closure->data; |
3232 | - data2 = g_value_peek_pointer (param_values + 0); |
3233 | - } |
3234 | - else |
3235 | - { |
3236 | - data1 = g_value_peek_pointer (param_values + 0); |
3237 | - data2 = closure->data; |
3238 | - } |
3239 | - callback = (GMarshalFunc_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback); |
3240 | - |
3241 | - v_return = callback (data1, |
3242 | - g_marshal_value_peek_string (param_values + 1), |
3243 | - g_marshal_value_peek_int (param_values + 2), |
3244 | +/* BOOLEAN:INT,POINTER */ |
3245 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__INT_POINTER (GClosure *closure, |
3246 | + GValue *return_value, |
3247 | + guint n_param_values, |
3248 | + const GValue *param_values, |
3249 | + gpointer invocation_hint, |
3250 | + gpointer marshal_data); |
3251 | +void |
3252 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__INT_POINTER (GClosure *closure, |
3253 | + GValue *return_value G_GNUC_UNUSED, |
3254 | + guint n_param_values, |
3255 | + const GValue *param_values, |
3256 | + gpointer invocation_hint G_GNUC_UNUSED, |
3257 | + gpointer marshal_data) |
3258 | +{ |
3259 | + typedef gboolean (*GMarshalFunc_BOOLEAN__INT_POINTER) (gpointer data1, |
3260 | + gint arg_1, |
3261 | + gpointer arg_2, |
3262 | + gpointer data2); |
3263 | + register GMarshalFunc_BOOLEAN__INT_POINTER callback; |
3264 | + register GCClosure *cc = (GCClosure*) closure; |
3265 | + register gpointer data1, data2; |
3266 | + gboolean v_return; |
3267 | + |
3268 | + g_return_if_fail (return_value != NULL); |
3269 | + g_return_if_fail (n_param_values == 3); |
3270 | + |
3271 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3272 | + { |
3273 | + data1 = closure->data; |
3274 | + data2 = g_value_peek_pointer (param_values + 0); |
3275 | + } |
3276 | + else |
3277 | + { |
3278 | + data1 = g_value_peek_pointer (param_values + 0); |
3279 | + data2 = closure->data; |
3280 | + } |
3281 | + callback = (GMarshalFunc_BOOLEAN__INT_POINTER) (marshal_data ? marshal_data : cc->callback); |
3282 | + |
3283 | + v_return = callback (data1, |
3284 | + g_marshal_value_peek_int (param_values + 1), |
3285 | + g_marshal_value_peek_pointer (param_values + 2), |
3286 | + data2); |
3287 | + |
3288 | + g_value_set_boolean (return_value, v_return); |
3289 | +} |
3290 | + |
3291 | +/* BOOLEAN:BOXED,POINTER */ |
3292 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOXED_POINTER (GClosure *closure, |
3293 | + GValue *return_value, |
3294 | + guint n_param_values, |
3295 | + const GValue *param_values, |
3296 | + gpointer invocation_hint, |
3297 | + gpointer marshal_data); |
3298 | +void |
3299 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOXED_POINTER (GClosure *closure, |
3300 | + GValue *return_value G_GNUC_UNUSED, |
3301 | + guint n_param_values, |
3302 | + const GValue *param_values, |
3303 | + gpointer invocation_hint G_GNUC_UNUSED, |
3304 | + gpointer marshal_data) |
3305 | +{ |
3306 | + typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_POINTER) (gpointer data1, |
3307 | + gpointer arg_1, |
3308 | + gpointer arg_2, |
3309 | + gpointer data2); |
3310 | + register GMarshalFunc_BOOLEAN__BOXED_POINTER callback; |
3311 | + register GCClosure *cc = (GCClosure*) closure; |
3312 | + register gpointer data1, data2; |
3313 | + gboolean v_return; |
3314 | + |
3315 | + g_return_if_fail (return_value != NULL); |
3316 | + g_return_if_fail (n_param_values == 3); |
3317 | + |
3318 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3319 | + { |
3320 | + data1 = closure->data; |
3321 | + data2 = g_value_peek_pointer (param_values + 0); |
3322 | + } |
3323 | + else |
3324 | + { |
3325 | + data1 = g_value_peek_pointer (param_values + 0); |
3326 | + data2 = closure->data; |
3327 | + } |
3328 | + callback = (GMarshalFunc_BOOLEAN__BOXED_POINTER) (marshal_data ? marshal_data : cc->callback); |
3329 | + |
3330 | + v_return = callback (data1, |
3331 | + g_marshal_value_peek_boxed (param_values + 1), |
3332 | + g_marshal_value_peek_pointer (param_values + 2), |
3333 | + data2); |
3334 | + |
3335 | + g_value_set_boolean (return_value, v_return); |
3336 | +} |
3337 | + |
3338 | +/* BOOLEAN:BOOLEAN,POINTER */ |
3339 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure, |
3340 | + GValue *return_value, |
3341 | + guint n_param_values, |
3342 | + const GValue *param_values, |
3343 | + gpointer invocation_hint, |
3344 | + gpointer marshal_data); |
3345 | +void |
3346 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure, |
3347 | + GValue *return_value G_GNUC_UNUSED, |
3348 | + guint n_param_values, |
3349 | + const GValue *param_values, |
3350 | + gpointer invocation_hint G_GNUC_UNUSED, |
3351 | + gpointer marshal_data) |
3352 | +{ |
3353 | + typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (gpointer data1, |
3354 | + gboolean arg_1, |
3355 | + gpointer arg_2, |
3356 | + gpointer data2); |
3357 | + register GMarshalFunc_BOOLEAN__BOOLEAN_POINTER callback; |
3358 | + register GCClosure *cc = (GCClosure*) closure; |
3359 | + register gpointer data1, data2; |
3360 | + gboolean v_return; |
3361 | + |
3362 | + g_return_if_fail (return_value != NULL); |
3363 | + g_return_if_fail (n_param_values == 3); |
3364 | + |
3365 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3366 | + { |
3367 | + data1 = closure->data; |
3368 | + data2 = g_value_peek_pointer (param_values + 0); |
3369 | + } |
3370 | + else |
3371 | + { |
3372 | + data1 = g_value_peek_pointer (param_values + 0); |
3373 | + data2 = closure->data; |
3374 | + } |
3375 | + callback = (GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback); |
3376 | + |
3377 | + v_return = callback (data1, |
3378 | + g_marshal_value_peek_boolean (param_values + 1), |
3379 | + g_marshal_value_peek_pointer (param_values + 2), |
3380 | + data2); |
3381 | + |
3382 | + g_value_set_boolean (return_value, v_return); |
3383 | +} |
3384 | + |
3385 | +/* BOOLEAN:BOOLEAN,STRING,STRING,POINTER */ |
3386 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_STRING_STRING_POINTER (GClosure *closure, |
3387 | + GValue *return_value, |
3388 | + guint n_param_values, |
3389 | + const GValue *param_values, |
3390 | + gpointer invocation_hint, |
3391 | + gpointer marshal_data); |
3392 | +void |
3393 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_STRING_STRING_POINTER (GClosure *closure, |
3394 | + GValue *return_value G_GNUC_UNUSED, |
3395 | + guint n_param_values, |
3396 | + const GValue *param_values, |
3397 | + gpointer invocation_hint G_GNUC_UNUSED, |
3398 | + gpointer marshal_data) |
3399 | +{ |
3400 | + typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN_STRING_STRING_POINTER) (gpointer data1, |
3401 | + gboolean arg_1, |
3402 | + gpointer arg_2, |
3403 | + gpointer arg_3, |
3404 | + gpointer arg_4, |
3405 | + gpointer data2); |
3406 | + register GMarshalFunc_BOOLEAN__BOOLEAN_STRING_STRING_POINTER callback; |
3407 | + register GCClosure *cc = (GCClosure*) closure; |
3408 | + register gpointer data1, data2; |
3409 | + gboolean v_return; |
3410 | + |
3411 | + g_return_if_fail (return_value != NULL); |
3412 | + g_return_if_fail (n_param_values == 5); |
3413 | + |
3414 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3415 | + { |
3416 | + data1 = closure->data; |
3417 | + data2 = g_value_peek_pointer (param_values + 0); |
3418 | + } |
3419 | + else |
3420 | + { |
3421 | + data1 = g_value_peek_pointer (param_values + 0); |
3422 | + data2 = closure->data; |
3423 | + } |
3424 | + callback = (GMarshalFunc_BOOLEAN__BOOLEAN_STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback); |
3425 | + |
3426 | + v_return = callback (data1, |
3427 | + g_marshal_value_peek_boolean (param_values + 1), |
3428 | + g_marshal_value_peek_string (param_values + 2), |
3429 | g_marshal_value_peek_string (param_values + 3), |
3430 | - g_marshal_value_peek_string (param_values + 4), |
3431 | - g_marshal_value_peek_string (param_values + 5), |
3432 | - g_marshal_value_peek_pointer (param_values + 6), |
3433 | - data2); |
3434 | - |
3435 | - g_value_set_boolean (return_value, v_return); |
3436 | -} |
3437 | - |
3438 | -/* BOOLEAN:STRING,BOOLEAN,POINTER */ |
3439 | -extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure, |
3440 | - GValue *return_value, |
3441 | - guint n_param_values, |
3442 | - const GValue *param_values, |
3443 | - gpointer invocation_hint, |
3444 | - gpointer marshal_data); |
3445 | -void |
3446 | -dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure, |
3447 | - GValue *return_value G_GNUC_UNUSED, |
3448 | - guint n_param_values, |
3449 | - const GValue *param_values, |
3450 | - gpointer invocation_hint G_GNUC_UNUSED, |
3451 | - gpointer marshal_data) |
3452 | -{ |
3453 | - typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (gpointer data1, |
3454 | - gpointer arg_1, |
3455 | - gboolean arg_2, |
3456 | - gpointer arg_3, |
3457 | - gpointer data2); |
3458 | - register GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER callback; |
3459 | - register GCClosure *cc = (GCClosure*) closure; |
3460 | - register gpointer data1, data2; |
3461 | - gboolean v_return; |
3462 | - |
3463 | - g_return_if_fail (return_value != NULL); |
3464 | - g_return_if_fail (n_param_values == 4); |
3465 | - |
3466 | - if (G_CCLOSURE_SWAP_DATA (closure)) |
3467 | - { |
3468 | - data1 = closure->data; |
3469 | - data2 = g_value_peek_pointer (param_values + 0); |
3470 | - } |
3471 | - else |
3472 | - { |
3473 | - data1 = g_value_peek_pointer (param_values + 0); |
3474 | - data2 = closure->data; |
3475 | - } |
3476 | - callback = (GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback); |
3477 | - |
3478 | - v_return = callback (data1, |
3479 | - g_marshal_value_peek_string (param_values + 1), |
3480 | - g_marshal_value_peek_boolean (param_values + 2), |
3481 | - g_marshal_value_peek_pointer (param_values + 3), |
3482 | + g_marshal_value_peek_pointer (param_values + 4), |
3483 | data2); |
3484 | |
3485 | g_value_set_boolean (return_value, v_return); |
3486 | @@ -204,48 +292,203 @@ |
3487 | g_value_set_boolean (return_value, v_return); |
3488 | } |
3489 | |
3490 | -/* BOOLEAN:BOOLEAN,POINTER */ |
3491 | -extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure, |
3492 | - GValue *return_value, |
3493 | - guint n_param_values, |
3494 | - const GValue *param_values, |
3495 | - gpointer invocation_hint, |
3496 | - gpointer marshal_data); |
3497 | -void |
3498 | -dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure, |
3499 | - GValue *return_value G_GNUC_UNUSED, |
3500 | - guint n_param_values, |
3501 | - const GValue *param_values, |
3502 | - gpointer invocation_hint G_GNUC_UNUSED, |
3503 | - gpointer marshal_data) |
3504 | -{ |
3505 | - typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (gpointer data1, |
3506 | - gboolean arg_1, |
3507 | - gpointer arg_2, |
3508 | - gpointer data2); |
3509 | - register GMarshalFunc_BOOLEAN__BOOLEAN_POINTER callback; |
3510 | - register GCClosure *cc = (GCClosure*) closure; |
3511 | - register gpointer data1, data2; |
3512 | - gboolean v_return; |
3513 | - |
3514 | - g_return_if_fail (return_value != NULL); |
3515 | - g_return_if_fail (n_param_values == 3); |
3516 | - |
3517 | - if (G_CCLOSURE_SWAP_DATA (closure)) |
3518 | - { |
3519 | - data1 = closure->data; |
3520 | - data2 = g_value_peek_pointer (param_values + 0); |
3521 | - } |
3522 | - else |
3523 | - { |
3524 | - data1 = g_value_peek_pointer (param_values + 0); |
3525 | - data2 = closure->data; |
3526 | - } |
3527 | - callback = (GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback); |
3528 | - |
3529 | - v_return = callback (data1, |
3530 | - g_marshal_value_peek_boolean (param_values + 1), |
3531 | +/* BOOLEAN:STRING,STRING,POINTER */ |
3532 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER (GClosure *closure, |
3533 | + GValue *return_value, |
3534 | + guint n_param_values, |
3535 | + const GValue *param_values, |
3536 | + gpointer invocation_hint, |
3537 | + gpointer marshal_data); |
3538 | +void |
3539 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER (GClosure *closure, |
3540 | + GValue *return_value G_GNUC_UNUSED, |
3541 | + guint n_param_values, |
3542 | + const GValue *param_values, |
3543 | + gpointer invocation_hint G_GNUC_UNUSED, |
3544 | + gpointer marshal_data) |
3545 | +{ |
3546 | + typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_STRING_POINTER) (gpointer data1, |
3547 | + gpointer arg_1, |
3548 | + gpointer arg_2, |
3549 | + gpointer arg_3, |
3550 | + gpointer data2); |
3551 | + register GMarshalFunc_BOOLEAN__STRING_STRING_POINTER callback; |
3552 | + register GCClosure *cc = (GCClosure*) closure; |
3553 | + register gpointer data1, data2; |
3554 | + gboolean v_return; |
3555 | + |
3556 | + g_return_if_fail (return_value != NULL); |
3557 | + g_return_if_fail (n_param_values == 4); |
3558 | + |
3559 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3560 | + { |
3561 | + data1 = closure->data; |
3562 | + data2 = g_value_peek_pointer (param_values + 0); |
3563 | + } |
3564 | + else |
3565 | + { |
3566 | + data1 = g_value_peek_pointer (param_values + 0); |
3567 | + data2 = closure->data; |
3568 | + } |
3569 | + callback = (GMarshalFunc_BOOLEAN__STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback); |
3570 | + |
3571 | + v_return = callback (data1, |
3572 | + g_marshal_value_peek_string (param_values + 1), |
3573 | + g_marshal_value_peek_string (param_values + 2), |
3574 | + g_marshal_value_peek_pointer (param_values + 3), |
3575 | + data2); |
3576 | + |
3577 | + g_value_set_boolean (return_value, v_return); |
3578 | +} |
3579 | + |
3580 | +/* BOOLEAN:STRING,POINTER,POINTER */ |
3581 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure, |
3582 | + GValue *return_value, |
3583 | + guint n_param_values, |
3584 | + const GValue *param_values, |
3585 | + gpointer invocation_hint, |
3586 | + gpointer marshal_data); |
3587 | +void |
3588 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure, |
3589 | + GValue *return_value G_GNUC_UNUSED, |
3590 | + guint n_param_values, |
3591 | + const GValue *param_values, |
3592 | + gpointer invocation_hint G_GNUC_UNUSED, |
3593 | + gpointer marshal_data) |
3594 | +{ |
3595 | + typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (gpointer data1, |
3596 | + gpointer arg_1, |
3597 | + gpointer arg_2, |
3598 | + gpointer arg_3, |
3599 | + gpointer data2); |
3600 | + register GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER callback; |
3601 | + register GCClosure *cc = (GCClosure*) closure; |
3602 | + register gpointer data1, data2; |
3603 | + gboolean v_return; |
3604 | + |
3605 | + g_return_if_fail (return_value != NULL); |
3606 | + g_return_if_fail (n_param_values == 4); |
3607 | + |
3608 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3609 | + { |
3610 | + data1 = closure->data; |
3611 | + data2 = g_value_peek_pointer (param_values + 0); |
3612 | + } |
3613 | + else |
3614 | + { |
3615 | + data1 = g_value_peek_pointer (param_values + 0); |
3616 | + data2 = closure->data; |
3617 | + } |
3618 | + callback = (GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); |
3619 | + |
3620 | + v_return = callback (data1, |
3621 | + g_marshal_value_peek_string (param_values + 1), |
3622 | g_marshal_value_peek_pointer (param_values + 2), |
3623 | + g_marshal_value_peek_pointer (param_values + 3), |
3624 | + data2); |
3625 | + |
3626 | + g_value_set_boolean (return_value, v_return); |
3627 | +} |
3628 | + |
3629 | +/* BOOLEAN:STRING,INT,STRING,POINTER */ |
3630 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER (GClosure *closure, |
3631 | + GValue *return_value, |
3632 | + guint n_param_values, |
3633 | + const GValue *param_values, |
3634 | + gpointer invocation_hint, |
3635 | + gpointer marshal_data); |
3636 | +void |
3637 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER (GClosure *closure, |
3638 | + GValue *return_value G_GNUC_UNUSED, |
3639 | + guint n_param_values, |
3640 | + const GValue *param_values, |
3641 | + gpointer invocation_hint G_GNUC_UNUSED, |
3642 | + gpointer marshal_data) |
3643 | +{ |
3644 | + typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_INT_STRING_POINTER) (gpointer data1, |
3645 | + gpointer arg_1, |
3646 | + gint arg_2, |
3647 | + gpointer arg_3, |
3648 | + gpointer arg_4, |
3649 | + gpointer data2); |
3650 | + register GMarshalFunc_BOOLEAN__STRING_INT_STRING_POINTER callback; |
3651 | + register GCClosure *cc = (GCClosure*) closure; |
3652 | + register gpointer data1, data2; |
3653 | + gboolean v_return; |
3654 | + |
3655 | + g_return_if_fail (return_value != NULL); |
3656 | + g_return_if_fail (n_param_values == 5); |
3657 | + |
3658 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3659 | + { |
3660 | + data1 = closure->data; |
3661 | + data2 = g_value_peek_pointer (param_values + 0); |
3662 | + } |
3663 | + else |
3664 | + { |
3665 | + data1 = g_value_peek_pointer (param_values + 0); |
3666 | + data2 = closure->data; |
3667 | + } |
3668 | + callback = (GMarshalFunc_BOOLEAN__STRING_INT_STRING_POINTER) (marshal_data ? marshal_data : cc->callback); |
3669 | + |
3670 | + v_return = callback (data1, |
3671 | + g_marshal_value_peek_string (param_values + 1), |
3672 | + g_marshal_value_peek_int (param_values + 2), |
3673 | + g_marshal_value_peek_string (param_values + 3), |
3674 | + g_marshal_value_peek_pointer (param_values + 4), |
3675 | + data2); |
3676 | + |
3677 | + g_value_set_boolean (return_value, v_return); |
3678 | +} |
3679 | + |
3680 | +/* BOOLEAN:STRING,DOUBLE,STRING,POINTER,POINTER */ |
3681 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER (GClosure *closure, |
3682 | + GValue *return_value, |
3683 | + guint n_param_values, |
3684 | + const GValue *param_values, |
3685 | + gpointer invocation_hint, |
3686 | + gpointer marshal_data); |
3687 | +void |
3688 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER (GClosure *closure, |
3689 | + GValue *return_value G_GNUC_UNUSED, |
3690 | + guint n_param_values, |
3691 | + const GValue *param_values, |
3692 | + gpointer invocation_hint G_GNUC_UNUSED, |
3693 | + gpointer marshal_data) |
3694 | +{ |
3695 | + typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER) (gpointer data1, |
3696 | + gpointer arg_1, |
3697 | + gdouble arg_2, |
3698 | + gpointer arg_3, |
3699 | + gpointer arg_4, |
3700 | + gpointer arg_5, |
3701 | + gpointer data2); |
3702 | + register GMarshalFunc_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER callback; |
3703 | + register GCClosure *cc = (GCClosure*) closure; |
3704 | + register gpointer data1, data2; |
3705 | + gboolean v_return; |
3706 | + |
3707 | + g_return_if_fail (return_value != NULL); |
3708 | + g_return_if_fail (n_param_values == 6); |
3709 | + |
3710 | + if (G_CCLOSURE_SWAP_DATA (closure)) |
3711 | + { |
3712 | + data1 = closure->data; |
3713 | + data2 = g_value_peek_pointer (param_values + 0); |
3714 | + } |
3715 | + else |
3716 | + { |
3717 | + data1 = g_value_peek_pointer (param_values + 0); |
3718 | + data2 = closure->data; |
3719 | + } |
3720 | + callback = (GMarshalFunc_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback); |
3721 | + |
3722 | + v_return = callback (data1, |
3723 | + g_marshal_value_peek_string (param_values + 1), |
3724 | + g_marshal_value_peek_double (param_values + 2), |
3725 | + g_marshal_value_peek_string (param_values + 3), |
3726 | + g_marshal_value_peek_pointer (param_values + 4), |
3727 | + g_marshal_value_peek_pointer (param_values + 5), |
3728 | data2); |
3729 | |
3730 | g_value_set_boolean (return_value, v_return); |
3731 | @@ -298,35 +541,33 @@ |
3732 | g_value_set_boolean (return_value, v_return); |
3733 | } |
3734 | |
3735 | -/* BOOLEAN:STRING,STRING,STRING,STRING,POINTER */ |
3736 | -extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER (GClosure *closure, |
3737 | - GValue *return_value, |
3738 | - guint n_param_values, |
3739 | - const GValue *param_values, |
3740 | - gpointer invocation_hint, |
3741 | - gpointer marshal_data); |
3742 | +/* BOOLEAN:STRING,BOOLEAN,POINTER */ |
3743 | +extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure, |
3744 | + GValue *return_value, |
3745 | + guint n_param_values, |
3746 | + const GValue *param_values, |
3747 | + gpointer invocation_hint, |
3748 | + gpointer marshal_data); |
3749 | void |
3750 | -dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER (GClosure *closure, |
3751 | - GValue *return_value G_GNUC_UNUSED, |
3752 | - guint n_param_values, |
3753 | - const GValue *param_values, |
3754 | - gpointer invocation_hint G_GNUC_UNUSED, |
3755 | - gpointer marshal_data) |
3756 | +dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure, |
3757 | + GValue *return_value G_GNUC_UNUSED, |
3758 | + guint n_param_values, |
3759 | + const GValue *param_values, |
3760 | + gpointer invocation_hint G_GNUC_UNUSED, |
3761 | + gpointer marshal_data) |
3762 | { |
3763 | - typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_STRING_STRING_STRING_POINTER) (gpointer data1, |
3764 | - gpointer arg_1, |
3765 | - gpointer arg_2, |
3766 | - gpointer arg_3, |
3767 | - gpointer arg_4, |
3768 | - gpointer arg_5, |
3769 | - gpointer data2); |
3770 | - register GMarshalFunc_BOOLEAN__STRING_STRING_STRING_STRING_POINTER callback; |
3771 | + typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (gpointer data1, |
3772 | + gpointer arg_1, |
3773 | + gboolean arg_2, |
3774 | + gpointer arg_3, |
3775 | + gpointer data2); |
3776 | + register GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER callback; |
3777 | register GCClosure *cc = (GCClosure*) closure; |
3778 | register gpointer data1, data2; |
3779 | gboolean v_return; |
3780 | |
3781 | g_return_if_fail (return_value != NULL); |
3782 | - g_return_if_fail (n_param_values == 6); |
3783 | + g_return_if_fail (n_param_values == 4); |
3784 | |
3785 | if (G_CCLOSURE_SWAP_DATA (closure)) |
3786 | { |
3787 | @@ -338,14 +579,12 @@ |
3788 | data1 = g_value_peek_pointer (param_values + 0); |
3789 | data2 = closure->data; |
3790 | } |
3791 | - callback = (GMarshalFunc_BOOLEAN__STRING_STRING_STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback); |
3792 | + callback = (GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback); |
3793 | |
3794 | v_return = callback (data1, |
3795 | g_marshal_value_peek_string (param_values + 1), |
3796 | - g_marshal_value_peek_string (param_values + 2), |
3797 | - g_marshal_value_peek_string (param_values + 3), |
3798 | - g_marshal_value_peek_string (param_values + 4), |
3799 | - g_marshal_value_peek_pointer (param_values + 5), |
3800 | + g_marshal_value_peek_boolean (param_values + 2), |
3801 | + g_marshal_value_peek_pointer (param_values + 3), |
3802 | data2); |
3803 | |
3804 | g_value_set_boolean (return_value, v_return); |
3805 | @@ -359,26 +598,30 @@ |
3806 | static const DBusGMethodInfo dbus_glib_cd_dbus_main_methods[] = { |
3807 | { (GCallback) cd_dbus_main_reboot, dbus_glib_marshal_cd_dbus_main_BOOLEAN__POINTER, 0 }, |
3808 | { (GCallback) cd_dbus_main_quit, dbus_glib_marshal_cd_dbus_main_BOOLEAN__POINTER, 34 }, |
3809 | - { (GCallback) cd_dbus_main_show_desklet, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER, 66 }, |
3810 | - { (GCallback) cd_dbus_main_reload_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 121 }, |
3811 | - { (GCallback) cd_dbus_main_activate_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER, 177 }, |
3812 | - { (GCallback) cd_dbus_main_show_dock, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER, 249 }, |
3813 | - { (GCallback) cd_dbus_main_create_launcher_from_scratch, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 294 }, |
3814 | - { (GCallback) cd_dbus_main_load_launcher_from_file, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 405 }, |
3815 | - { (GCallback) cd_dbus_main_reload_launcher, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 470 }, |
3816 | - { (GCallback) cd_dbus_main_remove_launcher, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 529 }, |
3817 | - { (GCallback) cd_dbus_main_set_quick_info, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 588 }, |
3818 | - { (GCallback) cd_dbus_main_set_label, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 690 }, |
3819 | - { (GCallback) cd_dbus_main_set_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 784 }, |
3820 | - { (GCallback) cd_dbus_main_set_emblem, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER, 877 }, |
3821 | - { (GCallback) cd_dbus_main_animate, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER, 986 }, |
3822 | - { (GCallback) cd_dbus_main_show_dialog, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER, 1097 }, |
3823 | + { (GCallback) cd_dbus_main_show_dock, dbus_glib_marshal_cd_dbus_main_BOOLEAN__INT_POINTER, 66 }, |
3824 | + { (GCallback) cd_dbus_main_show_desklet, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER, 118 }, |
3825 | + { (GCallback) cd_dbus_main_reload_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 173 }, |
3826 | + { (GCallback) cd_dbus_main_activate_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER, 229 }, |
3827 | + { (GCallback) cd_dbus_main_get_icon_properties, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER, 301 }, |
3828 | + { (GCallback) cd_dbus_main_get_container_properties, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER, 390 }, |
3829 | + { (GCallback) cd_dbus_main_get_module_properties, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER, 484 }, |
3830 | + { (GCallback) cd_dbus_main_add_launcher, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER, 572 }, |
3831 | + { (GCallback) cd_dbus_main_add_temporary_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOXED_POINTER, 679 }, |
3832 | + { (GCallback) cd_dbus_main_reload_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 747 }, |
3833 | + { (GCallback) cd_dbus_main_remove_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 800 }, |
3834 | + { (GCallback) cd_dbus_main_set_quick_info, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER, 853 }, |
3835 | + { (GCallback) cd_dbus_main_set_label, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER, 923 }, |
3836 | + { (GCallback) cd_dbus_main_set_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER, 985 }, |
3837 | + { (GCallback) cd_dbus_main_set_emblem, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER, 1046 }, |
3838 | + { (GCallback) cd_dbus_main_animate, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER, 1123 }, |
3839 | + { (GCallback) cd_dbus_main_demands_attention, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_STRING_STRING_POINTER, 1202 }, |
3840 | + { (GCallback) cd_dbus_main_show_dialog, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER, 1287 }, |
3841 | }; |
3842 | |
3843 | const DBusGObjectInfo dbus_glib_cd_dbus_main_object_info = { 1, |
3844 | dbus_glib_cd_dbus_main_methods, |
3845 | - 16, |
3846 | -"org.cairodock.CairoDock\0Reboot\0S\0\0org.cairodock.CairoDock\0Quit\0S\0\0org.cairodock.CairoDock\0ShowDesklet\0S\0widgetLayer\0I\0b\0\0org.cairodock.CairoDock\0ReloadModule\0S\0cModuleName\0I\0s\0\0org.cairodock.CairoDock\0ActivateModule\0S\0cModuleName\0I\0s\0bActivate\0I\0b\0\0org.cairodock.CairoDock\0ShowDock\0S\0show\0I\0b\0\0org.cairodock.CairoDock\0CreateLauncherFromScratch\0S\0cIconFile\0I\0s\0cLabel\0I\0s\0cCommand\0I\0s\0cParentDockName\0I\0s\0\0org.cairodock.CairoDock\0LoadLauncherFromFile\0S\0cDesktopFile\0I\0s\0\0org.cairodock.CairoDock\0ReloadLauncher\0S\0cDesktopFile\0I\0s\0\0org.cairodock.CairoDock\0RemoveLauncher\0S\0cDesktopFile\0I\0s\0\0org.cairodock.CairoDock\0SetQuickInfo\0S\0cQuickInfo\0I\0s\0cIconName\0I\0s\0cIconCommand\0I\0s\0cModuleName\0I\0s\0\0org.cairodock.CairoDock\0SetLabel\0S\0cLabel\0I\0s\0cIconName\0I\0s\0cIconCommand\0I\0s\0cModuleName\0I\0s\0\0org.cairodock.CairoDock\0SetIcon\0S\0cImage\0I\0s\0cIconName\0I\0s\0cIconCommand\0I\0s\0cModuleName\0I\0s\0\0org.cairodock.CairoDock\0SetEmblem\0S\0cImage\0I\0s\0iPosition\0I\0i\0cIconName\0I\0s\0cIconCommand\0I\0s\0cModuleName\0I\0s\0\0org.cairodock.CairoDock\0Animate\0S\0cAnimation\0I\0s\0iNbRounds\0I\0i\0cIconName\0I\0s\0cIconCommand\0I\0s\0cModuleName\0I\0s\0\0org.cairodock.CairoDock\0ShowDialog\0S\0message\0I\0s\0iDuration\0I\0i\0cIconName\0I\0s\0cIconCommand\0I\0s\0cModuleName\0I\0s\0\0\0", |
3847 | + 20, |
3848 | +"org.cairodock.CairoDock\0Reboot\0S\0\0org.cairodock.CairoDock\0Quit\0S\0\0org.cairodock.CairoDock\0ShowDock\0S\0iVisibility\0I\0i\0\0org.cairodock.CairoDock\0ShowDesklet\0S\0widgetLayer\0I\0b\0\0org.cairodock.CairoDock\0ReloadModule\0S\0cModuleName\0I\0s\0\0org.cairodock.CairoDock\0ActivateModule\0S\0cModuleName\0I\0s\0bActivate\0I\0b\0\0org.cairodock.CairoDock\0GetIconProperties\0S\0cIconQuery\0I\0s\0pIconProperties\0O\0F\0N\0aa{sv}\0\0org.cairodock.CairoDock\0GetContainerProperties\0S\0cName\0I\0s\0pContainerProperties\0O\0F\0N\0aa{sv}\0\0org.cairodock.CairoDock\0GetModuleProperties\0S\0cName\0I\0s\0pModuleProperties\0O\0F\0N\0aa{sv}\0\0org.cairodock.CairoDock\0AddLauncher\0S\0cDesktopFilePath\0I\0s\0fOrder\0I\0d\0cDockName\0I\0s\0cLauncherFile\0O\0F\0N\0s\0\0org.cairodock.CairoDock\0AddTemporaryIcon\0S\0hIconProperties\0I\0a{sv}\0\0org.cairodock.CairoDock\0ReloadIcon\0S\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0RemoveIcon\0S\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0SetQuickInfo\0S\0cQuickInfo\0I\0s\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0SetLabel\0S\0cLabel\0I\0s\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0SetIcon\0S\0cImage\0I\0s\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0SetEmblem\0S\0cImage\0I\0s\0iPosition\0I\0i\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0Animate\0S\0cAnimation\0I\0s\0iNbRounds\0I\0i\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0DemandsAttention\0S\0bStart\0I\0b\0cAnimation\0I\0s\0cIconQuery\0I\0s\0\0org.cairodock.CairoDock\0ShowDialog\0S\0message\0I\0s\0iDuration\0I\0i\0cIconQuery\0I\0s\0\0\0", |
3849 | "\0", |
3850 | "\0" |
3851 | }; |
3852 | |
3853 | === modified file 'Dbus/src/dbus_introspectable.xml' |
3854 | --- Dbus/src/dbus_introspectable.xml 2011-04-20 20:46:51 +0000 |
3855 | +++ Dbus/src/dbus_introspectable.xml 2011-08-09 20:07:46 +0000 |
3856 | @@ -6,6 +6,9 @@ |
3857 | </method> |
3858 | <method name="Quit"> |
3859 | </method> |
3860 | + <method name="ShowDock"> |
3861 | + <arg name="iVisibility" type="i" direction="in"/> |
3862 | + </method> |
3863 | <method name="ShowDesklet"> |
3864 | <arg name="widgetLayer" type="b" direction="in"/> |
3865 | </method> |
3866 | @@ -16,62 +19,67 @@ |
3867 | <arg name="cModuleName" type="s" direction="in"/> |
3868 | <arg name="bActivate" type="b" direction="in"/> |
3869 | </method> |
3870 | - <method name="ShowDock"> |
3871 | - <arg name="show" type="b" direction="in"/> |
3872 | - </method> |
3873 | - <method name="CreateLauncherFromScratch"> |
3874 | - <arg name="cIconFile" type="s" direction="in"/> |
3875 | - <arg name="cLabel" type="s" direction="in"/> |
3876 | - <arg name="cCommand" type="s" direction="in"/> |
3877 | - <arg name="cParentDockName" type="s" direction="in"/> |
3878 | - </method> |
3879 | - <method name="LoadLauncherFromFile"> |
3880 | - <arg name="cDesktopFile" type="s" direction="in"/> |
3881 | - </method> |
3882 | - <method name="ReloadLauncher"> |
3883 | - <arg name="cDesktopFile" type="s" direction="in"/> |
3884 | - </method> |
3885 | - <method name="RemoveLauncher"> |
3886 | - <arg name="cDesktopFile" type="s" direction="in"/> |
3887 | - </method> |
3888 | + |
3889 | + <method name="GetIconProperties"> |
3890 | + <arg name="cIconQuery" type="s" direction="in"/> |
3891 | + <arg name="pIconProperties" direction="out" type="aa{sv}"/> |
3892 | + </method> |
3893 | + <method name="GetContainerProperties"> |
3894 | + <arg name="cName" type="s" direction="in"/> |
3895 | + <arg name="pContainerProperties" direction="out" type="aa{sv}"/> |
3896 | + </method> |
3897 | + <method name="GetModuleProperties"> |
3898 | + <arg name="cName" type="s" direction="in"/> |
3899 | + <arg name="pModuleProperties" direction="out" type="aa{sv}"/> |
3900 | + </method> |
3901 | + |
3902 | + <method name="AddLauncher"> |
3903 | + <arg name="cDesktopFilePath" type="s" direction="in"/> |
3904 | + <arg name="fOrder" type="d" direction="in"/> |
3905 | + <arg name="cDockName" type="s" direction="in"/> |
3906 | + <arg name="cLauncherFile" type="s" direction="out"/> |
3907 | + </method> |
3908 | + <method name="AddTemporaryIcon"> |
3909 | + <arg name="hIconProperties" direction="in" type="a{sv}"/> |
3910 | + </method> |
3911 | + <method name="ReloadIcon"> |
3912 | + <arg name="cIconQuery" type="s" direction="in"/> |
3913 | + </method> |
3914 | + <method name="RemoveIcon"> |
3915 | + <arg name="cIconQuery" type="s" direction="in"/> |
3916 | + </method> |
3917 | + |
3918 | <method name="SetQuickInfo"> |
3919 | <arg name="cQuickInfo" type="s" direction="in"/> |
3920 | - <arg name="cIconName" type="s" direction="in"/> |
3921 | - <arg name="cIconCommand" type="s" direction="in"/> |
3922 | - <arg name="cModuleName" type="s" direction="in"/> |
3923 | + <arg name="cIconQuery" type="s" direction="in"/> |
3924 | </method> |
3925 | <method name="SetLabel"> |
3926 | <arg name="cLabel" type="s" direction="in"/> |
3927 | - <arg name="cIconName" type="s" direction="in"/> |
3928 | - <arg name="cIconCommand" type="s" direction="in"/> |
3929 | - <arg name="cModuleName" type="s" direction="in"/> |
3930 | + <arg name="cIconQuery" type="s" direction="in"/> |
3931 | </method> |
3932 | <method name="SetIcon"> |
3933 | <arg name="cImage" type="s" direction="in"/> |
3934 | - <arg name="cIconName" type="s" direction="in"/> |
3935 | - <arg name="cIconCommand" type="s" direction="in"/> |
3936 | - <arg name="cModuleName" type="s" direction="in"/> |
3937 | + <arg name="cIconQuery" type="s" direction="in"/> |
3938 | </method> |
3939 | <method name="SetEmblem"> |
3940 | <arg name="cImage" type="s" direction="in"/> |
3941 | <arg name="iPosition" type="i" direction="in"/> |
3942 | - <arg name="cIconName" type="s" direction="in"/> |
3943 | - <arg name="cIconCommand" type="s" direction="in"/> |
3944 | - <arg name="cModuleName" type="s" direction="in"/> |
3945 | + <arg name="cIconQuery" type="s" direction="in"/> |
3946 | </method> |
3947 | <method name="Animate"> |
3948 | <arg name="cAnimation" type="s" direction="in"/> |
3949 | <arg name="iNbRounds" type="i" direction="in"/> |
3950 | - <arg name="cIconName" type="s" direction="in"/> |
3951 | - <arg name="cIconCommand" type="s" direction="in"/> |
3952 | - <arg name="cModuleName" type="s" direction="in"/> |
3953 | + <arg name="cIconQuery" type="s" direction="in"/> |
3954 | + </method> |
3955 | + <method name="DemandsAttention"> |
3956 | + <arg name="bStart" type="b" direction="in"/> |
3957 | + <arg name="cAnimation" type="s" direction="in"/> |
3958 | + <arg name="cIconQuery" type="s" direction="in"/> |
3959 | </method> |
3960 | <method name="ShowDialog"> |
3961 | <arg name="message" type="s" direction="in"/> |
3962 | <arg name="iDuration" type="i" direction="in"/> |
3963 | - <arg name="cIconName" type="s" direction="in"/> |
3964 | - <arg name="cIconCommand" type="s" direction="in"/> |
3965 | - <arg name="cModuleName" type="s" direction="in"/> |
3966 | + <arg name="cIconQuery" type="s" direction="in"/> |
3967 | </method> |
3968 | </interface> |
3969 | </node> |
3970 | |
3971 | === modified file 'Dbus/src/interface-applet-methods.c' |
3972 | --- Dbus/src/interface-applet-methods.c 2011-04-20 20:46:51 +0000 |
3973 | +++ Dbus/src/interface-applet-methods.c 2011-08-09 20:07:46 +0000 |
3974 | @@ -435,6 +435,7 @@ |
3975 | gtk_range_set_value (GTK_RANGE (pScale), fInitialValue); |
3976 | |
3977 | gtk_widget_set (pScale, "width-request", 150, NULL); |
3978 | + cairo_dock_set_dialog_widget_text_color (pScale); |
3979 | |
3980 | if (cMinLabel || cMaxLabel) |
3981 | { |
3982 | @@ -669,8 +670,8 @@ |
3983 | pIcon->pSubDock = NULL; |
3984 | } |
3985 | pInstance->pDesklet->icons = g_list_concat (pInstance->pDesklet->icons, pIconsList); |
3986 | - gpointer data[2] = {GINT_TO_POINTER (TRUE), GINT_TO_POINTER (FALSE)}; |
3987 | - cairo_dock_set_desklet_renderer_by_name (pInstance->pDesklet, "Caroussel", (CairoDeskletRendererConfigPtr) data); |
3988 | + gpointer data[3] = {GINT_TO_POINTER (0), GINT_TO_POINTER (TRUE), NULL}; |
3989 | + cairo_dock_set_desklet_renderer_by_name (pInstance->pDesklet, "Panel", (CairoDeskletRendererConfigPtr) data); |
3990 | } |
3991 | |
3992 | return TRUE; |
3993 | @@ -844,15 +845,15 @@ |
3994 | pRenderAttr->iMemorySize = (pIcon->fWidth > 1 ? pIcon->fWidth : 32); // fWidht peut etre <= 1 en mode desklet au chargement. |
3995 | // Line;Plain;Bar;Circle;Plain Circle |
3996 | if (cTheme == NULL || strcmp (cTheme, "Line") == 0) |
3997 | - attr.iType = CAIRO_DOCK_GRAPH2_LINE; |
3998 | + attr.iType = CAIRO_DOCK_GRAPH_LINE; |
3999 | else if (strcmp (cTheme, "Plain") == 0) |
4000 | - attr.iType = CAIRO_DOCK_GRAPH2_PLAIN; |
4001 | + attr.iType = CAIRO_DOCK_GRAPH_PLAIN; |
4002 | else if (strcmp (cTheme, "Bar") == 0) |
4003 | - attr.iType = CAIRO_DOCK_GRAPH2_BAR; |
4004 | + attr.iType = CAIRO_DOCK_GRAPH_BAR; |
4005 | else if (strcmp (cTheme, "Circle") == 0) |
4006 | - attr.iType = CAIRO_DOCK_GRAPH2_CIRCLE; |
4007 | + attr.iType = CAIRO_DOCK_GRAPH_CIRCLE; |
4008 | else if (strcmp (cTheme, "Plain Circle") == 0) |
4009 | - attr.iType = CAIRO_DOCK_GRAPH2_CIRCLE_PLAIN; |
4010 | + attr.iType = CAIRO_DOCK_GRAPH_CIRCLE_PLAIN; |
4011 | attr.iRadius = 10; |
4012 | attr.bMixGraphs = FALSE; |
4013 | double *fHighColor = g_new (double, iNbValues*3); |
4014 | @@ -929,7 +930,9 @@ |
4015 | if (pIcon->cClass != NULL) |
4016 | cairo_dock_deinhibite_class (pIcon->cClass, pIcon); |
4017 | if (cClass != NULL) |
4018 | - cairo_dock_inhibite_class (cClass, pIcon); |
4019 | + { |
4020 | + cairo_dock_inhibite_class (cClass, pIcon); /// useful to use cairo_dock_register_class ?... |
4021 | + } |
4022 | if (! cairo_dock_is_loading ()) |
4023 | { |
4024 | CairoContainer *pContainer = pInstance->pContainer; |
4025 | @@ -1124,6 +1127,9 @@ |
4026 | { |
4027 | image = gtk_image_new_from_stock (cIcon, GTK_ICON_SIZE_MENU); |
4028 | } |
4029 | +#if (GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION >= 16) |
4030 | + gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (pMenuItem), TRUE); |
4031 | +#endif |
4032 | gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (pMenuItem), image); |
4033 | } |
4034 | } |
4035 | @@ -1268,7 +1274,7 @@ |
4036 | } |
4037 | else if (strcmp (cProperty, "orientation") == 0) |
4038 | { |
4039 | - CairoDockPositionType iScreenBorder = (g_pMainDock ? ((! g_pMainDock->container.bIsHorizontal) << 1) | (! g_pMainDock->container.bDirectionUp) : 0); |
4040 | + CairoDockPositionType iScreenBorder = ((! pContainer->bIsHorizontal) << 1) | (! pContainer->bDirectionUp); |
4041 | g_value_init (v, G_TYPE_UINT); |
4042 | g_value_set_uint (v, iScreenBorder); |
4043 | } |
4044 | |
4045 | === modified file 'Dbus/src/interface-applet-signals.c' |
4046 | --- Dbus/src/interface-applet-signals.c 2011-04-20 20:46:51 +0000 |
4047 | +++ Dbus/src/interface-applet-signals.c 2011-08-09 20:07:46 +0000 |
4048 | @@ -734,7 +734,7 @@ |
4049 | |
4050 | void cd_dbus_emit_on_stop_module (CairoDockModuleInstance *pModuleInstance) |
4051 | { |
4052 | - //g_print ("%s (%s, %d)\n", __func__, pModuleInstance->pModule->pVisitCard->cModuleName, myData.bKeepObjectAlive); |
4053 | + //g_print ("%s (%s)\n", __func__, pModuleInstance->pModule->pVisitCard->cModuleName); |
4054 | dbusApplet *pDbusApplet = cd_dbus_get_dbus_applet_from_instance (pModuleInstance); |
4055 | if (pDbusApplet != NULL) |
4056 | g_signal_emit (pDbusApplet, |
4057 | |
4058 | === modified file 'Dbus/src/interface-main-methods.c' |
4059 | --- Dbus/src/interface-main-methods.c 2011-04-20 20:46:51 +0000 |
4060 | +++ Dbus/src/interface-main-methods.c 2011-08-09 20:07:46 +0000 |
4061 | @@ -21,21 +21,16 @@ |
4062 | exemples : |
4063 | ---------- |
4064 | |
4065 | -dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.CreateLauncherFromScratch string:gimp.png string:"fake gimp" string:gimp string:none |
4066 | - |
4067 | -dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetLabel string:new_label string:icon_name string:any string:none |
4068 | - |
4069 | -dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetQuickInfo string:123 string:none string:none string:dustbin |
4070 | - |
4071 | -dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.Animate string:default int32:2 string:any string:firefox string:none |
4072 | - |
4073 | -dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetIcon string:firefox-3.0 string:any string:nautilus string:none |
4074 | +dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetQuickInfo string:123 string:"class=firefox" |
4075 | + |
4076 | +dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.Animate string:default int32:2 string:"class=firefox" |
4077 | |
4078 | ******************************************************************************/ |
4079 | |
4080 | #include <unistd.h> |
4081 | #include <glib.h> |
4082 | |
4083 | +#include "cairo-dock.h" |
4084 | #include "interface-main-methods.h" |
4085 | |
4086 | #define nullify_argument(string) do {\ |
4087 | @@ -61,6 +56,77 @@ |
4088 | return TRUE; |
4089 | } |
4090 | |
4091 | +static void _show_hide_one_dock (const gchar *cDockName, CairoDock *pDock, gpointer data) |
4092 | +{ |
4093 | + if (pDock->iRefCount != 0) |
4094 | + return ; |
4095 | + gboolean bShow = GPOINTER_TO_INT (data); |
4096 | + if (bShow) |
4097 | + { |
4098 | + ///cairo_dock_pop_up (pDock); |
4099 | + ///if (pDock->bAutoHide) |
4100 | + cairo_dock_emit_enter_signal (CAIRO_CONTAINER (pDock)); |
4101 | + } |
4102 | + else |
4103 | + { |
4104 | + ///cairo_dock_pop_down (pDock); // ne fait rien s'il n'etait pas "popped". |
4105 | + ///if (pDock->bAutoHide) |
4106 | + cairo_dock_emit_leave_signal (CAIRO_CONTAINER (pDock)); |
4107 | + } |
4108 | +} |
4109 | +gboolean cd_dbus_main_show_dock (dbusMainObject *pDbusCallback, gint iVisibiliy, GError **error) |
4110 | +{ |
4111 | + if (! myConfig.bEnableShowDock) |
4112 | + return FALSE; |
4113 | + |
4114 | + if (g_pMainDock == NULL) |
4115 | + return FALSE; |
4116 | + |
4117 | + gboolean bShow; |
4118 | + switch (iVisibiliy) |
4119 | + { |
4120 | + case 0: // hide |
4121 | + bShow = FALSE; |
4122 | + break; |
4123 | + case 1: // show |
4124 | + bShow = TRUE; |
4125 | + break; |
4126 | + case 2: // toggle |
4127 | + default: |
4128 | + bShow = (g_pMainDock->bIsBelow || (g_pMainDock->bAutoHide && g_pMainDock->fHideOffset == 1)); |
4129 | + break; |
4130 | + } |
4131 | + |
4132 | + if (bShow) |
4133 | + cairo_dock_stop_quick_hide (); |
4134 | + |
4135 | + cairo_dock_foreach_docks ((GHFunc) _show_hide_one_dock, GINT_TO_POINTER (bShow)); |
4136 | + |
4137 | + if (! bShow) |
4138 | + cairo_dock_quick_hide_all_docks (); |
4139 | + |
4140 | + return TRUE; |
4141 | +} |
4142 | + |
4143 | +gboolean cd_dbus_main_show_desklet (dbusMainObject *pDbusCallback, gboolean *widgetLayer, GError **error) |
4144 | +{ |
4145 | + if (! myConfig.bEnableDesklets) |
4146 | + return FALSE; |
4147 | + if (dbus_deskletVisible) |
4148 | + { |
4149 | + cairo_dock_set_desklets_visibility_to_default (); |
4150 | + cairo_dock_show_xwindow (dbus_xLastActiveWindow); |
4151 | + } |
4152 | + else |
4153 | + { |
4154 | + dbus_xLastActiveWindow = cairo_dock_get_current_active_window (); |
4155 | + cairo_dock_set_all_desklets_visible (widgetLayer != NULL ? *widgetLayer : FALSE); |
4156 | + } |
4157 | + dbus_deskletVisible = !dbus_deskletVisible; |
4158 | + return TRUE; |
4159 | +} |
4160 | + |
4161 | + |
4162 | gboolean cd_dbus_main_reload_module (dbusMainObject *pDbusCallback, const gchar *cModuleName, GError **error) |
4163 | { |
4164 | if (! myConfig.bEnableReloadModule) |
4165 | @@ -72,11 +138,9 @@ |
4166 | } |
4167 | else |
4168 | { |
4169 | - //CairoDockInternalModule *pInternalModule = cairo_dock_find_internal_module_from_name (cModuleName); |
4170 | GldiManager *pManager = gldi_get_manager (cModuleName); |
4171 | if (pManager != NULL) |
4172 | { |
4173 | - //cairo_dock_reload_internal_module (pInternalModule, g_cConfFile); |
4174 | gldi_reload_manager (pManager, g_cConfFile); |
4175 | } |
4176 | else |
4177 | @@ -96,9 +160,9 @@ |
4178 | CairoDockModule *pModule = cairo_dock_find_module_from_name (cModuleName); |
4179 | if (pModule == NULL) |
4180 | { |
4181 | - /*if (cairo_dock_find_internal_module_from_name (cModuleName) != NULL) |
4182 | + if (gldi_get_manager (cModuleName) != NULL) |
4183 | cd_warning ("Internal modules can't be (de)activated."); |
4184 | - else*/ |
4185 | + else |
4186 | cd_warning ("no such module (%s)", cModuleName); |
4187 | return FALSE; |
4188 | } |
4189 | @@ -110,86 +174,864 @@ |
4190 | return TRUE; |
4191 | } |
4192 | |
4193 | -gboolean cd_dbus_main_show_desklet(dbusMainObject *pDbusCallback, gboolean *widgetLayer, GError **error) |
4194 | -{ |
4195 | - if (! myConfig.bEnableDesklets) |
4196 | - return FALSE; |
4197 | - if (dbus_deskletVisible) |
4198 | - { |
4199 | - cairo_dock_set_desklets_visibility_to_default (); |
4200 | - cairo_dock_show_xwindow (dbus_xLastActiveWindow); |
4201 | - } |
4202 | - else |
4203 | - { |
4204 | - dbus_xLastActiveWindow = cairo_dock_get_current_active_window (); |
4205 | - cairo_dock_set_all_desklets_visible (widgetLayer != NULL ? *widgetLayer : FALSE); |
4206 | - } |
4207 | - dbus_deskletVisible = !dbus_deskletVisible; |
4208 | - return TRUE; |
4209 | -} |
4210 | - |
4211 | -static void _show_hide_one_dock (const gchar *cDockName, CairoDock *pDock, gpointer data) |
4212 | -{ |
4213 | - if (pDock->iRefCount != 0) |
4214 | - return ; |
4215 | - gboolean bShow = GPOINTER_TO_INT (data); |
4216 | - if (bShow) |
4217 | - { |
4218 | - ///cairo_dock_pop_up (pDock); |
4219 | - if (pDock->bAutoHide) |
4220 | - cairo_dock_emit_enter_signal (CAIRO_CONTAINER (pDock)); |
4221 | - } |
4222 | - else |
4223 | - { |
4224 | - ///cairo_dock_pop_down (pDock); // ne fait rien s'il n'etait pas "popped". |
4225 | - if (pDock->bAutoHide) |
4226 | - cairo_dock_emit_leave_signal (CAIRO_CONTAINER (pDock)); |
4227 | - } |
4228 | -} |
4229 | -gboolean cd_dbus_main_show_dock (dbusMainObject *pDbusCallback, gboolean bShow, GError **error) |
4230 | -{ |
4231 | - if (! myConfig.bEnableShowDock) |
4232 | - return FALSE; |
4233 | - |
4234 | - if (bShow) |
4235 | - cairo_dock_stop_quick_hide (); |
4236 | - |
4237 | - cairo_dock_foreach_docks ((GHFunc) _show_hide_one_dock, GINT_TO_POINTER (bShow)); |
4238 | - |
4239 | - if (! bShow) |
4240 | - cairo_dock_quick_hide_all_docks (); |
4241 | - |
4242 | - return TRUE; |
4243 | -} |
4244 | - |
4245 | -gboolean cd_dbus_main_create_launcher_from_scratch (dbusMainObject *pDbusCallback, const gchar *cIconFile, const gchar *cLabel, const gchar *cCommand, const gchar *cParentDockName, GError **error) |
4246 | -{ |
4247 | - if (! myConfig.bEnableCreateLauncher) |
4248 | - return FALSE; |
4249 | - |
4250 | - nullify_argument (cParentDockName); |
4251 | - if (cParentDockName == NULL) |
4252 | - cParentDockName = CAIRO_DOCK_MAIN_DOCK_NAME; |
4253 | + |
4254 | + ////////////////// |
4255 | + /// ICON QUERY /// |
4256 | +////////////////// |
4257 | + |
4258 | +typedef struct { |
4259 | + const gchar *cType; |
4260 | + const gchar *cName; |
4261 | + const gchar *cCommand; |
4262 | + const gchar *cClass; |
4263 | + const gchar *cContainerName; |
4264 | + Window Xid; |
4265 | + const gchar *cDesktopFile; |
4266 | + const gchar *cModuleName; |
4267 | + gint iPosition; |
4268 | + gboolean bMatchAll; |
4269 | + GList *pMatchingIcons; |
4270 | +} CDIconQueryBuffer; |
4271 | +static inline gboolean _strings_match (const gchar *q, const gchar *p) // query, parameter |
4272 | +{ |
4273 | + if (!p) |
4274 | + return (strcmp (q, "none") == 0); |
4275 | + int n = strlen(q); |
4276 | + if (n != 0 && q[n-1] == '*') // ok with UTF-8 too. |
4277 | + return (strncmp (q, p, n-1) == 0); |
4278 | + return (strcmp (q, p) == 0); |
4279 | +} |
4280 | +static inline gboolean _strings_match_case (const gchar *q, const gchar *p) // query, parameter |
4281 | +{ |
4282 | + if (!p) |
4283 | + return (strcmp (q, "none") == 0); |
4284 | + int n = strlen(q); |
4285 | + if (n != 0 && q[n-1] == '*') |
4286 | + return (g_ascii_strncasecmp (q, p, n-1) == 0); |
4287 | + return (g_ascii_strcasecmp (q, p) == 0); |
4288 | +} |
4289 | +static gboolean _icon_is_matching (Icon *pIcon, CairoContainer *pContainer, CDIconQueryBuffer *pQuery) |
4290 | +{ |
4291 | + gboolean bOr = FALSE; |
4292 | + gboolean bAnd = TRUE; // at least 1 of the fields is not nul. |
4293 | + gboolean r; |
4294 | + if (pQuery->cType) |
4295 | + { |
4296 | + const gchar *cType; |
4297 | + if (CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (pIcon)) |
4298 | + cType = "Launcher"; |
4299 | + else if (CAIRO_DOCK_ICON_TYPE_IS_APPLI (pIcon)) |
4300 | + cType = "Application"; |
4301 | + else if (CAIRO_DOCK_ICON_TYPE_IS_APPLET (pIcon)) |
4302 | + cType = "Applet"; |
4303 | + else if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon)) |
4304 | + cType = "Separator"; |
4305 | + else if (CAIRO_DOCK_ICON_TYPE_IS_CONTAINER (pIcon)) |
4306 | + cType = "Container"; |
4307 | + else if (CAIRO_DOCK_ICON_TYPE_IS_CLASS_CONTAINER (pIcon)) |
4308 | + cType = "Class-Container"; |
4309 | + else |
4310 | + cType = "Other"; |
4311 | + r = (strcmp (pQuery->cType, cType) == 0); |
4312 | + bOr |= r; |
4313 | + bAnd &= r; |
4314 | + } |
4315 | + if (pQuery->cName) |
4316 | + { |
4317 | + r = _strings_match (pQuery->cName, pIcon->cName); |
4318 | + bOr |= r; |
4319 | + bAnd &= r; |
4320 | + } |
4321 | + if (pQuery->cCommand) |
4322 | + { |
4323 | + r = _strings_match (pQuery->cCommand, pIcon->cCommand); |
4324 | + bOr |= r; |
4325 | + bAnd &= r; |
4326 | + } |
4327 | + if (pQuery->cClass) |
4328 | + { |
4329 | + r = _strings_match_case (pQuery->cClass, pIcon->cClass); |
4330 | + bOr |= r; |
4331 | + bAnd &= r; |
4332 | + } |
4333 | + if (pQuery->cContainerName) |
4334 | + { |
4335 | + const gchar *cContainerName = NULL; |
4336 | + if (CAIRO_DOCK_IS_DOCK (pContainer)) |
4337 | + cContainerName = pIcon->cParentDockName; |
4338 | + else if (CAIRO_DOCK_IS_DESKLET (pContainer)) |
4339 | + { |
4340 | + Icon *pMainIcon = CAIRO_DESKLET (pContainer)->pIcon; |
4341 | + if (CAIRO_DOCK_IS_APPLET (pMainIcon)) |
4342 | + cContainerName = pMainIcon->pModuleInstance->pModule->pVisitCard->cModuleName; |
4343 | + } |
4344 | + r = _strings_match (pQuery->cContainerName, cContainerName); |
4345 | + bOr |= r; |
4346 | + bAnd &= r; |
4347 | + } |
4348 | + if (pQuery->Xid != 0) |
4349 | + { |
4350 | + r = (pIcon->Xid == pQuery->Xid); |
4351 | + bOr |= r; |
4352 | + bAnd &= r; |
4353 | + } |
4354 | + if (pQuery->cDesktopFile) |
4355 | + { |
4356 | + r = _strings_match (pQuery->cDesktopFile, pIcon->cDesktopFileName); |
4357 | + if (!r && CAIRO_DOCK_IS_APPLET (pIcon) && pIcon->pModuleInstance->cConfFilePath) |
4358 | + { |
4359 | + if (*pQuery->cDesktopFile == '/') // query the complete path. |
4360 | + { |
4361 | + r = _strings_match (pQuery->cDesktopFile, pIcon->pModuleInstance->cConfFilePath); |
4362 | + } |
4363 | + else // query the file name only. |
4364 | + { |
4365 | + gchar *str = strrchr (pIcon->pModuleInstance->cConfFilePath, '/'); |
4366 | + if (str) |
4367 | + r = _strings_match (pQuery->cDesktopFile, str+1); |
4368 | + } |
4369 | + } |
4370 | + bOr |= r; |
4371 | + bAnd &= r; |
4372 | + } |
4373 | + if (pQuery->cModuleName) |
4374 | + { |
4375 | + r = (CAIRO_DOCK_IS_APPLET (pIcon) && _strings_match (pQuery->cModuleName, pIcon->pModuleInstance->pModule->pVisitCard->cModuleName)); |
4376 | + bOr |= r; |
4377 | + bAnd &= r; |
4378 | + } |
4379 | + |
4380 | + return ((pQuery->bMatchAll && bAnd) || (!pQuery->bMatchAll && bOr)); |
4381 | +} |
4382 | +static void _check_icon_matching (Icon *pIcon, CairoContainer *pContainer, CDIconQueryBuffer *pQuery) |
4383 | +{ |
4384 | + if (_icon_is_matching (pIcon, pContainer, pQuery)) |
4385 | + pQuery->pMatchingIcons = g_list_prepend (pQuery->pMatchingIcons, pIcon); |
4386 | +} |
4387 | +static void _get_icon_at_position_in_dock (const gchar *cDockName, CairoDock *pDock, CDIconQueryBuffer *pQuery) |
4388 | +{ |
4389 | + Icon *pIcon = g_list_nth_data (pDock->icons, pQuery->iPosition); |
4390 | + if (pIcon != NULL) |
4391 | + pQuery->pMatchingIcons = g_list_prepend (pQuery->pMatchingIcons, pIcon); |
4392 | +} |
4393 | +static gboolean _get_icon_at_position_in_desklet (CairoDesklet *pDesklet, CDIconQueryBuffer *pQuery) |
4394 | +{ |
4395 | + Icon *pIcon = g_list_nth_data (pDesklet->icons, pQuery->iPosition); |
4396 | + if (pIcon != NULL) |
4397 | + pQuery->pMatchingIcons = g_list_prepend (pQuery->pMatchingIcons, pIcon); |
4398 | + return FALSE; // don't stop. |
4399 | +} |
4400 | +static gboolean _prepare_query (CDIconQueryBuffer *pQuery, const gchar *cKey, const gchar *cValue) |
4401 | +{ |
4402 | + g_return_val_if_fail (cKey != NULL, FALSE); |
4403 | + if (cValue == NULL) // use "none" keyword to look for "icons that don't have key". |
4404 | + return FALSE; |
4405 | + |
4406 | + if (strcmp (cKey, "name") == 0 || strcmp (cKey, "label") == 0) |
4407 | + pQuery->cName = cValue; |
4408 | + else if (strcmp (cKey, "command") == 0) |
4409 | + pQuery->cCommand = cValue; |
4410 | + else if (strcmp (cKey, "class") == 0) |
4411 | + pQuery->cClass = cValue; |
4412 | + else if (strcmp (cKey, "container") == 0) |
4413 | + pQuery->cContainerName = cValue; |
4414 | + else if (strcmp (cKey, "Xid") == 0) |
4415 | + pQuery->Xid = strtol(cValue, NULL, 0); // can read hexa, decimal or octal. |
4416 | + else if (strcmp (cKey, "config-file") == 0) |
4417 | + pQuery->cDesktopFile = cValue; |
4418 | + else if (strcmp (cKey, "module") == 0) |
4419 | + pQuery->cModuleName = cValue; |
4420 | + else if (strcmp (cKey, "position") == 0) |
4421 | + pQuery->iPosition = atoi (cValue); |
4422 | + else if (strcmp (cKey, "type") == 0) |
4423 | + pQuery->cType = cValue; |
4424 | + else |
4425 | + { |
4426 | + cd_warning ("wrong key (%s)", cKey); |
4427 | + return FALSE; |
4428 | + } |
4429 | + return TRUE; |
4430 | +} |
4431 | +static GList *_find_matching_icons_for_key (const gchar *cKey, const gchar *cValue) |
4432 | +{ |
4433 | + //g_print (" %s (%s, %s)\n", __func__, cKey, cValue); |
4434 | + CDIconQueryBuffer query; |
4435 | + memset (&query, 0, sizeof (CDIconQueryBuffer)); |
4436 | + query.iPosition = -1; |
4437 | + query.bMatchAll = TRUE; |
4438 | + |
4439 | + gboolean bValidQuery = _prepare_query (&query, cKey, cValue); |
4440 | + g_return_val_if_fail (bValidQuery, NULL); |
4441 | + |
4442 | + if (query.iPosition >= 0) |
4443 | + { |
4444 | + cairo_dock_foreach_docks ((GHFunc) _get_icon_at_position_in_dock, &query); |
4445 | + cairo_dock_foreach_desklet ((CairoDockForeachDeskletFunc) _get_icon_at_position_in_desklet, &query); |
4446 | + } |
4447 | + else |
4448 | + { |
4449 | + cairo_dock_foreach_icons ((CairoDockForeachIconFunc) _check_icon_matching, &query); |
4450 | + } |
4451 | + return query.pMatchingIcons; |
4452 | +} |
4453 | +static GList *_find_matching_icons_for_test (gchar *cTest) |
4454 | +{ |
4455 | + g_return_val_if_fail (cTest != NULL, NULL); |
4456 | + //g_print (" %s (%s)\n", __func__, cTest); |
4457 | + |
4458 | + gchar *str = strchr (cTest, '='); |
4459 | + g_return_val_if_fail (str != NULL, NULL); |
4460 | + |
4461 | + *str = '\0'; |
4462 | + gchar *cKey = g_strstrip ((gchar*)cTest); // g_strstrip modifies the string in place (by moving the rest of the characters forward and cutting the trailing spaces) |
4463 | + gchar *cValue = g_strstrip (str+1); |
4464 | + |
4465 | + return _find_matching_icons_for_key (cKey, cValue); |
4466 | +} |
4467 | +static GList *_merge (GList *pList1, GList *pList2) |
4468 | +{ |
4469 | + //g_print ("%s ()\n", __func__); |
4470 | + GList *pList = NULL; |
4471 | + GList *ic; |
4472 | + Icon *pIcon; |
4473 | + for (ic = pList1; ic != NULL; ic = ic->next) |
4474 | + { |
4475 | + pIcon = ic->data; |
4476 | + if (g_list_find (pList2, pIcon) != NULL) |
4477 | + pList = g_list_prepend (pList, pIcon); |
4478 | + } |
4479 | + g_list_free (pList1); |
4480 | + g_list_free (pList2); |
4481 | + return pList; |
4482 | +} |
4483 | +static GList *_concat (GList *pList1, GList *pList2) |
4484 | +{ |
4485 | + //g_print ("%s ()\n", __func__); |
4486 | + GList *pList = g_list_copy (pList2); |
4487 | + GList *ic; |
4488 | + Icon *pIcon; |
4489 | + for (ic = pList1; ic != NULL; ic = ic->next) |
4490 | + { |
4491 | + pIcon = ic->data; |
4492 | + if (!g_list_find (pList2, pIcon)) |
4493 | + pList = g_list_prepend (pList, pIcon); |
4494 | + } |
4495 | + g_list_free (pList1); |
4496 | + g_list_free (pList2); |
4497 | + return pList; |
4498 | +} |
4499 | +GList *cd_dbus_find_matching_icons (gchar *cQuery) |
4500 | +{ |
4501 | + g_return_val_if_fail (cQuery != NULL, NULL); |
4502 | + //g_print ("%s (%s)\n", __func__, cQuery); |
4503 | + |
4504 | + gchar *str; |
4505 | + str = strchr (cQuery, '|'); // a && b || c && d <=> (a && b) || (c && d) |
4506 | + if (str) |
4507 | + { |
4508 | + *str = '\0'; |
4509 | + GList *pList1 = cd_dbus_find_matching_icons (cQuery); |
4510 | + GList *pList2 = cd_dbus_find_matching_icons (str+1); |
4511 | + return _concat (pList1, pList2); |
4512 | + } |
4513 | + str = strchr (cQuery, '&'); |
4514 | + if (str) |
4515 | + { |
4516 | + *str = '\0'; |
4517 | + GList *pList1 = cd_dbus_find_matching_icons (cQuery); |
4518 | + GList *pList2 = cd_dbus_find_matching_icons (str+1); |
4519 | + return _merge (pList1, pList2); |
4520 | + } |
4521 | + return _find_matching_icons_for_test (cQuery); |
4522 | +} |
4523 | + |
4524 | + |
4525 | +gboolean cd_dbus_main_get_icon_properties (dbusMainObject *pDbusCallback, gchar *cIconQuery, GPtrArray **pIconAttributes, GError **error) |
4526 | +{ |
4527 | + GList *pList = cd_dbus_find_matching_icons (cIconQuery); // if NULL, will just return an empty array. |
4528 | + |
4529 | + GPtrArray *pTab = g_ptr_array_new (); |
4530 | + *pIconAttributes = pTab; |
4531 | + |
4532 | + GHashTable *h; |
4533 | + GValue *v; |
4534 | + Icon *pIcon; |
4535 | + CairoContainer *pContainer; |
4536 | + int iPosition; |
4537 | + const gchar *cType; |
4538 | + const gchar *cContainerName; |
4539 | + const gchar *cDesktopFile; |
4540 | + GList *ic; |
4541 | + for (ic = pList; ic != NULL; ic = ic->next) |
4542 | + { |
4543 | + pIcon = ic->data; |
4544 | + pContainer = cairo_dock_search_container_from_icon (pIcon); |
4545 | + |
4546 | + h = g_hash_table_new_full (g_str_hash, |
4547 | + g_str_equal, |
4548 | + g_free, /// can we use const char here instead of duplicating each string ?... |
4549 | + g_free); |
4550 | + g_ptr_array_add (pTab, h); |
4551 | + |
4552 | + if (CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (pIcon)) |
4553 | + cType = "Launcher"; |
4554 | + else if (CAIRO_DOCK_ICON_TYPE_IS_APPLI (pIcon)) |
4555 | + cType = "Application"; |
4556 | + else if (CAIRO_DOCK_ICON_TYPE_IS_APPLET (pIcon)) |
4557 | + cType = "Applet"; |
4558 | + else if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon)) |
4559 | + cType = "Separator"; |
4560 | + else if (CAIRO_DOCK_ICON_TYPE_IS_CONTAINER (pIcon)) |
4561 | + cType = "Container"; |
4562 | + else if (CAIRO_DOCK_ICON_TYPE_IS_CLASS_CONTAINER (pIcon)) |
4563 | + cType = "Class-Container"; |
4564 | + else |
4565 | + cType = "Other"; |
4566 | + v = g_new0 (GValue, 1); |
4567 | + g_value_init (v, G_TYPE_STRING); |
4568 | + g_value_set_string (v, cType); |
4569 | + g_hash_table_insert (h, g_strdup ("type"), v); |
4570 | + |
4571 | + cDesktopFile = NULL; |
4572 | + if (pIcon->cDesktopFileName != NULL) |
4573 | + cDesktopFile = pIcon->cDesktopFileName; |
4574 | + else if (CAIRO_DOCK_IS_APPLET (pIcon)) |
4575 | + cDesktopFile = pIcon->pModuleInstance->cConfFilePath; |
4576 | + v = g_new0 (GValue, 1); |
4577 | + g_value_init (v, G_TYPE_STRING); |
4578 | + g_value_set_string (v, cDesktopFile); |
4579 | + g_hash_table_insert (h, g_strdup ("config-file"), v); |
4580 | + |
4581 | + if (CAIRO_DOCK_IS_APPLET (pIcon)) |
4582 | + { |
4583 | + v = g_new0 (GValue, 1); |
4584 | + g_value_init (v, G_TYPE_STRING); |
4585 | + g_value_set_string (v, pIcon->pModuleInstance->pModule->pVisitCard->cModuleName); |
4586 | + g_hash_table_insert (h, g_strdup ("module"), v); |
4587 | + } |
4588 | + |
4589 | + v = g_new0 (GValue, 1); |
4590 | + g_value_init (v, G_TYPE_STRING); |
4591 | + g_value_set_string (v, pIcon->cName); /// g_value_set_static_string ?... |
4592 | + g_hash_table_insert (h, g_strdup ("name"), v); |
4593 | + |
4594 | + v = g_new0 (GValue, 1); |
4595 | + g_value_init (v, G_TYPE_STRING); |
4596 | + g_value_set_string (v, pIcon->cCommand); |
4597 | + g_hash_table_insert (h, g_strdup ("command"), v); |
4598 | + |
4599 | + v = g_new0 (GValue, 1); |
4600 | + g_value_init (v, G_TYPE_STRING); |
4601 | + g_value_set_string (v, pIcon->cClass); |
4602 | + g_hash_table_insert (h, g_strdup ("class"), v); |
4603 | + |
4604 | + v = g_new0 (GValue, 1); |
4605 | + g_value_init (v, G_TYPE_STRING); |
4606 | + g_value_set_string (v, pIcon->cFileName); |
4607 | + g_hash_table_insert (h, g_strdup ("icon"), v); |
4608 | + |
4609 | + v = g_new0 (GValue, 1); |
4610 | + g_value_init (v, G_TYPE_STRING); |
4611 | + g_value_set_string (v, pIcon->cQuickInfo); |
4612 | + g_hash_table_insert (h, g_strdup ("quick-info"), v); |
4613 | + |
4614 | + v = g_new0 (GValue, 1); |
4615 | + g_value_init (v, G_TYPE_UINT); |
4616 | + g_value_set_uint (v, pIcon->Xid); |
4617 | + g_hash_table_insert (h, g_strdup ("Xid"), v); |
4618 | + |
4619 | + iPosition = -1; |
4620 | + cContainerName = NULL; |
4621 | + if (CAIRO_DOCK_IS_DOCK (pContainer)) |
4622 | + { |
4623 | + CairoDock *pDock = CAIRO_DOCK (pContainer); |
4624 | + iPosition = g_list_index (pDock->icons, pIcon); |
4625 | + cContainerName = pIcon->cParentDockName; |
4626 | + } |
4627 | + else if (CAIRO_DOCK_IS_DESKLET (pContainer)) |
4628 | + { |
4629 | + CairoDesklet *pDesklet = CAIRO_DESKLET (pContainer); |
4630 | + if (pDesklet->pIcon == pIcon) |
4631 | + iPosition = 0; |
4632 | + else |
4633 | + iPosition = g_list_index (pDesklet->icons, pIcon); |
4634 | + if (CAIRO_DOCK_IS_APPLET (pDesklet->pIcon)) |
4635 | + cContainerName = pDesklet->pIcon->pModuleInstance->pModule->pVisitCard->cModuleName; |
4636 | + } |
4637 | + v = g_new0 (GValue, 1); |
4638 | + g_value_init (v, G_TYPE_INT); |
4639 | + g_value_set_int (v, iPosition); |
4640 | + g_hash_table_insert (h, g_strdup ("position"), v); |
4641 | + |
4642 | + v = g_new0 (GValue, 1); |
4643 | + g_value_init (v, G_TYPE_STRING); |
4644 | + g_value_set_string (v, cContainerName); |
4645 | + g_hash_table_insert (h, g_strdup ("container"), v); |
4646 | + |
4647 | + v = g_new0 (GValue, 1); |
4648 | + g_value_init (v, G_TYPE_DOUBLE); |
4649 | + g_value_set_double (v, pIcon->fOrder); |
4650 | + g_hash_table_insert (h, g_strdup ("order"), v); |
4651 | + } |
4652 | + |
4653 | + g_list_free (pList); |
4654 | + return TRUE; |
4655 | +} |
4656 | + |
4657 | +static void _set_container_props (CairoContainer *pContainer, GHashTable *h) |
4658 | +{ |
4659 | + GValue *v; |
4660 | + int x, y, w, ht; |
4661 | + if (pContainer->bIsHorizontal) |
4662 | + { |
4663 | + x = pContainer->iWindowPositionX; |
4664 | + y = pContainer->iWindowPositionY; |
4665 | + w = pContainer->iWidth; |
4666 | + ht = pContainer->iHeight; |
4667 | + } |
4668 | + else |
4669 | + { |
4670 | + y = pContainer->iWindowPositionX; |
4671 | + x = pContainer->iWindowPositionY; |
4672 | + ht = pContainer->iWidth; |
4673 | + w = pContainer->iHeight; |
4674 | + } |
4675 | + v = g_new0 (GValue, 1); |
4676 | + g_value_init (v, G_TYPE_INT); |
4677 | + g_value_set_int (v, pContainer->iWindowPositionX); |
4678 | + g_hash_table_insert (h, g_strdup ("x"), v); |
4679 | + |
4680 | + v = g_new0 (GValue, 1); |
4681 | + g_value_init (v, G_TYPE_INT); |
4682 | + g_value_set_int (v, y); |
4683 | + g_hash_table_insert (h, g_strdup ("y"), v); |
4684 | + |
4685 | + v = g_new0 (GValue, 1); |
4686 | + g_value_init (v, G_TYPE_INT); |
4687 | + g_value_set_int (v, w); |
4688 | + g_hash_table_insert (h, g_strdup ("width"), v); |
4689 | + |
4690 | + v = g_new0 (GValue, 1); |
4691 | + g_value_init (v, G_TYPE_INT); |
4692 | + g_value_set_int (v, ht); |
4693 | + g_hash_table_insert (h, g_strdup ("height"), v); |
4694 | + |
4695 | + CairoDockPositionType iScreenBorder = ((! pContainer->bIsHorizontal) << 1) | (! pContainer->bDirectionUp); |
4696 | + v = g_new0 (GValue, 1); |
4697 | + g_value_init (v, G_TYPE_UINT); |
4698 | + g_value_set_uint (v, iScreenBorder); |
4699 | + g_hash_table_insert (h, g_strdup ("orientation"), v); |
4700 | +} |
4701 | +static void _insert_dock_props (const gchar *cDockName, CairoDock *pDock, GPtrArray *pTab) |
4702 | +{ |
4703 | + GHashTable *h = g_hash_table_new_full (g_str_hash, |
4704 | + g_str_equal, |
4705 | + g_free, /// can we use const char here instead of duplicating each string ?... |
4706 | + g_free); |
4707 | + g_ptr_array_add (pTab, h); |
4708 | + |
4709 | + GValue *v; |
4710 | + |
4711 | + v = g_new0 (GValue, 1); |
4712 | + g_value_init (v, G_TYPE_STRING); |
4713 | + g_value_set_string (v, "Dock"); |
4714 | + g_hash_table_insert (h, g_strdup ("type"), v); |
4715 | + |
4716 | + v = g_new0 (GValue, 1); |
4717 | + g_value_init (v, G_TYPE_STRING); |
4718 | + g_value_set_string (v, cDockName); |
4719 | + g_hash_table_insert (h, g_strdup ("name"), v); |
4720 | + |
4721 | + v = g_new0 (GValue, 1); |
4722 | + g_value_init (v, G_TYPE_BOOLEAN); |
4723 | + g_value_set_boolean (v, (pDock->iRefCount > 0)); |
4724 | + g_hash_table_insert (h, g_strdup ("is-sub-dock"), v); |
4725 | + |
4726 | + v = g_new0 (GValue, 1); |
4727 | + g_value_init (v, G_TYPE_INT); |
4728 | + g_value_set_int (v, g_list_length (pDock->icons)); |
4729 | + g_hash_table_insert (h, g_strdup ("nb-icons"), v); |
4730 | + |
4731 | + _set_container_props (CAIRO_CONTAINER (pDock), h); |
4732 | +} |
4733 | +static gboolean _insert_desklet_props (CairoDesklet *pDesklet, GPtrArray *pTab) |
4734 | +{ |
4735 | + GHashTable *h = g_hash_table_new_full (g_str_hash, |
4736 | + g_str_equal, |
4737 | + g_free, /// can we use const char here instead of duplicating each string ?... |
4738 | + g_free); |
4739 | + g_ptr_array_add (pTab, h); |
4740 | + |
4741 | + GValue *v; |
4742 | + |
4743 | + v = g_new0 (GValue, 1); |
4744 | + g_value_init (v, G_TYPE_STRING); |
4745 | + g_value_set_string (v, "Desklet"); |
4746 | + g_hash_table_insert (h, g_strdup ("type"), v); |
4747 | + |
4748 | + v = g_new0 (GValue, 1); |
4749 | + g_value_init (v, G_TYPE_STRING); |
4750 | + g_value_set_string (v, CAIRO_DOCK_IS_APPLET (pDesklet->pIcon) ? pDesklet->pIcon->pModuleInstance->pModule->pVisitCard->cModuleName : ""); |
4751 | + g_hash_table_insert (h, g_strdup ("name"), v); |
4752 | + |
4753 | + v = g_new0 (GValue, 1); |
4754 | + g_value_init (v, G_TYPE_INT); |
4755 | + g_value_set_int (v, 1 + g_list_length (pDesklet->icons)); |
4756 | + g_hash_table_insert (h, g_strdup ("nb-icons"), v); |
4757 | + |
4758 | + _set_container_props (CAIRO_CONTAINER (pDesklet), h); |
4759 | + return FALSE; |
4760 | +} |
4761 | +static gboolean _check_desklet_name (CairoDesklet *pDesklet, const gchar *cName) |
4762 | +{ |
4763 | + if (CAIRO_DOCK_IS_APPLET (pDesklet->pIcon)) |
4764 | + { |
4765 | + return (strcmp (cName, pDesklet->pIcon->pModuleInstance->pModule->pVisitCard->cModuleName) == 0); |
4766 | + } |
4767 | + return FALSE; |
4768 | +} |
4769 | +gboolean cd_dbus_main_get_container_properties (dbusMainObject *pDbusCallback, const gchar *cName, GPtrArray **pAttributes, GError **error) |
4770 | +{ |
4771 | + nullify_argument (cName); |
4772 | + |
4773 | + GPtrArray *pTab = g_ptr_array_new (); |
4774 | + *pAttributes = pTab; |
4775 | + |
4776 | + if (cName == NULL) |
4777 | + { |
4778 | + cairo_dock_foreach_docks ((GHFunc)_insert_dock_props, pTab); |
4779 | + cairo_dock_foreach_desklet ((CairoDockForeachDeskletFunc) _insert_desklet_props, pTab); |
4780 | + } |
4781 | + else |
4782 | + { |
4783 | + CairoDock *pDock = cairo_dock_search_dock_from_name (cName); |
4784 | + if (pDock != NULL) |
4785 | + { |
4786 | + _insert_dock_props (cName, pDock, pTab); |
4787 | + } |
4788 | + else |
4789 | + { |
4790 | + CairoDesklet *pDesklet = cairo_dock_foreach_desklet ((CairoDockForeachDeskletFunc) _check_desklet_name, (gpointer)cName); |
4791 | + if (pDesklet != NULL) |
4792 | + { |
4793 | + _insert_desklet_props (pDesklet, pTab); |
4794 | + } |
4795 | + } |
4796 | + } |
4797 | + |
4798 | + return TRUE; |
4799 | +} |
4800 | + |
4801 | +static gboolean _insert_module_props (CairoDockModule *pModule, GPtrArray *pTab) |
4802 | +{ |
4803 | + GHashTable *h = g_hash_table_new_full (g_str_hash, |
4804 | + g_str_equal, |
4805 | + g_free, /// can we use const char here instead of duplicating each string ?... |
4806 | + g_free); |
4807 | + g_ptr_array_add (pTab, h); |
4808 | + |
4809 | + GValue *v; |
4810 | + |
4811 | + v = g_new0 (GValue, 1); |
4812 | + g_value_init (v, G_TYPE_STRING); |
4813 | + g_value_set_string (v, pModule->pVisitCard->cModuleName); |
4814 | + g_hash_table_insert (h, g_strdup ("name"), v); |
4815 | + |
4816 | + v = g_new0 (GValue, 1); |
4817 | + g_value_init (v, G_TYPE_UINT); |
4818 | + g_value_set_uint (v, pModule->pVisitCard->iContainerType); |
4819 | + g_hash_table_insert (h, g_strdup ("type"), v); |
4820 | + |
4821 | + v = g_new0 (GValue, 1); |
4822 | + g_value_init (v, G_TYPE_UINT); |
4823 | + g_value_set_uint (v, pModule->pVisitCard->iCategory); |
4824 | + g_hash_table_insert (h, g_strdup ("category"), v); |
4825 | + |
4826 | + v = g_new0 (GValue, 1); |
4827 | + g_value_init (v, G_TYPE_STRING); |
4828 | + g_value_set_string (v, pModule->pVisitCard->cTitle); |
4829 | + g_hash_table_insert (h, g_strdup ("title"), v); |
4830 | + |
4831 | + v = g_new0 (GValue, 1); |
4832 | + g_value_init (v, G_TYPE_STRING); |
4833 | + g_value_set_string (v, pModule->pVisitCard->cIconFilePath); |
4834 | + g_hash_table_insert (h, g_strdup ("icon"), v); |
4835 | + |
4836 | + v = g_new0 (GValue, 1); |
4837 | + g_value_init (v, G_TYPE_STRING); |
4838 | + g_value_set_string (v, pModule->pVisitCard->cPreviewFilePath); |
4839 | + g_hash_table_insert (h, g_strdup ("preview"), v); |
4840 | + |
4841 | + v = g_new0 (GValue, 1); |
4842 | + g_value_init (v, G_TYPE_STRING); |
4843 | + g_value_set_string (v, dgettext (pModule->pVisitCard->cGettextDomain, pModule->pVisitCard->cDescription)); |
4844 | + g_hash_table_insert (h, g_strdup ("description"), v); |
4845 | + |
4846 | + v = g_new0 (GValue, 1); |
4847 | + g_value_init (v, G_TYPE_STRING); |
4848 | + g_value_set_string (v, pModule->pVisitCard->cAuthor); |
4849 | + g_hash_table_insert (h, g_strdup ("author"), v); |
4850 | + |
4851 | + v = g_new0 (GValue, 1); |
4852 | + g_value_init (v, G_TYPE_BOOLEAN); |
4853 | + g_value_set_boolean (v, pModule->pVisitCard->bMultiInstance); |
4854 | + g_hash_table_insert (h, g_strdup ("is-multi-instance"), v); |
4855 | + |
4856 | + g_print ("list instances ...\n"); |
4857 | + gchar **pInstances = g_new0 (gchar*, g_list_length (pModule->pInstancesList)+1); |
4858 | + CairoDockModuleInstance *pInstance; |
4859 | + int i = 0; |
4860 | + GList *mi; |
4861 | + for (mi = pModule->pInstancesList; mi != NULL; mi = mi->next) |
4862 | + { |
4863 | + pInstance = mi->data; |
4864 | + pInstances[i++] = g_strdup (pInstance->cConfFilePath); |
4865 | + } |
4866 | + g_print ("write instances ...\n"); |
4867 | + v = g_new0 (GValue, 1); |
4868 | + g_value_init (v, G_TYPE_STRV); |
4869 | + g_value_set_boxed (v, pInstances); |
4870 | + g_hash_table_insert (h, g_strdup ("instances"), v); |
4871 | + g_print ("done.\n"); |
4872 | + return TRUE; // continue |
4873 | +} |
4874 | +gboolean cd_dbus_main_get_module_properties (dbusMainObject *pDbusCallback, const gchar *cName, GPtrArray **pAttributes, GError **error) |
4875 | +{ |
4876 | + nullify_argument (cName); |
4877 | + |
4878 | + GPtrArray *pTab = g_ptr_array_new (); |
4879 | + *pAttributes = pTab; |
4880 | + |
4881 | + if (cName == NULL) |
4882 | + { |
4883 | + cairo_dock_foreach_module_in_alphabetical_order ((GCompareFunc) _insert_module_props, pTab); |
4884 | + } |
4885 | + else |
4886 | + { |
4887 | + CairoDockModule *pModule = cairo_dock_find_module_from_name (cName); |
4888 | + if (pModule != NULL) |
4889 | + { |
4890 | + _insert_module_props (pModule, pTab); |
4891 | + } |
4892 | + } |
4893 | + return TRUE; |
4894 | +} |
4895 | + |
4896 | +gboolean cd_dbus_main_add_launcher (dbusMainObject *pDbusCallback, const gchar *cDesktopFilePath, gdouble fOrder, const gchar *cDockName, gchar **cLauncherFile, GError **error) |
4897 | +{ |
4898 | + *cLauncherFile = NULL; |
4899 | + if (! myConfig.bEnableCreateLauncher) |
4900 | + return FALSE; |
4901 | + g_return_val_if_fail (cDesktopFilePath != NULL, FALSE); |
4902 | + |
4903 | + //\_______________ get the dock where to insert the icon. |
4904 | + nullify_argument (cDockName); |
4905 | + if (cDockName == NULL) |
4906 | + cDockName = CAIRO_DOCK_MAIN_DOCK_NAME; |
4907 | + |
4908 | + CairoDock * pParentDock = cairo_dock_search_dock_from_name (cDockName); |
4909 | + if (pParentDock == NULL) |
4910 | + { |
4911 | + cd_warning ("dock %s does not exist", cDockName); |
4912 | + pParentDock = g_pMainDock; |
4913 | + } |
4914 | + |
4915 | + //\_______________ add a new icon in the current theme. |
4916 | + int iLauncherType = -1; |
4917 | + if (strcmp (cDesktopFilePath, "separator.desktop") == 0) |
4918 | + iLauncherType = CAIRO_DOCK_DESKTOP_FILE_FOR_SEPARATOR; |
4919 | + else if (strcmp (cDesktopFilePath, "container.desktop") == 0) |
4920 | + iLauncherType = CAIRO_DOCK_DESKTOP_FILE_FOR_CONTAINER; |
4921 | + else if (strcmp (cDesktopFilePath, "launcher.desktop") == 0) |
4922 | + iLauncherType = CAIRO_DOCK_DESKTOP_FILE_FOR_LAUNCHER; |
4923 | + |
4924 | + if (fOrder < 0) |
4925 | + fOrder = CAIRO_DOCK_LAST_ORDER; |
4926 | + Icon *pNewIcon; |
4927 | + if (iLauncherType != -1) |
4928 | + pNewIcon = cairo_dock_add_new_launcher_by_type (iLauncherType, pParentDock, fOrder, CAIRO_DOCK_LAUNCHER); |
4929 | + else |
4930 | + pNewIcon = cairo_dock_add_new_launcher_by_uri (cDesktopFilePath, pParentDock, fOrder); |
4931 | + if (pNewIcon != NULL) |
4932 | + { |
4933 | + *cLauncherFile = g_strdup (pNewIcon->cDesktopFileName); |
4934 | + return TRUE; |
4935 | + } |
4936 | + else |
4937 | + return FALSE; |
4938 | +} |
4939 | + |
4940 | +gboolean cd_dbus_main_add_temporary_icon (dbusMainObject *pDbusCallback, GHashTable *hIconAttributes, GError **error) |
4941 | +{ |
4942 | + if (! myConfig.bEnableCreateLauncher) |
4943 | + return FALSE; |
4944 | + |
4945 | + g_return_val_if_fail (hIconAttributes != NULL, FALSE); |
4946 | + |
4947 | + //\_______________ get the attributes. |
4948 | + GValue *v; |
4949 | + const gchar *cType = "Launcher"; |
4950 | + v = g_hash_table_lookup (hIconAttributes, "type"); |
4951 | + if (v && G_VALUE_HOLDS_STRING (v)) |
4952 | + { |
4953 | + cType = g_value_get_string (v); |
4954 | + } |
4955 | + |
4956 | + const gchar *cIcon = NULL; |
4957 | + v = g_hash_table_lookup (hIconAttributes, "icon"); |
4958 | + if (v && G_VALUE_HOLDS_STRING (v)) |
4959 | + { |
4960 | + cIcon = g_value_get_string (v); |
4961 | + } |
4962 | + |
4963 | + const gchar *cName = NULL; |
4964 | + v = g_hash_table_lookup (hIconAttributes, "name"); |
4965 | + if (!v) |
4966 | + v = g_hash_table_lookup (hIconAttributes, "label"); |
4967 | + if (v && G_VALUE_HOLDS_STRING (v)) |
4968 | + { |
4969 | + cName = g_value_get_string (v); |
4970 | + } |
4971 | + |
4972 | + const gchar *cParentDockName = CAIRO_DOCK_MAIN_DOCK_NAME; |
4973 | + v = g_hash_table_lookup (hIconAttributes, "container"); |
4974 | + if (v && G_VALUE_HOLDS_STRING (v)) |
4975 | + { |
4976 | + cParentDockName = g_value_get_string (v); |
4977 | + } |
4978 | + |
4979 | + const gchar *cQuickInfo = NULL; |
4980 | + v = g_hash_table_lookup (hIconAttributes, "quick-info"); |
4981 | + if (v && G_VALUE_HOLDS_STRING (v)) |
4982 | + { |
4983 | + cQuickInfo = g_value_get_string (v); |
4984 | + } |
4985 | + |
4986 | + double fOrder = CAIRO_DOCK_LAST_ORDER; |
4987 | + v = g_hash_table_lookup (hIconAttributes, "order"); |
4988 | + if (v && G_VALUE_HOLDS_DOUBLE (v)) |
4989 | + { |
4990 | + fOrder = g_value_get_double (v); |
4991 | + } |
4992 | + |
4993 | + int iPosition = -1; |
4994 | + v = g_hash_table_lookup (hIconAttributes, "position"); |
4995 | + if (v && G_VALUE_HOLDS_INT (v)) |
4996 | + { |
4997 | + iPosition = g_value_get_int (v); |
4998 | + } |
4999 | + |
5000 | + const gchar *cCommand = NULL; |
Looks good, thanks!