Files
wmaker/src/WindowMaker.h
T

462 lines
14 KiB
C
Raw Normal View History

1998-09-29 22:36:29 +00:00
/*
1998-10-21 14:43:47 +00:00
* Window Maker window manager
2004-10-12 21:28:27 +00:00
*
2003-01-16 23:30:45 +00:00
* Copyright (c) 1997-2003 Alfredo K. Kojima
2004-10-12 21:28:27 +00:00
*
1998-09-29 22:36:29 +00:00
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1998-09-29 22:36:29 +00:00
*/
#ifndef WINDOWMAKER_H_
#define WINDOWMAKER_H_
#include "wconfig.h"
#include <assert.h>
#include <limits.h>
#include <WINGs/WINGs.h>
1998-09-29 22:36:29 +00:00
/* class codes */
typedef enum {
WCLASS_UNKNOWN = 0,
2004-10-12 21:28:27 +00:00
WCLASS_WINDOW = 1, /* managed client windows */
WCLASS_MENU = 2, /* root menus */
WCLASS_APPICON = 3,
WCLASS_DUMMYWINDOW = 4, /* window that holds window group leader */
WCLASS_MINIWINDOW = 5,
WCLASS_DOCK_ICON = 6,
WCLASS_PAGER = 7,
WCLASS_TEXT_INPUT = 8,
WCLASS_FRAME = 9
1998-09-29 22:36:29 +00:00
} WClassType;
/*
* generic window levels (a superset of the N*XTSTEP ones)
* Applications should use levels between WMDesktopLevel and
* WMScreensaverLevel anything boyond that range is allowed,
* but discouraged.
*/
1998-11-23 11:32:19 +00:00
enum {
2004-10-12 21:28:27 +00:00
WMBackLevel = INT_MIN+1, /* Very lowest level */
WMDesktopLevel = -1000, /* Lowest level of normal use */
WMSunkenLevel = -1,
WMNormalLevel = 0,
WMFloatingLevel = 3,
WMDockLevel = 5,
2004-10-16 22:16:11 +00:00
WMSubmenuLevel = 15,
2004-10-12 21:28:27 +00:00
WMMainMenuLevel = 20,
WMStatusLevel = 21,
2004-10-18 01:30:02 +00:00
WMFullscreenLevel = 50,
2004-10-12 21:28:27 +00:00
WMModalLevel = 100,
WMPopUpLevel = 101,
WMScreensaverLevel = 1000,
WMOuterSpaceLevel = INT_MAX
1998-11-23 11:32:19 +00:00
};
1998-09-29 22:36:29 +00:00
/*
* WObjDescriptor will be used by the event dispatcher to
2004-10-12 21:28:27 +00:00
* send events to a particular object through the methods in the
1998-09-29 22:36:29 +00:00
* method table. If all objects of the same class share the
* same methods, the class method table should be used, otherwise
* a new method table must be created for each object.
* It is also assigned to find the parent structure of a given
* window (like the WWindow or WMenu for a button)
*/
typedef struct WObjDescriptor {
2004-10-12 21:28:27 +00:00
void *self; /* the object that will be called */
/* event handlers */
1998-09-29 22:36:29 +00:00
void (*handle_expose)(struct WObjDescriptor *sender, XEvent *event);
void (*handle_mousedown)(struct WObjDescriptor *sender, XEvent *event);
void (*handle_enternotify)(struct WObjDescriptor *sender, XEvent *event);
void (*handle_leavenotify)(struct WObjDescriptor *sender, XEvent *event);
WClassType parent_type; /* type code of the parent */
void *parent; /* parent object (WWindow or WMenu) */
} WObjDescriptor;
/* internal buttons */
#define WBUT_CLOSE 0
#define WBUT_BROKENCLOSE 1
#define WBUT_ICONIFY 2
#define WBUT_KILL 3
1999-05-20 23:30:53 +00:00
#ifdef XKB_BUTTON_HINT
#define WBUT_XKBGROUP1 4
#define WBUT_XKBGROUP2 5
#define WBUT_XKBGROUP3 6
#define WBUT_XKBGROUP4 7
1999-05-22 21:30:35 +00:00
#define PRED_BPIXMAPS 8 /* reserved for 4 groups */
1999-05-20 23:30:53 +00:00
#else
1998-09-29 22:36:29 +00:00
#define PRED_BPIXMAPS 4 /* count of WBUT icons */
1999-05-20 23:30:53 +00:00
#endif /* XKB_BUTTON_HINT */
1998-09-29 22:36:29 +00:00
/* cursors */
#define WCUR_DEFAULT 0
#define WCUR_NORMAL 0
#define WCUR_MOVE 1
#define WCUR_RESIZE 2
#define WCUR_TOPLEFTRESIZE 3
#define WCUR_TOPRIGHTRESIZE 4
#define WCUR_BOTTOMLEFTRESIZE 5
#define WCUR_BOTTOMRIGHTRESIZE 6
#define WCUR_VERTICALRESIZE 7
#define WCUR_HORIZONRESIZE 8
#define WCUR_WAIT 9
#define WCUR_ARROW 10
#define WCUR_QUESTION 11
#define WCUR_TEXT 12
#define WCUR_SELECT 13
#define WCUR_ROOT 14
#define WCUR_EMPTY 15
#define WCUR_LAST 16
1998-09-29 22:36:29 +00:00
/* geometry displays */
#define WDIS_NEW 0 /* new style */
#define WDIS_CENTER 1 /* center of screen */
#define WDIS_TOPLEFT 2 /* top left corner of screen */
#define WDIS_FRAME_CENTER 3 /* center of the frame */
#define WDIS_NONE 4
1998-09-29 22:36:29 +00:00
/* keyboard input focus mode */
#define WKF_CLICK 0
#define WKF_SLOPPY 2
2001-05-14 14:58:55 +00:00
/* colormap change mode */
#define WCM_CLICK 0
#define WCM_POINTER 1
1998-09-29 22:36:29 +00:00
/* window placement mode */
#define WPM_MANUAL 0
#define WPM_CASCADE 1
#define WPM_SMART 2
#define WPM_RANDOM 3
1999-09-17 16:18:37 +00:00
#define WPM_AUTO 4
2012-06-10 18:04:59 +03:00
#define WPM_CENTER 5
1998-09-29 22:36:29 +00:00
/* text justification */
#define WTJ_CENTER 0
#define WTJ_LEFT 1
#define WTJ_RIGHT 2
/* iconification styles */
#define WIS_ZOOM 0
#define WIS_TWIST 1
#define WIS_FLIP 2
#define WIS_NONE 3
1998-11-27 12:26:46 +00:00
#define WIS_RANDOM 4 /* secret */
1998-09-29 22:36:29 +00:00
/* switchmenu actions */
#define ACTION_ADD 0
#define ACTION_REMOVE 1
#define ACTION_CHANGE 2
#define ACTION_CHANGE_WORKSPACE 3
1998-09-29 22:36:29 +00:00
#define ACTION_CHANGE_STATE 4
/* speeds */
#define SPEED_ULTRAFAST 0
#define SPEED_FAST 1
#define SPEED_MEDIUM 2
#define SPEED_SLOW 3
#define SPEED_ULTRASLOW 4
/* window states */
#define WS_FOCUSED 0
#define WS_UNFOCUSED 1
#define WS_PFOCUSED 2
/* clip title colors */
#define CLIP_NORMAL 0
#define CLIP_COLLAPSED 1
1998-09-29 22:36:29 +00:00
/* icon yard position */
#define IY_VERT 1
#define IY_HORIZ 0
#define IY_TOP 2
#define IY_BOTTOM 0
#define IY_RIGHT 4
#define IY_LEFT 0
1999-04-11 03:01:22 +00:00
/* menu styles */
#define MS_NORMAL 0
#define MS_SINGLE_TEXTURE 1
#define MS_FLAT 2
/* workspace actions */
#define WA_NONE 0
#define WA_SELECT_WINDOWS 1
#define WA_OPEN_APPMENU 2
#define WA_OPEN_WINLISTMENU 3
#define WA_SWITCH_WORKSPACES 4
1999-04-11 03:01:22 +00:00
1999-04-25 21:43:50 +00:00
/* workspace display position */
#define WD_NONE 0
#define WD_CENTER 1
#define WD_TOP 2
#define WD_BOTTOM 3
#define WD_TOPLEFT 4
#define WD_TOPRIGHT 5
#define WD_BOTTOMLEFT 6
#define WD_BOTTOMRIGHT 7
2010-09-10 20:51:08 +04:00
/* titlebar style */
#define TS_NEW 0
#define TS_OLD 1
#define TS_NEXT 2
1999-04-25 21:43:50 +00:00
/* workspace border position */
#define WB_NONE 0
#define WB_LEFTRIGHT 1
#define WB_TOPBOTTOM 2
#define WB_ALLDIRS (WB_LEFTRIGHT|WB_TOPBOTTOM)
1998-10-21 14:43:47 +00:00
/* program states */
#define WSTATE_NORMAL 0
#define WSTATE_NEED_EXIT 1
#define WSTATE_NEED_RESTART 2
#define WSTATE_EXITING 3
#define WSTATE_RESTARTING 4
1999-03-09 14:58:01 +00:00
#define WSTATE_MODAL 5
2001-01-30 03:04:02 +00:00
#define WSTATE_NEED_REREAD 6
1999-03-09 14:58:01 +00:00
#define WCHECK_STATE(state) (state == WProgramState)
2001-03-14 02:54:54 +00:00
#define WCHANGE_STATE(nstate) {\
if (WProgramState == WSTATE_NORMAL\
2004-10-12 21:28:27 +00:00
|| nstate != WSTATE_MODAL)\
WProgramState = (nstate); \
2001-03-14 02:54:54 +00:00
if (WProgramSigState != 0)\
2004-10-12 21:28:27 +00:00
WProgramState = WProgramSigState;\
2001-03-14 02:54:54 +00:00
}
/* only call inside signal handlers, with signals blocked */
#define SIG_WCHANGE_STATE(nstate) {\
WProgramSigState = (nstate);\
WProgramState = (nstate);\
}
1998-09-29 22:36:29 +00:00
/* Flags for the Window Maker state when restarting/crash situations */
#define WFLAGS_NONE (0)
#define WFLAGS_CRASHED (1<<0)
1999-04-03 03:51:17 +00:00
/* notifications */
#ifdef MAINFILE
#define NOTIFICATION(n) char *WN##n = #n
#else
#define NOTIFICATION(n) extern char *WN##n
#endif
NOTIFICATION(WindowAppearanceSettingsChanged);
NOTIFICATION(IconAppearanceSettingsChanged);
NOTIFICATION(IconTileSettingsChanged);
NOTIFICATION(MenuAppearanceSettingsChanged);
NOTIFICATION(MenuTitleAppearanceSettingsChanged);
/* appearance settings clientdata flags */
enum {
WFontSettings = 1 << 0,
2004-10-12 21:28:27 +00:00
WTextureSettings = 1 << 1,
WColorSettings = 1 << 2
1999-04-03 03:51:17 +00:00
};
1999-01-06 15:22:33 +00:00
typedef struct {
int x1, y1;
int x2, y2;
} WArea;
1998-09-29 22:36:29 +00:00
typedef struct WCoord {
int x, y;
} WCoord;
typedef struct WPreferences {
2010-01-09 13:12:20 +01:00
char *pixmap_path; /* : separated list of paths to find pixmaps */
char *icon_path; /* : separated list of paths to find icons */
WMArray *fallbackWMs; /* fallback window manager list */
1999-10-20 03:25:06 +00:00
char *logger_shell; /* shell to log child stdi/o */
1999-03-20 02:41:23 +00:00
RImage *button_images; /* titlebar button images */
char smooth_workspace_back;
2010-01-09 13:12:20 +01:00
signed char size_display; /* display type for resize geometry */
signed char move_display; /* display type for move geometry */
signed char window_placement; /* window placement mode */
signed char colormap_mode; /* colormap focus mode */
signed char focus_mode; /* window focusing mode */
1998-09-29 22:36:29 +00:00
2010-01-09 13:12:20 +01:00
char opaque_move; /* update window position during move */
2011-03-30 00:06:18 +02:00
char opaque_resize; /* update window position during resize */
char opaque_move_resize_keyboard; /* update window position during move,resize with keyboard */
1998-09-29 22:36:29 +00:00
char wrap_menus; /* wrap menus at edge of screen */
char scrollable_menus; /* let them be scrolled */
2012-02-10 11:02:25 +00:00
char vi_key_menus; /* use h/j/k/l to select */
1998-09-29 22:36:29 +00:00
char align_menus; /* align menu with their parents */
2010-01-09 13:12:20 +01:00
char use_saveunders; /* turn on SaveUnders for menus, icons etc. */
1998-11-27 12:26:46 +00:00
char no_window_over_dock;
1998-09-29 22:36:29 +00:00
char no_window_over_icons;
2010-01-09 13:12:20 +01:00
WCoord window_place_origin; /* Offset for windows placed on screen */
1998-09-29 22:36:29 +00:00
2010-01-09 13:12:20 +01:00
char constrain_window_size; /* don't let windows get bigger than screen */
2000-04-07 22:47:04 +00:00
char windows_cycling; /* windoze cycling */
2000-03-03 20:55:35 +00:00
char circ_raise; /* raise window after Alt-tabbing */
1998-09-29 22:36:29 +00:00
char ignore_focus_click;
2010-01-09 13:12:20 +01:00
char open_transients_with_parent; /* open transient window in same workspace as parent */
signed char title_justification; /* titlebar text alignment */
int window_title_clearance;
int window_title_min_height;
int window_title_max_height;
int menu_title_clearance;
int menu_title_min_height;
int menu_title_max_height;
int menu_text_clearance;
char multi_byte_text;
1998-11-03 12:53:26 +00:00
#ifdef KEEP_XKB_LOCK_STATUS
char modelock;
#endif
1998-09-29 22:36:29 +00:00
char no_dithering; /* use dithering or not */
char no_animations; /* enable/disable animations */
char no_autowrap; /* wrap workspace when window is moved to the edge */
2004-10-12 21:28:27 +00:00
char highlight_active_app; /* show the focused app by highlighting its icon */
1998-09-29 22:36:29 +00:00
char auto_arrange_icons; /* automagically arrange icons */
char icon_box_position; /* position to place icons */
signed char iconification_style; /* position to place icons */
1999-01-06 15:22:33 +00:00
char disable_root_mouse; /* disable button events in root window */
1998-09-29 22:36:29 +00:00
char auto_focus; /* focus window when it's mapped */
char *icon_back_file; /* background image for icons */
WCoord *root_menu_pos; /* initial position of the root menu*/
WCoord *app_menu_pos;
WCoord *win_menu_pos;
2004-10-12 21:28:27 +00:00
2010-01-09 13:12:20 +01:00
signed char icon_yard; /* aka iconbox */
1998-09-29 22:36:29 +00:00
int raise_delay; /* delay for autoraise. 0 is disabled */
2010-01-09 13:12:20 +01:00
int cmap_size; /* size of dithering colormap in colors per channel */
1998-09-29 22:36:29 +00:00
int icon_size; /* size of the icon */
signed char menu_style; /* menu decoration style */
signed char workspace_name_display_position;
1999-04-25 21:43:50 +00:00
unsigned int modifier_mask; /* mask to use as kbd modifier */
2010-11-16 20:42:04 -05:00
char *modifier_labels[7]; /* Names of the modifiers */
1999-04-25 21:43:50 +00:00
1998-09-29 22:36:29 +00:00
char ws_advance; /* Create new workspace and advance */
char ws_cycle; /* Cycle existing workspaces */
char save_session_on_exit; /* automatically save session on exit */
char sticky_icons; /* If miniwindows will be onmipresent */
char dont_confirm_kill; /* do not confirm Kill application */
char disable_miniwindows;
char dont_blink; /* do not blink icon selection */
2004-10-12 21:28:27 +00:00
1998-09-29 22:36:29 +00:00
/* Appearance options */
char new_style; /* Use newstyle buttons */
char superfluous; /* Use superfluous things */
/* root window mouse bindings */
signed char mouse_button1; /* action for left mouse button */
signed char mouse_button2; /* action for middle mouse button */
signed char mouse_button3; /* action for right mouse button */
signed char mouse_wheel; /* action for mouse wheel */
1998-09-29 22:36:29 +00:00
/* balloon text */
char window_balloon;
char miniwin_balloon;
char appicon_balloon;
1999-04-25 21:43:50 +00:00
char help_balloon;
2004-10-12 21:28:27 +00:00
1998-09-29 22:36:29 +00:00
/* some constants */
int dblclick_time; /* double click delay time in ms */
/* animate menus */
signed char menu_scroll_speed; /* how fast menus are scrolled */
1998-09-29 22:36:29 +00:00
/* animate icon sliding */
signed char icon_slide_speed; /* icon slide animation speed */
1998-09-29 22:36:29 +00:00
/* shading animation */
signed char shade_speed;
2010-09-17 14:55:45 -04:00
/* bouncing animation */
char bounce_appicons_when_urgent;
2010-09-17 15:33:13 -04:00
char raise_appicons_when_bouncing;
2012-02-23 11:52:11 +01:00
char do_not_make_appicons_bounce;
2010-09-17 14:55:45 -04:00
1998-09-29 22:36:29 +00:00
int edge_resistance;
2009-10-11 21:36:46 +02:00
int resize_increment;
1999-07-14 14:42:29 +00:00
char attract;
unsigned int workspace_border_size; /* Size in pixels of the workspace border */
char workspace_border_position; /* Where to leave a workspace border */
char single_click; /* single click to lauch applications */
2007-08-14 15:15:37 +04:00
int history_lines; /* history of "Run..." dialog */
2010-04-02 08:38:08 +02:00
char cycle_active_head_only; /* Cycle only windows on the active head */
char cycle_ignore_minimized; /* Ignore minimized windows when cycling */
RImage *swtileImage;
RImage *swbackImage[9];
2010-09-10 20:51:04 +04:00
int show_clip_title;
1998-09-29 22:36:29 +00:00
struct {
unsigned int nodock:1; /* don't display the dock */
2000-04-08 03:48:59 +00:00
unsigned int noclip:1; /* don't display the clip */
2004-10-12 21:28:27 +00:00
unsigned int noupdates:1; /* don't require ~/GNUstep (-static) */
unsigned int noautolaunch:1; /* don't autolaunch apps */
unsigned int norestore:1; /* don't restore session */
2010-03-18 19:18:18 +01:00
#ifndef HAVE_INOTIFY
unsigned int nopolling:1; /* don't poll the defaults database for changes */
#endif
2004-10-13 05:09:08 +00:00
unsigned int restarting:2;
1998-09-29 22:36:29 +00:00
} flags; /* internal flags */
} WPreferences;
/****** Global Variables ******/
extern Display *dpy;
extern unsigned int ValidModMask;
1999-03-09 14:58:01 +00:00
extern char WProgramState;
2001-03-14 04:19:06 +00:00
extern char WProgramSigState;
1998-09-29 22:36:29 +00:00
/****** Notifications ******/
extern const char *WMNManaged;
extern const char *WMNUnmanaged;
extern const char *WMNChangedWorkspace;
extern const char *WMNChangedState;
extern const char *WMNChangedFocus;
extern const char *WMNChangedStacking;
extern const char *WMNChangedName;
extern const char *WMNWorkspaceCreated;
extern const char *WMNWorkspaceDestroyed;
extern const char *WMNWorkspaceChanged;
extern const char *WMNWorkspaceNameChanged;
extern const char *WMNResetStacking;
1998-09-29 22:36:29 +00:00
#endif