Merge branch 'master' into next
[wmaker-crm.git] / WPrefs.app / WPrefs.h
blob0373414cc2a05edef160dfdbc22ce097c9ae5fa5
1 /* WPrefs.h- general definitions
3 * WPrefs - Window Maker Preferences Program
5 * Copyright (c) 1998-2003 Alfredo K. Kojima
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
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.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef WPREFS_H_
23 #define WPREFS_H_
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <string.h>
28 #include <strings.h>
29 #include <signal.h>
31 #include <X11/Xlib.h>
33 #include <wraster.h>
35 #include <WINGs/WINGs.h>
37 /* Needed for HAVE_LIBINTL_H and EXTENDED_WINDOWSHORTCUT */
38 #include "../src/wconfig.h"
41 * The macro 'wlengthof' should be used as much as possible, this macro
42 * is reserved for the cases where wlengthof cannot be used because the
43 * static_assert. Typical symptom is this compiler error (gcc):
45 * error: braced-group within expression allowed only inside a function
47 * which appears when you try to create an array whose size is determined using
48 * wlengthof on some other array.
50 #define wlengthof_nocheck(array) \
51 (sizeof(array) / sizeof(array[0]))
54 /****/
56 extern char *NOptionValueChanged;
57 extern Bool xext_xkb_supported;
59 typedef struct _Panel Panel;
61 typedef struct {
62 unsigned flags; /* reserved for WPrefs.c Don't access it */
64 void (*createWidgets)(Panel*); /* called when showing for first time */
65 void (*updateDomain)(Panel*); /* save the changes to the dictionary */
66 Bool (*requiresRestart)(Panel*); /* return True if some static option was changed */
67 void (*undoChanges)(Panel*); /* reset values to those in the dictionary */
68 void (*prepareForClose)(Panel*); /* called when exiting WPrefs */
69 void (*showPanel)(Panel*); /* called when entering the panel */
70 void (*hidePanel)(Panel*); /* called when exiting the panel */
71 } CallbackRec;
74 /* all Panels must start with the following layout */
75 typedef struct PanelRec {
76 WMBox *box;
78 char *sectionName; /* section name to display in titlebar */
80 char *description;
82 CallbackRec callbacks;
83 } PanelRec;
86 /* ---[ Wprefs.c ] ------------------------------------------------------- */
88 void AddSection(Panel *panel, const char *iconFile);
90 char *LocateImage(const char *name);
92 void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, const char *file);
94 /* Loads `file' into `icon_normal'. If `icon_greyed' is not NULL,
95 * combine `icon_normal' with some grey and then optionally with image
96 * `xis', and store it in `icon_greyed' (typically to produce a
97 * greyed-out, red-crossed version of `icon_normal') */
98 void CreateImages(WMScreen *scr, RContext *rc, RImage *xis, const char *file,
99 WMPixmap **icon_normal, WMPixmap **icon_greyed);
101 WMWindow *GetWindow(void);
103 /* manipulate the dictionary for the WindowMaker domain */
105 WMPropList *GetObjectForKey(const char *defaultName);
107 void SetObjectForKey(WMPropList *object, const char *defaultName);
109 void RemoveObjectForKey(const char *defaultName);
111 char *GetStringForKey(const char *defaultName);
113 int GetIntegerForKey(const char *defaultName);
115 Bool GetBoolForKey(const char *defaultName);
117 int GetSpeedForKey(const char *defaultName);
119 void SetIntegerForKey(int value, const char *defaultName);
121 void SetStringForKey(const char *value, const char *defaultName);
123 void SetBoolForKey(Bool value, const char *defaultName);
125 void SetSpeedForKey(int speed, const char *defaultName);
128 /* ---[ KeyboardShortcuts.c ] -------------------------------------------- */
130 char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case);
133 /* ---[ double.c ] ------------------------------------------------------- */
134 typedef struct W_DoubleTest DoubleTest;
136 DoubleTest *CreateDoubleTest(WMWidget *parent, const char *text);
139 /* ---[ main.c ] --------------------------------------------------------- */
140 void AddDeadChildHandler(pid_t pid, void (*handler)(void*), void *data);
143 /* ---[ xmodifier.c ] ---------------------------------------------------- */
144 int ModifierFromKey(Display * dpy, const char *key);
147 /* ---[ Panel Initializers ]---------------------------------------------- */
149 void Initialize(WMScreen *scr);
151 /* in alphabetical order - in case you'd want to add one */
152 Panel *InitAppearance(WMWidget *parent);
153 Panel *InitConfigurations(WMWidget *parent);
154 Panel *InitDocks(WMWidget *parent);
155 Panel *InitExpert(WMWidget *parent);
156 Panel *InitFocus(WMWidget *parent);
157 Panel *InitFontSimple(WMWidget *parent);
158 Panel *InitIcons(WMWidget *parent);
159 Panel *InitKeyboardShortcuts(WMWidget *parent);
160 Panel *InitMenu(WMWidget *parent);
161 Panel *InitMenuPreferences(WMWidget *parent);
162 Panel *InitMouseSettings(WMWidget *parent);
163 Panel *InitPaths(WMWidget *parent);
164 Panel *InitPreferences(WMWidget *parent);
165 Panel *InitWindowHandling(WMWidget *parent);
166 Panel *InitWorkspace(WMWidget *parent);
169 #define FRAME_TOP 105
170 #define FRAME_LEFT -2
171 #define FRAME_WIDTH 524
172 #define FRAME_HEIGHT 235
173 #endif /* WPREFS_H_ */