home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / XfeWidgets / Xfe / Button.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  4.7 KB  |  138 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/Button.h>                                            */
  21. /* Description:    XfeButton widget public header file.                    */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27. #ifndef _XfeButton_h_                            /* start Button.h        */
  28. #define _XfeButton_h_
  29.  
  30. #include <Xfe/Label.h>
  31.  
  32. #ifdef __cplusplus                                /* start C++            */
  33. extern "C" {
  34. #endif
  35.  
  36. /*----------------------------------------------------------------------*/
  37. /*                                                                        */
  38. /* XmRButtonType                                                        */
  39. /*                                                                        */
  40. /*----------------------------------------------------------------------*/
  41. enum
  42. {
  43.     XmBUTTON_NONE,                                /*                        */
  44.     XmBUTTON_PUSH,                                /*                        */
  45.     XmBUTTON_TOGGLE                                /*                        */
  46. };
  47. /*----------------------------------------------------------------------*/
  48.  
  49. /*----------------------------------------------------------------------*/
  50. /*                                                                        */
  51. /* XmRButtonLayout                                                        */
  52. /*                                                                        */
  53. /*----------------------------------------------------------------------*/
  54. enum
  55. {
  56.     XmBUTTON_LABEL_ONLY,
  57.     XmBUTTON_LABEL_ON_BOTTOM,
  58.     XmBUTTON_LABEL_ON_LEFT,
  59.     XmBUTTON_LABEL_ON_RIGHT,
  60.     XmBUTTON_LABEL_ON_TOP,
  61.     XmBUTTON_PIXMAP_ONLY
  62. };
  63. /*----------------------------------------------------------------------*/
  64.  
  65. /*----------------------------------------------------------------------*/
  66. /*                                                                        */
  67. /* XmRButtonTrigger                                                        */
  68. /*                                                                        */
  69. /*----------------------------------------------------------------------*/
  70. enum
  71. {
  72.     XmBUTTON_TRIGGER_ANYWHERE,
  73.     XmBUTTON_TRIGGER_LABEL,
  74.     XmBUTTON_TRIGGER_PIXMAP,
  75.     XmBUTTON_TRIGGER_EITHER,
  76.     XmBUTTON_TRIGGER_NEITHER
  77. };
  78. /*----------------------------------------------------------------------*/
  79.  
  80. /*----------------------------------------------------------------------*/
  81. /*                                                                        */
  82. /* Button callback structure                                            */
  83. /*                                                                        */
  84. /*----------------------------------------------------------------------*/
  85. typedef struct
  86. {
  87.     int            reason;                    /* Reason why CB was invoked    */
  88.     XEvent *    event;                    /* Event that triggered CB        */
  89.     Boolean        armed;                    /* Button armed ?                */
  90.     Boolean        raised;                    /* Button raised ?                */
  91. } XfeButtonCallbackStruct;
  92.  
  93. /*----------------------------------------------------------------------*/
  94. /*                                                                        */
  95. /* XfeButton class names                                                */
  96. /*                                                                        */
  97. /*----------------------------------------------------------------------*/
  98. externalref WidgetClass xfeButtonWidgetClass;
  99.     
  100. typedef struct _XfeButtonClassRec *    XfeButtonWidgetClass;
  101. typedef struct _XfeButtonRec *        XfeButtonWidget;
  102.  
  103. /*----------------------------------------------------------------------*/
  104. /*                                                                        */
  105. /* XfeButton subclass test macro                                        */
  106. /*                                                                        */
  107. /*----------------------------------------------------------------------*/
  108. #define XfeIsButton(w)    XtIsSubclass(w,xfeButtonWidgetClass)
  109.  
  110. /*----------------------------------------------------------------------*/
  111. /*                                                                        */
  112. /* XfeButton public functions                                            */
  113. /*                                                                        */
  114. /*----------------------------------------------------------------------*/
  115. extern Widget
  116. XfeCreateButton                (Widget        parent,
  117.                              String        name,
  118.                              Arg *        args,
  119.                              Cardinal    num_args);
  120. /*----------------------------------------------------------------------*/
  121. extern void
  122. XfeButtonPreferredGeometry    (Widget                w,
  123.                              unsigned char        layout,
  124.                              Dimension *        width_out,
  125.                              Dimension *        height_out);
  126. /*----------------------------------------------------------------------*/
  127. extern Boolean
  128. XfeButtonAcceptXY            (Widget                w,
  129.                              int                x,
  130.                              int                y);
  131. /*----------------------------------------------------------------------*/
  132.  
  133. #ifdef __cplusplus                                /* end C++                */
  134. }
  135. #endif
  136.  
  137. #endif                                            /* end Button.h            */
  138.