Commit graph

889 commits

Author SHA1 Message Date
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
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
d86416e23b [script] Ensure two character operators have no space between characters
Checks whitespace before the second token is zero.
2009-07-24 09:30:08 -04:00
Charlie Brej
583dd45be2 [scan] Remember white space between tokens
Tokens now contain the number of white space characters since the last token.
This is useful in situations where white space between symbols changes the
meaning (e.g. a++ vs. a+ +).
2009-07-24 09:30:07 -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
efb543e294 [script] Free the main script after freeing the state
There are links from the script state to parsed script data. Destroy the parsed
data after freeing the state.

This should be done properly with more ref counting or moving the freeme var to
the linking structure.
2009-07-24 09:30:07 -04:00
Charlie Brej
f66f6078c1 [script] Dereference on assign without affecting refcount
Assigns were incorrectly dereferencing creating an incorrect refcount.
2009-07-24 09:30:06 -04:00
Charlie Brej
cf8c99c38f [script] Add support for logical AND and OR
Allows the use of "&&" and "||". These are evaluated lazily and return the
evaluated sub-value which completed the operation rather than a bool. It allows
things like:

reply = cache_lookup(index) || slow_lookup(index);

If cache_lookup returns a false value (NULL, or 0) then slow_lookup is executed
and its result is placed in reply. Otherwise the result from cache_lookup is
used.
2009-07-24 09:30:05 -04:00
Charlie Brej
02e878a728 [script] Add support for floats
Adds parsing and execution support for floats. Some operations upgrade ints to
floats with no way of turning them back to ints.
2009-07-24 09:30:05 -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
Charlie Brej
fc2d96de67 [utils] Add utf-8 support functions to determine character and string length
These are used to feed the keyboard input a single character at a time, to
determine the number of bullets in the password dialogue and process backspaes.
2009-07-15 11:30:19 +01:00
Charlie Brej
f6da5d5aeb [frame-buffer] Unroll gradient drawing loop
When drawing the gradient, rather than creating each dithered pixel, a block
of 8 pixels is created and copied repeatedly to the target. So long as the
number of noise bits is low and the random number generator is good, no
repetition is visible.
2009-06-18 15:31:36 +01:00
Charlie Brej
5232df3238 [frame-buffer] Use a simpler pseudo-random number generator for gradient noise
In some plugins about 80% of time is spent in the random number generation
functions. These are used to create the dithering noise to stop the banding in
the gradient functions.

The simpler version is an adaptation of a linear feedback register which
creates a pseudo random sequence repeating every 4,194,303 generations.
2009-06-18 14:55:51 +01:00
Charlie Brej
1230d1d3ec [frame-buffer] Make additions to the areas to flush non-overlapping
When adding areas to be flushed, the algorithm now looks for partial overlap
with existing areas and if found it either: throws away an area as it is fully
overlapped, reduces the area to remove the overlap or breaks the area into two
skirt around the area already in the list.

The algorithm does does not scale particularly well when there are more than 30
areas stacked with each being partly (but not fully) overlapped by others. This
creates a large list of small areas to check against which could eventually
become counter productive.
2009-06-17 15:22:42 +01:00
Ray Strode
bed202ac28 [frame-buffer] Discard overlapping flush areas
One advantage of the previous bounding box approach to flushing
is overlapping flush areas wouldn't get flushed multiple times.

This commit tries to identify overlapping flush areas and eliminate
them. It's not perfect though.

A better approach might be to store a sorted tree of areas to be
flushed, and walk the tree when adding new flush areas to quickly find
overlapping areas. Then we'd split each area into two or more new areas
to avoid overlaps.
2009-06-11 23:37:03 -04:00
Ray Strode
a741222aca [frame-buffer] Track multiple flush areas
Previously we would always aggregate flush areas together even
if they were disjoint and far apart.  That meant that if two
images on opposites sides of the screen were updated in one
frame, then the entire screen would get redrawn.

We now track flush areas in a list, instead of a bounding box.
2009-06-11 23:18:30 -04:00
Ray Strode
ffec2f1e67 [frame-buffer] Rework flush interface to take area
Before this commit it would always flush the area_to_flush
area. Now the interface allows flushing arbitrary areas. This
change paves the way for us to flush multiple disjoint areas
at one time.
2009-06-11 22:49:32 -04:00
Ray Strode
6f08a84681 [splash] Add theme source files to EXTRA_DIST
They weren't making it into the dist'd tarball
2009-05-20 17:27:54 -04:00
Charlie Brej
e205883286 [solar] pull trigger right away if idle
The idle_trigger was not being pulled in the solar plugin which causes the
system to deadlock on quit and plymouthd never exits.
2009-05-20 17:27:54 -04:00
Ray Strode
eed536ba54 [two-step] pull trigger right away if already idle
The trigger always needs to get pulled so that the
daemon knows that it can quit.  Previously, we weren't
pulling it if two-step was already idle.  This meant that
plymouthd never quit.
2009-05-20 17:27:54 -04:00
Ray Strode
ffc3dda9c5 [two-step] Clean up animation when stopping 2009-05-20 17:27:54 -04:00
Ray Strode
9d9892f395 [two-step] Always finish 2nd step before quitting
Previously, we'd cut short in the middle of a very short animation.
2009-05-20 17:27:53 -04:00
Ray Strode
3df0f12602 [daemon] Tell splash to become idle before quitting
This allows it to, e.g., finish up its current round of animations or
fade out the progress bar or whatever.
2009-05-20 17:27:53 -04:00
Charlie Brej
c03d816ebe [two-step] Add merge-fade as a progress animation transition type
The merge fade merges the two frames before drawing them to the framebuffer.
This makes a smooth transition between areas with partly transparent pixels or
areas in later frames becoming trasparent. This is set as the default on the
"glow" theme.
2009-05-20 17:27:53 -04:00
Ray Strode
e4e91bad03 [glow] Add fade between frames in glow theme 2009-05-20 17:27:53 -04:00
Ray Strode
1d835fa552 [two-step] Add fade to progress animation
One issue with the two-step plugin is that during the initial boot
progress the frames can be updated several seconds apart from each
other.  This can look jumpy.  We can now optionally fade between
the frames to make the experience be a little smoother.
2009-05-20 17:27:53 -04:00
Ray Strode
bb19232b41 [two-step] Add support for a "corner image"
This is so the OLPC theme can have a
"Powered by blah" logo in the corner of the screen.
2009-05-20 17:27:53 -04:00
Ray Strode
d35ec8bd03 [two-step] Pull background color from theme
The OLPC theme looks best when it's white, so we need to be able to
specify the background color from the theme.  If the theme doesn't
specify a background color, we fall back to the old behavior of using
the distro default.
2009-05-20 17:27:53 -04:00
Ray Strode
c9e00b603e [splash] Rename fade-in plugin to fade-throbber
We're trying to keep a distinction between
plugin and theme.
2009-05-20 17:27:53 -04:00
Ray Strode
c56ce86f78 [splash] Rename solar plugin to space-flares
We're trying to keep a distinction between
plugin and theme.
2009-05-20 17:27:53 -04:00
Ray Strode
3cd5b5f2e0 [splash] Rename spinfinity plugin to throbgress
It's the theme that makes it spinfinity,
not the plugin.  The plugin is more generic.
2009-05-20 17:27:53 -04:00
Ray Strode
e2ed2b9812 [splash] Rename glow plugin to two-step
Now the "glow" theme is just one possible manifestation of the
"two-step" plugin.
2009-05-20 17:27:52 -04:00
Ray Strode
d974256b2f [splash] Drop pulser plugin
It's ugly and doesn't pass the quality sniff test.
2009-05-20 17:27:52 -04:00
Ray Strode
6acf834f1e [splash] Split splashes into plugins and themes
Some of the plugins (well, the glow plugin) would be a lot more
versatile if they could be reused for multiple splashes with different
images.

This commit splits boot splashes into two parts, the plugin engine which
does all the dirty work, and the theme which says which plugin to use
and optionally how the plugin should work (using plugin specific
key/value pairs)
2009-05-20 17:27:52 -04:00
Charlie Brej
a4b8ec711a [key-file] Use hashtables instead of lists
Not really any performance advantage but it makes the code a little simpler.
2009-05-20 17:27:52 -04:00
Ray Strode
f74090a5bb [libply] Add new keyfile class
This is a very lame keyfile parser.  We'll be able to use it to load
some metadata about the plugins.

The idea is that plugins will shift to being engines that can be
leveraged from multiple splash themes.  This way, for instance, the glow
plugin (which will be renamed) can be used to implement several
splashes.
2009-05-20 17:27:52 -04:00
Ray Strode
03139ac838 [window] Don't force text mode if debugging is on
It's not that much more work to hit ctrl-t, and now
that we log messages to plymouth-crash.log it's a lot
less useful to see them on screen.
2009-05-20 17:27:52 -04:00
Charlie Brej
d45a6e4915 [daemon] Update tests to include compile correctly
Adds ply-list.c/h to all tests automake files which use ply-logger.c.
Adds PLYMOUTH_TIME_DIRECTORY/PLUGIN/THEME_PATH when ply-boot-splash.c is used.
Adds PLY_BOOT_SPLASH_MODE_BOOT_UP to the ply_boot_splash_show call.
2009-05-20 17:27:52 -04:00
Charlie Brej
1f7e2c0772 [daemon] Free the debug buffer only after printing the last trace message
Was segfaulting or printing failed assertios just before exitting.
2009-05-20 17:27:52 -04:00
Ray Strode
77dbc07593 [daemon] Dump log to plymouth-crash.log on crash
This will be useful for debug purposes.

It's implemented by adding the concept of
"filters" to the logger code.  Each time a message
is logged it is passed through all registered
filter handlers and then the output of the filters
are what is actually logged.

In this case, we pass the messages through verbatim,
but also redirect them to a debug buffer.

We only do this redirection when plymouth:debug is
used.
2009-05-20 17:27:51 -04:00
Ray Strode
4596395fe6 [throbber] Fix call to remove_frames
ply-throbber was passing in the frames directly
instead of the throbber object
2009-05-20 17:27:41 -04:00
Ray Strode
fd0fda1b82 [animation] Fix call to remove_frames
ply-animation was passing in the frames directly
instead of the animation object
2009-05-20 17:00:28 -04:00
Ray Strode
8be743e8cd [progress-animation] Fix call to remove_frames
ply-progress-animation was passing in the frames directly instead of the
progress object
2009-05-20 17:00:28 -04:00
Ray Strode
79baa323e6 [event-loop] Don't crash by running removed timeouts
We used to run and remove timeouts in a loop.  This
breaks the case where the dispatched timeout handler
removes the timeout itself.

We fix it by making timeout handling a two pass thing.
First we find which handlers need to be dispatched,
and move them to their own list.  Then we run through
the new list and dispatch the handlers.
2009-05-20 17:00:27 -04:00
Ray Strode
d5948e5a91 Switch to tty 63 on shutdown
This is less than ideal, but side-steps weird interactions
between init, X, and plymouth.
2009-05-07 23:43:46 -04:00
Ray Strode
841068ba12 Hang around until killed by init at shutdown
init does two rounds of killing at shutdown:
a round of SIGTERMs and a round of SIGKILLs.

We want to stay alive until the SIGKILL round
so we ignore the SIGTERM signal.
2009-05-07 14:46:03 -04:00
Ray Strode
8124531ef1 Pass the mode plymouthd is running to splashes
We don't want to show progress bars and things for
shutdown, so pass the mode to the plugins so they can
just do a static image.
2009-05-07 14:38:50 -04:00
Ray Strode
81cea28b40 Add stub INSTALL file 2009-05-02 01:10:19 -04:00