dtappbuilder: make it build under autotools

This commit is contained in:
Chase
2020-09-05 15:27:30 -05:00
committed by Jon Trulson
parent cb3180cd2a
commit 65d2062518
126 changed files with 846 additions and 65 deletions

View File

@@ -0,0 +1,812 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: util_types.h /main/4 1995/11/06 18:54:42 rswiston $
*
* @(#)util_types.h 3.69 15 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _AB_UTIL_TYPES_H
#define _AB_UTIL_TYPES_H
/*
* util_types.h - defines all scalar types used in the CDE app builder
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#define AB_VERSION_PREFIX ":bil-version"
/*************************************************************************
**************************************************************************
** **
** GENERAL/MISCELLANEOUS TYPES **
** **
**************************************************************************
**************************************************************************/
#define OK (0)
#define ERROR (-1)
#define AB_NO_SUBTYPE -1
extern const int Util_major_version;
extern const int Util_minor_version;
#include <X11/Xmd.h> /* For BOOL and BYTE typedefs */
typedef unsigned char UCHAR;
typedef unsigned int UINT;
typedef unsigned long ULONG;
typedef char * STRING;
#ifndef FALSE
#define FALSE ((BOOL)(0x00))
#endif
#ifndef TRUE
#define TRUE ((BOOL)(0x01))
#endif
/*************************************************************************
**************************************************************************
** **
** APP-BUILDER-SPECIFIC TYPES **
** **
**************************************************************************
**************************************************************************/
/*
* Argument type used in the resfile.
*/
typedef enum
{
AB_ARG_UNDEF = 0,
AB_ARG_BOOLEAN,
AB_ARG_CALLBACK,
AB_ARG_FLOAT,
AB_ARG_INT,
AB_ARG_LITERAL, /* e.g., #define values, written out "as is" */
AB_ARG_NONE, /* no argument */
AB_ARG_STRING,
AB_ARG_XMSTRING,
AB_ARG_XMSTRING_TBL,
AB_ARG_PIXEL,
AB_ARG_PIXMAP,
AB_ARG_FONT,
AB_ARG_WIDGET,
AB_ARG_VOID_PTR,
AB_ARG_VARIABLE,
AB_ARG_MNEMONIC,
AB_ARG_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_ARG_TYPE;
/*
* Resource "classes"
*
* The classes are mutually exclusive.
*/
typedef enum
{
AB_ARG_CLASS_UNDEF = 0,
AB_ARG_CLASS_ACCELERATOR, /* items */
AB_ARG_CLASS_COLOR, /* any color-related arg */
AB_ARG_CLASS_GEOMETRY, /* includes layout, attachments */
AB_ARG_CLASS_GLYPH, /* any glyph (including icons) */
AB_ARG_CLASS_NON_GLYPH_LABEL, /* any label not of type glyph */
AB_ARG_CLASS_OTHER_STRING, /* any string of no other class */
AB_ARG_CLASS_OTHER, /* any of no other class */
AB_ARG_CLASS_VALUE, /* e.g., text field, scale, scrollbar*/
AB_ARG_CLASS_NUM_VALUES /* must be last */
} AB_ARG_CLASS;
typedef unsigned char AB_ARG_CLASS_FLAGS; /* bitmap of arg classes */
#define AB_ARG_CLASS_FLAGS_NONE ((AB_ARG_CLASS_FLAGS)0x0000)
#define AB_ARG_CLASS_FLAGS_ALL ((AB_ARG_CLASS_FLAGS)~0x0000)
/*
* Function type used in the resfile
*/
typedef enum
{
AB_FUNC_UNDEF = 0,
AB_FUNC_BUILTIN, /* ab-defined action (e.g., setvalue) */
AB_FUNC_USER_DEF, /* function name (user-defined function) */
AB_FUNC_CODE_FRAG, /* actual code entered by user */
AB_FUNC_ON_ITEM_HELP, /* dtb_do_on_item_help() */
AB_FUNC_HELP_VOLUME, /* dtb_show_help_volume_info() */
AB_FUNC_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_FUNC_TYPE;
/*
* Orientation scalar
*/
typedef enum
{
AB_ORIENT_UNDEF = 0,
AB_ORIENT_HORIZONTAL,
AB_ORIENT_VERTICAL,
AB_ORIENTATION_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_ORIENTATION;
/*
* Types for the AB_GROUP_TYPE attribute.
*/
typedef enum
{
AB_GROUP_UNDEF = 0,
AB_GROUP_IGNORE,
AB_GROUP_COLUMNS,
AB_GROUP_ROWS,
AB_GROUP_ROWSCOLUMNS,
AB_GROUP_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_GROUP_TYPE;
/*
* Types for AB_LINE_TYPE (Used for Separator Object &
* framing objects)
*/
typedef enum
{
AB_LINE_UNDEF = 0,
AB_LINE_NONE,
AB_LINE_SHADOW_IN,
AB_LINE_SHADOW_OUT,
AB_LINE_ETCHED_IN,
AB_LINE_ETCHED_OUT,
AB_LINE_ETCHED_IN_DASH,
AB_LINE_ETCHED_OUT_DASH,
AB_LINE_SINGLE_LINE,
AB_LINE_DOUBLE_LINE,
AB_LINE_SINGLE_DASHED_LINE,
AB_LINE_DOUBLE_DASHED_LINE,
AB_LINE_TYPE_NUM_VALUES
} AB_LINE_TYPE;
/*
*
*/
typedef enum
{
AB_ALIGN_UNDEF = 0,
AB_ALIGN_TOP,
AB_ALIGN_RIGHT,
AB_ALIGN_BOTTOM,
AB_ALIGN_LEFT,
AB_ALIGN_CENTER, /* center verticaly and horizontally */
AB_ALIGN_VCENTER, /* center vertically */
AB_ALIGN_HCENTER, /* center horizontally */
AB_ALIGN_LABELS,
AB_ALIGNMENT_NUM_VALUES /* must be last! */
} AB_ALIGNMENT;
typedef enum
{
AB_DIR_UNDEF = 0,
AB_DIR_LEFT_TO_RIGHT,
AB_DIR_RIGHT_TO_LEFT,
AB_DIR_TOP_TO_BOTTOM,
AB_DIR_BOTTOM_TO_TOP,
AB_DIR_NUM_VALUES /* must be last! */
} AB_DIRECTION;
/*
* Types for the AB_{ANCHOR,REFERENCE}_POINT attributes.
*/
typedef enum
{
AB_CP_UNDEF = 0,
AB_CP_NORTH,
AB_CP_NORTHEAST,
AB_CP_EAST,
AB_CP_SOUTHEAST,
AB_CP_SOUTH,
AB_CP_SOUTHWEST,
AB_CP_WEST,
AB_CP_NORTHWEST,
AB_CP_CENTER,
AB_COMPASS_POINT_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_COMPASS_POINT;
/*
* Layout Attachment types
*/
typedef enum
{
AB_ATTACH_UNDEF = 0,
AB_ATTACH_POINT,
AB_ATTACH_OBJ,
AB_ATTACH_ALIGN_OBJ_EDGE,
AB_ATTACH_GRIDLINE,
AB_ATTACH_CENTER_GRIDLINE,
AB_ATTACH_NONE,
AB_ATTACHMENT_NUM_VALUES
} AB_ATTACH_TYPE;
/*
* Intitial state types.
*/
typedef enum
{
AB_STATE_UNDEF = 0,
AB_STATE_ACTIVE,
AB_STATE_ICONIC,
AB_STATE_INACTIVE,
AB_STATE_INVISIBLE,
AB_STATE_NOTSELECTED,
AB_STATE_OPEN,
AB_STATE_SELECTED,
AB_STATE_VISIBLE,
AB_OBJECT_STATE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_OBJECT_STATE;
/*
*
*/
typedef enum
{
AB_PACK_UNDEF = 0,
AB_PACK_NONE,
AB_PACK_TIGHT,
AB_PACK_EQUAL,
AB_PACKING_NUM_VALUES
} AB_PACKING;
/*
* file types
*/
typedef enum
{
AB_FILE_UNDEF = 0,
AB_FILE_BIL_COMPLETE,
AB_FILE_BIL_PROJECT,
AB_FILE_BIL_MODULE,
AB_FILE_C,
AB_FILE_GIL_INTERFACE,
AB_FILE_GIL_PROJECT,
AB_FILE_UIL,
AB_FILE_TYPE_NUM_VALUES
} AB_FILE_TYPE;
/*
* Action triggers ("when" values)
*
*/
typedef enum
{
AB_WHEN_UNDEF = 0,
AB_WHEN_ACTION1, /* MessageBox Ok Button */
AB_WHEN_ACTION2, /* MessageBox Extra Button */
AB_WHEN_ACTION3, /* MessageBox Extra Button */
AB_WHEN_ACTIVATED,
AB_WHEN_AFTER_CREATED, /* immediately after create */
AB_WHEN_AFTER_RESIZED,
AB_WHEN_BEFORE_POST_MENU,
AB_WHEN_BEFORE_TEXT_CHANGED,
AB_WHEN_CANCEL, /* MessageBox Cancel Button */
AB_WHEN_DESTROYED,
AB_WHEN_DOUBLE_CLICKED_ON,
AB_WHEN_DRAGGED,
AB_WHEN_DRAGGED_FROM,
AB_WHEN_DROPPED_ON,
AB_WHEN_HIDDEN,
AB_WHEN_ITEM_SELECTED,
AB_WHEN_OK,
AB_WHEN_POPPED_DOWN,
AB_WHEN_POPPED_UP,
AB_WHEN_REPAINT_NEEDED,
AB_WHEN_SESSION_RESTORE,
AB_WHEN_SESSION_SAVE,
AB_WHEN_SHOWN,
AB_WHEN_TEXT_CHANGED,
AB_WHEN_TOGGLED,
AB_WHEN_TOOLTALK_DO_COMMAND,
AB_WHEN_TOOLTALK_GET_STATUS,
AB_WHEN_TOOLTALK_PAUSE_RESUME,
AB_WHEN_TOOLTALK_QUIT,
AB_WHEN_VALUE_CHANGED,
AB_WHEN_NUM_VALUES
} AB_WHEN;
/*
* Builtin app builder actions
*/
typedef enum
{
AB_STDACT_UNDEF = 0,
AB_STDACT_DISABLE,
AB_STDACT_ENABLE,
AB_STDACT_HIDE,
AB_STDACT_SET_LABEL,
AB_STDACT_SET_TEXT,
AB_STDACT_SET_VALUE,
AB_STDACT_SHOW,
AB_BUILTIN_ACTION_NUM_VALUES
} AB_BUILTIN_ACTION;
/*
* Horizontal and vertical scrollbar settings
*/
typedef enum
{
AB_SCROLLBAR_UNDEF = 0,
AB_SCROLLBAR_ALWAYS,
AB_SCROLLBAR_NEVER,
AB_SCROLLBAR_WHEN_NEEDED,
AB_SCROLLBAR_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_SCROLLBAR_POLICY;
/*
* Tooltalk Handling Level types
*/
typedef enum
{
AB_TOOLTALK_UNDEF,
AB_TOOLTALK_NONE,
AB_TOOLTALK_DESKTOP_BASIC,
AB_TOOLTALK_DESKTOP_ADVANCED,
AB_TOOLTALK_NUM_VALUES /* number of valid values - LAST */
} AB_TOOLTALK_LEVEL;
/*
* Sessioning method.
* Used in Project ABObj.
*/
typedef enum
{
AB_SESSIONING_UNDEF = 0,
AB_SESSIONING_NONE,
AB_SESSIONING_CMDLINE,
AB_SESSIONING_FILE,
AB_SESSIONING_CMDLINE_AND_FILE,
AB_SESSIONING_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_SESSIONING_METHOD;
/*************************************************************************
**************************************************************************
** **
** OBJECT TYPES AND SUBTYPES **
** **
**************************************************************************
**************************************************************************/
/*
* Basic object types
*/
typedef enum
{
AB_TYPE_UNDEF = 0,
AB_TYPE_ACTION,
AB_TYPE_ACTION_LIST,
AB_TYPE_BASE_WINDOW,
AB_TYPE_BUTTON,
AB_TYPE_CHOICE,
AB_TYPE_COMBO_BOX,
AB_TYPE_CONTAINER,
AB_TYPE_DIALOG,
AB_TYPE_DRAWING_AREA,
AB_TYPE_FILE, /*generic file, usually, a file in a proj*/
AB_TYPE_MODULE,
AB_TYPE_ITEM, /* item in a list, menu, or choice */
AB_TYPE_LABEL, /* static text */
AB_TYPE_LAYERS,
AB_TYPE_LIST,
AB_TYPE_MENU,
AB_TYPE_PROJECT,
AB_TYPE_SEPARATOR,
AB_TYPE_SPIN_BOX,
AB_TYPE_SCALE,
AB_TYPE_TERM_PANE,
AB_TYPE_TEXT_FIELD,
AB_TYPE_TEXT_PANE,
AB_TYPE_UNKNOWN,
AB_TYPE_FILE_CHOOSER,
AB_TYPE_MESSAGE,
AB_OBJECT_TYPE_NUM_VALUES /* number of valid values (MUST BE LAST!) */
} AB_OBJECT_TYPE;
#define AB_TYPE_INTERFACE AB_TYPE_MODULE /* INTERFACE WILL GO AWAY */
/*
* Compound object sub-types
*/
typedef enum
{
AB_COMP_UNDEF = 0,
AB_COMP_FILE_CHOOSER,
AB_COMP_MESSAGE,
AB_COMPOUND_TYPE_NUM_VALUES /* must be last! */
} AB_COMPOUND_TYPE;
/*
* Container subtypes
*/
typedef enum
{
AB_CONT_UNDEF = 0,
AB_CONT_ABSOLUTE,
AB_CONT_BUTTON_PANEL,
AB_CONT_FOOTER,
AB_CONT_GROUP,
AB_CONT_MAIN_WINDOW,
AB_CONT_MENU_BAR,
AB_CONT_PANED,
AB_CONT_RELATIVE,
AB_CONT_SCROLLED_WINDOW,
AB_CONT_ROW_COLUMN,
AB_CONT_TOOL_BAR,
AB_CONTAINER_TYPE_NUM_VALUES /* must be last! */
} AB_CONTAINER_TYPE;
typedef enum
{
AB_DLG_UNDEF = 0,
AB_DLG_BUILTIN,
AB_DLG_CUSTOM,
AB_DIALOG_TYPE_NUM_VALUES /* must be last! */
} AB_DIALOG_TYPE;
/*
* Button subtypes.
*/
typedef enum
{
AB_BUT_UNDEF = 0,
AB_BUT_PUSH,
AB_BUT_DRAWN,
AB_BUT_MENU,
AB_BUTTON_TYPE_NUM_VALUES /* must be last! */
} AB_BUTTON_TYPE;
/*
* subtype for: ITEM
*/
typedef enum
{
AB_ITEM_FOR_UNDEF = 0,
AB_ITEM_FOR_CHOICE,
AB_ITEM_FOR_COMBO_BOX,
AB_ITEM_FOR_LIST,
AB_ITEM_FOR_MENU,
AB_ITEM_FOR_MENUBAR,
AB_ITEM_FOR_SPIN_BOX,
AB_ITEM_TYPE_NUM_VALUES /* must be last */
} AB_ITEM_TYPE;
/*
* Menu types.
*/
typedef enum
{
AB_MENU_UNDEF = 0,
AB_MENU_PULLDOWN,
AB_MENU_POPUP,
AB_MENU_OPTION,
AB_MENU_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_MENU_TYPE;
/*
* Setting types.
*/
typedef enum
{
AB_CHOICE_UNDEF = 0,
AB_CHOICE_EXCLUSIVE,
AB_CHOICE_NONEXCLUSIVE,
AB_CHOICE_OPTION_MENU,
AB_CHOICE_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_CHOICE_TYPE;
typedef enum
{
AB_SELECT_UNDEF = 0,
AB_SELECT_SINGLE,
AB_SELECT_BROWSE,
AB_SELECT_MULTIPLE,
AB_SELECT_BROWSE_MULTIPLE,
AB_SELECT_TYPE_NUM_VALUES
/* ANSI: no comma after last enum item! */
} AB_SELECT_TYPE;
/*
* subtype for: TEXT_FIELD, TEXT_PANE, SPIN_BOX
*/
typedef enum
{
AB_TEXT_UNDEF = 0,
AB_TEXT_ALPHANUMERIC,
AB_TEXT_NUMERIC,
AB_TEXT_DEFINED_STRING,
AB_TEXT_TYPE_NUM_VALUES /* must be last! */
} AB_TEXT_TYPE;
/*
* Label subtypes.
*/
typedef enum
{
AB_LABEL_UNDEF = 0,
AB_LABEL_ARROW_DOWN,
AB_LABEL_ARROW_LEFT,
AB_LABEL_ARROW_RIGHT,
AB_LABEL_ARROW_UP,
AB_LABEL_DRAWN,
AB_LABEL_GLYPH,
AB_LABEL_STRING,
AB_LABEL_SEPARATOR,
AB_LABEL_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
} AB_LABEL_TYPE;
typedef enum
{
AB_STYLE_UNDEF = 0,
AB_STYLE_NORMAL,
AB_STYLE_BOLD,
AB_STYLE_3D,
AB_LABEL_STYLE_NUM_VALUES /* must be last */
} AB_LABEL_STYLE;
/*
* Arrow styles for SpinBox
*/
typedef enum
{
AB_ARROW_UNDEF = 0,
AB_ARROW_FLAT_BEGIN,
AB_ARROW_FLAT_END,
AB_ARROW_BEGIN,
AB_ARROW_END,
AB_ARROW_SPLIT,
AB_ARROW_STYLE_NUM_VALUES /* must be last */
} AB_ARROW_STYLE;
#define ab_label_is_arrow(lt) \
((lt) == AB_LABEL_ARROW_DOWN || \
(lt) == AB_LABEL_ARROW_UP || \
(lt) == AB_LABEL_ARROW_RIGHT || \
(lt) == AB_LABEL_ARROW_LEFT )
/*
* Scale subtypes.
*/
typedef enum
{
AB_SCALE_UNDEF = 0,
AB_SCALE_SCALE,
AB_SCALE_GAUGE,
AB_SCALE_NUM_VALUES /* must be last! */
} AB_SCALE_TYPE;
/*
* File type masks for the File Chooser
*/
typedef enum
{
AB_FILE_TYPE_MASK_UNDEF = 0,
AB_FILE_REGULAR,
AB_FILE_DIRECTORY,
AB_FILE_ANY,
AB_FILE_TYPE_MASK_NUM_VALUES /* must be last! */
} AB_FILE_TYPE_MASK;
/*
* Message Box types
*/
typedef enum
{
AB_MSG_UNDEF = 0,
AB_MSG_ERROR,
AB_MSG_INFORMATION,
AB_MSG_QUESTION,
AB_MSG_WARNING,
AB_MSG_WORKING,
AB_MSG_TYPE_NUM_VALUES /* must be last! */
} AB_MESSAGE_TYPE;
/*
* Default Button.
*/
typedef enum
{
AB_DEFAULT_BTN_UNDEF = 0,
AB_DEFAULT_BTN_ACTION1,
AB_DEFAULT_BTN_ACTION2,
AB_DEFAULT_BTN_ACTION3,
AB_DEFAULT_BTN_CANCEL,
AB_DEFAULT_BTN_NONE,
AB_DEFAULT_BTN_NUM_VALUES /* must be last! */
} AB_DEFAULT_BUTTON;
/*************************************************************************
** **
** Type converters **
** **
**************************************************************************/
AB_ARG_TYPE util_string_to_arg_type(
STRING arg_type
);
STRING util_arg_type_to_string(
AB_ARG_TYPE arg_type
);
AB_ARG_CLASS util_string_to_arg_class(
STRING arg_class_string
);
STRING util_arg_class_to_string(
AB_ARG_CLASS arg_class
);
AB_ARG_CLASS_FLAGS util_arg_class_to_flag(
AB_ARG_CLASS arg_class
);
AB_ARG_CLASS util_flag_to_arg_class(
AB_ARG_CLASS_FLAGS arg_flag
);
AB_LABEL_TYPE util_string_to_label_type(
STRING label_type
);
STRING util_label_type_to_string(
AB_LABEL_TYPE label_type
);
AB_OBJECT_STATE util_string_to_object_state(
STRING state
);
STRING util_object_state_to_string(
AB_OBJECT_STATE state
);
AB_OBJECT_TYPE util_string_to_object_type(
STRING type
);
STRING util_object_type_to_string(
AB_OBJECT_TYPE type
);
AB_ORIENTATION util_string_to_orientation(
STRING orientation
);
STRING util_orientation_to_string(
AB_ORIENTATION orientation
);
AB_MENU_TYPE util_string_to_menu_type(
STRING menu_type
);
STRING util_menu_type_to_string(
AB_MENU_TYPE menu_type
);
AB_BUTTON_TYPE util_string_to_button_type(
STRING button_type
);
STRING util_button_type_to_string(
AB_BUTTON_TYPE button_type
);
AB_ALIGNMENT util_string_to_alignment(
STRING alignment
);
STRING util_alignment_to_string(
AB_ALIGNMENT alignment
);
AB_GROUP_TYPE util_string_to_group_type(
STRING group_type
);
STRING util_group_type_to_string(
AB_GROUP_TYPE group_type
);
AB_CHOICE_TYPE util_string_to_choice_type(
STRING choice_type
);
STRING util_choice_type_to_string(
AB_CHOICE_TYPE choice_type
);
AB_TEXT_TYPE util_string_to_text_type(
STRING text_type
);
STRING util_text_type_to_string(
AB_TEXT_TYPE text_type
);
AB_BUILTIN_ACTION util_string_to_builtin_action(
STRING action
);
STRING util_builtin_action_to_string(
AB_BUILTIN_ACTION action
);
AB_WHEN util_string_to_when(
STRING when
);
STRING util_when_to_string(
AB_WHEN when
);
STRING util_object_type_to_browser_string(
AB_OBJECT_TYPE type
);
AB_OBJECT_TYPE util_browser_string_to_object_type(
STRING string_type
);
AB_CONTAINER_TYPE util_string_to_container_type(
STRING container_string
);
STRING util_container_type_to_string(
AB_CONTAINER_TYPE type
);
AB_ITEM_TYPE util_string_to_item_type(
STRING item_string
);
STRING util_item_type_to_string(
AB_ITEM_TYPE type
);
#endif /* _AB_UTIL_TYPES_H */

View File

@@ -0,0 +1,77 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: AB.h /main/4 1995/11/06 18:48:43 rswiston $
*
* @(#)AB.h 1.1 11 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABUTIL_AB_H_
#define _ABUTIL_AB_H_
/*
* <ab_private/AB.h>
*
* This file should be included by ALL app builder source files!
* And it should be included before any other ab include files
* ( <ab_private/x.h>, <ab/x.h>, "x.h" ).
*
* It sets DEBUG parameters, and affects the entire product
*/
/*
* Turn on POSIX compliance. This mostly affect system header files.
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1
#endif
/*
* Set the DEBUG compile-time parameter to be exactly the opposite of
* NDEBUG
*/
#ifndef NDEBUG
#ifndef DEBUG
#define DEBUG 1
#endif
#else
#undef DEBUG
#endif
#endif /* _ABUTIL_AB_H_ */

View File

@@ -0,0 +1,62 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: MwmUtil.h /main/4 1995/11/06 18:49:29 rswiston $
*
* @(#)MwmUtil.h 1.4 01 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _AB_MWMUTIL_H_
#define _AB_MWMUTIL_H_
/*
* MwmUtil.h - include X library header files, while adding necessary
* defines for app builder programs.
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <Xm/MwmUtil.h>
/*
* Make sure we don't redefine types defined in standard X include files
*/
#define _AB_BOOL_DEFINED_
#define _AB_BYTE_DEFINED_
#endif /* _AB_MWMUTIL_H_ */

View File

@@ -0,0 +1,43 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/* $XConsortium: UilDef.h /main/2 1995/07/15 22:31:34 drk $ */
#ifndef _AB_UILDEF_H_
#define _AB_UILDEF_H_
/*
* UilDef.h - include standard header files, adding symbols for AB
* files.
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <uil/UilDef.h>
/*
* Make sure we don't redefine types defined in standard X include files
*/
#define _AB_BOOL_DEFINED_
#define _AB_BYTE_DEFINED_
#endif /* _AB_UILDEF_H_ */

View File

@@ -0,0 +1,62 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: XmAll.h /main/4 1995/11/06 18:49:40 rswiston $
*
* @(#)XmAll.h 1.5 01 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _AB_XMALL_H_
#define _AB_XMALL_H_
/*
* XmAll.h - include standard header files, adding symbols for AB
* files.
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <Xm/XmAll.h>
/*
* Make sure we don't redefine types defined in standard X include files
*/
#define _AB_BOOL_DEFINED_
#define _AB_BYTE_DEFINED_
#endif /* _AB_XMALL_H_ */

View File

@@ -0,0 +1,104 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: ab.h /main/3 1995/11/06 17:12:23 rswiston $
*
* @(#)ab.h 1.49 94/07/31 Copyright 1993 Sun Microsystems
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* ab.h
*/
#ifndef _AB_H_
#define _AB_H_
#include <Xm/Xm.h>
#include <nl_types.h> /* Necessary for message I18N */
#include <ab_private/obj.h>
#include <ab_private/vwr.h>
#include <ab_private/ab_utils.h>
#include <Dt/Dt.h> /* for version information */
#define MODE_BUILD 1
#define MODE_TEST_SHOWN 2
#define MODE_TEST_PROJ 3
/*
* Determine the version string
*/
#ifdef SDtVERSION_STRING
#define AbVERSION_STRING SDtVERSION_STRING
#elif defined DtVERSION_STRING
#define AbVERSION_STRING DtVERSION_STRING
#else
#define AbVERSION_STRING "CDE Version Unknown"
#endif
extern ABObj AB_project;
extern ABObj AB_cur_module;
extern int AB_builder_mode;
extern Widget AB_toplevel;
extern Widget AB_cgen_win;
extern Widget AB_proj_window;
extern Widget AB_generic_chooser;
extern Widget AB_appfw_dialog;
extern Widget AB_attch_ed_dialog;
extern Widget AB_cgen_env_dialog;
extern Widget AB_cgen_prop_dialog;
extern Widget AB_conn_dialog;
extern Widget AB_dnd_dialog;
extern Widget AB_help_dialog;
extern Widget AB_layout_dialog;
extern Widget AB_msgEd_dialog;
extern Widget AB_rev_prop_dialog;
extern Vwr Proj_viewer;
extern XrmDatabase AB_db;
extern Boolean AB_btn1_transfer;
extern int AB_BMenu;
/* Needed for message I18N */
extern nl_catd Dtb_project_catd;
#endif /* _AB_H_ */

View File

@@ -0,0 +1,107 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: ab_bil.h /main/3 1995/11/06 17:12:53 rswiston $
*
* @(#)ab_bil.h 1.13 02 Apr 1995
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* File: ab_bil.h
*/
#ifndef _ab_ab_bil_h
#define _ab_ab_bil_h
#include <ab_private/obj.h>
/* Defines for data types returned by DtDtsBufferToDataType()
* and DtDtsFileToDataType().
*/
#define BIL "BIL"
#define BIP "BIP"
#define BIX "BIX"
/* Loads entire project. Sets/replaces current project.
*/
int ab_load_bil_file(
STRING fileName,
FILE *inFile,
BOOL BufferDrop
);
/* Loads one bil file, containing one or more modules, into
* the current project.
*/
int ab_import_bil_file(
STRING fileName,
FILE *inFile,
BOOL import_by_ref
);
/* Calls ab_load_bil_file(). Called by the File->Open Project
* callback and the Project->Open callback. Also called when
* a project is loaded from the command-line.
*/
int ab_check_and_open_bip(
STRING fileName
);
/* Calls ab_import_bil_file(). Called by the File->Import->Module
* callback and the Module->Import callback. Also called when
* a project or module is loaded from the command-line.
*/
int ab_check_and_import_bil(
STRING fileName,
BOOL ImportByCopy
);
int ab_load_project(
STRING fileName,
FILE *inFile,
BOOL BufferDrop
);
int ab_import_module(
STRING fileName,
FILE *inFile,
BOOL ImportByCopy
);
#endif /* _ab_ab_bil_h */

View File

@@ -0,0 +1,58 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: ab_dnd.h /main/3 1995/11/06 17:13:18 rswiston $
*
* %W% %G% cde_app_builder/src/
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* ab_dnd.h
* Declarations for drag and drop functions in the app builder.
*/
#ifndef _ab_dnd_h
#define _ab_dnd_h
extern void ab_dnd_register_drop_file(
Widget dropFile
);
extern void ab_dnd_unregister_drop(
Widget dropFile
);
#endif /* _ab_dnd_h */

View File

@@ -0,0 +1,44 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: ab_resources.h /main/3 1995/11/06 17:13:44 rswiston $
*
* @(#)ab_resources.h 1.1 27 Jun 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#define AB_XRM_CUR_PROJECT "Dtbuilder.currentProject"
#define AB_XRM_SHOWN_MODULES "Dtbuilder.shownModules"

View File

@@ -0,0 +1,166 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: ab_utils.h /main/3 1995/11/06 17:14:16 rswiston $
*
* @(#)ab_utils.h 1.10 95/03/09 Copyright 1993 Sun Microsystems
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* ab_utils.h
*/
#ifndef _AB_UTILS_H_
#define _AB_UTILS_H_
#include <ab_private/abio.h>
#define InTestMode AB_builder_mode == MODE_TEST_SHOWN || \
AB_builder_mode == MODE_TEST_PROJ
#define InBuildMode AB_builder_mode == MODE_BUILD
/* To implement dtbuilder window protocol */
#define WindowHidden 0x0000
#define WindowUp 0x0001
#define WindowIconified 0x0002
typedef enum
{
AB_WIN_LEADER,
AB_WIN_WINDOW,
AB_WIN_DIALOG,
AB_WIN_MODAL,
AB_WIN_TYPE_NUM_VALUES
} AB_WIN_TYPE;
typedef enum
{
AB_WPOS_UNSPECIFIED,
AB_WPOS_TILE_ABOVE,
AB_WPOS_TILE_BELOW,
AB_WPOS_TILE_HORIZONTAL,
AB_WPOS_TILE_LEFT,
AB_WPOS_TILE_RIGHT,
AB_WPOS_TILE_VERTICAL,
AB_WPOS_STACK_DIAGONAL,
AB_WPOS_STACK_CENTER,
AB_WPOS_TYPE_NUM_VALUES
} AB_WPOS_TYPE;
typedef enum
{
AB_STATUS_OBJ_TYPE,
AB_STATUS_OBJ_NAME,
AB_STATUS_OBJ_POS,
AB_STATUS_OBJ_SIZE,
AB_STATUS_CURS_POS,
AB_STATUS_CUR_MODULE,
AB_STATUS_NUM_VALUES /* number of valid values - MUST BE
LAST */
/* ANSI: no comma after last enum item! */
} AB_STATUS_INFO;
typedef struct AB_WINDOW {
Widget widget;
AB_WIN_TYPE type;
unsigned long state;
struct AB_WINDOW *next;
} ABWindow;
extern void ab_register_window(
Widget widget,
AB_WIN_TYPE type,
unsigned long init_state,
Widget init_pos_ref_win,
AB_WPOS_TYPE init_pos_type,
XtCallbackProc close_callback,
XtPointer close_clientdata
);
extern void ab_show_window(
Widget widget
);
extern void ab_takedown_windows(void);
extern void ab_putback_windows(void);
extern BOOL ab_window_leader_iconified(void);
extern BOOL ab_window_is_open(
Widget widget
);
extern void ab_position_window(
Widget widget,
Widget ref_widget,
AB_WPOS_TYPE pos_type
);
extern BOOL ab_is_cur_dir(
STRING dir
);
extern int ab_change_dir(
STRING new_dir
);
extern STRING ab_get_cur_dir(void);
extern int ab_cvt_image_file_to_pixmap(
Widget widget,
STRING file_name,
Pixmap *pixmap_out
);
extern int ab_post_instantiate(
ABObj obj
);
extern int ab_update_stat_region(
AB_STATUS_INFO type,
String valuestring
);
extern void ab_set_busy_cursor(
BOOL on
);
extern void ab_palette_set_active(
BOOL active
);
extern void ab_exit_dtbuilder(void);
#endif /* _AB_UTILS_H_ */

View File

@@ -0,0 +1,417 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abio.h /main/5 1995/11/06 18:50:10 rswiston $
*
* @(#)abio.h 1.21 11 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* abio.h
*
* GUIDE Intermediate Language (GIL) file input / output interface.
*/
#ifndef _abio_h
#define _abio_h
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <stdio.h>
#include <ab_private/AB.h>
#include <ab_private/istr.h>
#include <ab/util_types.h>
/*
* Public functions.
*/
/*
* Indentation control
*/
int abio_indent(FILE *text_file);
int abio_outdent(FILE *text_file);
int abio_set_indent(FILE *text_file, int level);
int abio_get_indent(FILE *text_file);
int abio_set_indent_char(FILE *text_file, int indent_char);
int abio_get_indent_char(FILE *text_file);
int abio_set_indent_chars_per_level(FILE *text_file, int chars_per_level);
int abio_get_indent_chars_per_level(FILE *text_file);
int abio_close_input(FILE *outFile);
int abio_close_output(FILE *outFile);
int abio_access_file(
STRING name,
BOOL *read_OK,
BOOL *write_OK
);
STRING abio_comment_string(void);
STRING abio_module_string(void);
STRING abio_project_string(void);
int abio_get_eof(FILE *inFile);
int abio_get_file_begin(FILE *inFile);
int abio_get_file_end(FILE *inFile);
int abio_get_handler(
FILE *inFile,
ISTRING *stringOut
);
int abio_get_integer(
FILE *inFile,
int *i
);
int abio_get_keyword(
FILE *inFile,
ISTRING *stringOut
);
int abio_get_list(
FILE *inFile,
ISTRING *stringOut
);
int abio_get_list_begin(FILE *inFile);
int abio_get_list_end(FILE *inFile);
int abio_gil_get_full_name(
FILE *inFile,
ISTRING *interfaceOut,
ISTRING *parentOut,
ISTRING *nameOut,
ISTRING *itemOut
);
int abio_gil_get_object_begin(FILE *inFile);
int abio_gil_get_object_end(FILE *inFile);
int abio_get_string(
FILE *inFile,
ISTRING *stringOut
);
int abio_get_string_begin(FILE *inFile);
int abio_get_string_end(FILE *inFile);
STRING abio_integer_string(
int i
);
STRING abio_keyword_string(
STRING s
);
STRING abio_list_begin_string(void);
STRING abio_list_end_string(void);
STRING abio_name_string(
STRING s
);
STRING abio_gil_object_begin_string(void);
STRING abio_gil_object_end_string(void);
STRING abio_open_output(
STRING name,
FILE **pOutFile
);
STRING abio_open_gil_input(
STRING name,
FILE **pInFile
);
STRING abio_open_gil_output(
STRING outFileName,
FILE **pOutFile
);
int abio_open_bil_output(
STRING outfile,
STRING old_file,
FILE **pOutFile
);
STRING abio_open_proj_input(
STRING name,
FILE **pInFile
);
STRING abio_open_proj_output(
STRING name,
FILE **pOutFile
);
STRING abio_open_resfile_input(
STRING name,
FILE **pInFile
);
int
abio_printf(
FILE * outFile,
STRING fmt,...
);
int
abio_print_line(
FILE * outFile,
STRING fmt,...
);
int abio_putc(
FILE *outFile,
char c
);
int abio_puts(
FILE *outFile,
STRING s
);
int abio_put_float(
FILE *outFile,
double d
);
int abio_put_integer(
FILE *outFile,
int i
);
int abio_put_keyword(
FILE *outFile,
AB_OBJECT_TYPE abo_type
);
int abio_put_keyword_name(
FILE *outFile,
STRING name
);
int abio_put_handler(
FILE *outFile,
STRING s
);
int abio_put_full_name(
FILE *outFile,
STRING parent,
STRING name,
STRING item
);
int abio_put_proj_full_name(
FILE *outFile,
STRING itf,
STRING parent,
STRING name,
STRING item
);
int abio_put_string(
FILE *outFile,
STRING s
);
int abio_put_string_to_file(
FILE *outFile,
STRING s
);
int abio_put_string_to_buffer(
STRING string,
STRING outBuf,
int size
);
STRING abio_string_begin_string(void);
STRING abio_string_end_string(void);
STRING abio_string_string(
STRING
);
int abio_open_block(FILE *outFile);
int abio_close_block(FILE *outFile);
int abio_expand_path(
STRING path
);
int abio_expand_file(
char *file,
char *exp_file
);
/*
* BIL functions
*/
int abio_expand_bil_proj_path(
STRING path
);
int abio_expand_bil_module_path(
STRING path
);
int abio_expand_bil_encapsulated_path(
STRING path
);
STRING abio_open_bil_input(
STRING fileName,
int *linesRead,
FILE **pInFile
);
float abio_get_bil_version(
FILE * fp,
int *pLinesRead
);
STRING abio_bil_object_begin_string(void);
STRING abio_bil_object_end_string(void);
STRING abio_bil_boolean_string(
BOOL value
);
STRING abio_bil_true_string(void);
STRING abio_bil_false_string(void);
int abio_bil_get_boolean(
FILE *inFile,
BOOL *valueOut
);
int abio_bil_put_boolean(
FILE *outFile,
BOOL value
);
STRING abio_check_bil_version(
float ver,
STRING name
);
/*
* GIL functions
*/
int abio_is_gil_path(
STRING path
);
int abio_gil_expand_path(
STRING path
);
int abio_gil_expand_proj_path(
STRING path
);
int abio_is_gil_proj_path(
STRING path
);
int abio_gil_put_name(
FILE *outFile,
STRING s
);
int abio_gil_get_name(
FILE *inFile,
ISTRING *stringOut
);
STRING abio_gil_boolean_string(
BOOL value
);
STRING abio_gil_true_string(void);
STRING abio_gil_false_string(void);
int abio_gil_get_boolean(
FILE *inFile,
BOOL *valueOut
);
int abio_gil_put_boolean(
FILE *outFile,
BOOL value
);
/*****************************************************************
** **
** Inline implementation **
** **
*****************************************************************/
#define abio_close_input(fp) (abio_close_input_impl(&(fp)))
int abio_close_input_impl(FILE **pFp);
#define abio_close_output(fp) (abio_close_output_impl(&(fp)))
int abio_close_output_impl(FILE **pFp);
#endif /* _abio_h */

View File

@@ -0,0 +1,85 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abmf.h /main/3 1995/11/06 18:01:36 rswiston $
*
* @(#)abmf.h 1.3 15 Jul 1994 cde_app_builder/src/abmf
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* abmf.h - public entry points to the code generator
*/
#ifndef _ABMF_ABMF_H_
#define _ABMF_ABMF_H_
#include <ab_private/obj.h>
typedef enum
{
ABMF_I18N_UNDEF= 0,
ABMF_I18N_NONE, /* no i18n */
ABMF_I18N_XPG4_API, /* generated code conforms to
* XPG4 API
*/
ABMF_I18N_METHOD_NUM_VALUES /* must be last */
} ABMF_I18N_METHOD;
typedef enum
{
ABMF_CGEN_UNDEF,
ABMF_CGEN_ALL,
ABMF_CGEN_BY_DATE,
ABMF_CGEN_BY_DATE_AND_CONTENTS,
ABMF_CGEN_RESTRICTION_NUM_VALUES /* must be last */
} ABMF_CGEN_RESTRICTION;
/*
* "dumped" resources are written to a resource file, rather than a C file
*/
int abmf_generate_code(
ABObj project,
ABMF_CGEN_RESTRICTION restriction,
BOOL merge_files,
ABMF_I18N_METHOD i18nMethod,
BOOL prototype_functions,
AB_ARG_CLASS_FLAGS dumped_resources
);
#endif /* _ABMF_ABMF_H_ */

View File

@@ -0,0 +1,480 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abobj.h /main/3 1995/11/06 17:14:34 rswiston $
*
* @(#)abobj.h 1.27 15 Feb 1994 cde_app_builder/src/ab
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABOBJ_H_
#define _ABOBJ_H_
/*
* abobj.h - AB object manipulation functions
*/
#include <X11/Intrinsic.h>
#include <ab_private/objxm.h>
#include "dtb_utils.h"
/*
* Flags to control ABObj Edit Menu state
*/
#define ABMenuNone 0x0000
#define ABMenuProps 0x0001
#define ABMenuUndo 0x0002
#define ABMenuCut 0x0004
#define ABMenuCopy 0x0008
#define ABMenuPaste 0x0010
#define ABMenuDelete 0x0020
#define ABMenuAlign 0x0040
#define ABMenuDistribute 0x0080
#define ABMenuGroup 0x0100
#define ABMenuUngroup 0x0200
#define ABMenuNextLayer 0x0400
#define ABMenuBrowse 0x0800
#define ABMenuAttach 0x1000
#define ABMenuPane 0x2000
#define ABMenuUnpane 0x4000
#define ABMenuExpand 0x8000
#define ABMenuExpandAll 0x10000
#define ABMenuCollapse 0x20000
#define ABMenuTearOff 0x40000
/*
* Two Types of Object Edit Menus: Browser & WindowObj
*/
typedef enum
{
WIN_EDIT_MENU,
BROWSER_EDIT_MENU,
EDIT_MENU_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} EDIT_MENU_TYPE;
/*
* Selected Object storage
*/
typedef struct _AB_SELECTED_REC
{
ABObj *list;
int count;
} ABSelectedRec;
/*
* EVENT-HANDLING for AB objects
*/
extern void abobj_register_build_actions(
XtAppContext app
);
extern int abobj_tree_set_build_actions(
ABObj root
);
/*
* Instantiate/Show/Hide/Propogate an AB object hierarchy
*/
extern int abobj_instantiate_tree(
ABObj root,
BOOL manage_last
);
extern int abobj_show_tree(
ABObj root,
BOOL manage_last
);
extern int abobj_hide_tree(
ABObj root
);
/*
* SELECT AB object functions
*/
extern void abobj_select(
ABObj obj
);
extern void abobj_deselect(
ABObj obj
);
extern void abobj_deselect_all(
ABObj root
);
extern int abobj_get_selected(
/* NOTE: caller must free the memory for sel->list! */
ABObj root,
BOOL include_root,
BOOL include_items,
ABSelectedRec *sel
);
extern void abobj_sort_sel_list(
ABObj *sel_list,
int sel_count,
int sort);
extern void abobj_group_selected_objects(
);
extern void abobj_ungroup_selected_objects(
);
extern void abobj_layout_group(
ABObj obj,
BOOL init
);
extern void abobj_register_group_expose_handler(
ABObj obj
);
extern void abobj_make_panedwin(
);
extern void abobj_unmake_panedwin(
);
/*
* MOVE AB object functions
*/
extern int abobj_move(
ABObj obj,
XEvent *event
);
extern void abobj_move_selected(
ABObj *sel_list,
int sel_count,
XRectangle *start,
XRectangle *stop
);
extern void abobj_nudge_selected(
ABObj *sel_list,
int sel_count,
short x_delta,
short y_delta,
BOOL reselect
);
extern BOOL abobj_is_movable(
ABObj obj
);
/*
* ALIGN AB object functions
*/
extern void abobj_align(
unsigned long align_mask
);
/*
* RESIZE AB object functions
*/
extern int abobj_resize(
ABObj obj,
XEvent *event
);
extern BOOL abobj_is_directly_resizable(
ABObj obj
);
extern BOOL abobj_width_resizable(
ABObj obj
);
extern BOOL abobj_height_resizable(
ABObj obj
);
/*
* LAYOUT AB object functions
*/
extern int abobj_layout_changed(
ABObj obj
);
extern int abobj_calculate_new_layout(
ABObj obj,
int new_x,
int new_y,
Dimension new_width,
Dimension new_height
);
extern void abobj_sort_children(
ABObj obj,
int sort);
extern void abobj_clear_layout(
ABObj obj,
BOOL clear_children,
BOOL init_attachments
);
extern ABObj abobj_handle_layered_pane(
ABObj newobj,
ABObj pane
);
extern int abobj_init_pane_position(
ABObj pane
);
extern int abobj_layer_show_next(
ABObj layer
);
extern void abobj_layer_set_size(
ABObj layer,
int new_width,
int new_height
);
extern int abobj_layer_manage_visible(
ABObj layer
);
/*
* Functions to duplicate an ABObj tree for the clipboard
*/
extern ABObj abobj_dup(
ABObj obj
);
extern ABObj abobj_dup_tree(
ABObj obj
);
/*
* POPUP-MENU AB object functions
*/
/* Handles Caching Menus */
extern void abobj_popup_menu(
EDIT_MENU_TYPE mtype,
Widget origin,
ABSelectedRec *target,
XButtonEvent *event
);
/* Creates/Destroys Menu each time */
extern void abobj_menu(
Widget origin,
ABSelectedRec *target,
XButtonEvent *event
);
/*
* Miscellaneous AB object utilities
*/
extern int abobj_comp_rename(
ABObj obj,
STRING oldname,
STRING newname
);
extern int abobj_get_value_x(
ABObj obj
);
extern int abobj_get_actual_width(
ABObj obj
);
extern int abobj_get_actual_height(
ABObj obj
);
extern int abobj_get_comp_width(
ABObj obj
);
extern int abobj_get_comp_height(
ABObj obj
);
extern int abobj_get_x(
ABObj obj
);
extern int abobj_get_y(
ABObj obj
);
extern int abobj_get_actual_x(
ABObj obj
);
extern int abobj_get_actual_y(
ABObj obj
);
extern int abobj_get_comp_x(
ABObj obj
);
extern int abobj_get_comp_y(
ABObj obj
);
extern int abobj_get_label_width(
ABObj obj
);
extern void abobj_get_rect_for_objects(
ABObj *list,
int count,
XRectangle *j_rect
);
extern void abobj_get_greatest_size(
ABObj *list,
int count,
int *width,
int *height,
ABObj *tallest_obj,
ABObj *widest_obj
);
extern BOOL abobj_has_attached_label(
ABObj obj
);
/* Given an obj, return a module-format name:
* "modulename :: objname"
* NOTE: it is up to caller to free memory allocated
* by this function
*/
extern STRING abobj_get_moduled_name(
ABObj obj
);
/* Give a module-name & an obj-name, return in format:
* "modulename :: objname"
* NOTE: the caller must free the memory allocated
* by this function
*/
extern STRING abobj_alloc_moduled_name(
STRING mod_name,
STRING obj_name
);
/* Given a module-format name "modulename :: objname",
* return the correct 'module' & 'obj' ABobjs
*/
extern int abobj_moduled_name_extract(
STRING m_o_name,
ABObj *module,
ABObj *obj
);
extern int abobj_reset_colors(
ABObj obj,
BOOL reset_bg,
BOOL reset_fg
);
extern void abobj_force_dang_form_resize(
ABObj obj
);
extern int abobj_update_module_name(
ABObj modobj
);
extern int abobj_update_proj_name(
ABObj proj_obj
);
extern int abobj_update_palette_title(
ABObj proj_obj
);
extern void abobj_tree_realize(
ABObj ab_interface,
Bool manage
);
extern int abobj_tree_set_centering_handler(
ABObj root
);
extern DTB_CENTERING_TYPES abobj_get_centering_type(
ABObj obj
);
extern int abobj_build_menus_array(
ABObj root,
ABObj **menus_ptr,
int *menu_count_ptr
);
extern void abobj_build_layout_menu(
Widget menu
);
extern void abobj_set_menu_item_state(
Widget menu
);
extern void abobj_strings_init(
);
extern int abobj_project_name_extract(
STRING app_name,
ABObj *obj
);
/*
* Data
*/
extern int AB_grid_size;
extern const int AB_selected_rect_size;
/*************************************************************************
** **
** INLINE IMPLEMENTATION **
** **
*************************************************************************/
#endif /* _ABOBJ_H_ */

View File

@@ -0,0 +1,184 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abobjP.h /main/3 1995/11/06 17:14:46 rswiston $
*
* @(#)abobjP.h 1.17 15 Feb 1994 cde_app_builder/src/ab
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* abobjP.h -
*/
#ifndef _ABOBJ_P_H_
#define _ABOBJ_P_H_
#if !defined(CSRG_BASED)
#include <values.h>
#endif
#include <ab_private/abobj.h>
#include <ab_private/abobj_set.h>
#ifndef MAXINT
#define MAXINT (0x7FFFFFFF)
#endif /* MAXINT */
#define XSORT (1)
#define YSORT (2)
/*
* Resize directions.
*/
typedef enum {
NONE,
MOVE,
NORTH,
SOUTH,
EAST,
WEST,
NORTH_EAST,
NORTH_WEST,
SOUTH_EAST,
SOUTH_WEST,
RESIZE_DIR_NUM_VALUES
/* ANSI: no comma after last enum item! */
} RESIZE_DIR;
typedef enum {
LEFT_EDGES = (1L << 0),
VCENTERS = (1L << 1),
RIGHT_EDGES = (1L << 2),
LABELS = (1L << 3),
TOP_EDGES = (1L << 4),
HCENTERS = (1L << 5),
BOTTOM_EDGES = (1L << 6),
TO_GRID = (1L << 7),
VSPACING = (1L << 8),
HSPACING = (1L << 9),
FIXEDROWS = (1L << 10),
FIXEDCOLS = (1L << 12),
ROWFIRST = (1L << 13),
COLFIRST = (1L << 14),
HCENTERED = (1L << 15),
VCENTERED = (1L << 16)
/* ANSI: no comma after last enum item! */
} AB_ALIGN_TYPES;
/*
* Translation Table storage
*/
typedef struct _AB_TRANS_TBL
{
WidgetClass wclass;
XtTranslations translations;
} ABTransTbl;
/*
* Object Menu Cache structure
*/
typedef struct _WIN_MENU_CACHE
{
ABObj winobj;
Widget menu;
} WinMenuCache;
/*
* Browser Menu Cache structure
*/
typedef struct _BROWSER_MENU_CACHE
{
Widget brws_widget;
Widget menu;
} BrowserMenuCache;
/*
* EVENT-HANDLING for AB objects
*/
extern void abobjP_enable_build_actions(
ABObj obj,
Widget widget
);
extern void abobjP_disable_build_actions(
ABObj obj,
Widget widget
);
/*
* SELECT AB object functions
*/
/*
* MOVE AB object functions
*/
extern int abobjP_move_object_outline(
ABObj obj,
XMotionEvent *mevent
);
/*
* RESIZE AB object functions
*/
extern Cursor abobjP_get_resize_cursor(
Widget w,
RESIZE_DIR dir
);
extern RESIZE_DIR abobjP_find_resize_direction(
ABObj obj,
Widget w,
XEvent *event
);
extern int abobjP_resize_object_outline(
ABObj obj,
XEvent *event,
RESIZE_DIR dir
);
extern void abobjP_track_external_resizes(
Widget widget,
XtPointer client_data,
XEvent *event,
Boolean cont_to_dispatch
);
#endif /* _ABOBJ_P_H_ */

View File

@@ -0,0 +1,320 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abobj_edit.h /main/3 1995/11/06 17:15:39 rswiston $
*
* @(#)abobj_edit.h 1.1 15 Feb 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABOBJ_EDIT_H_
#define _ABOBJ_EDIT_H_
#include <ab_private/abobj.h>
/*
* Declarations for edit features
*/
/*
* Size of each malloc'd block for clipboard/undo buffer
*/
#define ABOBJ_CLIPBOARD_BLOCK_SIZE 10
#define ABOBJ_UNDO_BLOCK_SIZE 10
/*
* Edit operations
*/
typedef enum
{
AB_EDIT_CUT = 0,
AB_EDIT_COPY,
AB_EDIT_PASTE,
AB_EDIT_DELETE,
AB_EDIT_NUM_VALUES
} AB_EDIT_TYPE;
/*
* Supported actions that can be undone
*/
typedef enum
{
AB_UNDO_NO_TYPE = 0,
AB_UNDO_CUT,
AB_UNDO_DELETE,
AB_UNDO_PASTE,
AB_UNDO_MOVE,
AB_UNDO_RESIZE,
AB_UNDO_GROUP,
AB_UNDO_UNGROUP,
AB_UNDO_NUM_VALUES
} AB_UNDO_TYPE;
/*
** Supported initiator locations of a paste operation
*/
typedef enum
{
AB_PASTE_INITIATOR_NO_TYPE = 0,
AB_PASTE_INITIATOR_OBJ_MENU, /* Object popup menu */
AB_PASTE_INITIATOR_BRWS_MENU, /* Browser popup menu */
AB_PASTE_INITIATOR_BRWS_EDIT_MENU, /* Browser's edit menu */
AB_PASTE_INITIATOR_PAL_EDIT_MENU, /* Palette's edit menu */
AB_PASTE_INITIATOR_NUM_VALUES
} AB_PASTE_INITIATOR_TYPE;
/*
* Data structures for clipboard/undo
* What follows are data structures that are used to store
* ABOBj's and related data for undo and the clipboard.
*
* The two main data structures are:
* AB_CLIPBOARD_REC and
* AB_UNDO_REC
*
* AB_UNDO_REC is a bit complicated because it consists
* of data for cut/delete/paste/move/resize/group/ungroup
* which are all contained in a union.
*/
/*
* Additional info needed for clipboard
*/
typedef struct _AB_CLIPB_INFO
{
ABObj dup_obj; /* duplicated object, not just ptr to */
ABObj action_list; /* duplicated ACTIONS for object and it's descendants */
char *other_stuff; /* placeholder for now, will be filled
* in later */
}AB_CLIPB_INFO, *ABClipbInfo;
/*
* Additional info needed for undoing cut
*/
typedef struct _AB_UNDO_CUT_INFO
{
ABObj dup_obj;
ABObj from_action_list; /* duplicated ACTIONS for object (object == source) */
ABObj to_action_list; /* duplicated ACTIONS for object (object == target) */
ABObj parent; /* POINTER to parent */
ABObj pane_sibling; /* POINTER to sibling - used for layers */
} AB_UNDO_CUT_INFO, *ABUndoCutInfo;
/*
* Additional info needed for undoing move
*/
typedef struct _AB_UNDO_MOVE_INFO
{
int x;
int y;
} AB_UNDO_MOVE_INFO, *ABUndoMoveInfo;
/*
* Additional info needed for undoing resize
*/
typedef struct _AB_UNDO_RESIZE_INFO
{
int width;
int height;
} AB_UNDO_RESIZE_INFO, *ABUndoResizeInfo;
/*
* Additional info needed for undoing ungroup
*/
typedef struct _AB_UNDO_UNGROUP_INFO
{
ABObj dup_old_group; /* DUPLICATE of ungrouped group */
ABObj *member_list; /* List of POINTERS to members */
int member_count;
} AB_UNDO_UNGROUP_INFO, *ABUndoUngroupInfo;
/*
* Union of additional info for undo actions
*/
typedef union _AB_UNDO_EXTRA_INFO
{
AB_UNDO_CUT_INFO cut;
/* undo for cut == undo for delete */
/* don't need special info for undoing paste */
AB_UNDO_MOVE_INFO move;
AB_UNDO_RESIZE_INFO resize;
AB_UNDO_UNGROUP_INFO ungroup;
/* don't need special info for undoing group */
}AB_UNDO_EXTRA_INFO, *ABUndoExtraInfo;
/*
* Info for undoing an action on ONE object
*/
typedef struct _AB_UNDO_INFO
{
AB_UNDO_TYPE type;
AB_UNDO_EXTRA_INFO info;
}AB_UNDO_INFO, *ABUndoInfo;
/*
* Data structure for clipboard
*/
typedef struct _AB_CLIPBOARD_REC{
ABObj *list; /* List of POINTERS to copied/cut objects */
AB_CLIPB_INFO *info_list;
int count;
int action_count;
int size;
} AB_CLIPBOARD_REC, *ABClipboardRec;
/*
* Type for ABUndoFunc
*/
struct _AB_UNDO_REC; /* forward ref for ABUndoFunc */
typedef void AB_UNDO_FUNC(struct _AB_UNDO_REC *undo_rec);
typedef AB_UNDO_FUNC *ABUndoFunc;
/*
* Data structure for undo buffer
*/
typedef struct _AB_UNDO_REC{
ABObj *list;
AB_UNDO_INFO *info_list;
ABUndoFunc undo_func;
int count;
int action_count;
int size;
} AB_UNDO_REC, *ABUndoRec;
/*
* Editing functions
*/
extern void abobj_edit_init(
);
extern int abobj_cut(
);
extern int abobj_copy(
);
extern int abobj_paste(
AB_PASTE_INITIATOR_TYPE initiator
);
extern int abobj_delete(void);
extern int abobj_undo(void);
extern int abobj_cancel_undo(void);
extern BOOL abobj_undo_active(
);
/*
* CLIPBOARD manipulating functions
*/
extern BOOL abobj_clipboard_is_empty(
);
extern BOOL abobj_in_clipboard(
ABObj obj
);
extern void abobj_clipboard_clear(
);
extern void abobj_clipboard_set(
ABObj *obj,
int count
);
extern void abobj_clipboard_add(
ABObj *obj,
int count
);
/*
* Function to set undo buffer
*/
extern int abobj_set_undo(
ABObj *obj,
int count,
ABUndoFunc undo_func,
AB_UNDO_TYPE undo_type
);
extern void abobj_setup_undo_cut_layer(
ABObj layer,
ABObj last_pane
);
/*
* Xt Callbacks for editing functions:
* undo
* cut
* copy
* paste
* delete
*/
extern void abobj_undo_cb(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void abobj_cut_cb(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void abobj_copy_cb(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void abobj_paste_cb(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void abobj_delete_cb(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
#endif /* _ABOBJ_EDIT_H_ */

View File

@@ -0,0 +1,97 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abobj_list.h /main/3 1995/11/06 17:16:36 rswiston $
*
* @(#)abobj_list.h 1.3 22 Jul 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* File: abobj_list.h - keeps a scrolling list of object names
*/
#ifndef _ab_abobj_list_h
#define _ab_abobj_list_h
#include <ab_private/obj_notify.h>
#include <ab_private/abobj.h>
int abobj_list_load(
Widget w,
ABObj root,
ABObjTestFunc show_obj_func
);
int abobj_list_update(
Widget w,
ABObj root,
ABObjTestFunc show_obj_func
);
int abobj_list_obj_created(
Widget list,
ABObj obj,
ABObjTestFunc show_obj_func
);
int abobj_list_obj_renamed(
Widget list,
ABObj obj,
STRING old_name,
ABObjTestFunc show_obj_func
);
int abobj_list_obj_destroyed(
Widget list,
ABObj obj,
ABObjTestFunc show_obj_func
);
int abobj_list_obj_updated(
Widget list,
ObjEvUpdateInfo update_info,
ABObjTestFunc show_obj_func
);
int abobj_list_obj_reparented(
Widget list,
ObjEvReparentInfo info,
ABObjTestFunc list_obj_test
);
#endif /* _ab_abobj_list_h */

View File

@@ -0,0 +1,427 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abobj_set.h /main/3 1995/11/06 17:17:42 rswiston $
*
* @(#)abobj_set.h 1.53 02 Feb 1995
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* abobj_set.h
*/
#ifndef _ABOBJ_SET_H_
#define _ABOBJ_SET_H_
#include <ab_private/obj.h>
/*
* Routines to instantiate attribute changes in the Motif
* instance of the objects
*/
extern void abobj_instantiate_changes(
ABObj obj
);
extern void abobj_tree_instantiate_changes(
ABObj root
);
/*
* Routines to set attribute changes in objects
*/
extern void abobj_set_accelerator(
ABObj obj,
STRING accel
);
extern void abobj_set_background_color(
ABObj obj,
STRING colorname
);
extern void abobj_set_choice_type(
ABObj obj,
AB_CHOICE_TYPE type
);
extern void abobj_set_direction(
ABObj obj,
AB_DIRECTION dir
);
extern void abobj_set_drawarea_size(
ABObj obj,
int width,
int height
);
extern void abobj_set_foreground_color(
ABObj obj,
STRING colorname
);
extern void abobj_set_icon(
ABObj obj,
STRING icon,
STRING icon_mask,
STRING icon_label
);
extern void abobj_set_initial_state(
ABObj obj,
AB_OBJECT_STATE istate
);
extern void abobj_set_initial_value(
ABObj obj,
STRING strval,
int intval
);
extern void abobj_set_label(
ABObj obj,
AB_LABEL_TYPE label_type,
STRING label
);
extern void abobj_set_label_alignment(
ABObj obj,
AB_ALIGNMENT align
);
extern void abobj_set_label_position(
ABObj obj,
AB_COMPASS_POINT pos
);
extern void abobj_set_group_type(
ABObj obj,
AB_GROUP_TYPE group_type
);
extern void abobj_set_row_alignment(
ABObj obj,
AB_ALIGNMENT align
);
extern void abobj_set_col_alignment(
ABObj obj,
AB_ALIGNMENT align
);
extern void abobj_set_row_attach_type(
ABObj obj,
AB_ATTACH_TYPE type
);
extern void abobj_set_col_attach_type(
ABObj obj,
AB_ATTACH_TYPE type
);
extern void abobj_set_row_offset(
ABObj obj,
int offset
);
extern void abobj_set_col_offset(
ABObj obj,
int offset
);
extern void abobj_set_border_frame(
ABObj obj,
AB_LINE_TYPE btype
);
extern void abobj_set_line_style(
ABObj obj,
AB_LINE_TYPE type
);
extern void abobj_set_arrow_style(
ABObj obj,
AB_ARROW_STYLE astyle
);
extern void abobj_set_button_type(
ABObj obj,
AB_BUTTON_TYPE type
);
extern void abobj_set_name(
ABObj obj,
STRING name
);
extern void abobj_set_selection_mode(
ABObj obj,
AB_SELECT_TYPE select
);
extern void abobj_set_show_value(
ABObj obj,
BOOL show_val
);
extern void abobj_set_size_policy(
ABObj obj,
BOOL resizable
);
extern STRING abobj_construct_item_name(
STRING prefix,
STRING namebase,
STRING suffix
);
extern void abobj_set_item_name(
ABObj iobj,
ABObj module,
STRING basename,
STRING label
);
extern void abobj_set_menu_name(
ABObj obj,
STRING menuname
);
extern void abobj_set_menu_title(
ABObj obj,
STRING menu_title
);
extern void abobj_set_mnemonic(
ABObj obj,
STRING mnemonic
);
extern void abobj_set_orientation(
ABObj obj,
AB_ORIENTATION orient
);
extern void abobj_set_num_columns(
ABObj obj,
int num_cols
);
extern void abobj_set_num_rows(
ABObj obj,
int num_rows
);
extern void abobj_set_read_only(
ABObj obj,
BOOL readonly
);
extern void abobj_set_resize_mode(
ABObj obj,
BOOL resizable
);
extern void abobj_set_scrollbar_state(
ABObj obj,
AB_SCROLLBAR_POLICY scrolling
);
extern void abobj_set_pixel_width(
ABObj obj,
int width,
int border_frame_w
);
extern void abobj_set_pixel_height(
ABObj obj,
int height,
int border_frame_w
);
extern void abobj_set_pixel_size(
ABObj obj,
int height,
int width,
int border_frame_w
);
extern void abobj_set_text_size(
ABObj obj,
int height,
int width
);
extern void abobj_set_max_length(
ABObj obj,
int max_len
);
extern void abobj_set_win_parent(
ABObj obj,
ABObj win_parent
);
extern void abobj_set_word_wrap(
ABObj obj,
BOOL wrap
);
extern void abobj_set_xy(
ABObj obj,
int x,
int y
);
extern void abobj_set_active(
ABObj obj,
BOOL active
);
extern void abobj_set_visible(
ABObj obj,
BOOL visible
);
extern void abobj_set_iconic(
ABObj obj,
BOOL iconic
);
extern void abobj_set_selected(
ABObj obj,
BOOL selected
);
extern void abobj_set_tearoff(
ABObj obj,
BOOL tearoff
);
extern void abobj_set_text_type(
ABObj obj,
AB_TEXT_TYPE ttype
);
extern void abobj_set_decimal_points(
ABObj obj,
int dec_points
);
extern void abobj_set_default_act_button(
ABObj obj,
ABObj button
);
extern void abobj_set_help_act_button(
ABObj obj,
ABObj button
);
extern void abobj_set_increment(
ABObj obj,
int incr
);
extern void abobj_set_min_max_values(
ABObj obj,
int min,
int max
);
extern int abobj_set_save_needed(
ABObj obj,
BOOL set
);
extern void abobj_disable_save_needed(
);
extern void abobj_enable_save_needed(
);
extern BOOL abobj_save_needed_enabled(
);
extern void abobj_set_pattern_type(
ABObj obj,
AB_FILE_TYPE_MASK fmtype
);
extern void abobj_set_directory(
ABObj obj,
STRING val
);
extern void abobj_set_filter_pattern(
ABObj obj,
STRING val
);
extern void abobj_set_ok_label(
ABObj obj,
STRING val
);
extern void abobj_set_auto_dismiss(
ABObj obj,
BOOL val
);
extern void abobj_set_sessioning_method(
ABObj proj,
AB_SESSIONING_METHOD ss_mthd
);
extern void abobj_set_pane_min(
ABObj obj,
int value
);
extern void abobj_set_pane_max(
ABObj obj,
int value
);
extern void abobj_set_attachment(
ABObj obj,
AB_COMPASS_POINT dir,
ABAttachment *attach
);
extern void abobj_set_i18n_enabled(
ABObj proj,
BOOL i18n_enabled
);
#endif /* _ABOBJ_SET_H_ */

View File

@@ -0,0 +1,58 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abuil_load.h /main/3 1995/11/06 18:20:24 rswiston $
*
* %W% %G% cose/unity1/cde_app_builder/src/libABil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABIL_LOAD_UIL_H
#define _ABIL_LOAD_UIL_H
/*
* This file declares the API of the uil load component
*/
#include <ab_private/obj.h>
extern ABObjPtr abuil_get_uil_file(
STRING uil_file_path,
ABObjPtr ab_project
);
extern void abuil_trav_uil_tree(
void *uil_root
);
#endif /* _ABIL_LOAD_UIL_H */

View File

@@ -0,0 +1,54 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: abuil_print.h /main/3 1995/11/06 18:21:09 rswiston $
*
* @(#)abuil_print.h 1.9 25 Aug 1994 cose/unity1/cde_app_builder/src/libABil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABIL_PRINT_UIL_H
#define _ABIL_PRINT_UIL_H
/*
* This file declares the API for the print uil component
*/
#include <ab_private/obj.h>
extern void abuil_obj_print_uil(
FILE *fp,
ABObjPtr ab_project
);
#endif /* _ABIL_PRINT_UIL_H */

View File

@@ -0,0 +1,63 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: appfw.h /main/3 1995/11/06 17:18:44 rswiston $
*
* @(#)appfw.h 1.1 27 Jun 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* appfw.h
*
* Functions for manipulating the Application Frameworks Editor
*/
#ifndef _appfw_h
#define _appfw_h
#include <ab_private/obj.h>
#include "appfw_ui.h"
void appfw_show_dialog(
ABObj project
);
void appfw_notify_new_project(
ABObj project
);
#endif /* _appfw_h */

View File

@@ -0,0 +1,109 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: attch_ed.h /main/3 1995/11/06 17:19:33 rswiston $
*
* @(#)attch_ed.h 1.4 08 Oct 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* attch_ed.h
*
* Functions for manipulating the Attachments Editor
*/
#ifndef _attch_ed_h
#define _attch_ed_h
typedef enum
{
ATTCH_ED_PARENT = 0,
ATTCH_ED_OPPOSITE_PARENT,
ATTCH_ED_SIBLING,
ATTCH_ED_OPPOSITE_SIBLING,
ATTCH_ED_GRIDLINE,
ATTCH_ED_CENTER_GRIDLINE,
ATTCH_ED_NONE
} ATTCH_ED_ATTACH_TYPE;
typedef enum
{
ATTCH_ED_WRN_LOAD = 0,
ATTCH_ED_WRN_CHANGE_OBJTYPE,
ATTCH_ED_WRN_CLOSE
} ATTCH_ED_WRN_TYPE;
#define attch_ed_need_obj_menu(attach_type) \
((attach_type == ATTCH_ED_SIBLING) || (attach_type == ATTCH_ED_OPPOSITE_SIBLING))
/*
* Attachment Editor Settings
*/
typedef struct ATTACHMENT_EDITOR_SETTINGS
{
Widget prop_sheet;
PropOptionsSettingRec top_attach_type;
PropFieldSettingRec top_attach_offset;
PropFieldSettingRec top_attach_position;
PropOptionsSettingRec top_attach_obj;
PropOptionsSettingRec bottom_attach_type;
PropFieldSettingRec bottom_attach_offset;
PropFieldSettingRec bottom_attach_position;
PropOptionsSettingRec bottom_attach_obj;
PropOptionsSettingRec left_attach_type;
PropFieldSettingRec left_attach_offset;
PropFieldSettingRec left_attach_position;
PropOptionsSettingRec left_attach_obj;
PropOptionsSettingRec right_attach_type;
PropFieldSettingRec right_attach_offset;
PropFieldSettingRec right_attach_position;
PropOptionsSettingRec right_attach_obj;
ABObj cur_object;
} AttchEditorSettingsRec, *AttchEditorSettings;
void attch_ed_init(
);
void attch_ed_show_dialog(
ABObj cur_obj
);
BOOL attch_ed_can_edit_attachments(
ABObj obj
);
#endif /* _attch_ed_h */

View File

@@ -0,0 +1,80 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: bil.h /main/3 1995/11/06 18:23:13 rswiston $
*
* @(#)bil.h 1.11 14 Feb 1994 cde_app_builder/src/libABil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABIL_BIL_H_
#define _ABIL_BIL_H_
#include <X11/Intrinsic.h>
#include "bil_parse.h"
typedef enum
{
BIL_SAVE_UNDEF = 0,
BIL_SAVE_DUMP, /* just dump the whole thing */
BIL_SAVE_FILE_PER_MODULE, /* assume 1 project file, 1 for each module */
BIL_SAVE_ENCAPSULATED, /* assume everything goes in one file */
BIL_SAVE_TYPE_NUM_VALUES
} BIL_SAVE_TYPE;
extern ABObj bil_load_file(
STRING path,
FILE *inFile,
ABObj proj,
ABObjList *compObjsOut /* composite objs loaded */
);
extern int bil_load_file_and_resolve_all(
STRING fileName,
FILE *inFile,
ABObj *newProjectPtr
);
extern int bil_save_tree(
ABObj root,
STRING filename,
STRING old_proj_dir,
BIL_SAVE_TYPE type
);
extern STRING bil_get_filename(
ABObj proj,
ABObj module
);
#endif /* _ABIL_BIL_H_ */

View File

@@ -0,0 +1,394 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: brws.h /main/3 1995/11/06 17:20:37 rswiston $
*
* @(#)brws.h 1.40 29 Mar 1995
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* ab_browser.h
* Declarations for the App Builder browser
*
* Currently, this is a direct port of the Devguide browser. It will change
* for the CDE APP Builder soon.
*/
#ifndef _brws_h
#define _brws_h
#include <ab/util_types.h>
#include <ab_private/obj.h>
#include <ab_private/vwr.h>
#include <X11/Intrinsic.h>
#ifndef BIT_FIELD
#define BIT_FIELD(field) unsigned field : 1
#endif
/*
* Indices to the node element array
* e.g. index 2 points to the data that
* represents the AB_OBJ type.
*
* This is also used to determine which bit in the
* 'elements_shown' bit vector corresponds to
* the particular node element.
* e.g. The AB_OBJ name is shown only if bit # 1
* in the vector is set.
*/
#define BRWS_GLYPH_POS 0
#define BRWS_NAME_POS 1
#define BRWS_TYPE_POS 2
#define BRWS_WCLASS_POS 3
#define BRWS_NUM_ELM BRWS_WCLASS_POS + 1
#define BRWS_SHOW_GLYPH (1L << BRWS_GLYPH_POS) /* Node elements shown, */
#define BRWS_SHOW_NAME (1L << BRWS_NAME_POS) /* max = sizeof(int) */
#define BRWS_SHOW_TYPE (1L << BRWS_TYPE_POS)
#define BRWS_SHOW_WIDGET_CLASS (1L << BRWS_WCLASS_POS)
/*
* Flags for browser properties
*/
#define BRWS_MATRIX_MODE 0 /* Draw mode */
#define BRWS_TREE_MODE 1
#define BRWS_VERTICAL 0 /* Orientation */
#define BRWS_HORIZONTAL 1
/*
* Masks for browser node state
*/
#define BRWS_NODE_SELECTED (1L << 0)
#define BRWS_BNODE_PREVIEWED (1L << 1)
#define BRWS_NODE_EXPANDED (1L << 2)
#define BRWS_NODE_VISIBLE (1L << 3)
#define BRWS_NODE_STATE_IS_SET(bnode, mask) (bnode->state & mask)
#define BRWS_NODE_SET_STATE(bnode, mask) (bnode->state |= mask)
#define BRWS_NODE_UNSET_STATE(bnode, mask) (bnode->state &= ~mask)
/*
* Dimensions of borders, margins, lines
*/
#define BRWS_INTER_ELM_DISTANCE 1
#define BRWS_ELM_BBOX_MARGIN 3
#define BRWS_ELM_BORDER_WIDTH 2
#define BRWS_LINE_WIDTH 0
#define BRWS_NODE_LINK_GAP 4
#define BRWS_NODE_SUBTREE_GAP 5
/*
* The gap between two nodes
*/
#define BRWS_NODE_X_GAP 10 + BRWS_NODE_LINK_GAP + BRWS_NODE_SUBTREE_GAP
#define BRWS_NODE_Y_GAP 10 + BRWS_NODE_LINK_GAP + BRWS_NODE_SUBTREE_GAP
/*
* The origin where the graphics starts
*/
#define BRWS_X_ORIGIN 10
#define BRWS_Y_ORIGIN 10
typedef struct _AB_BROWSER *ABBrowser;
typedef struct _BrowserUiObjects *BrowserUiObj;
typedef struct _BrowserProperties *BrowserProps;
/*
* The browser window consists of 2 windows:
* - the project window, where the modules for the project is displayed
* - the module window, where the relevant modules are 'expanded'
* into the tree structured diagram.
*/
typedef struct _AB_BROWSER
{
Vwr project;
Vwr module;
ABBrowser previous;
ABBrowser next;
} AB_BROWSER;
/*
* Description of the Xt specific data in the browser
*/
typedef struct _BrowserUiObjects
{
void *ip;
Widget shell;
Widget textf;
Widget find_box;
GC normal_gc;
GC select_gc;
GC line_gc;
XFontStruct *sm_font;
XFontStruct *bg_font;
unsigned long fg_color;
unsigned long bg_color;
}BrowserUiObjects;
/*
* Description of browser properties
*/
typedef struct _BrowserProperties
{
unsigned long elements_shown;
int initial_state; /* of browser nodes */
Dimension min_width; /* of drawing area */
Dimension min_height;
BIT_FIELD(orientation); /* values: VERTICAL, HORIZONTAL */
BIT_FIELD(show_mult_trees); /* values: TRUE, FALSE */
BIT_FIELD(active); /* values: TRUE, FALSE */
}BrowserProperties;
/*
* API for manipulating App Builder browser
*/
extern void brws_register_actions(
XtAppContext app
);
extern ABBrowser brws_create (
);
extern void brws_destroy (
ABBrowser b
);
extern void brws_add_objects(
AB_OBJ *obj
);
extern void brws_add_objects_to_browser(
ABBrowser ab,
AB_OBJ *obj
);
extern void brws_delete_objects(
AB_OBJ *obj
);
extern int aob_populate_tree(
Viewer *browser,
AB_OBJ *root
);
extern BOOL aob_is_browser_win(
AB_OBJ *project,
Window w
);
extern AB_OBJ *aob_get_object_from_xy(
AB_OBJ *project,
Window w,
int x,
int y
);
extern void brws_select(
AB_OBJ *obj
);
extern void brws_deselect(
AB_OBJ *obj
);
extern void brws_toggle_select(
AB_OBJ *obj
);
extern void aob_redraw(
Viewer *b
);
extern ViewerNode *aob_object_insert(
Viewer *browser,
AB_OBJ *obj
);
extern void brws_popup(
ABBrowser b
);
extern void brws_popdown(
ABBrowser b
);
extern void aob_set_mode(
AB_OBJ *project
);
extern void aob_free_graphics(
Viewer *b
);
extern int browser_get_num_siblings(
ViewerNode *bnode
);
extern int browser_num_elm_shown(
Viewer *b
);
extern ViewerNode *aob_find_bnode(
AB_OBJ *obj,
Viewer *b
);
extern AB_OBJ *aob_project_from_browser(
Viewer *b
);
extern BrowserProps aob_browser_properties(
Viewer *b
);
extern void aob_copy_props(
Viewer *from,
Viewer *to
);
extern BrowserUiObjects *aob_ui_from_browser(
Viewer *b
);
extern Widget aob_ui_shell(
Viewer *b
);
extern ViewerNodeElm *aob_bnode_elements(
ViewerNode *bnode
);
extern void aob_str_elm_render (
ViewerNode *node,
ViewerNodeElm *elm
);
extern unsigned long browser_get_elm_shown(
Viewer *b
);
extern Vwr aob_proj_or_module(
ABBrowser b,
Widget w
);
extern void brws_set_module_name(
Vwr b
);
extern void aob_preview(
ABObj obj,
Window browser_window
);
extern void aob_deselect_all_nodes(
Vwr b,
int flag
);
extern void aob_deselect_all_objects(
AB_OBJ *project
);
extern int number_of_selected(
VNode tree
);
extern VNode node_selected(
VNode tree
);
extern void draw_viewer(
Vwr v
);
extern void erase_viewer(
Vwr v
);
extern void setup_vwr_graphics(
Vwr v
);
extern BrowserUiObj aob_create_ui_obj();
extern void brws_switch_module(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void brws_update_node(
ABObj obj
);
extern ABBrowser brws_get_browser_for_obj(
ABObj obj
);
extern Widget brws_get_browser_shell_for_obj(
ABObj obj
);
extern void brws_edit_cascadeCB(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void brws_build_module_menu(
Widget pulldown,
XtCallbackProc callback
);
extern void brws_show_browser(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void brws_center_on_obj(
ABBrowser ab,
ABObj obj
);
extern void brws_init(
);
#endif /* _brws_h */

View File

@@ -0,0 +1,122 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: brwsP.h /main/3 1995/11/06 17:20:46 rswiston $
*
* @(#)brwsP.h 1.15 03 Oct 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* brwsP.h
* Private declarations for browser
*/
#ifndef _BRWSP_H
#define _BRWSP_H
#include <ab_private/brws.h>
#include "brws_ui.h"
extern Widget brws_draw_area(
Vwr v
);
void brwsP_create_find_box(
ABBrowser b
);
void brwsP_destroy_find_box(
Vwr v
);
void brwsP_show_find_box(
Vwr v
);
void brwsP_hide_find_box(
Vwr v
);
int brwsP_select_fn(
VNode vnode
);
void brwsP_sync_views(
ABBrowser ab,
short select_at_least_one
);
void browser_show_view_elements(
Viewer *b,
unsigned long mask,
Widget widget,
char *set_str,
char *unset_str
);
void recompute_viewer(
Viewer *v
);
int brwsP_node_is_collapsed(
VNode vnode
);
int brwsP_node_is_visible(
VNode vnode
);
void brwsP_make_drawarea_snap(
Vwr v,
Widget draw_area
);
void brwsP_collapse_selected(
ABBrowser ab
);
void brwsP_expand_selected(
ABBrowser ab
);
void brwsP_expand_collapsed(
ABBrowser ab
);
void brwsP_tear_off_selected(
ABBrowser ab
);
#endif /* _BRWSP_H */

View File

@@ -0,0 +1,166 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: cgen.h /main/3 1995/11/06 17:22:21 rswiston $
*
* @(#)cgen.h 1.14 14 Nov 1994 cde_app_builder/src/ab
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _CGEN_H_
#define _CGEN_H_
/*
* cgen.h - Code Generator interface
*/
#include <X11/Intrinsic.h>
#include <ab_private/obj.h>
#include <ab_private/obj_notify.h>
/*
* The final goal the user wants to reach. May need to issue a series of
* (system) commands to achieve this goal.
*/
typedef enum
{
CG_GOAL_UNDEF = 0, /* CG = codegen */
CG_GOAL_GEN_CODE,
CG_GOAL_MAKE,
CG_GOAL_RUN,
CG_GOAL_MAKE_AND_RUN,
CG_GOAL_NUM_VALUES
} CG_GOAL;
typedef enum
{
CG_CMD_UNDEF = 0,
CG_CMD_GEN_CODE,
CG_CMD_MAKE,
CG_CMD_RUN,
CG_SUBCOMMAND_NUM_VALUES
} CG_SUBCOMMAND;
typedef enum
{
CG_VERBOSITY_UNDEF = 0,
CG_VERBOSITY_NORMAL,
CG_VERBOSITY_SILENT,
CG_VERBOSITY_VERBOSE,
CB_VERBOSITY_NUM_VALUES
} CG_VERBOSITY;
typedef enum
{
CG_GEN_FLAG_UNDEF = 0,
CG_GEN_PROJ_FLAG,
CG_GEN_MAIN_FLAG,
CG_GEN_SPECIFIC_FILES_FLAG,
CG_GEN_SPECIFIC_FILES_AND_MAIN_FLAG,
CG_GEN_FLAG_NUM_VALUES
} CG_GEN_FLAG;
typedef struct
{
CG_GEN_FLAG cmd_flag;
Boolean no_merge;
CG_VERBOSITY verbosity;
StringList module_list;
STRING make_args;
STRING run_args;
} CGenOptions;
extern CGenOptions CodeGenOptions;
extern StringList user_env_vars;
extern StringList module_list;
/*
extern void cgen_show_dialog(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
*/
extern void cgen_show_codegen_win(
void
);
extern void cgen_gen_code(
CG_SUBCOMMAND cmd
);
extern void cgen_make(
CG_SUBCOMMAND cmd
);
extern void cgen_run(
CG_SUBCOMMAND cmd
);
extern void cgen_make_run(
CG_SUBCOMMAND cmd
);
extern void cgenP_init_props_module_list(
Widget mod_list
);
extern void cgenP_prop_init(void);
extern void cgenP_update_mod_listCB(
Widget widget,
XtPointer clientData,
XtPointer callData
);
/*
* Updates project directory, title, ...
*/
extern int cgen_notify_new_directory(STRING directory);
extern int cgen_notify_new_project(ABObj project);
extern int cgen_notify_props_new_proj(ABObj project);
extern int cgenP_sync_up_dir(void);
/*
* Aborts whatever command is running (if any)
*/
extern int cgen_abort(void);
#endif /* _CGEN_H_ */

View File

@@ -0,0 +1,50 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: color_chooser.h /main/3 1995/11/06 17:24:25 rswiston $
*
* @(#)color_chooser.h 1.1 21 Feb 1994 cde_app_builder/src/ab
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
** color_chooser.h -- declarations associated with the color chooser
*/
/*
** Routine to display the color chooser and return the name of the
** color selected. Returns an empty string if no color is selected.
*/
char * display_color_chooser();

View File

@@ -0,0 +1,101 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: conn.h /main/3 1995/11/06 17:25:27 rswiston $
*
* @(#)conn.h 1.17 02 May 1995 cde_app_builder/src/libABobj
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _CONN_H_
#define _CONN_H_
/*
* conn.h -
*/
#include <X11/Intrinsic.h>
#include <ab_private/obj.h>
#include "conn_ui.h"
extern ABObj project;
extern void conn_drag_chord(
Widget widget,
XEvent *event,
String *params,
Cardinal num_params
);
extern void conn_popup_dialog(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void conn_set_source(
ABObj obj
);
extern void conn_set_target(
ABObj obj
);
extern void conn_enable_action_interpret(
ABObj project,
BOOL to_test_project
);
extern void conn_disable_action_interpret(
ABObj project
);
extern void conn_test_mode_initialize(
ABObj project
);
extern void conn_test_mode_cleanup(
ABObj project
);
extern void conn_init();
extern void conn_strings_init();
extern void conn_override_default_when(
AB_WHEN when
);
extern void conn_reset_default_when(void);
extern void conn_reset_default_action(void);
extern void conn_override_default_action_type(
AB_FUNC_TYPE func_type
);
extern void conn_reset_default_action_type();
#endif /* _CONN_H_ */

View File

@@ -0,0 +1,281 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: connP.h /main/3 1995/11/06 17:25:39 rswiston $
*
* @(#)connP.h 1.12 17 Feb 1994 cde_app_builder/src/libABobj
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _CONN_P_H_
#define _CONN_P_H_
/*
* connP.h -
*/
#include <X11/Intrinsic.h>
#include <ab_private/obj.h>
#include <ab_private/obj_notify.h>
#include <ab_private/conn.h>
#include "conn_ui.h"
#define FUNCTION_LABEL "Function:"
#define ARGUMENT_LABEL "Argument:"
#define CODE_LABEL "Code:"
extern Widget ConnP_dialog;
typedef enum {
ACTION_TYPE_PREDEFINED = 0,
ACTION_TYPE_CALLFUNC,
ACTION_TYPE_EXECUTE_CODE,
ACTION_TYPE_ON_ITEM_HELP,
ACTION_TYPE_HELP_VOLUME,
ACTION_TYPE_NUM_VALUES
} ACTION_TYPE;
typedef struct _ConnWhenRec
{
AB_WHEN when_type;
char *label;
} ConnWhen;
typedef struct _ConnActRec
{
AB_BUILTIN_ACTION act_type;
char *label;
} ConnAct;
typedef struct _ConnObjRec
{
AB_OBJECT_TYPE obj_type;
int obj_subtype;
char *label;
AB_WHEN *when_list;
Cardinal num_whens;
AB_WHEN default_when;
AB_BUILTIN_ACTION *action_list;
Cardinal num_actions;
AB_BUILTIN_ACTION default_act;
} ConnObj;
extern ConnObj ConnP_conn_objs[];
extern int ConnP_num_conn_objs;
extern ConnWhen *ConnP_conn_whens;
extern int ConnP_num_conn_whens;
extern ConnAct *ConnP_conn_acts;
extern int ConnP_num_conn_acts;
extern char ** connP_get_when_labels(
int *num_labels
);
extern char ** connP_get_act_labels(
int *num_labels
);
extern long connP_get_obj_type_index(
AB_OBJECT_TYPE ab_type,
int ab_subtype
);
extern STRING connP_get_moduled_name(
ABObj obj
);
extern char *connP_make_conn_string(
ABObj action_obj
);
extern ABObj connP_get_source(
void
);
extern ABObj connP_get_target(
void
);
extern ABObj connP_get_connection(
void
);
extern void connP_set_connection(
ABObj action
);
extern void connP_set_source_type(
AB_OBJECT_TYPE obj_type,
int obj_subtype
);
extern void connP_set_target_type(
AB_OBJECT_TYPE obj_type,
int obj_subtype
);
extern AB_OBJECT_TYPE connP_get_source_type(
void
);
extern int connP_get_source_subtype(
void
);
extern AB_OBJECT_TYPE connP_get_target_type(
void
);
extern int connP_get_target_subtype(
void
);
extern void connP_set_action_type(
AB_FUNC_TYPE action_type
);
extern AB_FUNC_TYPE connP_get_action_type(
void
);
extern void connP_ui_source_type_update(
AB_OBJECT_TYPE new_type,
int new_subtype
);
extern void connP_ui_target_type_update(
AB_OBJECT_TYPE new_type,
int new_subtype
);
extern AB_ARG_TYPE connP_action_needs_arg(
AB_BUILTIN_ACTION act_type
);
extern void connP_guess_when_action(
AB_OBJECT_TYPE source_type,
int source_subtype,
AB_OBJECT_TYPE target_type,
int target_subtype,
AB_WHEN *when_ret,
AB_FUNC_TYPE *func_type_ret,
AB_BUILTIN_ACTION *act_ret
);
extern int connP_objtype_needs_subtype(
AB_OBJECT_TYPE obj_type,
int obj_subtype
);
extern long connP_obj_enabled(
AB_OBJECT_TYPE obj_type,
int obj_subtype
);
extern void connP_set_conn_arg(
ABObj ab_action,
AB_ARG_TYPE arg_type,
char *str_value
);
extern void connP_make_builtin_conn(
ABObj ab_action,
ABObj c_source,
ABObj c_target,
AB_WHEN c_when,
AB_BUILTIN_ACTION c_act
);
extern void connP_make_user_def_conn(
ABObj ab_action,
ABObj c_source,
AB_WHEN c_when,
char *function_name
);
extern void connP_make_code_frag_conn(
ABObj ab_action,
ABObj c_source,
AB_WHEN c_when,
char *code_frag
);
extern void connP_make_on_item_help_conn(
ABObj ab_action,
ABObj c_source,
AB_WHEN c_when
);
extern void connP_make_help_vol_conn(
ABObj ab_action,
ABObj c_source,
AB_WHEN c_when,
STRING volume,
STRING location
);
extern int connP_update_on_obj_destroy(
ObjEvDestroyInfo destroyInfo
);
extern int connP_update_on_obj_rename(
ObjEvAttChangeInfo info
);
extern int connP_update_on_obj_reparent(
ObjEvReparentInfo info
);
extern int connP_update_on_show_status(
ObjEvUpdateInfo info
);
extern BOOL connP_change_in_builtin(
ABObj ab_action,
ABObj c_source,
ABObj c_target,
AB_WHEN c_when,
AB_BUILTIN_ACTION c_act,
char *arg_str
);
extern void connP_builtin_remove_arg(
ABObj ab_action
);
extern void connP_destroy_connections_for(
ABObj obj
);
extern BOOL connP_conn_is_possible(
void
);
extern BOOL allow_show_help_connection(
ABObj src_obj,
ABObj target_obj
);
extern void connP_update_when_menu(
Widget widget,
XtPointer clientData,
XtPointer callData
);
extern void connP_update_action_menu(
Widget widget,
XtPointer clientData,
XtPointer callData
);
extern BOOL connP_obj_part_of_conn(
ABObj obj,
ABObj conn_obj
);
#endif /* _CONN_P_H_ */

View File

@@ -0,0 +1,56 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: dtb_utils.h /main/3 1995/11/06 18:04:40 rswiston $
*
* @(#)dtb_utils.h 1.1 20 Sep 1994 cde_app_builder/src/abmf
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* dtb_utils.h - partial set of dtb_utils.h functions
*/
#ifndef _ABMF_DTB_UTILS_H_
#define _ABMF_DTB_UTILS_H_
#include <ab/util_types.h>
void dtb_save_command(char *argv0);
STRING dtb_get_exe_dir(void);
#endif /* _ABMF_DTB_UTILS_H_ */

View File

@@ -0,0 +1,72 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: gil.h /main/3 1995/11/06 18:27:23 rswiston $
*
* @(#)gil.h 1.8 02 Feb 1995 cde_app_builder/src/libABobj
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* gil.h - gil file defines, et cetera.
*/
#ifndef _ABIL_GIL_H_
#define _ABIL_GIL_H_
#include <ab_private/obj.h>
#define GIL_MAX_NAME_LENGTH 1023
#define GIL_MAX_NAME_SIZE (GIL_MAX_NAME_LENGTH + 1)/*size includes NULL*/
int gil_init(void); /* CALL THIS FIRST! */
extern ABObj gil_load_file(
STRING interfaceFilePath,
FILE *inFile,
ABObj project
);
extern int gil_load_project_file(
STRING projectFilePath,
FILE *inFile,
ABObj *projectOut
);
extern int gil_load_project_file_and_resolve_all(
STRING projectFilePath,
FILE *inFile,
ABObj *projectOut
);
#endif /* _ABIL_GIL_H_ */

View File

@@ -0,0 +1,80 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: help.h /main/3 1995/11/06 17:30:51 rswiston $
*
* @(#)help.h 1.5 14 Jul 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* File: help.h - Public header file for App Builder Help Editor functions.
* See help_ed_stubs.c for more details.
*/
#ifndef _HELP_H_
#define _HELP_H_
/*
** External method to forcibly set the current help object retained
** privately within the Help Editor.
*/
extern void ab_set_help_obj(ABObj obj);
/*
** Routines to enable & disable help functionality when entering and leaving
** test mode (respectively).
*/
extern void help_test_enable(ABObj obj);
extern void help_test_disable(ABObj obj);
/*
** Function used to provide on-item help support for App Builder, and which
** should be called by the "On Item..." item in the App Builder main Help
** menu.
*/
extern Boolean help_do_onitem_help();
/*
** Method to bring up the Help Editor, used as a callback for the "Help Text..."
** button on various prop sheets.
*/
extern void ab_popup_help(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
#endif /* _HELP_H_ */

View File

@@ -0,0 +1,290 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: istr.h /main/4 1995/11/06 18:50:56 rswiston $
*
* @(#)istr.h 1.27 11 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* istr.h - string allocater
*
* empty value for an ISTRING is NULL.
*/
#ifndef _ISTR_H
#define _ISTR_H
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <string.h>
#include <ab_private/AB.h>
#include <ab/util_types.h>
#include <ab_private/util.h>
typedef struct
{
BYTE you_dont_want_to_use_this_field;
} ISTRING_PUBLIC_REC;
typedef ISTRING_PUBLIC_REC *ISTRING;
/*
* Allocate a new istring for a given string and return the value,
* or if the string already exists return the value
* for an existing istring. If the string was previously allocated as
* a read only string change its status to const and its string
* pointer.
* Returns -1 if error.
* Note: This string is read only. The string sent in is already
* allocated and the destroy command will not deallocate the
* string
*/
extern ISTRING istr_create_const(
STRING string
);
/*
* Identical to istr_create_const (shortcut)
*/
extern ISTRING istr_const(
STRING string
);
/*
* Allocate a new istring for a given string and return the value,
* or if the string already exists return the value
* for an existing istring. Returns -1 if error.
* Note: This string is read only. The string sent in is already
* allocated and the destroy command will deallocate the
* string
*/
extern ISTRING istr_create_alloced(
STRING string
);
/*
* Allocate a new istring for a given string and return the value,
* or if the string already exists return the value for an
* existing istring. Returns -1 if error.
* Note: This string is read only. The string sent in has not
* been allocated and the destroy command will deallocate
* the string.
*/
extern ISTRING istr_create(
STRING string
);
/*
* Deallocate for the string if refcount=0 else decrement the refcount.
* If the string type is const then don't deallocate.
* returns -1 if error, else returns 1
*/
extern int istr_destroy(
ISTRING istring
);
/*
* Return the string value, and increment counter
* return -1 if error
*/
extern ISTRING istr_dup(
ISTRING istring
);
/*
* Return (STRING) for istring, return NULL if error
*/
extern STRING istr_string(
ISTRING istring
);
/*
* Won't return NULL - returns string associated with istring,
* or "(nil)"
* Note: printable string returned
*/
extern STRING istr_string_safe(
ISTRING istring
);
/*
* Finds the existing ISTRING value for string, returns NULL if string
* doesn't exist
*
* Note that this dups the existing string, and istr_destroy() must
* be called on the returned ISTRING when it is no longer needed.
*/
extern ISTRING istr_dup_existing(
STRING s
);
/*
* Moves the istring in "from" to the istring in "to" and
* sets "from" to NULL
* always returns 0
*/
extern int istr_move(
ISTRING to,
ISTRING from
);
/*
* Returns the length of the string, returns NULL if the
* string is empty
*/
extern int istr_len(
ISTRING s
);
/*
* Compare the two strings, returns the same as strcmp
*/
extern int istr_cmp(
ISTRING s1,
ISTRING s2
);
/*
* Compare the two istrings, returns TRUE if equal
*/
extern BOOL istr_equal(
ISTRING s1,
ISTRING s2
);
/*
* Compare the two strings, returns the same as strcmp
*/
extern int istr_cmpstr(
ISTRING s1,
STRING s2
);
/*
* Compare the two strings, returns TRUE if equal
*/
extern BOOL istr_equalstr(
ISTRING s1,
STRING s2
);
/*
* Verifies that the given ISTRING is valid (e.g., that it exists, and that
* it is not corrupted.
*
* Returns < 0 if an error is detected
*/
int istr_verify(ISTRING);
/*
* Checks all the ISTRINGS and internal data structures to see if anything
* has become corrupted.
*
* Returns < 0 if an error is detected
*/
int istr_verify_all(void);
/*************************************************************************
** **
** Internal functions - clients must not call these! **
** **
**************************************************************************/
typedef struct
{
int refcount;
STRING str;
unsigned int read_const : 1;
} ISTR_PRIVT_STRN;
extern STRING Istr_null_string;
extern int istrP_destroy_impl518283652PrivF(ISTRING*);
extern ISTRING istrP_create_alloced_impl9726039350PrivF(STRING*);
extern int istrP_notify_invalid2160413670PrivF(ISTRING);
extern STRING istrP_get_string_fast3718930164PrivF(ISTRING);
extern STRING istrP_get_string_verify4521632085PrivF(ISTRING);
extern long istrP_num_count7608925912PrivD;
extern ISTR_PRIVT_STRN *istrP_int_array1809065681PrivD;
/*************************************************************************
** **
** Inline implementation **
** **
**************************************************************************/
#define istr_equal(a,b) ((a) == (b))
#define istr_len(s) ((s)==NULL? 0:strlen(istr_string(s)))
#define istr_destroy(s) \
(istrP_destroy_impl518283652PrivF(&(s)))
#define istr_create_alloced(s) \
(istrP_create_alloced_impl9726039350PrivF(&(s)))
#define istr_move(a,b) ((int)((a)=(b), (b)=NULL))
#define istr_cmp(a,b) (util_strcmp(istr_string(a),istr_string(b)))
#define istr_cmpstr(a,b) (util_strcmp(istr_string(a),(b)))
#define istr_equalstr(a,b) (istr_cmpstr(a,b)==0)
#define istr_const(s) (istr_create_const(s))
#define istr_string_safe(s) ((s) == NULL? Istr_null_string:istr_string(s))
#define istrP_get_string_fast3718930164PrivF(istring) \
(istrP_int_array1809065681PrivD[((long)istring)].str)
/* istr_string - if debugging is turned on, checks ISTRINGS for validity */
#ifdef DEBUG
#define istr_string(istring) \
((!debugging())? \
istrP_get_string_fast3718930164PrivF(istring) \
: \
istrP_get_string_verify4521632085PrivF(istring) \
)
#else
#define istr_string(istring) \
(istrP_get_string_fast3718930164PrivF(istring))
#endif /* DEBUG */
#endif /* _ISTR_H */

View File

@@ -0,0 +1,53 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: message.h /main/3 1995/11/06 17:34:09 rswiston $
*
* @(#)message.h 1.1 08 Jul 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* File: message.h - message .h file for this directory
*/
#ifndef _ab_message_h
#define _ab_message_h
extern void msgEd_show_dialog(
);
#endif /* _ab_message_h */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,144 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: obj_list.h /main/3 1995/11/06 18:36:04 rswiston $
*
* @(#)template.h 1.6 11 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABOBJ_OBJ_LIST_H_
#define _ABOBJ_OBJ_LIST_H_
/*
* obj_list.h - define ABObjList data type
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <ab_private/AB.h> /* everybody must include this first! */
#include <ab/util_types.h>
struct _AB_OBJ;
#define ABObj struct _AB_OBJ *
typedef enum
{
OBJLIST_SORT_UNDEF = 0,
OBJLIST_SORT_ALPHANUMERIC,
OBJLIST_SORT_BEST,
OBJLIST_SORT_CLIENT_DEF,
OBJLIST_SORT_ORDER_NUM_VALUES /* must be last */
} OBJLIST_SORT_ORDER;
typedef void (*ABObjListIterFn)(ABObj obj);
/*
* obj list structure.
*/
typedef struct
{
int num_objs;
int objs_size;
ABObj *objs;
void **user_datas;
BOOL unique;
OBJLIST_SORT_ORDER sort_order;
BOOL indexes_dirty;
} ABObjListRec, *ABObjList;
#undef ABObj
#include <ab_private/obj.h>
/*
* ABObjList - lifecycle methods
*/
ABObjList objlist_create(void);
int objlist_destroy(ABObjList);
int objlist_construct(ABObjList);
int objlist_destruct(ABObjList);
ABObjList objlist_dup(ABObjList);
/*
* ABObjList - methods dealing with entire list
*/
int objlist_set_sort_order(ABObjList, OBJLIST_SORT_ORDER);
OBJLIST_SORT_ORDER objlist_get_sort_order(ABObjList);
int objlist_set_is_unique(ABObjList, BOOL unique);
BOOL objlist_is_unique(ABObjList);
int objlist_make_empty(ABObjList);
int objlist_is_empty(ABObjList);
int objlist_set_num_objs(ABObjList, int numABObjs);
int objlist_get_num_objs(ABObjList);
int objlist_set_max_size_soft(ABObjList, int maxNumObjs);
int objlist_get_max_size(ABObjList);
BOOL objlist_max_size_is_soft(ABObjList);
int objlist_shrink_mem_to_fit(ABObjList);
int objlist_iterate(ABObjList, ABObjListIterFn);
/*
* Methods dealing with individual objects
*/
int objlist_remove_obj(ABObjList, ABObj obj);
int objlist_remove_index(ABObjList, int index);
int objlist_add_obj(ABObjList, ABObj obj, void *userData);
int objlist_add_index(ABObjList,
int index, ABObj obj, void *userData);
BOOL objlist_obj_exists(ABObjList list, ABObj obj);
int objlist_get_obj_index(ABObjList list, ABObj obj);
ABObj objlist_get_obj(ABObjList, int whichObj, void **userDataOut);
void *objlist_get_obj_data(ABObjList, ABObj obj);
/*
* Debugging methods
*/
#ifdef DEBUG
int objlist_dump(ABObjList list);
#endif
/*************************************************************************
**************************************************************************
** **
** Inline definitions **
** **
**************************************************************************
*************************************************************************/
int objlist_destroy_impl(ABObjList *listInOut);
#define objlist_destroy(list) (objlist_destroy_impl(&(list)))
#endif /* _ABOBJ_OBJ_LIST_H_ */

View File

@@ -0,0 +1,181 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: obj_notify.h /main/3 1995/11/06 18:37:49 rswiston $
*
* @(#)obj_notify.h 1.14 02 Feb 1995
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* obj_notify.h - object change notification
*/
#ifndef _ABOBJ_NOTIFY_H_
#define _ABOBJ_NOTIFY_H_
#include <ab_private/obj.h>
typedef unsigned char OBJEV_ATT_FLAGS;
#define OBJEV_ATT_UNDEF ((OBJEV_ATT_FLAGS)0x00)
#define OBJEV_ATT_NONE ((OBJEV_ATT_FLAGS)0x00)
#define OBJEV_ATT_GEOMETRY ((OBJEV_ATT_FLAGS)0x01)
#define OBJEV_ATT_HSCROLL ((OBJEV_ATT_FLAGS)0x02)
#define OBJEV_ATT_LABEL ((OBJEV_ATT_FLAGS)0x04)
#define OBJEV_ATT_NAME ((OBJEV_ATT_FLAGS)0x08)
#define OBJEV_ATT_POSITION ((OBJEV_ATT_FLAGS)0x10)
#define OBJEV_ATT_SELECTED ((OBJEV_ATT_FLAGS)0x20)
#define OBJEV_ATT_SIZE ((OBJEV_ATT_FLAGS)0x40)
#define OBJEV_ATT_VSCROLL ((OBJEV_ATT_FLAGS)0x80)
typedef struct
{
ABObj obj;
} OBJEV_STANDARD_INFO;
typedef struct
{
ABObj obj;
int new_x, new_y, new_width, new_height;
} OBJEV_ALLOW_GEOMETRY_CHANGE_INFO;
typedef struct
{
ABObj obj;
ABObj new_parent;
} OBJEV_ALLOW_REPARENT_INFO;
typedef struct
{
ABObj obj;
OBJEV_ATT_FLAGS atts;
ISTRING old_name;
} OBJEV_ATT_CHANGE_INFO;
typedef struct
{
ABObj obj;
ABObj old_parent;
} OBJEV_REPARENT_INFO;
typedef struct
{
ABObj obj;
BOOL update_subtree;
} OBJEV_UPDATE_INFO;
typedef struct
{
ABObj obj;
BOOL update_subtree;
int update_code;
void *update_data;
UpdateDataFreeFunc update_data_free_func;
} OBJEV_UPDATE_WITH_DATA_INFO;
typedef OBJEV_STANDARD_INFO OBJEV_CREATE_INFO;
typedef OBJEV_STANDARD_INFO OBJEV_DESTROY_INFO;
typedef OBJEV_ALLOW_GEOMETRY_CHANGE_INFO *ObjEvAllowGeometryChangeInfo;
typedef OBJEV_ALLOW_REPARENT_INFO *ObjEvAllowReparentInfo;
typedef OBJEV_ATT_CHANGE_INFO *ObjEvAttChangeInfo;
typedef OBJEV_CREATE_INFO *ObjEvCreateInfo;
typedef OBJEV_DESTROY_INFO *ObjEvDestroyInfo;
typedef OBJEV_REPARENT_INFO *ObjEvReparentInfo;
typedef OBJEV_UPDATE_INFO *ObjEvUpdateInfo;
typedef OBJEV_UPDATE_WITH_DATA_INFO *ObjEvUpdateWithDataInfo;
/*
* Callback function types.
* Must return >= 0 for success, or value from util_err.h
*/
typedef int (*ObjAllowGeometryChangeCallback) (ObjEvAllowGeometryChangeInfo);
typedef int (*ObjAllowReparentCallback) (ObjEvAllowReparentInfo);
typedef int (*ObjAttChangeCallback) (ObjEvAttChangeInfo);
typedef int (*ObjCreateCallback) (ObjEvCreateInfo);
typedef int (*ObjDestroyCallback) (ObjEvDestroyInfo);
typedef int (*ObjReparentCallback) (ObjEvReparentInfo);
typedef int (*ObjUpdateCallback) (ObjEvUpdateInfo);
typedef int (*ObjUpdateWithDataCallback) (ObjEvUpdateWithDataInfo);
/*
* The debug_name parameter is used for error reporting, and may
* be NULL.
*/
int obj_add_allow_geometry_change_callback(
ObjAllowGeometryChangeCallback,
STRING debug_name
);
int obj_add_allow_reparent_callback(
ObjAllowReparentCallback,
STRING debug_name
);
int obj_add_create_callback(
ObjCreateCallback,
STRING debug_name
);
int obj_add_destroy_callback(
ObjDestroyCallback,
STRING debug_name
);
int obj_add_geometry_change_callback(
ObjAttChangeCallback,
STRING debug_name
);
int obj_add_rename_callback(
ObjAttChangeCallback,
STRING debug_name
);
int obj_add_reparent_callback(
ObjReparentCallback,
STRING debug_name
);
int obj_add_selected_change_callback(
ObjAttChangeCallback,
STRING debug_name
);
int obj_add_update_callback(
ObjUpdateCallback,
STRING debug_name
);
int obj_add_update_with_data_callback(
ObjUpdateWithDataCallback,
STRING debug_name
);
#endif /* _ABOBJ_NOTIFY_H_ */

View File

@@ -0,0 +1,913 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: objxm.h /main/3 1995/11/06 18:43:58 rswiston $
*
* @(#)objxm.h 1.73 24 Apr 1995
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* objxm.h - Handle Motif-specific mechanism for obj structure
*
*/
#ifndef _OBJXM_H_
#define _OBJXM_H_
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#include <ab_private/obj.h>
#include <ab_private/istr.h>
/*
* Define Flags for Color Args
*/
#define ObjxmNone 0x00
#define ObjxmForeground 0x01
#define ObjxmBackground 0x02
/*
* OBJXM Configuration Types
* The difference between the 2 types of XmConfiguring is in
* how the Obj's Resource ArgLists are constructed:
*
* For Build-mode, resource values are converted to the
* correct 'type' for a real "SetValues" or "Create" call.
* (e.g. For XmNbackground, the value is converted to a Pixel)
*
* For Codegen-mode, resource values are converted to what
* should be *written-out* in code.
* (e.g. For XmNbackground, the value is the color-name string,
* NOT a Pixel)
*
*/
typedef enum
{
OBJXM_CONFIG_BUILD,
OBJXM_CONFIG_CODEGEN,
OBJXM_CONFIG_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} OBJXM_CONFIG_TYPE;
/*
* Type of "objects" in an XmConfigured hierarchy
*/
typedef enum
{
/* Required by all XmConfigured objs */
AB_CFG_UNDEF = 0,
AB_CFG_OBJECT_OBJ, /* Object SubObj */
AB_CFG_LABEL_OBJ, /* Label SubObj */
AB_CFG_SIZE_OBJ, /* SubObj responsible for Sizing */
AB_CFG_POSITION_OBJ, /* SubObj responsible for Positioning*/
AB_CFG_PARENT_OBJ, /* SubObj for parenting children */
AB_CFG_SELECT_OBJ, /* SubObj for displaying Select feedback */
/* Optional for XmConfigured objs */
AB_CFG_BORDER_OBJ, /* SubObj for displaying border */
AB_CFG_DND_OBJ, /* drag from/drop on this object */
AB_CFG_HELP_OBJ, /* where we attach help */
AB_CFG_STATUS_OBJ, /* SubObj for status display */
AB_CFG_MENU_PARENT_OBJ, /* SubObj for parenting menus */
AB_CFG_SCROLLBAR_OBJ, /* Scrollbar SubObj */
AB_CFG_SCROLLING_OBJ, /* Scrolling container SubObj */
AB_CFG_MENU_OBJ, /* Menu (reference) SubObj */
AB_CFG_WINDOW_BB_OBJ, /* Dialog internal BulletinBoard SubObj */
AB_CFG_WINDOW_PW_OBJ, /* Window internal PanedWindow SubObj */
AB_CFG_WINDOW_MW_OBJ, /* Window internal MainWindow SubObj */
AB_CFG_OBJ_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
} AB_CFG_OBJ_TYPE;
typedef int ObjxmFilenameToPixmapFuncRec(
Widget widget,
STRING filename,
Pixmap *pixmap_out
);
typedef ObjxmFilenameToPixmapFuncRec *ObjxmFilenameToPixmapFunc;
typedef int ObjxmPostInstantiateFuncRec(
ABObj obj
);
typedef ObjxmPostInstantiateFuncRec *ObjxmPostInstantiateFunc;
/*
* define types for Xm-Configure object "methods"
*/
typedef int (*XmConfigProc) (
ABObj obj
);
typedef int (*XmUnconfigProc) (
ABObj obj
);
typedef BOOL (*XmConfigIsaFunc) (
ABObj obj
);
typedef int (*XmConfigSetArgProc) (
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
typedef int (*XmConfigPostInstProc) (
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
typedef ABObj (*XmConfigGetObjProc) (
ABObj obj,
AB_CFG_OBJ_TYPE type
);
/*
* XmConfigInfo Structure - one for each type of object supported
*/
typedef struct _XM_CONFIG_INFO_REC {
/* Methods...*/
XmConfigProc xmconfig; /* configures obj hierarchy */
XmUnconfigProc xmunconfig; /* unconfigures obj */
XmConfigGetObjProc get_config_obj;/* returns config obj */
XmConfigSetArgProc set_args; /* sets appropriate resources */
XmConfigPostInstProc post_instantiate; /* does any post-instantiation stuff*/
XmConfigIsaFunc is_a_test; /* "is a" test */
} XM_CONFIG_INFO_REC, XmConfigInfoRec, *XmConfigInfo;
/*
* Xm String Cache Data structures & defines
*/
/*
* ABXm XmCreateFunc structure
*/
typedef Widget (*XmCreateFunc) (
Widget parent,
String name,
ArgList args,
Cardinal arg_count
);
/*
* Widget Classes
*/
extern char * const _applicationShell;
extern char * const _dtComboBox;
extern char * const _dtMenuButton;
extern char * const _dtSpinBox;
extern char * const _dtTerm;
extern char * const _group;
extern char * const _topLevelShell;
extern char * const _xmArrowButton;
extern char * const _xmBulletinBoard;
extern char * const _xmCascadeButton;
extern char * const _xmCommand;
extern char * const _xmDialogShell;
extern char * const _xmDrawingArea;
extern char * const _xmDrawnButton;
extern char * const _xmFileSelectionBox;
extern char * const _xmForm;
extern char * const _xmFrame;
extern char * const _xmLabel;
extern char * const _xmLabelGadget;
extern char * const _xmList;
extern char * const _xmMainWindow;
extern char * const _xmManager;
extern char * const _xmMenuShell;
extern char * const _xmMessageBox;
extern char * const _xmPanedWindow;
extern char * const _xmPopupMenu;
extern char * const _xmPrimitive;
extern char * const _xmPulldownMenu;
extern char * const _xmPushButton;
extern char * const _xmRowColumn;
extern char * const _xmScale;
extern char * const _xmScrollBar;
extern char * const _xmScrolledList;
extern char * const _xmScrolledWindow;
extern char * const _xmSelectionBox;
extern char * const _xmSeparator;
extern char * const _xmSeparatorGadget;
extern char * const _xmText;
extern char * const _xmTextField;
extern char * const _xmToggleButton;
extern char * const _xmToggleButtonGadget;
/*
* XmConfigure Routines
*/
/* Function to initialize objxm
*/
extern int objxm_init(
Widget toplevel
);
/*
* Hook to add routine to convert filenames to callbacks.
* NULL callback reinstates default conversion method.
*/
extern int objxm_set_cvt_filename_to_pixmap_callback(
ObjxmFilenameToPixmapFunc filename_to_pixmap_cb
);
/*
* Hook to add routine to do additional post instantiate
* stuff
* by default, this callback is NULL, so nothing is called
*/
extern int objxm_set_post_instantiate_callback(
ObjxmPostInstantiateFunc post_instantiate_cb
);
/* Function to register XmConfigInfo
* for a single object type
*/
extern void objxm_register_config_info(
XmConfigInfo cfginfo
);
/* Function which XmConfigures an object
* into it's appropriate Composite object
* hierarchy
*/
extern int objxm_obj_configure(
ABObj obj,
OBJXM_CONFIG_TYPE ctype,
BOOL set_args
);
/* Function which XmConfigures an entire tree
*/
extern int objxm_tree_configure(
ABObj root,
OBJXM_CONFIG_TYPE ctype
);
/* Function which UnConfigures an object
* NOTE: does NOT destroy associated widgets!
*/
extern int objxm_obj_unconfigure(
ABObj obj
);
/* Function which UnConfigures an entire tree
* NOTE: does NOT destroy associated widgets!
*/
extern int objxm_tree_unconfigure(
ABObj root
);
/* Function which returns the correct
* Composite SubObj corresponding to 'type'
*/
extern ABObj objxm_comp_get_subobj(
ABObj obj,
AB_CFG_OBJ_TYPE type
);
/* Function which configures an object with the
* the standard labeled-structure (container
* managing Label & Main-object)
*/
extern int objxm_comp_config_labeled_obj(
ABObj obj,
AB_OBJECT_TYPE obj_type,
STRING obj_suffix,
STRING obj_classname
);
/* Function which collapses a labeled object
* back down into a single Main-object
*/
extern int objxm_comp_unconfig_labeled_obj(
ABObj obj
);
/* Function which builds a Menu-reference object
* if "menu_name" is non-NULL
*/
extern ABObj objxm_comp_config_menu_ref(
ABObj obj
);
/* Function which finds & destroys a Menu-reference
* object if one exists
*/
extern int objxm_comp_unconfig_menu_ref(
ABObj obj
);
/* Function which makes the RootObj a "Frame" and
* creates a new SubObj directly underneath to
* represent the actual Obj.
*/
extern ABObj objxm_comp_config_border_frame(
ABObj obj
);
/* Function that collapses a Composite Obj configured
* with a Frame as the Root, back down to an Obj
* without a Frame.
*/
extern int objxm_comp_unconfig_border_frame(
ABObj obj
);
/*
* Xm Instantiation/Change/Destruction routines
*/
/* Instantiate widgets for an entire tree
* NOTE: for instantiating large trees at once
* (like loading BIL or UIL, set "manage_last" to
* TRUE! (if instantiating a single object or small
* group of objects, set it to FALSE).
*/
extern int objxm_tree_instantiate(
ABObj root,
BOOL manage_last
);
/* Destroy Widgets in a tree and set ui_handles=NULL
* NOTE: this does NOT destroy the Objs
*/
extern int objxm_tree_uninstantiate(
ABObj root,
BOOL top_most
);
/* Destroy Widgets AND Objs for an entire tree
*/
extern int objxm_tree_destroy(
ABObj root
);
/* Instantiate any changes made to the
* Composite-obj
* Return whether or not New widgets were
* created as a result of the changes
*/
extern int objxm_comp_instantiate_changes(
ABObj obj,
BOOL *new_widgets
);
extern int objxm_tree_instantiate_changes(
ABObj obj,
BOOL *new_widgets
);
extern int objxm_comp_set_item_selection(
ABObj obj
);
/*
* Routines to Temporarily Instantiate/Destroy Menus
*/
extern int objxm_instantiate_menus(
ABObj root
);
extern int objxm_destroy_menus(
ABObj root
);
extern int objxm_create_popup_menu_title(
ABObj menu_ref,
OBJXM_CONFIG_TYPE ctype,
STRING title
);
/*
* Routines to Store default Translations & Obj pointer
* inside widget's userData
*/
extern int objxm_store_obj_and_actions(
Widget w,
ABObj obj
);
extern int objxm_free_obj_and_actions(
Widget w
);
extern ABObj objxm_get_obj_from_widget(
Widget w
);
extern XtTranslations
objxm_get_actions_from_widget(
Widget w
);
/*
* Xm Map/Unmap routine
*/
extern int objxm_tree_map(
ABObj root,
BOOL map
);
/*
* Object-specific methods
*/
extern ABObj objxm_comp_mainwin_get_area(
ABObj obj,
AB_CONTAINER_TYPE area_type
);
extern ABObj objxm_comp_custdlg_get_area(
ABObj obj,
AB_CONTAINER_TYPE area_type
);
/*
* Xm Resource-setting routines
*/
/* Set Xm resource lists for entire tree
*/
extern int objxm_tree_set_ui_args(
ABObj root,
OBJXM_CONFIG_TYPE ctype,
BOOL replace
);
/* Remove Xm resource lists for entire tree */
extern int objxm_tree_remove_ui_args(
ABObj root,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list for a Composite object
* hierarchy
*/
extern int objxm_comp_set_ui_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype,
BOOL replace
);
/* Set Xm resources that can only be set AFTER
* ALL WIDGETS have been instantiated
*/
extern int objxm_tree_set_post_inst_args(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
extern int objxm_obj_set_post_inst_args(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list corresponding to
* attachment properties for a Composite object
* hierarchy
*/
extern int objxm_comp_set_attachment_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list corresponding to
* attachment properties for a single object
*/
extern int objxm_obj_set_attachment_args(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list corresponding to
* color properties for a Composite object
* hierarchy
*/
extern int objxm_comp_set_color_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype,
unsigned int flag
);
/* Set Xm resources for "default button" within a
* dialog's button-panel
*/
extern int objxm_comp_set_default_button_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
/* Set the Label type/value resources
* for a Composite object hierarchy
*/
extern int objxm_comp_set_label_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list corresponding to
* label alignment properties for a
* Composite object hierarchy
*/
extern int objxm_comp_set_lbl_align_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list correspondin gto
* label positioning for a Composite object
* hierarchy
*/
extern int objxm_comp_set_lbl_pos_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
extern int objxm_comp_set_icon_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list corresponding to
* Border-frame style for a Composite object
* hierarchy
*/
extern int objxm_comp_set_border_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
extern int objxm_comp_set_read_only_args(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype
);
/* Set Xm resource list corresponding to
* the MessageBox object's buttons.
*/
extern int objxm_comp_set_msgbox_button_arg(
ABObj comproot,
OBJXM_CONFIG_TYPE ctype,
unsigned char which_btn
);
extern int objxm_obj_set_arrow_style_arg(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
extern int objxm_obj_set_direction_arg(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
extern int objxm_obj_set_line_style_arg(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
extern int objxm_obj_set_orientation_arg(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
extern int objxm_obj_set_selection_arg(
ABObj obj,
OBJXM_CONFIG_TYPE ctype
);
extern Widget objxm_set_widget(
ABObj obj,
Widget widget
);
extern Widget objxm_get_widget(
ABObj obj
);
extern WidgetClass
objxm_get_class_ptr(
STRING class_name
);
/*
* Connections stuff
*/
extern ABObj objxm_comp_get_source_for_when(
ABObj sourceObj,
AB_WHEN when
);
extern ABObj objxm_comp_get_target_for_builtin_action(
ABObj targetObj,
AB_BUILTIN_ACTION builtin_action
);
extern STRING objxm_get_resource_for_when(
ABObj sourceObj,
AB_WHEN when
);
extern STRING objxm_get_resource_for_builtin_action(
ABObj targetObj,
AB_BUILTIN_ACTION builtin_action
);
/* Return number of resource args presently
* set in ArgList
*/
extern int objxm_get_num_args(
ArgList arglist
);
/* Return number of resource args presently in object's
* ui_arg_list
*/
extern int objxm_obj_get_num_ui_args(
ABObj obj
);
/* Return default motif widget-class name
* for a given object's type
*/
extern STRING objxm_obj_get_default_motif_class(
ABObj obj
);
/* Return to Motif Create function for
* the Obj
*/
extern XmCreateFunc
objxm_obj_get_xmcreate_func(
ABObj obj
);
/* Set resource (name/value) in ArgList
*/
extern int objxm_set_arg(
ArgList *p_arglist,
AB_ARG_TYPE type,
String name,
XtArgVal value
);
/* Set a Literal type (name/value) in ArgList
*/
extern int objxm_set_literal_arg(
OBJXM_CONFIG_TYPE ctype,
ArgList *p_arglist,
String name,
unsigned char literal
);
/* Set a Widget type (name/value) in ArgList
*/
extern int objxm_set_widget_arg(
OBJXM_CONFIG_TYPE ctype,
ArgList *p_arglist,
String name,
ABObj w_obj
);
/* Set resource (name/value) in ArgList
* only if not already present
*/
extern int objxm_set_arg_if_new(
ArgList *p_arglist,
AB_ARG_TYPE type,
String name,
XtArgVal value
);
/* Remove resource (name/value) from ArgList
*/
extern int objxm_remove_arg(
ArgList *p_arglist,
String name
);
/* Remove all resources from ArgList
*/
extern void objxm_remove_all_args(
ArgList *p_arglist,
OBJXM_CONFIG_TYPE ctype
);
extern Arg *objxm_get_arg(
ArgList arglist,
char *name
);
/* FOR DEBUG PURPOSES ONLY */
extern int objxm_dump_arglist(
ABObj obj,
ArgList args,
int num_args
);
extern int objxm_dump_arglist_indented(
ABObj obj,
ArgList args,
int num_args,
int spaces
);
/* FOR DEBUG PURPOSES ONLY */
extern int objxm_dump_widget_geometry(
Widget widget
);
/*
* Xm String cache routines
*/
/* Load internal resource tables with
* required Xt/Xm resources/enums/createfuncs
*/
extern void objxm_strs_init(
);
/* return "strname" corresponding to xmname
*/
extern ISTRING objxm_get_res_strname(
String xmname
);
/* return "xmname" corresponding to strname
*/
extern String objxm_get_res_xmname(
ISTRING strname
);
/* return type corresponding to resource strname
*/
extern AB_ARG_TYPE objxm_get_istr_res_type(
ISTRING strname
);
/* return type corresponding to resource xmname
*/
extern AB_ARG_TYPE objxm_get_res_type(
String xmname
);
/* return arg class corresponding to resource strname
*/
extern AB_ARG_CLASS objxm_get_istr_res_class(
ISTRING strname
);
/* return arg class corresponding to resource xmname
*/
extern AB_ARG_CLASS objxm_get_res_class(
String xmname
);
/* return whether or not the value is defined as the
* "default" for that resource
*/
extern BOOL objxm_res_value_is_default(
String xmname,
WidgetClass wclass,
XtArgVal value
);
/* return "strdef" corresponding to xmdef
*/
extern ISTRING objxm_get_enum_strdef(
String xmname,
unsigned char xmdef
);
/* return "xmdef" corresponding to strdef
*/
extern unsigned char
objxm_get_enum_xmdef(
String xmname,
ISTRING strdef
);
/* return "ftnstr" corresponding to ftn
*/
extern ISTRING objxm_get_xmcreate_ftnstr(
XmCreateFunc ftn
);
/* return "ftn" corresponding to ftnstr
*/
XmCreateFunc objxm_get_xmcreate_xmdef(
ISTRING ftnstr
);
/*
* Xm Utility routines
*/
extern BOOL objxm_color_exists(
String colorname
);
extern int objxm_name_to_pixel(
Widget widget,
String colorname,
Pixel *pixel_p
);
extern int objxm_filebase_to_pixmap(
Widget widget,
String filebase,
Pixmap *pixmap_p
);
extern STRING objxm_pixmap_conversion_error_msg(
ABObj obj,
STRING filebase,
int status
);
extern XFontStruct *
objxm_fontlist_to_font(
XmFontList fontlist
);
extern XmString objxm_str_to_xmstr(
Widget widget,
String string
);
extern STRING objxm_xmstr_to_str(
XmString xmstr
);
extern String objxm_accel_to_acceltext(
String accelstr
);
extern unsigned char
objxm_linestyle_to_enum(
AB_LINE_TYPE linestyle
);
extern BOOL objxm_is_menu_widget(
Widget widget
);
/*
* Debugging functions
*/
int objxm_print(ABObj obj);
int objxm_print_indented(ABObj obj, int spaces, int verbosity);
int objxm_tree_print(ABObj obj);
int objxm_tree_print_indented(ABObj obj, int spaces, int verbosity);
/*
* Xm Resource Setting macros
*/
#define objxm_obj_set_ui_arg(obj, type, name, val) \
objxm_set_arg((ArgList*)&((obj)->ui_args), type, name, (XtArgVal)val)
#define objxm_obj_set_literal_ui_arg(obj, ctype, name, enum) \
objxm_set_literal_arg(ctype, (ArgList*)&((obj)->ui_args), name, enum)
#define objxm_obj_set_widget_ui_arg(obj, ctype, name, w_obj) \
objxm_set_widget_arg(ctype, (ArgList*)&((obj)->ui_args), name, w_obj)
#define objxm_obj_remove_ui_arg(obj, name) \
objxm_remove_arg((ArgList*)&((obj)->ui_args), name)
#define objxm_obj_remove_all_ui_args(obj, t) objxm_remove_all_args((ArgList*)&((obj)->ui_args), t)
#define objxm_obj_get_ui_args(obj) ((ArgList)((obj)->ui_args))
#define objxm_obj_get_num_ui_args(obj) \
(objxm_get_num_args(objxm_obj_get_ui_args(obj)))
#define objxm_obj_get_ui_arg(obj,name) \
(objxm_get_arg(objxm_obj_get_ui_args(obj),(name)))
/*************************************************************************
** **
** INLINE IMPLEMENTATION **
** **
*************************************************************************/
#define objxm_set_widget(obj,w) ((obj)->ui_handle = ((void *)(w)))
#define objxm_get_widget(obj) ((Widget)((obj)->ui_handle))
#endif /* _OBJXM_H_ */

View File

@@ -0,0 +1,243 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: pal.h /main/3 1995/11/06 17:35:34 rswiston $
*
* @(#)pal.h 1.32 01 Feb 1995 cde_app_builder/src/ab
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* pal.h - implements the palette object mechanism
*/
#ifndef _PAL_H_
#define _PAL_H_
#include <X11/Intrinsic.h>
#include <ab_private/obj.h>
#include <ab_private/proj.h>
/*
* AppBuilder Property sheet types: Revolving & fixed
*/
typedef enum
{
AB_PROP_UNDEF = 0,
AB_PROP_REVOLVING,
AB_PROP_FIXED,
AB_PROP_TYPE_NUM_VALUES /* number of valid values - MUST BE LAST */
/* ANSI: no comma after last enum item! */
} AB_PROP_TYPE;
typedef struct _PAL_ITEM_INFO PalItemInfo;
typedef struct _PAL_EDITABLE_OBJ_INFO PalEditableObjInfo;
/*
* define types for palette item "methods"
*/
typedef int (*PalItemInitProc) (
ABObj
);
typedef Widget (*PalItemPropInitProc) (
Widget,
AB_PROP_TYPE
);
typedef int (*PalItemPropClearProc) (
AB_PROP_TYPE
);
typedef int (*PalItemPropActiveProc) (
AB_PROP_TYPE,
BOOL
);
typedef int (*PalItemPropLoadProc) (
ABObj,
AB_PROP_TYPE,
unsigned long
);
typedef int (*PalItemPropApplyProc) (
AB_PROP_TYPE
);
typedef BOOL (*PalItemPropPendingFunc)(
AB_PROP_TYPE
);
typedef BOOL (*PalItemIsaFunc) (
ABObj
);
typedef struct _PAL_SUBTYPE_INFO {
int subtype;
String subname;
Pixmap pixmap;
unsigned int pmwidth;
unsigned int pmheight;
} PalSubtypeInfo;
/*
* Palette Item Info Structure - one for each type of object supported
*/
typedef struct _PAL_ITEM_INFO {
/* Data...*/
AB_OBJECT_TYPE type; /* AB type */
char *name; /* virtual name */
PalSubtypeInfo *subinfo; /* specific subtype info */
int num_subinfo; /* number of subtypes */
Widget rev_prop_frame; /* revolving prop sheet */
Widget fix_prop_dialog; /* fixed prop sheet */
/* Methods...*/
PalItemInitProc initialize; /* initializes instance */
PalItemIsaFunc is_a_test; /* "is a" test */
PalItemPropInitProc prop_initialize; /* creates prop sheet */
PalItemPropActiveProc prop_activate; /* sets prop sheet active/inactive */
PalItemPropClearProc prop_clear; /* clears prop sheet */
PalItemPropLoadProc prop_load; /* loads prop sheet */
PalItemPropApplyProc prop_apply; /* applys properties to obj */
PalItemPropPendingFunc prop_pending; /* checks for pending changes */
} PAL_ITEM_INFO;
typedef struct _PAL_EDITABLE_OBJ_INFO {
AB_OBJECT_TYPE type;
int subtype;
ISTRING name;
PalItemInfo *palitem;
PalEditableObjInfo *next;
} PAL_EDITABLE_OBJ_INFO;
typedef BOOL (*PalEditableObjTestFunc) (
PalEditableObjInfo *edobj_info
);
extern PalItemInfo *ab_button_palitem;
extern PalItemInfo *ab_choice_palitem;
extern PalItemInfo *ab_combo_box_palitem;
extern PalItemInfo *ab_cpanel_palitem;
extern PalItemInfo *ab_custdlg_palitem;
extern PalItemInfo *ab_drawp_palitem;
extern PalItemInfo *ab_label_palitem;
extern PalItemInfo *ab_group_palitem;
extern PalItemInfo *ab_list_palitem;
extern PalItemInfo *ab_mainwin_palitem;
extern PalItemInfo *ab_menu_palitem;
extern PalItemInfo *ab_menubar_palitem;
extern PalItemInfo *ab_scale_palitem;
extern PalItemInfo *ab_separator_palitem;
extern PalItemInfo *ab_spinbox_palitem;
extern PalItemInfo *ab_termp_palitem;
extern PalItemInfo *ab_textf_palitem;
extern PalItemInfo *ab_textp_palitem;
extern PalItemInfo *ab_fchooser_palitem;
extern PalItemInfo *ab_panedwin_palitem;
extern void pal_register_item_info(
Widget pwidget,
PalItemInfo *palitem,
int subtype,
String subname,
Pixmap pixmap
);
extern void pal_enable_item_drag(
Widget item_widget,
int subtype
);
extern PalItemInfo *pal_get_item_info(
ABObj obj
);
extern PalItemInfo* pal_get_type_item_info(
AB_OBJECT_TYPE type,
int subtype
);
extern Pixmap pal_get_item_pixmap(
ABObj obj,
int subtype,
int *p_width,
int *p_height
);
extern STRING pal_get_item_subname(
ABObj obj,
int subtype
);
extern void pal_register_editable_obj(
AB_OBJECT_TYPE type,
int subtype,
STRING name,
PalItemInfo *palitem
);
extern PalEditableObjInfo *
pal_get_editable_obj_info(
ABObj obj
);
extern void pal_add_editable_obj_menu_items(
Widget menu_pane,
XtCallbackProc item_cb,
PalEditableObjTestFunc test_func
);
extern int pal_initialize_obj(
ABObj obj
);
extern int pal_create_menu(
AB_PROP_TYPE type,
ABObj module,
STRING menu_name,
STRING menu_title
);
extern void pal_set_File_menu(
AB_CHOOSER_TYPE chooser_type,
BOOL active
);
#endif /* _PAL_H_ */

View File

@@ -0,0 +1,264 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: proj.h /main/3 1995/11/06 17:45:59 rswiston $
*
* @(#)proj.h 1.11 16 Feb 1994 cde_app_builder/src/
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* proj.h
* Header file for the project window
*/
#ifndef _PROJ_H_
#define _PROJ_H_
#include <Xm/Xm.h>
#include <ab_private/ui_util.h>
#include "dtb_utils.h"
#define IMPORT_BY_REF 0
#define IMPORT_BY_COPY 1
#define IMPORT_AS_BIL 2
#define IMPORT_AS_UIL 3
typedef enum {
AB_OPEN_PROJ_CHOOSER = 0,
AB_SAVE_PROJ_AS_CHOOSER,
AB_IMPORT_CHOOSER,
AB_EXPORT_CHOOSER,
AB_SAVE_MOD_AS_CHOOSER,
AB_CHOOSER_TYPE_NUM_VALUES
} AB_CHOOSER_TYPE;
typedef enum
{
PROJ_STATUS_MOD_PATH,
PROJ_STATUS_PROJ_PATH, /* number of valid values - MUST BE LAST */
PROJ_STATUS_NUM_VALUES
/* ANSI: no comma after last enum item! */
} PROJ_STATUS_INFO;
typedef struct {
Widget child;
AB_CHOOSER_TYPE chooser_type;
BOOL ImportAsBil;
BOOL ImportByCopy;
BOOL writeEncapsulated;
} ChooserInfoRec, *ChooserInfo;
/*
* This is only used for projects right now, but it can be used for other
* types of saves, as well.
*/
#define AB_SAVE_CANCELLED (-1) /* errors are negative */
#define AB_SAVE_NORMAL 1
#define AB_SAVE_SAVE_AS 2
typedef int ProjSaveCallbackFuncRec(int status);
typedef ProjSaveCallbackFuncRec *ProjSaveCallbackFunc;
int proj_init(void);
void proj_add_objects(
AB_OBJ *obj
);
void proj_delete_objects(
AB_OBJ *obj
);
void proj_register_actions(
XtAppContext app
);
void proj_select(
AB_OBJ *module
);
void proj_deselect(
AB_OBJ *module
);
void proj_toggle_select(
AB_OBJ *module
);
extern int proj_set_project(
ABObj project
);
extern int proj_destroy_project(
ABObj proj
);
extern ABObj proj_get_project(
);
extern int proj_set_cur_module(
ABObj module
);
extern ABObj proj_get_cur_module(
);
extern int proj_rename_module(
ABObj module,
STRING name
);
extern void proj_update_node(
ABObj obj
);
extern int proj_update_stat_region(
PROJ_STATUS_INFO type,
STRING value
);
extern BOOL proj_check_unsaved_edits(
ABObj root
);
extern void proj_create_new_proj(
STRING proj_name
);
extern void proj_name_proj( void );
extern int proj_set_files_exploded(ABObj project);
extern int proj_unset_files_exploded(ABObj project);
extern void proj_show_save_as_proj_chooser(
Widget widget
);
extern void proj_show_name_dlg(
ABObj module,
Widget parent
);
extern void proj_show_export_bil_chooser(
Widget widget,
ABObj obj
);
extern BOOL proj_is_exploded(ABObj project);
extern int proj_overwrite_existing_file(
char *file,
ABObj obj,
BOOL encapsulating,
BOOL Exporting,
BOOL changed_dir,
STRING old_proj_dir,
DTB_MODAL_ANSWER *answer
);
extern void proj_save_needed(
ProjSaveCallbackFunc saveDoneCB /* may be NULL */
);
extern int proj_save_encapsulated(
ABObj obj,
STRING file_name
);
extern int proj_save_exploded( /* one file per module */
ABObj obj,
char *exp_path,
BOOL changed_dir,
BOOL encap_file
);
extern int proj_show_proj_dir(void);
extern void proj_open_proj_okCB(
Widget widget,
XtPointer client_data,
XmSelectionBoxCallbackStruct *call_data
);
extern void proj_cancelCB(
Widget widget,
XtPointer client_data,
XmSelectionBoxCallbackStruct *call_data
);
extern void proj_unmap_chooserCB(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void proj_show_save_proj_as_chooser(
Widget widget,
ProjSaveCallbackFunc saveDoneCB
);
extern void proj_show_dialog(void);
extern void proj_import_okCB(
Widget widget,
XtPointer client_data,
XmSelectionBoxCallbackStruct *call_data
);
extern STRING proj_cvt_mod_file_to_rel_path(
STRING mod_path,
STRING proj_path
);
extern void proj_set_menus(
AB_CHOOSER_TYPE chooser_type,
BOOL active
);
extern Boolean proj_verify_name(
STRING new_name,
BOOL ObjIsModule,
DtbMessageData msgData,
Widget parent,
ABObj newObj
);
#endif /* _PROJ_H_ */

View File

@@ -0,0 +1,83 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: projP.h /main/3 1995/11/06 17:46:14 rswiston $
*
* @(#)projP.h 1.5 15 Feb 1994 cde_app_builder/src/
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* projP.h
* Private declarations for project window
*/
#ifndef _PROJP_H
#define _PROJP_H
#include <ab_private/proj.h>
#include "proj_ui.h"
extern void projP_show_save_as_bil_chooser(
Widget widget,
ABObj obj
);
extern int projP_write_out_bil_file(
ABObj obj,
char *exp_path,
STRING old_proj_dir,
BOOL Exporting
);
extern int projP_save_export_bil(
ABObj module_obj,
STRING fullpath,
BOOL Exporting
);
extern void projP_store_viewer(
Widget widget,
XtPointer client_data,
XtPointer call_data
);
extern void projP_update_menu_items(
int old_count,
int new_count
);
#endif /* _PROJP_H */

View File

@@ -0,0 +1,690 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: prop.h /main/5 1996/08/08 17:58:47 mustafa $
*
* @(#)prop.h 1.75 95/04/20 Copyright 1993 Sun Microsystems
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* prop.h - defines structures/routines required for property sheets
*/
#ifndef _PROPS_H_
#define _PROPS_H_
#include <X11/Intrinsic.h>
#if !defined(CSRG_BASED)
#include <values.h>
#endif
#include <limits.h>
#include <ab_private/obj.h>
#include <ab_private/pal.h>
#include <ab_private/abobj_edit.h>
#include "revolv_ui.h"
#define SIZE_OF_CONTENTS_KEY -1
#define SIZE_FIXED_KEY 0
#define SIZE_IN_CHARS_KEY 88
#define SIZE_IN_PIXELS_KEY 99
#define EDIT_CHANGE 111
#define HELP_ITEM_KEY 222
#define DISMISS_ITEM_KEY 333
#define ACTION1_ITEM_KEY 444
#define ACTION2_ITEM_KEY 555
#define ACTION3_ITEM_KEY 777
#define CANCEL_ITEM_KEY 888
#define SHOW_VALUE_KEY 999
/*
* Load Flags - defines which attributes need to be loaded
*/
#define LoadClear 0x0000
#define LoadAll 0x0001
#define LoadName 0x0002
#define LoadPosition 0x0004
#define LoadSize 0x0008
/*
* Enum values for Changebar State
*/
typedef enum
{
PROP_CB_OFF,
PROP_CB_ON,
PROP_CB_NUM_VALUES
} PROP_CB_STATE;
#define ERR_ATOI MAXINT
/*
* Item Editing Insert choices
*/
typedef enum
{
INSERT_AFTER = 6, /* prevent conflict with AB_EDIT_ enums */
INSERT_BEFORE,
INSERT_TOP,
INSERT_BOTTOM,
INSERT_NUM_VALUES
} INSERT_TYPE;
/*
* Geometry Keys
*/
typedef enum
{
GEOM_X,
GEOM_Y,
GEOM_WIDTH,
GEOM_HEIGHT,
GEOM_NUM_VALUES
} GEOM_KEY;
extern char *LabelForString;
extern char *LabelForGraphic;
extern char *NoneItem;
extern char *XFieldStr;
extern char *YFieldStr;
extern char *WFieldStr;
extern char *HFieldStr;
extern char *OffsetFieldStr;
extern char *PercentageFieldStr;
extern char *RowColFieldStr;
extern char *VertSpacingFieldStr;
extern char *HorizSpacingFieldStr;
/*
* Structures to store Prop Sheet Setting Widgets
*/
typedef struct _PROP_CHECKBOX_SETTING {
Widget label;
Widget checkbox;
Widget changebar;
} PropCheckboxSettingRec, *PropCheckboxSetting;
typedef struct _PROP_COLOR_SETTING {
Widget label;
Widget menubutton;
Widget swatch;
Widget field;
Widget changebar;
} PropColorSettingRec, *PropColorSetting;
typedef struct _PROP_OBJ_COMBOBOX_SETTING {
Widget label;
Widget combobox;
Widget list;
Widget changebar;
ABObj *current_obj_ptr;
} PropObjComboboxSettingRec, *PropObjComboboxSetting;
typedef struct _PROP_FIELD_SETTING {
Widget label;
Widget field;
Widget changebar;
} PropFieldSettingRec, *PropFieldSetting;
typedef struct _PROP_FOOTER_SETTING {
Widget label;
Widget checkbox;
Widget field;
Widget changebar;
} PropFooterSettingRec, *PropFooterSetting;
typedef struct _PROP_GEOMETRY_SETTING {
Widget label;
Widget x_label;
Widget x_field;
Widget y_label;
Widget y_field;
Widget w_label;
Widget w_field;
Widget h_label;
Widget h_field;
Widget changebar;
} PropGeometrySettingRec, *PropGeometrySetting;
typedef struct _PROP_MENUNAME_SETTING {
AB_PROP_TYPE prop_type;
Widget label;
Widget menubutton;
Widget field;
Widget owner_name_field;
Widget changebar;
PropFieldSetting menu_title_pfs;
ABObj *current_obj_ptr;
} PropMenunameSettingRec, *PropMenunameSetting;
typedef struct _PROP_OPTIONS_SETTING {
Widget label;
Widget optionbox;
Widget menu;
Widget changebar;
} PropOptionsSettingRec, *PropOptionsSetting;
typedef struct _PROP_OBJ_OPTIONS_SETTING {
PropOptionsSettingRec options;
BOOL display_module;
ABObj *current_obj_ptr;
ABObjTestFunc obj_test_func;
ABObj search_root;
} PropObjOptionsSettingRec, *PropObjOptionsSetting;
typedef struct _PROP_RADIO_SETTING {
Widget label;
Widget radiobox;
Widget changebar;
} PropRadioSettingRec, *PropRadioSetting;
typedef struct _PROP_ITEMS_SETTING {
AB_ITEM_TYPE item_type;
Widget item_list;
Widget item_menu;
PropFieldSetting item_label_pfs;
PropOptionsSetting item_label_type_pos;
PropFieldSetting item_mnemonic_pfs;
PropFieldSetting item_accel_pfs;
PropOptionsSetting item_line_style_pos;
PropCheckboxSetting item_state_pcs;
PropMenunameSetting item_menuname_pms;
Widget changebar;
ABObj current_item;
ABObj clipboard_item;
ABObj *current_obj_ptr;
} PropItemsSettingRec, *PropItemsSetting;
/*
* Prop Dialog Management Functions
*/
/* Prop module Initialization
*/
extern void prop_init(
Widget toplevel
);
/* Property Dialog "Popup" routines
*/
extern void prop_show_dialog(
Widget w,
XtPointer client_data,
XtPointer call_data
);
extern void prop_show_fixed(
PalItemInfo *palitem
);
extern void prop_show_menu_props(
Widget w,
XtPointer client_data,
XtPointer call_data
);
extern void prop_show_group_props(
Widget w,
XtPointer client_data,
XtPointer call_data
);
extern void prop_load_obj(
ABObj obj,
AB_PROP_TYPE ptype
);
/* Prop Dialog Initialization Functions
*/
extern void prop_activate_panel_init(
AB_PROP_TYPE type,
PalItemInfo *palitem,
Widget ok_button,
Widget apply_button,
Widget reset_button,
Widget cancel_button,
Widget help_button
);
extern void prop_editors_panel_init(
AB_PROP_TYPE type,
PalItemInfo *palitem,
Widget attach_ed_button,
Widget conn_ed_button,
Widget help_ed_button
);
extern void prop_fixed_dialog_init(
PalItemInfo *palitem,
Widget dialog,
Widget list
);
/* Checkbox Setting Functions
*/
extern void prop_checkbox_init(
PropCheckboxSetting pcs,
Widget label,
Widget checkbox,
int num_items,
WidgetList items,
int *item_keys,
Widget changebar
);
extern BOOL prop_checkbox_get_value(
PropCheckboxSetting pcs,
int itemkey
);
extern int prop_checkbox_set_value(
PropCheckboxSetting pcs,
int itemkey,
BOOL value,
BOOL trip_changebar
);
/* Color Field Functions
*/
extern void prop_colorfield_init(
PropColorSetting pcs,
Widget menubutton,
Widget none_item,
Widget chooser_item,
Widget swatch,
Widget field,
Widget changebar
);
extern int prop_colorfield_set_value(
PropColorSetting pcs,
STRING colorname, /* NULL clears swatch */
BOOL trip_changebar
);
/* Caller must free memory allocated for return String */
extern STRING prop_colorfield_get_value(
PropColorSetting pcs
);
/* REMIND: ComboBox has too many bugs to use right now; if
* we never revert back to using it, delete these functions
*/
/* Object Combobox Functions
*/
extern void prop_obj_combobox_init(
PropObjComboboxSetting pcs,
Widget label,
Widget combobox,
Widget changebar,
ABObj *current_obj_ptr
);
extern ABObj prop_obj_combobox_get_value(
PropObjComboboxSetting pcs
);
extern int prop_obj_combobox_set_value(
PropObjComboboxSetting pcs,
ABObj obj,
BOOL trip_changebar
);
extern void prop_obj_combobox_load(
PropObjComboboxSetting pcs,
ABObj root,
ABObjTestFunc obj_test_func
);
/* TextField Functions
*/
extern void prop_field_init(
PropFieldSetting pfs,
Widget label,
Widget field,
Widget changebar
);
/* Caller must free memory allocated for return String */
extern STRING prop_field_get_value(
PropFieldSetting pfs
);
extern int prop_field_get_numeric_value(
PropFieldSetting pfs
);
extern int prop_field_set_value(
PropFieldSetting pfs,
STRING value,
BOOL trip_changebar
);
extern int prop_field_set_numeric_value(
PropFieldSetting pfs,
int value,
BOOL trip_changebar
);
/* Footer Setting Functions
*/
extern void prop_footer_init(
PropFooterSetting pfs,
Widget label,
Widget checkbox,
int num_items,
WidgetList items,
int *item_keys,
Widget field,
Widget changebar
);
/* Item Editor Functions
*/
extern void prop_item_editor_init(
PropItemsSetting pis,
AB_ITEM_TYPE type,
Widget list,
Widget changebar,
Widget add_button,
int insert_count,
WidgetList insert_items,
int *insert_enums,
int edit_count,
WidgetList edit_items,
int *edit_enums,
PropFieldSetting label_pfs,
PropOptionsSetting label_type_pos,
Widget label_graphic_hint,
PropFieldSetting mnemonic_pfs,
PropFieldSetting accel_pfs,
PropOptionsSetting line_style_pos,
PropCheckboxSetting state_pcs,
PropMenunameSetting menuname_pms,
ABObj *current_obj_ptr
);
extern void prop_item_editor_apply(
PropItemsSetting pis
);
extern void prop_item_editor_clear(
PropItemsSetting pis
);
extern void prop_item_editor_load(
PropItemsSetting pis,
ABObj obj
);
extern void prop_item_change(
PropItemsSetting pis,
BOOL reselect
);
extern void prop_item_edit(
PropItemsSetting pis,
AB_EDIT_TYPE etype
);
extern STRING prop_item_get_namebase(
ABObj iobj
);
extern int prop_item_insert(
PropItemsSetting pis,
INSERT_TYPE itype,
ABObj iobj
);
extern void prop_item_labeltypeCB(
Widget w,
XtPointer client_data,
XtPointer call_data
);
/* Geometry Field Functions
*/
extern void prop_geomfield_init(
PropGeometrySetting pgs,
Widget label,
Widget x_label,
Widget x_field,
Widget y_label,
Widget y_field,
Widget w_label,
Widget w_field,
Widget h_label,
Widget h_field,
Widget changebar
);
extern int prop_geomfield_get_value(
PropGeometrySetting pgs,
GEOM_KEY gkey
);
extern int prop_geomfield_set_value(
PropGeometrySetting pgs,
GEOM_KEY gkey,
int gvalue,
BOOL trip_changebar
);
extern int prop_geomfield_clear(
PropGeometrySetting pgs,
GEOM_KEY gkey
);
extern void prop_size_policyCB(
Widget w,
XtPointer client_data,
XtPointer call_data
);
extern void prop_load_obj_position(
ABObj obj,
PropGeometrySetting pgs
);
extern void prop_load_obj_size(
ABObj obj,
PropGeometrySetting pgs
);
/* Menu Name Field Functions
*/
extern void prop_menuname_init(
PropMenunameSetting pms,
AB_PROP_TYPE ptype,
Widget label,
Widget menubutton,
Widget field,
Widget owner_name_field,
Widget changebar,
PropFieldSetting menu_title_pfs,
ABObj *current_obj_ptr,
BOOL new_item_ok
);
/* Caller must free memory allocated for return String */
extern STRING prop_menuname_get_value(
PropMenunameSetting pms
);
extern int prop_menuname_set_value(
PropMenunameSetting pms,
STRING value,
BOOL trip_changebar
);
/* Option Menu Functions
*/
extern void prop_options_init(
PropOptionsSetting pos,
Widget label,
Widget optionbox,
Widget menu,
int num_items,
WidgetList items,
XtPointer *item_vals,
Widget changebar
);
extern XtPointer prop_options_get_value(
PropOptionsSetting pos
);
extern int prop_options_set_value(
PropOptionsSetting pos,
XtPointer value,
BOOL trip_changebar
);
extern int prop_options_remove_value(
PropOptionsSetting pos,
XtPointer value,
BOOL trip_changebar
);
/* Object OptionMenu Functions
*/
extern void prop_obj_options_init(
PropObjOptionsSetting pos,
Widget label,
Widget optionbox,
Widget menu,
int num_items,
WidgetList items,
XtPointer *item_vals,
Widget changebar,
BOOL display_module,
ABObj *current_obj_ptr,
ABObjTestFunc obj_test_func
);
extern ABObj prop_obj_options_get_value(
PropObjOptionsSetting pos
);
extern int prop_obj_options_set_value(
PropObjOptionsSetting pos,
ABObj obj,
BOOL trip_changebar
);
extern void prop_obj_options_load(
PropObjOptionsSetting pos,
ABObj search_root
);
/* Radiobox Functions
*/
extern void prop_radiobox_init(
PropRadioSetting prs,
Widget label,
Widget radiobox,
int num_items,
WidgetList items,
XtPointer *item_vals,
Widget changebar
);
extern int prop_radiobox_get_value(
PropRadioSetting prs
);
extern int prop_radiobox_set_value(
PropRadioSetting prs,
XtPointer value,
BOOL trip_changebar
);
extern void prop_label_field_init(
PropFieldSetting label_pfs,
Widget graphic_hint,
WidgetList labeltype_items,
int num_items
);
extern void prop_setup_label_field(
PropFieldSetting label_pfs,
PropOptionsSetting label_line_style_pos,
AB_LABEL_TYPE ltype,
STRING label,
AB_LINE_TYPE line_style
);
/*
* Changebar Management Routines
*/
extern BOOL prop_changed(
Widget changebar
);
extern BOOL prop_changebars_pending(
Widget prop_form
);
extern void prop_changebars_cleared(
Widget prop_form
);
extern void prop_set_changebar(
Widget changebar,
int state
);
/*
* Prop Setting Verification Routines
*/
extern int prop_str_to_int(
STRING str
);
extern BOOL prop_string_ok(
Widget field,
const char *chars,
BOOL display_notice
);
extern BOOL prop_identifier_ok(
Widget field
);
extern BOOL prop_name_ok(
ABObj obj,
Widget field
);
extern BOOL prop_graphic_filename_ok(
Widget field,
BOOL empty_ok
);
extern BOOL prop_obj_name_ok(
Widget field,
ABObj root,
AB_OBJECT_TYPE objtype,
STRING objtype_name
);
extern BOOL prop_submenu_name_ok(
Widget field,
ABObj owner
);
extern BOOL prop_color_ok(
Widget field
);
extern BOOL prop_number_ok(
Widget field,
STRING field_name,
int min,
int max
);
extern BOOL prop_help_item_ok(
Widget list,
ABObj item_obj
);
#endif /* _PROP_H_ */

View File

@@ -0,0 +1,126 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: propP.h /main/3 1995/11/06 17:48:54 rswiston $
*
* @(#)propP.h 1.7 95/04/27 Copyright 1993 Sun Microsystems
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* propP.h - Module-private defines structures/routines required for
* property sheets
*/
#ifndef _PROPP_H_
#define _PROPP_H_
#include <X11/Intrinsic.h>
#if !defined(CSRG_BASED)
#include <values.h>
#endif
#include <ab_private/obj.h>
#include <ab_private/pal.h>
#include <ab_private/abobj_edit.h>
/*
* Enum values for Prop Sheet Mode
*/
typedef enum
{
PROP_LOAD,
PROP_EDIT,
PROP_MODE_NUM_VALUES
} PROP_MODE;
/*
* Property Dialog Manipulation Routines
*/
extern void propP_changebar_init(
Widget changebar,
Widget setting
);
extern void propP_combobox_chgCB(
Widget field,
XtPointer clientdata,
XtPointer calldata
);
extern void propP_field_chgCB(
Widget field,
XtPointer clientdata,
XtPointer calldata
);
extern int propP_field_set_value(
Widget field,
STRING value,
BOOL trip_changebar
);
extern int propP_field_set_numeric_value(
Widget field,
int value,
BOOL trip_changebar
);
extern void propP_labeltypeCB(
Widget item,
XtPointer clientdata,
XtPointer calldata
);
extern void propP_options_itemCB(
Widget item,
XtPointer clientdata,
XtPointer calldata
);
extern void propP_popup_message(
Widget w,
STRING msg,
BOOL modal
);
extern void propP_radiobox_itemCB(
Widget item,
XtPointer clientdata,
XtPointer calldata
);
extern void propP_setting_chgCB(
Widget item,
XtPointer clientdata,
XtPointer calldata
);
#endif /* _PROPP_H_ */

View File

@@ -0,0 +1,133 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: strlist.h /main/4 1995/11/06 18:52:03 rswiston $
*
* @(#)template.h 1.6 11 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABUTIL_STRLIST_H_
#define _ABUTIL_STRLIST_H_
/*
* strlist.h - string list manipulation
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <ab_private/AB.h> /* everybody must include this first! */
#include <ab_private/istr.h>
typedef enum
{
STRLIST_SORT_UNDEF = 0,
STRLIST_SORT_ALPHANUMERIC,
STRLIST_SORT_BEST,
STRLIST_SORT_CLIENT_DEF,
STRLIST_SORT_ORDER_NUM_VALUES /* must be last */
} STRLIST_SORT_ORDER;
/*
* string list structure.
*/
typedef struct
{
int num_strings;
int strings_size;
ISTRING *strings;
void **user_datas;
BOOL unique;
STRLIST_SORT_ORDER sort_order;
BOOL indexes_dirty;
} StringListRec, *StringList;
/*
* StringList
*/
StringList strlist_create(void);
int strlist_destroy(StringList);
int strlist_set_sort_order(StringList, STRLIST_SORT_ORDER);
STRLIST_SORT_ORDER strlist_get_sort_order(StringList);
int strlist_construct(StringList);
int strlist_destruct(StringList);
int strlist_set_is_unique(StringList, BOOL unique);
BOOL strlist_is_unique(StringList);
int strlist_make_empty(StringList);
int strlist_is_empty(StringList);
int strlist_add_index(StringList,
int index, STRING s, void *userData);
int strlist_set_num_strs(StringList, int numStrings);
int strlist_get_num_strs(StringList);
int strlist_set_max_size_soft(StringList, int max_num_strs);
int strlist_get_max_size(StringList);
BOOL strlist_max_size_is_soft(StringList);
int strlist_remove_index(StringList, int index);
int strlist_shrink_mem_to_fit(StringList);
int strlist_dump(StringList list);
/*
* STRING interfaces
*/
int strlist_add_str(StringList, STRING s, void *userData);
long strlist_remove_str(StringList, STRING s);
BOOL strlist_str_exists(StringList list, STRING s);
long strlist_get_str_index(StringList list, STRING s);
STRING strlist_get_str(StringList,
int whichString, void **userDataOut);
long strlist_set_str_data(StringList, STRING string, void *data);
void *strlist_get_str_data(StringList, STRING string);
StringList strlist_dup(StringList);
/*
* ISTRING interfaces
*
* The STRINGs and ISTRING are kept in the same list, and behave identically
*/
int strlist_add_istr(StringList, ISTRING s, void *userData);
long strlist_add_index_istr(StringList,
int index, ISTRING s, void *userData);
BOOL strlist_istr_exists(StringList list, ISTRING s);
long strlist_get_istr_index(StringList list, ISTRING s);
ISTRING strlist_get_istr(StringList,
int whichString, void **userDataOut);
long strlist_set_istr_data(StringList, ISTRING istring, void *data);
void *strlist_get_istr_data(StringList, ISTRING istring);
long strlist_remove_istr(StringList, ISTRING s);
#endif /* _ABUTIL_STRLIST_H_ */

View File

@@ -0,0 +1,68 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: tmode.h /main/3 1995/11/06 17:54:45 rswiston $
*
* @(#)tmode.h 1.1 15 Jan 1995
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
** File: tmode.h - *New* interface into Test Mode
*/
#ifndef _AB_TMODE_H
#define _AB_TMODE_H
#include <ab_private/AB.h>
#include <ab_private/obj.h>
/*
** Entry point into Test Mode
*/
extern void tmode_enable(
ABObj project,
BOOL test_project
);
/*
** Exit point from Test Mode
*/
extern void tmode_disable(
ABObj project
);
#endif /* _AB_TMODE_H */

View File

@@ -0,0 +1,175 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: tmodeP.h /main/3 1995/11/06 17:55:14 rswiston $
*
* @(#)tmodeP.h 1.1 15 Jan 1995
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
** File: tmodep.h - Common Test Mode functionality
*/
#ifndef _AB_TMODEP_H
#define _AB_TMODEP_H
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <ab_private/AB.h>
#include <ab_private/obj.h>
#include <ab_private/obj_list.h>
/*
* Constants
*/
#define TestModeFlagsNone ((TestModeFlags)0x0000)
#define TestModeTestProject ((TestModeFlags)0x0001) /* stored on project obj */
#define TestModeFlagDirtyWindow ((TestModeFlags)0x0002) /* per window */
#define TestModeFlagResizedWindow ((TestModeFlags)0x0004) /* per window */
/*
* Data Structures
*/
typedef struct TEST_MODE_ANY_DATA_REC /* name must match obj.h! */
{
XRectangle rect; /* win dimension. saved on entry, compaired with on exit */
} TestModeAnyDataRec;
typedef TestModeAnyDataRec TestModeDataRec;
typedef TestModeAnyData TestModeData;
/*
* Test Mode Flags manipulation
*/
#define tmodeP_obj_flags(obj) ((obj)->test_mode_flags)
#define tmodeP_obj_has_flags(obj, _flags) \
((tmodeP_obj_flags(obj) & ((TestModeFlags)(_flags))) != 0)
#define tmodeP_obj_set_flags(obj, _flags) \
((obj)->test_mode_flags |= ((TestModeFlags)(_flags)))
#define tmodeP_obj_clear_flags(obj, _flags) \
(tmodeP_obj_flags(obj) &= ~((TestModeFlags)(_flags)))
#define tmodeP_obj_construct_flags(obj) \
((obj)->test_mode_flags = TestModeFlagsNone)
/*
* Test Mode Data manipulation
*/
#define tmodeP_obj_data(obj) \
(obj->test_mode_data)
#define tmodeP_obj_has_data(obj) \
((obj)->test_mode_data != NULL)
extern int tmodeP_obj_create_data(
ABObj obj
);
extern int tmodeP_obj_destroy_data(
ABObj obj
);
extern int tmodeP_obj_construct_data(
ABObj obj
);
/*
* Geometry
*/
#define tmodeP_obj_geometry(obj) \
(tmodeP_obj_data(obj)->rect)
#define tmodeP_obj_set_geometry(obj, _rect) \
(tmodeP_obj_geometry(obj) = _rect)
#define tmodeP_obj_get_width(obj) \
(tmodeP_obj_data(obj)->rect.width)
#define tmodeP_obj_set_width(obj, _width) \
(tmodeP_obj_data(obj)->rect.width = _width)
#define tmodeP_obj_get_height(obj) \
(tmodeP_obj_data(obj)->rect.height)
#define tmodeP_obj_set_height(obj, _height) \
(tmodeP_obj_data(obj)->rect.height = _height)
#define tmodeP_obj_get_x(obj) \
(tmodeP_obj_data(obj)->rect.x)
#define tmodeP_obj_set_x(obj, _x) \
(tmodeP_obj_data(obj)->rect.x = _x)
#define tmodeP_obj_get_y(obj) \
(tmodeP_obj_data(obj)->rect.y)
#define tmodeP_obj_set_y(obj, _y) \
(tmodeP_obj_data(obj)->rect.y = _y)
/*
* Window List manipulation
*/
extern int tmodeP_window_list_create(
ABObj project
);
extern int tmodeP_window_list_construct(
ABObj project
);
extern int tmodeP_window_list_destruct(
void
);
extern int tmodeP_window_list_destroy(
void
);
extern void tmodeP_window_list_iterate(
ABObjListIterFn fn
);
extern int tmodeP_window_list_add_handler(
EventMask event_mask,
Boolean nonmaskable,
XtEventHandler event_handler
);
extern int tmodeP_window_list_remove_handler(
EventMask event_mask,
Boolean nonmaskable,
XtEventHandler event_handler
);
#endif /* _AB_TMODEP_H */

View File

@@ -0,0 +1,216 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: trav.h /main/3 1995/11/06 18:41:46 rswiston $
*
* @(#)trav.h 3.28 27 Apr 1994 cde_app_builder/src/libABobj
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* Traversal.h - Handles object tree traversal.
*
* The AB_TRAVERSAL data type allows the client to easily visit objects
* in a tree of ABObjs. A great deal of flexibility is provided, with the
* ability to select the types of objects to visit, the order they will be
* visited in, and the ability to modify the tree while the traversal is
* being performed.
*
* To traverse a tree, call trav_open with the root object of the tree to be
* searched, along with a traversal specifier, which is a set of one or more
* AB_TRAV_ constants. The specifier defines exactly what types of objects
* you want returned, and in what order you want them returned. Note that
* trav_open does not return an object - trav_next returns the first and all
* successive objects. Calling trav_next until it returns NULL will get
* all of the objects selected by the traversal. WHEN THE TRAVERSAL IS NO
* LONGER NEEDED, YOU MUST USE trav_close() TO INVALIDATE IT.
*
* A traversal specifier is a bitwise-ored value, consisting of a traversal
* type and zero or more modifiers. Without a modifier, the default order
* of visitation is undefined, although each selected object will be returned
* exactly once. Note that once a traversal is opened, the traversal specifier
* cannot be changed.
*
* Traversal type
* --------------
* The traveral type defines the object selection (what types/classes of
* objects are visited). Only one traversal type can be specified, and
* if no traversal type is specified, AB_TRAV_ALL is assumed.
* Commonly used types are AB_TRAV_UI, AB_TRAV_SALIENT and AB_TRAV_SALIENT_UI
*
* Traversal modifier
* ------------------
* Modifiers may be used in any combination to modify the behavior of a
* traversal.
*
* AB_TRAV_MOD_PARENTS_FIRST returns the parents (ancestors) of an object
* before returning the object itself. This does
* not change the objects returned, only their
* ordering.
*
* AB_TRAV_MOD_SAFE allows the tree to be modified while the
* traversal is being performed. Note
* that if an object is destroyed, an invalid
* reference to it will be returned by the
* traversal. However, since each object is
* returned only once, destroying an object
* after it is returned should avoid most
* problems.
*
* Note that all of the calls to the trav_ functions require a first
* parameter of type (AB_TRAVERSAL *). This must be a pointer to a
* previously-allocated structure (e.g., the address of a local variable
* of type AB_TRAVERSAL).
*
*
* E.g.:
*
* int
* show_objects(ABObj root)
* {
* AB_TRAVERSAL trav;
* for (trav_open(&trav, root, AB_TRAV_SALIENT_UI | AB_TRAV_MOD_SAFE);
* (obj= trav_next(&trav)) != NULL; )
* {
* -- operate on obj
* }
* trav_close(&trav); -- gotta close!
* return 0;
* }
*
*
* Other examples of opening a traversal:
*
* trav_open(&trav, rootObj, AB_TRAV_WINDOWS | AB_TRAV_MOD_SAFE);
* trav_open(&trav, rootObj, AB_TRAV_UI | AB_TRAV_MOD_SAFE);
* trav_open(&trav, rootObj, AB_TRAV_MOD_PARENT_FIRST);
*
*/
#ifndef _ABOBJ_TRAVERSAL_H_
#define _ABOBJ_TRAVERSAL_H_
#include <ab_private/obj.h>
/*
* Traversal types (see comment at top of this file)
*/
#define AB_TRAV_UNDEF (0U) /* invalid traversal type */
#define AB_TRAV_ACTIONS (1U) /* actions only */
#define AB_TRAV_ACTIONS_FOR_OBJ (2U) /* actions for root object only */
#define AB_TRAV_ALL (3U)
#define AB_TRAV_CHILDREN (4U) /* ONLY IMMEDIATE CHILDREN! */
#define AB_TRAV_FILES (5U)
#define AB_TRAV_GROUPS (6U)
#define AB_TRAV_ITEMS (7U) /* all items in tree */
#define AB_TRAV_ITEMS_FOR_OBJ (8U) /* items for object only */
#define AB_TRAV_MENUS (9U) /* all types of menus */
#define AB_TRAV_MODULES (10U)
#define AB_TRAV_PARENTS (11U)
#define AB_TRAV_SALIENT (12U) /*user-manipulatable objects*/
#define AB_TRAV_SALIENT_UI (13U) /* salient && ui */
#define AB_TRAV_SALIENT_CHILDREN (14U) /*user-manipulatable children*/
#define AB_TRAV_SALIENT_UI_CHILDREN (15U)
#define AB_TRAV_SIBLINGS (16U)
#define AB_TRAV_UI (17U) /* all ui objs (no actions) */
#define AB_TRAV_WINDOWS (18U) /* all windows */
#define AB_TRAV_COMP_SUBOBJS (19U) /* subobjs of this comp. obj */
/*
* Traversal modifiers (see comment at top of this file)
*/
#define AB_TRAV_MOD_PARENTS_FIRST (0x0100U)
#define AB_TRAV_MOD_SAFE (0x0200U)
/*
* Traversal data structure
*/
typedef struct
{
unsigned travType;
ABObj rootObj;
ABObj curObj;
ABObj *objArray;
int objArraySize;
int objArrayIndex;
BOOL done;
ABObjTestFunc testFunc;
} AB_TRAVERSAL;
typedef AB_TRAVERSAL *ABTraversal;
/*
* callback for trav_perform. return of negative value aborts traversal.
*/
typedef int (*AB_TRAVERSAL_CB)(ABObj obj);
typedef AB_TRAVERSAL_CB ABTraversalCB;
int trav_open(ABTraversal trav, ABObj root, unsigned trav_type);
int trav_open_cond(
ABTraversal trav,
ABObj root,
unsigned trav_type,
ABObjTestFunc cond_test_func
);
ABObj trav_obj(ABTraversal trav);
ABObj trav_next(ABTraversal trav);
ABObj trav_goto(ABTraversal trav, int which);
int trav_close(ABTraversal trav);
BOOL trav_is_open(ABTraversal trav);
int trav_reset(ABTraversal trav);
/* Returns the # of objects that will be returned by the traversal.
*/
int trav_count(ABObj root, int trav_type);
int trav_count_cond(ABObj root, int trav_type, ABObjTestFunc);
/*
* Performs the traversal, calling clientfunc on each object. A negative
* return from clientfunc aborts the traversal.
*/
int trav_perform(ABObj root, int trav_type,
AB_TRAVERSAL_CB clientfunc);
/*************************************************************************
** **
** Inline implementations **
** **
**************************************************************************/
#define trav_is_open(trav) ((trav)->rootObj != NULL)
#define trav_obj(trav) ((trav)->curObj)
#endif /* _ABOBJ_TRAVERSAL_H_ */

View File

@@ -0,0 +1,535 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: ui_util.h /main/3 1995/11/06 17:56:54 rswiston $
*
* @(#)ui_util.h 1.29 14 Feb 1994 cde_app_builder/src/libABobj
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* ui_util.h
*/
#ifndef _UI_UTIL_H_
#define _UI_UTIL_H_
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#include <ab_private/obj.h>
#include <ab_private/util.h>
#include "dtb_utils.h"
/*
* Return "answer" values for Modal Messages
*/
typedef enum
{
UI_ANSWER_NONE,
UI_ANSWER_OK,
UI_ANSWER_CANCEL,
UI_ANSWER_HELP
} UI_MODAL_ANSWER;
typedef struct _MENU_ITEM {
char *name;
char *label;
AB_LABEL_TYPE label_type;
WidgetClass *wclass;
XtCallbackProc callback;
XtPointer client_data;
XtPointer user_data;
struct _MENU_ITEM *subitems;
int num_columns;
BOOL active;
int pixwidth;
int pixheight;
unsigned char *bits;
} MenuItem;
/*
* Data structure for object pixmaps
*/
typedef struct _UiObjPixmap
{
AB_OBJECT_TYPE type;
int subtype;
char *filename;
Pixmap pixmap;
unsigned int width;
unsigned int height;
} UiObjPixmap;
typedef Boolean (*ModalPromptVerifyProc)(Widget, XtPointer);
/* Data structure for userData on the modal prompt dialog created
* by ui_popup_modal_prompt().
*/
typedef struct _Prompt_Info_Rec {
ModalPromptVerifyProc verify_proc; /* Hook to supply custom
* verification routine of text
* entered in the prompt dialog */
XtPointer client_data; /* Data to pass onto verification
* routine */
STRING *seln_str; /* Stores text from prompt dialog */
} Prompt_Info_Rec;
/*
* Function type for rubber band func
*/
typedef void (*UiRubberBandFunc) (
Widget,
XEvent *,
XRectangle *,
XtPointer
);
/*
* Move a Window to the front of stack
*/
extern void ui_win_front(
Widget widget
);
/*
* Show or Hide a Window
*/
extern void ui_win_show(
Widget widget,
BOOL show,
XtGrabKind grab_kind
);
extern void ui_win_set_resizable(
Widget widget,
BOOL resizable,
BOOL remap
);
/*
* Popup a Simple InfoMessage Dialog in front
* of a window (parent)
*/
extern void ui_popup_info_message(
Widget parent,
STRING title,
STRING message
);
/*
* Popup up a MessageDialog of "msg_type"
* Any widget can be passed in as the "parent";
* the routine will use this widget's shell ancestor
* as the actual parent of the Dialog.
*
* If a button_label parameter is NULL, the
* corresponding button will not appear in the
* dialog. 'callback' parameters can also be NULL.
*
* This routine takes care of dynamic creation/destruction
* of the MessageDialog.
*/
extern void ui_popup_message(
Widget parent,
unsigned char msg_type,
STRING title,
STRING message,
STRING ok_label,
XtCallbackProc ok_callback,
STRING cancel_label,
XtCallbackProc cancel_callback,
STRING help_label,
XtCallbackProc help_callback,
unsigned char default_button_type
);
/* Popup an Application-MODAL MessageDialog of "msg_type".
* Any widget can be passed in as the "parent";
* the routine will use this widget's shell ancestor
* as the actual parent of the Dialog.
*
* If a button_label parameter is NULL, the
* corresponding button will not appear in the dialog.
*
* This routine returns the "answer" corresponding to
* the button the user pressed on the dialog:
* UI_ANSWER_OK, UI_ANSWER_CANCEL, UI_ANSWER_HELP
*/
extern UI_MODAL_ANSWER
ui_popup_modal_message(
Widget parent,
unsigned char msg_type,
STRING title,
STRING message,
STRING ok_label,
STRING cancel_label,
STRING help_label,
unsigned char default_button_type,
Widget *modal_dlg
);
/*
* Set the LabelString resource on a widget
* (converts it to XmString internally)
*/
extern void ui_set_label_string(
Widget widget,
STRING label
);
/*
* Set the XmNlabel resource on a widget from the image file
*/
extern void ui_set_label_glyph(
Widget widget,
STRING fileName
);
/* Set a widget (and it's immediate children)
* sensitive or insensitive
*/
extern void ui_set_active(
Widget widget,
BOOL state
);
/*
* Set a widget to be visible or invisible
* (unmanages, so space will collapse)
*/
extern void ui_set_visible(
Widget widget,
BOOL viz
);
/* Set the value-string in a TextField
*/
extern void ui_field_set_string(
Widget field,
STRING valuestr
);
/* Get/alloc the value-string of a TextField
* NOTE: caller must free memory allocated
* by this call
*/
extern STRING ui_field_get_string(
Widget field
);
/* Make the string inside a TextField selected
*/
extern void ui_field_select_string(
Widget field,
BOOL assign_focus
);
extern void ui_field_set_editable(
Widget field,
BOOL editable
);
extern Widget ui_get_ancestor_shell(
Widget widget
);
extern Widget ui_get_ancestor_dialog(
Widget widget
);
extern Widget ui_build_menu(
Widget parent,
int menu_type,
int num_columns,
char *menu_title,
char *menu_name,
MenuItem *menu_items
);
extern void ui_populate_pulldown_menu(
Widget menu,
int num_columns,
MenuItem *menu_items
);
extern void ui_size_to_row_col(
Widget text,
unsigned short width,
unsigned short height,
int *row_ptr,
int *col_ptr
);
extern int ui_set_busy_cursor(
Window window,
BOOL on
);
extern void ui_get_obj_pixmap(
AB_OBJ *obj,
Pixmap *pixmap,/* RETURN */
unsigned int *width, /* RETURN */
unsigned int *height /* RETURN */
);
/*
* ComboBox Widget Manipulation utilities
*/
extern int ui_combobox_add_item(
Widget combobox,
STRING item,
int pos,
BOOL unique
);
extern int ui_combobox_clear(
Widget combobox
);
extern Widget ui_combobox_get_list_widget(
Widget combobox
);
extern Widget ui_combobox_get_field_widget(
Widget combobox
);
extern int ui_combobox_select_item(
Widget combobox,
STRING item
);
/*
* ScrolledList Widget Manipulation utilities
*/
extern int ui_list_add_item(
Widget list,
STRING item_str,
int pos
);
extern int ui_list_find_item(
Widget list,
STRING item_str,
int *pos_out
);
extern int ui_list_get_info(
Widget list,
int *num_items_out,
int *first_visible_out,
int *last_visible_out
);
extern int ui_list_delete_item(
Widget list,
STRING item_str
);
extern int ui_list_get_selected_pos(
Widget list
);
extern int ui_list_replace_item(
Widget list,
STRING old_item_str,
STRING new_item_str
);
extern int ui_list_replace_item_prefix(
Widget list,
STRING old_prefix_str,
STRING new_prefix_str
);
extern int ui_list_select_item(
Widget list,
STRING item_str,
BOOL invoke_callback
);
extern int ui_list_select_pos(
Widget list,
int item_pos,
BOOL invoke_callback
);
extern void ui_popup_prompt(
Widget parent,
STRING title,
STRING label,
STRING initial_text,
STRING ok_label,
XtCallbackProc ok_callback,
XtPointer ok_clientData,
STRING cancel_label,
XtCallbackProc cancel_callback,
XtPointer cancel_clientData,
STRING help_label,
XtCallbackProc help_callback,
XtPointer help_clientData,
unsigned char default_button_type
);
extern void ui_add_window_close_callback(
Widget shell,
XtCallbackProc callback,
XtPointer client_data,
unsigned char delete_response
);
extern void ui_remove_window_close_callback(
Widget shell,
XtCallbackProc callback,
XtPointer client_data
);
extern void ui_add_window_iconify_handler(
Widget shell,
XtEventHandler iconify_proc,
XtPointer client_data
);
extern void ui_remove_window_iconify_handler(
Widget shell,
XtEventHandler iconify_proc,
XtPointer client_data
);
extern UI_MODAL_ANSWER
ui_popup_modal_prompt(
Widget parent,
STRING title,
STRING label,
STRING initial_text,
STRING ok_label,
STRING cancel_label,
STRING help_label,
DtbObjectHelpData help_data,
unsigned char default_button_type,
STRING *seln_str,
ModalPromptVerifyProc verify_proc,
XtPointer client_data
);
extern void ui_refresh_widget_tree(
Widget widget
);
extern int ui_sync_display_of_widget(
Widget widget
);
extern int ui_initiate_rubberband(
Widget widget,
Boolean confine_to_window,
UiRubberBandFunc rb_func,
XtPointer client_data
);
extern void ui_button_drag(
Widget widget,
XEvent *event,
XtPointer client_data
);
extern void ui_rubberband_finish(
Widget widget,
XEvent *event,
XtPointer client_data
);
extern Widget ui_optionmenu_add_item(
Widget opmenu,
STRING item_str
);
extern int ui_optionmenu_delete_item(
Widget opmenu,
STRING item_str
);
extern Widget ui_optionmenu_replace_item(
Widget opmenu,
STRING old_item_str,
STRING new_item_str
);
extern Widget ui_optionmenu_find_item(
Widget opmenu,
STRING item_str
);
extern int ui_optionmenu_num_items(
Widget opmenu
);
extern void ui_optionmenu_change_label(
Widget opmenu,
STRING new_str
);
extern void ui_optionmenu_change_label_pixmap(
Widget opmenu,
Pixmap pixmap
);
/*
** Set the label string on an object
** (converts it to XmString internally, if needed)
*/
extern void ui_obj_set_label_string(
ABObj obj,
STRING label
);
/*
** Set the label glyph (ie graphic) on an object
*/
extern void ui_obj_set_label_glyph(
ABObj obj,
STRING fileName
);
/*
** Set the label on an object
** string and glyphs are supported
*/
extern void ui_obj_set_label(
ABObj obj,
STRING label
);
#endif /* _UI_UTIL_H_ */

View File

@@ -0,0 +1,352 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: util.h /main/4 1995/11/06 18:52:47 rswiston $
*
* @(#)util.h 1.39 14 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* util.h - general utilities
*/
#ifndef _AB_ABUTIL_H_
#define _AB_ABUTIL_H_
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <ab_private/AB.h>
#include <ab/util_types.h>
#include <ab_private/util_err.h>
/*
* <string.h> seems to have a problem cc -Xc is continually complaining
* about strdup().
*/
#ifdef __cplusplus
extern "C" {
#endif
#if !defined(__linux__)
extern char *strdup(const char *);
#endif
#ifdef __cplusplus
} /*extern "C" */
#endif
typedef enum
{
AB_OS_UNDEF = 0,
AB_OS_HPUX,
AB_OS_AIX,
AB_OS_SUNOS,
AB_OS_LNX,
AB_OS_FBSD,
AB_OS_NBSD,
AB_OS_OBSD,
AB_OS_TYPE_NUM_VALUES /* must be last */
} AB_OS_TYPE;
typedef int UTIL_OUTPUT_HANDLER(STRING error_message);
typedef UTIL_OUTPUT_HANDLER *UtilOutputHandler;
extern const STRING Util_null_string; /* "(nil)" */
extern const STRING Util_empty_string; /* "" */
extern int utilP_verbosityPriv3602759317; /* private! */
/*
* Initialization
*/
int util_init(int *argc_in_out, STRING **argv_in_out);
/*
* Memory management
*/
#define util_free(ptr) {if ((ptr) != NULL) {free(ptr); (ptr)= NULL;}}
#define util_malloc(size) (malloc(size))
/*
* General
*/
int util_putenv(STRING string);
#define util_min(a,b) (((a) < (b))? (a):(b))
#define util_max(a,b) (((a) > (b))? (a):(b))
#define util_xor(a,b) ( (((a)?1:0) + ((b)?1:0)) == 1 ) /* logical xor */
int util_set_program_name(STRING this_prog_name);
STRING util_get_program_name(void);
int util_set_program_name_from_argv0(STRING argv0);
AB_OS_TYPE util_get_os_type(void);
STRING util_os_type_to_string(AB_OS_TYPE);
STRING util_os_type_to_ident(AB_OS_TYPE);
/*
* Verbosity
*
* If verbosity is >= 3, debugging is turned on.
* verbosity < 3 => debugging level 0
* verbosity 3 => debugging level 1
* verbosity 4 => debugging level 2
* et cetera...
*/
int util_set_verbosity(int verbosity);
int util_get_verbosity(void);
BOOL util_be_silent(void);
BOOL util_be_verbose(void);
int util_get_debug_level(void);
int debug_level(void); /* these are special-case shortcuts that */
BOOL debugging(); /* don't conform to the naming convention */
/*
* Input/Output
*
* util_puts_err() and util_printf_err() should be used for messages
* that absolutely must be seen by the user (this should cause a popup
* to appear, when ab is running).
*
* util_puts() and util_printf() should be used for informative messages,
* and may or may not actually be presented to the user.
*
* util_dputs() and util_dprintf() should be used for debugging messages.
* Their first parameter is the debugging level at which the message should
* be printed. (verbosity 3 = debug level 1). If debugging is disabled
* (e.g., verbosity < 3), these functions never generate output.
*
* To redirect the error output, use util_set_err_output_handler. ALL error
* output will then be sent to that error handler. A value of NULL sends
* error messages to stderr (which is the startup default). This is normally
* used to add an error handler that will pop up an error dialog when
* running in a windowed application.
*
* util_set_output_handler() works similarly to the error handler.
*/
int util_set_err_output_handler(UtilOutputHandler);
int util_set_output_handler(UtilOutputHandler);
int util_puts(STRING msg);
int util_puts_err(STRING msg);
int util_printf(STRING fmt, ...);
int util_printf_err(STRING fmt, ...);
void util_set_help_data(STRING help, STRING vol, STRING locID);
int util_get_help_data(STRING *help, STRING *vol, STRING *locID);
/* print output if debugging level >= specified */
int util_dputs(int debug_level, STRING msg);
int util_dprintf(int debug_level, STRING fmt, ...);
/*
* files
*/
#define util_fopen fopen /* for consistency */
int util_unbuffer_file(FILE *fp); /* for debugging - removes all */
/* buffer from the stream */
BOOL util_file_is_regular_file(STRING filename);
BOOL util_file_is_directory(STRING filename);
BOOL util_directory_exists(STRING dirName);
BOOL util_file_exists(STRING fileName);
long util_file_size(STRING fileName); /* error if file don't exist */
BOOL util_paths_are_same_file(STRING path1, STRING path2);
int util_fdtruncate(int fildes, off_t length); /* truncate open file*/
int util_ftruncate(FILE *file, off_t length, const char *accessType);
int util_flock(
FILE *file,
BOOL wait,
int lockType,
off_t offset,
off_t length
);
int util_funlock(
FILE *file,
off_t offset,
off_t length
);
FILE *util_fopen_locked(const char *filename, const char *type);
BOOL util_file_name_has_extension(STRING file_name, STRING ext);
BOOL util_file_name_has_ab_extension(STRING file_name);
BOOL util_file_name_is_bil_encapsulated(STRING file_name);
BOOL util_file_name_is_bil_module(STRING file_name);
BOOL util_file_name_is_bil_proj(STRING file_name);
FILE* util_create_tmp_file(char *data);
int util_cvt_path_to_relative( /* NULL from = cwd */
STRING path,
STRING from,
char *buf,
int buf_size);
/*
* strings
*
* THE UTIL STRING FUNCTIONS *ALWAYS* NULL-TERMINATE ANY RETURNED STRINGS!
*
* Note: len = length of string withOUT terminating 0
* size = size of string including terminating 0 ( = len+1 )
*/
BOOL util_streq(STRING s1, STRING s2); /* True if strings = */
BOOL util_strcmp(STRING s1, STRING s2); /* allows NULL strings */
STRING util_strsafe(STRING s); /*returns "(nil)" for NULL strs*/
BOOL util_strempty(STRING s); /* looks for NULL AND "" */
int util_strncpy(STRING to, STRING from, int to_size);
int util_strcvt_to_lower(STRING to, STRING from, int to_size);
int util_strcasestr(STRING str, STRING substr);
int util_strncasecmp(STRING s1, STRING s2, int max_chars);
STRING util_strip_white_space(STRING string);
STRING util_get_file_name_from_path(
STRING path,
STRING fileNameBuf,
int fileNameBufSize
);
STRING util_get_dir_name_from_path(
STRING path,
STRING dirNameBuf,
int dirNameBufSize
);
int util_mkdir_hier(
STRING path
);
BOOL util_path_is_absolute(
STRING dir
);
int util_derive_name_from_path(
char *fullpath,
char *objname
);
int util_check_name(
STRING name,
STRING new_name
);
/*
* Process control
*/
pid_t util_vfork(void); /* lightweight fork() */
/*
* conversions
*/
STRING util_cvt_bool_to_string(BOOL bool_value, STRING buf, int buf_size);
/*************************************************************************
** **
** Inline implementation **
** **
*************************************************************************/
/* check 1st chars before calling strcmp - avoids a lot of calls */
#define util_streq(s1,s2) \
( ((s1) == (s2)) \
|| (((s1) != NULL) && ((s2) != NULL) && (((s1)[0] == (s2)[0]) && (strcmp(s1,s2) == 0))) \
)
/*
* allows compare of null strings (NULL < "")
*/
#define util_strcmp(s1,s2) \
(((s1) == (s2))? \
0 \
: \
((s1 == NULL)? \
(-1) \
: \
((s2) == NULL? \
(1) \
: \
strcmp((s1),(s2)) \
) \
) \
)
#define util_strlen(s) ((s) == NULL? 0:strlen(s))
#define util_strsafe(s) ((s) == NULL? Util_null_string:(s))
#define util_strempty(s) (s == NULL || (strcmp(s, "") == 0))
/*
* Verbosity
*/
#define util_get_verbosity() (utilP_verbosityPriv3602759317)
#define util_be_silent() (util_get_verbosity() < 1)
#define util_be_verbose() (util_get_verbosity() > 1)
#define util_get_debug_level() (util_max(0, util_get_verbosity() - 2))
#define debug_level() ((int)(util_get_debug_level()))
#define debugging() ((BOOL)(debug_level() > 0))
/*
* We key on DEBUG here, so that if DEBUG is turned off, these macros
* evaluate to constants. That should allow the compiler to remove
* sections of code that are executed conditionally based on these
* macros.
*/
#ifndef DEBUG
#undef util_get_debug_level
#define util_get_debug_level() (0)
#undef debug_level
#define debug_level() (0)
#undef debugging
#define debugging() (FALSE)
#endif /* DEBUG */
#define util_fclose(fp) ((fp) == NULL? 0:(util_funlock(fp, 0, 0), fclose(fp), (fp)= NULL, 0))
/*
* These functions are obsolete. Here for backwards compatibility
*/
#define util_error(s) util_puts_err(s)
#endif /* _AB_ABUTIL_H_ */

View File

@@ -0,0 +1,94 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: util_ds.h /main/4 1995/11/06 18:53:31 rswiston $
*
* @(#)util_ds.h 1.1 19 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _UTIL_DS_H_
#define _UTIL_DS_H_
/*
* util_ds.h - LList and ASet ADTs
*/
#include <X11/Intrinsic.h>
typedef struct _LListStruct *LList;
typedef void (*LListIterFn)(void *cl_data);
#define ASet LList
#define ASetIterFn LListIterFn
/*******************************
* LList and ASet ADT operations
*******************************/
extern LList util_llist_create(
void
);
extern void util_llist_destroy(
LList llist
);
extern void util_llist_insert_after(
LList llist,
void *cl_data
);
extern LList util_llist_find(
LList llist,
void *cl_data
);
extern void util_llist_delete(
LList llist,
void *cl_data
);
extern void util_llist_iterate(
LList llist,
LListIterFn fn
);
#define util_aset_create util_llist_create
#define util_aset_destroy util_llist_destroy
#define util_aset_iterate util_llist_iterate
#define util_aset_remove util_llist_delete
extern void util_aset_add(
ASet aset,
void *cl_data
);
#endif /* _UTIL_DS_H_ */

View File

@@ -0,0 +1,110 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: util_err.h /main/4 1995/11/06 18:53:55 rswiston $
*
* @(#)util_err.h 1.14 11 Feb 1994 cde_app_builder/src/libAButil
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
#ifndef _ABUTIL_UTIL_ERR_H_
#define _ABUTIL_UTIL_ERR_H_
/*
* util_err.h - error codes
*
* All error codes are negative. They are numbered in
* groups (general, file i/o, memory, ...).
*
* When returning an error, use the most specific error code.
*/
#ifndef _POSIX_SOURCE
#define _POSIX_SOURCE 1 /* we want to be POSIX-compliant */
#endif
#include <ab_private/AB.h>
#include <ab/util_types.h>
#define OK (0) /* smooth sailing */
#define ERR (-1) /* generic error */
#define ERR_INTERNAL (-100) /* internal errors */
#define ERR_RECURSION (-101) /* recursion not allowed! */
#define ERR_DATA_SPACE_FULL (-102)
#define ERR_BUFFER_TOO_SMALL (-103)
#define ERR_NOT_IMPLEMENTED (-104)
#define ERR_NOT_INITIALIZED (-105)
#define ERR_CLIENT (-200) /* errors on the part of the caller */
#define ERR_NOT_ALLOWED (-201)
#define ERR_NOT_FOUND (-202) /* search failed */
#define ERR_DUPLICATE_KEY (-203) /* insert of duplicate key */
#define ERR_BAD_PARAM (-220) /* bad parameter */
#define ERR_BAD_PARAM1 (-221) /* parameter #1 bad */
#define ERR_BAD_PARAM2 (-222)
#define ERR_BAD_PARAM3 (-223)
#define ERR_BAD_PARAM4 (-224)
#define ERR_BAD_PARAM5 (-225)
#define ERR_BAD_PARAM6 (-226)
#define ERR_BAD_PARAM7 (-227)
#define ERR_BAD_PARAM8 (-228)
#define ERR_BAD_PARAM9 (-229)
#define ERR_IO (-300) /* I/O errors */
#define ERR_FILE_NOT_FOUND (-301)
#define ERR_OPEN (-302)
#define ERR_WRITE (-303)
#define ERR_READ (-304)
#define ERR_EOF (-305)
#define ERR_BAD_FILE_FORMAT (-306)
#define ERR_RENAME (-307)
#define ERR_READ_ONLY (-308)
#define ERR_BACKUP (-309)
#define ERR_MEMORY (-400) /* memory errors */
#define ERR_NO_MEMORY (-401)
#define ERR_MEMORY_CORRUPT (-402)
#define ERR_MULTIPLE_FREE (-403) /* multiple frees of same object/buf */
/*************************************************************************
** **
** Functions **
** **
*************************************************************************/
STRING util_error_string(int errCode);
int util_print_error(int errCode, STRING string); /* NULL OK for string*/
#endif /* _ABUTIL_UTIL_ERR_H_ */

View File

@@ -0,0 +1,282 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: vwr.h /main/3 1995/11/06 17:57:27 rswiston $
*
* @(#)vwr.h 1.27 16 Aug 1994
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* vwr.h
*
* Declarations for the generic object viewer.
* This file should be standalone.
*/
#ifndef _VWR_H
#define _VWR_H
#ifndef BIT_FIELD
#define BIT_FIELD(field) unsigned field : 1
#endif
typedef struct _Viewer *Vwr;
typedef struct _ViewerNode *VNode;
typedef struct _ViewerMethods *VMethods;
typedef struct _ViewerNodeElm *VNodeElm;
typedef struct _ViewerElmMethods *VElmMethods;
typedef struct _ViewerMethods
{
/*
* Initialize/free:
* viewer properties
* viewer nodes
* viewer node elements
*/
void (*init_prop)(Vwr);
void (*init_ui)(Vwr);
VNode (*init_node)(Vwr, void *);
void (*init_elements)(VNode);
void (*free_prop)(Vwr);
void (*free_ui)(Vwr);
void (*free_node)(VNode, void *);
void (*free_elements)(VNode);
/*
* Insert/delete of viewer data into/from client data
*/
int (*insert_tree)(Vwr, void *);
VNode (*insert_node)(Vwr, void *);
void (*remove_tree)(Vwr, void *);
void (*remove_node)(Vwr, void *);
/*
* Viewer <-> Application obj
*/
void (*get_obj_data)(VNode);
VNode (*get_viewer_data)(void *);
void (*set_viewer_data)(void *, VNode);
/*
* For traversals
*/
VNode (*get_sibling)(VNode);
VNode (*get_parent)(VNode);
int (*get_num_children)(VNode);
VNode (*get_child)(VNode, int);
/*
* Draw operations
*/
unsigned long (*get_drawarea)(Vwr);
void (*compute_tree)(Vwr, int *, int *);
void (*compute_node)(VNode, int, int);
void (*render_tree)(VNode);
void (*render_node)(VNode, int);
void (*render_line)(VNode, VNode);
void (*preview_node)(VNode);
VNode (*locate_node)(VNode, int, int);
unsigned long (*locate_elements)(VNode, int, int);
} ViewerMethods;
#define BNODE_METHODS(node) (node->browser->methods)
/*
* This is the methods vector for the viewer node elements
*/
typedef struct _ViewerElmMethods
{
void (*init)(VNode, VNodeElm, void *);
void (*compute)(VNode, VNodeElm, int, int);
void (*render)(VNode, VNodeElm, int);
void (*free)(VNode, VNodeElm);
} ViewerElmMethods;
/*
* This describes each element of a viewer node.
* Element here refers to things like class name or instance name.
* If the viewer node is to contain say:
* class name
* instance name
* object glyph, etc.
* then each viewer node will contain an array of these structures
* to describe each of those elements.
*
* For now, there will not be a init/draw method for every
* ViewerNodeElm. Instead, the one single init/draw method will
* be responsible for intepreting all the ViewerNodeElm's and
* initializing/drawing them correctly.
*/
typedef struct _ViewerNodeElm
{
int x; /* x,y,width,height location of this element */
int y;
unsigned int width;
unsigned int height;
void *data; /* e.g. class/instance name string or pixmap */
} ViewerNodeElm;
/*
* This describes the viewer in general.
* It also contains handles to the actual widgets for the viewer.
*/
typedef struct _Viewer
{
VMethods methods;
void *obj_data; /* Pointer back to project data */
void *ui_handle;
/*
* Viewer properties
*/
void *properties;
VNode tree;
VNode current_tree;
Vwr next;
Vwr previous;
} Viewer;
/*
* Description of one viewer node
*/
typedef struct _ViewerNode
{
Vwr browser; /* points to viewer info */
void *obj_data; /* Pointer back to application object */
VElmMethods *elm_methods;
VNodeElm elements; /* Array of node elements */
int num_elements; /* Number of node elements */
short boundbox_shown; /* TRUE if the bounding box of the
* icon is drawn
*/
int x; /* x,y,width,height of this node */
int y;
int width;
int height;
int state; /* Can be used for:
* selected/previewed/expanded etc..
*/
VNode next; /* Points to the next/previous viewer data node */
VNode previous; /* for a particular object */
} ViewerNode;
/*
* Create/destroy
*/
Vwr vwr_create(
VMethods m
);
void vwr_destroy(
Vwr v
);
VNode vwr_create_node();
void vwr_destroy_node(
VNode bnode
);
ViewerNodeElm vwr_create_elm();
ViewerNodeElm vwr_destroy_elm(
VNodeElm belm
);
/*
* Functions that manipulate the tree structure.
*/
void vwr_destroy_tree(
ViewerNode *tree
);
void vwr_delete_tree(
Viewer *v,
ViewerNode *node
);
void vwr_reset(
Viewer *v
);
VNode vwr_traverse_tree();
void vwr_init_elements(
VNode vnode
);
/*
* Viewer graphics routines.
*/
VNode vwr_locate_node(
Viewer *v,
int x,
int y
);
void vwr_get_cond(
VNode tree,
VNode **array,/* RETURN */
int *num, /* RETURN */
int (*cond)(VNode)
);
void vwr_num_cond(
VNode tree,
int *num, /* RETURN */
int (*cond)(VNode)
);
void vwr_repaint(
Viewer *v
);
#endif /* _VWR_H */

View File

@@ -0,0 +1,229 @@
/*
* CDE - Common Desktop Environment
*
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
*
* These libraries and programs are free software; you can
* redistribute them and/or modify them under the terms of the GNU
* Lesser General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option)
* any later version.
*
* These libraries and programs are distributed in the hope that
* they will be useful, but WITHOUT ANY WARRANTY; without even the
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
/*
* $XConsortium: x_util.h /main/3 1995/11/06 17:57:58 rswiston $
*
* @(#)x_util.h 1.16 21 Apr 1994 cde_app_builder/src/ab
*
* RESTRICTED CONFIDENTIAL INFORMATION:
*
* The information in this document is subject to special
* restrictions in a confidential disclosure agreement between
* HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
* document outside HP, IBM, Sun, USL, SCO, or Univel without
* Sun's specific written approval. This document and all copies
* and derivative works thereof must be returned or destroyed at
* Sun's request.
*
* Copyright 1993 Sun Microsystems, Inc. All rights reserved.
*
*/
/*
* ab_x_util.h
*/
#ifndef _X_UTIL_H_
#define _X_UTIL_H_
#include <X11/Intrinsic.h>
#include <X11/StringDefs.h>
#ifndef min
#define min(a,b) ((a) < (b)? (a):(b))
#endif
#ifndef max
#define max(a,b) ((a) > (b)? (a):(b))
#endif
extern int x_load_cursor_bitmaps(
Widget w
);
extern void x_get_widget_rect(
Widget w,
XRectangle *r
);
extern void x_get_rect_bounding(
XRectangle *r1,
XRectangle *r2
);
extern void x_graphics_op(
Display *dpy,
Drawable dest,
GC gc,
int x,
int y,
int width,
int height,
Pixmap src
);
extern void x_get_widget_rect(
Widget widget,
XRectangle *rect
);
extern void x_adjust_rect_margin(
XRectangle *r,
int m
);
extern void x_box(
Widget widget,
Drawable win,
int x0,
int y0,
int x1,
int y1
);
extern void x_box_r(
Widget widget,
XRectangle *r
);
extern void x_dashed_box_r(
Widget widget,
Drawable drawable,
XRectangle *r
);
extern void x_fullscreen_box(
Widget widget,
Drawable rootwin,
int x0,
int y0,
int x1,
int y1
);
extern void x_fullscreen_preview_box(
Widget widget,
Drawable rootwin,
int x0,
int y0,
int x1,
int y1
);
extern void x_conn_fullscreen_init(
Widget w,
Drawable root_win
);
extern void x_conn_fullscreen_chord(
Widget w,
Drawable rootwin,
int x0,
int y0,
int x1,
int y1
);
extern void x_fullscreen_chord(
Widget widget,
Drawable rootwin,
int x0,
int y0,
int x1,
int y1
);
extern void x_conn_fullscreen_cleanup(
Widget w
);
extern unsigned int
x_contrast_color(
Widget w
);
extern Boolean x_widget_translate_xy(
Widget src,
XtPointer dst,
int src_x,
int src_y,
int *p_dst_x,
int *p_dst_y
);
extern Boolean x_rootxy_inside_widget(
Widget w,
int rootx,
int rooty
);
extern Window x_xwin_at_rootxy(
Widget widget,
int x,
int y,
int *p_wx,
int *p_wy
);
extern Cursor x_create_cursor(
Widget widget,
Window root_win,
unsigned char bits[],
unsigned short width,
unsigned short height,
unsigned int xhot,
unsigned int yhot
);
extern Cursor x_create_stencil_cursor(
Widget widget,
Pixmap pixmap,
unsigned short width,
unsigned short height,
unsigned int xhot,
unsigned int yhot
);
extern int x_get_num_pending_expose_events(Display *display);
/*************************************************************************
** **
** Macros **
** **
**************************************************************************/
#define rect_right(r) (short)((r)->x + (short)(r)->width)
#define rect_bottom(r) (short)((r)->y + (short)(r)->height)
#define rect_includespoint(r,p_x,p_y) \
((p_x) >= (r)->x && (p_y) >= (r)->y && \
(p_x)< (short)((r)->x+(short)(r)->width) && \
(p_y)< (short)((r)->y+(short)(r)->height))
#define rect_includesrect(r1, r2) \
((r2)->x >= (r1)->x && (r2)->y >= (r1)->y && \
((r2)->x + (short)(r2)->width) <= ((r1)->x + (short)(r1)->width) && \
((r2)->y + (short)(r2)->height) <= ((r1)->y + (short)(r1)->height))
#define rect_equal(r1,r2) \
((r1)->x==(r2)->x && (r1)->width==(r2)->width && \
(r1)->y==(r2)->y && (r1)->height==(r2)->height)
#define rect_zero_out(r) \
{ (r)->x=0;(r)->y=0;(r)->width=0;(r)->height=0; }
#define rect_isnull(r) \
((r)->width==0 && (r)->height==0)
/*************************************************************************
** **
** Extern Data **
** **
**************************************************************************/
extern Pixmap AB_cp_cursor_pixmap, AB_mv_cursor_pixmap;
extern unsigned short AB_cp_cursor_height, AB_cp_cursor_width;
extern unsigned short AB_mv_cursor_height, AB_mv_cursor_width;
#endif /* _X_UTIL_H_ */