home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume19 / xfig / part01 / e_break.c next >
Encoding:
C/C++ Source or Header  |  1993-05-27  |  2.2 KB  |  84 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 "resources.h"
  15. #include "mode.h"
  16. #include "object.h"
  17. #include "paintop.h"
  18. #include "u_search.h"
  19. #include "u_list.h"
  20. #include "u_undo.h"
  21. #include "w_canvas.h"
  22. #include "w_mousefun.h"
  23.  
  24. static int    init_break(), init_break_only(), init_break_tag();
  25.  
  26. break_selected()
  27. {
  28.     set_mousefun("break compound", "break and tag", "");
  29.     canvas_kbd_proc = null_proc;
  30.     canvas_locmove_proc = null_proc;
  31.     init_searchproc_left(init_break_only);
  32.     init_searchproc_middle(init_break_tag);
  33.     canvas_leftbut_proc = object_search_left;
  34.     canvas_middlebut_proc = object_search_middle;
  35.     canvas_rightbut_proc = null_proc;
  36.     set_cursor(pick15_cursor);
  37. }
  38.  
  39. static
  40. init_break_only(p, type, x, y, px, py, loc_tag)
  41.     char       *p;
  42.     int            type;
  43.     int            x, y;
  44.     int            px, py;
  45.     int         loc_tag;
  46. {
  47.     init_break(p, type, x, y, px, py, 0);
  48. }
  49.  
  50. static
  51. init_break_tag(p, type, x, y, px, py, loc_tag)
  52.     char       *p;
  53.     int            type;
  54.     int            x, y;
  55.     int            px, py;
  56.     int         loc_tag;
  57. {
  58.     init_break(p, type, x, y, px, py, 1);
  59. }
  60.  
  61. static
  62. init_break(p, type, x, y, px, py, loc_tag)
  63.     char       *p;
  64.     int            type;
  65.     int            x, y;
  66.     int            px, py;
  67.     int         loc_tag;
  68. {
  69.     if (type != O_COMPOUND)
  70.     return;
  71.  
  72.     cur_c = (F_compound *) p;
  73.     mask_toggle_compoundmarker(cur_c);
  74.     clean_up();
  75.     list_delete_compound(&objects.compounds, cur_c);
  76.     tail(&objects, &object_tails);
  77.     append_objects(&objects, cur_c, &object_tails);
  78.     toggle_markers_in_compound(cur_c);
  79.     set_tags(cur_c, loc_tag);
  80.     set_action(F_BREAK);
  81.     set_latestcompound(cur_c);
  82.     set_modifiedflag();
  83. }
  84.