本文整理汇总了C++中G_IS_OBJECT函数的典型用法代码示例。如果您正苦于以下问题:C++ G_IS_OBJECT函数的具体用法?C++ G_IS_OBJECT怎么用?C++ G_IS_OBJECT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_IS_OBJECT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: feed_list_node_rename
void
feed_list_node_rename (nodePtr node)
{
GtkWidget *nameentry;
if (!nodenamedialog || !G_IS_OBJECT (nodenamedialog))
nodenamedialog = liferea_dialog_new (NULL, "nodenamedialog");
nameentry = liferea_dialog_lookup (nodenamedialog, "nameentry");
gtk_entry_set_text (GTK_ENTRY (nameentry), node_get_title (node));
g_signal_connect (G_OBJECT (nodenamedialog), "response",
G_CALLBACK (on_nodenamedialog_response), node);
gtk_widget_show (nodenamedialog);
}
示例2: ide_settings_bind
void
ide_settings_bind (IdeSettings *self,
const gchar *key,
gpointer object,
const gchar *property,
GSettingsBindFlags flags)
{
g_return_if_fail (IDE_IS_SETTINGS (self));
g_return_if_fail (key != NULL);
g_return_if_fail (G_IS_OBJECT (object));
g_return_if_fail (property != NULL);
egg_settings_sandwich_bind (self->settings_sandwich, key, object, property, flags);
}
示例3: seahorse_object_model_get_row_key
GObject *
seahorse_object_model_get_row_key (SeahorseObjectModel *self, GtkTreeIter *iter)
{
SeahorseObjectRow *skrow;
g_return_val_if_fail (SEAHORSE_IS_OBJECT_MODEL (self), NULL);
g_return_val_if_fail (self->data_column >= 0, NULL);
gtk_tree_model_get (GTK_TREE_MODEL (self), iter, self->data_column, &skrow, -1);
if (!skrow)
return NULL;
g_assert (G_IS_OBJECT (skrow->object));
return skrow->object;
}
示例4: spice_foreign_menu_listener_accept_async
void
spice_foreign_menu_listener_accept_async (GObject *listener,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_return_if_fail(G_IS_OBJECT(listener));
#ifdef G_OS_WIN32
spice_named_pipe_listener_accept_async (SPICE_NAMED_PIPE_LISTENER (listener), cancellable, callback, user_data);
#else
g_socket_listener_accept_async (G_SOCKET_LISTENER (listener), cancellable, callback, user_data);
#endif
}
示例5: iface_print_string
static void
iface_print_string (TestIface *tiobj,
const gchar *string)
{
TestIfaceClass *iface;
g_return_if_fail (TEST_IS_IFACE (tiobj));
g_return_if_fail (G_IS_OBJECT (tiobj)); /* ensured through prerequisite */
iface = TEST_IFACE_GET_CLASS (tiobj);
g_object_ref (tiobj);
iface->print_string (tiobj, string);
g_object_unref (tiobj);
}
示例6: _midgard_query_constraint_group_dispose
static void
_midgard_query_constraint_group_dispose (GObject *object)
{
MidgardQueryConstraintGroup *self = MIDGARD_QUERY_CONSTRAINT_GROUP (object);
GSList *self_constraints = MIDGARD_QUERY_CONSTRAINT_GROUP (self)->priv->constraints;
GSList *l = NULL;
for (l = self_constraints; l != NULL; l = l->next) {
if (l->data && G_IS_OBJECT (l->data)) {
g_object_unref(l->data);
l->data = NULL;
}
}
parent_class->dispose (object);
}
示例7: gst_controller_new
/**
* gst_controller_new:
* @object: the object of which some properties should be controlled
* @...: %NULL terminated list of property names that should be controlled
*
* Creates a new GstController for the given object's properties
*
* Returns: the new controller.
*/
GstController *
gst_controller_new (GObject * object, ...)
{
GstController *self;
va_list var_args;
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
va_start (var_args, object);
self = gst_controller_new_valist (object, var_args);
va_end (var_args);
return self;
}
示例8: gimp_config_dump
gboolean
gimp_config_dump (GObject *gimp,
GimpConfigDumpFormat format)
{
GOutputStream *output;
GimpConfigWriter *writer;
GimpConfig *rc;
g_return_val_if_fail (G_IS_OBJECT (gimp), FALSE);
rc = g_object_new (GIMP_TYPE_RC,
"gimp", gimp,
NULL);
#ifdef G_OS_WIN32
output = g_win32_output_stream_new ((gpointer) 1, FALSE);
#else
output = g_unix_output_stream_new (1, FALSE);
#endif
writer = gimp_config_writer_new_stream (output, NULL, NULL);
switch (format)
{
case GIMP_CONFIG_DUMP_NONE:
break;
case GIMP_CONFIG_DUMP_GIMPRC:
gimp_config_writer_comment (writer,
"Dump of the GIMP default configuration");
gimp_config_writer_linefeed (writer);
gimp_config_serialize_properties (rc, writer);
gimp_config_writer_linefeed (writer);
break;
case GIMP_CONFIG_DUMP_GIMPRC_SYSTEM:
dump_gimprc_system (rc, writer, output);
break;
case GIMP_CONFIG_DUMP_GIMPRC_MANPAGE:
dump_gimprc_manpage (rc, writer, output);
break;
}
gimp_config_writer_finish (writer, NULL, NULL);
g_object_unref (output);
g_object_unref (rc);
return TRUE;
}
示例9: g_value_init_from_instance
/**
* g_value_init_from_instance:
* @value: An uninitialized #GValue structure.
* @instance: (type GObject.TypeInstance): the instance
*
* Initializes and sets @value from an instantiatable type via the
* value_table's collect_value() function.
*
* Note: The @value will be initialised with the exact type of
* @instance. If you wish to set the @value's type to a different GType
* (such as a parent class GType), you need to manually call
* g_value_init() and g_value_set_instance().
*
* Since: 2.42
*/
void
g_value_init_from_instance (GValue *value,
gpointer instance)
{
g_return_if_fail (value != NULL && G_VALUE_TYPE(value) == 0);
if (G_IS_OBJECT (instance))
{
/* Fast-path.
* If G_IS_OBJECT() succeeds we know:
* * that instance is present and valid
* * that it is a GObject, and therefore we can directly
* use the collect implementation (g_object_ref) */
value_meminit (value, G_TYPE_FROM_INSTANCE (instance));
value->data[0].v_pointer = g_object_ref (instance);
}
else
{
GType g_type;
GTypeValueTable *value_table;
GTypeCValue cvalue;
gchar *error_msg;
g_return_if_fail (G_TYPE_CHECK_INSTANCE (instance));
g_type = G_TYPE_FROM_INSTANCE (instance);
value_table = g_type_value_table_peek (g_type);
g_return_if_fail (strcmp (value_table->collect_format, "p") == 0);
memset (&cvalue, 0, sizeof (cvalue));
cvalue.v_pointer = instance;
/* setup and collect */
value_meminit (value, g_type);
value_table->value_init (value);
error_msg = value_table->collect_value (value, 1, &cvalue, 0);
if (error_msg)
{
g_warning ("%s: %s", G_STRLOC, error_msg);
g_free (error_msg);
/* we purposely leak the value here, it might not be
* in a sane state if an error condition occoured
*/
value_meminit (value, g_type);
value_table->value_init (value);
}
}
}
示例10: rs_filter_param_set_object
/**
* Set an object property
* @param filter_param A RSFilterParam
* @param name The name of the property
* @param value An object to store. Refcount will be incremented by one
*/
void
rs_filter_param_set_object(RSFilterParam *filter_param, const gchar *name, gpointer object)
{
GValue *val;
g_return_if_fail(RS_IS_FILTER_PARAM(filter_param));
g_return_if_fail(name != NULL);
g_return_if_fail(name[0] != '\0');
g_return_if_fail(G_IS_OBJECT(object));
val = new_value(G_OBJECT_TYPE(object));
g_value_set_object(val, object);
rs_filter_param_set_gvalue(filter_param, name, val);
}
示例11: gst_object_set_controller
EXPORT_C
#endif
gboolean
gst_object_set_controller (GObject * object, GstController * controller)
{
g_return_val_if_fail (G_IS_OBJECT (object), FALSE);
g_return_val_if_fail (controller, FALSE);
if (!g_object_get_qdata (object, priv_gst_controller_key)) {
g_object_set_qdata (object, priv_gst_controller_key, controller);
return (TRUE);
}
return (FALSE);
}
示例12: seahorse_object_list_remove
GList*
seahorse_object_list_remove (GList *original, gpointer object)
{
GList *at;
g_return_val_if_fail (G_IS_OBJECT (object), original);
at = g_list_find (original, object);
if (at != NULL) {
g_object_unref (object);
return g_list_delete_link (original, at);
}
return original;
}
示例13: nautilus_undo_transaction_unregister_object
void
nautilus_undo_transaction_unregister_object (GObject *object)
{
GList *list;
g_return_if_fail (G_IS_OBJECT (object));
/* Remove atoms from each transaction on the list. */
list = g_object_get_data (object, NAUTILUS_UNDO_TRANSACTION_LIST_DATA);
if (list != NULL) {
g_list_foreach (list, remove_atoms_cover, object);
g_list_free (list);
g_object_set_data (object, NAUTILUS_UNDO_TRANSACTION_LIST_DATA, NULL);
}
}
示例14: nautilus_undo_attach_undo_manager
void
nautilus_undo_attach_undo_manager (GObject *object,
NautilusUndoManager *manager)
{
g_return_if_fail (G_IS_OBJECT (object));
if (manager == NULL) {
g_object_set_data (object, NAUTILUS_UNDO_MANAGER_DATA, NULL);
} else {
g_object_ref (manager);
g_object_set_data_full
(object, NAUTILUS_UNDO_MANAGER_DATA,
manager, g_object_unref);
}
}
示例15: ui_folder_add
gboolean
ui_folder_add (void)
{
GtkWidget *foldernameentry;
if (!newfolderdialog || !G_IS_OBJECT (newfolderdialog))
newfolderdialog = liferea_dialog_new (NULL, "newfolderdialog");
foldernameentry = liferea_dialog_lookup (newfolderdialog, "foldertitleentry");
gtk_entry_set_text (GTK_ENTRY (foldernameentry), "");
gtk_widget_show (newfolderdialog);
return TRUE;
}