Skip to content

Commit

Permalink
Merge pull request #61 from hpi-swa-teaching/master
Browse files Browse the repository at this point in the history
PowerSqueak v0.3
  • Loading branch information
LeonMatthes authored Jun 20, 2018
2 parents 3e0dd91 + 5e64748 commit 5aac655
Show file tree
Hide file tree
Showing 183 changed files with 936 additions and 121 deletions.
61 changes: 57 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PowerSqueak [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=master)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09)[![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=master)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=master)
# PowerSqueak [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=release)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09)[![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=release)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=release)

A presentation tool for the Squeak development platform

Expand All @@ -10,19 +10,72 @@ Please check [Travis-ci](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09

Squeak 5.0 is officially unsupported (see [Travis-ci](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09)).

## Overview
* [Overview](https://github.com/hpi-swa-teaching/SWT18-Project-09#overview)
* [Installation Instructions](https://github.com/hpi-swa-teaching/SWT18-Project-09#installation-instructions)
* [Build status](https://github.com/hpi-swa-teaching/SWT18-Project-09#build-status)
* [Using PowerSqueak](https://github.com/hpi-swa-teaching/SWT18-Project-09#using-powersqueak)
* [Edit mode](https://github.com/hpi-swa-teaching/SWT18-Project-09#edit-mode)
* [Presentation mode](https://github.com/hpi-swa-teaching/SWT18-Project-09#presentation-mode)
* [Interactive/Non-Interactive mode](https://github.com/hpi-swa-teaching/SWT18-Project-09#interactivenon-interactive-mode)
* [saving and loading](https://github.com/hpi-swa-teaching/SWT18-Project-09#saving-and-loading)

## Installation Instructions
For easy installation, please first install [Metacello](https://github.com/Metacello/metacello).

Then run the following code in your Squeak 5.1/6.0(trunk) image:
``` smalltalk
Metacello new
baseline: 'Presenter';
repository: 'github://hpi-swa-teaching/SWT18-Project-09:master/packages';
repository: 'github://hpi-swa-teaching/SWT18-Project-09:release/packages';
load.
```

## Build status
| [Release](https://github.com/hpi-swa-teaching/SWT18-Project-09/releases/latest) | master
| ------------------------- | ------------------- |
| [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=release)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09) | [![Build Status](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09.svg?branch=master)](https://travis-ci.org/hpi-swa-teaching/SWT18-Project-09) |
| [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=release)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=release) | [![Coverage Status](https://coveralls.io/repos/github/hpi-swa-teaching/SWT18-Project-09/badge.svg?branch=master)](https://coveralls.io/github/hpi-swa-teaching/SWT18-Project-09?branch=master) |

## Using PowerSqueak
To open PowerSqueak run: ``` PSPresentationTool open. ```
To open PowerSqueak either
* run: ``` PSPresentationTool open. ```
* click PowerSqueak in the "Apps" drop-down-menu<br><img src="/pictures/apps-drawer.png" alt="Open PowerSqueak in the Apps menu" width="250">

You can then use the buttons at the top to create, delete and navigate slides and to create different slide elements (like text boxes, and images) and drop them onto the slide.
### Edit mode
During edit mode, you can use the buttons at the top to create, delete and navigate slides and to create different slide elements (like text boxes, and images) and drop them onto the slide.
You may also drop in other Morphs, but be aware, that some features of those Morphs might not work as expected.

For advanced features like deleting morphs or resizing text, right-click the morph.
<br><img src="/pictures/right-click.png" alt="Right-click example" width="400">

### Presentation mode
To enter presentation mode, click the "Present" button.

To control your presentation during presentation mode, use:

| Key | Action |
| ------- | ------- |
| Esc | Leave presentation mode |
| right arrow/page down | next slide |
| left arrow/page up | previous slide |
| Number keys | Jump to a slide number |
| i | (de-)activate interactivity and (un-)hide cursor |
#### Interactive/Non-Interactive mode
By pressing "i" during presentation mode, you can disable/enable interactivity and hide/unhide the cursor.
This mode is added to avoid the visual clutter of the cursor and to keep text on slides from grabbing the keyboard input, which prevents you from changing slides.

Leaving presentation mode also enables interactivity and unhides the cursor.

### Saving and loading
PowerSqueak can save and load presentations to/from the file system.

Use the corresponding save/load buttons to save/load the presentation.
If you want to view the saved files, go to the PSPresentation folder in your Squeak VMs folder.
You can share presentations by copying any presentation in the PSPresentation folder into the PSPresentations folder of another image.
In the other image you can then load the presentation as usual in PowerSqueak.

``` diff
- Warning: some morphs may crash your image if they are saved/loaded!
- It is recommended, that you save your image before every save/load operation in PowerSqueak
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
baseline
preLoad


"Fixes an invalid state, which is present in some versions of Squeak.
Required in order for Text scaling to work correctly"
(TextStyle named: 'BitstreamVeraSans') fontArray do: [:font |
font
instVarNamed: #derivatives
put: ((font instVarNamed: #derivatives) reject: [:ea | ea isKindOf: TTCFontSet])]
font
instVarNamed: #derivatives
put: ((font instVarNamed: #derivatives) reject: [:ea | ea isKindOf: TTCFontSet])]
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"instance" : {
"baseline:" : "LM 6/13/2018 13:41",
"postLoad" : "LM 6/13/2018 13:51",
"preLoad" : "WoC 5/28/2018 17:40" } }
"preLoad" : "LM 6/20/2018 18:45" } }
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ addContent: aMorph
position: aMorph position;
child: aMorph;
extent: aMorph extent;
addMorph: aMorph.
self addMouseCaptureFilter: self
addMorph: aMorph;
addMouseCaptureFilter: self
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
context menu
copyChildToHand

| copy |
copy := self child copy.
copy center: ActiveHand center.
ActiveHand grabMorph: copy.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ accessing
defaultContextMenuContent

^ #(
('grab' grabChild)
-
('delete' abandon)
-
('bring to front' comeToFront)
('send to back' goBehind)
-
('duplicate' copyChildToHand)
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
context menu
grabChild

self child center: ActiveHand position.
ActiveHand grabMorph: self child
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
scaling
notifySlideRescale: newExtent

(self child hasProperty: #acceptRescale) ifTrue: [self child rescale: newExtent]
(self child hasProperty: #acceptRescale)
ifTrue: [self child rescale: newExtent]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resizing
placeHandles

self resizeHandles withIndexDo: [:each :index |
self resizeHandles withIndexDo: [:each :index |
each center: (self corners at: index)]
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
"class" : {
"for:" : "MK 5/18/2018 16:30" },
"instance" : {
"addContent:" : "MK 6/1/2018 16:37",
"addContent:" : "LM 6/15/2018 19:11",
"addHandleAtPosition:withIndex:" : "MK 5/25/2018 17:37",
"addResizeHandles" : "MK 5/25/2018 17:39",
"child" : "MK 5/18/2018 20:03",
"child:" : "LM 5/21/2018 12:48",
"copyChildToHand" : "LM 6/17/2018 11:52",
"corners" : "MK 5/25/2018 17:11",
"createContextMenu" : "MK 6/1/2018 18:36",
"createContextMenu" : "LB 6/15/2018 21:42",
"createHandleAtPosition:withIndex:" : "MK 5/25/2018 17:37",
"defaultContextMenuContent" : "MK 6/1/2018 18:06",
"disablePresentationMode" : "MK 5/25/2018 16:12",
"defaultContextMenuContent" : "LM 6/17/2018 11:52",
"disablePresentationMode" : "WoC 6/17/2018 18:44",
"dragCorner:event:fromHandle:" : "MK 5/25/2018 17:10",
"enablePresentationMode" : "LM 6/8/2018 20:10",
"extent:" : "MK 5/25/2018 17:11",
Expand All @@ -20,6 +21,7 @@
"extentTopLeft:" : "MK 5/25/2018 17:12",
"extentTopRight:" : "MK 5/25/2018 17:12",
"filterEvent:for:" : "MK 6/1/2018 18:02",
"grabChild" : "LM 6/15/2018 16:32",
"handleLayerNumber" : "MK 5/25/2018 16:26",
"handlesMouseDown:" : "WoC 5/22/2018 19:48",
"hasHandles" : "MK 5/18/2018 19:42",
Expand All @@ -28,8 +30,8 @@
"initialize" : "MK 5/25/2018 17:10",
"layoutFractionsOf:" : "LB 5/22/2018 16:09",
"mouseDown:" : "MK 6/1/2018 16:25",
"notifySlideRescale:" : "LB 5/25/2018 16:42",
"placeHandles" : "MK 5/18/2018 20:16",
"notifySlideRescale:" : "LM 6/17/2018 19:02",
"placeHandles" : "WoC 6/17/2018 13:22",
"removeResizeHandles" : "MK 5/25/2018 16:18",
"removedMorph:" : "WoC 5/23/2018 18:40",
"resizeChild" : "MK 5/18/2018 20:03",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nil
for: aString

^ self new setContent: aString
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
active: anObject

active := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
active

^ active
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
content: anObject

content := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
content

^ content
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
defaultPadding

^ 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
fadingTime

^ 1500
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
initialize-release
initialize

super initialize.
self
content: StringMorph new;
addMorph: self content;
color: Color gray;
remaining: self fadingTime;
startStepping
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
testing
isActive

^ active
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
remaining: anObject

remaining := anObject
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
accessing
remaining

^ remaining
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
accessing
setContent: aString

self content contents: aString. "here no cascade because it fixes a presentation bug"
self bounds: (self content position corner: self content bottomRight + self defaultPadding).
self content center: self center.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
stepping and presenter
step

self remaining <= 0
ifTrue: [ self delete ]
ifFalse: [self updateColor]
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
stepping and presenter
stepTime

^ 10
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
stepping and presenter
updateColor

| alpha |
self remaining: self remaining - 10.
self remaining < 1000
ifTrue: [
alpha := remaining / 1000.0.
self color: (self color alpha: alpha)]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"class" : {
"for:" : "WoC 6/15/2018 17:24" },
"instance" : {
"active" : "WoC 6/15/2018 19:23",
"active:" : "WoC 6/15/2018 19:23",
"content" : "WoC 6/15/2018 17:21",
"content:" : "WoC 6/15/2018 17:21",
"defaultPadding" : "WoC 6/15/2018 17:31",
"fadingTime" : "WoC 6/15/2018 17:46",
"initialize" : "WoC 6/15/2018 19:23",
"isActive" : "WoC 6/15/2018 19:23",
"remaining" : "WoC 6/15/2018 17:41",
"remaining:" : "WoC 6/15/2018 17:41",
"setContent:" : "WoC 6/15/2018 18:13",
"step" : "WoC 6/15/2018 17:43",
"stepTime" : "WoC 6/15/2018 17:55",
"updateColor" : "WoC 6/15/2018 17:54" } }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"category" : "Presenter-Core",
"classinstvars" : [
],
"classvars" : [
],
"commentStamp" : "",
"instvars" : [
"remaining",
"content",
"active" ],
"name" : "PSFadingMessage",
"pools" : [
],
"super" : "Morph",
"type" : "normal" }
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
instance creation
open
open

^ ToolBuilder default open: self new
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
as yet unclassified
checkSlideDirectory: aDirectoryName

^ aDirectoryName matchesRegex: 'slide[0-9]+'
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ createSlide
newSlide := PSSlide new.
self slides add: newSlide afterIndex: self currentSlideNumber.
self selectSlide: self currentSlideNumber + 1.
"self updateSlideNumbers."
^ newSlide

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ deleteSlide: anIndex
(self slideAt: anIndex) abandon.
self slides removeAt: anIndex.
self currentSlideNumber >= anIndex ifTrue:
[self selectSlide: (self currentSlideNumber - 1 max: self minimumSlideCount)]
[self selectSlide: (self currentSlideNumber - 1 max: self minimumSlideCount)].

"self updateSlideNumbers "

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
do not touch
exportAsPNGs: name

(FileDirectory default / 'PSSlidePNGs' / name) assureExistence.
self enablePresentationMode.
self slideContainer enableNonInteractiveMode.
self slides withIndexDo: [:each :index |
self selectSlide: index.
World doOneCycle.
each exportAsPNGNamed: 'PSSlidePNGs\', name, '\slide',index,'.png'].
self disablePresentationMode
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,7 @@ isValidPresentationDirectory: aDirectory

| slidesDirectory |
slidesDirectory := aDirectory / self slidesDirectoryName.
^ slidesDirectory exists and: [slidesDirectory directoryNames isEmpty not]
^ slidesDirectory exists
and: [slidesDirectory directoryNames isEmpty not]
and: [slidesDirectory directoryNames allSatisfy: [:each |
self checkSlideDirectory: each]]
Loading

0 comments on commit 5aac655

Please sign in to comment.