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: obj_fields.c /main/4 1996/10/29 15:20:22 mustafa $
27 * @(#)obj_fields.c 3.72 15 Feb 1994 cde_app_builder/src/libABobj
29 * RESTRICTED CONFIDENTIAL INFORMATION:
31 * The information in this document is subject to special restrictions in a
32 * confidential disclosure agreement between HP, IBM, Sun, USL, SCO and
33 * Univel. Do not distribute this document outside HP, IBM, Sun, USL, SCO,
34 * or Univel without Sun's specific written approval. This document and all
35 * copies and derivative works thereof must be returned or destroyed at Sun's
38 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
44 * fields.c - set and get fields of the gobj structure
50 #include "obj_notifyP.h"
51 #include "obj_names_listP.h"
52 #include <ab_private/util.h>
55 * This function verifies the integrity of the object, and is called at the
56 * beginning of each field access, when debugging
58 static int verify_for_write(ABObj obj);
59 static int verify_for_read(ABObj obj);
62 * If a bad field (member) access is attempted, use member_error() to report
63 * the error. E.g.: member_error(obj, "bg_color"). It's automatically removed
64 * from non-debugging builds.
66 static int member_error(ABObj obj, STRING member_name);
69 * Define our local debugging routines
74 ABObj obj, STRING member_name, STRING file, int line);
75 #define member_error(obj, member_name) \
76 (member_error_impl(obj, member_name, __FILE__, __LINE__))
78 #define member_error(obj, member_name) /* ignore this! */
82 static int verify_for_read_impl(ABObj obj, STRING file, int line);
83 static int verify_for_write_impl(ABObj obj, STRING file, int line);
84 #define verify_for_read(obj) (verify_for_read_impl(obj, __FILE__, __LINE__))
85 #define verify_for_write(obj) (verify_for_write_impl(obj, __FILE__, __LINE__))
87 #define verify_for_read(obj) /* ignore this! */
88 #define verify_for_write(obj) /* ignore this! */
94 obj_set_file(ABObj obj, STRING file)
97 ISTRING *old_name = NULL;
99 verify_for_write(obj);
103 iRet = obj_set_name(obj, file); /* use name field */
107 old_name = &(obj->info.module.file);
110 case AB_TYPE_PROJECT:
111 old_name = &(obj->info.project.file);
115 member_error(obj, "file");
119 if (old_name != NULL)
121 istr_destroy(*old_name);
122 *old_name = istr_create(file);
128 * Note - obj_get_file is more complex and is in utils.c
132 obj_set_has_border(ABObj obj, BOOL has_border)
134 verify_for_write(obj);
137 case AB_TYPE_CONTAINER:
138 obj->info.container.has_border = has_border;
141 case AB_TYPE_TEXT_FIELD:
142 case AB_TYPE_TEXT_PANE:
143 obj->info.text.has_border = TRUE;
147 member_error(obj, "has_border");
153 obj_set_hscrollbar_policy(ABObj obj, AB_SCROLLBAR_POLICY hscrollbar)
155 verify_for_write(obj);
158 case AB_TYPE_DRAWING_AREA:
159 obj->info.drawing_area.hscrollbar = hscrollbar;
161 case AB_TYPE_TEXT_PANE:
162 obj->info.text.hscrollbar = hscrollbar;
171 obj_has_border(ABObj obj)
173 verify_for_read(obj);
176 case AB_TYPE_CONTAINER:
177 return obj->info.container.has_border;
179 case AB_TYPE_TEXT_FIELD:
180 return obj->info.text.has_border;
186 obj_get_increment(ABObj obj)
188 verify_for_read(obj);
189 if (obj_is_spin_box(obj))
190 return(obj->info.spin_box.increment);
191 else if (obj_is_scale(obj))
192 return(obj->info.scale.increment);
198 obj_set_increment(ABObj obj, int incr)
200 verify_for_write(obj);
201 if (obj_is_spin_box(obj))
203 obj->info.spin_box.increment = incr;
206 else if (obj_is_scale(obj))
208 obj->info.scale.increment = incr;
211 member_error(obj, "increment");
216 obj_set_is_default(ABObj obj, BOOL is_default)
218 verify_for_write(obj);
219 if (obj->type == AB_TYPE_PROJECT)
221 obj->info.project.is_default = is_default;
224 member_error(obj, "is_default");
230 obj_is_default(ABObj obj)
232 verify_for_read(obj);
233 if (obj->type == AB_TYPE_PROJECT)
235 return obj->info.project.is_default;
242 obj_set_is_defined(ABObj obj, BOOL is_defined)
244 verify_for_write(obj);
247 obj_set_impl_flags(obj, ObjFlagIsDefined);
251 obj_clear_impl_flags(obj, ObjFlagIsDefined);
257 obj_is_defined(ABObj obj)
259 verify_for_read(obj);
260 return obj_has_impl_flags(obj, ObjFlagIsDefined);
264 obj_set_is_help_item(
269 verify_for_write(obj);
270 if (obj_is_item(obj))
272 /* Only Settable for Cascade Items */
273 if (obj->info.item.type == AB_ITEM_FOR_MENUBAR)
274 obj->info.item.is_help_item = is_help_item;
277 member_error(obj, "is_help_item");
286 verify_for_read(obj);
287 if (obj_is_item(obj))
289 return obj->info.item.is_help_item;
295 obj_set_accelerator(ABObj obj, STRING accel)
297 verify_for_write(obj);
298 if (!obj_is_item(obj))
300 member_error(obj, "accelerator");
303 istr_destroy(obj->info.item.accelerator);
304 obj->info.item.accelerator = istr_create(accel);
309 obj_set_bg_color(ABObj obj, STRING bg_color)
311 verify_for_write(obj);
312 istr_destroy(obj->bg_color);
313 obj->bg_color = istr_create(bg_color);
318 obj_set_fg_color(ABObj obj, STRING fg_color)
320 verify_for_write(obj);
321 istr_destroy(obj->fg_color);
322 obj->fg_color = istr_create(fg_color);
327 obj_set_filter_pattern(ABObj obj, STRING filter_pattern)
329 verify_for_write(obj);
330 if (!obj_is_file_chooser(obj))
332 member_error(obj, "filter_pattern");
335 istr_destroy(obj->info.file_chooser.filter_pattern);
336 obj->info.file_chooser.filter_pattern = istr_create(filter_pattern);
341 obj_get_filter_pattern( ABObj obj)
343 STRING pattern = NULL;
345 verify_for_read(obj);
346 pattern = istr_string(obj->info.file_chooser.filter_pattern);
351 obj_set_icon(ABObj obj, STRING icon)
353 verify_for_write(obj);
354 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
356 istr_destroy(obj->info.window.icon);
357 obj->info.window.icon = istr_create(icon);
360 member_error(obj, "icon");
365 obj_get_icon(ABObj obj)
367 verify_for_read(obj);
368 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
369 return istr_string(obj->info.window.icon);
375 obj_set_icon_label(ABObj obj, STRING icon_label)
377 verify_for_write(obj);
378 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
380 istr_destroy(obj->info.window.icon_label);
381 obj->info.window.icon_label = istr_create(icon_label);
384 member_error(obj, "icon_label");
389 obj_get_icon_label(ABObj obj)
391 verify_for_read(obj);
392 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
393 return istr_string(obj->info.window.icon_label);
398 obj_set_icon_mask(ABObj obj, STRING icon_mask)
400 verify_for_write(obj);
401 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
403 istr_destroy(obj->info.window.icon_mask);
404 obj->info.window.icon_mask = istr_create(icon_mask);
407 member_error(obj, "icon_mask");
412 obj_get_icon_mask(ABObj obj)
414 verify_for_read(obj);
415 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
416 return istr_string(obj->info.window.icon_mask);
422 obj_set_initial_value_string(ABObj obj, STRING val)
424 verify_for_write(obj);
425 if (obj_is_text(obj))
427 istr_destroy(obj->info.text.initial_value_string);
428 obj->info.text.initial_value_string = istr_create(val);
431 member_error(obj, "initial_value_string");
436 obj_get_initial_value_string(ABObj obj)
438 verify_for_read(obj);
439 if (obj_is_text(obj))
441 return (istr_string(obj->info.text.initial_value_string));
447 * REMIND: FIND AND CHANGE ALL BY-NAME REFERENCES TO THIS OBJECT!!!
449 * NOTE: don't verify at the top of the function - the indexes may be
450 * out-of-sync until we update them (i.e., the object is temporarily
454 obj_set_name_istr(ABObj obj, ISTRING new_name)
456 ISTRING old_name = NULL;
457 StringList names = NULL;
458 ABObj oldNameObj = NULL;
460 if (istr_equal(new_name, obj->name))
465 if ((names = objP_get_names_scope(obj)) != NULL)
467 oldNameObj = (ABObj)strlist_get_istr_data(names, new_name);
468 if (oldNameObj != NULL)
470 if (oldNameObj == obj)
472 strlist_remove_istr(names, new_name);
476 /* it's not unique! */
478 util_dprintf(1, "ERROR: duplicate name rejected: %s\n",
479 istr_string_safe(new_name));
481 return ERR_DUPLICATE_KEY;
486 old_name = istr_dup(obj->name);
487 istr_destroy(obj->name);
488 obj->name = istr_dup(new_name);
491 obj->debug_name = istr_string(obj->name);
495 * Update the names list
497 if ((names = objP_get_names_scope(obj)) != NULL)
499 if (strlist_get_istr_data(names, old_name) == ((void*)obj))
501 /* this was probably called during a reparent, so the */
502 /* old_name is actuall from a different names list */
503 strlist_remove_istr(names, old_name);
505 strlist_add_istr(names, new_name, (void *)obj);
509 * The indexes are up-to-date - verify everything
511 verify_for_write(obj);
513 objP_notify_send_name_change(obj, old_name);
514 istr_destroy(old_name);
521 obj_set_name(ABObj obj, STRING strName)
523 int return_value = 0;
524 ISTRING name = istr_create(strName);
525 return_value = obj_set_name_istr(obj, name);
533 obj_get_name(ABObj obj)
535 verify_for_read(obj);
536 return istr_string(obj->name);
538 #endif /* !obj_get_name */
540 #ifndef obj_get_name_istr
542 obj_get_name_istr(ABObj obj)
544 verify_for_read(obj);
547 #endif /* !obj_get_name_istr */
551 obj_set_num_columns(ABObj obj, int num_columns)
556 verify_for_write(obj);
559 case AB_TYPE_CONTAINER:
560 old_num_cols = obj->info.container.num_columns;
561 obj->info.container.num_columns = num_columns;
565 old_num_cols = obj->info.choice.num_columns;
566 obj->info.choice.num_columns = num_columns;
569 case AB_TYPE_TERM_PANE:
570 old_num_cols = obj->info.term.num_columns;
571 obj->info.term.num_columns = num_columns;
574 if (obj_is_text(obj))
576 old_num_cols = obj->info.text.num_columns;
577 obj->info.text.num_columns = num_columns;
581 member_error(obj, "num_columns");
583 else if (old_num_cols != num_columns)
584 iRet= objP_notify_send_rc_geometry_change(obj);
591 obj_get_num_columns(ABObj obj)
593 verify_for_read(obj);
596 case AB_TYPE_CONTAINER:
597 return obj->info.container.num_columns;
600 return obj->info.choice.num_columns;
602 case AB_TYPE_TERM_PANE:
603 return obj->info.term.num_columns;
605 if (obj_is_text(obj))
607 return obj->info.text.num_columns;
614 obj_set_num_rows(ABObj obj, int num_rows)
619 verify_for_write(obj);
622 case AB_TYPE_CONTAINER:
623 old_num_rows = obj->info.container.num_rows;
624 obj->info.container.num_rows = num_rows;
628 old_num_rows = obj->info.list.num_rows;
629 obj->info.list.num_rows = num_rows;
632 case AB_TYPE_TERM_PANE:
633 old_num_rows = obj->info.term.num_rows;
634 obj->info.term.num_rows = num_rows;
638 if (obj_is_text(obj))
640 old_num_rows = obj->info.text.num_rows;
641 obj->info.text.num_rows = num_rows;
645 member_error(obj, "num_rows");
647 else if (old_num_rows != num_rows)
648 iRet= objP_notify_send_rc_geometry_change(obj);
655 obj_get_num_rows(ABObj obj)
657 verify_for_read(obj);
660 case AB_TYPE_CONTAINER:
661 return obj->info.container.num_rows;
663 return obj->info.list.num_rows;
664 case AB_TYPE_TERM_PANE:
665 return obj->info.term.num_rows;
667 if (obj_is_text(obj))
669 return obj->info.text.num_rows;
676 obj_set_orientation(ABObj obj, AB_ORIENTATION orientation)
678 verify_for_write(obj);
681 case AB_TYPE_SEPARATOR:
682 obj->info.separator.orientation = orientation;
685 obj->info.scale.orientation = orientation;
689 obj->info.choice.orientation = orientation;
692 member_error(obj, "orientation");
698 obj_get_orientation(ABObj obj)
700 verify_for_read(obj);
703 case AB_TYPE_SEPARATOR:
704 return obj->info.separator.orientation;
707 return obj->info.scale.orientation;
710 return obj->info.choice.orientation;
712 return AB_ORIENT_HORIZONTAL;
716 obj_set_label(ABObj obj, STRING label)
718 verify_for_write(obj);
719 istr_destroy(obj->label);
720 obj->label = istr_create(label);
724 #ifndef obj_get_label
726 obj_get_label(ABObj obj)
728 verify_for_read(obj);
729 return istr_string(obj->label);
731 #endif /* !obj_get_label */
734 obj_set_label_type(ABObj obj, AB_LABEL_TYPE label_type)
736 verify_for_write(obj);
737 obj->label_type = label_type;
741 #ifndef obj_get_label_type
743 obj_get_label_type(ABObj obj)
745 verify_for_read(obj);
746 return obj->label_type;
748 #endif /* !obj_get_label_typ */
751 obj_set_label_alignment(ABObj obj, AB_ALIGNMENT type)
753 verify_for_write(obj);
758 obj->info.button.label_alignment = type;
762 obj->info.label.label_alignment = type;
765 member_error(obj, "label_alignment");
771 obj_get_label_alignment(ABObj obj)
773 verify_for_read(obj);
777 return (obj->info.button.label_alignment);
780 return (obj->info.label.label_alignment);
782 return (AB_ALIGNMENT) - 1;
787 obj_set_label_position(ABObj obj, AB_COMPASS_POINT pos)
789 verify_for_write(obj);
793 case AB_TYPE_TEXT_FIELD:
794 obj->info.text.label_position = pos;
797 obj->info.choice.label_position = pos;
799 case AB_TYPE_COMBO_BOX:
800 obj->info.combo_box.label_position = pos;
803 obj->info.list.label_position = pos;
806 obj->info.scale.label_position = pos;
808 case AB_TYPE_SPIN_BOX:
809 obj->info.spin_box.label_position = pos;
812 member_error(obj, "label_position");
817 obj_get_label_position(ABObj obj)
819 verify_for_read(obj);
823 case AB_TYPE_TEXT_PANE:
824 case AB_TYPE_TEXT_FIELD:
825 return (obj->info.text.label_position);
828 return (obj->info.choice.label_position);
830 case AB_TYPE_COMBO_BOX:
831 return (obj->info.combo_box.label_position);
834 return (obj->info.list.label_position);
837 return (obj->info.scale.label_position);
839 case AB_TYPE_SPIN_BOX:
840 return (obj->info.spin_box.label_position);
842 return (AB_COMPASS_POINT) - 1;
847 obj_get_bg_color(ABObj obj)
849 verify_for_read(obj);
850 return istr_string(obj->bg_color);
854 obj_get_fg_color(ABObj obj)
856 verify_for_read(obj);
857 return istr_string(obj->fg_color);
861 obj_set_menu_name(ABObj obj, STRING menu_name)
863 verify_for_write(obj);
865 istr_destroy(obj->menu_name);
866 obj->menu_name = istr_create(menu_name);
871 obj_get_menu_name(ABObj obj)
873 verify_for_read(obj);
875 return istr_string(obj->menu_name);
880 obj_set_menu_title(ABObj obj, STRING menu_title)
882 verify_for_write(obj);
886 case AB_TYPE_CONTAINER:
887 istr_destroy(obj->info.container.menu_title);
888 obj->info.container.menu_title = istr_create(menu_title);
890 case AB_TYPE_DRAWING_AREA:
891 istr_destroy(obj->info.drawing_area.menu_title);
892 obj->info.drawing_area.menu_title = istr_create(menu_title);
895 istr_destroy(obj->info.list.menu_title);
896 obj->info.list.menu_title = istr_create(menu_title);
898 case AB_TYPE_TEXT_FIELD:
899 case AB_TYPE_TEXT_PANE:
900 istr_destroy(obj->info.text.menu_title);
901 obj->info.text.menu_title = istr_create(menu_title);
903 case AB_TYPE_TERM_PANE:
904 istr_destroy(obj->info.term.menu_title);
905 obj->info.term.menu_title = istr_create(menu_title);
914 obj_get_menu_title(ABObj obj)
916 verify_for_read(obj);
920 case AB_TYPE_CONTAINER:
921 return(istr_string(obj->info.container.menu_title));
922 case AB_TYPE_DRAWING_AREA:
923 return(istr_string(obj->info.drawing_area.menu_title));
925 return(istr_string(obj->info.list.menu_title));
926 case AB_TYPE_TEXT_FIELD:
927 case AB_TYPE_TEXT_PANE:
928 return(istr_string(obj->info.text.menu_title));
929 case AB_TYPE_TERM_PANE:
930 return(istr_string(obj->info.term.menu_title));
937 obj_get_mnemonic(ABObj obj)
939 verify_for_read(obj);
940 if (obj_is_item(obj) && (obj->info.item.mnemonic))
942 return (istr_string(obj->info.item.mnemonic));
944 return ((STRING) NULL);
948 obj_set_mnemonic(ABObj obj, STRING mnem)
950 verify_for_write(obj);
951 if (!obj_is_item(obj))
953 member_error(obj, "mnemonic");
956 istr_destroy(obj->info.item.mnemonic);
957 obj->info.item.mnemonic = istr_create(mnem);
962 * Make this object actually refer to another object
972 return (ref_obj == NULL? 0:-1); /* NULL can only ref NULL */
974 verify_for_write(obj);
977 * The types must match!
981 obj_set_type(obj, obj_get_type(ref_obj));
983 obj->ref_to= ref_obj;
996 verify_for_read(obj);
998 return (obj->ref_to == NULL? obj:obj->ref_to);
1002 obj_set_min_value(ABObj obj, int minval)
1005 verify_for_write(obj);
1010 obj->info.scale.min_value = minval;
1012 case AB_TYPE_SPIN_BOX:
1013 obj->info.spin_box.min_value = minval;
1018 member_error(obj, "min_value");
1026 obj_get_min_value(ABObj obj)
1029 verify_for_read(obj);
1034 iValue = obj->info.scale.min_value;
1037 case AB_TYPE_SPIN_BOX:
1038 iValue = obj->info.spin_box.min_value;
1049 obj_set_max_value(ABObj obj, int maxval)
1052 verify_for_write(obj);
1057 obj->info.scale.max_value = maxval;
1059 case AB_TYPE_SPIN_BOX:
1060 obj->info.spin_box.max_value = maxval;
1065 member_error(obj, "max_value");
1072 obj_get_max_value(ABObj obj)
1075 verify_for_read(obj);
1080 iValue = obj->info.scale.max_value;
1083 case AB_TYPE_SPIN_BOX:
1084 iValue = obj->info.spin_box.max_value;
1095 obj_set_res_file_arg_classes(ABObj obj, AB_ARG_CLASS_FLAGS argClasses)
1097 if (obj->type == AB_TYPE_PROJECT)
1099 obj->info.project.res_file_arg_classes = argClasses;
1102 return ERR_NOT_FOUND;
1106 obj_get_res_file_arg_classes(ABObj obj)
1108 if (obj->type == AB_TYPE_PROJECT)
1110 return obj->info.project.res_file_arg_classes;
1112 return AB_ARG_CLASS_FLAGS_NONE;
1117 obj_set_resizable(ABObj obj, BOOL resizable)
1119 verify_for_write(obj);
1122 case AB_TYPE_BASE_WINDOW:
1123 case AB_TYPE_DIALOG:
1124 obj->info.window.resizable = resizable;
1127 member_error(obj, "resizeable");
1133 obj_get_resizable(ABObj obj)
1135 verify_for_read(obj);
1138 case AB_TYPE_BASE_WINDOW:
1139 case AB_TYPE_DIALOG:
1140 return obj->info.window.resizable;
1146 obj_get_selection_mode(ABObj obj)
1148 verify_for_read(obj);
1150 if (obj->type == AB_TYPE_LIST)
1151 return obj->info.list.selection_mode;
1153 return AB_SELECT_UNDEF;
1157 obj_set_selection_mode(ABObj obj, AB_SELECT_TYPE sel)
1160 verify_for_write(obj);
1162 if (obj->type == AB_TYPE_LIST)
1163 obj->info.list.selection_mode = sel;
1170 obj_set_selection_required(ABObj obj, BOOL selreq)
1173 verify_for_write(obj);
1178 obj->info.list.selection_required = selreq;
1181 case AB_TYPE_CHOICE:
1182 obj->info.choice.selection_required = selreq;
1187 member_error(obj, "selection_required");
1194 obj_get_selection_required(ABObj obj)
1197 verify_for_read(obj);
1201 case AB_TYPE_CHOICE:
1202 bRet = obj->info.choice.selection_required;
1205 bRet = obj->info.list.selection_required;
1213 obj_set_type(ABObj obj, AB_OBJECT_TYPE new_type)
1215 verify_for_write(obj);
1217 if (obj_get_type(obj) != new_type)
1219 /* only clear out the data if the type has changed */
1220 obj_destruct_type_specific_info(obj);
1221 obj->type = new_type;
1222 obj_construct_type_specific_info(obj);
1228 obj_set_subtype(ABObj obj, int subtype)
1230 verify_for_write(obj);
1232 if (obj_is_choice(obj))
1233 obj->info.choice.type = (AB_CHOICE_TYPE) subtype;
1235 else if (obj_is_message(obj))
1236 obj->info.message.type = (AB_MESSAGE_TYPE)subtype;
1238 else if (obj_is_container(obj))
1239 obj->info.container.type = (AB_CONTAINER_TYPE) subtype;
1241 else if (obj_is_item(obj))
1242 obj->info.item.type = (AB_ITEM_TYPE) subtype;
1244 else if (obj_is_button(obj))
1245 obj->info.button.type = (AB_BUTTON_TYPE) subtype;
1247 else if (obj_is_menu(obj))
1248 obj->info.menu.type = (AB_MENU_TYPE) subtype;
1251 * else if (obj_is_dialog(obj)) obj->info.dialog.type =
1252 * (AB_DIALOG_TYPE)subtype;
1261 #ifndef obj_get_type
1263 obj_get_type(ABObj obj)
1265 verify_for_read(obj);
1269 #endif /* !obj_get_type */
1272 obj_get_subtype(ABObj obj)
1274 verify_for_read(obj);
1276 if (obj_is_choice(obj))
1277 return ((int) obj->info.choice.type);
1279 else if (obj_is_message(obj))
1280 return((int)obj->info.message.type);
1282 else if (obj_is_button(obj))
1283 return ((int) obj->info.button.type);
1285 else if (obj_is_container(obj))
1286 return ((int) obj->info.container.type);
1288 else if (obj_is_item(obj))
1289 return ((int) obj->info.item.type);
1291 else if (obj_is_menu(obj))
1292 return ((int) obj->info.menu.type);
1294 return (AB_NO_SUBTYPE);
1299 obj_get_process_string(
1303 verify_for_read(obj);
1304 if (obj->type == AB_TYPE_TERM_PANE)
1305 return (istr_string(obj->info.term.process_string));
1312 obj_set_process_string(
1317 verify_for_write(obj);
1318 if (obj->type == AB_TYPE_TERM_PANE)
1320 istr_destroy(obj->info.term.process_string);
1321 obj->info.term.process_string = istr_create(subproc);
1327 obj_set_was_written(ABObj obj, BOOL was_written)
1329 verify_for_write(obj);
1331 obj_set_impl_flags(obj, ObjFlagWasWritten);
1333 obj_clear_impl_flags(obj, ObjFlagWasWritten);
1338 obj_was_written(ABObj obj)
1340 verify_for_read(obj);
1341 return obj_has_impl_flags(obj, ObjFlagWasWritten);
1350 AB_OBJECT_TYPE type = AB_TYPE_UNDEF;
1352 if (!obj_is_window(obj))
1355 verify_for_write(obj);
1356 type = obj_get_type(obj);
1359 case AB_TYPE_BASE_WINDOW:
1360 case AB_TYPE_DIALOG:
1361 obj->info.window.win_parent = wparent;
1363 case AB_TYPE_FILE_CHOOSER:
1364 obj->info.file_chooser.win_parent = wparent;
1378 ABObj wparent = NULL;
1379 AB_OBJECT_TYPE type = AB_TYPE_UNDEF;
1381 if (!obj_is_window(obj))
1384 verify_for_read(obj);
1385 type = obj_get_type(obj);
1388 case AB_TYPE_BASE_WINDOW:
1389 case AB_TYPE_DIALOG:
1390 wparent = obj->info.window.win_parent;
1392 case AB_TYPE_FILE_CHOOSER:
1393 wparent = obj->info.file_chooser.win_parent;
1403 obj_set_write_me(ABObj obj, BOOL write_me)
1405 verify_for_write(obj);
1408 obj_set_impl_flags(obj, ObjFlagWriteMe);
1412 obj_clear_impl_flags(obj, ObjFlagWriteMe);
1418 obj_get_write_me(ABObj obj)
1420 verify_for_read(obj);
1421 return obj_has_impl_flags(obj, ObjFlagWriteMe);
1425 obj_set_value_x(ABObj obj, int valx)
1428 verify_for_write(obj);
1432 case AB_TYPE_CHOICE:
1433 obj->info.choice.value_x = valx;
1438 member_error(obj, "value_x");
1446 obj_get_value_x(ABObj obj)
1449 verify_for_read(obj);
1453 case AB_TYPE_CHOICE:
1454 iRet = obj->info.choice.value_x;
1465 obj_set_value_y(ABObj obj, int valy)
1468 verify_for_write(obj);
1472 case AB_TYPE_CHOICE:
1473 obj->info.choice.value_y = valy;
1478 member_error(obj, "value_y");
1486 obj_get_value_y(ABObj obj)
1489 verify_for_read(obj);
1493 case AB_TYPE_CHOICE:
1494 iRet = obj->info.choice.value_y;
1504 obj_set_vscrollbar_policy(ABObj obj, AB_SCROLLBAR_POLICY vscrollbar)
1506 verify_for_write(obj);
1509 case AB_TYPE_DRAWING_AREA:
1510 obj->info.drawing_area.vscrollbar = vscrollbar;
1512 case AB_TYPE_TEXT_PANE:
1513 obj->info.text.vscrollbar = vscrollbar;
1515 case AB_TYPE_TERM_PANE:
1516 obj->info.term.vscrollbar = vscrollbar;
1524 obj_set_tearoff(ABObj obj, BOOL tearoff)
1526 verify_for_write(obj);
1530 obj->info.menu.tear_off = tearoff;
1533 member_error(obj, "tear_off");
1538 obj_set_vendor(ABObj obj, STRING vendor)
1540 verify_for_write(obj);
1541 if (!obj_is_project(obj))
1543 member_error(obj, "vendor");
1546 istr_destroy(obj->info.project.vendor);
1547 obj->info.project.vendor = istr_create(vendor);
1552 obj_get_vendor(ABObj obj)
1554 verify_for_read(obj);
1555 if (!obj_is_project(obj))
1557 member_error(obj, "vendor");
1560 return (istr_string(obj->info.project.vendor));
1564 obj_set_version(ABObj obj, STRING version)
1566 verify_for_write(obj);
1567 if (!obj_is_project(obj))
1569 member_error(obj, "version");
1572 istr_destroy(obj->info.project.version);
1573 obj->info.project.version = istr_create(version);
1578 obj_get_version(ABObj obj)
1580 verify_for_read(obj);
1581 if (!obj_is_project(obj))
1583 member_error(obj, "version");
1586 return (istr_string(obj->info.project.version));
1591 obj_set_root_window(ABObj obj, ABObj root_window)
1593 verify_for_write(obj);
1594 if (!obj_is_project(obj))
1596 member_error(obj, "root_window");
1599 obj->info.project.root_window = root_window;
1605 obj_get_root_window(ABObj obj)
1607 verify_for_read(obj);
1608 if (!obj_is_project(obj))
1610 member_error(obj, "root_window");
1613 return (obj->info.project.root_window);
1617 obj_set_height_is_resizable(ABObj obj, BOOL resizable)
1619 verify_for_write(obj);
1621 obj_set_impl_flags(obj, ObjFlagHeightIsResizable);
1623 obj_clear_impl_flags(obj, ObjFlagHeightIsResizable);
1628 obj_get_height_is_resizable(ABObj obj)
1630 verify_for_read(obj);
1631 return obj_has_impl_flags(obj, ObjFlagHeightIsResizable);
1635 obj_set_hoffset(ABObj obj, int hoffset)
1637 verify_for_write(obj);
1638 if (obj_is_container(obj))
1640 return (obj->info.container.hoffset = hoffset);
1642 return ERR_BAD_PARAM1;
1646 obj_get_hoffset(ABObj obj)
1648 verify_for_read(obj);
1649 if (obj_is_container(obj))
1651 return (obj->info.container.hoffset);
1653 return ERR_BAD_PARAM1;
1657 obj_set_voffset(ABObj obj, int voffset)
1659 verify_for_write(obj);
1660 if (obj_is_container(obj))
1662 return (obj->info.container.voffset = voffset);
1664 return ERR_BAD_PARAM1;
1668 obj_get_voffset(ABObj obj)
1670 verify_for_read(obj);
1671 if (obj_is_container(obj))
1673 return (obj->info.container.voffset);
1679 * REMIND: Not sure what to return when an ABObj is not a container
1687 obj_set_hspacing(ABObj obj, int hspacing)
1689 verify_for_write(obj);
1690 if (obj_is_container(obj))
1692 return (obj->info.container.hspacing = hspacing);
1694 return ERR_BAD_PARAM1;
1698 obj_get_hspacing(ABObj obj)
1700 verify_for_read(obj);
1701 if (obj_is_container(obj))
1703 return (obj->info.container.hspacing);
1709 * REMIND: Not sure what to return when an ABObj is not a container
1717 obj_set_vspacing(ABObj obj, int vspacing)
1719 verify_for_write(obj);
1720 if (obj_is_container(obj))
1722 return (obj->info.container.vspacing = vspacing);
1724 return ERR_BAD_PARAM1;
1728 obj_get_vspacing(ABObj obj)
1730 verify_for_read(obj);
1731 if (obj_is_container(obj))
1733 return (obj->info.container.vspacing);
1739 * REMIND: Not sure what to return when an ABObj is not a container
1747 obj_set_ref_point(ABObj obj, AB_COMPASS_POINT ref_point)
1749 verify_for_write(obj);
1750 if (obj_is_container(obj))
1752 return (obj->info.container.ref_point = ref_point);
1754 return ERR_BAD_PARAM1;
1758 obj_get_ref_point(ABObj obj)
1760 verify_for_read(obj);
1761 if (obj_is_container(obj))
1763 return obj->info.container.ref_point;
1769 * REMIND: Not sure if I should use obj_get_label_position() or if I
1770 * should do my own switch statement.
1773 return (obj_get_label_position(obj));
1778 obj_set_hattach_type(ABObj obj, AB_ATTACH_TYPE hattach_type)
1780 verify_for_write(obj);
1781 if (obj_is_container(obj))
1783 return (obj->info.container.hattach_type = hattach_type);
1785 return ERR_BAD_PARAM1;
1789 obj_get_hattach_type(ABObj obj)
1791 AB_ATTACH_TYPE attach_type = AB_ATTACH_UNDEF;
1792 verify_for_read(obj);
1794 if (obj_is_container(obj))
1796 attach_type = (obj->info.container.hattach_type);
1803 obj_set_vattach_type(ABObj obj, AB_ATTACH_TYPE vattach_type)
1805 verify_for_write(obj);
1806 if (obj_is_container(obj))
1808 return (obj->info.container.vattach_type = vattach_type);
1810 return ERR_BAD_PARAM1;
1814 obj_get_vattach_type(ABObj obj)
1816 AB_ATTACH_TYPE attach_type = AB_ATTACH_UNDEF;
1817 verify_for_read(obj);
1819 if (obj_is_container(obj))
1821 attach_type = (obj->info.container.vattach_type);
1828 obj_get_button_type(ABObj obj)
1830 verify_for_read(obj);
1831 if (obj_is_button(obj))
1833 return (obj->info.button.type);
1835 return (AB_BUT_UNDEF);
1839 obj_set_item_type(ABObj obj, AB_ITEM_TYPE item_type)
1841 verify_for_write(obj);
1842 if (obj_is_item(obj))
1844 return (obj->info.item.type = item_type);
1846 return ERR_BAD_PARAM1;
1851 obj_get_item_type(ABObj obj)
1853 verify_for_read(obj);
1854 if (obj_is_item(obj))
1856 return (obj->info.item.type);
1858 return (AB_ITEM_FOR_UNDEF);
1862 obj_set_group_type(ABObj obj, AB_GROUP_TYPE group_type)
1864 verify_for_write(obj);
1865 if (obj_is_container(obj))
1867 return (obj->info.container.group_type = group_type);
1869 return ERR_BAD_PARAM1;
1873 obj_get_group_type(ABObj obj)
1875 verify_for_read(obj);
1876 if ((obj != NULL) && obj_is_container(obj))
1878 return (obj->info.container.group_type);
1880 return (AB_GROUP_UNDEF);
1885 obj_set_row_align(ABObj obj, AB_ALIGNMENT row_align)
1887 verify_for_write(obj);
1888 if (obj_is_container(obj))
1890 return (obj->info.container.row_align = row_align);
1892 return ERR_BAD_PARAM1;
1896 obj_get_row_align(ABObj obj)
1898 verify_for_read(obj);
1899 if (obj_is_container(obj))
1901 return (obj->info.container.row_align);
1903 return (AB_ALIGN_UNDEF);
1907 obj_set_class_name(ABObj obj, STRING cname)
1909 verify_for_write(obj);
1910 istr_destroy(obj->class_name);
1911 obj->class_name = istr_create(cname);
1916 obj_get_class_name(ABObj obj)
1918 verify_for_read(obj);
1919 return istr_string(obj->class_name);
1923 obj_set_col_align(ABObj obj, AB_ALIGNMENT col_align)
1925 verify_for_write(obj);
1926 if (obj_is_container(obj))
1928 return (obj->info.container.col_align = col_align);
1930 return ERR_BAD_PARAM1;
1934 obj_get_col_align(ABObj obj)
1936 verify_for_read(obj);
1937 if (obj_is_container(obj))
1939 return (obj->info.container.col_align);
1941 return (AB_ALIGN_UNDEF);
1945 obj_set_container_type(ABObj obj, AB_CONTAINER_TYPE cont_type)
1947 verify_for_write(obj);
1948 if (obj_is_container(obj))
1950 return (obj->info.container.type = cont_type);
1952 return ERR_BAD_PARAM1;
1956 obj_get_container_type(ABObj obj)
1958 verify_for_read(obj);
1959 if (obj_is_container(obj))
1961 return obj->info.container.type;
1963 return AB_CONT_UNDEF;
1967 obj_get_decimal_points(ABObj obj)
1969 verify_for_read(obj);
1970 if (obj_is_spin_box(obj))
1971 return(obj->info.spin_box.decimal_points);
1972 else if (obj_is_scale(obj))
1973 return(obj->info.scale.decimal_points);
1979 obj_set_decimal_points(ABObj obj, int dec_points)
1981 verify_for_write(obj);
1982 if (obj_is_spin_box(obj))
1984 obj->info.spin_box.decimal_points = dec_points;
1987 else if (obj_is_scale(obj))
1989 obj->info.scale.decimal_points = dec_points;
1992 member_error(obj, "decimal_points");
1997 obj_set_default_act_button(
2002 if (!obj_is_window(obj))
2005 verify_for_write(obj);
2007 obj->info.window.default_act_button= defaultb;
2013 obj_get_default_act_button(
2017 ABObj defaultb = NULL;
2019 if (!obj_is_window(obj))
2022 verify_for_read(obj);
2024 return(obj->info.window.default_act_button);
2028 obj_get_direction(ABObj obj)
2030 verify_for_read(obj);
2031 if (obj_is_scale(obj))
2032 return(obj->info.scale.direction);
2034 return AB_DIR_UNDEF;
2038 obj_set_direction(ABObj obj, AB_DIRECTION dir)
2040 verify_for_write(obj);
2041 if (obj_is_scale(obj))
2043 obj->info.scale.direction= dir;
2046 member_error(obj, "direction");
2051 obj_set_drawarea_width(
2056 verify_for_write(obj);
2057 if (obj_is_drawing_area(obj))
2059 obj->info.drawing_area.drawarea_width = width;
2062 member_error(obj, "drawarea_width");
2067 obj_set_drawarea_height(
2072 verify_for_write(obj);
2073 if (obj_is_drawing_area(obj))
2075 obj->info.drawing_area.drawarea_height = height;
2078 member_error(obj, "drawarea_height");
2083 obj_get_drawarea_width(
2087 verify_for_read(obj);
2088 if (obj_is_drawing_area(obj))
2089 return (obj->info.drawing_area.drawarea_width);
2095 obj_get_drawarea_height(
2099 verify_for_read(obj);
2100 if (obj_is_drawing_area(obj))
2101 return (obj->info.drawing_area.drawarea_height);
2107 obj_set_textpane_width(ABObj obj,
2110 if (obj_is_text_pane(obj))
2112 obj->info.text.textpane_width = width;
2120 obj_set_textpane_height(ABObj obj,
2123 if (obj_is_text_pane(obj))
2125 obj->info.text.textpane_height = height;
2133 obj_get_textpane_width(ABObj obj)
2135 if (obj_is_text_pane(obj))
2136 return (obj->info.text.textpane_width);
2142 obj_get_textpane_height(ABObj obj)
2144 if (obj_is_text_pane(obj))
2145 return (obj->info.text.textpane_height);
2152 obj_get_hscrollbar_policy(ABObj obj)
2154 verify_for_read(obj);
2158 return (obj->info.list.hscrollbar);
2159 case AB_TYPE_DRAWING_AREA:
2160 return (obj->info.drawing_area.hscrollbar);
2161 case AB_TYPE_TEXT_PANE:
2162 return (obj->info.text.hscrollbar);
2164 return AB_SCROLLBAR_UNDEF;
2168 obj_get_vscrollbar_policy(ABObj obj)
2170 verify_for_read(obj);
2174 return (obj->info.list.vscrollbar);
2175 case AB_TYPE_DRAWING_AREA:
2176 return (obj->info.drawing_area.vscrollbar);
2177 case AB_TYPE_TEXT_PANE:
2178 return (obj->info.text.vscrollbar);
2179 case AB_TYPE_TERM_PANE:
2180 return (obj->info.term.vscrollbar);
2182 return AB_SCROLLBAR_UNDEF;
2186 obj_get_accelerator(ABObj obj)
2188 verify_for_read(obj);
2189 if (obj_is_item(obj) && (obj->info.item.accelerator))
2191 return (istr_string(obj->info.item.accelerator));
2193 return ((STRING) NULL);
2197 obj_get_max_length(ABObj obj)
2199 verify_for_read(obj);
2200 if (obj_is_text(obj))
2202 return (obj->info.text.max_length);
2208 obj_set_max_length(ABObj obj, int max_len)
2210 verify_for_write(obj);
2211 if (obj_is_text(obj))
2213 obj->info.text.max_length = max_len;
2216 member_error(obj, "max_length");
2222 obj_set_initial_value_int(ABObj obj, int ival)
2224 verify_for_write(obj);
2228 obj->info.scale.initial_value = ival;
2230 case AB_TYPE_SPIN_BOX:
2231 obj->info.spin_box.initial_value = ival;
2233 case AB_TYPE_TEXT_FIELD:
2234 case AB_TYPE_TEXT_PANE:
2235 obj->info.text.initial_value_int = ival;
2242 obj_get_initial_value_int(ABObj obj)
2244 verify_for_read(obj);
2248 return (obj->info.scale.initial_value);
2249 case AB_TYPE_SPIN_BOX:
2250 return (obj->info.spin_box.initial_value);
2251 case AB_TYPE_TEXT_FIELD:
2252 case AB_TYPE_TEXT_PANE:
2253 return (obj->info.text.initial_value_int);
2259 obj_get_text_type(ABObj obj)
2261 verify_for_read(obj);
2263 if (obj_is_text(obj))
2264 return (obj->info.text.type);
2266 if (obj_is_spin_box(obj))
2267 return (obj->info.spin_box.type);
2269 return (AB_TEXT_UNDEF);
2272 obj_set_text_type(ABObj obj, AB_TEXT_TYPE type)
2274 verify_for_write(obj);
2276 if (obj_is_text(obj))
2277 obj->info.text.type = type;
2279 else if (obj_is_spin_box(obj))
2280 obj->info.spin_box.type = type;
2284 member_error(obj, "text_type");
2291 obj_get_menu_type(ABObj obj)
2293 verify_for_read(obj);
2294 if (obj_is_menu(obj))
2296 return (obj->info.menu.type);
2298 return (AB_MENU_UNDEF);
2302 obj_get_packing(ABObj obj)
2304 verify_for_read(obj);
2305 if (obj_is_container(obj))
2307 return (obj->info.container.packing);
2309 return (AB_PACK_UNDEF);
2313 obj_get_choice_type(ABObj obj)
2315 verify_for_read(obj);
2316 if (obj_is_choice(obj))
2318 return (obj->info.choice.type);
2320 return (AB_CHOICE_UNDEF);
2324 obj_set_is_initially_active(ABObj obj, BOOL active)
2326 verify_for_write(obj);
2328 obj_set_impl_flags(obj, ObjFlagIsInitiallyActive);
2330 obj_clear_impl_flags(obj, ObjFlagIsInitiallyActive);
2335 obj_is_initially_active(ABObj obj)
2337 verify_for_read(obj);
2338 return obj_has_impl_flags(obj, ObjFlagIsInitiallyActive);
2342 obj_set_is_initially_iconic(ABObj obj, BOOL iconic)
2344 int return_value = 0;
2345 verify_for_write(obj);
2347 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
2349 obj->info.window.is_initially_iconic = iconic;
2353 member_error(obj, "is_initially_iconic");
2356 return return_value;
2360 obj_is_initially_iconic(ABObj obj)
2362 verify_for_read(obj);
2363 if (obj_is_window(obj) && !obj_is_file_chooser(obj))
2365 return (obj->info.window.is_initially_iconic);
2371 obj_set_is_initially_selected(ABObj obj, BOOL selected)
2373 int return_value = 0;
2374 verify_for_write(obj);
2376 if (obj_is_item(obj))
2378 obj->info.item.is_initially_selected = selected;
2382 member_error(obj, "is_initially_selected");
2385 return return_value;
2389 obj_is_initially_selected(ABObj obj)
2391 verify_for_read(obj);
2392 if (obj_is_item(obj))
2394 return (obj->info.item.is_initially_selected);
2400 obj_set_is_initially_visible(ABObj obj, BOOL visible)
2402 verify_for_write(obj);
2404 obj_set_impl_flags(obj, ObjFlagIsInitiallyVisible);
2406 obj_clear_impl_flags(obj, ObjFlagIsInitiallyVisible);
2411 obj_is_initially_visible(ABObj obj)
2413 verify_for_read(obj);
2414 return obj_has_impl_flags(obj, ObjFlagIsInitiallyVisible);
2418 obj_get_tearoff(ABObj obj)
2420 verify_for_read(obj);
2421 if (obj_is_menu(obj))
2423 return (obj->info.menu.tear_off);
2429 obj_get_exclusive(ABObj obj)
2431 verify_for_read(obj);
2432 if (obj_is_menu(obj))
2434 return (obj->info.menu.exclusive);
2440 obj_set_to(ABObj obj, ABObj to)
2442 verify_for_write(obj);
2443 if (!obj_is_action(obj))
2445 member_error(obj, "to");
2448 obj->info.action.to = to;
2453 obj_get_to(ABObj obj)
2455 verify_for_read(obj);
2456 if (!obj_is_action(obj))
2458 member_error(obj, "to");
2461 return obj->info.action.to;
2465 obj_set_from(ABObj obj, ABObj from)
2467 verify_for_write(obj);
2468 if (!obj_is_action(obj))
2470 member_error(obj, "from");
2473 obj->info.action.from = from;
2478 obj_get_from(ABObj obj)
2480 verify_for_read(obj);
2481 if (!obj_is_action(obj))
2483 member_error(obj, "from");
2486 return obj->info.action.from;
2490 obj_set_func_type(ABObj obj, AB_FUNC_TYPE new_func_type)
2492 verify_for_write(obj);
2493 if (!obj_is_action(obj))
2495 member_error(obj, "func_type");
2498 if (obj->info.action.func_type == new_func_type)
2504 * Free the old type's data
2506 switch (obj->info.action.func_type)
2508 case AB_FUNC_CODE_FRAG:
2509 istr_destroy(obj->info.action.func_value.code_frag);
2512 case AB_FUNC_USER_DEF:
2513 istr_destroy(obj->info.action.func_value.func_name);
2516 case AB_FUNC_ON_ITEM_HELP:
2519 case AB_FUNC_HELP_VOLUME:
2520 istr_destroy(obj->info.action.volume_id);
2521 istr_destroy(obj->info.action.location);
2529 * Set default value for new type
2531 obj->info.action.func_type = new_func_type;
2532 switch (obj->info.action.func_type)
2537 case AB_FUNC_CODE_FRAG:
2538 obj->info.action.func_value.code_frag = NULL;
2541 case AB_FUNC_USER_DEF:
2542 obj->info.action.func_value.func_name = NULL;
2545 case AB_FUNC_HELP_VOLUME:
2546 obj->info.action.volume_id = NULL;
2547 obj->info.action.location = NULL;
2558 obj_get_func_type(ABObj obj)
2560 verify_for_read(obj);
2561 if (obj_is_action(obj))
2563 return (obj->info.action.func_type);
2565 return (AB_FUNC_UNDEF);
2569 obj_set_func_name(ABObj obj, STRING func_name)
2571 verify_for_write(obj);
2572 if (!(obj_is_action(obj)
2573 && (obj->info.action.func_type == AB_FUNC_USER_DEF)))
2575 member_error(obj, "func_name");
2578 istr_destroy(obj->info.action.func_value.func_name);
2579 obj->info.action.func_value.func_name = istr_create(func_name);
2584 obj_get_func_name(ABObj obj)
2586 verify_for_read(obj);
2587 if (!(obj_is_action(obj)
2588 && (obj->info.action.func_type == AB_FUNC_USER_DEF)))
2592 return (istr_string(obj->info.action.func_value.func_name));
2596 obj_set_func_name_suffix(ABObj obj, STRING suffix)
2598 verify_for_write(obj);
2599 if (!obj_is_action(obj))
2601 member_error(obj, "func_name_suffix");
2604 istr_destroy(obj->info.action.func_name_suffix);
2605 obj->info.action.func_name_suffix = istr_create(suffix);
2610 obj_get_func_name_suffix(ABObj obj)
2612 verify_for_read(obj);
2613 if (!obj_is_action(obj))
2615 member_error(obj, "func_name_suffix");
2618 return istr_string(obj->info.action.func_name_suffix);
2622 obj_set_func_code(ABObj obj, STRING code)
2624 verify_for_write(obj);
2625 if (!(obj_is_action(obj)
2626 && (obj->info.action.func_type == AB_FUNC_CODE_FRAG)))
2628 member_error(obj, "func_code");
2631 istr_destroy(obj->info.action.func_value.code_frag);
2632 obj->info.action.func_value.code_frag = istr_create(code);
2637 obj_get_func_code(ABObj obj)
2639 verify_for_read(obj);
2640 if (obj_is_action(obj))
2642 return (istr_string(obj->info.action.func_value.code_frag));
2644 member_error(obj, "func_code");
2649 obj_get_func_builtin(ABObj obj)
2651 verify_for_read(obj);
2652 if (!(obj_is_action(obj) && (obj_get_func_type(obj) == AB_FUNC_BUILTIN)))
2654 return AB_STDACT_UNDEF;
2656 return (obj->info.action.func_value.builtin);
2660 obj_set_func_builtin(ABObj obj, AB_BUILTIN_ACTION act)
2662 verify_for_write(obj);
2663 if (obj_is_action(obj) && (obj_get_func_type(obj) == AB_FUNC_BUILTIN))
2665 obj->info.action.func_value.builtin = act;
2672 obj_get_when(ABObj obj)
2674 verify_for_read(obj);
2675 if (obj_is_action(obj))
2677 return (obj->info.action.when);
2679 return AB_WHEN_UNDEF;
2683 obj_set_when(ABObj obj, AB_WHEN when)
2685 verify_for_write(obj);
2686 if (obj->type != AB_TYPE_ACTION)
2688 member_error(obj, "when");
2691 obj->info.action.when = when;
2696 obj_set_width_is_resizable(ABObj obj, BOOL resizable)
2698 verify_for_write(obj);
2700 obj_set_impl_flags(obj, ObjFlagWidthIsResizable);
2702 obj_clear_impl_flags(obj, ObjFlagWidthIsResizable);
2707 obj_get_width_is_resizable(ABObj obj)
2709 verify_for_read(obj);
2710 return obj_has_impl_flags(obj, ObjFlagWidthIsResizable);
2714 obj_set_arg_type(ABObj obj, AB_ARG_TYPE arg_type)
2716 verify_for_write(obj);
2717 if (!obj_is_action(obj))
2719 member_error(obj, "arg_type");
2722 if (arg_type == obj->info.action.arg_type)
2728 * Free old data type
2730 if (obj->info.action.arg_type == AB_ARG_STRING)
2732 istr_destroy(obj->info.action.arg_value.sval);
2736 * Set initial value for new data type
2738 obj->info.action.arg_type = arg_type;
2739 switch (obj->info.action.arg_type)
2742 case AB_ARG_VOID_PTR:
2746 obj->info.action.arg_value.fval = 0.0;
2750 obj->info.action.arg_value.fval = 0;
2754 obj->info.action.arg_value.sval = NULL;
2761 obj_get_arg_type(ABObj obj)
2763 verify_for_read(obj);
2764 if (obj_is_action(obj))
2766 return (obj->info.action.arg_type);
2768 return AB_ARG_UNDEF;
2773 obj_get_arg_value(ABObj obj)
2775 verify_for_read(obj);
2778 if (obj_is_action(obj))
2780 return (obj->info.action.arg_value);
2788 obj_set_arg_float(ABObj obj, double float_val)
2790 verify_for_write(obj);
2791 if (!(obj_is_action(obj) && (obj_get_arg_type(obj) == AB_ARG_FLOAT)))
2793 member_error(obj, "arg_float");
2796 obj->info.action.arg_value.fval = float_val;
2801 obj_get_arg_float(ABObj obj)
2803 verify_for_read(obj);
2804 if (!(obj_is_action(obj) && (obj_get_arg_type(obj) == AB_ARG_FLOAT)))
2806 member_error(obj, "arg_float");
2809 return (obj->info.action.arg_value.fval);
2813 obj_set_arg_int(ABObj obj, int int_value)
2815 verify_for_write(obj);
2816 if (!(obj_is_action(obj) && (obj->info.action.arg_type == AB_ARG_INT)))
2818 member_error(obj, "arg_int");
2821 obj->info.action.arg_value.ival = int_value;
2827 obj_get_arg_int(ABObj obj)
2829 verify_for_read(obj);
2830 if (!(obj_is_action(obj) && (obj->info.action.arg_type == AB_ARG_INT)))
2832 member_error(obj, "arg_int");
2835 return (obj->info.action.arg_value.ival);
2839 obj_set_arg_string(ABObj obj, STRING argString)
2841 verify_for_write(obj);
2842 if (!(obj_is_action(obj) && (obj->info.action.arg_type == AB_ARG_STRING)))
2844 member_error(obj, "arg_string");
2847 istr_destroy(obj->info.action.arg_value.sval);
2848 obj->info.action.arg_value.sval = istr_create(argString);
2853 obj_get_arg_string(ABObj obj)
2855 verify_for_read(obj);
2856 if (obj_is_action(obj))
2858 return (istr_string(obj->info.action.arg_value.sval));
2866 AB_COMPASS_POINT dir
2869 ABAttachment *attach = NULL;
2870 verify_for_read(obj);
2872 if (obj->attachments == NULL)
2880 attach = (&(obj->attachments->north));
2883 attach = (&(obj->attachments->south));
2886 attach = (&(obj->attachments->east));
2889 attach = (&(obj->attachments->west));
2892 if (util_get_verbosity() >= 3)
2893 fprintf(stderr, "obj_get_attachment: invalid direction\n");
2903 obj_get_attach_type(
2905 AB_COMPASS_POINT dir
2908 verify_for_read(obj);
2909 if (obj->attachments == NULL)
2910 return AB_ATTACH_UNDEF;
2915 return (obj->attachments->north.type);
2917 return (obj->attachments->south.type);
2919 return (obj->attachments->east.type);
2921 return (obj->attachments->west.type);
2923 if (util_get_verbosity() > 0)
2924 fprintf(stderr, "obj_get_attach_type: invalid direction\n");
2925 return AB_ATTACH_UNDEF;
2931 obj_get_attach_value(
2933 AB_COMPASS_POINT dir
2936 verify_for_read(obj);
2937 if (obj->attachments == NULL)
2943 return (obj->attachments->north.value);
2945 return (obj->attachments->south.value);
2947 return (obj->attachments->east.value);
2949 return (obj->attachments->west.value);
2951 if (util_get_verbosity() > 0)
2952 fprintf(stderr, "obj_get_attach_value: invalid direction\n");
2959 obj_get_attach_offset(
2961 AB_COMPASS_POINT dir
2964 verify_for_read(obj);
2965 if (obj->attachments == NULL)
2971 return (obj->attachments->north.offset);
2973 return (obj->attachments->south.offset);
2975 return (obj->attachments->east.offset);
2977 return (obj->attachments->west.offset);
2979 if (util_get_verbosity() > 0)
2980 fprintf(stderr, "obj_get_attach_offset: invalid direction\n");
2989 AB_COMPASS_POINT dir,
2990 AB_ATTACH_TYPE type,
2995 ABAttachment *attachment;
2996 verify_for_write(obj);
2998 if (obj->attachments == NULL)
2999 obj_init_attachments(obj);
3004 attachment = &(obj->attachments->north);
3007 attachment = &(obj->attachments->west);
3010 attachment = &(obj->attachments->south);
3013 attachment = &(obj->attachments->east);
3016 attachment->type = type;
3017 attachment->value = value;
3018 attachment->offset = offset;
3024 obj_set_attach_type(
3026 AB_COMPASS_POINT dir,
3030 verify_for_write(obj);
3031 if (obj->attachments == NULL)
3032 obj_init_attachments(obj);
3037 obj->attachments->north.type = type;
3040 obj->attachments->west.type = type;
3043 obj->attachments->south.type = type;
3046 obj->attachments->east.type = type;
3053 obj_set_attach_value(
3055 AB_COMPASS_POINT dir,
3059 verify_for_write(obj);
3060 if (obj->attachments == NULL)
3061 obj_init_attachments(obj);
3066 obj->attachments->north.value = value;
3069 obj->attachments->west.value = value;
3072 obj->attachments->south.value = value;
3075 obj->attachments->east.value = value;
3082 obj_set_attach_offset(
3084 AB_COMPASS_POINT dir,
3088 verify_for_write(obj);
3089 if (obj->attachments == NULL)
3090 obj_init_attachments(obj);
3095 obj->attachments->north.offset = offset;
3098 obj->attachments->west.offset = offset;
3101 obj->attachments->south.offset = offset;
3104 obj->attachments->east.offset = offset;
3111 obj_set_button_type(ABObj obj, AB_BUTTON_TYPE type)
3113 verify_for_write(obj);
3114 if (!obj_is_button(obj))
3117 obj->info.button.type = type;
3123 obj_set_help_act_button(
3128 if (!obj_is_window(obj))
3131 verify_for_write(obj);
3132 obj->info.window.help_act_button= helpb;
3137 obj_get_help_act_button(
3141 ABObj defaultb = NULL;
3143 if (!obj_is_window(obj))
3146 verify_for_read(obj);
3147 return(obj->info.window.help_act_button);
3151 ** Indicate whether a particular object has help data set. This is used
3152 ** by the front end to set-up help in Test Mode and by the code generator
3153 ** to decide whether to generate help support code.
3156 obj_has_help_data(ABObj obj)
3158 STRING help_text = istr_string(obj->help_text);
3160 if( (help_text != 0) && (*help_text != 0) ) {
3167 obj_set_help_data(ABObj obj,
3169 STRING help_location,
3173 verify_for_write(obj);
3174 istr_destroy(obj->help_volume);
3175 istr_destroy(obj->help_location);
3176 istr_destroy(obj->help_text);
3178 obj->help_volume = istr_create(help_volume);
3179 obj->help_location = istr_create(help_location);
3180 obj->help_text = istr_create(help_text);
3186 obj_set_help_volume(ABObj obj,
3190 verify_for_write(obj);
3191 istr_destroy(obj->help_volume);
3192 obj->help_volume = istr_create(help_volume);
3198 obj_set_help_location(ABObj obj,
3199 STRING help_location
3202 verify_for_write(obj);
3203 istr_destroy(obj->help_location);
3204 obj->help_location = istr_create(help_location);
3210 obj_set_help_text(ABObj obj,
3214 verify_for_write(obj);
3215 istr_destroy(obj->help_text);
3216 obj->help_text = istr_create(help_text);
3222 obj_get_help_data(ABObj obj,
3223 STRING * help_volume,
3224 STRING * help_location,
3228 verify_for_read(obj);
3229 *help_volume = istr_string(obj->help_volume);
3230 *help_location = istr_string(obj->help_location);
3231 *help_text = istr_string(obj->help_text);
3236 obj_get_help_volume(
3240 STRING help_volume = NULL;
3241 verify_for_read(obj);
3243 help_volume = istr_string(obj->help_volume);
3244 return (help_volume);
3248 obj_get_help_location(
3252 STRING help_location = NULL;
3253 verify_for_read(obj);
3255 help_location = istr_string(obj->help_location);
3256 return (help_location);
3264 STRING help_text = NULL;
3265 verify_for_read(obj);
3267 help_text = istr_string(obj->help_text);
3272 obj_set_word_wrap(ABObj obj, BOOL word_wrap)
3274 verify_for_write(obj);
3275 if (obj_is_text_pane(obj))
3277 obj->info.text.word_wrap = word_wrap;
3280 member_error(obj, "word_wrap");
3286 obj_get_word_wrap(ABObj obj)
3288 verify_for_read(obj);
3289 return (obj->info.text.word_wrap);
3293 obj_set_line_style(ABObj obj, AB_LINE_TYPE line_style)
3295 verify_for_write(obj);
3298 case AB_TYPE_SEPARATOR:
3299 obj->info.separator.line_style = line_style;
3302 obj->info.item.line_style = line_style;
3305 member_error(obj, "line_style");
3315 verify_for_read(obj);
3319 case AB_TYPE_SEPARATOR:
3320 return (obj->info.separator.line_style);
3322 return (obj->info.item.line_style);
3324 return (AB_LINE_UNDEF);
3329 obj_set_arrow_style(ABObj obj, AB_ARROW_STYLE arrow_style)
3331 verify_for_write(obj);
3334 case AB_TYPE_SPIN_BOX:
3335 obj->info.spin_box.arrow_style = arrow_style;
3338 member_error(obj, "arrow_style");
3344 obj_get_arrow_style(
3348 verify_for_read(obj);
3349 if (!obj || !obj_is_spin_box(obj))
3350 return (AB_ARROW_UNDEF);
3352 return (obj->info.spin_box.arrow_style);
3361 verify_for_write(obj);
3362 if (!obj_is_scale(obj))
3364 member_error(obj, "scale_show_value");
3368 obj->info.scale.show_value = val;
3377 verify_for_read(obj);
3378 if (!obj_is_scale(obj))
3380 member_error(obj, "show_value");
3384 return (obj->info.scale.show_value);
3388 obj_set_user_data(ABObj obj, STRING user_data)
3390 verify_for_write(obj);
3391 istr_destroy(obj->user_data);
3392 obj->user_data = istr_create(user_data);
3397 obj_get_user_data(ABObj obj)
3399 verify_for_read(obj);
3400 return istr_string(obj->user_data);
3407 verify(ABObj obj, int min_debug, STRING file, int line)
3411 if (debug_level() < min_debug)
3416 rc = objP_update_verify(obj);
3419 util_dprintf(0, "Corrupted object detected (%s:%d).\n",
3421 if (debug_level() >= 5)
3430 /* don't normally check obj integrity on every read (debug level 3) */
3432 verify_for_read_impl(ABObj obj, STRING file, int line)
3434 return verify(obj, 1, file, line);
3438 verify_for_write_impl(ABObj obj, STRING file, int line)
3440 return verify(obj, 1, file, line);
3448 * Report an attempt to set an unsupported attribute on an object.
3451 member_error_impl(ABObj obj, STRING member_name, STRING file, int line)
3456 * We "use" fields that are illegal for objects regularly, and just
3457 * ignore the objects that return errors.
3467 obj_get_safe_name(obj, obj_name, 256);
3469 "ERROR(%s:%d): Bad attribute access '%s' in object '%s'.\n",
3470 file, line, member_name, obj_name);
3478 obj_has_hscrollbar(ABObj obj)
3480 AB_OBJECT_TYPE type = AB_TYPE_UNDEF;
3481 AB_SCROLLBAR_POLICY sb_policy = AB_SCROLLBAR_UNDEF;
3482 BOOL has_hscrollbar = FALSE;
3484 type = obj_get_type(obj);
3485 if (type == AB_TYPE_DRAWING_AREA || type == AB_TYPE_LIST ||
3486 type == AB_TYPE_TERM_PANE || type == AB_TYPE_TEXT_PANE )
3488 sb_policy = obj_get_hscrollbar_policy(obj);
3489 if (sb_policy == AB_SCROLLBAR_ALWAYS ||
3490 sb_policy == AB_SCROLLBAR_WHEN_NEEDED)
3492 has_hscrollbar = TRUE;
3496 return (has_hscrollbar);
3500 obj_has_vscrollbar(ABObj obj)
3502 AB_OBJECT_TYPE type = AB_TYPE_UNDEF;
3503 AB_SCROLLBAR_POLICY sb_policy = AB_SCROLLBAR_UNDEF;
3504 BOOL has_vscrollbar = FALSE;
3506 type = obj_get_type(obj);
3507 if (type == AB_TYPE_DRAWING_AREA || type == AB_TYPE_LIST ||
3508 type == AB_TYPE_TERM_PANE || type == AB_TYPE_TEXT_PANE )
3510 sb_policy = obj_get_vscrollbar_policy(obj);
3511 if (sb_policy == AB_SCROLLBAR_ALWAYS ||
3512 sb_policy == AB_SCROLLBAR_WHEN_NEEDED)
3514 has_vscrollbar = TRUE;
3518 return (has_vscrollbar);
3522 obj_set_ok_label(ABObj obj, STRING label)
3524 verify_for_write(obj);
3525 if (!obj_is_file_chooser(obj))
3527 member_error(obj, "ok_label");
3530 istr_destroy(obj->info.file_chooser.ok_label);
3531 obj->info.file_chooser.ok_label = istr_create(label);
3536 obj_get_ok_label( ABObj obj)
3538 STRING label = NULL;
3540 verify_for_read(obj);
3541 if (!obj_is_file_chooser(obj))
3543 member_error(obj, "ok_label");
3546 label = istr_string(obj->info.file_chooser.ok_label);
3551 obj_set_action1_label(ABObj obj, STRING label)
3553 verify_for_write(obj);
3554 if (!obj_is_message(obj))
3556 member_error(obj, "action1_label");
3559 istr_destroy(obj->info.message.action1_label);
3560 obj->info.message.action1_label = istr_create(label);
3565 obj_get_action1_label( ABObj obj)
3567 STRING label = NULL;
3569 verify_for_read(obj);
3570 if (!obj_is_message(obj))
3572 member_error(obj, "action1_label");
3575 label = istr_string(obj->info.message.action1_label);
3580 obj_set_action2_label(ABObj obj, STRING label)
3582 verify_for_write(obj);
3583 if (!obj_is_message(obj))
3585 member_error(obj, "action2_label");
3588 istr_destroy(obj->info.message.action2_label);
3589 obj->info.message.action2_label = istr_create(label);
3594 obj_get_action2_label( ABObj obj)
3596 STRING label = NULL;
3598 verify_for_read(obj);
3599 if (!obj_is_message(obj))
3601 member_error(obj, "action2_label");
3604 label = istr_string(obj->info.message.action2_label);
3609 obj_set_action3_label(ABObj obj, STRING label)
3611 verify_for_write(obj);
3612 if (!obj_is_message(obj))
3614 member_error(obj, "action3_label");
3617 istr_destroy(obj->info.message.action3_label);
3618 obj->info.message.action3_label = istr_create(label);
3623 obj_get_action3_label( ABObj obj)
3625 STRING label = NULL;
3627 verify_for_read(obj);
3628 if (!obj_is_message(obj))
3630 member_error(obj, "action3_label");
3633 label = istr_string(obj->info.message.action3_label);
3638 obj_set_directory(ABObj obj, STRING dir)
3640 verify_for_write(obj);
3641 if (!obj_is_file_chooser(obj))
3643 member_error(obj, "directory");
3646 istr_destroy(obj->info.file_chooser.directory);
3647 obj->info.file_chooser.directory = istr_create(dir);
3652 obj_get_directory( ABObj obj)
3656 verify_for_read(obj);
3657 if (!obj_is_file_chooser(obj))
3659 member_error(obj, "directory");
3662 dir = istr_string(obj->info.file_chooser.directory);
3668 obj_set_auto_dismiss(ABObj obj, BOOL dismiss)
3670 verify_for_write(obj);
3671 if (!obj_is_file_chooser(obj))
3673 member_error(obj, "auto_dismiss");
3676 obj->info.file_chooser.auto_dismiss = dismiss;
3681 obj_get_auto_dismiss( ABObj obj)
3683 verify_for_read(obj);
3684 if (!obj_is_file_chooser(obj))
3686 member_error(obj, "auto_dismiss");
3689 return (obj->info.file_chooser.auto_dismiss);
3694 obj_set_file_type_mask(ABObj obj, AB_FILE_TYPE_MASK ftm)
3696 verify_for_write(obj);
3697 if (!obj_is_file_chooser(obj))
3699 member_error(obj, "file_type_mask");
3702 obj->info.file_chooser.file_type_mask = ftm;
3707 obj_get_file_type_mask( ABObj obj)
3709 verify_for_read(obj);
3710 if (!obj_is_file_chooser(obj))
3712 member_error(obj, "file_type_mask");
3713 return (AB_FILE_TYPE_MASK)0;
3716 return (obj->info.file_chooser.file_type_mask);
3720 obj_set_msg_string(ABObj obj, STRING msg)
3722 verify_for_write(obj);
3723 if (!obj_is_message(obj))
3725 member_error(obj, "message");
3728 istr_destroy(obj->info.message.msg_string);
3729 obj->info.message.msg_string = istr_create(msg);
3734 obj_get_msg_string( ABObj obj)
3738 verify_for_read(obj);
3739 if (!obj_is_message(obj))
3741 member_error(obj, "message");
3744 msg = istr_string(obj->info.message.msg_string);
3749 obj_set_msg_type(ABObj obj, AB_MESSAGE_TYPE msg_type)
3751 verify_for_write(obj);
3752 if (obj_is_message(obj))
3754 return (obj->info.message.type = msg_type);
3756 return ERR_BAD_PARAM1;
3760 obj_get_msg_type( ABObj obj)
3762 verify_for_read(obj);
3763 if (obj_is_message(obj))
3765 return (obj->info.message.type);
3767 return AB_MSG_UNDEF;
3771 obj_set_default_btn(ABObj obj, AB_DEFAULT_BUTTON button)
3773 verify_for_write(obj);
3774 if (obj_is_message(obj))
3776 return (obj->info.message.default_btn = button);
3778 return ERR_BAD_PARAM1;
3782 obj_get_default_btn( ABObj obj)
3784 verify_for_read(obj);
3785 if (obj_is_message(obj))
3787 return (obj->info.message.default_btn);
3789 return AB_DEFAULT_BTN_UNDEF;
3793 obj_has_action1_button(ABObj obj)
3795 verify_for_read(obj);
3796 if (obj_is_message(obj))
3797 return (!util_strempty(obj_get_action1_label(obj)));
3803 obj_has_action2_button(ABObj obj)
3805 verify_for_read(obj);
3806 if (obj_is_message(obj))
3807 return (!util_strempty(obj_get_action2_label(obj)));
3813 obj_has_action3_button(ABObj obj)
3815 verify_for_read(obj);
3816 if (obj_is_message(obj))
3817 return (!util_strempty(obj_get_action3_label(obj)));
3823 obj_has_cancel_button(ABObj obj)
3825 verify_for_read(obj);
3826 if (obj_is_message(obj))
3827 return (obj->info.message.cancel_button != 0);
3833 obj_has_help_button(ABObj obj)
3835 verify_for_read(obj);
3836 if (obj_is_message(obj))
3837 return (obj->info.message.help_button != 0);
3843 obj_set_sessioning_method(ABObj obj, AB_SESSIONING_METHOD sessioning_method)
3845 verify_for_write(obj);
3846 if (obj_is_project(obj))
3848 return (obj->info.project.session_mgmt.sessioning_method = sessioning_method);
3850 return ERR_BAD_PARAM1;
3853 AB_SESSIONING_METHOD
3854 obj_get_sessioning_method( ABObj obj)
3856 verify_for_read(obj);
3857 if (obj_is_project(obj))
3859 return (obj->info.project.session_mgmt.sessioning_method);
3861 return AB_SESSIONING_UNDEF;
3864 obj_set_cancel_button(ABObj obj, BOOL has_button)
3866 verify_for_write(obj);
3867 if (!obj_is_message(obj))
3869 obj->info.message.cancel_button = has_button;
3874 obj_set_help_button(ABObj obj, BOOL has_button)
3876 verify_for_write(obj);
3877 if (!obj_is_message(obj))
3879 obj->info.message.help_button = has_button;
3882 obj_set_tooltalk_level(ABObj obj, AB_TOOLTALK_LEVEL tt_level)
3884 verify_for_write(obj);
3885 if (obj_is_project(obj))
3887 return (obj->info.project.tooltalk.level = tt_level);
3889 return ERR_BAD_PARAM1;
3893 obj_get_tooltalk_level( ABObj obj)
3895 verify_for_read(obj);
3896 if (obj_is_project(obj))
3898 return (obj->info.project.tooltalk.level);
3900 return AB_TOOLTALK_UNDEF;
3904 obj_set_pane_min( ABObj obj, int val)
3906 verify_for_write(obj);
3907 if (!obj_is_pane(obj) && !obj_is_layers(obj))
3910 if (obj_is_text_pane(obj))
3911 obj->info.text.pane_min = val;
3912 if (obj_is_term_pane(obj))
3913 obj->info.term.pane_min = val;
3914 if (obj_is_drawing_area(obj))
3915 obj->info.drawing_area.pane_min = val;
3916 if (obj_is_container(obj))
3917 obj->info.container.pane_min = val;
3918 if (obj_is_layers(obj))
3919 obj->info.layer.pane_min = val;
3924 obj_get_pane_min( ABObj obj)
3926 verify_for_read(obj);
3927 if (!obj_is_pane(obj) && !obj_is_layers(obj))
3930 if (obj_is_text_pane(obj))
3931 return (obj->info.text.pane_min);
3932 if (obj_is_term_pane(obj))
3933 return (obj->info.term.pane_min);
3934 if (obj_is_drawing_area(obj))
3935 return (obj->info.drawing_area.pane_min);
3936 if (obj_is_container(obj))
3937 return (obj->info.container.pane_min);
3938 if (obj_is_layers(obj))
3939 return (obj->info.layer.pane_min);
3943 obj_set_pane_max( ABObj obj, int val)
3945 verify_for_write(obj);
3946 if (!obj_is_pane(obj) && !obj_is_layers(obj))
3949 if (obj_is_text_pane(obj))
3950 obj->info.text.pane_max = val;
3951 if (obj_is_term_pane(obj))
3952 obj->info.term.pane_max = val;
3953 if (obj_is_drawing_area(obj))
3954 obj->info.drawing_area.pane_max = val;
3955 if (obj_is_container(obj))
3956 obj->info.container.pane_max = val;
3957 if (obj_is_layers(obj))
3958 obj->info.layer.pane_max = val;
3963 obj_get_pane_max( ABObj obj)
3965 verify_for_read(obj);
3966 if (!obj_is_pane(obj) && !obj_is_layers(obj))
3969 if (obj_is_text_pane(obj))
3970 return (obj->info.text.pane_max);
3971 if (obj_is_term_pane(obj))
3972 return (obj->info.term.pane_max);
3973 if (obj_is_drawing_area(obj))
3974 return (obj->info.drawing_area.pane_max);
3975 if (obj_is_container(obj))
3976 return (obj->info.container.pane_max);
3977 if (obj_is_layers(obj))
3978 return (obj->info.layer.pane_max);
3982 obj_set_i18n_enabled(ABObj obj, BOOL i18n_enabled)
3984 verify_for_write(obj);
3985 if (obj_is_project(obj))
3987 obj->info.project.i18n.enabled = i18n_enabled;
3990 return ERR_BAD_PARAM1;
3994 obj_get_i18n_enabled( ABObj obj)
3996 verify_for_read(obj);
3997 if (obj_is_project(obj))
3999 return(obj->info.project.i18n.enabled);
4005 obj_get_num_win_children( ABObj obj)
4007 ABObj refObj = NULL;
4008 AB_OBJ_REF_TYPE refType = AB_REF_UNDEF;
4009 ABObjList refs = NULL;
4010 void *voidRefType = NULL;
4011 int numRefs = 0, i = 0;
4012 int numWinChildren = 0;
4014 verify_for_read(obj);
4015 if (!obj_is_base_win(obj))
4018 if ((refs = obj_get_refs_to(obj)) != NULL)
4020 numRefs = objlist_get_num_objs(refs);
4021 for (i = 0; i < numRefs; i++)
4023 refObj = objlist_get_obj(refs, i, &voidRefType);
4024 refType = (AB_OBJ_REF_TYPE)voidRefType;
4026 if (refType == AB_REF_WIN_PARENT)
4031 objlist_destroy(refs);
4034 return (numWinChildren);
4038 obj_set_read_only(ABObj obj, BOOL is_read_only)
4040 verify_for_write(obj);
4043 obj_set_impl_flags(obj, ObjFlagIsReadOnly);
4047 obj_clear_impl_flags(obj, ObjFlagIsReadOnly);
4053 obj_get_read_only(ABObj obj)
4055 verify_for_read(obj);
4056 return obj_has_impl_flags(obj, ObjFlagIsReadOnly);
4060 obj_get_func_help_location(ABObj obj)
4062 verify_for_read(obj);
4063 if (obj_is_action(obj))
4065 return (istr_string(obj->info.action.location));
4067 member_error(obj, "func_help_location");
4072 obj_set_func_help_location(ABObj obj, STRING location)
4074 verify_for_write(obj);
4075 if (!(obj_is_action(obj) &&
4076 (obj->info.action.func_type == AB_FUNC_HELP_VOLUME)))
4078 member_error(obj, "func_help_location");
4081 istr_destroy(obj->info.action.location);
4082 obj->info.action.location = istr_create(location);
4087 obj_get_func_help_volume(ABObj obj)
4089 verify_for_read(obj);
4090 if (obj_is_action(obj))
4092 return (istr_string(obj->info.action.volume_id));
4094 member_error(obj, "func_help_volume");
4099 obj_set_func_help_volume(ABObj obj, STRING volume)
4101 verify_for_write(obj);
4102 if (!(obj_is_action(obj) &&
4103 (obj->info.action.func_type == AB_FUNC_HELP_VOLUME)))
4105 member_error(obj, "func_help_volume");
4108 istr_destroy(obj->info.action.volume_id);
4109 obj->info.action.volume_id = istr_create(volume);
4115 /**************************************************************************
4116 **************************************************************************
4119 *** Drag and Drop ***
4122 *** bit 0 -> drag enabled ***
4123 *** bit 1 -> drag to root allowed ***
4124 *** bits 2-4 -> drag ops ***
4125 *** bits 5-8 -> drag types ***
4126 *** bit 9 -> drop enabled ***
4127 *** bits 10-12 -> drop ops ***
4128 *** bits 13-16 -> drop types ***
4130 **************************************************************************
4131 **************************************************************************/
4133 #define ObjDndFlagDragEnabled (((unsigned)0x0001))
4134 #define ObjDndFlagDragToRootOK (((unsigned)0x0001)<<1)
4135 #define ObjDndFlagDragOpsFBIT (2) /* first bit */
4136 #define ObjDndFlagDragOpsNBITS (3) /* num bits */
4137 #define ObjDndFlagDragTypesFBIT (5) /* first bit */
4138 #define ObjDndFlagDragTypesNBITS (4) /* num bits */
4139 #define ObjDndFlagDropEnabled (((unsigned)0x0001)<<9)
4140 #define ObjDndFlagDropOpsFBIT (10) /* first bit */
4141 #define ObjDndFlagDropOpsNBITS (3) /* num bits */
4142 #define ObjDndFlagDropTypesFBIT (13) /* first bit */
4143 #define ObjDndFlagDropTypesNBITS (4) /* num bits */
4144 #define ObjDndFlagDropOnChildOK (((unsigned)0x0001)<<17)
4148 obj_set_drag_cursor(ABObj obj, STRING filename)
4150 verify_for_write(obj);
4151 istr_destroy(obj->drag_cursor);
4152 obj->drag_cursor = istr_create(filename);
4157 obj_get_drag_cursor(ABObj obj)
4159 verify_for_read(obj);
4160 return istr_string(obj->drag_cursor);
4164 obj_set_drag_cursor_mask(ABObj obj, STRING filename)
4166 verify_for_write(obj);
4167 istr_destroy(obj->drag_cursor_mask);
4168 obj->drag_cursor_mask = istr_create(filename);
4173 obj_get_drag_cursor_mask(ABObj obj)
4175 verify_for_read(obj);
4176 return istr_string(obj->drag_cursor_mask);
4180 obj_set_drag_initially_enabled(ABObj obj, BOOL enabled)
4182 obj->impl_dnd_flags &= ~ObjDndFlagDragEnabled;
4185 obj->impl_dnd_flags |= ObjDndFlagDragEnabled;
4191 obj_get_drag_initially_enabled(ABObj obj)
4193 return ((obj->impl_dnd_flags & ObjDndFlagDragEnabled) != 0);
4197 obj_set_drag_to_root_allowed(ABObj obj, BOOL allowed)
4199 obj->impl_dnd_flags &= ~ObjDndFlagDragToRootOK;
4202 obj->impl_dnd_flags |= ObjDndFlagDragToRootOK;
4208 obj_get_drag_to_root_allowed(ABObj obj)
4210 return ((obj->impl_dnd_flags & ObjDndFlagDragToRootOK) != 0);
4215 obj_set_drag_ops(ABObj obj, BYTE dragOps)
4217 obj->impl_dnd_flags &= ~(0x07U<<ObjDndFlagDragOpsFBIT);
4218 obj->impl_dnd_flags |= ((dragOps & 0x07)<<ObjDndFlagDragOpsFBIT);
4224 obj_get_drag_ops(ABObj obj)
4226 return (BYTE)((obj->impl_dnd_flags >> ObjDndFlagDragOpsFBIT) & 0x07);
4231 obj_set_drag_types(ABObj obj, BYTE dragTypes)
4233 obj->impl_dnd_flags &= ~(0x0fU<<ObjDndFlagDragTypesFBIT);
4234 obj->impl_dnd_flags |= ((dragTypes & 0x0f) << ObjDndFlagDragTypesFBIT);
4240 obj_get_drag_types(ABObj obj)
4242 return (BYTE)((obj->impl_dnd_flags >> ObjDndFlagDragTypesFBIT) & 0x0f);
4246 obj_set_drop_initially_enabled(ABObj obj, BOOL enabled)
4248 obj->impl_dnd_flags &= ~ObjDndFlagDropEnabled;
4251 obj->impl_dnd_flags |= ObjDndFlagDropEnabled;
4257 obj_get_drop_initially_enabled(ABObj obj)
4259 return ((obj->impl_dnd_flags & ObjDndFlagDropEnabled) != 0);
4263 obj_set_drop_ops(ABObj obj, BYTE dropOps)
4265 obj->impl_dnd_flags &= ~(0x07U<<ObjDndFlagDropOpsFBIT);
4266 obj->impl_dnd_flags |= ((dropOps & 0x07)<<ObjDndFlagDropOpsFBIT);
4272 obj_get_drop_ops(ABObj obj)
4274 return (BYTE)((obj->impl_dnd_flags >> ObjDndFlagDropOpsFBIT) & 0x07);
4279 obj_set_drop_types(ABObj obj, BYTE dropTypes)
4281 obj->impl_dnd_flags &= ~(0x0fU<<ObjDndFlagDropTypesFBIT);
4282 obj->impl_dnd_flags |= ((dropTypes & 0x0f) << ObjDndFlagDropTypesFBIT);
4288 obj_get_drop_types(ABObj obj)
4290 return (BYTE)((obj->impl_dnd_flags >> ObjDndFlagDropTypesFBIT) & 0x0f);
4295 obj_set_drop_on_children_is_allowed(ABObj obj, BOOL allowed)
4297 obj->impl_dnd_flags &= ~ObjDndFlagDropOnChildOK;
4300 obj->impl_dnd_flags |= ObjDndFlagDropOnChildOK;
4306 obj_drop_on_children_is_allowed(ABObj obj)
4308 return ((obj->impl_dnd_flags & ObjDndFlagDropOnChildOK) != 0);