Awn

Applet Framework

Registered by aarobone

Redesigning the applet framework to support gobject's inheritance mechanism. This will change the hook function that all applets use to register with the system.

Blueprint information

Status:
Complete
Approver:
Neil J. Patel
Priority:
Essential
Drafter:
aarobone
Direction:
Needs approval
Assignee:
aarobone
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
aarobone
Completed by
aarobone

Related branches

Sprints

Whiteboard

The new applet hook function signature will look like this:

AwnApplet* awn_applet_factory_init( gchar* uid, gint orient, gint height );

Your applet's implementation of this function will be responsible for creating itself and returning itself so it can be added to the AWN dock. Your applet will be required to extend AwnApplet via the GObject way.

Simple Example (non-inheritance way):

AwnApplet* awn_applet_factory_init ( gchar* uid, gint orient, gint height ) {
    AwnApplet *applet = awn_applet_new( uid, orient, height );
    gtk_widget_set_size_request (GTK_WIDGET (applet), 5, height * 2);

    g_signal_connect (G_OBJECT (applet), "expose-event", G_CALLBACK (expose), NULL);

    return applet;
}

static gboolean expose (GtkWidget *widget, GdkEventExpose *event, gpointer null) {
    cairo_t *cr = NULL;

    cr = gdk_cairo_create (widget->window);
    if (!cr)
            return FALSE;

    /* Clear the background to transparent */
    cairo_set_source_rgba (cr, 1.0f, 1.0f, 1.0f, 0.0f);
    cairo_set_operator (cr, CAIRO_OPERATOR_CLEAR);
    cairo_paint (cr);

    /* Clean up */
    cairo_destroy (cr);

    return TRUE;
}

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.