Cairo__FontOptions.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 28 Dec 2014 22:38:24 +0100
changeset 29 6ba06265e543
parent 23 38ee47dbd976
child 40 28dfc583beb5
permissions -rw-r--r--
Bindinge updated to recent Cairo version. All primitives moved to a new class - Cairo::CPrimitives. Callouts selectors changed to reflect C function names closely.

"{ Package: 'stx:goodies/libcairo' }"

"{ NameSpace: Cairo }"

ExternalStructure subclass:#FontOptions
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'Cairo-Objects'
!


!FontOptions class methodsFor:'accessing'!

dllPath

    OperatingSystem isMSWINDOWSlike ifTrue:[
        ^ #( 'C:\Windows' 'C:\Windows\System32' "Wild guess, should not harm" )
    ].

    OperatingSystem isUNIXlike ifTrue:[
        OperatingSystem getSystemType == #linux ifTrue:[
            | path |

            path := #( '/lib' '/usr/lib' '/usr/local/lib' ).
            (OperatingSystem getSystemInfo at:#machine) = 'x86_64' ifTrue:[
                "If the machine is 64bit, prepend standard path for 32bit libs.
                 Leave standard paths at the end, as the system might be completely 
                 32bit but running on 64bit-capable CPU.

                CAVEAT: This is bit dangerous, as on 64bit OS, if ia32 libs are
                not installed byt 64bit sqlite libs are, then 64bit libs are found
                and when a function is called, segfault will occur!!

                Q: Is there a way how to figure out if the OS itself is 32bit,
                regardles on CPU?"
                path := #( '/lib32' '/usr/lib32' '/usr/local/lib32' ) , path.
            ].
            ^path

        ].
    ].

    self error:'Unsupported operating system'

    "
        SqliteLibrary dllPath
    "

    "Created: / 31-08-2011 / 18:02:17 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

libraryName

    OperatingSystem isUNIXlike ifTrue:[^'libcairo.so.2'].

    OperatingSystem isMSWINDOWSlike ifTrue:[^'cairo.dll'].

    self error:'Library name for host OS is not known'
!

sizeof
    "Returns size of undelaying structure in bytes"

    ^0
! !

!FontOptions class methodsFor:'primitives'!

primCopy: original 

	<cdecl: const Cairo::FontOptions "cairo_font_options_copy" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primDestroy: options 

	<cdecl: const void "cairo_font_options_destroy" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primEqual: options other: other 

	<cdecl: const int32 "cairo_font_options_equal" ( Cairo::FontOptions Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primFontOptionsCreate

	<cdecl: const Cairo::FontOptions "cairo_font_options_create" ( ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primFtFontOptionsSubstitute: options pattern: pattern 

	<cdecl: const void "cairo_ft_font_options_substitute" ( Cairo::FontOptions pointer ) >
	self primitiveFailed

    "Created: / 10-07-2008 / 23:05:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primGetAntialias: options 

	<cdecl: const int32 "cairo_font_options_get_antialias" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primGetHintMetrics: options 

	<cdecl: const int32 "cairo_font_options_get_hint_metrics" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primGetHintStyle: options 

	<cdecl: const int32 "cairo_font_options_get_hint_style" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primGetSubpixelOrder: options 

	<cdecl: const int32 "cairo_font_options_get_subpixel_order" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primHash: options 

	<cdecl: const int32 "cairo_font_options_hash" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primMerge: options other: other 

	<cdecl: const void "cairo_font_options_merge" ( Cairo::FontOptions Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primSetAntialias: options antialias: antialias 

	<cdecl: const void "cairo_font_options_set_antialias" ( Cairo::FontOptions int32 ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primSetHintMetrics: options hintMetrics: hint_metrics 

	<cdecl: const void "cairo_font_options_set_hint_metrics" ( Cairo::FontOptions int32 ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primSetHintStyle: options hintStyle: hint_style 

	<cdecl: const void "cairo_font_options_set_hint_style" ( Cairo::FontOptions int32 ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primSetSubpixelOrder: options subpixelOrder: subpixel_order 

	<cdecl: const void "cairo_font_options_set_subpixel_order" ( Cairo::FontOptions int32 ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

primStatus: options 

	<cdecl: const int32 "cairo_font_options_status" ( Cairo::FontOptions ) >
	self primitiveFailed

    "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
! !

!FontOptions class methodsFor:'documentation'!

version
    ^'$Id$'
!

version_HG
    ^ '$Changeset: <not expanded> $'
! !