delorie.com/archives/browse.cgi   search  
Mail Archives: geda-user/2012/07/16/06:00:58.1

X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f
X-Recipient: geda-user AT delorie DOT com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20120113;
h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to
:references;
bh=/ad2GM5cTtbTeQlsL1FNw62Bi2zc/w4WrK/O32g/xec=;
b=OinRB7crCd1lGWpX4Sqll90drn/Oe1MwGWMMB/SrYJVQAKKQ2zAyw8Qmk5JbsamM+X
oWliNymXxti7TT3wfFTdU58Pc1r39kaRwI6ohsIK3wKhZHUSzchDkjtES9gA7uQL4M5y
sgP2pRgM2xjS5a/ZY8fcnwKTt8ZvJ8uBLsUJe7il7CTxog9bXA7jQ0oPOudL4BYkMOcb
h5+vMaveernbUobN3I3e0/6uW7uwimXD/a9ITTj5kM2j06oyI7gKA9Wn0jsntQbPLTkz
o2w3bFxFOwI1J0y/hhqIssF+ZSIb78tJHPztwEZc8muwSuegTUaSo/fxqNxjul/FAVgk
QTUw==
Sender: Russ Dill <russ DOT dill AT gmail DOT com>
From: Russ Dill <Russ DOT Dill AT asu DOT edu>
To: geda-user AT delorie DOT com
Cc: Russ Dill <Russ DOT Dill AT gmail DOT com>
Subject: [geda-user] [PATCH 2/2] Add PCB::merge layer attribute.
Date: Mon, 16 Jul 2012 02:59:52 -0700
Message-Id: <1342432792-29260-3-git-send-email-Russ.Dill@asu.edu>
X-Mailer: git-send-email 1.7.10.4
In-Reply-To: <1342432792-29260-1-git-send-email-Russ.Dill@asu.edu>
References: <1342432792-29260-1-git-send-email-Russ DOT Dill AT asu DOT edu>
Reply-To: geda-user AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: geda-user AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

From: Russ Dill <Russ DOT Dill AT gmail DOT com>

If this attribute is set, then the layer is drawn on the
layer specified by the attribute. For instance, toppaste
will cause the layer to be merged with the toppaste
layer during printing.

Signed-off-by: Russ Dill <Russ DOT Dill AT gmail DOT com>
---
 src/draw.c |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/src/draw.c b/src/draw.c
index cc6b954..e094b79 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -612,6 +612,29 @@ PrintAssembly (int side, const BoxType * drawn_area)
 }
 
 /* ---------------------------------------------------------------------------
+ * Merge drawing layer
+ */
+
+void
+DrawMerge (const char *name, const BoxType *screen)
+{
+  int i;
+  if (gui->gui)
+    return;
+
+  for (i = 0; i < max_copper_layer; i++)
+    {
+      const char *attrib;
+      LayerType *l = LAYER_ON_STACK (i);
+      attrib = AttributeGet (l, "PCB::merge");
+      if (attrib && !strcmp (attrib, name))
+        {
+          DrawLayer (l, screen);
+        }
+    }
+}
+
+/* ---------------------------------------------------------------------------
  * initializes some identifiers for a new zoom factor and redraws whole screen
  */
 static void
@@ -701,24 +724,28 @@ DrawEverything (const BoxType *drawn_area)
   if (gui->set_layer ("componentmask", SL (MASK, TOP), 0))
     {
       DrawMask (COMPONENT_LAYER, drawn_area);
+      DrawMerge ("componentmask", drawn_area);
       gui->end_layer ();
     }
 
   if (gui->set_layer ("soldermask", SL (MASK, BOTTOM), 0))
     {
       DrawMask (SOLDER_LAYER, drawn_area);
+      DrawMerge ("soldermask", drawn_area);
       gui->end_layer ();
     }
 
   if (gui->set_layer ("topsilk", SL (SILK, TOP), 0))
     {
       DrawSilk (COMPONENT_LAYER, drawn_area);
+      DrawMerge ("topsilk", drawn_area);
       gui->end_layer ();
     }
 
   if (gui->set_layer ("bottomsilk", SL (SILK, BOTTOM), 0))
     {
       DrawSilk (SOLDER_LAYER, drawn_area);
+      DrawMerge ("bottomsilk", drawn_area);
       gui->end_layer ();
     }
 
@@ -740,6 +767,7 @@ DrawEverything (const BoxType *drawn_area)
   if (gui->set_layer ("toppaste", SL (PASTE, TOP), paste_empty))
     {
       DrawPaste (COMPONENT_LAYER, drawn_area);
+      DrawMerge ("toppaste", drawn_area);
       gui->end_layer ();
     }
 
@@ -747,24 +775,28 @@ DrawEverything (const BoxType *drawn_area)
   if (gui->set_layer ("bottompaste", SL (PASTE, BOTTOM), paste_empty))
     {
       DrawPaste (SOLDER_LAYER, drawn_area);
+      DrawMerge ("bottompaste", drawn_area);
       gui->end_layer ();
     }
 
   if (gui->set_layer ("topassembly", SL (ASSY, TOP), 0))
     {
       PrintAssembly (COMPONENT_LAYER, drawn_area);
+      DrawMerge ("topassembly", drawn_area);
       gui->end_layer ();
     }
 
   if (gui->set_layer ("bottomassembly", SL (ASSY, BOTTOM), 0))
     {
       PrintAssembly (SOLDER_LAYER, drawn_area);
+      DrawMerge ("bottomassembly", drawn_area);
       gui->end_layer ();
     }
 
   if (gui->set_layer ("fab", SL (FAB, 0), 0))
     {
       PrintFab (Output.fgGC);
+      DrawMerge ("fab", drawn_area);
       gui->end_layer ();
     }
 }
-- 
1.7.10.4

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019