[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.6.1-20100214-195-g0d658ba)



The branch, master has been updated
       via  0d658babe176af44e2a58fe09ca18b718aea2412 (commit)
      from  e045f84435ed3e07d7a54a41015bf145335c5094 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 NEWS                           |    3 ++
 gschem/include/prototype.h     |    3 ++
 gschem/lib/system-gschemrc.scm |    4 ++-
 gschem/src/g_keys.c            |    1 +
 gschem/src/g_register.c        |    1 +
 gschem/src/i_callbacks.c       |   17 ++++++++++++++++
 gschem/src/o_select.c          |   42 ++++++++++++++++++++++++++++++++++++++++
 7 files changed, 70 insertions(+), 1 deletions(-)


=================
 Commit Messages
=================

commit 0d658babe176af44e2a58fe09ca18b718aea2412
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: Add "Select All" bound to Ctrl-A. [3143355]

:100644 100644 27c0f96... f2353b1... M	NEWS
:100644 100644 d0439a3... 9b56955... M	gschem/include/prototype.h
:100644 100644 64861fe... 2936f9a... M	gschem/lib/system-gschemrc.scm
:100644 100644 67c46be... 07448a1... M	gschem/src/g_keys.c
:100644 100644 19f7920... 2170a92... M	gschem/src/g_register.c
:100644 100644 6520721... fbd73ea... M	gschem/src/i_callbacks.c
:100644 100644 597c334... 9a1c99d... M	gschem/src/o_select.c

=========
 Changes
=========

commit 0d658babe176af44e2a58fe09ca18b718aea2412
Author: Peter TB Brett <peter@xxxxxxxxxxxxx>
Commit: Peter TB Brett <peter@xxxxxxxxxxxxx>

    gschem: Add "Select All" bound to Ctrl-A. [3143355]

diff --git a/NEWS b/NEWS
index 27c0f96..f2353b1 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,9 @@ Notable changes in gEDA/gaf 1.7.0
 * `gschem' no longer supports the `-t' option. It supports a new `-V'
   option to display version information.
 
+* `gschem' now provides a "Select All" function, which is bound to
+  <Control a> by default.
+
 * In the `gschem' "Add component" dialog, filtering the component
   library will expand matching libraries.  If the filter is cancelled,
   all libraries are collapsed.  Components can now be selected by
diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index d0439a3..9b56955 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -63,6 +63,7 @@ SCM g_keys_file_quit(SCM rest);
 SCM g_keys_edit_undo(SCM rest);
 SCM g_keys_edit_redo(SCM rest);
 SCM g_keys_edit_select(SCM rest);
+SCM g_keys_edit_select_all(SCM rest);
 SCM g_keys_edit_copy(SCM rest);
 SCM g_keys_edit_copy_hotkey(SCM rest);
 SCM g_keys_edit_mcopy(SCM rest);
@@ -323,6 +324,7 @@ void i_callback_edit_redo(gpointer data, guint callback_action, GtkWidget *widge
 void i_callback_toolbar_edit_redo(GtkWidget *widget, gpointer data);
 void i_callback_edit_select(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_toolbar_edit_select(GtkWidget *widget, gpointer data);
+void i_callback_edit_select_all(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_edit_copy(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_edit_copy_hotkey(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_edit_mcopy(gpointer data, guint callback_action, GtkWidget *widget);
@@ -689,6 +691,7 @@ OBJECT *o_select_return_first_object(GSCHEM_TOPLEVEL *w_current);
 int o_select_selected(GSCHEM_TOPLEVEL *w_current);
 void o_select_unselect_list(GSCHEM_TOPLEVEL *w_current, SELECTION *selection);
 void o_select_unselect_all(GSCHEM_TOPLEVEL *w_current);
+void o_select_visible_unlocked(GSCHEM_TOPLEVEL *w_current);
 void o_select_move_to_place_list(GSCHEM_TOPLEVEL *w_current);
 /* o_slot.c */
 void o_slot_start(GSCHEM_TOPLEVEL *w_current, OBJECT *object);
diff --git a/gschem/lib/system-gschemrc.scm b/gschem/lib/system-gschemrc.scm
index 64861fe..2936f9a 100644
--- a/gschem/lib/system-gschemrc.scm
+++ b/gschem/lib/system-gschemrc.scm
@@ -1341,7 +1341,8 @@
     ("Control c" . clipboard-copy)
     ("Control v" . clipboard-paste-hotkey)
     ("Control z" . edit-undo)
-    ("Control y" . edit-redo)))
+    ("Control y" . edit-redo)
+    ("Control a" . edit-select-all)))
 
 ; finally set the keymap point to the newly created datastructure 
 (define current-keymap global-keymap)
@@ -1406,6 +1407,7 @@
            (,(N_ "_Delete")            edit-delete            edit-delete             "gtk-delete"  )
            ("SEPARATOR"               #f                     #f                      #f)
            (,(N_ "Select Mode")        edit-select            edit-select             #f)
+           (,(N_ "Select All")         edit-select-all        edit-select-all         "gtk-select-all")
            (,(N_ "Copy Mode")          edit-copy              edit-copy-hotkey        #f)
            (,(N_ "Multiple Copy Mode") edit-mcopy             edit-mcopy-hotkey       #f)
            (,(N_ "Move Mode")          edit-move              edit-move-hotkey        #f)
diff --git a/gschem/src/g_keys.c b/gschem/src/g_keys.c
index 67c46be..07448a1 100644
--- a/gschem/src/g_keys.c
+++ b/gschem/src/g_keys.c
@@ -223,6 +223,7 @@ DEFINE_G_KEYS(file_quit)
 DEFINE_G_KEYS(edit_undo)
 DEFINE_G_KEYS(edit_redo)
 DEFINE_G_KEYS(edit_select)
+DEFINE_G_KEYS(edit_select_all)
 DEFINE_G_KEYS(edit_copy)
 DEFINE_G_KEYS(edit_copy_hotkey)
 DEFINE_G_KEYS(edit_mcopy)
diff --git a/gschem/src/g_register.c b/gschem/src/g_register.c
index 19f7920..2170a92 100644
--- a/gschem/src/g_register.c
+++ b/gschem/src/g_register.c
@@ -165,6 +165,7 @@ static struct gsubr_t gschem_funcs[] = {
   { "edit-undo",                 0, 0, 0, g_keys_edit_undo },
   { "edit-redo",                 0, 0, 0, g_keys_edit_redo },
   { "edit-select",               0, 0, 0, g_keys_edit_select },
+  { "edit-select-all",           0, 0, 0, g_keys_edit_select_all },
   { "edit-copy",                 0, 0, 0, g_keys_edit_copy },
   { "edit-copy-hotkey",          0, 0, 0, g_keys_edit_copy_hotkey },
   { "edit-mcopy",                0, 0, 0, g_keys_edit_mcopy },
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index 6520721..fbd73ea 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -528,6 +528,23 @@ void i_callback_toolbar_edit_select(GtkWidget* widget, gpointer data)
   }
 }
 
+/*! \brief Select all objects on page.
+ * \par Function Description
+ * Sets all objects on page as selected.
+ */
+DEFINE_I_CALLBACK (edit_select_all)
+{
+  GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL *) data;
+  o_redraw_cleanstates (w_current);
+
+  o_select_visible_unlocked (w_current);
+
+  i_set_state (w_current, SELECT);
+  w_current->inside_action = 0;
+  i_update_toolbar (w_current);
+  i_update_menus (w_current);
+}
+
 /*! \todo Finish function documentation!!!
  *  \brief
  *  \par Function Description
diff --git a/gschem/src/o_select.c b/gschem/src/o_select.c
index 597c334..9a1c99d 100644
--- a/gschem/src/o_select.c
+++ b/gschem/src/o_select.c
@@ -535,6 +535,48 @@ void o_select_unselect_all(GSCHEM_TOPLEVEL *w_current)
   o_select_unselect_list( w_current, toplevel->page_current->selection_list );
 }
 
+/*! \brief Selects all visible objects on the current page.
+ * \par Function Description
+ * Clears any existing selection, then selects everything visible and
+ * unlocked on the current page, and any attached attributes whether
+ * visible or invisible..
+ *
+ * \param w_current  The current #GSCHEM_TOPLEVEL structure.
+ */
+void
+o_select_visible_unlocked (GSCHEM_TOPLEVEL *w_current)
+{
+  TOPLEVEL *toplevel = w_current->toplevel;
+  const GList *iter;
+
+  o_select_unselect_all (w_current);
+  for (iter = s_page_objects (toplevel->page_current);
+       iter != NULL;
+       iter = g_list_next (iter)) {
+    OBJECT *obj = (OBJECT *) iter->data;
+
+    /* Skip invisible objects. */
+    if (obj->visibility != VISIBLE && !toplevel->show_hidden_text)
+      continue;
+
+    /* Skip locked objects. */
+    if (obj->sel_func == NULL) continue;
+
+    /* Run selection hooks & add object to selection. */
+    /*! \bug We can't call obj->sel_func, because o_select_object()
+     * behaves differently depending on the state of
+     * w_current->SHIFTKEY and w_current->CONTROLKEY, which may well
+     * be set if this function is called via a keystroke
+     * (e.g. Ctrl-A). */
+    o_select_run_hooks (w_current, obj, 1);
+    o_selection_add (toplevel, toplevel->page_current->selection_list, obj);
+
+    /* Add any attributes of object to selection as well. */
+    o_attrib_add_selected (w_current, toplevel->page_current->selection_list,
+                           obj);
+  }
+}
+
 /*! \todo Finish function documentation!!!
  *  \brief
  *  \par Function Description




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs