Merge lp:~cairo-dock-team/ubuntu/oneiric/cairo-dock-plug-ins/2.4.0-0beta2 into lp:ubuntu/oneiric/cairo-dock-plug-ins

Proposed by Matthieu Baerts
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
Reviewer Review Type Date Requested Status
Kees Cook Approve
Review via email: mp+70953@code.launchpad.net

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.

To post a comment you must log in.
Revision history for this message
Kees Cook (kees) wrote :

Looks good, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Animated-icons/data/Animated-icons.conf.in'
--- Animated-icons/data/Animated-icons.conf.in 2011-04-20 20:46:51 +0000
+++ Animated-icons/data/Animated-icons.conf.in 2011-08-09 20:07:46 +0000
@@ -1,4 +1,4 @@
1#!en;@VERSION_ANIMATED_ICONS@1#@VERSION_ANIMATED_ICONS@
22
3#[gtk-preferences]3#[gtk-preferences]
4[Global]4[Global]
55
=== modified file 'Animated-icons/src/applet-wobbly.c'
--- Animated-icons/src/applet-wobbly.c 2011-04-20 20:46:51 +0000
+++ Animated-icons/src/applet-wobbly.c 2011-08-09 20:07:46 +0000
@@ -473,7 +473,7 @@
473 473
474 ///glActiveTextureARB(GL_TEXTURE0_ARB); // Go pour le multitexturing 1ere passe474 ///glActiveTextureARB(GL_TEXTURE0_ARB); // Go pour le multitexturing 1ere passe
475 glBindTexture(GL_TEXTURE_2D, pIcon->iIconTexture);475 glBindTexture(GL_TEXTURE_2D, pIcon->iIconTexture);
476 glColor4f(1.0f, 1.0f, 1.0f, myIconsParam.fAlbedo * pIcon->fAlpha); // transparence du reflet.476 glColor4f(1.0f, 1.0f, 1.0f, myIconsParam.fAlbedo * pIcon->fAlpha / 2); // transparence du reflet.
477 glBlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,477 glBlendFuncSeparate (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA,
478 GL_ONE, GL_ONE_MINUS_SRC_ALPHA);478 GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
479 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);479 glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
480480
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2011-07-05 13:45:43 +0000
+++ CMakeLists.txt 2011-08-09 20:07:46 +0000
@@ -10,7 +10,7 @@
10########### project ###############10########### project ###############
1111
12project ("cairo-dock-plugins")12project ("cairo-dock-plugins")
13set (VERSION "2.3.0~3")13set (VERSION "2.4.0~0beta2")
1414
15add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall15add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall
16if (NOT ${CMAKE_BUILD_TYPE})16if (NOT ${CMAKE_BUILD_TYPE})
@@ -22,11 +22,11 @@
2222
23set (CPACK_SOURCE_GENERATOR "TGZ")23set (CPACK_SOURCE_GENERATOR "TGZ")
24set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")24set (CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${VERSION}")
25set (CPACK_SOURCE_IGNORE_FILES 25set (CPACK_SOURCE_IGNORE_FILES
26 "/build/;/.bzr/;bzrignore$;/misc/;~$;${CPACK_SOURCE_IGNORE_FILES}")26 "/build/;/.bzr/;bzrignore$;/misc/;~$;${CPACK_SOURCE_IGNORE_FILES}")
27include (CPack)27include (CPack)
2828
29add_custom_target( dist29add_custom_target(dist
30 COMMAND ${CMAKE_MAKE_PROGRAM} package_source)30 COMMAND ${CMAKE_MAKE_PROGRAM} package_source)
31add_custom_target(dist-bzr31add_custom_target(dist-bzr
32 COMMAND bzr export ${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz32 COMMAND bzr export ${CMAKE_PROJECT_NAME}-${VERSION}.tar.gz
@@ -48,21 +48,25 @@
4848
49# get plug-ins install dir49# get plug-ins install dir
50execute_process(50execute_process(
51 COMMAND pkg-config cairo-dock --variable=pluginsdir # /usr/lib/cairo-dock51 COMMAND pkg-config gldi --variable=pluginsdir # /usr/lib/cairo-dock
52 OUTPUT_VARIABLE pluginsdir)52 OUTPUT_VARIABLE pluginsdir)
53STRING (REGEX REPLACE "\n" "" pluginsdir ${pluginsdir}) # la commande rajoute un retour chariot ...53STRING (REGEX REPLACE "\n" "" pluginsdir ${pluginsdir}) # la commande rajoute un retour chariot ...
54# get plug-ins data dir54# get plug-ins data dir
55execute_process(55execute_process(
56 COMMAND pkg-config cairo-dock --variable=pluginsdatadir # /usr/share/cairo-dock/plug-ins56 COMMAND pkg-config gldi --variable=pluginsdatadir # /usr/share/cairo-dock/plug-ins
57 OUTPUT_VARIABLE pluginsdatadir)57 OUTPUT_VARIABLE pluginsdatadir)
58STRING (REGEX REPLACE "\n" "" pluginsdatadir ${pluginsdatadir})58STRING (REGEX REPLACE "\n" "" pluginsdatadir ${pluginsdatadir})
59# check that version matches with the core59# check that version matches with the core
60execute_process(60execute_process(
61 COMMAND pkg-config --modversion cairo-dock # 2.2.0-361 COMMAND pkg-config --modversion gldi # 2.2.0-3
62 OUTPUT_VARIABLE dock_version)62 OUTPUT_VARIABLE dock_version)
63STRING (REGEX REPLACE "\n" "" dock_version ${dock_version})63STRING (REGEX REPLACE "\n" "" dock_version ${dock_version})
64if (NOT "${dock_version}" STREQUAL "${VERSION}") # Version64if (NOT "${dock_version}" STREQUAL "${VERSION}") # Version
65 MESSAGE (FATAL_ERROR "warning : version mismatch with the core : " ${VERSION} <> ${dock_version})65 if ("${PACKAGEMENT}" STREQUAL "")
66 MESSAGE (FATAL_ERROR "Error : version mismatch with the core : " ${VERSION} <> ${dock_version})
67 else ()
68 MESSAGE (WARNING "Warning : version mismatch with the core : " ${VERSION} <> ${dock_version})
69 endif ()
66endif()70endif()
6771
68#if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT "${FORCE_LIB64}" STREQUAL "") # 64bits and force install in lib6472#if( CMAKE_SIZEOF_VOID_P EQUAL 8 AND NOT "${FORCE_LIB64}" STREQUAL "") # 64bits and force install in lib64
@@ -76,7 +80,9 @@
76GET_FILENAME_COMPONENT(libdir "${pluginsdir}/.." ABSOLUTE) # /usr/lib80GET_FILENAME_COMPONENT(libdir "${pluginsdir}/.." ABSOLUTE) # /usr/lib
77GET_FILENAME_COMPONENT(prefix "${pluginsdir}/../.." ABSOLUTE) # /usr81GET_FILENAME_COMPONENT(prefix "${pluginsdir}/../.." ABSOLUTE) # /usr
78if (NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${prefix}")82if (NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "${prefix}")
79 message (STATUS "Warning : plug-ins should be installed in the same directory as the core, that is to say in ${pluginsdir}")83 message (STATUS "It seems that the current CMAKE_INSTALL_PREFIX flag is not the same that you have used with the core.")
84 message (STATUS " It will be replaced by this value: ${prefix}")
85 message (WARNING "Plug-ins should be installed in the same directory as the core, that is to say in ${pluginsdir}")
80 set (CMAKE_INSTALL_PREFIX "${prefix}")86 set (CMAKE_INSTALL_PREFIX "${prefix}")
81 #set (libdir "${CMAKE_INSTALL_PREFIX}/${libname}/cairo-dock")87 #set (libdir "${CMAKE_INSTALL_PREFIX}/${libname}/cairo-dock")
82endif()88endif()
@@ -88,6 +94,10 @@
8894
89set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") # additionnal FindPackage files95set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") # additionnal FindPackage files
9096
97set (MODULES_MISSING "")
98set (MODULES_INTEGRATION_MISSING "")
99set (PROGRAMS_MISSING "")
100
91########### dependancies ###############101########### dependancies ###############
92102
93message ("")103message ("")
@@ -96,7 +106,10 @@
96message (STATUS "=====================")106message (STATUS "=====================")
97message ("")107message ("")
98108
99pkg_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")109pkg_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")
110pkg_check_modules ("GLDI" REQUIRED "gldi") # we don't want to link with gldi
111set (PACKAGE_INCLUDE_DIRS "${GLDI_INCLUDE_DIRS}")
112#message (STATUS "PACKAGE: ${PACKAGE_INCLUDE_DIRS}")
100113
101############# GLIB #################114############# GLIB #################
102pkg_check_modules (GLIB glib-2.0)115pkg_check_modules (GLIB glib-2.0)
@@ -107,14 +120,17 @@
107 STRING (REGEX REPLACE "-.*" "" GLIB_NANO "${GLIB_NANO}")120 STRING (REGEX REPLACE "-.*" "" GLIB_NANO "${GLIB_NANO}")
108121
109############# ALSA_MIXER #################122############# ALSA_MIXER #################
123message (STATUS "> AlsaMixer:")
110set (with_alsa "no")124set (with_alsa "no")
111if (NOT "${enable-alsa-mixer}" STREQUAL "no")125if (NOT "${enable-alsa-mixer}" STREQUAL "no")
112 pkg_check_modules (ALSA_MIXER_PACKAGE alsa)126 pkg_check_modules (ALSA_MIXER_PACKAGE alsa)
113 if ("${ALSA_MIXER_PACKAGE_FOUND}" STREQUAL "")127 if ("${ALSA_MIXER_PACKAGE_FOUND}" STREQUAL "")
114 message (STATUS "Could not find alsa; Cairo-Dock won't be built with AlsaMixer applet.")128 message (STATUS "Could not find alsa; Cairo-Dock won't be built with AlsaMixer applet.")
129 message (WARNING "This module is required to compile AlsaMixer applet: alsa")
130 set (MODULES_MISSING "${MODULES_MISSING} alsa")
115 else()131 else()
116 set (GETTEXT_ALSA_MIXER ${GETTEXT_PLUGINS})132 set (GETTEXT_ALSA_MIXER ${GETTEXT_PLUGINS})
117 set (VERSION_ALSA_MIXER "1.0.12")133 set (VERSION_ALSA_MIXER "1.0.13")
118 set (PACKAGE_ALSA_MIXER "cd-AlsaMixer")134 set (PACKAGE_ALSA_MIXER "cd-AlsaMixer")
119 set (with_alsa "yes")135 set (with_alsa "yes")
120 set (alsa_mixerdatadir "${pluginsdatadir}/AlsaMixer")136 set (alsa_mixerdatadir "${pluginsdatadir}/AlsaMixer")
@@ -124,6 +140,7 @@
124endif()140endif()
125141
126############# ANIMATED ICONS #################142############# ANIMATED ICONS #################
143message (STATUS "> Animated Icons:")
127set (GETTEXT_ANIMATED_ICONS ${GETTEXT_PLUGINS})144set (GETTEXT_ANIMATED_ICONS ${GETTEXT_PLUGINS})
128set (VERSION_ANIMATED_ICONS "1.0.10")145set (VERSION_ANIMATED_ICONS "1.0.10")
129set (PACKAGE_ANIMATED_ICONS "cd-Animated-icons")146set (PACKAGE_ANIMATED_ICONS "cd-Animated-icons")
@@ -132,8 +149,9 @@
132add_subdirectory (Animated-icons)149add_subdirectory (Animated-icons)
133150
134############# CAIRO_PENGUIN #################151############# CAIRO_PENGUIN #################
152message (STATUS "> Cairo Penguin:")
135set (GETTEXT_CAIRO_PENGUIN ${GETTEXT_PLUGINS})153set (GETTEXT_CAIRO_PENGUIN ${GETTEXT_PLUGINS})
136set (VERSION_CAIRO_PENGUIN "1.1.8")154set (VERSION_CAIRO_PENGUIN "1.1.9")
137set (PACKAGE_CAIRO_PENGUIN "cd-Cairo-Penguin")155set (PACKAGE_CAIRO_PENGUIN "cd-Cairo-Penguin")
138set (cairo_penguinuserdirname "Cairo-Penguin")156set (cairo_penguinuserdirname "Cairo-Penguin")
139set (cairo_penguindatadir "${pluginsdatadir}/Cairo-Penguin")157set (cairo_penguindatadir "${pluginsdatadir}/Cairo-Penguin")
@@ -141,54 +159,64 @@
141add_subdirectory (Cairo-Penguin)159add_subdirectory (Cairo-Penguin)
142160
143############# CLIPPER #################161############# CLIPPER #################
162message (STATUS "> Clipper:")
144set (GETTEXT_CLIPPER ${GETTEXT_PLUGINS})163set (GETTEXT_CLIPPER ${GETTEXT_PLUGINS})
145set (VERSION_CLIPPER "1.1.4")164set (VERSION_CLIPPER "1.1.5")
146set (PACKAGE_CLIPPER "cd-Clipper")165set (PACKAGE_CLIPPER "cd-Clipper")
147set (Clipperdatadir "${pluginsdatadir}/Clipper")166set (Clipperdatadir "${pluginsdatadir}/Clipper")
148configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Clipper/data/Clipper.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Clipper/data/Clipper.conf)167configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Clipper/data/Clipper.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Clipper/data/Clipper.conf)
149add_subdirectory (Clipper)168add_subdirectory (Clipper)
150169
151############# CLOCK #################170############# CLOCK #################
171message (STATUS "> Clock:")
152set (with_ical "yes")172set (with_ical "yes")
153pkg_check_modules ("LIBICAL_PACKAGE" "libical")173pkg_check_modules ("LIBICAL_PACKAGE" "libical")
154if ("${LIBICAL_PACKAGE_FOUND}" STREQUAL "")174if ("${LIBICAL_PACKAGE_FOUND}" STREQUAL "")
155 set (with_ical "no")175 set (with_ical "no")
156 message (STATUS "Could not find libical; Clock plugin won't be built with iCal support.")176 message (STATUS "Could not find libical; Clock plugin won't be built with iCal support.")
177 message (WARNING "This module is required to compile Clock applet with iCal support: libical")
178 set (MODULES_MISSING "${MODULES_MISSING} libical")
157endif()179endif()
158set (GETTEXT_CLOCK ${GETTEXT_PLUGINS})180set (GETTEXT_CLOCK ${GETTEXT_PLUGINS})
159set (VERSION_CLOCK "2.1.2")181set (VERSION_CLOCK "2.1.3")
160set (PACKAGE_CLOCK "cd-clock")182set (PACKAGE_CLOCK "cd-clock")
161set (clockuserdirname "clock")183set (clockuserdirname "clock")
162set (clockdatadir "${pluginsdatadir}/clock")184set (clockdatadir "${pluginsdatadir}/clock")
163configure_file (${CMAKE_CURRENT_SOURCE_DIR}/clock/data/clock.conf.in ${CMAKE_CURRENT_BINARY_DIR}/clock/data/clock.conf)185configure_file (${CMAKE_CURRENT_SOURCE_DIR}/clock/data/clock.conf.in ${CMAKE_CURRENT_BINARY_DIR}/clock/data/clock.conf)
164add_subdirectory (clock)186add_subdirectory (clock)
165187
166############# COMPIZ_ICON #################188############# COMPOSITE_MANAGER #################
167set (GETTEXT_COMPIZ_ICON ${GETTEXT_PLUGINS})189message (STATUS "> Coposite Manager:")
168set (VERSION_COMPIZ_ICON "1.1.6")190set (GETTEXT_COMPOSITE_MANAGER ${GETTEXT_PLUGINS})
169set (PACKAGE_COMPIZ_ICON "cd-compiz-icon")191set (VERSION_COMPOSITE_MANAGER "1.0.0")
170set (compiz_icondatadir "${pluginsdatadir}/compiz-icon")192set (PACKAGE_COMPOSITE_MANAGER "cd-Composite-Manager")
171configure_file (${CMAKE_CURRENT_SOURCE_DIR}/compiz-icon/data/compiz-icon.conf.in ${CMAKE_CURRENT_BINARY_DIR}/compiz-icon/data/compiz-icon.conf)193set (composite_managerdatadir "${pluginsdatadir}/Composite-Manager")
172add_subdirectory (compiz-icon)194configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Composite-Manager/data/Composite-Manager.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Composite-Manager/data/Composite-Manager.conf)
195add_subdirectory (Composite-Manager)
173196
174############# DBUS #################197############# DBUS #################
198message (STATUS "> DBus:")
199message (STATUS "* Python:")
175find_program (PYTHON_EXECUTABLE python)200find_program (PYTHON_EXECUTABLE python)
176EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print sys.version" OUTPUT_VARIABLE PYTHON_VERSION)201EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print sys.version" OUTPUT_VARIABLE PYTHON_VERSION)
177if ("${PYTHON_VERSION}" STREQUAL "") 202if ("${PYTHON_VERSION}" STREQUAL "")
178 message (STATUS "Could not find Python, won't install Python interface.") 203 message (STATUS "Could not find Python, won't install Python interface.")
179 set (with_python "no") 204 message (WARNING "This program is required to compile DBus applet with Python interface: python (version 2)")
180else() 205 set (PROGRAMS_MISSING "${PROGRAMS_MISSING} python")
206 set (with_python "no")
207else()
181 STRING (REGEX REPLACE "\n" "" PYTHON_VERSION ${PYTHON_VERSION})208 STRING (REGEX REPLACE "\n" "" PYTHON_VERSION ${PYTHON_VERSION})
182 message (STATUS "Python Version: ${PYTHON_VERSION}") 209 message (STATUS "Python Version: ${PYTHON_VERSION}")
183 GET_FILENAME_COMPONENT(DEBIAN_VERSION /etc/debian_version ABSOLUTE) 210 GET_FILENAME_COMPONENT(DEBIAN_VERSION /etc/debian_version ABSOLUTE)
184 if (EXISTS ${DEBIAN_VERSION}) 211 if (EXISTS ${DEBIAN_VERSION})
185 message (STATUS " will use '--install-layout deb' with 'python setup.py install'") 212 message (STATUS " will use '--install-layout deb' with 'python setup.py install'")
186 set (DEBIAN_INSTALL_LAYOUT "--install-layout deb")213 set (DEBIAN_INSTALL_LAYOUT "--install-layout deb")
187 endif()214 endif()
188 set (PYTHON_FOUND "TRUE")215 set (PYTHON_FOUND "TRUE")
189 set (with_python "yes") 216 set (with_python "yes")
190endif()217endif()
191218
219message (STATUS "* Ruby:")
192# find_package(Ruby) found libs of ruby-dev but we only need a directory where we can install ruby libs.220# find_package(Ruby) found libs of ruby-dev but we only need a directory where we can install ruby libs.
193find_program (RUBY_EXECUTABLE ruby)221find_program (RUBY_EXECUTABLE ruby)
194EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']"222EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']"
@@ -196,6 +224,8 @@
196message (STATUS "RUBY_LIBRARY: ${RUBY_LIB_DIR}")224message (STATUS "RUBY_LIBRARY: ${RUBY_LIB_DIR}")
197if ("${RUBY_LIB_DIR}" STREQUAL "" OR "${RUBY_LIB_DIR}" STREQUAL "nil")225if ("${RUBY_LIB_DIR}" STREQUAL "" OR "${RUBY_LIB_DIR}" STREQUAL "nil")
198 message (STATUS "Could not find ruby libs, won't install Ruby interface.")226 message (STATUS "Could not find ruby libs, won't install Ruby interface.")
227 message (WARNING "This program is required to compile DBus applet with Ruby interface: ruby")
228 set (PROGRAMS_MISSING "${PROGRAMS_MISSING} ruby")
199 set (with_ruby "no")229 set (with_ruby "no")
200else()230else()
201 string (REGEX REPLACE "lib/ruby/[0-9].[0-9]" "" RUBY_LIB_DIR_INSTALL "${RUBY_LIB_DIR}")231 string (REGEX REPLACE "lib/ruby/[0-9].[0-9]" "" RUBY_LIB_DIR_INSTALL "${RUBY_LIB_DIR}")
@@ -206,6 +236,7 @@
206 set (with_ruby "yes")236 set (with_ruby "yes")
207endif()237endif()
208238
239message (STATUS "* Mono:")
209#find_package (Mono)240#find_package (Mono)
210find_program (GMCS_EXECUTABLE gmcs)241find_program (GMCS_EXECUTABLE gmcs)
211if ("${GMCS_EXECUTABLE}" STREQUAL "" OR NOT EXISTS ${GMCS_EXECUTABLE})242if ("${GMCS_EXECUTABLE}" STREQUAL "" OR NOT EXISTS ${GMCS_EXECUTABLE})
@@ -215,6 +246,8 @@
215 pkg_check_modules (MONO_PACKAGE glib-sharp-2.0 ndesk-dbus-1.0 ndesk-dbus-glib-1.0)246 pkg_check_modules (MONO_PACKAGE glib-sharp-2.0 ndesk-dbus-1.0 ndesk-dbus-glib-1.0)
216 if ("${MONO_PACKAGE_FOUND}" STREQUAL "")247 if ("${MONO_PACKAGE_FOUND}" STREQUAL "")
217 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.")248 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.")
249 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")
250 set (MODULES_MISSING "${MODULES_MISSING} glib-sharp-2.0 ndesk-dbus-1.0 ndesk-dbus-glib-1.0")
218 set (with_mono "no")251 set (with_mono "no")
219 else()252 else()
220 set (MONO_FOUND "TRUE")253 set (MONO_FOUND "TRUE")
@@ -222,6 +255,7 @@
222 endif()255 endif()
223endif()256endif()
224257
258message (STATUS "* Vala:")
225# Valac is only riquired to convert vala files to C files.259# Valac is only riquired to convert vala files to C files.
226# So we can directly use produced files (c, h, vapi) without using valac.260# So we can directly use produced files (c, h, vapi) without using valac.
227set (with_vala "yes")261set (with_vala "yes")
@@ -243,7 +277,7 @@
243277
244 STRING (REGEX REPLACE "\\..*" "" VALA_MAJOR "${VALA_VERSION}")278 STRING (REGEX REPLACE "\\..*" "" VALA_MAJOR "${VALA_VERSION}")
245 # message (STATUS "VALA_MAJOR : ${VALA_MAJOR}")279 # message (STATUS "VALA_MAJOR : ${VALA_MAJOR}")
246 280
247 STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" VALA_MINOR "${VALA_VERSION}") # 0.1.7 => 1.7281 STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" VALA_MINOR "${VALA_VERSION}") # 0.1.7 => 1.7
248 STRING (REGEX REPLACE "\\.[0-9]*" "" VALA_MINOR "${VALA_MINOR}")282 STRING (REGEX REPLACE "\\.[0-9]*" "" VALA_MINOR "${VALA_MINOR}")
249 # message (STATUS "VALA_MINOR : ${VALA_MINOR}")283 # message (STATUS "VALA_MINOR : ${VALA_MINOR}")
@@ -252,13 +286,18 @@
252 STRING (REGEX REPLACE "-.*" "" VALA_NANO "${VALA_NANO}")286 STRING (REGEX REPLACE "-.*" "" VALA_NANO "${VALA_NANO}")
253 # message (STATUS "VALA_NANO : ${VALA_NANO}")287 # message (STATUS "VALA_NANO : ${VALA_NANO}")
254288
255 if (${VALA_MAJOR} GREATER 0 OR ${VALA_MINOR} GREATER 9) # vala > 0.10289 if (${VALA_MAJOR} GREATER 0 OR ${VALA_MINOR} GREATER 9) # vala >= 0.10
256 message (STATUS " Vala compiler OK (>= 0.10).")290 # AND (${VALA_MAJOR} LESS 1 AND ${VALA_MINOR} LESS 13)) # and <= 0.12
291 message (STATUS " Vala compiler OK (>= 0.10).")# and <= 0.12).")
257 set (VALAC_FOUND "TRUE")292 set (VALAC_FOUND "TRUE")
258 set (with_valac "yes")293 set (with_valac "yes")
259 else()294 else()
260 message (STATUS "Vala compiler is too old (0.10 required), won't build Vala interface.")295 message (STATUS "Vala compiler is too old (0.10 required) or too new (> 0.12), won't build Vala interface.")
261 endif()296 endif()
297else()
298 message (STATUS "Could not find ValaC, won't build Vala interface with the version of your distribution.")
299 message (WARNING "This program is required to compile DBus applet with Python interface: valac (version > 0.10)")
300 set (PROGRAMS_MISSING "${PROGRAMS_MISSING} valac")
262endif()301endif()
263302
264303
@@ -270,6 +309,7 @@
270add_subdirectory (Dbus)309add_subdirectory (Dbus)
271310
272############# DESKLET_RENDERING #################311############# DESKLET_RENDERING #################
312message (STATUS "> Desklet Rendering:")
273set (GETTEXT_DESKLET_RENDERING ${GETTEXT_PLUGINS})313set (GETTEXT_DESKLET_RENDERING ${GETTEXT_PLUGINS})
274set (VERSION_DESKLET_RENDERING "1.5.6")314set (VERSION_DESKLET_RENDERING "1.5.6")
275set (PACKAGE_DESKLET_RENDERING "cd-desklet-rendering")315set (PACKAGE_DESKLET_RENDERING "cd-desklet-rendering")
@@ -278,6 +318,7 @@
278add_subdirectory (desklet-rendering)318add_subdirectory (desklet-rendering)
279319
280############# DIALOG_RENDERING #################320############# DIALOG_RENDERING #################
321message (STATUS "> Dialog Rendering:")
281set (GETTEXT_DIALOG_RENDERING ${GETTEXT_PLUGINS})322set (GETTEXT_DIALOG_RENDERING ${GETTEXT_PLUGINS})
282set (VERSION_DIALOG_RENDERING "0.5.1")323set (VERSION_DIALOG_RENDERING "0.5.1")
283set (PACKAGE_DIALOG_RENDERING "cd-dialog-rendering")324set (PACKAGE_DIALOG_RENDERING "cd-dialog-rendering")
@@ -288,8 +329,9 @@
288############# DISKS #################329############# DISKS #################
289set (with_disks "no")330set (with_disks "no")
290if ("${enable-disks}" STREQUAL "yes")331if ("${enable-disks}" STREQUAL "yes")
332 message (STATUS "> Disks:")
291 set (GETTEXT_DISKS ${GETTEXT_PLUGINS})333 set (GETTEXT_DISKS ${GETTEXT_PLUGINS})
292 set (VERSION_DISKS "0.0.2")334 set (VERSION_DISKS "0.0.3")
293 set (PACKAGE_DISKS "cd-disks")335 set (PACKAGE_DISKS "cd-disks")
294 set (with_disks "yes")336 set (with_disks "yes")
295 set (disksdatadir "${pluginsdatadir}/Disks")337 set (disksdatadir "${pluginsdatadir}/Disks")
@@ -298,6 +340,7 @@
298endif()340endif()
299341
300############# DND2SHARE #################342############# DND2SHARE #################
343message (STATUS "> DND2Share:")
301set (GETTEXT_DND2SHARE ${GETTEXT_PLUGINS})344set (GETTEXT_DND2SHARE ${GETTEXT_PLUGINS})
302set (VERSION_DND2SHARE "1.0.6")345set (VERSION_DND2SHARE "1.0.6")
303set (PACKAGE_DND2SHARE "cd-dnd2share")346set (PACKAGE_DND2SHARE "cd-dnd2share")
@@ -306,6 +349,7 @@
306add_subdirectory (dnd2share)349add_subdirectory (dnd2share)
307350
308############# DOCK RENDERING #################351############# DOCK RENDERING #################
352message (STATUS "> Dock Rendering:")
309set (GETTEXT_RENDERING ${GETTEXT_PLUGINS})353set (GETTEXT_RENDERING ${GETTEXT_PLUGINS})
310set (VERSION_RENDERING "1.5.9")354set (VERSION_RENDERING "1.5.9")
311set (PACKAGE_RENDERING "cd-rendering")355set (PACKAGE_RENDERING "cd-rendering")
@@ -316,8 +360,9 @@
316############# DONCKY #################360############# DONCKY #################
317set (with_doncky "no")361set (with_doncky "no")
318if ("${enable-doncky}" STREQUAL "yes")362if ("${enable-doncky}" STREQUAL "yes")
363 message (STATUS "> Doncky:")
319 set (GETTEXT_DONCKY ${GETTEXT_PLUGINS})364 set (GETTEXT_DONCKY ${GETTEXT_PLUGINS})
320 set (VERSION_DONCKY "0.0.4")365 set (VERSION_DONCKY "0.0.5")
321 set (PACKAGE_DONCKY "cd-doncky")366 set (PACKAGE_DONCKY "cd-doncky")
322 set (with_doncky "yes")367 set (with_doncky "yes")
323 set (donckydatadir "${pluginsdatadir}/Doncky")368 set (donckydatadir "${pluginsdatadir}/Doncky")
@@ -326,6 +371,7 @@
326endif()371endif()
327372
328############# DROP INDICATOR #################373############# DROP INDICATOR #################
374message (STATUS "> Drop Indicator:")
329set (GETTEXT_DROP_INDICATOR ${GETTEXT_PLUGINS})375set (GETTEXT_DROP_INDICATOR ${GETTEXT_PLUGINS})
330set (VERSION_DROP_INDICATOR "1.1.4")376set (VERSION_DROP_INDICATOR "1.1.4")
331set (PACKAGE_DROP_INDICATOR "cd-drop_indicator")377set (PACKAGE_DROP_INDICATOR "cd-drop_indicator")
@@ -334,8 +380,9 @@
334add_subdirectory (drop-indicator)380add_subdirectory (drop-indicator)
335381
336############# DUSTBIN #################382############# DUSTBIN #################
383message (STATUS "> Dustbin:")
337set (GETTEXT_DUSTBIN ${GETTEXT_PLUGINS})384set (GETTEXT_DUSTBIN ${GETTEXT_PLUGINS})
338set (VERSION_DUSTBIN "2.3.1")385set (VERSION_DUSTBIN "2.3.2")
339set (PACKAGE_DUSTBIN "cd-dustbin")386set (PACKAGE_DUSTBIN "cd-dustbin")
340set (dustbinuserdirname "dustbin")387set (dustbinuserdirname "dustbin")
341set (dustbindatadir "${pluginsdatadir}/dustbin")388set (dustbindatadir "${pluginsdatadir}/dustbin")
@@ -343,22 +390,26 @@
343add_subdirectory (dustbin)390add_subdirectory (dustbin)
344391
345############# FOLDERS #################392############# FOLDERS #################
393message (STATUS "> Folders:")
346set (GETTEXT_FOLDERS ${GETTEXT_PLUGINS})394set (GETTEXT_FOLDERS ${GETTEXT_PLUGINS})
347set (VERSION_FOLDERS "0.2.1")395set (VERSION_FOLDERS "0.2.2")
348set (PACKAGE_FOLDERS "cd-Folders")396set (PACKAGE_FOLDERS "cd-Folders")
349set (foldersdatadir "${pluginsdatadir}/Folders")397set (foldersdatadir "${pluginsdatadir}/Folders")
350configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Folders/data/Folders.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Folders/data/Folders.conf)398configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Folders/data/Folders.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Folders/data/Folders.conf)
351add_subdirectory (Folders)399add_subdirectory (Folders)
352400
353############# GMENU #################401############# GMENU #################
402message (STATUS "> GMenu:")
354set (with_gmenu "no")403set (with_gmenu "no")
355if (NOT "${enable-gmenu}" STREQUAL "no")404if (NOT "${enable-gmenu}" STREQUAL "no")
356 pkg_check_modules (GMENU_PACKAGE libgnome-menu)405 pkg_check_modules (GMENU_PACKAGE libgnome-menu)
357 if ("${GMENU_PACKAGE_FOUND}" STREQUAL "")406 if ("${GMENU_PACKAGE_FOUND}" STREQUAL "")
358 message (STATUS "Could not find libgnome-menu; Cairo-Dock won't be built with GMenu applet.")407 message (STATUS "Could not find libgnome-menu; Cairo-Dock won't be built with GMenu applet.")
408 message (WARNING "This module is required to compile GMenu applet: libgnome-menu")
409 set (MODULES_MISSING "${MODULES_MISSING} libgnome-menu")
359 else()410 else()
360 set (GETTEXT_GMENU ${GETTEXT_PLUGINS})411 set (GETTEXT_GMENU ${GETTEXT_PLUGINS})
361 set (VERSION_GMENU "1.1.6")412 set (VERSION_GMENU "1.1.8")
362 set (PACKAGE_GMENU "cd-GMenu")413 set (PACKAGE_GMENU "cd-GMenu")
363 set (with_gmenu "yes")414 set (with_gmenu "yes")
364 set (gmenudatadir "${pluginsdatadir}/GMenu")415 set (gmenudatadir "${pluginsdatadir}/GMenu")
@@ -368,15 +419,19 @@
368endif()419endif()
369420
370############# GVFS-INTEGRATION #################421############# GVFS-INTEGRATION #################
422message (STATUS "> GVFS-Integration:")
371pkg_check_modules ("LIBGIO" "gio-2.0")423pkg_check_modules ("LIBGIO" "gio-2.0")
372add_subdirectory (gvfs-integration)424add_subdirectory (gvfs-integration)
373425
374############# GNOME-INTEGRATION #################426############# GNOME-INTEGRATION #################
427message (STATUS "> Gnome-Integration:")
375set (with_gnome_integration "no")428set (with_gnome_integration "no")
376if (NOT "${enable-gnome-integration}" STREQUAL "no")429if (NOT "${enable-gnome-integration}" STREQUAL "no")
377 pkg_check_modules (GNOME_INTEGRATION gio-2.0)430 pkg_check_modules (GNOME_INTEGRATION gio-2.0)
378 if ("${GNOME_INTEGRATION_FOUND}" STREQUAL "")431 if ("${GNOME_INTEGRATION_FOUND}" STREQUAL "")
379 message (STATUS "Could not find gio; Cairo-Dock won't be built with Gnome>=2.22 support.")432 message (STATUS "Could not find gio; Cairo-Dock won't be built with Gnome>=2.22 support.")
433 message (STATUS "This module is required to compile Gnome-Integration applet: gio-2.0")
434 set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gio-2.0")
380 else()435 else()
381 set (VERSION_GNOME_INTEGRATION "1.0.3")436 set (VERSION_GNOME_INTEGRATION "1.0.3")
382 set (PACKAGE_GNOME_INTEGRATION "cd_gnome-integration")437 set (PACKAGE_GNOME_INTEGRATION "cd_gnome-integration")
@@ -389,9 +444,13 @@
389############# GNOME-INTEGRATION-OLD #################444############# GNOME-INTEGRATION-OLD #################
390set (with_gnome_integration_old "no")445set (with_gnome_integration_old "no")
391if ("${enable-old-gnome-integration}" STREQUAL "yes")446if ("${enable-old-gnome-integration}" STREQUAL "yes")
447 message (STATUS "> Gnome-Integration:")
448 message (WARNING "This applet is deprecated")
392 pkg_check_modules (OLD_GNOME_INTEGRATION gnome-vfs-2.0 libgnomeui-2.0)449 pkg_check_modules (OLD_GNOME_INTEGRATION gnome-vfs-2.0 libgnomeui-2.0)
393 if ("${OLD_GNOME_INTEGRATION_FOUND}" STREQUAL "")450 if ("${OLD_GNOME_INTEGRATION_FOUND}" STREQUAL "")
394 message (STATUS "Could not find gnome-vfs and/or gnomeui; Cairo-Dock won't be built with Gnome<2.22 support.")451 message (STATUS "Could not find gnome-vfs and/or gnomeui; Cairo-Dock won't be built with Gnome<2.22 support.")
452 message (STATUS "These modules are required to compile Gnome-Integration-Old applet: gnome-vfs-2.0 libgnomeui-2.0")
453 set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gnome-vfs-2.0 libgnomeui-2.0")
395 else()454 else()
396 set (VERSION_GNOME_INTEGRATION_OLD "1.0.4")455 set (VERSION_GNOME_INTEGRATION_OLD "1.0.4")
397 set (PACKAGE_GNOME_INTEGRATION_OLD "cd_gnome-integration-old")456 set (PACKAGE_GNOME_INTEGRATION_OLD "cd_gnome-integration-old")
@@ -401,7 +460,8 @@
401 endif()460 endif()
402endif()461endif()
403462
404############# ICON EFFECT #################463############# ICON EFFECTS #################
464message (STATUS "> Icon Effects:")
405set (GETTEXT_ICON_EFFECTS ${GETTEXT_PLUGINS})465set (GETTEXT_ICON_EFFECTS ${GETTEXT_PLUGINS})
406set (VERSION_ICON_EFFECTS "1.2.4")466set (VERSION_ICON_EFFECTS "1.2.4")
407set (PACKAGE_ICON_EFFECTS "cd-icon-effect")467set (PACKAGE_ICON_EFFECTS "cd-icon-effect")
@@ -409,11 +469,32 @@
409configure_file (${CMAKE_CURRENT_SOURCE_DIR}/icon-effect/data/icon-effect.conf.in ${CMAKE_CURRENT_BINARY_DIR}/icon-effect/data/icon-effect.conf)469configure_file (${CMAKE_CURRENT_SOURCE_DIR}/icon-effect/data/icon-effect.conf.in ${CMAKE_CURRENT_BINARY_DIR}/icon-effect/data/icon-effect.conf)
410add_subdirectory (icon-effect)470add_subdirectory (icon-effect)
411471
472############# IMPULSE #################
473set (with_impulse "no")
474if ("${enable-impulse}" STREQUAL "yes")
475 message (STATUS "> Impulse:")
476 pkg_check_modules (IMPULSE_PACKAGES libpulse fftw3)
477 if ("${IMPULSE_PACKAGES_FOUND}" STREQUAL "")
478 message (STATUS "Could not find libpulse; Cairo-Dock won't be built with Impulse applet.")
479 message (WARNING "These modules are required to compile Impulse applet: libpulse fftw3")
480 set (MODULES_MISSING "${MODULES_MISSING} libpulse fftw3")
481 else()
482 set (GETTEXT_IMPULSE ${GETTEXT_PLUGINS})
483 set (VERSION_IMPULSE "0.0.3")
484 set (PACKAGE_IMPULSE "cd-Impulse")
485 set (with_impulse "yes")
486 set (impulsedatadir "${pluginsdatadir}/Impulse")
487 configure_file (${CMAKE_CURRENT_SOURCE_DIR}/Impulse/data/Impulse.conf.in ${CMAKE_CURRENT_BINARY_DIR}/Impulse/data/Impulse.conf)
488 add_subdirectory (Impulse)
489 endif()
490endif()
491
412############# INDICATOR-APPLET #################492############# INDICATOR-APPLET #################
413# Note: the names of dbusmenu-glib and dbusmenu-gtk have changed...493message (STATUS "> Indicator-Applet:")
494# Note: the names of dbusmenu-glib, dbusmenu-gtk and indicator have changed...
414pkg_check_modules (DBUSMENU_04 QUIET dbusmenu-glib-0.4)495pkg_check_modules (DBUSMENU_04 QUIET dbusmenu-glib-0.4)
415pkg_check_modules (DBUSMENU_GTK_04 QUIET dbusmenu-gtk-0.4)496pkg_check_modules (DBUSMENU_GTK_04 QUIET dbusmenu-gtk-0.4)
416pkg_check_modules (INDICATOR_APPLET indicator libido-0.1)497pkg_check_modules (INDICATOR_04 QUIET indicator-0.4)
417if ("${DBUSMENU_04_FOUND}" STREQUAL "1")498if ("${DBUSMENU_04_FOUND}" STREQUAL "1")
418 pkg_check_modules (DBUSMENU dbusmenu-glib-0.4)499 pkg_check_modules (DBUSMENU dbusmenu-glib-0.4)
419else()500else()
@@ -424,29 +505,45 @@
424else()505else()
425 pkg_check_modules (DBUSMENU_GTK dbusmenu-gtk)506 pkg_check_modules (DBUSMENU_GTK dbusmenu-gtk)
426endif()507endif()
508if ("${INDICATOR_04_FOUND}" STREQUAL "1")
509 pkg_check_modules (INDICATOR_APPLET indicator-0.4 libido-0.1)
510else()
511 pkg_check_modules (INDICATOR_APPLET indicator libido-0.1)
512endif()
513
427if ("${INDICATOR_APPLET_FOUND}" STREQUAL "1" AND "${DBUSMENU_FOUND}" STREQUAL "1" AND "${DBUSMENU_GTK_FOUND}" STREQUAL "1")514if ("${INDICATOR_APPLET_FOUND}" STREQUAL "1" AND "${DBUSMENU_FOUND}" STREQUAL "1" AND "${DBUSMENU_GTK_FOUND}" STREQUAL "1")
428 message (STATUS "DBUSMENU_VERSION : ${DBUSMENU_VERSION}")515 #message (STATUS "DBUSMENU_VERSION : ${DBUSMENU_VERSION}")
429 516
430 STRING (REGEX REPLACE "\\..*" "" DBUSMENU_MAJOR "${DBUSMENU_VERSION}")517 STRING (REGEX REPLACE "\\..*" "" DBUSMENU_MAJOR "${DBUSMENU_VERSION}")
431 # message (STATUS "DBUSMENU_MAJOR : ${DBUSMENU_MAJOR}")518 # message (STATUS "DBUSMENU_MAJOR : ${DBUSMENU_MAJOR}")
432 519
433 STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" DBUSMENU_MINOR "${DBUSMENU_VERSION}") # 0.1.7 => 1.7520 STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" DBUSMENU_MINOR "${DBUSMENU_VERSION}") # 0.1.7 => 1.7
434 STRING (REGEX REPLACE "\\.[0-9]*" "" DBUSMENU_MINOR "${DBUSMENU_MINOR}")521 STRING (REGEX REPLACE "\\.[0-9]*" "" DBUSMENU_MINOR "${DBUSMENU_MINOR}")
435 # message (STATUS "DBUSMENU_MINOR : ${DBUSMENU_MINOR}")522 # message (STATUS "DBUSMENU_MINOR : ${DBUSMENU_MINOR}")
436 523
437 STRING (REGEX REPLACE ".*\\." "" DBUSMENU_NANO "${DBUSMENU_VERSION}")524 STRING (REGEX REPLACE ".*\\." "" DBUSMENU_NANO "${DBUSMENU_VERSION}")
438 STRING (REGEX REPLACE "-.*" "" DBUSMENU_NANO "${DBUSMENU_NANO}")525 STRING (REGEX REPLACE "-.*" "" DBUSMENU_NANO "${DBUSMENU_NANO}")
439 # message (STATUS "DBUSMENU_NANO : ${DBUSMENU_NANO}")526 # message (STATUS "DBUSMENU_NANO : ${DBUSMENU_NANO}")
440 527
441 execute_process(528 if ("${INDICATOR_04_FOUND}" STREQUAL "1")
442 COMMAND pkg-config --variable=iconsdir indicator529 execute_process(
443 OUTPUT_VARIABLE INDICATORICONSDIR)530 COMMAND pkg-config --variable=iconsdir indicator-0.4
531 OUTPUT_VARIABLE INDICATORICONSDIR)
532 else()
533 execute_process(
534 COMMAND pkg-config --variable=iconsdir indicator
535 OUTPUT_VARIABLE INDICATORICONSDIR)
536 endif()
444 STRING (REGEX REPLACE "\n" "" INDICATORICONSDIR ${INDICATORICONSDIR}) # la commande rajoute un retour chariot ...537 STRING (REGEX REPLACE "\n" "" INDICATORICONSDIR ${INDICATORICONSDIR}) # la commande rajoute un retour chariot ...
445 add_subdirectory (Indicator-applet)538 add_subdirectory (Indicator-applet)
446 set (with_indicator "yes")539 set (with_indicator "yes")
540else()
541 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)")
542 set (MODULES_MISSING "${MODULES_MISSING} indicator(-0.4) libido-0.1 dbusmenu-glib(-0.4) dbusmenu-gtk(-0.4)")
447endif()543endif()
448544
449############# ILLUSION #################545############# ILLUSION #################
546message (STATUS "> Illusion:")
450set (GETTEXT_ILLUSION ${GETTEXT_PLUGINS})547set (GETTEXT_ILLUSION ${GETTEXT_PLUGINS})
451set (VERSION_ILLUSION "1.0.7")548set (VERSION_ILLUSION "1.0.7")
452set (PACKAGE_ILLUSION "cd-illusion")549set (PACKAGE_ILLUSION "cd-illusion")
@@ -455,13 +552,75 @@
455add_subdirectory (illusion)552add_subdirectory (illusion)
456553
457############# KDE-INTEGRATION #################554############# KDE-INTEGRATION #################
555message (STATUS "> KDE-Integration:")
458set (with_kde_integration "no")556set (with_kde_integration "no")
459if (NOT "${enable-kde-integration}" STREQUAL "no")557set (with_kde_integration2 "no")
558if ("${enable-kde-integration2}" STREQUAL "yes")
559 #find_package(KDE4)
560 find_package(Qt4)
561 if (QT4_FOUND)
562 message (STATUS " * Qt Includes: ${QT_INCLUDES}")
563 message (STATUS " * Qt Definitions: ${QT_DEFINITIONS}")
564 message (STATUS " * QtCore Library: ${QT_QTCORE_LIBRARY} / ${PACKAGE_LIBRARIES}")
565 else()
566 message (STATUS " * Qt unavailable")
567 endif()
568
569 find_path(KDECORE_INCLUDE_DIR "kdecore_export.h")
570 find_library(KDECORE_LIBRARY NAMES "kdecore")
571 GET_FILENAME_COMPONENT(KDECORE_LIBRARY ${KDECORE_LIBRARY} PATH)
572
573 find_path(KIO_INCLUDE_DIR "kio_export.h" PATH_SUFFIXES "kio")
574 find_library(KIO_LIBRARY NAMES "kio")
575 GET_FILENAME_COMPONENT(KIO_LIBRARY ${KIO_LIBRARY} PATH)
576
577 find_path(KDE_INCLUDE_DIR "KDirWatch" PATH_SUFFIXES "KDE")
578
579 if (NOT "${KDECORE_LIBRARY}" STREQUAL "")
580 message (STATUS " * KDECORE Dir: ${KDECORE_INCLUDE_DIR}")
581 message (STATUS " * KDECORE Library: ${KDECORE_LIBRARY}")
582 else()
583 message (STATUS " * KDECORE unavailable")
584 endif()
585 if (NOT "${KIO_LIBRARY}" STREQUAL "")
586 message (STATUS " * KIO Dir: ${KIO_INCLUDE_DIR}")
587 message (STATUS " * KIO Library: ${KIO_LIBRARY}")
588 else()
589 message (STATUS " * KIO unavailable")
590 endif()
591 if (NOT "${KDE_LIBRARY}" STREQUAL "") ## always empty?
592 message (STATUS " * KDE4 Dir: ${KDE_INCLUDE_DIR}")
593 message (STATUS " * KDE4 Library: ${KDE_LIBRARY}")
594 else()
595 message (STATUS " * KDE4 unavailable")
596 endif()
597
598 if (QT4_FOUND
599 AND KDECORE_INCLUDE_DIR
600 AND KDECORE_LIBRARY
601 AND KIO_INCLUDE_DIR
602 AND KIO_LIBRARY
603 AND KDE_INCLUDE_DIR)
604 message (STATUS "KDE: OK")
605 set (VERSION_KDE_INTEGRATION "0.0.3")
606 set (PACKAGE_KDE_INTEGRATION "cd_kde-integration")
607 set (with_kde_integration2 "yes")
608 set (kde_integrationdatadir "${pluginsdatadir}/kde-integration2")
609 add_subdirectory ("kde-integration2")
610 else()
611 message (STATUS "Could not find kde libs; Cairo-Dock won't be built with KDE support.")
612 message (STATUS "These libraries are required to compile KDE experimental applet: kdecore, kio, kde4")
613 set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} kdecore, kio, kde4")
614 endif()
615elseif (NOT "${enable-kde-integration}" STREQUAL "no")
460 pkg_check_modules (KDE_INTEGRATION gio-2.0)616 pkg_check_modules (KDE_INTEGRATION gio-2.0)
461 if ("${KDE_INTEGRATION_FOUND}" STREQUAL "")617 message (STATUS "KDE_INTEGRATION_FOUND: ${KDE_INTEGRATION_FOUND}")
462 message (STATUS "Could not find kde libs; Cairo-Dock won't be built with KDE support.")618 if (NOT KDE_INTEGRATION_FOUND)
619 message (STATUS "Could not find gio; Cairo-Dock won't be built with KDE support.")
620 message (STATUS "This module is required to compile KDE-Integration applet: gio-2.0")
621 set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gio-2.0")
463 else()622 else()
464 set (VERSION_KDE_INTEGRATION "0.0.2")623 set (VERSION_KDE_INTEGRATION "1.0.3")
465 set (PACKAGE_KDE_INTEGRATION "cd_kde-integration")624 set (PACKAGE_KDE_INTEGRATION "cd_kde-integration")
466 set (with_kde_integration "yes")625 set (with_kde_integration "yes")
467 set (kde_integrationdatadir "${pluginsdatadir}/kde-integration")626 set (kde_integrationdatadir "${pluginsdatadir}/kde-integration")
@@ -470,13 +629,16 @@
470endif()629endif()
471630
472############# KEYBOARD_INDICATOR #################631############# KEYBOARD_INDICATOR #################
632message (STATUS "> Keyboard-Indicator:")
473set (with_keyboard_indicator "no")633set (with_keyboard_indicator "no")
474pkg_check_modules (KEYBOARD_INDICATOR_PACKAGE libxklavier)634pkg_check_modules (KEYBOARD_INDICATOR_PACKAGE libxklavier)
475if ("${KEYBOARD_INDICATOR_PACKAGE_FOUND}" STREQUAL "")635if ("${KEYBOARD_INDICATOR_PACKAGE_FOUND}" STREQUAL "")
476 message (STATUS "Could not find libxklavier; Cairo-Dock won't be built with keyboard-indicator applet.")636 message (STATUS "Could not find libxklavier; Cairo-Dock won't be built with keyboard-indicator applet.")
637 message (WARNING "This module is required to compile Keyboard-Indicator applet: libxklavier")
638 set (MODULES_MISSING "${MODULES_MISSING} libxklavier")
477else()639else()
478 set (GETTEXT_KEYBOARD_INDICATOR ${GETTEXT_PLUGINS})640 set (GETTEXT_KEYBOARD_INDICATOR ${GETTEXT_PLUGINS})
479 set (VERSION_KEYBOARD_INDICATOR "1.1.3")641 set (VERSION_KEYBOARD_INDICATOR "1.1.4")
480 set (PACKAGE_KEYBOARD_INDICATOR "cd-keyboard-indicator")642 set (PACKAGE_KEYBOARD_INDICATOR "cd-keyboard-indicator")
481 set (with_keyboard_indicator "yes")643 set (with_keyboard_indicator "yes")
482 set (keyboard_indicatordatadir "${pluginsdatadir}/keyboard-indicator")644 set (keyboard_indicatordatadir "${pluginsdatadir}/keyboard-indicator")
@@ -485,20 +647,32 @@
485endif()647endif()
486648
487############# LOGOUT #################649############# LOGOUT #################
650message (STATUS "> LogOut:")
651pkg_check_modules (UPOWER upower-glib) # useful for Powermanager too.
652if (${UPOWER_FOUND})
653 set (with_upower_support "yes")
654else()
655 set (with_upower_support "no")
656 message (STATUS "Could not find upower-glib; LogOut and PowerManager plugin won't be built with UPower support.")
657 message (WARNING "This module is required to compile LogOut and PowerManager applet with UPower support: upower-glib")
658 set (MODULES_MISSING "${MODULES_MISSING} upower-glib")
659endif()
488set (GETTEXT_LOGOUT ${GETTEXT_PLUGINS})660set (GETTEXT_LOGOUT ${GETTEXT_PLUGINS})
489set (VERSION_LOGOUT "1.2.10")661set (VERSION_LOGOUT "1.2.11")
490set (PACKAGE_LOGOUT "cd-logout")662set (PACKAGE_LOGOUT "cd-logout")
491set (logoutdatadir "${pluginsdatadir}/logout")663set (logoutdatadir "${pluginsdatadir}/logout")
492configure_file (${CMAKE_CURRENT_SOURCE_DIR}/logout/data/logout.conf.in ${CMAKE_CURRENT_BINARY_DIR}/logout/data/logout.conf)664configure_file (${CMAKE_CURRENT_SOURCE_DIR}/logout/data/logout.conf.in ${CMAKE_CURRENT_BINARY_DIR}/logout/data/logout.conf)
493add_subdirectory (logout)665add_subdirectory (logout)
494666
495############# MAIL #################667############# MAIL #################
668message (STATUS "> Mail:")
496set (with_mail "no")669set (with_mail "no")
497# find the compilation flags670# find the compilation flags
671find_program (LIBETPAN_CONFIG_EXECUTABLE libetpan-config)
498execute_process(672execute_process(
499 COMMAND libetpan-config --cflags673 COMMAND ${LIBETPAN_CONFIG_EXECUTABLE} --cflags
500 OUTPUT_VARIABLE MAIL_PACKAGE_CFLAGS)674 OUTPUT_VARIABLE MAIL_PACKAGE_CFLAGS)
501if (NOT "${MAIL_PACKAGE_CFLAGS}" STREQUAL "") # if we don't want to use it, we don't want to have an error675if (NOT "${MAIL_PACKAGE_CFLAGS}" STREQUAL "") # if there is a problem with the previous, we don't want to have a lot of errors
502 STRING (REGEX MATCHALL "-I[^ ]+ " TMP_VARIABLE "${MAIL_PACKAGE_CFLAGS}") # first extract the "-I" options676 STRING (REGEX MATCHALL "-I[^ ]+ " TMP_VARIABLE "${MAIL_PACKAGE_CFLAGS}") # first extract the "-I" options
503 STRING (REGEX REPLACE ";" "" TMP_VARIABLE "${TMP_VARIABLE}")677 STRING (REGEX REPLACE ";" "" TMP_VARIABLE "${TMP_VARIABLE}")
504 STRING (REGEX REPLACE " $" "" TMP_VARIABLE "${TMP_VARIABLE}")678 STRING (REGEX REPLACE " $" "" TMP_VARIABLE "${TMP_VARIABLE}")
@@ -506,7 +680,7 @@
506endif()680endif()
507# find the link flags681# find the link flags
508execute_process(682execute_process(
509 COMMAND libetpan-config --libs683 COMMAND ${LIBETPAN_CONFIG_EXECUTABLE} --libs
510 OUTPUT_VARIABLE MAIL_PACKAGE_LIBS)684 OUTPUT_VARIABLE MAIL_PACKAGE_LIBS)
511if (NOT "${MAIL_PACKAGE_LIBS}" STREQUAL "")685if (NOT "${MAIL_PACKAGE_LIBS}" STREQUAL "")
512 # find the link libraries686 # find the link libraries
@@ -521,13 +695,15 @@
521endif()695endif()
522if ("${MAIL_PACKAGE_LIBS}" STREQUAL "")696if ("${MAIL_PACKAGE_LIBS}" STREQUAL "")
523 message (STATUS "warning : Could not find libetpan; Cairo-Dock won't be built with Mail applet.")697 message (STATUS "warning : Could not find libetpan; Cairo-Dock won't be built with Mail applet.")
698 message (WARNING "This module is required to compile Mail applet: libetpan")
699 set (PROGRAMS_MISSING "${PROGRAMS_MISSING} libetpan-config")
524else()700else()
525 message (STATUS "libetpan found. Using the following options:")701 message (STATUS "libetpan found. Using the following options:")
526 message (STATUS " Include directories: ${MAIL_PACKAGE_INCLUDE_DIRS}")702 message (STATUS " Include directories: ${MAIL_PACKAGE_INCLUDE_DIRS}")
527 message (STATUS " Link directories: ${MAIL_PACKAGE_LIBRARY_DIRS}")703 message (STATUS " Link directories: ${MAIL_PACKAGE_LIBRARY_DIRS}")
528 message (STATUS " Link libraries: ${MAIL_PACKAGE_LIBRARIES}")704 message (STATUS " Link libraries: ${MAIL_PACKAGE_LIBRARIES}")
529 set (GETTEXT_MAIL ${GETTEXT_PLUGINS})705 set (GETTEXT_MAIL ${GETTEXT_PLUGINS})
530 set (VERSION_MAIL "1.0.8")706 set (VERSION_MAIL "1.0.9")
531 set (PACKAGE_MAIL "cd-mail")707 set (PACKAGE_MAIL "cd-mail")
532 set (maildatadir "${pluginsdatadir}/mail")708 set (maildatadir "${pluginsdatadir}/mail")
533 set (with_mail "yes")709 set (with_mail "yes")
@@ -535,7 +711,8 @@
535 add_subdirectory ("mail")711 add_subdirectory ("mail")
536endif()712endif()
537713
538############# MEMENU #################714############# DISTRIBUTION #################
715message (STATUS "> Distribution:")
539# We try to detect if the user is on Ubuntu to know which bus we have to use...716# We try to detect if the user is on Ubuntu to know which bus we have to use...
540execute_process(717execute_process(
541 COMMAND lsb_release -i718 COMMAND lsb_release -i
@@ -573,11 +750,17 @@
573 endif()750 endif()
574endif()751endif()
575752
576set (INDICATOR_OLD_NAMES 0)
577if (NOT "${DISTRO_ID}" STREQUAL "")753if (NOT "${DISTRO_ID}" STREQUAL "")
578 message (STATUS "DISTRO_ID: ${DISTRO_ID}, DISTRO_RELEASE: ${DISTRO_RELEASE}")754 message (STATUS "DISTRO_ID: ${DISTRO_ID}, DISTRO_RELEASE: ${DISTRO_RELEASE}")
579endif()755endif()
580if ("${DISTRO_ID}" STREQUAL "Ubuntu")756
757############# INDICATOR_NAME #################
758message (STATUS "> Indicator Names:")
759set (INDICATOR_OLD_NAMES 0)
760if ("${force_old_indicator_names}" STREQUAL "yes")
761 set (INDICATOR_OLD_NAMES 1)
762 message (STATUS "Indicators: use old Ayatana Dbus names (forced)")
763elseif ("${DISTRO_ID}" STREQUAL "Ubuntu")
581 STRING (REGEX REPLACE "\\..*" "" DISTRO_RELEASE_MAJOR ${DISTRO_RELEASE})764 STRING (REGEX REPLACE "\\..*" "" DISTRO_RELEASE_MAJOR ${DISTRO_RELEASE})
582 # message (STATUS "DISTRO_RELEASE_MAJOR: ${DISTRO_RELEASE_MAJOR}")765 # message (STATUS "DISTRO_RELEASE_MAJOR: ${DISTRO_RELEASE_MAJOR}")
583 if (${DISTRO_RELEASE_MAJOR} LESS 11) # from 11.04, new names are used.766 if (${DISTRO_RELEASE_MAJOR} LESS 11) # from 11.04, new names are used.
@@ -586,10 +769,12 @@
586 endif()769 endif()
587endif()770endif()
588771
772############# MEMENU #################
589set (with_me_menu "no")773set (with_me_menu "no")
590if ("${with_indicator}" STREQUAL "yes")774if ("${with_indicator}" STREQUAL "yes")
775 message (STATUS "> MeMenu:")
591 set (GETTEXT_MEMENU ${GETTEXT_PLUGINS})776 set (GETTEXT_MEMENU ${GETTEXT_PLUGINS})
592 set (VERSION_MEMENU "1.0.1")777 set (VERSION_MEMENU "1.0.2")
593 set (PACKAGE_MEMENU "cd-MeMenu")778 set (PACKAGE_MEMENU "cd-MeMenu")
594 set (memenudatadir "${pluginsdatadir}/MeMenu")779 set (memenudatadir "${pluginsdatadir}/MeMenu")
595 set (with_me_menu "yes")780 set (with_me_menu "yes")
@@ -600,8 +785,9 @@
600############# MESSAGING_MENU #################785############# MESSAGING_MENU #################
601set (with_messaging_menu "no")786set (with_messaging_menu "no")
602if ("${with_indicator}" STREQUAL "yes")787if ("${with_indicator}" STREQUAL "yes")
788 message (STATUS "> Messaging-Menu:")
603 set (GETTEXT_MESSAGING_MENU ${GETTEXT_PLUGINS})789 set (GETTEXT_MESSAGING_MENU ${GETTEXT_PLUGINS})
604 set (VERSION_MESSAGING_MENU "1.0.1")790 set (VERSION_MESSAGING_MENU "1.0.2")
605 set (PACKAGE_MESSAGING_MENU "cd-Messaging-Menu")791 set (PACKAGE_MESSAGING_MENU "cd-Messaging-Menu")
606 set (with_messaging_menu "yes")792 set (with_messaging_menu "yes")
607 set (messaging_menudatadir "${pluginsdatadir}/Messaging-Menu")793 set (messaging_menudatadir "${pluginsdatadir}/Messaging-Menu")
@@ -610,6 +796,7 @@
610endif()796endif()
611797
612############# MOTION BLUR #################798############# MOTION BLUR #################
799message (STATUS "> Motion Blur:")
613set (GETTEXT_MOTION_BLUR ${GETTEXT_PLUGINS})800set (GETTEXT_MOTION_BLUR ${GETTEXT_PLUGINS})
614set (VERSION_MOTION_BLUR "1.0.4")801set (VERSION_MOTION_BLUR "1.0.4")
615set (PACKAGE_MOTION_BLUR "cd-motion_blur")802set (PACKAGE_MOTION_BLUR "cd-motion_blur")
@@ -618,16 +805,18 @@
618add_subdirectory (motion-blur)805add_subdirectory (motion-blur)
619806
620############# MUSICPLAYER #################807############# MUSICPLAYER #################
808message (STATUS "> MusicPlayer:")
621set (GETTEXT_MUSICPLAYER ${GETTEXT_PLUGINS})809set (GETTEXT_MUSICPLAYER ${GETTEXT_PLUGINS})
622set (VERSION_MUSICPLAYER "1.0.7")810set (VERSION_MUSICPLAYER "1.0.8")
623set (PACKAGE_MUSICPLAYER "cd-musicPlayer")811set (PACKAGE_MUSICPLAYER "cd-musicPlayer")
624set (musicplayerdatadir "${pluginsdatadir}/musicPlayer")812set (musicplayerdatadir "${pluginsdatadir}/musicPlayer")
625configure_file (${CMAKE_CURRENT_SOURCE_DIR}/musicPlayer/data/musicPlayer.conf.in ${CMAKE_CURRENT_BINARY_DIR}/musicPlayer/data/musicPlayer.conf)813configure_file (${CMAKE_CURRENT_SOURCE_DIR}/musicPlayer/data/musicPlayer.conf.in ${CMAKE_CURRENT_BINARY_DIR}/musicPlayer/data/musicPlayer.conf)
626add_subdirectory (musicPlayer)814add_subdirectory (musicPlayer)
627815
628############# NETSPEED #################816############# NETSPEED #################
817message (STATUS "> NetSpeed:")
629set (GETTEXT_NETSPEED ${GETTEXT_PLUGINS})818set (GETTEXT_NETSPEED ${GETTEXT_PLUGINS})
630set (VERSION_NETSPEED "1.2.5")819set (VERSION_NETSPEED "1.2.6")
631set (PACKAGE_NETSPEED "cd-netspeed")820set (PACKAGE_NETSPEED "cd-netspeed")
632set (netspeeddatadir "${pluginsdatadir}/netspeed")821set (netspeeddatadir "${pluginsdatadir}/netspeed")
633configure_file (${CMAKE_CURRENT_SOURCE_DIR}/netspeed/data/netspeed.conf.in ${CMAKE_CURRENT_BINARY_DIR}/netspeed/data/netspeed.conf)822configure_file (${CMAKE_CURRENT_SOURCE_DIR}/netspeed/data/netspeed.conf.in ${CMAKE_CURRENT_BINARY_DIR}/netspeed/data/netspeed.conf)
@@ -636,8 +825,9 @@
636############# NETWORK_MONITOR #################825############# NETWORK_MONITOR #################
637set (with_network_monitor "no")826set (with_network_monitor "no")
638if ("${enable-network-monitor}" STREQUAL "yes")827if ("${enable-network-monitor}" STREQUAL "yes")
828 message (STATUS "> Network Monitor:")
639 set (GETTEXT_NETWORK_MONITOR ${GETTEXT_PLUGINS})829 set (GETTEXT_NETWORK_MONITOR ${GETTEXT_PLUGINS})
640 set (VERSION_NETWORK_MONITOR "0.2.3")830 set (VERSION_NETWORK_MONITOR "0.2.4")
641 set (PACKAGE_NETWORK_MONITOR "cd-network-monitor")831 set (PACKAGE_NETWORK_MONITOR "cd-network-monitor")
642 set (with_network_monitor "yes")832 set (with_network_monitor "yes")
643 set (network_monitordatadir "${pluginsdatadir}/Network-Monitor")833 set (network_monitordatadir "${pluginsdatadir}/Network-Monitor")
@@ -646,29 +836,34 @@
646endif()836endif()
647837
648############# POWERMANAGER #################838############# POWERMANAGER #################
839message (STATUS "> PowerManager:")
649set (GETTEXT_POWERMANAGER ${GETTEXT_PLUGINS})840set (GETTEXT_POWERMANAGER ${GETTEXT_PLUGINS})
650set (VERSION_POWERMANAGER "1.3.4")841set (VERSION_POWERMANAGER "1.3.5")
651set (PACKAGE_POWERMANAGER "cd-powermanager")842set (PACKAGE_POWERMANAGER "cd-powermanager")
652set (powermanagerdatadir "${pluginsdatadir}/powermanager")843set (powermanagerdatadir "${pluginsdatadir}/powermanager")
653configure_file (${CMAKE_CURRENT_SOURCE_DIR}/powermanager/data/powermanager.conf.in ${CMAKE_CURRENT_BINARY_DIR}/powermanager/data/powermanager.conf)844configure_file (${CMAKE_CURRENT_SOURCE_DIR}/powermanager/data/powermanager.conf.in ${CMAKE_CURRENT_BINARY_DIR}/powermanager/data/powermanager.conf)
654add_subdirectory (powermanager)845add_subdirectory (powermanager)
655846
656############# QUICK BROWSER #################847############# QUICK BROWSER #################
848message (STATUS "> Quick Browser:")
657set (GETTEXT_QUICK_BROWSER ${GETTEXT_PLUGINS})849set (GETTEXT_QUICK_BROWSER ${GETTEXT_PLUGINS})
658set (VERSION_QUICK_BROWSER "1.0.8")850set (VERSION_QUICK_BROWSER "1.0.9")
659set (PACKAGE_QUICK_BROWSER "cd-quick-browser")851set (PACKAGE_QUICK_BROWSER "cd-quick-browser")
660set (quick_browserdatadir "${pluginsdatadir}/quick_browser")852set (quick_browserdatadir "${pluginsdatadir}/quick_browser")
661configure_file (${CMAKE_CURRENT_SOURCE_DIR}/quick-browser/data/quick-browser.conf.in ${CMAKE_CURRENT_BINARY_DIR}/quick-browser/data/quick-browser.conf)853configure_file (${CMAKE_CURRENT_SOURCE_DIR}/quick-browser/data/quick-browser.conf.in ${CMAKE_CURRENT_BINARY_DIR}/quick-browser/data/quick-browser.conf)
662add_subdirectory (quick-browser)854add_subdirectory (quick-browser)
663855
664############# RECENT-EVENTS #################856############# RECENT-EVENTS #################
857message (STATUS "> Recent-Events:")
665set (with_recent_events "no")858set (with_recent_events "no")
666pkg_check_modules (RECENT_EVENTS zeitgeist-1.0)859pkg_check_modules (RECENT_EVENTS zeitgeist-1.0)
667if ("${RECENT_EVENTS_FOUND}" STREQUAL "")860if ("${RECENT_EVENTS_FOUND}" STREQUAL "")
668 message (STATUS "Could not find libzeitgeist; Cairo-Dock won't be built with Zeitgeist support.")861 message (STATUS "Could not find libzeitgeist; Cairo-Dock won't be built with Zeitgeist support.")
862 message (WARNING "This module is required to compile Recent-Events applet: zeitgeist-1.0")
863 set (MODULES_MISSING "${MODULES_MISSING} zeitgeist-1.0")
669else()864else()
670 set (GETTEXT_RECENT_EVENTS ${GETTEXT_PLUGINS})865 set (GETTEXT_RECENT_EVENTS ${GETTEXT_PLUGINS})
671 set (VERSION_RECENT_EVENTS "0.0.2")866 set (VERSION_RECENT_EVENTS "1.0.0")
672 set (PACKAGE_RECENT_EVENTS "cd-Recent-Events")867 set (PACKAGE_RECENT_EVENTS "cd-Recent-Events")
673 set (with_recent_events "yes")868 set (with_recent_events "yes")
674 set (recent_eventsdatadir "${pluginsdatadir}/Recent-Events")869 set (recent_eventsdatadir "${pluginsdatadir}/Recent-Events")
@@ -677,6 +872,7 @@
677endif()872endif()
678873
679############# REMOTE_CONTROL #################874############# REMOTE_CONTROL #################
875message (STATUS "> Remote Control:")
680set (GETTEXT_REMOTE_CONTROL ${GETTEXT_PLUGINS})876set (GETTEXT_REMOTE_CONTROL ${GETTEXT_PLUGINS})
681set (VERSION_REMOTE_CONTROL "0.0.2")877set (VERSION_REMOTE_CONTROL "0.0.2")
682set (PACKAGE_REMOTE_CONTROL "cd-Remote-Control")878set (PACKAGE_REMOTE_CONTROL "cd-Remote-Control")
@@ -685,8 +881,9 @@
685add_subdirectory (Remote-Control)881add_subdirectory (Remote-Control)
686882
687############# RSSREADER #################883############# RSSREADER #################
884message (STATUS "> RSSreader:")
688set (GETTEXT_RSS_READER ${GETTEXT_PLUGINS})885set (GETTEXT_RSS_READER ${GETTEXT_PLUGINS})
689set (VERSION_RSS_READER "1.0.3")886set (VERSION_RSS_READER "1.0.4")
690set (PACKAGE_RSS_READER "cd-rssreader")887set (PACKAGE_RSS_READER "cd-rssreader")
691set (rss_readerdatadir "${pluginsdatadir}/RSSreader")888set (rss_readerdatadir "${pluginsdatadir}/RSSreader")
692configure_file (${CMAKE_CURRENT_SOURCE_DIR}/RSSreader/data/RSSreader.conf.in ${CMAKE_CURRENT_BINARY_DIR}/RSSreader/data/RSSreader.conf)889configure_file (${CMAKE_CURRENT_SOURCE_DIR}/RSSreader/data/RSSreader.conf.in ${CMAKE_CURRENT_BINARY_DIR}/RSSreader/data/RSSreader.conf)
@@ -695,6 +892,7 @@
695############# SCOOBY_DO #################892############# SCOOBY_DO #################
696set (with_scooby_do "no")893set (with_scooby_do "no")
697if ("${enable-scooby-do}" STREQUAL "yes")894if ("${enable-scooby-do}" STREQUAL "yes")
895 message (STATUS "> Scooby-Do:")
698 set (GETTEXT_SCOOBY_DO ${GETTEXT_PLUGINS})896 set (GETTEXT_SCOOBY_DO ${GETTEXT_PLUGINS})
699 set (VERSION_SCOOBY_DO "0.1.1")897 set (VERSION_SCOOBY_DO "0.1.1")
700 set (PACKAGE_SCOOBY_DO "cd-scooby-do")898 set (PACKAGE_SCOOBY_DO "cd-scooby-do")
@@ -704,29 +902,38 @@
704 add_subdirectory (Scooby-Do)902 add_subdirectory (Scooby-Do)
705endif()903endif()
706904
905############# SHARED-IMAGES #################
906set (shared_imagesdatadir "${pluginsdatadir}/shared-images")
907add_subdirectory (shared-images)
908
707############# SHORTCUTS #################909############# SHORTCUTS #################
910message (STATUS "> Shortcuts:")
708set (GETTEXT_SHORTCUTS ${GETTEXT_PLUGINS})911set (GETTEXT_SHORTCUTS ${GETTEXT_PLUGINS})
709set (VERSION_SHORTCUTS "1.3.1")912set (VERSION_SHORTCUTS "1.3.2")
710set (PACKAGE_SHORTCUTS "cd-shortcuts")913set (PACKAGE_SHORTCUTS "cd-shortcuts")
711set (shortcutsdatadir "${pluginsdatadir}/shortcuts")914set (shortcutsdatadir "${pluginsdatadir}/shortcuts")
712configure_file (${CMAKE_CURRENT_SOURCE_DIR}/shortcuts/data/shortcuts.conf.in ${CMAKE_CURRENT_BINARY_DIR}/shortcuts/data/shortcuts.conf)915configure_file (${CMAKE_CURRENT_SOURCE_DIR}/shortcuts/data/shortcuts.conf.in ${CMAKE_CURRENT_BINARY_DIR}/shortcuts/data/shortcuts.conf)
713add_subdirectory (shortcuts)916add_subdirectory (shortcuts)
714917
715############# SHOW DESKTOP #################918############# SHOW DESKTOP #################
919message (STATUS "> ShowDesktop:")
716set (with_xrandr "yes")920set (with_xrandr "yes")
717pkg_check_modules (SHOW_DESKTOP_XRANDR xrandr)921pkg_check_modules (SHOW_DESKTOP_XRANDR xrandr)
718if ("${SHOW_DESKTOP_XRANDR_FOUND}" STREQUAL "")922if ("${SHOW_DESKTOP_XRANDR_FOUND}" STREQUAL "")
719 message (STATUS "Could not find xrandr; ShowDesktop won't be built with screen resolution abilities.")923 message (STATUS "Could not find xrandr; ShowDesktop won't be built with screen resolution abilities.")
924 message (WARNING "This module is required to compile ShowDesktop applet with xRandr support: xrandr")
925 set (MODULES_MISSING "${MODULES_MISSING} xrandr")
720 set (with_xrandr "no")926 set (with_xrandr "no")
721endif()927endif()
722set (GETTEXT_SHOW_DESKTOP ${GETTEXT_PLUGINS})928set (GETTEXT_SHOW_DESKTOP ${GETTEXT_PLUGINS})
723set (VERSION_SHOW_DESKTOP "1.2.4")929set (VERSION_SHOW_DESKTOP "1.2.5")
724set (PACKAGE_SHOW_DESKTOP "cd-showDesktop")930set (PACKAGE_SHOW_DESKTOP "cd-showDesktop")
725set (show_desktopdatadir "${pluginsdatadir}/showDesktop")931set (show_desktopdatadir "${pluginsdatadir}/showDesktop")
726configure_file (${CMAKE_CURRENT_SOURCE_DIR}/showDesktop/data/showDesktop.conf.in ${CMAKE_CURRENT_BINARY_DIR}/showDesktop/data/showDesktop.conf)932configure_file (${CMAKE_CURRENT_SOURCE_DIR}/showDesktop/data/showDesktop.conf.in ${CMAKE_CURRENT_BINARY_DIR}/showDesktop/data/showDesktop.conf)
727add_subdirectory (showDesktop)933add_subdirectory (showDesktop)
728934
729############# SHOW MOUSE #################935############# SHOW MOUSE #################
936message (STATUS "> Show Mouse:")
730set (GETTEXT_SHOW_MOUSE ${GETTEXT_PLUGINS})937set (GETTEXT_SHOW_MOUSE ${GETTEXT_PLUGINS})
731set (VERSION_SHOW_MOUSE "1.0.4")938set (VERSION_SHOW_MOUSE "1.0.4")
732set (PACKAGE_SHOW_MOUSE "cd-show_mouse")939set (PACKAGE_SHOW_MOUSE "cd-show_mouse")
@@ -735,33 +942,41 @@
735add_subdirectory (show-mouse)942add_subdirectory (show-mouse)
736943
737############# SLIDER #################944############# SLIDER #################
945message (STATUS "> Slider:")
738set (with_exif "yes")946set (with_exif "yes")
739pkg_check_modules (EXIF libexif)947pkg_check_modules (EXIF libexif)
740if ("${EXIF_FOUND}" STREQUAL "")948if ("${EXIF_FOUND}" STREQUAL "")
741 message (STATUS "Could not find libexif; Slider won't be able to rotate the images accordingly to their exif data.")949 message (STATUS "Could not find libexif; Slider won't be able to rotate the images accordingly to their exif data.")
950 message (WARNING "This module is required to compile Slider applet with Exif support: libexif")
951 set (MODULES_MISSING "${MODULES_MISSING} libexif")
742 set (with_exif "no")952 set (with_exif "no")
743endif()953endif()
744set (GETTEXT_SLIDER ${GETTEXT_PLUGINS})954set (GETTEXT_SLIDER ${GETTEXT_PLUGINS})
745set (VERSION_SLIDER "2.0.8")955set (VERSION_SLIDER "2.0.9")
746set (PACKAGE_SLIDER "cd-slider")956set (PACKAGE_SLIDER "cd-slider")
747set (sliderdatadir "${pluginsdatadir}/slider")957set (sliderdatadir "${pluginsdatadir}/slider")
748configure_file (${CMAKE_CURRENT_SOURCE_DIR}/slider/data/slider.conf.in ${CMAKE_CURRENT_BINARY_DIR}/slider/data/slider.conf)958configure_file (${CMAKE_CURRENT_SOURCE_DIR}/slider/data/slider.conf.in ${CMAKE_CURRENT_BINARY_DIR}/slider/data/slider.conf)
749add_subdirectory (slider)959add_subdirectory (slider)
750960
751############# STACK #################961############# STACK #################
962message (STATUS "> Stack:")
752set (GETTEXT_STACK ${GETTEXT_PLUGINS})963set (GETTEXT_STACK ${GETTEXT_PLUGINS})
753set (VERSION_STACK "0.3.1")964set (VERSION_STACK "0.3.2")
754set (PACKAGE_STACK "cd-stack")965set (PACKAGE_STACK "cd-stack")
755set (stackdatadir "${pluginsdatadir}/stack")966set (stackdatadir "${pluginsdatadir}/stack")
756configure_file (${CMAKE_CURRENT_SOURCE_DIR}/stack/data/stack.conf.in ${CMAKE_CURRENT_BINARY_DIR}/stack/data/stack.conf)967configure_file (${CMAKE_CURRENT_SOURCE_DIR}/stack/data/stack.conf.in ${CMAKE_CURRENT_BINARY_DIR}/stack/data/stack.conf)
757add_subdirectory (stack)968add_subdirectory (stack)
758969
759############# STATUS NOTIFIER #################970############# STATUS NOTIFIER #################
971message (STATUS "> Status Notifier:")
760if ("${DBUSMENU_GTK_FOUND}" STREQUAL "")972if ("${DBUSMENU_GTK_FOUND}" STREQUAL "")
761 message (STATUS "Could not find Status-Notifier libs; Cairo-Dock won't be built with Status-Notifier support.")973 message (STATUS "Could not find Status-Notifier libs; Cairo-Dock won't be built with Status-Notifier support.")
974 message (WARNING "This module is required to compile Status Notifier applet: dbusmenu-gtk(-0.4)")
975 # set (MODULES_MISSING "${MODULES_MISSING} dbusmenu-gtk(-0.4)") # it should already be in the list.
976 set (with_status_notifier "no")
762else()977else()
763 set (GETTEXT_STATUS_NOTIFIER ${GETTEXT_PLUGINS})978 set (GETTEXT_STATUS_NOTIFIER ${GETTEXT_PLUGINS})
764 set (VERSION_STATUS_NOTIFIER "0.1.3")979 set (VERSION_STATUS_NOTIFIER "0.1.4")
765 set (PACKAGE_STATUS_NOTIFIER "cd-status-notifier")980 set (PACKAGE_STATUS_NOTIFIER "cd-status-notifier")
766 set (with_status_notifier "yes")981 set (with_status_notifier "yes")
767 set (status_notifierdatadir "${pluginsdatadir}/Status-Notifier")982 set (status_notifierdatadir "${pluginsdatadir}/Status-Notifier")
@@ -770,43 +985,51 @@
770endif()985endif()
771986
772############# SWITCHER #################987############# SWITCHER #################
988message (STATUS "> Switcher:")
773set (GETTEXT_SWITCHER ${GETTEXT_PLUGINS})989set (GETTEXT_SWITCHER ${GETTEXT_PLUGINS})
774set (VERSION_SWITCHER "2.1.6")990set (VERSION_SWITCHER "2.1.7")
775set (PACKAGE_SWITCHER "cd-switcher")991set (PACKAGE_SWITCHER "cd-switcher")
776set (switcherdatadir "${pluginsdatadir}/switcher")992set (switcherdatadir "${pluginsdatadir}/switcher")
777configure_file (${CMAKE_CURRENT_SOURCE_DIR}/switcher/data/switcher.conf.in ${CMAKE_CURRENT_BINARY_DIR}/switcher/data/switcher.conf)993configure_file (${CMAKE_CURRENT_SOURCE_DIR}/switcher/data/switcher.conf.in ${CMAKE_CURRENT_BINARY_DIR}/switcher/data/switcher.conf)
778add_subdirectory (switcher)994add_subdirectory (switcher)
779995
780############# SYSTEM MONITOR #################996############# SYSTEM MONITOR #################
997message (STATUS "> System Monitor:")
781set (with_sensors "yes")998set (with_sensors "yes")
782find_package (Sensors)999find_package (Sensors)
783if (NOT "${SENSORS_FOUND}" STREQUAL "TRUE")1000if (NOT "${SENSORS_FOUND}" STREQUAL "TRUE")
784 message (STATUS "Could not find libsensors; System-Monitor won't be able to monitor fan speed and CPU temperature.")1001 message (STATUS "Could not find libsensors; System-Monitor won't be able to monitor fan speed and CPU temperature.")
1002 message (WARNING "This package is required to compile System Monitor applet with Sensors support: sensors")
1003 set (PROGRAMS_MISSING "${PROGRAMS_MISSING} sensors")
785 set (with_sensors "no")1004 set (with_sensors "no")
786endif()1005endif()
787set (GETTEXT_SYSTEM_MONITOR ${GETTEXT_PLUGINS})1006set (GETTEXT_SYSTEM_MONITOR ${GETTEXT_PLUGINS})
788set (VERSION_SYSTEM_MONITOR "1.0.6")1007set (VERSION_SYSTEM_MONITOR "1.0.7")
789set (PACKAGE_SYSTEM_MONITOR "cd-system-monitor")1008set (PACKAGE_SYSTEM_MONITOR "cd-system-monitor")
790set (system_monitordatadir "${pluginsdatadir}/System-monitor")1009set (system_monitordatadir "${pluginsdatadir}/System-monitor")
791configure_file (${CMAKE_CURRENT_SOURCE_DIR}/System-Monitor/data/System-Monitor.conf.in ${CMAKE_CURRENT_BINARY_DIR}/System-Monitor/data/System-Monitor.conf)1010configure_file (${CMAKE_CURRENT_SOURCE_DIR}/System-Monitor/data/System-Monitor.conf.in ${CMAKE_CURRENT_BINARY_DIR}/System-Monitor/data/System-Monitor.conf)
792add_subdirectory (System-Monitor)1011add_subdirectory (System-Monitor)
7931012
794############# SYSTRAY #################1013############# SYSTRAY #################
1014message (STATUS "> Systray:")
795set (GETTEXT_SYSTRAY ${GETTEXT_PLUGINS})1015set (GETTEXT_SYSTRAY ${GETTEXT_PLUGINS})
796set (VERSION_SYSTRAY "0.2.2")1016set (VERSION_SYSTRAY "0.2.3")
797set (PACKAGE_SYSTRAY "cd-systray")1017set (PACKAGE_SYSTRAY "cd-systray")
798set (systraydatadir "${pluginsdatadir}/systray")1018set (systraydatadir "${pluginsdatadir}/systray")
799configure_file (${CMAKE_CURRENT_SOURCE_DIR}/systray/data/systray.conf.in ${CMAKE_CURRENT_BINARY_DIR}/systray/data/systray.conf)1019configure_file (${CMAKE_CURRENT_SOURCE_DIR}/systray/data/systray.conf.in ${CMAKE_CURRENT_BINARY_DIR}/systray/data/systray.conf)
800add_subdirectory (systray)1020add_subdirectory (systray)
8011021
802############# TERMINAL #################1022############# TERMINAL #################
1023message (STATUS "> Terminal:")
803pkg_check_modules (TERMINAL_PACKAGE vte)1024pkg_check_modules (TERMINAL_PACKAGE vte)
804if ("${TERMINAL_PACKAGE_FOUND}" STREQUAL "")1025if ("${TERMINAL_PACKAGE_FOUND}" STREQUAL "")
805 message (STATUS "Could not find libvte; Cairo-Dock won't be built with terminal applet.")1026 message (STATUS "Could not find libvte; Cairo-Dock won't be built with terminal applet.")
1027 message (WARNING "This module is required to compile Terminal applet: vte")
1028 set (MODULES_MISSING "${MODULES_MISSING} vte")
806 set (with_terminal "no")1029 set (with_terminal "no")
807else()1030else()
808 set (GETTEXT_TERMINAL ${GETTEXT_PLUGINS})1031 set (GETTEXT_TERMINAL ${GETTEXT_PLUGINS})
809 set (VERSION_TERMINAL "1.0.10")1032 set (VERSION_TERMINAL "1.0.11")
810 set (PACKAGE_TERMINAL "cd-terminal")1033 set (PACKAGE_TERMINAL "cd-terminal")
811 set (with_terminal "yes")1034 set (with_terminal "yes")
812 set (terminaldatadir "${pluginsdatadir}/terminal")1035 set (terminaldatadir "${pluginsdatadir}/terminal")
@@ -815,16 +1038,18 @@
815endif()1038endif()
8161039
817############# TOMBOY #################1040############# TOMBOY #################
1041message (STATUS "> Tomboy:")
818set (GETTEXT_TOMBOY ${GETTEXT_PLUGINS})1042set (GETTEXT_TOMBOY ${GETTEXT_PLUGINS})
819set (VERSION_TOMBOY "1.3.1")1043set (VERSION_TOMBOY "1.3.2")
820set (PACKAGE_TOMBOY "cd-tomboy")1044set (PACKAGE_TOMBOY "cd-tomboy")
821set (tomboydatadir "${pluginsdatadir}/tomboy")1045set (tomboydatadir "${pluginsdatadir}/tomboy")
822configure_file (${CMAKE_CURRENT_SOURCE_DIR}/tomboy/data/tomboy.conf.in ${CMAKE_CURRENT_BINARY_DIR}/tomboy/data/tomboy.conf)1046configure_file (${CMAKE_CURRENT_SOURCE_DIR}/tomboy/data/tomboy.conf.in ${CMAKE_CURRENT_BINARY_DIR}/tomboy/data/tomboy.conf)
823add_subdirectory (tomboy)1047add_subdirectory (tomboy)
8241048
825############# TOONS #################1049############# TOONS #################
1050message (STATUS "> Toons:")
826set (GETTEXT_TOONS ${GETTEXT_PLUGINS})1051set (GETTEXT_TOONS ${GETTEXT_PLUGINS})
827set (VERSION_TOONS "1.0.8")1052set (VERSION_TOONS "1.0.9")
828set (PACKAGE_TOONS "cd-Toons")1053set (PACKAGE_TOONS "cd-Toons")
829set (toonsdatadir "${pluginsdatadir}/Toons")1054set (toonsdatadir "${pluginsdatadir}/Toons")
830set (toonsuserdirname "Toons")1055set (toonsuserdirname "Toons")
@@ -832,8 +1057,9 @@
832add_subdirectory (Toons)1057add_subdirectory (Toons)
8331058
834############# WEATHER #################1059############# WEATHER #################
1060message (STATUS "> Weather:")
835set (GETTEXT_WEATHER ${GETTEXT_PLUGINS})1061set (GETTEXT_WEATHER ${GETTEXT_PLUGINS})
836set (VERSION_WEATHER "1.2.10")1062set (VERSION_WEATHER "1.2.11")
837set (PACKAGE_WEATHER "cd-weather")1063set (PACKAGE_WEATHER "cd-weather")
838set (weatherdatadir "${pluginsdatadir}/weather")1064set (weatherdatadir "${pluginsdatadir}/weather")
839set (weatheruserdirname "weather")1065set (weatheruserdirname "weather")
@@ -841,14 +1067,17 @@
841add_subdirectory (weather)1067add_subdirectory (weather)
8421068
843############# WEBLETS #################1069############# WEBLETS #################
1070message (STATUS "> Weblets:")
844set (with_weblets "no")1071set (with_weblets "no")
845if (NOT "${enable-weblets}" STREQUAL "no")1072if (NOT "${enable-weblets}" STREQUAL "no")
846 pkg_check_modules (WEBKIT webkit-1.0)1073 pkg_check_modules (WEBKIT webkit-1.0)
847 if ("${WEBKIT_FOUND}" STREQUAL "")1074 if ("${WEBKIT_FOUND}" STREQUAL "")
848 message (STATUS "Could not find webkit-1.0; Cairo-Dock won't be built with Weblets applet.")1075 message (STATUS "Could not find webkit-1.0; Cairo-Dock won't be built with Weblets applet.")
1076 message (WARNING "This module is required to compile Weblets applet: webkit-1.0")
1077 set (MODULES_MISSING "${MODULES_MISSING} webkit-1.0")
849 else()1078 else()
850 set (GETTEXT_WEBLETS ${GETTEXT_PLUGINS})1079 set (GETTEXT_WEBLETS ${GETTEXT_PLUGINS})
851 set (VERSION_WEBLETS "0.0.10")1080 set (VERSION_WEBLETS "0.0.11")
852 set (PACKAGE_WEBLETS "cd-weblets")1081 set (PACKAGE_WEBLETS "cd-weblets")
853 set (webletsdatadir "${pluginsdatadir}/weblets")1082 set (webletsdatadir "${pluginsdatadir}/weblets")
854 set (with_weblets "yes")1083 set (with_weblets "yes")
@@ -858,20 +1087,24 @@
858endif()1087endif()
8591088
860############# WIFI #################1089############# WIFI #################
1090message (STATUS "> WiFi:")
861set (GETTEXT_WIFI ${GETTEXT_PLUGINS})1091set (GETTEXT_WIFI ${GETTEXT_PLUGINS})
862set (VERSION_WIFI "1.2.6")1092set (VERSION_WIFI "1.2.7")
863set (PACKAGE_WIFI "cd-wifi")1093set (PACKAGE_WIFI "cd-wifi")
864set (wifidatadir "${pluginsdatadir}/wifi")1094set (wifidatadir "${pluginsdatadir}/wifi")
865configure_file (${CMAKE_CURRENT_SOURCE_DIR}/wifi/data/wifi.conf.in ${CMAKE_CURRENT_BINARY_DIR}/wifi/data/wifi.conf)1095configure_file (${CMAKE_CURRENT_SOURCE_DIR}/wifi/data/wifi.conf.in ${CMAKE_CURRENT_BINARY_DIR}/wifi/data/wifi.conf)
866add_subdirectory (wifi)1096add_subdirectory (wifi)
8671097
868############# XFCE-INTEGRATION #################1098############# XFCE-INTEGRATION #################
1099message (STATUS "> XFCE-Integration:")
869set (with_xfce_integration "no")1100set (with_xfce_integration "no")
870if (NOT "${enable-xfce-integration}" STREQUAL "no")1101if (NOT "${enable-xfce-integration}" STREQUAL "no")
871 pkg_check_modules (XFCE_INTEGRATION_THUNAR thunar-vfs-1)1102 pkg_check_modules (XFCE_INTEGRATION_THUNAR thunar-vfs-1)
872 pkg_check_modules (XFCE_INTEGRATION_GVFS gio-2.0)1103 pkg_check_modules (XFCE_INTEGRATION_GVFS gio-2.0)
873 if ("${XFCE_INTEGRATION_THUNAR_FOUND}" STREQUAL "" AND "${XFCE_INTEGRATION_GVFS_FOUND}" STREQUAL "")1104 if ("${XFCE_INTEGRATION_THUNAR_FOUND}" STREQUAL "" AND "${XFCE_INTEGRATION_GVFS_FOUND}" STREQUAL "")
874 message (STATUS "Could find neither thunar-vfs or libgio-2.0; Cairo-Dock won't be built with XFCE support.")1105 message (STATUS "Could find neither thunar-vfs or libgio-2.0; Cairo-Dock won't be built with XFCE support.")
1106 message (STATUS "This module is required to compile XFCE-Integration applet: gio-2.0 (or thunar-vfs-1)")
1107 set (MODULES_INTEGRATION_MISSING "${MODULES_INTEGRATION_MISSING} gio-2.0")
875 else()1108 else()
876 set (VERSION_XFCE_INTEGRATION "1.0.3")1109 set (VERSION_XFCE_INTEGRATION "1.0.3")
877 set (PACKAGE_XFCE_INTEGRATION "cd_xfce-integration")1110 set (PACKAGE_XFCE_INTEGRATION "cd_xfce-integration")
@@ -882,13 +1115,16 @@
882endif()1115endif()
8831116
884############# XGAMMA #################1117############# XGAMMA #################
1118message (STATUS "> XGamma:")
885pkg_check_modules (XGAMMA_PACKAGE x11 xxf86vm)1119pkg_check_modules (XGAMMA_PACKAGE x11 xxf86vm)
886if ("${XGAMMA_PACKAGE_FOUND}" STREQUAL "")1120if ("${XGAMMA_PACKAGE_FOUND}" STREQUAL "")
887 message (STATUS "Could not find xxf86vm; Cairo-Dock won't be built with Xgamma applet.")1121 message (STATUS "Could not find xxf86vm; Cairo-Dock won't be built with Xgamma applet.")
1122 message (WARNING "These modules are required to compile XGamma applet: x11 and xxf86vm")
1123 set (MODULES_MISSING "${MODULES_MISSING} x11 xxf86vm")
888 set (with_xgamma "no")1124 set (with_xgamma "no")
889else()1125else()
890 set (GETTEXT_XGAMMA ${GETTEXT_PLUGINS})1126 set (GETTEXT_XGAMMA ${GETTEXT_PLUGINS})
891 set (VERSION_XGAMMA "1.2.0")1127 set (VERSION_XGAMMA "1.2.1")
892 set (PACKAGE_XGAMMA "cd-Xgamma")1128 set (PACKAGE_XGAMMA "cd-Xgamma")
893 set (with_xgamma "yes")1129 set (with_xgamma "yes")
894 set (xgammadatadir "${pluginsdatadir}/Xgamma")1130 set (xgammadatadir "${pluginsdatadir}/Xgamma")
@@ -926,16 +1162,37 @@
926message (STATUS " - with Weblets applet: ${with_weblets}")1162message (STATUS " - with Weblets applet: ${with_weblets}")
927message (STATUS " - with Xgamma applet: ${with_xgamma}")1163message (STATUS " - with Xgamma applet: ${with_xgamma}")
928message (STATUS " - with Recent-Events applet: ${with_recent_events}")1164message (STATUS " - with Recent-Events applet: ${with_recent_events}")
1165message (STATUS " - with UPower support: ${with_upower_support}")
929message (STATUS " - with Python interface: ${with_python}")1166message (STATUS " - with Python interface: ${with_python}")
930message (STATUS " - with Ruby interface: ${with_ruby}")1167message (STATUS " - with Ruby interface: ${with_ruby}")
931message (STATUS " - with Mono interface: ${with_mono}")1168message (STATUS " - with Mono interface: ${with_mono}")
932message (STATUS " - with Vala interface: ${with_vala}")1169message (STATUS " - with Vala interface: ${with_vala}")
933message (STATUS " - with Vala Translator (valac) : ${with_valac}")1170message (STATUS " - with Vala Translator (valac): ${with_valac}")
934message (STATUS "Unstable:")1171message (STATUS "Unstable:")
935message (STATUS " - with Disks applet: ${with_disks}")1172message (STATUS " - with Disks applet: ${with_disks}")
936message (STATUS " - with Doncky applet: ${with_doncky}")1173message (STATUS " - with Doncky applet: ${with_doncky}")
1174message (STATUS " - with Impulse applet: ${with_impulse}")
1175message (STATUS " - with KDE experimental support: ${with_kde_integration2}")
937message (STATUS " - with Network-Monitor applet: ${with_network_monitor}")1176message (STATUS " - with Network-Monitor applet: ${with_network_monitor}")
938message (STATUS " - with Scooby-Do applet: ${with_scooby_do}")1177message (STATUS " - with Scooby-Do applet: ${with_scooby_do}")
939message (STATUS "Unsupported:")1178message (STATUS "Deprecated:")
940message (STATUS " - with old Gnome support: ${with_gnome_integration_old}")1179message (STATUS " - with old Gnome support: ${with_gnome_integration_old}")
1180
1181if (NOT "${MODULES_MISSING}" STREQUAL "")
1182 message ("")
1183 message (STATUS "WARNING: It seems that one (or more) module(s) is (are) missing:${MODULES_MISSING}")
1184 message (STATUS "It can be interesting to install them (even more if you're a maintainer of Cairo-Dock's packages).")
1185endif ()
1186
1187if (NOT "${PROGRAMS_MISSING}" STREQUAL "")
1188 message ("")
1189 message (STATUS "WARNING: It seems that one (or more) program(s) or package(s) is (are) missing:${PROGRAMS_MISSING}")
1190 message (STATUS "It can be interesting to install them (even more if you're a maintainer of Cairo-Dock's packages).")
1191endif ()
1192
1193if (NOT "${MODULES_INTEGRATION_MISSING}" STREQUAL "")
1194 message ("")
1195 message (STATUS "WARNING: It seems that one (or more) module(s) for the integration with the system is (are) missing:${MODULES_INTEGRATION_MISSING}")
1196 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.")
1197endif ()
941message ("")1198message ("")
9421199
=== modified file 'Cairo-Penguin/data/Cairo-Penguin.conf.in'
--- Cairo-Penguin/data/Cairo-Penguin.conf.in 2011-04-20 20:46:51 +0000
+++ Cairo-Penguin/data/Cairo-Penguin.conf.in 2011-08-09 20:07:46 +0000
@@ -1,9 +1,9 @@
1#!en;@VERSION_CAIRO_PENGUIN@1#@VERSION_CAIRO_PENGUIN@
22
3#[gtk-about]3#[gtk-about]
4[Icon]4[Icon]
55
6#F[Applet]6#F[Icon]
7frame_maininfo=7frame_maininfo=
88
9#d Name of the dock it belongs to:9#d Name of the dock it belongs to:
@@ -11,13 +11,12 @@
1111
12#s Name of the icon as it will appear in its caption in the dock:12#s Name of the icon as it will appear in its caption in the dock:
13name = 13name =
1414 #v
15#F[Display]15sep_display=
16frame_display=
1716
18icon =17icon =
1918
20#j+[0;128] Icon size for busy penguin:19#j+[0;128] Desired icon size for this applet
21#{Set to 0 to use the default applet size}20#{Set to 0 to use the default applet size}
22icon size = 0;021icon size = 0;0
2322
2423
=== modified file 'Clipper/data/Clipper.conf.in'
--- Clipper/data/Clipper.conf.in 2011-04-20 20:46:51 +0000
+++ Clipper/data/Clipper.conf.in 2011-08-09 20:07:46 +0000
@@ -1,23 +1,22 @@
1#!en;@VERSION_CLIPPER@1#@VERSION_CLIPPER@
22
3#[gtk-about]3#[gtk-about]
4[Icon]4[Icon]
55
6#F[Applet]6#F[Icon]
7frame_maininfo=7frame_maininfo=
88
9#d Name of the dock it belongs to:9#d Name of the dock it belongs to:
10dock name = 10dock name =
1111
12#s Name of the icon as it will appear in its caption in the dock:12#s Name of the icon as it will appear in its caption in the dock:
13name = Clipboard13name =
1414 #v
15#F[Display]15sep_display=
16frame_display=
1716
18#S+ Image filename:17#S+ Image filename:
19#{Leave empty to use the default one.}18#{Leave empty to use the default one.}
20icon = 19icon=accessories-text-editor.svg
2120
22#j+[0;128] Desired icon size for this applet21#j+[0;128] Desired icon size for this applet
23#{Set to 0 to use the default applet size}22#{Set to 0 to use the default applet size}
2423
=== modified file 'Clipper/src/applet-clipboard.c'
--- Clipper/src/applet-clipboard.c 2011-04-20 20:46:51 +0000
+++ Clipper/src/applet-clipboard.c 2011-08-09 20:07:46 +0000
@@ -451,6 +451,9 @@
451 pImage = gtk_image_new_from_pixbuf (pixbuf);451 pImage = gtk_image_new_from_pixbuf (pixbuf);
452 g_free (cIconFilePath);452 g_free (cIconFilePath);
453 g_object_unref (pixbuf);453 g_object_unref (pixbuf);
454#if (GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION >= 16)
455 gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (pMenuItem), TRUE);
456#endif
454 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (pMenuItem), pImage);457 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (pMenuItem), pImage);
455 }458 }
456 gtk_menu_shell_append (GTK_MENU_SHELL (pMenu), pMenuItem);459 gtk_menu_shell_append (GTK_MENU_SHELL (pMenu), pMenuItem);
457460
=== added directory 'Composite-Manager'
=== added file 'Composite-Manager/CMakeLists.txt'
--- Composite-Manager/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ Composite-Manager/CMakeLists.txt 2011-08-09 20:07:46 +0000
@@ -0,0 +1,2 @@
1add_subdirectory(src)
2add_subdirectory(data)
03
=== added directory 'Composite-Manager/data'
=== added file 'Composite-Manager/data/CMakeLists.txt'
--- Composite-Manager/data/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ Composite-Manager/data/CMakeLists.txt 2011-08-09 20:07:46 +0000
@@ -0,0 +1,10 @@
1
2########### install files ###############
3
4install (FILES ${CMAKE_CURRENT_BINARY_DIR}/Composite-Manager.conf
5 preview.jpg
6 icon.png
7 composite-on.png
8 composite-off.png
9 DESTINATION ${composite_managerdatadir})
10
011
=== added file 'Composite-Manager/data/Composite-Manager.conf.in'
--- Composite-Manager/data/Composite-Manager.conf.in 1970-01-01 00:00:00 +0000
+++ Composite-Manager/data/Composite-Manager.conf.in 2011-08-09 20:07:46 +0000
@@ -0,0 +1,137 @@
1#@VERSION_COMPOSITE_MANAGER@
2
3#[gtk-about]
4[Icon]
5
6#F[Icon]
7frame_maininfo=
8
9#d Name of the dock it belongs to:
10dock name =
11
12#s Name of the icon as it will appear in its caption in the dock:
13name =
14 #v
15sep_display=
16
17icon =
18
19#j[0;128] Desired icon size for this applet
20#{Set to 0 to use the default applet size}
21icon size = 0;0
22
23order=
24
25#F[Applet's Handbook]
26frame_hand=
27#A
28handbook=Composite-Manager
29
30
31#[gtk-convert]
32[Desklet]
33
34#X[Position]
35frame_pos =
36
37#b Lock position?
38#{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.}
39locked = false
40
41#j+[24;512] Desklet dimensions (width x height):
42#{Depending on your WindowManager, you may be able to resize this with ALT + middle-click or ALT + left-click.}
43size = 96;96
44
45#i[-2048;2048] Desklet position (x, y):
46#{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}
47x position=0
48#i[-2048;2048] ...
49y position=0
50
51#I[-180;180] Rotation:
52#{You can quickly rotate the desklet with the mouse, by dragging the little buttons on its left and top sides.}
53rotation = 0
54
55#X[Visibility]
56frame_visi =
57
58#b Is detached from the dock
59initially detached=false
60#l[Normal;Keep above;Keep below;Keep on widget layer;Reserve space] Visibility:
61#{for CompizFusion's "widget layer", set behaviour in Compiz to: (class=Cairo-dock & type=utility)}
62accessibility=0
63#b Should be visible on all desktops?
64sticky=true
65
66
67#F[Decorations;gtk-orientation-portrait]
68frame_deco=
69
70#o+ Choose a decoration theme for this desklet:
71#{Choose 'Custom decorations' to define your own decorations below.}
72decorations = default
73
74#v
75sep_deco =
76
77#S+ Background image:
78#{Image to be displayed below drawings, e.g. a frame. Leave empty for no image.}
79bg desklet =
80#e+[0;1] Background transparency:
81bg alpha = 1
82#i+[0;256] Left offset:
83#{in pixels. Use this to adjust the left position of drawings.}
84left offset = 0
85#i+[0;256] Top offset:
86#{in pixels. Use this to adjust the top position of drawings.}
87top offset = 0
88#i+[0;256] Right offset:
89#{in pixels. Use this to adjust the right position of drawings.}
90right offset = 0
91#i+[0;256] Bottom offset:
92#{in pixels. Use this to adjust the bottom position of drawings.}
93bottom offset = 0
94#S+ Foreground image:
95#{Image to be displayed above the drawings, e.g. a reflection. Leave empty for no image.}
96fg desklet =
97#e+[0;1] Foreground tansparency:
98fg alpha = 1
99
100
101#[gtk-preferences]
102[Configuration]
103
104#F[Style;gtk-color-picker]
105frame_style =
106
107#S+ Image when composite is active:
108#{Leave empty to use the default one.}
109icon on =
110
111#S+ Image when composite is inactive:
112#{Leave empty to use the default one.}
113icon off =
114
115
116#F[Behaviour;gtk-execute]
117frame_behav =
118
119#E[;Compiz;KWin;Xfwm;Metacity] Composite window-manager:
120#{Let empty to use the default one. Alternatively, you can set any command you want.}
121compositor =
122
123#E[;Compiz;KWin;Xfwm;Metacity] Fallback window-manager:
124#{Let empty to use the default one. Alternatively, you can set any command you want.}
125fallback =
126
127#b Ask before switching:
128ask = true
129
130#v
131sep_act=
132
133#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:
134action on click = 0
135
136#k Shortkey to toggle the composite ON/OFF:
137shortkey = <Control>F12
0138
=== added file 'Composite-Manager/data/composite-off.png'
1Binary 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 differ139Binary 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
=== added file 'Composite-Manager/data/composite-on.png'
2Binary 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 differ140Binary 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
=== added file 'Composite-Manager/data/icon.png'
3Binary 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 differ141Binary 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
=== added file 'Composite-Manager/data/preview.jpg'
4Binary 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 differ142Binary 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
=== added directory 'Composite-Manager/src'
=== added file 'Composite-Manager/src/CMakeLists.txt'
--- Composite-Manager/src/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/CMakeLists.txt 2011-08-09 20:07:46 +0000
@@ -0,0 +1,39 @@
1
2########### sources ###############
3
4SET(MODULE_SRCS
5 applet-struct.h
6 applet-init.c applet-init.h
7 applet-config.c applet-config.h
8 applet-composite-manager.c applet-composite-manager.h
9 applet-notifications.c applet-notifications.h
10)
11
12add_library(${PACKAGE_COMPOSITE_MANAGER} SHARED ${MODULE_SRCS})
13
14########### compil ###############
15add_definitions (-DMY_APPLET_SHARE_DATA_DIR="${composite_managerdatadir}")
16add_definitions (-DMY_APPLET_PREVIEW_FILE="preview.jpg")
17add_definitions (-DMY_APPLET_CONF_FILE="Composite-Manager.conf")
18add_definitions (-DMY_APPLET_USER_DATA_DIR="Composite-Manager")
19add_definitions (-DMY_APPLET_VERSION="${VERSION_COMPOSITE_MANAGER}")
20add_definitions (-DMY_APPLET_GETTEXT_DOMAIN="${GETTEXT_COMPOSITE_MANAGER}")
21add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}")
22add_definitions (-DMY_APPLET_ICON_FILE="icon.png")
23### uncomment the following line to allow multi-instance applet.
24#add_definitions (-DCD_APPLET_MULTI_INSTANCE="1")
25### uncomment the following line to allow extended OpenGL drawing.
26#add_definitions (-DGL_GLEXT_PROTOTYPES="1")
27
28include_directories (
29 ${PACKAGE_INCLUDE_DIRS})
30
31link_directories (
32 ${PACKAGE_LIBRARY_DIRS})
33
34target_link_libraries (${PACKAGE_COMPOSITE_MANAGER}
35 ${PACKAGE_LIBRARIES})
36
37########### install files ###############
38
39install(TARGETS ${PACKAGE_COMPOSITE_MANAGER} DESTINATION ${pluginsdir})
040
=== added file 'Composite-Manager/src/applet-composite-manager.c'
--- Composite-Manager/src/applet-composite-manager.c 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-composite-manager.c 2011-08-09 20:07:46 +0000
@@ -0,0 +1,535 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#define _BSD_SOURCE
21#include <string.h>
22#include <stdlib.h>
23#include <stdio.h>
24#include <unistd.h>
25#include <glib/gstdio.h>
26#include <cairo-dock.h>
27
28#include "applet-struct.h"
29#include "applet-composite-manager.h"
30
31
32 ///////////////////
33 /// WM BACKENDS ///
34///////////////////
35
36static CDWM *_get_wm_by_name (const gchar *cName)
37{
38 int i;
39 for (i = 0; i < NB_WM; i ++)
40 {
41 if (strcmp (cName, myData.pWmList[i].cName) == 0)
42 return &myData.pWmList[i];
43 }
44 return NULL;
45}
46static CDWM *_get_wm_by_index (CDWMIndex n)
47{
48 if (n < NB_WM)
49 return &myData.pWmList[n];
50 else
51 return NULL;
52}
53
54static void _set_metacity_composite (gboolean bActive)
55{
56 int r;
57 if (bActive)
58 r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true");
59 else
60 r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false");
61}
62static void _set_xfwm_composite (gboolean bActive)
63{
64 int r;
65 if (bActive)
66 r = system ("xfconf-query -c xfwm4 -p '/general/use_compositing' -t 'bool' -s 'true'");
67 else
68 r = system ("xfconf-query -c xfwm4 -p '/general/use_compositing' -t 'bool' -s 'false'");
69}
70static void _set_kwin_composite (gboolean bActive)
71{
72 int r;
73 if (bActive)
74 r = system ("if test \"`qdbus org.kde.kwin /KWin compositingActive`\" = \"false\";then qdbus org.kde.kwin /KWin toggleCompositing; fi"); // not active, so activating
75 else
76 r = system ("if test \"`qdbus org.kde.kwin /KWin compositingActive`\" = \"true\"; then qdbus org.kde.kwin /KWin toggleCompositing; fi"); // active, so deactivating
77}
78static void _define_known_wms (void)
79{
80 myData.pWmList[CD_COMPIZ].cName = "Compiz";
81 myData.pWmList[CD_COMPIZ].cCommand = "compiz --replace";
82 myData.pWmList[CD_COMPIZ].activate_composite = NULL;
83 myData.pWmList[CD_COMPIZ].cConfigTool = "ccsm";
84
85 myData.pWmList[CD_KWIN].cName = "KWin";
86 myData.pWmList[CD_KWIN].cCommand = "kwin --replace";
87 myData.pWmList[CD_KWIN].activate_composite = _set_kwin_composite;
88 myData.pWmList[CD_KWIN].cConfigTool = NULL; /// TODO: find the config tool...
89
90 myData.pWmList[CD_XFWM].cName = "Xfwm";
91 myData.pWmList[CD_XFWM].cCommand = "xfwm4 --replace";
92 myData.pWmList[CD_XFWM].activate_composite = _set_xfwm_composite;
93 myData.pWmList[CD_XFWM].cConfigTool = "xfwm4-settings"; // there is also xfwm4-tweaks-settings, wish they merge both ...
94
95 myData.pWmList[CD_METACITY].cName = "Metacity";
96 myData.pWmList[CD_METACITY].cCommand = "metacity --replace";
97 myData.pWmList[CD_METACITY].activate_composite = _set_metacity_composite;
98 myData.pWmList[CD_METACITY].cConfigTool = "gconf-editor /apps/metacity";
99
100 myData.pWmList[CD_CUSTOM_WMFB].cName = "Fallback";
101 myData.pWmList[CD_CUSTOM_WMFB].cCommand = NULL;
102 myData.pWmList[CD_CUSTOM_WMFB].activate_composite = NULL;
103 myData.pWmList[CD_CUSTOM_WMFB].bIsAvailable = TRUE;
104
105 myData.pWmList[CD_CUSTOM_WMC].cName = "Composite";
106 myData.pWmList[CD_CUSTOM_WMC].cCommand = NULL;
107 myData.pWmList[CD_CUSTOM_WMC].activate_composite = NULL;
108 myData.pWmList[CD_CUSTOM_WMC].bIsAvailable = TRUE;
109}
110
111static void _check_available_wms (gchar *cWhich)
112{
113 if (cWhich == NULL) // no known WM is present, skip the check.
114 return;
115
116 CDWM *wm;
117 wm = _get_wm_by_index (CD_COMPIZ);
118 wm->bIsAvailable = (strstr (cWhich, "compiz") != NULL);
119 wm = _get_wm_by_index (CD_KWIN);
120 wm->bIsAvailable = (strstr (cWhich, "kwin") != NULL);
121 wm = _get_wm_by_index (CD_XFWM);
122 wm->bIsAvailable = (strstr (cWhich, "xfwm4") != NULL);
123 wm = _get_wm_by_index (CD_METACITY);
124 wm->bIsAvailable = (strstr (cWhich, "metacity") != NULL);
125}
126
127static CDWMIndex _check_current_wm (gchar *cPs)
128{
129 if (cPs == NULL) // no known WM is present, skip the check.
130 return -1;
131
132 if (strstr (cPs, "compiz") != NULL)
133 return CD_COMPIZ;
134 if (strstr (cPs, "kwin") != NULL)
135 return CD_KWIN;
136 if (strstr (cPs, "xfwm4") != NULL)
137 return CD_XFWM;
138 if (strstr (cPs, "metacity") != NULL)
139 return CD_METACITY;
140
141 return -1;
142}
143
144
145 ////////////////////////
146 /// COMPOSITE SIGNAL ///
147////////////////////////
148
149static void _on_composited_changed (GdkScreen *pScreen, gpointer data)
150{
151 myData.bIsComposited = gdk_screen_is_composited (pScreen);
152 cd_draw_current_state ();
153}
154static void _start_watching_composite_state (void)
155{
156 // get the current state.
157 GdkScreen *pScreen = gdk_screen_get_default ();
158 myData.bIsComposited = gdk_screen_is_composited (pScreen);
159
160 // draw it.
161 cd_draw_current_state ();
162
163 // listen for future changes.
164 g_signal_connect (G_OBJECT (pScreen), "composited-changed", G_CALLBACK(_on_composited_changed), NULL);
165}
166
167
168 ///////////////////
169 /// PREFERED WM ///
170///////////////////
171
172static CDWM *_get_prefered_wmc (CDWMIndex iCurrentWm)
173{
174 g_print ("%s (%s, %d)\n", __func__, myConfig.cWmCompositor, iCurrentWm);
175 CDWM *wm;
176 if (myConfig.cWmCompositor != NULL) // a composite WM is defined.
177 {
178 wm = _get_wm_by_name (myConfig.cWmCompositor);
179 if (wm == NULL) // not one of the known WM -> define and take the custom one.
180 {
181 wm = _get_wm_by_index (CD_CUSTOM_WMC);
182 g_free ((gchar*)wm->cCommand);
183 wm->cCommand = g_strdup (myConfig.cWmCompositor);
184 return wm;
185 }
186 else if (wm->bIsAvailable)
187 return wm;
188 }
189
190 // no WM defined, or the one defined is not available -> check if a suitable one is running.
191 if (iCurrentWm < NB_WM) // one of the know WM is running
192 {
193 if (myData.bIsComposited) // and it provides composite => let's take it!
194 {
195 wm = _get_wm_by_index (iCurrentWm);
196 if (wm->bIsAvailable) // just to be sure.
197 return wm;
198 }
199 }
200
201 // no succes so far, take the most suitable one.
202 int index[NB_COMPOSITE_WM] = {CD_COMPIZ, CD_KWIN, CD_XFWM, CD_METACITY}; // in this order by default.
203 switch (g_iDesktopEnv)
204 {
205 case CAIRO_DOCK_GNOME:
206 index[1] = CD_METACITY;
207 index[3] = CD_KWIN;
208 break;
209 case CAIRO_DOCK_XFCE:
210 index[1] = CD_XFWM;
211 index[2] = CD_KWIN;
212 break;
213 case CAIRO_DOCK_KDE:
214 default:
215 break;
216 }
217 int i;
218 for (i = 0; i < NB_COMPOSITE_WM; i ++)
219 {
220 wm = _get_wm_by_index (index[i]);
221 g_print (" %d) %s, %d\n", index[i], wm->cName, wm->bIsAvailable);
222 if (wm->bIsAvailable)
223 return wm;
224 }
225 return NULL;
226}
227
228static CDWM *_get_prefered_wmfb (CDWMIndex iCurrentWm)
229{
230 g_print ("%s (%s, %d)\n", __func__, myConfig.cWmFallback, iCurrentWm);
231 CDWM *wm;
232 if (myConfig.cWmFallback != NULL) // a fallback WM is defined.
233 {
234 wm = _get_wm_by_name (myConfig.cWmFallback);
235 if (wm == NULL) // not one of the known WM -> define and take the custom one.
236 {
237 wm = _get_wm_by_index (CD_CUSTOM_WMFB);
238 g_free ((gchar*)wm->cCommand);
239 wm->cCommand = g_strdup (myConfig.cWmFallback);
240 return wm;
241 }
242 else if (wm->bIsAvailable)
243 return wm;
244 }
245
246 // no WM defined, or the one defined is not available -> check if a suitable one is running.
247 if (iCurrentWm < NB_WM) // one of the know WM is running
248 {
249 if (!myData.bIsComposited) // and it is a fallback => let's take it!
250 {
251 wm = _get_wm_by_index (iCurrentWm);
252 g_print ("current wm: %d, %d\n", iCurrentWm, wm->bIsAvailable);
253 if (wm->bIsAvailable) // just to be sure.
254 return wm;
255 }
256 }
257
258 // no succes so far, take the most suitable one.
259 int index[NB_FALLBACK_WM] = {CD_METACITY, CD_XFWM, CD_KWIN}; // in this order by default.
260 switch (g_iDesktopEnv)
261 {
262 case CAIRO_DOCK_GNOME:
263 index[0] = CD_METACITY;
264 index[1] = CD_XFWM;
265 break;
266 case CAIRO_DOCK_XFCE:
267 index[0] = CD_XFWM;
268 index[1] = CD_METACITY;
269 break;
270 case CAIRO_DOCK_KDE:
271 index[0] = CD_KWIN;
272 index[1] = CD_METACITY;
273 index[2] = CD_XFWM;
274 break;
275 }
276 int i;
277 for (i = 0; i < NB_FALLBACK_WM; i ++)
278 {
279 wm = _get_wm_by_index (index[i]);
280 g_print (" %s (%d)\n", wm->cName, wm->bIsAvailable);
281 if (wm->bIsAvailable)
282 return wm;
283 }
284 return NULL;
285}
286
287static inline gchar *_get_running_wm (void)
288{
289 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
290}
291static void _define_prefered_wms (gchar *cPs)
292{
293 // get the compositor and fallback WMs
294 CDWMIndex iCurrentWm = _check_current_wm (cPs);
295 myData.wmc = _get_prefered_wmc (iCurrentWm);
296 myData.wmfb = _get_prefered_wmfb (iCurrentWm);
297 g_print ("***** WM: %s / %s\n", myData.wmc?myData.wmc->cName:NULL, myData.wmfb?myData.wmfb->cName:NULL);
298}
299void cd_define_prefered_wms (void)
300{
301 gchar *ps = _get_running_wm ();
302 _define_prefered_wms (ps);
303 g_free (ps);
304}
305
306 /////////////////
307 /// INIT/STOP ///
308/////////////////
309
310static void _check_wms (CDSharedMemory *pSharedMemory)
311{
312 pSharedMemory->which = cairo_dock_launch_command_sync ("which compiz kwin xfwm4 metacity");
313
314 pSharedMemory->ps = _get_running_wm ();
315}
316static void _update_from_data (CDSharedMemory *pSharedMemory)
317{
318 _check_available_wms (pSharedMemory->which);
319
320 _define_prefered_wms (pSharedMemory->ps); // we do it once we know the current state.
321
322 cairo_dock_discard_task (myData.pTask);
323 myData.pTask = NULL;
324}
325
326static void _free_shared_memory (CDSharedMemory *pSharedMemory)
327{
328 g_free (pSharedMemory->which);
329 g_free (pSharedMemory->ps);
330 g_free (pSharedMemory);
331}
332void cd_init_wms (void)
333{
334 _define_known_wms ();
335
336 _start_watching_composite_state ();
337
338 CDSharedMemory *pSharedMemory = g_new0 (CDSharedMemory, 1);
339 myData.pTask = cairo_dock_new_task_full (0, // one-shot
340 (CairoDockGetDataAsyncFunc) _check_wms,
341 (CairoDockUpdateSyncFunc) _update_from_data,
342 (GFreeFunc) _free_shared_memory,
343 pSharedMemory);
344 cairo_dock_launch_task_delayed (myData.pTask, 3000); // 3s delay, since we don't need these info right away.
345}
346
347
348void cd_stop_wms (void)
349{
350 // discard task.
351 cairo_dock_discard_task (myData.pTask);
352
353 // stop listening
354 GdkScreen *pScreen = gdk_screen_get_default ();
355 g_signal_handlers_disconnect_by_func (G_OBJECT(pScreen), _on_composited_changed, NULL);
356
357 // reset custom WMs.
358 CDWM *wm;
359 wm = _get_wm_by_index (CD_CUSTOM_WMC);
360 g_free ((gchar*)wm->cCommand);
361 wm = _get_wm_by_index (CD_CUSTOM_WMFB);
362 g_free ((gchar*)wm->cCommand);
363}
364
365
366 ////////////
367 /// DRAW ///
368////////////
369
370void cd_draw_current_state (void)
371{
372 g_print ("%s (%d)\n", __func__, myData.bIsComposited);
373 if (myData.bIsComposited)
374 CD_APPLET_SET_USER_IMAGE_ON_MY_ICON (myConfig.cIconCompositeON, "composite-on.png");
375 else
376 CD_APPLET_SET_USER_IMAGE_ON_MY_ICON (myConfig.cIconCompositeOFF, "composite-off.png");
377}
378
379
380 /////////////////////
381 /// TOGGLE ON/OFF ///
382/////////////////////
383
384static gboolean _activate_composite_delayed (gpointer data)
385{
386 if (data)
387 {
388 if (myData.wmc->activate_composite != NULL)
389 myData.wmc->activate_composite (TRUE);
390 }
391 else
392 {
393 if (myData.wmfb->activate_composite != NULL)
394 myData.wmfb->activate_composite (FALSE);
395 }
396 return FALSE;
397}
398
399static gboolean _wm_is_running (CDWM *wm)
400{
401 const gchar *cCommand = wm->cCommand;
402 gchar *cWhich = g_strdup_printf ("pgrep %s$", cCommand); // see above for the '$' character.
403 gchar *str = strchr (cWhich+6, ' '); // remove any parameter to the command, we just want the program name.
404 if (str) // a space is found.
405 {
406 *str = '$';
407 *(str+1) = '\0';
408 }
409 gchar *cResult = cairo_dock_launch_command_sync (cWhich);
410 gboolean bIsRunning = (cResult != NULL && *cResult != '\0');
411
412 g_free (cWhich);
413 g_free (cResult);
414 return bIsRunning;
415}
416
417static void cd_turn_composite_on (void)
418{
419 if (myData.wmc == NULL) // no compositor.
420 {
421 cairo_dock_show_temporary_dialog_with_icon (D_("No compositor is available."), myIcon, myContainer, 6000, "same icon");
422 return;
423 }
424
425 // if not already launched, launch it.
426 if (! _wm_is_running (myData.wmc)) // not running
427 {
428 cairo_dock_launch_command (myData.wmc->cCommand);
429 g_timeout_add_seconds (2, _activate_composite_delayed, GINT_TO_POINTER (1)); // let the WM start for 2s.
430 }
431 else // already running, just toggle composite ON.
432 {
433 if (myData.wmc->activate_composite != NULL)
434 myData.wmc->activate_composite (TRUE);
435 else
436 cairo_dock_show_temporary_dialog_with_icon (D_("No compositor is available."), myIcon, myContainer, 6000, "same icon");
437 }
438}
439
440static void cd_turn_composite_off (void)
441{
442 if (myData.wmfb == NULL) // no fallback.
443 {
444 cairo_dock_show_temporary_dialog_with_icon (D_("No fallback is available."), myIcon, myContainer, 6000, "same icon");
445 return;
446 }
447
448 // if not already launched, launch it.
449 if (! _wm_is_running (myData.wmfb)) // not running
450 {
451 cairo_dock_launch_command (myData.wmfb->cCommand);
452 g_timeout_add_seconds (2, _activate_composite_delayed, 0); // let the WM start for 2s.
453 }
454 else // already running, just toggle composite OFF.
455 {
456 if (myData.wmfb->activate_composite != NULL)
457 myData.wmfb->activate_composite (FALSE);
458 else
459 cairo_dock_show_temporary_dialog_with_icon (D_("No fallback is available."), myIcon, myContainer, 6000, "same icon");
460 }
461}
462
463void cd_toggle_composite (void)
464{
465 if (myData.bIsComposited)
466 cd_turn_composite_off ();
467 else
468 cd_turn_composite_on ();
469}
470
471
472 ///////////////////
473 /// CONFIG TOOL ///
474///////////////////
475
476static const gchar *_get_config_tool (void)
477{
478 if (myData.bIsComposited && myData.wmc)
479 {
480 return myData.wmc->cConfigTool;
481 }
482 else if (!myData.bIsComposited && myData.wmfb)
483 {
484 return myData.wmfb->cConfigTool;
485 }
486 return NULL;
487}
488void cd_open_wm_config (void)
489{
490 const gchar *cConfigTool = _get_config_tool ();
491
492 if (cConfigTool != NULL)
493 {
494 gchar *cmd = g_strdup_printf ("which %s", cConfigTool);
495 gchar *cResult = cairo_dock_launch_command_sync (cmd);
496 g_free (cmd);
497 if (cResult == NULL || *cResult != '/')
498 {
499 gchar *msg = g_strdup_printf (D_("You need to install '%s'"), cConfigTool);
500 cairo_dock_show_temporary_dialog_with_icon (msg, myIcon, myContainer, 6000, "same icon");
501 g_free (msg);
502 }
503 else
504 {
505 cairo_dock_launch_command (cConfigTool);
506 }
507 }
508 else
509 {
510 cairo_dock_show_temporary_dialog_with_icon (D_("No configuration tool is available."), myIcon, myContainer, 6000, "same icon");
511 }
512}
513
514
515static const gchar *_get_command (void)
516{
517 if (myData.bIsComposited && myData.wmc)
518 {
519 return myData.wmc->cCommand;
520 }
521 else if (!myData.bIsComposited && myData.wmfb)
522 {
523 return myData.wmfb->cCommand;
524 }
525 return NULL;
526}
527
528void cd_reload_wm (void)
529{
530 const gchar *cCommand = _get_command ();
531 if (cCommand != NULL)
532 {
533 cairo_dock_launch_command (cCommand);
534 }
535}
0536
=== added file 'Composite-Manager/src/applet-composite-manager.h'
--- Composite-Manager/src/applet-composite-manager.h 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-composite-manager.h 2011-08-09 20:07:46 +0000
@@ -0,0 +1,46 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef __APPLET_COMPOSITE_MANAGER__
21#define __APPLET_COMPOSITE_MANAGER__
22
23#include <cairo-dock.h>
24
25
26void cd_init_wms (void);
27
28void cd_stop_wms (void);
29
30
31void cd_define_prefered_wms (void);
32
33
34void cd_draw_current_state (void);
35
36
37void cd_toggle_composite (void);
38
39
40void cd_open_wm_config (void);
41
42
43void cd_reload_wm (void);
44
45
46#endif
047
=== added file 'Composite-Manager/src/applet-config.c'
--- Composite-Manager/src/applet-config.c 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-config.c 2011-08-09 20:07:46 +0000
@@ -0,0 +1,63 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#include <cairo-dock.h>
21
22#include "applet-struct.h"
23#include "applet-composite-manager.h"
24#include "applet-config.h"
25
26
27static void _cd_on_keybinding_pull (const char *keystring, gpointer user_data)
28{
29 cd_toggle_composite ();
30}
31
32CD_APPLET_GET_CONFIG_BEGIN
33 myConfig.cWmCompositor = CD_CONFIG_GET_STRING ("Configuration", "compositor");
34 myConfig.cWmFallback = CD_CONFIG_GET_STRING ("Configuration", "fallback");
35
36 myConfig.cIconCompositeON = CD_CONFIG_GET_STRING ("Configuration", "icon on");
37 myConfig.cIconCompositeOFF = CD_CONFIG_GET_STRING ("Configuration", "icon off");
38
39 myConfig.bAskBeforeSwitching = CD_CONFIG_GET_BOOLEAN ("Configuration", "ask");
40
41 myConfig.iActionOnMiddleClick = CD_CONFIG_GET_INTEGER ("Configuration", "action on click");
42
43 myConfig.cShortCut = CD_CONFIG_GET_STRING ("Configuration", "shortkey");
44 cd_keybinder_bind (myConfig.cShortCut, (CDBindkeyHandler)_cd_on_keybinding_pull, (gpointer)NULL);
45CD_APPLET_GET_CONFIG_END
46
47
48CD_APPLET_RESET_CONFIG_BEGIN
49 g_free (myConfig.cWmCompositor);
50 g_free (myConfig.cWmFallback);
51 g_free (myConfig.cIconCompositeON);
52 g_free (myConfig.cIconCompositeOFF);
53 if (myConfig.cShortCut)
54 {
55 cd_keybinder_unbind(myConfig.cShortCut, (CDBindkeyHandler)_cd_on_keybinding_pull);
56 g_free (myConfig.cShortCut);
57 }
58CD_APPLET_RESET_CONFIG_END
59
60
61CD_APPLET_RESET_DATA_BEGIN
62
63CD_APPLET_RESET_DATA_END
064
=== added file 'Composite-Manager/src/applet-config.h'
--- Composite-Manager/src/applet-config.h 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-config.h 2011-08-09 20:07:46 +0000
@@ -0,0 +1,30 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef __APPLET_CONFIG__
22#define __APPLET_CONFIG__
23
24#include <cairo-dock.h>
25
26
27CD_APPLET_CONFIG_H
28
29
30#endif
031
=== added file 'Composite-Manager/src/applet-init.c'
--- Composite-Manager/src/applet-init.c 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-init.c 2011-08-09 20:07:46 +0000
@@ -0,0 +1,73 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#include "applet-config.h"
21#include "applet-notifications.h"
22#include "applet-struct.h"
23#include "applet-composite-manager.h"
24#include "applet-init.h"
25
26
27CD_APPLET_DEFINITION (N_("Composite-Manager"),
28 2, 3, 0,
29 CAIRO_DOCK_CATEGORY_APPLET_DESKTOP,
30 N_("This applet allows you to <b>toggle the composite ON/OFF</b>.\n"
31 "The composite is what allows transparency on the desktop, but it can slow down your PC, especially during games.\n"
32 "<b>Click</b> on the icon to switch the composite ON/OFF. You can define a <b>shortcut</b> for this action.\n"
33 "The applet also lets you acces to some actions of the Window-Manager, from <b>middle-click and the menu</b>.\n"
34 "You can define in the configuration a Window-Manager that will provide the composite, and another as a fallback."),
35 "Fabounet")
36
37
38CD_APPLET_INIT_BEGIN
39 if (myDesklet)
40 {
41 CD_APPLET_SET_DESKLET_RENDERER ("Simple");
42 }
43
44 cd_init_wms ();
45
46 CD_APPLET_REGISTER_FOR_CLICK_EVENT;
47 CD_APPLET_REGISTER_FOR_MIDDLE_CLICK_EVENT;
48 CD_APPLET_REGISTER_FOR_BUILD_MENU_EVENT;
49CD_APPLET_INIT_END
50
51
52CD_APPLET_STOP_BEGIN
53 cd_stop_wms ();
54
55 CD_APPLET_UNREGISTER_FOR_CLICK_EVENT;
56 CD_APPLET_UNREGISTER_FOR_MIDDLE_CLICK_EVENT;
57 CD_APPLET_UNREGISTER_FOR_BUILD_MENU_EVENT;
58CD_APPLET_STOP_END
59
60
61CD_APPLET_RELOAD_BEGIN
62 if (CD_APPLET_MY_CONFIG_CHANGED)
63 {
64 if (myDesklet && CD_APPLET_MY_CONTAINER_TYPE_CHANGED) // we are now in a desklet, set a renderer.
65 {
66 CD_APPLET_SET_DESKLET_RENDERER ("Simple");
67 }
68
69 cd_define_prefered_wms ();
70
71 cd_draw_current_state ();
72 }
73CD_APPLET_RELOAD_END
074
=== added file 'Composite-Manager/src/applet-init.h'
--- Composite-Manager/src/applet-init.h 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-init.h 2011-08-09 20:07:46 +0000
@@ -0,0 +1,31 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef __APPLET_INIT__
22#define __APPLET_INIT__
23
24
25#include <cairo-dock.h>
26
27
28CD_APPLET_H
29
30
31#endif
032
=== added file 'Composite-Manager/src/applet-notifications.c'
--- Composite-Manager/src/applet-notifications.c 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-notifications.c 2011-08-09 20:07:46 +0000
@@ -0,0 +1,170 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#define _BSD_SOURCE
21#include <stdlib.h>
22#include <stdio.h>
23#include <string.h>
24#include <unistd.h>
25#include <glib/gi18n.h>
26#include <glib/gstdio.h>
27
28#include "applet-struct.h"
29#include "applet-notifications.h"
30#include "applet-composite-manager.h"
31
32static void _on_answer (int iClickedButton, GtkWidget *pInteractiveWidget, gpointer data, CairoDialog *pDialog)
33{
34 if (iClickedButton == 0 || iClickedButton == -1) // ok or Enter
35 {
36 cd_toggle_composite ();
37 }
38}
39
40CD_APPLET_ON_CLICK_BEGIN
41 if (myConfig.bAskBeforeSwitching)
42 {
43 cairo_dock_show_dialog_full (D_("Toggle composite?"), myIcon, myContainer, 0, "same icon", NULL, (CairoDockActionOnAnswerFunc)_on_answer, NULL, NULL);
44 }
45 else
46 {
47 cd_toggle_composite ();
48 }
49CD_APPLET_ON_CLICK_END
50
51
52static void _cd_show_desktop (void)
53{
54 gboolean bDesktopIsVisible = cairo_dock_desktop_is_visible ();
55 cairo_dock_show_hide_desktop (! bDesktopIsVisible);
56}
57static void _cd_expose_windows (void)
58{
59 cairo_dock_wm_present_windows ();
60}
61static gboolean _cd_expose_windows_idle (gpointer data)
62{
63 _cd_expose_windows ();
64 return FALSE;
65}
66static void _cd_expose_desktops (void)
67{
68 cairo_dock_wm_present_desktops ();
69}
70static void _cd_show_widget_layer (void)
71{
72 cairo_dock_wm_show_widget_layer ();
73}
74
75CD_APPLET_ON_MIDDLE_CLICK_BEGIN
76 switch (myConfig.iActionOnMiddleClick)
77 {
78
79 case CD_EDIT_CONFIG:
80 {
81 cd_open_wm_config();
82 }
83 break;
84 case CD_RELOAD_WM:
85 {
86 cd_reload_wm();
87 }
88 break;
89 case CD_SHOW_DESKTOP:
90 {
91 _cd_show_desktop ();
92 }
93 break;
94 case CD_EXPOSE_DESKTOPS:
95 {
96 _cd_expose_desktops ();
97 }
98 break;
99 case CD_EXPOSE_WINDOWS:
100 {
101 // ok this is just crazy: if you call the Scale dbus method of Compiz before the middle button is released, it doesn't work.
102 g_timeout_add (300, _cd_expose_windows_idle, NULL);
103 }
104 break;
105 case CD_SHOW_WIDGET_LAYER:
106 {
107 _cd_show_widget_layer ();
108 }
109 break;
110 default: // shouldn't happen.
111 cd_warning ("problem in the config!");
112 break;
113 }
114CD_APPLET_ON_MIDDLE_CLICK_END
115
116
117CD_APPLET_ON_BUILD_MENU_BEGIN
118 gchar *cLabel;
119
120 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")));
121 CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel,
122 GTK_STOCK_EDIT,
123 cd_open_wm_config,
124 CD_APPLET_MY_MENU);
125 g_free (cLabel);
126
127 cLabel = (myConfig.iActionOnMiddleClick == CD_RELOAD_WM ? g_strdup_printf ("%s (%s)", D_("Reload Window-Manager"), D_("middle-click")) : g_strdup (D_("Reload Window-Manager")));
128 CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel,
129 GTK_STOCK_REFRESH,
130 cd_reload_wm,
131 CD_APPLET_MY_MENU);
132 g_free (cLabel);
133
134 CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
135
136 cLabel = (myConfig.iActionOnMiddleClick == CD_SHOW_DESKTOP ? g_strdup_printf ("%s (%s)", D_("Show desktop"), D_("middle-click")) : g_strdup (D_("Show desktop")));
137 CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel,
138 MY_APPLET_SHARE_DATA_DIR"/../shared-images/show-desktop.svg",
139 _cd_show_desktop,
140 CD_APPLET_MY_MENU);
141 g_free (cLabel);
142
143 if (cairo_dock_wm_can_present_desktops ())
144 {
145 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")));
146 CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel,
147 MY_APPLET_SHARE_DATA_DIR"/../shared-images/expose-desktops.svg",
148 _cd_expose_desktops,
149 CD_APPLET_MY_MENU);
150 g_free (cLabel);
151 }
152 if (cairo_dock_wm_can_present_windows ())
153 {
154 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")));
155 CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel,
156 MY_APPLET_SHARE_DATA_DIR"/../shared-images/expose-windows.svg",
157 _cd_expose_windows,
158 CD_APPLET_MY_MENU);
159 g_free (cLabel);
160 }
161 if (cairo_dock_wm_can_show_widget_layer ())
162 {
163 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")));
164 CD_APPLET_ADD_IN_MENU_WITH_STOCK (cLabel,
165 GTK_STOCK_LEAVE_FULLSCREEN,
166 _cd_show_widget_layer,
167 CD_APPLET_MY_MENU);
168 g_free (cLabel);
169 }
170CD_APPLET_ON_BUILD_MENU_END
0171
=== added file 'Composite-Manager/src/applet-notifications.h'
--- Composite-Manager/src/applet-notifications.h 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-notifications.h 2011-08-09 20:07:46 +0000
@@ -0,0 +1,35 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef __APPLET_NOTIFICATIONS__
22#define __APPLET_NOTIFICATIONS__
23
24
25#include <cairo-dock.h>
26
27
28
29CD_APPLET_ON_CLICK_H
30
31CD_APPLET_ON_BUILD_MENU_H
32
33CD_APPLET_ON_MIDDLE_CLICK_H
34
35#endif
036
=== added file 'Composite-Manager/src/applet-struct.h'
--- Composite-Manager/src/applet-struct.h 1970-01-01 00:00:00 +0000
+++ Composite-Manager/src/applet-struct.h 2011-08-09 20:07:46 +0000
@@ -0,0 +1,83 @@
1/**
2* This file is a part of the Cairo-Dock project
3*
4* Copyright : (C) see the 'copyright' file.
5* E-mail : see the 'copyright' file.
6*
7* This program is free software; you can redistribute it and/or
8* modify it under the terms of the GNU General Public License
9* as published by the Free Software Foundation; either version 3
10* of the License, or (at your option) any later version.
11*
12* This program is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16* You should have received a copy of the GNU General Public License
17* along with this program. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20
21#ifndef __CD_APPLET_STRUCT__
22#define __CD_APPLET_STRUCT__
23
24#include <cairo-dock.h>
25
26typedef struct _CDWM {
27 const gchar *cName;
28 const gchar *cCommand;
29 const gchar *cConfigTool;
30 gboolean bIsAvailable;
31 void (*activate_composite) (gboolean bActive);
32} CDWM;
33
34typedef enum {
35 CD_COMPIZ,
36 CD_KWIN,
37 CD_XFWM,
38 CD_METACITY,
39 CD_CUSTOM_WMFB,
40 CD_CUSTOM_WMC,
41 NB_WM
42} CDWMIndex;
43
44#define NB_COMPOSITE_WM 4 // 4 of them can do composite
45#define NB_FALLBACK_WM 3 // 3 of them can do without
46
47typedef enum {
48 CD_EDIT_CONFIG,
49 CD_RELOAD_WM,
50 CD_SHOW_DESKTOP,
51 CD_EXPOSE_DESKTOPS,
52 CD_EXPOSE_WINDOWS,
53 CD_SHOW_WIDGET_LAYER,
54 CD_NB_ACTIONS
55 } CDWMAction;
56
57//\___________ structure containing the applet's configuration parameters.
58struct _AppletConfig {
59 gchar *cWmCompositor;
60 gchar *cWmFallback;
61 gchar *cIconCompositeON;
62 gchar *cIconCompositeOFF;
63 gboolean bAskBeforeSwitching;
64 CDWMAction iActionOnMiddleClick;
65 gchar *cShortCut;
66} ;
67
68typedef struct {
69 gchar *which;
70 gchar *ps;
71 } CDSharedMemory;
72
73//\___________ structure containing the applet's data, like surfaces, dialogs, results of calculus, etc.
74struct _AppletData {
75 CairoDockTask *pTask;
76 CDWM pWmList[NB_WM];
77 gboolean bIsComposited;
78 CDWM *wmc;
79 CDWM *wmfb;
80} ;
81
82
83#endif
084
=== modified file 'Dbus/data/Dbus.conf.in'
--- Dbus/data/Dbus.conf.in 2011-04-20 20:46:51 +0000
+++ Dbus/data/Dbus.conf.in 2011-08-09 20:07:46 +0000
@@ -1,4 +1,4 @@
1#!en;@VERSION_DBUS@1#@VERSION_DBUS@
22
3#[gtk-preferences]3#[gtk-preferences]
4[Configuration]4[Configuration]
55
=== added file 'Dbus/demos/demo_vala/demo_vala.conf'
--- Dbus/demos/demo_vala/demo_vala.conf 1970-01-01 00:00:00 +0000
+++ Dbus/demos/demo_vala/demo_vala.conf 2011-08-09 20:07:46 +0000
@@ -0,0 +1,101 @@
1#!en;0.0.2
2
3#[gtk-about]
4[Icon]
5#j+[0;128] Desired icon size for this applet
6#{Set to 0 to use the default applet size}
7icon size = 0;0
8
9#s Name of the icon as it will appear in its label in the dock :
10name = Dbus Applet
11
12#S+ Image's filename :
13#{Let empty to use the default one.}
14icon =
15
16#d Name of the dock it belongs to:
17dock name =
18
19order=
20
21#F[Applet's Handbook]
22frame_hand=
23#A
24handbook=demo_vala
25
26#[gtk-convert]
27[Desklet]
28
29#j+[48;512] Desklet's dimension (width x height) :
30#{Depending on your WindowManager, you can resize it with ALT + middle_click or ALT + left_click for exemple.}
31size = 164;96
32
33#i[-2048;2048] Desklet's position (x ; y) :
34#{Depending on your WindowManager, you can move it with ALT + left_click}
35x position=0
36#i[-2048;2048] ...
37y position=0
38
39#b Is detached from the dock ?
40initially detached=false
41#l[Normal;Keep above;Keep below;On Widget Layer;Reserve space] Accessibility :
42#{for CompizFusion's "widget layer", set behaviour in Compiz to: (class=Cairo-dock & type=utility)}
43accessibility=0
44#b Should be visible on all desktops ?
45sticky=true
46
47#b Lock position ?
48#{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.}
49locked = false
50
51#I[-180;180] Rotation :
52#{in degrees.}
53rotation = 0
54
55use size=
56
57#F[Decorations;gtk-orientation-portrait]
58frame_deco=
59
60#o+ Choose a decoration theme for this desklet :
61#{Choose the 'personnal' one to define your own decorations below.}
62decorations = default
63
64#v
65sep_deco =
66
67#S+ Background image :
68#{It's an image that will be displayed below the drawings, like a frame for exemple. Let empty to not use any.}
69bg desklet =
70#e+[0;1] Background tansparency :
71bg alpha = 1
72#i+[0;256] Left offset :
73#{in pixels. Use this to adjust the left position of the drawings.}
74left offset = 0
75#i+[0;256] Top offset :
76#{in pixels. Use this to adjust the top position of the drawings.}
77top offset = 0
78#i+[0;256] Right offset :
79#{in pixels. Use this to adjust the right position of the drawings.}
80right offset = 0
81#i+[0;256] Bottom offset :
82#{in pixels. Use this to adjust the bottom position of the drawings.}
83bottom offset = 0
84#S+ Foreground image :
85#{It's an image that will be displayed above the drawings, like a reflect for exemple. Let empty to not use any.}
86fg desklet =
87#e+[0;1] Foreground tansparency :
88fg alpha = 1
89
90#[gtk-preferences]
91[Configuration]
92
93#h+[/usr/share/cairo-dock/gauges;gauges;gauges] Choose one of the available themes :/
94theme = Turbo-night
95
96#i[10;100] Max value :
97max value = 100
98
99#b Yes / No ?
100yesno = false
101
0102
=== modified file 'Dbus/interfaces/python/CDApplet.py'
--- Dbus/interfaces/python/CDApplet.py 2011-04-20 20:46:51 +0000
+++ Dbus/interfaces/python/CDApplet.py 2011-08-09 20:07:46 +0000
@@ -1,4 +1,4 @@
1# This is a part of the external demo applet for Cairo-Dock1# This is a part of the external applets for Cairo-Dock
2# Copyright : (C) 2010-2011 by Fabounet2# Copyright : (C) 2010-2011 by Fabounet
3# E-mail : fabounet@glx-dock.org3# E-mail : fabounet@glx-dock.org
4#4#
@@ -24,41 +24,59 @@
24import ConfigParser24import ConfigParser
25import gobject25import gobject
26import glib26import glib
27import gettext
27import dbus28import dbus
28from dbus.mainloop.glib import DBusGMainLoop29from dbus.mainloop.glib import DBusGMainLoop
2930
30DBusGMainLoop(set_as_default=True)31DBusGMainLoop(set_as_default=True)
3132
33INSTALL_PREFIX = os.path.abspath("..") # applets are launched from their install directory, so ".." is the folder containing all applets.
34
35GETTEXT_NAME = 'cairo-dock-plugins-extra'
36LOCALE_DIR = INSTALL_PREFIX + '/locale' # user version of /usr/share/locale
37gettext.textdomain(GETTEXT_NAME)
38gettext.bind_textdomain_codeset (GETTEXT_NAME, 'UTF-8');
39gettext.bindtextdomain(GETTEXT_NAME, LOCALE_DIR)
40_ = lambda x: gettext.dgettext(GETTEXT_NAME,x)
41
32####################42####################
33### Applet class ###43### Applet class ###
34####################44####################
35class CDApplet:45class CDApplet:
36 46
47 #############
48 ### Enums ###
49 #############
50 # orientation
37 BOTTOM = 051 BOTTOM = 0
38 TOP = 152 TOP = 1
39 RIGHT = 253 RIGHT = 2
40 LEFT = 354 LEFT = 3
41 55 # container type
42 DOCK = 056 DOCK = 0
43 DESKLET = 157 DESKLET = 1
44 58 # emblem position
45 UPPER_LEFT = 059 UPPER_LEFT = 0
46 LOWER_RIGHT = 160 LOWER_RIGHT = 1
47 LOWER_LEFT = 261 LOWER_LEFT = 2
48 UPPER_RIGHT = 362 UPPER_RIGHT = 3
49 MIDDLE = 463 MIDDLE = 4
50 64 # menu item types
51 MENU_ENTRY = 065 MENU_ENTRY = 0
52 MENU_SUB_MENU = 166 MENU_SUB_MENU = 1
53 MENU_SEPARATOR = 267 MENU_SEPARATOR = 2
54 MENU_CHECKBOX = 368 MENU_CHECKBOX = 3
55 MENU_RADIO_BUTTON = 469 MENU_RADIO_BUTTON = 4
5670 # main menu ID
57 MAIN_MENU_ID = 071 MAIN_MENU_ID = 0
58 72 # dialog key pressed
59 DIALOG_KEY_ENTER = -173 DIALOG_KEY_ENTER = -1
60 DIALOG_KEY_ESCAPE = -274 DIALOG_KEY_ESCAPE = -2
61 75
76 #####################
77 ### INIT AND DBUS ###
78 #####################
79
62 def __init__(self):80 def __init__(self):
63 """ initialize the applet. Must be called by any class that inheritates from it.81 """ initialize the applet. Must be called by any class that inheritates from it.
64 It defines the following:82 It defines the following:
@@ -74,14 +92,44 @@
74 self.loop = None92 self.loop = None
75 self._bEnded = False93 self._bEnded = False
76 self._cMenuIconId = None94 self._cMenuIconId = None
77 self.cAppletName = sys.argv[0][2:]95 self.cAppletName = sys.argv[0][2:] # the command is ./applet_name
78 self.cBusPath = sys.argv[2]96 self.cBusPath = sys.argv[2]
79 self.cConfFile = sys.argv[3]97 self.cConfFile = sys.argv[3]
80 self.cParentAppName = sys.argv[4]98 self.cParentAppName = sys.argv[4]
99 self.cShareDataDir = INSTALL_PREFIX + '/' + self.cAppletName
81 100
82 self._get_config()101 self._get_config()
83 self._connect_to_dock()102 self._connect_to_dock()
84 103
104 def _connect_to_dock(self):
105 # get our applet on the bus.
106 bus = dbus.SessionBus()
107 try:
108 applet_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath)
109 except:
110 print ">>> object '"+self.cBusPath+"' can't be found on the bus, exit.\nMake sure that Cairo-Dock is running"
111 sys.exit(2)
112 self.icon = dbus.Interface(applet_object, "org.cairodock.CairoDock.applet") # this object represents our icon inside the dock or a desklet.
113 sub_icons_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath+"/sub_icons")
114 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.
115 # connect to signals.
116 self.icon.connect_to_signal("on_click", self.on_click) # when the user left-clicks on our icon.
117 self.icon.connect_to_signal("on_middle_click", self.on_middle_click) # when the user middle-clicks on our icon.
118 self.icon.connect_to_signal("on_build_menu", self._on_build_menu) # when the user right-clicks on our applet (which builds the menu)
119 self.icon.connect_to_signal("on_menu_select", self._on_menu_select) # when the user selects an entry of this menu.
120 self.icon.connect_to_signal("on_scroll", self.on_scroll) # when the user scroll up or down on our icon.
121 self.icon.connect_to_signal("on_drop_data", self.on_drop_data) # when the user drops something on our icon.
122 self.icon.connect_to_signal("on_answer_dialog", self.on_answer_dialog) # when the user answer a question.
123 self.icon.connect_to_signal("on_shortkey", self.on_shortkey) # when the user press the shortkey.
124 self.icon.connect_to_signal("on_change_focus", self.on_change_focus) # when the window's focus changes.
125 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).
126 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).
127 self.sub_icons.connect_to_signal("on_click_sub_icon", self.on_click_sub_icon) # when the user left-clicks on a sub-icon.
128 self.sub_icons.connect_to_signal("on_middle_click_sub_icon", self.on_middle_click_sub_icon)
129 self.sub_icons.connect_to_signal("on_scroll_sub_icon", self.on_scroll_sub_icon)
130 self.sub_icons.connect_to_signal("on_build_menu_sub_icon", self._on_build_menu_sub_icon)
131 self.sub_icons.connect_to_signal("on_drop_data_sub_icon", self.on_drop_data_sub_icon)
132
85 def run(self):133 def run(self):
86 """ start the applet and enter the main loop; we never get out of this function """134 """ start the applet and enter the main loop; we never get out of this function """
87 self.begin()135 self.begin()
@@ -94,6 +142,7 @@
94 ##################################142 ##################################
95 ### callbacks on the main icon ###143 ### callbacks on the main icon ###
96 ##################################144 ##################################
145
97 def on_click(self,iState):146 def on_click(self,iState):
98 """ action on click """147 """ action on click """
99 pass148 pass
@@ -148,6 +197,7 @@
148 ##################################197 ##################################
149 ### callbacks on the sub-icons ###198 ### callbacks on the sub-icons ###
150 ##################################199 ##################################
200
151 def on_click_sub_icon(self, iState, cIconID):201 def on_click_sub_icon(self, iState, cIconID):
152 """ action on click on one of our sub-icons"""202 """ action on click on one of our sub-icons"""
153 pass203 pass
@@ -183,6 +233,7 @@
183 ###############################233 ###############################
184 ### callbacks on the applet ###234 ### callbacks on the applet ###
185 ###############################235 ###############################
236
186 def begin(self):237 def begin(self):
187 """ action when the applet is started """238 """ action when the applet is started """
188 pass239 pass
@@ -215,32 +266,3 @@
215 keyfile.read(self.cConfFile)266 keyfile.read(self.cConfFile)
216 self.get_config(keyfile)267 self.get_config(keyfile)
217 268
218 def _connect_to_dock(self):
219 # get our applet on the bus.
220 #~ applet_path = "/org/cairodock/CairoDock/"+self.cAppletName # path where our object is stored on the bus.
221 bus = dbus.SessionBus()
222 try:
223 applet_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath)
224 except:
225 print ">>> object '"+self.cBusPath+"' can't be found on the bus, exit.\nMake sure that the 'Dbus' plug-in is activated in Cairo-Dock"
226 sys.exit(2)
227 self.icon = dbus.Interface(applet_object, "org.cairodock.CairoDock.applet") # this object represents our icon inside the dock or a desklet.
228 sub_icons_object = bus.get_object("org.cairodock.CairoDock", self.cBusPath+"/sub_icons")
229 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.
230 # connect to signals.
231 self.icon.connect_to_signal("on_click", self.on_click) # when the user left-clicks on our icon.
232 self.icon.connect_to_signal("on_middle_click", self.on_middle_click) # when the user middle-clicks on our icon.
233 self.icon.connect_to_signal("on_build_menu", self._on_build_menu) # when the user right-clicks on our applet (which builds the menu)
234 self.icon.connect_to_signal("on_menu_select", self._on_menu_select) # when the user selects an entry of this menu.
235 self.icon.connect_to_signal("on_scroll", self.on_scroll) # when the user scroll up or down on our icon.
236 self.icon.connect_to_signal("on_drop_data", self.on_drop_data) # when the user drops something on our icon.
237 self.icon.connect_to_signal("on_answer_dialog", self.on_answer_dialog) # when the user answer a question.
238 self.icon.connect_to_signal("on_shortkey", self.on_shortkey) # when the user press the shortkey.
239 self.icon.connect_to_signal("on_change_focus", self.on_change_focus) # when the window's focus changes.
240 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).
241 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).
242 self.sub_icons.connect_to_signal("on_click_sub_icon", self.on_click_sub_icon) # when the user left-clicks on a sub-icon.
243 self.sub_icons.connect_to_signal("on_middle_click_sub_icon", self.on_middle_click_sub_icon)
244 self.sub_icons.connect_to_signal("on_scroll_sub_icon", self.on_scroll_sub_icon)
245 self.sub_icons.connect_to_signal("on_build_menu_sub_icon", self._on_build_menu_sub_icon)
246 self.sub_icons.connect_to_signal("on_drop_data_sub_icon", self.on_drop_data_sub_icon)
247269
=== modified file 'Dbus/interfaces/python/CMakeLists.txt'
--- Dbus/interfaces/python/CMakeLists.txt 2011-04-20 20:46:51 +0000
+++ Dbus/interfaces/python/CMakeLists.txt 2011-08-09 20:07:46 +0000
@@ -3,7 +3,7 @@
33
4if (NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")4if (NOT "${CMAKE_CURRENT_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
5 # copy *.py to current binary dir (cleaner)5 # copy *.py to current binary dir (cleaner)
6 execute_process(COMMAND cp "${CMAKE_CURRENT_SOURCE_DIR}/setup.py" "${CMAKE_CURRENT_SOURCE_DIR}/CDApplet.py" ${CMAKE_CURRENT_BINARY_DIR})6 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})
7 exec_program("${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}" ARGS "setup.py" "-q" "build")7 exec_program("${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_BINARY_DIR}" ARGS "setup.py" "-q" "build")
8endif()8endif()
9# Run a custom script with 'make install' 9# Run a custom script with 'make install'
1010
=== added file 'Dbus/interfaces/python/CairoDock.py'
--- Dbus/interfaces/python/CairoDock.py 1970-01-01 00:00:00 +0000
+++ Dbus/interfaces/python/CairoDock.py 2011-08-09 20:07:46 +0000
@@ -0,0 +1,111 @@
1# This is a part of the Cairo-Dock plug-ins.
2# Copyright : (C) 2010-2011 by Fabounet
3# E-mail : fabounet@glx-dock.org
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; either version 2
8# of the License, or (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14# http://www.gnu.org/licenses/licenses.html#GPL
15
16# Base class for Cairo-Dock's main interface.
17
18####################
19### dependancies ###
20####################
21import os.path
22import dbus
23import re
24
25USER_CONFIG_DIR = os.path.abspath("~/.config")
26
27
28##################
29### Main class ###
30##################
31class CairoDock:
32
33 #############
34 ### Enums ###
35 #############
36 # orientation
37 BOTTOM = 0
38 TOP = 1
39 RIGHT = 2
40 LEFT = 3
41 # container type
42 DOCK = "Dock"
43 DESKLET = "Desklet"
44 # emblem position
45 UPPER_LEFT = 0
46 LOWER_RIGHT = 1
47 LOWER_LEFT = 2
48 UPPER_RIGHT = 3
49 MIDDLE = 4
50 # module category
51 CATEGORY_BEHAVIOR = 0
52 CATEGORY_THEME = 1
53 CATEGORY_APPLET_FILES = 2
54 CATEGORY_APPLET_INTERNET = 3
55 CATEGORY_APPLET_DESKTOP = 4
56 CATEGORY_APPLET_ACCESSORY = 5
57 CATEGORY_APPLET_SYSTEM = 6
58 CATEGORY_APPLET_FUN = 7
59 # module type
60 CAN_DOCK = 1
61 CAN_DESKLET = 2
62 # icon type
63 TYPE_LAUNCHER = "Launcher"
64 TYPE_APPLICATION = "Application"
65 TYPE_APPLET = "Applet"
66 TYPE_SEPARATOR = "Separator"
67 TYPE_CONTAINER = "Container"
68 TYPE_CLASS_CONTAINER = "Class-Container"
69 TYPE_OTHER = "Other"
70 # toggle dock visibility
71 HIDE_DOCK = 0
72 SHOW_DOCK = 1
73 TOGGLE_DOCK = 2
74
75 #####################
76 ### INIT AND DBUS ###
77 #####################
78
79 def __init__(self, app_name="cairo-dock"):
80 """ Initialize the interface.
81 It defines the following:
82 - cDataDir: main dir
83 - cCurrentThemeDir: current theme dir
84 - cConfFile : path to the global config file
85 """
86 self.dock = None
87 self.cAppName = app_name
88 self.cDataDir = USER_CONFIG_DIR + '/' + app_name
89 self.cCurrentThemeDir = self.cDataDir + '/current_theme'
90 self.cLaunchersDir = self.cCurrentThemeDir + '/launchers'
91 self.cPluginsDir = self.cCurrentThemeDir + '/plug-ins'
92 self.cConfFile = self.cCurrentThemeDir + '/' + app_name + '.conf'
93
94 self._connect()
95
96 def _connect(self):
97 # get gldi on the bus.
98 bus = dbus.SessionBus()
99
100 name1 = self.cAppName.replace('-','') # -> cairodock
101 name2 = re.sub('-[a-z]', lambda x: x.group(0).upper(), self.cAppName)
102 name2 = re.sub('^[a-z]', lambda x: x.group(0).upper(), name2) # -> CairoDock
103 name2 = name2.replace('-','') # -> CairoDock
104 cBusPath = '/org/'+name1+'/'+name2
105 try:
106 dbus_object = bus.get_object("org.cairodock.CairoDock", cBusPath)
107 except:
108 print ">>> object '"+cBusPath+"' can't be found on the bus, exit.\nMake sure that Cairo-Dock is running"
109 return
110 self.iface = dbus.Interface(dbus_object, "org.cairodock.CairoDock") # this object represents gldi.
111
0112
=== modified file 'Dbus/interfaces/python/setup.py'
--- Dbus/interfaces/python/setup.py 2011-04-20 20:46:51 +0000
+++ Dbus/interfaces/python/setup.py 2011-08-09 20:07:46 +0000
@@ -21,5 +21,5 @@
21 author_email='fabounet@glx-dock.org',21 author_email='fabounet@glx-dock.org',
22 description='Python interface for Cairo-Dock',22 description='Python interface for Cairo-Dock',
23 url='https://launchpad.net/cairo-dock',23 url='https://launchpad.net/cairo-dock',
24 py_modules=['CDApplet']24 py_modules=['CDApplet', 'CairoDock']
25 )25 )
2626
=== modified file 'Dbus/interfaces/vala/CMakeLists.txt'
--- Dbus/interfaces/vala/CMakeLists.txt 2011-04-20 20:46:51 +0000
+++ Dbus/interfaces/vala/CMakeLists.txt 2011-08-09 20:07:46 +0000
@@ -13,9 +13,13 @@
13 else()13 else()
14 set (VALA_DIR ${CMAKE_CURRENT_BINARY_DIR})14 set (VALA_DIR ${CMAKE_CURRENT_BINARY_DIR})
15 endif()15 endif()
16 if (${VALA_MAJOR} LESS 1 AND ${VALA_MINOR} LESS 13)
17 set (DISABLE_DBUS_TRANSFORMATION "--disable-dbus-transformation")
18 endif()
16 # first, precompile the Vala code into C code.19 # first, precompile the Vala code into C code.
17 execute_process(COMMAND20 execute_process(COMMAND
18 ${VALAC_EXE} -q -C --disable-warnings --disable-dbus-transformation21 ${VALAC_EXE} -q -C
22 --disable-warnings ${DISABLE_DBUS_TRANSFORMATION}
19 --pkg gio-2.023 --pkg gio-2.0
20 --vapi=${VALA_DIR}/src/${CDAPPLET}.vapi24 --vapi=${VALA_DIR}/src/${CDAPPLET}.vapi
21 --header=${VALA_DIR}/src/${CDAPPLET}.h25 --header=${VALA_DIR}/src/${CDAPPLET}.h
2226
=== modified file 'Dbus/src/applet-dbus.c'
--- Dbus/src/applet-dbus.c 2011-04-20 20:46:51 +0000
+++ Dbus/src/applet-dbus.c 2011-08-09 20:07:46 +0000
@@ -38,6 +38,7 @@
38#define __USE_POSIX38#define __USE_POSIX
39#include <signal.h> // kill39#include <signal.h> // kill
40#include <glib.h>40#include <glib.h>
41#include <glib/gstdio.h>
41#include <dbus/dbus-glib.h>42#include <dbus/dbus-glib.h>
42#include <dbus/dbus-glib-bindings.h>43#include <dbus/dbus-glib-bindings.h>
4344
@@ -47,6 +48,9 @@
47#include "interface-applet-signals.h"48#include "interface-applet-signals.h"
48#include "applet-dbus.h"49#include "applet-dbus.h"
4950
51#define DISTANT_DIR "2.4.0"
52#define GETTEXT_NAME_EXTRAS "cairo-dock-plugins-extra"
53#define LOCALE_DIR_NAME "locale"
5054
51 ///////////////////55 ///////////////////
52 /// MAIN OBJECT ///56 /// MAIN OBJECT ///
@@ -82,7 +86,6 @@
82 86
83 //\_____________ On initialise l'icone.87 //\_____________ On initialise l'icone.
84 cd_dbus_action_on_init_module (pModuleInstance);88 cd_dbus_action_on_init_module (pModuleInstance);
85
86 //\_____________ On cree l'objet sur le bus.89 //\_____________ On cree l'objet sur le bus.
87 dbusApplet *pDbusApplet = cd_dbus_create_remote_applet_object (pModuleInstance);90 dbusApplet *pDbusApplet = cd_dbus_create_remote_applet_object (pModuleInstance);
88 g_return_if_fail (pDbusApplet != NULL);91 g_return_if_fail (pDbusApplet != NULL);
@@ -91,7 +94,12 @@
91 if (pKeyFile != NULL)94 if (pKeyFile != NULL)
92 {95 {
93 if (cairo_dock_conf_file_needs_update (pKeyFile, pModuleInstance->pModule->pVisitCard->cModuleVersion))96 if (cairo_dock_conf_file_needs_update (pKeyFile, pModuleInstance->pModule->pVisitCard->cModuleVersion))
94 cairo_dock_flush_conf_file (pKeyFile, pModuleInstance->cConfFilePath, pModuleInstance->pModule->pVisitCard->cShareDataDir, pModuleInstance->pModule->pVisitCard->cConfFileName);97 {
98 ///cairo_dock_flush_conf_file (pKeyFile, pModuleInstance->cConfFilePath, pModuleInstance->pModule->pVisitCard->cShareDataDir, pModuleInstance->pModule->pVisitCard->cConfFileName);
99 gchar *cTemplate = g_strdup_printf ("%s/%s", pModuleInstance->pModule->pVisitCard->cShareDataDir, pModuleInstance->pModule->pVisitCard->cConfFileName);
100 cairo_dock_upgrade_conf_file (pModuleInstance->cConfFilePath, pKeyFile, cTemplate);
101 g_free (cTemplate);
102 }
95 }103 }
96 104
97 //\_____________ On (re)lance l'executable de l'applet.105 //\_____________ On (re)lance l'executable de l'applet.
@@ -122,7 +130,7 @@
122 pVisitCard->iMinorVersionNeeded = 1;130 pVisitCard->iMinorVersionNeeded = 1;
123 pVisitCard->iMicroVersionNeeded = 1;131 pVisitCard->iMicroVersionNeeded = 1;
124 pVisitCard->cPreviewFilePath = cShareDataDir ? g_strdup_printf ("%s/preview", cShareDataDir) : NULL;132 pVisitCard->cPreviewFilePath = cShareDataDir ? g_strdup_printf ("%s/preview", cShareDataDir) : NULL;
125 pVisitCard->cGettextDomain = g_strdup_printf ("cd-%s", cModuleName);133 pVisitCard->cGettextDomain = g_strdup (GETTEXT_NAME_EXTRAS);
126 pVisitCard->cUserDataDir = g_strdup (cModuleName);134 pVisitCard->cUserDataDir = g_strdup (cModuleName);
127 pVisitCard->cShareDataDir = g_strdup (cShareDataDir);135 pVisitCard->cShareDataDir = g_strdup (cShareDataDir);
128 pVisitCard->cConfFileName = g_strdup_printf ("%s.conf", cModuleName);136 pVisitCard->cConfFileName = g_strdup_printf ("%s.conf", cModuleName);
@@ -219,16 +227,17 @@
219 return bActivationOk;227 return bActivationOk;
220}228}
221229
222static void _cd_dbus_register_all_applets_in_dir (const gchar *cDirPath)230static gboolean _cd_dbus_register_all_applets_in_dir (const gchar *cDirPath)
223{231{
232 gboolean bAppletRegistered = FALSE;
224 const gchar *cFileName;233 const gchar *cFileName;
225 gchar *cThirdPartyPath = g_strdup_printf ("%s/%s", cDirPath, CD_DBUS_APPLETS_FOLDER);234 gchar *cThirdPartyPath = g_strdup_printf ("%s/%s", cDirPath, CD_DBUS_APPLETS_FOLDER);
226 235
227 GDir *dir = g_dir_open (cThirdPartyPath, 0, NULL); // si le repertoire n'existe pas, on ne veut de warning.236 GDir *dir = g_dir_open (cThirdPartyPath, 0, NULL); // si le repertoire n'existe pas, on ne veut pas de warning.
228 if (dir == NULL)237 if (dir == NULL)
229 {238 {
230 g_free (cThirdPartyPath);239 g_free (cThirdPartyPath);
231 return ;240 return bAppletRegistered;
232 }241 }
233242
234 do243 do
@@ -236,12 +245,14 @@
236 cFileName = g_dir_read_name (dir);245 cFileName = g_dir_read_name (dir);
237 if (cFileName == NULL)246 if (cFileName == NULL)
238 break ;247 break ;
239 248
240 cd_dbus_register_module_in_dir (cFileName, cThirdPartyPath);249 if (strcmp (cFileName, LOCALE_DIR_NAME) != 0)
250 bAppletRegistered |= cd_dbus_register_module_in_dir (cFileName, cThirdPartyPath);
241 }251 }
242 while (1);252 while (1);
243 g_dir_close (dir);253 g_dir_close (dir);
244 g_free (cThirdPartyPath);254 g_free (cThirdPartyPath);
255 return bAppletRegistered;
245}256}
246257
247258
@@ -253,19 +264,23 @@
253{264{
254 const gchar *cSharePackagesDir = MY_APPLET_SHARE_DATA_DIR"/"CD_DBUS_APPLETS_FOLDER;265 const gchar *cSharePackagesDir = MY_APPLET_SHARE_DATA_DIR"/"CD_DBUS_APPLETS_FOLDER;
255 gchar *cUserPackagesDir = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CD_DBUS_APPLETS_FOLDER);266 gchar *cUserPackagesDir = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CD_DBUS_APPLETS_FOLDER);
256 gchar *cDistantPackagesDir = g_strdup_printf ("%s/%d.%d.%d", CD_DBUS_APPLETS_FOLDER, g_iMajorVersion, g_iMinorVersion, g_iMicroVersion);267 ///gchar *cDistantPackagesDir = g_strdup_printf ("%s/%d.%d.%d", CD_DBUS_APPLETS_FOLDER, g_iMajorVersion, g_iMinorVersion, g_iMicroVersion);
257 gchar *cPath = cairo_dock_get_package_path (cModuleName, cSharePackagesDir, cUserPackagesDir, cDistantPackagesDir, CAIRO_DOCK_UPDATED_PACKAGE);268 const gchar *cDistantPackagesDir = CD_DBUS_APPLETS_FOLDER"/"DISTANT_DIR;
269 gchar *cPath = cairo_dock_get_package_path (cModuleName,
270 cSharePackagesDir,
271 cUserPackagesDir,
272 cDistantPackagesDir,
273 CAIRO_DOCK_UPDATED_PACKAGE);
258 cd_debug ("*** update of the applet '%s' -> got '%s'\n", cModuleName, cPath);274 cd_debug ("*** update of the applet '%s' -> got '%s'\n", cModuleName, cPath);
259 g_free (cPath);275 g_free (cPath);
260 g_free (cUserPackagesDir);276 g_free (cUserPackagesDir);
261 g_free (cDistantPackagesDir);277 //g_free (cDistantPackagesDir);
262}278}
263static gboolean _apply_package_update (gchar *cModuleName)279static gboolean _apply_package_update (gchar *cModuleName)
264{280{
265 CairoDockModule *pModule = cairo_dock_find_module_from_name (cModuleName);281 CairoDockModule *pModule = cairo_dock_find_module_from_name (cModuleName);
266 g_return_val_if_fail (pModule != NULL, TRUE);
267 282
268 if (pModule->pInstancesList != NULL) // applet active => on la recharge.283 if (pModule && pModule->pInstancesList != NULL) // applet active => reload it (pModule can be NULL in case of "locale").
269 {284 {
270 cd_debug ("*** applet '%s' is active, reload it", cModuleName);285 cd_debug ("*** applet '%s' is active, reload it", cModuleName);
271 CairoDockModuleInstance *pModuleInstance = pModule->pInstancesList->data;286 CairoDockModuleInstance *pModuleInstance = pModule->pInstancesList->data;
@@ -424,8 +439,8 @@
424 const gchar *cProgName = g_get_prgname ();439 const gchar *cProgName = g_get_prgname ();
425 g_return_if_fail (cProgName != NULL);440 g_return_if_fail (cProgName != NULL);
426 int n = strlen (cProgName);441 int n = strlen (cProgName);
427 gchar *cName1 = g_new0 (gchar, n+1);442 gchar *cName1 = g_new0 (gchar, n+1); // prog name without '-' and '_'
428 gchar *cName2 = g_new0 (gchar, n+1);443 gchar *cName2 = g_new0 (gchar, n+1); // same but with upper char after the '-' and '_'
429 int i, k=0;444 int i, k=0;
430 for (i = 0; i < n; i ++)445 for (i = 0; i < n; i ++)
431 {446 {
@@ -450,25 +465,47 @@
450 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 ?...465 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 ?...
451 466
452 //\____________ create the main object on the bus.467 //\____________ create the main object on the bus.
453 myData.pMainObject = g_object_new (cd_dbus_main_get_type(), NULL); // appelle cd_dbus_main_class_init() et cd_dbus_main_init().468 myData.pMainObject = g_object_new (cd_dbus_main_get_type(), NULL); // call cd_dbus_main_class_init() and cd_dbus_main_init().
454 469
455 //\____________ register the applets installed in the default folders.470 //\____________ register the applets installed in the default folders.
456 _cd_dbus_register_all_applets_in_dir (MY_APPLET_SHARE_DATA_DIR);471 gboolean bAppletRegistered = FALSE;
457 472 bAppletRegistered |= _cd_dbus_register_all_applets_in_dir (MY_APPLET_SHARE_DATA_DIR);
458 _cd_dbus_register_all_applets_in_dir (g_cCairoDockDataDir);473
474 bAppletRegistered |= _cd_dbus_register_all_applets_in_dir (g_cCairoDockDataDir);
475
476 //\____________ internationalize the applets.
477 gchar *cLocaleDir = g_strdup_printf ("%s/"CD_DBUS_APPLETS_FOLDER"/"LOCALE_DIR_NAME, g_cCairoDockDataDir); // user version of /usr/share/locale
478 if (! g_file_test (cLocaleDir, G_FILE_TEST_EXISTS)) // translations not downloaded yet.
479 {
480 gchar *cUserAppletsFolder = g_strdup_printf ("%s/"CD_DBUS_APPLETS_FOLDER, g_cCairoDockDataDir);
481 if (! g_file_test (cUserAppletsFolder, G_FILE_TEST_EXISTS))
482 {
483 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.
484 cd_warning ("couldn't create '%s'; third-party applets can't be added", cUserAppletsFolder);
485 }
486 g_free (cUserAppletsFolder);
487
488 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.
489 cd_warning ("couldn't create '%s'; applets won't be translated", cLocaleDir);
490 }
491 bindtextdomain (GETTEXT_NAME_EXTRAS, cLocaleDir); // bind the applets' domain to the user locale folder.
492 bind_textdomain_codeset (GETTEXT_NAME_EXTRAS, "UTF-8");
493 g_free (cLocaleDir);
459 494
460 //\____________ download in background the list of existing applets.495 //\____________ download in background the list of existing applets.
461 const gchar *cSharePackagesDir = NULL; // MY_APPLET_SHARE_DATA_DIR"/"CD_DBUS_APPLETS_FOLDER;496 if (bAppletRegistered) // only if some third-party applets are present on the disk.
462 gchar *cUserPackagesDir = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CD_DBUS_APPLETS_FOLDER);497 {
463 gchar *cDistantPackagesDir = g_strdup_printf ("%s/%d.%d.%d", CD_DBUS_APPLETS_FOLDER, g_iMajorVersion, g_iMinorVersion, g_iMicroVersion);498 const gchar *cSharePackagesDir = NULL; // no share data dir, since we can't write in /usr
464 myData.pGetListTask = cairo_dock_list_packages_async (cSharePackagesDir,499 gchar *cUserPackagesDir = g_strdup_printf ("%s/%s", g_cCairoDockDataDir, CD_DBUS_APPLETS_FOLDER);
465 cUserPackagesDir,500 const gchar *cDistantPackagesDir = CD_DBUS_APPLETS_FOLDER"/"DISTANT_DIR;
466 cDistantPackagesDir,501 myData.pGetListTask = cairo_dock_list_packages_async (cSharePackagesDir,
467 (CairoDockGetPackagesFunc) _on_got_list,502 cUserPackagesDir,
468 NULL, // data503 cDistantPackagesDir,
469 NULL); // table504 (CairoDockGetPackagesFunc) _on_got_list,
470 g_free (cUserPackagesDir);505 NULL, // data
471 g_free (cDistantPackagesDir);506 NULL); // table
507 g_free (cUserPackagesDir);
508 }
472}509}
473510
474511
475512
=== modified file 'Dbus/src/dbus-main-spec.h'
--- Dbus/src/dbus-main-spec.h 2011-04-20 20:46:51 +0000
+++ Dbus/src/dbus-main-spec.h 2011-08-09 20:07:46 +0000
@@ -55,105 +55,193 @@
55#endif /* !G_ENABLE_DEBUG */55#endif /* !G_ENABLE_DEBUG */
5656
5757
58/* BOOLEAN:STRING,INT,STRING,STRING,STRING,POINTER */58/* BOOLEAN:INT,POINTER */
59extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER (GClosure *closure,59extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__INT_POINTER (GClosure *closure,
60 GValue *return_value,60 GValue *return_value,
61 guint n_param_values,61 guint n_param_values,
62 const GValue *param_values,62 const GValue *param_values,
63 gpointer invocation_hint,63 gpointer invocation_hint,
64 gpointer marshal_data);64 gpointer marshal_data);
65void65void
66dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER (GClosure *closure,66dbus_glib_marshal_cd_dbus_main_BOOLEAN__INT_POINTER (GClosure *closure,
67 GValue *return_value G_GNUC_UNUSED,67 GValue *return_value G_GNUC_UNUSED,
68 guint n_param_values,68 guint n_param_values,
69 const GValue *param_values,69 const GValue *param_values,
70 gpointer invocation_hint G_GNUC_UNUSED,70 gpointer invocation_hint G_GNUC_UNUSED,
71 gpointer marshal_data)71 gpointer marshal_data)
72{72{
73 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER) (gpointer data1,73 typedef gboolean (*GMarshalFunc_BOOLEAN__INT_POINTER) (gpointer data1,
74 gpointer arg_1,74 gint arg_1,
75 gint arg_2,75 gpointer arg_2,
76 gpointer arg_3,76 gpointer data2);
77 gpointer arg_4,77 register GMarshalFunc_BOOLEAN__INT_POINTER callback;
78 gpointer arg_5,78 register GCClosure *cc = (GCClosure*) closure;
79 gpointer arg_6,79 register gpointer data1, data2;
80 gpointer data2);80 gboolean v_return;
81 register GMarshalFunc_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER callback;81
82 register GCClosure *cc = (GCClosure*) closure;82 g_return_if_fail (return_value != NULL);
83 register gpointer data1, data2;83 g_return_if_fail (n_param_values == 3);
84 gboolean v_return;84
8585 if (G_CCLOSURE_SWAP_DATA (closure))
86 g_return_if_fail (return_value != NULL);86 {
87 g_return_if_fail (n_param_values == 7);87 data1 = closure->data;
8888 data2 = g_value_peek_pointer (param_values + 0);
89 if (G_CCLOSURE_SWAP_DATA (closure))89 }
90 {90 else
91 data1 = closure->data;91 {
92 data2 = g_value_peek_pointer (param_values + 0);92 data1 = g_value_peek_pointer (param_values + 0);
93 }93 data2 = closure->data;
94 else94 }
95 {95 callback = (GMarshalFunc_BOOLEAN__INT_POINTER) (marshal_data ? marshal_data : cc->callback);
96 data1 = g_value_peek_pointer (param_values + 0);96
97 data2 = closure->data;97 v_return = callback (data1,
98 }98 g_marshal_value_peek_int (param_values + 1),
99 callback = (GMarshalFunc_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback);99 g_marshal_value_peek_pointer (param_values + 2),
100100 data2);
101 v_return = callback (data1,101
102 g_marshal_value_peek_string (param_values + 1),102 g_value_set_boolean (return_value, v_return);
103 g_marshal_value_peek_int (param_values + 2),103}
104
105/* BOOLEAN:BOXED,POINTER */
106extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOXED_POINTER (GClosure *closure,
107 GValue *return_value,
108 guint n_param_values,
109 const GValue *param_values,
110 gpointer invocation_hint,
111 gpointer marshal_data);
112void
113dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOXED_POINTER (GClosure *closure,
114 GValue *return_value G_GNUC_UNUSED,
115 guint n_param_values,
116 const GValue *param_values,
117 gpointer invocation_hint G_GNUC_UNUSED,
118 gpointer marshal_data)
119{
120 typedef gboolean (*GMarshalFunc_BOOLEAN__BOXED_POINTER) (gpointer data1,
121 gpointer arg_1,
122 gpointer arg_2,
123 gpointer data2);
124 register GMarshalFunc_BOOLEAN__BOXED_POINTER callback;
125 register GCClosure *cc = (GCClosure*) closure;
126 register gpointer data1, data2;
127 gboolean v_return;
128
129 g_return_if_fail (return_value != NULL);
130 g_return_if_fail (n_param_values == 3);
131
132 if (G_CCLOSURE_SWAP_DATA (closure))
133 {
134 data1 = closure->data;
135 data2 = g_value_peek_pointer (param_values + 0);
136 }
137 else
138 {
139 data1 = g_value_peek_pointer (param_values + 0);
140 data2 = closure->data;
141 }
142 callback = (GMarshalFunc_BOOLEAN__BOXED_POINTER) (marshal_data ? marshal_data : cc->callback);
143
144 v_return = callback (data1,
145 g_marshal_value_peek_boxed (param_values + 1),
146 g_marshal_value_peek_pointer (param_values + 2),
147 data2);
148
149 g_value_set_boolean (return_value, v_return);
150}
151
152/* BOOLEAN:BOOLEAN,POINTER */
153extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure,
154 GValue *return_value,
155 guint n_param_values,
156 const GValue *param_values,
157 gpointer invocation_hint,
158 gpointer marshal_data);
159void
160dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure,
161 GValue *return_value G_GNUC_UNUSED,
162 guint n_param_values,
163 const GValue *param_values,
164 gpointer invocation_hint G_GNUC_UNUSED,
165 gpointer marshal_data)
166{
167 typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (gpointer data1,
168 gboolean arg_1,
169 gpointer arg_2,
170 gpointer data2);
171 register GMarshalFunc_BOOLEAN__BOOLEAN_POINTER callback;
172 register GCClosure *cc = (GCClosure*) closure;
173 register gpointer data1, data2;
174 gboolean v_return;
175
176 g_return_if_fail (return_value != NULL);
177 g_return_if_fail (n_param_values == 3);
178
179 if (G_CCLOSURE_SWAP_DATA (closure))
180 {
181 data1 = closure->data;
182 data2 = g_value_peek_pointer (param_values + 0);
183 }
184 else
185 {
186 data1 = g_value_peek_pointer (param_values + 0);
187 data2 = closure->data;
188 }
189 callback = (GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback);
190
191 v_return = callback (data1,
192 g_marshal_value_peek_boolean (param_values + 1),
193 g_marshal_value_peek_pointer (param_values + 2),
194 data2);
195
196 g_value_set_boolean (return_value, v_return);
197}
198
199/* BOOLEAN:BOOLEAN,STRING,STRING,POINTER */
200extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_STRING_STRING_POINTER (GClosure *closure,
201 GValue *return_value,
202 guint n_param_values,
203 const GValue *param_values,
204 gpointer invocation_hint,
205 gpointer marshal_data);
206void
207dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_STRING_STRING_POINTER (GClosure *closure,
208 GValue *return_value G_GNUC_UNUSED,
209 guint n_param_values,
210 const GValue *param_values,
211 gpointer invocation_hint G_GNUC_UNUSED,
212 gpointer marshal_data)
213{
214 typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN_STRING_STRING_POINTER) (gpointer data1,
215 gboolean arg_1,
216 gpointer arg_2,
217 gpointer arg_3,
218 gpointer arg_4,
219 gpointer data2);
220 register GMarshalFunc_BOOLEAN__BOOLEAN_STRING_STRING_POINTER callback;
221 register GCClosure *cc = (GCClosure*) closure;
222 register gpointer data1, data2;
223 gboolean v_return;
224
225 g_return_if_fail (return_value != NULL);
226 g_return_if_fail (n_param_values == 5);
227
228 if (G_CCLOSURE_SWAP_DATA (closure))
229 {
230 data1 = closure->data;
231 data2 = g_value_peek_pointer (param_values + 0);
232 }
233 else
234 {
235 data1 = g_value_peek_pointer (param_values + 0);
236 data2 = closure->data;
237 }
238 callback = (GMarshalFunc_BOOLEAN__BOOLEAN_STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback);
239
240 v_return = callback (data1,
241 g_marshal_value_peek_boolean (param_values + 1),
242 g_marshal_value_peek_string (param_values + 2),
104 g_marshal_value_peek_string (param_values + 3),243 g_marshal_value_peek_string (param_values + 3),
105 g_marshal_value_peek_string (param_values + 4),244 g_marshal_value_peek_pointer (param_values + 4),
106 g_marshal_value_peek_string (param_values + 5),
107 g_marshal_value_peek_pointer (param_values + 6),
108 data2);
109
110 g_value_set_boolean (return_value, v_return);
111}
112
113/* BOOLEAN:STRING,BOOLEAN,POINTER */
114extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure,
115 GValue *return_value,
116 guint n_param_values,
117 const GValue *param_values,
118 gpointer invocation_hint,
119 gpointer marshal_data);
120void
121dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure,
122 GValue *return_value G_GNUC_UNUSED,
123 guint n_param_values,
124 const GValue *param_values,
125 gpointer invocation_hint G_GNUC_UNUSED,
126 gpointer marshal_data)
127{
128 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (gpointer data1,
129 gpointer arg_1,
130 gboolean arg_2,
131 gpointer arg_3,
132 gpointer data2);
133 register GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER callback;
134 register GCClosure *cc = (GCClosure*) closure;
135 register gpointer data1, data2;
136 gboolean v_return;
137
138 g_return_if_fail (return_value != NULL);
139 g_return_if_fail (n_param_values == 4);
140
141 if (G_CCLOSURE_SWAP_DATA (closure))
142 {
143 data1 = closure->data;
144 data2 = g_value_peek_pointer (param_values + 0);
145 }
146 else
147 {
148 data1 = g_value_peek_pointer (param_values + 0);
149 data2 = closure->data;
150 }
151 callback = (GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback);
152
153 v_return = callback (data1,
154 g_marshal_value_peek_string (param_values + 1),
155 g_marshal_value_peek_boolean (param_values + 2),
156 g_marshal_value_peek_pointer (param_values + 3),
157 data2);245 data2);
158246
159 g_value_set_boolean (return_value, v_return);247 g_value_set_boolean (return_value, v_return);
@@ -204,48 +292,203 @@
204 g_value_set_boolean (return_value, v_return);292 g_value_set_boolean (return_value, v_return);
205}293}
206294
207/* BOOLEAN:BOOLEAN,POINTER */295/* BOOLEAN:STRING,STRING,POINTER */
208extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure,296extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER (GClosure *closure,
209 GValue *return_value,297 GValue *return_value,
210 guint n_param_values,298 guint n_param_values,
211 const GValue *param_values,299 const GValue *param_values,
212 gpointer invocation_hint,300 gpointer invocation_hint,
213 gpointer marshal_data);301 gpointer marshal_data);
214void302void
215dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER (GClosure *closure,303dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER (GClosure *closure,
216 GValue *return_value G_GNUC_UNUSED,304 GValue *return_value G_GNUC_UNUSED,
217 guint n_param_values,305 guint n_param_values,
218 const GValue *param_values,306 const GValue *param_values,
219 gpointer invocation_hint G_GNUC_UNUSED,307 gpointer invocation_hint G_GNUC_UNUSED,
220 gpointer marshal_data)308 gpointer marshal_data)
221{309{
222 typedef gboolean (*GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (gpointer data1,310 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_STRING_POINTER) (gpointer data1,
223 gboolean arg_1,311 gpointer arg_1,
224 gpointer arg_2,312 gpointer arg_2,
225 gpointer data2);313 gpointer arg_3,
226 register GMarshalFunc_BOOLEAN__BOOLEAN_POINTER callback;314 gpointer data2);
227 register GCClosure *cc = (GCClosure*) closure;315 register GMarshalFunc_BOOLEAN__STRING_STRING_POINTER callback;
228 register gpointer data1, data2;316 register GCClosure *cc = (GCClosure*) closure;
229 gboolean v_return;317 register gpointer data1, data2;
230318 gboolean v_return;
231 g_return_if_fail (return_value != NULL);319
232 g_return_if_fail (n_param_values == 3);320 g_return_if_fail (return_value != NULL);
233321 g_return_if_fail (n_param_values == 4);
234 if (G_CCLOSURE_SWAP_DATA (closure))322
235 {323 if (G_CCLOSURE_SWAP_DATA (closure))
236 data1 = closure->data;324 {
237 data2 = g_value_peek_pointer (param_values + 0);325 data1 = closure->data;
238 }326 data2 = g_value_peek_pointer (param_values + 0);
239 else327 }
240 {328 else
241 data1 = g_value_peek_pointer (param_values + 0);329 {
242 data2 = closure->data;330 data1 = g_value_peek_pointer (param_values + 0);
243 }331 data2 = closure->data;
244 callback = (GMarshalFunc_BOOLEAN__BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback);332 }
245333 callback = (GMarshalFunc_BOOLEAN__STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback);
246 v_return = callback (data1,334
247 g_marshal_value_peek_boolean (param_values + 1),335 v_return = callback (data1,
336 g_marshal_value_peek_string (param_values + 1),
337 g_marshal_value_peek_string (param_values + 2),
338 g_marshal_value_peek_pointer (param_values + 3),
339 data2);
340
341 g_value_set_boolean (return_value, v_return);
342}
343
344/* BOOLEAN:STRING,POINTER,POINTER */
345extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure,
346 GValue *return_value,
347 guint n_param_values,
348 const GValue *param_values,
349 gpointer invocation_hint,
350 gpointer marshal_data);
351void
352dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER (GClosure *closure,
353 GValue *return_value G_GNUC_UNUSED,
354 guint n_param_values,
355 const GValue *param_values,
356 gpointer invocation_hint G_GNUC_UNUSED,
357 gpointer marshal_data)
358{
359 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (gpointer data1,
360 gpointer arg_1,
361 gpointer arg_2,
362 gpointer arg_3,
363 gpointer data2);
364 register GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER callback;
365 register GCClosure *cc = (GCClosure*) closure;
366 register gpointer data1, data2;
367 gboolean v_return;
368
369 g_return_if_fail (return_value != NULL);
370 g_return_if_fail (n_param_values == 4);
371
372 if (G_CCLOSURE_SWAP_DATA (closure))
373 {
374 data1 = closure->data;
375 data2 = g_value_peek_pointer (param_values + 0);
376 }
377 else
378 {
379 data1 = g_value_peek_pointer (param_values + 0);
380 data2 = closure->data;
381 }
382 callback = (GMarshalFunc_BOOLEAN__STRING_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
383
384 v_return = callback (data1,
385 g_marshal_value_peek_string (param_values + 1),
248 g_marshal_value_peek_pointer (param_values + 2),386 g_marshal_value_peek_pointer (param_values + 2),
387 g_marshal_value_peek_pointer (param_values + 3),
388 data2);
389
390 g_value_set_boolean (return_value, v_return);
391}
392
393/* BOOLEAN:STRING,INT,STRING,POINTER */
394extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER (GClosure *closure,
395 GValue *return_value,
396 guint n_param_values,
397 const GValue *param_values,
398 gpointer invocation_hint,
399 gpointer marshal_data);
400void
401dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER (GClosure *closure,
402 GValue *return_value G_GNUC_UNUSED,
403 guint n_param_values,
404 const GValue *param_values,
405 gpointer invocation_hint G_GNUC_UNUSED,
406 gpointer marshal_data)
407{
408 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_INT_STRING_POINTER) (gpointer data1,
409 gpointer arg_1,
410 gint arg_2,
411 gpointer arg_3,
412 gpointer arg_4,
413 gpointer data2);
414 register GMarshalFunc_BOOLEAN__STRING_INT_STRING_POINTER callback;
415 register GCClosure *cc = (GCClosure*) closure;
416 register gpointer data1, data2;
417 gboolean v_return;
418
419 g_return_if_fail (return_value != NULL);
420 g_return_if_fail (n_param_values == 5);
421
422 if (G_CCLOSURE_SWAP_DATA (closure))
423 {
424 data1 = closure->data;
425 data2 = g_value_peek_pointer (param_values + 0);
426 }
427 else
428 {
429 data1 = g_value_peek_pointer (param_values + 0);
430 data2 = closure->data;
431 }
432 callback = (GMarshalFunc_BOOLEAN__STRING_INT_STRING_POINTER) (marshal_data ? marshal_data : cc->callback);
433
434 v_return = callback (data1,
435 g_marshal_value_peek_string (param_values + 1),
436 g_marshal_value_peek_int (param_values + 2),
437 g_marshal_value_peek_string (param_values + 3),
438 g_marshal_value_peek_pointer (param_values + 4),
439 data2);
440
441 g_value_set_boolean (return_value, v_return);
442}
443
444/* BOOLEAN:STRING,DOUBLE,STRING,POINTER,POINTER */
445extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER (GClosure *closure,
446 GValue *return_value,
447 guint n_param_values,
448 const GValue *param_values,
449 gpointer invocation_hint,
450 gpointer marshal_data);
451void
452dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER (GClosure *closure,
453 GValue *return_value G_GNUC_UNUSED,
454 guint n_param_values,
455 const GValue *param_values,
456 gpointer invocation_hint G_GNUC_UNUSED,
457 gpointer marshal_data)
458{
459 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER) (gpointer data1,
460 gpointer arg_1,
461 gdouble arg_2,
462 gpointer arg_3,
463 gpointer arg_4,
464 gpointer arg_5,
465 gpointer data2);
466 register GMarshalFunc_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER callback;
467 register GCClosure *cc = (GCClosure*) closure;
468 register gpointer data1, data2;
469 gboolean v_return;
470
471 g_return_if_fail (return_value != NULL);
472 g_return_if_fail (n_param_values == 6);
473
474 if (G_CCLOSURE_SWAP_DATA (closure))
475 {
476 data1 = closure->data;
477 data2 = g_value_peek_pointer (param_values + 0);
478 }
479 else
480 {
481 data1 = g_value_peek_pointer (param_values + 0);
482 data2 = closure->data;
483 }
484 callback = (GMarshalFunc_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER) (marshal_data ? marshal_data : cc->callback);
485
486 v_return = callback (data1,
487 g_marshal_value_peek_string (param_values + 1),
488 g_marshal_value_peek_double (param_values + 2),
489 g_marshal_value_peek_string (param_values + 3),
490 g_marshal_value_peek_pointer (param_values + 4),
491 g_marshal_value_peek_pointer (param_values + 5),
249 data2);492 data2);
250493
251 g_value_set_boolean (return_value, v_return);494 g_value_set_boolean (return_value, v_return);
@@ -298,35 +541,33 @@
298 g_value_set_boolean (return_value, v_return);541 g_value_set_boolean (return_value, v_return);
299}542}
300543
301/* BOOLEAN:STRING,STRING,STRING,STRING,POINTER */544/* BOOLEAN:STRING,BOOLEAN,POINTER */
302extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER (GClosure *closure,545extern void dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure,
303 GValue *return_value,546 GValue *return_value,
304 guint n_param_values,547 guint n_param_values,
305 const GValue *param_values,548 const GValue *param_values,
306 gpointer invocation_hint,549 gpointer invocation_hint,
307 gpointer marshal_data);550 gpointer marshal_data);
308void551void
309dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER (GClosure *closure,552dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER (GClosure *closure,
310 GValue *return_value G_GNUC_UNUSED,553 GValue *return_value G_GNUC_UNUSED,
311 guint n_param_values,554 guint n_param_values,
312 const GValue *param_values,555 const GValue *param_values,
313 gpointer invocation_hint G_GNUC_UNUSED,556 gpointer invocation_hint G_GNUC_UNUSED,
314 gpointer marshal_data)557 gpointer marshal_data)
315{558{
316 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_STRING_STRING_STRING_POINTER) (gpointer data1,559 typedef gboolean (*GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (gpointer data1,
317 gpointer arg_1,560 gpointer arg_1,
318 gpointer arg_2,561 gboolean arg_2,
319 gpointer arg_3,562 gpointer arg_3,
320 gpointer arg_4,563 gpointer data2);
321 gpointer arg_5,564 register GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER callback;
322 gpointer data2);
323 register GMarshalFunc_BOOLEAN__STRING_STRING_STRING_STRING_POINTER callback;
324 register GCClosure *cc = (GCClosure*) closure;565 register GCClosure *cc = (GCClosure*) closure;
325 register gpointer data1, data2;566 register gpointer data1, data2;
326 gboolean v_return;567 gboolean v_return;
327568
328 g_return_if_fail (return_value != NULL);569 g_return_if_fail (return_value != NULL);
329 g_return_if_fail (n_param_values == 6);570 g_return_if_fail (n_param_values == 4);
330571
331 if (G_CCLOSURE_SWAP_DATA (closure))572 if (G_CCLOSURE_SWAP_DATA (closure))
332 {573 {
@@ -338,14 +579,12 @@
338 data1 = g_value_peek_pointer (param_values + 0);579 data1 = g_value_peek_pointer (param_values + 0);
339 data2 = closure->data;580 data2 = closure->data;
340 }581 }
341 callback = (GMarshalFunc_BOOLEAN__STRING_STRING_STRING_STRING_POINTER) (marshal_data ? marshal_data : cc->callback);582 callback = (GMarshalFunc_BOOLEAN__STRING_BOOLEAN_POINTER) (marshal_data ? marshal_data : cc->callback);
342583
343 v_return = callback (data1,584 v_return = callback (data1,
344 g_marshal_value_peek_string (param_values + 1),585 g_marshal_value_peek_string (param_values + 1),
345 g_marshal_value_peek_string (param_values + 2),586 g_marshal_value_peek_boolean (param_values + 2),
346 g_marshal_value_peek_string (param_values + 3),587 g_marshal_value_peek_pointer (param_values + 3),
347 g_marshal_value_peek_string (param_values + 4),
348 g_marshal_value_peek_pointer (param_values + 5),
349 data2);588 data2);
350589
351 g_value_set_boolean (return_value, v_return);590 g_value_set_boolean (return_value, v_return);
@@ -359,26 +598,30 @@
359static const DBusGMethodInfo dbus_glib_cd_dbus_main_methods[] = {598static const DBusGMethodInfo dbus_glib_cd_dbus_main_methods[] = {
360 { (GCallback) cd_dbus_main_reboot, dbus_glib_marshal_cd_dbus_main_BOOLEAN__POINTER, 0 },599 { (GCallback) cd_dbus_main_reboot, dbus_glib_marshal_cd_dbus_main_BOOLEAN__POINTER, 0 },
361 { (GCallback) cd_dbus_main_quit, dbus_glib_marshal_cd_dbus_main_BOOLEAN__POINTER, 34 },600 { (GCallback) cd_dbus_main_quit, dbus_glib_marshal_cd_dbus_main_BOOLEAN__POINTER, 34 },
362 { (GCallback) cd_dbus_main_show_desklet, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER, 66 },601 { (GCallback) cd_dbus_main_show_dock, dbus_glib_marshal_cd_dbus_main_BOOLEAN__INT_POINTER, 66 },
363 { (GCallback) cd_dbus_main_reload_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 121 },602 { (GCallback) cd_dbus_main_show_desklet, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER, 118 },
364 { (GCallback) cd_dbus_main_activate_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER, 177 },603 { (GCallback) cd_dbus_main_reload_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 173 },
365 { (GCallback) cd_dbus_main_show_dock, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_POINTER, 249 },604 { (GCallback) cd_dbus_main_activate_module, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_BOOLEAN_POINTER, 229 },
366 { (GCallback) cd_dbus_main_create_launcher_from_scratch, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 294 },605 { (GCallback) cd_dbus_main_get_icon_properties, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER, 301 },
367 { (GCallback) cd_dbus_main_load_launcher_from_file, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 405 },606 { (GCallback) cd_dbus_main_get_container_properties, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER, 390 },
368 { (GCallback) cd_dbus_main_reload_launcher, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 470 },607 { (GCallback) cd_dbus_main_get_module_properties, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER_POINTER, 484 },
369 { (GCallback) cd_dbus_main_remove_launcher, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 529 },608 { (GCallback) cd_dbus_main_add_launcher, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_DOUBLE_STRING_POINTER_POINTER, 572 },
370 { (GCallback) cd_dbus_main_set_quick_info, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 588 },609 { (GCallback) cd_dbus_main_add_temporary_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOXED_POINTER, 679 },
371 { (GCallback) cd_dbus_main_set_label, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 690 },610 { (GCallback) cd_dbus_main_reload_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 747 },
372 { (GCallback) cd_dbus_main_set_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_STRING_STRING_POINTER, 784 },611 { (GCallback) cd_dbus_main_remove_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_POINTER, 800 },
373 { (GCallback) cd_dbus_main_set_emblem, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER, 877 },612 { (GCallback) cd_dbus_main_set_quick_info, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER, 853 },
374 { (GCallback) cd_dbus_main_animate, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER, 986 },613 { (GCallback) cd_dbus_main_set_label, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER, 923 },
375 { (GCallback) cd_dbus_main_show_dialog, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_STRING_STRING_POINTER, 1097 },614 { (GCallback) cd_dbus_main_set_icon, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_STRING_POINTER, 985 },
615 { (GCallback) cd_dbus_main_set_emblem, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER, 1046 },
616 { (GCallback) cd_dbus_main_animate, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER, 1123 },
617 { (GCallback) cd_dbus_main_demands_attention, dbus_glib_marshal_cd_dbus_main_BOOLEAN__BOOLEAN_STRING_STRING_POINTER, 1202 },
618 { (GCallback) cd_dbus_main_show_dialog, dbus_glib_marshal_cd_dbus_main_BOOLEAN__STRING_INT_STRING_POINTER, 1287 },
376};619};
377620
378const DBusGObjectInfo dbus_glib_cd_dbus_main_object_info = { 1,621const DBusGObjectInfo dbus_glib_cd_dbus_main_object_info = { 1,
379 dbus_glib_cd_dbus_main_methods,622 dbus_glib_cd_dbus_main_methods,
380 16,623 20,
381"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",624"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",
382"\0",625"\0",
383"\0"626"\0"
384};627};
385628
=== modified file 'Dbus/src/dbus_introspectable.xml'
--- Dbus/src/dbus_introspectable.xml 2011-04-20 20:46:51 +0000
+++ Dbus/src/dbus_introspectable.xml 2011-08-09 20:07:46 +0000
@@ -6,6 +6,9 @@
6 </method>6 </method>
7 <method name="Quit">7 <method name="Quit">
8 </method>8 </method>
9 <method name="ShowDock">
10 <arg name="iVisibility" type="i" direction="in"/>
11 </method>
9 <method name="ShowDesklet">12 <method name="ShowDesklet">
10 <arg name="widgetLayer" type="b" direction="in"/>13 <arg name="widgetLayer" type="b" direction="in"/>
11 </method>14 </method>
@@ -16,62 +19,67 @@
16 <arg name="cModuleName" type="s" direction="in"/>19 <arg name="cModuleName" type="s" direction="in"/>
17 <arg name="bActivate" type="b" direction="in"/>20 <arg name="bActivate" type="b" direction="in"/>
18 </method>21 </method>
19 <method name="ShowDock">22
20 <arg name="show" type="b" direction="in"/>23 <method name="GetIconProperties">
21 </method>24 <arg name="cIconQuery" type="s" direction="in"/>
22 <method name="CreateLauncherFromScratch">25 <arg name="pIconProperties" direction="out" type="aa{sv}"/>
23 <arg name="cIconFile" type="s" direction="in"/>26 </method>
24 <arg name="cLabel" type="s" direction="in"/>27 <method name="GetContainerProperties">
25 <arg name="cCommand" type="s" direction="in"/>28 <arg name="cName" type="s" direction="in"/>
26 <arg name="cParentDockName" type="s" direction="in"/>29 <arg name="pContainerProperties" direction="out" type="aa{sv}"/>
27 </method>30 </method>
28 <method name="LoadLauncherFromFile">31 <method name="GetModuleProperties">
29 <arg name="cDesktopFile" type="s" direction="in"/>32 <arg name="cName" type="s" direction="in"/>
30 </method>33 <arg name="pModuleProperties" direction="out" type="aa{sv}"/>
31 <method name="ReloadLauncher">34 </method>
32 <arg name="cDesktopFile" type="s" direction="in"/>35
33 </method>36 <method name="AddLauncher">
34 <method name="RemoveLauncher">37 <arg name="cDesktopFilePath" type="s" direction="in"/>
35 <arg name="cDesktopFile" type="s" direction="in"/>38 <arg name="fOrder" type="d" direction="in"/>
36 </method>39 <arg name="cDockName" type="s" direction="in"/>
40 <arg name="cLauncherFile" type="s" direction="out"/>
41 </method>
42 <method name="AddTemporaryIcon">
43 <arg name="hIconProperties" direction="in" type="a{sv}"/>
44 </method>
45 <method name="ReloadIcon">
46 <arg name="cIconQuery" type="s" direction="in"/>
47 </method>
48 <method name="RemoveIcon">
49 <arg name="cIconQuery" type="s" direction="in"/>
50 </method>
51
37 <method name="SetQuickInfo">52 <method name="SetQuickInfo">
38 <arg name="cQuickInfo" type="s" direction="in"/>53 <arg name="cQuickInfo" type="s" direction="in"/>
39 <arg name="cIconName" type="s" direction="in"/>54 <arg name="cIconQuery" type="s" direction="in"/>
40 <arg name="cIconCommand" type="s" direction="in"/>
41 <arg name="cModuleName" type="s" direction="in"/>
42 </method>55 </method>
43 <method name="SetLabel">56 <method name="SetLabel">
44 <arg name="cLabel" type="s" direction="in"/>57 <arg name="cLabel" type="s" direction="in"/>
45 <arg name="cIconName" type="s" direction="in"/>58 <arg name="cIconQuery" type="s" direction="in"/>
46 <arg name="cIconCommand" type="s" direction="in"/>
47 <arg name="cModuleName" type="s" direction="in"/>
48 </method>59 </method>
49 <method name="SetIcon">60 <method name="SetIcon">
50 <arg name="cImage" type="s" direction="in"/>61 <arg name="cImage" type="s" direction="in"/>
51 <arg name="cIconName" type="s" direction="in"/>62 <arg name="cIconQuery" type="s" direction="in"/>
52 <arg name="cIconCommand" type="s" direction="in"/>
53 <arg name="cModuleName" type="s" direction="in"/>
54 </method>63 </method>
55 <method name="SetEmblem">64 <method name="SetEmblem">
56 <arg name="cImage" type="s" direction="in"/>65 <arg name="cImage" type="s" direction="in"/>
57 <arg name="iPosition" type="i" direction="in"/>66 <arg name="iPosition" type="i" direction="in"/>
58 <arg name="cIconName" type="s" direction="in"/>67 <arg name="cIconQuery" type="s" direction="in"/>
59 <arg name="cIconCommand" type="s" direction="in"/>
60 <arg name="cModuleName" type="s" direction="in"/>
61 </method>68 </method>
62 <method name="Animate">69 <method name="Animate">
63 <arg name="cAnimation" type="s" direction="in"/>70 <arg name="cAnimation" type="s" direction="in"/>
64 <arg name="iNbRounds" type="i" direction="in"/>71 <arg name="iNbRounds" type="i" direction="in"/>
65 <arg name="cIconName" type="s" direction="in"/>72 <arg name="cIconQuery" type="s" direction="in"/>
66 <arg name="cIconCommand" type="s" direction="in"/>73 </method>
67 <arg name="cModuleName" type="s" direction="in"/>74 <method name="DemandsAttention">
75 <arg name="bStart" type="b" direction="in"/>
76 <arg name="cAnimation" type="s" direction="in"/>
77 <arg name="cIconQuery" type="s" direction="in"/>
68 </method>78 </method>
69 <method name="ShowDialog">79 <method name="ShowDialog">
70 <arg name="message" type="s" direction="in"/>80 <arg name="message" type="s" direction="in"/>
71 <arg name="iDuration" type="i" direction="in"/>81 <arg name="iDuration" type="i" direction="in"/>
72 <arg name="cIconName" type="s" direction="in"/>82 <arg name="cIconQuery" type="s" direction="in"/>
73 <arg name="cIconCommand" type="s" direction="in"/>
74 <arg name="cModuleName" type="s" direction="in"/>
75 </method>83 </method>
76 </interface>84 </interface>
77</node>85</node>
7886
=== modified file 'Dbus/src/interface-applet-methods.c'
--- Dbus/src/interface-applet-methods.c 2011-04-20 20:46:51 +0000
+++ Dbus/src/interface-applet-methods.c 2011-08-09 20:07:46 +0000
@@ -435,6 +435,7 @@
435 gtk_range_set_value (GTK_RANGE (pScale), fInitialValue);435 gtk_range_set_value (GTK_RANGE (pScale), fInitialValue);
436 436
437 gtk_widget_set (pScale, "width-request", 150, NULL);437 gtk_widget_set (pScale, "width-request", 150, NULL);
438 cairo_dock_set_dialog_widget_text_color (pScale);
438 439
439 if (cMinLabel || cMaxLabel)440 if (cMinLabel || cMaxLabel)
440 {441 {
@@ -669,8 +670,8 @@
669 pIcon->pSubDock = NULL;670 pIcon->pSubDock = NULL;
670 }671 }
671 pInstance->pDesklet->icons = g_list_concat (pInstance->pDesklet->icons, pIconsList);672 pInstance->pDesklet->icons = g_list_concat (pInstance->pDesklet->icons, pIconsList);
672 gpointer data[2] = {GINT_TO_POINTER (TRUE), GINT_TO_POINTER (FALSE)};673 gpointer data[3] = {GINT_TO_POINTER (0), GINT_TO_POINTER (TRUE), NULL};
673 cairo_dock_set_desklet_renderer_by_name (pInstance->pDesklet, "Caroussel", (CairoDeskletRendererConfigPtr) data);674 cairo_dock_set_desklet_renderer_by_name (pInstance->pDesklet, "Panel", (CairoDeskletRendererConfigPtr) data);
674 }675 }
675 676
676 return TRUE;677 return TRUE;
@@ -844,15 +845,15 @@
844 pRenderAttr->iMemorySize = (pIcon->fWidth > 1 ? pIcon->fWidth : 32); // fWidht peut etre <= 1 en mode desklet au chargement.845 pRenderAttr->iMemorySize = (pIcon->fWidth > 1 ? pIcon->fWidth : 32); // fWidht peut etre <= 1 en mode desklet au chargement.
845 // Line;Plain;Bar;Circle;Plain Circle846 // Line;Plain;Bar;Circle;Plain Circle
846 if (cTheme == NULL || strcmp (cTheme, "Line") == 0)847 if (cTheme == NULL || strcmp (cTheme, "Line") == 0)
847 attr.iType = CAIRO_DOCK_GRAPH2_LINE;848 attr.iType = CAIRO_DOCK_GRAPH_LINE;
848 else if (strcmp (cTheme, "Plain") == 0)849 else if (strcmp (cTheme, "Plain") == 0)
849 attr.iType = CAIRO_DOCK_GRAPH2_PLAIN;850 attr.iType = CAIRO_DOCK_GRAPH_PLAIN;
850 else if (strcmp (cTheme, "Bar") == 0)851 else if (strcmp (cTheme, "Bar") == 0)
851 attr.iType = CAIRO_DOCK_GRAPH2_BAR;852 attr.iType = CAIRO_DOCK_GRAPH_BAR;
852 else if (strcmp (cTheme, "Circle") == 0)853 else if (strcmp (cTheme, "Circle") == 0)
853 attr.iType = CAIRO_DOCK_GRAPH2_CIRCLE;854 attr.iType = CAIRO_DOCK_GRAPH_CIRCLE;
854 else if (strcmp (cTheme, "Plain Circle") == 0)855 else if (strcmp (cTheme, "Plain Circle") == 0)
855 attr.iType = CAIRO_DOCK_GRAPH2_CIRCLE_PLAIN;856 attr.iType = CAIRO_DOCK_GRAPH_CIRCLE_PLAIN;
856 attr.iRadius = 10;857 attr.iRadius = 10;
857 attr.bMixGraphs = FALSE;858 attr.bMixGraphs = FALSE;
858 double *fHighColor = g_new (double, iNbValues*3);859 double *fHighColor = g_new (double, iNbValues*3);
@@ -929,7 +930,9 @@
929 if (pIcon->cClass != NULL)930 if (pIcon->cClass != NULL)
930 cairo_dock_deinhibite_class (pIcon->cClass, pIcon);931 cairo_dock_deinhibite_class (pIcon->cClass, pIcon);
931 if (cClass != NULL)932 if (cClass != NULL)
932 cairo_dock_inhibite_class (cClass, pIcon);933 {
934 cairo_dock_inhibite_class (cClass, pIcon); /// useful to use cairo_dock_register_class ?...
935 }
933 if (! cairo_dock_is_loading ())936 if (! cairo_dock_is_loading ())
934 {937 {
935 CairoContainer *pContainer = pInstance->pContainer;938 CairoContainer *pContainer = pInstance->pContainer;
@@ -1124,6 +1127,9 @@
1124 {1127 {
1125 image = gtk_image_new_from_stock (cIcon, GTK_ICON_SIZE_MENU);1128 image = gtk_image_new_from_stock (cIcon, GTK_ICON_SIZE_MENU);
1126 }1129 }
1130#if (GTK_MAJOR_VERSION > 2 || GTK_MINOR_VERSION >= 16)
1131 gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (pMenuItem), TRUE);
1132#endif
1127 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (pMenuItem), image);1133 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (pMenuItem), image);
1128 }1134 }
1129 }1135 }
@@ -1268,7 +1274,7 @@
1268 }1274 }
1269 else if (strcmp (cProperty, "orientation") == 0)1275 else if (strcmp (cProperty, "orientation") == 0)
1270 {1276 {
1271 CairoDockPositionType iScreenBorder = (g_pMainDock ? ((! g_pMainDock->container.bIsHorizontal) << 1) | (! g_pMainDock->container.bDirectionUp) : 0);1277 CairoDockPositionType iScreenBorder = ((! pContainer->bIsHorizontal) << 1) | (! pContainer->bDirectionUp);
1272 g_value_init (v, G_TYPE_UINT);1278 g_value_init (v, G_TYPE_UINT);
1273 g_value_set_uint (v, iScreenBorder);1279 g_value_set_uint (v, iScreenBorder);
1274 }1280 }
12751281
=== modified file 'Dbus/src/interface-applet-signals.c'
--- Dbus/src/interface-applet-signals.c 2011-04-20 20:46:51 +0000
+++ Dbus/src/interface-applet-signals.c 2011-08-09 20:07:46 +0000
@@ -734,7 +734,7 @@
734734
735void cd_dbus_emit_on_stop_module (CairoDockModuleInstance *pModuleInstance)735void cd_dbus_emit_on_stop_module (CairoDockModuleInstance *pModuleInstance)
736{736{
737 //g_print ("%s (%s, %d)\n", __func__, pModuleInstance->pModule->pVisitCard->cModuleName, myData.bKeepObjectAlive);737 //g_print ("%s (%s)\n", __func__, pModuleInstance->pModule->pVisitCard->cModuleName);
738 dbusApplet *pDbusApplet = cd_dbus_get_dbus_applet_from_instance (pModuleInstance);738 dbusApplet *pDbusApplet = cd_dbus_get_dbus_applet_from_instance (pModuleInstance);
739 if (pDbusApplet != NULL)739 if (pDbusApplet != NULL)
740 g_signal_emit (pDbusApplet,740 g_signal_emit (pDbusApplet,
741741
=== modified file 'Dbus/src/interface-main-methods.c'
--- Dbus/src/interface-main-methods.c 2011-04-20 20:46:51 +0000
+++ Dbus/src/interface-main-methods.c 2011-08-09 20:07:46 +0000
@@ -21,21 +21,16 @@
21exemples : 21exemples :
22----------22----------
2323
24dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.CreateLauncherFromScratch string:gimp.png string:"fake gimp" string:gimp string:none24dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetQuickInfo string:123 string:"class=firefox"
2525
26dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetLabel string:new_label string:icon_name string:any string:none26dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.Animate string:default int32:2 string:"class=firefox"
27
28dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetQuickInfo string:123 string:none string:none string:dustbin
29
30dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.Animate string:default int32:2 string:any string:firefox string:none
31
32dbus-send --session --dest=org.cairodock.CairoDock /org/cairodock/CairoDock org.cairodock.CairoDock.SetIcon string:firefox-3.0 string:any string:nautilus string:none
3327
34******************************************************************************/28******************************************************************************/
3529
36#include <unistd.h>30#include <unistd.h>
37#include <glib.h>31#include <glib.h>
3832
33#include "cairo-dock.h"
39#include "interface-main-methods.h"34#include "interface-main-methods.h"
4035
41#define nullify_argument(string) do {\36#define nullify_argument(string) do {\
@@ -61,6 +56,77 @@
61 return TRUE;56 return TRUE;
62}57}
6358
59static void _show_hide_one_dock (const gchar *cDockName, CairoDock *pDock, gpointer data)
60{
61 if (pDock->iRefCount != 0)
62 return ;
63 gboolean bShow = GPOINTER_TO_INT (data);
64 if (bShow)
65 {
66 ///cairo_dock_pop_up (pDock);
67 ///if (pDock->bAutoHide)
68 cairo_dock_emit_enter_signal (CAIRO_CONTAINER (pDock));
69 }
70 else
71 {
72 ///cairo_dock_pop_down (pDock); // ne fait rien s'il n'etait pas "popped".
73 ///if (pDock->bAutoHide)
74 cairo_dock_emit_leave_signal (CAIRO_CONTAINER (pDock));
75 }
76}
77gboolean cd_dbus_main_show_dock (dbusMainObject *pDbusCallback, gint iVisibiliy, GError **error)
78{
79 if (! myConfig.bEnableShowDock)
80 return FALSE;
81
82 if (g_pMainDock == NULL)
83 return FALSE;
84
85 gboolean bShow;
86 switch (iVisibiliy)
87 {
88 case 0: // hide
89 bShow = FALSE;
90 break;
91 case 1: // show
92 bShow = TRUE;
93 break;
94 case 2: // toggle
95 default:
96 bShow = (g_pMainDock->bIsBelow || (g_pMainDock->bAutoHide && g_pMainDock->fHideOffset == 1));
97 break;
98 }
99
100 if (bShow)
101 cairo_dock_stop_quick_hide ();
102
103 cairo_dock_foreach_docks ((GHFunc) _show_hide_one_dock, GINT_TO_POINTER (bShow));
104
105 if (! bShow)
106 cairo_dock_quick_hide_all_docks ();
107
108 return TRUE;
109}
110
111gboolean cd_dbus_main_show_desklet (dbusMainObject *pDbusCallback, gboolean *widgetLayer, GError **error)
112{
113 if (! myConfig.bEnableDesklets)
114 return FALSE;
115 if (dbus_deskletVisible)
116 {
117 cairo_dock_set_desklets_visibility_to_default ();
118 cairo_dock_show_xwindow (dbus_xLastActiveWindow);
119 }
120 else
121 {
122 dbus_xLastActiveWindow = cairo_dock_get_current_active_window ();
123 cairo_dock_set_all_desklets_visible (widgetLayer != NULL ? *widgetLayer : FALSE);
124 }
125 dbus_deskletVisible = !dbus_deskletVisible;
126 return TRUE;
127}
128
129
64gboolean cd_dbus_main_reload_module (dbusMainObject *pDbusCallback, const gchar *cModuleName, GError **error)130gboolean cd_dbus_main_reload_module (dbusMainObject *pDbusCallback, const gchar *cModuleName, GError **error)
65{131{
66 if (! myConfig.bEnableReloadModule)132 if (! myConfig.bEnableReloadModule)
@@ -72,11 +138,9 @@
72 }138 }
73 else139 else
74 {140 {
75 //CairoDockInternalModule *pInternalModule = cairo_dock_find_internal_module_from_name (cModuleName);
76 GldiManager *pManager = gldi_get_manager (cModuleName);141 GldiManager *pManager = gldi_get_manager (cModuleName);
77 if (pManager != NULL)142 if (pManager != NULL)
78 {143 {
79 //cairo_dock_reload_internal_module (pInternalModule, g_cConfFile);
80 gldi_reload_manager (pManager, g_cConfFile);144 gldi_reload_manager (pManager, g_cConfFile);
81 }145 }
82 else146 else
@@ -96,9 +160,9 @@
96 CairoDockModule *pModule = cairo_dock_find_module_from_name (cModuleName);160 CairoDockModule *pModule = cairo_dock_find_module_from_name (cModuleName);
97 if (pModule == NULL)161 if (pModule == NULL)
98 {162 {
99 /*if (cairo_dock_find_internal_module_from_name (cModuleName) != NULL)163 if (gldi_get_manager (cModuleName) != NULL)
100 cd_warning ("Internal modules can't be (de)activated.");164 cd_warning ("Internal modules can't be (de)activated.");
101 else*/165 else
102 cd_warning ("no such module (%s)", cModuleName);166 cd_warning ("no such module (%s)", cModuleName);
103 return FALSE;167 return FALSE;
104 }168 }
@@ -110,86 +174,864 @@
110 return TRUE;174 return TRUE;
111}175}
112176
113gboolean cd_dbus_main_show_desklet(dbusMainObject *pDbusCallback, gboolean *widgetLayer, GError **error)177
114{178 //////////////////
115 if (! myConfig.bEnableDesklets)179 /// ICON QUERY ///
116 return FALSE;180//////////////////
117 if (dbus_deskletVisible)181
118 {182typedef struct {
119 cairo_dock_set_desklets_visibility_to_default ();183 const gchar *cType;
120 cairo_dock_show_xwindow (dbus_xLastActiveWindow);184 const gchar *cName;
121 }185 const gchar *cCommand;
122 else186 const gchar *cClass;
123 {187 const gchar *cContainerName;
124 dbus_xLastActiveWindow = cairo_dock_get_current_active_window ();188 Window Xid;
125 cairo_dock_set_all_desklets_visible (widgetLayer != NULL ? *widgetLayer : FALSE);189 const gchar *cDesktopFile;
126 }190 const gchar *cModuleName;
127 dbus_deskletVisible = !dbus_deskletVisible;191 gint iPosition;
128 return TRUE;192 gboolean bMatchAll;
129}193 GList *pMatchingIcons;
130194} CDIconQueryBuffer;
131static void _show_hide_one_dock (const gchar *cDockName, CairoDock *pDock, gpointer data)195static inline gboolean _strings_match (const gchar *q, const gchar *p) // query, parameter
132{196{
133 if (pDock->iRefCount != 0)197 if (!p)
134 return ;198 return (strcmp (q, "none") == 0);
135 gboolean bShow = GPOINTER_TO_INT (data);199 int n = strlen(q);
136 if (bShow)200 if (n != 0 && q[n-1] == '*') // ok with UTF-8 too.
137 {201 return (strncmp (q, p, n-1) == 0);
138 ///cairo_dock_pop_up (pDock);202 return (strcmp (q, p) == 0);
139 if (pDock->bAutoHide)203}
140 cairo_dock_emit_enter_signal (CAIRO_CONTAINER (pDock));204static inline gboolean _strings_match_case (const gchar *q, const gchar *p) // query, parameter
141 }205{
142 else206 if (!p)
143 {207 return (strcmp (q, "none") == 0);
144 ///cairo_dock_pop_down (pDock); // ne fait rien s'il n'etait pas "popped".208 int n = strlen(q);
145 if (pDock->bAutoHide)209 if (n != 0 && q[n-1] == '*')
146 cairo_dock_emit_leave_signal (CAIRO_CONTAINER (pDock));210 return (g_ascii_strncasecmp (q, p, n-1) == 0);
147 }211 return (g_ascii_strcasecmp (q, p) == 0);
148}212}
149gboolean cd_dbus_main_show_dock (dbusMainObject *pDbusCallback, gboolean bShow, GError **error)213static gboolean _icon_is_matching (Icon *pIcon, CairoContainer *pContainer, CDIconQueryBuffer *pQuery)
150{214{
151 if (! myConfig.bEnableShowDock)215 gboolean bOr = FALSE;
152 return FALSE;216 gboolean bAnd = TRUE; // at least 1 of the fields is not nul.
153 217 gboolean r;
154 if (bShow)218 if (pQuery->cType)
155 cairo_dock_stop_quick_hide ();219 {
156 220 const gchar *cType;
157 cairo_dock_foreach_docks ((GHFunc) _show_hide_one_dock, GINT_TO_POINTER (bShow));221 if (CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (pIcon))
158 222 cType = "Launcher";
159 if (! bShow)223 else if (CAIRO_DOCK_ICON_TYPE_IS_APPLI (pIcon))
160 cairo_dock_quick_hide_all_docks ();224 cType = "Application";
161 225 else if (CAIRO_DOCK_ICON_TYPE_IS_APPLET (pIcon))
162 return TRUE;226 cType = "Applet";
163}227 else if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
164228 cType = "Separator";
165gboolean cd_dbus_main_create_launcher_from_scratch (dbusMainObject *pDbusCallback, const gchar *cIconFile, const gchar *cLabel, const gchar *cCommand, const gchar *cParentDockName, GError **error)229 else if (CAIRO_DOCK_ICON_TYPE_IS_CONTAINER (pIcon))
166{230 cType = "Container";
167 if (! myConfig.bEnableCreateLauncher)231 else if (CAIRO_DOCK_ICON_TYPE_IS_CLASS_CONTAINER (pIcon))
168 return FALSE;232 cType = "Class-Container";
169 233 else
170 nullify_argument (cParentDockName);234 cType = "Other";
171 if (cParentDockName == NULL)235 r = (strcmp (pQuery->cType, cType) == 0);
172 cParentDockName = CAIRO_DOCK_MAIN_DOCK_NAME;236 bOr |= r;
237 bAnd &= r;
238 }
239 if (pQuery->cName)
240 {
241 r = _strings_match (pQuery->cName, pIcon->cName);
242 bOr |= r;
243 bAnd &= r;
244 }
245 if (pQuery->cCommand)
246 {
247 r = _strings_match (pQuery->cCommand, pIcon->cCommand);
248 bOr |= r;
249 bAnd &= r;
250 }
251 if (pQuery->cClass)
252 {
253 r = _strings_match_case (pQuery->cClass, pIcon->cClass);
254 bOr |= r;
255 bAnd &= r;
256 }
257 if (pQuery->cContainerName)
258 {
259 const gchar *cContainerName = NULL;
260 if (CAIRO_DOCK_IS_DOCK (pContainer))
261 cContainerName = pIcon->cParentDockName;
262 else if (CAIRO_DOCK_IS_DESKLET (pContainer))
263 {
264 Icon *pMainIcon = CAIRO_DESKLET (pContainer)->pIcon;
265 if (CAIRO_DOCK_IS_APPLET (pMainIcon))
266 cContainerName = pMainIcon->pModuleInstance->pModule->pVisitCard->cModuleName;
267 }
268 r = _strings_match (pQuery->cContainerName, cContainerName);
269 bOr |= r;
270 bAnd &= r;
271 }
272 if (pQuery->Xid != 0)
273 {
274 r = (pIcon->Xid == pQuery->Xid);
275 bOr |= r;
276 bAnd &= r;
277 }
278 if (pQuery->cDesktopFile)
279 {
280 r = _strings_match (pQuery->cDesktopFile, pIcon->cDesktopFileName);
281 if (!r && CAIRO_DOCK_IS_APPLET (pIcon) && pIcon->pModuleInstance->cConfFilePath)
282 {
283 if (*pQuery->cDesktopFile == '/') // query the complete path.
284 {
285 r = _strings_match (pQuery->cDesktopFile, pIcon->pModuleInstance->cConfFilePath);
286 }
287 else // query the file name only.
288 {
289 gchar *str = strrchr (pIcon->pModuleInstance->cConfFilePath, '/');
290 if (str)
291 r = _strings_match (pQuery->cDesktopFile, str+1);
292 }
293 }
294 bOr |= r;
295 bAnd &= r;
296 }
297 if (pQuery->cModuleName)
298 {
299 r = (CAIRO_DOCK_IS_APPLET (pIcon) && _strings_match (pQuery->cModuleName, pIcon->pModuleInstance->pModule->pVisitCard->cModuleName));
300 bOr |= r;
301 bAnd &= r;
302 }
303
304 return ((pQuery->bMatchAll && bAnd) || (!pQuery->bMatchAll && bOr));
305}
306static void _check_icon_matching (Icon *pIcon, CairoContainer *pContainer, CDIconQueryBuffer *pQuery)
307{
308 if (_icon_is_matching (pIcon, pContainer, pQuery))
309 pQuery->pMatchingIcons = g_list_prepend (pQuery->pMatchingIcons, pIcon);
310}
311static void _get_icon_at_position_in_dock (const gchar *cDockName, CairoDock *pDock, CDIconQueryBuffer *pQuery)
312{
313 Icon *pIcon = g_list_nth_data (pDock->icons, pQuery->iPosition);
314 if (pIcon != NULL)
315 pQuery->pMatchingIcons = g_list_prepend (pQuery->pMatchingIcons, pIcon);
316}
317static gboolean _get_icon_at_position_in_desklet (CairoDesklet *pDesklet, CDIconQueryBuffer *pQuery)
318{
319 Icon *pIcon = g_list_nth_data (pDesklet->icons, pQuery->iPosition);
320 if (pIcon != NULL)
321 pQuery->pMatchingIcons = g_list_prepend (pQuery->pMatchingIcons, pIcon);
322 return FALSE; // don't stop.
323}
324static gboolean _prepare_query (CDIconQueryBuffer *pQuery, const gchar *cKey, const gchar *cValue)
325{
326 g_return_val_if_fail (cKey != NULL, FALSE);
327 if (cValue == NULL) // use "none" keyword to look for "icons that don't have key".
328 return FALSE;
329
330 if (strcmp (cKey, "name") == 0 || strcmp (cKey, "label") == 0)
331 pQuery->cName = cValue;
332 else if (strcmp (cKey, "command") == 0)
333 pQuery->cCommand = cValue;
334 else if (strcmp (cKey, "class") == 0)
335 pQuery->cClass = cValue;
336 else if (strcmp (cKey, "container") == 0)
337 pQuery->cContainerName = cValue;
338 else if (strcmp (cKey, "Xid") == 0)
339 pQuery->Xid = strtol(cValue, NULL, 0); // can read hexa, decimal or octal.
340 else if (strcmp (cKey, "config-file") == 0)
341 pQuery->cDesktopFile = cValue;
342 else if (strcmp (cKey, "module") == 0)
343 pQuery->cModuleName = cValue;
344 else if (strcmp (cKey, "position") == 0)
345 pQuery->iPosition = atoi (cValue);
346 else if (strcmp (cKey, "type") == 0)
347 pQuery->cType = cValue;
348 else
349 {
350 cd_warning ("wrong key (%s)", cKey);
351 return FALSE;
352 }
353 return TRUE;
354}
355static GList *_find_matching_icons_for_key (const gchar *cKey, const gchar *cValue)
356{
357 //g_print (" %s (%s, %s)\n", __func__, cKey, cValue);
358 CDIconQueryBuffer query;
359 memset (&query, 0, sizeof (CDIconQueryBuffer));
360 query.iPosition = -1;
361 query.bMatchAll = TRUE;
362
363 gboolean bValidQuery = _prepare_query (&query, cKey, cValue);
364 g_return_val_if_fail (bValidQuery, NULL);
365
366 if (query.iPosition >= 0)
367 {
368 cairo_dock_foreach_docks ((GHFunc) _get_icon_at_position_in_dock, &query);
369 cairo_dock_foreach_desklet ((CairoDockForeachDeskletFunc) _get_icon_at_position_in_desklet, &query);
370 }
371 else
372 {
373 cairo_dock_foreach_icons ((CairoDockForeachIconFunc) _check_icon_matching, &query);
374 }
375 return query.pMatchingIcons;
376}
377static GList *_find_matching_icons_for_test (gchar *cTest)
378{
379 g_return_val_if_fail (cTest != NULL, NULL);
380 //g_print (" %s (%s)\n", __func__, cTest);
381
382 gchar *str = strchr (cTest, '=');
383 g_return_val_if_fail (str != NULL, NULL);
384
385 *str = '\0';
386 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)
387 gchar *cValue = g_strstrip (str+1);
388
389 return _find_matching_icons_for_key (cKey, cValue);
390}
391static GList *_merge (GList *pList1, GList *pList2)
392{
393 //g_print ("%s ()\n", __func__);
394 GList *pList = NULL;
395 GList *ic;
396 Icon *pIcon;
397 for (ic = pList1; ic != NULL; ic = ic->next)
398 {
399 pIcon = ic->data;
400 if (g_list_find (pList2, pIcon) != NULL)
401 pList = g_list_prepend (pList, pIcon);
402 }
403 g_list_free (pList1);
404 g_list_free (pList2);
405 return pList;
406}
407static GList *_concat (GList *pList1, GList *pList2)
408{
409 //g_print ("%s ()\n", __func__);
410 GList *pList = g_list_copy (pList2);
411 GList *ic;
412 Icon *pIcon;
413 for (ic = pList1; ic != NULL; ic = ic->next)
414 {
415 pIcon = ic->data;
416 if (!g_list_find (pList2, pIcon))
417 pList = g_list_prepend (pList, pIcon);
418 }
419 g_list_free (pList1);
420 g_list_free (pList2);
421 return pList;
422}
423GList *cd_dbus_find_matching_icons (gchar *cQuery)
424{
425 g_return_val_if_fail (cQuery != NULL, NULL);
426 //g_print ("%s (%s)\n", __func__, cQuery);
427
428 gchar *str;
429 str = strchr (cQuery, '|'); // a && b || c && d <=> (a && b) || (c && d)
430 if (str)
431 {
432 *str = '\0';
433 GList *pList1 = cd_dbus_find_matching_icons (cQuery);
434 GList *pList2 = cd_dbus_find_matching_icons (str+1);
435 return _concat (pList1, pList2);
436 }
437 str = strchr (cQuery, '&');
438 if (str)
439 {
440 *str = '\0';
441 GList *pList1 = cd_dbus_find_matching_icons (cQuery);
442 GList *pList2 = cd_dbus_find_matching_icons (str+1);
443 return _merge (pList1, pList2);
444 }
445 return _find_matching_icons_for_test (cQuery);
446}
447
448
449gboolean cd_dbus_main_get_icon_properties (dbusMainObject *pDbusCallback, gchar *cIconQuery, GPtrArray **pIconAttributes, GError **error)
450{
451 GList *pList = cd_dbus_find_matching_icons (cIconQuery); // if NULL, will just return an empty array.
452
453 GPtrArray *pTab = g_ptr_array_new ();
454 *pIconAttributes = pTab;
455
456 GHashTable *h;
457 GValue *v;
458 Icon *pIcon;
459 CairoContainer *pContainer;
460 int iPosition;
461 const gchar *cType;
462 const gchar *cContainerName;
463 const gchar *cDesktopFile;
464 GList *ic;
465 for (ic = pList; ic != NULL; ic = ic->next)
466 {
467 pIcon = ic->data;
468 pContainer = cairo_dock_search_container_from_icon (pIcon);
469
470 h = g_hash_table_new_full (g_str_hash,
471 g_str_equal,
472 g_free, /// can we use const char here instead of duplicating each string ?...
473 g_free);
474 g_ptr_array_add (pTab, h);
475
476 if (CAIRO_DOCK_ICON_TYPE_IS_LAUNCHER (pIcon))
477 cType = "Launcher";
478 else if (CAIRO_DOCK_ICON_TYPE_IS_APPLI (pIcon))
479 cType = "Application";
480 else if (CAIRO_DOCK_ICON_TYPE_IS_APPLET (pIcon))
481 cType = "Applet";
482 else if (CAIRO_DOCK_ICON_TYPE_IS_SEPARATOR (pIcon))
483 cType = "Separator";
484 else if (CAIRO_DOCK_ICON_TYPE_IS_CONTAINER (pIcon))
485 cType = "Container";
486 else if (CAIRO_DOCK_ICON_TYPE_IS_CLASS_CONTAINER (pIcon))
487 cType = "Class-Container";
488 else
489 cType = "Other";
490 v = g_new0 (GValue, 1);
491 g_value_init (v, G_TYPE_STRING);
492 g_value_set_string (v, cType);
493 g_hash_table_insert (h, g_strdup ("type"), v);
494
495 cDesktopFile = NULL;
496 if (pIcon->cDesktopFileName != NULL)
497 cDesktopFile = pIcon->cDesktopFileName;
498 else if (CAIRO_DOCK_IS_APPLET (pIcon))
499 cDesktopFile = pIcon->pModuleInstance->cConfFilePath;
500 v = g_new0 (GValue, 1);
501 g_value_init (v, G_TYPE_STRING);
502 g_value_set_string (v, cDesktopFile);
503 g_hash_table_insert (h, g_strdup ("config-file"), v);
504
505 if (CAIRO_DOCK_IS_APPLET (pIcon))
506 {
507 v = g_new0 (GValue, 1);
508 g_value_init (v, G_TYPE_STRING);
509 g_value_set_string (v, pIcon->pModuleInstance->pModule->pVisitCard->cModuleName);
510 g_hash_table_insert (h, g_strdup ("module"), v);
511 }
512
513 v = g_new0 (GValue, 1);
514 g_value_init (v, G_TYPE_STRING);
515 g_value_set_string (v, pIcon->cName); /// g_value_set_static_string ?...
516 g_hash_table_insert (h, g_strdup ("name"), v);
517
518 v = g_new0 (GValue, 1);
519 g_value_init (v, G_TYPE_STRING);
520 g_value_set_string (v, pIcon->cCommand);
521 g_hash_table_insert (h, g_strdup ("command"), v);
522
523 v = g_new0 (GValue, 1);
524 g_value_init (v, G_TYPE_STRING);
525 g_value_set_string (v, pIcon->cClass);
526 g_hash_table_insert (h, g_strdup ("class"), v);
527
528 v = g_new0 (GValue, 1);
529 g_value_init (v, G_TYPE_STRING);
530 g_value_set_string (v, pIcon->cFileName);
531 g_hash_table_insert (h, g_strdup ("icon"), v);
532
533 v = g_new0 (GValue, 1);
534 g_value_init (v, G_TYPE_STRING);
535 g_value_set_string (v, pIcon->cQuickInfo);
536 g_hash_table_insert (h, g_strdup ("quick-info"), v);
537
538 v = g_new0 (GValue, 1);
539 g_value_init (v, G_TYPE_UINT);
540 g_value_set_uint (v, pIcon->Xid);
541 g_hash_table_insert (h, g_strdup ("Xid"), v);
542
543 iPosition = -1;
544 cContainerName = NULL;
545 if (CAIRO_DOCK_IS_DOCK (pContainer))
546 {
547 CairoDock *pDock = CAIRO_DOCK (pContainer);
548 iPosition = g_list_index (pDock->icons, pIcon);
549 cContainerName = pIcon->cParentDockName;
550 }
551 else if (CAIRO_DOCK_IS_DESKLET (pContainer))
552 {
553 CairoDesklet *pDesklet = CAIRO_DESKLET (pContainer);
554 if (pDesklet->pIcon == pIcon)
555 iPosition = 0;
556 else
557 iPosition = g_list_index (pDesklet->icons, pIcon);
558 if (CAIRO_DOCK_IS_APPLET (pDesklet->pIcon))
559 cContainerName = pDesklet->pIcon->pModuleInstance->pModule->pVisitCard->cModuleName;
560 }
561 v = g_new0 (GValue, 1);
562 g_value_init (v, G_TYPE_INT);
563 g_value_set_int (v, iPosition);
564 g_hash_table_insert (h, g_strdup ("position"), v);
565
566 v = g_new0 (GValue, 1);
567 g_value_init (v, G_TYPE_STRING);
568 g_value_set_string (v, cContainerName);
569 g_hash_table_insert (h, g_strdup ("container"), v);
570
571 v = g_new0 (GValue, 1);
572 g_value_init (v, G_TYPE_DOUBLE);
573 g_value_set_double (v, pIcon->fOrder);
574 g_hash_table_insert (h, g_strdup ("order"), v);
575 }
576
577 g_list_free (pList);
578 return TRUE;
579}
580
581static void _set_container_props (CairoContainer *pContainer, GHashTable *h)
582{
583 GValue *v;
584 int x, y, w, ht;
585 if (pContainer->bIsHorizontal)
586 {
587 x = pContainer->iWindowPositionX;
588 y = pContainer->iWindowPositionY;
589 w = pContainer->iWidth;
590 ht = pContainer->iHeight;
591 }
592 else
593 {
594 y = pContainer->iWindowPositionX;
595 x = pContainer->iWindowPositionY;
596 ht = pContainer->iWidth;
597 w = pContainer->iHeight;
598 }
599 v = g_new0 (GValue, 1);
600 g_value_init (v, G_TYPE_INT);
601 g_value_set_int (v, pContainer->iWindowPositionX);
602 g_hash_table_insert (h, g_strdup ("x"), v);
603
604 v = g_new0 (GValue, 1);
605 g_value_init (v, G_TYPE_INT);
606 g_value_set_int (v, y);
607 g_hash_table_insert (h, g_strdup ("y"), v);
608
609 v = g_new0 (GValue, 1);
610 g_value_init (v, G_TYPE_INT);
611 g_value_set_int (v, w);
612 g_hash_table_insert (h, g_strdup ("width"), v);
613
614 v = g_new0 (GValue, 1);
615 g_value_init (v, G_TYPE_INT);
616 g_value_set_int (v, ht);
617 g_hash_table_insert (h, g_strdup ("height"), v);
618
619 CairoDockPositionType iScreenBorder = ((! pContainer->bIsHorizontal) << 1) | (! pContainer->bDirectionUp);
620 v = g_new0 (GValue, 1);
621 g_value_init (v, G_TYPE_UINT);
622 g_value_set_uint (v, iScreenBorder);
623 g_hash_table_insert (h, g_strdup ("orientation"), v);
624}
625static void _insert_dock_props (const gchar *cDockName, CairoDock *pDock, GPtrArray *pTab)
626{
627 GHashTable *h = g_hash_table_new_full (g_str_hash,
628 g_str_equal,
629 g_free, /// can we use const char here instead of duplicating each string ?...
630 g_free);
631 g_ptr_array_add (pTab, h);
632
633 GValue *v;
634
635 v = g_new0 (GValue, 1);
636 g_value_init (v, G_TYPE_STRING);
637 g_value_set_string (v, "Dock");
638 g_hash_table_insert (h, g_strdup ("type"), v);
639
640 v = g_new0 (GValue, 1);
641 g_value_init (v, G_TYPE_STRING);
642 g_value_set_string (v, cDockName);
643 g_hash_table_insert (h, g_strdup ("name"), v);
644
645 v = g_new0 (GValue, 1);
646 g_value_init (v, G_TYPE_BOOLEAN);
647 g_value_set_boolean (v, (pDock->iRefCount > 0));
648 g_hash_table_insert (h, g_strdup ("is-sub-dock"), v);
649
650 v = g_new0 (GValue, 1);
651 g_value_init (v, G_TYPE_INT);
652 g_value_set_int (v, g_list_length (pDock->icons));
653 g_hash_table_insert (h, g_strdup ("nb-icons"), v);
654
655 _set_container_props (CAIRO_CONTAINER (pDock), h);
656}
657static gboolean _insert_desklet_props (CairoDesklet *pDesklet, GPtrArray *pTab)
658{
659 GHashTable *h = g_hash_table_new_full (g_str_hash,
660 g_str_equal,
661 g_free, /// can we use const char here instead of duplicating each string ?...
662 g_free);
663 g_ptr_array_add (pTab, h);
664
665 GValue *v;
666
667 v = g_new0 (GValue, 1);
668 g_value_init (v, G_TYPE_STRING);
669 g_value_set_string (v, "Desklet");
670 g_hash_table_insert (h, g_strdup ("type"), v);
671
672 v = g_new0 (GValue, 1);
673 g_value_init (v, G_TYPE_STRING);
674 g_value_set_string (v, CAIRO_DOCK_IS_APPLET (pDesklet->pIcon) ? pDesklet->pIcon->pModuleInstance->pModule->pVisitCard->cModuleName : "");
675 g_hash_table_insert (h, g_strdup ("name"), v);
676
677 v = g_new0 (GValue, 1);
678 g_value_init (v, G_TYPE_INT);
679 g_value_set_int (v, 1 + g_list_length (pDesklet->icons));
680 g_hash_table_insert (h, g_strdup ("nb-icons"), v);
681
682 _set_container_props (CAIRO_CONTAINER (pDesklet), h);
683 return FALSE;
684}
685static gboolean _check_desklet_name (CairoDesklet *pDesklet, const gchar *cName)
686{
687 if (CAIRO_DOCK_IS_APPLET (pDesklet->pIcon))
688 {
689 return (strcmp (cName, pDesklet->pIcon->pModuleInstance->pModule->pVisitCard->cModuleName) == 0);
690 }
691 return FALSE;
692}
693gboolean cd_dbus_main_get_container_properties (dbusMainObject *pDbusCallback, const gchar *cName, GPtrArray **pAttributes, GError **error)
694{
695 nullify_argument (cName);
696
697 GPtrArray *pTab = g_ptr_array_new ();
698 *pAttributes = pTab;
699
700 if (cName == NULL)
701 {
702 cairo_dock_foreach_docks ((GHFunc)_insert_dock_props, pTab);
703 cairo_dock_foreach_desklet ((CairoDockForeachDeskletFunc) _insert_desklet_props, pTab);
704 }
705 else
706 {
707 CairoDock *pDock = cairo_dock_search_dock_from_name (cName);
708 if (pDock != NULL)
709 {
710 _insert_dock_props (cName, pDock, pTab);
711 }
712 else
713 {
714 CairoDesklet *pDesklet = cairo_dock_foreach_desklet ((CairoDockForeachDeskletFunc) _check_desklet_name, (gpointer)cName);
715 if (pDesklet != NULL)
716 {
717 _insert_desklet_props (pDesklet, pTab);
718 }
719 }
720 }
721
722 return TRUE;
723}
724
725static gboolean _insert_module_props (CairoDockModule *pModule, GPtrArray *pTab)
726{
727 GHashTable *h = g_hash_table_new_full (g_str_hash,
728 g_str_equal,
729 g_free, /// can we use const char here instead of duplicating each string ?...
730 g_free);
731 g_ptr_array_add (pTab, h);
732
733 GValue *v;
734
735 v = g_new0 (GValue, 1);
736 g_value_init (v, G_TYPE_STRING);
737 g_value_set_string (v, pModule->pVisitCard->cModuleName);
738 g_hash_table_insert (h, g_strdup ("name"), v);
739
740 v = g_new0 (GValue, 1);
741 g_value_init (v, G_TYPE_UINT);
742 g_value_set_uint (v, pModule->pVisitCard->iContainerType);
743 g_hash_table_insert (h, g_strdup ("type"), v);
744
745 v = g_new0 (GValue, 1);
746 g_value_init (v, G_TYPE_UINT);
747 g_value_set_uint (v, pModule->pVisitCard->iCategory);
748 g_hash_table_insert (h, g_strdup ("category"), v);
749
750 v = g_new0 (GValue, 1);
751 g_value_init (v, G_TYPE_STRING);
752 g_value_set_string (v, pModule->pVisitCard->cTitle);
753 g_hash_table_insert (h, g_strdup ("title"), v);
754
755 v = g_new0 (GValue, 1);
756 g_value_init (v, G_TYPE_STRING);
757 g_value_set_string (v, pModule->pVisitCard->cIconFilePath);
758 g_hash_table_insert (h, g_strdup ("icon"), v);
759
760 v = g_new0 (GValue, 1);
761 g_value_init (v, G_TYPE_STRING);
762 g_value_set_string (v, pModule->pVisitCard->cPreviewFilePath);
763 g_hash_table_insert (h, g_strdup ("preview"), v);
764
765 v = g_new0 (GValue, 1);
766 g_value_init (v, G_TYPE_STRING);
767 g_value_set_string (v, dgettext (pModule->pVisitCard->cGettextDomain, pModule->pVisitCard->cDescription));
768 g_hash_table_insert (h, g_strdup ("description"), v);
769
770 v = g_new0 (GValue, 1);
771 g_value_init (v, G_TYPE_STRING);
772 g_value_set_string (v, pModule->pVisitCard->cAuthor);
773 g_hash_table_insert (h, g_strdup ("author"), v);
774
775 v = g_new0 (GValue, 1);
776 g_value_init (v, G_TYPE_BOOLEAN);
777 g_value_set_boolean (v, pModule->pVisitCard->bMultiInstance);
778 g_hash_table_insert (h, g_strdup ("is-multi-instance"), v);
779
780 g_print ("list instances ...\n");
781 gchar **pInstances = g_new0 (gchar*, g_list_length (pModule->pInstancesList)+1);
782 CairoDockModuleInstance *pInstance;
783 int i = 0;
784 GList *mi;
785 for (mi = pModule->pInstancesList; mi != NULL; mi = mi->next)
786 {
787 pInstance = mi->data;
788 pInstances[i++] = g_strdup (pInstance->cConfFilePath);
789 }
790 g_print ("write instances ...\n");
791 v = g_new0 (GValue, 1);
792 g_value_init (v, G_TYPE_STRV);
793 g_value_set_boxed (v, pInstances);
794 g_hash_table_insert (h, g_strdup ("instances"), v);
795 g_print ("done.\n");
796 return TRUE; // continue
797}
798gboolean cd_dbus_main_get_module_properties (dbusMainObject *pDbusCallback, const gchar *cName, GPtrArray **pAttributes, GError **error)
799{
800 nullify_argument (cName);
801
802 GPtrArray *pTab = g_ptr_array_new ();
803 *pAttributes = pTab;
804
805 if (cName == NULL)
806 {
807 cairo_dock_foreach_module_in_alphabetical_order ((GCompareFunc) _insert_module_props, pTab);
808 }
809 else
810 {
811 CairoDockModule *pModule = cairo_dock_find_module_from_name (cName);
812 if (pModule != NULL)
813 {
814 _insert_module_props (pModule, pTab);
815 }
816 }
817 return TRUE;
818}
819
820gboolean cd_dbus_main_add_launcher (dbusMainObject *pDbusCallback, const gchar *cDesktopFilePath, gdouble fOrder, const gchar *cDockName, gchar **cLauncherFile, GError **error)
821{
822 *cLauncherFile = NULL;
823 if (! myConfig.bEnableCreateLauncher)
824 return FALSE;
825 g_return_val_if_fail (cDesktopFilePath != NULL, FALSE);
826
827 //\_______________ get the dock where to insert the icon.
828 nullify_argument (cDockName);
829 if (cDockName == NULL)
830 cDockName = CAIRO_DOCK_MAIN_DOCK_NAME;
831
832 CairoDock * pParentDock = cairo_dock_search_dock_from_name (cDockName);
833 if (pParentDock == NULL)
834 {
835 cd_warning ("dock %s does not exist", cDockName);
836 pParentDock = g_pMainDock;
837 }
838
839 //\_______________ add a new icon in the current theme.
840 int iLauncherType = -1;
841 if (strcmp (cDesktopFilePath, "separator.desktop") == 0)
842 iLauncherType = CAIRO_DOCK_DESKTOP_FILE_FOR_SEPARATOR;
843 else if (strcmp (cDesktopFilePath, "container.desktop") == 0)
844 iLauncherType = CAIRO_DOCK_DESKTOP_FILE_FOR_CONTAINER;
845 else if (strcmp (cDesktopFilePath, "launcher.desktop") == 0)
846 iLauncherType = CAIRO_DOCK_DESKTOP_FILE_FOR_LAUNCHER;
847
848 if (fOrder < 0)
849 fOrder = CAIRO_DOCK_LAST_ORDER;
850 Icon *pNewIcon;
851 if (iLauncherType != -1)
852 pNewIcon = cairo_dock_add_new_launcher_by_type (iLauncherType, pParentDock, fOrder, CAIRO_DOCK_LAUNCHER);
853 else
854 pNewIcon = cairo_dock_add_new_launcher_by_uri (cDesktopFilePath, pParentDock, fOrder);
855 if (pNewIcon != NULL)
856 {
857 *cLauncherFile = g_strdup (pNewIcon->cDesktopFileName);
858 return TRUE;
859 }
860 else
861 return FALSE;
862}
863
864gboolean cd_dbus_main_add_temporary_icon (dbusMainObject *pDbusCallback, GHashTable *hIconAttributes, GError **error)
865{
866 if (! myConfig.bEnableCreateLauncher)
867 return FALSE;
868
869 g_return_val_if_fail (hIconAttributes != NULL, FALSE);
870
871 //\_______________ get the attributes.
872 GValue *v;
873 const gchar *cType = "Launcher";
874 v = g_hash_table_lookup (hIconAttributes, "type");
875 if (v && G_VALUE_HOLDS_STRING (v))
876 {
877 cType = g_value_get_string (v);
878 }
879
880 const gchar *cIcon = NULL;
881 v = g_hash_table_lookup (hIconAttributes, "icon");
882 if (v && G_VALUE_HOLDS_STRING (v))
883 {
884 cIcon = g_value_get_string (v);
885 }
886
887 const gchar *cName = NULL;
888 v = g_hash_table_lookup (hIconAttributes, "name");
889 if (!v)
890 v = g_hash_table_lookup (hIconAttributes, "label");
891 if (v && G_VALUE_HOLDS_STRING (v))
892 {
893 cName = g_value_get_string (v);
894 }
895
896 const gchar *cParentDockName = CAIRO_DOCK_MAIN_DOCK_NAME;
897 v = g_hash_table_lookup (hIconAttributes, "container");
898 if (v && G_VALUE_HOLDS_STRING (v))
899 {
900 cParentDockName = g_value_get_string (v);
901 }
902
903 const gchar *cQuickInfo = NULL;
904 v = g_hash_table_lookup (hIconAttributes, "quick-info");
905 if (v && G_VALUE_HOLDS_STRING (v))
906 {
907 cQuickInfo = g_value_get_string (v);
908 }
909
910 double fOrder = CAIRO_DOCK_LAST_ORDER;
911 v = g_hash_table_lookup (hIconAttributes, "order");
912 if (v && G_VALUE_HOLDS_DOUBLE (v))
913 {
914 fOrder = g_value_get_double (v);
915 }
916
917 int iPosition = -1;
918 v = g_hash_table_lookup (hIconAttributes, "position");
919 if (v && G_VALUE_HOLDS_INT (v))
920 {
921 iPosition = g_value_get_int (v);
922 }
923
924 const gchar *cCommand = NULL;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches