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


Golang C.gulong函数代码示例

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


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

示例1: GetElementsByTagName

func (v *DOMDocument) GetElementsByTagName(tagName string) []*DOMNode {
	CtagName := C.CString(tagName)
	defer C.free_string(CtagName)
	GtagName := C.to_gcharptr(CtagName)

	list := C.webkit_dom_document_get_elements_by_tag_name(v.getDOMDocument(), GtagName)
	length := C.webkit_dom_node_list_get_length(list)

	//log.Fatal(length)

	nodes := []*DOMNode{}
	for i := C.gulong(0); i < length; i++ {
		domNode := &DOMNode{glib.GObject{unsafe.Pointer(C.webkit_dom_node_list_item(list, C.gulong(i)))}}
		nodes = append(nodes, domNode)
	}
	return nodes
}
开发者ID:ardemiranda,项目名称:go-webkit,代码行数:17,代码来源:webkit.go

示例2: Set

// Set value to i
func (v *Value) Set(i interface{}) {
	if vg, ok := i.(ValueGetter); ok {
		vg.Value().Copy(v)
		return
	}
	// Other types
	r := reflect.ValueOf(i)
	switch r.Kind() {
	case reflect.Invalid:
		C.g_value_reset(v.g())

	case reflect.Bool:
		C.g_value_set_boolean(v.g(), gBoolean(r.Bool()))

	case reflect.Int:
		C.g_value_set_long(v.g(), C.glong(i.(int)))

	case reflect.Int8:
		C.g_value_set_schar(v.g(), C.gint8(i.(int8)))

	case reflect.Int32:
		C.g_value_set_int(v.g(), C.gint(i.(int32)))

	case reflect.Int64:
		C.g_value_set_int64(v.g(), C.gint64(i.(int64)))

	case reflect.Uint:
		C.g_value_set_ulong(v.g(), C.gulong(i.(uint)))

	case reflect.Uint8:
		C.g_value_set_uchar(v.g(), C.guchar(i.(uint8)))

	case reflect.Uint32:
		C.g_value_set_uint(v.g(), C.guint(i.(uint32)))

	case reflect.Uint64:
		C.g_value_set_uint64(v.g(), C.guint64(i.(uint64)))

	case reflect.Float32:
		C.g_value_set_float(v.g(), C.gfloat(i.(float32)))

	case reflect.Float64:
		C.g_value_set_double(v.g(), C.gdouble(i.(float64)))

	case reflect.Ptr:
		C.g_value_set_pointer(v.g(), C.gpointer(r.Pointer()))

	case reflect.String:
		C.g_value_set_static_string(v.g(), (*C.gchar)(C.CString(r.String())))

	default:
		panic("Can't represent Go value in Glib type system.")
	}
}
开发者ID:ziutek,项目名称:glib,代码行数:55,代码来源:value.go

示例3: PropertyGet

/*
Retrieves a portion of the contents of a property. If the
property does not exist, then the function returns %FALSE,
and %GDK_NONE will be stored in @actual_property_type.

The XGetWindowProperty() function that gdk_property_get()
uses has a very confusing and complicated set of semantics.
Unfortunately, gdk_property_get() makes the situation
worse instead of better (the semantics should be considered
undefined), and also prints warnings to stderr in cases where it
should return a useful error to the program. You are advised to use
XGetWindowProperty() directly until a replacement function for
gdk_property_get() is provided.
*/
func PropertyGet(window IsWindow, property C.GdkAtom, type_ C.GdkAtom, offset uint64, length uint64, pdelete int) (actual_property_type C.GdkAtom, actual_format int, actual_length int, data string, return__ bool) {
	var __cgo__actual_format C.gint
	var __cgo__actual_length C.gint
	var __cgo__data *C.guchar
	var __cgo__return__ C.gboolean
	__cgo__return__ = C.gdk_property_get(window.GetWindowPointer(), property, type_, C.gulong(offset), C.gulong(length), C.gint(pdelete), &actual_property_type, &__cgo__actual_format, &__cgo__actual_length, &__cgo__data)
	actual_format = int(__cgo__actual_format)
	actual_length = int(__cgo__actual_length)
	data = C.GoString((*C.char)(unsafe.Pointer(__cgo__data)))
	return__ = __cgo__return__ == C.gboolean(1)
	return
}
开发者ID:reusee,项目名称:ggir,代码行数:26,代码来源:gdk_functions.go

示例4: HandlerDisconnect

// HandlerDisconnect is a wrapper around g_signal_handler_disconnect().
func (v *Object) HandlerDisconnect(handle SignalHandle) {
	C.g_signal_handler_disconnect(C.gpointer(v.GObject), C.gulong(handle))
	C.g_closure_invalidate(signals[handle])
	delete(closures.m, signals[handle])
	delete(signals, handle)
}
开发者ID:vvanpo,项目名称:gotk3,代码行数:7,代码来源:glib.go

示例5: HandlerUnblock

// HandlerUnblock is a wrapper around g_signal_handler_unblock().
func (v *Object) HandlerUnblock(handle SignalHandle) {
	C.g_signal_handler_unblock(C.gpointer(v.GObject), C.gulong(handle))
}
开发者ID:vvanpo,项目名称:gotk3,代码行数:4,代码来源:glib.go

示例6: GlibULong

func GlibULong(l uint64) C.gulong {
	return C.gulong(l)
}
开发者ID:dradtke,项目名称:gogi,代码行数:3,代码来源:marshal.go

示例7: GULong

func GULong(val interface{}) *GValue {
	ui := val.(uint32)
	ul := C.gulong(ui)
	return CreateCGValue(G_TYPE_ULONG, unsafe.Pointer(&ul))
}
开发者ID:napsy,项目名称:go-gtk3,代码行数:5,代码来源:gfundamental.go


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