diff -r fdc697f4f190 -r e5f0c18af8a9 Cairo__ScaledFont.st --- a/Cairo__ScaledFont.st Wed May 30 20:06:35 2012 +0000 +++ b/Cairo__ScaledFont.st Thu Jun 14 09:18:25 2012 +0000 @@ -6,12 +6,50 @@ instanceVariableNames:'' classVariableNames:'' poolDictionaries:'' - category:'Cairo - Objects' + category:'Cairo-Objects' ! !ScaledFont 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 " +! + 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:54 / Jan Vrany " ! structSize ^0 + + "Modified: / 10-09-2008 / 18:19:54 / Jan Vrany " ! ! !ScaledFont class methodsFor:'primitives'! @@ -136,102 +178,8 @@ self primitiveFailed -! -primScaledFontDestroy: scaled_font - - - self primitiveFailed -! - -primScaledFontExtents: scaled_font extents: extents - - - self primitiveFailed -! - -primScaledFontGetCtm: scaled_font ctm: ctm - - - self primitiveFailed -! - -primScaledFontGetFontFace: scaled_font - - - self primitiveFailed -! - -primScaledFontGetFontMatrix: scaled_font fontMatrix: font_matrix - - - self primitiveFailed -! - -primScaledFontGetFontOptions: scaled_font options: options - - - self primitiveFailed -! - -primScaledFontGetReferenceCount: scaled_font - - - self primitiveFailed -! - -primScaledFontGetScaleMatrix: scaled_font scaleMatrix: scale_matrix - - - self primitiveFailed -! - -primScaledFontGetType: scaled_font - - - self primitiveFailed -! - -primScaledFontGetUserData: scaled_font key: key - - - self primitiveFailed -! - -primScaledFontGlyphExtents: scaled_font glyphs: glyphs numGlyphs: num_glyphs extents: extents - - - self primitiveFailed -! - -primScaledFontReference: scaled_font - - - self primitiveFailed -! - -primScaledFontSetUserData: scaled_font key: key userData: user_data destroy: destroy - - - self primitiveFailed -! - -primScaledFontStatus: scaled_font - - - self primitiveFailed -! - -primScaledFontTextExtents: scaled_font utf8: utf8 extents: extents - - - self primitiveFailed -! - -primScaledFontTextToGlyphs: scaled_font x: x y: y utf8: utf8 utf8Len: utf8_len glyphs: glyphs numGlyphs: num_glyphs clusters: clusters numClusters: num_clusters clusterFlags: cluster_flags - - - self primitiveFailed + "Modified: / 10-09-2008 / 18:19:55 / Jan Vrany " ! primSetUserData: scaled_font key: key userData: user_data destroy: destroy