From 24ae95932e113db79d85d487523576d6e8747ebc Mon Sep 17 00:00:00 2001 From: Peter Clifton Date: Sun, 15 Nov 2009 02:27:20 +0000 Subject: [PATCH] Add SL_RATS layer ID to tell the GUI we're drawing rats Also, let the GUI decide whether it wants to draw rats or not, rather than have the core test PCB->RatsOn directly. --- src/draw.c | 2 +- src/hid.h | 1 + src/hid/gtk/gtkhid-main.c | 2 ++ src/hid/lesstif/main.c | 2 ++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/draw.c b/src/draw.c index 8340b853..b843da66 100644 --- a/src/draw.c +++ b/src/draw.c @@ -518,7 +518,7 @@ DrawEverything (BoxTypePtr drawn_area) r_search (PCB->Data->element_tree, drawn_area, NULL, EMark_callback, NULL); /* Draw rat lines on top */ - if (PCB->RatOn) + if (gui->set_layer ("rats", SL (RATS, 0), 0)) DrawRats(drawn_area); } diff --git a/src/hid.h b/src/hid.h index ee48b9f4..7966346c 100644 --- a/src/hid.h +++ b/src/hid.h @@ -214,6 +214,7 @@ extern "C" #define SL_INVISIBLE 0x0060 #define SL_FAB 0x0070 #define SL_ASSY 0x0080 +#define SL_RATS 0x0090 /* Callers should use this. */ #define SL(type,side) (~0xfff | SL_##type | SL_##side##_SIDE) diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c index cbdd104e..280cfbe0 100644 --- a/src/hid/gtk/gtkhid-main.c +++ b/src/hid/gtk/gtkhid-main.c @@ -551,6 +551,8 @@ ghid_set_layer (const char *name, int group, int empty) case SL_PDRILL: case SL_UDRILL: return 1; + case SL_RATS: + return PCB->RatOn; } } return 0; diff --git a/src/hid/lesstif/main.c b/src/hid/lesstif/main.c index 93bb2b8f..6ff7e742 100644 --- a/src/hid/lesstif/main.c +++ b/src/hid/lesstif/main.c @@ -2890,6 +2890,8 @@ lesstif_set_layer (const char *name, int group, int empty) case SL_UDRILL: case SL_PDRILL: return 1; + case SL_RATS: + return PCB->RatOn; } } return 0; -- 2.11.4.GIT