2
* Copyright (C) 2004 Ed Catmur <ed@catmur.co.uk>
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.
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.
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22
#ifndef __BRIGHTSIDE_H__
23
#define __BRIGHTSIDE_H__
26
#include <gconf/gconf-client.h>
28
#define DIALOG_TIMEOUT 1000 /* timeout in ms for action icon dialog */
30
#define SELECTION_NAME "_BRIGHTSIDE_SELECTION" /* X selection to communicate
31
between daemon and capplet */
33
#define BRIGHTSIDE_KEY_ROOT "/apps/brightside"
35
#define TIMEVAL_ELAPSED_MSEC(a, b) ((((a).tv_sec - (b).tv_sec) * 1000) \
36
+ (((a).tv_usec - (b).tv_usec) / 1000))
38
#if defined(__powerpc__) && defined (__linux__)
46
NO_SCREENSAVER_ACTION,
58
/* struct GConfEnumStringPair {
65
const char *description;
66
} actions[HANDLED_ACTIONS] = {
67
{ MUTE_VOLUME_ACTION, "mute",
69
{ NO_SCREENSAVER_ACTION, "noscreensaver",
70
N_("Prevent screensaver starting") },
71
{ SCREENSAVER_ACTION, "screensaver",
72
N_("Start screensaver") },
73
{ DPMS_STANDBY_ACTION, "standby",
74
N_("Enter DPMS standby mode") },
75
{ DPMS_SUSPEND_ACTION, "suspend",
76
N_("Enter DPMS suspend mode") },
77
{ DPMS_OFF_ACTION, "off",
78
N_("Enter DPMS off mode") },
80
{ DIM_BACKLIGHT_ACTION, "dimbacklight",
81
N_("Dim laptop backlight") },
83
{ CUSTOM_ACTION, "custom",
84
N_("Custom action...") },
87
static GConfEnumStringPair actions_lookup_table[HANDLED_ACTIONS + 1] = {
88
{ MUTE_VOLUME_ACTION, "mute", },
89
{ NO_SCREENSAVER_ACTION, "noscreensaver", },
90
{ SCREENSAVER_ACTION, "screensaver", },
91
{ DPMS_STANDBY_ACTION, "standby", },
92
{ DPMS_SUSPEND_ACTION, "suspend", },
93
{ DPMS_OFF_ACTION, "off", },
95
{ DIM_BACKLIGHT_ACTION, "dimbacklight", },
97
{ CUSTOM_ACTION, "custom", },
101
/* Can change ordering as long as whole contents of this file are updated */
102
typedef enum { NW, SW, NE, SE,
103
TOP, BOTTOM, LEFT, RIGHT, NONE = -1 } BrightsideRegionType;
104
typedef BrightsideRegionType BrightsideCornerType;
105
#define REGION_FIRST_CORNER NW
106
#define REGION_IS_CORNER(r) ((r) >= NW && (r) <= SE)
107
#define REGION_IS_EDGE(r) ((r) >= TOP && (r) <= RIGHT)
108
#define REGION_ADJACENT_REGIONS(r, s) ( \
109
((r) == NW && (s) == TOP) || ((r) == TOP && (s) == NE) || \
110
((r) == NE && (s) == RIGHT) || ((r) == RIGHT && (s) == SE) || \
111
((r) == SE && (s) == BOTTOM) || ((r) == BOTTOM && (s) == SW) || \
112
((r) == SW && (s) == LEFT) || ((r) == LEFT && (s) == NW) || \
113
((s) == NW && (r) == TOP) || ((s) == TOP && (r) == NE) || \
114
((s) == NE && (r) == RIGHT) || ((s) == RIGHT && (r) == SE) || \
115
((s) == SE && (r) == BOTTOM) || ((s) == BOTTOM && (r) == SW) || \
116
((s) == SW && (r) == LEFT) || ((s) == LEFT && (r) == NW) || \
118
#define REGION_CORNER_TO_ADJACENT_EDGE(r, s) ( \
119
((r) == NW && (s) == TOP) || ((r) == NE && (s) == RIGHT) || \
120
((r) == SE && (s) == BOTTOM) || ((r) == SW && (s) == LEFT) || \
121
((r) == NW && (s) == LEFT) || ((r) == NE && (s) == TOP) || \
122
((r) == SE && (s) == RIGHT) || ((r) == SW && (s) == BOTTOM) || \
124
#define REGION_GESTURE_CODES "FLTJNSWE" /* corners are Graffiti strokes */
125
#define REGION_GESTURE_HISTORY 8
128
BrightsideCornerType id;
129
const gchar *enabled_key;
130
const char *enabled_toggle_id;
131
const gchar *action_key;
132
const char *action_menu_id;
133
const gchar *custom_in_key;
134
const gchar *custom_out_key;
135
const gchar *custom_kill_key;
136
gint default_action; /* see also brightside.schemas.in */
138
{ NW, "/apps/brightside/nw_enabled", "nw_enabled",
139
"/apps/brightside/nw_action", "nw_action",
140
"/apps/brightside/nw_custom_in", "/apps/brightside/nw_custom_out",
141
"/apps/brightside/nw_custom_kill", MUTE_VOLUME_ACTION, },
142
{ SW, "/apps/brightside/sw_enabled", "sw_enabled",
143
"/apps/brightside/sw_action", "sw_action",
144
"/apps/brightside/sw_custom_in", "/apps/brightside/sw_custom_out",
145
"/apps/brightside/sw_custom_kill", NO_SCREENSAVER_ACTION, },
146
{ NE, "/apps/brightside/ne_enabled", "ne_enabled",
147
"/apps/brightside/ne_action", "ne_action",
148
"/apps/brightside/ne_custom_in", "/apps/brightside/ne_custom_out",
149
"/apps/brightside/ne_custom_kill", SCREENSAVER_ACTION, },
150
{ SE, "/apps/brightside/se_enabled", "se_enabled",
151
"/apps/brightside/se_action", "se_action",
152
"/apps/brightside/se_custom_in", "/apps/brightside/se_custom_out",
153
"/apps/brightside/se_custom_kill", DPMS_STANDBY_ACTION },
156
#define CORNER_DELAY_KEY "/apps/brightside/corner_delay"
157
#define CORNER_FLIP_KEY "/apps/brightside/corner_flip"
158
#define ENABLE_EDGE_FLIP_KEY "/apps/brightside/enable_edge_flip"
159
#define AFTER_FLIP_COMMAND_KEY "/apps/brightside/after_flip_command"
160
#define EDGE_DELAY_KEY "/apps/brightside/edge_delay"
161
#define EDGE_WRAP_KEY "/apps/brightside/edge_wrap"
162
#define ORIENTABLE_WORKSPACES_KEY "/apps/brightside/orientable_workspaces"
163
#define USE_PCM_KEY "/apps/brightside/use_pcm"
165
#define CUSTOM_SHOW_LIST_KEY "/apps/panel/profiles/default/general/show_program_list"
167
#define MOVING_WINDOW_ATOM "_NET_MOVING_WINDOW"
168
#define RESIZING_WINDOW_ATOM "_NET_RESIZING_WINDOW"
169
#define DESKTOP_LAYOUT_ATOM "_NET_DESKTOP_LAYOUT"
170
#define WM_MOVERESIZE_ATOM "_NET_WM_MOVERESIZE"
171
#define ACTIVE_WINDOW_ATOM "_NET_ACTIVE_WINDOW"
172
/* fragment of EWMH spec */
173
#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
175
#define BRIGHTSIDE_URL PACKAGE_BUGREPORT
177
#define EASTER_EGG_GESTURE "TFLJWEWE" /* Euro symbol */
179
#endif /* __BRIGHTSIDE_H__ */