From: kidproto Date: Fri, 25 Aug 2006 07:03:19 +0000 (+0000) Subject: peeled back the gboolean code as it hit on some complexity theory principles... X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f4f507228b30d55fd7e39386ba513f3a0a54bd5d;p=inkscape.git peeled back the gboolean code as it hit on some complexity theory principles... need to rethink and incrementally change gbooleans to bools --- diff --git a/src/color.cpp b/src/color.cpp index 78ef39188..2a6da863c 100644 --- a/src/color.cpp +++ b/src/color.cpp @@ -69,7 +69,7 @@ sp_color_copy(SPColor *dst, SPColor const *src) /** * Returns TRUE if c0 or c1 is NULL, or if colors/opacities differ. */ -bool +gboolean sp_color_is_equal (SPColor const *c0, SPColor const *c1) { g_return_val_if_fail (c0 != NULL, TRUE); @@ -89,7 +89,7 @@ sp_color_is_equal (SPColor const *c0, SPColor const *c1) * with CMYK aditionally comparing opacity, or if c0 or c1 is NULL. * \note Do we want the latter? */ -bool +gboolean sp_color_is_close (SPColor const *c0, SPColor const *c1, float epsilon) { g_return_val_if_fail (c0 != NULL, TRUE); diff --git a/src/color.h b/src/color.h index 824604afc..2c3f91fe7 100644 --- a/src/color.h +++ b/src/color.h @@ -64,8 +64,8 @@ SPColorSpaceType sp_color_get_colorspace_type (const SPColor *color); void sp_color_copy (SPColor *dst, const SPColor *src); -bool sp_color_is_equal (const SPColor *c0, const SPColor *c1); -bool sp_color_is_close (const SPColor *c0, const SPColor *c1, float epsilon); +gboolean sp_color_is_equal (const SPColor *c0, const SPColor *c1); +gboolean sp_color_is_close (const SPColor *c0, const SPColor *c1, float epsilon); void sp_color_set_rgb_float (SPColor *color, float r, float g, float b); void sp_color_set_rgb_rgba32 (SPColor *color, guint32 value); diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp index 0532a7668..22ddb5425 100644 --- a/src/conn-avoid-ref.cpp +++ b/src/conn-avoid-ref.cpp @@ -273,7 +273,7 @@ void init_avoided_shape_geometry(SPDesktop *desktop) // Don't count this as changes to the document, // it is basically just llate initialisation. SPDocument *document = sp_desktop_document(desktop); - bool saved = sp_document_get_undo_sensitive(document); + gboolean saved = sp_document_get_undo_sensitive(document); sp_document_set_undo_sensitive(document, FALSE); bool initialised = false; diff --git a/src/connector-context.cpp b/src/connector-context.cpp index ed0d6aad7..e38f8a627 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -961,7 +961,7 @@ spcc_connector_finish(SPConnectorContext *const cc) } -static bool +static gboolean cc_generic_knot_handler(SPCanvasItem *, GdkEvent *event, SPKnot *knot) { g_assert (knot != NULL); @@ -971,7 +971,7 @@ cc_generic_knot_handler(SPCanvasItem *, GdkEvent *event, SPKnot *knot) SPConnectorContext *cc = SP_CONNECTOR_CONTEXT( knot->desktop->event_context); - bool consumed = FALSE; + gboolean consumed = FALSE; switch (event->type) { case GDK_ENTER_NOTIFY: @@ -1008,12 +1008,12 @@ cc_generic_knot_handler(SPCanvasItem *, GdkEvent *event, SPKnot *knot) } -static bool +static gboolean endpt_handler(SPKnot *knot, GdkEvent *event, SPConnectorContext *cc) { g_assert( SP_IS_CONNECTOR_CONTEXT(cc) ); - bool consumed = FALSE; + gboolean consumed = FALSE; switch (event->type) { case GDK_BUTTON_PRESS: diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index 7cae37a93..5f6c557f1 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -109,7 +109,7 @@ clonetiler_dialog_destroy (GtkObject *object, gpointer data) } -static bool +static gboolean clonetiler_dialog_delete (GtkObject *object, GdkEvent * /*event*/, gpointer data) { gtk_window_get_position ((GtkWindow *) dlg, &x, &y); diff --git a/src/dialogs/dialog-events.cpp b/src/dialogs/dialog-events.cpp index 983024d10..deabcf383 100644 --- a/src/dialogs/dialog-events.cpp +++ b/src/dialogs/dialog-events.cpp @@ -31,7 +31,7 @@ * \brief This function is called to zero the transientize semaphore by a * timeout. */ -bool +gboolean sp_allow_again (gpointer *wd) { ((win_data *) wd)->stop = 0; @@ -81,7 +81,7 @@ sp_dialog_defocus_on_enter (GtkWidget *w) -bool +gboolean sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data) { @@ -91,7 +91,7 @@ sp_dialog_event_handler (GtkWindow *win, GdkEvent *event, gpointer data) return FALSE; } - bool ret = FALSE; + gboolean ret = FALSE; switch (event->type) { @@ -210,7 +210,7 @@ void on_dialog_unhide (GtkWidget *w) gtk_widget_show (w); } -bool +gboolean sp_dialog_hide (GtkObject *object, gpointer data) { GtkWidget *dlg = (GtkWidget *) data; @@ -223,7 +223,7 @@ sp_dialog_hide (GtkObject *object, gpointer data) -bool +gboolean sp_dialog_unhide (GtkObject *object, gpointer data) { GtkWidget *dlg = (GtkWidget *) data; diff --git a/src/dialogs/dialog-events.h b/src/dialogs/dialog-events.h index a86ac0b9b..7cc64c6a2 100644 --- a/src/dialogs/dialog-events.h +++ b/src/dialogs/dialog-events.h @@ -31,7 +31,7 @@ typedef struct { } win_data; -bool sp_dialog_event_handler ( GtkWindow *win, +gboolean sp_dialog_event_handler ( GtkWindow *win, GdkEvent *event, gpointer data ); @@ -49,8 +49,8 @@ void sp_transientize_callback ( Inkscape::Application *inkscape, void on_dialog_hide (GtkWidget *w); void on_dialog_unhide (GtkWidget *w); -bool sp_dialog_hide (GtkObject *object, gpointer data); -bool sp_dialog_unhide (GtkObject *object, gpointer data); +gboolean sp_dialog_hide (GtkObject *object, gpointer data); +gboolean sp_dialog_unhide (GtkObject *object, gpointer data); #endif diff --git a/src/dialogs/filedialog-win32.cpp b/src/dialogs/filedialog-win32.cpp index 67e949d35..ca9ce5f6c 100644 --- a/src/dialogs/filedialog-win32.cpp +++ b/src/dialogs/filedialog-win32.cpp @@ -25,11 +25,11 @@ namespace Dialogs /*################################# # U T I L I T Y #################################*/ -static bool +static gboolean win32_is_os_wide() { - static bool initialized = FALSE; - static bool is_wide = FALSE; + static gboolean initialized = FALSE; + static gboolean is_wide = FALSE; static OSVERSIONINFOA osver; if ( !initialized ) diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp index c5d2e6eed..f3efeed81 100644 --- a/src/dialogs/find.cpp +++ b/src/dialogs/find.cpp @@ -88,7 +88,7 @@ static void sp_find_dialog_destroy(GtkObject *object, gpointer) -static bool sp_find_dialog_delete(GtkObject *, GdkEvent *, gpointer data) +static gboolean sp_find_dialog_delete(GtkObject *, GdkEvent *, gpointer data) { gtk_window_get_position (GTK_WINDOW (dlg), &x, &y); gtk_window_get_size (GTK_WINDOW (dlg), &w, &h); @@ -476,7 +476,7 @@ toggle_shapes (GtkToggleButton *tb, gpointer data) GtkWidget * -sp_find_types_checkbox (GtkWidget *w, const gchar *data, bool active, +sp_find_types_checkbox (GtkWidget *w, const gchar *data, gboolean active, GtkTooltips *tt, const gchar *tip, const gchar *label, void (*toggled)(GtkToggleButton *, gpointer)) @@ -499,7 +499,7 @@ sp_find_types_checkbox (GtkWidget *w, const gchar *data, bool active, } GtkWidget * -sp_find_types_checkbox_indented (GtkWidget *w, const gchar *data, bool active, +sp_find_types_checkbox_indented (GtkWidget *w, const gchar *data, gboolean active, GtkTooltips *tt, const gchar *tip, const gchar *label, void (*toggled)(GtkToggleButton *, gpointer), guint indent) diff --git a/src/dialogs/input.cpp b/src/dialogs/input.cpp index 643a4a764..eac3a0c5a 100644 --- a/src/dialogs/input.cpp +++ b/src/dialogs/input.cpp @@ -43,7 +43,7 @@ sp_input_dialog_destroy (GtkObject *object, gpointer data) wd.stop = 0; } -static bool +static gboolean sp_input_dialog_delete (GtkObject *object, GdkEvent *event, gpointer data) { gtk_window_get_position ((GtkWindow *) dlg, &x, &y); diff --git a/src/dialogs/item-properties.cpp b/src/dialogs/item-properties.cpp index 78482018b..6f12a48f1 100644 --- a/src/dialogs/item-properties.cpp +++ b/src/dialogs/item-properties.cpp @@ -64,7 +64,7 @@ sp_item_dialog_destroy (GtkObject *object, gpointer data) wd.stop = 0; } -static bool +static gboolean sp_item_dialog_delete (GtkObject *object, GdkEvent *event, gpointer data) { gtk_window_get_position ((GtkWindow *) dlg, &x, &y); diff --git a/src/dialogs/object-properties.cpp b/src/dialogs/object-properties.cpp index 7f326f476..a4dd49aeb 100644 --- a/src/dialogs/object-properties.cpp +++ b/src/dialogs/object-properties.cpp @@ -66,7 +66,7 @@ sp_object_properties_dialog_destroy (GtkObject *object, gpointer data) wd.stop = 0; } -static bool +static gboolean sp_object_properties_dialog_delete ( GtkObject *object, GdkEvent *event, gpointer data ) diff --git a/src/dialogs/stroke-style.cpp b/src/dialogs/stroke-style.cpp index 6dcb80499..80099eb82 100644 --- a/src/dialogs/stroke-style.cpp +++ b/src/dialogs/stroke-style.cpp @@ -889,7 +889,7 @@ sp_marker_select(GtkOptionMenu *mnu, GtkWidget *spw) /* TODO: annotate */ "stroke-style.cpp:889"); } -static bool stroke_width_set_unit(SPUnitSelector *, +static gboolean stroke_width_set_unit(SPUnitSelector *, SPUnit const *old, SPUnit const *new_units, GObject *spw) diff --git a/src/dialogs/swatches.cpp b/src/dialogs/swatches.cpp index 10f30e64b..1f5ae5c7c 100644 --- a/src/dialogs/swatches.cpp +++ b/src/dialogs/swatches.cpp @@ -202,7 +202,7 @@ static void dragBegin( GtkWidget *widget, GdkDragContext* dc, gpointer data ) } //"drag-drop" -// bool dragDropColorData( GtkWidget *widget, +// gboolean dragDropColorData( GtkWidget *widget, // GdkDragContext *drag_context, // gint x, // gint y, diff --git a/src/dialogs/text-edit.cpp b/src/dialogs/text-edit.cpp index f37cc645f..8ea0a7236 100644 --- a/src/dialogs/text-edit.cpp +++ b/src/dialogs/text-edit.cpp @@ -61,7 +61,7 @@ static void sp_text_edit_dialog_set_default (GtkButton *button, GtkWidget *dlg); static void sp_text_edit_dialog_apply (GtkButton *button, GtkWidget *dlg); static void sp_text_edit_dialog_close (GtkButton *button, GtkWidget *dlg); -static void sp_text_edit_dialog_read_selection (GtkWidget *dlg, bool style, bool content); +static void sp_text_edit_dialog_read_selection (GtkWidget *dlg, gboolean style, gboolean content); static void sp_text_edit_dialog_text_changed (GtkTextBuffer *tb, GtkWidget *dlg); static void sp_text_edit_dialog_font_changed (SPFontSelector *fontsel, font_instance *font, GtkWidget *dlg); @@ -93,7 +93,7 @@ sp_text_edit_dialog_destroy (GtkObject *object, gpointer data) -static bool +static gboolean sp_text_edit_dialog_delete (GtkObject *object, GdkEvent *event, gpointer data) { gtk_window_get_position ((GtkWindow *) dlg, &x, &y); @@ -116,7 +116,7 @@ sp_text_edit_dialog_delete (GtkObject *object, GdkEvent *event, gpointer data) This flag is used to prevent passing keys from the dialog to canvas, so that the text editor can handle keys like Esc and Ctrl+Z itself. */ -bool +gboolean text_view_focus_in (GtkWidget *w, GdkEventKey *event, gpointer data) { GObject *dlg = (GObject *) data; @@ -124,7 +124,7 @@ text_view_focus_in (GtkWidget *w, GdkEventKey *event, gpointer data) return FALSE; } -bool +gboolean text_view_focus_out (GtkWidget *w, GdkEventKey *event, gpointer data) { GObject *dlg = (GObject *) data; @@ -452,7 +452,7 @@ sp_text_edit_dialog_selection_modified ( Inkscape::Application *inkscape, guint flags, GtkWidget *dlg ) { - bool style, content; + gboolean style, content; style = ((flags & ( SP_OBJECT_CHILD_MODIFIED_FLAG | @@ -645,8 +645,8 @@ sp_text_edit_dialog_close (GtkButton *button, GtkWidget *dlg) static void sp_text_edit_dialog_read_selection ( GtkWidget *dlg, - bool dostyle, - bool docontent ) + gboolean dostyle, + gboolean docontent ) { if (g_object_get_data (G_OBJECT (dlg), "blocked")) return; diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp index bcd3b31f7..e515a3f37 100644 --- a/src/dialogs/xml-tree.cpp +++ b/src/dialogs/xml-tree.cpp @@ -110,7 +110,7 @@ static void on_tree_select_row(GtkCTree *tree, GtkCTreeNode *node, gint column, static void on_tree_unselect_row(GtkCTree *tree, GtkCTreeNode *node, gint column, gpointer data); static void after_tree_move(GtkCTree *tree, GtkCTreeNode *node, GtkCTreeNode *new_parent, GtkCTreeNode *new_sibling, gpointer data); static void on_destroy(GtkObject *object, gpointer data); -static bool on_delete(GtkObject *object, GdkEvent *event, gpointer data); +static gboolean on_delete(GtkObject *object, GdkEvent *event, gpointer data); static void on_tree_select_row_enable_if_element(GtkCTree *tree, GtkCTreeNode *node, gint column, gpointer data); static void on_tree_select_row_enable_if_mutable(GtkCTree *tree, GtkCTreeNode *node, gint column, gpointer data); @@ -159,7 +159,7 @@ static void cmd_unindent_node(GtkObject *object, gpointer data); static void cmd_delete_attr(GtkObject *object, gpointer data); static void cmd_set_attr(GtkObject *object, gpointer data); -static bool sp_xml_tree_key_press(GtkWidget *widget, GdkEventKey *event); +static gboolean sp_xml_tree_key_press(GtkWidget *widget, GdkEventKey *event); /* @@ -625,7 +625,7 @@ void sp_xml_tree_dialog() } // end of sp_xml_tree_dialog() -static bool sp_xml_tree_key_press(GtkWidget *widget, GdkEventKey *event) +static gboolean sp_xml_tree_key_press(GtkWidget *widget, GdkEventKey *event) { unsigned int shortcut = get_group0_keyval(event) | @@ -913,7 +913,7 @@ static void on_destroy(GtkObject *object, gpointer data) -static bool on_delete(GtkObject *object, GdkEvent *event, gpointer data) +static gboolean on_delete(GtkObject *object, GdkEvent *event, gpointer data) { gtk_window_get_position((GtkWindow *) dlg, &x, &y); gtk_window_get_size((GtkWindow *) dlg, &w, &h); @@ -991,7 +991,7 @@ void on_tree_select_row_show_if_text(GtkCTree *tree, GtkCTreeNode *node, } -bool xml_tree_node_mutable(GtkCTreeNode *node) +gboolean xml_tree_node_mutable(GtkCTreeNode *node) { // top-level is immutable, obviously if (!GTK_CTREE_ROW(node)->parent) { @@ -1141,7 +1141,7 @@ void on_attr_select_row_set_value_content(GtkCList *list, gint row, gint column, void on_tree_select_row_enable_if_indentable(GtkCTree *tree, GtkCTreeNode *node, gint column, gpointer data) { - bool indentable = FALSE; + gboolean indentable = FALSE; if (xml_tree_node_mutable(node)) { Inkscape::XML::Node *repr, *prev; diff --git a/src/display/canvas-arena.cpp b/src/display/canvas-arena.cpp index 8a999fe42..2d192ac1b 100644 --- a/src/display/canvas-arena.cpp +++ b/src/display/canvas-arena.cpp @@ -423,7 +423,7 @@ sp_canvas_arena_set_pick_delta (SPCanvasArena *ca, gdouble delta) } void -sp_canvas_arena_set_sticky (SPCanvasArena *ca, bool sticky) +sp_canvas_arena_set_sticky (SPCanvasArena *ca, gboolean sticky) { g_return_if_fail (ca != NULL); g_return_if_fail (SP_IS_CANVAS_ARENA (ca)); diff --git a/src/display/canvas-arena.h b/src/display/canvas-arena.h index a2728a7b5..805bee60a 100644 --- a/src/display/canvas-arena.h +++ b/src/display/canvas-arena.h @@ -51,7 +51,7 @@ struct SPCanvasArenaClass { GtkType sp_canvas_arena_get_type (void); void sp_canvas_arena_set_pick_delta (SPCanvasArena *ca, gdouble delta); -void sp_canvas_arena_set_sticky (SPCanvasArena *ca, bool sticky); +void sp_canvas_arena_set_sticky (SPCanvasArena *ca, gboolean sticky); void sp_canvas_arena_render_pixblock (SPCanvasArena *ca, NRPixBlock *pb); diff --git a/src/document-undo.cpp b/src/document-undo.cpp index 226183bda..09bb4e857 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -75,13 +75,13 @@ * Since undo sensitivity needs to be nested, setting undo sensitivity * should be done like this: *\verbatim - bool saved = sp_document_get_undo_sensitive(document); + gboolean saved = sp_document_get_undo_sensitive(document); sp_document_set_undo_sensitive(document, FALSE); ... do stuff ... sp_document_set_undo_sensitive(document, saved); \endverbatim */ void -sp_document_set_undo_sensitive (SPDocument *doc, bool sensitive) +sp_document_set_undo_sensitive (SPDocument *doc, gboolean sensitive) { g_assert (doc != NULL); g_assert (doc->priv != NULL); @@ -101,7 +101,7 @@ sp_document_set_undo_sensitive (SPDocument *doc, bool sensitive) doc->priv->sensitive = !!sensitive; } -bool sp_document_get_undo_sensitive(SPDocument const *document) { +gboolean sp_document_get_undo_sensitive(SPDocument const *document) { g_assert(document != NULL); g_assert(document->priv != NULL); @@ -200,13 +200,13 @@ void finish_incomplete_transaction(SPDocument &doc) { } -bool +gboolean sp_document_undo (SPDocument *doc) { using Inkscape::Debug::EventTracker; using Inkscape::Debug::SimpleEvent; - bool ret; + gboolean ret; EventTracker > tracker("undo"); @@ -244,13 +244,13 @@ sp_document_undo (SPDocument *doc) return ret; } -bool +gboolean sp_document_redo (SPDocument *doc) { using Inkscape::Debug::EventTracker; using Inkscape::Debug::SimpleEvent; - bool ret; + gboolean ret; EventTracker > tracker("redo"); diff --git a/src/document.cpp b/src/document.cpp index 04d3a147c..20bbeb73e 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -549,7 +549,7 @@ void sp_document_set_uri(SPDocument *document, gchar const *uri) // Update saveable repr attributes. Inkscape::XML::Node *repr = sp_document_repr_root(document); // changing uri in the document repr must not be not undoable - bool saved = sp_document_get_undo_sensitive(document); + gboolean saved = sp_document_get_undo_sensitive(document); sp_document_set_undo_sensitive(document, FALSE); if (document->base) repr->setAttribute("sodipodi:docbase", document->base); @@ -914,7 +914,7 @@ upwards in z-order and returns what it has found so far (i.e. the found item is guaranteed to be lower than upto). */ SPItem* -find_item_at_point(unsigned int dkey, SPGroup *group, NR::Point const p, bool into_groups, bool take_insensitive = false, SPItem *upto = NULL) +find_item_at_point(unsigned int dkey, SPGroup *group, NR::Point const p, gboolean into_groups, bool take_insensitive = false, SPItem *upto = NULL) { SPItem *seen = NULL, *newseen = NULL; @@ -1015,7 +1015,7 @@ GSList *sp_document_partial_items_in_box(SPDocument *document, unsigned int dkey SPItem * sp_document_item_at_point(SPDocument *document, unsigned const key, NR::Point const p, - bool const into_groups, SPItem *upto) + gboolean const into_groups, SPItem *upto) { g_return_val_if_fail(document != NULL, NULL); g_return_val_if_fail(document->priv != NULL, NULL); @@ -1035,7 +1035,7 @@ sp_document_group_at_point(SPDocument *document, unsigned int key, NR::Point con /* Resource management */ -bool +gboolean sp_document_add_resource(SPDocument *document, gchar const *key, SPObject *object) { GSList *rlist; @@ -1060,7 +1060,7 @@ sp_document_add_resource(SPDocument *document, gchar const *key, SPObject *objec return TRUE; } -bool +gboolean sp_document_remove_resource(SPDocument *document, gchar const *key, SPObject *object) { GSList *rlist; diff --git a/src/document.h b/src/document.h index f29804db0..b0afba5ec 100644 --- a/src/document.h +++ b/src/document.h @@ -175,8 +175,8 @@ void sp_document_set_height (SPDocument * document, gdouble height, const SPUnit * Undo & redo */ -void sp_document_set_undo_sensitive (SPDocument * document, bool sensitive); -bool sp_document_get_undo_sensitive (SPDocument const * document); +void sp_document_set_undo_sensitive (SPDocument * document, gboolean sensitive); +gboolean sp_document_get_undo_sensitive (SPDocument const * document); void sp_document_clear_undo (SPDocument * document); void sp_document_clear_redo (SPDocument * document); @@ -200,12 +200,12 @@ void sp_document_reset_key (Inkscape::Application *inkscape, SPDesktop *desktop, void sp_document_cancel (SPDocument *document); /* Undo and redo */ -bool sp_document_undo (SPDocument * document); -bool sp_document_redo (SPDocument * document); +gboolean sp_document_undo (SPDocument * document); +gboolean sp_document_redo (SPDocument * document); /* Resource management */ -bool sp_document_add_resource (SPDocument *document, const gchar *key, SPObject *object); -bool sp_document_remove_resource (SPDocument *document, const gchar *key, SPObject *object); +gboolean sp_document_add_resource (SPDocument *document, const gchar *key, SPObject *object); +gboolean sp_document_remove_resource (SPDocument *document, const gchar *key, SPObject *object); const GSList *sp_document_get_resource_list (SPDocument *document, const gchar *key); sigc::connection sp_document_resources_changed_connect(SPDocument *document, const gchar *key, SPDocument::ResourcesChangedSignal::slot_type slot); @@ -231,7 +231,7 @@ sigc::connection sp_document_resources_changed_connect(SPDocument *document, con GSList * sp_document_items_in_box(SPDocument *document, unsigned int dkey, NR::Rect const &box); GSList * sp_document_partial_items_in_box(SPDocument *document, unsigned int dkey, NR::Rect const &box); SPItem* sp_document_item_from_list_at_point_bottom (unsigned int dkey, SPGroup *group, const GSList *list, NR::Point const p, bool take_insensitive = false); -SPItem * sp_document_item_at_point (SPDocument *document, unsigned int key, NR::Point const p, bool into_groups, SPItem *upto = NULL); +SPItem * sp_document_item_at_point (SPDocument *document, unsigned int key, NR::Point const p, gboolean into_groups, SPItem *upto = NULL); SPItem * sp_document_group_at_point (SPDocument *document, unsigned int key, NR::Point const p); void sp_document_set_uri (SPDocument *document, const gchar *uri); diff --git a/src/draw-anchor.cpp b/src/draw-anchor.cpp index ce016aabb..b06e94a48 100644 --- a/src/draw-anchor.cpp +++ b/src/draw-anchor.cpp @@ -23,7 +23,7 @@ * Creates an anchor object and initializes it. */ SPDrawAnchor * -sp_draw_anchor_new(SPDrawContext *dc, SPCurve *curve, bool start, NR::Point delta) +sp_draw_anchor_new(SPDrawContext *dc, SPCurve *curve, gboolean start, NR::Point delta) { SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(dc); @@ -67,7 +67,7 @@ sp_draw_anchor_destroy(SPDrawAnchor *anchor) * pointer to it or NULL. */ SPDrawAnchor * -sp_draw_anchor_test(SPDrawAnchor *anchor, NR::Point w, bool activate) +sp_draw_anchor_test(SPDrawAnchor *anchor, NR::Point w, gboolean activate) { SPDesktop *dt = SP_EVENT_CONTEXT_DESKTOP(anchor->dc); diff --git a/src/draw-anchor.h b/src/draw-anchor.h index 3662451a6..1036a5472 100644 --- a/src/draw-anchor.h +++ b/src/draw-anchor.h @@ -24,10 +24,10 @@ struct SPDrawAnchor { }; -SPDrawAnchor *sp_draw_anchor_new(SPDrawContext *dc, SPCurve *curve, bool start, +SPDrawAnchor *sp_draw_anchor_new(SPDrawContext *dc, SPCurve *curve, gboolean start, NR::Point delta); SPDrawAnchor *sp_draw_anchor_destroy(SPDrawAnchor *anchor); -SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, NR::Point w, bool activate); +SPDrawAnchor *sp_draw_anchor_test(SPDrawAnchor *anchor, NR::Point w, gboolean activate); #endif /* !SEEN_DRAW_ANCHOR_H */ diff --git a/src/draw-context.cpp b/src/draw-context.cpp index d94681703..bb1f56044 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -405,7 +405,7 @@ reverse_then_unref(SPCurve *orig) * Invoke _flush_white to write result back to object. */ void -spdc_concat_colors_and_flush(SPDrawContext *dc, bool forceclosed) +spdc_concat_colors_and_flush(SPDrawContext *dc, gboolean forceclosed) { /* Concat RBG */ SPCurve *c = dc->green_curve; diff --git a/src/draw-context.h b/src/draw-context.h index ded913283..59ec5a92f 100644 --- a/src/draw-context.h +++ b/src/draw-context.h @@ -57,7 +57,7 @@ struct SPDrawContext : public SPEventContext{ GSList *green_bpaths; SPCurve *green_curve; SPDrawAnchor *green_anchor; - bool green_closed; // a flag meaning we hit the green anchor, so close the path on itself + gboolean green_closed; // a flag meaning we hit the green anchor, so close the path on itself /* White */ SPItem *white_item; @@ -81,7 +81,7 @@ struct SPDrawContextClass : public SPEventContextClass{}; GType sp_draw_context_get_type(void); SPDrawAnchor *spdc_test_inside(SPDrawContext *dc, NR::Point p); -void spdc_concat_colors_and_flush(SPDrawContext *dc, bool forceclosed); +void spdc_concat_colors_and_flush(SPDrawContext *dc, gboolean forceclosed); void spdc_endpoint_snap_rotation(SPEventContext const *const ec, NR::Point &p, NR::Point const o, guint state); void spdc_endpoint_snap_free(SPEventContext const *ec, NR::Point &p, guint state); diff --git a/src/dyna-draw-context.cpp b/src/dyna-draw-context.cpp index 741513fa3..3233198f6 100644 --- a/src/dyna-draw-context.cpp +++ b/src/dyna-draw-context.cpp @@ -75,8 +75,8 @@ static void clear_current(SPDynaDrawContext *dc); static void set_to_accumulated(SPDynaDrawContext *dc); static void accumulate_calligraphic(SPDynaDrawContext *dc); -static void fit_and_split(SPDynaDrawContext *ddc, bool release); -static void fit_and_split_calligraphics(SPDynaDrawContext *ddc, bool release); +static void fit_and_split(SPDynaDrawContext *ddc, gboolean release); +static void fit_and_split_calligraphics(SPDynaDrawContext *ddc, gboolean release); static void sp_dyna_draw_reset(SPDynaDrawContext *ddc, NR::Point p); static NR::Point sp_dyna_draw_get_npoint(SPDynaDrawContext const *ddc, NR::Point v); @@ -327,7 +327,7 @@ sp_dyna_draw_extinput(SPDynaDrawContext *dc, GdkEvent *event) } -static bool +static gboolean sp_dyna_draw_apply(SPDynaDrawContext *dc, NR::Point p) { NR::Point n = sp_dyna_draw_get_npoint(dc, p); @@ -708,7 +708,7 @@ accumulate_calligraphic(SPDynaDrawContext *dc) static void fit_and_split(SPDynaDrawContext *dc, - bool release) + gboolean release) { fit_and_split_calligraphics(dc, release); } @@ -719,7 +719,7 @@ static double square(double const x) } static void -fit_and_split_calligraphics(SPDynaDrawContext *dc, bool release) +fit_and_split_calligraphics(SPDynaDrawContext *dc, gboolean release) { double const tolerance_sq = square( NR::expansion(SP_EVENT_CONTEXT(dc)->desktop->w2d()) * TOLERANCE_CALLIGRAPHIC ); diff --git a/src/extension/init.cpp b/src/extension/init.cpp index e52600f8a..756fff964 100644 --- a/src/extension/init.cpp +++ b/src/extension/init.cpp @@ -53,7 +53,7 @@ #include "prefs-utils.h" #include "io/sys.h" -extern bool inkscape_app_use_gui( Inkscape::Application const *app ); +extern gboolean inkscape_app_use_gui( Inkscape::Application const *app ); namespace Inkscape { namespace Extension { @@ -81,7 +81,7 @@ update_pref(gchar const *pref_path, gchar const *pref_attr, { gchar const *pref = prefs_get_string_attribute(pref_path,pref_attr); /* - bool missing=TRUE; + gboolean missing=TRUE; for (GSList *list = extension_family; list; list = g_slist_next(list)) { g_assert( list->data ); diff --git a/src/extension/input.cpp b/src/extension/input.cpp index aaa3f1415..68eb31e7b 100644 --- a/src/extension/input.cpp +++ b/src/extension/input.cpp @@ -165,7 +165,7 @@ Input::open (const gchar *uri) if (doc != NULL) { Inkscape::XML::Node * repr = sp_document_repr_root(doc); - bool saved = sp_document_get_undo_sensitive(doc); + gboolean saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive (doc, FALSE); repr->setAttribute("inkscape:output_extension", output_extension); sp_document_set_undo_sensitive (doc, saved); diff --git a/src/extension/internal/ps.cpp b/src/extension/internal/ps.cpp index b4a3f8904..01387ca19 100644 --- a/src/extension/internal/ps.cpp +++ b/src/extension/internal/ps.cpp @@ -221,7 +221,7 @@ PrintPS::setup(Inkscape::Extension::Print * mod) unsigned int PrintPS::begin(Inkscape::Extension::Print *mod, SPDocument *doc) { - bool epsexport = false; + gboolean epsexport = false; _latin1_encoded_fonts.clear(); _newlatin1font_proc_defined = false; diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index 55ba10ff9..ab9c59830 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -198,7 +198,7 @@ Svg::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar *uri) gchar *save_path = g_path_get_dirname (uri); - bool const spns = (!mod->get_id() + gboolean const spns = (!mod->get_id() || !strcmp (mod->get_id(), SP_MODULE_KEY_OUTPUT_SVG_INKSCAPE) || !strcmp (mod->get_id(), SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE)); @@ -214,7 +214,7 @@ Svg::save (Inkscape::Extension::Output *mod, SPDocument *doc, const gchar *uri) Inkscape::IO::fixupHrefs( doc, save_path, spns ); - bool const s = sp_repr_save_file (sp_repr_document (repr), uri, SP_SVG_NS_URI); + gboolean const s = sp_repr_save_file (sp_repr_document (repr), uri, SP_SVG_NS_URI); if (s == FALSE) { throw Inkscape::Extension::Output::save_failed(); } diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp index 1ea51f6b9..51dbd3a00 100644 --- a/src/extension/internal/win32.cpp +++ b/src/extension/internal/win32.cpp @@ -97,11 +97,11 @@ my_timer (HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime) /* Platform detection */ -bool +gboolean PrintWin32::is_os_wide() { - static bool initialized = FALSE; - static bool is_wide = FALSE; + static gboolean initialized = FALSE; + static gboolean is_wide = FALSE; static OSVERSIONINFOA osver; if ( !initialized ) diff --git a/src/extension/internal/win32.h b/src/extension/internal/win32.h index 96b68f075..d46b5b2fb 100644 --- a/src/extension/internal/win32.h +++ b/src/extension/internal/win32.h @@ -60,7 +60,7 @@ public: static void init (void); /* Platform detection */ - static bool is_os_wide(); + static gboolean is_os_wide(); /* Print functions */ virtual unsigned int setup (Inkscape::Extension::Print * module); diff --git a/src/extension/system.cpp b/src/extension/system.cpp index 482d6c5ea..41d6e7513 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -104,7 +104,7 @@ open(Extension *key, gchar const *filename) /* This kinda overkill as most of these are already set, but I want to make sure for this release -- TJG */ Inkscape::XML::Node *repr = sp_document_repr_root(doc); - bool saved = sp_document_get_undo_sensitive(doc); + gboolean saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, FALSE); repr->setAttribute("sodipodi:modified", NULL); sp_document_set_undo_sensitive(doc, saved); diff --git a/src/file.cpp b/src/file.cpp index 9b2b803c6..de8ab2b5d 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1097,7 +1097,7 @@ sp_file_print_preview(gpointer object, gpointer data) } -void Inkscape::IO::fixupHrefs( SPDocument *doc, const gchar *base, bool spns ) +void Inkscape::IO::fixupHrefs( SPDocument *doc, const gchar *base, gboolean spns ) { //g_message("Inkscape::IO::fixupHrefs( , [%s], )", base ); @@ -1125,7 +1125,7 @@ void Inkscape::IO::fixupHrefs( SPDocument *doc, const gchar *base, bool spns ) try { URI uri(things[i]); - bool isAbs = g_path_is_absolute( things[i] ); + gboolean isAbs = g_path_is_absolute( things[i] ); gchar *str = uri.toString(); g_message( "abs:%d isRel:%d scheme:[%s] path:[%s][%s] uri[%s] / [%s]", (int)isAbs, (int)uri.isRelative(), @@ -1144,7 +1144,7 @@ void Inkscape::IO::fixupHrefs( SPDocument *doc, const gchar *base, bool spns ) if ( redo == NULL ) { URI again = URI::fromUtf8( things[i] ); - bool isAbs = g_path_is_absolute( things[i] ); + gboolean isAbs = g_path_is_absolute( things[i] ); gchar *str = again.toString(); g_message( "abs:%d isRel:%d scheme:[%s] path:[%s][%s] uri[%s] / [%s]", (int)isAbs, (int)again.isRelative(), diff --git a/src/file.h b/src/file.h index 19835ae38..18e4068a1 100644 --- a/src/file.h +++ b/src/file.h @@ -172,7 +172,7 @@ void sp_file_vacuum (); namespace Inkscape { namespace IO { -void fixupHrefs( SPDocument *doc, const gchar *uri, bool spns ); +void fixupHrefs( SPDocument *doc, const gchar *uri, gboolean spns ); } } diff --git a/src/helper/unit-menu.cpp b/src/helper/unit-menu.cpp index bbda0a7c5..34a2b6344 100644 --- a/src/helper/unit-menu.cpp +++ b/src/helper/unit-menu.cpp @@ -46,7 +46,7 @@ struct SPUnitSelector { struct SPUnitSelectorClass { GtkHBoxClass parent_class; - bool (* set_unit)(SPUnitSelector *us, SPUnit const *old, SPUnit const *new_unit); + gboolean (* set_unit)(SPUnitSelector *us, SPUnit const *old, SPUnit const *new_unit); }; enum {SET_UNIT, LAST_SIGNAL}; @@ -175,7 +175,7 @@ spus_unit_activate(GtkWidget *widget, SPUnitSelector *us) us->update = TRUE; - bool consumed = FALSE; + gboolean consumed = FALSE; g_signal_emit(G_OBJECT(us), signals[SET_UNIT], 0, old, unit, &consumed); if ( !consumed @@ -333,7 +333,7 @@ sp_unit_selector_remove_adjustment(SPUnitSelector *us, GtkAdjustment *adj) gtk_object_unref(GTK_OBJECT(adj)); } -bool +gboolean sp_unit_selector_update_test(SPUnitSelector const *selector) { g_return_val_if_fail(selector != NULL, FALSE); diff --git a/src/helper/unit-menu.h b/src/helper/unit-menu.h index 9407afa3f..bf5bb260e 100644 --- a/src/helper/unit-menu.h +++ b/src/helper/unit-menu.h @@ -38,7 +38,7 @@ void sp_unit_selector_set_unit(SPUnitSelector *selector, SPUnit const *unit); void sp_unit_selector_add_adjustment(SPUnitSelector *selector, GtkAdjustment *adjustment); void sp_unit_selector_remove_adjustment(SPUnitSelector *selector, GtkAdjustment *adjustment); -bool sp_unit_selector_update_test(SPUnitSelector const *selector); +gboolean sp_unit_selector_update_test(SPUnitSelector const *selector); double sp_unit_selector_get_value_in_pixels(SPUnitSelector const *selector, GtkAdjustment *adj); void sp_unit_selector_set_value_in_pixels(SPUnitSelector *selector, GtkAdjustment *adj, double value); diff --git a/src/helper/units.cpp b/src/helper/units.cpp index af9560d7d..448f60302 100644 --- a/src/helper/units.cpp +++ b/src/helper/units.cpp @@ -119,7 +119,7 @@ sp_unit_free_list(GSList *units) /* These are pure utility */ /* Return TRUE if conversion is possible */ -bool +gboolean sp_convert_distance(gdouble *distance, SPUnit const *from, SPUnit const *to) { g_return_val_if_fail(distance != NULL, FALSE); diff --git a/src/helper/units.h b/src/helper/units.h index 4746fccca..3acb65828 100644 --- a/src/helper/units.h +++ b/src/helper/units.h @@ -130,7 +130,7 @@ void sp_unit_free_list (GSList *units); /* These are pure utility */ /* Return TRUE if conversion is possible, FALSE if unit bases differ */ -bool sp_convert_distance (gdouble *distance, const SPUnit *from, const SPUnit *to); +gboolean sp_convert_distance (gdouble *distance, const SPUnit *from, const SPUnit *to); /* If either one is NULL, transconverting to/from that base fails */ /* Generic conversion between volatile units would be useless anyways */ diff --git a/src/helper/window.cpp b/src/helper/window.cpp index 7bfc28b92..346bd19f1 100644 --- a/src/helper/window.cpp +++ b/src/helper/window.cpp @@ -19,7 +19,7 @@ #include "desktop.h" #include "event-context.h" -static bool +static gboolean sp_window_key_press (GtkWidget *widget, GdkEventKey *event) { unsigned int shortcut; diff --git a/src/inkscape.cpp b/src/inkscape.cpp index f976f6682..d3cc1aa00 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -89,7 +89,7 @@ enum { # FORWARD DECLARATIONS ################################*/ -bool inkscape_app_use_gui( Inkscape::Application const * app ); +gboolean inkscape_app_use_gui( Inkscape::Application const * app ); static void inkscape_class_init (Inkscape::ApplicationClass *klass); static void inkscape_init (SPObject *object); @@ -112,8 +112,8 @@ struct Inkscape::Application { GSList *documents; GSList *desktops; gchar *argv0; - bool dialogs_toggle; - bool use_gui; // may want to consider a virtual function + gboolean dialogs_toggle; + gboolean use_gui; // may want to consider a virtual function // for overriding things like the warning dlg's }; @@ -540,7 +540,7 @@ inkscape_segv_handler (int signum) void -inkscape_application_init (const gchar *argv0, bool use_gui) +inkscape_application_init (const gchar *argv0, gboolean use_gui) { inkscape = (Inkscape::Application *)g_object_new (SP_TYPE_INKSCAPE, NULL); /* fixme: load application defaults */ @@ -590,7 +590,7 @@ inkscape_get_instance() return inkscape; } -bool inkscape_app_use_gui( Inkscape::Application const * app ) +gboolean inkscape_app_use_gui( Inkscape::Application const * app ) { return app->use_gui; } diff --git a/src/inkscape.h b/src/inkscape.h index 79e2b0234..12f101901 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -29,7 +29,7 @@ namespace Inkscape { #define INKSCAPE inkscape_get_instance() -void inkscape_application_init (const gchar *argv0, bool use_gui); +void inkscape_application_init (const gchar *argv0, gboolean use_gui); bool inkscape_load_config (const gchar *filename, Inkscape::XML::Document *config, const gchar *skeleton, unsigned int skel_size, const gchar *e_notreg, const gchar *e_notxml, const gchar *e_notsp, const gchar *warn); Inkscape::XML::Node *inkscape_get_repr (Inkscape::Application *inkscape, const gchar *key); diff --git a/src/interface.cpp b/src/interface.cpp index 0b2c80845..b31853cf3 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -126,7 +126,7 @@ SPActionEventVector menu_item_event_vector = { }; void -sp_create_window(SPViewWidget *vw, bool editable) +sp_create_window(SPViewWidget *vw, gboolean editable) { g_return_if_fail(vw != NULL); g_return_if_fail(SP_IS_VIEW_WIDGET(vw)); @@ -346,7 +346,7 @@ sp_ui_menuitem_add_icon( GtkWidget *item, gchar *icon_name ) static GtkWidget * sp_ui_menu_append_item( GtkMenu *menu, gchar const *stock, gchar const *label, gchar const *tip, Inkscape::UI::View::View *view, GCallback callback, - gpointer data, bool with_mnemonic = TRUE ) + gpointer data, gboolean with_mnemonic = TRUE ) { GtkWidget *item; @@ -569,13 +569,13 @@ checkitem_toggled(GtkCheckMenuItem *menuitem, gpointer user_data) else pref_path = g_strconcat("window.", pref, NULL); - bool checked = gtk_check_menu_item_get_active(menuitem); + gboolean checked = gtk_check_menu_item_get_active(menuitem); prefs_set_int_attribute(pref_path, "state", checked); reinterpret_cast(view)->layoutWidget(); } -static bool +static gboolean checkitem_update(GtkWidget *widget, GdkEventExpose *event, gpointer user_data) { GtkCheckMenuItem *menuitem=GTK_CHECK_MENU_ITEM(widget); @@ -602,7 +602,7 @@ checkitem_update(GtkWidget *widget, GdkEventExpose *event, gpointer user_data) void sp_ui_menu_append_check_item_from_verb(GtkMenu *menu, Inkscape::UI::View::View *view, gchar const *label, gchar const *tip, gchar const *pref, void (*callback_toggle)(GtkCheckMenuItem *, gpointer user_data), - bool (*callback_update)(GtkWidget *widget, GdkEventExpose *event, gpointer user_data), + gboolean (*callback_update)(GtkWidget *widget, GdkEventExpose *event, gpointer user_data), Inkscape::Verb *verb) { GtkWidget *item; diff --git a/src/interface.h b/src/interface.h index becaf67b3..099fdd277 100644 --- a/src/interface.h +++ b/src/interface.h @@ -22,7 +22,7 @@ /** * Create a new document window. */ -void sp_create_window (SPViewWidget *vw, bool editable); +void sp_create_window (SPViewWidget *vw, gboolean editable); /** * diff --git a/src/knot.cpp b/src/knot.cpp index dd773ca75..a8d694779 100644 --- a/src/knot.cpp +++ b/src/knot.cpp @@ -290,7 +290,7 @@ static int sp_knot_handler(SPCanvasItem *item, GdkEvent *event, SPKnot *knot) g_object_ref(knot); tolerance = prefs_get_int_attribute_limited("options.dragtolerance", "value", 0, 0, 100); - bool consumed = FALSE; + gboolean consumed = FALSE; /* Run client universal event handler, if present */ @@ -505,7 +505,7 @@ void sp_knot_request_position(SPKnot *knot, NR::Point *p, guint state) g_return_if_fail(knot != NULL); g_return_if_fail(SP_IS_KNOT(knot)); - bool done = FALSE; + gboolean done = FALSE; g_signal_emit(knot, knot_signals[REQUEST], 0, diff --git a/src/knotholder.h b/src/knotholder.h index 544ead795..971dae3b0 100644 --- a/src/knotholder.h +++ b/src/knotholder.h @@ -41,7 +41,7 @@ struct SPKnotHolder : GObject { Inkscape::XML::Node *repr; ///< repr of the item, for setting and releasing listeners. - bool local_change; ///< if true, no need to recreate knotholder if repr was changed. + gboolean local_change; ///< if true, no need to recreate knotholder if repr was changed. }; struct SPKnotHolderClass : GObjectClass { diff --git a/src/main.cpp b/src/main.cpp index 9b6756ac6..6e184f4d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -157,33 +157,33 @@ static void do_query_dimension (SPDocument *doc, bool extent, NR::Dim2 const axi static gchar *sp_global_printer = NULL; -static bool sp_global_slideshow = FALSE; +static gboolean sp_global_slideshow = FALSE; static gchar *sp_export_png = NULL; static gchar *sp_export_dpi = NULL; static gchar *sp_export_area = NULL; -static bool sp_export_area_drawing = FALSE; -static bool sp_export_area_canvas = FALSE; +static gboolean sp_export_area_drawing = FALSE; +static gboolean sp_export_area_canvas = FALSE; static gchar *sp_export_width = NULL; static gchar *sp_export_height = NULL; static gchar *sp_export_id = NULL; static gchar *sp_export_background = NULL; static gchar *sp_export_background_opacity = NULL; -static bool sp_export_area_snap = FALSE; -static bool sp_export_use_hints = FALSE; -static bool sp_export_id_only = FALSE; +static gboolean sp_export_area_snap = FALSE; +static gboolean sp_export_use_hints = FALSE; +static gboolean sp_export_id_only = FALSE; static gchar *sp_export_svg = NULL; static gchar *sp_export_ps = NULL; static gchar *sp_export_eps = NULL; static gchar *sp_export_pdf = NULL; -static bool sp_export_text_to_path = FALSE; -static bool sp_export_bbox_page = FALSE; -static bool sp_query_x = FALSE; -static bool sp_query_y = FALSE; -static bool sp_query_width = FALSE; -static bool sp_query_height = FALSE; +static gboolean sp_export_text_to_path = FALSE; +static gboolean sp_export_bbox_page = FALSE; +static gboolean sp_query_x = FALSE; +static gboolean sp_query_y = FALSE; +static gboolean sp_query_width = FALSE; +static gboolean sp_query_height = FALSE; static gchar *sp_query_id = NULL; static int sp_new_gui = FALSE; -static bool sp_vacuum_defs = FALSE; +static gboolean sp_vacuum_defs = FALSE; static gchar *sp_export_png_utf8 = NULL; static gchar *sp_export_svg_utf8 = NULL; @@ -410,7 +410,7 @@ main(int argc, char **argv) Inkscape::Debug::Logger::init(); - bool use_gui; + gboolean use_gui; #ifndef WIN32 use_gui = (getenv("DISPLAY") != NULL); #else @@ -624,7 +624,7 @@ sp_main_gui(int argc, char const **argv) filename = 0; if (!sp_global_slideshow) { - bool create_new = TRUE; + gboolean create_new = TRUE; /// \todo FIXME BROKEN - non-UTF-8 sneaks in here. inkscape_application_init(argv[0], true); diff --git a/src/node-context.cpp b/src/node-context.cpp index 603294e14..3142e5b0e 100644 --- a/src/node-context.cpp +++ b/src/node-context.cpp @@ -317,7 +317,7 @@ nodepath_event_attr_changed(Inkscape::XML::Node *repr, gchar const *name, bool is_interactive, gpointer data) { SPItem *item = NULL; - bool changed = FALSE; + gboolean changed = FALSE; g_assert(data); SPNodeContext *nc = ((SPNodeContext *) data); diff --git a/src/node-context.h b/src/node-context.h index a4086da2b..a9b4beb07 100644 --- a/src/node-context.h +++ b/src/node-context.h @@ -34,10 +34,10 @@ struct SPNodeContext { Inkscape::NodePath::Path *nodepath; - bool leftalt; - bool rightalt; - bool leftctrl; - bool rightctrl; + gboolean leftalt; + gboolean rightalt; + gboolean leftctrl; + gboolean rightctrl; /// If true, rubberband was cancelled by esc, so the next button release should not deselect. bool rb_escaped; diff --git a/src/nodepath.cpp b/src/nodepath.cpp index 3f76a6548..3398ac1a1 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -94,9 +94,9 @@ static gchar *create_typestr(Inkscape::NodePath::Path *np); static void sp_node_update_handles(Inkscape::NodePath::Node *node, bool fire_move_signals = true); -static void sp_nodepath_node_select(Inkscape::NodePath::Node *node, bool incremental, bool override); +static void sp_nodepath_node_select(Inkscape::NodePath::Node *node, gboolean incremental, gboolean override); -static void sp_node_set_selected(Inkscape::NodePath::Node *node, bool selected); +static void sp_node_set_selected(Inkscape::NodePath::Node *node, gboolean selected); /* Adjust handle placement, if the node or the other handle is moved */ static void sp_node_adjust_handle(Inkscape::NodePath::Node *node, gint which_adjust); @@ -106,15 +106,15 @@ static void sp_node_adjust_handles(Inkscape::NodePath::Node *node); static void node_clicked(SPKnot *knot, guint state, gpointer data); static void node_grabbed(SPKnot *knot, guint state, gpointer data); static void node_ungrabbed(SPKnot *knot, guint state, gpointer data); -static bool node_request(SPKnot *knot, NR::Point *p, guint state, gpointer data); +static gboolean node_request(SPKnot *knot, NR::Point *p, guint state, gpointer data); /* Handle event callbacks */ static void node_handle_clicked(SPKnot *knot, guint state, gpointer data); static void node_handle_grabbed(SPKnot *knot, guint state, gpointer data); static void node_handle_ungrabbed(SPKnot *knot, guint state, gpointer data); -static bool node_handle_request(SPKnot *knot, NR::Point *p, guint state, gpointer data); +static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint state, gpointer data); static void node_handle_moved(SPKnot *knot, NR::Point *p, guint state, gpointer data); -static bool node_handle_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n); +static gboolean node_handle_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n); /* Constructors and destructors */ @@ -1286,7 +1286,7 @@ static void sp_node_ensure_knot_exists (SPDesktop *desktop, Inkscape::NodePath:: /** * Ensure the given handle of the node is visible/invisible, update its screen position */ -static void sp_node_update_handle(Inkscape::NodePath::Node *node, gint which, bool show_handle, bool fire_move_signals) +static void sp_node_update_handle(Inkscape::NodePath::Node *node, gint which, gboolean show_handle, bool fire_move_signals) { g_assert(node != NULL); @@ -1351,7 +1351,7 @@ static void sp_node_update_handles(Inkscape::NodePath::Node *node, bool fire_mov sp_knot_moveto(node->knot, &node->pos); } - bool show_handles = node->selected; + gboolean show_handles = node->selected; if (node->p.other != NULL) { if (node->p.other->selected) show_handles = TRUE; } @@ -1558,11 +1558,11 @@ sp_nodepath_select_segment_near_point(Inkscape::NodePath::Path *nodepath, NR::Po //fixme: this can return NULL, so check before proceeding. g_return_if_fail(e != NULL); - bool force = FALSE; + gboolean force = FALSE; if (!(e->selected && (!e->p.other || e->p.other->selected))) { force = TRUE; } - sp_nodepath_node_select(e, (bool) toggle, force); + sp_nodepath_node_select(e, (gboolean) toggle, force); if (e->p.other) sp_nodepath_node_select(e->p.other, TRUE, force); @@ -2120,7 +2120,7 @@ sp_node_selected_delete_segment(void) if (a->subpath->closed) { - bool reversed = FALSE; + gboolean reversed = FALSE; //Since we can go in a circle, we need to find the shorter distance. // a->b or b->a @@ -2276,7 +2276,7 @@ sp_node_selected_set_type(Inkscape::NodePath::NodeType type) /** * Change select status of node, update its own and neighbour handles. */ -static void sp_node_set_selected(Inkscape::NodePath::Node *node, bool selected) +static void sp_node_set_selected(Inkscape::NodePath::Node *node, gboolean selected) { node->selected = selected; @@ -2303,7 +2303,7 @@ static void sp_node_set_selected(Inkscape::NodePath::Node *node, bool selected) \param incremental If true, add to selection, otherwise deselect others \param override If true, always select this node, otherwise toggle selected status */ -static void sp_nodepath_node_select(Inkscape::NodePath::Node *node, bool incremental, bool override) +static void sp_nodepath_node_select(Inkscape::NodePath::Node *node, gboolean incremental, gboolean override) { Inkscape::NodePath::Path *nodepath = node->subpath->nodepath; @@ -2520,7 +2520,7 @@ void sp_nodepath_select_prev(Inkscape::NodePath::Path *nodepath) /** * \brief Select all nodes that are within the rectangle. */ -void sp_nodepath_select_rect(Inkscape::NodePath::Path *nodepath, NR::Rect const &b, bool incremental) +void sp_nodepath_select_rect(Inkscape::NodePath::Path *nodepath, NR::Rect const &b, gboolean incremental) { if (!incremental) { sp_nodepath_deselect(nodepath); @@ -2855,9 +2855,9 @@ static void sp_node_adjust_handles(Inkscape::NodePath::Node *node) /** * Node event callback. */ -static bool node_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n) +static gboolean node_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node *n) { - bool ret = FALSE; + gboolean ret = FALSE; switch (event->type) { case GDK_ENTER_NOTIFY: active_node = n; @@ -2902,7 +2902,7 @@ static bool node_event(SPKnot *knot, GdkEvent *event, Inkscape::NodePath::Node * /** * Handle keypress on node; directly called. */ -bool node_key(GdkEvent *event) +gboolean node_key(GdkEvent *event) { Inkscape::NodePath::Path *np; @@ -3033,13 +3033,13 @@ static double point_line_distance(NR::Point *p, double a) * Callback for node "request" signal. * \todo fixme: This goes to "moved" event? (lauris) */ -static bool +static gboolean node_request(SPKnot *knot, NR::Point *p, guint state, gpointer data) { double yn, xn, yp, xp; double an, ap, na, pa; double d_an, d_ap, d_na, d_pa; - bool collinear = FALSE; + gboolean collinear = FALSE; NR::Point c; NR::Point pr; @@ -3282,7 +3282,7 @@ static void node_handle_ungrabbed(SPKnot *knot, guint state, gpointer data) /** * Node handle "request" signal callback. */ -static bool node_handle_request(SPKnot *knot, NR::Point *p, guint state, gpointer data) +static gboolean node_handle_request(SPKnot *knot, NR::Point *p, guint state, gpointer data) { Inkscape::NodePath::Node *n = (Inkscape::NodePath::Node *) data; @@ -3424,9 +3424,9 @@ static void node_handle_moved(SPKnot *knot, NR::Point *p, guint state, gpointer /** * Node handle event callback. */ -static bool node_handle_event(SPKnot *knot, GdkEvent *event,Inkscape::NodePath::Node *n) +static gboolean node_handle_event(SPKnot *knot, GdkEvent *event,Inkscape::NodePath::Node *n) { - bool ret = FALSE; + gboolean ret = FALSE; switch (event->type) { case GDK_KEY_PRESS: switch (get_group0_keyval (&event->key)) { @@ -3449,7 +3449,7 @@ static bool node_handle_event(SPKnot *knot, GdkEvent *event,Inkscape::NodePath:: } static void node_rotate_one_internal(Inkscape::NodePath::Node const &n, gdouble const angle, - Radial &rme, Radial &rother, bool const both) + Radial &rme, Radial &rother, gboolean const both) { rme.a += angle; if ( both @@ -3461,7 +3461,7 @@ static void node_rotate_one_internal(Inkscape::NodePath::Node const &n, gdouble } static void node_rotate_one_internal_screen(Inkscape::NodePath::Node const &n, gdouble const angle, - Radial &rme, Radial &rother, bool const both) + Radial &rme, Radial &rother, gboolean const both) { gdouble const norm_angle = angle / n.subpath->nodepath->desktop->current_zoom(); @@ -3492,7 +3492,7 @@ static void node_rotate_one_internal_screen(Inkscape::NodePath::Node const &n, g /** * Rotate one node. */ -static void node_rotate_one (Inkscape::NodePath::Node *n, gdouble angle, int which, bool screen) +static void node_rotate_one (Inkscape::NodePath::Node *n, gdouble angle, int which, gboolean screen) { Inkscape::NodePath::NodeSide *me, *other; bool both = false; diff --git a/src/nodepath.h b/src/nodepath.h index edce23f76..21c2957aa 100644 --- a/src/nodepath.h +++ b/src/nodepath.h @@ -147,7 +147,7 @@ class SubPath { /** The parent of this subpath */ Path * nodepath; /** Is this path closed (no endpoints) or not?*/ - bool closed; + gboolean closed; /** The nodes in this subpath. */ GList * nodes; /** The first node of the subpath (does not imply open/closed)*/ @@ -247,12 +247,12 @@ void sp_nodepath_select_all (Inkscape::NodePath::Path *nodepath, bool invert); void sp_nodepath_select_all_from_subpath(Inkscape::NodePath::Path *nodepath, bool invert); void sp_nodepath_select_next (Inkscape::NodePath::Path *nodepath); void sp_nodepath_select_prev (Inkscape::NodePath::Path *nodepath); -void sp_nodepath_select_rect (Inkscape::NodePath::Path * nodepath, NR::Rect const &b, bool incremental); +void sp_nodepath_select_rect (Inkscape::NodePath::Path * nodepath, NR::Rect const &b, gboolean incremental); GList *save_nodepath_selection (Inkscape::NodePath::Path *nodepath); void restore_nodepath_selection (Inkscape::NodePath::Path *nodepath, GList *r); -bool nodepath_repr_d_changed (Inkscape::NodePath::Path * np, const char *newd); -bool nodepath_repr_typestr_changed (Inkscape::NodePath::Path * np, const char *newtypestr); -bool node_key (GdkEvent * event); +gboolean nodepath_repr_d_changed (Inkscape::NodePath::Path * np, const char *newd); +gboolean nodepath_repr_typestr_changed (Inkscape::NodePath::Path * np, const char *newtypestr); +gboolean node_key (GdkEvent * event); void sp_nodepath_update_repr(Inkscape::NodePath::Path *np, const gchar *annotation); void sp_nodepath_update_statusbar (Inkscape::NodePath::Path *nodepath); void sp_nodepath_selected_align(Inkscape::NodePath::Path *nodepath, NR::Dim2 axis); diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 82037fde3..0c35020b7 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -34,7 +34,7 @@ #include "desktop-handles.h" /* Helper functions for sp_selected_path_to_curves */ -static void sp_selected_path_to_curves0(bool do_document_done, guint32 text_grouping_policy); +static void sp_selected_path_to_curves0(gboolean do_document_done, guint32 text_grouping_policy); static Inkscape::XML::Node *sp_selected_item_to_curved_repr(SPItem *item, guint32 text_grouping_policy); enum { /* Not used yet. This is the placeholder of Lauris's idea. */ @@ -245,7 +245,7 @@ sp_selected_path_to_curves(void) } static void -sp_selected_path_to_curves0(bool interactive, guint32 text_grouping_policy) +sp_selected_path_to_curves0(gboolean interactive, guint32 text_grouping_policy) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; diff --git a/src/pen-context.cpp b/src/pen-context.cpp index 30cd84180..c1d7af150 100644 --- a/src/pen-context.cpp +++ b/src/pen-context.cpp @@ -55,7 +55,7 @@ static void spdc_pen_set_subsequent_point(SPPenContext *pc, NR::Point const p, b static void spdc_pen_set_ctrl(SPPenContext *pc, NR::Point const p, guint state); static void spdc_pen_finish_segment(SPPenContext *pc, NR::Point p, guint state); -static void spdc_pen_finish(SPPenContext *pc, bool closed); +static void spdc_pen_finish(SPPenContext *pc, gboolean closed); static gint pen_handle_button_press(SPPenContext *const pc, GdkEventButton const &bevent); static gint pen_handle_motion_notify(SPPenContext *const pc, GdkEventMotion const &mevent); @@ -1126,7 +1126,7 @@ spdc_pen_finish_segment(SPPenContext *const pc, NR::Point const p, guint const s } static void -spdc_pen_finish(SPPenContext *const pc, bool const closed) +spdc_pen_finish(SPPenContext *const pc, gboolean const closed) { SPDesktop *const desktop = pc->desktop; pc->_message_context->clear(); diff --git a/src/selection.cpp b/src/selection.cpp index 3e4c622c1..a27e45cb2 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -66,7 +66,7 @@ void Selection::_schedule_modified(SPObject *obj, guint flags) { this->_flags |= flags; } -bool +gboolean Selection::_emit_modified(Selection *selection) { /* force new handler to be created if requested before we return */ diff --git a/src/selection.h b/src/selection.h index 29fcbf361..1dcaa53ff 100644 --- a/src/selection.h +++ b/src/selection.h @@ -317,7 +317,7 @@ private: void operator=(Selection const &); /** @brief Issues modification notification signals */ - static bool _emit_modified(Selection *selection); + static gboolean _emit_modified(Selection *selection); /** @brief Schedules an item modification signal to be sent */ void _schedule_modified(SPObject *obj, guint flags); diff --git a/src/seltrans-handles.h b/src/seltrans-handles.h index 8e3851f2e..0afa552ea 100644 --- a/src/seltrans-handles.h +++ b/src/seltrans-handles.h @@ -22,15 +22,15 @@ namespace Inkscape class SPSelTransHandle; // request handlers -bool sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); -bool sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); -bool sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); -bool sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); -bool sp_sel_trans_center_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_center_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); // action handlers @@ -45,7 +45,7 @@ struct SPSelTransHandle { GdkCursorType cursor; guint control; void (* action) (Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); - bool (* request) (Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); + gboolean (* request) (Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &p, guint state); gdouble x, y; }; diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 31e69f7ad..675cb672e 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -53,11 +53,11 @@ static void sp_sel_trans_handle_grab(SPKnot *knot, guint state, gpointer data); static void sp_sel_trans_handle_ungrab(SPKnot *knot, guint state, gpointer data); static void sp_sel_trans_handle_click(SPKnot *knot, guint state, gpointer data); static void sp_sel_trans_handle_new_event(SPKnot *knot, NR::Point *position, guint32 state, gpointer data); -static bool sp_sel_trans_handle_request(SPKnot *knot, NR::Point *p, guint state, bool *data); +static gboolean sp_sel_trans_handle_request(SPKnot *knot, NR::Point *p, guint state, gboolean *data); extern GdkPixbuf *handles[]; -static bool sp_seltrans_handle_event(SPKnot *knot, GdkEvent *event, gpointer) +static gboolean sp_seltrans_handle_event(SPKnot *knot, GdkEvent *event, gpointer) { switch (event->type) { case GDK_MOTION_NOTIFY: @@ -609,7 +609,7 @@ static void sp_sel_trans_handle_new_event(SPKnot *knot, NR::Point *position, gui ); } -static bool sp_sel_trans_handle_request(SPKnot *knot, NR::Point *position, guint state, bool *data) +static gboolean sp_sel_trans_handle_request(SPKnot *knot, NR::Point *position, guint state, gboolean *data) { return SP_SELECT_CONTEXT(knot->desktop->event_context)->_seltrans->handleRequest( knot, position, state, *(SPSelTransHandle const *) data @@ -688,7 +688,7 @@ void Inkscape::SelTrans::handleNewEvent(SPKnot *knot, NR::Point *position, guint } -bool Inkscape::SelTrans::handleRequest(SPKnot *knot, NR::Point *position, guint state, SPSelTransHandle const &handle) +gboolean Inkscape::SelTrans::handleRequest(SPKnot *knot, NR::Point *position, guint state, SPSelTransHandle const &handle) { if (!SP_KNOT_IS_GRABBED(knot)) { return TRUE; @@ -752,37 +752,37 @@ static double sign(double const x) : 1 ); } -bool sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_scale_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, NR::Point &pt, guint state) { return seltrans->scaleRequest(pt, state); } -bool sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_stretch_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &pt, guint state) { return seltrans->stretchRequest(handle, pt, state); } -bool sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_skew_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &handle, NR::Point &pt, guint state) { return seltrans->skewRequest(handle, pt, state); } -bool sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_rotate_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, NR::Point &pt, guint state) { return seltrans->rotateRequest(pt, state); } -bool sp_sel_trans_center_request(Inkscape::SelTrans *seltrans, +gboolean sp_sel_trans_center_request(Inkscape::SelTrans *seltrans, SPSelTransHandle const &, NR::Point &pt, guint state) { return seltrans->centerRequest(pt, state); } -bool Inkscape::SelTrans::scaleRequest(NR::Point &pt, guint state) +gboolean Inkscape::SelTrans::scaleRequest(NR::Point &pt, guint state) { using NR::X; using NR::Y; @@ -890,7 +890,7 @@ bool Inkscape::SelTrans::scaleRequest(NR::Point &pt, guint state) return TRUE; } -bool Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state) +gboolean Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state) { using NR::X; using NR::Y; @@ -1002,7 +1002,7 @@ bool Inkscape::SelTrans::stretchRequest(SPSelTransHandle const &handle, NR::Poin return TRUE; } -bool Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state) +gboolean Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state) { using NR::X; using NR::Y; @@ -1092,7 +1092,7 @@ bool Inkscape::SelTrans::skewRequest(SPSelTransHandle const &handle, NR::Point & return TRUE; } -bool Inkscape::SelTrans::rotateRequest(NR::Point &pt, guint state) +gboolean Inkscape::SelTrans::rotateRequest(NR::Point &pt, guint state) { int snaps = prefs_get_int_attribute("options.rotationsnapsperpi", "value", 12); @@ -1140,7 +1140,7 @@ bool Inkscape::SelTrans::rotateRequest(NR::Point &pt, guint state) return TRUE; } -bool Inkscape::SelTrans::centerRequest(NR::Point &pt, guint state) +gboolean Inkscape::SelTrans::centerRequest(NR::Point &pt, guint state) { using NR::X; using NR::Y; diff --git a/src/seltrans.h b/src/seltrans.h index ccb00708e..5326c7b87 100644 --- a/src/seltrans.h +++ b/src/seltrans.h @@ -57,13 +57,13 @@ public: void scale(NR::Point &pt, guint state); void skew(SPSelTransHandle const &handle, NR::Point &pt, guint state); void rotate(NR::Point &pt, guint state); - bool scaleRequest(NR::Point &pt, guint state); - bool stretchRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state); - bool skewRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state); - bool rotateRequest(NR::Point &pt, guint state); - bool centerRequest(NR::Point &pt, guint state); + gboolean scaleRequest(NR::Point &pt, guint state); + gboolean stretchRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state); + gboolean skewRequest(SPSelTransHandle const &handle, NR::Point &pt, guint state); + gboolean rotateRequest(NR::Point &pt, guint state); + gboolean centerRequest(NR::Point &pt, guint state); - bool handleRequest(SPKnot *knot, NR::Point *position, guint state, SPSelTransHandle const &handle); + gboolean handleRequest(SPKnot *knot, NR::Point *position, guint state, SPSelTransHandle const &handle); void handleGrab(SPKnot *knot, guint state, SPSelTransHandle const &handle); void handleClick(SPKnot *knot, guint state, SPSelTransHandle const &handle); void handleNewEvent(SPKnot *knot, NR::Point *position, guint state, SPSelTransHandle const &handle); diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index f8fb5ca78..b2b0f7b05 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -78,7 +78,7 @@ static void sp_genericellipse_set_shape(SPShape *shape); static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape::XML::Node *repr, guint flags); -static bool sp_arc_set_elliptical_path_attribute(SPArc *arc, Inkscape::XML::Node *repr); +static gboolean sp_arc_set_elliptical_path_attribute(SPArc *arc, Inkscape::XML::Node *repr); static SPShapeClass *ge_parent_class; @@ -655,7 +655,7 @@ sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) * See SVG 1.0 Specification W3C Recommendation * ``F.6 Ellptical arc implementation notes'' for more detail. */ -static bool +static gboolean sp_arc_set_elliptical_path_attribute(SPArc *arc, Inkscape::XML::Node *repr) { gint fa, fs; diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index ed15e2fa3..ccaf81649 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -221,7 +221,7 @@ void sp_guide_hide(SPGuide *guide, SPCanvas *canvas) g_assert_not_reached(); } -void sp_guide_sensitize(SPGuide *guide, SPCanvas *canvas, bool sensitive) +void sp_guide_sensitize(SPGuide *guide, SPCanvas *canvas, gboolean sensitive) { g_assert(guide != NULL); g_assert(SP_IS_GUIDE(guide)); diff --git a/src/sp-guide.h b/src/sp-guide.h index 2a12225be..a3b876483 100644 --- a/src/sp-guide.h +++ b/src/sp-guide.h @@ -41,7 +41,7 @@ GType sp_guide_get_type(); void sp_guide_show(SPGuide *guide, SPCanvasGroup *group, GCallback handler); void sp_guide_hide(SPGuide *guide, SPCanvas *canvas); -void sp_guide_sensitize(SPGuide *guide, SPCanvas *canvas, bool sensitive); +void sp_guide_sensitize(SPGuide *guide, SPCanvas *canvas, gboolean sensitive); double sp_guide_position_from_pt(SPGuide const *guide, NR::Point const &pt); void sp_guide_moveto(SPGuide const &guide, gdouble const position, bool const commit); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index fe480b22b..5804089e6 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -119,7 +119,7 @@ namespace IO { class PushPull { public: - bool first; + gboolean first; FILE* fp; guchar* scratch; gsize size; @@ -135,9 +135,9 @@ public: offset(0), loader(0) {}; - bool readMore() + gboolean readMore() { - bool good = FALSE; + gboolean good = FALSE; if ( offset ) { g_memmove( scratch, scratch + offset, used - offset ); @@ -211,7 +211,7 @@ void user_read_data( png_structp png_ptr, png_bytep data, png_size_t length ) PushPull* youme = (PushPull*)png_get_io_ptr(png_ptr); gsize filled = 0; - bool canRead = TRUE; + gboolean canRead = TRUE; while ( filled < length && canRead ) { @@ -254,8 +254,8 @@ GdkPixbuf* pixbuf_new_from_file( const char *filename, GError **error ) // short buffer guchar scratch[1024]; - bool latter = FALSE; - bool isPng = FALSE; + gboolean latter = FALSE; + gboolean isPng = FALSE; png_structp pngPtr = NULL; png_infop infoPtr = NULL; //png_infop endPtr = NULL; @@ -375,7 +375,7 @@ GdkPixbuf* pixbuf_new_from_file( const char *filename, GError **error ) } } - bool ok = gdk_pixbuf_loader_close(loader, &err); + gboolean ok = gdk_pixbuf_loader_close(loader, &err); if ( ok ) { buf = gdk_pixbuf_loader_get_pixbuf( loader ); diff --git a/src/sp-metrics.cpp b/src/sp-metrics.cpp index 4c2016881..5f05c9fad 100644 --- a/src/sp-metrics.cpp +++ b/src/sp-metrics.cpp @@ -69,7 +69,7 @@ sp_absolute_metric_to_metric (gdouble length_src, const SPMetric metric_src, con GString * sp_metric_to_metric_string(gdouble const length, SPMetric const metric_src, SPMetric const metric_dst, - bool const m) + gboolean const m) { gdouble const len = sp_absolute_metric_to_metric(length, metric_src, metric_dst); GString *str = g_string_new(""); diff --git a/src/sp-metrics.h b/src/sp-metrics.h index 07818f848..23c1b6c13 100644 --- a/src/sp-metrics.h +++ b/src/sp-metrics.h @@ -6,7 +6,7 @@ #include "sp-metric.h" gdouble sp_absolute_metric_to_metric (gdouble length_src, const SPMetric metric_src, const SPMetric metric_dst); -GString * sp_metric_to_metric_string (gdouble length, const SPMetric metric_src, const SPMetric metric_dst, bool m); +GString * sp_metric_to_metric_string (gdouble length, const SPMetric metric_src, const SPMetric metric_dst, gboolean m); // convenience since we mostly deal with points #define SP_METRIC_TO_PT(l,m) sp_absolute_metric_to_metric(l,m,SP_PT); diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 3757dcf7f..f3dea40c7 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -57,9 +57,9 @@ static void sp_namedview_setup_guides(SPNamedView * nv); static void sp_namedview_setup_grid(SPNamedView * nv); static void sp_namedview_setup_grid_item(SPNamedView * nv, SPCanvasItem * item); -static bool sp_str_to_bool(const gchar *str); -static bool sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit); -static bool sp_nv_read_opacity(const gchar *str, guint32 *color); +static gboolean sp_str_to_bool(const gchar *str); +static gboolean sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit); +static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color); static SPObjectGroupClass * parent_class; @@ -687,7 +687,7 @@ void sp_namedview_document_from_window(SPDesktop *desktop) NR::Rect const r = desktop->get_display_area(); // saving window geometry is not undoable - bool saved = sp_document_get_undo_sensitive(sp_desktop_document(desktop)); + gboolean saved = sp_document_get_undo_sensitive(sp_desktop_document(desktop)); sp_document_set_undo_sensitive(sp_desktop_document(desktop), FALSE); sp_repr_set_svg_double(view, "inkscape:zoom", desktop->current_zoom()); @@ -734,7 +734,7 @@ void SPNamedView::hide(SPDesktop const *desktop) gridviews = g_slist_remove(gridviews, l->data); } -void SPNamedView::activateGuides(gpointer desktop, bool active) +void SPNamedView::activateGuides(gpointer desktop, gboolean active) { g_assert(desktop != NULL); g_assert(g_slist_find(views, desktop)); @@ -771,7 +771,7 @@ void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr) v = !v; } - bool saved = sp_document_get_undo_sensitive(doc); + gboolean saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, FALSE); sp_repr_set_boolean(repr, "showguides", v); @@ -786,7 +786,7 @@ void sp_namedview_toggle_grid(SPDocument *doc, Inkscape::XML::Node *repr) sp_repr_get_boolean(repr, "showgrid", &v); v = !v; - bool saved = sp_document_get_undo_sensitive(doc); + gboolean saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, FALSE); sp_repr_set_boolean(repr, "showgrid", v); @@ -840,7 +840,7 @@ GSList const *SPNamedView::getViewList() const /* This should be moved somewhere */ -static bool sp_str_to_bool(const gchar *str) +static gboolean sp_str_to_bool(const gchar *str) { if (str) { if (!g_strcasecmp(str, "true") || @@ -856,7 +856,7 @@ static bool sp_str_to_bool(const gchar *str) /* fixme: Collect all these length parsing methods and think common sane API */ -static bool sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit) +static gboolean sp_nv_read_length(const gchar *str, guint base, gdouble *val, const SPUnit **unit) { if (!str) { return FALSE; @@ -906,7 +906,7 @@ static bool sp_nv_read_length(const gchar *str, guint base, gdouble *val, const return FALSE; } -static bool sp_nv_read_opacity(const gchar *str, guint32 *color) +static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color) { if (!str) { return FALSE; diff --git a/src/sp-namedview.h b/src/sp-namedview.h index b60fb5617..54291413e 100644 --- a/src/sp-namedview.h +++ b/src/sp-namedview.h @@ -85,7 +85,7 @@ struct SPNamedView : public SPObjectGroup { void show(SPDesktop *desktop); void hide(SPDesktop const *desktop); - void activateGuides(gpointer desktop, bool active); + void activateGuides(gpointer desktop, gboolean active); gchar const *getName() const; guint getViewCount(); GSList const *getViewList() const; diff --git a/src/sp-object.cpp b/src/sp-object.cpp index f3e6d2164..62a442d0a 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -825,7 +825,7 @@ sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::No /* Redefine ID, if required */ if ((id == NULL) || (strcmp(id, realid) != 0)) { - bool undo_sensitive=sp_document_get_undo_sensitive(document); + gboolean undo_sensitive=sp_document_get_undo_sensitive(document); sp_document_set_undo_sensitive(document, FALSE); object->repr->setAttribute("id", realid); sp_document_set_undo_sensitive(document, undo_sensitive); diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp index 8c853bcd6..56cbfefde 100644 --- a/src/sp-polygon.cpp +++ b/src/sp-polygon.cpp @@ -137,7 +137,7 @@ static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::No } -static bool polygon_get_value(gchar const **p, gdouble *v) +static gboolean polygon_get_value(gchar const **p, gdouble *v) { while (**p != '\0' && (**p == ',' || **p == '\x20' || **p == '\x9' || **p == '\xD' || **p == '\xA')) { (*p)++; @@ -170,7 +170,7 @@ static void sp_polygon_set(SPObject *object, unsigned int key, const gchar *valu break; } SPCurve *curve = sp_curve_new(); - bool hascpt = FALSE; + gboolean hascpt = FALSE; gchar const *cptr = value; bool has_error = false; diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp index 265b2b797..54a38ccd1 100644 --- a/src/sp-polyline.cpp +++ b/src/sp-polyline.cpp @@ -101,7 +101,7 @@ sp_polyline_set (SPObject *object, unsigned int key, const gchar *value) SPCurve * curve; const gchar * cptr; char * eptr; - bool hascpt; + gboolean hascpt; if (!value) break; curve = sp_curve_new (); diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index e28664888..edcea21a2 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -311,7 +311,7 @@ sp_rect_position_set(SPRect *rect, gdouble x, gdouble y, gdouble width, gdouble } void -sp_rect_set_rx(SPRect *rect, bool set, gdouble value) +sp_rect_set_rx(SPRect *rect, gboolean set, gdouble value) { g_return_if_fail(rect != NULL); g_return_if_fail(SP_IS_RECT(rect)); @@ -323,7 +323,7 @@ sp_rect_set_rx(SPRect *rect, bool set, gdouble value) } void -sp_rect_set_ry(SPRect *rect, bool set, gdouble value) +sp_rect_set_ry(SPRect *rect, gboolean set, gdouble value) { g_return_if_fail(rect != NULL); g_return_if_fail(SP_IS_RECT(rect)); diff --git a/src/sp-rect.h b/src/sp-rect.h index bef99470b..4cf3b24ba 100644 --- a/src/sp-rect.h +++ b/src/sp-rect.h @@ -47,8 +47,8 @@ GType sp_rect_get_type (void); void sp_rect_position_set (SPRect * rect, gdouble x, gdouble y, gdouble width, gdouble height); /* If SET if FALSE, VALUE is just ignored */ -void sp_rect_set_rx(SPRect * rect, bool set, gdouble value); -void sp_rect_set_ry(SPRect * rect, bool set, gdouble value); +void sp_rect_set_rx(SPRect * rect, gboolean set, gdouble value); +void sp_rect_set_ry(SPRect * rect, gboolean set, gdouble value); void sp_rect_set_visible_rx (SPRect *rect, gdouble rx); void sp_rect_set_visible_ry (SPRect *rect, gdouble ry); diff --git a/src/spiral-context.cpp b/src/spiral-context.cpp index fcc8aa9db..1dc6bd6cb 100644 --- a/src/spiral-context.cpp +++ b/src/spiral-context.cpp @@ -252,7 +252,7 @@ sp_spiral_context_set(SPEventContext *ec, gchar const *key, gchar const *val) static gint sp_spiral_context_root_handler(SPEventContext *event_context, GdkEvent *event) { - static bool dragging; + static gboolean dragging; SPDesktop *desktop = event_context->desktop; Inkscape::Selection *selection = sp_desktop_selection (desktop); diff --git a/src/star-context.cpp b/src/star-context.cpp index 612f5d5bb..74b252860 100644 --- a/src/star-context.cpp +++ b/src/star-context.cpp @@ -262,7 +262,7 @@ sp_star_context_set (SPEventContext *ec, const gchar *key, const gchar *val) static gint sp_star_context_root_handler(SPEventContext *event_context, GdkEvent *event) { - static bool dragging; + static gboolean dragging; SPDesktop *desktop = event_context->desktop; Inkscape::Selection *selection = sp_desktop_selection (desktop); diff --git a/src/svg-view.cpp b/src/svg-view.cpp index 254540aaa..22d9dd120 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -132,7 +132,7 @@ static gint arena_handler (SPCanvasArena *arena, NRArenaItem *ai, GdkEvent *event, SPSVGView *svgview) { static gdouble x, y; - static bool active = FALSE; + static gboolean active = FALSE; SPEvent spev; SPItem *spitem = (ai) ? (SPItem*)NR_ARENA_ITEM_GET_DATA (ai) : 0; diff --git a/src/svg/svg-color.cpp b/src/svg/svg-color.cpp index 6bbcdd884..372570883 100644 --- a/src/svg/svg-color.cpp +++ b/src/svg/svg-color.cpp @@ -235,7 +235,7 @@ internal_sp_svg_read_color(gchar const *str, gchar const **end_ptr, guint32 def) *end_ptr = str + i; } } else if (strneq(str, "rgb(", 4)) { - bool hasp, hasd; + gboolean hasp, hasd; gchar *s, *e; gdouble r, g, b; diff --git a/src/svg/svg-path.cpp b/src/svg/svg-path.cpp index b37814164..6598a5731 100644 --- a/src/svg/svg-path.cpp +++ b/src/svg/svg-path.cpp @@ -63,7 +63,7 @@ struct RSVGParsePathCtx { double spx, spy; /* beginning of current subpath point */ char cmd; /* current command (lowercase) */ int param; /* parameter number */ - bool rel; /* true if relative coords */ + gboolean rel; /* true if relative coords */ double params[7]; /* parameters that have been parsed */ }; @@ -221,7 +221,7 @@ static void rsvg_parse_path_default_xy(RSVGParsePathCtx *ctx, int n_params) } } -static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, bool final) +static void rsvg_parse_path_do_cmd(RSVGParsePathCtx *ctx, gboolean final) { double x1, y1, x2, y2, x3, y3; @@ -455,10 +455,10 @@ static void rsvg_parse_path_data(RSVGParsePathCtx *ctx, const char *data) int i = 0; double val = 0; char c = 0; - bool in_num = FALSE; - bool in_frac = FALSE; - bool in_exp = FALSE; - bool exp_wait_sign = FALSE; + gboolean in_num = FALSE; + gboolean in_frac = FALSE; + gboolean in_exp = FALSE; + gboolean exp_wait_sign = FALSE; int sign = 0; int exp = 0; int exp_sign = 0; diff --git a/src/ui/dialog/dialog.cpp b/src/ui/dialog/dialog.cpp index 1a4816c88..074ee0d36 100644 --- a/src/ui/dialog/dialog.cpp +++ b/src/ui/dialog/dialog.cpp @@ -36,7 +36,7 @@ namespace UI { namespace Dialog { #ifndef WIN32 -static bool +static gboolean sp_retransientize_again (gpointer dlgPtr) { Dialog *dlg = (Dialog *)dlgPtr; diff --git a/src/ui/view/view-widget.h b/src/ui/view/view-widget.h index 6c66ff64e..9b5e9c4a8 100644 --- a/src/ui/view/view-widget.h +++ b/src/ui/view/view-widget.h @@ -61,7 +61,7 @@ class SPViewWidget { sp_view_widget_set_view(this, view); } - bool shutdown() { + gboolean shutdown() { return sp_view_widget_shutdown(this); } @@ -80,7 +80,7 @@ class SPViewWidgetClass { /// Virtual method about view size change void (* view_resized) (SPViewWidget *vw, Inkscape::UI::View::View *view, gdouble width, gdouble height); - bool (* shutdown) (SPViewWidget *vw); + gboolean (* shutdown) (SPViewWidget *vw); }; #endif diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 1f688fc38..4ac73e484 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -94,7 +94,7 @@ RegisteredCheckButton::on_toggled() Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt)); _wr->setUpdating (true); - bool saved = sp_document_get_undo_sensitive (doc); + gboolean saved = sp_document_get_undo_sensitive (doc); sp_document_set_undo_sensitive (doc, FALSE); sp_repr_set_boolean(repr, _key.c_str(), _button->get_active()); doc->rroot->setAttribute("sodipodi:modified", "true"); @@ -152,7 +152,7 @@ RegisteredUnitMenu::on_changed() _wr->setUpdating (true); SPDocument *doc = sp_desktop_document(dt); - bool saved = sp_document_get_undo_sensitive (doc); + gboolean saved = sp_document_get_undo_sensitive (doc); sp_document_set_undo_sensitive (doc, FALSE); Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt)); repr->setAttribute(_key.c_str(), os.str().c_str()); @@ -220,7 +220,7 @@ RegisteredScalarUnit::on_value_changed() _wr->setUpdating (true); SPDocument *doc = sp_desktop_document(dt); - bool saved = sp_document_get_undo_sensitive (doc); + gboolean saved = sp_document_get_undo_sensitive (doc); sp_document_set_undo_sensitive (doc, FALSE); Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt)); repr->setAttribute(_key.c_str(), os.str().c_str()); @@ -395,7 +395,7 @@ RegisteredRadioButtonPair::on_value_changed() bool second = _rb2->get_active(); SPDocument *doc = sp_desktop_document(dt); - bool saved = sp_document_get_undo_sensitive (doc); + gboolean saved = sp_document_get_undo_sensitive (doc); sp_document_set_undo_sensitive (doc, FALSE); Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt)); repr->setAttribute(_key.c_str(), second ? "true" : "false"); diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index 792c84efb..b7839284a 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -163,7 +163,7 @@ ToleranceSlider::update (double val) _wr->setUpdating (true); SPDocument *doc = sp_desktop_document(dt); - bool saved = sp_document_get_undo_sensitive (doc); + gboolean saved = sp_document_get_undo_sensitive (doc); sp_document_set_undo_sensitive (doc, FALSE); Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt)); repr->setAttribute(_key.c_str(), os.str().c_str()); diff --git a/src/version.cpp b/src/version.cpp index 2812af3d4..edaa600db 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -15,7 +15,7 @@ #include #include "version.h" -bool sp_version_from_string(const gchar *string, Inkscape::Version *version) +gboolean sp_version_from_string(const gchar *string, Inkscape::Version *version) { if (!string) { return FALSE; @@ -34,7 +34,7 @@ gchar *sp_version_to_string(Inkscape::Version version) return g_strdup_printf("%u.%u", version.major, version.minor); } -bool sp_version_inside_range(Inkscape::Version version, +gboolean sp_version_inside_range(Inkscape::Version version, unsigned major_min, unsigned minor_min, unsigned major_max, unsigned minor_max) { diff --git a/src/version.h b/src/version.h index 7f708c1b8..750ef8e55 100644 --- a/src/version.h +++ b/src/version.h @@ -49,9 +49,9 @@ struct Version { #define SP_VERSION_IS_ZERO (v) (!(v).major && !(v).minor) -bool sp_version_from_string (const gchar *string, Inkscape::Version *version); +gboolean sp_version_from_string (const gchar *string, Inkscape::Version *version); gchar *sp_version_to_string (Inkscape::Version version); -bool sp_version_inside_range (Inkscape::Version version, +gboolean sp_version_inside_range (Inkscape::Version version, unsigned major_min, unsigned minor_min, unsigned major_max, unsigned minor_max); diff --git a/src/widgets/button.cpp b/src/widgets/button.cpp index e9f44a5d8..f9e854302 100644 --- a/src/widgets/button.cpp +++ b/src/widgets/button.cpp @@ -204,7 +204,7 @@ sp_button_new( Inkscape::IconSize size, SPButtonType type, SPAction *action, SPA } void -sp_button_toggle_set_down (SPButton *button, bool down) +sp_button_toggle_set_down (SPButton *button, gboolean down) { g_return_if_fail (button->type == SP_BUTTON_TYPE_TOGGLE); g_signal_handlers_block_by_func (G_OBJECT (button), (gpointer)G_CALLBACK (sp_button_perform_action), NULL); diff --git a/src/widgets/button.h b/src/widgets/button.h index 0d715053d..f14af94d1 100644 --- a/src/widgets/button.h +++ b/src/widgets/button.h @@ -53,7 +53,7 @@ GType sp_button_get_type (void); GtkWidget *sp_button_new (Inkscape::IconSize size, SPButtonType type, SPAction *action, SPAction *doubleclick_action, GtkTooltips *tooltips); -void sp_button_toggle_set_down (SPButton *button, bool down); +void sp_button_toggle_set_down (SPButton *button, gboolean down); GtkWidget *sp_button_new_from_data (Inkscape::IconSize size, SPButtonType type, diff --git a/src/widgets/desktop-widget.h b/src/widgets/desktop-widget.h index 6e00998f3..0514dd393 100644 --- a/src/widgets/desktop-widget.h +++ b/src/widgets/desktop-widget.h @@ -34,7 +34,7 @@ void sp_desktop_widget_destroy (SPDesktopWidget* dtw); gint sp_desktop_widget_set_focus(GtkWidget *widget, GdkEvent *event, SPDesktopWidget *dtw); -void sp_desktop_widget_show_decorations(SPDesktopWidget *dtw, bool show); +void sp_desktop_widget_show_decorations(SPDesktopWidget *dtw, gboolean show); void sp_desktop_widget_fullscreen(SPDesktopWidget *dtw); void sp_desktop_widget_layout(SPDesktopWidget *dtw); void sp_desktop_widget_update_zoom(SPDesktopWidget *dtw); diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp index 9e699d0b2..3177700c3 100644 --- a/src/widgets/gradient-selector.cpp +++ b/src/widgets/gradient-selector.cpp @@ -276,7 +276,7 @@ sp_gradient_selector_get_vector (SPGradientSelector *sel) static void sp_gradient_selector_vector_set (SPGradientVectorSelector *gvs, SPGradient *gr, SPGradientSelector *sel) { - static bool blocked = FALSE; + static gboolean blocked = FALSE; if (!blocked) { blocked = TRUE; diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index 81462f56a..78ae4213d 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -170,7 +170,7 @@ sp_gradient_vector_selector_new (SPDocument *doc, SPGradient *gr) void sp_gradient_vector_selector_set_gradient (SPGradientVectorSelector *gvs, SPDocument *doc, SPGradient *gr) { - static bool suppress = FALSE; + static gboolean suppress = FALSE; g_return_if_fail (gvs != NULL); g_return_if_fail (SP_IS_GRADIENT_VECTOR_SELECTOR (gvs)); @@ -418,7 +418,7 @@ sp_gvs_defs_modified (SPObject *defs, guint flags, SPGradientVectorSelector *gvs static GtkWidget *sp_gradient_vector_widget_new (SPGradient *gradient, SPStop *stop); static void sp_gradient_vector_widget_load_gradient (GtkWidget *widget, SPGradient *gradient); -static bool sp_gradient_vector_dialog_delete (GtkWidget *widget, GdkEvent *event, GtkWidget *dialog); +static gint sp_gradient_vector_dialog_delete (GtkWidget *widget, GdkEvent *event, GtkWidget *dialog); static void sp_gradient_vector_dialog_destroy (GtkObject *object, gpointer data); static void sp_gradient_vector_widget_destroy (GtkObject *object, gpointer data); @@ -428,7 +428,7 @@ static void sp_gradient_vector_color_dragged (SPColorSelector *csel, GtkObject * static void sp_gradient_vector_color_changed (SPColorSelector *csel, GtkObject *object); static void update_stop_list( GtkWidget *mnu, SPGradient *gradient, SPStop *new_stop); -static bool blocked = FALSE; +static gboolean blocked = FALSE; static void grad_edit_dia_stop_added_or_removed (Inkscape::XML::Node *repr, Inkscape::XML::Node *child, Inkscape::XML::Node *ref, gpointer data) { @@ -1025,7 +1025,7 @@ sp_gradient_vector_widget_load_gradient (GtkWidget *widget, SPGradient *gradient // Once the user edits a gradient, it stops being auto-collectable if (SP_OBJECT_REPR(gradient)->attribute("inkscape:collect")) { SPDocument *document = SP_OBJECT_DOCUMENT (gradient); - bool saved = sp_document_get_undo_sensitive(document); + gboolean saved = sp_document_get_undo_sensitive(document); sp_document_set_undo_sensitive (document, FALSE); SP_OBJECT_REPR(gradient)->setAttribute("inkscape:collect", NULL); sp_document_set_undo_sensitive (document, saved); @@ -1042,7 +1042,7 @@ sp_gradient_vector_dialog_destroy (GtkObject *object, gpointer data) wd.stop = 0; } -static bool +static gboolean sp_gradient_vector_dialog_delete (GtkWidget *widget, GdkEvent *event, GtkWidget *dialog) { gtk_window_get_position ((GtkWindow *) dlg, &x, &y); diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 0fadffdc8..264349bd1 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -273,7 +273,7 @@ sp_icon_new_full( Inkscape::IconSize lsize, gchar const *name ) addPreRender( lsize, name ); GtkStockItem stock; - bool tryLoad = gtk_stock_lookup( name, &stock ); + gboolean tryLoad = gtk_stock_lookup( name, &stock ); if ( !tryLoad && fallback ) { tryLoad |= strncmp("gtk-", name, 4 ) == 0; } diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index 025e6be66..2f42d590f 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -230,7 +230,7 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) } GtkWidget * -sp_select_toolbox_spinbutton(gchar *label, gchar *data, float lower_limit, GtkWidget *us, GtkWidget *spw, gchar *tooltip, bool altx) +sp_select_toolbox_spinbutton(gchar *label, gchar *data, float lower_limit, GtkWidget *us, GtkWidget *spw, gchar *tooltip, gboolean altx) { GtkTooltips *tt = gtk_tooltips_new(); @@ -262,7 +262,7 @@ sp_select_toolbox_spinbutton(gchar *label, gchar *data, float lower_limit, GtkWi return hb; } -static bool aux_set_unit(SPUnitSelector *, +static gboolean aux_set_unit(SPUnitSelector *, SPUnit const *old, SPUnit const *new_units, GObject *dlg) diff --git a/src/widgets/sp-color-notebook.cpp b/src/widgets/sp-color-notebook.cpp index b3fe62262..c14d89f11 100644 --- a/src/widgets/sp-color-notebook.cpp +++ b/src/widgets/sp-color-notebook.cpp @@ -34,8 +34,8 @@ struct SPColorNotebookTracker { const gchar* className; GType type; guint submode; - bool enabledFull; - bool enabledBrief; + gboolean enabledFull; + gboolean enabledBrief; SPColorNotebook *backPointer; }; @@ -154,7 +154,7 @@ gint ColorNotebook::menuHandler( GdkEvent* event ) static void sp_color_notebook_menuitem_response (GtkMenuItem *menuitem, gpointer user_data) { - bool active = FALSE; + gboolean active = FALSE; active = gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem)); SPColorNotebookTracker *entry = reinterpret_cast< SPColorNotebookTracker* > (user_data); @@ -267,7 +267,7 @@ void ColorNotebook::init() gtk_notebook_set_current_page (GTK_NOTEBOOK (_book), prefs_get_int_attribute ("colorselector", "page", 0)); { - bool found = FALSE; + gboolean found = FALSE; _popup = gtk_menu_new(); GtkMenu *menu = GTK_MENU (_popup); @@ -493,7 +493,7 @@ void ColorNotebook::_entryGrabbed (SPColorSelector *, SPColorNotebook *colorbook void ColorNotebook::_entryDragged (SPColorSelector *csel, SPColorNotebook *colorbook) { - bool oldState; + gboolean oldState; ColorNotebook* nb = (ColorNotebook*)(SP_COLOR_SELECTOR(colorbook)->base); oldState = nb->_dragging; @@ -512,7 +512,7 @@ void ColorNotebook::_entryReleased (SPColorSelector *, SPColorNotebook *colorboo void ColorNotebook::_entryChanged (SPColorSelector *csel, SPColorNotebook *colorbook) { - bool oldState; + gboolean oldState; ColorNotebook* nb = (ColorNotebook*)(SP_COLOR_SELECTOR(colorbook)->base); oldState = nb->_dragging; diff --git a/src/widgets/sp-color-notebook.h b/src/widgets/sp-color-notebook.h index dae2767ec..ad79437da 100644 --- a/src/widgets/sp-color-notebook.h +++ b/src/widgets/sp-color-notebook.h @@ -54,9 +54,9 @@ protected: void _rgbaEntryChanged( GtkEntry* entry ); void _updateRgbaEntry( const SPColor& color, gfloat alpha ); - bool _updating : 1; - bool _updatingrgba : 1; - bool _dragging : 1; + gboolean _updating : 1; + gboolean _updatingrgba : 1; + gboolean _dragging : 1; gulong _switchId; gulong _entryId; GtkWidget *_book; diff --git a/src/widgets/sp-color-scales.cpp b/src/widgets/sp-color-scales.cpp index ddfb40a8f..8acd96bbb 100644 --- a/src/widgets/sp-color-scales.cpp +++ b/src/widgets/sp-color-scales.cpp @@ -214,7 +214,7 @@ sp_color_scales_new (void) return GTK_WIDGET (csel); } -void ColorScales::_recalcColor( bool changing ) +void ColorScales::_recalcColor( gboolean changing ) { if ( changing ) { diff --git a/src/widgets/sp-color-scales.h b/src/widgets/sp-color-scales.h index e7d94ab37..efb557f9b 100644 --- a/src/widgets/sp-color-scales.h +++ b/src/widgets/sp-color-scales.h @@ -53,14 +53,14 @@ protected: void _getCmykaFloatv(gfloat *cmyka); guint32 _getRgba32(); void _updateSliders(guint channels); - void _recalcColor(bool changing); + void _recalcColor(gboolean changing); void _setRangeLimit( gdouble upper ); SPColorScalesMode _mode; gdouble _rangeLimit; - bool _updating : 1; - bool _dragging : 1; + gboolean _updating : 1; + gboolean _dragging : 1; GtkAdjustment *_a[5]; /* Channel adjustments */ GtkWidget *_s[5]; /* Channel sliders */ GtkWidget *_b[5]; /* Spinbuttons */ diff --git a/src/widgets/sp-color-selector.cpp b/src/widgets/sp-color-selector.cpp index b4af6bf86..1532eddd7 100644 --- a/src/widgets/sp-color-selector.cpp +++ b/src/widgets/sp-color-selector.cpp @@ -171,7 +171,7 @@ SPColorSpaceType ColorSelector::getColorspace() const return type; } -bool ColorSelector::setColorspace( SPColorSpaceType colorspace ) +gboolean ColorSelector::setColorspace( SPColorSpaceType colorspace ) { return false; } @@ -262,14 +262,14 @@ void ColorSelector::_released() } // Called from subclasses to update color and broadcast if needed -void ColorSelector::_updateInternals( const SPColor& color, gfloat alpha, bool held ) +void ColorSelector::_updateInternals( const SPColor& color, gfloat alpha, gboolean held ) { g_return_if_fail( ( 0.0 <= alpha ) && ( alpha <= 1.0 ) ); - bool colorDifferent = ( !sp_color_is_close( &color, &_color, _epsilon ) + gboolean colorDifferent = ( !sp_color_is_close( &color, &_color, _epsilon ) || ( fabs((_alpha) - (alpha)) >= _epsilon ) ); - bool grabbed = held && !_held; - bool released = !held && _held; + gboolean grabbed = held && !_held; + gboolean released = !held && _held; // Store these before emmiting any signals _held = held; diff --git a/src/widgets/sp-color-selector.h b/src/widgets/sp-color-selector.h index 5739f7f15..b2fd62b1e 100644 --- a/src/widgets/sp-color-selector.h +++ b/src/widgets/sp-color-selector.h @@ -32,13 +32,13 @@ public: virtual guint getSubmode() const; virtual SPColorSpaceType getColorspace() const; - virtual bool setColorspace( SPColorSpaceType colorspace ); + virtual gboolean setColorspace( SPColorSpaceType colorspace ); protected: void _grabbed(); void _released(); - void _updateInternals( const SPColor& color, gfloat alpha, bool held ); - bool _isHeld() const { return _held; } + void _updateInternals( const SPColor& color, gfloat alpha, gboolean held ); + gboolean _isHeld() const { return _held; } virtual void _colorChanged( const SPColor& color, gfloat alpha ); @@ -53,7 +53,7 @@ private: ColorSelector( const ColorSelector& obj ); ColorSelector& operator=( const ColorSelector& obj ); - bool _held; + gboolean _held; bool virgin; // if true, no color is set yet }; diff --git a/src/widgets/sp-color-wheel-selector.h b/src/widgets/sp-color-wheel-selector.h index 2e3d7ac12..de358d5ac 100644 --- a/src/widgets/sp-color-wheel-selector.h +++ b/src/widgets/sp-color-wheel-selector.h @@ -36,10 +36,10 @@ protected: static void _fooChanged( GtkWidget foo, SPColorWheelSelector *cs ); - void _recalcColor( bool changing ); + void _recalcColor( gboolean changing ); - bool _updating : 1; - bool _dragging : 1; + gboolean _updating : 1; + gboolean _dragging : 1; GtkAdjustment* _adj; /* Channel adjustment */ GtkWidget* _wheel; GtkWidget* _slider; diff --git a/src/widgets/sp-color-wheel.cpp b/src/widgets/sp-color-wheel.cpp index bf6510287..9038b6d38 100644 --- a/src/widgets/sp-color-wheel.cpp +++ b/src/widgets/sp-color-wheel.cpp @@ -47,7 +47,8 @@ static void sp_color_wheel_render_hue_wheel (SPColorWheel *wheel); static void sp_color_wheel_render_triangle (SPColorWheel *wheel); -static gboolean sp_color_wheel_focus(GtkWidget *widget, GtkDirectionType direction); +static gboolean sp_color_wheel_focus(GtkWidget *widget, + GtkDirectionType direction); static void sp_color_wheel_process_in_triangle( SPColorWheel *wheel, gdouble x, gdouble y ); @@ -225,7 +226,7 @@ void sp_color_wheel_set_color( SPColorWheel *wheel, const SPColor* color ) sp_color_wheel_set_sv(wheel, sat, val); } -bool sp_color_wheel_is_adjusting( SPColorWheel *wheel ) +gboolean sp_color_wheel_is_adjusting( SPColorWheel *wheel ) { g_return_val_if_fail( SP_IS_COLOR_WHEEL(wheel), FALSE ); return wheel->dragging; @@ -334,7 +335,7 @@ sp_color_wheel_button_press (GtkWidget *widget, GdkEventButton *event) gint cx, cw; cx = widget->style->xthickness; cw = widget->allocation.width - 2 * cx; - bool grabbed = FALSE; + gboolean grabbed = FALSE; { double dx = event->x - wheel->_center; @@ -453,7 +454,7 @@ static void sp_color_wheel_set_hue(SPColorWheel *wheel, gdouble hue) static void sp_color_wheel_set_sv( SPColorWheel *wheel, gdouble sat, gdouble value ) { static gdouble epsilon = 1e-6; - bool changed = FALSE; + gboolean changed = FALSE; if ( ABS( wheel->_sat - sat ) > epsilon ) { @@ -1015,7 +1016,7 @@ sp_color_wheel_render_hue_wheel (SPColorWheel *wheel) gint x, y; guint r, g, b; gint size = wheel->_center * 2; - bool dirty = FALSE; + gboolean dirty = FALSE; if (wheel->_image && (wheel->_bs < (size * size) )) { g_free (wheel->_image); @@ -1086,10 +1087,10 @@ sp_color_wheel_render_hue_wheel (SPColorWheel *wheel) static gboolean sp_color_wheel_focus(GtkWidget *widget, GtkDirectionType direction) { - bool focusKept = FALSE; - bool wasFocused = GTK_WIDGET_HAS_FOCUS(widget); + gboolean focusKept = FALSE; + gboolean wasFocused = GTK_WIDGET_HAS_FOCUS(widget); SPColorWheel* wheel = SP_COLOR_WHEEL(widget); - bool goingUp = FALSE; + gboolean goingUp = FALSE; switch ( direction ) { diff --git a/src/widgets/sp-color-wheel.h b/src/widgets/sp-color-wheel.h index 5b01f1a88..d8fceb908 100644 --- a/src/widgets/sp-color-wheel.h +++ b/src/widgets/sp-color-wheel.h @@ -29,10 +29,10 @@ struct SPColorWheel { GtkWidget widget; - bool dragging : 1; + gboolean dragging : 1; - bool _inTriangle; - bool _triDirty; + gboolean _inTriangle; + gboolean _triDirty; GdkRegion* _triangle; GdkPoint _triPoints[3]; guchar *_triImage; @@ -64,7 +64,7 @@ GtkWidget *sp_color_wheel_new (); void sp_color_wheel_get_color( SPColorWheel *wheel, SPColor* color ); void sp_color_wheel_set_color( SPColorWheel *wheel, const SPColor* color ); -bool sp_color_wheel_is_adjusting( SPColorWheel *wheel ); +gboolean sp_color_wheel_is_adjusting( SPColorWheel *wheel ); #endif diff --git a/src/widgets/spinbutton-events.cpp b/src/widgets/spinbutton-events.cpp index 893a7a7e0..14ac51422 100644 --- a/src/widgets/spinbutton-events.cpp +++ b/src/widgets/spinbutton-events.cpp @@ -22,7 +22,7 @@ #include "widget-sizes.h" -bool +gboolean spinbutton_focus_in (GtkWidget *w, GdkEventKey *event, gpointer data) { gdouble *ini; @@ -51,7 +51,7 @@ void spinbutton_defocus (GtkObject *container) { // defocus spinbuttons by moving focus to the canvas, unless "stay" is on - bool stay = GPOINTER_TO_INT(gtk_object_get_data (GTK_OBJECT (container), "stay")); + gboolean stay = GPOINTER_TO_INT(gtk_object_get_data (GTK_OBJECT (container), "stay")); if (stay) { gtk_object_set_data (GTK_OBJECT (container), "stay", GINT_TO_POINTER (FALSE)); } else { @@ -62,7 +62,7 @@ spinbutton_defocus (GtkObject *container) } } -bool +gboolean spinbutton_keypress (GtkWidget *w, GdkEventKey *event, gpointer data) { SPWidget *spw = (SPWidget *) data; diff --git a/src/widgets/spinbutton-events.h b/src/widgets/spinbutton-events.h index eaa999b00..868bc195a 100644 --- a/src/widgets/spinbutton-events.h +++ b/src/widgets/spinbutton-events.h @@ -13,9 +13,9 @@ #include /* GtkWidget */ #include /* GtkObject */ -bool spinbutton_focus_in (GtkWidget *w, GdkEventKey *event, gpointer data); +gboolean spinbutton_focus_in (GtkWidget *w, GdkEventKey *event, gpointer data); void spinbutton_undo (GtkWidget *w); -bool spinbutton_keypress (GtkWidget *w, GdkEventKey *event, gpointer data); +gboolean spinbutton_keypress (GtkWidget *w, GdkEventKey *event, gpointer data); void spinbutton_defocus (GtkObject *container); /* diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index e42f58954..ed9259aef 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -775,7 +775,7 @@ sp_tb_spinbutton( gchar const *path, gchar const *data, gdouble def, GtkWidget *us, GtkWidget *tbl, - bool altx, gchar const *altx_mark, + gboolean altx, gchar const *altx_mark, gdouble lower, gdouble upper, gdouble step, gdouble page, void (*callback)(GtkAdjustment *, GtkWidget *), gdouble climb = 0.1, guint digits = 3, double factor = 1.0) @@ -1155,7 +1155,7 @@ sp_stb_defaults(GtkWidget *widget, GtkWidget *tbl) // fixme: make settable in prefs! gint mag = 5; gdouble prop = 0.5; - bool flat = FALSE; + gboolean flat = FALSE; gdouble randomized = 0; gdouble rounded = 0; diff --git a/src/xml/repr-io.cpp b/src/xml/repr-io.cpp index d4eea0835..10f6101b6 100644 --- a/src/xml/repr-io.cpp +++ b/src/xml/repr-io.cpp @@ -36,9 +36,9 @@ using Inkscape::XML::AttributeRecord; static Document *sp_repr_do_read (xmlDocPtr doc, const gchar *default_ns); static Node *sp_repr_svg_read_node (xmlNodePtr node, const gchar *default_ns, GHashTable *prefix_map); static gint sp_repr_qualified_name (gchar *p, gint len, xmlNsPtr ns, const xmlChar *name, const gchar *default_ns, GHashTable *prefix_map); -static void sp_repr_write_stream_root_element (Node *repr, Writer &out, bool add_whitespace, gchar const *default_ns); -static void sp_repr_write_stream (Node *repr, Writer &out, gint indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix); -static void sp_repr_write_stream_element (Node *repr, Writer &out, gint indent_level, bool add_whitespace, Glib::QueryQuark elide_prefix, List attributes); +static void sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitespace, gchar const *default_ns); +static void sp_repr_write_stream (Node *repr, Writer &out, gint indent_level, gboolean add_whitespace, Glib::QueryQuark elide_prefix); +static void sp_repr_write_stream_element (Node *repr, Writer &out, gint indent_level, gboolean add_whitespace, Glib::QueryQuark elide_prefix, List attributes); #ifdef HAVE_LIBWMF static xmlDocPtr sp_wmf_convert (const char * file_name); @@ -539,7 +539,7 @@ sp_repr_save_stream (Document *doc, FILE *fp, gchar const *default_ns, bool comp /* Returns TRUE if file successfully saved; FALSE if not */ -bool +gboolean sp_repr_save_file (Document *doc, const gchar *filename, gchar const *default_ns) { @@ -667,7 +667,7 @@ void populate_ns_map(NSMap &ns_map, Node &repr) { } void -sp_repr_write_stream_root_element (Node *repr, Writer &out, bool add_whitespace, gchar const *default_ns) +sp_repr_write_stream_root_element (Node *repr, Writer &out, gboolean add_whitespace, gchar const *default_ns) { using Inkscape::Util::ptr_shared; g_assert(repr != NULL); @@ -710,7 +710,7 @@ sp_repr_write_stream_root_element (Node *repr, Writer &out, bool add_whitespace, void sp_repr_write_stream (Node *repr, Writer &out, gint indent_level, - bool add_whitespace, Glib::QueryQuark elide_prefix) + gboolean add_whitespace, Glib::QueryQuark elide_prefix) { if (repr->type() == Inkscape::XML::TEXT_NODE) { repr_quote_write (out, repr->content()); @@ -725,12 +725,12 @@ sp_repr_write_stream (Node *repr, Writer &out, gint indent_level, void sp_repr_write_stream_element (Node * repr, Writer & out, gint indent_level, - bool add_whitespace, + gboolean add_whitespace, Glib::QueryQuark elide_prefix, List attributes) { Node *child; - bool loose; + gboolean loose; gint i; g_return_if_fail (repr != NULL); diff --git a/src/xml/repr.h b/src/xml/repr.h index c30dcf66a..7d2f7d474 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -180,7 +180,7 @@ inline Inkscape::XML::Node *sp_repr_next(Inkscape::XML::Node *repr) { Inkscape::XML::Document *sp_repr_read_file(gchar const *filename, gchar const *default_ns); Inkscape::XML::Document *sp_repr_read_mem(gchar const *buffer, int length, gchar const *default_ns); void sp_repr_save_stream(Inkscape::XML::Document *doc, FILE *to_file, gchar const *default_ns=NULL, bool compress = false); -bool sp_repr_save_file(Inkscape::XML::Document *doc, gchar const *filename, gchar const *default_ns=NULL); +gboolean sp_repr_save_file(Inkscape::XML::Document *doc, gchar const *filename, gchar const *default_ns=NULL); void sp_repr_print(Inkscape::XML::Node *repr);