Don't save app settings proplist when nothing changed
[wmaker-crm.git] / src / framewin.h
blobf01e26757bd013af5dc21a7bd99991b5e56bb7cf
1 /*
2 * Window Maker window manager
4 * Copyright (c) 1997-2003 Alfredo K. Kojima
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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 #ifndef WMFRAMEWINDOW_H_
22 #define WMFRAMEWINDOW_H_
24 #include "wcore.h"
25 #include "pixmap.h"
27 #define BORDER_TOP 1
28 #define BORDER_BOTTOM 2
29 #define BORDER_LEFT 4
30 #define BORDER_RIGHT 8
31 #define BORDER_ALL (1|2|4|8)
34 #define WFF_TITLEBAR (1<<0)
35 #define WFF_LEFT_BUTTON (1<<1)
36 #define WFF_RIGHT_BUTTON (1<<2)
37 #define WFF_RESIZEBAR (1<<3)
38 #define WFF_BORDER (1<<4)
39 #define WFF_SINGLE_STATE (1<<5)
40 #ifdef XKB_BUTTON_HINT
41 #define WFF_LANGUAGE_BUTTON (1<<6)
42 #endif
45 #define WFF_IS_SHADED (1<<16)
47 typedef struct WFrameWindow {
48 WScreen *screen_ptr; /* pointer to the screen structure */
50 WCoreWindow *core;
52 WCoreWindow *titlebar; /* the titlebar */
53 WCoreWindow *left_button; /* miniaturize button */
54 #ifdef XKB_BUTTON_HINT
55 WCoreWindow *language_button;
56 #endif
57 WCoreWindow *right_button; /* close button */
59 short workspace; /* workspace that the window occupies */
61 short top_width;
62 int *title_clearance;
63 short bottom_width;
65 short resizebar_corner_width;
67 WCoreWindow *resizebar; /* bottom resizebar */
69 Pixmap title_back[3]; /* focused, unfocused, pfocused */
70 Pixmap resizebar_back[3]; /* any, None, None */
71 Pixmap lbutton_back[3];
72 Pixmap rbutton_back[3];
73 #ifdef XKB_BUTTON_HINT
74 Pixmap languagebutton_back[3];
75 #endif
77 WPixmap *lbutton_image;
78 WPixmap *rbutton_image;
79 #ifdef XKB_BUTTON_HINT
80 WPixmap *languagebutton_image;
81 #endif
83 union WTexture **title_texture;
84 union WTexture **resizebar_texture;
85 WMColor **title_color;
86 WMFont **font;
88 char *title; /* window name (title) */
90 #ifdef KEEP_XKB_LOCK_STATUS
91 int languagemode;
92 int last_languagemode;
93 #endif /* KEEP_XKB_LOCK_STATUS */
95 /* thing that uses this frame. passed as data to callbacks */
96 void *child;
98 /* callbacks */
99 void (*on_click_left)(WCoreWindow *sender, void *data, XEvent *event);
100 #ifdef XKB_BUTTON_HINT
101 void (*on_click_language)(WCoreWindow *sender, void *data, XEvent *event);
102 #endif
104 void (*on_click_right)(WCoreWindow *sender, void *data, XEvent *event);
105 void (*on_dblclick_right)(WCoreWindow *sender, void *data, XEvent *event);
107 void (*on_mousedown_titlebar)(WCoreWindow *sender, void *data, XEvent *event);
108 void (*on_dblclick_titlebar)(WCoreWindow *sender, void *data, XEvent *event);
110 void (*on_mousedown_resizebar)(WCoreWindow *sender, void *data, XEvent *event);
112 struct {
113 unsigned int state:2; /* 3 possible states */
114 unsigned int justification:2;
115 unsigned int titlebar:1;
116 unsigned int resizebar:1;
117 unsigned int left_button:1;
118 unsigned int right_button:1;
119 #ifdef XKB_BUTTON_HINT
120 unsigned int language_button:1;
121 #endif
123 unsigned int need_texture_remake:1;
125 unsigned int single_texture:1;
127 unsigned int hide_left_button:1;
128 unsigned int hide_right_button:1;
129 #ifdef XKB_BUTTON_HINT
130 unsigned int hide_language_button:1;
131 #endif
133 unsigned int need_texture_change:1;
135 unsigned int lbutton_dont_fit:1;
136 unsigned int rbutton_dont_fit:1;
137 #ifdef XKB_BUTTON_HINT
138 unsigned int languagebutton_dont_fit:1;
139 #endif
141 unsigned int repaint_only_titlebar:1;
142 unsigned int repaint_only_resizebar:1;
144 unsigned int is_client_window_frame:1;
146 unsigned int incomplete_title:1;
147 } flags;
148 } WFrameWindow;
151 WFrameWindow*
152 wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
153 int width, int height, int *clearance, int flags,
154 union WTexture **title_texture,
155 union WTexture **resize_texture,
156 WMColor **color, WMFont **font);
158 void wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags);
160 void wFrameWindowDestroy(WFrameWindow *fwin);
162 void wFrameWindowChangeState(WFrameWindow *fwin, int state);
164 void wFrameWindowPaint(WFrameWindow *fwin);
166 void wFrameWindowConfigure(WFrameWindow *fwin, int x, int y, int width, int height);
168 void wFrameWindowResize(WFrameWindow *fwin, int width, int height);
170 void wFrameWindowShowButton(WFrameWindow *fwin, int flags);
172 void wFrameWindowHideButton(WFrameWindow *fwin, int flags);
174 int wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title);
176 #ifdef XKB_BUTTON_HINT
177 void wFrameWindowUpdateLanguageButton(WFrameWindow *fwin);
178 #endif
180 #endif