midori-view

midori-view

Synopsis

#include <midori/midori.h>

enum                MidoriDelay;
enum                MidoriDownloadType;
GtkWidget *         midori_view_new_with_title          (const gchar *title,
                                                         MidoriWebSettings *settings,
                                                         gboolean append);
GtkWidget *         midori_view_new_with_item           (KatzeItem *item,
                                                         MidoriWebSettings *settings);
void                midori_view_set_settings            (MidoriView *view,
                                                         MidoriWebSettings *settings);
gdouble             midori_view_get_progress            (MidoriView *view);
MidoriLoadStatus    midori_view_get_load_status         (MidoriView *view);
void                midori_view_set_uri                 (MidoriView *view,
                                                         const gchar *uri);
void                midori_view_set_html                (MidoriView *view,
                                                         const gchar *data,
                                                         const gchar *uri,
                                                         void *web_frame);
void                midori_view_set_overlay_text        (MidoriView *view,
                                                         const gchar *text);
gboolean            midori_view_is_blank                (MidoriView *view);
const gchar *       midori_view_get_display_uri         (MidoriView *view);
const gchar *       midori_view_get_display_title       (MidoriView *view);
GdkPixbuf *         midori_view_get_icon                (MidoriView *view);
const gchar *       midori_view_get_icon_uri            (MidoriView *view);
const gchar *       midori_view_get_link_uri            (MidoriView *view);
gboolean            midori_view_has_selection           (MidoriView *view);
const gchar *       midori_view_get_selected_text       (MidoriView *view);
GtkWidget *         midori_view_get_proxy_menu_item     (MidoriView *view);
GtkWidget *         midori_view_get_tab_menu            (MidoriView *view);
GtkWidget *         midori_view_duplicate               (MidoriView *view);
PangoEllipsizeMode  midori_view_get_label_ellipsize     (MidoriView *view);
GraniteWidgetsTab * midori_view_get_tab                 (MidoriView *view);
void                midori_view_set_tab                 (MidoriView *view,
                                                         GraniteWidgetsTab *tab);
GtkWidget *         midori_view_get_proxy_tab_label     (MidoriView *view);
KatzeItem *         midori_view_get_proxy_item          (MidoriView *view);
gfloat              midori_view_get_zoom_level          (MidoriView *view);
gboolean            midori_view_can_zoom_in             (MidoriView *view);
gboolean            midori_view_can_zoom_out            (MidoriView *view);
void                midori_view_set_zoom_level          (MidoriView *view,
                                                         gfloat zoom_level);
void                midori_view_reload                  (MidoriView *view,
                                                         gboolean from_cache);
gboolean            midori_view_can_go_back             (MidoriView *view);
void                midori_view_go_back                 (MidoriView *view);
gboolean            midori_view_can_go_forward          (MidoriView *view);
void                midori_view_go_forward              (MidoriView *view);
void                midori_view_go_back_or_forward      (MidoriView *view,
                                                         gint steps);
gboolean            midori_view_can_go_back_or_forward  (MidoriView *view,
                                                         gint steps);
const gchar *       midori_view_get_previous_page       (MidoriView *view);
const gchar *       midori_view_get_next_page           (MidoriView *view);
void                midori_view_print                   (MidoriView *view);
gboolean            midori_view_can_view_source         (MidoriView *view);
gchar *             midori_view_save_source             (MidoriView *view,
                                                         const gchar *uri,
                                                         const gchar *outfile,
                                                         gboolean use_dom);
void                midori_view_search_text             (MidoriView *view,
                                                         const gchar *text,
                                                         gboolean case_sensitive,
                                                         gboolean forward);
gboolean            midori_view_execute_script          (MidoriView *view,
                                                         const gchar *script,
                                                         gchar **exception);
GdkPixbuf *         midori_view_get_snapshot            (MidoriView *view,
                                                         gint width,
                                                         gint height);
GtkWidget *         midori_view_get_web_view            (MidoriView *view);
MidoriView *        midori_view_get_for_widget          (GtkWidget *web_view);
void                midori_view_populate_popup          (MidoriView *view,
                                                         GtkWidget *menu,
                                                         gboolean manual);
GtkWidget *         midori_view_add_info_bar            (MidoriView *view,
                                                         GtkMessageType message_type,
                                                         const gchar *message,
                                                         GCallback response_cb,
                                                         gpointer user_data,
                                                         const gchar *first_button_text,
                                                         ...);
const gchar *       midori_view_fallback_extension      (MidoriView *view,
                                                         const gchar *extension);
GList *             midori_view_get_resources           (MidoriView *view);
void                midori_view_list_versions           (GString *markup,
                                                         gboolean html);
void                midori_view_list_plugins            (MidoriView *view,
                                                         GString *markup,
                                                         gboolean html);
void                midori_view_set_colors              (MidoriView *view,
                                                         GdkColor *fg_color,
                                                         GdkColor *bg_color);
gboolean            midori_view_get_tls_info            (MidoriView *view,
                                                         void *request,
                                                         GTlsCertificate **tls_cert,
                                                         GTlsCertificateFlags *tls_flags,
                                                         gchar **hostname);
                    MidoriViewClass;
                    MidoriView;

Description

Details

enum MidoriDelay

typedef enum {
    MIDORI_DELAY_UNDELAYED = -1, /* The view is in a regular undelayed state */
    MIDORI_DELAY_DELAYED = 1, /* The view is delayed but has not displayed any indication of such */
    MIDORI_DELAY_PENDING_UNDELAY = -2 /* The view is delayed and showing a message asking to be undelayed */
} MidoriDelay;

MIDORI_DELAY_UNDELAYED

MIDORI_DELAY_DELAYED

MIDORI_DELAY_PENDING_UNDELAY


enum MidoriDownloadType

typedef enum {
    MIDORI_DOWNLOAD_CANCEL,
    MIDORI_DOWNLOAD_OPEN,
    MIDORI_DOWNLOAD_SAVE,
    MIDORI_DOWNLOAD_SAVE_AS,
    MIDORI_DOWNLOAD_OPEN_IN_VIEWER,
} MidoriDownloadType;

MIDORI_DOWNLOAD_CANCEL

MIDORI_DOWNLOAD_OPEN

MIDORI_DOWNLOAD_SAVE

MIDORI_DOWNLOAD_SAVE_AS

MIDORI_DOWNLOAD_OPEN_IN_VIEWER


midori_view_new_with_title ()

GtkWidget *         midori_view_new_with_title          (const gchar *title,
                                                         MidoriWebSettings *settings,
                                                         gboolean append);

Warning

midori_view_new_with_title is deprecated and should not be used in newly-written code. 0.4.3

Creates a new view with the specified parameters that is visible by default.

title :

a title, or NULL

settings :

a MidoriWebSettings, or NULL

append :

if TRUE, the view should be appended

Returns :

a new MidoriView

Since 0.3.0


midori_view_new_with_item ()

GtkWidget *         midori_view_new_with_item           (KatzeItem *item,
                                                         MidoriWebSettings *settings);

Creates a new view from an item that is visible by default.

item :

a KatzeItem, or NULL

settings :

a MidoriWebSettings, or NULL

Returns :

a new MidoriView

Since 0.4.3


midori_view_set_settings ()

void                midori_view_set_settings            (MidoriView *view,
                                                         MidoriWebSettings *settings);

Assigns a settings instance to the view.

view :

a MidoriView

settings :

a MidoriWebSettings

midori_view_get_progress ()

gdouble             midori_view_get_progress            (MidoriView *view);

Retrieves the current loading progress as a fraction between 0.0 and 1.0.

view :

a MidoriView

Returns :

the current loading progress

midori_view_get_load_status ()

MidoriLoadStatus    midori_view_get_load_status         (MidoriView *view);

midori_view_set_uri ()

void                midori_view_set_uri                 (MidoriView *view,
                                                         const gchar *uri);

Opens the specified URI in the view.

Since 0.3.0 a warning is shown if the view is not yet contained in a browser. This is because extensions can't monitor page loading if that happens.

view :

a MidoriView

midori_view_set_html ()

void                midori_view_set_html                (MidoriView *view,
                                                         const gchar *data,
                                                         const gchar *uri,
                                                         void *web_frame);

midori_view_set_overlay_text ()

void                midori_view_set_overlay_text        (MidoriView *view,
                                                         const gchar *text);

Show a specified URI or text on top of the view. Has no effect with < GTK+ 3.2.0.

view :

a MidoriView

text :

a URI or text string

Since 0.4.5


midori_view_is_blank ()

gboolean            midori_view_is_blank                (MidoriView *view);

Determines whether the view is currently empty.

view :

a MidoriView

midori_view_get_display_uri ()

const gchar *       midori_view_get_display_uri         (MidoriView *view);

Retrieves a string that is suitable for displaying.

Note that "about:blank" and "about:dial" are represented as "".

You can assume that the string is not NULL.

view :

a MidoriView

Returns :

an URI string

midori_view_get_display_title ()

const gchar *       midori_view_get_display_title       (MidoriView *view);

Retrieves a string that is suitable for displaying as a title. Most of the time this will be the title or the current URI.

You can assume that the string is not NULL.

view :

a MidoriView

Returns :

a title string

midori_view_get_icon ()

GdkPixbuf *         midori_view_get_icon                (MidoriView *view);

Retrieves the icon of the view, or a default icon. See midori_view_get_icon_uri() if you need to distinguish the origin of an icon.

The returned icon is owned by the view and must not be modified.

view :

a MidoriView

Returns :

a GdkPixbuf, or NULL

midori_view_get_icon_uri ()

const gchar *       midori_view_get_icon_uri            (MidoriView *view);

Retrieves the address of the icon of the view if the loaded website has an icon, otherwise NULL. Note that if there is no icon uri, midori_view_get_icon() will still return a default icon.

The returned string is owned by the view and must not be freed.

view :

a MidoriView

Returns :

a string, or NULL

Since 0.2.5


midori_view_get_link_uri ()

const gchar *       midori_view_get_link_uri            (MidoriView *view);

Retrieves the uri of the currently focused link, particularly while the mouse hovers a link or a context menu is being opened.

view :

a MidoriView

Returns :

an URI string, or NULL if there is no link focussed

midori_view_has_selection ()

gboolean            midori_view_has_selection           (MidoriView *view);

Determines whether something in the view is selected.

This function returns FALSE if there is a selection that effectively only consists of whitespace.

view :

a MidoriView

Returns :

TRUE if effectively there is a selection

midori_view_get_selected_text ()

const gchar *       midori_view_get_selected_text       (MidoriView *view);

Retrieves the currently selected text.

view :

a MidoriView

Returns :

the selected text, or NULL

midori_view_get_proxy_menu_item ()

GtkWidget *         midori_view_get_proxy_menu_item     (MidoriView *view);

Retrieves a proxy menu item that is typically added to a Window menu and which on activation switches to the right window/ tab.

The item is created on the first call and will be updated to reflect changes to the icon and title automatically.

The menu item is valid until it is removed from its container.

view :

a MidoriView

Returns :

the proxy GtkMenuItem

midori_view_get_tab_menu ()

GtkWidget *         midori_view_get_tab_menu            (MidoriView *view);

Retrieves a menu that is typically shown when right-clicking a tab label or equivalent representation.

view :

a MidoriView

Returns :

a GtkMenu

Since 0.1.8


midori_view_duplicate ()

GtkWidget *         midori_view_duplicate               (MidoriView *view);

midori_view_get_label_ellipsize ()

PangoEllipsizeMode  midori_view_get_label_ellipsize     (MidoriView *view);

Determines how labels representing the view should be ellipsized, which is helpful for alternative labels.

view :

a MidoriView

Returns :

how to ellipsize the label

Since 0.1.9


midori_view_get_tab ()

GraniteWidgetsTab * midori_view_get_tab                 (MidoriView *view);

midori_view_set_tab ()

void                midori_view_set_tab                 (MidoriView *view,
                                                         GraniteWidgetsTab *tab);

midori_view_get_proxy_tab_label ()

GtkWidget *         midori_view_get_proxy_tab_label     (MidoriView *view);

Retrieves a proxy tab label that is typically used when adding the view to a notebook.

Note that the label actually adjusts its orientation to the according tab position when used in a notebook.

The label is created on the first call and will be updated to reflect changes of the loading progress and title.

The label is valid until it is removed from its container.

view :

a MidoriView

Returns :

the proxy GtkEventBox

midori_view_get_proxy_item ()

KatzeItem *         midori_view_get_proxy_item          (MidoriView *view);

Retrieves a proxy item that can be used for bookmark storage as well as session management.

The item reflects changes to title (name), URI and MIME type (mime-type).

view :

a MidoriView

Returns :

the proxy KatzeItem

midori_view_get_zoom_level ()

gfloat              midori_view_get_zoom_level          (MidoriView *view);

Determines the current zoom level of the view.

view :

a MidoriView

Returns :

the current zoom level

midori_view_can_zoom_in ()

gboolean            midori_view_can_zoom_in             (MidoriView *view);

midori_view_can_zoom_out ()

gboolean            midori_view_can_zoom_out            (MidoriView *view);

midori_view_set_zoom_level ()

void                midori_view_set_zoom_level          (MidoriView *view,
                                                         gfloat zoom_level);

Sets the current zoom level of the view.

view :

a MidoriView

zoom_level :

the new zoom level

midori_view_reload ()

void                midori_view_reload                  (MidoriView *view,
                                                         gboolean from_cache);

Reloads the view.

view :

a MidoriView

from_cache :

whether to allow caching

midori_view_can_go_back ()

gboolean            midori_view_can_go_back             (MidoriView *view);

Determines whether the view can go back.

view :

a MidoriView

midori_view_go_back ()

void                midori_view_go_back                 (MidoriView *view);

Goes back one page in the view.

view :

a MidoriView

midori_view_can_go_forward ()

gboolean            midori_view_can_go_forward          (MidoriView *view);

midori_view_go_forward ()

void                midori_view_go_forward              (MidoriView *view);

midori_view_go_back_or_forward ()

void                midori_view_go_back_or_forward      (MidoriView *view,
                                                         gint steps);

Goes back or forward in history.

view :

a MidoriView

steps :

number of steps to jump in history

Since 0.4.5


midori_view_can_go_back_or_forward ()

gboolean            midori_view_can_go_back_or_forward  (MidoriView *view,
                                                         gint steps);

Determines whether the view can go back or forward by number of steps.

view :

a MidoriView

steps :

number of steps to jump in history

Since 0.4.5


midori_view_get_previous_page ()

const gchar *       midori_view_get_previous_page       (MidoriView *view);

Determines the previous sub-page in the view.

view :

a MidoriView

Returns :

an URI, or NULL

Since 0.2.3


midori_view_get_next_page ()

const gchar *       midori_view_get_next_page           (MidoriView *view);

Determines the next sub-page in the view.

view :

a MidoriView

Returns :

an URI, or NULL

Since 0.2.3


midori_view_print ()

void                midori_view_print                   (MidoriView *view);

Prints the contents of the view.

view :

a MidoriView

midori_view_can_view_source ()

gboolean            midori_view_can_view_source         (MidoriView *view);

midori_view_save_source ()

gchar *             midori_view_save_source             (MidoriView *view,
                                                         const gchar *uri,
                                                         const gchar *outfile,
                                                         gboolean use_dom);

Saves the data in the view to disk.

view :

a MidoriView

uri :

an alternative destination URI, or NULL

outfile :

a destination filename, or NULL

Returns :

the destination filename

Since 0.4.4


midori_view_search_text ()

void                midori_view_search_text             (MidoriView *view,
                                                         const gchar *text,
                                                         gboolean case_sensitive,
                                                         gboolean forward);

Searches a text within the view.

view :

a MidoriView

text :

a string

case_sensitive :

case sensitivity

forward :

whether to search forward

midori_view_execute_script ()

gboolean            midori_view_execute_script          (MidoriView *view,
                                                         const gchar *script,
                                                         gchar **exception);

Execute a script on the view.

view :

a MidoriView

script :

script code

exception :

location to store an exception message

Returns :

TRUE if the script was executed successfully

midori_view_get_snapshot ()

GdkPixbuf *         midori_view_get_snapshot            (MidoriView *view,
                                                         gint width,
                                                         gint height);

Warning

midori_view_get_snapshot is deprecated and should not be used in newly-written code. 0.5.4

Take a snapshot of the view at the given dimensions. The view has to be mapped on the screen.

If width and height are negative, the resulting image is going to be optimized for speed.

view :

a MidoriView

width :

the desired width

height :

the desired height

Returns :

a newly allocated GdkPixbuf

Since 0.2.1


midori_view_get_web_view ()

GtkWidget *         midori_view_get_web_view            (MidoriView *view);

Warning

midori_view_get_web_view has been deprecated since version 0.4.8 and should not be used in newly-written code. Use midori_tab_get_web_view() instead.

view :

a MidoriView

Returns :

The WebKitWebView for this view

Since 0.2.5


midori_view_get_for_widget ()

MidoriView *        midori_view_get_for_widget          (GtkWidget *web_view);

Determines the view appropriate for the specified widget.

widget :

a GtkWidget

Returns :

a MidoriView Since 0.4.5

midori_view_populate_popup ()

void                midori_view_populate_popup          (MidoriView *view,
                                                         GtkWidget *menu,
                                                         gboolean manual);

Warning

midori_view_populate_popup has been deprecated since version 0.5.5 and should not be used in newly-written code. Use midori_view_get_page_context_action().

Populates the given menu with context menu items according to the position of the mouse pointer. This can be used in situations where a custom hotkey opens the context menu or the default behaviour needs to be intercepted.

manual should usually be TRUE, except for the case where menu was created by the WebKitWebView.

view :

a MidoriView

menu :

a GtkMenu

manual :

TRUE if this a manually created popup

Since 0.2.5


midori_view_add_info_bar ()

GtkWidget *         midori_view_add_info_bar            (MidoriView *view,
                                                         GtkMessageType message_type,
                                                         const gchar *message,
                                                         GCallback response_cb,
                                                         gpointer user_data,
                                                         const gchar *first_button_text,
                                                         ...);

Adds an infobar (or equivalent) to the view. Activation of a button invokes the specified callback. The infobar is automatically destroyed if the location changes or reloads.

view :

a MidoriView

message_type :

a GtkMessageType

message :

a message string

response_cb :

a response callback

user_data :

user data passed to the callback

first_button_text :

button text or stock ID

... :

first response ID, then more text - response ID pairs

Returns :

an infobar widget

Since 0.2.9


midori_view_fallback_extension ()

const gchar *       midori_view_fallback_extension      (MidoriView *view,
                                                         const gchar *extension);

midori_view_get_resources ()

GList *             midori_view_get_resources           (MidoriView *view);

midori_view_list_versions ()

void                midori_view_list_versions           (GString *markup,
                                                         gboolean html);

midori_view_list_plugins ()

void                midori_view_list_plugins            (MidoriView *view,
                                                         GString *markup,
                                                         gboolean html);

midori_view_set_colors ()

void                midori_view_set_colors              (MidoriView *view,
                                                         GdkColor *fg_color,
                                                         GdkColor *bg_color);

midori_view_get_tls_info ()

gboolean            midori_view_get_tls_info            (MidoriView *view,
                                                         void *request,
                                                         GTlsCertificate **tls_cert,
                                                         GTlsCertificateFlags *tls_flags,
                                                         gchar **hostname);

MidoriViewClass

typedef struct _MidoriViewClass MidoriViewClass;

MidoriView

typedef struct _MidoriView MidoriView;