mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-27 20:08:22 +01:00
add bases classes
This commit is contained in:
parent
989b3c16fd
commit
12a79139d7
@ -20,6 +20,11 @@ DiyaBoot class >> initialize [
|
|||||||
|
|
||||||
{ #category : #'system startup' }
|
{ #category : #'system startup' }
|
||||||
DiyaBoot class >> startUp: status [
|
DiyaBoot class >> startUp: status [
|
||||||
|
"
|
||||||
|
As is the entry point for Diya, it need to be disabled
|
||||||
|
when inside the SDK image.
|
||||||
|
"
|
||||||
|
((Smalltalk globals at:#codeName ifAbsent:[nil]) = 'diya') ifFalse: [^self].
|
||||||
self getLoadedClasses
|
self getLoadedClasses
|
||||||
do: [ :c |
|
do: [ :c |
|
||||||
Transcript
|
Transcript
|
||||||
|
25
Diya/DiyaFFIBase.class.st
Normal file
25
Diya/DiyaFFIBase.class.st
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
Class {
|
||||||
|
#name : #DiyaFFIBase,
|
||||||
|
#superclass : #DiyaBaseObject,
|
||||||
|
#category : #'Diya-Core'
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
DiyaFFIBase class >> checkSymbol [
|
||||||
|
^self subclassResponsibility
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
DiyaFFIBase class >> libNames [
|
||||||
|
^self subclassResponsibility
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
DiyaFFIBase class >> moduleName [
|
||||||
|
self libNames do:[:aName|
|
||||||
|
(ExternalAddress loadSymbol: self checkSymbol from: aName) ifNotNil: [
|
||||||
|
^ aName
|
||||||
|
].
|
||||||
|
].
|
||||||
|
self error: 'Unable to find FFI library (', self checkSymbol, ')'.
|
||||||
|
]
|
18
Diya/DiyaSDLBinding.class.st
Normal file
18
Diya/DiyaSDLBinding.class.st
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
Class {
|
||||||
|
#name : #DiyaSDLBinding,
|
||||||
|
#superclass : #DiyaFFIBase,
|
||||||
|
#category : #'Diya-Graphics-SDL'
|
||||||
|
}
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
DiyaSDLBinding class >> checkSymbol [
|
||||||
|
^ 'SDL_Init'
|
||||||
|
]
|
||||||
|
|
||||||
|
{ #category : #accessing }
|
||||||
|
DiyaSDLBinding class >> libNames [
|
||||||
|
#(
|
||||||
|
'libSDL2-2.0.so.0' "Linux 1"
|
||||||
|
'libSDL2-2.0.so.0.2.1' "Linux 2"
|
||||||
|
)
|
||||||
|
]
|
@ -87,7 +87,7 @@ ImageInitializer >> preloadSystem: loaded [
|
|||||||
|
|
||||||
{ #category : #activation }
|
{ #category : #activation }
|
||||||
ImageInitializer >> snap [
|
ImageInitializer >> snap [
|
||||||
|pkg|
|
Smalltalk globals at: #codeName put: 'diya'.
|
||||||
self class removeFromSystem.
|
self class removeFromSystem.
|
||||||
Smalltalk garbageCollect.
|
Smalltalk garbageCollect.
|
||||||
Smalltalk snapshot: true andQuit: false.
|
Smalltalk snapshot: true andQuit: false.
|
||||||
|
Loading…
Reference in New Issue
Block a user