Send commitlog mailing list submissions to
commitlog@lists.openmoko.org
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.openmoko.org/mailman/listinfo/commitlog
or, via email, send a message with subject or body 'help' to
commitlog-requ...@lists.openmoko.org
You can reach the person managing the list at
commitlog-ow...@lists.openmoko.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of commitlog digest..."
Today's Topics:
1. r5516 - trunk/eda/fped (wer...@docs.openmoko.org)
2. r5517 - trunk/eda/fped (wer...@docs.openmoko.org)
3. r5518 - trunk/gta02-core/modules (wer...@docs.openmoko.org)
4. r5519 - trunk/eda/fped (wer...@docs.openmoko.org)
5. r5520 - in trunk/gta02-core: . docs (wer...@docs.openmoko.org)
--- Begin Message ---
Author: werner
Date: 2009-08-21 21:50:45 +0200 (Fri, 21 Aug 2009)
New Revision: 5516
Modified:
trunk/eda/fped/delete.c
trunk/eda/fped/gui_style.c
Log:
When deleting frame "foo" in root->foo->bar and then linking bar from root,
bar didn't automatically become active, which was rather confusing. We now
also try harder to keep a frame active.
- when deleting a frame, also reset all outbound active references
- when removing the active frame reference, search for a suitable replacement
instead of just setting it to NULL
- gui_style.c: made inactive frames a little more visible
Modified: trunk/eda/fped/delete.c
===================================================================
--- trunk/eda/fped/delete.c 2009-08-21 19:19:33 UTC (rev 5515)
+++ trunk/eda/fped/delete.c 2009-08-21 19:50:45 UTC (rev 5516)
@@ -74,6 +74,9 @@
static void do_delete_obj(struct obj *obj);
+/* ----- helper functions -------------------------------------------------- */
+
+
static struct deletion *new_deletion(enum del_type type)
{
struct deletion *del;
@@ -87,6 +90,19 @@
}
+static void reset_active_ref(struct frame *ref)
+{
+ const struct frame *frame;
+ struct obj *obj = NULL;
+
+ for (frame = frames; frame; frame = frame->next)
+ for (obj = frame->objs; obj; obj = obj->next)
+ if (obj->type == ot_frame && obj->u.frame.ref == ref)
+ break;
+ ref->active_ref = obj;
+}
+
+
/* ----- vectors ----------------------------------------------------------- */
@@ -189,7 +205,7 @@
switch (obj->type) {
case ot_frame:
if (obj->u.frame.ref->active_ref == obj)
- obj->u.frame.ref->active_ref = NULL;
+ reset_active_ref(obj->u.frame.ref);
break;
case ot_pad:
free(obj->u.pad.name);
@@ -232,7 +248,7 @@
del->u.obj.ref = obj;
del->u.obj.prev = prev;
if (obj->type == ot_frame && obj->u.frame.ref->active_ref == obj)
- obj->u.frame.ref->active_ref = NULL;
+ reset_active_ref(obj->u.frame.ref);
}
@@ -502,6 +518,10 @@
if (obj->type == ot_frame)
if (obj->u.frame.ref == ref)
do_delete_obj(obj);
+ for (obj = ref->objs; obj; obj = obj->next)
+ if (obj->type == ot_frame)
+ if (obj->u.frame.ref->active_ref == obj)
+ reset_active_ref(obj->u.frame.ref);
}
Modified: trunk/eda/fped/gui_style.c
===================================================================
--- trunk/eda/fped/gui_style.c 2009-08-21 19:19:33 UTC (rev 5515)
+++ trunk/eda/fped/gui_style.c 2009-08-21 19:50:45 UTC (rev 5516)
@@ -65,7 +65,7 @@
style(gc_pad, "#400000", "#ff0000", "#ffff80");
style(gc_ptext, "#404040", "#ffffff", "#ffffff");
style(gc_meas, "#280040", "#ff00ff", "#ffff80");
- style(gc_frame, "#004000", "#009000", "#ffff80");
+ style(gc_frame, "#005000", "#009000", "#ffff80");
gc_active_frame = gc("#00ff00", 2);
// gc_highlight = gc("#ff8020", 2);
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2009-08-22 01:28:38 +0200 (Sat, 22 Aug 2009)
New Revision: 5517
Modified:
trunk/eda/fped/TODO
trunk/eda/fped/postscript.c
Log:
Improving Postscript output (on-going)
- postscript.c: added page layout parameters and header
- postscript.c: increase initial size for maxfont from 100 to 1000, so that we
don't end up with zero-sized fonts for zoom = 1
- postscript.c: desired size of measurement text is no longer affected by zoom
- postscript.c: roughly doubled size of measurement text
- postscript.c: adjust zoom to package dimension and try to draw 2x and 1x
package next to enlarged package
Modified: trunk/eda/fped/TODO
===================================================================
--- trunk/eda/fped/TODO 2009-08-21 19:50:45 UTC (rev 5516)
+++ trunk/eda/fped/TODO 2009-08-21 23:28:38 UTC (rev 5517)
@@ -1,5 +1,4 @@
Major missing features:
-- populate input area (still needed: mm/mil, rezoom)
- add postscript output (partially done)
- add option to include/omit helper vecs and frames (done for display, still
need postscript). Better idea: in PS, print the component 10x, 1x, and then
@@ -10,11 +9,12 @@
- reorder rows in a table (can use text editor)
- reorder columns in a table
- reorder variables in a frame (can use text editor)
+- move items/vectors up and down the hierarchy
Error detection:
- eliminate duplicate instances
-Style:
+Style and usability:
- make column of entry field greedily consume all unallocated space
- make menu bar consume all unallocated space instead of sharing it evenly with
upper toolbar
@@ -26,6 +26,8 @@
don't properly size rotated text.
- when changing the part, we should automatically switch to a configuration
that generates any of its (non-global) elements
+- add zoom controls to top toolbar
+- add tooltips
Bugs:
- default silk width has no business being hard-coded in obj.c
Modified: trunk/eda/fped/postscript.c
===================================================================
--- trunk/eda/fped/postscript.c 2009-08-21 19:50:45 UTC (rev 5516)
+++ trunk/eda/fped/postscript.c 2009-08-21 23:28:38 UTC (rev 5517)
@@ -21,29 +21,62 @@
#include "postscript.h"
+/*
+ * A4 is 210 mm x 297 mm
+ * US Letter is 216 mm x 279 mm
+ *
+ * We pick the smallest dimensions minus a bit of slack and center on the
+ * printer page.
+ */
+
+#define PAGE_HALF_WIDTH mm_to_units(210/2.0-10) /* A4 */
+#define PAGE_HALF_HEIGHT mm_to_units(279/2.0-15) /* US Letter */
+
+/*
+ * Page layout:
+ *
+ * HEADER DATE
+ * --------------------------- HEADER_HEIGHT+DIVIDER_BORDER below top
+ * |
+ * | 2x
+ * 10 x |<------------- roughly at 10/12
+ * | 1x
+ * |
+ * --------------------------- 50% height
+ * Frames in boxes
+ *
+ */
+
+
+#define PS_HEADER_HEIGHT mm_to_units(8)
+#define PS_DIVIDER_BORDER mm_to_units(2)
+#define PS_DIVIDER_WIDTH mm_to_units(0.5)
+
#define PS_DOT_DIST mm_to_units(0.03)
#define PS_DOT_DIAM mm_to_units(0.01)
#define PS_HATCH mm_to_units(0.1)
#define PS_HATCH_LINE mm_to_units(0.015)
#define PS_FONT_OUTLINE mm_to_units(0.025)
#define PS_MEAS_LINE mm_to_units(0.015)
-#define PS_MEAS_ARROW_LEN mm_to_units(0.07)
+#define PS_MEAS_ARROW_LEN mm_to_units(0.15)
#define PS_MEAS_ARROW_ANGLE 30
-#define PS_MEAS_TEXT_HEIGHT mm_to_units(0.2)
-#define PS_MEAS_BASE_OFFSET mm_to_units(0.05)
+#define PS_MEAS_TEXT_HEIGHT mm_to_units(3.5) /* ~10 pt, real
mm */
+#define PS_MEAS_BASE_OFFSET mm_to_units(0.5) /* real mm */
#define PS_CROSS_WIDTH mm_to_units(0.01)
#define PS_CROSS_DASH mm_to_units(0.1)
struct postscript_params postscript_params = {
- .zoom = 10.0,
.show_pad_names = 1,
.show_stuff = 0,
.label_vecs = 0,
.show_meas = 1,
};
+static const struct postscript_params minimal_params;
+static struct postscript_params active_params;
+
static void ps_pad_name(FILE *file, const struct inst *inst)
{
struct coord a = inst->base;
@@ -58,7 +91,7 @@
w = -w;
fprintf(file, "0 setgray /Helvetica-Bold findfont dup\n");
fprintf(file, " (%s) %d %d\n", inst->u.pad.name, w/2, h/2);
- fprintf(file, " 4 copy 100 maxfont\n");
+ fprintf(file, " 4 copy 1000 maxfont\n");
fprintf(file, " maxfont scalefont setfont\n");
fprintf(file, " %d %d moveto\n", (a.x+b.x)/2, (a.y+b.y)/2);
fprintf(file, " (%s) center %d showoutlined newpath\n",
@@ -217,12 +250,13 @@
//s = stralloc_printf("%s%lgmm", meas->label ? meas->label : "", len);
fprintf(file, "gsave %d %d moveto\n", c.x/2, c.y/2);
fprintf(file, " /Helvetica-Bold findfont dup\n");
- fprintf(file, " (%s) %d %d\n", s,
+ fprintf(file, " (%s) %d %d realsize\n", s,
(int) (dist_point(a1, b1)-1.5*PS_MEAS_ARROW_LEN),
PS_MEAS_TEXT_HEIGHT);
- fprintf(file, " 4 copy 100 maxfont maxfont scalefont setfont\n");
+ fprintf(file, " 4 copy 1000 maxfont maxfont scalefont setfont\n");
fprintf(file, " %f rotate\n", atan2(d.y, d.x)/M_PI*180);
- fprintf(file, " (%s) %d hcenter\n", s, PS_MEAS_BASE_OFFSET);
+ fprintf(file, " (%s) %d realsize hcenter\n",
+ s, PS_MEAS_BASE_OFFSET);
fprintf(file, " show grestore\n");
free(s);
}
@@ -254,20 +288,20 @@
switch (prio) {
case ip_pad:
if (inst->obj->u.pad.rounded)
- ps_rpad(file, inst, postscript_params.show_pad_names);
+ ps_rpad(file, inst, active_params.show_pad_names);
else
- ps_pad(file, inst, postscript_params.show_pad_names);
+ ps_pad(file, inst, active_params.show_pad_names);
break;
case ip_vec:
- if (postscript_params.show_stuff)
+ if (active_params.show_stuff)
ps_vec(file, inst);
break;
case ip_frame:
- if (postscript_params.show_stuff)
+ if (active_params.show_stuff)
ps_frame(file, inst);
break;
case ip_meas:
- if (postscript_params.show_meas)
+ if (active_params.show_meas)
ps_meas(file, inst, curr_unit);
break;
default:
@@ -276,6 +310,9 @@
}
+/* ----- Package level ----------------------------------------------------- */
+
+
static void ps_cross(FILE *file, const struct inst *inst)
{
fprintf(file, "gsave 0 setgray %d setlinewidth\n", PS_CROSS_WIDTH);
@@ -284,16 +321,152 @@
inst->bbox.min.x, inst->bbox.max.x);
fprintf(file, " 0 %d moveto 0 %d lineto\n",
inst->bbox.min.y, inst->bbox.max.y);
- fprintf(file, " stroke grestore \n");
+ fprintf(file, " stroke grestore\n");
}
-int postscript(FILE *file)
+static void ps_draw_package(FILE *file, const struct pkg *pkg, double zoom)
{
enum inst_prio prio;
const struct inst *inst;
int i;
+ fprintf(file, "gsave %f dup scale\n", zoom);
+ ps_cross(file, pkgs->insts[ip_frame]);
+ FOR_INST_PRIOS_UP(prio)
+ FOR_ALL_INSTS(i, prio, inst)
+ ps_background(file, prio, inst);
+ FOR_INST_PRIOS_UP(prio)
+ FOR_ALL_INSTS(i, prio, inst)
+ ps_foreground(file, prio, inst);
+ fprintf(file, "grestore\n");
+}
+
+
+/* ----- Page level -------------------------------------------------------- */
+
+
+static void ps_hline(FILE *file, int y)
+{
+ fprintf(file, "gsave %d setlinewidth\n", PS_DIVIDER_WIDTH);
+ fprintf(file, " %d %d moveto\n", -PAGE_HALF_WIDTH, y);
+ fprintf(file, " %d 0 rlineto stroke gsave\n", PAGE_HALF_WIDTH*2);
+}
+
+
+static void ps_header(FILE *file, const struct pkg *pkg)
+{
+ fprintf(file, "gsave %d %d moveto\n",
+ -PAGE_HALF_WIDTH, PAGE_HALF_HEIGHT-PS_HEADER_HEIGHT);
+ fprintf(file, " /Helvetica-Bold findfont dup\n");
+ fprintf(file, " (%s) %d %d\n",
+ pkg->name, PAGE_HALF_WIDTH, PS_HEADER_HEIGHT);
+ fprintf(file, " 4 copy 1000 maxfont maxfont scalefont setfont\n");
+ fprintf(file, " (%s) show grestore\n", pkg->name);
+
+ ps_hline(file, PAGE_HALF_HEIGHT-PS_HEADER_HEIGHT-PS_DIVIDER_BORDER);
+}
+
+
+static void ps_package(FILE *file, const struct pkg *pkg)
+{
+ struct bbox bbox;
+ unit_type x, y;
+ unit_type w, h;
+ double f;
+ unit_type c, d;
+
+ ps_header(file, pkg);
+
+ x = 2*PAGE_HALF_WIDTH-2*PS_DIVIDER_BORDER;
+ y = PAGE_HALF_HEIGHT-PS_HEADER_HEIGHT-3*PS_DIVIDER_BORDER;
+
+ bbox = inst_get_bbox();
+ w = 2*(-bbox.min.y > bbox.max.y ? -bbox.min.y : bbox.max.y);
+ h = 2*(-bbox.min.x > bbox.max.x ? -bbox.min.x : bbox.max.x);
+
+ /*
+ * Zoom such that we can fit at least one drawing
+ */
+
+ if (w > x/2 || h > y) {
+ f = (double) x/w;
+ if ((double) y/h < f)
+ f = (double) y/h;
+ if (f > 1)
+ f = 1;
+ } else {
+ for (f = 20; f > 1; f--)
+ if (x/(f+2) >= w && y/f >= h)
+ break;
+ }
+
+ /*
+ * Decide if we have room for two, one, or zero smaller views
+ */
+
+ c = y/2+PS_DIVIDER_BORDER;
+ active_params = postscript_params;
+ if (x/(f+2) >= w && y/3 > h) {
+ /* main drawing */
+ fprintf(file, "gsave %d %d translate\n",
+ (int) (x/(f+2)*f/2)-PAGE_HALF_WIDTH, c);
+ ps_draw_package(file, pkg, f);
+
+ active_params = minimal_params;
+
+ /* divider */
+ d = PAGE_HALF_WIDTH-2*x/(f+2);
+ fprintf(file, "grestore %d %d moveto 0 %d rlineto stroke\n",
+ d-PS_DIVIDER_BORDER, PS_DIVIDER_BORDER, y);
+
+ /* x1 package */
+ fprintf(file, "gsave %d %d translate\n",
+ (d+PAGE_HALF_WIDTH)/2, y/6*5+PS_DIVIDER_BORDER);
+ ps_draw_package(file, pkg, 1);
+
+ /* x2 package */
+ fprintf(file, "grestore gsave %d %d translate\n",
+ (d+PAGE_HALF_WIDTH)/2, y/3+PS_DIVIDER_BORDER);
+ ps_draw_package(file, pkg, 2);
+ } else if (x/(f+1) >= w && y/2 > h) {
+ /* main drawing */
+ fprintf(file, "gsave %d %d translate\n",
+ (int) (x/(f+1)*f/2)-PAGE_HALF_WIDTH, c);
+ ps_draw_package(file, pkg, f);
+
+ active_params = minimal_params;
+
+ /* divider */
+ d = PAGE_HALF_WIDTH-x/(f+1);
+ fprintf(file, "grestore %d %d moveto 0 %d rlineto stroke\n",
+ d-PS_DIVIDER_BORDER, PS_DIVIDER_BORDER, y);
+
+ /* x1 package */
+ fprintf(file, "gsave %d %d translate\n",
+ (d+PAGE_HALF_WIDTH)/2, c);
+ ps_draw_package(file, pkg, 1);
+ } else {
+ fprintf(file, "gsave 0 %d translate\n", c);
+ ps_draw_package(file, pkg, f);
+ }
+ fprintf(file, "grestore\n");
+
+ ps_hline(file, 0);
+
+ /*
+ * Put the frames
+ */
+
+ fprintf(file, "showpage\n");
+}
+
+
+/* ----- File level -------------------------------------------------------- */
+
+
+static void prologue(FILE *file)
+{
fprintf(file, "%%!PS\n");
fprintf(file,
@@ -301,8 +474,8 @@
" aload pop\n"
" 2 div exch 2 div exch\n"
" translate\n"
-" %f 72 mul %d div 1000 div dup scale\n",
- (double) postscript_params.zoom , (int) MIL_UNITS);
+" 72 %d div 1000 div dup scale\n",
+ (int) MIL_UNITS);
fprintf(file,
"/dotpath {\n"
@@ -400,17 +573,29 @@
" 0 setgray 100 setlinewidth\n"
" llx lly urx llx sub ury lly sub rectstroke grestore } def\n");
- ps_cross(file, pkgs->insts[ip_frame]);
- FOR_INST_PRIOS_UP(prio)
- FOR_ALL_INSTS(i, prio, inst)
- ps_background(file, prio, inst);
- FOR_INST_PRIOS_UP(prio)
- FOR_ALL_INSTS(i, prio, inst)
- ps_foreground(file, prio, inst);
+ /*
+ * Stack: int -> int
+ */
- fprintf(file, "showpage\n");
+fprintf(file,
+"/realsize {\n"
+" 254 div 72 mul 1000 div 0 matrix currentmatrix idtransform pop\n"
+" } def\n");
+}
+
+
+static void epilogue(FILE *file)
+{
fprintf(file, "%%%%EOF\n");
+}
+
+int postscript(FILE *file)
+{
+ prologue(file);
+ ps_package(file, active_pkg);
+ epilogue(file);
+
fflush(file);
return !ferror(file);
}
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2009-08-22 10:58:00 +0200 (Sat, 22 Aug 2009)
New Revision: 5518
Modified:
trunk/gta02-core/modules/stdpass.fpd
Log:
- modules/stdpass.fpd: enjoy our new freedom and adjust measurement offset to
package dimensions
- modules/stdpass.fpd: renamed outline L and W to Ox and Oy, and moved them to
the root frame. Less confusing that way.
Modified: trunk/gta02-core/modules/stdpass.fpd
===================================================================
--- trunk/gta02-core/modules/stdpass.fpd 2009-08-21 23:28:38 UTC (rev
5517)
+++ trunk/gta02-core/modules/stdpass.fpd 2009-08-22 08:58:00 UTC (rev
5518)
@@ -22,12 +22,8 @@
}
frame outline {
- set L = e+2*a+2*clear+silk
-
- set W = b+2*clear+silk
-
- ll: vec @(-L/2, -W/2)
- __1: vec @(L/2, W/2)
+ ll: vec @(-Ox/2, -Oy/2)
+ ur: vec @(Ox/2, Oy/2)
rect ll . silk
}
@@ -44,10 +40,14 @@
set clear = 4mil
+set Ox = e+2*a+2*clear+silk
+
+set Oy = b+2*clear+silk
+
frame pads @
frame outline @
measx pad_l.w >> pad_r.ll -0.3mm
measx pad_l.ll -> pad_l.w -0.3mm
measy pad_l.ll >> pad_l.h 0.3mm
-measx outline.ll >> outline.__1 1mm
-measy outline.__1 >> outline.ll 0.3mm
+measx outline.ll >> outline.ur Oy+0.3mm
+measy outline.ur >> outline.ll 0.3mm
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2009-08-22 10:58:26 +0200 (Sat, 22 Aug 2009)
New Revision: 5519
Modified:
trunk/eda/fped/README
trunk/eda/fped/gui_style.h
trunk/eda/fped/inst.h
trunk/eda/fped/postscript.c
Log:
- postscript.c: added DSC comments
- postscript.c: generate a page for each package
- gui_style.h: changed monospaced font to Liberation Mono, to alleviate "l" vs.
"1" problem
Modified: trunk/eda/fped/README
===================================================================
--- trunk/eda/fped/README 2009-08-22 08:58:00 UTC (rev 5518)
+++ trunk/eda/fped/README 2009-08-22 08:58:26 UTC (rev 5519)
@@ -21,6 +21,7 @@
- fig2dev
- ImageMagick
- Gtk+ 2.x development package (libgtk2.0-dev or similar)
+- Liberation Fonts (ttf-liberation or similar)
Check out the repository:
Modified: trunk/eda/fped/gui_style.h
===================================================================
--- trunk/eda/fped/gui_style.h 2009-08-22 08:58:00 UTC (rev 5518)
+++ trunk/eda/fped/gui_style.h 2009-08-22 08:58:26 UTC (rev 5519)
@@ -47,7 +47,8 @@
#define FRAME_EYE_R1 3
#define FRAME_EYE_R2 5
-#define ITEM_LIST_FONT "Courier Bold 8"
+#define ITEM_LIST_FONT "Liberation Mono 8"
+//#define ITEM_LIST_FONT "Courier Bold 8"
#define SELECT_R 6 /* pixels within which we
select */
Modified: trunk/eda/fped/inst.h
===================================================================
--- trunk/eda/fped/inst.h 2009-08-22 08:58:00 UTC (rev 5518)
+++ trunk/eda/fped/inst.h 2009-08-22 08:58:26 UTC (rev 5519)
@@ -139,10 +139,12 @@
#define FOR_INST_PRIOS_DOWN(prio) \
for (prio = ip_n-1; prio != (enum inst_prio) -1; prio--)
+#define FOR_PKG_INSTS(pkg, prio, inst)
\
+ for (inst = (pkg)->insts[prio]; inst; inst = inst->next)
+
#define FOR_ALL_INSTS(i, prio, inst)
\
for (i = 0; i != 2; i++) \
- for (inst = (i ? active_pkg : pkgs)->insts[prio]; inst; \
- inst = inst->next)
+ FOR_PKG_INSTS(i ? active_pkg : pkgs, prio, inst)
void inst_select_outside(void *item, void (*deselect)(void *item));
Modified: trunk/eda/fped/postscript.c
===================================================================
--- trunk/eda/fped/postscript.c 2009-08-22 08:58:00 UTC (rev 5518)
+++ trunk/eda/fped/postscript.c 2009-08-22 08:58:26 UTC (rev 5519)
@@ -247,7 +247,6 @@
c = add_vec(a1, b1);
d = sub_vec(b1, a1);
-//s = stralloc_printf("%s%lgmm", meas->label ? meas->label : "", len);
fprintf(file, "gsave %d %d moveto\n", c.x/2, c.y/2);
fprintf(file, " /Helvetica-Bold findfont dup\n");
fprintf(file, " (%s) %d %d realsize\n", s,
@@ -329,16 +328,21 @@
{
enum inst_prio prio;
const struct inst *inst;
- int i;
fprintf(file, "gsave %f dup scale\n", zoom);
ps_cross(file, pkgs->insts[ip_frame]);
- FOR_INST_PRIOS_UP(prio)
- FOR_ALL_INSTS(i, prio, inst)
+ FOR_INST_PRIOS_UP(prio) {
+ FOR_PKG_INSTS(pkgs, prio, inst)
ps_background(file, prio, inst);
- FOR_INST_PRIOS_UP(prio)
- FOR_ALL_INSTS(i, prio, inst)
+ FOR_PKG_INSTS(pkg, prio, inst)
+ ps_background(file, prio, inst);
+ }
+ FOR_INST_PRIOS_UP(prio) {
+ FOR_PKG_INSTS(pkgs, prio, inst)
ps_foreground(file, prio, inst);
+ FOR_PKG_INSTS(pkg, prio, inst)
+ ps_foreground(file, prio, inst);
+ }
fprintf(file, "grestore\n");
}
@@ -368,14 +372,32 @@
}
-static void ps_package(FILE *file, const struct pkg *pkg)
+
+static void ps_page(FILE *file, int page)
{
+ fprintf(file, "%%%%Page: %d %d\n", page, page);
+
+ fprintf(file, "%%%%BeginPageSetup\n");
+ fprintf(file,
+"currentpagedevice /PageSize get\n"
+" aload pop\n"
+" 2 div exch 2 div exch\n"
+" translate\n"
+" 72 %d div 1000 div dup scale\n",
+ (int) MIL_UNITS);
+ fprintf(file, "%%%%EndPageSetup\n");
+}
+
+
+static void ps_package(FILE *file, const struct pkg *pkg, int page)
+{
struct bbox bbox;
unit_type x, y;
unit_type w, h;
double f;
unit_type c, d;
+ ps_page(file, page);
ps_header(file, pkg);
x = 2*PAGE_HALF_WIDTH-2*PS_DIVIDER_BORDER;
@@ -465,18 +487,18 @@
/* ----- File level -------------------------------------------------------- */
-static void prologue(FILE *file)
+static void prologue(FILE *file, int pages)
{
- fprintf(file, "%%!PS\n");
+ fprintf(file, "%%!PS-Adobe-3.0\n");
+ fprintf(file, "%%%%Pages: %d\n", pages);
+ fprintf(file, "%%%%EndComments\n");
- fprintf(file,
-"currentpagedevice /PageSize get\n"
-" aload pop\n"
-" 2 div exch 2 div exch\n"
-" translate\n"
-" 72 %d div 1000 div dup scale\n",
- (int) MIL_UNITS);
+ fprintf(file, "%%%%BeginDefaults\n");
+ fprintf(file, "%%%%PageResources: font Helvetica Helvetica-Bold\n");
+ fprintf(file, "%%%%EndDefaults\n");
+ fprintf(file, "%%%%BeginProlog\n");
+
fprintf(file,
"/dotpath {\n"
" gsave flattenpath pathbbox clip newpath\n"
@@ -581,6 +603,8 @@
"/realsize {\n"
" 254 div 72 mul 1000 div 0 matrix currentmatrix idtransform pop\n"
" } def\n");
+
+ fprintf(file, "%%%%EndProlog\n");
}
@@ -592,8 +616,17 @@
int postscript(FILE *file)
{
- prologue(file);
- ps_package(file, active_pkg);
+ struct pkg *pkg;
+ int pages;
+
+ for (pkg = pkgs; pkg; pkg = pkg->next)
+ if (pkg->name)
+ pages++;
+ prologue(file, pages);
+ pages = 0;
+ for (pkg = pkgs; pkg; pkg = pkg->next)
+ if (pkg->name)
+ ps_package(file, pkg, ++pages);
epilogue(file);
fflush(file);
--- End Message ---
--- Begin Message ---
Author: werner
Date: 2009-08-22 11:09:14 +0200 (Sat, 22 Aug 2009)
New Revision: 5520
Modified:
trunk/gta02-core/Makefile
trunk/gta02-core/docs/GETTING-STARTED
trunk/gta02-core/gta02-core.erx
Log:
- docs/GETTING-STARTED: added fped's new font dependency
- docs/gta02-core.erx: added U3001-CON1701 conflict and added comment for
U7607 vs. GND conflict (now, fix the syntax or find a work-around ?)
- Makefile: updated list of common targets (reported by Nathael Pajani)
Modified: trunk/gta02-core/Makefile
===================================================================
--- trunk/gta02-core/Makefile 2009-08-22 08:58:26 UTC (rev 5519)
+++ trunk/gta02-core/Makefile 2009-08-22 09:09:14 UTC (rev 5520)
@@ -2,7 +2,8 @@
.PHONY: dsv
all:
- @echo "make what ? target: gen generate sch upload"
+ @echo "make what ? target: gen update sch gv xpdf brd dsv"
+ # we have more targets, but "normal users" don't need them
@exit 1
gen generate:
Modified: trunk/gta02-core/docs/GETTING-STARTED
===================================================================
--- trunk/gta02-core/docs/GETTING-STARTED 2009-08-22 08:58:26 UTC (rev
5519)
+++ trunk/gta02-core/docs/GETTING-STARTED 2009-08-22 09:09:14 UTC (rev
5520)
@@ -59,6 +59,7 @@
- fig2dev
- ImageMagick
- Gtk+ 2.x development package (libgtk2.0-dev or similar)
+ - Liberation Fonts (ttf-liberation or similar)
- Download it:
Modified: trunk/gta02-core/gta02-core.erx
===================================================================
--- trunk/gta02-core/gta02-core.erx 2009-08-22 08:58:26 UTC (rev 5519)
+++ trunk/gta02-core/gta02-core.erx 2009-08-22 09:09:14 UTC (rev 5520)
@@ -3,3 +3,6 @@
U1701 42 U1701 43 # PCF50633 AUTOOUTx
U7609 2 U7609 3 # SI1040X OUT
U7610 2 U7610 3 # SI1040X OUT
+
+#U7608 D8 #FLG0118 1 # GPS P12/GPSMODE2 to GND
+U3001 44 CON1701 1 # CODEC MODE/GPIO3 to GND
--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog