aboutsummaryrefslogtreecommitdiff
path: root/generic/Types.h
diff options
context:
space:
mode:
authorlecoanet2000-02-02 08:47:59 +0000
committerlecoanet2000-02-02 08:47:59 +0000
commit80e8c070f8293bceaa6aec439fc8fdb35169e36e (patch)
tree8803f6665431f0be3f7f4809e7a776d98aaf0147 /generic/Types.h
parentabfced29752cf4d282abd983adf827a69518ad84 (diff)
downloadtkzinc-80e8c070f8293bceaa6aec439fc8fdb35169e36e.zip
tkzinc-80e8c070f8293bceaa6aec439fc8fdb35169e36e.tar.gz
tkzinc-80e8c070f8293bceaa6aec439fc8fdb35169e36e.tar.bz2
tkzinc-80e8c070f8293bceaa6aec439fc8fdb35169e36e.tar.xz
Passage en Zinc.
Correction du probl�me d'inclusion de stdio.h en ptk.
Diffstat (limited to 'generic/Types.h')
-rw-r--r--generic/Types.h222
1 files changed, 108 insertions, 114 deletions
diff --git a/generic/Types.h b/generic/Types.h
index a508402..bb94f34 100644
--- a/generic/Types.h
+++ b/generic/Types.h
@@ -1,5 +1,5 @@
/*
- * Types.h -- Types used by the Radar widget.
+ * Types.h -- Types used by the Zinc widget.
*
* Authors : Patrick Lecoanet.
* Creation date : Mon Feb 1 12:13:24 1999
@@ -30,6 +30,7 @@
#ifndef _Types_h
#define _Types_h
+#define NEED_REAL_STDIO
#include <tk.h>
#include <X11/Xutil.h>
#ifdef PTK
@@ -55,29 +56,29 @@ extern "C" {
#endif
-typedef void *RadarItemClassId;
-typedef void *RadarItemId;
-
-typedef double RadarReal;
-typedef int RadarBool; /* Keep it an int to keep Tk happy */
-typedef RadarReal RadarPos;
-typedef RadarReal RadarDim;
-typedef XColor *RadarColor;
-typedef Tk_Font RadarFont;
-typedef Tk_Window RadarWindow;
-typedef void *RadarPtr;
-typedef Tk_Image RadarImage;
-typedef Arg *RadarAttrList;
+typedef void *ZnItemClassId;
+typedef void *ZnItemId;
+
+typedef double ZnReal;
+typedef int ZnBool; /* Keep it an int to keep Tk happy */
+typedef ZnReal ZnPos;
+typedef ZnReal ZnDim;
+typedef XColor *ZnColor;
+typedef Tk_Font ZnFont;
+typedef Tk_Window ZnWindow;
+typedef void *ZnPtr;
+typedef Tk_Image ZnImage;
+typedef Arg *ZnAttrList;
typedef struct {
- RadarPos x, y;
-} RadarPoint;
+ ZnPos x, y;
+} ZnPoint;
typedef struct {
- RadarPos x, y, w, h;
-} RadarRect;
+ ZnPos x, y, w, h;
+} ZnRect;
/*
- * RadarBBox: orig is into the area while corner is not.
+ * ZnBBox: orig is into the area while corner is not.
* Thus the test: ((bbox.orig.x == bbox.corner.x) ||
* (bbox.orig.y == bbox.corner.y))
* tells whether the bbox is empty or not.
@@ -87,18 +88,18 @@ typedef struct {
* always axes aligned.
*/
typedef struct {
- RadarPoint orig, corner;
-} RadarBBox;
+ ZnPoint orig, corner;
+} ZnBBox;
/*
* Describe the clipping at a given node
* of the item hierarchy.
*/
typedef struct {
- RadarBool simple; /* The clip is an aligned rectangle. */
+ ZnBool simple; /* The clip is an aligned rectangle. */
Region region; /* The X region used to draw and to */
/* probe for picking. */
- RadarBBox clip_box; /* The bounding box of the clip area. */
+ ZnBBox clip_box; /* The bounding box of the clip area. */
} ClipState;
/*
@@ -122,83 +123,83 @@ typedef struct {
int offset;
int bool_bit;
int flags;
- RadarBool read_only;
-} RadarAttrConfig;
+ ZnBool read_only;
+} ZnAttrConfig;
/*
* When adding new type in the following enum
* do not forget to update attribute_type_strings
* in Item.c.
*/
-#define RADAR_CONFIG_END 0
-#define RADAR_CONFIG_COLOR 1
-#define RADAR_CONFIG_BOOL 2
-#define RADAR_CONFIG_PATTERN 3
-#define RADAR_CONFIG_TEXT 4
-#define RADAR_CONFIG_FONT 5
-#define RADAR_CONFIG_BORDER 6
-#define RADAR_CONFIG_RELIEF 7
-#define RADAR_CONFIG_DIM 8
-#define RADAR_CONFIG_PRI 9
-#define RADAR_CONFIG_JUSTIFY 10
-#define RADAR_CONFIG_AUTO_JUSTIFY 11
-#define RADAR_CONFIG_LINE_END 12
-#define RADAR_CONFIG_LABEL_FORMAT 13
-#define RADAR_CONFIG_LINE_STYLE 14
-#define RADAR_CONFIG_LINE_SHAPE 15
-#define RADAR_CONFIG_ITEM 16
-#define RADAR_CONFIG_ANGLE 17
-#define RADAR_CONFIG_INT 18
-#define RADAR_CONFIG_UINT 19
-#define RADAR_CONFIG_POINT 20
-#define RADAR_CONFIG_RECT 21
-#define RADAR_CONFIG_PATTERNS 22
-#define RADAR_CONFIG_ANCHOR 23
-#define RADAR_CONFIG_TAGS 24
-#define RADAR_CONFIG_POINTS 25
-#define RADAR_CONFIG_MAP_INFO 26
-#define RADAR_CONFIG_IMAGE 27
-#define RADAR_CONFIG_LEADER_ANCHORS 28
-#define RADAR_CONFIG_JOIN_STYLE 29
-#define RADAR_CONFIG_CAP_STYLE 30
+#define ZN_CONFIG_END 0
+#define ZN_CONFIG_COLOR 1
+#define ZN_CONFIG_BOOL 2
+#define ZN_CONFIG_PATTERN 3
+#define ZN_CONFIG_TEXT 4
+#define ZN_CONFIG_FONT 5
+#define ZN_CONFIG_BORDER 6
+#define ZN_CONFIG_RELIEF 7
+#define ZN_CONFIG_DIM 8
+#define ZN_CONFIG_PRI 9
+#define ZN_CONFIG_JUSTIFY 10
+#define ZN_CONFIG_AUTO_JUSTIFY 11
+#define ZN_CONFIG_LINE_END 12
+#define ZN_CONFIG_LABEL_FORMAT 13
+#define ZN_CONFIG_LINE_STYLE 14
+#define ZN_CONFIG_LINE_SHAPE 15
+#define ZN_CONFIG_ITEM 16
+#define ZN_CONFIG_ANGLE 17
+#define ZN_CONFIG_INT 18
+#define ZN_CONFIG_UINT 19
+#define ZN_CONFIG_POINT 20
+#define ZN_CONFIG_RECT 21
+#define ZN_CONFIG_PATTERNS 22
+#define ZN_CONFIG_ANCHOR 23
+#define ZN_CONFIG_TAGS 24
+#define ZN_CONFIG_POINTS 25
+#define ZN_CONFIG_MAP_INFO 26
+#define ZN_CONFIG_IMAGE 27
+#define ZN_CONFIG_LEADER_ANCHORS 28
+#define ZN_CONFIG_JOIN_STYLE 29
+#define ZN_CONFIG_CAP_STYLE 30
-#define RADAR_DRAW_FLAG 1 << 0
-#define RADAR_COORDS_FLAG 1 << 1
-#define RADAR_TRANSFO_FLAG 1 << 2
-#define RADAR_REPICK_FLAG 1 << 3
-#define RADAR_BORDER_FLAG 1 << 4
-#define RADAR_CLFC_FLAG 1 << 5 /* Clear Label Format Cache. */
-#define RADAR_IMAGE_FLAG 1 << 6 /* Update image pointer. */
-#define RADAR_VIS_FLAG 1 << 7 /* Visibility has changed. */
-#define RADAR_MOVED_FLAG 1 << 8 /* Item has moved. */
-#define RADAR_ITEM_FLAG 1 << 9 /* Signal a change in item type attribute. */
-#define RADAR_MAP_INFO_FLAG 1 << 10 /* Update mapinfo pointer. */
-#define RADAR_LAYOUT_FLAG 1 << 10 /* A layout need update. */
-#define RADAR_POLAR_FLAG 1 << 11 /* Signal a cartesian to polar change. */
-#define RADAR_CARTESIAN_FLAG 1 << 12 /* Signal a polar to cartesian change. */
-#define RADAR_TILE_FLAG 1 << 13 /* Update tile pointer. */
+#define ZN_DRAW_FLAG 1 << 0
+#define ZN_COORDS_FLAG 1 << 1
+#define ZN_TRANSFO_FLAG 1 << 2
+#define ZN_REPICK_FLAG 1 << 3
+#define ZN_BORDER_FLAG 1 << 4
+#define ZN_CLFC_FLAG 1 << 5 /* Clear Label Format Cache. */
+#define ZN_IMAGE_FLAG 1 << 6 /* Update image pointer. */
+#define ZN_VIS_FLAG 1 << 7 /* Visibility has changed. */
+#define ZN_MOVED_FLAG 1 << 8 /* Item has moved. */
+#define ZN_ITEM_FLAG 1 << 9 /* Signal a change in item type attribute. */
+#define ZN_MAP_INFO_FLAG 1 << 10 /* Update mapinfo pointer. */
+#define ZN_LAYOUT_FLAG 1 << 10 /* A layout need update. */
+#define ZN_POLAR_FLAG 1 << 11 /* Signal a cartesian to polar change. */
+#define ZN_CARTESIAN_FLAG 1 << 12 /* Signal a polar to cartesian change. */
+#define ZN_TILE_FLAG 1 << 13 /* Update tile pointer. */
/*
* Type and constant values for alignments.
*/
-typedef char RadarJustify;
-#define RadarJustifyLeft TK_JUSTIFY_LEFT
-#define RadarJustifyRight TK_JUSTIFY_RIGHT
-#define RadarJustifyCenter TK_JUSTIFY_CENTER
+typedef char ZnJustify;
+#define ZnJustifyLeft TK_JUSTIFY_LEFT
+#define ZnJustifyRight TK_JUSTIFY_RIGHT
+#define ZnJustifyCenter TK_JUSTIFY_CENTER
/*
* Type and constant values for anchors.
*/
-typedef Tk_Anchor RadarAnchor;
-#define RadarAnchorN TK_ANCHOR_N
-#define RadarAnchorS TK_ANCHOR_S
-#define RadarAnchorE TK_ANCHOR_E
-#define RadarAnchorW TK_ANCHOR_W
-#define RadarAnchorNE TK_ANCHOR_NE
-#define RadarAnchorNW TK_ANCHOR_NW
-#define RadarAnchorSE TK_ANCHOR_SE
-#define RadarAnchorSW TK_ANCHOR_SW
-#define RadarAnchorCenter TK_ANCHOR_CENTER
+typedef Tk_Anchor ZnAnchor;
+#define ZnAnchorN TK_ANCHOR_N
+#define ZnAnchorS TK_ANCHOR_S
+#define ZnAnchorE TK_ANCHOR_E
+#define ZnAnchorW TK_ANCHOR_W
+#define ZnAnchorNE TK_ANCHOR_NE
+#define ZnAnchorNW TK_ANCHOR_NW
+#define ZnAnchorSE TK_ANCHOR_SE
+#define ZnAnchorSW TK_ANCHOR_SW
+#define ZnAnchorCenter TK_ANCHOR_CENTER
/*
* Type and constant values for borders.
@@ -275,8 +276,8 @@ typedef int ReliefStyle; /* Keep it an int to keep Tk happy */
* Type and constant values for automatic alignments.
*/
typedef struct {
- RadarBool automatic;
- RadarJustify align[3];
+ ZnBool automatic;
+ ZnJustify align[3];
} AutoAlign;
#define AA_LEFT 0
#define AA_CENTER 1
@@ -297,33 +298,26 @@ typedef struct {
short right_y; /* right leader percent of bbox or < 0 if field */
} LeaderAnchorsStruct, *LeaderAnchors;
-#define RadarPixel(color) ((color)->pixel)
-#define RadarFontId(font) (Tk_FontId(font))
-#define RadarWindowId(win) (Tk_WindowId(win))
-#define RadarTextWidth(font, text, len) (Tk_TextWidth(font, text, len))
-#define RadarMalloc(size) (ckalloc(size))
-#define RadarFree(ptr) (ckfree((char *)(ptr)))
-#define RadarRealloc(ptr, size) (ckrealloc((void *)(ptr), size))
-/*
- * How to make ptk include the right stdio.h ?
- */
-#ifndef PTK
-#define RadarWarning(msg) (fprintf(stderr, "%s\n", (msg)))
-#else
-#define RadarWarning(msg)
-#endif
+#define ZnPixel(color) ((color)->pixel)
+#define ZnFontId(font) (Tk_FontId(font))
+#define ZnWindowId(win) (Tk_WindowId(win))
+#define ZnTextWidth(font, text, len) (Tk_TextWidth(font, text, len))
+#define ZnMalloc(size) (ckalloc(size))
+#define ZnFree(ptr) (ckfree((char *)(ptr)))
+#define ZnRealloc(ptr, size) (ckrealloc((void *)(ptr), size))
+#define ZnWarning(msg) (fprintf(stderr, "%s\n", (msg)))
-#define RadarUnspecifiedPattern None
-#define RadarUnspecifiedImage None
-#define RadarUnspecifiedColor NULL
-#define RADAR_OK TCL_OK
-#define RADAR_ERROR TCL_ERROR
-#define RADAR_NO_ITEM NULL
+#define ZnUnspecifiedPattern None
+#define ZnUnspecifiedImage None
+#define ZnUnspecifiedColor NULL
+#define ZN_OK TCL_OK
+#define ZN_ERROR TCL_ERROR
+#define ZN_NO_ITEM NULL
/*
* Various constants used by items.
*/
-#define RADAR_ANY_CIRCLES -1
+#define ZN_ANY_CIRCLES -1
/*
* Constants for item parts. The fields or item indexable parts are coded
@@ -333,11 +327,11 @@ typedef struct {
*/
#define PART_NUMBER_TO_BIT(part) (1 << (ABS(part)-2))
-#define RADAR_NO_PART -1
-#define RADAR_CURRENT_POSITION -2
-#define RADAR_SPEED_VECTOR -3
-#define RADAR_LEADER -4
-#define RADAR_CONNECTION -5
+#define ZN_NO_PART -1
+#define ZN_CURRENT_POSITION -2
+#define ZN_SPEED_VECTOR -3
+#define ZN_LEADER -4
+#define ZN_CONNECTION -5
/*