Initial import of the CDE 2.1.30 sources from the Open Group.

This commit is contained in:
Peter Howkins
2012-03-10 18:21:40 +00:00
commit 83b6996daa
18978 changed files with 3945623 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,191 @@
/*
* (c) Copyright 1989, 1990, 1991, 1992, 1993 OPEN SOFTWARE FOUNDATION, INC.
* ALL RIGHTS RESERVED
*/
/*
* Motif Release 1.2.2
*/
/* $XConsortium: DNDDemo.h /main/4 1995/10/27 10:43:48 rswiston $ */
/*
* (c) Copyright 1987, 1988, 1989 HEWLETT-PACKARD COMPANY */
/*
* file: DNDDemo.h
*
* Header file for the program DNDDemo.
*/
#include <stdio.h>
#include <X11/Xatom.h>
#include <X11/Intrinsic.h>
#include <Xm/Xm.h>
#include <Xm/AtomMgr.h>
#include <Xm/MainW.h>
#include <Xm/DrawingA.h>
#include <Xm/SeparatoG.h>
#include <Xm/Form.h>
#include <Xm/RowColumn.h>
#include <Xm/PushB.h>
#include <Xm/MessageB.h>
#include <Xm/DragDrop.h>
#include <Xm/Screen.h>
/* The following is used to layout the color labels */
#define BOX_WIDTH 85
#define BOX_HEIGHT 25
#define BOX_X_OFFSET 95
#define BOX_Y_OFFSET 35
#define BOX_X_MARGIN 10
#define BOX_Y_MARGIN 10
/* The following are used in setting up the drag icons */
#define ICON_WIDTH 32
#define ICON_HEIGHT 32
#define SMALL_ICON_WIDTH 16
#define SMALL_ICON_HEIGHT 16
#define ICON_X_HOT 0
#define ICON_Y_HOT 0
/* Some scales or text entry field could be added to change this value */
#define RECT_WIDTH 20
#define RECT_HEIGHT 50
/* The following defines could be setup as application resources */
#define RECT_START_COLOR "black"
#define HIGHLIGHT_THICKNESS 3
#define HIGHLIGHT_COLOR "Black" /* this is equivalent to gray60
in the R5 rgb.txt */
#define DRAW_AREA_BG_COLOR "white"
#define DRAW_AREA_FG_COLOR "black" /* 5127 fix */
#define LABEL1_COLOR "#ff5026" /* a slight softer shade of red,
red was too dark */
#define LABEL2_COLOR "orange"
#define LABEL3_COLOR "yellow"
#define LABEL4_COLOR "violet"
#define LABEL5_COLOR "#00C3ff" /* a blue green color,
blue was too dark */
#define LABEL6_COLOR "green"
#define VALID_CURSOR_FG_COLOR "black"
#define INVALID_CURSOR_FG_COLOR "maroon"
#define NONE_CURSOR_FG_COLOR "maroon"
/*
* This struct is used to contain information about each rectangle
* to use in the dislay routines
*/
typedef struct _RectStruct {
Position x;
Position y;
Dimension width;
Dimension height;
Pixel color;
Pixmap pixmap; /* currently not in use */
} RectStruct, *RectPtr;
/* This struct is used to hold global application information */
typedef struct _AppInfoRec {
GC rectGC; /* graphic context used to draw the rectangles */
Pixel currentColor; /* color that is currently in the GC */
RectPtr *rectDpyTable; /* the rectangle display table */
int rectsAllocd; /* keeps track of how much the above
table has been alloc'd */
int numRects; /* the number of rects that are visible */
RectPtr highlightRect; /* the current highlighted rectangle */
RectPtr clearRect; /* the rectangle that is being moved */
Boolean doMove; /* indicates that a move is being performed */
Boolean creatingRect; /* indicates that a rect create is being
performed */
unsigned char operation;/* indicates the drop help operation */
unsigned int maxCursorWidth; /* the maximum allowable cursor width */
unsigned int maxCursorHeight; /* the maximum allowable cursor height */
Position rectX;
Position rectY;
Position rectX2;
Position rectY2;
} AppInfoRec, *AppInfo;
/*
* This struct is used to pass information
* from the dropProc to the transferProc
*/
typedef struct _DropTransferRec {
Widget widget;
Position x;
Position y;
} DropTransferRec, *DropTransfer;
/*
* This struct is used to pass information
* from the rectangle dragStart proc to it's associated
* callback procs.
*/
typedef struct _DragConvertRec {
Widget widget;
RectPtr rect;
} DragConvertRec, *DragConvertPtr;
extern void InitializeAppInfo(void );
extern void StartRect(Widget , XEvent *, String *, Cardinal *);
extern void ExtendRect(Widget , XEvent *, String *, Cardinal *);
extern void EndRect(Widget , XEvent *, String *, Cardinal *);
extern RectPtr RectCreate(Position , Position , Dimension ,
Dimension , Pixel , Pixmap );
extern RectPtr RectFind(Position , Position );
extern void RectSetColor(RectPtr , Display *, Window , Pixel );
extern Pixel RectGetColor(RectPtr );
extern Pixmap GetBitmapFromRect(Widget , RectPtr , Pixel , Pixel ,
Dimension *, Dimension *);
extern void RectHide(Display *, Window , RectPtr );
extern void RectFree(RectPtr );
extern void RedrawRectangles(Widget );
extern void RectDrawStippled(Display *, Window , RectPtr );
extern void RectHighlight(Widget , RectPtr );
extern void RectUnhighlight(Widget );
extern void RectSetPixmap(RectPtr , Display *, Window , Pixmap );
extern void RectRegister(RectPtr , Position , Position );
extern void InitializeRectDpyTable(void );
extern void CreateLayout(void );
extern void CreateRectGC(void );
extern Pixel GetColor(char *);
extern void ColorRect(Widget , XEvent *, String *, Cardinal *);
/* The following character arrays hold the bits for
* the source and state icons for both 32x32 and 16x16 drag icons.
* The source is a color palatte icon and the state is a paint brush icon.
*/
extern unsigned char SOURCE_ICON_BITS[];
extern unsigned char SOURCE_ICON_MASK[];
extern unsigned char STATE_ICON_BITS[];
extern unsigned char STATE_ICON_MASK[];
extern unsigned char INVALID_ICON_BITS[];
extern unsigned char SMALL_SOURCE_ICON_BITS[];
extern unsigned char SMALL_SOURCE_ICON_MASK[];
extern unsigned char SMALL_STATE_ICON_BITS[];
extern unsigned char SMALL_STATE_ICON_MASK[];
extern unsigned char SMALL_INVALID_ICON_BITS[];
/* The folowing character arrays are for use with the drop help
* dialogs. For internationalization, message catalogs should
* replace these static declarations.
*/
extern char HELP_MSG1[];
extern char HELP_MSG2[];
extern char HELP_MSG3[];
extern char HELP_MSG4[];
extern char HELP_MSG5[];
/* Globals variables */
extern AppInfo appInfo;
extern Widget topLevel;
extern Widget drawingArea;
extern Widget helpDialog;
extern Widget helpLabel, helpMenu;
extern XtAppContext appContext;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,45 @@
# $XConsortium: Makefile.hp /main/2 1996/05/13 11:58:02 drk $
##########################################################################
#
# Makefile for motif drag and drop examples (HP)
#
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Novell, Inc.
#
##########################################################################
CC = cc
RM = rm -f
PROGRAM = DNDDemo
SOURCES = DNDDemo.c DNDDraw.c
OBJECTS = DNDDemo.o DNDDraw.o
DEFINES =
CDEBUGFLAGS = -O
CFLAGS = -Aa -z $(DEFINES) $(CDEBUGFLAGS)
DTINCLUDE = -I/usr/dt/include
X11INCLUDE = -I/usr/include/X11R5
INCLUDES = $(DTINCLUDE) $(X11INCLUDE)
DTLIBS = -L/usr/dt/lib -lDtWidget -lXm
X11LIBS = -L/usr/lib/X11R5 -lXt -lX11
SYSLIBS =
LIBRARIES = $(DTLIBS) $(X11LIBS) $(SYSLIBS)
LDFLAGS =
.c.o:
${CC} -c $(CFLAGS) $(INCLUDES) $<
all:: $(PROGRAM)
$(PROGRAM):: $(OBJECTS)
${CC} -o $(PROGRAM) $(LDFLAGS) $(OBJECTS) $(LIBRARIES)
clean::
${RM} $(PROGRAM) $(OBJECTS)

View File

@@ -0,0 +1,45 @@
# $XConsortium: Makefile.ibm /main/2 1996/05/13 11:58:19 drk $
##########################################################################
#
# Makefile for motif drag and drop examples (IBM)
#
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Novell, Inc.
#
##########################################################################
CC = cc
RM = rm -f
PROGRAM = DNDDemo
SOURCES = DNDDemo.c DNDDraw.c
OBJECTS = DNDDemo.o DNDDraw.o
DEFINES =
CDEBUGFLAGS = -O
CFLAGS = $(DEFINES) $(CDEBUGFLAGS)
DTINCLUDE = -I/usr/dt/include
X11INCLUDE = -I/usr/include
INCLUDES = $(DTINCLUDE) $(X11INCLUDE)
DTLIBS = -L/usr/dt/lib -lDtWidget -lXm
X11LIBS = -L/usr/lib -lXt -lX11
SYSLIBS =
LIBRARIES = $(DTLIBS) $(X11LIBS) $(SYSLIBS)
LDFLAGS =
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $<
all:: $(PROGRAM)
$(PROGRAM):: $(OBJECTS)
$(CC) -o $(PROGRAM) $(LDFLAGS) $(OBJECTS) $(LIBRARIES)
clean::
$(RM) $(PROGRAM) $(OBJECTS)

View File

@@ -0,0 +1,45 @@
# $XConsortium: Makefile.novell /main/2 1996/05/13 11:58:35 drk $
##########################################################################
#
# Makefile for motif drag and drop examples (Novell)
#
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Novell, Inc.
#
##########################################################################
CC = cc
RM = rm -f
PROGRAM = DNDDemo
SOURCES = DNDDemo.c DNDDraw.c
OBJECTS = DNDDemo.o DNDDraw.o
DEFINES =
CDEBUGFLAGS = -O
CFLAGS = -Xc $(DEFINES) $(CDEBUGFLAGS)
DTINCLUDE = -I/usr/dt/include
X11INCLUDE = -I/usr/X/include
INCLUDES = $(DTINCLUDE) $(X11INCLUDE)
DTLIBS = -L/usr/dt/lib -lDtWidget -lXm
X11LIBS = -L/usr/X/lib -lXt -lX11
SYSLIBS = -lw -lgen -lnsl -lresolv -lsocket -lXIM
LIBRARIES = $(DTLIBS) $(X11LIBS) $(SYSLIBS)
LDFLAGS =
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $<
all:: $(PROGRAM)
$(PROGRAM):: $(OBJECTS)
$(CC) -o $(PROGRAM) $(LDFLAGS) $(OBJECTS) $(LIBRARIES)
clean::
$(RM) $(PROGRAM) $(OBJECTS)

View File

@@ -0,0 +1,45 @@
# $XConsortium: Makefile.sun /main/2 1996/05/13 11:58:52 drk $
##########################################################################
#
# Makefile for motif drag and drop examples (SUN)
#
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Novell, Inc.
#
##########################################################################
CC = cc
RM = rm -f
PROGRAM = DNDDemo
SOURCES = DNDDemo.c DNDDraw.c
OBJECTS = DNDDemo.o DNDDraw.o
DEFINES =
CDEBUGFLAGS = -O
CFLAGS = $(DEFINES) $(CDEBUGFLAGS)
DTINCLUDE = -I/usr/dt/include
X11INCLUDE = -I/usr/openwin/include
INCLUDES = $(DTINCLUDE) $(X11INCLUDE)
DTLIBS = -L/usr/dt/lib -lDtWidget -lXm
X11LIBS = -L/usr/openwin/lib -lXt -lX11
SYSLIBS = -ldl -lw -lgen
LIBRARIES = $(DTLIBS) $(X11LIBS) $(SYSLIBS)
LDFLAGS = -R/usr/dt/lib:/usr/openwin/lib
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $<
all:: $(PROGRAM)
$(PROGRAM):: $(OBJECTS)
$(CC) -o $(PROGRAM) $(LDFLAGS) $(OBJECTS) $(LIBRARIES)
clean::
$(RM) $(PROGRAM) $(OBJECTS)

View File

@@ -0,0 +1,46 @@
# $XConsortium: Makefile.uxp /main/2 1996/05/13 11:59:16 drk $
##########################################################################
#
# Makefile for motif drag and drop examples (UXP)
#
# (Fujitsu.patch applied)
#
# (c) Copyright 1993, 1994 Hewlett-Packard Company
# (c) Copyright 1993, 1994 International Business Machines Corp.
# (c) Copyright 1993, 1994 Sun Microsystems, Inc.
# (c) Copyright 1993, 1994 Novell, Inc.
#
##########################################################################
CC = cc
RM = rm -f
PROGRAM = DNDDemo
SOURCES = DNDDemo.c DNDDraw.c
OBJECTS = DNDDemo.o DNDDraw.o
DEFINES =
CDEBUGFLAGS = -O
CFLAGS = -Xc $(DEFINES) $(CDEBUGFLAGS)
DTINCLUDE = -I/usr/dt/include
INCLUDES = $(DTINCLUDE)
DTLIBS = -L/usr/dt/lib -lDtWidget -lDtSvc -ltt -lXm
X11LIBS = -lXt -lX11
SYSLIBS = -lw -lgen -lnsl -lresolv -lsocket
LIBRARIES = $(DTLIBS) $(X11LIBS) $(SYSLIBS)
LDFLAGS =
.c.o:
$(CC) -c $(CFLAGS) $(INCLUDES) $<
all:: $(PROGRAM)
$(PROGRAM):: $(OBJECTS)
$(CC) -o $(PROGRAM) $(LDFLAGS) $(OBJECTS) $(LIBRARIES)
clean::
$(RM) $(PROGRAM) $(OBJECTS)

View File

@@ -0,0 +1,76 @@
/* $XConsortium: README /main/2 1996/07/15 14:04:42 drk $ */
This directory contains an example illustrating a typical use of
the Motif DragAndDrop feature.
When the demo comes up, it does not have any valid drop sites. It
comes up with different color rectangles which act as drag sources
for dragging the colors around. You can create the drop sites as
follows:
Move the pointer into the drawing area (with white background).
Press MouseBtn1 and drag. You will see the rubberbanding effect.
Release MouseBtn1 after dragging some distance. A rectangle
will appear with one of its corners corresponding to the point
of MouseBtn1 press, and the diagonally opposite corner
corresponding to the point of MouseBtn1 release. The rectangle
comes up filled with black by default. You can create any number
of rectangles like this.
To initiate a drag, you move the pointer over to the drag source,
press BTransfer (which is MouseBtn2 by default), and start dragging.
Immediately, you will notice that the cursor changes to a painter's
palette in the same color as the color rectangle from which the
drag is initiated.
The rectanlges inside the drawing area that you created will act
as valid drop sites for colors. You can test this by, for example,
initiating the drag from the yellow color rectangle, dragging over
to one of the rectangles inside the drawing area, and releasing
BTransfer.
While you are dragging, you will notice several things.
When you are dragging over root window, the dragicon consists of
only the painter's palette. When you drag over parts of the
drawing area where there are no rectangles, you will notice that
the dragicon changes to include a "DO NOT ENTER!" sign on top of
the painter's palette; when you are dragging over any of the
rectangles inside the drawing area, you will see that the
"DO NOT ENTER!" sign gets replaced with a painter's brush.
To attempt a drop, you will release BTransfer. If you release
BTranfer with the pointer over any part of drawing area outside
of the rectangles, or anywhere on the root window, you will see
that the dragicon snaps back to the point of drag initiation,
and disappears. This is an indication that the drop you
attempted was a failure. On the other hand, if you release
BTransfer with the pointer over any of the rectangles inside
the drawing area, you will see that the dragicon melts into
the background and disappears; this indicates that the drop
you attempted was a success. Also, when the rectangle on which
the drop was attempted, gets filled with the color that was
being dragged around (yellow, in our example).
The rectangles inside the drawing area themselves act as drag
sources. You can initiate the drag with the pointer on any
rectangle, and you will notice that the cursor changes to
a rectangle (either of the same size or a smaller size depending
on X cursor size constraints). You can drag a rectangle from
one place and drop it onto a new place inside the drawing area.
The rectangle gets physically moved to the new position. If,
on the other hand, you want to copy the rectangle to a new
position, you can use the appropriate modifier key while dragging,
and/or at the time you attempt the drop (<Ctrl> is the modifier
key for copy in the current implementation). When you drag
a rectangle with no modifier key pressed or with <Shift>
pressed, you will notice that the solid rectangle from where
you initiated the drag gets replaced by a hollow rectangle with
dotted-line borders. It will continue to be this way, for
the duration of the drag or until you press the <Ctrl> key,
which will change the operation to Copy; at which time it will
regain its original solid form.
A couple of other things to note. Anytime during dragging, you
can cancel that drag by hitting the Cancel key. Also, during
dragging, anytime you hit the Help key, you will get a dialog
giving you some information about whether the drop will
succeed, what are the drop operations possible, etc.