1 /* $Header: /home/yav/xpx/RCS/work.c,v 1.16 1996/04/24 23:08:27 yav Exp $ 2 * xpx work area 3 * written by yav (UHD98984@pcvan.or.jp) 4 */ 5 6 #include <X11/Xlib.h> 7 #include <X11/Xutil.h> 8 9 #include "headers.h" 10 #include "xpx.h" 11 #include "version.h" 12 13 char rcsid_work[] = "$Id: work.c,v 1.16 1996/04/24 23:08:27 yav Exp $"; 14 15 char xpx_version[] = XPX_RCS_VERSION; 16 char *myname = "xpx"; 17 int debug_mode = 0; 18 Display *dsp; 19 int scr; 20 Colormap cmap; 21 Window win; 22 unsigned long fg, bg, border_color; 23 GC gc0, gc1, gridgc, grid0gc, areagc; 24 XImage *img; 25 Window imgwin; 26 XFontStruct *fs0, *fs1; 27 GC colgc[MAXCOLSET]; 28 Window viewwin; 29 int view_sw = 0; 30 XImage *vimg = NULL; 31 int imgmaxw = 640; 32 int imgmaxh = 400; 33 int maxzoom = 4; 34 int current_col = -1; 35 int current_pal = 0; 36 int sw_quit = 0; 37 Bool double_clicked = False; 38 int zoomfactor = 2; 39 char imgfilename[MAXPATH] = "*Noname*"; 40 char colfilename[MAXPATH] = "*Noname*"; 41 unsigned char *imgdata; 42 int imgofsx = 0; 43 int imgofsy = 0; 44 int imgwinwidth, imgwinheight; 45 int alloced_color = 0; 46 int alloced_private_color = 0; 47 int missed_color = 0; 48 Bool grid_mode = False; 49 int grid_size = 8; 50 int grid_ofsx = 0; 51 int grid_ofsy = 0; 52 int imgfilew = 0; 53 int imgfileh = 0; 54 int imgfiledepth = 0; 55 int imgposx = 0; 56 int imgposy = 0; 57 int colposx = 0; 58 int colposy = 0; 59 int colfilew = 0; 60 int colfileh = 0; 61 int curx = 0; 62 int cury = 0; 63 int curz = 0; 64 int scroll_speed = 8; 65 int scroll_dx = 0; 66 int scroll_dy = 0; 67 int scroll_ax = 0; 68 int scroll_ay = 0; 69 int border_width = 1; 70 int menu_speed = 8; 71 int hotspotx = -1; 72 int hotspoty = -1; 73 Bool nocopypixel_mode = False; 74 int nocopypixel = 0; 75 char imgchanged = 0; /* 0:nochanged 1:changed 2:noreturn*/ 76 char colchanged = 0; /* 0:nochanged 1:changed */ 77 Bool imgwin_noexpose = True; 78 int oargc; 79 char **oargv; 80 Cursor curs_watch; 81 Cursor curs_cross; 82 #define MAXTOPLEVELWINDOW 32 83 int toplevelwc = 0; 84 Window toplevelwin[MAXTOPLEVELWINDOW]; 85 86 COL *color_buf = NULL; 87 char *coltbl = NULL; 88 char *colmask = NULL; 89 unsigned long *pixtbl = NULL; 90 91 char str_file_geom[32] = ""; 92 char str_info_geom[32] = ""; 93 char str_edit_geom[32] = ""; 94 95 Window infowin; 96 Window filewin; 97 Window editwin; 98 99 int imgwx = -1; /* 140 */ /* image window x position */ 100 int imgwy = -1; /* 80 */ /* image window y position */ 101 int menumode = 1; /* 0:menu off */ 102 int scrollbarmode = 2; /* 0:scroll bar off, 1:old style */ 103 int quick_convert = False; 104 int backingstoremode = 0; /* 0:no use 1:WhenMapped 2:Always */ 105 106 /* 8x8 hatch pattern */ 107 char hatch_bits[] = {0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55}; 108 Pixmap hatch_pixmap; 109 110 111 /* End of file */ 112