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 __CAIRO_DOCK_APPLICATION_MANAGER__
21 #define  __CAIRO_DOCK_APPLICATION_MANAGER__
22 
23 #include "cairo-dock-struct.h"
24 #include "cairo-dock-icon-manager.h"
25 G_BEGIN_DECLS
26 
27 /**
28 *@file cairo-dock-applications-manager.h This class manages the list of icons representing a window, ie the Taskbar.
29 */
30 
31 // manager
32 typedef struct _CairoTaskbarParam CairoTaskbarParam;
33 typedef struct _Icon AppliIcon;
34 
35 #ifndef _MANAGER_DEF_
36 extern CairoTaskbarParam myTaskbarParam;
37 extern GldiManager myTaskbarMgr;
38 extern GldiObjectManager myAppliIconObjectMgr;
39 #endif
40 
41 
42 typedef enum {
43 	CAIRO_APPLI_BEFORE_FIRST_ICON,
44 	CAIRO_APPLI_BEFORE_FIRST_LAUNCHER,
45 	CAIRO_APPLI_AFTER_LAST_LAUNCHER,
46 	CAIRO_APPLI_AFTER_LAST_ICON,
47 	CAIRO_APPLI_AFTER_ICON,
48 	CAIRO_APPLI_NB_PLACEMENTS
49 } CairoTaskbarPlacement;
50 
51 // params
52 struct _CairoTaskbarParam {
53 	gboolean bShowAppli;
54 	gboolean bGroupAppliByClass;
55 	gint iAppliMaxNameLength;
56 	gboolean bMinimizeOnClick;
57 	gboolean bPresentClassOnClick;
58 	gint iActionOnMiddleClick;
59 	gboolean bHideVisibleApplis;
60 	gdouble fVisibleAppliAlpha;
61 	gboolean bAppliOnCurrentDesktopOnly;
62 	gboolean bDemandsAttentionWithDialog;
63 	gint iDialogDuration;
64 	gchar *cAnimationOnDemandsAttention;
65 	gchar *cAnimationOnActiveWindow;
66 	gboolean bOverWriteXIcons;
67 	gint iMinimizedWindowRenderType;
68 	gboolean bMixLauncherAppli;
69 	gchar *cOverwriteException;
70 	gchar *cGroupException;
71 	gchar *cForceDemandsAttention;
72 	CairoTaskbarPlacement iIconPlacement;
73 	gchar *cRelativeIconName;
74 	gboolean bSeparateApplis;
75 	} ;
76 
77 // signals
78 typedef enum {
79 	NB_NOTIFICATIONS_TASKBAR = NB_NOTIFICATIONS_ICON,
80 	} CairoTaskbarNotifications;
81 
82 
83 /** Say if an object is an AppliIcon.
84 *@param obj the object.
85 *@return TRUE if the object is a AppliIcon.
86 */
87 #define GLDI_OBJECT_IS_APPLI_ICON(obj) gldi_object_is_manager_child (GLDI_OBJECT(obj), &myAppliIconObjectMgr)
88 
89 
90 /** Start the applications manager. It will load all the appli-icons, and keep monitoring them. If enabled, it will insert them into the dock.
91 *@param pDock the main dock
92 */
93 void cairo_dock_start_applications_manager (CairoDock *pDock);
94 
95 
96 /** Get the list of appli-icons, including the icons not currently displayed in the dock. You can then order the list by z-order, name, etc.
97 *@return a newly allocated list of appli-icons. You must free the list when you're done with it, but not the icons.
98 */
99 GList *cairo_dock_get_current_applis_list (void);
100 
101 /** Get the icon of the currently active window, if any.
102 *@return the icon (maybe not inside a dock, maybe NULL).
103 */
104 Icon *cairo_dock_get_current_active_icon (void);
105 
106 /** Get the icon of a given window, if any.
107 *@param actor the window actor
108 *@return the icon (maybe not inside a dock, maybe NULL).
109 */
110 Icon *cairo_dock_get_appli_icon (GldiWindowActor *actor);
111 
112 /** Run a function on all Appli icons.
113 *@param pFunction function to be called
114 *@param pUserData data passed to the function.
115 */
116 void cairo_dock_foreach_appli_icon (GldiIconFunc pFunction, gpointer pUserData);
117 
118 void cairo_dock_set_icons_geometry_for_window_manager (CairoDock *pDock);
119 
120 
121 void gldi_register_applications_manager (void);
122 
123 G_END_DECLS
124 #endif
125