midori-view

midori-view

Functions

GtkWidget * midori_view_new_with_title ()
GtkWidget * midori_view_new_with_item ()
GtkWidget * midori_view_new_from_view ()
void midori_view_set_settings ()
gdouble midori_view_get_progress ()
MidoriLoadStatus midori_view_get_load_status ()
void midori_view_set_uri ()
void midori_view_set_html ()
void midori_view_set_overlay_text ()
gboolean midori_view_is_blank ()
const gchar * midori_view_get_display_uri ()
const gchar * midori_view_get_display_title ()
GdkPixbuf * midori_view_get_icon ()
const gchar * midori_view_get_icon_uri ()
const gchar * midori_view_get_link_uri ()
gboolean midori_view_has_selection ()
const gchar * midori_view_get_selected_text ()
GtkWidget * midori_view_get_proxy_menu_item ()
GtkWidget * midori_view_get_tab_menu ()
GtkWidget * midori_view_duplicate ()
PangoEllipsizeMode midori_view_get_label_ellipsize ()
GtkWidget * midori_view_get_proxy_tab_label ()
KatzeItem * midori_view_get_proxy_item ()
gfloat midori_view_get_zoom_level ()
gboolean midori_view_can_zoom_in ()
gboolean midori_view_can_zoom_out ()
void midori_view_set_zoom_level ()
void midori_view_reload ()
gboolean midori_view_can_go_back ()
void midori_view_go_back ()
gboolean midori_view_can_go_forward ()
void midori_view_go_forward ()
void midori_view_go_back_or_forward ()
gboolean midori_view_can_go_back_or_forward ()
const gchar * midori_view_get_previous_page ()
const gchar * midori_view_get_next_page ()
void midori_view_print ()
gboolean midori_view_can_view_source ()
gchar * midori_view_save_source ()
void midori_view_search_text ()
gboolean midori_view_execute_script ()
GdkPixbuf * midori_view_get_snapshot ()
GtkWidget * midori_view_get_web_view ()
MidoriView * midori_view_get_for_widget ()
void midori_view_populate_popup ()
GtkWidget * midori_view_add_info_bar ()
const gchar * midori_view_fallback_extension ()
GList * midori_view_get_resources ()
void midori_view_list_versions ()
void midori_view_list_plugins ()
void midori_view_list_video_formats ()
void midori_view_set_colors ()
gboolean midori_view_get_tls_info ()

Types and Values

Includes

#include <midori/midori.h>

Description

Functions

midori_view_new_with_title ()

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

midori_view_new_with_title has been deprecated since version 0.4.3 and should not be used in newly-written code.

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

Parameters

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);

midori_view_new_with_item has been deprecated since version 0.5.8 and should not be used in newly-written code.

Use midori_view_new_from_view instead.

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

Parameters

item

a KatzeItem, or NULL

 

settings

a MidoriWebSettings, or NULL

 

Returns

a new MidoriView

Since 0.4.3


midori_view_new_from_view ()

GtkWidget *
midori_view_new_from_view (MidoriView *view,
                           KatzeItem *item,
                           MidoriWebSettings *settings);

Creates a new view, visible by default.

If a view is specified the returned new view will share its settings and if applicable re-use the rendering process.

When view should be passed: The new one created is a new tab/ window for the old view A tab was duplicated

When view may be passed: Old and new view belong to the same website or group

Don't pass a view if: The new view is a completely new website

The item may contain title, URI and minimized status and will be copied.

Usually settings should be passed from an existing view or browser.

Parameters

view

a predating, related MidoriView, or NULL

 

item

a KatzeItem, or NULL

 

settings

a MidoriWebSettings, or NULL

 

Returns

a new MidoriView

Since 0.5.8


midori_view_set_settings ()

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

Assigns a settings instance to the view.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

view

a MidoriView

 

Returns

the proxy GtkMenuItem


midori_view_get_tab_menu ()

GtkWidget *
midori_view_get_tab_menu (MidoriView *view);

midori_view_get_tab_menu has been deprecated since version 0.5.7 and should not be used in newly-written code.

Use MidoriNotebook API instead.

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

Parameters

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.

Parameters

view

a MidoriView

 

Returns

how to ellipsize the label

Since 0.1.9


midori_view_get_proxy_tab_label ()

GtkWidget *
midori_view_get_proxy_tab_label (MidoriView *view);

midori_view_get_proxy_tab_label has been deprecated since version 0.5.7 and should not be used in newly-written code.

Don't use this label.

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

Parameters

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).

Parameters

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.

Parameters

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.

Parameters

view

a MidoriView

 

zoom_level

the new zoom level

 

midori_view_reload ()

void
midori_view_reload (MidoriView *view,
                    gboolean from_cache);

Reloads the view.

Parameters

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.

Parameters

view

a MidoriView

 

midori_view_go_back ()

void
midori_view_go_back (MidoriView *view);

Goes back one page in the view.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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.

Parameters

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);

midori_view_get_snapshot has been deprecated since version 0.5.4 and should not be used in newly-written code.

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.

Parameters

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);

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.

Parameters

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.

Parameters

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);

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.

Parameters

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.

Parameters

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);

Obtain a list of the resources loaded by the page shown in the view.

Parameters

view

a MidoriView

 

Returns

the resources.

[transfer full][element-type WebKitWebResource]


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_list_video_formats ()

void
midori_view_list_video_formats (MidoriView *view,
                                GString *formats,
                                gboolean html);

midori_view_set_colors ()

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

midori_view_set_colors has been deprecated since version 0.5.7 and should not be used in newly-written code.

Use fg_color/ bg_color on Midori.Tab.

Sets colors on the label.

Parameters

view

a MidoriView

 

fg_color

a GdkColor, or NULL

 

bg_color

a GdkColor, or NULL

 

midori_view_get_tls_info ()

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

Returns TRUE if the the host is secure and trustworthy.

Parameters

view

a MidoriView

 

request

a WebKitNetworkRequest with WebKit1, otherwise NULL

 

tls_cert

variable to store the certificate

 

tls_flags

variable to store the flags

 

hostname

variable to store the hostname

 

Types and Values

enum MidoriDelay

Members

MIDORI_DELAY_UNDELAYED

   

MIDORI_DELAY_DELAYED

   

MIDORI_DELAY_PENDING_UNDELAY

   

enum MidoriDownloadType

Members

MIDORI_DOWNLOAD_CANCEL

   

MIDORI_DOWNLOAD_OPEN

   

MIDORI_DOWNLOAD_SAVE

   

MIDORI_DOWNLOAD_SAVE_AS

   

MIDORI_DOWNLOAD_OPEN_IN_VIEWER