Added reset of pointer after memory free to avoid double-free crash
[wmaker-crm.git] / WPrefs.app / WPrefs.h
blob900afdcbd6d0e34a7425b1a8d0f5bcfce22a9838
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;
72 void AddSection(Panel *panel, char *iconFile);
74 char *LocateImage(char *name);
76 void SetButtonAlphaImage(WMScreen *scr, WMButton *bPtr, char *file,
77 char *title1, char *title2);
79 WMWindow *GetWindow(Panel *panel);
81 /* manipulate the dictionary for the WindowMaker domain */
83 WMPropList *GetObjectForKey(char *defaultName);
85 void SetObjectForKey(WMPropList *object, char *defaultName);
87 void RemoveObjectForKey(char *defaultName);
89 char *GetStringForKey(char *defaultName);
91 int GetIntegerForKey(char *defaultName);
93 Bool GetBoolForKey(char *defaultName);
95 int GetSpeedForKey(char *defaultName);
97 void SetIntegerForKey(int value, char *defaultName);
99 void SetStringForKey(char *value, char *defaultName);
101 void SetBoolForKey(Bool value, char *defaultName);
103 void SetSpeedForKey(int speed, char *defaultName);
107 void AddDeadChildHandler(pid_t pid, void (*handler)(void*), void *data);
110 #define FRAME_TOP 105
111 #define FRAME_LEFT -2
112 #define FRAME_WIDTH 524
113 #define FRAME_HEIGHT 235
114 #endif /* WPREFS_H_ */