Cleanup includes of wcore.h, defaults.h and pixmap.h
[wmaker-crm.git] / src / framewin.h
bloba0c586c4e09bc58346013b660b379c02f0cc7f51
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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19 * USA.
22 #ifndef WMFRAMEWINDOW_H_
23 #define WMFRAMEWINDOW_H_
25 #include "wcore.h"
26 #include "pixmap.h"
28 #define BORDER_TOP 1
29 #define BORDER_BOTTOM 2
30 #define BORDER_LEFT 4
31 #define BORDER_RIGHT 8
32 #define BORDER_ALL (1|2|4|8)
35 #define WFF_TITLEBAR (1<<0)
36 #define WFF_LEFT_BUTTON (1<<1)
37 #define WFF_RIGHT_BUTTON (1<<2)
38 #define WFF_RESIZEBAR (1<<3)
39 #define WFF_BORDER (1<<4)
40 #define WFF_SINGLE_STATE (1<<5)
41 #ifdef XKB_BUTTON_HINT
42 #define WFF_LANGUAGE_BUTTON (1<<6)
43 #endif
46 #define WFF_IS_SHADED (1<<16)
48 typedef struct WFrameWindow {
49 WScreen *screen_ptr; /* pointer to the screen structure */
51 WCoreWindow *core;
53 WCoreWindow *titlebar; /* the titlebar */
54 WCoreWindow *left_button; /* miniaturize button */
55 #ifdef XKB_BUTTON_HINT
56 WCoreWindow *language_button;
57 #endif
58 WCoreWindow *right_button; /* close button */
60 short workspace; /* workspace that the window occupies */
62 short top_width;
63 int *title_clearance;
64 short bottom_width;
66 short resizebar_corner_width;
68 WCoreWindow *resizebar; /* bottom resizebar */
70 Pixmap title_back[3]; /* focused, unfocused, pfocused */
71 Pixmap resizebar_back[3]; /* any, None, None */
72 Pixmap lbutton_back[3];
73 Pixmap rbutton_back[3];
74 #ifdef XKB_BUTTON_HINT
75 Pixmap languagebutton_back[3];
76 #endif
78 WPixmap *lbutton_image;
79 WPixmap *rbutton_image;
80 #ifdef XKB_BUTTON_HINT
81 WPixmap *languagebutton_image;
82 #endif
84 union WTexture **title_texture;
85 union WTexture **resizebar_texture;
86 WMColor **title_color;
87 WMFont **font;
89 char *title; /* window name (title) */
91 #ifdef KEEP_XKB_LOCK_STATUS
92 int languagemode;
93 int last_languagemode;
94 #endif /* KEEP_XKB_LOCK_STATUS */
96 /* thing that uses this frame. passed as data to callbacks */
97 void *child;
99 /* callbacks */
100 void (*on_click_left)(WCoreWindow *sender, void *data, XEvent *event);
101 #ifdef XKB_BUTTON_HINT
102 void (*on_click_language)(WCoreWindow *sender, void *data, XEvent *event);
103 #endif
105 void (*on_click_right)(WCoreWindow *sender, void *data, XEvent *event);
106 void (*on_dblclick_right)(WCoreWindow *sender, void *data, XEvent *event);
108 void (*on_mousedown_titlebar)(WCoreWindow *sender, void *data, XEvent *event);
109 void (*on_dblclick_titlebar)(WCoreWindow *sender, void *data, XEvent *event);
111 void (*on_mousedown_resizebar)(WCoreWindow *sender, void *data, XEvent *event);
113 struct {
114 unsigned int state:2; /* 3 possible states */
115 unsigned int justification:2;
116 unsigned int titlebar:1;
117 unsigned int resizebar:1;
118 unsigned int left_button:1;
119 unsigned int right_button:1;
120 #ifdef XKB_BUTTON_HINT
121 unsigned int language_button:1;
122 #endif
124 unsigned int need_texture_remake:1;
126 unsigned int single_texture:1;
128 unsigned int hide_left_button:1;
129 unsigned int hide_right_button:1;
130 #ifdef XKB_BUTTON_HINT
131 unsigned int hide_language_button:1;
132 #endif
134 unsigned int need_texture_change:1;
136 unsigned int lbutton_dont_fit:1;
137 unsigned int rbutton_dont_fit:1;
138 #ifdef XKB_BUTTON_HINT
139 unsigned int languagebutton_dont_fit:1;
140 #endif
142 unsigned int repaint_only_titlebar:1;
143 unsigned int repaint_only_resizebar:1;
145 unsigned int is_client_window_frame:1;
147 unsigned int incomplete_title:1;
148 } flags;
149 } WFrameWindow;
152 WFrameWindow*
153 wFrameWindowCreate(WScreen *scr, int wlevel, int x, int y,
154 int width, int height, int *clearance, int flags,
155 union WTexture **title_texture,
156 union WTexture **resize_texture,
157 WMColor **color, WMFont **font);
159 void wFrameWindowUpdateBorders(WFrameWindow *fwin, int flags);
161 void wFrameWindowDestroy(WFrameWindow *fwin);
163 void wFrameWindowChangeState(WFrameWindow *fwin, int state);
165 void wFrameWindowPaint(WFrameWindow *fwin);
167 void wFrameWindowConfigure(WFrameWindow *fwin, int x, int y, int width, int height);
169 void wFrameWindowResize(WFrameWindow *fwin, int width, int height);
171 void wFrameWindowShowButton(WFrameWindow *fwin, int flags);
173 void wFrameWindowHideButton(WFrameWindow *fwin, int flags);
175 int wFrameWindowChangeTitle(WFrameWindow *fwin, char *new_title);
177 #ifdef XKB_BUTTON_HINT
178 void wFrameWindowUpdateLanguageButton(WFrameWindow *fwin);
179 #endif
181 #endif