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

gEDA-cvs: gaf.git: branch: master updated (1.5.1-20081221-20-gc08a776)



The branch, master has been updated
       via  c08a776a0a68a9bc89ca17089120db305fda6167 (commit)
      from  5453f2680e45dd3f2ffde73f442ba18a6a180437 (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
=========

 gschem/include/prototype.h |    2 ++
 gschem/src/x_color.c       |   34 ++++++++++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)


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

commit c08a776a0a68a9bc89ca17089120db305fda6167
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:34:29 2008 +0000

    gschem: Expose accessors to get the COLOUR for a given colour index.

:100644 100644 2280868... 4fd5128... M	gschem/include/prototype.h
:100644 100644 bb83ec4... 3666b46... M	gschem/src/x_color.c

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

commit c08a776a0a68a9bc89ca17089120db305fda6167
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Mon Dec 22 19:34:29 2008 +0000

    gschem: Expose accessors to get the COLOUR for a given colour index.

diff --git a/gschem/include/prototype.h b/gschem/include/prototype.h
index 2280868..4fd5128 100644
--- a/gschem/include/prototype.h
+++ b/gschem/include/prototype.h
@@ -724,6 +724,8 @@ void x_color_free (void);
 void x_color_allocate (void);
 GdkColor *x_get_color(int color);
 GdkColor *x_get_darkcolor(int color);
+COLOR *x_color_lookup(int color);
+COLOR *x_color_lookup_dark(int color);
 gchar *x_color_get_name(int index);
 gboolean x_color_display_enabled (int index);
 /* x_dialog.c */
diff --git a/gschem/src/x_color.c b/gschem/src/x_color.c
index bb83ec4..3666b46 100644
--- a/gschem/src/x_color.c
+++ b/gschem/src/x_color.c
@@ -191,6 +191,40 @@ GdkColor *x_get_darkcolor(int color)
  *  \par Function Documentation
  *
  */
+COLOR *x_color_lookup (int color)
+{
+  if (color < 0 || color >= MAX_COLORS ||
+      !display_colors[color].enabled) {
+    fprintf(stderr, _("Tried to get an invalid color: %d\n"), color);
+    return &display_colors[DEFAULT_COLOR];
+  } else {
+    return &display_colors[color];
+  }
+}
+
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Documentation
+ *
+ *  \todo this has to change... to the right code
+ */
+COLOR *x_color_lookup_dark (int color)
+{
+  if (color < 0 || color >= MAX_COLORS ||
+      !display_outline_colors[color].enabled) {
+    g_warning (_("Tried to get an invalid outline color: %d\n"), color);
+    return &display_outline_colors[DEFAULT_COLOR];
+  } else {
+    return &display_outline_colors[color];
+  }
+
+}
+
+/*! \todo Finish function documentation!!!
+ *  \brief
+ *  \par Function Documentation
+ *
+ */
 gchar *x_color_get_name(int index)
 {
   COLOR c;




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