aboutsummaryrefslogtreecommitdiff
path: root/generic
diff options
context:
space:
mode:
authorlecoanet2005-01-24 12:19:27 +0000
committerlecoanet2005-01-24 12:19:27 +0000
commit8f19fda4baa210eab4dd9c508b5aca253c13a0c4 (patch)
tree60b8c2ea44bc2813362a46b6f711ab731c78368a /generic
parenta56b4764d2773a957658e496b0e2863e27b0bca9 (diff)
downloadtkzinc-8f19fda4baa210eab4dd9c508b5aca253c13a0c4.zip
tkzinc-8f19fda4baa210eab4dd9c508b5aca253c13a0c4.tar.gz
tkzinc-8f19fda4baa210eab4dd9c508b5aca253c13a0c4.tar.bz2
tkzinc-8f19fda4baa210eab4dd9c508b5aca253c13a0c4.tar.xz
Suppressed the conditional compilation of the anti-overlapping
code. Added the conditional compilation of all the atc code.
Diffstat (limited to 'generic')
-rw-r--r--generic/Group.c8
-rw-r--r--generic/Item.c4
-rw-r--r--generic/Track.c2
-rw-r--r--generic/WidgetInfo.h6
-rw-r--r--generic/tkZinc.c55
5 files changed, 48 insertions, 27 deletions
diff --git a/generic/Group.c b/generic/Group.c
index 65cffab..4228437 100644
--- a/generic/Group.c
+++ b/generic/Group.c
@@ -57,7 +57,7 @@ typedef struct _GroupItemStruct {
ZnItem head; /* Doubly linked list of all items. */
ZnItem tail;
ZnList dependents; /* List of dependent items. */
-#ifdef OM
+#ifdef ATC
/* Overlap manager variables.
* These variables are valid *only* if the overlap
* manager is active. */
@@ -137,7 +137,7 @@ Init(ZnItem item,
SET(item->flags, ZN_COMPOSE_SCALE_BIT);
CLEAR(item->flags, ATOMIC_BIT);
item->priority = 1;
-#ifdef OM
+#ifdef ATC
group->call_om = False;
#endif
@@ -170,7 +170,7 @@ Clone(ZnItem item)
current_item = group->tail;
group->head = group->tail = ZN_NO_ITEM;
-#ifdef OM
+#ifdef ATC
group->call_om = False;
#endif
dependents = group->dependents;
@@ -1392,7 +1392,7 @@ ZnGroupTail(ZnItem group)
return ((GroupItem) group)->tail;
}
-#ifdef OM
+#ifdef ATC
ZnBool
ZnGroupCallOm(ZnItem group)
{
diff --git a/generic/Item.c b/generic/Item.c
index a78360e..1ae8983 100644
--- a/generic/Item.c
+++ b/generic/Item.c
@@ -39,7 +39,7 @@
#include "Image.h"
#include "Color.h"
#include "tkZinc.h"
-#ifdef OM
+#ifdef ATC
#include "OverlapMan.h"
#endif
@@ -1340,10 +1340,12 @@ ZnItemInit()
/* First check if static part already inited */
if (item_classes == NULL) {
item_classes = ZnListNew(16, sizeof(ZnItemClass));
+#ifdef ATC
ZnAddItemClass(ZnTrack);
ZnAddItemClass(ZnWayPoint);
ZnAddItemClass(ZnMap);
ZnAddItemClass(ZnReticle);
+#endif
ZnAddItemClass(ZnTabular);
ZnAddItemClass(ZnRectangle);
ZnAddItemClass(ZnArc);
diff --git a/generic/Track.c b/generic/Track.c
index 0d18c27..47b80a0 100644
--- a/generic/Track.c
+++ b/generic/Track.c
@@ -1779,7 +1779,7 @@ PostScript(ZnItem item __unused,
}
-#ifdef OM
+#ifdef ATC
/*
**********************************************************************************
*
diff --git a/generic/WidgetInfo.h b/generic/WidgetInfo.h
index 4a35cce..725b2d9 100644
--- a/generic/WidgetInfo.h
+++ b/generic/WidgetInfo.h
@@ -141,13 +141,12 @@ typedef struct _ZnWInfo {
ZnReliefStyle relief; /* The border relief. */
/* Tracks global resources */
+#ifdef ATC
unsigned int track_managed_history_size; /* Size of history for tracks */
unsigned int track_visible_history_size; /* Size of displayed history */
ZnReal speed_vector_length; /* How long (in time) are speedvectors*/
int om_group_id; /* Tell which group contains tracks to be */
-#ifdef OM
ZnItem om_group; /* processed for anti label overlap. */
-#endif
/* Maps global resources */
Tk_Font map_text_font; /* Font for texts in Map items */
@@ -160,7 +159,8 @@ typedef struct _ZnWInfo {
/* lines. */
Tcl_Obj *track_symbol_obj;
ZnImage track_symbol; /* Symbol displayed at track/wp current */
- /* positrion. */
+ /* position. */
+#endif
/* Transformer */
ZnTransfo *current_transfo;
ZnList transfo_stack;
diff --git a/generic/tkZinc.c b/generic/tkZinc.c
index 6f0ec05..f184fb6 100644
--- a/generic/tkZinc.c
+++ b/generic/tkZinc.c
@@ -48,10 +48,10 @@ static const char * const zinc_version = "zinc-version-" VERSION;
#include "WidgetInfo.h"
#include "tkZinc.h"
#include "MapInfo.h"
-#ifdef OM
+#ifdef ATC
#include "OverlapMan.h"
-#endif
#include "Track.h"
+#endif
#include "Transfo.h"
#include "Image.h"
#include "Draw.h"
@@ -429,6 +429,7 @@ static Tk_OptionSpec option_specs[] = {
"600", -1, Tk_Offset(ZnWInfo, insert_on_time), 0, NULL, CONFIG_FOCUS},
{TK_OPTION_PIXELS, "-insertwidth", "insertWidth", "InsertWidth",
"2", -1, Tk_Offset(ZnWInfo, text_info.insert_width), 0, NULL, CONFIG_FOCUS_ITEM},
+#ifdef ATC
{TK_OPTION_STRING, "-mapdistancesymbol", "mapDistanceSymbol", "MapDistanceSymbol",
"AtcSymbol19", Tk_Offset(ZnWInfo, map_symbol_obj), -1,
TK_CONFIG_NULL_OK, NULL, CONFIG_MAP_SYMBOL|CONFIG_INVALIDATE_MAPS},
@@ -437,6 +438,7 @@ static Tk_OptionSpec option_specs[] = {
-1, Tk_Offset(ZnWInfo, map_text_font), 0, NULL, CONFIG_MAP_FONT},
{TK_OPTION_INT, "-overlapmanager", "overlapManager", "OverlapManager", "1",
-1, Tk_Offset(ZnWInfo, om_group_id), 0, NULL, CONFIG_OM},
+#endif
{TK_OPTION_INT, "-pickaperture", "pickAperture", "PickAperture",
"1", -1, Tk_Offset(ZnWInfo, pick_aperture), 0, NULL, 0},
{TK_OPTION_CUSTOM, "-relief", "relief", "Relief",
@@ -450,13 +452,16 @@ static Tk_OptionSpec option_specs[] = {
TK_CONFIG_NULL_OK, NULL, CONFIG_SET_ORIGIN|CONFIG_SCROLL_REGION},
{TK_OPTION_CUSTOM, "-selectbackground", "selectBackground", "Foreground",
"#a0a0a0", -1, Tk_Offset(ZnWInfo, text_info.sel_color), 0, &gradientOption, 0},
+#ifdef ATC
{TK_OPTION_DOUBLE, "-speedvectorlength", "speedVectorLength",
"SpeedVectorLength", "3", -1, Tk_Offset(ZnWInfo, speed_vector_length),
0, NULL, CONFIG_INVALIDATE_TRACKS},
+#endif
{TK_OPTION_STRING, "-takefocus", "takeFocus", "TakeFocus",
NULL, Tk_Offset(ZnWInfo, take_focus), -1, TK_CONFIG_NULL_OK, NULL, 0},
{TK_OPTION_STRING, "-tile", "tile", "Tile",
"", Tk_Offset(ZnWInfo, tile_obj), -1, TK_CONFIG_NULL_OK, NULL, CONFIG_TILE|CONFIG_DAMAGE_ALL},
+#ifdef ATC
{TK_OPTION_INT, "-trackvisiblehistorysize", "trackVisibleHistorySize", "TrackVisibleHistorySize",
"6", -1, Tk_Offset(ZnWInfo, track_visible_history_size), 0, NULL, CONFIG_INVALIDATE_TRACKS},
{TK_OPTION_INT, "-trackmanagedhistorysize", "trackManagedHistorySize",
@@ -465,6 +470,7 @@ static Tk_OptionSpec option_specs[] = {
{TK_OPTION_STRING, "-tracksymbol", "trackSymbol", "TrackSymbol",
"AtcSymbol15", Tk_Offset(ZnWInfo, track_symbol_obj), -1,
0, NULL, CONFIG_TRACK_SYMBOL|CONFIG_INVALIDATE_TRACKS|CONFIG_INVALIDATE_WPS},
+#endif
{TK_OPTION_PIXELS, "-width", "width", "Width",
"10c", -1, Tk_Offset(ZnWInfo, opt_width), 0, NULL, CONFIG_DAMAGE_ALL|CONFIG_REQUEST_GEOM},
#ifdef PTK
@@ -1319,25 +1325,29 @@ ZincObjCmd(ClientData client_data, /* Main window associated with
wi->opt_width = None;
wi->opt_height = None;
wi->font = 0;
+#ifdef ATC
+ wi->track_visible_history_size = 0;
+ wi->track_managed_history_size = 0;
+ wi->speed_vector_length = 0;
wi->map_text_font = 0;
-#ifdef GL
+# ifdef GL
wi->font_tfi = NULL;
wi->map_font_tfi = NULL;
-#endif
+# endif
wi->map_distance_symbol = ZnUnspecifiedImage;
wi->track_symbol = ZnUnspecifiedImage;
- wi->tile = ZnUnspecifiedImage;
-#ifndef PTK_800
+# ifndef PTK_800
wi->map_symbol_obj = NULL;
wi->track_symbol_obj = NULL;
+# endif
+#endif
+ wi->tile = ZnUnspecifiedImage;
+#ifndef PTK_800
wi->tile_obj = NULL;
#endif
wi->cursor = None;
wi->hot_item = ZN_NO_ITEM;
wi->hot_prev = ZN_NO_ITEM;
- wi->track_visible_history_size = 0;
- wi->track_managed_history_size = 0;
- wi->speed_vector_length = 0;
wi->confine = 0;
wi->origin.x = wi->origin.y = 0;
wi->scroll_xo = wi->scroll_yo = 0;
@@ -1356,7 +1366,7 @@ ZincObjCmd(ClientData client_data, /* Main window associated with
wi->top_group = ZnCreateItem(wi, ZnGroup, 0, NULL);
-#ifdef OM
+#ifdef ATC
wi->om_group_id = 0;
wi->om_group = wi->top_group;
OmRegister((void *) wi, ZnSendTrackToOm, ZnSetLabelAngleFromOm, ZnQueryLabelPosition);
@@ -6569,6 +6579,7 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
CONFIG_PROBE(HIGHLIGHT_THICKNESS_SPEC)) {
ZnDamageAll(wi);
}
+#ifdef ATC
if (CONFIG_PROBE(SPEED_VECTOR_LENGTH_SPEC) ||
CONFIG_PROBE(VISIBLE_HISTORY_SIZE_SPEC) ||
CONFIG_PROBE(MANAGED_HISTORY_SIZE_SPEC)) {
@@ -6581,7 +6592,8 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
ZnITEM.InvalidateItems(wi->top_group, ZnTrack);
ZnITEM.InvalidateItems(wi->top_group, ZnWayPoint);
}
-
+#endif
+
/*
* Request the new geometry.
*/
@@ -6598,7 +6610,7 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
/*
* Update the registration with the overlap manager.
*/
-#ifdef OM
+#ifdef ATC
if (CONFIG_PROBE(OVERLAP_MANAGER_SPEC)) {
Tcl_HashEntry *entry;
ZnItem grp;
@@ -6844,6 +6856,7 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
}
}
+#ifdef ATC
if ((mask & CONFIG_MAP_SYMBOL) || init) {
if (wi->map_distance_symbol) {
ZnFreeImage(wi->map_distance_symbol, NULL, NULL);
@@ -6870,6 +6883,7 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
}
}
+#endif
/*
* Maintain the pick aperture within meaningful bounds.
@@ -6902,6 +6916,7 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
wi->inset = wi->border_width + wi->highlight_width;
+#ifdef ATC
if (mask & CONFIG_INVALIDATE_TRACKS) {
ZnITEM.InvalidateItems(wi->top_group, ZnTrack);
}
@@ -6911,7 +6926,8 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
if (mask & CONFIG_INVALIDATE_WPS) {
ZnITEM.InvalidateItems(wi->top_group, ZnWayPoint);
}
-
+#endif
+
/*
* Request the new geometry.
*/
@@ -6922,7 +6938,7 @@ Configure(Tcl_Interp *interp,/* Used for error reporting. */
/*
* Update the registration with the overlap manager.
*/
-#ifdef OM
+#ifdef ATC
if (mask & CONFIG_OM) {
Tcl_HashEntry *entry;
ZnItem grp;
@@ -8000,7 +8016,7 @@ Destroy(char *mem_ptr) /* Info about the widget. */
/*
* Unregister form the overlap manager.
*/
-#ifdef OM
+#ifdef ATC
if (wi->om_group != ZN_NO_ITEM) {
OmUnregister((void *) wi);
}
@@ -8058,6 +8074,7 @@ Destroy(char *mem_ptr) /* Info about the widget. */
wi->tile = ZnUnspecifiedImage;
}
+#ifdef ATC
/* Free the symbols */
if (wi->map_distance_symbol != ZnUnspecifiedImage) {
ZnFreeImage(wi->map_distance_symbol, NULL, NULL);
@@ -8067,6 +8084,7 @@ Destroy(char *mem_ptr) /* Info about the widget. */
ZnFreeImage(wi->track_symbol, NULL, NULL);
wi->track_symbol = ZnUnspecifiedImage;
}
+#endif
/* Free the double buffer pixmap/image */
if (wi->draw_buffer) {
@@ -8280,7 +8298,7 @@ Update(ZnWInfo *wi)
/*
* Give the overlap manager a chance to do its work.
*/
-#ifdef OM
+#ifdef ATC
if ((wi->om_group != ZN_NO_ITEM) && ZnGroupCallOm(wi->om_group)) {
ZnPoint scale={1.0,1.0};
if (wi->om_group->transfo) {
@@ -8936,7 +8954,7 @@ InitZinc(Tcl_Interp *interp) {
/*
* Initialise Overlap manager library.
*/
-#ifdef OM
+#ifdef ATC
OmInit();
#endif
@@ -8988,11 +9006,12 @@ Tkzinc_Init(Tcl_Interp *interp) /* Used for error reporting. */
Tcl_CreateObjCommand(interp, "zinc", ZincObjCmd,
(ClientData) Tk_MainWindow(interp),
(Tcl_CmdDeleteProc *) NULL);
+#ifdef ATC
Tcl_CreateObjCommand(interp, "mapinfo", ZnMapInfoObjCmd,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
Tcl_CreateObjCommand(interp, "videomap", ZnVideomapObjCmd,
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
-
+#endif
#ifndef PTK
if (Tcl_PkgProvide(interp, "Tkzinc", VERSION) == TCL_ERROR) {