Skip to content

Commit

Permalink
Convert to Tonel v1
Browse files Browse the repository at this point in the history
Same script (change default writer before)
  • Loading branch information
tinchodias committed Nov 4, 2023
1 parent faa454f commit 596db58
Show file tree
Hide file tree
Showing 1,586 changed files with 18,257 additions and 20,953 deletions.
9 changes: 4 additions & 5 deletions src/BaselineOfBloc/BaselineOfBloc.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ See BaselineOfBloc for more information about Bloc in general.
"
Class {
#name : 'BaselineOfBloc',
#superclass : 'BaselineOf',
#category : 'BaselineOfBloc',
#package : 'BaselineOfBloc'
#name : #BaselineOfBloc,
#superclass : #BaselineOf,
#category : #BaselineOfBloc
}

{ #category : 'baselines' }
{ #category : #baselines }
BaselineOfBloc >> baseline: spec [
<baseline>
spec
Expand Down
2 changes: 1 addition & 1 deletion src/BaselineOfBloc/package.st
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Package { #name : 'BaselineOfBloc' }
Package { #name : #BaselineOfBloc }
37 changes: 18 additions & 19 deletions src/Bloc-Alexandrie-Exporter/BAExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,68 @@
I am an exporter of Bloc elements to certain output format, that each of my subclasses define.
"
Class {
#name : 'BAExporter',
#superclass : 'Object',
#name : #BAExporter,
#superclass : #Object,
#instVars : [
'element',
'scale',
'background'
],
#category : 'Bloc-Alexandrie-Exporter',
#package : 'Bloc-Alexandrie-Exporter'
#category : #'Bloc-Alexandrie-Exporter'
}

{ #category : 'instance creation' }
{ #category : #'instance creation' }
BAExporter class >> form [
^ BAFormExporter new
]

{ #category : 'instance creation' }
{ #category : #'instance creation' }
BAExporter class >> jpg [
^ BAJpgExporter new
]

{ #category : 'instance creation' }
{ #category : #'instance creation' }
BAExporter class >> pdf [
^ BAPdfExporter new
]

{ #category : 'instance creation' }
{ #category : #'instance creation' }
BAExporter class >> png [
^ BAPngExporter new
]

{ #category : 'instance creation' }
{ #category : #'instance creation' }
BAExporter class >> svg [
^ BASvgExporter new
]

{ #category : 'accessing' }
{ #category : #accessing }
BAExporter >> background [

^ background
]

{ #category : 'api - configuration' }
{ #category : #'api - configuration' }
BAExporter >> background: aColorOrPaint [

background := aColorOrPaint
]

{ #category : 'accessing' }
{ #category : #accessing }
BAExporter >> element [
"Return an element to be exported"

^ element
]

{ #category : 'api - configuration' }
{ #category : #'api - configuration' }
BAExporter >> element: aBlElement [
"Specify an element to be exorted"

element := aBlElement
]

{ #category : 'api - exporting' }
{ #category : #'api - exporting' }
BAExporter >> export [

| aCanvas aBounds |
Expand All @@ -83,35 +82,35 @@ BAExporter >> export [
^ self finishExport: aCanvas
]

{ #category : 'api - exporting' }
{ #category : #'api - exporting' }
BAExporter >> finishExport: aeCanvas [
"Do finish the canvas and return the export result."

self subclassResponsibility
]

{ #category : 'initialization' }
{ #category : #initialization }
BAExporter >> initialize [
super initialize.

scale := 1.0.
background := Color transparent
]

{ #category : 'instance creation' }
{ #category : #'instance creation' }
BAExporter >> newCanvas: anExtent [
"Create a suitable canvas of a given size used for the export"

^ self subclassResponsibility
]

{ #category : 'accessing' }
{ #category : #accessing }
BAExporter >> scale [

^ scale
]

{ #category : 'api - configuration' }
{ #category : #'api - configuration' }
BAExporter >> scale: aNumber [
"Scale horizontally and vertically by aNumber. Scale must be positive."

Expand Down
19 changes: 9 additions & 10 deletions src/Bloc-Alexandrie-Exporter/BAFileExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,29 @@ I export a Bloc element to a file target.
See my subclasses for different output formats.
"
Class {
#name : 'BAFileExporter',
#superclass : 'BAExporter',
#name : #BAFileExporter,
#superclass : #BAExporter,
#instVars : [
'target'
],
#category : 'Bloc-Alexandrie-Exporter',
#package : 'Bloc-Alexandrie-Exporter'
#category : #'Bloc-Alexandrie-Exporter'
}

{ #category : 'private' }
{ #category : #private }
BAFileExporter >> defaultTarget [

^ Smalltalk imageDirectory /
(self element class name, '-', self element hash asString, '.' , self extension)
]

{ #category : 'accessing' }
{ #category : #accessing }
BAFileExporter >> extension [
"Return a String representing default file extension to be used during export"

^ self subclassResponsibility
]

{ #category : 'accessing' }
{ #category : #accessing }
BAFileExporter >> fileName: aFileReference [

self
Expand All @@ -38,19 +37,19 @@ BAFileExporter >> fileName: aFileReference [
self target: aFileReference
]

{ #category : 'private' }
{ #category : #private }
BAFileExporter >> finishExport: aeCanvas [

^ target
]

{ #category : 'accessing' }
{ #category : #accessing }
BAFileExporter >> target [

^ target ifNil: [ target := self defaultTarget ]
]

{ #category : 'accessing' }
{ #category : #accessing }
BAFileExporter >> target: aFileReference [

target := aFileReference
Expand Down
11 changes: 5 additions & 6 deletions src/Bloc-Alexandrie-Exporter/BAFormExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,18 @@ I export an element as a Form.
"
Class {
#name : 'BAFormExporter',
#superclass : 'BAExporter',
#category : 'Bloc-Alexandrie-Exporter',
#package : 'Bloc-Alexandrie-Exporter'
#name : #BAFormExporter,
#superclass : #BAExporter,
#category : #'Bloc-Alexandrie-Exporter'
}

{ #category : 'private' }
{ #category : #private }
BAFormExporter >> finishExport: aeCanvas [

^ aeCanvas asForm
]

{ #category : 'private' }
{ #category : #private }
BAFormExporter >> newCanvas: anExtent [

^ AeCanvas extent: anExtent
Expand Down
23 changes: 11 additions & 12 deletions src/Bloc-Alexandrie-Exporter/BAJpgExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,22 @@ element size: 400@200.
"
Class {
#name : 'BAJpgExporter',
#superclass : 'BAFileExporter',
#name : #BAJpgExporter,
#superclass : #BAFileExporter,
#instVars : [
'isProgressive',
'quality'
],
#category : 'Bloc-Alexandrie-Exporter',
#package : 'Bloc-Alexandrie-Exporter'
#category : #'Bloc-Alexandrie-Exporter'
}

{ #category : 'accessing' }
{ #category : #accessing }
BAJpgExporter >> extension [

^ 'jpg'
]

{ #category : 'private' }
{ #category : #private }
BAJpgExporter >> finishExport: aCanvas [
"Answer a file reference to the exported JPG."

Expand All @@ -47,7 +46,7 @@ BAJpgExporter >> finishExport: aCanvas [
^ self target
]

{ #category : 'initialization' }
{ #category : #initialization }
BAJpgExporter >> initialize [

super initialize.
Expand All @@ -57,31 +56,31 @@ BAJpgExporter >> initialize [
background := Color white
]

{ #category : 'accessing' }
{ #category : #accessing }
BAJpgExporter >> isProgressive [

^ isProgressive
]

{ #category : 'accessing' }
{ #category : #accessing }
BAJpgExporter >> isProgressive: aBoolean [

isProgressive := aBoolean
]

{ #category : 'private' }
{ #category : #private }
BAJpgExporter >> newCanvas: anExtent [

^ AeCanvas extent: anExtent
]

{ #category : 'accessing' }
{ #category : #accessing }
BAJpgExporter >> quality [

^ quality
]

{ #category : 'accessing' }
{ #category : #accessing }
BAJpgExporter >> quality: aNumber [
"Quality must be between 0 and 100"

Expand Down
13 changes: 6 additions & 7 deletions src/Bloc-Alexandrie-Exporter/BAPdfExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ element size: 400@200.
"
Class {
#name : 'BAPdfExporter',
#superclass : 'BAFileExporter',
#category : 'Bloc-Alexandrie-Exporter',
#package : 'Bloc-Alexandrie-Exporter'
#name : #BAPdfExporter,
#superclass : #BAFileExporter,
#category : #'Bloc-Alexandrie-Exporter'
}

{ #category : 'accessing' }
{ #category : #accessing }
BAPdfExporter >> extension [

^ 'pdf'
]

{ #category : 'private' }
{ #category : #private }
BAPdfExporter >> finishExport: aCanvas [
"Answer a file reference to the exported PDF."

Expand All @@ -38,7 +37,7 @@ BAPdfExporter >> finishExport: aCanvas [
^ self target
]

{ #category : 'private' }
{ #category : #private }
BAPdfExporter >> newCanvas: anExtent [

| aSurface |
Expand Down
13 changes: 6 additions & 7 deletions src/Bloc-Alexandrie-Exporter/BAPngExporter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,18 @@ element size: 400@200.
"
Class {
#name : 'BAPngExporter',
#superclass : 'BAFileExporter',
#category : 'Bloc-Alexandrie-Exporter',
#package : 'Bloc-Alexandrie-Exporter'
#name : #BAPngExporter,
#superclass : #BAFileExporter,
#category : #'Bloc-Alexandrie-Exporter'
}

{ #category : 'accessing' }
{ #category : #accessing }
BAPngExporter >> extension [

^ 'png'
]

{ #category : 'private' }
{ #category : #private }
BAPngExporter >> finishExport: aCanvas [
"Answer a file reference to the exported PNG."

Expand All @@ -39,7 +38,7 @@ BAPngExporter >> finishExport: aCanvas [
^ self target
]

{ #category : 'private' }
{ #category : #private }
BAPngExporter >> newCanvas: anExtent [

^ AeCanvas extent: anExtent
Expand Down
Loading

0 comments on commit 596db58

Please sign in to comment.