Charlie Brej
42fe12b9fc
[script] Remove some derefs as they are now handled in the access functions
2009-07-24 09:30:27 -04:00
Charlie Brej
32e0487d5e
[script] More changes to use access functions
2009-07-24 09:30:26 -04:00
Charlie Brej
41ebc5f630
[script] Use hash access functions rather than doing lookups directly
2009-07-24 09:30:26 -04:00
Charlie Brej
da38f5a6b9
[script] Use access functions instead of directly accessing function objects
2009-07-24 09:30:26 -04:00
Charlie Brej
9c7e45c349
[script] Abstract formations of script_return_t with helper functions
2009-07-24 09:30:25 -04:00
Charlie Brej
36186e407a
[script] Simplify object comparisons
...
Also removes many -Wextra warnings
2009-07-24 09:30:25 -04:00
Charlie Brej
74388bca11
[script] Typo in the MathMax function
2009-07-24 09:30:25 -04:00
Charlie Brej
2b62c964bc
[script] Fix some compile warnings
...
Fixed by making most plugin functions static as they dont get linked from
outside anyway. Also changed some char* to const char*.
2009-07-24 09:30:24 -04:00
Charlie Brej
d32a075e7a
[script] Correct the math min and max functions
...
Were the wrong way round and confusingly written. Also adds a MathPi constant.
2009-07-24 09:30:24 -04:00
Charlie Brej
1a4e3372fa
[script] Add atan2 to the math library
2009-07-24 09:30:23 -04:00
Charlie Brej
d167bd0e96
[script] Add "_t" to all struct names
2009-07-24 09:30:23 -04:00
Charlie Brej
e50ef7aacc
[script] Corrected indentation and formatting to match the rest of the project
...
Uncrustify did a reasonable job and only needed minor fixups.
2009-07-24 09:30:23 -04:00
Charlie Brej
a36d61d12a
[script] Add GPL 2+ licence headers to all .c and .h files
2009-07-24 09:30:22 -04:00
Charlie Brej
bf27872518
[script] Remove the display state as it is now handled by the script
2009-07-24 09:30:22 -04:00
Charlie Brej
9b941402fb
[script] Fix minor memory leaks
2009-07-24 09:30:22 -04:00
Charlie Brej
f0ca590f14
[script] Free any remaining over sprites at plugin destroy
2009-07-24 09:30:21 -04:00
Charlie Brej
f5b7a7c814
[script] Simplify native functions by using the hash-cast access functions
2009-07-24 09:30:21 -04:00
Charlie Brej
c44fcbb6df
[script] Use the helper hash element extraction functions
...
This should simplify the code a little as it removes the need to play with
objects which must be unreffed.
2009-07-24 09:30:20 -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
3a24c86b31
[script] Simplify the object operations
...
Using nested switch statements made it easy to decide what to do in each
situation but this is rather verbose and causes -Wextra to complain (a lot).
Also added script_obj_is_[type] to help identify object easier and not repeat
code.
2009-07-24 09:30:19 -04:00
Charlie Brej
4a82c35e4a
[script] Add modify assignments (+=, *= ...)
...
Adds the following modify assignments: +=, -=, *=, /=, %=
2009-07-24 09:30:19 -04:00
Charlie Brej
a99a8a27c9
[script] Move object operating functions to script-object to avoid repetition
2009-07-24 09:30:19 -04:00
Charlie Brej
a11fac81f6
[script] Fix bug of assigning a var to itself (e.g. val = val;)
...
Problem was that the var is cleared before being re-assigned, which also clears
the value we were about to write into it.
2009-07-24 09:30:18 -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
370e0522f0
[script] Add support for image scale
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
156d12b87a
[script] Add support for an "else" after an "if"
2009-07-24 09:30:16 -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
a3b9e728c6
[script] Added a turn float to integer function to the math library
2009-07-24 09:30:15 -04:00
Charlie Brej
985a3c030e
[script] Deref the state to allow local and global to be reassigned
...
This should allow local and global to be assigned to a different vareable.
This is discouriged as it may cause asserts to fail, but may be useful to save
current state and continue the function at a later time.
2009-07-24 09:30:15 -04:00
Charlie Brej
8786b2eba6
[script] Handle -0 in float comparisons correctly
2009-07-24 09:30:15 -04:00
Charlie Brej
4a6ba0212e
[script] Add simple Math functions (abs, min, max and clamp)
2009-07-24 09:30:14 -04:00
Charlie Brej
76666c2955
[script] Remember the width and height of old sprite image for next refresh
...
When we change the sprite image, the redraw now remembers to refresh the old
area despite any change in the image size.
2009-07-24 09:30:14 -04:00
Charlie Brej
83c8977e34
[script] Refresh the part of the screen that a sprite was on when removing
...
When a sprite is destroyed, this should now refresh the area the sprite was
occupying.
2009-07-24 09:30:13 -04:00
Charlie Brej
e7fad23f70
[script] Creating a string object with a NULL string now returns a NULL object
...
Strings in C are often set to NULL to signify that they have not been set. This
should be carried through to the script system rather than failing at the
conversion.
2009-07-24 09:30:13 -04:00
Charlie Brej
5df19c2b1b
[script] Free the functions, in the script lib plymouth, when library is freed
2009-07-24 09:30:13 -04:00
Charlie Brej
b3496bd54a
[script] add sprite opacity control
...
SpriteSetOpacity sets the opacity of the sprite. Also a couple fixups to
refresh when the image has been changed.
2009-07-24 09:30:12 -04:00
Charlie Brej
58e51c4302
[script] Add cos, sin, tan and square root functions to the script math library
2009-07-24 09:30:12 -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
b2e08f4968
[script] Correctly parse multiple parameter functions and allow dangeling comma
...
Typo was causing parsing errors.
2009-07-24 09:30:11 -04:00
Charlie Brej
7901df33f9
[script] Don't error on object unref of NULL
...
This follows the usage of free with a NULL as well as ply-image etc.
2009-07-24 09:30:11 -04:00
Charlie Brej
9af3a9d3db
[script] Rationalize function calls and callbacks
...
Allows script functions to be executed without extracting the body of the
function and executing that. This makes implementing callbacks simpler and
enables passing of parameters.
2009-07-24 09:30:10 -04:00
Charlie Brej
0892d0c66a
[script] Output error mesages when parsing files
...
The parses should now produce useful error messages of syntax errors in the
parsed files. This is not a 100% coverage but at least it now gives an error
with a line number rather than just an assert and a crash.
2009-07-24 09:30:10 -04:00
Charlie Brej
3dff5d2b4f
[scan] Correct character index calculation
...
Index should point to the coordinate before the character and not after.
2009-07-24 09:30:10 -04:00
Charlie Brej
8b32ab721c
[scan] Remember the line and column number of tokens
...
This is useful for scan and parse error reporting. The first column is zero but
this can be changed. Nedit and Emacs say zero, gedit says 1 and Vi says "0-1".
2009-07-24 09:30:09 -04:00
Charlie Brej
6f307ed7b4
[scan] Add error reporting to the scanner
...
The canner now returs error tokens when strings or comments are not correctly
terminated.
2009-07-24 09:30:09 -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