From: kidproto Date: Fri, 25 Aug 2006 02:06:50 +0000 (+0000) Subject: I peeled back my changes because of some deep error. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f903f7d86c33cbf4d57cb4052158d3452289b579;p=inkscape.git I peeled back my changes because of some deep error. --- diff --git a/src/dialogs/eek-preview.cpp b/src/dialogs/eek-preview.cpp index 15b1990f9..0108d4777 100644 --- a/src/dialogs/eek-preview.cpp +++ b/src/dialogs/eek-preview.cpp @@ -100,8 +100,6 @@ static void eek_preview_size_request( GtkWidget* widget, GtkRequisition* req ) gint width = 0; gint height = 0; EekPreview* preview = EEK_PREVIEW(widget); - // JON: keeping this gboolean because it is legacy c-based code - // TODO: convert to bool gboolean worked = gtk_icon_size_lookup( preview->_size, &width, &height ); if ( !worked ) { width = 16; @@ -123,8 +121,7 @@ enum { static guint eek_preview_signals[LAST_SIGNAL] = { 0 }; -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool + gboolean eek_preview_expose_event( GtkWidget* widget, GdkEventExpose* event ) { /* g_message("Exposed!!! %s", GTK_WIDGET_HAS_FOCUS(widget) ? "XXX" : "---" ); */ @@ -271,8 +268,6 @@ gboolean eek_preview_expose_event( GtkWidget* widget, GdkEventExpose* event ) } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool static gboolean eek_preview_enter_cb( GtkWidget* widget, GdkEventCrossing* event ) { if ( gtk_get_event_widget( (GdkEvent*)event ) == widget ) { @@ -283,8 +278,6 @@ static gboolean eek_preview_enter_cb( GtkWidget* widget, GdkEventCrossing* event return FALSE; } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool static gboolean eek_preview_leave_cb( GtkWidget* widget, GdkEventCrossing* event ) { if ( gtk_get_event_widget( (GdkEvent*)event ) == widget ) { @@ -296,31 +289,21 @@ static gboolean eek_preview_leave_cb( GtkWidget* widget, GdkEventCrossing* event } /* -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool static gboolean eek_preview_focus_in_event( GtkWidget* widget, GdkEventFocus* event ) { g_message("focus IN"); - // JON: keeping this gboolean because it is legacy c-based code - // TODO: convert to bool gboolean blip = parent_class->focus_in_event ? parent_class->focus_in_event(widget, event) : FALSE; return blip; } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool static gboolean eek_preview_focus_out_event( GtkWidget* widget, GdkEventFocus* event ) { g_message("focus OUT"); - // JON: keeping this gboolean because it is legacy c-based code - // TODO: convert to bool gboolean blip = parent_class->focus_out_event ? parent_class->focus_out_event(widget, event) : FALSE; return blip; } */ -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool static gboolean eek_preview_button_press_cb( GtkWidget* widget, GdkEventButton* event ) { if ( gtk_get_event_widget( (GdkEvent*)event ) == widget ) { @@ -341,8 +324,6 @@ static gboolean eek_preview_button_press_cb( GtkWidget* widget, GdkEventButton* return FALSE; } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool static gboolean eek_preview_button_release_cb( GtkWidget* widget, GdkEventButton* event ) { if ( gtk_get_event_widget( (GdkEvent*)event ) == widget ) { @@ -350,8 +331,6 @@ static gboolean eek_preview_button_release_cb( GtkWidget* widget, GdkEventButton preview->_hot = FALSE; gtk_widget_set_state( widget, GTK_STATE_NORMAL ); if ( preview->_within && event->button == PRIME_BUTTON_MAGIC_NUMBER ) { - // JON: keeping this gboolean because it is legacy c-based code - // TODO: convert to bool gboolean isAlt = (event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK; if ( isAlt ) { @@ -364,16 +343,12 @@ static gboolean eek_preview_button_release_cb( GtkWidget* widget, GdkEventButton return FALSE; } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool gboolean eek_preview_key_press_event( GtkWidget* widget, GdkEventKey* event) { g_message("TICK"); return FALSE; } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool gboolean eek_preview_key_release_event( GtkWidget* widget, GdkEventKey* event) { g_message("tock"); @@ -412,8 +387,6 @@ static void eek_preview_set_property( GObject *object, case FOCUS_PROP_ID: { EekPreview* preview = EEK_PREVIEW( object ); - // JON: keeping this gboolean because it is legacy c-based code - // TODO: convert to bool gboolean val = g_value_get_boolean( value ); if ( val != preview->_takesFocus ) { preview->_takesFocus = val; @@ -430,13 +403,9 @@ static void eek_preview_set_property( GObject *object, } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool static gboolean eek_preview_popup_menu( GtkWidget* widget ) { /* g_message("Do the popup!"); */ - // JON: keeping this gboolean because it is legacy c-based code - // TODO: convert to bool gboolean blip = parent_class->popup_menu ? parent_class->popup_menu(widget) : FALSE; return blip; } @@ -550,15 +519,11 @@ LinkType eek_preview_get_linked( EekPreview* splat ) return (LinkType)splat->_linked; } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool gboolean eek_preview_get_focus_on_click( EekPreview* preview ) { return preview->_takesFocus; } -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool void eek_preview_set_focus_on_click( EekPreview* preview, gboolean focus_on_click ) { if ( focus_on_click != preview->_takesFocus ) { diff --git a/src/dialogs/eek-preview.h b/src/dialogs/eek-preview.h index a2799dd8c..114be8742 100644 --- a/src/dialogs/eek-preview.h +++ b/src/dialogs/eek-preview.h @@ -86,9 +86,7 @@ struct _EekPreview int _r; int _g; int _b; - - // JON: keeping this gboolean because it is legacy c-based code - // TODO: convert to bool + gboolean _hot; gboolean _within; gboolean _takesFocus; @@ -116,8 +114,6 @@ void eek_preview_set_color( EekPreview* splat, int r, int g, int b ); void eek_preview_set_linked( EekPreview* splat, LinkType link ); LinkType eek_preview_get_linked( EekPreview* splat ); -// JON: keeping this gboolean because it is legacy c-based code -// TODO: convert to bool gboolean eek_preview_get_focus_on_click( EekPreview* preview ); void eek_preview_set_focus_on_click( EekPreview* preview, gboolean focus_on_click ); diff --git a/src/dialogs/layers-panel.cpp b/src/dialogs/layers-panel.cpp index 2f5f4b89c..3a7463ff3 100644 --- a/src/dialogs/layers-panel.cpp +++ b/src/dialogs/layers-panel.cpp @@ -188,7 +188,7 @@ public: SPObject* _target; }; -static bool layers_panel_activated( GtkObject *object, GdkEvent * /*event*/, gpointer data ) +static gboolean layers_panel_activated( GtkObject *object, GdkEvent * /*event*/, gpointer data ) { if ( data ) { diff --git a/src/document.cpp b/src/document.cpp index ebc65830f..04d3a147c 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -66,8 +66,6 @@ static gint sp_document_idle_handler(gpointer data); -// JON: This must stay as gboolean because its used as a callback into -// our legacy c stuff in here. Would like to make bool gboolean sp_document_resource_list_free(gpointer key, gpointer value, gpointer data); static gint doc_count = 0; @@ -1108,8 +1106,6 @@ sigc::connection sp_document_resources_changed_connect(SPDocument *document, /* Helpers */ -// JON: This must stay this way because it is used as a callback for -// legacy glib code which needs to be moved to glibmm gboolean sp_document_resource_list_free(gpointer key, gpointer value, gpointer data) { diff --git a/src/extension/internal/pdf.cpp b/src/extension/internal/pdf.cpp index b732fc723..c35e4d217 100644 --- a/src/extension/internal/pdf.cpp +++ b/src/extension/internal/pdf.cpp @@ -225,7 +225,7 @@ PrintPDF::setup(Inkscape::Extension::Print * mod) unsigned int PrintPDF::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/system.cpp b/src/extension/system.cpp index 76a6f13e0..482d6c5ea 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -250,7 +250,7 @@ save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, if (official) { // save the filename for next use sp_document_set_uri(doc, fileName); - bool saved = sp_document_get_undo_sensitive(doc); + gboolean saved = sp_document_get_undo_sensitive(doc); // also save the extension for next use Inkscape::XML::Node *repr = sp_document_repr_root(doc); sp_document_set_undo_sensitive (doc, FALSE); diff --git a/src/helper/sp-marshal.cpp.mingw b/src/helper/sp-marshal.cpp.mingw index adbf0a3c7..8a7e7648c 100644 --- a/src/helper/sp-marshal.cpp.mingw +++ b/src/helper/sp-marshal.cpp.mingw @@ -65,7 +65,7 @@ sp_marshal_VOID__POINTER_BOOLEAN (GClosure *closure, { typedef void (*GMarshalFunc_VOID__POINTER_BOOLEAN) (gpointer data1, gpointer arg_1, - bool arg_2, + gboolean arg_2, gpointer data2); register GMarshalFunc_VOID__POINTER_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; @@ -213,7 +213,7 @@ sp_marshal_VOID__STRING_BOOLEAN (GClosure *closure, { typedef void (*GMarshalFunc_VOID__STRING_BOOLEAN) (gpointer data1, gpointer arg_1, - bool arg_2, + gboolean arg_2, gpointer data2); register GMarshalFunc_VOID__STRING_BOOLEAN callback; register GCClosure *cc = (GCClosure*) closure; @@ -248,12 +248,12 @@ sp_marshal_BOOLEAN__VOID (GClosure *closure, gpointer invocation_hint, gpointer marshal_data) { - typedef bool (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, + typedef gboolean (*GMarshalFunc_BOOLEAN__VOID) (gpointer data1, gpointer data2); register GMarshalFunc_BOOLEAN__VOID callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; - bool v_return; + gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 1); @@ -285,13 +285,13 @@ sp_marshal_BOOLEAN__UINT (GClosure *closure, gpointer invocation_hint, gpointer marshal_data) { - typedef bool (*GMarshalFunc_BOOLEAN__UINT) (gpointer data1, + typedef gboolean (*GMarshalFunc_BOOLEAN__UINT) (gpointer data1, guint arg_1, gpointer data2); register GMarshalFunc_BOOLEAN__UINT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; - bool v_return; + gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 2); @@ -324,13 +324,13 @@ sp_marshal_BOOLEAN__POINTER (GClosure *closure, gpointer invocation_hint, gpointer marshal_data) { - typedef bool (*GMarshalFunc_BOOLEAN__POINTER) (gpointer data1, + typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER) (gpointer data1, gpointer arg_1, gpointer data2); register GMarshalFunc_BOOLEAN__POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; - bool v_return; + gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 2); @@ -363,14 +363,14 @@ sp_marshal_BOOLEAN__POINTER_UINT (GClosure *closure, gpointer invocation_hint, gpointer marshal_data) { - typedef bool (*GMarshalFunc_BOOLEAN__POINTER_UINT) (gpointer data1, + typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_UINT) (gpointer data1, gpointer arg_1, guint arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__POINTER_UINT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; - bool v_return; + gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 3); @@ -404,14 +404,14 @@ sp_marshal_BOOLEAN__POINTER_POINTER (GClosure *closure, gpointer invocation_hint, gpointer marshal_data) { - typedef bool (*GMarshalFunc_BOOLEAN__POINTER_POINTER) (gpointer data1, + typedef gboolean (*GMarshalFunc_BOOLEAN__POINTER_POINTER) (gpointer data1, gpointer arg_1, gpointer arg_2, gpointer data2); register GMarshalFunc_BOOLEAN__POINTER_POINTER callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; - bool v_return; + gboolean v_return; g_return_if_fail (return_value != NULL); g_return_if_fail (n_param_values == 3); diff --git a/src/message-stack.cpp b/src/message-stack.cpp index 4186970e3..ae65e3421 100644 --- a/src/message-stack.cpp +++ b/src/message-stack.cpp @@ -138,8 +138,7 @@ void MessageStack::_emitChanged() { _changed_signal.emit(NORMAL_MESSAGE, NULL); } } -// JON: this has o stay this way because of legacy use of glib -// would like to change this to bool + gboolean MessageStack::_timeout(gpointer data) { Message *m=reinterpret_cast(data); m->timeout_id = 0; diff --git a/src/message-stack.h b/src/message-stack.h index bcae24161..4741cce1e 100644 --- a/src/message-stack.h +++ b/src/message-stack.h @@ -155,7 +155,6 @@ private: Message *_discard(Message *m); ///< frees a message struct and returns the next such struct in the list void _emitChanged(); ///< emits the "changed" signal - // JON: Have to keep this gboolean for legacy reasons of glib support static gboolean _timeout(gpointer data); ///< callback to expire flashed messages sigc::signal _changed_signal; diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp index 46e63478c..ff27f3de0 100644 --- a/src/sp-style-elem.cpp +++ b/src/sp-style-elem.cpp @@ -272,7 +272,7 @@ end_font_face_cb(CRDocHandler *a_handler) static void property_cb(CRDocHandler *const a_handler, CRString *const a_name, - CRTerm *const a_value, int const a_important) + CRTerm *const a_value, gboolean const a_important) { g_return_if_fail(a_handler && a_name); g_return_if_fail(a_handler->app_data != NULL); diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index b170d69f8..0fadffdc8 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -35,8 +35,6 @@ #include "icon.h" -// JON: keeping legacy gboolean because of old code -// TODO: replace gboolean with bool static gboolean icon_prerender_task(gpointer data); static void addPreRender( Inkscape::IconSize lsize, gchar const *name ); diff --git a/src/widgets/sp-xmlview-tree.cpp b/src/widgets/sp-xmlview-tree.cpp index 578951456..d6fd92d78 100644 --- a/src/widgets/sp-xmlview-tree.cpp +++ b/src/widgets/sp-xmlview-tree.cpp @@ -41,8 +41,6 @@ static void comment_content_changed (Inkscape::XML::Node * repr, const gchar * o static void tree_move (GtkCTree * tree, GtkCTreeNode * node, GtkCTreeNode * new_parent, GtkCTreeNode * new_sibling); -// JON: Must keep this as gboolean legacy -// TODO: convert to use bool static gboolean check_drag (GtkCTree * tree, GtkCTreeNode * node, GtkCTreeNode * new_parent, GtkCTreeNode * new_sibling); static GtkCTreeNode * ref_to_sibling (GtkCTreeNode * parent, Inkscape::XML::Node * ref); diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index f474cd735..e42f58954 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -2941,8 +2941,8 @@ sp_text_toolbox_selection_changed (Inkscape::Selection *selection, GObject *tbl) { GtkToggleButton *button = GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (tbl), "style-bold")); - bool active = gtk_toggle_button_get_active (button); - bool check = (query->font_weight.computed >= SP_CSS_FONT_WEIGHT_700); + gboolean active = gtk_toggle_button_get_active (button); + gboolean check = (query->font_weight.computed >= SP_CSS_FONT_WEIGHT_700); if (active != check) { @@ -2955,8 +2955,8 @@ sp_text_toolbox_selection_changed (Inkscape::Selection *selection, GObject *tbl) { GtkToggleButton *button = GTK_TOGGLE_BUTTON (g_object_get_data (G_OBJECT (tbl), "style-italic")); - bool active = gtk_toggle_button_get_active (button); - bool check = (query->font_style.computed != SP_CSS_FONT_STYLE_NORMAL); + gboolean active = gtk_toggle_button_get_active (button); + gboolean check = (query->font_style.computed != SP_CSS_FONT_STYLE_NORMAL); if (active != check) { @@ -3233,7 +3233,7 @@ sp_text_toolbox_orientation_toggled (GtkRadioButton *button, gtk_widget_grab_focus (GTK_WIDGET(desktop->canvas)); } -bool +gboolean sp_text_toolbox_size_keypress (GtkWidget *w, GdkEventKey *event, gpointer data) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; @@ -3253,7 +3253,7 @@ sp_text_toolbox_size_keypress (GtkWidget *w, GdkEventKey *event, gpointer data) return FALSE; } -bool +gboolean sp_text_toolbox_family_keypress (GtkWidget *w, GdkEventKey *event, GObject *tbl) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; @@ -3269,7 +3269,7 @@ sp_text_toolbox_family_keypress (GtkWidget *w, GdkEventKey *event, GObject *tbl) return FALSE; } -bool +gboolean sp_text_toolbox_family_list_keypress (GtkWidget *w, GdkEventKey *event, GObject *tbl) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; @@ -3364,7 +3364,7 @@ sp_text_toolbox_text_popdown_clicked (GtkButton *button, } } -bool +gboolean sp_text_toolbox_entry_focus_in (GtkWidget *entry, GdkEventFocus *event, GObject *tbl) @@ -3373,7 +3373,7 @@ sp_text_toolbox_entry_focus_in (GtkWidget *entry, return FALSE; } -bool +gboolean sp_text_toolbox_popdown_focus_out (GtkWidget *popdown, GdkEventFocus *event, GObject *tbl) diff --git a/src/xml/croco-node-iface.cpp b/src/xml/croco-node-iface.cpp index 17c3495a5..0464e4fb7 100644 --- a/src/xml/croco-node-iface.cpp +++ b/src/xml/croco-node-iface.cpp @@ -38,8 +38,6 @@ static char *get_attr(CRXMLNodePtr n, char const *a) } static char const *get_local_name(CRXMLNodePtr n) { return local_part(static_cast(n)->name()); } -// JON: Need to keep gboolean to interface with libcroco -// TODO: convert to bool static gboolean is_element_node(CRXMLNodePtr n) { return static_cast(n)->type() == ELEMENT_NODE; } }