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

gEDA-cvs: pcb.git: branch: master updated (9d40aaacebbdeaff69be5e28bbd2a186bd6bd304)



The branch, master has been updated
       via  9d40aaacebbdeaff69be5e28bbd2a186bd6bd304 (commit)
       via  bf4c0a5374ddaf8bed791daa18c7b628fb74d74a (commit)
       via  bf2ec895800b351c2df2bebb27c6c2860b26b66f (commit)
       via  9d69c8ef2d0e6f2ce6dc8aec36151ba5785415d4 (commit)
       via  9eaf239092644e3176bba20cb532ea26cfccbb08 (commit)
      from  ac0c3a203fc29adbf4e9e01faa86bd7b8ff2ea51 (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
=========

 src/flags.c                                    |    4 +-
 src/hid/gtk/gtk-pcb-cell-renderer-visibility.c |   10 ++
 src/hid/gtk/gtk-pcb-coord-entry.c              |   33 ++++++++
 src/hid/gtk/gtk-pcb-layer-selector.c           |    5 +-
 src/hid/gtk/gui-config.c                       |    1 -
 src/hid/gtk/gui-top-window.c                   |    1 -
 src/pcb-printf.c                               |  106 ++++++++++++++++++++++--
 7 files changed, 148 insertions(+), 12 deletions(-)


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

commit 9d40aaacebbdeaff69be5e28bbd2a186bd6bd304
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    gtk: remove call to ghid_layer_buttons_color_update
    
    The call to ghid_layer_buttons_color_update() in config_read()
    is now unnecessary; the Gtk layer selection widget does not
    exist, nor do the PCB struct's colors need to be synced with
    the ones in the Settings struct.
    
    So this call makes no sense. Oh, and it causes a segfault.
    
    Also: remove color-changing debug code from gui-top-window.c

:100644 100644 f44fa25... 215f16a... M	src/hid/gtk/gui-config.c
:100644 100644 001d2ca... 8dc10b7... M	src/hid/gtk/gui-top-window.c

commit bf4c0a5374ddaf8bed791daa18c7b628fb74d74a
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Add doxygen comments to gtk-pcb-coord-entry.c
    
    No code changes.

:100644 100644 83dcaa0... 233dc9b... M	src/hid/gtk/gtk-pcb-coord-entry.c

commit bf2ec895800b351c2df2bebb27c6c2860b26b66f
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Add doxygen comments to gtk-pcb-cell-renderer-visibility.c
    
    Also fix the file description for gtk-pcb-layer-selector.c.
    No code changes.

:100644 100644 8f6d669... 5824adb... M	src/hid/gtk/gtk-pcb-cell-renderer-visibility.c
:100644 100644 519ec50... b2b30e5... M	src/hid/gtk/gtk-pcb-layer-selector.c

commit 9d69c8ef2d0e6f2ce6dc8aec36151ba5785415d4
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Add doxygen comments to pcb-printf.c
    
    No code changes.

:100644 100644 422b761... 88c98ee... M	src/pcb-printf.c

commit 9eaf239092644e3176bba20cb532ea26cfccbb08
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Fix const-correctness warning in flags.c

:100644 100644 954d94a... de77b68... M	src/flags.c

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

commit 9d40aaacebbdeaff69be5e28bbd2a186bd6bd304
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    gtk: remove call to ghid_layer_buttons_color_update
    
    The call to ghid_layer_buttons_color_update() in config_read()
    is now unnecessary; the Gtk layer selection widget does not
    exist, nor do the PCB struct's colors need to be synced with
    the ones in the Settings struct.
    
    So this call makes no sense. Oh, and it causes a segfault.
    
    Also: remove color-changing debug code from gui-top-window.c

diff --git a/src/hid/gtk/gui-config.c b/src/hid/gtk/gui-config.c
index f44fa25..215f16a 100644
--- a/src/hid/gtk/gui-config.c
+++ b/src/hid/gtk/gui-config.c
@@ -506,7 +506,6 @@ config_colors_read (gchar * path)
     }
   fclose (f);
 
-  ghid_layer_buttons_color_update ();
   return TRUE;
 }
 
diff --git a/src/hid/gtk/gui-top-window.c b/src/hid/gtk/gui-top-window.c
index 001d2ca..8dc10b7 100644
--- a/src/hid/gtk/gui-top-window.c
+++ b/src/hid/gtk/gui-top-window.c
@@ -1033,7 +1033,6 @@ get_layer_color (gint layer)
 void
 ghid_layer_buttons_color_update (void)
 {
-  printf ("UPDATE COLORS\n");
   gtk_pcb_layer_selector_update_colors
     (GTK_PCB_LAYER_SELECTOR (ghidgui->layer_selector), get_layer_color);
   pcb_colors_from_settings (PCB);

commit bf4c0a5374ddaf8bed791daa18c7b628fb74d74a
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Add doxygen comments to gtk-pcb-coord-entry.c
    
    No code changes.

diff --git a/src/hid/gtk/gtk-pcb-coord-entry.c b/src/hid/gtk/gtk-pcb-coord-entry.c
index 83dcaa0..233dc9b 100644
--- a/src/hid/gtk/gtk-pcb-coord-entry.c
+++ b/src/hid/gtk/gtk-pcb-coord-entry.c
@@ -1,3 +1,14 @@
+/*! \file <gtk-pcb-coord-entry.c>
+ *  \brief Implementation of GtkPcbCoordEntry widget
+ *  \par Description
+ *  This widget is a modified spinbox for the user to enter
+ *  pcb coords. It is assigned a default unit (for display),
+ *  but this can be changed by the user by typing a new one
+ *  or right-clicking on the box.
+ *
+ *  Internally, it keeps track of its value in pcb coords.
+ *  From the user's perspective, it uses natural human units.
+ */
 
 #include <glib.h>
 #include <glib-object.h>
@@ -36,6 +47,7 @@ struct _GtkPcbCoordEntryClass
 };
 
 /* SIGNAL HANDLERS */
+/*! \brief Callback for "Change Unit" menu click */
 static void
 menu_item_activate_cb (GtkMenuItem *item, GtkPcbCoordEntry *ce)
 {
@@ -45,6 +57,7 @@ menu_item_activate_cb (GtkMenuItem *item, GtkPcbCoordEntry *ce)
   g_signal_emit (ce, gtk_pcb_coord_entry_signals[UNIT_CHANGE_SIGNAL], 0, unit);
 }
 
+/*! \brief Callback for context menu creation */
 static void
 gtk_pcb_coord_entry_popup_cb (GtkPcbCoordEntry *ce, GtkMenu *menu, gpointer data)
 {
@@ -77,6 +90,7 @@ gtk_pcb_coord_entry_popup_cb (GtkPcbCoordEntry *ce, GtkMenu *menu, gpointer data
   gtk_widget_show (menu_item);
 }
 
+/*! \brief Callback for user output */
 static gboolean
 gtk_pcb_coord_entry_output_cb (GtkPcbCoordEntry *ce, gpointer data)
 {
@@ -91,6 +105,7 @@ gtk_pcb_coord_entry_output_cb (GtkPcbCoordEntry *ce, gpointer data)
   return TRUE;
 }
 
+/*! \brief Callback for user input */
 static gboolean
 gtk_pcb_coord_text_changed_cb (GtkPcbCoordEntry *entry, gpointer data)
 {
@@ -112,6 +127,7 @@ gtk_pcb_coord_text_changed_cb (GtkPcbCoordEntry *entry, gpointer data)
   return FALSE;
 }
 
+/*! \brief Callback for change in value (input or ^v clicks) */
 static gboolean
 gtk_pcb_coord_value_changed_cb (GtkPcbCoordEntry *ce, gpointer data)
 {
@@ -126,6 +142,11 @@ gtk_pcb_coord_value_changed_cb (GtkPcbCoordEntry *ce, gpointer data)
   return FALSE;
 }
 
+/*! \brief Change the unit used by a coord entry
+ *
+ *  \param [in] ce         The entry to be acted on
+ *  \parin [in] new_unit   The new unit to be used
+ */
 static void
 gtk_pcb_coord_entry_change_unit (GtkPcbCoordEntry *ce, const Unit *new_unit)
 {
@@ -215,6 +236,16 @@ gtk_pcb_coord_entry_get_type (void)
   return ce_type;
 }
 
+/*! \brief Create a new GtkPcbCoordEntry
+ *
+ *  \param [in] min_val    The minimum allowed value, in pcb coords
+ *  \param [in] max_val    The maximum allowed value, in pcb coords
+ *  \param [in] value      The default value, in pcb coords
+ *  \param [in] unit       The default unit
+ *  \param [in] step_size  How large the default increments should be
+ *
+ *  \return a freshly-allocated GtkPcbCoordEntry
+ */
 GtkWidget *
 gtk_pcb_coord_entry_new (Coord min_val, Coord max_val, Coord value,
                          const Unit *unit, enum ce_step_size step_size)
@@ -264,12 +295,14 @@ gtk_pcb_coord_entry_new (Coord min_val, Coord max_val, Coord value,
   return GTK_WIDGET (ce);
 }
 
+/*! \brief Gets a GtkPcbCoordEntry's value, in pcb coords */
 Coord
 gtk_pcb_coord_entry_get_value (GtkPcbCoordEntry *ce)
 {
   return ce->value;
 }
 
+/*! \brief Sets a GtkPcbCoordEntry's value, in pcb coords */
 void
 gtk_pcb_coord_entry_set_value (GtkPcbCoordEntry *ce, Coord val)
 {

commit bf2ec895800b351c2df2bebb27c6c2860b26b66f
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Add doxygen comments to gtk-pcb-cell-renderer-visibility.c
    
    Also fix the file description for gtk-pcb-layer-selector.c.
    No code changes.

diff --git a/src/hid/gtk/gtk-pcb-cell-renderer-visibility.c b/src/hid/gtk/gtk-pcb-cell-renderer-visibility.c
index 8f6d669..5824adb 100644
--- a/src/hid/gtk/gtk-pcb-cell-renderer-visibility.c
+++ b/src/hid/gtk/gtk-pcb-cell-renderer-visibility.c
@@ -1,3 +1,10 @@
+/*! \file <gtk-pcb-cell-render-visibility.c>
+ *  \brief Implementation of GtkCellRenderer for layer visibility toggler
+ *  \par More Information
+ *  For details on the functions implemented here, see the Gtk
+ *  documentation for the GtkCellRenderer object, which defines
+ *  the interface we are implementing.
+ */
 
 #include <glib.h>
 #include <glib-object.h>
@@ -35,6 +42,7 @@ struct _GtkPcbCellRendererVisibilityClass
 };
 
 /* RENDERER FUNCTIONS */
+/*! \brief Calculates the window area the renderer will use */
 static void
 gtk_pcb_cell_renderer_visibility_get_size (GtkCellRenderer *cell,
                                            GtkWidget       *widget,
@@ -69,6 +77,7 @@ gtk_pcb_cell_renderer_visibility_get_size (GtkCellRenderer *cell,
     }
 }
 
+/*! \brief Actually renders the swatch */
 static void
 gtk_pcb_cell_renderer_visibility_render (GtkCellRenderer      *cell,
                                          GdkWindow            *window,
@@ -144,6 +153,7 @@ gtk_pcb_cell_renderer_visibility_render (GtkCellRenderer      *cell,
     }
 }
 
+/*! \brief Toggless the swatch */
 static gint
 gtk_pcb_cell_renderer_visibility_activate (GtkCellRenderer      *cell,
                                            GdkEvent             *event,
diff --git a/src/hid/gtk/gtk-pcb-layer-selector.c b/src/hid/gtk/gtk-pcb-layer-selector.c
index 519ec50..b2b30e5 100644
--- a/src/hid/gtk/gtk-pcb-layer-selector.c
+++ b/src/hid/gtk/gtk-pcb-layer-selector.c
@@ -1,7 +1,10 @@
 /*! \file <gtk-pcb-layer-selector.c>
  *  \brief Implementation of GtkPcbLayerSelector widget
  *  \par Description
- *  This widget is used for
+ *  This widget is the layer selector on the left side of the Gtk
+ *  GUI. It also describes (in XML) the relevant sections of the
+ *  menu for layer selection and visibility toggling, and makes
+ *  sure these stay in sync.
  */
 
 #include <glib.h>

commit 9d69c8ef2d0e6f2ce6dc8aec36151ba5785415d4
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Add doxygen comments to pcb-printf.c
    
    No code changes.

diff --git a/src/pcb-printf.c b/src/pcb-printf.c
index 422b761..88c98ee 100644
--- a/src/pcb-printf.c
+++ b/src/pcb-printf.c
@@ -24,6 +24,13 @@
  *
  */
 
+/*! \file <pcb-printf.c>
+ *  \brief Implementation of printf wrapper to output pcb coords and angles
+ *  \par Description
+ *  For details of all supported specifiers, see the comment at the
+ *  top of pcb-printf.h
+ */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -74,8 +81,12 @@ static Unit Units[] = {
                { "pcb" } }
 };
 #define N_UNITS ((int) (sizeof Units / sizeof Units[0]))
-/* The function is needed to avoid "non-constant initializer"
- *  errors on the internationalized unit suffixes. */
+/* \brief Initialize non-static data for pcb-printf
+ * \par Function Description
+ * Assigns each unit its index for quick access through the
+ * main units array, and internationalize the units for GUI
+ * display.
+ */
 void initialize_units()
 {
   int i;
@@ -85,6 +96,7 @@ void initialize_units()
       Units[i].in_suffix = _(Units[i].suffix);
     }
 }
+
 /* This list -must- contain all printable units from the above list */
 /* For now I have just copy/pasted the same values for all metric
  * units and the same values for all imperial ones */
@@ -135,7 +147,16 @@ static Increments increments[] = {
 };
 #define N_INCREMENTS (sizeof increments / sizeof increments[0])
 
-/* Obtain a unit object from its (non-international) suffix */
+/* \brief Obtain a unit object from its suffix
+ * \par Function Description
+ * Looks up a given suffix in the main units array. Internationalized
+ * unit suffixes are not supported, though pluralized units are, for
+ * backward-compatibility.
+ *
+ * \param [in] const_suffix   The suffix to look up
+ *
+ * \return A const pointer to the Unit struct, or NULL if none was found
+ */
 const Unit *get_unit_struct (const char *const_suffix)
 {
   int i;
@@ -174,16 +195,26 @@ const Unit *get_unit_struct (const char *const_suffix)
 }
 
 /* ACCESSORS */
+/* \brief Returns the master unit list. This may not be modified. */
 const Unit *get_unit_list (void)
 {
 	return Units;
 }
+/* \brief Returns the length of the master unit list. */
 int get_n_units (void)
 {
 	return N_UNITS;
 }
 
-/* Obtain a increment object from its (non-international) suffix */
+/* \brief Obtain an increment object from its suffix
+ * \par Function Description
+ * Looks up a given suffix in the main increments array. Internationalized
+ * unit suffixes are not supported, nor are pluralized units.
+ *
+ * \param [in] suffix   The suffix to look up
+ *
+ * \return A const pointer to the Increments struct, or NULL if none was found
+ */
 Increments *get_increments_struct (const char *suffix)
 {
   int i;
@@ -194,7 +225,13 @@ Increments *get_increments_struct (const char *suffix)
   return NULL;
 }
 
-/* Scale factor lookup functions for Unit[] table */
+/* \brief Convert a pcb coord to the given unit
+ *
+ * \param [in] unit  The unit to convert to
+ * \param [in] x     The quantity to convert
+ *
+ * \return The converted measure
+ */
 double coord_to_unit (const Unit *unit, Coord x)
 {
   double base;
@@ -206,6 +243,13 @@ double coord_to_unit (const Unit *unit, Coord x)
   return x * unit->scale_factor * base;
 }
 
+/* \brief Convert a given unit to pcb coords
+ *
+ * \param [in] unit  The unit to convert from
+ * \param [in] x     The quantity to convert
+ *
+ * \return The converted measure
+ */
 Coord unit_to_coord (const Unit *unit, double x)
 {
   return x / coord_to_unit (unit, 1);
@@ -227,10 +271,21 @@ static int min_sig_figs(double d)
   return rv;
 }
 
-/* Converts a (group of) measurement(s) to a comma-deliminated
+/* \brief Internal coord-to-string converter for pcb-printf
+ * \par Function Description
+ * Converts a (group of) measurement(s) to a comma-deliminated
  * string, with appropriate units. If more than one coord is
  * given, the list is enclosed in parens to make the scope of
- * the unit suffix clear.  */
+ * the unit suffix clear.
+ *
+ * \param [in] coord        Array of coords to convert
+ * \param [in] n_coords     Number of coords in array
+ * \param [in] printf_spec  printf sub-specifier to use with %f
+ * \param [in] e_allow      Bitmap of units the function may use
+ * \param [in] suffix_type  Whether to add a suffix
+ *
+ * \return A string containing the formatted coords. Must be freed with g_free.
+ */
 static gchar *CoordsToString(Coord coord[], int n_coords, const char *printf_spec, enum e_allow allow, enum e_suffix suffix_type)
 {
   GString *buff;
@@ -368,6 +423,17 @@ static gchar *CoordsToString(Coord coord[], int n_coords, const char *printf_spe
   return g_string_free (buff, FALSE);
 }
 
+/* \brief Main pcb-printf function
+ * \par Function Description
+ * This is a printf wrapper that accepts new format specifiers to
+ * output pcb coords as various units. See the comment at the top
+ * of pcb-printf.h for full details.
+ *
+ * \param [in] fmt    Format specifier
+ * \param [in] args   Arguments to specifier
+ *
+ * \return A formatted string. Must be freed with g_free.
+ */
 gchar *pcb_vprintf(const char *fmt, va_list args)
 {
   GString *string = g_string_new ("");
@@ -547,6 +613,13 @@ gchar *pcb_vprintf(const char *fmt, va_list args)
 }
 
 
+/* \brief Wrapper for pcb_vprintf that outputs to a string
+ *
+ * \param [in] string  Pointer to string to output into
+ * \param [in] fmt     Format specifier
+ *
+ * \return The length of the written string
+ */
 int pcb_sprintf(char *string, const char *fmt, ...)
 {
   gchar *tmp;
@@ -562,6 +635,13 @@ int pcb_sprintf(char *string, const char *fmt, ...)
   return strlen (string);
 }
 
+/* \brief Wrapper for pcb_vprintf that outputs to a file
+ *
+ * \param [in] fh   File to output to
+ * \param [in] fmt  Format specifier
+ *
+ * \return The length of the written string
+ */
 int pcb_fprintf(FILE *fh, const char *fmt, ...)
 {
   int rv;
@@ -583,6 +663,12 @@ int pcb_fprintf(FILE *fh, const char *fmt, ...)
   return rv;
 }
 
+/* \brief Wrapper for pcb_vprintf that outputs to stdout
+ *
+ * \param [in] fmt  Format specifier
+ *
+ * \return The length of the written string
+ */
 int pcb_printf(const char *fmt, ...)
 {
   int rv;
@@ -599,6 +685,12 @@ int pcb_printf(const char *fmt, ...)
   return rv;
 }
 
+/* \brief Wrapper for pcb_vprintf that outputs to a newly allocated string
+ *
+ * \param [in] fmt  Format specifier
+ *
+ * \return The newly allocated string. Must be freed with g_free.
+ */
 char *pcb_g_strdup_printf(const char *fmt, ...)
 {
   gchar *tmp;

commit 9eaf239092644e3176bba20cb532ea26cfccbb08
Author: Andrew Poelstra <asp11@xxxxxx>
Commit: Andrew Poelstra <asp11@xxxxxx>

    Fix const-correctness warning in flags.c

diff --git a/src/flags.c b/src/flags.c
index 954d94a..de77b68 100644
--- a/src/flags.c
+++ b/src/flags.c
@@ -74,7 +74,7 @@ FlagGridSize (int dummy)
 static int
 FlagUnitsMm (int dummy)
 {
-  static Unit *u = NULL;
+  static const Unit *u = NULL;
   if (u == NULL)
     u = get_unit_struct ("mm");
   return (Settings.grid_unit == u);
@@ -83,7 +83,7 @@ FlagUnitsMm (int dummy)
 static int
 FlagUnitsMil (int dummy)
 {
-  static Unit *u = NULL;
+  static const Unit *u = NULL;
   if (u == NULL)
     u = get_unit_struct ("mil");
   return (Settings.grid_unit == u);




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