MaemoProgram API Reference

    Version  0.9.5
    Warning: API may and will change until we have reached 1.0 milestone

maemo_program_new

	MaemoProgram *maemo_program_new (int argc, char *argv[], 
                                         const gchar *application_name,
                                         const gchar *service_name, 
                                         const gchar *help_topic_id, 
                                         gpointer data_ptr,
                                         const MaemoMenuStructure *menu_structure)

Creates a new program object. By creating a maemo program you will initilize Gtk+, create the HildonProgram and HildonWindow objects, load GConf settings for the application, initialize libOSSO and gettext, set up the pixmap directory and the clipboard, and create the main menu with at least the standard items and the application toolbar having at least the standard buttons (the exact menu and toolbar items to be created can be specified with the @menus masking argument).

	@application_name: name of the application.
	@service_name:     name of the DBUS service of the application.
	                   This must match what is defined in the .service file.
	@help_topic_id:    identifier for the help content.
	@argc:             command line argument count from the main function.
	@argv:             command line argument vector from the main function.
	@data_ptr:         a pointer to be passed for all signals.
	@menus:            mask to specify what standard submenus (and toolbar
	                   buttons) are to be created.
	Returns:           A newly allocated MaemoProgram object.

maemo_program_add_menu_item

        GtkWidget *maemo_program_add_menu_item( MaemoProgram* self, 
                                                GtkMenu*      menu,
                                                gchar*        label,
                                                gpointer      cb )

Adds a menu item of the application. You can add menu items for the main menu, for example, like this:

    program = maemo_program_new( argc, argv, application_name, service_name,
                                 help_id, data_ptr, NULL );
    maemo_program_add_menu_item( program, program->main_menu, "My Item", cb_func );
	@self:      a MaemoProgram instance.
	@menu:      the menu widget to where menu item is to be inserted.
	@label:     menu item label
	@cb:        the callback function.
	Returns:    the menu item widget (can be ignored if not needed).

The callback function should receive two arguments: the MaemoProgram instance itself and the data pointer to be passed for all signals. The return type is void.

        void cb_my_item(MaemoProgram *program, gpointer data)

maemo_program_set_about

	void maemo_program_set_about(MaemoProgram *self,
                                     const gchar *copyright,
                                     const gchar *license,
                                     const gchar *comments,
                                     const gchar *logo_path)

Sets the about dialog copyright, license and comments texts as well as the logo to be shown. Logo should contain the path to the bitmap file.

	@copyright: the copyright holder.
	@license:   the license text.
	@comments:  the short description of the application.
	@logo_path: file path to the logo file.
	Returns:        (void)

maemo_program_set_about_website

	void maemo_program_set_about_website(MaemoProgram *self,
                                             const gchar *website,
                                             const gchar *website_label)

Sets the website link and the label to be shown in the About dialog.

	@website:       website link for the about dialog.
	@website_label: website label to be shown.
	Returns:        (void)

maemo_program_set_about_credits

	void
	maemo_program_set_about_credits(MaemoProgram *self, const gchar **auth,
                                        const gchar **art,
			                const gchar **docs, const gchar *transl)

Sets the names of the authors, artists, documenters and translators for the About dialog.

	@auth:   names of the authors.
	@art:    names of the artists.
	@docs:   names of the documenters.
	@transl: names of the translators.
	Returns: (void)

maemo_program_set_zoom_range

	gboolean maemo_program_set_zoom_range(MaemoProgram *self,
                                              const gint *zoom_levels)

Sets the zooming level range from a vector of percentage numbers. The vector is given as integers and must be 0 terminated. The zooming levels have to be in increasing order. Resets the zooming level to 100% if it is not already it. zoom_level_changed signal will be emitted.

An Example:

    gint levels[] = { 50, 80, 100, 120, 150, 200, 0 };
    maemo_program_set_zoom_range( program, levels );

maemo_program_main

	void maemo_program_main (MaemoProgram *self)

Enters the main loop of the program.

maemo_program_set_text_buffer

	gboolean maemo_program_set_text_buffer(MaemoProgram *self,
                                               GtkTextBuffer *buffer )

Sets the text buffer widget to which the clipboard handling operations (edit->copy, edit->paste etc.) are connected with.