home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / XfeWidgets / Xfe / LabelP.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  6.7 KB  |  181 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/LabelP.h>                                            */
  21. /* Description:    XfeLabel widget private header file.                    */
  22. /* Author:        Ramiro Estrugo <ramiro@netscape.com>                    */
  23. /*                                                                        */
  24. /*----------------------------------------------------------------------*/
  25.  
  26.  
  27. #ifndef _XfeLabelP_h_                            /* start LabelP.h        */
  28. #define _XfeLabelP_h_
  29.  
  30. #include <Xfe/Label.h>
  31. #include <Xfe/PrimitiveP.h>
  32.  
  33. #ifdef __cplusplus                                /* start C++            */
  34. extern "C" {
  35. #endif
  36.    
  37. /*----------------------------------------------------------------------*/
  38. /*                                                                        */
  39. /* XfeLabelClassPart                                                    */
  40. /*                                                                        */
  41. /*----------------------------------------------------------------------*/
  42. typedef struct
  43. {
  44.     XtWidgetProc        layout_string;                /* layout_label        */
  45.     XfeExposeProc        draw_string;                /* draw_string        */
  46.     XfeExposeProc        draw_selection;                /* draw_selection    */
  47.     XfeGetGCFunc        get_label_gc;                /* get_label_gc        */
  48.     XfeGetGCFunc        get_selection_gc;            /* get_selection_gc    */
  49.     XtPointer            extension;                    /* Extension        */
  50. } XfeLabelClassPart;
  51.  
  52. /*----------------------------------------------------------------------*/
  53. /*                                                                        */
  54. /* XfeLabelClassRec                                                        */
  55. /*                                                                        */
  56. /*----------------------------------------------------------------------*/
  57. typedef struct _XfeLabelClassRec
  58. {
  59.     CoreClassPart            core_class;
  60.     XmPrimitiveClassPart    primitive_class;
  61.     XfePrimitiveClassPart    xfe_primitive_class;
  62.     XfeLabelClassPart        xfe_label_class;
  63. } XfeLabelClassRec;
  64.  
  65. externalref XfeLabelClassRec xfeLabelClassRec;
  66.  
  67. /*----------------------------------------------------------------------*/
  68. /*                                                                        */
  69. /* XfeLabelPart                                                            */
  70. /*                                                                        */
  71. /*----------------------------------------------------------------------*/
  72. typedef struct _XfeLabelPart
  73. {
  74.     /* Callback resources */
  75.     XtCallbackList        selection_changed_callback;    /* Selection changed cb */
  76.  
  77.     /* Label resources */
  78.     unsigned char            label_alignment;        /* Label alignment    */
  79.     unsigned char            label_direction;        /* Label direction    */
  80.     XmFontList                font_list;                /* Label fontlist    */
  81.     XmString                label_string;            /* Label string        */
  82.  
  83.     /* Truncation resources */
  84.     Boolean                    truncate_label;            /* Truncate label    */
  85.     XfeTruncateXmStringProc    truncate_proc;            /* Trunctae proc    */    
  86.  
  87.     /* Selection resources */
  88.     Boolean                    selected;                /* Selected ?        */
  89.     Pixel                    selection_color;        /* Selection color    */
  90.     Modifiers                selection_modifiers;    /* Selection mod    */
  91.  
  92.     /* Private Data Members */
  93.     GC                        label_GC;                /* Label gc            */
  94.     GC                        insensitive_top_GC;        /* Insens top gc    */
  95.     GC                        insensitive_bottom_GC;    /* Insens bottom gc    */
  96.     XRectangle                label_rect;                /* Label rectangle    */
  97.     Dimension                misc_offset;            /* Misc offset        */
  98.  
  99.     GC                        selection_GC;            /* Selection  gc    */
  100.  
  101. } XfeLabelPart;
  102.  
  103. /*----------------------------------------------------------------------*/
  104. /*                                                                        */
  105. /* XfeLabelRec                                                            */
  106. /*                                                                        */
  107. /*----------------------------------------------------------------------*/
  108. typedef struct _XfeLabelRec
  109. {
  110.     CorePart            core;                    /* Core Part            */
  111.     XmPrimitivePart        primitive;                /* XmPrimitive Part        */
  112.     XfePrimitivePart    xfe_primitive;            /* XfePrimitive Part    */
  113.     XfeLabelPart        xfe_label;                /* XfeLabel Part        */
  114. } XfeLabelRec;
  115.  
  116. /*----------------------------------------------------------------------*/
  117. /*                                                                        */
  118. /* XfeLabelPart Access Macro                                            */
  119. /*                                                                        */
  120. /*----------------------------------------------------------------------*/
  121. #define _XfeLabelPart(w) &(((XfeLabelWidget) w) -> xfe_label)
  122.  
  123. /*----------------------------------------------------------------------*/
  124. /*                                                                        */
  125. /* XfeLabel Method invocation functions                                    */
  126. /*                                                                        */
  127. /*----------------------------------------------------------------------*/
  128. extern void
  129. _XfeLabelLayoutString            (Widget            w);
  130. /*----------------------------------------------------------------------*/
  131. extern void
  132. _XfeLabelDrawString                (Widget            w,
  133.                                  XEvent *        event,
  134.                                  Region            region,
  135.                                  XRectangle *    clip_rect);
  136. /*----------------------------------------------------------------------*/
  137. extern void
  138. _XfeLabelDrawSelection            (Widget            w,
  139.                                  XEvent *        event,
  140.                                  Region            region,
  141.                                  XRectangle *    clip_rect);
  142. /*----------------------------------------------------------------------*/
  143. extern GC
  144. _XfeLabelGetLabelGC                (Widget            w);
  145. /*----------------------------------------------------------------------*/
  146. extern GC
  147. _XfeLabelGetSelectionGC            (Widget            w);
  148. /*----------------------------------------------------------------------*/
  149.     
  150. /*----------------------------------------------------------------------*/
  151. /*                                                                        */
  152. /* XfeLabel action procedures                                            */
  153. /*                                                                        */
  154. /*----------------------------------------------------------------------*/
  155. extern void
  156. _XfeLabelSelect                    (Widget,XEvent *,char **,Cardinal *);
  157. /*----------------------------------------------------------------------*/
  158.  
  159. /*----------------------------------------------------------------------*/
  160. /*                                                                        */
  161. /* XfeLabel private functions                                            */
  162. /*                                                                        */
  163. /*----------------------------------------------------------------------*/
  164. extern  Boolean
  165. _XfeLabelAcceptSelectionEvent    (Widget            w,
  166.                                  XEvent *        event,
  167.                                  Boolean        inside_label);
  168. /*----------------------------------------------------------------------*/
  169. extern  void
  170. _XfeLabelSetSelected            (Widget            w,
  171.                                  XEvent *        event,
  172.                                  Boolean        selected,
  173.                                  Boolean        invoke_callbacks);
  174. /*----------------------------------------------------------------------*/
  175.  
  176. #ifdef __cplusplus                                /* end C++                */
  177. }
  178. #endif
  179.  
  180. #endif                                            /* end LabelP.h            */
  181.