stx_goodies_libcairo.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 28 Feb 2016 14:53:56 +0000
changeset 51 5293f2b851ab
parent 50 239120c68187
child 57 2c9a342e1f2a
permissions -rw-r--r--
CairGraphicsContext: added support for displaying images with alpha channel

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

"{ NameSpace: Smalltalk }"

LibraryDefinition subclass:#stx_goodies_libcairo
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'* Projects & Packages *'
!


!stx_goodies_libcairo class methodsFor:'description'!

excludedFromPreRequisites
    "list packages which are to be explicitely excluded from the automatic constructed
     prerequisites list. If empty, everything that is found along the inheritance of any of
     my classes is considered to be a prerequisite package."

    ^ #(
    )
!

mandatoryPreRequisites
    "list packages which are mandatory as a prerequisite.
     This are packages containing superclasses of my classes and classes which
     are extended by myself.
     They are mandatory, because we need these packages as a prerequisite for loading and compiling.
     This method is generated automatically,
     by searching along the inheritance chain of all of my classes."

    ^ #(
        #'stx:libbasic'    "ArrayedCollection - superclass of Cairo::CStructure"
        #'stx:libview'    "DeviceGraphicsContext - extended"
        #'stx:libview2'    "stx_libview2 - extended"
    )
!

postLoadAction

    "
        stx_goodies_libcairo postLoadAction
    "

    super postLoadAction.
    OperatingSystem isUNIXlike 
        ifTrue:
            [ExternalLibraryFunction dllPath:    
                (ExternalLibraryFunction dllPath asOrderedCollection
                    add:'/usr/lib/i386-linux-gnu';
                    add:'/usr/lib';
                    add:'/usr/local/lib';
                    yourself)].

    "Created: / 10-09-2008 / 18:30:19 / Jan Vrany <vranyj1@fel.cvut.cz>"
    "Modified: / 21-09-2014 / 01:01:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

preLoadAction

    "
        stx_goodies_libcairo preLoadAction
    "

    super preLoadAction.
    NameSpace name:#Cairo

    "Created: / 10-09-2008 / 19:16:56 / Jan Vrany <vranyj1@fel.cvut.cz>"
!

preRequisites
    "list all required packages.
     This list can be maintained manually or (better) generated and
     updated by scanning the superclass hierarchies and looking for
     global variable accesses. (the browser has a menu function for that)
     Howevery, often too much is found, and you may want to explicitely
     exclude individual packages in the #excludedFromPrerequisites method."

    ^ #(
        #'stx:libbasic'    "ProjectDefinition - superclass of stx_goodies_libcairo "
        #'stx:libview'    "GLXWorkstation - superclass of Cairo::GLXWorkstation "
    )
!

referencedPreRequisites
    "list packages which are a prerequisite, because they contain
     classes which are referenced by my classes.
     We do not need these packages as a prerequisite for compiling or loading,
     however, a class from it may be referenced during execution and having it
     unloaded then may lead to a runtime doesNotUnderstand error, unless the caller
     includes explicit checks for the package being present.
     This method is generated automatically,
     by searching all classes (and their packages) which are referenced by my classes."

    ^ #(
        #'stx:goodies/sunit'    "TestAsserter - superclass of Cairo::Examples1"
        #'stx:libcomp'    "SyntaxHighlighter - referenced by Cairo::AbstractViewer>>postBuildWorkspace:"
        #'stx:libwidg'    "HVScrollableView - referenced by Image>>inspector2TabImageCairo"
    )
!

subProjects
    "list packages which are known as subprojects. 
     The generated makefile will enter those and make there as well.
     However: they are not forced to be loaded when a package is loaded; 
     for those, redefine requiredPrerequisites."

    ^ #(
    )
! !

!stx_goodies_libcairo class methodsFor:'description - contents'!

classNamesAndAttributes
    "lists the classes which are to be included in the project.
     Each entry in the list may be: a single class-name (symbol),
     or an array-literal consisting of class name and attributes.
     Attributes are: #autoload or #<os> where os is one of win32, unix,..."

    ^ #(
        "<className> or (<className> attributes...) in load order"
        (#'Cairo::AbstractViewer' autoload)
        #'Cairo::Antialias'
        #'Cairo::CError'
        #'Cairo::CPrimitives'
        #'Cairo::CStructure'
        #'Cairo::ClockView'
        #'Cairo::Content'
        #'Cairo::Device'
        #'Cairo::DeviceType'
        (#'Cairo::Examples1' autoload)
        (#'Cairo::Examples2' autoload)
        #'Cairo::Extend'
        #'Cairo::FillRule'
        #'Cairo::Filter'
        #'Cairo::FontSlant'
        #'Cairo::FontType'
        #'Cairo::FontWeight'
        #'Cairo::Format'
        #'Cairo::HintMetrics'
        #'Cairo::HintStyle'
        #'Cairo::LineCap'
        #'Cairo::LineJoin'
        #'Cairo::Operator'
        #'Cairo::Path'
        #'Cairo::PathData'
        #'Cairo::PathDataType'
        #'Cairo::PatternType'
        #'Cairo::PdfVersion'
        #'Cairo::RectangleInt'
        #'Cairo::RectangleList'
        #'Cairo::Region'
        #'Cairo::RegionOverlap'
        #'Cairo::Status'
        #'Cairo::SubpixelOrder'
        #'Cairo::SurfaceObserverMode'
        #'Cairo::SurfaceType'
        #'Cairo::TextCluster'
        #'Cairo::TextClusterFlags'
        #'Cairo::TextExampleView'
        #'Cairo::UserDataKey'
        #'stx_goodies_libcairo'
        #'Cairo::CObject'
        (#'Cairo::Examples1Viewer' autoload)
        (#'Cairo::Examples2Viewer' autoload)
        #'Cairo::FontExtents'
        #'Cairo::Glyph'
        #'Cairo::Matrix'
        #'Cairo::Rectangle'
        #'Cairo::TextExtents'
        CairoGraphicsContext
        CairoScaledFont
        #'Cairo::FontFace'
        #'Cairo::FontOptions'
        #'Cairo::GraphicsContext'
        #'Cairo::Pattern'
        #'Cairo::ScaledFont'
        #'Cairo::Surface'
        #'Cairo::SurfaceImage'
        #'Cairo::SurfacePDF'
        #'Cairo::SurfaceWin32'
        #'Cairo::SurfaceXlib'
    )
!

extensionMethodNames
    "list class/selector pairs of extensions.
     A correponding method with real names must be present in my concrete subclasses"

    ^ #(
        DeviceGraphicsContext drawableId
        GraphicsDevice cairoSurfaceFor:
        GraphicsDevice displayId
        SimpleView cairo
        SimpleView redrawWithCairo
        SimpleView redrawWithCairo:x:y:width:height:
        SimpleView redrawWithCairoBuffered
        SimpleView redrawWithCairoBuffered:
        SimpleView redrawWithCairoBuffered:x:y:width:height:
        SimpleView redrawWithCairoBufferedX:y:width:height:
        SimpleView redrawWithCairoX:y:width:height:
        DeviceGraphicsContext cairo
        Image inspector2TabImageCairo
        GraphicsContext displayDeviceLineFromX:y:toX:y:
        GraphicsContext displayDeviceRectangleX:y:width:height:
        GraphicsContext fillDeviceRectangleX:y:width:height:
        DeviceGraphicsContext cairoSurface
        GraphicsMedium cairoify
        SimpleView cairoify
        SimpleView cairoSurface
        'stx_libbasic class' #'version_HG'
        'stx_libview2 class' #'version_HG'
    )
! !

!stx_goodies_libcairo class methodsFor:'description - project information'!

companyName
    "Return a companyname which will appear in <lib>.rc"

    ^ 'CTU FEI'

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

description
    "Return a description string which will appear in vc.def / bc.def"

    ^ 'Cairo bindings (http://www.cairographics.org)'

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

legalCopyright
    "Return a copyright string which will appear in <lib>.rc"

    ^ 'Copyright Jan Vrany 2008'

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

productName
    "Return a product name which will appear in <lib>.rc"

    ^ 'Cairo'

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

!stx_goodies_libcairo class methodsFor:'description - svn'!

svnRepositoryUrlString
    "Return a SVN repository URL of myself.
     (Generated since 2011-04-08)
     Do not make the string shorter!!!!!! We have to use fixed-length keyword!!!!!!
    "        

    ^ '$URL::                                                                                                                        $'
!

svnRevisionNr
    "Return a SVN revision number of myself.
     This number is updated after a commit"

    ^ "$SVN-Revision:"'14              '"$"
! !

!stx_goodies_libcairo class methodsFor:'documentation'!

version
    ^'$Id$'
!

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