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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-54-ga887176)



The branch, master has been updated
       via  a887176190cf5a0bea019b5cdc150611edb7a603 (commit)
       via  5031f6846f2ae9ec703bcdcd689ab4e0d87373c8 (commit)
       via  94f3f4f753e255538d1376ab9a9b334d53f0be60 (commit)
       via  714580df3fee12732d5e1180722f008a47aaf973 (commit)
       via  826676196547f44c7923e4103a0789c1e1be63ca (commit)
      from  c43c40260ec072e2ad31a3b42b9d5437bea2a529 (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
=========

 gnetlist/examples/vams/gschemrc |    3 ---
 gschem/include/globals.h        |    3 ---
 gschem/include/prototype.h      |    4 ++++
 gschem/lib/system-gschemrc.in   |   13 +++++++------
 gschem/src/g_keys.c             |    2 ++
 gschem/src/g_register.c         |    2 ++
 gschem/src/globals.c            |    3 ---
 gschem/src/gschem.c             |    1 -
 gschem/src/i_callbacks.c        |   34 ++++++++++++++++++++++++++++++++++
 gschem/src/rcstrings.c          |    2 ++
 gschem/src/x_color.c            |   15 +++++++++++++--
 gschem/src/x_menus.c            |   10 +---------
 12 files changed, 65 insertions(+), 27 deletions(-)


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

commit a887176190cf5a0bea019b5cdc150611edb7a603
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:54:08 2008 +0000

    gschem: Add actions to view menu to switch to light or dark colour scheme
    
    For now, these menu entries are hard-coded to the colour scheme files
    which we ship. It would be nice in the future (when menus are reworked),
    to add these options from a registered list of colour schemes.

:100644 100644 49d3d83... f473db6... M	gschem/include/prototype.h
:100644 100644 d4464b1... 357bafb... M	gschem/lib/system-gschemrc.in
:100644 100644 00608a0... 838890d... M	gschem/src/g_keys.c
:100644 100644 99145b3... fb710ed... M	gschem/src/g_register.c
:100644 100644 dd41528... 30c8a3a... M	gschem/src/i_callbacks.c
:100644 100644 514302e... 2adaf26... M	gschem/src/rcstrings.c

commit 5031f6846f2ae9ec703bcdcd689ab4e0d87373c8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:53:45 2008 +0000

    gschem: Fix x_color_free() and make it free the whole colour map
    
    The previous code would have caused breakage if it were executed,
    since gdk_colormap_free_colors expects to take a pointer to an
    array of GdkColor elements.

:100644 100644 f91abe9... ca444db... M	gschem/src/x_color.c

commit 94f3f4f753e255538d1376ab9a9b334d53f0be60
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:53:45 2008 +0000

    gschem: Move handling of the gdk colour map into x_color.c

:100644 100644 42817c6... 52844a9... M	gschem/include/globals.h
:100644 100644 f9bd90d... 54278b8... M	gschem/src/globals.c
:100644 100644 9c58d37... 1c3122a... M	gschem/src/gschem.c
:100644 100644 3666b46... f91abe9... M	gschem/src/x_color.c

commit 714580df3fee12732d5e1180722f008a47aaf973
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:53:42 2008 +0000

    gschem: Don't define key-bindings for keys which have no-action
    
    If we do this, then when we set "no-action" to a menu item's key binding,
    the code will try to display one of the keys associated with "no-action"
    as a binding for that menu item.

:100644 100644 f1bfb49... cb814e2... M	gnetlist/examples/vams/gschemrc
:100644 100644 3f9d34c... d4464b1... M	gschem/lib/system-gschemrc.in

commit 826676196547f44c7923e4103a0789c1e1be63ca
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:42:55 2008 +0000

    gschem: Remove a few unused variables from x_menus.c
    
    Removed some an debugging printf as well, which printed them.

:100644 100644 649aa85... e2c38a7... M	gschem/src/x_menus.c

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

commit a887176190cf5a0bea019b5cdc150611edb7a603
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:54:08 2008 +0000

    gschem: Add actions to view menu to switch to light or dark colour scheme
    
    For now, these menu entries are hard-coded to the colour scheme files
    which we ship. It would be nice in the future (when menus are reworked),
    to add these options from a registered list of colour schemes.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 49d3d83..f473db6 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -129,6 +129,8 @@ SCM g_keys_view_pan_up(SCM rest);
 SCM g_keys_view_pan_down(SCM rest);
 SCM g_keys_view_pan_hotkey(SCM rest);
 SCM g_keys_view_update_cues(SCM rest);
+SCM g_keys_view_dark_colors(SCM rest);
+SCM g_keys_view_light_colors(SCM rest);
 SCM g_keys_page_manager(SCM rest);
 SCM g_keys_page_next(SCM rest);
 SCM g_keys_page_prev(SCM rest);
@@ -361,6 +363,8 @@ void i_callback_view_pan_up(gpointer data, guint callback_action, GtkWidget *wid
 void i_callback_view_pan_down(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_view_pan_hotkey(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_view_update_cues(gpointer data, guint callback_action, GtkWidget *widget);
+void i_callback_view_dark_colors(gpointer data, guint callback_action, GtkWidget *widget);
+void i_callback_view_light_colors(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_page_manager(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_page_next(gpointer data, guint callback_action, GtkWidget *widget);
 void i_callback_page_prev(gpointer data, guint callback_action, GtkWidget *widget);
diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in
index d4464b1..357bafb 100644
--- a/gschem/lib/system-gschemrc.in
+++ b/gschem/lib/system-gschemrc.in
@@ -1247,7 +1247,8 @@
     ("p" . view-pan-hotkey)
     ("u" . view-update-cues)
     ("o" . view-zoom-out-hotkey)
-    ("i" . view-zoom-in-hotkey)))
+    ("i" . view-zoom-in-hotkey)
+   ))
 
 (define buffer-keymap
   '(("c" . buffer-copy1)
@@ -1480,7 +1481,11 @@
 	   ("Zoom Extents"	view-zoom-extents	view-zoom-extents)
 	   ("Zoom In"		view-zoom-in		view-zoom-in-hotkey)
 	   ("Zoom Out"		view-zoom-out		view-zoom-out-hotkey)
-	   ("Zoom Full"		view-zoom-full		view-zoom-full)))
+	   ("Zoom Full"		view-zoom-full		view-zoom-full)
+	   ("SEPARATOR"         no-action               no-action)
+	   ("Dark color scheme"  view-dark-colors       no-action)
+	   ("Light color scheme" view-light-colors      no-action)
+	 ))
 
 (define page-menu-items 
 ;;
diff --git a/gschem/src/g_keys.c b/gschem/src/g_keys.c
index 00608a0..838890d 100644
--- a/gschem/src/g_keys.c
+++ b/gschem/src/g_keys.c
@@ -297,6 +297,8 @@ DEFINE_G_KEYS(view_pan_up)
 DEFINE_G_KEYS(view_pan_down)
 DEFINE_G_KEYS(view_pan_hotkey)
 DEFINE_G_KEYS(view_update_cues)
+DEFINE_G_KEYS(view_dark_colors)
+DEFINE_G_KEYS(view_light_colors)
 DEFINE_G_KEYS(page_manager)
 DEFINE_G_KEYS(page_next)
 DEFINE_G_KEYS(page_prev)
diff --git a/gschem/src/g_register.c b/gschem/src/g_register.c
index 99145b3..fb710ed 100644
--- a/gschem/src/g_register.c
+++ b/gschem/src/g_register.c
@@ -237,6 +237,8 @@ static struct gsubr_t gschem_funcs[] = {
   { "view-pan-up",		 0, 0, 0, g_keys_view_pan_up },
   { "view-pan-down",		 0, 0, 0, g_keys_view_pan_down },
   { "view-update-cues",          0, 0, 0, g_keys_view_update_cues },
+  { "view-dark-colors",          0, 0, 0, g_keys_view_dark_colors },
+  { "view-light-colors",         0, 0, 0, g_keys_view_light_colors },
   { "page-manager",              0, 0, 0, g_keys_page_manager },
   { "page-next",                 0, 0, 0, g_keys_page_next },
   { "page-prev",                 0, 0, 0, g_keys_page_prev },
diff --git a/gschem/src/i_callbacks.c b/gschem/src/i_callbacks.c
index dd41528..30c8a3a 100644
--- a/gschem/src/i_callbacks.c
+++ b/gschem/src/i_callbacks.c
@@ -1597,6 +1597,40 @@ DEFINE_I_CALLBACK(view_update_cues)
   o_invalidate_all (w_current);
 }
 
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Description
+ *
+ */
+DEFINE_I_CALLBACK (view_dark_colors)
+{
+  GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
+
+  x_color_free ();
+  /* Change the scheme here */
+  g_scm_c_eval_string_protected ("(load (build-path geda-rc-path \"gschem-colormap-darkbg\"))");
+  x_color_allocate ();
+
+  o_invalidate_all (w_current);
+}
+
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Description
+ *
+ */
+DEFINE_I_CALLBACK (view_light_colors)
+{
+  GSCHEM_TOPLEVEL *w_current = (GSCHEM_TOPLEVEL*) data;
+
+  x_color_free ();
+  /* Change the scheme here */
+  g_scm_c_eval_string_protected ("(load (build-path geda-rc-path \"gschem-colormap-lightbg\"))");
+  x_color_allocate ();
+
+  o_invalidate_all (w_current);
+}
+
 /*! \section page-menu Page Menu Callback Functions */
 /*! \todo Finish function documentation!!!
  *  \brief
diff --git a/gschem/src/rcstrings.c b/gschem/src/rcstrings.c
index 514302e..2adaf26 100644
--- a/gschem/src/rcstrings.c
+++ b/gschem/src/rcstrings.c
@@ -68,6 +68,8 @@ _("Zoom Extents")
 _("Zoom In")
 _("Zoom Out")
 _("Zoom Full")
+_("Dark color scheme")
+_("Light color scheme")
 
 _("Page")
 _("Manager...")

commit 5031f6846f2ae9ec703bcdcd689ab4e0d87373c8
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:53:45 2008 +0000

    gschem: Fix x_color_free() and make it free the whole colour map
    
    The previous code would have caused breakage if it were executed,
    since gdk_colormap_free_colors expects to take a pointer to an
    array of GdkColor elements.

diff --git a/gschem/src/x_color.c b/gschem/src/x_color.c
index f91abe9..ca444db 100644
--- a/gschem/src/x_color.c
+++ b/gschem/src/x_color.c
@@ -62,10 +62,17 @@ x_color_init (void)
 void
 x_color_free (void)
 {
-  GdkColor *colors[] = { &black, &white };
+  int i;
 
-  gdk_colormap_free_colors (colormap, *colors, 2);
+  gdk_colormap_free_colors (colormap, &black, 1);
+  gdk_colormap_free_colors (colormap, &white, 1);
 
+  for (i = 0; i < MAX_COLORS; i++) {
+    if (display_colors[i].enabled)
+      gdk_colormap_free_colors (colormap, gdk_colors[i], 1);
+    if (display_outline_colors[i].enabled)
+      gdk_colormap_free_colors (colormap, gdk_outline_colors[i], 1);
+  }
 }
 
 /*! \todo Finish function documentation!!!

commit 94f3f4f753e255538d1376ab9a9b334d53f0be60
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:53:45 2008 +0000

    gschem: Move handling of the gdk colour map into x_color.c

diff --git a/gschem/include/globals.h b/gschem/include/globals.h
index 42817c6..52844a9 100644
--- a/gschem/include/globals.h
+++ b/gschem/include/globals.h
@@ -27,9 +27,6 @@ extern GSCHEM_TOPLEVEL *global_window_current;
 /* window list */
 extern GList *global_window_list;
 
-/* color stuff */
-extern GdkColormap *colormap; 
-
 /* colors */
 extern GdkColor white;
 extern GdkColor black;
diff --git a/gschem/src/globals.c b/gschem/src/globals.c
index f9bd90d..54278b8 100644
--- a/gschem/src/globals.c
+++ b/gschem/src/globals.c
@@ -40,9 +40,6 @@ char *rc_filename     = NULL;
 char *script_filename = NULL;
 char *output_filename = NULL;
 
-/* color stuff */
-GdkColormap *colormap;
-
 /* colors */
 GdkColor white;
 GdkColor black;
diff --git a/gschem/src/gschem.c b/gschem/src/gschem.c
index 9c58d37..1c3122a 100644
--- a/gschem/src/gschem.c
+++ b/gschem/src/gschem.c
@@ -267,7 +267,6 @@ void main_prog(void *closure, int argc, char *argv[])
   x_window_set_default_icon();
 
   /* At end, complete set up of window. */
-  colormap = gdk_colormap_get_system ();
   x_color_allocate();
   x_window_setup (w_current);
 
diff --git a/gschem/src/x_color.c b/gschem/src/x_color.c
index 3666b46..f91abe9 100644
--- a/gschem/src/x_color.c
+++ b/gschem/src/x_color.c
@@ -37,6 +37,8 @@ COLOR display_outline_colors[MAX_COLORS];
 static GdkColor* gdk_colors[MAX_COLORS];
 static GdkColor* gdk_outline_colors[MAX_COLORS];
 
+static GdkColormap *colormap = NULL;
+
 /*! \brief Initializes the color system for the application.
  *  \par Function Documentation
  *
@@ -45,6 +47,8 @@ static GdkColor* gdk_outline_colors[MAX_COLORS];
 void
 x_color_init (void)
 {
+  colormap = gdk_colormap_get_system ();
+
   /* Initialise default color maps */
   s_color_map_defaults (display_colors);
   s_color_map_defaults (display_outline_colors);

commit 714580df3fee12732d5e1180722f008a47aaf973
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:53:42 2008 +0000

    gschem: Don't define key-bindings for keys which have no-action
    
    If we do this, then when we set "no-action" to a menu item's key binding,
    the code will try to display one of the keys associated with "no-action"
    as a binding for that menu item.

diff --git a/gnetlist/examples/vams/gschemrc b/gnetlist/examples/vams/gschemrc
index f1bfb49..cb814e2 100644
--- a/gnetlist/examples/vams/gschemrc
+++ b/gnetlist/examples/vams/gschemrc
@@ -19,14 +19,11 @@
     ("g" . gnetlist-keymap)
     ("h" . help-keymap)
     ("i" . add-component)
-    ("j" . no-action)
-    ("k" . no-action)
     ("l" . add-line-hotkey) 
     ("m" . edit-move-hotkey)
     ("n" . add-net-hotkey)
     ("o" . options-keymap)
     ("p" . page-keymap)
-    ("q" . no-action)
     ("r" . view-redraw)
     ("s" . edit-select)
     ("t" . attributes-keymap)
diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in
index 3f9d34c..d4464b1 100644
--- a/gschem/lib/system-gschemrc.in
+++ b/gschem/lib/system-gschemrc.in
@@ -1329,11 +1329,8 @@
     ("d" . edit-delete)
     ("e" . edit-keymap)
     ("f" . file-keymap)
-    ("g" . no-action)
     ("h" . help-keymap)
     ("i" . add-component)
-    ("j" . no-action)
-    ("k" . no-action)
     ("l" . add-line-hotkey) 
     ("m" . edit-move-hotkey)
     ("n" . add-net-hotkey)
@@ -1341,7 +1338,6 @@
     ("bracketright" . options-scale-up-snap-size)
     ("bracketleft" . options-scale-down-snap-size)
     ("p" . page-keymap)
-    ("q" . no-action)
     ("r" . view-redraw)
     ("s" . edit-select)
     ("t" . attributes-keymap)

commit 826676196547f44c7923e4103a0789c1e1be63ca
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Fri Dec 26 21:42:55 2008 +0000

    gschem: Remove a few unused variables from x_menus.c
    
    Removed some an debugging printf as well, which printed them.

diff --git a/gschem/src/x_menus.c b/gschem/src/x_menus.c
index 649aa85..e2c38a7 100644
--- a/gschem/src/x_menus.c
+++ b/gschem/src/x_menus.c
@@ -104,7 +104,7 @@ void get_main_menu(GtkWidget ** menubar)
   char *menu_item_keys;
   char *spaces;
   int i, j;
-  int name_len, key_len, pad;
+  int pad;
   int sum, diff, max_size, space_size;
   PangoLayout *layout;
   int name_width, keys_width;
@@ -164,9 +164,6 @@ void get_main_menu(GtkWidget ** menubar)
           menu_item_keys = g_strdup (SCM_STRING_CHARS (scm_keys));
         }      
 
-        name_len = strlen(menu_item_name);
-        key_len = strlen(menu_item_keys);
-
         layout = gtk_widget_create_pango_layout(menu, menu_item_name);
         pango_layout_get_pixel_size(layout, &name_width, NULL);
         g_object_unref(layout);
@@ -186,11 +183,6 @@ void get_main_menu(GtkWidget ** menubar)
         spaces = g_strnfill (pad, ' ');
         buf = g_strdup_printf("%s%s%s", menu_item_name, spaces, menu_item_keys);
 
-#if DEBUG
-        printf("%s :\n %d %d %d = %d\n", buf, name_len, pad, key_len,
-               name_len + pad + key_len);
-#endif
-      
         menu_item = gtk_menu_item_new_with_label(buf);
 	g_free(buf);
         gtk_menu_append(GTK_MENU(menu), menu_item);




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