~centralelyon2010/inkscape/imagelinks2

« back to all changes in this revision

Viewing changes to src/sp-namedview.cpp

  • Committer: kidproto
  • Date: 2006-08-25 07:03:19 UTC
  • Revision ID: kidproto@users.sourceforge.net-20060825070319-49nso3fdlwuveifv
peeled back the gboolean code as it hit on some complexity theory principles...
need to rethink and incrementally change gbooleans to bools

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
static void sp_namedview_setup_grid(SPNamedView * nv);
58
58
static void sp_namedview_setup_grid_item(SPNamedView * nv, SPCanvasItem * item);
59
59
 
60
 
static bool sp_str_to_bool(const gchar *str);
61
 
static bool sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit);
62
 
static bool sp_nv_read_opacity(const gchar *str, guint32 *color);
 
60
static gboolean sp_str_to_bool(const gchar *str);
 
61
static gboolean sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit);
 
62
static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color);
63
63
 
64
64
static SPObjectGroupClass * parent_class;
65
65
 
687
687
    NR::Rect const r = desktop->get_display_area();
688
688
 
689
689
    // saving window geometry is not undoable
690
 
    bool saved = sp_document_get_undo_sensitive(sp_desktop_document(desktop));
 
690
    gboolean saved = sp_document_get_undo_sensitive(sp_desktop_document(desktop));
691
691
    sp_document_set_undo_sensitive(sp_desktop_document(desktop), FALSE);
692
692
 
693
693
    sp_repr_set_svg_double(view, "inkscape:zoom", desktop->current_zoom());
734
734
    gridviews = g_slist_remove(gridviews, l->data);
735
735
}
736
736
 
737
 
void SPNamedView::activateGuides(gpointer desktop, bool active)
 
737
void SPNamedView::activateGuides(gpointer desktop, gboolean active)
738
738
{
739
739
    g_assert(desktop != NULL);
740
740
    g_assert(g_slist_find(views, desktop));
771
771
        v = !v;
772
772
    }
773
773
 
774
 
    bool saved = sp_document_get_undo_sensitive(doc);
 
774
    gboolean saved = sp_document_get_undo_sensitive(doc);
775
775
    sp_document_set_undo_sensitive(doc, FALSE);
776
776
 
777
777
    sp_repr_set_boolean(repr, "showguides", v);
786
786
    sp_repr_get_boolean(repr, "showgrid", &v);
787
787
    v = !v;
788
788
 
789
 
    bool saved = sp_document_get_undo_sensitive(doc);
 
789
    gboolean saved = sp_document_get_undo_sensitive(doc);
790
790
    sp_document_set_undo_sensitive(doc, FALSE);
791
791
 
792
792
    sp_repr_set_boolean(repr, "showgrid", v);
840
840
 
841
841
/* This should be moved somewhere */
842
842
 
843
 
static bool sp_str_to_bool(const gchar *str)
 
843
static gboolean sp_str_to_bool(const gchar *str)
844
844
{
845
845
    if (str) {
846
846
        if (!g_strcasecmp(str, "true") ||
856
856
 
857
857
/* fixme: Collect all these length parsing methods and think common sane API */
858
858
 
859
 
static bool sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit)
 
859
static gboolean sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit)
860
860
{
861
861
    if (!str) {
862
862
        return FALSE;
906
906
    return FALSE;
907
907
}
908
908
 
909
 
static bool sp_nv_read_opacity(const gchar *str, guint32 *color)
 
909
static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color)
910
910
{
911
911
    if (!str) {
912
912
        return FALSE;