You are not logged in.
This is a code request for an idea I've had for a while now - a sort of interactive program that can display pictures on the desktop but also responds to click events. This would open up endless interaction possibilities.
How it works:
* The application supports one window per instance, to reduce confusion and code complexity. For more windows, spawn more instances (like people do with Conky).
* The window has appropriate hints set on it so the windowmanager doesn't let you move it around the desktop (including by way of alt+drag), it has no titlebar, xcompmgr doesn't try to put a shadow around its frame, and so on. And its Z-Index is set such that it's "bound" to the desktop and can't be focused "higher" than the root window.
* Uses doublebuffering to reduce flicker.
* You communicate with it over a named pipe, which you specify the name of at launch. The named pipe lets you connect and send the following commands (questions are surrounded with *asterisks*):
LOAD /path/to/file.cfg
Clears the configuration and window tree and loads /path/to/file.cfg. When
the entire file has been read and enumerated, and the result rendered, the
window is redrawn once. This can be used as the --load parameter on the
commandline to load a script without having to touch the socket, or in the
socket to load a new or modified file (whether manually or by a script).
The configuration file can contain any of the commands that are listed in
this section.
QUIT
Causes the app to quit after disconnecting the other end of the named
pipe. *Should this remove the named pipe when it's done?*
WINDOW x y width height
(Re)sizes the window and places it at the x, y point on the screen.
Note that this cannot create new windows; it simply specifies the initial size
of the window at startup. *Like Conky, should the window use a default
size/position or throw errors and prevent objects from being created in the
window if this command hasn't yet been run at least once?*
BUTTON name normal.png pressed.png hover.png 0 1
Creates and shows a button with name 'name'. The "hover.png" image is optional,
and if omitted shows the same image as "normal.png" when the mouse is over the
button. The first digit specifies whether to recieve mousemove events when
it's over the button, and the 2nd specifies whether to recieve "extended"
click events. By default, the socket sends "CLICK name" when the "name" button
has been clicked with the left mouse button and nothing else, and turning
"extended" click events on allows whatever is on the other end of the pipe to
listen for click events from all registered mouse buttons.
IMAGE image.png x y
Reads in image.png, shows it at the x, y position in the window, then unloads
the image data from memory (leaving the already-drawn image in the buffer).
AREA x y width height 1 1
A mutant subset of BUTTON - without actually showing anything, create an
"active" area on the form that, just like the button, can be specified to
both send mousemove events and "extended" click events.
TEXT x y fontname #hexfgcolor #hexbgcolor 0 string string string string string
string string string string string...
Draw "string string string string string string string string string string"... at x, y
using the font "fontname" (can be "xft:fontname" for XFT fonts) using #hexfgcolor
for the foreground and #hexbgcolor for the background (use -1 to make this
transparent (*unless you have any better ideas?*)). The digit specifies whether
the font should be antialiased - this only works with XFT fonts, and is ignored
if a non-XFT font is specified.
Conflicts:
* If a BUTTON, IMAGE or AREA overlaps, for example if two AREAs overlap each other, both objects should be sent events (ie mousemove or click events) when the mouse is in the overlapping region.
That just about covers everything I'd personally want this to do.
Feel free to add ideas, concepts, comments, or even... code
And if you know of any application that fulfills the ability to at least configure and set up a window the windowmanager decides can't be moved around the desktop and load PNGs fast, please do tell me.
PLEASE NOTE: I currently run no applications written in scripting languages 24/7. I believe scripting languages are good for a process that happens in a transient manner, and prefer applications like the one described in this post - things I'll use pretty much every day - to be written in a compiled language, although this doesn't necessarily mean C.
-dav7
Last edited by dav7 (2008-09-19 02:43:38)
Windows was made for looking at success from a distance through a wall of oversimplicity. Linux removes the wall, so you can just walk up to success and make it your own.
--
Reinventing the wheel is fun. You get to redefine pi.
Offline