From 8e19b5509a40826aeacd6b43efa35403f13763f8 Mon Sep 17 00:00:00 2001 From: Peter Clifton Date: Fri, 2 Apr 2010 16:55:25 +0100 Subject: [PATCH] gschem: Introduce B/W colour scheme --- gschem/include/prototype.h | 2 ++ gschem/lib/Makefile.am | 4 +-- gschem/lib/gschem-colormap-bw | 69 +++++++++++++++++++++++++++++++++++++++++++ gschem/lib/system-gschemrc.in | 3 ++ gschem/src/g_keys.c | 1 + gschem/src/g_register.c | 1 + gschem/src/i_callbacks.c | 17 +++++++++++ gschem/src/rcstrings.c | 1 + 8 files changed, 96 insertions(+), 2 deletions(-) create mode 100644 gschem/lib/gschem-colormap-bw diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h index cffe84d69..5948c748f 100644 --- a/gschem/include/prototype.h +++ b/gschem/include/prototype.h @@ -135,6 +135,7 @@ SCM g_keys_view_pan_down(SCM rest); SCM g_keys_view_pan_hotkey(SCM rest); SCM g_keys_view_dark_colors(SCM rest); SCM g_keys_view_light_colors(SCM rest); +SCM g_keys_view_bw_colors(SCM rest); SCM g_keys_page_manager(SCM rest); SCM g_keys_page_next(SCM rest); SCM g_keys_page_prev(SCM rest); @@ -370,6 +371,7 @@ void i_callback_view_pan_down(gpointer data, guint callback_action, GtkWidget *w void i_callback_view_pan_hotkey(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_view_bw_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/Makefile.am b/gschem/lib/Makefile.am index 1f1bc15a2..37dd5dbff 100644 --- a/gschem/lib/Makefile.am +++ b/gschem/lib/Makefile.am @@ -1,8 +1,8 @@ rcdatadir = $(GEDARCDIR) -rcdata_DATA = system-gschemrc gschem-gtkrc gschem-colormap-lightbg gschem-colormap-darkbg +rcdata_DATA = system-gschemrc gschem-gtkrc gschem-colormap-lightbg gschem-colormap-darkbg gschem-colormap-bw -EXTRA_DIST = system-gschemrc.in gschem-gtkrc gschem-colormap-lightbg gschem-colormap-darkbg +EXTRA_DIST = system-gschemrc.in gschem-gtkrc gschem-colormap-lightbg gschem-colormap-darkbg gschem-colormap-bw MOSTLYCLEANFILES = *.log *~ CLEANFILES = *.log *~ diff --git a/gschem/lib/gschem-colormap-bw b/gschem/lib/gschem-colormap-bw new file mode 100644 index 000000000..179fd4ba8 --- /dev/null +++ b/gschem/lib/gschem-colormap-bw @@ -0,0 +1,69 @@ +; -*-Scheme-*- +; +; Light background color map for gschem +; + +; ;'s are comments +; Keywords are case sensitive (guile feature) +; Colors are not case sensitive +; + +; Colors may be specified in "#RRGGBB" or "#RRGGBBAA" format. If the alpha +; value is not specified, full opacity is assumed. +; +; If a color is #f (not a string; Scheme 'false'), then objects of +; that color will never be drawn. + +(display-color-map + '((background "#f0f0f0") + (pin "#000000") + (net-endpoint "#ff0000") + (graphic "#000000") + (net "#000000") + (attribute "#000000") + (logic-bubble "#000000") + (dots-grid "#7f7f7f") + (mesh-grid-major "#e1e1e1") + (mesh-grid-minor "#e8e8e8") + (detached-attribute "#ff0000") + (text "#000000") + (bus "#000000") + (select "#b22222") + (bounding-box "#ffa500") + (stroke "#a020f0") + (zoom-box "#008b8b") + (lock "#666666") + (output-background #f) + (junction "#000000") + (freestyle1 #f) + (freestyle2 #f) + (freestyle3 #f) + (freestyle4 #f) + )) + +(display-outline-color-map + '((background "#f0f0f0") + (pin "#4d4d4d") + (net-endpoint "#cdcdcd") + (graphic "#008b00") + (net "#0000cd") + (attribute "#4d4d4d") + (logic-bubble "#008b8b") + (dots-grid #f) + (mesh-grid-major #f) + (mesh-grid-minor #f) + (detached-attribute "#cd0000") + (text "#008b00") + (bus "#00cd00") + (select "#b22222") + (bounding-box "#ffa500") + (zoom-box "#008b8b") + (stroke "#a020f0") + (lock "#a9a9a9") + (output-background #f) + (junction "#7e26cd") + (freestyle1 #f) + (freestyle2 #f) + (freestyle3 #f) + (freestyle4 #f) + )) diff --git a/gschem/lib/system-gschemrc.in b/gschem/lib/system-gschemrc.in index 0f660c587..2b31b7d3a 100644 --- a/gschem/lib/system-gschemrc.in +++ b/gschem/lib/system-gschemrc.in @@ -32,6 +32,7 @@ ; (load (build-path geda-rc-path "gschem-colormap-darkbg")) ; dark background ;(load (build-path geda-rc-path "gschem-colormap-lightbg")) ; light background +;(load (build-path geda-rc-path "gschem-colormap-bw")) ; light background, bw ; ; End of color section @@ -1215,6 +1216,7 @@ ("i" . view-zoom-in-hotkey) ("d" . view-dark-colors) ("l" . view-light-colors) + ("w" . view-bw-colors) )) (define buffer-keymap @@ -1454,6 +1456,7 @@ ("SEPARATOR" #f #f #f) ("_Dark color scheme" view-dark-colors view-dark-colors #f) ("_Light color scheme" view-light-colors view-light-colors #f) + ("B_W color scheme" view-bw-colors view-bw-colors #f) )) (define page-menu-items diff --git a/gschem/src/g_keys.c b/gschem/src/g_keys.c index 7a1ef092a..67c46be67 100644 --- a/gschem/src/g_keys.c +++ b/gschem/src/g_keys.c @@ -304,6 +304,7 @@ DEFINE_G_KEYS(view_pan_down) DEFINE_G_KEYS(view_pan_hotkey) DEFINE_G_KEYS(view_dark_colors) DEFINE_G_KEYS(view_light_colors) +DEFINE_G_KEYS(view_bw_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 987b89827..19f792017 100644 --- a/gschem/src/g_register.c +++ b/gschem/src/g_register.c @@ -239,6 +239,7 @@ static struct gsubr_t gschem_funcs[] = { { "view-pan-down", 0, 0, 0, g_keys_view_pan_down }, { "view-dark-colors", 0, 0, 0, g_keys_view_dark_colors }, { "view-light-colors", 0, 0, 0, g_keys_view_light_colors }, + { "view-bw-colors", 0, 0, 0, g_keys_view_bw_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 09c4057af..bcc3525a2 100644 --- a/gschem/src/i_callbacks.c +++ b/gschem/src/i_callbacks.c @@ -1578,6 +1578,23 @@ DEFINE_I_CALLBACK (view_light_colors) o_invalidate_all (w_current); } +/*! \todo Finish function documentation!!! + * \brief + * \par Function Description + * + */ +DEFINE_I_CALLBACK (view_bw_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-bw\"))"); + 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 8c6bb23b9..18dc517a6 100644 --- a/gschem/src/rcstrings.c +++ b/gschem/src/rcstrings.c @@ -70,6 +70,7 @@ _("Zoom _Out") _("Zoom _Full") _("_Dark color scheme") _("_Light color scheme") +_("B_W color scheme") _("_Page") _("_Manager...") -- 2.11.4.GIT