home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Enlightenment / enl_DR-0.10.tar.gz / enl_DR-0.10.tar / enl / enlightenment.h < prev    next >
C/C++ Source or Header  |  1997-06-24  |  6KB  |  346 lines

  1.  
  2. /*
  3.  * Defines for various system dpendant stuff
  4.  */
  5.  
  6. #ifdef sun
  7. #define SOLARIS_SUX
  8. #endif
  9.  
  10. /*
  11.  * Standard system includes
  12.  */
  13.  
  14. #include <stdio.h>
  15. #include <stdlib.h>
  16. #include <unistd.h>
  17. #include <string.h>
  18. #include <fcntl.h>
  19. #include <dirent.h>
  20. #include <signal.h>
  21. #include <time.h>
  22. #include <sys/types.h>
  23. #include <sys/wait.h>
  24. #include <sys/stat.h>
  25.  
  26. /*
  27.  * X includes
  28.  */
  29. #include <X11/Xlib.h>
  30. #include <X11/Xutil.h>
  31. #include <X11/extensions/shape.h>
  32. #include <X11/imlib.h>
  33.  
  34. /*
  35.  * Constant defines
  36.  */
  37. #define MAX_WIDTH 2048
  38. #define MAX_HEIGHT 1536
  39.  
  40. /*
  41.  * This is where enlightenment will look if it can't find config files in
  42.  * ./.enlightenment/ or ~/.enlightnement/
  43.  */
  44. #ifndef SYSCONFIG_DIR
  45. #define SYSCONFIG_DIR "/usr/local/enlightenment/system_config/"
  46. #endif
  47. #ifndef THEMES_DIR
  48. #define THEMES_DIR "/usr/local/enlightenment/themes/"
  49. #endif
  50.  
  51. /*
  52.  * Data structures global to enlightenment
  53.  */
  54. /*States for an EWin window to be in */
  55. #define SELECTED    (1<<0)
  56. #define ICONIFIED   (1<<1)
  57. #define MAPPED      (1<<2)
  58. #define UNMAPPED    (1<<3)
  59. #define NEW_WIN     (1<<4)
  60. #define ALL         (0xffffffff)
  61.  
  62. /*Changes to be flaged for an EWin */
  63. #define MOD_SIZE    (1<<0)
  64. #define MOD_TITLE   (1<<1)
  65. #define MOD_SELECT  (1<<2)
  66. #define MOD_STATE   (1<<3)
  67. #define MOD_ALL     (0xffffffff)
  68.  
  69. /*Realtive pos's for EWin Subwindows */
  70. #define POS_TL    (1<<0)
  71. #define POS_TR    (1<<1)
  72. #define POS_BL    (1<<2)
  73. #define POS_BR    (1<<3)
  74.  
  75. /*Subwin states */
  76. #define NORM 0
  77. #define CLICKED 1
  78.  
  79. /*Text formatting defined flags*/
  80. #define SHADOW     (1<<0)
  81. #define OUTLINE    (1<<1)
  82. #define J_RIGHT    (1<<2)
  83. #define J_CENTER   (1<<3)
  84. #define ITALIC     (1<<4)
  85. #define BOLD       (1<<5)
  86.  
  87. /*Modes that enlightenment can be in during its event handling loop*/
  88. #define MODE_NORMAL 0
  89. #define MODE_MOVE   1
  90. #define MODE_RESIZE 2
  91. #define MODE_MENU   3
  92.  
  93. /*
  94.  * I put this is becuase the solaris X86 boxes at uni were fucked.. and this
  95.  * was the only way to make it compile and run.
  96.  */
  97.  
  98. #ifdef SOLARIS_SUX
  99. typedef void (*__sighandler_t)(int);
  100. typedef unsigned long sigset_t;
  101. struct sigaction  
  102. {
  103.    int sa_flags;
  104.    void (*sa_handler)();
  105.    sigset_t sa_mask;
  106.    int sa_resv[2];  
  107. };
  108. #endif
  109.  
  110. typedef struct ewn EWin;
  111. typedef struct icn Icon;
  112.  
  113. struct icn
  114. {
  115.    Window win;
  116.    Pixmap pmap;
  117.    Pixmap mask;
  118.    EWin *ewin;
  119.    int x;
  120.    int y;
  121.    int width;
  122.    int height;
  123. };
  124.  
  125. struct ewn
  126. {
  127.    Window frame_win;
  128.    Window client_win;
  129.    Window group_win;
  130.    Window icon_win;
  131.    int state;
  132.    char title[256];
  133.    
  134.    int changes;
  135.    Colormap colormap;
  136.    int frame_x;
  137.    int frame_y;
  138.    int frame_width;
  139.    int frame_height;
  140.    int sizeinc_x;
  141.    int sizeinc_y;
  142.    int min_width;
  143.    int min_height;
  144.    int max_width;
  145.    int max_height;
  146.    int base_width;
  147.    int base_height;
  148.    int client_x;
  149.    int client_y;
  150.    int client_width;
  151.    int client_height;
  152.    int border_l;
  153.    int border_r;
  154.    int border_t;
  155.    int border_b;
  156.  
  157.    int num_subwins;
  158.    Window subwins[64];
  159.    int subwin_state[64];
  160.    Pixmap subwin_pm_clk[64];
  161.    Pixmap subwin_pm_sel[64];
  162.    Pixmap subwin_pm_uns[64];
  163.    Pixmap subwin_pm_clk_mask[64];
  164.    Pixmap subwin_pm_sel_mask[64];
  165.    Pixmap subwin_pm_uns_mask[64];
  166.    Pixmap mask_sel;
  167.    Pixmap mask_uns;
  168.    int lastop;
  169.    int prev_frame_x;
  170.    int prev_frame_y;
  171.    int prev_client_width;
  172.    int prev_client_height;
  173.    int top;
  174.    Icon *icon;
  175.    struct 
  176.      {
  177.     Window shadow_win;
  178.      } fx;
  179. };
  180.  
  181. typedef struct
  182. {
  183.    int id;
  184.    char params[256];
  185. } Action;
  186.  
  187. typedef struct
  188. {
  189.    int shape_mode;
  190.    int move_mode;
  191.    int resize_mode;
  192.    int border_l;
  193.    int border_r;
  194.    int border_t;
  195.    int border_b;
  196.    int num_subwins;
  197.    int subwin_type[64];
  198.    int subwin_level[64];
  199.    int subwin_scale_method[64];
  200.    int subwin_pos_method1[64];
  201.    int subwin_pos_method2[64];
  202.    int subwin_pos_x1[64];
  203.    int subwin_pos_y1[64];
  204.    int subwin_pos_x2[64];
  205.    int subwin_pos_y2[64];
  206.    Action subwin_action[64][3][4];
  207.    char *subwin_pmname_clk[64];
  208.    char *subwin_pmname_sel[64];
  209.    char *subwin_pmname_uns[64];
  210.    ImColor subwin_transp_clk[64];
  211.    ImColor subwin_transp_sel[64];
  212.    ImColor subwin_transp_uns[64];
  213.    Image *subwin_img_clk[64];
  214.    Image *subwin_img_sel[64];
  215.    Image *subwin_img_uns[64];
  216.    char root_pname[1024];
  217.    int root_width;
  218.    int root_height;
  219.    char *font;
  220.    int font_style;
  221.    int font_fg;
  222.    int font_bg;
  223.    int autoraise;
  224.    int autoraise_time;
  225. } ConfigWin;
  226.  
  227. typedef struct
  228. {
  229.    int num_fg_r;
  230.    int num_fg_g;
  231.    int num_fg_b;
  232.    int num_bg_r;
  233.    int num_bg_g;
  234.    int num_bg_b;
  235.    int num_size;
  236. } ConfigCursor;
  237.  
  238. typedef struct
  239. {
  240.    int mode;
  241.    EWin *ewin;
  242.    int wbtn;
  243.    int pw;
  244.    int ph;
  245.    int px;
  246.    int py;
  247.    int resize_mode;
  248.    int x1;
  249.    int x2;
  250.    int y1;
  251.    int y2;
  252.    char mname[1024];
  253. } Event_Mode_Data;
  254.  
  255. typedef struct
  256. {
  257.    struct 
  258.      {
  259.     int on;
  260.     int x;
  261.     int y;
  262.     int r;
  263.     int g;
  264.     int b;
  265.      } shadow;
  266. } Fx;
  267.  
  268. /*
  269.  * Global Variables
  270.  */
  271.  
  272. /* for X */
  273. extern Display *disp;
  274. extern int screen;
  275. extern Window root;
  276. extern Visual *visual;
  277. extern int depth;
  278. extern int scr_width;
  279. extern int scr_height;
  280. extern Colormap root_cmap;
  281.  
  282. /* Imlib */
  283.  
  284. extern ImlibData *imd;
  285.  
  286. /*
  287.  * Enligthenment includes
  288.  */
  289. #include "main.h"
  290. #include "lists.h"
  291. #include "draw.h"
  292. #include "events.h"
  293. #include "wininfo.h"
  294. #include "buttons.h"
  295. #include "ewin.h"
  296. #include "loadcfg.h"
  297. #include "root.h"
  298. #include "text.h"
  299. #include "status.h"
  300. #include "alert.h"
  301. #include "iconify.h"
  302. #include "menus.h"
  303. #include "actions.h"
  304. #include "infobox.h"
  305. #include "file.h"
  306. #include "regexp.h"
  307.  
  308. /* for Enlightenment */
  309.  
  310. extern Window FocusWin;
  311. extern ConfigWin cfg;
  312. extern ConfigCursor ccfg;
  313. extern Icon_cfg icfg;
  314. extern listhead *global_l;
  315. extern EWin *global_killewin;
  316. extern Pixmap root_pm;
  317. extern Event_Mode_Data evmd;
  318. extern Window raisewin;
  319. extern Window sel_win;
  320. extern char font_weight[32];
  321. extern char font_slant[32];
  322. extern int mouse_x;
  323. extern int mouse_y;
  324. extern int debug_mode;
  325. extern char *argv1;
  326. extern struct _bl bl;
  327. extern struct _btmd btmd;
  328. extern struct icon_list ilist;
  329. extern struct _newicon newicon;
  330. extern struct scfg_ scfg;
  331. extern struct winlist *Wlist;
  332. extern struct winlist winlist;
  333. extern int num_menus;
  334. extern char Theme_Tar_Ball[1024];
  335. extern char Theme_Path[1024];
  336. extern char Theme_Name[1024];
  337. extern int nodel;
  338. extern struct menulist mlist;
  339. extern struct menulist active_mlist;
  340. extern Menu *tmp_menu;
  341. extern Fx fx;
  342. extern int predef_num;
  343. extern struct predef_icon_list *predef_list;
  344. extern struct infobox ifb;
  345.  
  346.