当前位置: 首页>>代码示例>>C++>>正文


C++ G_TYPE_CHECK_INSTANCE_TYPE函数代码示例

本文整理汇总了C++中G_TYPE_CHECK_INSTANCE_TYPE函数的典型用法代码示例。如果您正苦于以下问题:C++ G_TYPE_CHECK_INSTANCE_TYPE函数的具体用法?C++ G_TYPE_CHECK_INSTANCE_TYPE怎么用?C++ G_TYPE_CHECK_INSTANCE_TYPE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了G_TYPE_CHECK_INSTANCE_TYPE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: storage_daemon_find_thing

gpointer
storage_daemon_find_thing (StorageDaemon *daemon,
                           const gchar *object_path,
                           GType type_of_thing)
{
  GDBusObject *object;
  GList *interfaces, *l;
  gpointer ret = NULL;

  object = g_dbus_object_manager_get_object (G_DBUS_OBJECT_MANAGER (daemon->object_manager), object_path);
  if (object == NULL ||
      type_of_thing == G_TYPE_INVALID ||
      G_TYPE_CHECK_INSTANCE_TYPE (object, type_of_thing))
    {
      return object;
    }

  interfaces = g_dbus_object_get_interfaces (object);
  for (l = interfaces; ret == NULL && l != NULL; l = g_list_next (l))
    {
      if (G_TYPE_CHECK_INSTANCE_TYPE (l->data, type_of_thing))
        ret = g_object_ref (l->data);
    }

  g_list_free_full (interfaces, g_object_unref);
  g_object_unref (object);
  return ret;
}
开发者ID:mvollmer,项目名称:storaged,代码行数:28,代码来源:daemon.c

示例2: update

void QtVideoSinkDelegate::update()
{
#ifndef GST_QT_VIDEO_SINK_NO_OPENGL
    if (G_TYPE_CHECK_INSTANCE_TYPE(m_sink, GST_TYPE_QT_GL_VIDEO_SINK)) {
        GstQtGLVideoSink::emit_update(m_sink);
    } else
#endif
    if (G_TYPE_CHECK_INSTANCE_TYPE(m_sink, GST_TYPE_QT_VIDEO_SINK)) {
        GstQtVideoSink::emit_update(m_sink);
    } else {
        Q_ASSERT(false);
    }
}
开发者ID:OBIGOGIT,项目名称:qt-gstreamer,代码行数:13,代码来源:qtvideosinkdelegate.cpp

示例3: soy_controllers_graph_value_take_edge

void soy_controllers_graph_value_take_edge (GValue* value, gpointer v_object) {
	soycontrollersgraphEdge* old;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SOY_CONTROLLERS_GRAPH_TYPE_EDGE));
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	old = value->data[0].v_pointer;
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	if (v_object) {
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SOY_CONTROLLERS_GRAPH_TYPE_EDGE));
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
		value->data[0].v_pointer = v_object;
#line 374 "Graph.c"
	} else {
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
		value->data[0].v_pointer = NULL;
#line 378 "Graph.c"
	}
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
	if (old) {
#line 35 "/home/jeff/Documents/libraries/libsoy/src/controllers/graph/Graph.gs"
		soy_controllers_graph_edge_unref (old);
#line 384 "Graph.c"
	}
}
开发者ID:couchjd,项目名称:playground,代码行数:27,代码来源:Graph.c

示例4: system_collections_value_take_dictionary_entry

#line 341 "DictionaryEntry.c"
	}
}


void system_collections_value_take_dictionary_entry (GValue* value, gpointer v_object) {
	SystemCollectionsDictionaryEntry* old;
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SYSTEM_COLLECTIONS_TYPE_DICTIONARY_ENTRY));
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	old = value->data[0].v_pointer;
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	if (v_object) {
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SYSTEM_COLLECTIONS_TYPE_DICTIONARY_ENTRY));
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
		value->data[0].v_pointer = v_object;
#line 360 "DictionaryEntry.c"
	} else {
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
		value->data[0].v_pointer = NULL;
#line 364 "DictionaryEntry.c"
	}
#line 24 "/home/developer/projects/Backup/LibDotNet/src/System/Collections/DictionaryEntry.vala"
	if (old) {
开发者ID:chebizarro,项目名称:LibDotNet,代码行数:27,代码来源:DictionaryEntry.c

示例5: dup_channel_features_impl

static GArray *
dup_channel_features_impl (TpSimpleClientFactory *self,
    TpChannel *channel)
{
  GArray *features;
  GQuark standard_features[] = {
      TP_CHANNEL_FEATURE_GROUP,
      TP_CHANNEL_FEATURE_PASSWORD,
  };
  ChannelTypeMapping *m;

  /* Chainup to get desired features for all channel types */
  features = chainup->dup_channel_features (self, channel);

  g_array_append_vals (features, standard_features, G_N_ELEMENTS (standard_features));

  for (m = channel_type_mapping; m->channel_type != NULL; m++)
    {
      if (G_TYPE_CHECK_INSTANCE_TYPE (channel, m->gtype))
        {
          guint j;
          for (j = 0; m->features[j] != 0; j++)
            g_array_append_val (features, m->features[j]);
          break;
        }
    }

  return features;
}
开发者ID:Distrotech,项目名称:telepathy-glib,代码行数:29,代码来源:automatic-client-factory.c

示例6: system_text_regular_expressions_value_take_capture

void system_text_regular_expressions_value_take_capture (GValue* value, gpointer v_object) {
	SystemTextRegularExpressionsCapture* old;
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SYSTEM_TEXT_REGULAR_EXPRESSIONS_TYPE_CAPTURE));
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	old = value->data[0].v_pointer;
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	if (v_object) {
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SYSTEM_TEXT_REGULAR_EXPRESSIONS_TYPE_CAPTURE));
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
		value->data[0].v_pointer = v_object;
#line 597 "RegexCapture.c"
	} else {
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
		value->data[0].v_pointer = NULL;
#line 601 "RegexCapture.c"
	}
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
	if (old) {
#line 15 "/home/developer/projects/Backup/LibDotNet/src/System/Text/RegularExpressions/RegexCapture.vala"
		system_text_regular_expressions_capture_unref (old);
#line 607 "RegexCapture.c"
	}
}
开发者ID:chebizarro,项目名称:LibDotNet,代码行数:27,代码来源:RegexCapture.c

示例7: Q_UNUSED

void QGtkStylePrivate::addAllSubWidgets(GtkWidget *widget, gpointer v)
{
    Q_UNUSED(v);
    addWidgetToMap(widget);
    if (G_TYPE_CHECK_INSTANCE_TYPE ((widget), gtk_container_get_type()))
        gtk_container_forall((GtkContainer*)widget, addAllSubWidgets, NULL);
}
开发者ID:MarianMMX,项目名称:MarianMMX,代码行数:7,代码来源:qgtkstyle_p.cpp

示例8: seahorse_predicate_match

/**
 * seahorse_predicate_match:
 * @self: the object to test
 * @obj: The predicate to match
 *
 * matches a seahorse object and a predicate
 *
 * Returns: FALSE if predicate does not match the #SeahorseObject, TRUE else
 */
gboolean
seahorse_predicate_match (SeahorsePredicate *pred,
                          GObject* obj)
{

	g_return_val_if_fail (G_IS_OBJECT (obj), FALSE);

	/* Check all the fields */
	if (pred->type != 0 && !G_TYPE_CHECK_INSTANCE_TYPE (obj, pred->type))
		return FALSE;

	if (pred->usage != 0) {
		SeahorseUsage usage = 0;
		g_object_get (obj, "usage", &usage, NULL);
		if (pred->usage != usage)
			return FALSE;
	}

	if (pred->flags != 0 || pred->nflags != 0) {
		SeahorseFlags flags = 0;
		g_object_get (obj, "object-flags", &flags, NULL);
		if (pred->flags != 0 && (pred->flags & flags) == 0)
			return FALSE;
		if (pred->nflags != 0 && (pred->nflags & flags) != 0)
			return FALSE;
	}

	/* And any custom stuff */
	if (pred->custom != NULL && !pred->custom (obj, pred->custom_target))
		return FALSE;

	return TRUE;
}
开发者ID:atulhjp,项目名称:seahorse,代码行数:42,代码来源:seahorse-predicate.c

示例9: system_linq_value_take_strings

void system_linq_value_take_strings (GValue* value, gpointer v_object) {
	SystemLinqstrings* old;
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SYSTEM_LINQ_TYPE_STRINGS));
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	old = value->data[0].v_pointer;
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	if (v_object) {
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SYSTEM_LINQ_TYPE_STRINGS));
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		value->data[0].v_pointer = v_object;
#line 600 "Errors.c"
	} else {
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		value->data[0].v_pointer = NULL;
#line 604 "Errors.c"
	}
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	if (old) {
#line 29 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		system_linq_strings_unref (old);
#line 610 "Errors.c"
	}
}
开发者ID:chebizarro,项目名称:LibDotNet,代码行数:27,代码来源:Errors.c

示例10: find_device_by_interface_name

static NMDevice *
find_device_by_interface_name (NmtDeviceEntry *deventry,
                               const char     *interface_name)
{
    NmtDeviceEntryPrivate *priv = NMT_DEVICE_ENTRY_GET_PRIVATE (deventry);
    const GPtrArray *devices;
    NMDevice *device = NULL;
    int i;

    devices = nm_client_get_devices (nm_client);
    for (i = 0; i < devices->len && !device; i++) {
        NMDevice *candidate = devices->pdata[i];

        if (   priv->hardware_type != G_TYPE_NONE
                && !G_TYPE_CHECK_INSTANCE_TYPE (candidate, priv->hardware_type))
            continue;

        if (   priv->device_filter
                && !priv->device_filter (deventry, candidate, priv->device_filter_data))
            continue;

        if (!g_strcmp0 (interface_name, nm_device_get_iface (candidate)))
            device = candidate;
    }

    return device;
}
开发者ID:gunchleoc,项目名称:NetworkManager,代码行数:27,代码来源:nmt-device-entry.c

示例11: gst_element_implements_interface

gboolean
gst_element_implements_interface (GstElement * element, GType iface_type)
{
  g_return_val_if_fail (GST_IS_ELEMENT (element), FALSE);

  if (G_TYPE_CHECK_INSTANCE_TYPE (G_OBJECT (element), iface_type)) {
    GstImplementsInterface *iface;
    GstImplementsInterfaceClass *ifclass;

    iface = G_TYPE_CHECK_INSTANCE_CAST (G_OBJECT (element),
        iface_type, GstImplementsInterface);
    ifclass = GST_IMPLEMENTS_INTERFACE_GET_CLASS (iface);

    /* element implements iface_type but not GstImplementsInterface, so
     * just assume the other interface is implemented unconditionally */
    if (ifclass == NULL)
      return TRUE;

    if (ifclass->supported != NULL &&
        ifclass->supported (iface, iface_type) == TRUE) {
      return TRUE;
    }
  }

  return FALSE;
}
开发者ID:WangCrystal,项目名称:gstreamer,代码行数:26,代码来源:gstinterface.c

示例12: gst_allocator_fast_malloc_alloc

static GstMemory* gst_allocator_fast_malloc_alloc(GstAllocator* allocator, gsize size, GstAllocationParams* params)
{
    ASSERT(G_TYPE_CHECK_INSTANCE_TYPE(allocator, gst_allocator_fast_malloc_get_type()));

    // alignment should be a (power-of-two - 1).
    gsize alignment = params->align | gst_memory_alignment;
    ASSERT(!((alignment + 1) & alignment));

    gsize headerSize = (sizeof(GstMemoryFastMalloc) + alignment) & ~alignment;
    gsize allocationSize = params->prefix + size + params->padding;

    GstMemoryFastMalloc* mem = static_cast<GstMemoryFastMalloc*>(fastAlignedMalloc(alignment + 1, headerSize + allocationSize));
    if (!mem)
        return nullptr;

    mem->data = reinterpret_cast<uint8_t*>(mem) + headerSize;

    if (params->prefix && (params->flags & GST_MEMORY_FLAG_ZERO_PREFIXED))
        std::memset(mem->data, 0, params->prefix);
    if (params->padding && (params->flags & GST_MEMORY_FLAG_ZERO_PADDED))
        std::memset(mem->data + params->prefix + size, 0, params->padding);

    gst_memory_init(GST_MEMORY_CAST(mem), params->flags, allocator, nullptr,
        allocationSize, alignment, params->prefix, size);

    return GST_MEMORY_CAST(mem);
}
开发者ID:Comcast,项目名称:WebKitForWayland,代码行数:27,代码来源:GstAllocatorFastMalloc.cpp

示例13: remmina_widget_pool_find

GtkWidget*
remmina_widget_pool_find(GType type, const gchar *tag)
{
	GtkWidget *widget;
	gint i;
	GdkScreen *screen;
	gint screen_number;
	guint workspace;

	screen = gdk_screen_get_default();
	screen_number = gdk_screen_get_number(screen);
	workspace = remmina_public_get_current_workspace(screen);

	if (remmina_widget_pool == NULL)
		return NULL;

	for (i = 0; i < remmina_widget_pool->len; i++)
	{
		widget = GTK_WIDGET(g_ptr_array_index(remmina_widget_pool, i));
		if (!G_TYPE_CHECK_INSTANCE_TYPE(widget, type))
			continue;
		if (screen_number != gdk_screen_get_number(gtk_window_get_screen(GTK_WINDOW(widget))))
			continue;
		if (workspace != remmina_public_get_window_workspace(GTK_WINDOW(widget)))
			continue;
		if (tag && g_strcmp0((const gchar*) g_object_get_data(G_OBJECT(widget), "tag"), tag) != 0)
			continue;
		return widget;
	}
	return NULL;
}
开发者ID:BillTheBest,项目名称:Remmina,代码行数:31,代码来源:remmina_widget_pool.c

示例14: system_linq_value_set_error

void system_linq_value_set_error (GValue* value, gpointer v_object) {
	SystemLinqError* old;
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	g_return_if_fail (G_TYPE_CHECK_VALUE_TYPE (value, SYSTEM_LINQ_TYPE_ERROR));
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	old = value->data[0].v_pointer;
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	if (v_object) {
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		g_return_if_fail (G_TYPE_CHECK_INSTANCE_TYPE (v_object, SYSTEM_LINQ_TYPE_ERROR));
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		g_return_if_fail (g_value_type_compatible (G_TYPE_FROM_INSTANCE (v_object), G_VALUE_TYPE (value)));
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		value->data[0].v_pointer = v_object;
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		system_linq_error_ref (value->data[0].v_pointer);
#line 259 "Errors.c"
	} else {
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		value->data[0].v_pointer = NULL;
#line 263 "Errors.c"
	}
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
	if (old) {
#line 10 "/home/developer/projects/Backup/LibDotNet/src/System/Linq/Errors.vala"
		system_linq_error_unref (old);
#line 269 "Errors.c"
	}
}
开发者ID:chebizarro,项目名称:LibDotNet,代码行数:29,代码来源:Errors.c

示例15: list_stack_top

GreeterList* list_stack_top (ListStack* self) {
    GreeterList* result = NULL;
    GList* _tmp0_ = NULL;
    GList* children;
    GList* _tmp1_;
    g_return_val_if_fail (self != NULL, NULL);
    _tmp0_ = gtk_container_get_children ((GtkContainer*) self);
    children = _tmp0_;
    _tmp1_ = children;
    if (_tmp1_ == NULL) {
        result = NULL;
        _g_list_free0 (children);
        return result;
    } else {
        GList* _tmp2_;
        GList* _tmp3_ = NULL;
        gconstpointer _tmp4_;
        GtkWidget* _tmp5_;
        GreeterList* _tmp6_;
        _tmp2_ = children;
        _tmp3_ = g_list_last (_tmp2_);
        _tmp4_ = _tmp3_->data;
        _tmp5_ = (GtkWidget*) _tmp4_;
        _tmp6_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp5_, TYPE_GREETER_LIST) ? ((GreeterList*) _tmp5_) : NULL);
        result = _tmp6_;
        _g_list_free0 (children);
        return result;
    }
    _g_list_free0 (children);
}
开发者ID:fatman2021,项目名称:unity-greeter,代码行数:30,代码来源:list-stack.c


注:本文中的G_TYPE_CHECK_INSTANCE_TYPE函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。