1 /********************************************************************\
2 **                             _________________________________    **
3 **   A n t h o n y            |________    __    __    _________|   **
4 **                                     |  |o_|  |o_|  |             **
5 **           T h y s s e n           __|   __    __   |__           **
6 **                                __|   __|  |  |  |__   |__        **
7 **  `` Dragon Computing! ''    __|   __|     |  |     |__   |__     **
8 **                            |_____|        |__|        |_____|    **
9 **                                                                  **
10 \********************************************************************/
11 /*
12 ** IconLabelP.h - IconLabel Widget   Display a Pixmap with or without a label
13 **
14 ** Author: Anthony Thyssen
15 **         Griffith University
16 **         anthony@cit.gu.edu.au
17 **
18 ** Date:   March 30, 1996
19 **
20 ** This Widget was created due to problems with using the original X
21 ** Consortium Label Widget for displaying Bitmap and Pixmap in my
22 ** XbmBrowser program.  I designed this widget to basically display a
23 ** pixmap and optionally a title or filename centered underneath this
24 ** image.
25 **
26 ** FEATURES
27 **    1/  Pixmap displayed correctly (a flag indicates to treat it as a bitmap)
28 **    2/  Shaped Windows using the bitmap mask given
29 **    3/  Optional Label centered either above or below the image
30 **    4/  Numerous inter-dimension controls for good user control
31 **
32 */
33 
34 #ifndef _IconLabelP_h
35 #define _IconLabelP_h
36 
37 #include "IconLabel.h"
38 #include <X11/Xaw/SimpleP.h>
39 
40 /*---------------------------------------------------------------------------*/
41 /*---------------------------- Class Definitions ----------------------------*/
42 
43 /* Just use a empty class part for this widget */
44 typedef struct {int foo;} IconLabelClassPart;
45 
46 /* Full class record for widget */
47 typedef struct _IconLabelClassRec {
48     CoreClassPart       core_class;
49     SimpleClassPart     simple_class;
50     IconLabelClassPart  icon_label_class;
51 } IconLabelClassRec;
52 
53 /* The class record for this widget */
54 extern IconLabelClassRec iconLabelClassRec;
55 
56 
57 /*---------------------------------------------------------------------------*/
58 /*--------------------------- Instance Definitions --------------------------*/
59 
60 typedef struct {
61 /* --- public resources --- */
62 /* miscellanous */
63   Pixel       foreground;   /* foreground for label and bitmaps */
64   XFontStruct *font;        /* font to display labels and bitmaps */
65   Boolean     shape;        /* is the widget to use shaped windows? */
66   Boolean     resize;       /* resize allowed on this widget? */
67 /* pixmap stuff */
68   Pixmap      pixmap;       /* pixmap or bitmap to be displayed */
69   Pixmap      mask;         /* bitmap mask for window shape (without label) */
70   Boolean     is_bitmap;    /* is the pixmap really a bitmap? */
71 /* label stuff */
72   String      label;        /* the text label to use (NULL if off) */
73   Boolean     label_top;    /* label at top (or bottom by default) */
74 /* internal space */
75   Dimension   internal_height; /* space inside the widget */
76   Dimension   internal_width;
77   Dimension   label_gap;       /* extra space between label and pixmap */
78 /* Extra Information Pointer */
79   XtPointer   info_ptr;
80 
81 /* --- private variables --- */
82   GC          normal_GC;    /* Drawing GCs (sensitive or insensitive ) */
83   GC          gray_GC;
84   Pixmap      stipple;
85   XRectangle  pm_rect;     /* rectangles for position and shape */
86   XRectangle  lb_rect;     /*   of the pixmap/label parts */
87   int         pm_depth;    /* depth of the pixmap */
88   int         label_len;   /* length of the label */
89   Boolean     shape_on;    /* is shape currently on? */
90 } IconLabelPart;
91 
92 
93 /* Full Instance record for widget */
94 typedef struct _IconLabelRec {
95     CorePart       core;
96     SimplePart     simple;
97     IconLabelPart  icon_label;
98 } IconLabelRec;
99 
100 #endif /* _IconLabelP_h */
101 
102