[beast: 21/22] GXK: use Rapicorn's assert_return()
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 21/22] GXK: use Rapicorn's assert_return()
- Date: Thu, 24 Sep 2015 20:10:43 +0000 (UTC)
commit f4ceb3e745a3eb1b0aeaa400805d6c19d17dd5ab
Author: Tim Janik <timj gnu org>
Date: Wed Sep 23 09:48:04 2015 +0200
GXK: use Rapicorn's assert_return()
beast-gtk/gxk/gxkaction.cc | 54 +++++-----
beast-gtk/gxk/gxkassortment.cc | 60 ++++++------
beast-gtk/gxk/gxkcanvas.cc | 26 +++---
beast-gtk/gxk/gxkcellrendererpopup.cc | 12 +-
beast-gtk/gxk/gxkdialog.cc | 20 ++--
beast-gtk/gxk/gxkglobals.cc | 10 +-
beast-gtk/gxk/gxkimagecache.cc | 2 +-
beast-gtk/gxk/gxkled.cc | 4 +-
beast-gtk/gxk/gxklistwrapper.cc | 52 +++++-----
beast-gtk/gxk/gxklistwrapper.hh | 2 +-
beast-gtk/gxk/gxklogadjustment.cc | 22 ++--
beast-gtk/gxk/gxkmenubutton.cc | 2 +-
beast-gtk/gxk/gxknotebook.cc | 2 +-
beast-gtk/gxk/gxkparam.cc | 74 +++++++-------
beast-gtk/gxk/gxkpolygon.cc | 12 +-
beast-gtk/gxk/gxkrackeditor.cc | 12 +-
beast-gtk/gxk/gxkrackitem.cc | 2 +-
beast-gtk/gxk/gxkracktable.cc | 8 +-
beast-gtk/gxk/gxkradget.cc | 42 ++++----
beast-gtk/gxk/gxkradgetfactory.cc | 6 +-
beast-gtk/gxk/gxkscrollcanvas.cc | 58 ++++++------
beast-gtk/gxk/gxksimplelabel.cc | 4 +-
beast-gtk/gxk/gxkspline.cc | 4 +-
beast-gtk/gxk/gxkstatusbar.cc | 6 +-
beast-gtk/gxk/gxkstock.cc | 24 +++---
beast-gtk/gxk/gxktexttools.cc | 76 +++++++-------
beast-gtk/gxk/gxkutils.cc | 176 ++++++++++++++++----------------
27 files changed, 386 insertions(+), 386 deletions(-)
---
diff --git a/beast-gtk/gxk/gxkaction.cc b/beast-gtk/gxk/gxkaction.cc
index 17c4e11..12cc3db 100644
--- a/beast-gtk/gxk/gxkaction.cc
+++ b/beast-gtk/gxk/gxkaction.cc
@@ -98,7 +98,7 @@ action_class_ref_new (GxkActionCheck acheck,
static ActionClass*
action_class_ref (ActionClass *aclass)
{
- g_return_val_if_fail (aclass->ref_count > 0, NULL);
+ assert_return (aclass->ref_count > 0, NULL);
aclass->ref_count++;
return aclass;
}
@@ -106,7 +106,7 @@ action_class_ref (ActionClass *aclass)
static void
action_class_unref (ActionClass *aclass)
{
- g_return_if_fail (aclass->ref_count > 0);
+ assert_return (aclass->ref_count > 0);
aclass->ref_count--;
if (!aclass->ref_count)
{
@@ -205,7 +205,7 @@ gxk_action_list_add_actions (GxkActionList *alist,
guint i;
for (i = 0; i < n_actions; i++)
{
- g_return_if_fail (actions[i].name != NULL);
+ assert_return (actions[i].name != NULL);
action_list_add (alist, klass, TRUE, actions[i].name, actions + i, idomain);
}
action_class_unref (klass);
@@ -225,7 +225,7 @@ gxk_action_list_add_translated (GxkActionList *alist,
{
ActionClass *klass = action_class_ref_new (acheck, aexec, user_data, alist->agroup, 0);
GxkStockAction a = { 0, };
- g_return_if_fail (name);
+ assert_return (name);
if (!key)
key = name;
a.name = name;
@@ -298,7 +298,7 @@ gxk_action_list_get_action (GxkActionList *alist,
GxkAction *action)
{
ActionEntry *e;
- g_return_if_fail (nth < alist->n_entries);
+ assert_return (nth < alist->n_entries);
e = alist->entries[nth];
action->key = e->key;
action->action_data = e;
@@ -330,7 +330,7 @@ gxk_action_list_regulate_widget (GxkActionList *alist,
GtkWidget *widget)
{
ActionEntry *e;
- g_return_if_fail (nth < alist->n_entries);
+ assert_return (nth < alist->n_entries);
e = alist->entries[nth];
e->widgets = g_slist_prepend (e->widgets, g_object_ref (widget));
g_object_set_qdata ((GObject*) widget, quark_action_entry, e);
@@ -370,7 +370,7 @@ void
gxk_action_activate_callback (gconstpointer action_data)
{
const ActionEntry *e = (const ActionEntry*) action_data;
- g_return_if_fail (e && e->klass && e->klass->ref_count > 0);
+ assert_return (e && e->klass && e->klass->ref_count > 0);
if (!e->klass->agroup || e->klass->agroup->lock_count == 0)
{
if (ACTION_CHECK (e->klass->acheck, e->klass->user_data, e->action.action_id))
@@ -418,7 +418,7 @@ static GQuark quark_action_factories = 0;
static void
action_link_unref (ActionLink *alink)
{
- g_return_if_fail (alink->ref_count > 0);
+ assert_return (alink->ref_count > 0);
alink->ref_count--;
if (!alink->ref_count)
{
@@ -446,8 +446,8 @@ static void
window_add_action_link (GtkWidget *window,
ActionLink *alink)
{
- g_return_if_fail (GTK_IS_WIDGET (alink->widget));
- g_return_if_fail (alink->toplevel == NULL);
+ assert_return (GTK_IS_WIDGET (alink->widget));
+ assert_return (alink->toplevel == NULL);
alink->next = (ActionLink*) g_object_steal_qdata ((GObject*) window, quark_action_links);
alink->toplevel = window;
alink->ref_count++;
@@ -466,7 +466,7 @@ static void
window_remove_action_link (ActionLink *alink)
{
GtkWidget *window = alink->toplevel;
- g_return_if_fail (GTK_IS_WIDGET (alink->toplevel));
+ assert_return (GTK_IS_WIDGET (alink->toplevel));
ActionLink *last = NULL, *anode = (ActionLink*) g_object_get_qdata ((GObject*) window, quark_action_links);
for (; anode; last = anode, anode = last->next)
@@ -625,7 +625,7 @@ void
gxk_widget_update_actions_upwards (gpointer widget)
{
GtkWidget *toplevel = gtk_widget_get_toplevel ((GtkWidget*) widget);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (GTK_IS_WINDOW (toplevel))
window_queue_action_updates (toplevel, (GtkWidget*) widget, NULL);
}
@@ -634,7 +634,7 @@ void
gxk_widget_update_actions_downwards (gpointer widget)
{
GtkWidget *toplevel = gtk_widget_get_toplevel ((GtkWidget*) widget);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (GTK_IS_WINDOW (toplevel))
window_queue_action_updates (toplevel, NULL, (GtkWidget*) widget);
}
@@ -643,7 +643,7 @@ void
gxk_widget_update_actions (gpointer widget)
{
GtkWidget *toplevel = gtk_widget_get_toplevel ((GtkWidget*) widget);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (GTK_IS_WINDOW (toplevel))
window_queue_action_updates (toplevel, (GtkWidget*) widget, (GtkWidget*) widget);
}
@@ -710,7 +710,7 @@ gxk_widget_publish_action_list (gpointer widget,
GxkActionList *alist)
{
ActionLink *alink = g_new0 (ActionLink, 1);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
alink->ref_count = 1;
alink->widget = (GtkWidget*) widget;
alink->prefix = g_strdup (prefix);
@@ -775,7 +775,7 @@ gxk_widget_publish_actions_grouped (gpointer widget,
GxkActionExec aexec)
{
GxkActionList *alist = gxk_action_list_create_grouped (group);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
gxk_action_list_add_actions (alist, n_actions, actions, i18n_domain, acheck, aexec, widget);
gxk_widget_publish_action_list (widget, prefix, alist);
}
@@ -806,7 +806,7 @@ gxk_widget_publish_grouped_translated (gpointer widget,
GxkActionExec aexec)
{
GxkActionList *alist = gxk_action_list_create_grouped (group);
- g_return_if_fail (name != NULL);
+ assert_return (name != NULL);
gxk_action_list_add_translated (alist, g_intern_string (key ? key : name), name,
accelerator, tooltip, action_id, stock_icon,
acheck, aexec, widget);
@@ -825,7 +825,7 @@ gxk_widget_publish_translated (gpointer widget,
GxkActionCheck acheck,
GxkActionExec aexec)
{
- g_return_if_fail (name != NULL);
+ assert_return (name != NULL);
gxk_widget_publish_grouped_translated (widget, NULL, prefix, key ? key : name, name, accelerator,
tooltip, action_id, stock_icon, acheck, aexec);
}
@@ -835,8 +835,8 @@ gxk_window_add_action_client (GtkWindow *window,
GxkActionClient added_func,
gpointer client_data)
{
- g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (client_data != NULL);
+ assert_return (GTK_IS_WINDOW (window));
+ assert_return (client_data != NULL);
ActionClient *aclient = g_new0 (ActionClient, 1);
aclient->client_data = client_data;
aclient->added_func = added_func;
@@ -851,8 +851,8 @@ void
gxk_window_remove_action_client (GtkWindow *window,
gpointer client_data)
{
- g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (client_data != NULL);
+ assert_return (GTK_IS_WINDOW (window));
+ assert_return (client_data != NULL);
GSList *last = NULL, *slist = (GSList*) g_object_get_qdata ((GObject*) window, quark_action_clients);
while (slist)
{
@@ -925,7 +925,7 @@ void
gxk_action_group_select (GxkActionGroup *self,
size_t action_id)
{
- g_return_if_fail (GXK_IS_ACTION_GROUP (self));
+ assert_return (GXK_IS_ACTION_GROUP (self));
if (!self->lock_count && (action_id != self->action_id || self->invert_dups))
{
if (action_id == self->action_id)
@@ -941,22 +941,22 @@ gxk_action_group_select (GxkActionGroup *self,
void
gxk_action_group_lock (GxkActionGroup *self)
{
- g_return_if_fail (GXK_IS_ACTION_GROUP (self));
+ assert_return (GXK_IS_ACTION_GROUP (self));
self->lock_count++;
}
void
gxk_action_group_unlock (GxkActionGroup *self)
{
- g_return_if_fail (GXK_IS_ACTION_GROUP (self));
- g_return_if_fail (self->lock_count > 0);
+ assert_return (GXK_IS_ACTION_GROUP (self));
+ assert_return (self->lock_count > 0);
self->lock_count--;
}
void
gxk_action_group_dispose (GxkActionGroup *self)
{
- g_return_if_fail (GXK_IS_ACTION_GROUP (self));
+ assert_return (GXK_IS_ACTION_GROUP (self));
g_object_run_dispose ((GObject*) self);
}
diff --git a/beast-gtk/gxk/gxkassortment.cc b/beast-gtk/gxk/gxkassortment.cc
index c71ef46..462f1df 100644
--- a/beast-gtk/gxk/gxkassortment.cc
+++ b/beast-gtk/gxk/gxkassortment.cc
@@ -17,7 +17,7 @@ assortment_entry_copy (gpointer boxed)
static void
assortment_entry_free (GxkAssortmentEntry *aentry)
{
- g_return_if_fail (aentry->ref_count > 0);
+ assert_return (aentry->ref_count > 0);
aentry->ref_count -= 1;
if (!aentry->ref_count)
{
@@ -68,22 +68,22 @@ gxk_assortment_new (void)
void
gxk_assortment_dispose (GxkAssortment *self)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
+ assert_return (GXK_IS_ASSORTMENT (self));
g_object_run_dispose ((GObject*) self);
}
void
gxk_assortment_block_selection (GxkAssortment *self)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
+ assert_return (GXK_IS_ASSORTMENT (self));
self->block_count++;
}
void
gxk_assortment_unblock_selection (GxkAssortment *self)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
- g_return_if_fail (self->block_count > 0);
+ assert_return (GXK_IS_ASSORTMENT (self));
+ assert_return (self->block_count > 0);
self->block_count--;
}
@@ -91,7 +91,7 @@ void
gxk_assortment_select (GxkAssortment *self,
GxkAssortmentEntry *entry)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
+ assert_return (GXK_IS_ASSORTMENT (self));
if (!self->block_count && entry != self->selected)
{
self->selected = entry;
@@ -103,7 +103,7 @@ void
gxk_assortment_select_data (GxkAssortment *self,
gpointer entry_user_data)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
+ assert_return (GXK_IS_ASSORTMENT (self));
gxk_assortment_select (self, gxk_assortment_find_data (self, entry_user_data));
}
@@ -111,7 +111,7 @@ GxkAssortmentEntry*
gxk_assortment_find_data (GxkAssortment *self,
gpointer entry_user_data)
{
- g_return_val_if_fail (GXK_IS_ASSORTMENT (self), NULL);
+ assert_return (GXK_IS_ASSORTMENT (self), NULL);
GSList *slist;
for (slist = self->entries; slist; slist = slist->next)
{
@@ -133,7 +133,7 @@ gxk_assortment_insert (GxkAssortment *self,
gpointer owner,
GxkAssortmentDelete free_func)
{
- g_return_val_if_fail (GXK_IS_ASSORTMENT (self), NULL);
+ assert_return (GXK_IS_ASSORTMENT (self), NULL);
GxkAssortmentEntry *aentry = g_new0 (GxkAssortmentEntry, 1);
aentry->label = g_strdup (label);
@@ -153,8 +153,8 @@ void
gxk_assortment_changed (GxkAssortment *self,
GxkAssortmentEntry *entry)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
- g_return_if_fail (g_slist_find (self->entries, entry) != NULL);
+ assert_return (GXK_IS_ASSORTMENT (self));
+ assert_return (g_slist_find (self->entries, entry) != NULL);
g_signal_emit (self, signal_entry_changed, 0, entry);
}
@@ -163,13 +163,13 @@ void
gxk_assortment_remove (GxkAssortment *self,
GxkAssortmentEntry *entry)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
+ assert_return (GXK_IS_ASSORTMENT (self));
GSList *last = NULL, *slist;
for (slist = self->entries; slist; last = slist, slist = last->next)
if (slist->data == entry)
break;
- g_return_if_fail (slist != NULL);
+ assert_return (slist != NULL);
gboolean selection_changed = FALSE;
if (self->selected == entry)
@@ -202,7 +202,7 @@ static void
assortment_dispose (GObject *object)
{
GxkAssortment *self = GXK_ASSORTMENT (object);
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
+ assert_return (GXK_IS_ASSORTMENT (self));
gboolean was_selected = self->selected != NULL;
self->selected = NULL;
while (self->entries)
@@ -220,7 +220,7 @@ static void
assortment_finalize (GObject *object)
{
GxkAssortment *self = GXK_ASSORTMENT (object);
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
+ assert_return (GXK_IS_ASSORTMENT (self));
self->selected = NULL;
while (self->entries)
{
@@ -286,7 +286,7 @@ struct AssortmentLink {
static void
assortment_link_unref (AssortmentLink *alink)
{
- g_return_if_fail (alink->ref_count > 0);
+ assert_return (alink->ref_count > 0);
alink->ref_count--;
if (!alink->ref_count)
{
@@ -319,10 +319,10 @@ static void
window_add_assortment_link (GtkWidget *window,
AssortmentLink *alink)
{
- g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (GTK_IS_WIDGET (alink->widget));
- g_return_if_fail (alink->toplevel == NULL);
- g_return_if_fail (alink->next == NULL);
+ assert_return (GTK_IS_WINDOW (window));
+ assert_return (GTK_IS_WIDGET (alink->widget));
+ assert_return (alink->toplevel == NULL);
+ assert_return (alink->next == NULL);
alink->next = (AssortmentLink*) g_object_steal_qdata ((GObject*) window, quark_window_assortments);
alink->toplevel = window;
alink->ref_count++;
@@ -341,7 +341,7 @@ static void
window_remove_assortment_link (AssortmentLink *alink)
{
GtkWidget *window = alink->toplevel;
- g_return_if_fail (GTK_IS_WINDOW (window));
+ assert_return (GTK_IS_WINDOW (window));
AssortmentLink *last = NULL, *anode = (AssortmentLink*) g_object_get_qdata ((GObject*) window,
quark_window_assortments);
for (; anode; last = anode, anode = last->next)
@@ -427,9 +427,9 @@ gxk_widget_publish_assortment (gpointer widget,
GxkAssortment *assortment)
{
AssortmentLink *alink = g_new0 (AssortmentLink, 1);
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (GXK_IS_ASSORTMENT (assortment));
- g_return_if_fail (assortment->publishing_name == NULL);
+ assert_return (GTK_IS_WIDGET (widget));
+ assert_return (GXK_IS_ASSORTMENT (assortment));
+ assert_return (assortment->publishing_name == NULL);
assortment->publishing_name = g_strdup (publishing_name);
alink->assortment = (GxkAssortment*) g_object_ref (assortment);
alink->ref_count = 1;
@@ -448,8 +448,8 @@ gxk_window_add_assortment_client (GtkWindow *window,
GxkAssortmentClient removed_func,
gpointer client_data)
{
- g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (client_data != NULL);
+ assert_return (GTK_IS_WINDOW (window));
+ assert_return (client_data != NULL);
AssortmentClient *aclient = g_new0 (AssortmentClient, 1);
aclient->client_data = client_data;
aclient->added_func = added_func;
@@ -466,8 +466,8 @@ void
gxk_window_remove_assortment_client (GtkWindow *window,
gpointer client_data)
{
- g_return_if_fail (GTK_IS_WINDOW (window));
- g_return_if_fail (client_data != NULL);
+ assert_return (GTK_IS_WINDOW (window));
+ assert_return (client_data != NULL);
GSList *last = NULL, *slist = (GSList*) g_object_get_qdata ((GObject*) window, quark_assortment_clients);
while (slist)
{
@@ -615,8 +615,8 @@ void
gxk_assortment_manage_menu (GxkAssortment *self,
GtkMenu *menu)
{
- g_return_if_fail (GXK_IS_ASSORTMENT (self));
- g_return_if_fail (GTK_IS_MENU (menu));
+ assert_return (GXK_IS_ASSORTMENT (self));
+ assert_return (GTK_IS_MENU (menu));
g_signal_connect_object (self, "entry-added", G_CALLBACK (assortment_menu_entry_added), menu,
GConnectFlags (0));
g_signal_connect_object (self, "entry-changed", G_CALLBACK (assortment_menu_entry_changed), menu,
GConnectFlags (0));
diff --git a/beast-gtk/gxk/gxkcanvas.cc b/beast-gtk/gxk/gxkcanvas.cc
index 6446a8f..3680083 100644
--- a/beast-gtk/gxk/gxkcanvas.cc
+++ b/beast-gtk/gxk/gxkcanvas.cc
@@ -10,7 +10,7 @@ gnome_canvas_points_new0 (guint num_points)
GnomeCanvasPoints *points;
guint i;
- g_return_val_if_fail (num_points > 1, NULL);
+ assert_return (num_points > 1, NULL);
points = gnome_canvas_points_new (num_points);
for (i = 0; i < num_points; i++)
@@ -30,7 +30,7 @@ gnome_canvas_points_newv (guint num_points,
guint i;
va_list args;
- g_return_val_if_fail (num_points > 1, NULL);
+ assert_return (num_points > 1, NULL);
va_start (args, num_points);
points = gnome_canvas_points_new (num_points);
@@ -49,7 +49,7 @@ gnome_canvas_typed_item_at (GnomeCanvas *canvas,
{
GnomeCanvasItem *item;
- g_return_val_if_fail (GNOME_IS_CANVAS (canvas), NULL);
+ assert_return (GNOME_IS_CANVAS (canvas), NULL);
item = gnome_canvas_get_item_at (canvas, world_x, world_y);
while (item && !g_type_is_a (GTK_OBJECT_TYPE (item), item_type))
@@ -80,7 +80,7 @@ gnome_canvas_item_check_undisposed (GnomeCanvasItem *item)
guint
gnome_canvas_item_get_stacking (GnomeCanvasItem *item)
{
- g_return_val_if_fail (GNOME_IS_CANVAS_ITEM (item), 0);
+ assert_return (GNOME_IS_CANVAS_ITEM (item), 0);
if (item->parent)
{
@@ -104,9 +104,9 @@ gnome_canvas_item_keep_between (GnomeCanvasItem *between,
GnomeCanvasItem *item1,
GnomeCanvasItem *item2)
{
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (between));
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item1));
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item2));
+ assert_return (GNOME_IS_CANVAS_ITEM (between));
+ assert_return (GNOME_IS_CANVAS_ITEM (item1));
+ assert_return (GNOME_IS_CANVAS_ITEM (item2));
if (between->parent && item1->parent && item2->parent)
{
@@ -133,9 +133,9 @@ gnome_canvas_item_keep_above (GnomeCanvasItem *above,
GnomeCanvasItem *item1,
GnomeCanvasItem *item2)
{
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (above));
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item1));
- g_return_if_fail (GNOME_IS_CANVAS_ITEM (item2));
+ assert_return (GNOME_IS_CANVAS_ITEM (above));
+ assert_return (GNOME_IS_CANVAS_ITEM (item1));
+ assert_return (GNOME_IS_CANVAS_ITEM (item2));
if (above->parent && item1->parent && item2->parent)
{
@@ -169,7 +169,7 @@ void
gnome_canvas_text_set_zoom_size (GnomeCanvasText *item,
gdouble pixels)
{
- g_return_if_fail (GNOME_IS_CANVAS_TEXT (item));
+ assert_return (GNOME_IS_CANVAS_TEXT (item));
g_object_set (item, "size_points", pixels * GNOME_CANVAS_ITEM(item)->canvas->pixels_per_unit, NULL);
g_object_set_double (item, "zoom_size", pixels);
@@ -207,7 +207,7 @@ void
gnome_canvas_set_zoom (GnomeCanvas *canvas,
gdouble pixels_per_unit)
{
- g_return_if_fail (GNOME_IS_CANVAS (canvas));
+ assert_return (GNOME_IS_CANVAS (canvas));
/* adjust all text items */
canvas_adjust_text_zoom (GNOME_CANVAS_GROUP (canvas->root), pixels_per_unit);
@@ -219,7 +219,7 @@ void
gnome_canvas_FIXME_hard_update (GnomeCanvas *canvas)
{
return;
- g_return_if_fail (GNOME_IS_CANVAS (canvas));
+ assert_return (GNOME_IS_CANVAS (canvas));
/* _first_ recalc bounds of already queued items */
gnome_canvas_update_now (canvas);
diff --git a/beast-gtk/gxk/gxkcellrendererpopup.cc b/beast-gtk/gxk/gxkcellrendererpopup.cc
index 1d5f687..f1c6f1b 100644
--- a/beast-gtk/gxk/gxkcellrendererpopup.cc
+++ b/beast-gtk/gxk/gxkcellrendererpopup.cc
@@ -252,9 +252,9 @@ void
gxk_cell_renderer_popup_dialog (GxkCellRendererPopup *self,
GtkWidget *dialog)
{
- g_return_if_fail (GXK_IS_CELL_RENDERER_POPUP (self));
+ assert_return (GXK_IS_CELL_RENDERER_POPUP (self));
if (dialog)
- g_return_if_fail (GTK_IS_WINDOW (dialog));
+ assert_return (GTK_IS_WINDOW (dialog));
if (self->dialog)
{
@@ -292,7 +292,7 @@ gxk_cell_renderer_popup_change (GxkCellRendererPopup *self,
gboolean preserve_popup,
gboolean keep_editing)
{
- g_return_if_fail (GXK_IS_CELL_RENDERER_POPUP (self));
+ assert_return (GXK_IS_CELL_RENDERER_POPUP (self));
if (self->entry && text)
gtk_entry_set_text (GTK_ENTRY (self->entry), text);
@@ -466,9 +466,9 @@ void
gxk_proxy_editable_set_cell_editable (GxkProxyEditable *self,
GtkCellEditable *ecell)
{
- g_return_if_fail (GXK_IS_PROXY_EDITABLE (self));
- g_return_if_fail (GTK_IS_CELL_EDITABLE (ecell));
- g_return_if_fail (self->ecell == NULL);
+ assert_return (GXK_IS_PROXY_EDITABLE (self));
+ assert_return (GTK_IS_CELL_EDITABLE (ecell));
+ assert_return (self->ecell == NULL);
self->ecell = ecell;
g_signal_connect_object (ecell, "remove_widget",
diff --git a/beast-gtk/gxk/gxkdialog.cc b/beast-gtk/gxk/gxkdialog.cc
index 490f46b..db9f56a 100644
--- a/beast-gtk/gxk/gxkdialog.cc
+++ b/beast-gtk/gxk/gxkdialog.cc
@@ -336,7 +336,7 @@ void
gxk_dialog_set_title (GxkDialog *dialog,
const gchar *title)
{
- g_return_if_fail (GXK_IS_DIALOG (dialog));
+ assert_return (GXK_IS_DIALOG (dialog));
g_object_set (dialog, "title", title, NULL);
}
@@ -353,7 +353,7 @@ gxk_dialog_add_flags (GxkDialog *dialog,
{
gint f;
- g_return_if_fail (GXK_IS_DIALOG (dialog));
+ assert_return (GXK_IS_DIALOG (dialog));
f = dialog->flags;
f |= flags;
@@ -372,7 +372,7 @@ gxk_dialog_clear_flags (GxkDialog *dialog,
{
gint f;
- g_return_if_fail (GXK_IS_DIALOG (dialog));
+ assert_return (GXK_IS_DIALOG (dialog));
f = dialog->flags;
f &= ~flags;
@@ -387,7 +387,7 @@ gxk_dialog_clear_flags (GxkDialog *dialog,
GtkWidget*
gxk_dialog_get_child (GxkDialog *dialog)
{
- g_return_val_if_fail (GXK_IS_DIALOG (dialog), NULL);
+ assert_return (GXK_IS_DIALOG (dialog), NULL);
/* return the single child that was passed to gxk_dialog_new() if any */
return dialog->child;
}
@@ -403,7 +403,7 @@ void
gxk_dialog_set_child (GxkDialog *dialog,
GtkWidget *child)
{
- g_return_if_fail (GXK_IS_DIALOG (dialog));
+ assert_return (GXK_IS_DIALOG (dialog));
gtk_container_foreach (GTK_CONTAINER (dialog->vbox), (GtkCallback) gtk_widget_destroy, NULL);
if (dialog->child)
@@ -428,7 +428,7 @@ void
gxk_dialog_set_focus (GxkDialog *self,
GtkWidget *focus_widget)
{
- g_return_if_fail (GXK_IS_DIALOG (self));
+ assert_return (GXK_IS_DIALOG (self));
if (self->focus_widget)
g_signal_handlers_disconnect_by_func (self->focus_widget, (void*) g_nullify_pointer,
&self->focus_widget);
@@ -448,7 +448,7 @@ void
gxk_dialog_set_default (GxkDialog *self,
GtkWidget *default_widget)
{
- g_return_if_fail (GXK_IS_DIALOG (self));
+ assert_return (GXK_IS_DIALOG (self));
if (self->default_widget)
g_signal_handlers_disconnect_by_func (self->default_widget, (void*) g_nullify_pointer,
&self->default_widget);
@@ -603,7 +603,7 @@ gxk_dialog_get_status_window (void)
void
gxk_dialog_remove_actions (GxkDialog *dialog)
{
- g_return_if_fail (GXK_IS_DIALOG (dialog));
+ assert_return (GXK_IS_DIALOG (dialog));
if (dialog->hbox)
gtk_container_foreach (GTK_CONTAINER (dialog->hbox), (GtkCallback) gtk_widget_destroy, NULL);
@@ -628,8 +628,8 @@ gxk_dialog_action_multi (GxkDialog *self,
{
GtkWidget *button = NULL;
- g_return_val_if_fail (GXK_IS_DIALOG (self), NULL);
- g_return_val_if_fail (action != NULL, NULL);
+ assert_return (GXK_IS_DIALOG (self), NULL);
+ assert_return (action != NULL, NULL);
if (self->sep)
gtk_widget_show (self->sep);
diff --git a/beast-gtk/gxk/gxkglobals.cc b/beast-gtk/gxk/gxkglobals.cc
index 62d9dff..b537771 100644
--- a/beast-gtk/gxk/gxkglobals.cc
+++ b/beast-gtk/gxk/gxkglobals.cc
@@ -12,7 +12,7 @@ gxk_init (void)
{
static GxkGlobals globals = { NULL, };
- g_return_if_fail (gxk_globals == NULL);
+ assert_return (gxk_globals == NULL);
gxk_globals = &globals;
@@ -34,10 +34,10 @@ gxk_nullify_in_object (gpointer object,
{
GObject **location = (GObject**) _location;
GClosure *closure;
- g_return_val_if_fail (object != NULL, 0);
- g_return_val_if_fail (location != NULL, 0);
- g_return_val_if_fail (G_IS_OBJECT (object), 0);
- g_return_val_if_fail (GTK_IS_OBJECT (*location), 0);
+ assert_return (object != NULL, 0);
+ assert_return (location != NULL, 0);
+ assert_return (G_IS_OBJECT (object), 0);
+ assert_return (GTK_IS_OBJECT (*location), 0);
closure = g_cclosure_new_swap (G_CALLBACK (g_nullify_pointer), location, NULL);
g_object_watch_closure ((GObject*) object, closure);
return g_signal_connect_closure (*location, "destroy", closure, 0);
diff --git a/beast-gtk/gxk/gxkimagecache.cc b/beast-gtk/gxk/gxkimagecache.cc
index 5165f70..93ebd10 100644
--- a/beast-gtk/gxk/gxkimagecache.cc
+++ b/beast-gtk/gxk/gxkimagecache.cc
@@ -94,7 +94,7 @@ image_cache_create_item (const gchar *file_name,
static void
image_cache_item_unuse (GxkImageCacheItem *citem)
{
- g_return_if_fail (citem->use_count > 0);
+ assert_return (citem->use_count > 0);
citem->use_count--;
if (citem->use_count)
return;
diff --git a/beast-gtk/gxk/gxkled.cc b/beast-gtk/gxk/gxkled.cc
index d91264b..e1d47e8 100644
--- a/beast-gtk/gxk/gxkled.cc
+++ b/beast-gtk/gxk/gxkled.cc
@@ -116,7 +116,7 @@ void
gxk_led_set_color (GxkLed *self,
guint color)
{
- g_return_if_fail (GXK_IS_LED (self));
+ assert_return (GXK_IS_LED (self));
if (!color) /* lazy bum! */
color = GXK_LED_OFF;
@@ -129,7 +129,7 @@ void
gxk_led_set_border_width (GxkLed *self,
guint border_width)
{
- g_return_if_fail (GXK_IS_LED (self));
+ assert_return (GXK_IS_LED (self));
self->border_width = border_width;
gtk_widget_queue_resize (GTK_WIDGET (self));
diff --git a/beast-gtk/gxk/gxklistwrapper.cc b/beast-gtk/gxk/gxklistwrapper.cc
index 5f4ecb0..904649a 100644
--- a/beast-gtk/gxk/gxklistwrapper.cc
+++ b/beast-gtk/gxk/gxklistwrapper.cc
@@ -136,7 +136,7 @@ gxk_list_wrapper_set_property (GObject *object,
case PROP_COLUMN_TYPES:
self->column_types = g_new0 (GType, self->n_cols);
ctypes = (GType*) g_value_get_pointer (value);
- g_return_if_fail (ctypes != NULL);
+ assert_return (ctypes != NULL);
for (i = 0; i < self->n_cols; i++)
self->column_types[i] = ctypes[i];
for (i = 0; i < self->n_cols; i++)
@@ -194,8 +194,8 @@ gxk_list_wrapper_newv (guint n_cols,
{
GxkListWrapper *self;
- g_return_val_if_fail (n_cols > 0, NULL);
- g_return_val_if_fail (column_types != NULL, NULL);
+ assert_return (n_cols > 0, NULL);
+ assert_return (column_types != NULL, NULL);
self = (GxkListWrapper*) g_object_new (GXK_TYPE_LIST_WRAPPER,
"n_cols", n_cols,
@@ -215,7 +215,7 @@ gxk_list_wrapper_new (guint n_cols,
va_list var_args;
guint i;
- g_return_val_if_fail (n_cols > 0, NULL);
+ assert_return (n_cols > 0, NULL);
ctypes = g_new (GType, n_cols);
@@ -254,7 +254,7 @@ gxk_list_wrapper_get_column_type (GtkTreeModel *tree_model,
{
GxkListWrapper *self = GXK_LIST_WRAPPER (tree_model);
- g_return_val_if_fail (index >= 0 && index < int (self->n_cols), G_TYPE_INVALID);
+ assert_return (index >= 0 && index < int (self->n_cols), G_TYPE_INVALID);
return self->column_types[index];
}
@@ -267,7 +267,7 @@ gxk_list_wrapper_get_iter (GtkTreeModel *tree_model,
GxkListWrapper *self = GXK_LIST_WRAPPER (tree_model);
gint *ind;
- g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
+ assert_return (gtk_tree_path_get_depth (path) > 0, FALSE);
ind = gtk_tree_path_get_indices (path);
if (ind[0] < 0 || ind[0] >= int (self->n_rows))
@@ -286,7 +286,7 @@ gxk_list_wrapper_get_path (GtkTreeModel *tree_model,
GxkListWrapper *self = GXK_LIST_WRAPPER (tree_model);
GtkTreePath *path;
- g_return_val_if_fail (iter->stamp == int (self->stamp), NULL);
+ assert_return (iter->stamp == int (self->stamp), NULL);
uint i = P2I (iter->user_data);
if (i < 0 || i >= self->n_rows)
@@ -306,8 +306,8 @@ gxk_list_wrapper_get_value (GtkTreeModel *tree_model,
{
GxkListWrapper *self = GXK_LIST_WRAPPER (tree_model);
- g_return_if_fail (iter->stamp == int (self->stamp));
- g_return_if_fail (column >= 0 && uint (column) < self->n_cols);
+ assert_return (iter->stamp == int (self->stamp));
+ assert_return (column >= 0 && uint (column) < self->n_cols);
g_value_init (value, self->column_types[column]);
@@ -324,7 +324,7 @@ gxk_list_wrapper_iter_next (GtkTreeModel *tree_model,
{
GxkListWrapper *self = GXK_LIST_WRAPPER (tree_model);
- g_return_val_if_fail (iter->stamp == int (self->stamp), FALSE);
+ assert_return (iter->stamp == int (self->stamp), FALSE);
uint i = P2I (iter->user_data);
if (i < 0 || i >= self->n_rows)
@@ -366,7 +366,7 @@ gxk_list_wrapper_iter_nth_child (GtkTreeModel *tree_model,
if (parent) /* nodes of a list don't have a parent */
return FALSE;
- g_return_val_if_fail (n >= 0 && uint (n) < self->n_rows, FALSE);
+ assert_return (n >= 0 && uint (n) < self->n_rows, FALSE);
iter->stamp = self->stamp;
iter->user_data = I2P (n);
@@ -399,8 +399,8 @@ gxk_list_wrapper_notify_insert (GxkListWrapper *self,
GtkTreeIter iter;
GtkTreePath *path;
- g_return_if_fail (GXK_IS_LIST_WRAPPER (self));
- g_return_if_fail (nth_row <= self->n_rows);
+ assert_return (GXK_IS_LIST_WRAPPER (self));
+ assert_return (nth_row <= self->n_rows);
g_signal_emit (self, signal_row_change, 0, -1);
tree_model = GTK_TREE_MODEL (self);
@@ -425,8 +425,8 @@ gxk_list_wrapper_notify_change (GxkListWrapper *self,
GtkTreeIter iter;
GtkTreePath *path;
- g_return_if_fail (GXK_IS_LIST_WRAPPER (self));
- g_return_if_fail (nth_row < self->n_rows);
+ assert_return (GXK_IS_LIST_WRAPPER (self));
+ assert_return (nth_row < self->n_rows);
g_signal_emit (self, signal_row_change, 0, nth_row);
tree_model = GTK_TREE_MODEL (self);
@@ -447,8 +447,8 @@ gxk_list_wrapper_notify_delete (GxkListWrapper *self,
GtkTreeIter iter;
GtkTreePath *path;
- g_return_if_fail (GXK_IS_LIST_WRAPPER (self));
- g_return_if_fail (nth_row < self->n_rows);
+ assert_return (GXK_IS_LIST_WRAPPER (self));
+ assert_return (nth_row < self->n_rows);
g_signal_emit (self, signal_row_change, 0, -1);
tree_model = GTK_TREE_MODEL (self);
@@ -467,7 +467,7 @@ void
gxk_list_wrapper_notify_prepend (GxkListWrapper *self,
guint n_rows)
{
- g_return_if_fail (GXK_IS_LIST_WRAPPER (self));
+ assert_return (GXK_IS_LIST_WRAPPER (self));
g_object_freeze_notify (G_OBJECT (self));
g_signal_emit (self, signal_row_change, 0, -1);
@@ -480,7 +480,7 @@ void
gxk_list_wrapper_notify_append (GxkListWrapper *self,
guint n_rows)
{
- g_return_if_fail (GXK_IS_LIST_WRAPPER (self));
+ assert_return (GXK_IS_LIST_WRAPPER (self));
g_object_freeze_notify (G_OBJECT (self));
g_signal_emit (self, signal_row_change, 0, -1);
@@ -492,7 +492,7 @@ gxk_list_wrapper_notify_append (GxkListWrapper *self,
void
gxk_list_wrapper_notify_clear (GxkListWrapper *self)
{
- g_return_if_fail (GXK_IS_LIST_WRAPPER (self));
+ assert_return (GXK_IS_LIST_WRAPPER (self));
g_object_freeze_notify (G_OBJECT (self));
g_signal_emit (self, signal_row_change, 0, -1);
@@ -506,9 +506,9 @@ gxk_list_wrapper_get_iter_at (GxkListWrapper *self,
GtkTreeIter *iter,
guint index)
{
- g_return_if_fail (GXK_IS_LIST_WRAPPER (self));
- g_return_if_fail (iter != NULL);
- g_return_if_fail (index < self->n_rows);
+ assert_return (GXK_IS_LIST_WRAPPER (self));
+ assert_return (iter != NULL);
+ assert_return (index < self->n_rows);
iter->stamp = self->stamp;
iter->user_data = I2P (index);
@@ -518,9 +518,9 @@ guint
gxk_list_wrapper_get_index (GxkListWrapper *self,
GtkTreeIter *iter)
{
- g_return_val_if_fail (GXK_IS_LIST_WRAPPER (self), G_MAXUINT);
- g_return_val_if_fail (iter != NULL, G_MAXUINT);
- g_return_val_if_fail (iter->stamp == int (self->stamp), G_MAXUINT);
+ assert_return (GXK_IS_LIST_WRAPPER (self), G_MAXUINT);
+ assert_return (iter != NULL, G_MAXUINT);
+ assert_return (iter->stamp == int (self->stamp), G_MAXUINT);
return P2I (iter->user_data);
}
diff --git a/beast-gtk/gxk/gxklistwrapper.hh b/beast-gtk/gxk/gxklistwrapper.hh
index b5b628f..d0f6d45 100644
--- a/beast-gtk/gxk/gxklistwrapper.hh
+++ b/beast-gtk/gxk/gxklistwrapper.hh
@@ -2,7 +2,7 @@
#ifndef __GXK_LIST_WRAPPER_H__
#define __GXK_LIST_WRAPPER_H__
-#include <gtk/gtktreemodel.h>
+#include <gxk/gxkglobals.hh>
G_BEGIN_DECLS
diff --git a/beast-gtk/gxk/gxklogadjustment.cc b/beast-gtk/gxk/gxklogadjustment.cc
index c8a5289..a62b817 100644
--- a/beast-gtk/gxk/gxklogadjustment.cc
+++ b/beast-gtk/gxk/gxklogadjustment.cc
@@ -36,8 +36,8 @@ gxk_adapter_adjustment_from_adj (GtkAdjustment *client,
gpointer data,
GDestroyNotify destroy)
{
- g_return_val_if_fail (GTK_IS_ADJUSTMENT (client), NULL);
- g_return_val_if_fail (conv_func != NULL, NULL);
+ assert_return (GTK_IS_ADJUSTMENT (client), NULL);
+ assert_return (conv_func != NULL, NULL);
GxkAdapterAdjustment *self = (GxkAdapterAdjustment*) g_object_new (GXK_TYPE_ADAPTER_ADJUSTMENT, NULL);
gxk_adapter_adjustment_set_client (self, client);
gxk_adapter_adjustment_setup (self, conv_func, data, destroy);
@@ -152,9 +152,9 @@ void
gxk_adapter_adjustment_set_client (GxkAdapterAdjustment *self,
GtkAdjustment *client)
{
- g_return_if_fail (GXK_IS_ADAPTER_ADJUSTMENT (self));
+ assert_return (GXK_IS_ADAPTER_ADJUSTMENT (self));
if (client)
- g_return_if_fail (GTK_IS_ADJUSTMENT (client));
+ assert_return (GTK_IS_ADJUSTMENT (client));
if (client)
g_object_ref (client);
@@ -185,7 +185,7 @@ gxk_adapter_adjustment_setup (GxkAdapterAdjustment *self,
gpointer data,
GDestroyNotify destroy)
{
- g_return_if_fail (GXK_IS_ADAPTER_ADJUSTMENT (self));
+ assert_return (GXK_IS_ADAPTER_ADJUSTMENT (self));
GtkAdjustment *adj = GTK_ADJUSTMENT (self);
gpointer odata = self->data;
GDestroyNotify odestroy = self->destroy;
@@ -301,7 +301,7 @@ gxk_log_adjustment_from_adj (GtkAdjustment *client)
{
GxkLogAdjustment *self;
- g_return_val_if_fail (GTK_IS_ADJUSTMENT (client), NULL);
+ assert_return (GTK_IS_ADJUSTMENT (client), NULL);
self = (GxkLogAdjustment*) g_object_new (GXK_TYPE_LOG_ADJUSTMENT, NULL);
gxk_log_adjustment_set_client (self, client);
@@ -313,9 +313,9 @@ void
gxk_log_adjustment_set_client (GxkLogAdjustment *self,
GtkAdjustment *client)
{
- g_return_if_fail (GXK_IS_LOG_ADJUSTMENT (self));
+ assert_return (GXK_IS_LOG_ADJUSTMENT (self));
if (client)
- g_return_if_fail (GTK_IS_ADJUSTMENT (client));
+ assert_return (GTK_IS_ADJUSTMENT (client));
g_object_ref (self);
if (self->client)
@@ -345,9 +345,9 @@ gxk_log_adjustment_setup (GxkLogAdjustment *self,
{
GtkAdjustment *adj;
- g_return_if_fail (GXK_IS_LOG_ADJUSTMENT (self));
- g_return_if_fail (n_steps > 0);
- g_return_if_fail (base > 0);
+ assert_return (GXK_IS_LOG_ADJUSTMENT (self));
+ assert_return (n_steps > 0);
+ assert_return (base > 0);
adj = GTK_ADJUSTMENT (self);
self->center = center;
diff --git a/beast-gtk/gxk/gxkmenubutton.cc b/beast-gtk/gxk/gxkmenubutton.cc
index 662e9b6..60d332b 100644
--- a/beast-gtk/gxk/gxkmenubutton.cc
+++ b/beast-gtk/gxk/gxkmenubutton.cc
@@ -545,7 +545,7 @@ static GtkWidget*
menu_button_create_button (GxkMenuButton *self,
gpointer child)
{
- g_return_val_if_fail (self->button == NULL, NULL);
+ assert_return (self->button == NULL, NULL);
self->button = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
"relief", self->relief,
"child", child ? gtk_widget_get_toplevel ((GtkWidget*) child) :
NULL,
diff --git a/beast-gtk/gxk/gxknotebook.cc b/beast-gtk/gxk/gxknotebook.cc
index e8e643c..a3bf129 100644
--- a/beast-gtk/gxk/gxknotebook.cc
+++ b/beast-gtk/gxk/gxknotebook.cc
@@ -185,7 +185,7 @@ void
gxk_notebook_set_assortment (GxkNotebook *self,
GxkAssortment *assortment)
{
- g_return_if_fail (GXK_IS_NOTEBOOK (self));
+ assert_return (GXK_IS_NOTEBOOK (self));
GtkNotebook *notebook = GTK_NOTEBOOK (self);
if (self->assortment == assortment)
return;
diff --git a/beast-gtk/gxk/gxkparam.cc b/beast-gtk/gxk/gxkparam.cc
index d019ab8..2d8ca55 100644
--- a/beast-gtk/gxk/gxkparam.cc
+++ b/beast-gtk/gxk/gxkparam.cc
@@ -57,8 +57,8 @@ gxk_param_new (GParamSpec *pspec,
GxkParamBinding *binding,
gpointer user_data)
{
- g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
- g_return_val_if_fail (binding != NULL, NULL);
+ assert_return (G_IS_PARAM_SPEC (pspec), NULL);
+ assert_return (binding != NULL, NULL);
return param_new (pspec, FALSE, binding, user_data);
}
@@ -67,8 +67,8 @@ gxk_param_new_constant (GParamSpec *pspec,
GxkParamBinding *binding,
gpointer user_data)
{
- g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), NULL);
- g_return_val_if_fail (binding != NULL, NULL);
+ assert_return (G_IS_PARAM_SPEC (pspec), NULL);
+ assert_return (binding != NULL, NULL);
return param_new (pspec, TRUE, binding, user_data);
}
@@ -94,7 +94,7 @@ gxk_object_set_param_callback (GtkObject *object,
GxkParamUpdateFunc ufunc)
{
/* sets the callback to apply param->value to object (update GUI) */
- g_return_if_fail (GTK_IS_OBJECT (object));
+ assert_return (GTK_IS_OBJECT (object));
g_object_set_data ((GObject*) object, "GxkParamUpdateFunc", (void*) ufunc);
}
@@ -104,7 +104,7 @@ gxk_param_update (GxkParam *param)
GSList *slist;
gboolean updating;
- g_return_if_fail (GXK_IS_PARAM (param));
+ assert_return (GXK_IS_PARAM (param));
updating = param->updating;
param->updating = TRUE;
@@ -166,9 +166,9 @@ gxk_param_remove_object (GxkParam *param,
GtkObject *object)
{
GSList *slist;
- g_return_if_fail (GXK_IS_PARAM (param));
+ assert_return (GXK_IS_PARAM (param));
slist = g_slist_find (param->objects, object);
- g_return_if_fail (slist != NULL);
+ assert_return (slist != NULL);
param->objects = g_slist_delete_link (param->objects, slist);
g_object_disconnect (object, "any_signal::destroy", gxk_param_remove_object, param, NULL);
if (GTK_IS_WIDGET (object) && /* check for grab_widget: */
@@ -184,7 +184,7 @@ void
gxk_param_add_object (GxkParam *param,
GtkObject *object)
{
- g_return_if_fail (GXK_IS_PARAM (param));
+ assert_return (GXK_IS_PARAM (param));
if (gxk_signal_handler_pending (object, "destroy", G_CALLBACK (gxk_param_remove_object), param) == FALSE)
{
if (GTK_IS_WIDGET (object))
@@ -198,7 +198,7 @@ gxk_param_add_object (GxkParam *param,
void
gxk_param_apply_value (GxkParam *param)
{
- g_return_if_fail (GXK_IS_PARAM (param));
+ assert_return (GXK_IS_PARAM (param));
if (param->updating)
{
g_warning ("%s: param (%p) currently in update", G_STRFUNC, param);
@@ -216,7 +216,7 @@ gxk_param_apply_value (GxkParam *param)
void
gxk_param_apply_default (GxkParam *param)
{
- g_return_if_fail (GXK_IS_PARAM (param));
+ assert_return (GXK_IS_PARAM (param));
if (!param->updating && param->editable && param->sensitive)
{
g_param_value_set_default (param->pspec, ¶m->value);
@@ -228,7 +228,7 @@ void
gxk_param_set_editable (GxkParam *param,
gboolean editable)
{
- g_return_if_fail (GXK_IS_PARAM (param));
+ assert_return (GXK_IS_PARAM (param));
editable = editable != FALSE;
if (param->ueditable != editable)
{
@@ -248,7 +248,7 @@ gxk_param_set_editable (GxkParam *param,
const gchar*
gxk_param_get_name (GxkParam *param)
{
- g_return_val_if_fail (GXK_IS_PARAM (param), NULL);
+ assert_return (GXK_IS_PARAM (param), NULL);
return param->pspec->name;
}
@@ -264,7 +264,7 @@ gxk_param_dup_tooltip (GxkParam *param)
{
gchar *tooltip;
const gchar *ctip;
- g_return_val_if_fail (GXK_IS_PARAM (param), NULL);
+ assert_return (GXK_IS_PARAM (param), NULL);
ctip = g_param_spec_get_blurb (param->pspec);
if (!_param_devel_tips)
tooltip = g_strdup (ctip);
@@ -278,9 +278,9 @@ gxk_param_dup_tooltip (GxkParam *param)
void
gxk_param_start_grouping (GxkParam *param)
{
- g_return_if_fail (GXK_IS_PARAM (param));
- g_return_if_fail (param->binding != NULL);
- g_return_if_fail (param->grouping < 0xff);
+ assert_return (GXK_IS_PARAM (param));
+ assert_return (param->binding != NULL);
+ assert_return (param->grouping < 0xff);
if (!param->grouping++ &&
param->binding->start_grouping)
param->binding->start_grouping (param);
@@ -289,8 +289,8 @@ gxk_param_start_grouping (GxkParam *param)
void
gxk_param_stop_grouping (GxkParam *param)
{
- g_return_if_fail (GXK_IS_PARAM (param));
- g_return_if_fail (param->binding != NULL);
+ assert_return (GXK_IS_PARAM (param));
+ assert_return (param->binding != NULL);
if (param->grouping)
{
if (!--param->grouping &&
@@ -302,8 +302,8 @@ gxk_param_stop_grouping (GxkParam *param)
void
gxk_param_destroy (GxkParam *param)
{
- g_return_if_fail (GXK_IS_PARAM (param));
- g_return_if_fail (param->binding != NULL);
+ assert_return (GXK_IS_PARAM (param));
+ assert_return (param->binding != NULL);
while (param->grouping)
gxk_param_stop_grouping (param);
@@ -475,10 +475,10 @@ void
gxk_param_set_object (GxkParam *param,
GObject *object)
{
- g_return_if_fail (GXK_IS_PARAM (param));
- g_return_if_fail (param->binding == &g_object_binding);
+ assert_return (GXK_IS_PARAM (param));
+ assert_return (param->binding == &g_object_binding);
if (object)
- g_return_if_fail (G_IS_OBJECT (object));
+ assert_return (G_IS_OBJECT (object));
object_binding_destroy (param);
param->bdata[0].v_pointer = object;
@@ -494,7 +494,7 @@ gxk_param_set_object (GxkParam *param,
GObject*
gxk_param_get_object (GxkParam *param)
{
- g_return_val_if_fail (GXK_IS_PARAM (param), NULL);
+ assert_return (GXK_IS_PARAM (param), NULL);
if (param->binding == &g_object_binding)
return (GObject*) param->bdata[0].v_pointer;
@@ -528,7 +528,7 @@ gxk_param_register_editor (GxkParamEditor *editor,
{
if (editor->type_match.all_int_nums)
{
- g_return_if_fail (editor->type_match.type == G_TYPE_NONE);
+ assert_return (editor->type_match.type == G_TYPE_NONE);
params_register_editor_dup_typed (editor, i18n_domain, G_TYPE_CHAR);
params_register_editor_dup_typed (editor, i18n_domain, G_TYPE_UCHAR);
params_register_editor_dup_typed (editor, i18n_domain, G_TYPE_INT);
@@ -540,13 +540,13 @@ gxk_param_register_editor (GxkParamEditor *editor,
}
if (editor->type_match.all_float_nums)
{
- g_return_if_fail (editor->type_match.type == G_TYPE_NONE);
+ assert_return (editor->type_match.type == G_TYPE_NONE);
params_register_editor_dup_typed (editor, i18n_domain, G_TYPE_FLOAT);
params_register_editor_dup_typed (editor, i18n_domain, G_TYPE_DOUBLE);
}
if (!editor->type_match.all_int_nums && !editor->type_match.all_float_nums)
{
- g_return_if_fail (editor->type_match.type != G_TYPE_NONE);
+ assert_return (editor->type_match.type != G_TYPE_NONE);
param_register_editor (editor, i18n_domain);
}
}
@@ -711,8 +711,8 @@ gxk_param_editor_score (const gchar *editor_name,
{
guint rating = 0; /* threshold for mismatch */
GSList *slist;
- g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), 0);
- g_return_val_if_fail (editor_name != NULL, 0);
+ assert_return (G_IS_PARAM_SPEC (pspec), 0);
+ assert_return (editor_name != NULL, 0);
for (slist = _param_editor_list; slist; slist = slist->next)
{
GxkParamEditor *editor = (GxkParamEditor*) slist->data;
@@ -730,7 +730,7 @@ gxk_param_editor_debug_score (GParamSpec *pspec)
{
guint rating = 0; /* threshold for mismatch */
GSList *slist;
- g_return_if_fail (G_IS_PARAM_SPEC (pspec));
+ assert_return (G_IS_PARAM_SPEC (pspec));
const gchar *options = g_param_spec_get_options (pspec);
g_printerr ("GxkParamEditor: rating for pspec: name=%s fundamental=%s type=%s options=%s nick=\"%s\"
blurb=\"%s\"\n",
pspec->name,
@@ -750,8 +750,8 @@ const gchar*
gxk_param_lookup_editor (const gchar *editor_name,
GParamSpec *pspec)
{
- g_return_val_if_fail (editor_name != NULL, 0);
- g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), 0);
+ assert_return (editor_name != NULL, 0);
+ assert_return (G_IS_PARAM_SPEC (pspec), 0);
return param_lookup_editor (editor_name, pspec)->ident.name;
}
@@ -826,8 +826,8 @@ void
gxk_param_set_size_group (GxkParam *param,
guint size_group)
{
- g_return_if_fail (GXK_IS_PARAM (param));
- g_return_if_fail (size_group <= n_size_groups);
+ assert_return (GXK_IS_PARAM (param));
+ assert_return (size_group <= n_size_groups);
param->size_group = size_group;
}
@@ -835,7 +835,7 @@ void
gxk_param_set_sizes (guint size_group,
const GxkParamEditorSizes *esizes)
{
- g_return_if_fail (size_group > 0 && size_group <= n_size_groups);
+ assert_return (size_group > 0 && size_group <= n_size_groups);
size_groups[size_group - 1] = esizes ? *esizes : param_editor_default_sizes;
}
@@ -907,7 +907,7 @@ gxk_param_entry_set_text (GxkParam *param,
const gchar *text)
{
GtkEntry *entry = (GtkEntry*) _entry;
- g_return_if_fail (GTK_IS_ENTRY (entry));
+ assert_return (GTK_IS_ENTRY (entry));
if (!text)
text = "";
if (!g_str_equal (gtk_entry_get_text (entry), text))
diff --git a/beast-gtk/gxk/gxkpolygon.cc b/beast-gtk/gxk/gxkpolygon.cc
index 20af15a..43b4216 100644
--- a/beast-gtk/gxk/gxkpolygon.cc
+++ b/beast-gtk/gxk/gxkpolygon.cc
@@ -109,9 +109,9 @@ gxk_polygon_set_lines (GxkPolygon *self,
guint n_lines,
GxkPolygonLine *lines)
{
- g_return_if_fail (GXK_IS_POLYGON (self));
+ assert_return (GXK_IS_POLYGON (self));
if (n_lines)
- g_return_if_fail (lines != NULL);
+ assert_return (lines != NULL);
g_free (self->lines);
self->n_lines = n_lines;
@@ -132,9 +132,9 @@ gxk_polygon_set_arcs (GxkPolygon *self,
guint n_arcs,
GxkPolygonArc *arcs)
{
- g_return_if_fail (GXK_IS_POLYGON (self));
+ assert_return (GXK_IS_POLYGON (self));
if (n_arcs)
- g_return_if_fail (arcs != NULL);
+ assert_return (arcs != NULL);
g_free (self->arcs);
self->n_arcs = n_arcs;
@@ -153,7 +153,7 @@ void
gxk_polygon_set_graph (GxkPolygon *self,
GxkPolygonGraph *polygon_graph)
{
- g_return_if_fail (GXK_IS_POLYGON (self));
+ assert_return (GXK_IS_POLYGON (self));
if (polygon_graph)
{
gxk_polygon_set_lines (self, polygon_graph->n_lines, polygon_graph->lines);
@@ -179,7 +179,7 @@ void
gxk_polygon_set_length (GxkPolygon *self,
guint length)
{
- g_return_if_fail (GXK_IS_POLYGON (self));
+ assert_return (GXK_IS_POLYGON (self));
self->request_length = length;
gtk_widget_queue_resize (GTK_WIDGET (self));
diff --git a/beast-gtk/gxk/gxkrackeditor.cc b/beast-gtk/gxk/gxkrackeditor.cc
index c4c2900..3077eea 100644
--- a/beast-gtk/gxk/gxkrackeditor.cc
+++ b/beast-gtk/gxk/gxkrackeditor.cc
@@ -523,8 +523,8 @@ gxk_rack_table_handle_button_release (GxkRackTable *self,
void
gxk_rack_table_destroy_editor (GxkRackTable *self)
{
- g_return_if_fail (GXK_IS_RACK_TABLE (self));
- g_return_if_fail (self->editor);
+ assert_return (GXK_IS_RACK_TABLE (self));
+ assert_return (self->editor);
rack_table_abort_drag (self, GDK_CURRENT_TIME);
rack_table_editor_unrealize (self);
g_free (self->editor);
@@ -535,7 +535,7 @@ void
gxk_rack_table_set_edit_mode (GxkRackTable *self,
gboolean enable_editing)
{
- g_return_if_fail (GXK_IS_RACK_TABLE (self));
+ assert_return (GXK_IS_RACK_TABLE (self));
enable_editing = enable_editing && GTK_WIDGET_DRAWABLE (self);
if (!self->editor && enable_editing)
@@ -560,7 +560,7 @@ gxk_rack_table_check_cell (GxkRackTable *self,
guint col,
guint row)
{
- g_return_val_if_fail (GXK_IS_RACK_TABLE (self), FALSE);
+ assert_return (GXK_IS_RACK_TABLE (self), FALSE);
gxk_rack_table_update_child_map (self);
return g_bit_matrix_test (self->child_map, col, row);
@@ -578,7 +578,7 @@ gxk_rack_table_check_area (GxkRackTable *self,
guint ecol, erow, ehspan, evspan, i, j;
gboolean empty_frame;
- g_return_val_if_fail (GXK_IS_RACK_TABLE (self), FALSE);
+ assert_return (GXK_IS_RACK_TABLE (self), FALSE);
gxk_rack_table_update_child_map (self);
if (col + hspan > self->child_map->width ||
@@ -622,7 +622,7 @@ gxk_rack_table_expand_rect (GxkRackTable *self,
GtkTable *table;
guint i, j, f;
- g_return_val_if_fail (GXK_IS_RACK_TABLE (self), FALSE);
+ assert_return (GXK_IS_RACK_TABLE (self), FALSE);
gxk_rack_table_update_child_map (self);
table = GTK_TABLE (self);
diff --git a/beast-gtk/gxk/gxkrackitem.cc b/beast-gtk/gxk/gxkrackitem.cc
index 1366a6f..928944a 100644
--- a/beast-gtk/gxk/gxkrackitem.cc
+++ b/beast-gtk/gxk/gxkrackitem.cc
@@ -246,7 +246,7 @@ gxk_rack_item_button_press (GxkRackItem *self,
void
gxk_rack_item_gui_changed (GxkRackItem *self)
{
- g_return_if_fail (GXK_IS_RACK_ITEM (self));
+ assert_return (GXK_IS_RACK_ITEM (self));
}
gboolean
diff --git a/beast-gtk/gxk/gxkracktable.cc b/beast-gtk/gxk/gxkracktable.cc
index 494565f..72be3a7 100644
--- a/beast-gtk/gxk/gxkracktable.cc
+++ b/beast-gtk/gxk/gxkracktable.cc
@@ -273,8 +273,8 @@ gxk_rack_table_draw_area (GxkRackTable *self,
GtkTable *table = GTK_TABLE (self);
guint i, x, y, width, height, hcell2 = hcell1 + hspan, vcell2 = vcell1 + vspan;
- g_return_if_fail (hspan > 0 && hcell2 <= table->ncols);
- g_return_if_fail (vspan > 0 && vcell2 <= table->nrows);
+ assert_return (hspan > 0 && hcell2 <= table->ncols);
+ assert_return (vspan > 0 && vcell2 <= table->nrows);
x = GTK_CONTAINER (widget)->border_width + widget->allocation.x;
width = 0;
@@ -673,7 +673,7 @@ gxk_rack_table_update_child_map (GxkRackTable *self)
void
gxk_rack_table_cover_up (GxkRackTable *self)
{
- g_return_if_fail (GXK_IS_RACK_TABLE (self));
+ assert_return (GXK_IS_RACK_TABLE (self));
if (!self->covers)
self->covers = rack_cover_add_plates (self);
}
@@ -681,7 +681,7 @@ gxk_rack_table_cover_up (GxkRackTable *self)
void
gxk_rack_table_uncover (GxkRackTable *self)
{
- g_return_if_fail (GXK_IS_RACK_TABLE (self));
+ assert_return (GXK_IS_RACK_TABLE (self));
while (self->covers)
{
GtkWidget *widget = (GtkWidget*) g_slist_pop_head (&self->covers);
diff --git a/beast-gtk/gxk/gxkradget.cc b/beast-gtk/gxk/gxkradget.cc
index 802a672..4d9fb13 100644
--- a/beast-gtk/gxk/gxkradget.cc
+++ b/beast-gtk/gxk/gxkradget.cc
@@ -965,7 +965,7 @@ gxk_radget_parse_text (const gchar *domain_name,
{
Domain *domain;
GError *myerror = NULL;
- g_return_if_fail (text != NULL);
+ assert_return (text != NULL);
domain = domain_name ? (Domain*) g_datalist_get_data (&domains, domain_name) : standard_domain;
if (!domain)
{
@@ -1547,7 +1547,7 @@ gxk_radget_args_set (GxkRadgetArgs *args,
{
GQuark quark = g_quark_from_string (name);
guint i;
- g_return_val_if_fail (name != NULL, args);
+ assert_return (name != NULL, args);
if (!args)
args = gxk_radget_args (NULL);
for (i = 0; i < ARGS_N_ENTRIES (args); i++)
@@ -1650,12 +1650,12 @@ gxk_radget_creator (GxkRadget *radget,
GSList *call_args,
GSList *env_args)
{
- g_return_val_if_fail (domain_name != NULL, NULL);
- g_return_val_if_fail (name != NULL, NULL);
+ assert_return (domain_name != NULL, NULL);
+ assert_return (name != NULL, NULL);
if (radget)
{
Node *radget_node = (Node*) g_object_get_qdata ((GObject*) radget, quark_radget_node);
- g_return_val_if_fail (radget_node == NULL, NULL);
+ assert_return (radget_node == NULL, NULL);
}
return radget_creator (radget, domain_name, name, parent, call_args, env_args);
}
@@ -1727,7 +1727,7 @@ const gchar*
gxk_radget_get_domain (GxkRadget *radget)
{
Node *radget_node = (Node*) g_object_get_qdata ((GObject*) radget, quark_radget_node);
- g_return_val_if_fail (radget_node != NULL, NULL);
+ assert_return (radget_node != NULL, NULL);
return radget_node->domain;
}
@@ -1764,8 +1764,8 @@ gxk_radget_find (GxkRadget *radget,
{
const gchar *next, *c = name;
- g_return_val_if_fail (radget != NULL, NULL);
- g_return_val_if_fail (name != NULL, NULL);
+ assert_return (radget != NULL, NULL);
+ assert_return (name != NULL, NULL);
if (!GTK_IS_WIDGET (radget))
return NULL;
@@ -1819,7 +1819,7 @@ gxk_radget_add (GxkRadget *radget,
const gchar *area,
gpointer widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
radget = gxk_radget_find_area (radget, area);
if (GTK_IS_CONTAINER (radget))
gtk_container_add ((GtkContainer*) radget, (GtkWidget*) widget);
@@ -1902,9 +1902,9 @@ gxk_radget_define_type (GType type,
const gchar *attribute_names[1] = { NULL };
const gchar *attribute_values[1] = { NULL };
- g_return_if_fail (!G_TYPE_IS_ABSTRACT (type));
- g_return_if_fail (G_TYPE_IS_OBJECT (type));
- g_return_if_fail (g_type_get_qdata (type, quark_radget_type) == NULL);
+ assert_return (!G_TYPE_IS_ABSTRACT (type));
+ assert_return (G_TYPE_IS_OBJECT (type));
+ assert_return (g_type_get_qdata (type, quark_radget_type) == NULL);
g_type_set_qdata (type, quark_radget_type, (gpointer) ggtype);
radget_define_type (type, g_type_name (type), attribute_names, attribute_values, NULL);
@@ -2019,9 +2019,9 @@ gxk_radget_define_widget_type (GType type)
const gchar *attribute_values[G_N_ELEMENTS (widget_def) + G_N_ELEMENTS (container_def) + 1];
guint i, j = 0;
- g_return_if_fail (!G_TYPE_IS_ABSTRACT (type));
- g_return_if_fail (g_type_is_a (type, GTK_TYPE_WIDGET));
- g_return_if_fail (g_type_get_qdata (type, quark_radget_type) == NULL);
+ assert_return (!G_TYPE_IS_ABSTRACT (type));
+ assert_return (g_type_is_a (type, GTK_TYPE_WIDGET));
+ assert_return (g_type_get_qdata (type, quark_radget_type) == NULL);
g_type_set_qdata (type, quark_radget_type, (gpointer) &widget_info);
for (i = 0; i < G_N_ELEMENTS (widget_def); i++)
@@ -2094,12 +2094,12 @@ gxk_radget_register_hook (GParamSpec *pspec,
guint property_id,
GxkRadgetHook hook_func)
{
- g_return_if_fail (G_IS_PARAM_SPEC (pspec));
- g_return_if_fail (pspec->flags & G_PARAM_WRITABLE);
- g_return_if_fail (property_id > 0);
- g_return_if_fail (pspec->param_id == 0);
- g_return_if_fail (pspec->owner_type == 0);
- g_return_if_fail (hook_func != NULL);
+ assert_return (G_IS_PARAM_SPEC (pspec));
+ assert_return (pspec->flags & G_PARAM_WRITABLE);
+ assert_return (property_id > 0);
+ assert_return (pspec->param_id == 0);
+ assert_return (pspec->owner_type == 0);
+ assert_return (hook_func != NULL);
if (find_hook (pspec->name, NULL))
{
g_printerr ("GXK: not re-registering hook property: %s\n", pspec->name);
diff --git a/beast-gtk/gxk/gxkradgetfactory.cc b/beast-gtk/gxk/gxkradgetfactory.cc
index bdf0bd8..06ee915 100644
--- a/beast-gtk/gxk/gxkradgetfactory.cc
+++ b/beast-gtk/gxk/gxkradgetfactory.cc
@@ -145,7 +145,7 @@ gxk_radget_factory_finalize (GObject *object)
g_object_unref (b);
}
- g_return_if_fail (self->timer == 0);
+ assert_return (self->timer == 0);
/* chain parent class' handler */
G_OBJECT_CLASS (gxk_radget_factory_parent_class)->finalize (object);
@@ -395,8 +395,8 @@ gxk_radget_factory_attach (GxkRadgetFactory *self,
{
GSList *slist;
- g_return_if_fail (self->radget == NULL);
- g_return_if_fail (GTK_IS_WIDGET (radget));
+ assert_return (self->radget == NULL);
+ assert_return (GTK_IS_WIDGET (radget));
g_object_ref (self);
slist = (GSList*) g_object_steal_qdata ((GObject*) radget, quark_radget_factory_hook);
diff --git a/beast-gtk/gxk/gxkscrollcanvas.cc b/beast-gtk/gxk/gxkscrollcanvas.cc
index 2ad499b..de51119 100644
--- a/beast-gtk/gxk/gxkscrollcanvas.cc
+++ b/beast-gtk/gxk/gxkscrollcanvas.cc
@@ -192,9 +192,9 @@ void
gxk_scroll_canvas_set_hadjustment (GxkScrollCanvas *self,
GtkAdjustment *adjustment)
{
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
if (adjustment)
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
if (self->hadjustment)
{
@@ -221,9 +221,9 @@ void
gxk_scroll_canvas_set_vadjustment (GxkScrollCanvas *self,
GtkAdjustment *adjustment)
{
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
if (adjustment)
- g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
+ assert_return (GTK_IS_ADJUSTMENT (adjustment));
if (self->vadjustment)
{
@@ -260,7 +260,7 @@ scroll_canvas_set_scroll_adjustments (GxkScrollCanvas *self,
void
gxk_scroll_canvas_reset_pango_layouts (GxkScrollCanvas *self)
{
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
/* resort to destroying the layouts to force recreation,
* so things like merging a font_desc with STYLE->font_desc
* take effect.
@@ -447,7 +447,7 @@ void
gxk_scroll_canvas_reallocate (GxkScrollCanvas *self)
{
GxkScrollCanvasClass *klass;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
klass = GXK_SCROLL_CANVAS_GET_CLASS (self);
/* one reason we could be called is simply that self->layout has changed */
@@ -1034,7 +1034,7 @@ gxk_scroll_canvas_set_window_cursor (GxkScrollCanvas *self,
GdkCursorType cursor)
{
GdkCursorType ocursor;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
ocursor = (GdkCursorType) g_object_get_long (self, "window_cursor");
if (cursor != ocursor)
{
@@ -1050,7 +1050,7 @@ gxk_scroll_canvas_set_canvas_cursor (GxkScrollCanvas *self,
GdkCursorType cursor)
{
GdkCursorType ocursor;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
ocursor = (GdkCursorType) g_object_get_long (self, "canvas_cursor");
if (cursor != ocursor)
{
@@ -1065,7 +1065,7 @@ gxk_scroll_canvas_set_top_panel_cursor (GxkScrollCanvas *self,
GdkCursorType cursor)
{
GdkCursorType ocursor;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
ocursor = (GdkCursorType) g_object_get_long (self, "top_panel_cursor");
if (cursor != ocursor)
{
@@ -1080,7 +1080,7 @@ gxk_scroll_canvas_set_left_panel_cursor (GxkScrollCanvas *self,
GdkCursorType cursor)
{
GdkCursorType ocursor;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
ocursor = (GdkCursorType) g_object_get_long (self, "left_panel_cursor");
if (cursor != ocursor)
{
@@ -1095,7 +1095,7 @@ gxk_scroll_canvas_set_right_panel_cursor (GxkScrollCanvas *self,
GdkCursorType cursor)
{
GdkCursorType ocursor;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
ocursor = (GdkCursorType) g_object_get_long (self, "right_panel_cursor");
if (cursor != ocursor)
{
@@ -1110,7 +1110,7 @@ gxk_scroll_canvas_set_bottom_panel_cursor (GxkScrollCanvas *self,
GdkCursorType cursor)
{
GdkCursorType ocursor;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
ocursor = (GdkCursorType) g_object_get_long (self, "bottom_panel_cursor");
if (cursor != ocursor)
{
@@ -1125,7 +1125,7 @@ gxk_scroll_canvas_get_pango_layout (GxkScrollCanvas *self,
guint nth)
{
guint i;
- g_return_val_if_fail (GXK_IS_SCROLL_CANVAS (self), NULL);
+ assert_return (GXK_IS_SCROLL_CANVAS (self), NULL);
if (nth >= self->n_pango_layouts)
{
@@ -1147,7 +1147,7 @@ PangoLayout*
gxk_scroll_canvas_peek_pango_layout (GxkScrollCanvas *self,
guint nth)
{
- g_return_val_if_fail (GXK_IS_SCROLL_CANVAS (self), NULL);
+ assert_return (GXK_IS_SCROLL_CANVAS (self), NULL);
return nth < self->n_pango_layouts ? self->pango_layouts[nth] : NULL;
}
@@ -1346,7 +1346,7 @@ scroll_canvas_scroll_adjustments (GxkScrollCanvas *self,
gboolean
gxk_scroll_canvas_dragging (GxkScrollCanvas *self)
{
- g_return_val_if_fail (GXK_IS_SCROLL_CANVAS (self), FALSE);
+ assert_return (GXK_IS_SCROLL_CANVAS (self), FALSE);
GxkScrollCanvasDrag *drag = DRAG (self);
return drag != NULL;
}
@@ -1354,7 +1354,7 @@ gxk_scroll_canvas_dragging (GxkScrollCanvas *self)
void
gxk_scroll_canvas_drag_abort (GxkScrollCanvas *self)
{
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
GxkScrollCanvasDrag *drag = DRAG (self);
if (drag)
{
@@ -1566,7 +1566,7 @@ gxk_scroll_canvas_scroll_to (GxkScrollCanvas *self,
gint scroll_area_x,
gint scroll_area_y)
{
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
if (GTK_WIDGET_REALIZED (self))
{
@@ -1598,7 +1598,7 @@ gxk_scroll_canvas_make_visible (GxkScrollCanvas *self,
gint scroll_area_width,
gint scroll_area_height)
{
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
if (GTK_WIDGET_REALIZED (self))
{
gint ihv = self->hadjustment->value;
@@ -1626,7 +1626,7 @@ gxk_scroll_canvas_lookup_marker (GxkScrollCanvas *self,
guint *countp)
{
guint i;
- g_return_val_if_fail (GXK_IS_SCROLL_CANVAS (self), NULL);
+ assert_return (GXK_IS_SCROLL_CANVAS (self), NULL);
if (countp)
*countp = 0;
@@ -1651,8 +1651,8 @@ gxk_scroll_canvas_add_marker (GxkScrollCanvas *self,
{
GxkScrollMarker *marker;
guint i;
- g_return_val_if_fail (GXK_IS_SCROLL_CANVAS (self), NULL);
- g_return_val_if_fail (index > 0, NULL);
+ assert_return (GXK_IS_SCROLL_CANVAS (self), NULL);
+ assert_return (index > 0, NULL);
for (i = 0; i < self->n_markers; i++)
if (index < self->markers[i].index)
@@ -1671,8 +1671,8 @@ gxk_scroll_canvas_remove_marker (GxkScrollCanvas *self,
GxkScrollMarker *marker)
{
guint i;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
- g_return_if_fail (marker != NULL);
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (marker != NULL);
i = marker - self->markers;
gxk_scroll_canvas_setup_marker (self, marker, NULL, 0, 0, 0, 0);
@@ -1690,11 +1690,11 @@ gxk_scroll_canvas_setup_marker (GxkScrollCanvas *self,
guint height)
{
GtkWidget *widget;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
- g_return_if_fail (marker != NULL);
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (marker != NULL);
widget = GTK_WIDGET (self);
if (windowp)
- g_return_if_fail (windowp == &widget->window || windowp == &self->canvas ||
+ assert_return (windowp == &widget->window || windowp == &self->canvas ||
windowp == &self->top_panel || windowp == &self->left_panel ||
windowp == &self->right_panel || windowp == &self->bottom_panel);
@@ -1714,8 +1714,8 @@ gxk_scroll_canvas_move_marker (GxkScrollCanvas *self,
guint x,
guint y)
{
- g_return_if_fail (GXK_IS_SCROLL_CANVAS (self));
- g_return_if_fail (marker != NULL);
+ assert_return (GXK_IS_SCROLL_CANVAS (self));
+ assert_return (marker != NULL);
uint ox = marker->extends.x;
uint oy = marker->extends.y;
@@ -1872,7 +1872,7 @@ void
gxk_scroll_canvas_class_skin_changed (GxkScrollCanvasClass *klass)
{
GSList *slist;
- g_return_if_fail (GXK_IS_SCROLL_CANVAS_CLASS (klass));
+ assert_return (GXK_IS_SCROLL_CANVAS_CLASS (klass));
for (slist = klass->realized_widgets; slist; slist = slist->next)
scroll_canvas_reset_skin_and_style ((GxkScrollCanvas*) slist->data, TRUE);
}
diff --git a/beast-gtk/gxk/gxksimplelabel.cc b/beast-gtk/gxk/gxksimplelabel.cc
index de066ee..4bd365f 100644
--- a/beast-gtk/gxk/gxksimplelabel.cc
+++ b/beast-gtk/gxk/gxksimplelabel.cc
@@ -359,9 +359,9 @@ void
gxk_simple_label_set_mnemonic_widget (GxkSimpleLabel *self,
GtkWidget *widget)
{
- g_return_if_fail (GXK_IS_SIMPLE_LABEL (self));
+ assert_return (GXK_IS_SIMPLE_LABEL (self));
if (widget)
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (self->mnemonic_widget)
g_object_weak_unref (G_OBJECT (self->mnemonic_widget),
diff --git a/beast-gtk/gxk/gxkspline.cc b/beast-gtk/gxk/gxkspline.cc
index 210c961..50f36dd 100644
--- a/beast-gtk/gxk/gxkspline.cc
+++ b/beast-gtk/gxk/gxkspline.cc
@@ -87,7 +87,7 @@ gxk_spline_new (guint n_points,
double dy_start,
double dy_end)
{
- g_return_val_if_fail (n_points >= 2, NULL);
+ assert_return (n_points >= 2, NULL);
GxkSpline *spline = (GxkSpline*) g_malloc (sizeof (spline[0]) + n_points * sizeof (spline->segs[0]));
/* initialize segments */
spline->n_segs = n_points;
@@ -380,7 +380,7 @@ gxk_spline_findx (const GxkSpline *spline,
void
gxk_spline_free (GxkSpline *spline)
{
- g_return_if_fail (spline != NULL);
+ assert_return (spline != NULL);
g_free (spline);
}
diff --git a/beast-gtk/gxk/gxkstatusbar.cc b/beast-gtk/gxk/gxkstatusbar.cc
index f9c1484..36a4154 100644
--- a/beast-gtk/gxk/gxkstatusbar.cc
+++ b/beast-gtk/gxk/gxkstatusbar.cc
@@ -275,9 +275,9 @@ gxk_status_set (gfloat percentage,
void
gxk_status_window_push (gpointer widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
widget = gtk_widget_get_toplevel ((GtkWidget*) widget);
- g_return_if_fail (GTK_IS_WINDOW (widget) == TRUE);
+ assert_return (GTK_IS_WINDOW (widget) == TRUE);
gtk_widget_ref ((GtkWidget*) widget);
status_window_stack = g_slist_prepend (status_window_stack, widget);
@@ -290,7 +290,7 @@ gxk_status_window_push (gpointer widget)
void
gxk_status_window_pop (void)
{
- g_return_if_fail (status_window_stack != NULL);
+ assert_return (status_window_stack != NULL);
gtk_widget_unref ((GtkWidget*) status_window_stack->data);
status_window_stack = g_slist_remove (status_window_stack, status_window_stack->data);
diff --git a/beast-gtk/gxk/gxkstock.cc b/beast-gtk/gxk/gxkstock.cc
index 3daa4c7..51f7623 100644
--- a/beast-gtk/gxk/gxkstock.cc
+++ b/beast-gtk/gxk/gxkstock.cc
@@ -106,7 +106,7 @@ gxk_stock_button (const gchar *stock_id,
{
GtkWidget *button, *alignment;
- g_return_val_if_fail (stock_id != NULL, NULL);
+ assert_return (stock_id != NULL, NULL);
button = (GtkWidget*) g_object_new (GTK_TYPE_BUTTON,
"visible", TRUE,
@@ -134,7 +134,7 @@ gxk_stock_button_child (const gchar *stock_id,
{
GtkWidget *alignment, *hbox, *image;
- g_return_val_if_fail (stock_id != NULL, NULL);
+ assert_return (stock_id != NULL, NULL);
alignment = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
hbox = gtk_hbox_new (FALSE, 2);
@@ -166,7 +166,7 @@ gxk_stock_register_icon (const GxkStockIcon *icon)
GdkPixbuf *pixbuf;
GtkIconSet *iset;
- g_return_if_fail (icon != NULL);
+ assert_return (icon != NULL);
pixbuf = gdk_pixbuf_new_from_inline (-1, icon->inlined_pixbuf, FALSE, NULL);
iset = gtk_icon_set_new_from_pixbuf (pixbuf);
@@ -189,7 +189,7 @@ gxk_stock_register_icons (guint n_icons,
{
guint i;
- g_return_if_fail (icons != NULL);
+ assert_return (icons != NULL);
for (i = 0; i < n_icons; i++)
gxk_stock_register_icon (icons + i);
@@ -211,9 +211,9 @@ gxk_stock_register_item (const GxkStockItem *item)
{
GtkStockItem tkitem = { NULL, };
- g_return_if_fail (item != NULL);
- g_return_if_fail (item->stock_id != NULL);
- g_return_if_fail (item->label != NULL || item->stock_fallback != NULL);
+ assert_return (item != NULL);
+ assert_return (item->stock_id != NULL);
+ assert_return (item->label != NULL || item->stock_fallback != NULL);
tkitem.stock_id = (gchar*) item->stock_id;
if (item->label)
@@ -247,7 +247,7 @@ gxk_stock_register_items (guint n_items,
{
guint i;
- g_return_if_fail (items != NULL);
+ assert_return (items != NULL);
for (i = 0; i < n_items; i++)
gxk_stock_register_item (items + i);
@@ -260,7 +260,7 @@ gxk_stock_item (const gchar *stock_id)
const gchar *item = NULL;
GtkStockItem tkitem;
- g_return_val_if_fail (stock_id != NULL, NULL);
+ assert_return (stock_id != NULL, NULL);
if (gtk_stock_lookup (stock_id, &tkitem))
item = tkitem.label;
@@ -285,7 +285,7 @@ gxk_stock_fallback_pixbuf (const gchar *stock_id)
static GData *stock_pixbuf_repo = NULL;
GdkPixbuf *pixbuf;
- g_return_val_if_fail (stock_id != NULL, NULL);
+ assert_return (stock_id != NULL, NULL);
pixbuf = (GdkPixbuf*) g_datalist_get_data (&stock_pixbuf_repo, stock_id);
if (!pixbuf)
@@ -314,7 +314,7 @@ gdk_pixbuf_create_bitmap_data (GdkPixbuf *pixbuf,
guint width, height, rowstride, x, y;
guint8 *data, *buffer;
- g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
+ assert_return (GDK_IS_PIXBUF (pixbuf), NULL);
width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf);
@@ -358,7 +358,7 @@ gxk_stock_icon_window (const gchar *stock_id)
guint8 *bitmap_data;
gint width = 0, height = 0;
- g_return_val_if_fail (stock_id != NULL, NULL);
+ assert_return (stock_id != NULL, NULL);
pixbuf = gxk_stock_fallback_pixbuf (stock_id);
if (!pixbuf)
diff --git a/beast-gtk/gxk/gxktexttools.cc b/beast-gtk/gxk/gxktexttools.cc
index 8270a3e..0e4e750 100644
--- a/beast-gtk/gxk/gxktexttools.cc
+++ b/beast-gtk/gxk/gxktexttools.cc
@@ -202,8 +202,8 @@ gxk_text_register_textget_handler (const gchar *element_name,
{
TextgetHandler *th;
- g_return_if_fail (element_name != NULL);
- g_return_if_fail (handler != NULL);
+ assert_return (element_name != NULL);
+ assert_return (handler != NULL);
th = g_new (TextgetHandler, 1);
th->element_name = g_strdup (element_name);
@@ -242,8 +242,8 @@ void
gxk_text_buffer_add_textgets_to_view (GtkTextBuffer *tbuffer,
GtkTextView *tview)
{
- g_return_if_fail (GTK_IS_TEXT_BUFFER (tbuffer));
- g_return_if_fail (GTK_IS_TEXT_VIEW (tview));
+ assert_return (GTK_IS_TEXT_BUFFER (tbuffer));
+ assert_return (GTK_IS_TEXT_VIEW (tview));
GSList *slist = (GSList*) g_object_steal_data ((GObject*) tbuffer, "textgets");
while (slist)
@@ -496,7 +496,7 @@ static void
tsm_pop_level (TsmData *md)
{
TsmLevel *ml = md->lstack;
- g_return_if_fail (ml != NULL);
+ assert_return (ml != NULL);
md->lstack = ml->next;
if (ml->mark)
gtk_text_buffer_delete_mark (md->tbuffer, ml->mark);
@@ -971,9 +971,9 @@ gxk_text_buffer_append_from_string (GtkTextBuffer *tbuffer,
guint text_length,
const gchar *text)
{
- g_return_if_fail (GTK_IS_TEXT_BUFFER (tbuffer));
+ assert_return (GTK_IS_TEXT_BUFFER (tbuffer));
if (text_length)
- g_return_if_fail (text != NULL);
+ assert_return (text != NULL);
gxk_text_buffer_cursor_to_end (tbuffer);
if (!text_length)
@@ -1006,8 +1006,8 @@ gxk_text_buffer_append_from_file (GtkTextBuffer *tbuffer,
{
gint fd;
- g_return_if_fail (GTK_IS_TEXT_BUFFER (tbuffer));
- g_return_if_fail (file_name != NULL);
+ assert_return (GTK_IS_TEXT_BUFFER (tbuffer));
+ assert_return (file_name != NULL);
gxk_text_buffer_cursor_to_end (tbuffer);
@@ -1027,7 +1027,7 @@ gxk_text_buffer_cursor_to_start (GtkTextBuffer *tbuffer)
{
GtkTextIter iter;
- g_return_if_fail (GTK_IS_TEXT_BUFFER (tbuffer));
+ assert_return (GTK_IS_TEXT_BUFFER (tbuffer));
gtk_text_buffer_get_start_iter (tbuffer, &iter);
gtk_text_buffer_place_cursor (tbuffer, &iter);
@@ -1038,7 +1038,7 @@ gxk_text_buffer_cursor_to_end (GtkTextBuffer *tbuffer)
{
GtkTextIter iter;
- g_return_if_fail (GTK_IS_TEXT_BUFFER (tbuffer));
+ assert_return (GTK_IS_TEXT_BUFFER (tbuffer));
gtk_text_buffer_get_end_iter (tbuffer, &iter);
gtk_text_buffer_place_cursor (tbuffer, &iter);
@@ -1123,7 +1123,7 @@ text_view_key_event (GtkTextView *tview,
void
gxk_text_view_enter_browse_mode (GtkTextView *tview)
{
- g_return_if_fail (GTK_IS_TEXT_VIEW (tview));
+ assert_return (GTK_IS_TEXT_VIEW (tview));
if (!g_signal_handler_find (tview, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, (void*)
text_view_key_event, tview))
{
@@ -1141,7 +1141,7 @@ gxk_text_view_enter_browse_mode (GtkTextView *tview)
void
gxk_text_view_leave_browse_mode (GtkTextView *tview)
{
- g_return_if_fail (GTK_IS_TEXT_VIEW (tview));
+ assert_return (GTK_IS_TEXT_VIEW (tview));
if (g_signal_handler_find (tview, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, (void*)
text_view_key_event, tview))
g_signal_handlers_disconnect_by_func (tview, (void*) text_view_key_event, tview);
@@ -1159,7 +1159,7 @@ gxk_text_view_cursor_to_start (GtkTextView *tview)
{
GtkTextBuffer *tbuffer;
- g_return_if_fail (GTK_IS_TEXT_VIEW (tview));
+ assert_return (GTK_IS_TEXT_VIEW (tview));
tbuffer = gtk_text_view_get_buffer (tview);
gxk_text_buffer_cursor_to_start (tbuffer);
@@ -1178,7 +1178,7 @@ gxk_text_view_cursor_to_end (GtkTextView *tview)
{
GtkTextBuffer *tbuffer;
- g_return_if_fail (GTK_IS_TEXT_VIEW (tview));
+ assert_return (GTK_IS_TEXT_VIEW (tview));
tbuffer = gtk_text_view_get_buffer (tview);
gxk_text_buffer_cursor_to_end (tbuffer);
@@ -1188,7 +1188,7 @@ gxk_text_view_cursor_to_end (GtkTextView *tview)
void
gxk_text_view_cursor_busy (GtkTextView *tview)
{
- g_return_if_fail (GTK_IS_TEXT_VIEW (tview));
+ assert_return (GTK_IS_TEXT_VIEW (tview));
if (GTK_WIDGET_DRAWABLE (tview))
{
@@ -1202,7 +1202,7 @@ gxk_text_view_cursor_busy (GtkTextView *tview)
void
gxk_text_view_cursor_normal (GtkTextView *tview)
{
- g_return_if_fail (GTK_IS_TEXT_VIEW (tview));
+ assert_return (GTK_IS_TEXT_VIEW (tview));
if (GTK_WIDGET_DRAWABLE (tview))
{
@@ -1409,7 +1409,7 @@ gxk_scroll_text_create_for (GxkScrollTextFlags flags,
GtkWidget *parent)
{
GtkWidget *sctext;
- g_return_val_if_fail (GTK_IS_CONTAINER (parent), NULL);
+ assert_return (GTK_IS_CONTAINER (parent), NULL);
sctext = gxk_scroll_text_create (flags, "");
gtk_container_add (GTK_CONTAINER (parent), sctext);
return sctext;
@@ -1438,7 +1438,7 @@ gxk_scroll_text_clear (GtkWidget *sctext)
GtkTextIter iter1, iter2;
GSList *node, *slist = NULL;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
tview = gxk_scroll_text_get_text_view (sctext);
tbuffer = gtk_text_view_get_buffer (tview);
@@ -1464,7 +1464,7 @@ void
gxk_scroll_text_set (GtkWidget *sctext,
const gchar *string)
{
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
gxk_scroll_text_clear (sctext);
gxk_scroll_text_append (sctext, string);
@@ -1481,7 +1481,7 @@ void
gxk_scroll_text_set_tsm (GtkWidget *sctext,
const gchar *string)
{
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
gxk_scroll_text_clear (sctext);
gxk_scroll_text_append_tsm (sctext, string);
@@ -1500,7 +1500,7 @@ gxk_scroll_text_append (GtkWidget *sctext,
GtkTextView *tview;
GtkTextBuffer *tbuffer;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
tview = gxk_scroll_text_get_text_view (sctext);
tbuffer = gtk_text_view_get_buffer (tview);
@@ -1526,7 +1526,7 @@ gxk_scroll_text_append_tsm (GtkWidget *sctext,
GtkTextView *tview;
GtkTextBuffer *tbuffer;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
tview = gxk_scroll_text_get_text_view (sctext);
tbuffer = gtk_text_view_get_buffer (tview);
@@ -1552,8 +1552,8 @@ gxk_scroll_text_append_file (GtkWidget *sctext,
GtkTextView *tview;
GtkTextBuffer *tbuffer;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
- g_return_if_fail (file_name != NULL);
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (file_name != NULL);
tview = gxk_scroll_text_get_text_view (sctext);
tbuffer = gtk_text_view_get_buffer (tview);
@@ -1578,8 +1578,8 @@ gxk_scroll_text_append_file_tsm (GtkWidget *sctext,
GtkTextView *tview;
GtkTextBuffer *tbuffer;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
- g_return_if_fail (file_name != NULL);
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (file_name != NULL);
tview = gxk_scroll_text_get_text_view (sctext);
tbuffer = gtk_text_view_get_buffer (tview);
@@ -1602,7 +1602,7 @@ gxk_scroll_text_get_text_view (GtkWidget *sctext)
GtkTextView *tview;
GtkWidget *scwin;
- g_return_val_if_fail (GXK_IS_SCROLL_TEXT (sctext), NULL);
+ assert_return (GXK_IS_SCROLL_TEXT (sctext), NULL);
scwin = ((GtkBoxChild*) GTK_BOX (sctext)->children->next->data)->widget;
@@ -1623,7 +1623,7 @@ gxk_scroll_text_push_indent (GtkWidget *sctext)
GtkTextView *tview;
guint indent;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
tview = gxk_scroll_text_get_text_view (sctext);
indent = g_object_get_int (tview, "indent");
@@ -1642,7 +1642,7 @@ gxk_scroll_text_pop_indent (GtkWidget *sctext)
GtkTextView *tview;
guint indent;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
tview = gxk_scroll_text_get_text_view (sctext);
indent = g_object_get_int (tview, "indent");
@@ -2020,8 +2020,8 @@ gxk_scroll_text_display (GtkWidget *sctext,
{
TextNavigation *tnav;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
- g_return_if_fail (uri != NULL);
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (uri != NULL);
tnav = navigation_from_sctext (sctext);
navigation_set_url (tnav, uri, -1);
@@ -2044,8 +2044,8 @@ gxk_scroll_text_advance (GtkWidget *sctext,
TextNavigation *tnav;
HEntry *last;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
- g_return_if_fail (uri != NULL);
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (uri != NULL);
tnav = navigation_from_sctext (sctext);
/* handle history */
@@ -2096,8 +2096,8 @@ gxk_scroll_text_enter (GtkWidget *sctext,
{
TextNavigation *tnav;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
- g_return_if_fail (uri != NULL);
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (uri != NULL);
tnav = navigation_from_sctext (sctext);
navigation_reset_url (tnav);
@@ -2117,7 +2117,7 @@ gxk_scroll_text_set_index (GtkWidget *sctext,
{
TextNavigation *tnav;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
if (!uri || !uri[0])
uri = "about:";
@@ -2136,7 +2136,7 @@ gxk_scroll_text_rewind (GtkWidget *sctext)
{
TextNavigation *tnav;
- g_return_if_fail (GXK_IS_SCROLL_TEXT (sctext));
+ assert_return (GXK_IS_SCROLL_TEXT (sctext));
tnav = navigation_from_sctext (sctext);
while (tnav->back_stack)
diff --git a/beast-gtk/gxk/gxkutils.cc b/beast-gtk/gxk/gxkutils.cc
index b414073..d92c127 100644
--- a/beast-gtk/gxk/gxkutils.cc
+++ b/beast-gtk/gxk/gxkutils.cc
@@ -182,7 +182,7 @@ g_object_set_double (gpointer object,
{
gdouble zero = 0;
- g_return_if_fail (G_IS_OBJECT (object));
+ assert_return (G_IS_OBJECT (object));
if (memcmp (&v_double, &zero, sizeof (zero)) == 0)
g_object_set_data ((GObject*) object, name, NULL);
@@ -206,7 +206,7 @@ gdouble
g_object_get_double (gpointer object,
const gchar *name)
{
- g_return_val_if_fail (G_IS_OBJECT (object), 0);
+ assert_return (G_IS_OBJECT (object), 0);
double *dp = (double*) g_object_get_data ((GObject*) object, name);
return dp ? *dp : 0;
@@ -225,7 +225,7 @@ g_object_set_long (gpointer object,
const gchar *name,
glong v_long)
{
- g_return_if_fail (G_IS_OBJECT (object));
+ assert_return (G_IS_OBJECT (object));
g_object_set_data ((GObject*) object, name, (gpointer) v_long);
}
@@ -242,7 +242,7 @@ glong
g_object_get_long (gpointer object,
const gchar *name)
{
- g_return_val_if_fail (G_IS_OBJECT (object), 0);
+ assert_return (G_IS_OBJECT (object), 0);
return (glong) g_object_get_data ((GObject*) object, name);
}
@@ -328,7 +328,7 @@ gxk_factory_path_unescape_uline (const gchar *path)
gboolean
gxk_widget_viewable (GtkWidget *widget)
{
- g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+ assert_return (GTK_IS_WIDGET (widget), FALSE);
while (widget)
{
@@ -355,7 +355,7 @@ gxk_widget_viewable (GtkWidget *widget)
void
gxk_widget_viewable_changed (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
g_signal_emit (widget, signal_viewable_changed, 0);
}
@@ -384,7 +384,7 @@ gxk_traverse_viewable_changed (GtkWidget *widget,
void
gxk_widget_attached_hierarchy_changed (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
g_signal_emit (widget, signal_attached_hierarchy_changed, 0);
}
@@ -441,7 +441,7 @@ void
gxk_window_set_cursor_type (GdkWindow *window,
GdkCursorType cursor)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ assert_return (GDK_IS_WINDOW (window));
if (cursor >= GDK_LAST_CURSOR || cursor < 0)
gdk_window_set_cursor (window, NULL);
@@ -489,7 +489,7 @@ void
gxk_window_process_next (GdkWindow *window,
gboolean update_children)
{
- g_return_if_fail (GDK_IS_WINDOW (window));
+ assert_return (GDK_IS_WINDOW (window));
if (update_children)
cexpose_windows = g_slist_append_uniq (cexpose_windows, window);
@@ -616,7 +616,7 @@ GxkColorDots*
gxk_color_dots_new (guint n_dots,
const GxkColorDot *dots)
{
- g_return_val_if_fail (n_dots >= 2, NULL);
+ assert_return (n_dots >= 2, NULL);
GxkColorDots *cdots = g_new0 (GxkColorDots, 1);
guint sizeof_color_dot = sizeof (GxkColorDot);
cdots->n_colors = n_dots;
@@ -630,7 +630,7 @@ gxk_color_dots_interpolate (GxkColorDots *cdots,
double value,
double saturation)
{
- g_return_val_if_fail (cdots != NULL, 0);
+ assert_return (cdots != NULL, 0);
/* find segment via bisection */
guint offset = 0, n = cdots->n_colors;
while (offset + 1 < n)
@@ -668,7 +668,7 @@ gxk_color_dots_interpolate (GxkColorDots *cdots,
void
gxk_color_dots_destroy (GxkColorDots *cdots)
{
- g_return_if_fail (cdots != NULL);
+ assert_return (cdots != NULL);
g_free (cdots->colors);
g_free (cdots);
}
@@ -684,7 +684,7 @@ gxk_color_dots_destroy (GxkColorDots *cdots)
void
gxk_widget_make_insensitive (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (GTK_WIDGET_IS_SENSITIVE (widget))
gtk_widget_set_sensitive (widget, FALSE);
@@ -699,7 +699,7 @@ gxk_widget_make_insensitive (GtkWidget *widget)
void
gxk_widget_make_sensitive (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (!GTK_WIDGET_IS_SENSITIVE (widget))
gtk_widget_set_sensitive (widget, TRUE);
@@ -738,7 +738,7 @@ gxk_idle_showraise (GtkWidget *widget)
{
GtkWidget **widget_p;
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
widget_p = g_new (GtkWidget*, 1);
@@ -781,7 +781,7 @@ gxk_idle_show_widget (GtkWidget *widget)
{
GtkWidget **widget_p;
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
widget_p = g_new (GtkWidget*, 1);
@@ -827,7 +827,7 @@ gxk_idle_unrealize_widget (GtkWidget *widget)
{
GtkWidget **widget_p;
- g_return_if_fail (GTK_IS_WINDOW (widget));
+ assert_return (GTK_IS_WINDOW (widget));
widget_p = g_new (GtkWidget*, 1);
@@ -1006,7 +1006,7 @@ GtkWidget*
gtk_box_get_nth_child (GtkBox *box,
gint pos)
{
- g_return_val_if_fail (GTK_IS_BOX (box), NULL);
+ assert_return (GTK_IS_BOX (box), NULL);
GList *child = box->children;
@@ -1027,7 +1027,7 @@ gtk_box_get_nth_child (GtkBox *box,
void
gxk_widget_showraise (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
gtk_widget_show (widget);
if (GTK_WIDGET_REALIZED (widget) && !widget->parent)
@@ -1065,7 +1065,7 @@ async_delete_event_handler (gpointer data)
void
gxk_toplevel_delete (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
widget = gtk_widget_get_toplevel (widget);
if (GTK_IS_WINDOW (widget) && GTK_WIDGET_DRAWABLE (widget))
@@ -1080,7 +1080,7 @@ gxk_toplevel_delete (GtkWidget *widget)
void
gxk_toplevel_activate_default (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
widget = gtk_widget_get_toplevel (widget);
if (GTK_IS_WINDOW (widget))
@@ -1095,7 +1095,7 @@ gxk_toplevel_activate_default (GtkWidget *widget)
void
gxk_toplevel_hide (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
widget = gtk_widget_get_toplevel (widget);
gtk_widget_hide (widget);
@@ -1212,7 +1212,7 @@ widget_modify_style (GtkWidget *widget)
void
gxk_widget_modify_as_title (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (!gxk_signal_handler_exists (widget, "realize", G_CALLBACK (widget_modify_style), NULL))
{
@@ -1237,7 +1237,7 @@ gxk_widget_modify_as_title (GtkWidget *widget)
void
gxk_widget_modify_bg_as_base (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (!gxk_signal_handler_exists (widget, "realize", G_CALLBACK (widget_modify_style), NULL))
{
@@ -1257,7 +1257,7 @@ gxk_widget_modify_bg_as_base (GtkWidget *widget)
void
gxk_widget_modify_normal_bg_as_base (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (!gxk_signal_handler_exists (widget, "realize", G_CALLBACK (widget_modify_style), NULL))
{
@@ -1280,7 +1280,7 @@ gxk_widget_modify_normal_bg_as_base (GtkWidget *widget)
void
gxk_widget_modify_base_as_bg (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (!gxk_signal_handler_exists (widget, "realize", G_CALLBACK (widget_modify_style), NULL))
{
@@ -1300,7 +1300,7 @@ gxk_widget_modify_base_as_bg (GtkWidget *widget)
void
gxk_widget_modify_bg_as_active (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (!gxk_signal_handler_exists (widget, "realize", G_CALLBACK (widget_modify_style), NULL))
{
@@ -1333,7 +1333,7 @@ expose_bg_clear (GtkWidget *widget,
void
gxk_widget_force_bg_clear (GtkWidget *widget)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
gtk_widget_set_redraw_on_allocate (widget, TRUE);
if (!gxk_signal_handler_exists (widget, "expose_event", G_CALLBACK (expose_bg_clear), NULL))
@@ -1352,7 +1352,7 @@ void
gxk_widget_set_tooltip (gpointer widget,
const gchar *tooltip)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
gxk_widget_set_latent_tooltip ((GtkWidget*) widget, tooltip);
gtk_tooltips_set_tip (GXK_TOOLTIPS, (GtkWidget*) widget, tooltip, NULL);
}
@@ -1426,11 +1426,11 @@ void
gxk_widget_activate_accel_group (GtkWidget *widget,
GtkAccelGroup *accel_group)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (accel_group)
{
- g_return_if_fail (GTK_IS_ACCEL_GROUP (accel_group));
+ assert_return (GTK_IS_ACCEL_GROUP (accel_group));
gtk_accel_group_lock (accel_group);
g_signal_connect_data (widget, "key_press_event",
@@ -1557,10 +1557,10 @@ gxk_tree_view_add_column (GtkTreeView *tree_view,
guint n_cols;
va_list var_args;
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), 0);
- g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (column), 0);
- g_return_val_if_fail (column->tree_view == NULL, 0);
- g_return_val_if_fail (GTK_IS_CELL_RENDERER (cell), 0);
+ assert_return (GTK_IS_TREE_VIEW (tree_view), 0);
+ assert_return (GTK_IS_TREE_VIEW_COLUMN (column), 0);
+ assert_return (column->tree_view == NULL, 0);
+ assert_return (GTK_IS_CELL_RENDERER (cell), 0);
g_object_ref (column);
g_object_ref (cell);
@@ -1624,7 +1624,7 @@ gxk_tree_view_append_text_columns (GtkTreeView *tree_view,
{
va_list var_args;
- g_return_if_fail (GTK_IS_TREE_VIEW (tree_view));
+ assert_return (GTK_IS_TREE_VIEW (tree_view));
va_start (var_args, n_cols);
while (n_cols--)
@@ -1799,7 +1799,7 @@ gxk_tree_view_add_text_column (GtkTreeView *tree_view,
gpointer data,
GConnectFlags cflags)
{
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
+ assert_return (GTK_IS_TREE_VIEW (tree_view), NULL);
return tree_view_add_column (tree_view, model_column, xalign, title, tooltip,
edited_callback, NULL, data, cflags,
@@ -1836,7 +1836,7 @@ gxk_tree_view_add_popup_column (GtkTreeView *tree_view,
gpointer data,
GConnectFlags cflags)
{
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
+ assert_return (GTK_IS_TREE_VIEW (tree_view), NULL);
return tree_view_add_column (tree_view, model_column, xalign, title, tooltip,
edited_callback, popup_callback, data, cflags,
@@ -1874,7 +1874,7 @@ gxk_tree_view_add_toggle_column (GtkTreeView *tree_view,
gpointer data,
GConnectFlags cflags)
{
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree_view), NULL);
+ assert_return (GTK_IS_TREE_VIEW (tree_view), NULL);
return tree_view_add_column (tree_view, model_column, xalign, title, tooltip,
toggled_callback, NULL, data, cflags,
@@ -1942,7 +1942,7 @@ gxk_tree_view_column_set_tip_title (GtkTreeViewColumn *tree_column,
{
GtkWidget *label;
- g_return_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column));
+ assert_return (GTK_IS_TREE_VIEW_COLUMN (tree_column));
gtk_tree_view_column_set_title (tree_column, title);
label = (GtkWidget*) g_object_new (GTK_TYPE_LABEL,
@@ -1968,8 +1968,8 @@ gxk_tree_selection_select_spath (GtkTreeSelection *selection,
{
GtkTreePath *path;
- g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
- g_return_if_fail (str_path != NULL);
+ assert_return (GTK_IS_TREE_SELECTION (selection));
+ assert_return (str_path != NULL);
path = gtk_tree_path_new_from_string (str_path);
gtk_tree_selection_select_path (selection, path);
@@ -1988,8 +1988,8 @@ gxk_tree_selection_unselect_spath (GtkTreeSelection *selection,
{
GtkTreePath *path;
- g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
- g_return_if_fail (str_path != NULL);
+ assert_return (GTK_IS_TREE_SELECTION (selection));
+ assert_return (str_path != NULL);
path = gtk_tree_path_new_from_string (str_path);
gtk_tree_selection_unselect_path (selection, path);
@@ -2012,7 +2012,7 @@ gxk_tree_selection_select_ipath (GtkTreeSelection *selection,
va_list args;
gint i;
- g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
+ assert_return (GTK_IS_TREE_SELECTION (selection));
path = gtk_tree_path_new ();
i = first_index;
@@ -2043,7 +2043,7 @@ gxk_tree_selection_unselect_ipath (GtkTreeSelection *selection,
va_list args;
gint i;
- g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
+ assert_return (GTK_IS_TREE_SELECTION (selection));
path = gtk_tree_path_new ();
i = first_index;
@@ -2064,7 +2064,7 @@ gxk_tree_view_select_index (GtkTreeView *tview,
{
GtkTreeSelection *tsel;
GtkTreePath *path;
- g_return_if_fail (GTK_IS_TREE_VIEW (tview));
+ assert_return (GTK_IS_TREE_VIEW (tview));
tsel = gtk_tree_view_get_selection (tview);
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, index);
@@ -2198,9 +2198,9 @@ void
gxk_tree_selection_force_browse (GtkTreeSelection *selection,
GtkTreeModel *model)
{
- g_return_if_fail (GTK_IS_TREE_SELECTION (selection));
+ assert_return (GTK_IS_TREE_SELECTION (selection));
if (model)
- g_return_if_fail (GTK_IS_TREE_MODEL (model));
+ assert_return (GTK_IS_TREE_MODEL (model));
if (!gxk_signal_handler_exists (selection, "changed", G_CALLBACK (browse_selection_changed), selection))
g_signal_connect_data (selection, "changed", G_CALLBACK (browse_selection_changed), selection, NULL,
GConnectFlags (0));
if (model && !gxk_signal_handler_exists (model, "row-inserted", G_CALLBACK (browse_selection_changed),
selection))
@@ -2224,7 +2224,7 @@ gxk_tree_view_get_bin_window_pos (GtkTreeView *tree,
GdkWindow *window;
gint ax = 0, ay = 0;
- g_return_if_fail (GTK_IS_TREE_VIEW (tree));
+ assert_return (GTK_IS_TREE_VIEW (tree));
window = gtk_tree_view_get_bin_window (tree);
if (window)
@@ -2265,7 +2265,7 @@ gxk_tree_view_get_row_area (GtkTreeView *tree,
{
GdkRectangle rect = { 0, 0, 0, 0 };
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree), FALSE);
+ assert_return (GTK_IS_TREE_VIEW (tree), FALSE);
if (row >= 0)
{
@@ -2305,7 +2305,7 @@ gxk_tree_view_focus_row (GtkTreeView *tree,
{
GtkTreePath *path;
- g_return_if_fail (GTK_IS_TREE_VIEW (tree));
+ assert_return (GTK_IS_TREE_VIEW (tree));
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, row);
@@ -2324,7 +2324,7 @@ gboolean
gxk_tree_view_is_row_selected (GtkTreeView *tree,
gint row)
{
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree), FALSE);
+ assert_return (GTK_IS_TREE_VIEW (tree), FALSE);
if (row >= 0)
{
@@ -2353,7 +2353,7 @@ gxk_tree_view_get_selected_row (GtkTreeView *tree)
GtkTreeIter iter;
gint row = -1;
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree), -1);
+ assert_return (GTK_IS_TREE_VIEW (tree), -1);
if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection (tree),
&model, &iter))
@@ -2384,7 +2384,7 @@ gxk_tree_view_get_row_from_coord (GtkTreeView *tree,
GtkTreePath *path = NULL;
gint row = -1, outside = FALSE;
- g_return_val_if_fail (GTK_IS_TREE_VIEW (tree), FALSE);
+ assert_return (GTK_IS_TREE_VIEW (tree), FALSE);
if (!gtk_tree_view_get_path_at_pos (tree, GTK_WIDGET (tree)->allocation.width / 2,
y, &path, NULL, NULL, NULL))
@@ -2454,9 +2454,9 @@ gxk_signal_handler_exists (gpointer instance,
guint signal_id;
GQuark detail = 0;
- g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (instance), FALSE);
- g_return_val_if_fail (detailed_signal != NULL, FALSE);
- g_return_val_if_fail (callback != NULL, FALSE);
+ assert_return (G_TYPE_CHECK_INSTANCE (instance), FALSE);
+ assert_return (detailed_signal != NULL, FALSE);
+ assert_return (callback != NULL, FALSE);
if (detailed_signal && g_signal_parse_name (detailed_signal, G_TYPE_FROM_INSTANCE (instance),
&signal_id, &detail, FALSE))
@@ -2499,9 +2499,9 @@ gxk_signal_handler_pending (gpointer instance,
guint signal_id;
GQuark detail = 0;
- g_return_val_if_fail (G_TYPE_CHECK_INSTANCE (instance), FALSE);
- g_return_val_if_fail (detailed_signal != NULL, FALSE);
- g_return_val_if_fail (callback != NULL, FALSE);
+ assert_return (G_TYPE_CHECK_INSTANCE (instance), FALSE);
+ assert_return (detailed_signal != NULL, FALSE);
+ assert_return (callback != NULL, FALSE);
if (detailed_signal && g_signal_parse_name (detailed_signal, G_TYPE_FROM_INSTANCE (instance),
&signal_id, &detail, FALSE))
@@ -2533,7 +2533,7 @@ gxk_signal_handler_pending (gpointer instance,
gboolean
gxk_cell_editable_canceled (GtkCellEditable *ecell)
{
- g_return_val_if_fail (GTK_IS_CELL_EDITABLE (ecell), FALSE);
+ assert_return (GTK_IS_CELL_EDITABLE (ecell), FALSE);
if (GTK_IS_ENTRY (ecell))
return GTK_ENTRY (ecell)->editing_canceled;
@@ -2551,7 +2551,7 @@ gxk_cell_editable_canceled (GtkCellEditable *ecell)
void
gxk_cell_editable_is_focus_handler (GtkCellEditable *ecell)
{
- g_return_if_fail (GTK_IS_CELL_EDITABLE (ecell));
+ assert_return (GTK_IS_CELL_EDITABLE (ecell));
if (!gtk_widget_is_focus (GTK_WIDGET (ecell)))
{
@@ -2715,7 +2715,7 @@ gxk_widget_proxy_requisition (GtkWidget *widget,
gdouble xscale,
gdouble yscale)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
g_signal_handlers_disconnect_by_func (widget, (void*) requisition_to_aux_info, NULL);
double xyscale[2] = { xscale, yscale };
@@ -2874,8 +2874,8 @@ gxk_widget_has_ancestor (gpointer widget,
gpointer ancestor)
{
GtkWidget *w = (GtkWidget*) widget, *a = (GtkWidget*) ancestor;
- g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
- g_return_val_if_fail (GTK_IS_WIDGET (ancestor), FALSE);
+ assert_return (GTK_IS_WIDGET (widget), FALSE);
+ assert_return (GTK_IS_WIDGET (ancestor), FALSE);
while (w)
{
@@ -2900,8 +2900,8 @@ void
gxk_menu_set_active (GtkMenu *menu,
GtkWidget *child)
{
- g_return_if_fail (GTK_IS_MENU (menu));
- g_return_if_fail (GTK_IS_WIDGET (child));
+ assert_return (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_WIDGET (child));
gint nth = g_list_index (GTK_MENU_SHELL (menu)->children, child);
if (nth >= 0 && child != menu->old_active_menu_item)
@@ -2938,7 +2938,7 @@ gxk_widget_regulate (GtkWidget *widget,
gboolean sensitive,
gboolean active)
{
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_WIDGET (widget));
if (((GObject*) widget)->ref_count > 0)
{
GParamSpec *pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (widget), "active");
@@ -3063,7 +3063,7 @@ adjust_visibility (GtkWidget *expander,
GtkWidget *widget)
{
gboolean expanded;
- g_return_if_fail (G_IS_PARAM_SPEC_BOOLEAN (pspec));
+ assert_return (G_IS_PARAM_SPEC_BOOLEAN (pspec));
g_object_get (expander, "expanded", &expanded, NULL);
if (expanded)
gtk_widget_show (widget);
@@ -3111,7 +3111,7 @@ gxk_label_set_attributes (GtkLabel *label,
/* this function is based on gimp_label_set_attributes(), which is
* Copyright (C) 2000 Michael Natterer <mitch gimp org>
*/
- g_return_if_fail (GTK_IS_LABEL (label));
+ assert_return (GTK_IS_LABEL (label));
va_list args;
va_start (args, label);
@@ -3363,8 +3363,8 @@ void
gxk_menu_attach_as_submenu (GtkMenu *menu,
GtkMenuItem *menu_item)
{
- g_return_if_fail (GTK_IS_MENU (menu));
- g_return_if_fail (GTK_IS_MENU_ITEM (menu_item));
+ assert_return (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_MENU_ITEM (menu_item));
gtk_menu_item_set_submenu (menu_item, GTK_WIDGET (menu));
@@ -3395,8 +3395,8 @@ void
gxk_option_menu_set_menu (GtkOptionMenu *option_menu,
GtkMenu *menu)
{
- g_return_if_fail (GTK_IS_OPTION_MENU (option_menu));
- g_return_if_fail (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_OPTION_MENU (option_menu));
+ assert_return (GTK_IS_MENU (menu));
gtk_option_menu_set_menu (option_menu, GTK_WIDGET (menu));
@@ -3443,8 +3443,8 @@ gxk_menu_attach_as_popup_with_func (GtkMenu *menu,
GtkWidget *widget,
GtkMenuDetachFunc mdfunc)
{
- g_return_if_fail (GTK_IS_MENU (menu));
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ assert_return (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_WIDGET (widget));
GList *menu_list = (GList*) g_object_steal_data ((GObject*) widget, "GxkWidget-popup-menus");
menu_list = g_list_prepend (menu_list, menu);
@@ -3572,7 +3572,7 @@ gxk_menu_popup (GtkMenu *menu,
guint mouse_button,
guint32 time)
{
- g_return_if_fail (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_MENU (menu));
PopupData *pdata = g_new0 (PopupData, 1);
pdata->x = x;
pdata->y = y;
@@ -3588,7 +3588,7 @@ gxk_menu_popup_pushable (GtkMenu *menu,
guint mouse_button,
guint32 time)
{
- g_return_if_fail (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_MENU (menu));
PopupData *pdata = g_new0 (PopupData, 1);
pdata->x = x;
pdata->y = y;
@@ -3605,7 +3605,7 @@ gxk_menu_popup_pushed_in (GtkMenu *menu,
guint mouse_button,
guint32 time)
{
- g_return_if_fail (GTK_IS_MENU (menu));
+ assert_return (GTK_IS_MENU (menu));
PopupData *pdata = g_new0 (PopupData, 1);
pdata->pushed_x = pushed_x;
pdata->pushed_y = pushed_y;
@@ -3670,8 +3670,8 @@ GtkWidget*
gxk_widget_find_level_ordered (GtkWidget *toplevel,
const gchar *name)
{
- g_return_val_if_fail (GTK_IS_WIDGET (toplevel), NULL);
- g_return_val_if_fail (name != NULL, NULL);
+ assert_return (GTK_IS_WIDGET (toplevel), NULL);
+ assert_return (name != NULL, NULL);
return widget_find_level_ordered (toplevel, name);
}
@@ -3753,7 +3753,7 @@ gxk_widget_add_font_requisition (GtkWidget *widget,
const gchar*
gxk_widget_get_options (gpointer widget)
{
- g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
+ assert_return (GTK_IS_WIDGET (widget), NULL);
return (const char*) g_object_get_data ((GObject*) widget, "GxkWidget-options");
}
@@ -3775,9 +3775,9 @@ gxk_widget_add_option (gpointer widget,
{
const gchar *options;
guint append = 0;
- g_return_if_fail (GTK_IS_WIDGET (widget));
- g_return_if_fail (option != NULL && !strchr (option, ':'));
- g_return_if_fail (value == NULL || !strcmp (value, "-") || !strcmp (value, "+"));
+ assert_return (GTK_IS_WIDGET (widget));
+ assert_return (option != NULL && !strchr (option, ':'));
+ assert_return (value == NULL || !strcmp (value, "-") || !strcmp (value, "+"));
options = (const char*) g_object_get_data ((GObject*) widget, "GxkWidget-options");
if (!options)
options = "";
@@ -3811,7 +3811,7 @@ gxk_widget_check_option (gpointer widget,
const gchar *option)
{
const gchar *options;
- g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
+ assert_return (GTK_IS_WIDGET (widget), FALSE);
options = (const char*) g_object_get_data ((GObject*) widget, "GxkWidget-options");
return g_option_check (options, option);
}
@@ -3823,7 +3823,7 @@ gxk_file_selection_split (GtkFileSelection *fs,
GtkWidget *main_vbox;
GtkWidget *hbox;
- g_return_val_if_fail (GTK_IS_FILE_SELECTION (fs), NULL);
+ assert_return (GTK_IS_FILE_SELECTION (fs), NULL);
/* nuke GUI junk */
gtk_file_selection_hide_fileop_buttons (fs);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]