2022-08-07 20:43:16 +02:00
|
|
|
Class {
|
|
|
|
#name : #DiyaStyleSheet,
|
|
|
|
#superclass : #DiyaBaseObject,
|
|
|
|
#instVars : [
|
|
|
|
'stylesheet'
|
|
|
|
],
|
|
|
|
#category : #'Diya-Graphics'
|
|
|
|
}
|
|
|
|
|
|
|
|
{ #category : #convenience }
|
2022-08-08 00:12:54 +02:00
|
|
|
DiyaStyleSheet >> ? styleName [
|
|
|
|
^stylesheet at: styleName ifAbsent:[
|
|
|
|
DiyaCoreAPIError signal: 'Unable to query stylesheet ', styleName
|
2022-08-07 20:43:16 +02:00
|
|
|
].
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #initialization }
|
2022-08-08 00:12:54 +02:00
|
|
|
DiyaStyleSheet >> define: styName extend: parentStyName styles: rules [
|
|
|
|
|parentSheet style|
|
|
|
|
parentSheet := self ? parentStyName.
|
|
|
|
style := self define: styName styles: rules.
|
|
|
|
style parent: parentSheet.
|
|
|
|
^style
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #initialization }
|
|
|
|
DiyaStyleSheet >> define: name styles: rules [
|
|
|
|
|style|
|
|
|
|
style := rules asDiyaStyle.
|
|
|
|
stylesheet at: name put: style.
|
|
|
|
^style
|
2022-08-07 20:43:16 +02:00
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #initialization }
|
|
|
|
DiyaStyleSheet >> initialize [
|
|
|
|
super initialize.
|
|
|
|
stylesheet := Dictionary new.
|
|
|
|
]
|
|
|
|
|
|
|
|
{ #category : #accessing }
|
|
|
|
DiyaStyleSheet >> stylesheet [
|
|
|
|
^ stylesheet
|
|
|
|
]
|