AWN API

From AWN Wiki

Jump to: navigation, search

Contents

[edit] API

Note: This page describes API available in Awn 0.4.

The easiest way to browse the documentation on your computer is to install the libawn-doc package and browse the documentation using devhelp. But you can browse the API also [online].

If you're using any of libdesktop-agnostic methods, you might want to look at its [documentation].

[edit] Python Applet API

Make sure to see Python Applet Development for a quick introduction to creating applets and Example Python Applet for a well-commented example applet. Also note that AWNLib wraps around the AWN API and provides a different, more python-friendly interface to it. It is up to applet developers if they want to use this wrapper.

[edit] AWN Module

All the C API functions are available also in python, but with slightly different naming conventions: for example AwnAppletSimple -> awn.AppletSimple and for methods: awn_applet_simple_set_icon_name() -> applet_simple.set_icon_name(). Here's a list of extra python functions, which aren't part of the C API.

import awn
Imports the AWN module and gives you access the the applet API.

awn.init(sys.argv[1:])
Initiates a new applet.

awn.uid, awn.panel_id
These values should be passed to the awn.AppletSimple constructor.

awn.embed_applet
Finishes initialization of the applet and displays it. Should be passed a single parameter that is an object of type awn.Applet (or, usually, a class that inherits from awn.AppletSimple).

[edit] Proposed New/Revised APIs

A revised awn-effects API based on cairo surfaces instead of pixbufs.

Personal tools