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,54 @@
MAINTAINERCLEANFILES = Makefile.in
ABINCLUDES = ../include
EXTRA_DEFINES = -D_POSIX_SOURCE=1
EXTRALIBS = -lm
if HPUX
CCOPTIONS = -Ae
endif
if AIX
EXTRALIBS += -liconv
endif
if SOLARIS
EXTRALIBS += -ldl -lgen
endif
noinst_LIBRARIES = libABobj.a
#noinst_PROGRAMS = test test_notify
libABobj_a_CFLAGS = $(EXTRA_DEFINES) -I$(ABINCLUDES)
libABobj_a_SOURCES = obj.c \
obj_action.c \
obj_alloc.c \
obj_fields.c \
obj_geometry.c \
obj_init.c \
obj_isa.c \
obj_names_list.c \
obj_list.c \
obj_lists.c \
obj_notify.c \
obj_release.c \
obj_scoped.c \
obj_select.c \
obj_tree.c \
obj_utils.c \
trav.c \
travP.c \
trav_public.c \
trav_safe.c
#test_LDADD = ../libAButil/libAButil.a libABobj.a $(EXTRALIBS)
#test_SOURCES = test.c
#test_notify_LDADD = ../libAButil/libAButil.a libABobj.a $(EXTRALIBS)
#test_notify_SOURCES = test_notify.c

File diff suppressed because it is too large Load Diff

View File

@@ -1,144 +0,0 @@
/*
* 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

@@ -1,181 +0,0 @@
/*
* 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

@@ -1,216 +0,0 @@
/*
* 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_ */