Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / dtappbuilder / src / ab / pal.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
6  * These libraries and programs are free software; you can
7  * redistribute them and/or modify them under the terms of the GNU
8  * Lesser General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * These libraries and programs are distributed in the hope that
13  * they will be useful, but WITHOUT ANY WARRANTY; without even the
14  * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15  * PURPOSE. See the GNU Lesser General Public License for more
16  * details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with these librararies and programs; if not, write
20  * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21  * Floor, Boston, MA 02110-1301 USA
22  */
23
24 /*
25  *      $XConsortium: pal.h /main/3 1995/11/06 17:35:34 rswiston $
26  *
27  * @(#)pal.h    1.32 01 Feb 1995      cde_app_builder/src/ab
28  *
29  *      RESTRICTED CONFIDENTIAL INFORMATION:
30  *
31  *      The information in this document is subject to special
32  *      restrictions in a confidential disclosure agreement between
33  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
34  *      document outside HP, IBM, Sun, USL, SCO, or Univel without
35  *      Sun's specific written approval.  This document and all copies
36  *      and derivative works thereof must be returned or destroyed at
37  *      Sun's request.
38  *
39  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
40  *
41  */
42
43 /*
44  * pal.h - implements the palette object mechanism
45  */
46 #ifndef _PAL_H_
47 #define _PAL_H_
48
49 #include <X11/Intrinsic.h>
50 #include <ab_private/obj.h>
51 #include <ab_private/proj.h>
52
53 /*
54  * AppBuilder Property sheet types: Revolving & fixed
55  */
56 typedef enum
57 {
58         AB_PROP_UNDEF = 0,
59         AB_PROP_REVOLVING,
60         AB_PROP_FIXED,
61         AB_PROP_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
62         /* ANSI: no comma after last enum item! */
63 } AB_PROP_TYPE;
64
65 typedef struct _PAL_ITEM_INFO           PalItemInfo;
66 typedef struct _PAL_EDITABLE_OBJ_INFO   PalEditableObjInfo;
67
68 /*
69  * define types for palette item "methods"
70  */
71 typedef int     (*PalItemInitProc) (
72     ABObj
73 );
74
75 typedef Widget  (*PalItemPropInitProc) (
76     Widget,
77     AB_PROP_TYPE    
78 );
79
80 typedef int  (*PalItemPropClearProc) (
81     AB_PROP_TYPE
82 );
83
84 typedef int     (*PalItemPropActiveProc) (
85     AB_PROP_TYPE,
86     BOOL
87 );
88
89 typedef int     (*PalItemPropLoadProc) (
90     ABObj,
91     AB_PROP_TYPE,
92     unsigned long
93 );
94
95 typedef int     (*PalItemPropApplyProc) (
96     AB_PROP_TYPE
97 );
98
99 typedef BOOL    (*PalItemPropPendingFunc)(
100     AB_PROP_TYPE
101 );
102
103 typedef BOOL    (*PalItemIsaFunc) (
104     ABObj
105 );
106
107 typedef struct _PAL_SUBTYPE_INFO {
108     int                 subtype;
109     String              subname;
110     Pixmap              pixmap;
111     unsigned int        pmwidth;
112     unsigned int        pmheight;
113 } PalSubtypeInfo;
114  
115 /*
116  * Palette Item Info Structure - one for each type of object supported
117  */
118 typedef struct _PAL_ITEM_INFO {
119
120     /* Data...*/
121     AB_OBJECT_TYPE         type;            /* AB type                */
122     char                   *name;           /* virtual name           */
123     PalSubtypeInfo         *subinfo;        /* specific subtype info  */
124     int                    num_subinfo;     /* number of subtypes     */
125     Widget                 rev_prop_frame;  /* revolving prop sheet   */
126     Widget                 fix_prop_dialog; /* fixed prop sheet       */
127
128     /* Methods...*/
129     PalItemInitProc        initialize;      /* initializes instance     */
130     PalItemIsaFunc         is_a_test;       /* "is a" test              */
131     PalItemPropInitProc    prop_initialize; /* creates prop sheet       */
132     PalItemPropActiveProc  prop_activate;   /* sets prop sheet active/inactive */
133     PalItemPropClearProc   prop_clear;      /* clears prop sheet              */
134     PalItemPropLoadProc    prop_load;       /* loads prop sheet         */
135     PalItemPropApplyProc   prop_apply;      /* applys properties to obj */
136     PalItemPropPendingFunc prop_pending;    /* checks for pending changes */
137
138 } PAL_ITEM_INFO;
139
140 typedef struct _PAL_EDITABLE_OBJ_INFO {
141     AB_OBJECT_TYPE      type;
142     int                 subtype;
143     ISTRING             name;
144     PalItemInfo         *palitem;
145     PalEditableObjInfo  *next;
146 } PAL_EDITABLE_OBJ_INFO;
147
148 typedef BOOL    (*PalEditableObjTestFunc) (
149     PalEditableObjInfo *edobj_info
150 );
151
152 extern PalItemInfo      *ab_button_palitem;
153 extern PalItemInfo      *ab_choice_palitem;
154 extern PalItemInfo      *ab_combo_box_palitem;
155 extern PalItemInfo      *ab_cpanel_palitem;
156 extern PalItemInfo      *ab_custdlg_palitem;
157 extern PalItemInfo      *ab_drawp_palitem;
158 extern PalItemInfo      *ab_label_palitem;
159 extern PalItemInfo      *ab_group_palitem;
160 extern PalItemInfo      *ab_list_palitem;
161 extern PalItemInfo      *ab_mainwin_palitem;
162 extern PalItemInfo      *ab_menu_palitem;
163 extern PalItemInfo      *ab_menubar_palitem;
164 extern PalItemInfo      *ab_scale_palitem;
165 extern PalItemInfo      *ab_separator_palitem;
166 extern PalItemInfo      *ab_spinbox_palitem;
167 extern PalItemInfo      *ab_termp_palitem;
168 extern PalItemInfo      *ab_textf_palitem;
169 extern PalItemInfo      *ab_textp_palitem;
170 extern PalItemInfo      *ab_fchooser_palitem;
171 extern PalItemInfo      *ab_panedwin_palitem;
172
173
174
175 extern void     pal_register_item_info(
176                     Widget       pwidget,
177                     PalItemInfo  *palitem,
178                     int          subtype,
179                     String       subname,
180                     Pixmap       pixmap
181                 );
182
183 extern void     pal_enable_item_drag(
184                     Widget      item_widget,
185                     int         subtype
186                 );
187
188 extern PalItemInfo *pal_get_item_info(
189                     ABObj        obj
190                 );
191
192 extern PalItemInfo* pal_get_type_item_info(
193                     AB_OBJECT_TYPE      type,
194                     int                 subtype
195                 );
196
197 extern Pixmap   pal_get_item_pixmap(
198                     ABObj       obj,
199                     int         subtype,
200                     int         *p_width,
201                     int         *p_height
202                 );
203
204 extern STRING   pal_get_item_subname(
205                     ABObj       obj,
206                     int         subtype
207                 );
208
209 extern void     pal_register_editable_obj(
210                     AB_OBJECT_TYPE      type,
211                     int                 subtype,
212                     STRING              name,
213                     PalItemInfo         *palitem
214                 );
215
216 extern PalEditableObjInfo *
217                 pal_get_editable_obj_info(
218                     ABObj               obj
219                 );
220
221 extern void     pal_add_editable_obj_menu_items(
222                     Widget              menu_pane,
223                     XtCallbackProc      item_cb,
224                     PalEditableObjTestFunc test_func
225                 );
226
227 extern int      pal_initialize_obj(
228                     ABObj        obj
229                 );
230
231 extern int      pal_create_menu(
232                     AB_PROP_TYPE  type,
233                     ABObj         module,
234                     STRING        menu_name,
235                     STRING        menu_title
236                 );
237
238 extern void     pal_set_File_menu(
239                     AB_CHOOSER_TYPE     chooser_type,
240                     BOOL                active
241                 );
242
243 #endif /* _PAL_H_ */