See README for a tutorial-like introduction.


xsw Reference
*************

# This is a comment
#
image_path: "~/myimages"

template: NAME
  - [commands...]
  - CUSTOM_COMMAND: [text_parameters]

slide: [template]
  - "my string" [text_parameters]
  - text: "my string" [text_parameters]
  - image: "image_path.jpg" [image_parameters]
  - background: "image_path.jpg" [background_parameters]
  - [CUSTOM_COMMAND]: "my string"

Every minus sign (-) is a new command to be executed. A plus sign (+) in a text
command means the parameters will be copied from the previous command - this
can be used to write multiple lines of text.


Commands and Parameters
***********************

comments
--------
Everything that starts with a "#" is considered a comment and is ignored by
the program. Comments can start in the middle of the line.

image_path
----------
Gives xsw a image path, where it'll look for images. For example,

image_path: "~/myimages"
slide:
  - image: "test.jpg"

will look for test.jpg in the current directory. If not found, it'll look in
~/myimages.

text (or nothing)
-----------------
The text command writes a text on the screen. The parameters are:

     x: the horizontal position (0~100, default: 4)
     y: the vertical position (0~75, default: 3)
     h: vertical space between lines (default: one line, defined by the font)
  size: font size (default: 36)
  font: font face, must be one of: sans, serif or mono (default: sans)
 style: font style, must be one of: nostyle, italic (default: nostyle)
 align: alignment of the x position, must be one of: left, center, right 
        (default: left)
 color: the color of the text. Default: white. See "Colors" section.
border: the border color of the text. Can be a color or `none` for no border. 
        Default: black.

The keyword "text" is not necessary.

image (or img)
--------------
The image command pastes a image on the screen. The parameters are:

     x: the horizontal position (0~100, default: 4). Negative values can be 
        used.
     y: the vertical position (0~75, default: 3)
 scale: the image zoom, 1 being 100% (default: 1). Values higher than 1 make
        the image grow, values less than 1 make the image shrink (ex: 0.4)

background (or bg)
------------------
Similar to the image command, but automatically scale the image to the screen
size. The parameters are:

      x: the horizontal position (0~100, default: 0). It can be used to move the
         background image. Negative values can be used.
      y: the vertical position (0~75, default: 0)
 expand: this parameters defines what happens when the aspect ration of the 
         image is not the same as the screen. If horizontal is chosen, the
         left and right sides of the image will be anchored with the left and
         right side of the screen. (default: vertical)

The background can also be used to display a color, such as `background: pink`. 
The default background is black. In this case, the following parameters can be 
used:

 gradient: a color to display a vertical gradient. The default is the same color 
           as the background (that is - no gradient).||

See "Colors" section for more information.

Templates
*********

Templates can be used to write a slide layout that is used by many slides in 
the presentation. It's similar to what MS PowerPoint calls "master slide".

Example:

    template: mytemplate
      - background: "mylogo.jpg"

    slide: mytemplate
      - text: "Title"

In this case, the slide will be created with the mylogo.jpg background. Any
number of templates can be created and used on any number of slides.

A template can also contain a custom command. This can be used to create a text
that'll have the same properties in all slides. Example:

    template: mytemplate
      - title: x:50 y:10 align:center

    slide: mytemplate
      - title: "My Title"

In this case, a "title" command is created containing some parameters (but not
a text). The text is referenced in the first slide.

A template can also be referenced from another slide, such as this:

    template: mycompany
      - background: "logo.png"

    template: cover mycompany
      - title: x:50 y:10 align:center

    slide: cover
      - title: "My Company"


Colors
******

Colors can be referred to in two ways: by their code or by their name.

By code
-------
Colors can be referred by code, such as this: $FF00FF (this is pink). It's just
like the HTML color standard, except that it uses the character $ instead of #.

By name
-------

Colors can by used by name, using the colors defined in the file 
/usr/share/X11/rgb.txt. The color names follow these rules:

 * the names are case sensitive
 * when there's only one word, it's all lowercase: black, white, orange
 * when there are two words, it's CamelCase: DarkBlue, ForestGreen

Here are two useful color lists:

 * http://www.farb-tabelle.de/en/table-of-color.htm
 * http://www.graphviz.org/doc/info/colors.html (case sensitivity is different 
   from xsw)


Running the program
*******************

The program can be run as:

$ xsw mypresentation.xsw

A "-l" option opens the presentation in the last slide. This can be used to
speed up development, as usually the user is editing the last slide.

The following keys can be used during the presentation:

 - RIGHT / PAGE DOWN: go to the next slide
 - LEFT / PAGE UP: go to the previous slide
 - HOME: go to the first slide
 - END: go to the last slide
 - F: full screen
 - Ctrl+D: developer mode
 - Q: quits presentation
