home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / toswinsc.zoo / gadgets.c < prev    next >
C/C++ Source or Header  |  1992-10-27  |  1KB  |  79 lines

  1. /*
  2.  * Copyright 1992 Eric R. Smith. All rights reserved.
  3.  * Redistribution is permitted only if the distribution
  4.  * is not for profit, and only if all documentation
  5.  * (including, in particular, the file "copying")
  6.  * is included in the distribution in unmodified form.
  7.  * THIS PROGRAM COMES WITH ABSOLUTELY NO WARRANTY, NOT
  8.  * EVEN THE IMPLIED WARRANTIES OF MERCHANTIBILITY OR
  9.  * FITNESS FOR A PARTICULAR PURPOSE. USE AT YOUR OWN
  10.  * RISK.
  11.  */
  12. /*
  13.  * code for doing various user gadget type thingies
  14.  */
  15.  
  16. #include "xgem.h"
  17. #include "twdefs.h"
  18. #include "twproto.h"
  19.  
  20. void
  21. g_move()
  22. {
  23.     WINDOW *w;
  24.     int x, y, width, height;
  25.     int buttons, kshift;
  26.     int i;
  27.  
  28.     w = gl_topwin;
  29.     if (!w) return;
  30.  
  31.     wind_update(BEG_MCTRL);
  32.     graf_mouse(POINT_HAND, 0L);
  33.     wind_get(w->wi_handle, WF_CURRXYWH, &x, &y, &width, &height);
  34.  
  35.     evnt_button(1, 1, 1, &x, &y, &buttons, &kshift);
  36.  
  37.     i = graf_dragbox(width, height, x, y, xdesk, ydesk, wdesk, hdesk,
  38.              &x, &y);
  39.  
  40.     graf_mouse(ARROW, 0L);
  41.     wind_update(END_MCTRL);
  42.  
  43.     (*w->moved)(w, x, y, width, height);
  44. }
  45.  
  46. void
  47. g_full()
  48. {
  49.     WINDOW *w;
  50.  
  51.     w = gl_topwin;
  52.     if (!w) return;
  53.  
  54.     (*w->fulled)(w);
  55. }
  56.  
  57. void
  58. g_scroll(which)
  59.     long which;
  60. {
  61.     WINDOW *w;
  62.  
  63.     w = gl_topwin;
  64.     if (!w) return;
  65.  
  66.     (*w->arrowed)(w, (int)which);
  67. }
  68.  
  69. void
  70. g_close()
  71. {
  72.     WINDOW *w;
  73.  
  74.     w = gl_topwin;
  75.     if (w) {
  76.         (*w->closed)(w);
  77.     }
  78. }
  79.