From 3235d479f4f26476958b6686f410ab18d6c3f260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Corentin=20No=C3=ABl?= Date: Fri, 7 Jun 2019 15:54:22 +0200 Subject: GladeSignalClass: rename glade_signal_class_get_type --- gladeui/glade-signal-class.c | 85 +++++++++++++++++++++++++++++++++++++++++++- gladeui/glade-signal-class.h | 2 +- gladeui/glade-signal-model.c | 12 +++---- plugins/gtk+/glade-accels.c | 12 +++---- 4 files changed, 97 insertions(+), 14 deletions(-) diff --git a/gladeui/glade-signal-class.c b/gladeui/glade-signal-class.c index 96cb1660..99a811f9 100644 --- a/gladeui/glade-signal-class.c +++ b/gladeui/glade-signal-class.c @@ -42,6 +42,16 @@ struct _GladeSignalClass guint deprecated : 1; /* True if this signal is deprecated */ }; +/** + * glade_signal_class_new: + * @adaptor: a #GladeWidgetAdaptor + * @for_type: a #GType + * @signal_id: the signal id + * + * Creates a new #GladeSignalClass + * + * Returns: (transfer full): a new #GladeSignalClass + */ GladeSignalClass * glade_signal_class_new (GladeWidgetAdaptor *adaptor, GType for_type, @@ -76,6 +86,13 @@ glade_signal_class_new (GladeWidgetAdaptor *adaptor, return class; } + +/** + * glade_signal_class_free: + * @signal_class: a #GladeSignalClass + * + * Frees a #GladeSignalClass + */ void glade_signal_class_free (GladeSignalClass *signal_class) { @@ -104,6 +121,8 @@ glade_signal_class_update_from_node (GladeSignalClass *signal_class, * glade_signal_class_get_adaptor: * @signal_class: a #GladeSignalClass * + * Get #GladeWidgetAdaptor associated with the signal. + * * Returns: (transfer none): a #GladeWidgetAdaptor */ GladeWidgetAdaptor * @@ -114,6 +133,14 @@ glade_signal_class_get_adaptor (const GladeSignalClass *signal_class) return signal_class->adaptor; } +/** + * glade_signal_class_get_name: + * @signal_class: a #GladeSignalClass + * + * Get the name of the signal. + * + * Returns: the name of the signal + */ G_CONST_RETURN gchar * glade_signal_class_get_name (const GladeSignalClass *signal_class) { @@ -122,14 +149,31 @@ glade_signal_class_get_name (const GladeSignalClass *signal_class) return signal_class->name; } +/** + * glade_signal_class_get_object_type_name: + * @signal_class: a #GladeSignalClass + * + * Get the name of the object class that this signal belongs to. + * + * Returns: the type name of the signal + */ G_CONST_RETURN gchar * -glade_signal_class_get_type (const GladeSignalClass *signal_class) +glade_signal_class_get_object_type_name (const GladeSignalClass *signal_class) { g_return_val_if_fail (signal_class != NULL, NULL); return signal_class->type; } +/** + * glade_signal_class_get_flags: + * @signal_class: a #GladeSignalClass + * + * Get the combination of GSignalFlags specifying detail of when the default + * handler is to be invoked. + * + * Returns: the #GSignalFlags + */ GSignalFlags glade_signal_class_get_flags (const GladeSignalClass *signal_class) { @@ -138,6 +182,14 @@ glade_signal_class_get_flags (const GladeSignalClass *signal_class) return signal_class->query.signal_flags; } +/** + * glade_signal_class_set_since: + * @signal_class: a #GladeSignalClass + * @since_major: the major version. + * @since_minor: the minor version. + * + * Set the major and minor version that introduced this signal. + */ void glade_signal_class_set_since (GladeSignalClass *signal_class, guint16 since_major, @@ -149,6 +201,14 @@ glade_signal_class_set_since (GladeSignalClass *signal_class, signal_class->version_since_minor = since_minor; } +/** + * glade_signal_class_since_major: + * @signal_class: a #GladeSignalClass + * + * Get the major version that introduced this signal. + * + * Returns: the major version + */ guint16 glade_signal_class_since_major (GladeSignalClass *signal_class) { @@ -157,6 +217,14 @@ glade_signal_class_since_major (GladeSignalClass *signal_class) return signal_class->version_since_major; } +/** + * glade_signal_class_since_minor: + * @signal_class: a #GladeSignalClass + * + * Get the minor version that introduced this signal. + * + * Returns: the minor version + */ guint16 glade_signal_class_since_minor (GladeSignalClass *signal_class) { @@ -165,6 +233,13 @@ glade_signal_class_since_minor (GladeSignalClass *signal_class) return signal_class->version_since_minor; } +/** + * glade_signal_class_deprecated: + * @signal_class: a #GladeSignalClass + * @deprecated: %TRUE if the signal is deprecated + * + * Set if the signal is deprecated. + */ void glade_signal_class_set_deprecated (GladeSignalClass *signal_class, gboolean deprecated) @@ -174,6 +249,14 @@ glade_signal_class_set_deprecated (GladeSignalClass *signal_class, signal_class->deprecated = deprecated; } +/** + * glade_signal_class_deprecated: + * @signal_class: a #GladeSignalClass + * + * Get if the signal is flagged as deprecated. + * + * Returns: %TRUE if the class is deprecated + */ gboolean glade_signal_class_deprecated (GladeSignalClass *signal_class) { diff --git a/gladeui/glade-signal-class.h b/gladeui/glade-signal-class.h index 0330f530..4b909d8b 100644 --- a/gladeui/glade-signal-class.h +++ b/gladeui/glade-signal-class.h @@ -57,7 +57,7 @@ void glade_signal_class_update_from_node (GladeSignalCl GladeWidgetAdaptor *glade_signal_class_get_adaptor (const GladeSignalClass *signal_class); G_CONST_RETURN gchar *glade_signal_class_get_name (const GladeSignalClass *signal_class); -G_CONST_RETURN gchar *glade_signal_class_get_type (const GladeSignalClass *signal_class); +G_CONST_RETURN gchar *glade_signal_class_get_object_type_name (const GladeSignalClass *signal_class); GSignalFlags glade_signal_class_get_flags (const GladeSignalClass *signal_class); void glade_signal_class_set_since (GladeSignalClass *signal_class, diff --git a/gladeui/glade-signal-model.c b/gladeui/glade-signal-model.c index 977810e5..6e9e2189 100644 --- a/gladeui/glade-signal-model.c +++ b/gladeui/glade-signal-model.c @@ -86,10 +86,10 @@ glade_signal_model_create_widget_list (GladeSignalModel *sig_model) GladeSignalClass *signal = (GladeSignalClass *) list->data; if (!g_list_find_custom (sig_model->priv->widgets, - (gpointer) glade_signal_class_get_type (signal), (GCompareFunc) strcmp)) + (gpointer) glade_signal_class_get_object_type_name (signal), (GCompareFunc) strcmp)) { sig_model->priv->widgets = - g_list_prepend (sig_model->priv->widgets, (gpointer) glade_signal_class_get_type (signal)); + g_list_prepend (sig_model->priv->widgets, (gpointer) glade_signal_class_get_object_type_name (signal)); } } sig_model->priv->widgets = g_list_reverse (sig_model->priv->widgets); @@ -324,7 +324,7 @@ glade_signal_model_create_signal_list (GladeSignalModel *sig_model, signals = g_list_next (signals)) { GladeSignalClass *sig_class = signals->data; - if (g_str_equal (glade_signal_class_get_type (sig_class), widget_type)) + if (g_str_equal (glade_signal_class_get_object_type_name (sig_class), widget_type)) { widget_signals = g_list_append (widget_signals, sig_class); } @@ -342,7 +342,7 @@ on_glade_signal_model_added (GladeWidget *widget, const GladeSignalClass *sig_class = glade_signal_get_class (signal); glade_signal_model_create_signal_iter (model, - glade_signal_class_get_type (sig_class), + glade_signal_class_get_object_type_name (sig_class), signal, &iter); path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter); @@ -362,7 +362,7 @@ on_glade_signal_model_removed (GladeWidget *widget, const GladeSignalClass *sig_class = glade_signal_get_class (signal); glade_signal_model_create_signal_iter (model, - glade_signal_class_get_type (sig_class), + glade_signal_class_get_object_type_name (sig_class), signal, &iter); path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter); @@ -381,7 +381,7 @@ on_glade_signal_model_changed (GladeWidget *widget, const GladeSignalClass *sig_class = glade_signal_get_class (signal); glade_signal_model_create_signal_iter (model, - glade_signal_class_get_type (sig_class), + glade_signal_class_get_object_type_name (sig_class), signal, &iter); path = gtk_tree_model_get_path (GTK_TREE_MODEL (model), &iter); diff --git a/plugins/gtk+/glade-accels.c b/plugins/gtk+/glade-accels.c index ea8f391f..989c1ff8 100644 --- a/plugins/gtk+/glade-accels.c +++ b/plugins/gtk+/glade-accels.c @@ -228,7 +228,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS if (glade_widget_adaptor_get_object_type (adaptor) == type_action || g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), type_action)) { - if (g_strcmp0 (glade_signal_class_get_type (sclass), "GtkAction") != 0 || + if (g_strcmp0 (glade_signal_class_get_object_type_name (sclass), "GtkAction") != 0 || g_strcmp0 (glade_signal_class_get_name (sclass), "activate") != 0) continue; } @@ -237,17 +237,17 @@ G_GNUC_END_IGNORE_DEPRECATIONS continue; if (g_list_find_custom (eprop_accel->parent_iters, - glade_signal_class_get_type (sclass), + glade_signal_class_get_object_type_name (sclass), (GCompareFunc) eprop_find_iter) == NULL) { gtk_tree_store_append (model, &iter, NULL); gtk_tree_store_set (model, &iter, - ACCEL_COLUMN_SIGNAL, glade_signal_class_get_type (sclass), + ACCEL_COLUMN_SIGNAL, glade_signal_class_get_object_type_name (sclass), ACCEL_COLUMN_WEIGHT, PANGO_WEIGHT_BOLD, ACCEL_COLUMN_VISIBLE, FALSE, -1); parent_tab = g_new0 (GladeEpropIterTab, 1); - parent_tab->name = glade_signal_class_get_type (sclass); + parent_tab->name = glade_signal_class_get_object_type_name (sclass); parent_tab->iter = gtk_tree_iter_copy (&iter); eprop_accel->parent_iters = @@ -265,7 +265,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS if (glade_widget_adaptor_get_object_type (adaptor) == type_action || g_type_is_a (glade_widget_adaptor_get_object_type (adaptor), type_action)) { - if (g_strcmp0 (glade_signal_class_get_type (sclass), "GtkAction") != 0 || + if (g_strcmp0 (glade_signal_class_get_object_type_name (sclass), "GtkAction") != 0 || g_strcmp0 (glade_signal_class_get_name (sclass), "activate") != 0) continue; } @@ -274,7 +274,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS continue; if ((found = g_list_find_custom (eprop_accel->parent_iters, - glade_signal_class_get_type (sclass), + glade_signal_class_get_object_type_name (sclass), (GCompareFunc) eprop_find_iter)) != NULL) { parent_tab = found->data; -- cgit v1.2.1