If we could add on support for "simple applets" (applets that only use gtk and do no direct cario drawing) that would be great. I can think of several applets where the only cairo drawing necessary would be an applet frame. (E.g. a terminal applet.)
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
Suggested implementation:
*Add on an attribute called "use_frame" or "use_border." If it's set to true then let the AppletContainer decide to draw a draggable frame around the applet or not. The frame can be an svg (or maybe four of them for top, bottom, left, right) from the screenlet's Theme directory.
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
*The above would be useful because we don't always want to draw a frame. E.g. A Universal Applet displayed in an AwnDialog or a sidebar shouldn't have its own frame.
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
Summary of how applet drawing should be handled:
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
*An applet's content should contained in a Gtk.Widget called screenlet._content that is not of type Gtk.Window. screenlet._content should probably either be a Gtk.Container or something like screenlet.ShapedWidget (a widget that is based on Gtk.DrawingArea).
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
*A new class, AppletContainer, should be responsible for loading a single screenlet and displaying it.
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
*Applets don't really *need* to have a special screenlet._icon. If the screenlet._content is scaled down beneath a certain size then the applet can use screenlet._content to display the type of information that would be expected of an icon. (e.g. for an email applet this would be an icon with the number of emails on it instead of a list of emails.)
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
*Even though we don't *really* need to have a seperate icon (see above), there are times when it may make sense to keep track of both an icon sized and a regular sized screenlet._content. We would only do this when we want to display an icon sized preview and the full sized content at the same time. We may or may not want to do that in Awn. (See below.)
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
*Applets should be able to be displayed anywhere in any Gtk app. In regard to Awn, they should be able to be displayed in the bar as a normal screenlet (which may show icon like content depending on the size). If you click on the icon then it should either show a larger version in an AwnDialog (in which case we would need to keep track of both screenlet._icon and screenlet._content) or it should popout the icon into a fullsized screenlet. (See the mockup video that's linked to above.)
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
@Whise: I've found an example of why setting per-instance attributes in the class is a bad idea. (See my post on the compiz fusion forums.) Open up two Google Maps screenlets at the same time and you'll see what I mean. (The bug could be because of something else, but I don't think it is.)
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)