2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
25 * $XConsortium: prop.h /main/5 1996/08/08 17:58:47 mustafa $
27 * @(#)prop.h 1.75 95/04/20 Copyright 1993 Sun Microsystems
29 * RESTRICTED CONFIDENTIAL INFORMATION:
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
39 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 * prop.h - defines structures/routines required for property sheets
49 #include <X11/Intrinsic.h>
52 #include <ab_private/obj.h>
53 #include <ab_private/pal.h>
54 #include <ab_private/abobj_edit.h>
55 #include "revolv_ui.h"
57 #define SIZE_OF_CONTENTS_KEY -1
58 #define SIZE_FIXED_KEY 0
59 #define SIZE_IN_CHARS_KEY 88
60 #define SIZE_IN_PIXELS_KEY 99
61 #define EDIT_CHANGE 111
62 #define HELP_ITEM_KEY 222
63 #define DISMISS_ITEM_KEY 333
64 #define ACTION1_ITEM_KEY 444
65 #define ACTION2_ITEM_KEY 555
66 #define ACTION3_ITEM_KEY 777
67 #define CANCEL_ITEM_KEY 888
68 #define SHOW_VALUE_KEY 999
71 * Load Flags - defines which attributes need to be loaded
73 #define LoadClear 0x0000
74 #define LoadAll 0x0001
75 #define LoadName 0x0002
76 #define LoadPosition 0x0004
77 #define LoadSize 0x0008
80 * Enum values for Changebar State
89 #define ERR_ATOI MAXINT
92 * Item Editing Insert choices
96 INSERT_AFTER = 6, /* prevent conflict with AB_EDIT_ enums */
115 extern char *LabelForString;
116 extern char *LabelForGraphic;
117 extern char *NoneItem;
118 extern char *XFieldStr;
119 extern char *YFieldStr;
120 extern char *WFieldStr;
121 extern char *HFieldStr;
122 extern char *OffsetFieldStr;
123 extern char *PercentageFieldStr;
124 extern char *RowColFieldStr;
125 extern char *VertSpacingFieldStr;
126 extern char *HorizSpacingFieldStr;
129 * Structures to store Prop Sheet Setting Widgets
131 typedef struct _PROP_CHECKBOX_SETTING {
135 } PropCheckboxSettingRec, *PropCheckboxSetting;
137 typedef struct _PROP_COLOR_SETTING {
143 } PropColorSettingRec, *PropColorSetting;
145 typedef struct _PROP_OBJ_COMBOBOX_SETTING {
150 ABObj *current_obj_ptr;
151 } PropObjComboboxSettingRec, *PropObjComboboxSetting;
153 typedef struct _PROP_FIELD_SETTING {
157 } PropFieldSettingRec, *PropFieldSetting;
159 typedef struct _PROP_FOOTER_SETTING {
164 } PropFooterSettingRec, *PropFooterSetting;
166 typedef struct _PROP_GEOMETRY_SETTING {
177 } PropGeometrySettingRec, *PropGeometrySetting;
179 typedef struct _PROP_MENUNAME_SETTING {
180 AB_PROP_TYPE prop_type;
184 Widget owner_name_field;
186 PropFieldSetting menu_title_pfs;
187 ABObj *current_obj_ptr;
188 } PropMenunameSettingRec, *PropMenunameSetting;
190 typedef struct _PROP_OPTIONS_SETTING {
195 } PropOptionsSettingRec, *PropOptionsSetting;
197 typedef struct _PROP_OBJ_OPTIONS_SETTING {
198 PropOptionsSettingRec options;
200 ABObj *current_obj_ptr;
201 ABObjTestFunc obj_test_func;
203 } PropObjOptionsSettingRec, *PropObjOptionsSetting;
205 typedef struct _PROP_RADIO_SETTING {
209 } PropRadioSettingRec, *PropRadioSetting;
211 typedef struct _PROP_ITEMS_SETTING {
212 AB_ITEM_TYPE item_type;
215 PropFieldSetting item_label_pfs;
216 PropOptionsSetting item_label_type_pos;
217 PropFieldSetting item_mnemonic_pfs;
218 PropFieldSetting item_accel_pfs;
219 PropOptionsSetting item_line_style_pos;
220 PropCheckboxSetting item_state_pcs;
221 PropMenunameSetting item_menuname_pms;
224 ABObj clipboard_item;
225 ABObj *current_obj_ptr;
226 } PropItemsSettingRec, *PropItemsSetting;
229 * Prop Dialog Management Functions
231 /* Prop module Initialization
233 extern void prop_init(
237 /* Property Dialog "Popup" routines
239 extern void prop_show_dialog(
241 XtPointer client_data,
244 extern void prop_show_fixed(
247 extern void prop_show_menu_props(
249 XtPointer client_data,
252 extern void prop_show_group_props(
254 XtPointer client_data,
257 extern void prop_load_obj(
261 /* Prop Dialog Initialization Functions
263 extern void prop_activate_panel_init(
265 PalItemInfo *palitem,
269 Widget cancel_button,
272 extern void prop_editors_panel_init(
274 PalItemInfo *palitem,
275 Widget attach_ed_button,
276 Widget conn_ed_button,
277 Widget help_ed_button
279 extern void prop_fixed_dialog_init(
280 PalItemInfo *palitem,
285 /* Checkbox Setting Functions
287 extern void prop_checkbox_init(
288 PropCheckboxSetting pcs,
296 extern BOOL prop_checkbox_get_value(
297 PropCheckboxSetting pcs,
300 extern int prop_checkbox_set_value(
301 PropCheckboxSetting pcs,
307 /* Color Field Functions
309 extern void prop_colorfield_init(
310 PropColorSetting pcs,
318 extern int prop_colorfield_set_value(
319 PropColorSetting pcs,
320 STRING colorname, /* NULL clears swatch */
323 /* Caller must free memory allocated for return String */
324 extern STRING prop_colorfield_get_value(
328 /* REMIND: ComboBox has too many bugs to use right now; if
329 * we never revert back to using it, delete these functions
331 /* Object Combobox Functions
333 extern void prop_obj_combobox_init(
334 PropObjComboboxSetting pcs,
338 ABObj *current_obj_ptr
341 extern ABObj prop_obj_combobox_get_value(
342 PropObjComboboxSetting pcs
345 extern int prop_obj_combobox_set_value(
346 PropObjComboboxSetting pcs,
351 extern void prop_obj_combobox_load(
352 PropObjComboboxSetting pcs,
354 ABObjTestFunc obj_test_func
358 /* TextField Functions
360 extern void prop_field_init(
361 PropFieldSetting pfs,
366 /* Caller must free memory allocated for return String */
367 extern STRING prop_field_get_value(
370 extern int prop_field_get_numeric_value(
373 extern int prop_field_set_value(
374 PropFieldSetting pfs,
378 extern int prop_field_set_numeric_value(
379 PropFieldSetting pfs,
384 /* Footer Setting Functions
386 extern void prop_footer_init(
387 PropFooterSetting pfs,
397 /* Item Editor Functions
399 extern void prop_item_editor_init(
400 PropItemsSetting pis,
406 WidgetList insert_items,
409 WidgetList edit_items,
411 PropFieldSetting label_pfs,
412 PropOptionsSetting label_type_pos,
413 Widget label_graphic_hint,
414 PropFieldSetting mnemonic_pfs,
415 PropFieldSetting accel_pfs,
416 PropOptionsSetting line_style_pos,
417 PropCheckboxSetting state_pcs,
418 PropMenunameSetting menuname_pms,
419 ABObj *current_obj_ptr
421 extern void prop_item_editor_apply(
424 extern void prop_item_editor_clear(
427 extern void prop_item_editor_load(
428 PropItemsSetting pis,
431 extern void prop_item_change(
432 PropItemsSetting pis,
435 extern void prop_item_edit(
436 PropItemsSetting pis,
439 extern STRING prop_item_get_namebase(
442 extern int prop_item_insert(
443 PropItemsSetting pis,
447 extern void prop_item_labeltypeCB(
449 XtPointer client_data,
453 /* Geometry Field Functions
455 extern void prop_geomfield_init(
456 PropGeometrySetting pgs,
468 extern int prop_geomfield_get_value(
469 PropGeometrySetting pgs,
472 extern int prop_geomfield_set_value(
473 PropGeometrySetting pgs,
479 extern int prop_geomfield_clear(
480 PropGeometrySetting pgs,
484 extern void prop_size_policyCB(
486 XtPointer client_data,
490 extern void prop_load_obj_position(
492 PropGeometrySetting pgs
495 extern void prop_load_obj_size(
497 PropGeometrySetting pgs
500 /* Menu Name Field Functions
502 extern void prop_menuname_init(
503 PropMenunameSetting pms,
508 Widget owner_name_field,
510 PropFieldSetting menu_title_pfs,
511 ABObj *current_obj_ptr,
514 /* Caller must free memory allocated for return String */
515 extern STRING prop_menuname_get_value(
516 PropMenunameSetting pms
518 extern int prop_menuname_set_value(
519 PropMenunameSetting pms,
524 /* Option Menu Functions
526 extern void prop_options_init(
527 PropOptionsSetting pos,
533 XtPointer *item_vals,
536 extern XtPointer prop_options_get_value(
537 PropOptionsSetting pos
539 extern int prop_options_set_value(
540 PropOptionsSetting pos,
544 extern int prop_options_remove_value(
545 PropOptionsSetting pos,
550 /* Object OptionMenu Functions
552 extern void prop_obj_options_init(
553 PropObjOptionsSetting pos,
559 XtPointer *item_vals,
562 ABObj *current_obj_ptr,
563 ABObjTestFunc obj_test_func
566 extern ABObj prop_obj_options_get_value(
567 PropObjOptionsSetting pos
570 extern int prop_obj_options_set_value(
571 PropObjOptionsSetting pos,
576 extern void prop_obj_options_load(
577 PropObjOptionsSetting pos,
581 /* Radiobox Functions
583 extern void prop_radiobox_init(
584 PropRadioSetting prs,
589 XtPointer *item_vals,
592 extern int prop_radiobox_get_value(
595 extern int prop_radiobox_set_value(
596 PropRadioSetting prs,
601 extern void prop_label_field_init(
602 PropFieldSetting label_pfs,
604 WidgetList labeltype_items,
607 extern void prop_setup_label_field(
608 PropFieldSetting label_pfs,
609 PropOptionsSetting label_line_style_pos,
612 AB_LINE_TYPE line_style
616 * Changebar Management Routines
618 extern BOOL prop_changed(
621 extern BOOL prop_changebars_pending(
624 extern void prop_changebars_cleared(
627 extern void prop_set_changebar(
633 * Prop Setting Verification Routines
635 extern int prop_str_to_int(
639 extern BOOL prop_string_ok(
645 extern BOOL prop_identifier_ok(
649 extern BOOL prop_name_ok(
654 extern BOOL prop_graphic_filename_ok(
659 extern BOOL prop_obj_name_ok(
662 AB_OBJECT_TYPE objtype,
666 extern BOOL prop_submenu_name_ok(
671 extern BOOL prop_color_ok(
675 extern BOOL prop_number_ok(
682 extern BOOL prop_help_item_ok(
688 #endif /* _PROP_H_ */