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. r5375 - trunk/eda/fped (wer...@docs.openmoko.org)
   2. r5376 - in trunk/gta02-core: . components expanded
      (da...@docs.openmoko.org)
   3. r5377 - trunk/eda/fped (wer...@docs.openmoko.org)
--- Begin Message ---
Author: werner
Date: 2009-08-03 19:58:32 +0200 (Mon, 03 Aug 2009)
New Revision: 5375

Added:
   trunk/eda/fped/tab.fpd
Modified:
   trunk/eda/fped/README
   trunk/eda/fped/TODO
   trunk/eda/fped/fpd.l
   trunk/eda/fped/fpd.y
   trunk/eda/fped/gui.c
   trunk/eda/fped/gui_canvas.c
   trunk/eda/fped/obj.c
   trunk/eda/fped/obj.h
Log:
- keyboard functions for the canvas: - zoom out, + or = zoom in, . center,
  * zoom and center to extents
- variables in tables weren't properly initialized, causing stray recursive
  evaluation errors
- replaced table->active index with table->active_row pointer
- added row selection
- for fun, added tab.fpd row selection example 



Modified: trunk/eda/fped/README
===================================================================
--- trunk/eda/fped/README       2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/README       2009-08-03 17:58:32 UTC (rev 5375)
@@ -337,3 +337,15 @@
 Expressions can contain numeric constants (in non-exponential notation),
 variable names, the arithmetic operations +, -, *, /, and unary -.
 Parentheses can be used to change precedence.
+
+
+GUI
+---
+
+Keys:
+
+space  reset user coordinates
++, =   zoom in (like mouse wheel forward)
+-      zoom out (like mouse wheel backward)
+.      cursor position to screen center (like middle click)
+*      zoom and center to extents

Modified: trunk/eda/fped/TODO
===================================================================
--- trunk/eda/fped/TODO 2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/TODO 2009-08-03 17:58:32 UTC (rev 5375)
@@ -1,5 +1,4 @@
 Missing features:
-- add row selection
 - populate input area (still needed: mm/mil, rezoom)
 - add vec editor (need to be able to edit name, x, and y)
 - add obj editor

Modified: trunk/eda/fped/fpd.l
===================================================================
--- trunk/eda/fped/fpd.l        2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/fpd.l        2009-08-03 17:58:32 UTC (rev 5375)
@@ -121,6 +121,8 @@
                                        BEGIN(INITIAL);
                                  lineno++; }
 
+;                              BEGIN(INITIAL);
+
 "{"                            { BEGIN(NOKEYWORD);
                                  disable_keywords = is_table;
                                  return '{'; }

Modified: trunk/eda/fped/fpd.y
===================================================================
--- trunk/eda/fped/fpd.y        2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/fpd.y        2009-08-03 17:58:32 UTC (rev 5375)
@@ -249,7 +249,7 @@
                        $$ = $<table>2;
                        $$->vars = $4;
                        $$->rows = $6;
-                       $$->active = 0;
+                       $$->active_row = $6;
                        next_table = &$$->next;
                }
        ;
@@ -272,7 +272,7 @@
 var:
        ID
                {
-                       $$ = alloc_type(struct var);
+                       $$ = zalloc_type(struct var);
                        $$->name = $1;
                        $$->frame = curr_frame;
                        $$->next = NULL;

Modified: trunk/eda/fped/gui.c
===================================================================
--- trunk/eda/fped/gui.c        2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/gui.c        2009-08-03 17:58:32 UTC (rev 5375)
@@ -128,8 +128,8 @@
        struct value *value = data;
 
         label_in_box_bg(value->widget,
-           value->row && value->row->table && value->row->table->curr_row ==
-            value->row ? COLOR_CHOICE_SELECTED : COLOR_EXPR_PASSIVE);
+           value->row && value->row->table->active_row == value->row ?
+            COLOR_CHOICE_SELECTED : COLOR_EXPR_PASSIVE);
 }
 
 
@@ -141,7 +141,6 @@
 }
 
 
-
 /* ----- assignments ------------------------------------------------------- */
 
 
@@ -201,6 +200,19 @@
 /* ----- tables ------------------------------------------------------------ */
 
 
+static void select_row(struct row *row)
+{
+       struct table *table = row->table;
+       struct value *value;
+
+       for (value = table->active_row->values; value; value = value->next)
+               label_in_box_bg(value->widget, COLOR_ROW_UNSELECTED);
+       table->active_row = row;
+       for (value = table->active_row->values; value; value = value->next)
+               label_in_box_bg(value->widget, COLOR_ROW_SELECTED);
+}
+
+
 static gboolean table_var_select_event(GtkWidget *widget,
      GdkEventButton *event, gpointer data)
 {
@@ -212,7 +224,14 @@
 static gboolean table_value_select_event(GtkWidget *widget,
      GdkEventButton *event, gpointer data)
 {
-       edit_value(data);
+       struct value *value = data;
+
+       if (!value->row || value->row->table->active_row == value->row)
+               edit_value(value);
+       else {
+               select_row(value->row);
+               change_world();
+       }
        return TRUE;
 }
 
@@ -272,7 +291,7 @@
                            box_of_label(field),
                            n_vars, n_vars+1,
                            n_rows+1, n_rows+2);
-                       label_in_box_bg(field, table->active == n_rows ?
+                       label_in_box_bg(field, table->active_row == row ?
                            COLOR_ROW_SELECTED : COLOR_ROW_UNSELECTED);
                        g_signal_connect(G_OBJECT(box_of_label(field)),
                            "button_press_event",

Modified: trunk/eda/fped/gui_canvas.c
===================================================================
--- trunk/eda/fped/gui_canvas.c 2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/gui_canvas.c 2009-08-03 17:58:32 UTC (rev 5375)
@@ -228,6 +228,21 @@
                user_origin = pos;
                update_pos(pos);
                break;
+       case '+':
+       case '=':
+               zoom_in(pos);
+               break;
+       case '-':
+               zoom_out(pos);
+               break;
+       case '*':
+               center();
+               auto_scale();
+               redraw();
+       case '.':
+               ctx.center = pos;
+               redraw();
+               break;
        }
        return TRUE;
 }

Modified: trunk/eda/fped/obj.c
===================================================================
--- trunk/eda/fped/obj.c        2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/obj.c        2009-08-03 17:58:32 UTC (rev 5375)
@@ -223,18 +223,13 @@
 static int iterate_tables(struct frame *frame, struct table *table,
     struct coord base, int active)
 {
-       int n;
-
        if (!table)
                return run_loops(frame, frame->loops, base, active);
-       n = 0;
        for (table->curr_row = table->rows; table->curr_row;
-           table->curr_row = table->curr_row->next) {
+           table->curr_row = table->curr_row->next)
                if (!iterate_tables(frame, table->next, base,
-                   active && table->active == n))
+                   active && table->active_row == table->curr_row))
                        return 0;
-               n++;
-       }
        return 1;
 }
 

Modified: trunk/eda/fped/obj.h
===================================================================
--- trunk/eda/fped/obj.h        2009-08-03 16:12:47 UTC (rev 5374)
+++ trunk/eda/fped/obj.h        2009-08-03 17:58:32 UTC (rev 5375)
@@ -62,7 +62,7 @@
        struct row *curr_row;
 
        /* GUI use */
-       int active;     /* n-th row is active, 0 based */
+       struct row *active_row;
 };
 
 struct loop {

Added: trunk/eda/fped/tab.fpd
===================================================================
--- trunk/eda/fped/tab.fpd                              (rev 0)
+++ trunk/eda/fped/tab.fpd      2009-08-03 17:58:32 UTC (rev 5375)
@@ -0,0 +1,14 @@
+/*
+ * row selection example
+ */
+
+table
+    { x, x2 }
+    { 1mm, 1 }
+    { 2mm, 4 }
+    { 3mm, 9 }
+vec @(x, 0mm)
+circ @ .
+c: vec @(x-1mm, -4mm)
+vec c(0.5mm, 0.5mm)
+pad "$x2" c .




--- End Message ---
--- Begin Message ---
Author: daveb
Date: 2009-08-03 22:46:17 +0200 (Mon, 03 Aug 2009)
New Revision: 5376

Added:
   trunk/gta02-core/components/ge865.lib
Modified:
   trunk/gta02-core/AUTHORS
   trunk/gta02-core/components/INFO
   trunk/gta02-core/components/STATUS
   trunk/gta02-core/components/mkloe
   trunk/gta02-core/expanded/gta02-core-expanded.pro
   trunk/gta02-core/expanded/io.sch
Log:
Add symbol for Telit ge865 - potential 2G gsm modem.


Modified: trunk/gta02-core/AUTHORS
===================================================================
--- trunk/gta02-core/AUTHORS    2009-08-03 17:58:32 UTC (rev 5375)
+++ trunk/gta02-core/AUTHORS    2009-08-03 20:46:17 UTC (rev 5376)
@@ -5,6 +5,7 @@
   cpu_power.sch
   components/aat1275irn.lib
   components/k4m51323pe.lib
+  componants/ge865.lib
   componants/ht110.lib
   componants/isc5804at2.lib
   components/lis302dl.lib

Modified: trunk/gta02-core/components/INFO
===================================================================
--- trunk/gta02-core/components/INFO    2009-08-03 17:58:32 UTC (rev 5375)
+++ trunk/gta02-core/components/INFO    2009-08-03 20:46:17 UTC (rev 5376)
@@ -79,6 +79,12 @@
 A: lcm-filter
 D: http://www.acxc.com.tw/product/fa2012/FA2012-KR40PAA_070827.pdf
 
+# Telit GSM module
+S: ge864
+A: gsm
+A: telit-gsm
+D: http://www.telit.com/module/infopool/download.php?id=1666
+
 # WLAN Socket
 S: gta02_wlan_s
 D: 
http://www.panasonic-electric-works.it/catalogues/downloads/connectors/ds_65306_0000_en_axk5_6f.pdf

Modified: trunk/gta02-core/components/STATUS
===================================================================
--- trunk/gta02-core/components/STATUS  2009-08-03 17:58:32 UTC (rev 5375)
+++ trunk/gta02-core/components/STATUS  2009-08-03 20:46:17 UTC (rev 5376)
@@ -15,6 +15,7 @@
 emh4                   Q1501   Alvaro  Werner  Dave    Rene
 exc24cb102u            B3004   Alvaro  Werner  Dave    Rene
 fa2012                 RP6001  Alvaro  Werner  Dave    Rene
+ge865                          Dave
 gta02_power            -       Alvaro  Werner
 gta02_wlan_s           CON7901 Rene
 ht110                  LED1502 Dave

Added: trunk/gta02-core/components/ge865.lib
===================================================================
--- trunk/gta02-core/components/ge865.lib                               (rev 0)
+++ trunk/gta02-core/components/ge865.lib       2009-08-03 20:46:17 UTC (rev 
5376)
@@ -0,0 +1,65 @@
+EESchema-LIBRARY Version 2.3  Date: Mon 03 Aug 2009 21:35:56 BST
+#
+# GE865
+#
+DEF GE865 U 0 40 Y Y 1 F N
+F0 "U" 0 -100 60 H V C CNN
+F1 "GE865" 0 100 60 H V C CNN
+DRAW
+S -950 1600 950 -1700 0 1 0 N
+X VBATT F1 -200 1800 200 D 50 50 1 1 W
+X VBATT_PA F2 50 1800 200 D 50 50 1 1 W
+X VBATT_PA F3 150 1800 200 D 50 50 1 1 W
+X GPIO_10 E3 1150 -1300 200 L 50 50 1 1 B
+X GPIO_09 F4 1150 -1200 200 L 50 50 1 1 B
+X GPIO_08 D4 1150 -1100 200 L 50 50 1 1 B
+X BUZZER/GPIO_07 G6 1150 -1000 200 L 50 50 1 1 B
+X ALARM/GPIO_06 H8 1150 -900 200 L 50 50 1 1 B
+X RFTXMON/GPIO_05 G2 1150 -800 200 L 50 50 1 1 B
+X TX_DISAB/GPIO_04 H7 1150 -700 200 L 50 50 1 1 B
+X GPIO_03 E4 1150 -600 200 L 50 50 1 1 B
+X JDR/GPIO_02 D2 1150 -500 200 L 50 50 1 1 B
+X GPIO_01 D3 1150 -400 200 L 50 50 1 1 B
+X RING/C125 B4 1150 -100 200 L 50 50 1 1 O
+X DSR/C107 B2 1150 0 200 L 50 50 1 1 O
+X DCD/C109 B5 1150 100 200 L 50 50 1 1 O
+X CTS/C106 A2 1150 200 200 L 50 50 1 1 O
+X RTS/C105 A1 1150 300 200 L 50 50 1 1 I
+X DTR/C108 B3 1150 400 200 L 50 50 1 1 I
+X RXD/C104 A4 1150 500 200 L 50 50 1 1 O
+X TXD/C103 A3 1150 600 200 L 50 50 1 1 I
+X PWRMON E2 1150 900 200 L 50 50 1 1 O
+X VRTC H2 1150 1000 200 L 50 50 1 1 O
+X ON_OFF B1 1150 1100 200 L 50 50 1 1 I
+X RESET C1 1150 1200 200 L 50 50 1 1 I
+X ADC_IN2 F6 -1150 -1300 200 R 50 50 1 1 I
+X ADC_IN1 F5 -1150 -1200 200 R 50 50 1 1 I
+X DAC_OUT G7 -1150 -1100 200 R 50 50 1 1 O
+X RXD_AUX E1 -1150 -800 200 R 50 50 1 1 I
+X TXD_AUX D1 -1150 -700 200 R 50 50 1 1 O
+X SIMVCC A7 -1150 -400 200 R 50 50 1 1 w
+X SIMIN B7 -1150 -300 200 R 50 50 1 1 I
+X SIMIO A6 -1150 -200 200 R 50 50 1 1 B
+X SIMRST A8 -1150 -100 200 R 50 50 1 1 O
+X SIMCLK A5 -1150 0 200 R 50 50 1 1 O
+X MIC- C8 -1150 300 200 R 50 50 1 1 I
+X MIC+ B8 -1150 400 200 R 50 50 1 1 I
+X EAR+ D8 -1150 600 200 R 50 50 1 1 O
+X EAR- E8 -1150 700 200 R 50 50 1 1 O
+X STAT_LED G8 -1150 1000 200 R 50 50 1 1 O
+X SERVICE H1 -1150 1100 200 R 50 50 1 1 I
+X ANTENNA H5 -1150 1200 200 R 50 50 1 1 O
+X GND G1 -450 -1900 200 U 50 50 1 1 W
+X GND C2 -350 -1900 200 U 50 50 1 1 W
+X GND C7 -250 -1900 200 U 50 50 1 1 W
+X GND E5 -150 -1900 200 U 50 50 1 1 W
+X GND E7 -50 -1900 200 U 50 50 1 1 W
+X GND G5 50 -1900 200 U 50 50 1 1 W
+X GND G4 150 -1900 200 U 50 50 1 1 W
+X GND G3 250 -1900 200 U 50 50 1 1 W
+X GND H3 350 -1900 200 U 50 50 1 1 W
+X GND H6 450 -1900 200 U 50 50 1 1 W
+ENDDRAW
+ENDDEF
+#
+#End Library

Modified: trunk/gta02-core/components/mkloe
===================================================================
--- trunk/gta02-core/components/mkloe   2009-08-03 17:58:32 UTC (rev 5375)
+++ trunk/gta02-core/components/mkloe   2009-08-03 20:46:17 UTC (rev 5376)
@@ -9,6 +9,7 @@
 COMPS="$COMPS coax dfbm-cs320 exc24cb102u gta02_wlan_h gta02_wlan_s"
 COMPS="$COMPS td028ttec1 varistor vibrator jack_4p microphone debug_con"
 COMPS="$COMPS btp-03ja4g antenna r_us gta02_power upg2012tb zxct1009"
+COMPS="$COMPS ge865"
 
 LIB=gta02-core.lib
 

Modified: trunk/gta02-core/expanded/gta02-core-expanded.pro
===================================================================
--- trunk/gta02-core/expanded/gta02-core-expanded.pro   2009-08-03 17:58:32 UTC 
(rev 5375)
+++ trunk/gta02-core/expanded/gta02-core-expanded.pro   2009-08-03 20:46:17 UTC 
(rev 5376)
@@ -116,4 +116,4 @@
 LibName1=power
 LibName2=device
 LibName3=conn
-LibName4=../components/gta02-core-expanded
+LibName4=gta02-core-expanded

Modified: trunk/gta02-core/expanded/io.sch
===================================================================
--- trunk/gta02-core/expanded/io.sch    2009-08-03 17:58:32 UTC (rev 5375)
+++ trunk/gta02-core/expanded/io.sch    2009-08-03 20:46:17 UTC (rev 5376)
@@ -1,5 +1,5 @@
-EESchema Schematic File Version 2  date Tue Jun  9 21:09:11 2009
-LIBS:,powerdeviceconngta02-core-expandedgta02-core-expanded-cache
+EESchema Schematic File Version 2  date Mon 03 Aug 2009 21:43:10 BST
+LIBS:power,device,conn,gta02-core-expanded
 EELAYER 24  0
 EELAYER END
 $Descr A4 11700 8267
@@ -13,6 +13,15 @@
 Comment3 ""
 Comment4 ""
 $EndDescr
+$Comp
+L XGE865 U?
+U 1 1 4A774B74
+P 2500 4200
+F 0 "U?" H 2500 4100 60  0000 C CNN
+F 1 "XGE865" H 2500 4300 60  0000 C CNN
+       1    2500 4200
+       1    0    0    -1  
+$EndComp
 Text Notes 1050 1050 0    120  ~ 24
 IO
 $Comp
@@ -36,28 +45,28 @@
 $Comp
 L XSC32442 U?
 U 2 1 4A11234D
-P 4200 2450
-F 0 "U?" H 4200 2350 50  0000 C CNN
-F 1 "XSC32442" H 4200 2550 50  0000 C CNN
-       2    4200 2450
+P 4950 2400
+F 0 "U?" H 4950 2300 50  0000 C CNN
+F 1 "XSC32442" H 4950 2500 50  0000 C CNN
+       2    4950 2400
        1    0    0    -1  
 $EndComp
 $Comp
 L XSC32442 U?
 U 5 1 4A112247
-P 4200 5550
-F 0 "U?" H 4200 5450 50  0000 C CNN
-F 1 "XSC32442" H 4200 5650 50  0000 C CNN
-       5    4200 5550
+P 4950 5500
+F 0 "U?" H 4950 5400 50  0000 C CNN
+F 1 "XSC32442" H 4950 5600 50  0000 C CNN
+       5    4950 5500
        1    0    0    -1  
 $EndComp
 $Comp
 L XSC32442 U?
 U 3 1 4A0AE864
-P 4200 3850
-F 0 "U?" H 4200 3750 50  0000 C CNN
-F 1 "XSC32442" H 4200 3950 50  0000 C CNN
-       3    4200 3850
+P 4950 3800
+F 0 "U?" H 4950 3700 50  0000 C CNN
+F 1 "XSC32442" H 4950 3900 50  0000 C CNN
+       3    4950 3800
        1    0    0    -1  
 $EndComp
 $Comp




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2009-08-03 23:10:49 +0200 (Mon, 03 Aug 2009)
New Revision: 5377

Added:
   trunk/eda/fped/quad.fpd
Modified:
   trunk/eda/fped/error.c
   trunk/eda/fped/fpd.y
   trunk/eda/fped/gui.c
   trunk/eda/fped/gui_style.h
   trunk/eda/fped/inst.c
   trunk/eda/fped/obj.c
   trunk/eda/fped/obj.h
Log:
- combined frame and variable view into a single table
- make_var now sets up all back pointers, so we don't crash when deselecting a
  variable (this bug was uncovered by cleanup in the previous commit)
- report_parse_error didn't print a newline at the end of the message
- introduced frame reference selection and the data structures needed for it
- bounding box calculation of arcs used x for y
- added frame reference selection example quad.fpd



Modified: trunk/eda/fped/error.c
===================================================================
--- trunk/eda/fped/error.c      2009-08-03 20:46:17 UTC (rev 5376)
+++ trunk/eda/fped/error.c      2009-08-03 21:10:49 UTC (rev 5377)
@@ -51,7 +51,7 @@
 
 void report_parse_error(const char *s)
 {
-       fprintf(stderr, "%d: %s near \"%s\" ", lineno, s, yytext);
+       fprintf(stderr, "%d: %s near \"%s\"\n", lineno, s, yytext);
        exit(1);
 }
 

Modified: trunk/eda/fped/fpd.y
===================================================================
--- trunk/eda/fped/fpd.y        2009-08-03 20:46:17 UTC (rev 5376)
+++ trunk/eda/fped/fpd.y        2009-08-03 21:10:49 UTC (rev 5377)
@@ -79,9 +79,11 @@
        table->vars->name = id;
        table->vars->frame = curr_frame;
        table->rows = zalloc_type(struct row);
+       table->rows->table = table;
        table->rows->values = zalloc_type(struct value);
        table->rows->values->expr = expr;
        table->rows->values->row = table->rows;
+       table->active_row = table->rows;
        *next_table = table;
        next_table = &table->next;
 }
@@ -421,15 +423,22 @@
                        $$->u.meas.other = $3;
                        $$->u.meas.offset = $4;
                }
-       | TOK_FRAME ID base
+       | TOK_FRAME ID 
+               { 
+                   $<num>$.n = lineno;
+               }
+                   base
                {
                        $$ = new_obj(ot_frame);
-                       $$->base = $3;
-                       $$->u.frame = find_frame($2);
-                       if (!$$->u.frame) {
+                       $$->base = $4;
+                       $$->u.frame.ref = find_frame($2);
+                       if (!$$->u.frame.ref) {
                                yyerrorf("unknown frame \"%s\"", $2);
                                YYABORT;
                        }
+                       if (!$$->u.frame.ref->active_ref)
+                               $$->u.frame.ref->active_ref = $$;
+                       $$->u.frame.lineno = $<num>3.n;
                }
        ;
 

Modified: trunk/eda/fped/gui.c
===================================================================
--- trunk/eda/fped/gui.c        2009-08-03 20:46:17 UTC (rev 5376)
+++ trunk/eda/fped/gui.c        2009-08-03 21:10:49 UTC (rev 5377)
@@ -31,7 +31,6 @@
 GtkWidget *root;
 
 static GtkWidget *frames_box;
-static GtkWidget *vars_box;
 
 
 /* ----- menu bar ---------------------------------------------------------- */
@@ -385,12 +384,13 @@
 /* ----- the list of variables, tables, and loops -------------------------- */
 
 
-static void build_vars(GtkWidget *vbox, struct frame *frame)
+static GtkWidget *build_vars(struct frame *frame)
 {
+       GtkWidget *vbox;
        struct table *table;
        struct loop *loop;
 
-       destroy_all_children(GTK_CONTAINER(vbox));
+       vbox= gtk_vbox_new(FALSE, 0);
        for (table = frame->tables; table; table = table->next) {
                add_sep(vbox, 3);
                build_assignment(vbox, frame, table);
@@ -400,11 +400,11 @@
                add_sep(vbox, 3);
                build_loop(vbox, frame, loop);
        }
-       gtk_widget_show_all(vbox);
+       return vbox;
 }
 
 
-/* ----- frame list -------------------------------------------------------- */
+/* ----- frame labels ------------------------------------------------------ */
 
 
 static int validate_frame_name(const char *s, void *ctx)
@@ -468,27 +468,97 @@
 }
 
 
-static void build_frames(GtkWidget *vbox)
+static GtkWidget *build_frame_label(struct frame *frame)
 {
-       struct frame *f;
        GtkWidget *label;
 
+       label = label_in_box_new(frame->name ? frame->name : "(root)");
+       gtk_misc_set_padding(GTK_MISC(label), 2, 2);
+       gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+
+       label_in_box_bg(label, active_frame == frame ?
+           COLOR_FRAME_SELECTED : COLOR_FRAME_UNSELECTED);
+
+       g_signal_connect(G_OBJECT(box_of_label(label)),
+           "button_press_event", G_CALLBACK(frame_select_event), frame);
+       frame->label = label;
+
+       return box_of_label(label);
+}
+
+
+/* ----- frame references -------------------------------------------------- */
+
+
+static gboolean frame_ref_select_event(GtkWidget *widget, GdkEventButton 
*event,
+     gpointer data)
+{
+       struct obj *obj = data;
+
+       obj->u.frame.ref->active_ref = data;
+       change_world();
+       return TRUE;
+}
+
+
+static GtkWidget *build_frame_refs(const struct frame *frame)
+{
+       GtkWidget *hbox, *label;
+       struct obj *obj;
+       char buf[100];
+
+       hbox = gtk_hbox_new(FALSE, 0);
+       for (obj = frame->objs; obj; obj = obj->next)
+               if (obj->type == ot_frame && obj->u.frame.ref == active_frame) {
+                       sprintf(buf, "%d", obj->u.frame.lineno);
+                       label = label_in_box_new(buf);
+                       gtk_misc_set_padding(GTK_MISC(label), 2, 2);
+                       gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+                       label_in_box_bg(label,
+                           obj == obj->u.frame.ref->active_ref ?
+                           COLOR_REF_SELECTED : COLOR_REF_UNSELECTED);
+                       gtk_box_pack_start(GTK_BOX(hbox), box_of_label(label),
+                           FALSE, FALSE, 2);
+                       g_signal_connect(G_OBJECT(box_of_label(label)),
+                           "button_press_event",
+                           G_CALLBACK(frame_ref_select_event), obj);
+               }
+       return hbox;
+}
+
+
+/* ----- frames ------------------------------------------------------------ */
+
+
+static void build_frames(GtkWidget *vbox)
+{
+       struct frame *frame;
+       GtkWidget *tab, *label, *refs, *vars;
+       int n;
+
        destroy_all_children(GTK_CONTAINER(vbox));
-       for (f = root_frame; f; f = f->prev) {
-               label = label_in_box_new(f->name ? f->name : "(root)");
-               gtk_box_pack_start(GTK_BOX(vbox), box_of_label(label),
-                   FALSE, TRUE, 0);
-               gtk_misc_set_padding(GTK_MISC(label), 2, 2);
-               gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
+       for (frame = frames; frame; frame = frame->next)
+               n++;
 
-               label_in_box_bg(label, active_frame == f ?
-                   COLOR_FRAME_SELECTED : COLOR_FRAME_UNSELECTED);
+       tab = gtk_table_new(n*2, 2, FALSE);
+       gtk_table_set_row_spacings(GTK_TABLE(tab), 1);
+       gtk_table_set_col_spacings(GTK_TABLE(tab), 1);
+       gtk_box_pack_start(GTK_BOX(vbox), tab, FALSE, FALSE, 0);
 
-               g_signal_connect(G_OBJECT(box_of_label(label)),
-                   "button_press_event", G_CALLBACK(frame_select_event), f);
-               f->label = label;
+       n = 0;
+       for (frame = root_frame; frame; frame = frame->prev) {
+               label = build_frame_label(frame);
+               gtk_table_attach_defaults(GTK_TABLE(tab), label,
+                    0, 1, n*2, n*2+1);
+               refs = build_frame_refs(frame);
+               gtk_table_attach_defaults(GTK_TABLE(tab), refs,
+                    1, 2, n*2, n*2+1);
+               vars = build_vars(frame);
+               gtk_table_attach_defaults(GTK_TABLE(tab), vars,
+                    1, 2, n*2+1, n*2+2);
+               n++;
        }
-       gtk_widget_show_all(vbox);
+       gtk_widget_show_all(tab);
 }
 
 
@@ -497,42 +567,29 @@
 
 static void make_center_area(GtkWidget *vbox)
 {
-       GtkWidget *hbox, *vars, *paned;
-       GtkWidget *frame_list, *icons;
+       GtkWidget *hbox, *frames_area, *paned;
+       GtkWidget *icons;
 
        hbox = gtk_hbox_new(FALSE, 0);
        gtk_box_pack_start(GTK_BOX(vbox), hbox, TRUE, TRUE, 0);
 
-       /* Frame list */
-
-       frame_list = gtk_scrolled_window_new(NULL, NULL);
-       gtk_box_pack_start(GTK_BOX(hbox), frame_list, FALSE, TRUE, 0);
-       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(frame_list),
-           GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-
-       frames_box = gtk_vbox_new(FALSE, 0);
-       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(frame_list),
-           frames_box);
-
-       build_frames(frames_box);
-
-       add_sep(hbox, 2);
-
        paned = gtk_hpaned_new();
        gtk_box_pack_start(GTK_BOX(hbox), paned, TRUE, TRUE, 0);
        
-       /* Variables */
+       /* Frames */
 
-       vars = gtk_scrolled_window_new(NULL, NULL);
-       gtk_paned_add1(GTK_PANED(paned), vars);
-       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(vars),
+       frames_area = gtk_scrolled_window_new(NULL, NULL);
+       gtk_paned_add1(GTK_PANED(paned), frames_area);
+       gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(frames_area),
            GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
-       gtk_widget_set_size_request(vars, 150, 100);
-       vars_box = gtk_vbox_new(FALSE, 0);
+       gtk_widget_set_size_request(frames_area, 250, 100);
 
-       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(vars),
-           vars_box);
+       frames_box = gtk_vbox_new(FALSE, 0);
+       build_frames(frames_box);
 
+       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(frames_area),
+           frames_box);
+
        /* Canvas */
 
        gtk_paned_add2(GTK_PANED(paned), make_canvas());
@@ -553,7 +610,6 @@
        instantiate();
        label_in_box_bg(active_frame->label, COLOR_FRAME_SELECTED);
        build_frames(frames_box);
-       build_vars(vars_box, active_frame);
        redraw();
 }
 
@@ -592,7 +648,6 @@
            G_CALLBACK(gtk_main_quit), NULL);
 
        make_screen(root);
-       build_vars(vars_box, root_frame);
 
        gtk_widget_show_all(root);
 

Modified: trunk/eda/fped/gui_style.h
===================================================================
--- trunk/eda/fped/gui_style.h  2009-08-03 20:46:17 UTC (rev 5376)
+++ trunk/eda/fped/gui_style.h  2009-08-03 21:10:49 UTC (rev 5377)
@@ -62,6 +62,9 @@
 #define COLOR_FRAME_SELECTED   "#fff0a0"
 #define COLOR_FRAME_EDITING    COLOR_EDITING
 
+#define        COLOR_REF_UNSELECTED    COLOR_CHOICE_UNSELECTED
+#define        COLOR_REF_SELECTED      COLOR_CHOICE_SELECTED
+
 #define        COLOR_VAR_PASSIVE       COLOR_FRAME_UNSELECTED
 #define        COLOR_VAR_EDITING       COLOR_EDITING
 #define        COLOR_EXPR_PASSIVE      "#f0f0ff"

Modified: trunk/eda/fped/inst.c
===================================================================
--- trunk/eda/fped/inst.c       2009-08-03 20:46:17 UTC (rev 5376)
+++ trunk/eda/fped/inst.c       2009-08-03 21:10:49 UTC (rev 5377)
@@ -61,9 +61,9 @@
                for (inst = insts[prio]; inst; inst = inst->next)
 
 
-struct inst *curr_frame = NULL;
 struct inst *selected_inst = NULL;
 
+static struct inst *curr_frame = NULL;
 static struct inst *insts[ip_n], **next_inst[ip_n];
 static struct inst *prev_insts[ip_n];
 
@@ -480,8 +480,8 @@
        inst->u.arc.width = width;
        inst->bbox.min.x = center.x-r;
        inst->bbox.max.x = center.x+r;
-       inst->bbox.min.y = center.x-r;
-       inst->bbox.max.y = center.x+r;
+       inst->bbox.min.y = center.y-r;
+       inst->bbox.max.y = center.y+r;
        propagate_bbox(inst);
        return 1;
 }

Modified: trunk/eda/fped/obj.c
===================================================================
--- trunk/eda/fped/obj.c        2009-08-03 20:46:17 UTC (rev 5376)
+++ trunk/eda/fped/obj.c        2009-08-03 21:10:49 UTC (rev 5377)
@@ -92,8 +92,9 @@
        for (obj = frame->objs; obj; obj = obj->next)
                switch (obj->type) {
                case ot_frame:
-                       if (!generate_frame(obj->u.frame,
-                           obj->base ? obj->base->pos : base, frame, active))
+                       if (!generate_frame(obj->u.frame.ref,
+                           obj->base ? obj->base->pos : base, frame,
+                           active && obj->u.frame.ref->active_ref == obj))
                                return 0;
                        break;
                case ot_line:

Modified: trunk/eda/fped/obj.h
===================================================================
--- trunk/eda/fped/obj.h        2009-08-03 20:46:17 UTC (rev 5376)
+++ trunk/eda/fped/obj.h        2009-08-03 21:10:49 UTC (rev 5377)
@@ -108,6 +108,9 @@
        /* used during generation */
        const struct frame *curr_parent;
 
+       /* generating and editing */
+       struct obj *active_ref;
+
        /* for the GUI */
        GtkWidget *label;
 };
@@ -121,6 +124,11 @@
        ot_meas,
 };
 
+struct frame_ref {
+       struct frame *ref;
+       int lineno;
+};
+
 struct rect {
        struct vec *other; /* NULL if frame origin */
        struct expr *width;
@@ -145,7 +153,7 @@
 struct obj {
        enum obj_type type;
        union {
-               struct frame *frame;
+               struct frame_ref frame;
                struct rect rect;
                struct rect line;
                struct pad pad;
@@ -154,6 +162,7 @@
        } u;
        struct vec *base;
        struct obj *next;
+       int lineno;
 };
 
 

Added: trunk/eda/fped/quad.fpd
===================================================================
--- trunk/eda/fped/quad.fpd                             (rev 0)
+++ trunk/eda/fped/quad.fpd     2009-08-03 21:10:49 UTC (rev 5377)
@@ -0,0 +1,13 @@
+frame c {
+       vec @(1mm, 0mm)
+       circ . @
+}
+
+vec @(-1mm, 1mm)
+frame c .
+vec @(1mm, -1mm)
+frame c .
+vec @(-1mm, -1mm)
+frame c .
+vec @(1mm, 1mm)
+frame c .




--- End Message ---
_______________________________________________
commitlog mailing list
commitlog@lists.openmoko.org
http://lists.openmoko.org/mailman/listinfo/commitlog

Reply via email to