| 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 __LOGOUT_STRUCT__ |
| 22 |
#define __LOGOUT_STRUCT__ |
| 23 |
|
| 24 |
#include <cairo-dock.h> |
| 25 |
|
| 26 |
#define CD_REBOOT_NEEDED_FILE "/var/run/reboot-required" |
| 27 |
|
| 28 |
typedef enum { |
| 29 |
CD_LOGOUT=0, |
| 30 |
CD_SHUTDOWN, |
| 31 |
CD_LOCK_SCREEN, |
| 32 |
CD_POP_UP_MENU, |
| 33 |
CD_NB_ACTIONS |
| 34 |
} CDActionsEnum; |
| 35 |
|
| 36 |
typedef enum { |
| 37 |
CD_DISPLAY_EMBLEM, |
| 38 |
CD_DISPLAY_IMAGE, |
| 39 |
CD_NB_REBOOT_NEEDED_DISPLAYS |
| 40 |
} CDDisplayRebootNeeded; |
| 41 |
|
| 42 |
struct _AppletConfig { |
| 43 |
gchar *cUserAction; // custom logout command |
| 44 |
gchar *cUserActionShutdown; // custom shutdown command |
| 45 |
gchar *cUserActionSwitchUser; // custom switch-user command |
| 46 |
CDActionsEnum iActionOnMiddleClick; |
| 47 |
gint iShutdownTime; // time_t |
| 48 |
gchar *cEmblemPath; |
| 49 |
gchar *cDefaultLabel; |
| 50 |
gchar *cDefaultIcon; |
| 51 |
gchar *cShortkey; |
| 52 |
gchar *cShortkey2; |
| 53 |
gboolean bConfirmAction; |
| 54 |
CDDisplayRebootNeeded iRebootNeededImage; |
| 55 |
} ; |
| 56 |
|
| 57 |
typedef enum { |
| 58 |
CD_UNKNOWN, |
| 59 |
CD_CONSOLE_KIT, |
| 60 |
CD_LOGIND, |
| 61 |
CD_NB_LOGIN_MANAGER |
| 62 |
} CDLoginManager; |
| 63 |
|
| 64 |
typedef struct { |
| 65 |
gboolean bCanHibernate; |
| 66 |
gboolean bCanHybridSleep; |
| 67 |
gboolean bCanSuspend; |
| 68 |
gboolean bCanStop; |
| 69 |
gboolean bCanRestart; |
| 70 |
gboolean bHasGuestAccount; |
| 71 |
CDLoginManager iLoginManager; |
| 72 |
} CDSharedMemory; |
| 73 |
|
| 74 |
struct _AppletData { |
| 75 |
guint iSidTimer; |
| 76 |
// manual capabilities. |
| 77 |
GldiTask *pTask; |
| 78 |
gboolean bCapabilitiesChecked; |
| 79 |
gboolean bCanHibernate; |
| 80 |
gboolean bCanHybridSleep; |
| 81 |
gboolean bCanSuspend; |
| 82 |
gboolean bCanStop; |
| 83 |
gboolean bCanRestart; |
| 84 |
gboolean bHasGuestAccount; |
| 85 |
CDLoginManager iLoginManager; |
| 86 |
GldiShortkey *pKeyBinding; |
| 87 |
GldiShortkey *pKeyBinding2; |
| 88 |
GList *pUserList; |
| 89 |
// shut-down confirmation |
| 90 |
gint iCountDown; |
| 91 |
guint iSidShutDown; |
| 92 |
CairoDialog *pConfirmationDialog; |
| 93 |
gint iDesiredIconSize; |
| 94 |
} ; |
| 95 |
|
| 96 |
#endif |