home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Enlightenment / enl_BETA-0.13.src.tar.gz / enl_BETA-0.13.src.tar / enl-0.13 / enlightenment.h < prev    next >
C/C++ Source or Header  |  1997-11-16  |  8KB  |  421 lines

  1. /*
  2.  * Defines for various system dpendant stuff
  3.  */
  4.  
  5. /*
  6.  * A workaround for people with borken sun headers.. I found this problem for
  7.  * Solaris-x86 2.5.1 at uni....
  8.  * uncomment this and it should help.
  9.  * #ifdef sun
  10.  * #define SOLARIS_SUX
  11.  * #endif
  12.  */
  13.  
  14. /* Some Xservers have a broken XQueryBestCursor function. You'll know this if
  15.  * your cursor looks like  garbled mess whenever you move or resize windows
  16.  * or if your server goes down in a ball of flames when you move or resize.
  17.  * Report this bug to your Xserver vendors. This is a workaround. Uncomment it 
  18.  * and maybe fiddle with the width & height defines until it works. (common 
  19.  * sizes are 64x64, 32x32 and 16x16 )
  20.  * 
  21.  * #define BROKEN_XSERVER
  22.  * #define CURSOR_MAX_WIDTH  64
  23.  * #define CUSROS_MAX_HEIGHT 64
  24.  */
  25.  
  26.  
  27. /*
  28.  * Standard system includes
  29.  */
  30. #ifdef USE_PTHREADS
  31. #include <pthread.h>
  32. #endif
  33. #include <stdio.h>
  34. #include <stdlib.h>
  35. #include <unistd.h>
  36. #include <string.h>
  37. #include <fcntl.h>
  38. #include <dirent.h>
  39. #include <signal.h>
  40. #include <time.h>
  41. #include <sys/types.h>
  42. #include <sys/wait.h>
  43. #include <sys/stat.h>
  44. #include <ctype.h>
  45. /*
  46.  * X includes
  47.  */
  48. #include <X11/Xlib.h>
  49. #include <X11/Xutil.h>
  50. #include <X11/Xproto.h>
  51. #include <X11/extensions/shape.h>
  52. #include <X11/imlib.h>
  53. #include <X11/Xatom.h>
  54. #include <X11/keysym.h>
  55.  
  56. /*
  57.  * Constant defines
  58.  */
  59. #define MAX_WIDTH 2048
  60. #define MAX_HEIGHT 1536
  61.  
  62. /*
  63.  * This is where enlightenment will look if it can't find config files in
  64.  * ./.enlightenment/ or ~/.enlightnement/
  65.  */
  66. #ifndef SYSCONFIG_DIR
  67. #define SYSCONFIG_DIR "/usr/local/enlightenment/system_config/"
  68. #endif
  69. #ifndef THEMES_DIR
  70. #define THEMES_DIR "/usr/local/enlightenment/themes/"
  71. #endif
  72.  
  73. /*
  74.  * Data structures global to enlightenment
  75.  */
  76. /*States for an EWin window to be in */
  77. #define SELECTED    (1<<0)
  78. #define ICONIFIED   (1<<1)
  79. #define MAPPED      (1<<2)
  80. #define UNMAPPED    (1<<3)
  81. #define NEW_WIN     (1<<4)
  82. #define ALL         (0xffffffff)
  83.  
  84. /*Changes to be flaged for an EWin */
  85. #define MOD_SIZE    (1<<0)
  86. #define MOD_TITLE   (1<<1)
  87. #define MOD_SELECT  (1<<2)
  88. #define MOD_STATE   (1<<3)
  89. #define MOD_ALL     (0xffffffff)
  90.  
  91. /*Realtive pos's for EWin Subwindows */
  92. #define POS_TL    (1<<0)
  93. #define POS_TR    (1<<1)
  94. #define POS_BL    (1<<2)
  95. #define POS_BR    (1<<3)
  96.  
  97. /*Subwin states */
  98. #define NORM 0
  99. #define CLICKED 1
  100.  
  101. /*Text formatting defined flags*/
  102. #define SHADOW     (1<<0)
  103. #define OUTLINE    (1<<1)
  104. #define J_RIGHT    (1<<2)
  105. #define J_CENTER   (1<<3)
  106. #define ITALIC     (1<<4)
  107. #define BOLD       (1<<5)
  108.  
  109. /*Modes that enlightenment can be in during its event handling loop*/
  110. #define MODE_NORMAL 0
  111. #define MODE_MOVE   1
  112. #define MODE_RESIZE 2
  113. #define MODE_MENU   3
  114.  
  115. /* Symbolic Names for Keyboard/Mouse Focus Policies */
  116.  
  117. #define PointerFocus     0
  118. #define SloppyFocus    1
  119. #define ClickToFocus    2
  120.  
  121. /* Timer mode constants */
  122.  
  123. #define TIMER_NONE          0
  124. #define TIMER_INFOBOX       1
  125. #define TIMER_ICONIFY       2
  126. #define TIMER_AUTORAISE     3 
  127. #define TIMER_SNAPSHOTPAGER 4
  128.  
  129. /*
  130.  * I put this is becuase the solaris X86 boxes at uni were fucked.. and this
  131.  * was the only way to make it compile and run.
  132.  */
  133.  
  134. #ifdef SOLARIS_SUX
  135. typedef void (*__sighandler_t)(int);
  136. typedef unsigned long sigset_t;
  137. struct sigaction  
  138. {
  139.    int sa_flags;
  140.    void (*sa_handler)();
  141.    sigset_t sa_mask;
  142.    int sa_resv[2];  
  143. };
  144. #endif
  145.  
  146. typedef struct ewn EWin;
  147. typedef struct icn Icon;
  148.  
  149. Atom WM_STATE;
  150.  
  151. struct icn
  152. {
  153.    Window win;
  154.    Pixmap pmap;
  155.    Pixmap mask;
  156.    EWin *ewin;
  157.    int x;
  158.    int y;
  159.    int width;
  160.    int height;
  161. };
  162.  
  163. struct ewn
  164. {
  165.    Window frame_win;
  166.    Window client_win;
  167.    Window group_win;
  168.    Window icon_win;
  169.    int state;
  170.    char title[256];
  171.    
  172.    int changes;
  173.    Colormap colormap;
  174.    int frame_x;
  175.    int frame_y;
  176.    int frame_width;
  177.    int frame_height;
  178.    int sizeinc_x;
  179.    int sizeinc_y;
  180.    int min_width;
  181.    int min_height;
  182.    int max_width;
  183.    int max_height;
  184.    int base_width;
  185.    int base_height;
  186.    int client_x;
  187.    int client_y;
  188.    int client_width;
  189.    int client_height;
  190.    int border_l;
  191.    int border_r;
  192.    int border_t;
  193.    int border_b;
  194.  
  195.    int num_subwins;
  196.    Window subwins[64];
  197.    int subwin_state[64];
  198.    Pixmap subwin_pm_clk[64];
  199.    Pixmap subwin_pm_sel[64];
  200.    Pixmap subwin_pm_uns[64];
  201.    Pixmap subwin_pm_clk_mask[64];
  202.    Pixmap subwin_pm_sel_mask[64];
  203.    Pixmap subwin_pm_uns_mask[64];
  204.    Pixmap mask_sel;
  205.    Pixmap mask_uns;
  206.    int lastop;
  207.    int prev_frame_x;
  208.    int prev_frame_y;
  209.    int prev_client_width;
  210.    int prev_client_height;
  211.    int top;
  212.    Icon *icon;
  213.    struct 
  214.      {
  215.     Window shadow_win;
  216.      } fx;
  217.    int desk;
  218.    int snapshotok;
  219.    int skip;
  220.    Window di_win;
  221.    int state_entry;
  222. };
  223.  
  224. typedef struct
  225. {
  226.    int id;
  227.    char params[256];
  228. } Action;
  229.  
  230. typedef struct
  231. {
  232.    int shape_mode;
  233.    int move_mode;
  234.    int resize_mode;
  235.    int border_l;
  236.    int border_r;
  237.    int border_t;
  238.    int border_b;
  239.    int num_subwins;
  240.    int subwin_type[64];
  241.    int subwin_level[64];
  242.    int subwin_scale_method[64];
  243.    int subwin_pos_method1[64];
  244.    int subwin_pos_method2[64];
  245.    int subwin_pos_x1[64];
  246.    int subwin_pos_y1[64];
  247.    int subwin_pos_x2[64];
  248.    int subwin_pos_y2[64];
  249.    Action subwin_action[64][3][4];
  250.    char *subwin_pmname_clk[64];
  251.    char *subwin_pmname_sel[64];
  252.    char *subwin_pmname_uns[64];
  253.    ImColor subwin_transp_clk[64];
  254.    ImColor subwin_transp_sel[64];
  255.    ImColor subwin_transp_uns[64];
  256.    Image *subwin_img_clk[64];
  257.    Image *subwin_img_sel[64];
  258.    Image *subwin_img_uns[64];
  259.    char root_pname[1024];
  260.    int root_width;
  261.    int root_height;
  262.    char *font;
  263.    int font_style;
  264.    int font_fg;
  265.    int font_bg;
  266.    int autoraise;
  267.    int autoraise_time;
  268.    int focus_policy;
  269. } ConfigWin;
  270.  
  271. typedef struct
  272. {
  273.    int root_fg_r;
  274.    int root_fg_g;
  275.    int root_fg_b;
  276.    int root_bg_r;
  277.    int root_bg_g;
  278.    int root_bg_b;
  279.    char *root_pix;
  280.    char *root_mask;
  281.    char *cursor_name;
  282.    int doneroot;
  283. } ECursor;
  284.  
  285. typedef struct
  286. {
  287.    int num_fg_r;
  288.    int num_fg_g;
  289.    int num_fg_b;
  290.    int num_bg_r;
  291.    int num_bg_g;
  292.    int num_bg_b;
  293.    int num_size;
  294.    int doneroot;
  295. } ConfigCursor;
  296.  
  297. typedef struct
  298. {
  299.    int mode;
  300.    EWin *ewin;
  301.    int wbtn;
  302.    int pw;
  303.    int ph;
  304.    int px;
  305.    int py;
  306.    int resize_mode;
  307.    int x1;
  308.    int x2;
  309.    int y1;
  310.    int y2;
  311.    char mname[1024];
  312. } Event_Mode_Data;
  313.  
  314. typedef struct
  315. {
  316.    struct 
  317.      {
  318.     int on;
  319.     int x;
  320.     int y;
  321.     int r;
  322.     int g;
  323.     int b;
  324.      } shadow;
  325. } Fx;
  326.  
  327. /*
  328.  * Global Variables
  329.  */
  330.  
  331. /* for X */
  332. extern Display *disp;
  333. extern int screen;
  334. extern Window root;
  335. extern Visual *visual;
  336. extern int depth;
  337. extern int scr_width;
  338. extern int scr_height;
  339. extern Colormap root_cmap;
  340.  
  341. /* Imlib */
  342.  
  343. extern ImlibData *imd;
  344.  
  345. /*
  346.  * Enligthenment includes
  347.  */
  348. #include "main.h"
  349. #include "lists.h"
  350. #include "draw.h"
  351. #include "events.h"
  352. #include "wininfo.h"
  353. #include "buttons.h"
  354. #include "ewin.h"
  355. #include "loadcfg.h"
  356. #include "root.h"
  357. #include "text.h"
  358. #include "status.h"
  359. #include "alert.h"
  360. #include "iconify.h"
  361. #include "menus.h"
  362. #include "actions.h"
  363. #include "infobox.h"
  364. #include "file.h"
  365. #include "regexp.h"
  366. #include "desktops.h"
  367. #include "misc.h"
  368. #include "keys.h"
  369. #include "windowops.h"
  370. #include "states.h"
  371.  
  372. /* for Enlightenment */
  373.  
  374. extern Window FocusWin;
  375. extern Window FocusWin2;
  376. extern ConfigWin cfg;
  377. extern ConfigCursor ccfg;
  378. extern Icon_cfg icfg;
  379. extern listhead *global_l;
  380. extern EWin *global_killewin;
  381. extern Pixmap root_pm;
  382. extern Event_Mode_Data evmd;
  383. extern Window raisewin;
  384. extern Window sel_win;
  385. extern char font_weight[32];
  386. extern char font_slant[32];
  387. extern int mouse_x;
  388. extern int mouse_y;
  389. extern int debug_mode;
  390. extern char *argv1;
  391. extern struct _bl bl;
  392. extern struct _btmd btmd;
  393. extern struct icon_list ilist;
  394. extern struct _newicon newicon;
  395. extern struct scfg_ scfg;
  396. extern struct winlist *Wlist;
  397. extern struct winlist winlist;
  398. extern int num_menus;
  399. extern char Theme_Tar_Ball[1024];
  400. extern char Theme_Path[1024];
  401. extern char Theme_Name[1024];
  402. extern int nodel;
  403. extern struct menulist mlist;
  404. extern struct menulist active_mlist;
  405. extern Menu *tmp_menu;
  406. extern Fx fx;
  407. extern int predef_num;
  408. extern int KeyBind_num;
  409. extern int Cursors_num;
  410. extern struct predef_icon_list *predef_list;
  411. extern struct KeyBind_list_type *KeyBind_list;
  412. extern ECursor *Cursors_list;
  413. extern struct infobox ifb;
  414. extern struct _desk desk;
  415. extern char statefile[1024];
  416. extern int timer_mode;
  417. extern char AlreadyWinListed;
  418. extern MenuItem *tmplt_mi;
  419. extern int restart;
  420. extern int states;
  421.