home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / amiga / gui / x / xfig.lha / src / x11 / resources.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-26  |  5.4 KB  |  178 lines

  1. /*
  2.  * FIG : Facility for Interactive Generation of figures
  3.  * Copyright (c) 1985 by Supoj Sutanthavibul
  4.  *
  5.  * "Permission to use, copy, modify, distribute, and sell this software and its
  6.  * documentation for any purpose is hereby granted without fee, provided that
  7.  * the above copyright notice appear in all copies and that both the copyright
  8.  * notice and this permission notice appear in supporting documentation. 
  9.  * No representations are made about the suitability of this software for 
  10.  * any purpose.  It is provided "as is" without express or implied warranty."
  11.  */
  12.  
  13. #include "paintop.h"
  14. #include "w_rottext.h"
  15.  
  16. typedef struct {
  17.     unsigned int    x, y, z;
  18.     caddr_t       *m;
  19. }        MprData;
  20.  
  21. #define mpr_static(name,x,y,z,pix)    \
  22. XImage name    = \
  23. { \
  24. (x),        /* width */ \
  25. (y),        /* height */ \
  26. 0,        /* offset */ \
  27. XYBitmap,    /* format */ \
  28. (char *)(pix),    /* data pointer */ \
  29. MSBFirst,    /* data byte order LSB or MSB first */ \
  30. 8,        /* quant of scanline */ \
  31. LSBFirst,    /* bitmap bit order LSB or MSBFirst */ \
  32. 8,        /* bitmap pad */ \
  33. (z),        /* depth */ \
  34. (x+7)/8,    /* bytes-per-line */ \
  35. 1,        /* bits per pizel */ \
  36. 0,        /* red_mask */ \
  37. 0,        /* z arrangement green_mask */ \
  38. 0,        /* z arrangement blue_mask */ \
  39. NULL        /* object data pointer for extension */ \
  40. }
  41.  
  42. #define NUMCOLORS 8
  43. extern char    *colorNames[NUMCOLORS + 1];
  44. extern Boolean    all_colors_available;
  45.  
  46. /* resources structure */
  47.  
  48. typedef struct _appres {
  49.     char       *iconGeometry;
  50.     Boolean        INCHES;
  51.     Boolean        DEBUG;
  52.     Boolean        RHS_PANEL;
  53.     Boolean        INVERSE;
  54.     Boolean        TRACKING;
  55.     Boolean        landscape;
  56.     Boolean        ShowAllButtons;
  57.     Boolean        latexfonts;
  58.     Boolean        specialtext;
  59.     Boolean        SCALABLEFONTS;    /* hns 5 Nov 91 */
  60.     char       *normalFont;
  61.     char       *boldFont;
  62.     char       *buttonFont;
  63.     char       *startpsFont;    /* bab 11 Jan 92 */
  64.     char       *startlatexFont;    /* bab 11 Jan 92 */
  65.     float        tmp_width;
  66.     float        tmp_height;
  67.     float        startfontsize;    /* ges 6 Feb 91 */
  68.     int            internalborderwidth;
  69.     Pixel        color[NUMCOLORS];
  70.     Boolean        monochrome;
  71.     char       *keyFile;
  72.     char       *exportLanguage;
  73.     Boolean        flushleft;        /* center/flush-left printing */
  74.     Boolean        textoutline;    /* draw text bounding box if true */
  75.     float        user_scale;        /* scale screen units to user units */
  76.     char       *user_unit;        /* user defined unit name */
  77. }        appresStruct, *appresPtr;
  78. extern appresStruct appres;
  79.  
  80. typedef struct {
  81.     int            x, y;
  82. }        pr_size;
  83.  
  84. typedef struct {
  85.     unsigned int    r_width, r_height, r_left, r_top;
  86. }        RectRec;
  87.  
  88. typedef struct {
  89.     int            type;
  90.     char       *label;
  91.     caddr_t        info;
  92. }        MenuItemRec;
  93.  
  94. struct Menu {
  95.     int            m_imagetype;
  96. #define MENU_IMAGESTRING    0x00    /* imagedata is char * */
  97. #define MENU_GRAPHIC        0x01    /* imagedata is pixrect * */
  98.     caddr_t        m_imagedata;
  99.     int            m_itemcount;
  100.     MenuItemRec       *m_items;
  101.     struct Menu       *m_next;
  102.     caddr_t        m_data;
  103. };
  104.  
  105. typedef struct Menu MenuRec;
  106.  
  107. typedef XImage    PIXRECTREC;
  108. typedef XImage *PIXRECT;
  109. typedef XFontStruct *PIX_FONT;
  110. typedef XRotFontStruct *PIX_ROT_FONT;
  111. typedef MprData MPR_DATA;
  112. typedef Widget    TOOL;
  113. typedef Widget    TOOLSW;
  114. typedef pr_size PR_SIZE;
  115. typedef RectRec RECT;
  116.  
  117. extern Window    canvas_win, msg_win, sideruler_win, topruler_win;
  118.  
  119. extern Cursor    cur_cursor;
  120. extern Cursor    arrow_cursor, bull_cursor, buster_cursor, crosshair_cursor,
  121.         null_cursor, pencil_cursor, pick15_cursor, pick9_cursor,
  122.         panel_cursor, l_arrow_cursor, lr_arrow_cursor, r_arrow_cursor,
  123.         u_arrow_cursor, ud_arrow_cursor, d_arrow_cursor, wait_cursor;
  124.  
  125. extern TOOL    tool;
  126. extern XtAppContext tool_app;
  127.  
  128. extern TOOLSW    canvas_sw, ps_fontmenu, /* printer font menu tool */
  129.         latex_fontmenu, /* printer font menu tool */
  130.         msg_form, msg_panel, name_panel, cmd_panel, mode_panel, 
  131.         d_label, e_label, mousefun,
  132.         ind_viewp, ind_panel,    /* indicator panel */
  133.         unitbox_sw, sideruler_sw, topruler_sw;
  134.  
  135. extern Display *tool_d;
  136. extern Screen  *tool_s;
  137. extern int    tool_sn;
  138.  
  139. #define NUMFILLPATS 21
  140.  
  141. extern GC    gc, bold_gc, button_gc, ind_button_gc, mouse_button_gc,
  142.         color_gc, blank_gc, ind_blank_gc, mouse_blank_gc, gccache[NUMOPS],
  143.         fillgc, fill_gc[NUMFILLPATS],    /* fill style gc's */
  144.         black_fill_gc[NUMFILLPATS],
  145.         un_fill_gc[NUMFILLPATS],    /* unfill gc's */
  146.         black_un_fill_gc[NUMFILLPATS],
  147.         tr_gc, tr_xor_gc, tr_erase_gc,    /* for the rulers */
  148.         sr_gc, sr_xor_gc, sr_erase_gc;
  149.  
  150. extern Pixmap    fill_pm[NUMFILLPATS];
  151. extern XColor    x_fg_color, x_bg_color;
  152. extern Boolean    writing_bitmap;
  153. extern unsigned long but_fg, but_bg;
  154. extern unsigned long ind_but_fg, ind_but_bg;
  155. extern unsigned long mouse_but_fg, mouse_but_bg;
  156.  
  157. /* will be filled in with environment variable XFIGTMPDIR */
  158. extern char    *TMPDIR;
  159.  
  160. struct icon {
  161.     short        ic_width, ic_height;    /* overall icon dimensions */
  162.     PIXRECT        ic_background;    /* background pattern (mem pixrect) */
  163.     RECT        ic_gfxrect; /* where the graphic goes */
  164.     PIXRECT        ic_mpr;    /* the graphic (a memory pixrect) */
  165.     RECT        ic_textrect;/* where text goes */
  166.     char       *ic_text;    /* the text */
  167.     PIX_FONT        ic_font;    /* Font with which to display text */
  168.     int            ic_flags;
  169. };
  170.  
  171. /* flag values */
  172. #define ICON_BKGRDPAT    0x02    /* use ic_background to prepare image */
  173. #define ICON_BKGRDGRY    0x04    /* use std gray to prepare image */
  174. #define ICON_BKGRDCLR    0x08    /* clear to prepare image */
  175. #define ICON_BKGRDSET    0x10    /* set to prepare image */
  176. #define ICON_FIRSTPRIV    0x0100    /* start of private flags range */
  177. #define ICON_LASTPRIV    0x8000    /* end of private flags range */
  178.