home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / XfeWidgets / Xfe / ButtonP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  8.3 KB  |  218 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /*-----------------------------------------*/
  19. /*                                                                        */
  20. /* Name:        <Xfe/ButtonP.h>                                            */
  21. /* Description:    XfeButton widget private header file.                    */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27. #ifndef _XfeButtonP_h_                            /* start ButtonP.h        */
  28. #define _XfeButtonP_h_
  29.  
  30. #include <Xfe/Button.h>
  31. #include <Xfe/LabelP.h>
  32.  
  33. #ifdef __cplusplus                                /* start C++            */
  34. extern "C" {
  35. #endif
  36.    
  37. /*----------------------------------------------------------------------*/
  38. /*                                                                        */
  39. /* XfeButtonClassPart                                                    */
  40. /*                                                                        */
  41. /*----------------------------------------------------------------------*/
  42. typedef struct
  43. {
  44.     XtWidgetProc            layout_pixmap;        /* layout_pixmap        */
  45.     XfeExposeProc            draw_pixmap;        /* draw_pixmap            */
  46.     XfeExposeProc            draw_raise_border;    /* draw_raise_border    */
  47.     XtTimerCallbackProc        arm_timeout;        /* arm_timeout            */
  48.     XtPointer                extension;            /* Extension            */
  49. } XfeButtonClassPart;
  50.  
  51. /*----------------------------------------------------------------------*/
  52. /*                                                                        */
  53. /* XfeButtonClassRec                                                    */
  54. /*                                                                        */
  55. /*----------------------------------------------------------------------*/
  56. typedef struct _XfeButtonClassRec
  57. {
  58.     CoreClassPart            core_class;
  59.     XmPrimitiveClassPart    primitive_class;
  60.     XfePrimitiveClassPart    xfe_primitive_class;
  61.     XfeLabelClassPart        xfe_label_class;
  62.     XfeButtonClassPart        xfe_button_class;
  63. } XfeButtonClassRec;
  64.  
  65. externalref XfeButtonClassRec xfeButtonClassRec;
  66.  
  67. /*----------------------------------------------------------------------*/
  68. /*                                                                        */
  69. /* XfeButtonPart                                                        */
  70. /*                                                                        */
  71. /*----------------------------------------------------------------------*/
  72. typedef struct _XfeButtonPart
  73. {
  74.     /* Callback resources */
  75.     XtCallbackList        activate_callback;        /* Activate callback    */
  76.     XtCallbackList        arm_callback;            /* Arm callback            */
  77.     XtCallbackList        disarm_callback;        /* Disarm callback        */
  78.     XtCallbackList        button_3_down_callback;    /* Button 3 down cb        */
  79.     XtCallbackList        button_3_up_callback;    /* Button 3 up cb        */
  80.     
  81.     /* Pixmap resources */
  82.     Pixmap                armed_pixmap;            /* Armed pixmap            */
  83.     Pixmap                raised_pixmap;            /* Raised pixmap        */
  84.     Pixmap                insensitive_pixmap;        /* Insensitive pixmap    */
  85.     Pixmap                pixmap;                    /* Pixmap                */
  86.  
  87.     Pixmap                armed_pixmap_mask;        /* Armed pixmap mask    */
  88.     Pixmap                raised_pixmap_mask;        /* Raised pixmap mask    */
  89.     Pixmap                insensitive_pixmap_mask;/* Insens pixmap mask    */
  90.     Pixmap                pixmap_mask;            /* Pixmap mask            */
  91.  
  92.  
  93.     /* Arm resources */
  94.     Boolean                armed;                    /* Armed ?                */
  95.     Pixel                arm_background;            /* Arm background        */
  96.     Dimension            arm_offset;                /* Arm offset            */
  97.     Boolean                fill_on_arm;            /* Fill on arm ?        */
  98.  
  99.     /* Raise resources */
  100.     Boolean                fill_on_enter;            /* Fill on raise ?        */
  101.     Pixel                raise_foreground;        /* Raise foreground        */
  102.     Pixel                raise_background;        /* Raise background        */
  103.     Dimension            raise_border_thickness;    /* Raise border thickness*/
  104.     Boolean                raise_on_enter;            /* Raise on enter ?        */
  105.     Boolean                raised;                    /* Raised ?                */
  106.     Boolean                determinate;            /* Determinate ?        */
  107.  
  108.     /* Misc resources */
  109.     unsigned char        button_type;            /* Button type            */
  110.     unsigned char        button_layout;            /* Button layout        */
  111.     unsigned char        button_trigger;            /* Button trigger        */
  112.     Boolean                emulate_motif;            /* Emulate motif        */
  113.     Dimension            spacing;                /* Spacing                */
  114.  
  115.     /* Cursor resources */
  116.     Cursor                transparent_cursor;        /* Transparent cursor    */
  117.  
  118.     /* Private Data Members */
  119.     GC                    label_raised_GC;        /* Label raised gc        */
  120.     GC                    armed_GC;                /* Armed gc                */
  121.     GC                    raised_GC;                /* Raised gc            */
  122.  
  123.     GC                    pixmap_GC;                /* Pixmap gc            */
  124.     XRectangle            pixmap_rect;            /* Box rectangle        */
  125.  
  126.     Boolean                clicking;                /* Clicking                */
  127.  
  128.     Boolean                transparent_cursor_state;/* Trans cursor state    */
  129.  
  130. } XfeButtonPart;
  131.  
  132. /*----------------------------------------------------------------------*/
  133. /*                                                                        */
  134. /* XfeButtonRec                                                            */
  135. /*                                                                        */
  136. /*----------------------------------------------------------------------*/
  137. typedef struct _XfeButtonRec
  138. {
  139.     CorePart            core;                    /* Core Part            */
  140.     XmPrimitivePart        primitive;                /* XmPrimitive Part        */
  141.     XfePrimitivePart    xfe_primitive;            /* XfePrimitive Part    */
  142.     XfeLabelPart        xfe_label;                /* XfeLabel Part        */
  143.     XfeButtonPart        xfe_button;                /* XfeButton Part        */
  144. } XfeButtonRec;
  145.  
  146. /*----------------------------------------------------------------------*/
  147. /*                                                                        */
  148. /* XfeButtonPart Access Macro                                            */
  149. /*                                                                        */
  150. /*----------------------------------------------------------------------*/
  151. #define _XfeButtonPart(w) &(((XfeButtonWidget) w) -> xfe_button)
  152.  
  153.  
  154. /*----------------------------------------------------------------------*/
  155. /*                                                                        */
  156. /* XfeButton Method invocation functions                                */
  157. /*                                                                        */
  158. /*----------------------------------------------------------------------*/
  159. extern void
  160. _XfeButtonLayoutPixmap            (Widget            w);
  161. /*----------------------------------------------------------------------*/
  162. extern void
  163. _XfeButtonDrawPixmap            (Widget            w,
  164.                                  XEvent *        event,
  165.                                  Region            region,
  166.                                  XRectangle *    clip_rect);
  167. /*----------------------------------------------------------------------*/
  168. extern void
  169. _XfeButtonDrawRaiseBorder        (Widget            w,
  170.                                  XEvent *        event,
  171.                                  Region            region,
  172.                                  XRectangle *    clip_rect);
  173. /*----------------------------------------------------------------------*/
  174. extern void
  175. _XfeButtonArmTimeout            (Widget            w,
  176.                                  XtPointer        client_data,
  177.                                  XtIntervalId *    id);
  178. /*----------------------------------------------------------------------*/
  179.  
  180. /*----------------------------------------------------------------------*/
  181. /*                                                                        */
  182. /* XfeButton action procedures                                            */
  183. /*                                                                        */
  184. /*----------------------------------------------------------------------*/
  185. extern void
  186. _XfeButtonEnter                    (Widget,XEvent *,char **,Cardinal *);
  187. /*----------------------------------------------------------------------*/
  188. extern void
  189. _XfeButtonLeave                    (Widget,XEvent *,char **,Cardinal *);
  190. /*----------------------------------------------------------------------*/
  191. extern void
  192. _XfeButtonMotion                (Widget,XEvent *,char **,Cardinal *);
  193. /*----------------------------------------------------------------------*/
  194. extern void
  195. _XfeButtonArm                    (Widget,XEvent *,char **,Cardinal *);
  196. /*----------------------------------------------------------------------*/
  197. extern void
  198. _XfeButtonActivate                (Widget,XEvent *,char **,Cardinal *);
  199. /*----------------------------------------------------------------------*/
  200. extern void
  201. _XfeButtonDisarm                (Widget,XEvent *,char **,Cardinal *);
  202. /*----------------------------------------------------------------------*/
  203. extern void
  204. _XfeButtonArmAndActivate        (Widget,XEvent *,char **,Cardinal *);
  205. /*----------------------------------------------------------------------*/
  206. extern void
  207. _XfeButtonBtn3Down                (Widget,XEvent *,char **,Cardinal *);
  208. /*----------------------------------------------------------------------*/
  209. extern void
  210. _XfeButtonBtn3Up                (Widget,XEvent *,char **,Cardinal *);
  211. /*----------------------------------------------------------------------*/
  212.  
  213. #ifdef __cplusplus                                /* end C++                */
  214. }
  215. #endif
  216.  
  217. #endif                                            /* end ButtonP.h        */
  218.