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. r5932 - trunk/eda/fped (wer...@docs.openmoko.org)
   2. r5933 - trunk/src/host/dfu-util/src (ste...@docs.openmoko.org)
   3. r5934 - trunk/src/host/dfu-util/src (ste...@docs.openmoko.org)
   4. r5935 - trunk/eda/fped (wer...@docs.openmoko.org)
   5. r5936 - trunk/eda/fped (wer...@docs.openmoko.org)
   6. r5937 - in trunk/eda/fped: . icons (wer...@docs.openmoko.org)
--- Begin Message ---
Author: werner
Date: 2010-04-24 23:46:43 +0200 (Sat, 24 Apr 2010)
New Revision: 5932

Modified:
   trunk/eda/fped/gui_canvas.c
   trunk/eda/fped/gui_canvas.h
   trunk/eda/fped/gui_frame_drag.c
   trunk/eda/fped/gui_frame_drag.h
   trunk/eda/fped/gui_tool.c
   trunk/eda/fped/gui_tool.h
Log:
Dragging a frame into the canvas now works. It's built on top of the frame
tool, with all the old code still around, so the code paths are a bit obscure.

- gui_frame_drag.c: use GTK_DEST_DEFAULT_MOTION instead of
  GTK_DEST_DEFAULT_HIGHLIGHT
- gui_frame_drag.c: put meat on the frame and canvas drag and drop skeleton
- gui_frame_drag.c (setup_frame_drag, setup_canvas_drag): use GDK_ACTION_COPY
  instead of GDK_ACTION_PRIVATE
- gui_frame_drag.h, gui_frame_drag.c (is_dragging_anything): new helper
  function to check if we're dragging anything, without specifying what
- gui_canvas.h, gui_canvas.c: added thin interface layer between gui_frame.c 
  and gui_tool.c
- gui_canvas.c (enter_notify_event, leave_notify_event): return FALSE so that
  other widgets can get the events, too
- gui_tool.h, gui_tool.c (tool_hover): return whether we found anything to 
  hover on
- gui_tool.h, gui_tool.c: added interface for dropping a frame on the canvas



Modified: trunk/eda/fped/gui_canvas.c
===================================================================
--- trunk/eda/fped/gui_canvas.c 2010-04-24 09:54:32 UTC (rev 5931)
+++ trunk/eda/fped/gui_canvas.c 2010-04-24 21:46:43 UTC (rev 5932)
@@ -187,6 +187,41 @@
 }
 
 
+/* ----- drag and drop (frame to canvas) ----------------------------------- */
+
+
+void canvas_frame_begin(struct frame *frame)
+{
+       tool_push_frame(frame);
+}
+
+
+int canvas_frame_motion(struct frame *frame, int x, int y)
+{
+       struct coord pos = canvas_to_coord(x, y);
+
+       return tool_hover(pos);
+}
+
+
+void canvas_frame_end(void)
+{
+       tool_dehover();
+       tool_pop_frame();
+}
+
+
+int canvas_frame_drop(struct frame *frame, int x, int y)
+{
+       struct coord pos = canvas_to_coord(x, y);
+
+       if (!tool_place_frame(frame, pos))
+               return FALSE;
+       change_world();
+       return TRUE;
+}
+
+
 /* ----- button press and release ------------------------------------------ */
 
 
@@ -254,6 +289,8 @@
        DPRINTF("--- button release ---");
        switch (event->button) {
        case 1:
+               if (is_dragging_anything())
+                       return FALSE;
                if (!dragging)
                        break;
                drag_left(pos);
@@ -448,8 +485,9 @@
 static gboolean enter_notify_event(GtkWidget *widget, GdkEventCrossing *event,
     gpointer data)
 {
+       DPRINTF("--- enter ---");
        gtk_widget_grab_focus(widget);
-       return TRUE;
+       return FALSE;
 }
 
 
@@ -461,7 +499,7 @@
                tool_cancel_drag();
        tool_dehover();
        dragging = 0;
-       return TRUE;
+       return FALSE;
 }
 
 

Modified: trunk/eda/fped/gui_canvas.h
===================================================================
--- trunk/eda/fped/gui_canvas.h 2010-04-24 09:54:32 UTC (rev 5931)
+++ trunk/eda/fped/gui_canvas.h 2010-04-24 21:46:43 UTC (rev 5932)
@@ -1,8 +1,8 @@
 /*
  * gui_canvas.h - GUI, canvas
  *
- * Written 2009 by Werner Almesberger
- * Copyright 2009 by Werner Almesberger
+ * Written 2009, 2010 by Werner Almesberger
+ * Copyright 2009, 2010 by Werner Almesberger
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -34,6 +34,11 @@
 void zoom_to_frame(void);
 void zoom_to_extents(void);
 
+void canvas_frame_begin(struct frame *frame);
+int canvas_frame_motion(struct frame *frame, int x, int y);
+void canvas_frame_end(void);
+int canvas_frame_drop(struct frame *frame, int x, int y);
+
 GtkWidget *make_canvas(void);
 void init_canvas(void);
 

Modified: trunk/eda/fped/gui_frame_drag.c
===================================================================
--- trunk/eda/fped/gui_frame_drag.c     2010-04-24 09:54:32 UTC (rev 5931)
+++ trunk/eda/fped/gui_frame_drag.c     2010-04-24 21:46:43 UTC (rev 5932)
@@ -15,9 +15,15 @@
 
 #include "obj.h"
 #include "gui_util.h"
+#include "gui.h"
+#include "gui_canvas.h"
 #include "gui_frame_drag.h"
 
+#if 0
+#include "icons/frame.xpm"
+#endif
 
+
 enum {
        target_id_var,
        target_id_value,
@@ -61,6 +67,12 @@
 }
 
 
+int is_dragging_anything(void)
+{
+       return !!dragging;
+}
+
+
 /* ----- helper functions for indexed list and swapping -------------------- */
 
 
@@ -273,7 +285,7 @@
        box = box_of_label(var->widget);
        gtk_drag_source_set(box, GDK_BUTTON1_MASK,
            &target_var, 1, GDK_ACTION_PRIVATE);
-       gtk_drag_dest_set(box, GTK_DEST_DEFAULT_HIGHLIGHT,
+       gtk_drag_dest_set(box, GTK_DEST_DEFAULT_MOTION,
            &target_var, 1, GDK_ACTION_PRIVATE);
        setup_drag_common(box, var);
        g_signal_connect(G_OBJECT(box), "drag-motion",
@@ -342,7 +354,7 @@
        box = box_of_label(value->widget);
        gtk_drag_source_set(box, GDK_BUTTON1_MASK,
            &target_value, 1, GDK_ACTION_PRIVATE);
-       gtk_drag_dest_set(box, GTK_DEST_DEFAULT_HIGHLIGHT,
+       gtk_drag_dest_set(box, GTK_DEST_DEFAULT_MOTION,
            &target_value, 1, GDK_ACTION_PRIVATE);
        setup_drag_common(box, value);
        g_signal_connect(G_OBJECT(box), "drag-motion",
@@ -350,28 +362,86 @@
 }
 
 
+/* ----- frame to canvas helper functions ---------------------------------- */
+
+
+static int frame_on_canvas = 0;
+
+
+static void leave_canvas(void)
+{
+       if (frame_on_canvas)
+               canvas_frame_end();
+       frame_on_canvas = 0;
+}
+
+
 /* ----- drag frame labels ------------------------------------------------- */
 
 
+#if 0
+
+/*
+ * Setting our own icon looks nice but it slows things down to the point where
+ * cursor movements can lag noticeable and it adds yet another element to an
+ * already crowded cursor.
+ */
+
+static void drag_frame_begin(GtkWidget *widget,
+    GtkTextDirection previous_direction, gpointer user_data)
+{
+       GdkPixmap *pixmap;
+       GdkBitmap *mask;
+       GdkColormap *cmap;
+
+       pixmap = gdk_pixmap_create_from_xpm_d(DA, &mask, NULL, xpm_frame);
+       cmap = gdk_drawable_get_colormap(root->window);
+       gtk_drag_source_set_icon(widget, cmap, pixmap, mask);
+       g_object_unref(pixmap);
+       g_object_unref(mask);
+
+       dragging = user_data;
+}
+
+#endif
+
+
 static gboolean drag_frame_motion(GtkWidget *widget,
     GdkDragContext *drag_context, gint x, gint y, guint time_,
     gpointer user_data)
 {
        if (!has_target(widget, drag_context, "frame"))
                return FALSE;
-//fprintf(stderr, "frame\n");
-return FALSE;
+       /* nothing else to do yet */
+       return FALSE;
 }
 
 
+static void drag_frame_end(GtkWidget *widget, GdkDragContext *drag_context,
+    gpointer user_data)
+{
+       leave_canvas();
+       drag_end(widget, drag_context, user_data);
+}
+
+
 void setup_frame_drag(struct frame *frame)
 {
        GtkWidget *box;
 
        box = box_of_label(frame->label);
        gtk_drag_source_set(box, GDK_BUTTON1_MASK,
-           &target_frame, 1, GDK_ACTION_PRIVATE);
+           &target_frame, 1, GDK_ACTION_COPY);
        setup_drag_common(box, frame);
+
+       /* override */
+#if 0
+       g_signal_connect(G_OBJECT(box), "drag-begin",
+           G_CALLBACK(drag_frame_begin), frame);
+#endif
+       g_signal_connect(G_OBJECT(box), "drag-end",
+           G_CALLBACK(drag_frame_end), frame);
+
        g_signal_connect(G_OBJECT(box), "drag-motion",
            G_CALLBACK(drag_frame_motion), frame);
 }
@@ -386,16 +456,52 @@
 {
        if (!has_target(widget, drag_context, "frame"))
                return FALSE;
-//fprintf(stderr, "canvas\n");
+gtk_drag_finish(drag_context, FALSE, FALSE, time_);
 return FALSE;
+       if (!frame_on_canvas) {
+               frame_on_canvas = 1;
+               canvas_frame_begin(dragging);
+       }
+       if (canvas_frame_motion(dragging, x, y)) {
+               gdk_drag_status(drag_context, GDK_ACTION_COPY, time_);
+               return TRUE;
+       } else {
+               gdk_drag_status(drag_context, 0, time_);
+               return FALSE;
+       }
 }
 
 
+static void drag_canvas_leave(GtkWidget *widget, GdkDragContext *drag_context,
+    guint time_, gpointer user_data)
+{
+       leave_canvas();
+}
+
+
+static gboolean drag_canvas_drop(GtkWidget *widget,
+    GdkDragContext *drag_context, gint x, gint y, guint time_,
+    gpointer user_data)
+{
+       if (!has_target(widget, drag_context, "frame"))
+               return FALSE;
+       if (!canvas_frame_drop(dragging, x, y))
+               return FALSE;
+       gtk_drag_finish(drag_context, TRUE, FALSE, time_);
+       return TRUE;
+}
+
+
 void setup_canvas_drag(GtkWidget *canvas)
 {
-       gtk_drag_dest_set(canvas, GTK_DEST_DEFAULT_HIGHLIGHT,
-           &target_frame, 1, GDK_ACTION_PRIVATE);
-       setup_drag_common(canvas, NULL);
+       gtk_drag_dest_set(canvas,
+           GTK_DEST_DEFAULT_MOTION | GTK_DEST_DEFAULT_DROP,
+           &target_frame, 1, GDK_ACTION_COPY);
+
        g_signal_connect(G_OBJECT(canvas), "drag-motion",
            G_CALLBACK(drag_canvas_motion), NULL);
+       g_signal_connect(G_OBJECT(canvas), "drag-leave",
+           G_CALLBACK(drag_canvas_leave), NULL);
+       g_signal_connect(G_OBJECT(canvas), "drag-drop",
+           G_CALLBACK(drag_canvas_drop), NULL);
 }

Modified: trunk/eda/fped/gui_frame_drag.h
===================================================================
--- trunk/eda/fped/gui_frame_drag.h     2010-04-24 09:54:32 UTC (rev 5931)
+++ trunk/eda/fped/gui_frame_drag.h     2010-04-24 21:46:43 UTC (rev 5932)
@@ -20,6 +20,7 @@
 
 
 int is_dragging(void *this);
+int is_dragging_anything(void);
 
 void setup_var_drag(struct var *var);
 void setup_value_drag(struct value *value);

Modified: trunk/eda/fped/gui_tool.c
===================================================================
--- trunk/eda/fped/gui_tool.c   2010-04-24 09:54:32 UTC (rev 5931)
+++ trunk/eda/fped/gui_tool.c   2010-04-24 21:46:43 UTC (rev 5932)
@@ -803,7 +803,7 @@
 }
 
 
-void tool_hover(struct coord pos)
+int tool_hover(struct coord pos)
 {
        struct inst *curr;
 
@@ -825,18 +825,87 @@
 #endif
 
        if (curr == hover_inst)
-               return;
+               return !!curr;
        if (hover_inst) {
                over_leave();
                hover_inst = NULL;
        }
        if (!curr)
-               return;
+               return 0;
        hover_inst = curr;
        over_enter(hover_save_and_draw, NULL);
+       return 1;
 }
 
 
+/* ----- frame drag and drop ----------------------------------------------- */
+
+
+/*
+ * When dragging a frame, we temporarily replace the selected tool (if any)
+ * with the frame tool.
+ */
+
+
+static struct tool_ops *pushed_ops;
+
+
+void tool_push_frame(struct frame *frame)
+{
+       pushed_ops = active_ops;
+       locked_frame = frame;
+       active_ops = &frame_ops;
+       /*
+        * We don't need to call tool_selected since, with drag and drop, the
+        * frame tools doesn't need activation anymore.
+        */
+}
+
+
+static int do_place_frame(struct frame *frame, struct coord pos)
+{
+       if (!get_hover_inst(pos))
+               return 0;
+       tool_consider_drag(pos);
+       return 1;
+}
+
+
+/*
+ * Gtk calls drag-leave, drag-end, and only then drag-drop. So we'll already
+ * have cleaned up in tool_pop_frame before we get here. In order to place the
+ * frame, we need to activate the frame tool again.
+ *
+ * @@@ bug: there's a tool_reset in this path, so we'll lose the widget of the
+ * tool that's really active. This problem will vanish when scrapping the
+ * old-style frame referenes.
+ */
+
+int tool_place_frame(struct frame *frame, struct coord pos)
+{
+       int ok;
+
+       active_ops = &frame_ops;
+       ok = do_place_frame(frame, pos);
+       active_ops = pushed_ops;
+       return ok;
+}
+
+
+void tool_pop_frame(void)
+{
+       if (!active_tool)
+               return;
+       active_ops = pushed_ops;
+       /*
+        * We don't need to call tool_selected since the only tool that could
+        * use this would be the delete tool, and there the semantics would be
+        * undesirable. Also, the delete tool never stays active, so it can't
+        * appear together with drag and drop anyway.
+        */
+}
+
+
 /* ----- tooltip ----------------------------------------------------------- */
 
 

Modified: trunk/eda/fped/gui_tool.h
===================================================================
--- trunk/eda/fped/gui_tool.h   2010-04-24 09:54:32 UTC (rev 5931)
+++ trunk/eda/fped/gui_tool.h   2010-04-24 21:46:43 UTC (rev 5932)
@@ -46,7 +46,7 @@
 void do_move_to_arc(struct inst *inst, struct inst *to, int i);
 
 void tool_dehover(void);
-void tool_hover(struct coord pos);
+int tool_hover(struct coord pos);
 const char *tool_tip(struct coord pos);
 int tool_consider_drag(struct coord pos);
 void tool_drag(struct coord to);
@@ -73,6 +73,10 @@
 void tool_frame_update(void);
 void tool_frame_deleted(const struct frame *frame);
 
+void tool_push_frame(struct frame *frame);
+int tool_place_frame(struct frame *frame, struct coord pos);
+void tool_pop_frame(void);
+
 void tool_selected_inst(struct inst *inst);
 
 GtkWidget *get_icon_by_inst(const struct inst *inst);




--- End Message ---
--- Begin Message ---
Author: stefan
Date: 2010-04-24 23:59:37 +0200 (Sat, 24 Apr 2010)
New Revision: 5933

Modified:
   trunk/src/host/dfu-util/src/Makefile.am
Log:
Makefile.am: Fix make distcheck

All needed files must be listed.

Modified: trunk/src/host/dfu-util/src/Makefile.am
===================================================================
--- trunk/src/host/dfu-util/src/Makefile.am     2010-04-24 21:46:43 UTC (rev 
5932)
+++ trunk/src/host/dfu-util/src/Makefile.am     2010-04-24 21:59:37 UTC (rev 
5933)
@@ -7,10 +7,20 @@
 BUILT_SOURCES = dfu-version.h
 
 bin_PROGRAMS = dfu-util dfu-util_static
-dfu_util_SOURCES = main.c sam7dfu.c dfu.c dfu.h
+dfu_util_SOURCES = main.c \
+               sam7dfu.c \
+               sam7dfu.h \
+               dfu.c \
+               dfu.h \
+               usb_dfu.h
 
-dfu_util_static_SOURCES = main.c sam7dfu.c dfu.c dfu.h
+dfu_util_static_SOURCES = main.c \
+                       sam7dfu.c \
+                       sam7dfu.h \
+                       dfu.c \
+                       dfu.h \
+                       usb_dfu.h
+
 dfu_util_static_LDFLAGS = -static
 
-# commands.c commands.h sam7dfu.c
-
+EXTRA_DIST = dfu-version.h




--- End Message ---
--- Begin Message ---
Author: stefan
Date: 2010-04-24 23:59:40 +0200 (Sat, 24 Apr 2010)
New Revision: 5934

Modified:
   trunk/src/host/dfu-util/src/main.c
Log:
main: Make sure we switch to the DFU interface

"usb_set_altinerface(_rt_dif.dev_handle, 0)" call seems to be necessary
to actually switch to the DFU interface when the USB-Device still uses
its default interface.
usb_claim_interface() doesn't send anything over the bus, but the
device needs to know when to serve DFU-Requests (like the following
dfu_get_status() request).
it works without it on devices where the DFU-Interface == 0 or the only
DFU interface available.
It doesn't work if a device offers a DFU-Device Descriptor in normal
runtime mode (to serve appDETACH requests).

For OM devices we did not hit the problem, but we have no problems with it
either.

Reported-by: Daniel Hiepler <nft...@googlemail.com>

Modified: trunk/src/host/dfu-util/src/main.c
===================================================================
--- trunk/src/host/dfu-util/src/main.c  2010-04-24 21:59:37 UTC (rev 5933)
+++ trunk/src/host/dfu-util/src/main.c  2010-04-24 21:59:40 UTC (rev 5934)
@@ -588,6 +588,12 @@
                        exit(1);
                }
 
+               if (usb_set_altinterface(_rt_dif.dev_handle, 0) < 0) {
+                       fprintf(stderr, "Cannot set alt interface: %s\n",
+                               usb_strerror());
+                       exit(1);
+               }
+
                printf("Determining device status: ");
                if (dfu_get_status(_rt_dif.dev_handle, _rt_dif.interface, 
&status ) < 0) {
                        fprintf(stderr, "error get_status: %s\n",




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2010-04-25 00:18:21 +0200 (Sun, 25 Apr 2010)
New Revision: 5935

Modified:
   trunk/eda/fped/gui_frame_drag.c
Log:
Oops. Some nasty debugging code escaped.

- gui_frame_drag.c (drag_canvas_motion): removed broken experimental invocation
  of gtk_drag_finish



Modified: trunk/eda/fped/gui_frame_drag.c
===================================================================
--- trunk/eda/fped/gui_frame_drag.c     2010-04-24 21:59:40 UTC (rev 5934)
+++ trunk/eda/fped/gui_frame_drag.c     2010-04-24 22:18:21 UTC (rev 5935)
@@ -456,8 +456,6 @@
 {
        if (!has_target(widget, drag_context, "frame"))
                return FALSE;
-gtk_drag_finish(drag_context, FALSE, FALSE, time_);
-return FALSE;
        if (!frame_on_canvas) {
                frame_on_canvas = 1;
                canvas_frame_begin(dragging);




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2010-04-25 01:08:39 +0200 (Sun, 25 Apr 2010)
New Revision: 5936

Modified:
   trunk/eda/fped/gui_canvas.c
Log:
Dragging a frame into the canvas reuses the hover and drag system. In order to
avoid accidently dragging away bits the selected item (and confusing the
internal logic of the hover and drag system in the process), we have to make
sure nothing is selected when we enter the canvas.

- gui_canvas.c (canvas_frame_begin): make sure no instance is selected



Modified: trunk/eda/fped/gui_canvas.c
===================================================================
--- trunk/eda/fped/gui_canvas.c 2010-04-24 22:18:21 UTC (rev 5935)
+++ trunk/eda/fped/gui_canvas.c 2010-04-24 23:08:39 UTC (rev 5936)
@@ -192,6 +192,8 @@
 
 void canvas_frame_begin(struct frame *frame)
 {
+       inst_deselect(); /* don't drag away bits of the selected object */
+       redraw();
        tool_push_frame(frame);
 }
 




--- End Message ---
--- Begin Message ---
Author: werner
Date: 2010-04-25 02:11:45 +0200 (Sun, 25 Apr 2010)
New Revision: 5937

Removed:
   trunk/eda/fped/icons/frame_locked.fig
   trunk/eda/fped/icons/frame_ready.fig
Modified:
   trunk/eda/fped/Makefile
   trunk/eda/fped/gui.html
   trunk/eda/fped/gui_canvas.c
   trunk/eda/fped/gui_frame.c
   trunk/eda/fped/gui_tool.c
   trunk/eda/fped/gui_tool.h
Log:
Removing the old interface for adding frame refrences. Also updated the 
documentation.

- Makefile, icons/frame_locked.fig, icons/frame_ready.fig: removed the icons of
  locked and ready frames 
- gui_tool.c: removed the frame tool and all the image handling associated with
  it, leaving only the bits in place that are used by frame to canvas dragging 
- gui_tool.h, gui_tool.c (tool_frame_update, tool_frame_deleted), gui_canvas.c
  (key_press_event), gui_frame.c (popup_del_frame, select_frame): removed
  the notifications of frame changes
- gui.html: removed the old clumsy frame reference procedure and described the
  new way



Modified: trunk/eda/fped/Makefile
===================================================================
--- trunk/eda/fped/Makefile     2010-04-24 23:08:39 UTC (rev 5936)
+++ trunk/eda/fped/Makefile     2010-04-25 00:11:45 UTC (rev 5937)
@@ -22,7 +22,7 @@
        gui_tool.o gui_over.o gui_meas.o gui_frame.o gui_frame_drag.o
 
 XPMS = point.xpm delete.xpm delete_off.xpm \
-       vec.xpm frame.xpm frame_locked.xpm frame_ready.xpm \
+       vec.xpm frame.xpm \
        line.xpm rect.xpm pad.xpm rpad.xpm arc.xpm circ.xpm \
        meas.xpm meas_x.xpm meas_y.xpm \
        stuff.xpm stuff_off.xpm meas_off.xpm \

Modified: trunk/eda/fped/gui.html
===================================================================
--- trunk/eda/fped/gui.html     2010-04-24 23:08:39 UTC (rev 5936)
+++ trunk/eda/fped/gui.html     2010-04-25 00:11:45 UTC (rev 5937)
@@ -93,9 +93,34 @@
     a pad.
   <LI> To define a repetition through a loop or a table.
   <LI> To set variables for child frames. 
-</UL
+</UL>
 
+At the bottom of the hierarchy, we have the root frame. To add another
+frame, right-click on the root frame's label "(root)" and select "Add
+frame".
+<P>
+To be able to put items into the new frame, it has to be attached to
+the root frame (or to any other frame that's attached). This is called a
+<I>frame reference</I>. First, we need a place to attach it to. This
+can be the origin of its parent frame or it can be the end of a vector
+in the parent frame. To create the frame reference, do this:
+<P>
+<UL>
+  <LI> Click on the parent frame to select it.
+  <LI> Press the left mouse button on the frame you wish to reference
+    and drag it (move the mouse pointer while keeping the left button
+    pressed) into the canvas. When dragging, the mouse cursor changes
+    to show a hand.
+  <LI> When the mouse pointer is above a suitable point of attachment,
+    the point of attachment is highlighted with a red circle and the
+    mouse cursor changes to show a hand with a plus sign.
+  <LI> At the desired location, release the mouse button.
+</UL>
 
+If you wish to cancel the operation, simply release the mouse button at
+any place that isn't a point of attachment.
+
+
 <H1>Variables</H1>
 
 
@@ -191,25 +216,6 @@
     Note that the starting point of the vector has to be in the same
     frame as the vector being drawn. This limitation also applies to
     points defining pads and silk-screen items.
-  <DT><IMG src="manual/frame.png">&nbsp;<IMG src="manual/frame_locked.png">
-    &nbsp;<IMG src="manual/frame_ready.png">
-  <DD> Add a frame reference. A frame reference inserts the content of a
-    frame into another frame. There are three steps in this process:
-    <UL>
-      <LI> Select the frame to be inserted and click on the frame icon.
-       A large black dot appears in the icon to indicate that a frame
-       reference has been chosen.
-      <LI> Select the frame into which to insert the reference. The dot
-       changes to green to indicate that the reference can now be placed.
-       If the dot stays black, then the selected frame is not a valid
-       destination, i.e., because the reference in turn references this
-       frame.
-      <LI> Click on the location at which to attach the reference. This
-       location can be either the end of a vector or the frame's origin.
-    </UL>
-    When finished, don't forget that the destination frame is still selected.
-    In order to add elements to the newly referenced frame, you have to
-    select it first.
   <DT><IMG src="manual/pad.png">&nbsp;<IMG src="manual/rpad.png">
   <DD> Add a pad. Pads are either rectangular or rounded. They are
     defined by two points which are opposite corners of the rectangle

Modified: trunk/eda/fped/gui_canvas.c
===================================================================
--- trunk/eda/fped/gui_canvas.c 2010-04-24 23:08:39 UTC (rev 5936)
+++ trunk/eda/fped/gui_canvas.c 2010-04-25 00:11:45 UTC (rev 5937)
@@ -441,7 +441,6 @@
        case GDK_KP_Delete:
                if (selected_inst) {
                        inst_delete(selected_inst);
-                       tool_frame_update();
                        change_world();
                }
                break;

Modified: trunk/eda/fped/gui_frame.c
===================================================================
--- trunk/eda/fped/gui_frame.c  2010-04-24 23:08:39 UTC (rev 5936)
+++ trunk/eda/fped/gui_frame.c  2010-04-25 00:11:45 UTC (rev 5937)
@@ -130,7 +130,6 @@
        struct frame *frame = popup_data;
 
        assert(frame != root_frame);
-       tool_frame_deleted(frame);
        delete_frame(frame);
        if (active_frame == frame)
                select_frame(root_frame);
@@ -1680,7 +1679,6 @@
        if (active_frame)
                label_in_box_bg(active_frame->label, COLOR_FRAME_UNSELECTED);
        active_frame = frame;
-       tool_frame_update();
        change_world();
 }
 

Modified: trunk/eda/fped/gui_tool.c
===================================================================
--- trunk/eda/fped/gui_tool.c   2010-04-24 23:08:39 UTC (rev 5936)
+++ trunk/eda/fped/gui_tool.c   2010-04-25 00:11:45 UTC (rev 5937)
@@ -34,8 +34,6 @@
 #include "icons/arc.xpm"
 #include "icons/circ.xpm"
 #include "icons/frame.xpm"
-#include "icons/frame_locked.xpm"
-#include "icons/frame_ready.xpm"
 #include "icons/line.xpm"
 #include "icons/meas.xpm"
 #include "icons/meas_x.xpm"
@@ -49,11 +47,10 @@
 #include "icons/vec.xpm"
 
 
-static GtkWidget *ev_point, *ev_delete, *ev_frame;
+static GtkWidget *ev_point, *ev_delete;
 static GtkWidget *active_tool;
 static struct tool_ops *active_ops = NULL;
 static struct inst *hover_inst = NULL;
-static GtkWidget *frame_image, *frame_image_locked, *frame_image_ready;
 static GtkWidget *delete_image[2];
 
 static struct drag_state {
@@ -591,47 +588,12 @@
 }
 
 
-/* ----- frame cache ------------------------------------------------------- */
+/* ----- frame ------------------------------------------------------------- */
 
 
 static struct frame *locked_frame = NULL;
 
 
-static void set_frame_image(GtkWidget *image)
-{
-       set_image(ev_frame, image);
-}
-
-
-void tool_frame_update(void)
-{
-       set_frame_image(!locked_frame ? frame_image :
-           is_parent_of(locked_frame, active_frame) ?
-           frame_image_locked : frame_image_ready);
-}
-
-
-void tool_frame_deleted(const struct frame *frame)
-{
-       if (frame == locked_frame) {
-               locked_frame = NULL;
-               set_frame_image(frame_image);
-       }
-}
-
-
-static void tool_selected_frame(void)
-{
-       if (active_frame != root_frame) {
-               locked_frame = active_frame;
-               set_frame_image(frame_image_locked);
-       }
-}
-
-
-/* ----- frame ------------------------------------------------------------- */
-
-
 struct pix_buf *draw_move_frame(struct inst *inst, struct coord pos, int i)
 {
        struct pix_buf *buf;
@@ -663,14 +625,13 @@
        if (!locked_frame->active_ref)
                locked_frame->active_ref = obj;
        locked_frame = NULL;
-       tool_frame_update();
        tool_reset();
        return 1;
 }
 
 
 static struct tool_ops frame_ops = {
-       .tool_selected  = tool_selected_frame,
+       .tool_selected  = NULL,
        .drag_new       = NULL,
        .end_new        = end_new_frame,
 };
@@ -1199,8 +1160,6 @@
        tool_button(bar, drawable, xpm_vec,
            "Add a vector",
            tool_button_press_event, &vec_ops);
-       ev_frame = tool_button(bar, drawable, NULL, NULL,
-           tool_button_press_event, &frame_ops);
        tool_button(bar, drawable, xpm_pad,
            "Add a rectangular pad",
            tool_button_press_event, &pad_ops);
@@ -1227,17 +1186,6 @@
            "Add a vertical measurement",
            tool_button_press_event, &tool_meas_ops_y);
 
-       frame_image = gtk_widget_ref(make_image(drawable, xpm_frame,
-           "Step 1: select the current frame for insertion"));
-       frame_image_locked =
-           gtk_widget_ref(make_image(drawable, xpm_frame_locked,
-           "Step 2: select the frame into which to insert"));
-       frame_image_ready =
-           gtk_widget_ref(make_image(drawable, xpm_frame_ready,
-           "Final step: add the frame reference to an anchor point "
-           "(vector or origin)"));
-       set_frame_image(frame_image);
-
        delete_image[0] = gtk_widget_ref(make_image(drawable, xpm_delete_off,
            NULL));
        delete_image[1] = gtk_widget_ref(make_image(drawable, xpm_delete,
@@ -1252,9 +1200,6 @@
 
 void gui_cleanup_tools(void)
 {
-       g_object_unref(frame_image);
-       g_object_unref(frame_image_locked);
-       g_object_unref(frame_image_ready);
        g_object_unref(delete_image[0]);
        g_object_unref(delete_image[1]);
 }

Modified: trunk/eda/fped/gui_tool.h
===================================================================
--- trunk/eda/fped/gui_tool.h   2010-04-24 23:08:39 UTC (rev 5936)
+++ trunk/eda/fped/gui_tool.h   2010-04-25 00:11:45 UTC (rev 5937)
@@ -65,14 +65,6 @@
     struct coord end, struct coord pos, int i);
 struct pix_buf *drag_new_line(struct inst *from, struct coord to);
 
-
-/*
- * Cache the frame and track it.
- */
-
-void tool_frame_update(void);
-void tool_frame_deleted(const struct frame *frame);
-
 void tool_push_frame(struct frame *frame);
 int tool_place_frame(struct frame *frame, struct coord pos);
 void tool_pop_frame(void);

Deleted: trunk/eda/fped/icons/frame_locked.fig
===================================================================
--- trunk/eda/fped/icons/frame_locked.fig       2010-04-24 23:08:39 UTC (rev 
5936)
+++ trunk/eda/fped/icons/frame_locked.fig       2010-04-25 00:11:45 UTC (rev 
5937)
@@ -1,17 +0,0 @@
-#FIG 3.2  Produced by xfig version 3.2.5a
-Landscape
-Center
-Inches
-A4      
-100.00
-Single
--2
-1200 2
-6 3750 3225 5775 4200
-2 1 0 10 12 7 50 -1 -1 0.000 0 0 -1 0 0 3
-        3900 4125 3900 3525 5700 3525
-4 0 12 50 -1 22 42 0.0000 4 135 450 3750 3375 FRAME\001
--6
-1 3 0 0 0 0 50 -1 20 0.000 1 0.0000 5400 4200 375 375 5400 4200 5775 4200
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
-        3600 2400 6000 2400 6000 4800 3600 4800 3600 2400

Deleted: trunk/eda/fped/icons/frame_ready.fig
===================================================================
--- trunk/eda/fped/icons/frame_ready.fig        2010-04-24 23:08:39 UTC (rev 
5936)
+++ trunk/eda/fped/icons/frame_ready.fig        2010-04-25 00:11:45 UTC (rev 
5937)
@@ -1,15 +0,0 @@
-#FIG 3.2  Produced by xfig version 3.2.5a
-Landscape
-Center
-Inches
-A4      
-100.00
-Single
--2
-1200 2
-1 3 0 0 0 12 50 -1 20 0.000 1 0.0000 5400 4200 375 375 5400 4200 5775 4200
-2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5
-        3600 2400 6000 2400 6000 4800 3600 4800 3600 2400
-2 1 0 10 12 7 50 -1 -1 0.000 0 0 -1 0 0 3
-        3900 4125 3900 3525 5700 3525
-4 0 12 50 -1 22 42 0.0000 4 135 450 3750 3375 FRAME\001




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

Reply via email to