home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / educatio / xcoral16.zip / BUTTONS.H < prev    next >
C/C++ Source or Header  |  1993-01-15  |  2KB  |  81 lines

  1. /*
  2. ** Copyright 1989, 1992 by Lionel Fournigault
  3. **
  4. ** Permission to use, copy, and distribute for non-commercial purposes,
  5. ** is hereby granted without fee, providing that the above copyright
  6. ** notice appear in all copies and that both the copyright notice and this
  7. ** permission notice appear in supporting documentation.
  8. ** The software may be modified for your own purposes, but modified versions
  9. ** may not be distributed.
  10. ** This software is provided "as is" without any expressed or implied warranty.
  11. **
  12. **
  13. */
  14.  
  15. #ifndef _BUTTONS_H
  16. #define _BUTTONS_H
  17.  
  18. typedef struct {
  19.     Window     w;        /* Fenetre associee */
  20.     void    (* f) ();     /* Callback */
  21. }ButtonWindow;
  22.  
  23. typedef struct {
  24.     Pixmap        head_pix;
  25.     Pixmap        queue_pix;
  26.     Pixmap        up_pix;
  27.     Pixmap        down_pix;
  28.     Pixmap        np_pix;
  29.     Pixmap        pp_pix;
  30.     GC        mess_gc;
  31.     XFontStruct    *font;
  32.     unsigned long     fg, bg;
  33.     unsigned long   top_shadow, bot_shadow;
  34. } ResourcesButton;
  35.  
  36. /*
  37.  * La structure de controle en bas de la fenetre d'edition.
  38.  */
  39. typedef struct {
  40.     Window        frame;
  41.     Window        w_stat;
  42.     int        stat;
  43.     Window        mess;
  44.     Window        w_mode;
  45.     int        mode;
  46.     int             twidth, theight;
  47.     Window        up, down, np, pp;
  48.     Window        head, q;
  49.     char         s [256];
  50.     GC        mess_gc;
  51.     XFontStruct    *font;
  52.     unsigned long     fg, bg, red, green;
  53.     unsigned long   top_sh, bot_sh;
  54. } MWin;
  55.  
  56. /*
  57.  * Public
  58.  */
  59. #define    BUTTON_W    24
  60. #define MW_SPACE    5
  61. #define NB_BUTTONS    6
  62.  
  63. extern void     InitControlRes ( /* fg, bg, ts, bs */ );
  64. extern MWin     *MakeControlPanel ( /* w */ );
  65. extern void    DeleteControlPanel ( /* mwin */ );
  66. extern void    RefreshWindowStatBuf ( /* mwin */ );
  67. extern void    RefreshWindowMode ( /* mwin */ );
  68. extern char     *GetString ( /* text, prompt, reply */ );
  69. extern void    ShowControlPanel ( /* mwin, width, height */ );
  70. extern void    DisplayMessage ( /* mwin, s */ );
  71. extern void    ClearMessageWindow ( /* mwin */ );
  72. extern void     ButtonPressInControl ( /* ev, text, i */ );
  73. extern int     IsButtonInControl ( /* w */ );
  74. extern void     SetButton ( /* mwin */ );
  75. extern int    ExposeInControlPanel ( /* w, mwin */ );
  76.  
  77. #define HeightOfMess() ( BUTTON_W + 4 );
  78. #define ExecButtonFunction(text,i) ( bw [i].f ) ( text );
  79.  
  80. #endif /* _BUTTONS_H_ */
  81.