Move functions

This commit is contained in:
Milan Nikolic 2023-11-09 08:55:58 +01:00
parent 9f257fc589
commit f953e65a3a
No known key found for this signature in database
GPG key ID: 9229D0EAA3AA4E75
6 changed files with 184 additions and 215 deletions

View file

@ -10,11 +10,21 @@ import (
"unsafe"
)
// newGlyphInfoFromPointer - Returns new GlyphInfo from pointer
func newGlyphInfoFromPointer(ptr unsafe.Pointer) GlyphInfo {
return *(*GlyphInfo)(ptr)
}
// cptr returns C pointer
func (c *GlyphInfo) cptr() *C.GlyphInfo {
return (*C.GlyphInfo)(unsafe.Pointer(c))
}
// newFontFromPointer - Returns new Font from pointer
func newFontFromPointer(ptr unsafe.Pointer) Font {
return *(*Font)(ptr)
}
// cptr returns C pointer
func (s *Font) cptr() *C.Font {
return (*C.Font)(unsafe.Pointer(s))