1999-08-17 15:56:46 -07:00
|
|
|
/*****************************************************************************/
|
|
|
|
/* Enlightenment - The Window Manager that dares to do what others don't */
|
|
|
|
/*****************************************************************************/
|
1999-10-04 15:06:00 -07:00
|
|
|
/*
|
2007-01-13 11:14:29 -08:00
|
|
|
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
|
|
|
|
* Copyright (C) 2004-2007 Kim Woelders
|
2000-04-05 16:22:56 -07:00
|
|
|
*
|
1999-10-04 15:06:00 -07:00
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
2000-04-05 16:22:56 -07:00
|
|
|
*
|
1999-10-04 15:06:00 -07:00
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies of the Software, its documentation and marketing & publicity
|
|
|
|
* materials, and acknowledgment shall be given in the documentation, materials
|
|
|
|
* and software packages that this Software was used.
|
2000-04-05 16:22:56 -07:00
|
|
|
*
|
1999-10-04 15:06:00 -07:00
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
2007-01-16 17:10:44 -08:00
|
|
|
#ifndef _GNU_SOURCE
|
2004-02-28 17:30:18 -08:00
|
|
|
#define _GNU_SOURCE
|
2007-01-16 17:10:44 -08:00
|
|
|
#endif
|
2003-07-15 11:35:04 -07:00
|
|
|
#include "config.h"
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2006-04-19 12:13:46 -07:00
|
|
|
#include "alert.h"
|
2006-11-19 13:55:52 -08:00
|
|
|
#include "edebug.h"
|
2006-04-19 12:13:46 -07:00
|
|
|
#include "lang.h"
|
2007-08-23 11:48:21 -07:00
|
|
|
#include "sound.h"
|
2006-04-19 12:13:46 -07:00
|
|
|
#include "util.h"
|
2004-12-28 15:46:49 -08:00
|
|
|
|
2006-04-19 12:13:46 -07:00
|
|
|
#define USE_EXT_INIT_WIN 1
|
2004-03-13 14:49:48 -08:00
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/extensions/shape.h>
|
2004-12-28 15:46:49 -08:00
|
|
|
|
2007-07-18 04:18:50 -07:00
|
|
|
#ifdef HAVE_SM
|
|
|
|
#define USE_SM 1
|
|
|
|
#endif
|
|
|
|
|
2006-12-27 08:34:48 -08:00
|
|
|
#ifdef HAVE_XSYNC
|
2007-07-18 04:18:50 -07:00
|
|
|
#define USE_XSYNC 1
|
2006-03-19 07:33:38 -08:00
|
|
|
#endif
|
|
|
|
|
2006-12-27 08:34:48 -08:00
|
|
|
#ifdef HAVE_XSCREENSAVER
|
2006-03-19 07:33:38 -08:00
|
|
|
#define USE_XSCREENSAVER 1 /* Experimental */
|
|
|
|
#endif
|
|
|
|
|
2006-12-27 08:34:48 -08:00
|
|
|
#ifdef HAVE_XRANDR
|
2004-03-13 14:49:48 -08:00
|
|
|
#ifdef HAVE_X11_EXTENSIONS_XRANDR_H
|
|
|
|
#define USE_XRANDR 1
|
|
|
|
#endif
|
|
|
|
#endif
|
2004-02-28 07:14:02 -08:00
|
|
|
|
2006-12-27 08:34:48 -08:00
|
|
|
#ifdef HAVE_COMPOSITE
|
2004-12-28 15:46:49 -08:00
|
|
|
#define USE_COMPOSITE 1
|
|
|
|
#endif
|
|
|
|
|
2007-02-24 18:27:41 -08:00
|
|
|
#ifdef HAVE_GLX
|
|
|
|
#define USE_GLX 1
|
|
|
|
#endif
|
|
|
|
|
2006-07-24 14:10:59 -07:00
|
|
|
#include "xwin.h"
|
2006-04-29 12:39:21 -07:00
|
|
|
|
2005-04-15 16:59:59 -07:00
|
|
|
#define ENABLE_COLOR_MODIFIERS 0 /* Not functional */
|
|
|
|
|
2004-02-11 17:17:21 -08:00
|
|
|
#define ENABLE_TRANSPARENCY 1
|
|
|
|
#define ENABLE_THEME_TRANSPARENCY 1
|
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
/* sgi's stdio.h has:
|
|
|
|
*
|
|
|
|
* #if _SGIAPI && _NO_ANSIMODE
|
|
|
|
* extern int vsnprintf(char *, ssize_t, const char *, char *);
|
|
|
|
* #endif
|
|
|
|
*
|
|
|
|
* so workaround...
|
|
|
|
*/
|
1999-08-30 17:02:54 -07:00
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
#ifdef __sgi
|
|
|
|
#ifdef _NO_ANSIMODE
|
|
|
|
#undef _NO_ANSIMODE
|
|
|
|
#endif
|
|
|
|
#endif
|
1999-08-30 17:02:54 -07:00
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
2004-03-11 15:44:19 -08:00
|
|
|
#include <unistd.h>
|
1999-08-17 15:56:46 -07:00
|
|
|
|
|
|
|
#ifndef HAVE_GETCWD
|
|
|
|
#error "ERROR: Enlightenment needs a system with getcwd() in it's libs."
|
|
|
|
#error "You may have to upgrade your Operating system, Distribution, base"
|
|
|
|
#error "system libraries etc. Please see the the instructions for your"
|
|
|
|
#error "particular Operating System or Distribution"
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_MKDIR
|
|
|
|
#error "ERROR: Enlightenment needs a system with mkdir() in it's libs."
|
|
|
|
#error "You may have to upgrade your Operating system, Distribution, base"
|
|
|
|
#error "system libraries etc. Please see the the instructions for your"
|
|
|
|
#error "particular Operating System or Distribution"
|
|
|
|
#endif
|
|
|
|
|
2006-08-24 14:32:28 -07:00
|
|
|
#ifndef HAVE_STRCASESTR
|
|
|
|
# define strcasestr(haystack, needle) strstr(haystack, needle)
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_STRCASECMP
|
|
|
|
# define strcasecmp(s1, s2) strcmp(s1, s2)
|
|
|
|
#endif
|
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
#define FILEPATH_LEN_MAX 4096
|
2004-12-28 15:46:49 -08:00
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
#ifndef MAX
|
|
|
|
#define MAX(a,b) ((a)>(b)?(a):(b))
|
|
|
|
#endif
|
2000-06-04 12:45:55 -07:00
|
|
|
#ifndef MIN
|
|
|
|
#define MIN(a,b) ((a)<(b)?(a):(b))
|
|
|
|
#endif
|
1999-08-17 15:56:46 -07:00
|
|
|
|
|
|
|
#define IN_RANGE(a, b, range) \
|
|
|
|
((((a) > (b)) && ((a) - (b) <= (range))) || \
|
|
|
|
(((a) <= (b)) && ((b) - (a) <= (range))))
|
|
|
|
|
|
|
|
#define IN_ABOVE(a, b, range) \
|
|
|
|
(((a) >= (b)) && ((a) - (b) <= (range)))
|
|
|
|
|
|
|
|
#define IN_BELOW(a, b, range) \
|
|
|
|
(((a) <= (b)) && ((b) - (a) <= (range)))
|
|
|
|
|
|
|
|
#define SPANS_COMMON(x1, w1, x2, w2) \
|
|
|
|
(!((((x2) + (w2)) <= (x1)) || ((x2) >= ((x1) + (w1)))))
|
|
|
|
|
|
|
|
#define STATE_NORMAL 0
|
|
|
|
#define STATE_HILITED 1
|
|
|
|
#define STATE_CLICKED 2
|
|
|
|
#define STATE_DISABLED 3
|
|
|
|
|
|
|
|
#define FLAG_BUTTON 0
|
|
|
|
#define FLAG_TITLE 1
|
|
|
|
#define FLAG_MINIICON 2
|
|
|
|
#define FLAG_FIXED 4
|
|
|
|
#define FLAG_FIXED_HORIZ 8
|
|
|
|
#define FLAG_FIXED_VERT 16
|
|
|
|
|
2004-01-21 15:32:45 -08:00
|
|
|
#define MODE_FOCUS_POINTER 0
|
|
|
|
#define MODE_FOCUS_SLOPPY 1
|
|
|
|
#define MODE_FOCUS_CLICK 2
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2007-03-23 15:04:38 -07:00
|
|
|
#define EDGE_FLIP_OFF 0
|
|
|
|
#define EDGE_FLIP_ON 1
|
|
|
|
#define EDGE_FLIP_MOVE 2
|
|
|
|
|
1999-08-17 15:56:46 -07:00
|
|
|
#define DOCK_LEFT 0
|
|
|
|
#define DOCK_RIGHT 1
|
|
|
|
#define DOCK_UP 2
|
|
|
|
#define DOCK_DOWN 3
|
|
|
|
|
|
|
|
#define ICON_LEFT 0
|
|
|
|
#define ICON_RIGHT 1
|
|
|
|
#define ICON_UP 2
|
|
|
|
#define ICON_DOWN 3
|
|
|
|
|
|
|
|
#define MODE_NONE 0
|
2004-01-18 02:24:06 -08:00
|
|
|
#define MODE_MOVE_PENDING 1
|
|
|
|
#define MODE_MOVE 2
|
|
|
|
#define MODE_RESIZE 3
|
|
|
|
#define MODE_RESIZE_H 4
|
|
|
|
#define MODE_RESIZE_V 5
|
|
|
|
#define MODE_DESKDRAG 6
|
|
|
|
#define MODE_BUTTONDRAG 7
|
|
|
|
#define MODE_DESKRAY 8
|
|
|
|
#define MODE_PAGER_DRAG_PENDING 9
|
|
|
|
#define MODE_PAGER_DRAG 10
|
1999-08-17 15:56:46 -07:00
|
|
|
|
|
|
|
#define EVENT_MOUSE_DOWN 0
|
|
|
|
#define EVENT_MOUSE_UP 1
|
|
|
|
#define EVENT_MOUSE_ENTER 2
|
|
|
|
#define EVENT_MOUSE_LEAVE 3
|
|
|
|
#define EVENT_KEY_DOWN 4
|
|
|
|
#define EVENT_KEY_UP 5
|
|
|
|
#define EVENT_DOUBLE_DOWN 6
|
2005-08-10 12:33:33 -07:00
|
|
|
#define EVENT_FOCUS_IN 7
|
|
|
|
#define EVENT_FOCUS_OUT 8
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2006-03-19 07:33:38 -08:00
|
|
|
/* Server extensions */
|
|
|
|
#define XEXT_SHAPE 0
|
|
|
|
#define XEXT_SYNC 1
|
|
|
|
#define XEXT_SCRSAVER 2
|
|
|
|
#define XEXT_RANDR 3
|
|
|
|
#define XEXT_COMPOSITE 4
|
|
|
|
#define XEXT_DAMAGE 5
|
|
|
|
#define XEXT_FIXES 6
|
|
|
|
#define XEXT_RENDER 7
|
2007-02-24 18:27:41 -08:00
|
|
|
#define XEXT_GLX 8
|
|
|
|
|
2006-03-19 07:33:38 -08:00
|
|
|
#define XEXT_CM_ALL 16
|
|
|
|
|
|
|
|
#define XEXT_AVAILABLE(ext) (Mode.server.extensions & (1 << ext))
|
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/*
|
|
|
|
* Types
|
|
|
|
*/
|
2006-04-06 14:20:16 -07:00
|
|
|
#include "etypes.h"
|
2003-12-12 10:42:15 -08:00
|
|
|
|
2006-04-06 14:20:16 -07:00
|
|
|
typedef struct
|
2005-12-22 10:43:15 -08:00
|
|
|
{
|
|
|
|
int min, max;
|
|
|
|
}
|
|
|
|
Constraints;
|
|
|
|
|
2004-06-30 06:04:18 -07:00
|
|
|
typedef struct
|
|
|
|
{
|
2006-04-29 12:39:21 -07:00
|
|
|
Window xwin;
|
|
|
|
Win win;
|
2004-06-30 06:04:18 -07:00
|
|
|
Visual *vis;
|
|
|
|
int depth;
|
|
|
|
Colormap cmap;
|
|
|
|
int scr;
|
|
|
|
int w, h;
|
|
|
|
}
|
|
|
|
RealRoot;
|
|
|
|
|
|
|
|
typedef struct
|
2003-05-22 12:15:03 -07:00
|
|
|
{
|
2006-04-29 12:39:21 -07:00
|
|
|
Window xwin;
|
|
|
|
Win win;
|
2000-06-04 12:45:55 -07:00
|
|
|
Visual *vis;
|
|
|
|
int depth;
|
|
|
|
Colormap cmap;
|
|
|
|
int scr;
|
|
|
|
int w, h;
|
2007-04-07 06:19:30 -07:00
|
|
|
Pixmap pmap; /* Compositing buffer */
|
2003-05-22 12:15:03 -07:00
|
|
|
}
|
2004-06-30 06:04:18 -07:00
|
|
|
VirtRoot;
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-01-12 12:43:18 -08:00
|
|
|
/* Configuration parameters */
|
|
|
|
typedef struct
|
2003-05-22 12:15:03 -07:00
|
|
|
{
|
2007-01-27 20:59:46 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int step; /* Animation time step, ms */
|
|
|
|
} animation;
|
2004-01-12 12:43:18 -08:00
|
|
|
struct
|
2004-02-04 12:32:08 -08:00
|
|
|
{
|
|
|
|
char enable;
|
2004-12-28 15:46:49 -08:00
|
|
|
int delay; /* milliseconds */
|
2004-02-04 12:32:08 -08:00
|
|
|
} autoraise;
|
|
|
|
struct
|
2004-02-11 07:39:13 -08:00
|
|
|
{
|
|
|
|
char hiquality;
|
|
|
|
char user;
|
|
|
|
int timeout;
|
|
|
|
} backgrounds;
|
|
|
|
struct
|
2006-08-23 14:04:53 -07:00
|
|
|
{
|
|
|
|
int move_resistance;
|
|
|
|
} buttons;
|
|
|
|
struct
|
2004-01-12 12:43:18 -08:00
|
|
|
{
|
2005-09-04 00:27:20 -07:00
|
|
|
unsigned int num;
|
2004-02-06 11:56:26 -08:00
|
|
|
int dragdir;
|
|
|
|
int dragbar_width;
|
|
|
|
int dragbar_length;
|
2005-02-13 03:19:51 -08:00
|
|
|
int dragbar_ordering;
|
2005-01-02 07:38:52 -08:00
|
|
|
char desks_wraparound;
|
2004-02-06 11:56:26 -08:00
|
|
|
char slidein;
|
|
|
|
int slidespeed;
|
2005-01-02 07:38:52 -08:00
|
|
|
int areas_nx;
|
|
|
|
int areas_ny;
|
|
|
|
char areas_wraparound;
|
2007-03-23 15:04:38 -07:00
|
|
|
int edge_flip_mode;
|
2006-08-23 14:04:53 -07:00
|
|
|
int edge_flip_resistance;
|
2004-01-12 12:43:18 -08:00
|
|
|
} desks;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char headers;
|
2005-02-16 09:59:16 -08:00
|
|
|
char button_image;
|
2004-01-12 12:43:18 -08:00
|
|
|
} dialogs;
|
|
|
|
struct
|
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
char enable; /* wmdockapp only */
|
2005-01-05 16:01:33 -08:00
|
|
|
char sticky; /* Make dockapps sticky by default */
|
2004-12-28 15:46:49 -08:00
|
|
|
int dirmode;
|
2004-01-12 12:43:18 -08:00
|
|
|
int startx;
|
|
|
|
int starty;
|
|
|
|
} dock;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int mode;
|
|
|
|
char clickraises;
|
|
|
|
char transientsfollowleader;
|
|
|
|
char switchfortransientmap;
|
|
|
|
char all_new_windows_get_focus;
|
|
|
|
char new_transients_get_focus;
|
|
|
|
char new_transients_get_focus_if_group_focused;
|
2004-07-23 13:05:50 -07:00
|
|
|
char raise_on_next;
|
|
|
|
char warp_on_next;
|
2005-05-25 15:57:38 -07:00
|
|
|
char warp_always;
|
2004-01-12 12:43:18 -08:00
|
|
|
} focus;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char set_xroot_info_on_root_window;
|
|
|
|
} hints;
|
|
|
|
struct
|
2004-08-25 09:03:14 -07:00
|
|
|
{
|
2005-03-28 10:20:51 -08:00
|
|
|
char animate;
|
2004-12-28 15:46:49 -08:00
|
|
|
char onscreen;
|
|
|
|
char warp;
|
2006-01-08 06:28:00 -08:00
|
|
|
char show_icons;
|
2006-01-16 04:45:56 -08:00
|
|
|
int icon_size;
|
2004-12-28 15:46:49 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
KeySym left, right, up, down, escape, ret;
|
|
|
|
} key;
|
|
|
|
} menus;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int mode_move;
|
|
|
|
int mode_resize;
|
|
|
|
int mode_info;
|
2007-06-16 04:16:17 -07:00
|
|
|
unsigned int color;
|
2007-07-11 02:21:27 -07:00
|
|
|
char avoid_server_grab;
|
2005-03-28 05:39:32 -08:00
|
|
|
char update_while_moving;
|
2006-10-29 07:21:15 -08:00
|
|
|
char enable_sync_request;
|
2004-12-28 15:46:49 -08:00
|
|
|
} movres;
|
2004-08-25 09:03:14 -07:00
|
|
|
struct
|
2006-04-02 01:45:40 -08:00
|
|
|
{
|
|
|
|
int movres;
|
|
|
|
int menus;
|
|
|
|
int tooltips;
|
|
|
|
} opacity;
|
|
|
|
struct
|
2004-07-02 17:30:50 -07:00
|
|
|
{
|
|
|
|
char manual;
|
|
|
|
char manual_mouse_pointer;
|
2005-05-29 07:59:17 -07:00
|
|
|
char slidein;
|
2005-10-09 11:01:30 -07:00
|
|
|
char cleanupslide;
|
|
|
|
int slidemode;
|
|
|
|
int slidespeedmap;
|
|
|
|
int slidespeedcleanup;
|
2004-07-02 17:58:19 -07:00
|
|
|
char ignore_struts;
|
2004-09-30 15:42:54 -07:00
|
|
|
char raise_fullscreen;
|
2006-12-27 08:34:48 -08:00
|
|
|
#ifdef HAVE_XINERAMA
|
2006-08-23 14:04:53 -07:00
|
|
|
char extra_head; /* Not used */
|
|
|
|
#endif
|
2004-07-02 17:30:50 -07:00
|
|
|
} place;
|
|
|
|
struct
|
2005-01-28 23:11:59 -08:00
|
|
|
{
|
2005-11-09 12:36:35 -08:00
|
|
|
char enable_script;
|
|
|
|
char *script;
|
2005-01-28 23:11:59 -08:00
|
|
|
char enable_logout_dialog;
|
|
|
|
char enable_reboot_halt;
|
|
|
|
char *cmd_reboot;
|
|
|
|
char *cmd_halt;
|
|
|
|
} session;
|
|
|
|
struct
|
2006-08-23 14:04:53 -07:00
|
|
|
{
|
|
|
|
char animate;
|
|
|
|
int speed;
|
|
|
|
} shading;
|
|
|
|
struct
|
2004-01-12 12:43:18 -08:00
|
|
|
{
|
|
|
|
char enable;
|
|
|
|
int edge_snap_dist;
|
|
|
|
int screen_snap_dist;
|
|
|
|
} snap;
|
|
|
|
struct
|
2004-02-11 17:17:21 -08:00
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
char firsttime;
|
|
|
|
char animate;
|
|
|
|
} startup;
|
2004-01-12 12:43:18 -08:00
|
|
|
struct
|
|
|
|
{
|
2006-11-27 12:01:05 -08:00
|
|
|
char localise;
|
2007-08-07 08:05:08 -07:00
|
|
|
char use_alt_font_cfg;
|
2004-12-28 15:46:49 -08:00
|
|
|
char *name;
|
2005-02-24 14:07:39 -08:00
|
|
|
char *extra_path;
|
2005-07-16 09:35:39 -07:00
|
|
|
char *ttfont_path;
|
2007-08-07 08:05:08 -07:00
|
|
|
char *font_cfg;
|
2004-12-28 15:46:49 -08:00
|
|
|
} theme;
|
2004-07-25 02:34:43 -07:00
|
|
|
#ifdef ENABLE_THEME_TRANSPARENCY
|
2004-06-14 10:02:32 -07:00
|
|
|
struct
|
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
int alpha;
|
2004-06-14 10:02:32 -07:00
|
|
|
int border;
|
|
|
|
int widget;
|
|
|
|
int iconbox;
|
|
|
|
int menu;
|
|
|
|
int menu_item;
|
|
|
|
int tooltip;
|
|
|
|
int dialog;
|
|
|
|
int hilight;
|
|
|
|
int pager;
|
|
|
|
int warplist;
|
2004-12-28 15:46:49 -08:00
|
|
|
} trans;
|
2004-06-14 10:02:32 -07:00
|
|
|
#endif
|
2004-12-28 15:46:49 -08:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
char enable;
|
|
|
|
char showsticky;
|
|
|
|
char showshaded;
|
|
|
|
char showiconified;
|
2007-03-05 19:33:31 -08:00
|
|
|
char showalldesks;
|
2004-12-28 15:46:49 -08:00
|
|
|
char warpfocused;
|
|
|
|
char raise_on_select;
|
|
|
|
char warp_on_select;
|
2005-03-23 10:28:31 -08:00
|
|
|
int icon_mode;
|
2004-12-28 15:46:49 -08:00
|
|
|
} warplist;
|
2006-08-23 14:04:53 -07:00
|
|
|
|
2006-06-03 07:11:34 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
char argb_internal_objects;
|
|
|
|
char argb_internal_clients;
|
|
|
|
char argb_clients;
|
|
|
|
char argb_clients_inherit_attr;
|
2007-05-07 16:26:13 -07:00
|
|
|
int image_cache_size;
|
2006-09-19 09:55:16 -07:00
|
|
|
int mask_alpha_threshold;
|
2006-06-03 07:11:34 -07:00
|
|
|
} testing;
|
2006-08-23 14:04:53 -07:00
|
|
|
|
2004-01-12 12:43:18 -08:00
|
|
|
char autosave;
|
|
|
|
char memory_paranoia;
|
|
|
|
char save_under;
|
|
|
|
}
|
|
|
|
EConf;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2005-10-29 18:05:26 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int startup_id;
|
|
|
|
} apps;
|
2005-04-07 09:38:57 -07:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
char *name;
|
|
|
|
char *dir;
|
|
|
|
char *cache_dir;
|
|
|
|
} conf;
|
2004-04-07 07:32:36 -07:00
|
|
|
struct
|
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
char *name;
|
2004-04-07 07:32:36 -07:00
|
|
|
int screens;
|
2006-12-27 08:34:48 -08:00
|
|
|
#ifdef HAVE_XINERAMA
|
2004-12-28 15:46:49 -08:00
|
|
|
char xinerama_active;
|
2006-08-23 12:06:21 -07:00
|
|
|
#endif
|
|
|
|
#if USE_XSYNC
|
|
|
|
XID server_time;
|
2004-12-28 15:46:49 -08:00
|
|
|
#endif
|
2004-04-07 07:32:36 -07:00
|
|
|
} display;
|
|
|
|
struct
|
2005-08-15 09:57:13 -07:00
|
|
|
{
|
2005-08-15 10:15:19 -07:00
|
|
|
Time time;
|
2005-08-15 09:57:13 -07:00
|
|
|
int x, y;
|
|
|
|
int px, py;
|
|
|
|
Time last_btime;
|
|
|
|
Window last_bpress;
|
2005-12-23 16:39:29 -08:00
|
|
|
Window last_bpress2;
|
2005-08-15 09:57:13 -07:00
|
|
|
unsigned int last_button;
|
|
|
|
unsigned int last_keycode;
|
|
|
|
char double_click;
|
2006-02-12 09:27:30 -08:00
|
|
|
char on_screen;
|
2007-04-19 15:25:25 -07:00
|
|
|
#if USE_COMPOSITE
|
|
|
|
unsigned int damage_count;
|
|
|
|
#endif
|
2005-08-15 09:57:13 -07:00
|
|
|
} events;
|
|
|
|
struct
|
2004-08-05 16:08:34 -07:00
|
|
|
{
|
2005-08-15 09:57:13 -07:00
|
|
|
int server_grabbed;
|
2004-08-05 16:08:34 -07:00
|
|
|
char pointer_grab_active;
|
|
|
|
Window pointer_grab_window;
|
|
|
|
} grabs;
|
|
|
|
struct
|
2005-07-17 05:55:13 -07:00
|
|
|
{
|
|
|
|
const char *lang;
|
|
|
|
char utf8_int; /* Use UTF-8 internally */
|
|
|
|
char utf8_loc; /* Locale is UTF-8 */
|
|
|
|
} locale;
|
|
|
|
struct
|
2004-08-07 14:00:10 -07:00
|
|
|
{
|
2007-01-31 17:23:40 -08:00
|
|
|
unsigned int mod_key_mask;
|
2004-12-28 15:46:49 -08:00
|
|
|
unsigned int mod_combos[8];
|
|
|
|
} masks;
|
2004-08-07 14:00:10 -07:00
|
|
|
struct
|
2004-04-07 07:32:36 -07:00
|
|
|
{
|
2004-12-28 15:46:49 -08:00
|
|
|
char check; /* Avoid losing windows offscreen */
|
|
|
|
char swap;
|
|
|
|
int swapcoord_x, swapcoord_y;
|
|
|
|
} move;
|
|
|
|
struct
|
2005-05-29 07:59:17 -07:00
|
|
|
{
|
2007-06-17 01:33:22 -07:00
|
|
|
signed char enable_features;
|
2005-05-29 07:59:17 -07:00
|
|
|
char doing_manual;
|
|
|
|
char doing_slide;
|
|
|
|
} place;
|
|
|
|
struct
|
2006-03-29 15:45:32 -08:00
|
|
|
{
|
|
|
|
int w_old;
|
|
|
|
int h_old;
|
|
|
|
} screen;
|
|
|
|
struct
|
2006-03-19 07:33:38 -08:00
|
|
|
{
|
|
|
|
unsigned int extensions;
|
|
|
|
} server;
|
|
|
|
struct
|
2006-02-27 11:14:25 -08:00
|
|
|
{
|
|
|
|
Pixmap ext_pmap;
|
|
|
|
char ext_pmap_valid;
|
|
|
|
} root;
|
|
|
|
struct
|
2004-12-28 15:46:49 -08:00
|
|
|
{
|
|
|
|
char *path;
|
|
|
|
} theme;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char *exec_name; /* argv[0] */
|
2004-04-07 07:32:36 -07:00
|
|
|
char master; /* We are the master E */
|
|
|
|
char single; /* No slaves */
|
2004-06-30 06:04:18 -07:00
|
|
|
char window; /* Running in virtual root window */
|
2005-03-13 04:05:31 -08:00
|
|
|
pid_t pid;
|
2004-04-07 07:32:36 -07:00
|
|
|
int master_screen;
|
2005-02-07 15:44:59 -08:00
|
|
|
char session_start;
|
2004-05-07 08:18:07 -07:00
|
|
|
char startup;
|
2004-12-28 15:46:49 -08:00
|
|
|
char restart;
|
2004-05-07 08:18:07 -07:00
|
|
|
char xselect;
|
|
|
|
char exiting;
|
2006-07-11 16:17:19 -07:00
|
|
|
char in_signal_handler;
|
2004-05-07 08:18:07 -07:00
|
|
|
char save_ok;
|
|
|
|
char coredump;
|
2006-05-12 06:10:16 -07:00
|
|
|
int exit_mode;
|
|
|
|
char *exit_param;
|
2004-12-28 15:46:49 -08:00
|
|
|
int child_count;
|
|
|
|
pid_t *children;
|
|
|
|
char *machine_name;
|
2004-04-07 07:32:36 -07:00
|
|
|
} wm;
|
2004-01-12 12:43:18 -08:00
|
|
|
int mode;
|
2006-02-19 14:23:50 -08:00
|
|
|
int op_source;
|
2004-01-11 05:20:17 -08:00
|
|
|
char action_inhibit;
|
2000-06-04 12:45:55 -07:00
|
|
|
EWin *focuswin;
|
2004-06-28 16:37:55 -07:00
|
|
|
EWin *mouse_over_ewin;
|
2004-12-28 15:46:49 -08:00
|
|
|
EWin *context_ewin;
|
2000-06-04 12:45:55 -07:00
|
|
|
Colormap current_cmap;
|
2006-04-29 12:39:21 -07:00
|
|
|
Win context_win;
|
2000-06-04 12:45:55 -07:00
|
|
|
char constrained;
|
|
|
|
char nogroup;
|
|
|
|
char keybinds_changed;
|
2005-12-01 09:00:24 -08:00
|
|
|
char showing_desktop;
|
2004-01-13 12:01:44 -08:00
|
|
|
Window button_proxy_win;
|
2005-12-28 01:59:53 -08:00
|
|
|
char firsttime;
|
2003-05-22 12:15:03 -07:00
|
|
|
}
|
|
|
|
EMode;
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/*
|
|
|
|
* Function prototypes
|
|
|
|
*/
|
1999-09-07 14:20:34 -07:00
|
|
|
|
2006-11-19 13:55:52 -08:00
|
|
|
/* about.c */
|
2004-12-28 15:46:49 -08:00
|
|
|
void About(void);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2006-11-19 13:55:52 -08:00
|
|
|
/* actions.c */
|
2006-09-10 07:29:05 -07:00
|
|
|
#define EXEC_SET_LANG 0x01
|
|
|
|
int execApplication(const char *params, int flags);
|
2005-03-12 03:09:33 -08:00
|
|
|
void Espawn(int argc, char **argv);
|
2005-03-12 07:22:08 -08:00
|
|
|
void EspawnCmd(const char *cmd);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/* config.c */
|
2006-02-18 00:30:09 -08:00
|
|
|
void SkipTillEnd(FILE * ConfigFile);
|
2004-12-28 15:46:49 -08:00
|
|
|
char *GetLine(char *s, int size, FILE * f);
|
2007-07-27 09:59:50 -07:00
|
|
|
int ConfigParseline1(char *str, char *s2, char **p2, char **p3);
|
|
|
|
void ConfigParseError(const char *where, const char *line);
|
2004-12-28 15:46:49 -08:00
|
|
|
void ConfigAlertLoad(const char *txt);
|
2005-07-17 05:55:13 -07:00
|
|
|
char *FindFile(const char *file, const char *themepath,
|
|
|
|
int localized);
|
|
|
|
char *ThemeFileFind(const char *file, int localized);
|
2004-12-28 15:46:49 -08:00
|
|
|
char *ConfigFileFind(const char *name, const char *themepath,
|
|
|
|
int pp);
|
|
|
|
int ConfigFileLoad(const char *name, const char *themepath,
|
2005-02-16 11:48:33 -08:00
|
|
|
int (*parse) (FILE * fs), int preparse);
|
2005-03-05 04:19:48 -08:00
|
|
|
int ConfigFileRead(FILE * fs);
|
2004-12-28 15:46:49 -08:00
|
|
|
int ThemeConfigLoad(void);
|
2004-01-18 02:24:06 -08:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/* dialog.c */
|
|
|
|
void DialogOK(const char *title, const char *fmt, ...);
|
|
|
|
void DialogOKstr(const char *title, const char *txt);
|
|
|
|
void DialogAlert(const char *fmt, ...);
|
|
|
|
void DialogAlertOK(const char *fmt, ...);
|
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
/* econfig.c */
|
|
|
|
void ConfigurationLoad(void);
|
|
|
|
void ConfigurationSave(void);
|
|
|
|
void ConfigurationSet(const char *params);
|
|
|
|
void ConfigurationShow(const char *params);
|
|
|
|
|
2004-04-09 05:50:56 -07:00
|
|
|
/* edge.c */
|
2005-01-02 07:38:52 -08:00
|
|
|
void EdgeCheckMotion(int x, int y);
|
2004-06-29 06:19:23 -07:00
|
|
|
void EdgeWindowsShow(void);
|
|
|
|
void EdgeWindowsHide(void);
|
2004-12-28 15:46:49 -08:00
|
|
|
|
|
|
|
/* extinitwin.c */
|
|
|
|
Window ExtInitWinCreate(void);
|
2005-04-23 06:35:37 -07:00
|
|
|
void ExtInitWinSet(Window win);
|
|
|
|
Window ExtInitWinGet(void);
|
|
|
|
void ExtInitWinKill(void);
|
2004-12-28 15:46:49 -08:00
|
|
|
|
|
|
|
/* fonts.c */
|
2007-07-28 06:58:20 -07:00
|
|
|
void FontConfigLoad(void);
|
2004-12-28 15:46:49 -08:00
|
|
|
void FontConfigUnload(void);
|
|
|
|
const char *FontLookup(const char *name);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/* handlers.c */
|
|
|
|
void SignalsSetup(void);
|
|
|
|
void SignalsRestore(void);
|
2005-06-04 01:33:52 -07:00
|
|
|
void HandleXError(Display * d, XErrorEvent * ev);
|
2004-02-10 12:25:17 -08:00
|
|
|
void HandleXIOError(Display * d);
|
2003-03-23 19:48:09 -08:00
|
|
|
|
2004-12-28 15:46:49 -08:00
|
|
|
/* main.c */
|
|
|
|
void EExit(int exitcode);
|
|
|
|
const char *EDirRoot(void);
|
|
|
|
const char *EDirBin(void);
|
|
|
|
const char *EDirUser(void);
|
|
|
|
const char *EDirUserCache(void);
|
|
|
|
void EDirMake(const char *base, const char *name);
|
|
|
|
const char *EGetSavePrefix(void);
|
|
|
|
const char *EGetSavePrefixCommon(void);
|
2007-01-07 07:25:44 -08:00
|
|
|
void Etmp(char *s);
|
2004-12-28 15:46:49 -08:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/* misc.c */
|
|
|
|
void Quicksort(void **a, int l, int r,
|
|
|
|
int (*CompareFunc) (void *d1, void *d2));
|
2004-09-11 03:45:21 -07:00
|
|
|
void ETimedLoopInit(int k1, int k2, int speed);
|
|
|
|
int ETimedLoopNext(void);
|
2006-04-19 12:13:46 -07:00
|
|
|
|
|
|
|
/* mod-misc.c */
|
|
|
|
void autosave(void);
|
2004-02-08 08:17:58 -08:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/* regex.c */
|
|
|
|
int matchregexp(const char *rx, const char *s);
|
|
|
|
|
|
|
|
/* setup.c */
|
2004-12-28 15:46:49 -08:00
|
|
|
void SetupX(const char *dstr);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/* slideouts.c */
|
2004-12-28 15:46:49 -08:00
|
|
|
int SlideoutsConfigLoad(FILE * fs);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-02-13 10:36:52 -08:00
|
|
|
/* startup.c */
|
2005-02-27 06:42:41 -08:00
|
|
|
void StartupWindowsCreate(void);
|
|
|
|
void StartupWindowsOpen(void);
|
2004-02-13 10:36:52 -08:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/* theme.c */
|
2004-12-28 15:46:49 -08:00
|
|
|
void ThemePathFind(void);
|
|
|
|
char **ThemesList(int *num);
|
1999-08-17 15:56:46 -07:00
|
|
|
|
2004-02-10 12:25:17 -08:00
|
|
|
/*
|
|
|
|
* Global vars
|
|
|
|
*/
|
2003-07-12 07:06:37 -07:00
|
|
|
extern const char e_wm_name[];
|
|
|
|
extern const char e_wm_version[];
|
2005-02-13 06:49:38 -08:00
|
|
|
extern const char e_wm_date[];
|
1999-08-17 15:56:46 -07:00
|
|
|
extern Display *disp;
|
2004-06-30 06:04:18 -07:00
|
|
|
extern RealRoot RRoot;
|
|
|
|
extern VirtRoot VRoot;
|
2004-03-20 07:49:05 -08:00
|
|
|
extern EConf Conf;
|
|
|
|
extern EMode Mode;
|