home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume19 / xfig / part02 / mode.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-27  |  3.5 KB  |  129 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 "fig.h"
  14. #include "mode.h"
  15. #include "resources.h"
  16. #include "object.h"
  17. #include "w_indpanel.h"
  18.  
  19. int        cur_mode = F_NULL;
  20. int        cur_halign = NONE;
  21. int        cur_valign = NONE;
  22. int        manhattan_mode = 0;
  23. int        mountain_mode = 0;
  24. int        latexline_mode = 0;
  25. int        latexarrow_mode = 0;
  26. int        autoforwardarrow_mode = 0;
  27. int        autobackwardarrow_mode = 0;
  28. int        cur_gridmode = GRID_0;
  29. int        cur_pointposn = P_MAGNET;
  30. int        posn_rnd[P_GRID2 + 1];
  31. int        posn_hlf[P_GRID2 + 1];
  32. int        grid_fine[P_GRID2 + 1];
  33. int        grid_coarse[P_GRID2 + 1];
  34. char           *grid_name[P_GRID2 + 1];
  35. int        cur_rotnangle = 90;
  36. int        cur_linkmode = 0;
  37. int        cur_numsides = 6;
  38. int        action_on = 0;
  39. int        highlighting = 0;
  40. int        aborting = 0;
  41. int        anypointposn = 0;
  42. int        figure_modified = 0;
  43. char        cur_fig_units[32];
  44. Boolean        warnexist = True;
  45.  
  46. /**********************     global mode variables    ************************/
  47.  
  48. int        num_point;
  49. int        min_num_points;
  50.  
  51. /***************************  Export Settings  ****************************/
  52.  
  53. Boolean        export_flushleft;    /* flush left (true) or center (false) */
  54.  
  55. /***************************  Print Settings  ****************************/
  56.  
  57. int        print_landscape = 0;    /* def. orientation for printer */
  58. Boolean        print_flushleft;    /* flush left (true) or center (false) */
  59. int        cur_exp_lang = LANG_EPS; /* actually gets set up in main.c */
  60. Boolean        batch_exists = False;
  61. char        batch_file[32];
  62.  
  63. char           *lang_items[] = {
  64.     "box",     "latex",  "epic", "eepic", "eepicemu",
  65.     "pictex",  "ibmgl",  "eps",  "ps",    "pstex", 
  66.     "pstex_t", "textyl", "tpic", "pic",   "xbm"};
  67.  
  68. char           *lang_texts[] = {
  69.     "LaTeX box (figure boundary)    ",
  70.     "LaTeX picture                  ",
  71.     "LaTeX picture + epic macros    ",
  72.     "LaTeX picture + eepic macros   ",
  73.     "LaTeX picture + eepicemu macros",
  74.     "PiCTeX macros                  ",
  75.     "IBMGL (or HPGL)                ",
  76.     "Encapsulated Postscript        ",
  77.     "Postscript                     ",
  78.     "Combined PS/LaTeX (PS part)    ",
  79.     "Combined PS/LaTeX (LaTeX part) ",
  80.     "Textyl \\special commands       ",
  81.     "TPIC                           ",
  82.     "PIC                            ",
  83.     "X11 Bitmap                     "};
  84.  
  85. /***************************  Mode Settings  ****************************/
  86.  
  87. int        cur_objmask = M_NONE;
  88. int        cur_updatemask = I_UPDATEMASK;
  89. int        cur_depth = 0;
  90.  
  91. /***************************  Text Settings  ****************************/
  92.  
  93. int        hidden_text_length;
  94. float        cur_textstep = 1.2;
  95.  
  96. /***************************  File Settings  ****************************/
  97.  
  98. char        cur_dir[1024];
  99. char        cur_filename[200] = "";
  100. char        save_filename[200] = "";    /* to undo load */
  101. char        cut_buf_name[100];
  102. char        file_header[32] = "#FIG ";
  103.  
  104. /*************************** routines ***********************/
  105.  
  106. void
  107. reset_modifiedflag()
  108. {
  109.     figure_modified = 0;
  110. }
  111.  
  112. void
  113. set_modifiedflag()
  114. {
  115.     figure_modified = 1;
  116. }
  117.  
  118. void
  119. set_action_on()
  120. {
  121.     action_on = 1;
  122. }
  123.  
  124. void
  125. reset_action_on()
  126. {
  127.     action_on = 0;
  128. }
  129.