MidoriBrowser

MidoriBrowser

Synopsis

#include <midori/midori.h>

struct              MidoriBrowserClass;
MidoriBrowser *     midori_browser_new                  (void);
void                midori_browser_add_tab              (MidoriBrowser *browser,
                                                         GtkWidget *widget);
void                midori_browser_close_tab            (MidoriBrowser *browser,
                                                         GtkWidget *widget);
GtkWidget *         midori_browser_add_item             (MidoriBrowser *browser,
                                                         KatzeItem *item);
GtkWidget *         midori_browser_add_uri              (MidoriBrowser *browser,
                                                         const gchar *uri);
void                midori_browser_activate_action      (MidoriBrowser *browser,
                                                         const gchar *name);
void                midori_browser_assert_action        (MidoriBrowser *browser,
                                                         const gchar *name);
void                midori_browser_block_action         (MidoriBrowser *browser,
                                                         GtkAction *action);
void                midori_browser_unblock_action       (MidoriBrowser *browser,
                                                         GtkAction *action);
void                midori_browser_set_action_visible   (MidoriBrowser *browser,
                                                         const gchar *name,
                                                         gboolean visible);
GtkActionGroup *    midori_browser_get_action_group     (MidoriBrowser *browser);
void                midori_browser_set_current_uri      (MidoriBrowser *browser,
                                                         const gchar *uri);
const gchar *       midori_browser_get_current_uri      (MidoriBrowser *browser);
void                midori_browser_set_current_page_smartly
                                                        (MidoriBrowser *browser,
                                                         gint n);
void                midori_browser_set_current_tab_smartly
                                                        (MidoriBrowser *browser,
                                                         GtkWidget *view);
void                midori_browser_set_current_page     (MidoriBrowser *browser,
                                                         gint n);
gint                midori_browser_get_current_page     (MidoriBrowser *browser);
void                midori_browser_set_current_item     (MidoriBrowser *browser,
                                                         KatzeItem *item);
GtkWidget *         midori_browser_get_nth_tab          (MidoriBrowser *browser,
                                                         gint n);
void                midori_browser_set_current_tab      (MidoriBrowser *browser,
                                                         GtkWidget *widget);
#define             midori_browser_set_tab
GtkWidget *         midori_browser_get_current_tab      (MidoriBrowser *browser);
#define             midori_browser_get_tab
gint                midori_browser_page_num             (MidoriBrowser *browser,
                                                         GtkWidget *view);
GList *             midori_browser_get_tabs             (MidoriBrowser *browser);
gint                midori_browser_get_n_pages          (MidoriBrowser *browser);
KatzeArray *        midori_browser_get_proxy_array      (MidoriBrowser *browser);
MidoriBrowser *     midori_browser_get_for_widget       (GtkWidget *widget);
void                midori_browser_quit                 (MidoriBrowser *browser);
const gchar **      midori_browser_get_toolbar_actions  (MidoriBrowser *browser);
MidoriWebSettings * midori_browser_get_settings         (MidoriBrowser *browser);
void                midori_browser_update_history       (KatzeItem *item,
                                                         const gchar *type,
                                                         const gchar *event);
void                midori_browser_save_uri             (MidoriBrowser *browser,
                                                         MidoriView *view,
                                                         const gchar *uri);
void                midori_browser_set_inactivity_reset (MidoriBrowser *browser,
                                                         gint inactivity_reset);

Description

Details

struct MidoriBrowserClass

struct MidoriBrowserClass {
    GtkWindowClass parent_class;

    /* Signals */
    void
    (*window_object_cleared)   (MidoriBrowser*       browser,
#ifndef HAVE_WEBKIT2
                                WebKitWebFrame*      web_frame,
#else
                                void*                web_frame,
#endif
                                JSContextRef*        context,
                                JSObjectRef*         window_object);
    void
    (*statusbar_text_changed)  (MidoriBrowser*       browser,
                                const gchar*         text);
    void
    (*element_motion)          (MidoriBrowser*       browser,
                                const gchar*         link_uri);
    void
    (*new_window)              (MidoriBrowser*       browser,
                                const gchar*         uri);

    void
    (*add_tab)                 (MidoriBrowser*       browser,
                                GtkWidget*           view);
    void
    (*remove_tab)              (MidoriBrowser*       browser,
                                GtkWidget*           view);
    void
    (*activate_action)         (MidoriBrowser*       browser,
                                const gchar*         name);
    void
    (*quit)                    (MidoriBrowser*       browser);
};

midori_browser_new ()

MidoriBrowser *     midori_browser_new                  (void);

Creates a new browser widget.

A browser is a window with a menubar, toolbars, a notebook, panels and a statusbar. You should mostly treat it as an opaque widget.

Returns :

a new MidoriBrowser

midori_browser_add_tab ()

void                midori_browser_add_tab              (MidoriBrowser *browser,
                                                         GtkWidget *widget);

Appends a view in the form of a new tab and creates an according item in the Window menu.

browser :

a MidoriBrowser

widget :

a view

Since 0.4.9: Return type is void


midori_browser_close_tab ()

void                midori_browser_close_tab            (MidoriBrowser *browser,
                                                         GtkWidget *widget);

Closes an existing view, removing it and its associated menu item from the browser.

browser :

a MidoriBrowser

widget :

a view

midori_browser_add_item ()

GtkWidget *         midori_browser_add_item             (MidoriBrowser *browser,
                                                         KatzeItem *item);

browser :

a MidoriBrowser

item :

an item

Returns :

a GtkWidget

Since 0.4.9: Return type is GtkWidget*


midori_browser_add_uri ()

GtkWidget *         midori_browser_add_uri              (MidoriBrowser *browser,
                                                         const gchar *uri);

Appends an uri in the form of a new view.

browser :

a MidoriBrowser

uri :

an URI

Returns :

a GtkWidget

Since 0.4.9: Return type is GtkWidget*


midori_browser_activate_action ()

void                midori_browser_activate_action      (MidoriBrowser *browser,
                                                         const gchar *name);

Activates the specified action. See also midori_browser_assert_action().

browser :

a MidoriBrowser

name :

action, setting=value expression or extension=true|false

midori_browser_assert_action ()

void                midori_browser_assert_action        (MidoriBrowser *browser,
                                                         const gchar *name);

Assert that name is a valid action or setting expression, if it fails the program will terminate with an error. To be used with command line interfaces.

browser :

a MidoriBrowser

name :

action, setting=value expression or extension=true|false

Since 0.5.0


midori_browser_block_action ()

void                midori_browser_block_action         (MidoriBrowser *browser,
                                                         GtkAction *action);

Blocks built-in behavior of the specified action without disabling it, which gives you a chance to connect your own signal handling. Call midori_browser_unblock_action() to undo the effect.

browser :

a MidoriBrowser

name :

the action to be blocked

Since 0.3.4


midori_browser_unblock_action ()

void                midori_browser_unblock_action       (MidoriBrowser *browser,
                                                         GtkAction *action);

Restores built-in behavior of the specified action after previously blocking it with midori_browser_block_action().

browser :

a MidoriBrowser

name :

the action to be unblocked

Since 0.3.4


midori_browser_set_action_visible ()

void                midori_browser_set_action_visible   (MidoriBrowser *browser,
                                                         const gchar *name,
                                                         gboolean visible);

midori_browser_get_action_group ()

GtkActionGroup *    midori_browser_get_action_group     (MidoriBrowser *browser);

Retrieves the action group holding all actions used by the browser. It allows obtaining individual actions and adding new actions.

browser :

a MidoriBrowser

Returns :

the action group of the browser

Since 0.1.4


midori_browser_set_current_uri ()

void                midori_browser_set_current_uri      (MidoriBrowser *browser,
                                                         const gchar *uri);

Loads the specified URI in the current view.

If the current view is opaque, and cannot load new pages, it will automatically open a new tab.

browser :

a MidoriBrowser

uri :

an URI

midori_browser_get_current_uri ()

const gchar *       midori_browser_get_current_uri      (MidoriBrowser *browser);

Determines the URI loaded in the current view.

If there is no view present at all, NULL is returned.

browser :

a MidoriBrowser

Returns :

the current URI, or NULL

midori_browser_set_current_page_smartly ()

void                midori_browser_set_current_page_smartly
                                                        (MidoriBrowser *browser,
                                                         gint n);

midori_browser_set_current_tab_smartly ()

void                midori_browser_set_current_tab_smartly
                                                        (MidoriBrowser *browser,
                                                         GtkWidget *view);

Switches to the tab containing view iff open-tabs-in-the-background is FALSE.

browser :

a MidoriBrowser

view :

a GtkWidget

Since 0.4.9


midori_browser_set_current_page ()

void                midori_browser_set_current_page     (MidoriBrowser *browser,
                                                         gint n);

Switches to the page with the index n.

The widget will also grab the focus automatically.

browser :

a MidoriBrowser

n :

the index of a page

midori_browser_get_current_page ()

gint                midori_browser_get_current_page     (MidoriBrowser *browser);

Determines the currently selected page.

If there is no page present at all, NULL is returned.

browser :

a MidoriBrowser

Returns :

the selected page, or -1

midori_browser_set_current_item ()

void                midori_browser_set_current_item     (MidoriBrowser *browser,
                                                         KatzeItem *item);

Switches to the page containing item, see also midori_browser_set_current_page().

The widget will also grab the focus automatically.

browser :

a MidoriBrowser

item :

a KatzeItem

Since 0.4.8


midori_browser_get_nth_tab ()

GtkWidget *         midori_browser_get_nth_tab          (MidoriBrowser *browser,
                                                         gint n);

Retrieves the tab at the position page.

If there is no page present at all, NULL is returned.

browser :

a MidoriBrowser

page :

the index of a tab

Returns :

the selected page, or -1

Since 0.1.9


midori_browser_set_current_tab ()

void                midori_browser_set_current_tab      (MidoriBrowser *browser,
                                                         GtkWidget *widget);

midori_browser_set_tab

#define midori_browser_set_tab midori_browser_set_current_tab

Switches to the page containing view.

The widget will also grab the focus automatically.

browser :

a MidoriBrowser

view :

a GtkWidget

Since 0.2.6


midori_browser_get_current_tab ()

GtkWidget *         midori_browser_get_current_tab      (MidoriBrowser *browser);

midori_browser_get_tab

#define midori_browser_get_tab midori_browser_get_current_tab

Retrieves the currently selected tab.

If there is no tab present at all, NULL is returned.

See also midori_browser_get_current_page().

browser :

a MidoriBrowser

Returns :

the selected tab, or NULL

Since 0.2.6


midori_browser_page_num ()

gint                midori_browser_page_num             (MidoriBrowser *browser,
                                                         GtkWidget *view);

Retrieves the position of widget in the browser.

If there is no page present at all, -1 is returned.

browser :

a MidoriBrowser

widget :

a widget in the browser

Returns :

the index of the widget, or -1

Since 0.4.5


midori_browser_get_tabs ()

GList *             midori_browser_get_tabs             (MidoriBrowser *browser);

Retrieves the tabs as a list.

browser :

a MidoriBrowser

Returns :

a newly allocated GList of MidoriView

Since 0.2.5


midori_browser_get_n_pages ()

gint                midori_browser_get_n_pages          (MidoriBrowser *browser);

midori_browser_get_proxy_array ()

KatzeArray *        midori_browser_get_proxy_array      (MidoriBrowser *browser);

Retrieves a proxy array representing the respective proxy items. The array is updated automatically.

browser :

a MidoriBrowser

Returns :

the proxy KatzeArray

midori_browser_get_for_widget ()

MidoriBrowser *     midori_browser_get_for_widget       (GtkWidget *widget);

Determines the browser appropriate for the specified widget.

widget :

a GtkWidget

Returns :

a MidoriBrowser Since 0.1.7

midori_browser_quit ()

void                midori_browser_quit                 (MidoriBrowser *browser);

Quits the browser, including any other browser windows.

This function relys on the application implementing the MidoriBrowser::quit signal. If the browser was added to the MidoriApp, this is handled automatically.

browser :

a MidoriBrowser

midori_browser_get_toolbar_actions ()

const gchar **      midori_browser_get_toolbar_actions  (MidoriBrowser *browser);

Retrieves a list of actions which are suitable for use in a toolbar.

Returns :

a NULL-terminated array of strings with actions

Since 0.1.8


midori_browser_get_settings ()

MidoriWebSettings * midori_browser_get_settings         (MidoriBrowser *browser);

Retrieves the settings instance of the browser.

Returns :

a MidoriWebSettings instance

Since 0.2.5


midori_browser_update_history ()

void                midori_browser_update_history       (KatzeItem *item,
                                                         const gchar *type,
                                                         const gchar *event);

item :

a KatzeItem

type :

"website", "bookmark" or "download"

event :

"access", "leave", "modify", "delete"

Since 0.4.7


midori_browser_save_uri ()

void                midori_browser_save_uri             (MidoriBrowser *browser,
                                                         MidoriView *view,
                                                         const gchar *uri);

midori_browser_set_inactivity_reset ()

void                midori_browser_set_inactivity_reset (MidoriBrowser *browser,
                                                         gint inactivity_reset);