Commit graph

23 commits

Author SHA1 Message Date
Ray Strode
2c482f2350 script: only support one message at a time
That's the other themes do, and callers
expect it.
2016-05-20 16:40:08 -04:00
Charlie Brej
e50ece1f70 script: Implement hide message function in the example script theme
This leaves ugly spaces where messages used to be, but is simple.
2010-09-07 22:22:08 +01:00
Charlie Brej
d28ff94b69 [script] Update default script to use the window X and Y offsets every time
Previously the code was assuming the windows were placed at 0,0. This might not
be the case and the window X and Y values should be used when trying to
position items relative to a window.

This change needs to be applied to all other scripts otherwise mutiple screen
setups may have unaligned elements. Updates scripts should be tested using
multi-head test systems or the x11 test renderer.
2010-03-22 23:39:32 +00:00
Charlie Brej
57fb558046 [script] Add text to image capability
Enables scripts to display test by converting it into an image. This can then
be shown using a sprite. Function takes a string and the value of the three
colors (red green blue).

new_image = Image.Text("text we want", 1.0, 0.0, 0.0); // gives red text image
2009-11-21 17:45:41 +00:00
Charles Brej
a086ae755b [script] Convert example script functions to use objects
The example script had some old style function names. These still work due to
the compatibility translations, but are not recommended in new code.
2009-10-29 13:36:27 +00:00
Charlie Brej
36a1b35570 [script] Add an "on quit" callback to scripted themes
The callback is called before the final sprite refresh and quit. This allows
the theme to tidy up the screen before handing over to the X fade and the
destop manager.
2009-10-28 20:11:47 +00:00
Charlie Brej
d8156feb0d [script] Example script rewritten to use the object system 2009-09-09 21:27:39 +01:00
Frederic Crozat
9da0276853 [script] use dialog instead of dialogue 2009-08-25 15:59:30 +02:00
Frederic Crozat
fc2cbc497a [script] Display password dialog even if called twice 2009-08-18 19:19:13 +02:00
Charlie Brej
bc0d731e6f [script] Tidy up the example script
Removes the spinfinity function as it used an ugly ../ path to get the images
and assumed that spinfinity was installed.
Removes some elements which were only inserted for testing.
2009-07-24 09:30:31 -04:00
Charlie Brej
25fa788801 [script] Add support for setting the window background color
Two functions set the color of either the bottom or the top of the screen. If
the two colors are equal a solid colour draw is used. The color is supplied by
three floats specitying red green and blue elements.
2009-07-24 09:30:20 -04:00
Charlie Brej
3ffc473b96 [script] Add support for getting the window width and height
The example script has been updated to use this as well as to use other
features recently committed.
2009-07-24 09:30:20 -04:00
Charlie Brej
cf730d7b07 [script] Add an example progress bar to the example script 2009-07-24 09:30:18 -04:00
Charlie Brej
c9831c9dfa [script] Implement script based fade_in implementation
The example script now can show a spinfinity or a fade_in behaviour. This is
just to see how easy it is to implement current plugins. In the case of fade_in
it is around 23 lines of script code
2009-07-24 09:30:17 -04:00
Charlie Brej
bb4ed684b8 [script] Add support for 'for'
Matches the use in C as "for (first, condition, last)" where first is executed
once, last is executed at the end of each iteration (even when continue is
executed) and condition is tested at the start of every cycle.
2009-07-24 09:30:17 -04:00
Charlie Brej
e0774cc8f1 [script] Add support for loading the system logo image
This is done specifying the filename is special://logo. Not sure if this is the
best way of implementing but it is expandable to other special files.
2009-07-24 09:30:16 -04:00
Charlie Brej
d7fa520a77 [script] Add support for the password dialogue in the example script theme 2009-07-24 09:30:16 -04:00
Charlie Brej
a316d77674 [script] Allow scripts to attach themselves to plymouth plugin callbacks
The scripts can now attach themselves to the following callbacks: refresh,
boot_progress, root_mounted, keyboard_input, update_status, display_normal,
display_password and display_question.
2009-07-24 09:30:12 -04:00
Charlie Brej
6257228266 [scan] Add block comments
Treats "/*" and "*/" as block comment markers. Block comments may be nested.
There is a bug where if a comment or a string is not terminated before the end
of a file, the scanner deadlocks. Need to add a way or reporting scanner
errors to the parser.
2009-07-24 09:30:09 -04:00
Charlie Brej
67b8703dd6 [scan] Add parsing of line comments
These are currently hard coded to '//' and '#'. The code is there to return
them to the caller but currently they are thrown away.
Should add a skip_comments option and allow customisable markers.
2009-07-24 09:30:08 -04:00
Charlie Brej
8c9f902ecc [script] Add support for script image rotation
An image rotate operation creates a new image with the same dimensions but with
the contents rotated by an angle around the centre of the image. Also added a
script object to float function to allow this.
2009-07-24 09:30:07 -04:00
Charlie Brej
bccf288229 [script] Add support for unary operations (!/+/-/++/--)
Allows execution of unary operations: Pre/postfix inc/decrement, logical
negation and unary plus/minus.

The writebacks of increment/decrements happen during the execution of the
expression, unlike C where they are executed after the line if executed. This
is the case simply because it is simpler to execute this way.
2009-07-24 09:30:07 -04:00
Charlie Brej
5ea8be95ab Initial scripted plugin support
This is an initial support for the scripted plugin. There are _many_ FIXMEs
and the whole code is reather unstable. The formatting is completely incorrect
and will be changed soon. There are scripts which are converted using a perl
to an C embeddable string.
2009-07-24 09:30:05 -04:00