| 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 __CD_APPLET_STRUCT__ |
| 21 |
#define __CD_APPLET_STRUCT__ |
| 22 |
|
| 23 |
#include <cairo-dock.h> |
| 24 |
#include <gtk/gtk.h> |
| 25 |
|
| 26 |
#include <libdbusmenu-gtk/menuitem.h> |
| 27 |
#include <libdbusmenu-gtk/menu.h> |
| 28 |
|
| 29 |
typedef enum { |
| 30 |
CD_BUTTON_MENU, |
| 31 |
CD_BUTTON_MINIMIZE, |
| 32 |
CD_BUTTON_MAXIMIZE, |
| 33 |
CD_BUTTON_CLOSE, |
| 34 |
CD_NB_BUTTONS |
| 35 |
} CDButtonEnum; |
| 36 |
|
| 37 |
typedef enum { |
| 38 |
CD_GM_BUTTON_ORDER_AUTO = 0, |
| 39 |
CD_GM_BUTTON_ORDER_RIGHT, |
| 40 |
CD_GM_BUTTON_ORDER_LEFT |
| 41 |
} CDGMReversedMenu; |
| 42 |
|
| 43 |
//\___________ structure containing the applet's configuration parameters. |
| 44 |
struct _AppletConfig { |
| 45 |
gboolean bDisplayControls; // steal the window top border |
| 46 |
gboolean bDisplayMenu; // steal the menu from the window |
| 47 |
gboolean bCompactMode; // TRUE = if bDisplayControls, display all control buttons on the icon |
| 48 |
CDGMReversedMenu iButtonsOrder; // Buttons' order (auto / right / left) |
| 49 |
gchar *cShortkey; // if bDisplayMenu, shortkey to pop up the menu |
| 50 |
gboolean bMenuOnMouse; |
| 51 |
gint iTransitionDuration; // ms |
| 52 |
gchar *cMinimizeImage; |
| 53 |
gchar *cMaximizeImage; |
| 54 |
gchar *cRestoreImage; |
| 55 |
gchar *cCloseImage; |
| 56 |
} ; |
| 57 |
|
| 58 |
//\___________ structure containing the applet's data, like surfaces, dialogs, results of calculus, etc. |
| 59 |
#define CD_ANIM_STEPS 15 |
| 60 |
|
| 61 |
struct _AppletData { |
| 62 |
DBusGProxy *pProxyRegistrar; |
| 63 |
gboolean bOwnRegistrar; |
| 64 |
GldiWindowActor *pPreviousWindow, *pCurrentWindow; // window currently controlled. |
| 65 |
gboolean bCanClose; |
| 66 |
gboolean bCanMinimize; |
| 67 |
gboolean bCanMaximize; |
| 68 |
DbusmenuGtkMenu *pMenu; |
| 69 |
GldiShortkey *pKeyBinding; |
| 70 |
CairoDockImageBuffer defaultIcon; |
| 71 |
CairoDockImageBuffer minimizeButton; |
| 72 |
CairoDockImageBuffer maximizeButton; |
| 73 |
CairoDockImageBuffer restoreButton; |
| 74 |
CairoDockImageBuffer closeButton; |
| 75 |
gint iAnimIterMin, iAnimIterMax, iAnimIterClose, iAnimIterRestore; |
| 76 |
gboolean bButtonAnimating; |
| 77 |
guint iSidInitIdle; |
| 78 |
guint iSidInitIdle2; |
| 79 |
GldiTask *pTask; |
| 80 |
gint iNbButtons; |
| 81 |
GHashTable *windows; |
| 82 |
gboolean bReversedButtonsOrder; |
| 83 |
} ; |
| 84 |
|
| 85 |
#endif |