1 /*
2  * stage: Global stage of application
3  *
4  * Copyright 2012-2020 Stephan Haller <nomad@froevel.de>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  * MA 02110-1301, USA.
20  *
21  *
22  */
23 
24 #ifndef __LIBXFDASHBOARD_STAGE__
25 #define __LIBXFDASHBOARD_STAGE__
26 
27 #if !defined(__LIBXFDASHBOARD_H_INSIDE__) && !defined(LIBXFDASHBOARD_COMPILATION)
28 #error "Only <libxfdashboard/libxfdashboard.h> can be included directly."
29 #endif
30 
31 #include <clutter/clutter.h>
32 
33 #include <libxfdashboard/types.h>
34 
35 G_BEGIN_DECLS
36 
37 #define XFDASHBOARD_TYPE_STAGE				(xfdashboard_stage_get_type())
38 #define XFDASHBOARD_STAGE(obj)				(G_TYPE_CHECK_INSTANCE_CAST((obj), XFDASHBOARD_TYPE_STAGE, XfdashboardStage))
39 #define XFDASHBOARD_IS_STAGE(obj)			(G_TYPE_CHECK_INSTANCE_TYPE((obj), XFDASHBOARD_TYPE_STAGE))
40 #define XFDASHBOARD_STAGE_CLASS(klass)		(G_TYPE_CHECK_CLASS_CAST((klass), XFDASHBOARD_TYPE_STAGE, XfdashboardStageClass))
41 #define XFDASHBOARD_IS_STAGE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE((klass), XFDASHBOARD_TYPE_STAGE))
42 #define XFDASHBOARD_STAGE_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS((obj), XFDASHBOARD_TYPE_STAGE, XfdashboardStageClass))
43 
44 typedef struct _XfdashboardStage			XfdashboardStage;
45 typedef struct _XfdashboardStageClass		XfdashboardStageClass;
46 typedef struct _XfdashboardStagePrivate		XfdashboardStagePrivate;
47 
48 struct _XfdashboardStage
49 {
50 	/*< private >*/
51 	/* Parent instance */
52 	ClutterStage							parent_instance;
53 
54 	/* Private structure */
55 	XfdashboardStagePrivate					*priv;
56 };
57 
58 struct _XfdashboardStageClass
59 {
60 	/*< private >*/
61 	/* Parent class */
62 	ClutterStageClass						parent_class;
63 
64 	/*< public >*/
65 	/* Virtual functions */
66 	void (*actor_created)(XfdashboardStage *self, ClutterActor *inActor);
67 
68 	void (*search_started)(XfdashboardStage *self);
69 	void (*search_changed)(XfdashboardStage *self, gchar *inText);
70 	void (*search_ended)(XfdashboardStage *self);
71 
72 	void (*show_tooltip)(XfdashboardStage *self, ClutterAction *inAction);
73 	void (*hide_tooltip)(XfdashboardStage *self, ClutterAction *inAction);
74 };
75 
76 /* Public API */
77 GType xfdashboard_stage_get_type(void) G_GNUC_CONST;
78 
79 ClutterActor* xfdashboard_stage_new(void);
80 
81 XfdashboardStageBackgroundImageType xfdashboard_stage_get_background_image_type(XfdashboardStage *self);
82 void xfdashboard_stage_set_background_image_type(XfdashboardStage *self, XfdashboardStageBackgroundImageType inType);
83 
84 ClutterColor* xfdashboard_stage_get_background_color(XfdashboardStage *self);
85 void xfdashboard_stage_set_background_color(XfdashboardStage *self, const ClutterColor *inColor);
86 
87 const gchar* xfdashboard_stage_get_switch_to_view(XfdashboardStage *self);
88 void xfdashboard_stage_set_switch_to_view(XfdashboardStage *self, const gchar *inViewInternalName);
89 
90 void xfdashboard_stage_show_notification(XfdashboardStage *self, const gchar *inIconName, const gchar *inText);
91 
92 G_END_DECLS
93 
94 #endif	/* __LIBXFDASHBOARD_STAGE__ */
95