Cairo__FontFace.st
changeset 12 e5f0c18af8a9
parent 11 fdc697f4f190
child 20 18a3e6b5f310
--- a/Cairo__FontFace.st	Wed May 30 20:06:35 2012 +0000
+++ b/Cairo__FontFace.st	Thu Jun 14 09:18:25 2012 +0000
@@ -6,12 +6,50 @@
 	instanceVariableNames:''
 	classVariableNames:''
 	poolDictionaries:''
-	category:'Cairo - Objects'
+	category:'Cairo-Objects'
 !
 
 
 !FontFace 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'].
@@ -19,11 +57,15 @@
 	OperatingSystem isMSWINDOWSlike ifTrue:[^'cairo.dll'].
 
 	self error:'Library name for host OS is not known'
+
+    "Modified: / 10-09-2008 / 18:19:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
 structSize
 
 	^0
+
+    "Modified: / 10-09-2008 / 18:19:53 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
 
 !FontFace class methodsFor:'primitives'!
@@ -36,48 +78,6 @@
     "Modified: / 10-09-2008 / 18:19:54 / Jan Vrany <vranyj1@fel.cvut.cz>"
 !
 
-primFontFaceDestroy: font_face 
-
-	<cdecl: void "cairo_font_face_destroy" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primFontFaceGetReferenceCount: font_face 
-
-	<cdecl: uint32 "cairo_font_face_get_reference_count" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primFontFaceGetType: font_face 
-
-	<cdecl: int32 "cairo_font_face_get_type" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primFontFaceGetUserData: font_face key: key 
-
-	<cdecl: voidPointer "cairo_font_face_get_user_data" ( Cairo::FontFace Cairo::UserDataKey ) >
-	self primitiveFailed
-!
-
-primFontFaceReference: font_face 
-
-	<cdecl: Cairo::FontFace "cairo_font_face_reference" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primFontFaceSetUserData: font_face key: key userData: user_data destroy: destroy 
-
-	<cdecl: int32 "cairo_font_face_set_user_data" ( Cairo::FontFace Cairo::UserDataKey voidPointer pointer ) >
-	self primitiveFailed
-!
-
-primFontFaceStatus: font_face 
-
-	<cdecl: int32 "cairo_font_face_status" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
 primFtFontFaceCreateForFtFace: face loadFlags: load_flags 
 
 	<cdecl: Cairo::FontFace "cairo_ft_font_face_create_for_ft_face" ( pointer int32 ) >
@@ -140,84 +140,6 @@
 	self primitiveFailed
 
     "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany <vranyj1@fel.cvut.cz>"
-!
-
-primToyFontFaceCreate: family slant: slant weight: weight 
-
-	<cdecl: Cairo::FontFace "cairo_toy_font_face_create" ( charPointer int32 int32 ) >
-	self primitiveFailed
-!
-
-primToyFontFaceGetFamily: font_face 
-
-	<cdecl: charPointer "cairo_toy_font_face_get_family" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primToyFontFaceGetSlant: font_face 
-
-	<cdecl: int32 "cairo_toy_font_face_get_slant" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primToyFontFaceGetWeight: font_face 
-
-	<cdecl: int32 "cairo_toy_font_face_get_weight" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primUserFontFaceCreate
-
-	<cdecl: Cairo::FontFace "cairo_user_font_face_create" ( ) >
-	self primitiveFailed
-!
-
-primUserFontFaceGetInitFunc: font_face 
-
-	<cdecl: pointer "cairo_user_font_face_get_init_func" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primUserFontFaceGetRenderGlyphFunc: font_face 
-
-	<cdecl: pointer "cairo_user_font_face_get_render_glyph_func" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primUserFontFaceGetTextToGlyphsFunc: font_face 
-
-	<cdecl: pointer "cairo_user_font_face_get_text_to_glyphs_func" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primUserFontFaceGetUnicodeToGlyphFunc: font_face 
-
-	<cdecl: pointer "cairo_user_font_face_get_unicode_to_glyph_func" ( Cairo::FontFace ) >
-	self primitiveFailed
-!
-
-primUserFontFaceSetInitFunc: font_face initFunc: init_func 
-
-	<cdecl: void "cairo_user_font_face_set_init_func" ( Cairo::FontFace pointer ) >
-	self primitiveFailed
-!
-
-primUserFontFaceSetRenderGlyphFunc: font_face renderGlyphFunc: render_glyph_func 
-
-	<cdecl: void "cairo_user_font_face_set_render_glyph_func" ( Cairo::FontFace pointer ) >
-	self primitiveFailed
-!
-
-primUserFontFaceSetTextToGlyphsFunc: font_face textToGlyphsFunc: text_to_glyphs_func 
-
-	<cdecl: void "cairo_user_font_face_set_text_to_glyphs_func" ( Cairo::FontFace pointer ) >
-	self primitiveFailed
-!
-
-primUserFontFaceSetUnicodeToGlyphFunc: font_face unicodeToGlyphFunc: unicode_to_glyph_func 
-
-	<cdecl: void "cairo_user_font_face_set_unicode_to_glyph_func" ( Cairo::FontFace pointer ) >
-	self primitiveFailed
 ! !
 
 !FontFace class methodsFor:'documentation'!