1 /*
2  * types: Define application specific but common types
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 /**
25  * SECTION:types
26  * @title: Enums and types
27  * @short_description: Common enums and types
28  * @include: xfdashboard/types.h
29  *
30  * Various miscellaneous utilility functions.
31  */
32 
33 #ifndef __LIBXFDASHBOARD_TYPES__
34 #define __LIBXFDASHBOARD_TYPES__
35 
36 #if !defined(__LIBXFDASHBOARD_H_INSIDE__) && !defined(LIBXFDASHBOARD_COMPILATION)
37 #error "Only <libxfdashboard/libxfdashboard.h> can be included directly."
38 #endif
39 
40 #include <glib.h>
41 
42 G_BEGIN_DECLS
43 
44 /**
45  * XfdashboardViewMode:
46  * @XFDASHBOARD_VIEW_MODE_LIST: Show items in view as list
47  * @XFDASHBOARD_VIEW_MODE_ICON: Show items in view as icons
48  *
49  * Determines how to display items of a view.
50  */
51 typedef enum /*< prefix=XFDASHBOARD_VIEW_MODE >*/
52 {
53 	XFDASHBOARD_VIEW_MODE_LIST=0,
54 	XFDASHBOARD_VIEW_MODE_ICON
55 } XfdashboardViewMode;
56 
57 /**
58  * XfdashboardVisibilityPolicy:
59  * @XFDASHBOARD_VISIBILITY_POLICY_NEVER: The actor is always visible.
60  * @XFDASHBOARD_VISIBILITY_POLICY_AUTOMATIC: The actor will appear and disappear as necessary. For example, when a view does not fit into viewpad the scrollbar will be visible.
61  * @XFDASHBOARD_VISIBILITY_POLICY_ALWAYS: The actor will never appear.
62  *
63  * Determines when an actor will be visible, e.g. scrollbars in views.
64  */
65 typedef enum /*< prefix=XFDASHBOARD_VISIBILITY_POLICY >*/
66 {
67 	XFDASHBOARD_VISIBILITY_POLICY_NEVER=0,
68 	XFDASHBOARD_VISIBILITY_POLICY_AUTOMATIC,
69 	XFDASHBOARD_VISIBILITY_POLICY_ALWAYS
70 } XfdashboardVisibilityPolicy;
71 
72 /**
73  * XfdashboardOrientation:
74  * @XFDASHBOARD_ORIENTATION_LEFT: The actor is justified to left boundary.
75  * @XFDASHBOARD_ORIENTATION_RIGHT: The actor is justified to right boundary.
76  * @XFDASHBOARD_ORIENTATION_TOP: The actor is justified to top boundary.
77  * @XFDASHBOARD_ORIENTATION_BOTTOM: The actor is justified to bottom boundary.
78  *
79  * Determines the side to which an actor is justified to. It can mostly be switched on-the-fly.
80  */
81 typedef enum /*< prefix=XFDASHBOARD_ORIENTATION >*/
82 {
83 	XFDASHBOARD_ORIENTATION_LEFT=0,
84 	XFDASHBOARD_ORIENTATION_RIGHT,
85 	XFDASHBOARD_ORIENTATION_TOP,
86 	XFDASHBOARD_ORIENTATION_BOTTOM
87 } XfdashboardOrientation;
88 
89 /**
90  * XfdashboardCorners:
91  * @XFDASHBOARD_CORNERS_NONE: No corner is affected.
92  * @XFDASHBOARD_CORNERS_TOP_LEFT: Affects top-left corner of actor.
93  * @XFDASHBOARD_CORNERS_TOP_RIGHT: Affects top-right corner of actor.
94  * @XFDASHBOARD_CORNERS_BOTTOM_LEFT: Affects bottom-left corner of actor.
95  * @XFDASHBOARD_CORNERS_BOTTOM_RIGHT: Affects bottom-right corner of actor.
96  * @XFDASHBOARD_CORNERS_TOP: Affects corners at top side of actor - top-left and top-right.
97  * @XFDASHBOARD_CORNERS_BOTTOM: Affects corners at bottom side of actor - bottom-left and bottom-right.
98  * @XFDASHBOARD_CORNERS_LEFT: Affects corners at left side of actor - top-left and bottom-left.
99  * @XFDASHBOARD_CORNERS_RIGHT: Affects corners at right side of actor - top-right and bottom-right.
100  * @XFDASHBOARD_CORNERS_ALL: Affects all corners of actor.
101  *
102  * Specifies which corner of an actor is affected, e.g. used in background for rounded rectangles.
103  */
104 typedef enum /*< flags,prefix=XFDASHBOARD_CORNERS >*/
105 {
106 	XFDASHBOARD_CORNERS_NONE=0,
107 
108 	XFDASHBOARD_CORNERS_TOP_LEFT=1 << 0,
109 	XFDASHBOARD_CORNERS_TOP_RIGHT=1 << 1,
110 	XFDASHBOARD_CORNERS_BOTTOM_LEFT=1 << 2,
111 	XFDASHBOARD_CORNERS_BOTTOM_RIGHT=1 << 3,
112 
113 	XFDASHBOARD_CORNERS_TOP=(XFDASHBOARD_CORNERS_TOP_LEFT | XFDASHBOARD_CORNERS_TOP_RIGHT),
114 	XFDASHBOARD_CORNERS_BOTTOM=(XFDASHBOARD_CORNERS_BOTTOM_LEFT | XFDASHBOARD_CORNERS_BOTTOM_RIGHT),
115 	XFDASHBOARD_CORNERS_LEFT=(XFDASHBOARD_CORNERS_TOP_LEFT | XFDASHBOARD_CORNERS_BOTTOM_LEFT),
116 	XFDASHBOARD_CORNERS_RIGHT=(XFDASHBOARD_CORNERS_TOP_RIGHT | XFDASHBOARD_CORNERS_BOTTOM_RIGHT),
117 
118 	XFDASHBOARD_CORNERS_ALL=(XFDASHBOARD_CORNERS_TOP_LEFT | XFDASHBOARD_CORNERS_TOP_RIGHT | XFDASHBOARD_CORNERS_BOTTOM_LEFT | XFDASHBOARD_CORNERS_BOTTOM_RIGHT)
119 } XfdashboardCorners;
120 
121 /**
122  * XfdashboardBorders:
123  * @XFDASHBOARD_BORDERS_NONE: No side is affected.
124  * @XFDASHBOARD_BORDERS_LEFT: Affects left side of actor.
125  * @XFDASHBOARD_BORDERS_TOP: Affects top side of actor.
126  * @XFDASHBOARD_BORDERS_RIGHT: Affects right side of actor.
127  * @XFDASHBOARD_BORDERS_BOTTOM: Affects bottom side of actor.
128  * @XFDASHBOARD_BORDERS_ALL: Affects all sides of actor.
129  *
130  * Determines which side of an actor is affected, e.g. used in outlines.
131  */
132 typedef enum /*< flags,prefix=XFDASHBOARD_BORDERS >*/
133 {
134 	XFDASHBOARD_BORDERS_NONE=0,
135 
136 	XFDASHBOARD_BORDERS_LEFT=1 << 0,
137 	XFDASHBOARD_BORDERS_TOP=1 << 1,
138 	XFDASHBOARD_BORDERS_RIGHT=1 << 2,
139 	XFDASHBOARD_BORDERS_BOTTOM=1 << 3,
140 
141 	XFDASHBOARD_BORDERS_ALL=(XFDASHBOARD_BORDERS_LEFT | XFDASHBOARD_BORDERS_TOP | XFDASHBOARD_BORDERS_RIGHT | XFDASHBOARD_BORDERS_BOTTOM)
142 } XfdashboardBorders;
143 
144 /**
145  * XfdashboardStageBackgroundImageType:
146  * @XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE_NONE: Do not show anything at background of stage actor.
147  * @XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE_DESKTOP: Show current desktop image at background of stage actor.
148  *
149  * Determine what to show at background of a stage actor.
150  */
151 typedef enum /*< prefix=XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE >*/
152 {
153 	XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE_NONE=0,
154 	XFDASHBOARD_STAGE_BACKGROUND_IMAGE_TYPE_DESKTOP
155 } XfdashboardStageBackgroundImageType;
156 
157 /**
158  * XfdashboardSelectionTarget:
159  * @XFDASHBOARD_SELECTION_TARGET_LEFT: Move to next selectable actor at left side.
160  * @XFDASHBOARD_SELECTION_TARGET_RIGHT: Move to next selectable actor at right side.
161  * @XFDASHBOARD_SELECTION_TARGET_UP: Move to next selectable actor at top side.
162  * @XFDASHBOARD_SELECTION_TARGET_DOWN: Move to next selectable actor at bottom side.
163  * @XFDASHBOARD_SELECTION_TARGET_FIRST: Move to first selectable actor.
164  * @XFDASHBOARD_SELECTION_TARGET_LAST: Move to last selectable actor.
165  * @XFDASHBOARD_SELECTION_TARGET_PAGE_LEFT: Move to next selectable actor at left side page-width.
166  * @XFDASHBOARD_SELECTION_TARGET_PAGE_RIGHT: Move to next selectable actor at right side page-width.
167  * @XFDASHBOARD_SELECTION_TARGET_PAGE_UP: Move to next selectable actor at top side page-width.
168  * @XFDASHBOARD_SELECTION_TARGET_PAGE_DOWN: Move to next selectable actor at bottom side page-width.
169  * @XFDASHBOARD_SELECTION_TARGET_NEXT: Move to next selectable actor to current one.
170  *
171  * Determines the movement of selection within an actor which supports selections.
172  */
173 typedef enum /*< prefix=XFDASHBOARD_SELECTION_TARGET >*/
174 {
175 	XFDASHBOARD_SELECTION_TARGET_LEFT=0,
176 	XFDASHBOARD_SELECTION_TARGET_RIGHT,
177 	XFDASHBOARD_SELECTION_TARGET_UP,
178 	XFDASHBOARD_SELECTION_TARGET_DOWN,
179 
180 	XFDASHBOARD_SELECTION_TARGET_FIRST,
181 	XFDASHBOARD_SELECTION_TARGET_LAST,
182 
183 	XFDASHBOARD_SELECTION_TARGET_PAGE_LEFT,
184 	XFDASHBOARD_SELECTION_TARGET_PAGE_RIGHT,
185 	XFDASHBOARD_SELECTION_TARGET_PAGE_UP,
186 	XFDASHBOARD_SELECTION_TARGET_PAGE_DOWN,
187 
188 	XFDASHBOARD_SELECTION_TARGET_NEXT
189 } XfdashboardSelectionTarget;
190 
191 /* Anchor points */
192 /**
193  * XfdashboardAnchorPoint:
194  * @XFDASHBOARD_ANCHOR_POINT_NONE: Use default anchor of actor, usually top-left.
195  * @XFDASHBOARD_ANCHOR_POINT_NORTH_WEST: The anchor is at the top-left of the object.
196  * @XFDASHBOARD_ANCHOR_POINT_NORTH: The anchor is at the top of the object, centered horizontally.
197  * @XFDASHBOARD_ANCHOR_POINT_NORTH_EAST: The anchor is at the top-right of the object.
198  * @XFDASHBOARD_ANCHOR_POINT_EAST: The anchor is on the right of the object, centered vertically.
199  * @XFDASHBOARD_ANCHOR_POINT_SOUTH_EAST:  The anchor is at the bottom-right of the object.
200  * @XFDASHBOARD_ANCHOR_POINT_SOUTH: The anchor is at the bottom of the object, centered horizontally.
201  * @XFDASHBOARD_ANCHOR_POINT_SOUTH_WEST:  The anchor is at the bottom-left of the object.
202  * @XFDASHBOARD_ANCHOR_POINT_WEST: The anchor is on the left of the object, centered vertically.
203  * @XFDASHBOARD_ANCHOR_POINT_CENTER: The anchor is in the center of the object.
204  *
205  * Specifys the position of an object relative to a particular anchor point.
206  */
207 typedef enum /*< prefix=XFDASHBOARD_ANCHOR_POINT >*/
208 {
209 	XFDASHBOARD_ANCHOR_POINT_NONE=0,
210 	XFDASHBOARD_ANCHOR_POINT_NORTH_WEST,
211 	XFDASHBOARD_ANCHOR_POINT_NORTH,
212 	XFDASHBOARD_ANCHOR_POINT_NORTH_EAST,
213 	XFDASHBOARD_ANCHOR_POINT_EAST,
214 	XFDASHBOARD_ANCHOR_POINT_SOUTH_EAST,
215 	XFDASHBOARD_ANCHOR_POINT_SOUTH,
216 	XFDASHBOARD_ANCHOR_POINT_SOUTH_WEST,
217 	XFDASHBOARD_ANCHOR_POINT_WEST,
218 	XFDASHBOARD_ANCHOR_POINT_CENTER
219 } XfdashboardAnchorPoint;
220 
221 G_END_DECLS
222 
223 #endif	/* __LIBXFDASHBOARD_TYPES__ */
224