Golang C.guint32类(方法)实例源码

下面列出了Golang C.guint32 类(方法)源码代码实例,从而了解它的用法。

作者:reuse    项目:ggi   
/*
Ends the drag operation after a drop.

This function is called by the drag destination.
*/
func DropFinish(context IsDragContext, success bool, time_ uint32) {
	__cgo__success := C.gboolean(0)
	if success {
		__cgo__success = C.gboolean(1)
	}
	C.gdk_drop_finish(context.GetDragContextPointer(), __cgo__success, C.guint32(time_))
	return
}

作者:reuse    项目:ggi   
/*
Accepts or rejects a drop.

This function is called by the drag destination in response
to a drop initiated by the drag source.
*/
func DropReply(context IsDragContext, accepted bool, time_ uint32) {
	__cgo__accepted := C.gboolean(0)
	if accepted {
		__cgo__accepted = C.gboolean(1)
	}
	C.gdk_drop_reply(context.GetDragContextPointer(), __cgo__accepted, C.guint32(time_))
	return
}

作者:jkeys08    项目:go-gtk   
func (self Color) ToNative() unsafe.Pointer {
	var cColor *C.GdkColor = C._new_color()

	cColor.pixel = C.guint32(self.Pixel)
	cColor.red = C.guint16(self.Red)
	cColor.green = C.guint16(self.Green)
	cColor.blue = C.guint16(self.Blue)

	return unsafe.Pointer(cColor)
}

作者:yamnikov-ole    项目:gotk   
// Grab() is a wrapper around gdk_device_grab().
func (v *Device) Grab(w *Window, ownership GrabOwnership, owner_events bool, event_mask EventMask, cursor *Cursor, time uint32) GrabStatus {
	ret := C.gdk_device_grab(
		v.native(),
		w.native(),
		C.GdkGrabOwnership(ownership),
		gbool(owner_events),
		C.GdkEventMask(event_mask),
		cursor.native(),
		C.guint32(time),
	)
	return GrabStatus(ret)
}

作者:reuse    项目:ggi   
/*
Sets the owner of the given selection.
*/
func SelectionOwnerSet(owner IsWindow, selection C.GdkAtom, time_ uint32, send_event bool) (return__ bool) {
	var __cgo__owner *C.GdkWindow
	if owner != nil {
		__cgo__owner = owner.GetWindowPointer()
	}
	__cgo__send_event := C.gboolean(0)
	if send_event {
		__cgo__send_event = C.gboolean(1)
	}
	var __cgo__return__ C.gboolean
	__cgo__return__ = C.gdk_selection_owner_set(__cgo__owner, selection, C.guint32(time_), __cgo__send_event)
	return__ = __cgo__return__ == C.gboolean(1)
	return
}

作者:partkyl    项目:go-gmim   
func NewHTMLFilter(flags uint32, colour int32) *aFilter {
	f := C.g_mime_filter_html_new(C.guint32(flags), C.guint32(colour))
	defer unref(C.gpointer(f))
	return castFilter(f)
}

作者:partkyl    项目:go-gmim   
func NewEnrichedFilter(flags int32) *aFilter {
	f := C.g_mime_filter_enriched_new(C.guint32(flags))
	return castFilter(f)
}

作者:twstrik    项目:gotk   
// PresentWithTime is a wrapper around gtk_window_present_with_time().
func (v *Window) PresentWithTime(ts uint32) {
	C.gtk_window_present_with_time(v.native(), C.guint32(ts))
}

作者:jric    项目:gotk   
// Set() is a wrapper around g_object_set().  However, unlike
// g_object_set(), this function only sets one name value pair.  Make
// multiple calls to this function to set multiple properties.
func (v *Object) Set(name string, value interface{}) error {
	cstr := C.CString(name)
	defer C.free(unsafe.Pointer(cstr))

	if _, ok := value.(Object); ok {
		value = value.(Object).GObject
	}

	var p unsafe.Pointer = nil
	switch value.(type) {
	case bool:
		c := gbool(value.(bool))
		p = unsafe.Pointer(&c)
	case int8:
		c := C.gint8(value.(int8))
		p = unsafe.Pointer(&c)
	case int16:
		c := C.gint16(value.(int16))
		p = unsafe.Pointer(&c)
	case int32:
		c := C.gint32(value.(int32))
		p = unsafe.Pointer(&c)
	case int64:
		c := C.gint64(value.(int64))
		p = unsafe.Pointer(&c)
	case int:
		c := C.gint(value.(int))
		p = unsafe.Pointer(&c)
	case uint8:
		c := C.guchar(value.(uint8))
		p = unsafe.Pointer(&c)
	case uint16:
		c := C.guint16(value.(uint16))
		p = unsafe.Pointer(&c)
	case uint32:
		c := C.guint32(value.(uint32))
		p = unsafe.Pointer(&c)
	case uint64:
		c := C.guint64(value.(uint64))
		p = unsafe.Pointer(&c)
	case uint:
		c := C.guint(value.(uint))
		p = unsafe.Pointer(&c)
	case uintptr:
		p = unsafe.Pointer(C.gpointer(value.(uintptr)))
	case float32:
		c := C.gfloat(value.(float32))
		p = unsafe.Pointer(&c)
	case float64:
		c := C.gdouble(value.(float64))
		p = unsafe.Pointer(&c)
	case string:
		cstr := C.CString(value.(string))
		defer C.free(unsafe.Pointer(cstr))
		p = unsafe.Pointer(cstr)
	default:
		if pv, ok := value.(unsafe.Pointer); ok {
			p = pv
		} else {
			// Constants with separate types are not type asserted
			// above, so do a runtime check here instead.
			val := reflect.ValueOf(value)
			switch val.Kind() {
			case reflect.Int, reflect.Int8, reflect.Int16,
				reflect.Int32, reflect.Int64:
				c := C.int(val.Int())
				p = unsafe.Pointer(&c)
			case reflect.Uintptr:
				p = unsafe.Pointer(C.gpointer(val.Pointer()))
			}
		}
	}
	// Can't call g_object_set() as it uses a variable arg list, use a
	// wrapper instead
	if p != nil {
		C._g_object_set_one(C.gpointer(v.GObject), (*C.gchar)(cstr), p)
		return nil
	} else {
		return errors.New("Unable to perform type conversion")
	}
}

作者:reuse    项目:ggi   
/*
Drops on the current destination.

This function is called by the drag source.
*/
func DragDrop(context IsDragContext, time_ uint32) {
	C.gdk_drag_drop(context.GetDragContextPointer(), C.guint32(time_))
	return
}

作者:hauke9    项目:go-gt   
func (p *Pixbuf) Fill(pixel uint32) {
	C.gdk_pixbuf_fill(p.GPixbuf, C.guint32(pixel))
}

作者:reuse    项目:ggi   
/*
Clears a pixbuf to the given RGBA value, converting the RGBA value into
the pixbuf's pixel format. The alpha will be ignored if the pixbuf
doesn't have an alpha channel.
*/
func (self *TraitPixbuf) Fill(pixel uint32) {
	C.gdk_pixbuf_fill(self.CPointer, C.guint32(pixel))
	return
}

作者:reuse    项目:ggi   
/*
Sends a response to SelectionRequest event.
*/
func SelectionSendNotify(requestor IsWindow, selection C.GdkAtom, target C.GdkAtom, property C.GdkAtom, time_ uint32) {
	C.gdk_selection_send_notify(requestor.GetWindowPointer(), selection, target, property, C.guint32(time_))
	return
}

作者:gotk    项目:gotk   
func UnicodeToKeyval(v rune) uint {
	return uint(C.gdk_unicode_to_keyval(C.guint32(v)))
}

作者:reuse    项目:ggi   
/*
Send a response to SelectionRequest event.
*/
func SelectionSendNotifyForDisplay(display IsDisplay, requestor IsWindow, selection C.GdkAtom, target C.GdkAtom, property C.GdkAtom, time_ uint32) {
	C.gdk_selection_send_notify_for_display(display.GetDisplayPointer(), requestor.GetWindowPointer(), selection, target, property, C.guint32(time_))
	return
}

作者:reuse    项目:ggi   
/*
Selects one of the actions offered by the drag source.

This function is called by the drag destination in response to
gdk_drag_motion() called by the drag source.
*/
func DragStatus(context IsDragContext, action C.GdkDragAction, time_ uint32) {
	C.gdk_drag_status(context.GetDragContextPointer(), action, C.guint32(time_))
	return
}

作者:reuse    项目:ggi   
/*
Updates the drag context when the pointer moves or the
set of actions changes.

This function is called by the drag source.
*/
func DragMotion(context IsDragContext, dest_window IsWindow, protocol C.GdkDragProtocol, x_root int, y_root int, suggested_action C.GdkDragAction, possible_actions C.GdkDragAction, time_ uint32) (return__ bool) {
	var __cgo__return__ C.gboolean
	__cgo__return__ = C.gdk_drag_motion(context.GetDragContextPointer(), dest_window.GetWindowPointer(), protocol, C.gint(x_root), C.gint(y_root), suggested_action, possible_actions, C.guint32(time_))
	return__ = __cgo__return__ == C.gboolean(1)
	return
}

作者:reuse    项目:ggi   
/*
Creates a transformation of the source image @src by scaling by
@scale_x and @scale_y then translating by @offset_x and @offset_y,
then composites the rectangle (@dest_x ,@dest_y, @dest_width,
@dest_height) of the resulting image with a checkboard of the
colors @color1 and @color2 and renders it onto the destination
image.

See gdk_pixbuf_composite_color_simple() for a simpler variant of this
function suitable for many tasks.
*/
func (self *TraitPixbuf) CompositeColor(dest IsPixbuf, dest_x int, dest_y int, dest_width int, dest_height int, offset_x float64, offset_y float64, scale_x float64, scale_y float64, interp_type C.GdkInterpType, overall_alpha int, check_x int, check_y int, check_size int, color1 uint32, color2 uint32) {
	C.gdk_pixbuf_composite_color(self.CPointer, dest.GetPixbufPointer(), C.int(dest_x), C.int(dest_y), C.int(dest_width), C.int(dest_height), C.double(offset_x), C.double(offset_y), C.double(scale_x), C.double(scale_y), interp_type, C.int(overall_alpha), C.int(check_x), C.int(check_y), C.int(check_size), C.guint32(color1), C.guint32(color2))
	return
}

作者:cfstra    项目:cfmedia   
func (t *track) SetRating(val RatingT) {
	t.t.rating = C.guint32(val)
}

作者:reuse    项目:ggi   
/*
Creates a new #GdkPixbuf by scaling @src to @dest_width x
@dest_height and compositing the result with a checkboard of colors
@color1 and @color2.
*/
func (self *TraitPixbuf) CompositeColorSimple(dest_width int, dest_height int, interp_type C.GdkInterpType, overall_alpha int, check_size int, color1 uint32, color2 uint32) (return__ *Pixbuf) {
	var __cgo__return__ *C.GdkPixbuf
	__cgo__return__ = C.gdk_pixbuf_composite_color_simple(self.CPointer, C.int(dest_width), C.int(dest_height), interp_type, C.int(overall_alpha), C.int(check_size), C.guint32(color1), C.guint32(color2))
	if __cgo__return__ != nil {
		return__ = NewPixbufFromCPointer(unsafe.Pointer(reflect.ValueOf(__cgo__return__).Pointer()))
	}
	return
}


问题


面经


文章

微信
公众号

扫码关注公众号