mirror of
https://github.com/dguglielmi/sunny-overlay.git
synced 2025-12-06 18:12:39 +01:00
- Add x11-misc/cairo-dock-3.3.2 & x11-plugins/cairo-dock-plugins-3.3.2
This commit is contained in:
@@ -0,0 +1,112 @@
|
||||
--- cairo-dock-plugins-3.3.2/CMakeLists.txt.upower0 2013-10-29 19:27:30.000000000 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/CMakeLists.txt 2014-06-16 14:00:42.543802818 +0900
|
||||
@@ -152,6 +152,14 @@
|
||||
set (shared_filesdatadir "${pluginsdatadir}/shared-files")
|
||||
add_subdirectory (shared-files)
|
||||
|
||||
+
|
||||
+
|
||||
+################################################################################
|
||||
+# STATIC LIBS AND DEPENDENCES USED BY MORE THAN ONE PLUG-IN #
|
||||
+################################################################################
|
||||
+
|
||||
+
|
||||
+
|
||||
############# STATIC LIBRARIES ################
|
||||
message (STATUS "> Static Libraries:")
|
||||
|
||||
@@ -337,6 +345,29 @@
|
||||
endif()
|
||||
endif()
|
||||
|
||||
+############# UPOWER #####################
|
||||
+message (STATUS "> UPower:")
|
||||
+enable_if_not_defined (enable-upower-support)
|
||||
+if (enable-upower-support)
|
||||
+ pkg_check_modules (UPOWER upower-glib) # useful for Powermanager too.
|
||||
+endif()
|
||||
+if (UPOWER_FOUND)
|
||||
+ set (with_upower_support yes)
|
||||
+ STRING (REGEX REPLACE "\\..*" "" UPOWER_MAJOR "${UPOWER_VERSION}") # 2.28.3 => 2
|
||||
+ STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" UPOWER_MINOR "${UPOWER_VERSION}") # 2.28.3 => 2.28
|
||||
+ STRING (REGEX REPLACE "\\.[0-9]*" "" UPOWER_MINOR "${UPOWER_MINOR}") # 2.28 => 28
|
||||
+ if (${UPOWER_MAJOR} GREATER 0 OR ${UPOWER_MINOR} GREATER 89)
|
||||
+ message (STATUS " Your version of UPower no longer supports logout features")
|
||||
+ else()
|
||||
+ set (UPOWER_SUPPORTS_LOGOUT 1)
|
||||
+ endif()
|
||||
+else()
|
||||
+ set (with_upower_support no)
|
||||
+ message (STATUS "Could not find upower-glib; Logout and PowerManager plugin won't be built with UPower support.")
|
||||
+ message (WARNING "This module is required to compile LogOut and PowerManager applet with UPower support: upower-glib")
|
||||
+ set (MODULES_MISSING "${MODULES_MISSING} upower-glib")
|
||||
+endif()
|
||||
+
|
||||
############# DISTRIBUTION #################
|
||||
message (STATUS "> Distribution:")
|
||||
# We try to detect if the user is on Ubuntu to know which bus we have to use...
|
||||
@@ -965,18 +996,6 @@
|
||||
|
||||
############# LOGOUT #################
|
||||
message (STATUS "> Logout:")
|
||||
-enable_if_not_defined (enable-upower-support)
|
||||
-if (enable-upower-support)
|
||||
- pkg_check_modules (UPOWER upower-glib) # useful for Powermanager too.
|
||||
-endif()
|
||||
-if (UPOWER_FOUND)
|
||||
- set (with_upower_support yes)
|
||||
-else()
|
||||
- set (with_upower_support no)
|
||||
- message (STATUS "Could not find upower-glib; Logout and PowerManager plugin won't be built with UPower support.")
|
||||
- message (WARNING "This module is required to compile LogOut and PowerManager applet with UPower support: upower-glib")
|
||||
- set (MODULES_MISSING "${MODULES_MISSING} upower-glib")
|
||||
-endif()
|
||||
set (GETTEXT_LOGOUT ${GETTEXT_PLUGINS})
|
||||
set (VERSION_LOGOUT "2.0.3")
|
||||
set (PACKAGE_LOGOUT "cd-logout")
|
||||
--- cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt.upower0 2013-10-03 20:04:33.000000000 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt 2014-06-16 14:01:03.155216380 +0900
|
||||
@@ -20,22 +20,29 @@
|
||||
add_definitions (-DMY_APPLET_GETTEXT_DOMAIN="${GETTEXT_LOGOUT}")
|
||||
add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}")
|
||||
add_definitions (-DMY_APPLET_ICON_FILE="icon.svg")
|
||||
-if (${UPOWER_FOUND})
|
||||
- add_definitions (-DCD_UPOWER_AVAILABLE="1")
|
||||
-endif()
|
||||
|
||||
+if (UPOWER_SUPPORTS_LOGOUT)
|
||||
+ add_definitions (-DCD_UPOWER_AVAILABLE="1")
|
||||
+
|
||||
+ include_directories (
|
||||
+ ${UPOWER_INCLUDE_DIRS}
|
||||
+ ${PACKAGE_INCLUDE_DIRS})
|
||||
+
|
||||
+ link_directories (
|
||||
+ ${UPOWER_LIBRARY_DIRS}
|
||||
+ ${PACKAGE_LIBRARY_DIRS})
|
||||
+
|
||||
+ target_link_libraries (${PACKAGE_LOGOUT}
|
||||
+ ${UPOWER_LIBRARIES}
|
||||
+ ${PACKAGE_LIBRARIES})
|
||||
+else()
|
||||
+ include_directories (${PACKAGE_INCLUDE_DIRS})
|
||||
|
||||
-include_directories (
|
||||
- ${UPOWER_INCLUDE_DIRS}
|
||||
- ${PACKAGE_INCLUDE_DIRS})
|
||||
-
|
||||
-link_directories (
|
||||
- ${UPOWER_LIBRARY_DIRS}
|
||||
- ${PACKAGE_LIBRARY_DIRS})
|
||||
-
|
||||
-target_link_libraries (${PACKAGE_LOGOUT}
|
||||
- ${UPOWER_LIBRARIES}
|
||||
- ${PACKAGE_LIBRARIES})
|
||||
+ link_directories (${PACKAGE_LIBRARY_DIRS})
|
||||
+
|
||||
+ target_link_libraries (${PACKAGE_LOGOUT}
|
||||
+ ${PACKAGE_LIBRARIES})
|
||||
+endif()
|
||||
|
||||
########### install files ###############
|
||||
|
||||
@@ -0,0 +1,204 @@
|
||||
--- cairo-dock-plugins-3.3.2/CMakeLists.txt.upower1 2014-06-16 14:01:49.819680691 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/CMakeLists.txt 2014-06-16 14:01:49.821680926 +0900
|
||||
@@ -357,9 +357,10 @@
|
||||
STRING (REGEX REPLACE "[0-9]*\\.([^ ]+)" "\\1" UPOWER_MINOR "${UPOWER_VERSION}") # 2.28.3 => 2.28
|
||||
STRING (REGEX REPLACE "\\.[0-9]*" "" UPOWER_MINOR "${UPOWER_MINOR}") # 2.28 => 28
|
||||
if (${UPOWER_MAJOR} GREATER 0 OR ${UPOWER_MINOR} GREATER 89)
|
||||
- message (STATUS " Your version of UPower no longer supports logout features")
|
||||
+ message (STATUS " Your version of UPower no longer supports suspend/hibernate features")
|
||||
+ set (with_upower_support "yes (0.99+)")
|
||||
else()
|
||||
- set (UPOWER_SUPPORTS_LOGOUT 1)
|
||||
+ set (UPOWER_SUPPORTS_SUSPEND_HIBERNATE 1)
|
||||
endif()
|
||||
else()
|
||||
set (with_upower_support no)
|
||||
--- cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt.upower1 2014-06-16 14:01:49.822681043 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/logout/src/CMakeLists.txt 2014-06-16 14:02:34.010855358 +0900
|
||||
@@ -21,7 +21,7 @@
|
||||
add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}")
|
||||
add_definitions (-DMY_APPLET_ICON_FILE="icon.svg")
|
||||
|
||||
-if (UPOWER_SUPPORTS_LOGOUT)
|
||||
+if (UPOWER_SUPPORTS_SUSPEND_HIBERNATE)
|
||||
add_definitions (-DCD_UPOWER_AVAILABLE="1")
|
||||
|
||||
include_directories (
|
||||
--- cairo-dock-plugins-3.3.2/powermanager/src/CMakeLists.txt.upower1 2013-10-03 20:04:33.000000000 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/powermanager/src/CMakeLists.txt 2014-06-16 14:01:49.822681043 +0900
|
||||
@@ -25,7 +25,10 @@
|
||||
add_definitions (-DMY_APPLET_DOCK_VERSION="${dock_version}")
|
||||
add_definitions (-DMY_APPLET_ICON_FILE="icon.png")
|
||||
if (${UPOWER_FOUND})
|
||||
- add_definitions (-DCD_UPOWER_AVAILABLE="1")
|
||||
+ add_definitions (-DCD_UPOWER_AVAILABLE=1)
|
||||
+ if (NOT UPOWER_SUPPORTS_SUSPEND_HIBERNATE)
|
||||
+ add_definitions (-DCD_UPOWER_0_99=1)
|
||||
+ endif()
|
||||
endif()
|
||||
|
||||
include_directories (
|
||||
--- cairo-dock-plugins-3.3.2/powermanager/src/powermanager-menu-functions.c.upower1 2013-10-03 20:04:33.000000000 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-menu-functions.c 2014-06-16 14:01:49.822681043 +0900
|
||||
@@ -90,19 +90,5 @@
|
||||
|
||||
if (bAddSeparator)
|
||||
CD_APPLET_ADD_SEPARATOR_IN_MENU (CD_APPLET_MY_MENU);
|
||||
-
|
||||
- // Power actions (Hibernate/Suspend)
|
||||
- #ifdef CD_UPOWER_AVAILABLE // if Upower is available, we should be able to suspend; if not, then it's probably just a problem with consolekit, which should be fixed by the user; so show the items to give the user a hint about the problem.
|
||||
- pMenuItem = CD_APPLET_ADD_IN_MENU (D_("Hibernate"), cd_power_hibernate, CD_APPLET_MY_MENU);
|
||||
- if (! cd_power_can_hibernate ())
|
||||
- gtk_widget_set_sensitive (pMenuItem, FALSE);
|
||||
- pMenuItem = CD_APPLET_ADD_IN_MENU (D_("Suspend"), cd_power_suspend, CD_APPLET_MY_MENU);
|
||||
- if (! cd_power_can_suspend ())
|
||||
- gtk_widget_set_sensitive (pMenuItem, FALSE);
|
||||
- #else
|
||||
- if (cd_power_can_hibernate ())
|
||||
- CD_APPLET_ADD_IN_MENU (D_("Hibernate"), cd_power_hibernate, CD_APPLET_MY_MENU);
|
||||
- if (cd_power_can_suspend ())
|
||||
- CD_APPLET_ADD_IN_MENU (D_("Suspend"), cd_power_suspend, CD_APPLET_MY_MENU);
|
||||
- #endif
|
||||
+
|
||||
CD_APPLET_ON_BUILD_MENU_END
|
||||
--- cairo-dock-plugins-3.3.2/powermanager/src/powermanager-struct.h.upower1 2013-10-03 20:04:33.000000000 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-struct.h 2014-06-16 14:01:49.823681160 +0900
|
||||
@@ -22,10 +22,6 @@
|
||||
|
||||
#include <cairo-dock.h>
|
||||
#ifdef CD_UPOWER_AVAILABLE
|
||||
-/* to access suspend/resume functionality on Upower 0.9
|
||||
- * even if we use first logind, we only use logind via DBus
|
||||
- */
|
||||
-#define UPOWER_ENABLE_DEPRECATED
|
||||
#include <upower.h>
|
||||
#endif
|
||||
|
||||
--- cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.c.upower1 2013-10-03 20:04:33.000000000 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.c 2014-06-16 14:01:49.823681160 +0900
|
||||
@@ -48,7 +48,11 @@
|
||||
UpClient *pUPowerClient = up_client_new ();
|
||||
|
||||
// get the list of devices.
|
||||
- if (pUPowerClient == NULL || ! up_client_enumerate_devices_sync (pUPowerClient, NULL, NULL))
|
||||
+ if (pUPowerClient == NULL
|
||||
+ #ifndef CD_UPOWER_0_99 // no longer available with UPower 0.99+
|
||||
+ || ! up_client_enumerate_devices_sync (pUPowerClient, NULL, NULL)
|
||||
+ #endif
|
||||
+ )
|
||||
{
|
||||
cd_warning ("couldn't get devices from UPower daemon");
|
||||
if (pUPowerClient)
|
||||
@@ -182,6 +186,7 @@
|
||||
CD_APPLET_LEAVE ();
|
||||
}
|
||||
|
||||
+#ifndef CD_UPOWER_0_99 // no longer used with UPower 0.99+
|
||||
static void _on_device_changed (G_GNUC_UNUSED UpDevice *pDevice, G_GNUC_UNUSED gpointer data)
|
||||
{
|
||||
CD_APPLET_ENTER;
|
||||
@@ -194,6 +199,7 @@
|
||||
update_icon ();
|
||||
CD_APPLET_LEAVE ();
|
||||
}
|
||||
+#endif
|
||||
|
||||
// Can be launched the first time (with the Task) or when a device is added/removed after.
|
||||
static gboolean _cd_upower_update_state (CDSharedMemory *pSharedMemory)
|
||||
@@ -248,6 +254,7 @@
|
||||
g_free (cVendor);
|
||||
g_free (cModel);
|
||||
|
||||
+ #ifndef CD_UPOWER_0_99 // no longer used with UPower 0.99+
|
||||
if (myData.pTask != NULL // only the first time
|
||||
|| myData.pBatteryDeviceList == NULL // or if it's a new device
|
||||
|| g_list_find (myData.pBatteryDeviceList, pDevice) == NULL)
|
||||
@@ -262,6 +269,7 @@
|
||||
iSignalID = g_signal_connect (pDevice, "changed", G_CALLBACK (_on_device_changed), NULL);
|
||||
myData.pSignalIDList = g_list_append (myData.pSignalIDList, GINT_TO_POINTER (iSignalID));
|
||||
}
|
||||
+ #endif
|
||||
|
||||
bFirst = FALSE;
|
||||
}
|
||||
@@ -364,38 +372,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
-gboolean cd_power_hibernate (void)
|
||||
-{
|
||||
- if (myData.pUPowerClient != NULL)
|
||||
- return up_client_hibernate_sync (myData.pUPowerClient, NULL, NULL);
|
||||
- else
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
-gboolean cd_power_suspend (void)
|
||||
-{
|
||||
- if (myData.pUPowerClient != NULL)
|
||||
- return up_client_suspend_sync (myData.pUPowerClient, NULL, NULL);
|
||||
- else
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
-gboolean cd_power_can_hibernate (void)
|
||||
-{
|
||||
- if (myData.pUPowerClient != NULL)
|
||||
- return up_client_get_can_hibernate (myData.pUPowerClient);
|
||||
- else
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
-gboolean cd_power_can_suspend (void)
|
||||
-{
|
||||
- if (myData.pUPowerClient != NULL)
|
||||
- return up_client_get_can_suspend (myData.pUPowerClient);
|
||||
- else
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
#else // code without libupower
|
||||
|
||||
void cd_powermanager_start (void)
|
||||
@@ -408,24 +384,4 @@
|
||||
|
||||
}
|
||||
|
||||
-gboolean cd_power_hibernate (void)
|
||||
-{
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
-gboolean cd_power_suspend (void)
|
||||
-{
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
-gboolean cd_power_can_hibernate (void)
|
||||
-{
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
-gboolean cd_power_can_suspend (void)
|
||||
-{
|
||||
- return FALSE;
|
||||
-}
|
||||
-
|
||||
#endif
|
||||
--- cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.h.upower1 2013-10-03 20:04:33.000000000 +0900
|
||||
+++ cairo-dock-plugins-3.3.2/powermanager/src/powermanager-upower.h 2014-06-16 14:01:49.823681160 +0900
|
||||
@@ -27,14 +27,4 @@
|
||||
|
||||
void cd_upower_stop (void);
|
||||
|
||||
-
|
||||
-gboolean cd_power_hibernate (void);
|
||||
-
|
||||
-gboolean cd_power_suspend (void);
|
||||
-
|
||||
-gboolean cd_power_can_hibernate (void);
|
||||
-
|
||||
-gboolean cd_power_can_suspend (void);
|
||||
-
|
||||
-
|
||||
#endif
|
||||
Reference in New Issue
Block a user