simplified logic of handleMaximize function
[wmaker-crm.git] / WPrefs.app / WPrefs.h
blob021bf3b4abea7f237861e463615456b0018c3fab
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"
40 /****/
42 extern char *NOptionValueChanged;
44 typedef struct _Panel Panel;
46 typedef struct {
47 unsigned flags; /* reserved for WPrefs.c Don't access it */
49 void (*createWidgets)(Panel*); /* called when showing for first time */
50 void (*updateDomain)(Panel*); /* save the changes to the dictionary */
51 Bool (*requiresRestart)(Panel*); /* return True if some static option was changed */
52 void (*undoChanges)(Panel*); /* reset values to those in the dictionary */
53 void (*prepareForClose)(Panel*); /* called when exiting WPrefs */
54 void (*showPanel)(Panel*); /* called when entering the panel */
55 void (*hidePanel)(Panel*); /* called when exiting the panel */
56 } CallbackRec;
59 /* all Panels must start with the following layout */
60 typedef struct PanelRec {
61 WMBox *box;
63 char *sectionName; /* section name to display in titlebar */
65 char *description;
67 CallbackRec callbacks;
68 } PanelRec;
71 /* ---[ Wprefs.c ] ------------------------------------------------------- */
73 void AddSection(Panel *panel, const char *iconFile);
75 char *LocateImage(const char *name);
77 void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, const char *file,
78 const char *title1, const char *title2);
80 /* Loads `file' into `icon_normal'. If `icon_greyed' is not NULL,
81 * combine `icon_normal' with some grey and then optionally with image
82 * `xis', and store it in `icon_greyed' (typically to produce a
83 * greyed-out, red-crossed version of `icon_normal') */
84 void CreateImages(WMScreen *scr, RContext *rc, RImage *xis, const char *file,
85 WMPixmap **icon_normal, WMPixmap **icon_greyed);
87 WMWindow *GetWindow(Panel *panel);
89 /* manipulate the dictionary for the WindowMaker domain */
91 WMPropList *GetObjectForKey(const char *defaultName);
93 void SetObjectForKey(WMPropList *object, const char *defaultName);
95 void RemoveObjectForKey(const char *defaultName);
97 char *GetStringForKey(const char *defaultName);
99 int GetIntegerForKey(const char *defaultName);
101 Bool GetBoolForKey(const char *defaultName);
103 int GetSpeedForKey(const char *defaultName);
105 void SetIntegerForKey(int value, const char *defaultName);
107 void SetStringForKey(const char *value, const char *defaultName);
109 void SetBoolForKey(Bool value, const char *defaultName);
111 void SetSpeedForKey(int speed, const char *defaultName);
114 /* ---[ KeyboardShortcuts.c ] -------------------------------------------- */
116 char *capture_shortcut(Display *dpy, Bool *capturing, Bool convert_case);
119 /* ---[ double.c ] ------------------------------------------------------- */
120 typedef struct W_DoubleTest DoubleTest;
122 DoubleTest *CreateDoubleTest(WMWidget *parent, const char *text);
125 /* ---[ main.c ] --------------------------------------------------------- */
126 void AddDeadChildHandler(pid_t pid, void (*handler)(void*), void *data);
129 /* ---[ xmodifier.c ] ---------------------------------------------------- */
130 int ModifierFromKey(Display * dpy, const char *key);
133 /* ---[ Panel Initializers ]---------------------------------------------- */
135 void Initialize(WMScreen *scr);
137 /* in alphabetical order - in case you'd want to add one */
138 Panel *InitAppearance(WMScreen *scr, WMWidget *parent);
139 Panel *InitConfigurations(WMScreen *scr, WMWidget *parent);
140 Panel *InitDocks(WMScreen *scr, WMWidget *parent);
141 Panel *InitExpert(WMScreen *scr, WMWidget *parent);
142 Panel *InitFocus(WMScreen *scr, WMWidget *parent);
143 Panel *InitFontSimple(WMScreen *scr, WMWidget *parent);
144 Panel *InitIcons(WMScreen *scr, WMWidget *parent);
145 Panel *InitKeyboardShortcuts(WMScreen *scr, WMWidget *parent);
146 Panel *InitMenu(WMScreen *scr, WMWidget *parent);
147 Panel *InitMenuPreferences(WMScreen *scr, WMWidget *parent);
148 Panel *InitMouseSettings(WMScreen *scr, WMWidget *parent);
149 Panel *InitPaths(WMScreen *scr, WMWidget *parent);
150 Panel *InitPreferences(WMScreen *scr, WMWidget *parent);
151 Panel *InitWindowHandling(WMScreen *scr, WMWidget *parent);
152 Panel *InitWorkspace(WMScreen *scr, WMWidget *parent);
155 #define FRAME_TOP 105
156 #define FRAME_LEFT -2
157 #define FRAME_WIDTH 524
158 #define FRAME_HEIGHT 235
159 #endif /* WPREFS_H_ */