sokoke

sokoke

Synopsis

#include <midori/midori.h>

void                sokoke_create_win32_desktop_lnk     (gchar *prefix,
                                                         gchar *filename,
                                                         gchar *uri);
gboolean            sokoke_external_uri                 (const gchar *uri);
gchar *             sokoke_get_win32_desktop_lnk_path_for_filename
                                                        (gchar *filename);
guint               sokoke_gtk_action_count_modifiers   (GtkAction *action);
gchar *             sokoke_js_script_eval               (JSContextRef js_context,
                                                         const gchar *script,
                                                         gchar **exception);
gboolean            sokoke_key_file_save_to_file        (GKeyFile *key_file,
                                                         const gchar *filename,
                                                         GError **error);
gchar *             sokoke_magic_uri                    (const gchar *uri,
                                                         gboolean allow_search,
                                                         gboolean allow_realtive);
void                sokoke_message_dialog               (GtkMessageType message_type,
                                                         const gchar *short_message,
                                                         const gchar *detailed_message,
                                                         gboolean modal);
gboolean            sokoke_prefetch_uri                 (MidoriWebSettings *settings,
                                                         const char *uri,
                                                         GCallback callback,
                                                         gpointer user_data);
gchar *             sokoke_prepare_command              (const gchar *command,
                                                         gboolean quote_command,
                                                         const gchar *argument,
                                                         gboolean quote_argument);
gchar *             sokoke_replace_variables            (const gchar *template,
                                                         const gchar *variable_first,
                                                         ...);
gboolean            sokoke_resolve_hostname             (const gchar *hostname);
GtkWidget *         sokoke_search_entry_new             (const gchar *placeholder_text);
void                sokoke_spawn_app                    (const gchar *uri,
                                                         gboolean inherit_config);
void                sokoke_spawn_gdb                    (const gchar *gdb,
                                                         gboolean sync);
gboolean            sokoke_spawn_program                (const gchar *command,
                                                         gboolean quote_command,
                                                         const gchar *argument,
                                                         gboolean quote_argument,
                                                         gboolean sync);
gint64              sokoke_time_t_to_julian             (const time_t *timestamp);
void                sokoke_widget_copy_clipboard        (GtkWidget *widget,
                                                         const gchar *text,
                                                         GtkClipboardGetFunc get_cb,
                                                         gpointer owner);
void                sokoke_widget_get_text_size         (GtkWidget *widget,
                                                         const gchar *text,
                                                         gint *width,
                                                         gint *height);
void                sokoke_widget_set_visible           (GtkWidget *widget,
                                                         gboolean visible);
gboolean            sokoke_window_activate_key          (GtkWindow *window,
                                                         GdkEventKey *event);
GtkWidget *         sokoke_xfce_header_new              (const gchar *icon,
                                                         const gchar *title);

Description

Details

sokoke_create_win32_desktop_lnk ()

void                sokoke_create_win32_desktop_lnk     (gchar *prefix,
                                                         gchar *filename,
                                                         gchar *uri);

sokoke_external_uri ()

gboolean            sokoke_external_uri                 (const gchar *uri);

sokoke_get_win32_desktop_lnk_path_for_filename ()

gchar *             sokoke_get_win32_desktop_lnk_path_for_filename
                                                        (gchar *filename);

sokoke_gtk_action_count_modifiers ()

guint               sokoke_gtk_action_count_modifiers   (GtkAction *action);

Counts the number of modifiers in the accelerator belonging to the action.

action :

a GtkAction

Returns :

the number of modifiers

sokoke_js_script_eval ()

gchar *             sokoke_js_script_eval               (JSContextRef js_context,
                                                         const gchar *script,
                                                         gchar **exception);

sokoke_key_file_save_to_file ()

gboolean            sokoke_key_file_save_to_file        (GKeyFile *key_file,
                                                         const gchar *filename,
                                                         GError **error);

sokoke_magic_uri ()

gchar *             sokoke_magic_uri                    (const gchar *uri,
                                                         gboolean allow_search,
                                                         gboolean allow_realtive);

Takes a string that was typed by a user, guesses what it is, and returns an URI.

If it was a search, NULL will be returned.

uri :

a string typed by a user

Returns :

a newly allocated URI, or NULL

sokoke_message_dialog ()

void                sokoke_message_dialog               (GtkMessageType message_type,
                                                         const gchar *short_message,
                                                         const gchar *detailed_message,
                                                         gboolean modal);

sokoke_prefetch_uri ()

gboolean            sokoke_prefetch_uri                 (MidoriWebSettings *settings,
                                                         const char *uri,
                                                         GCallback callback,
                                                         gpointer user_data);

Attempts to prefetch the specified URI, that is it tries to resolve the hostname in advance.

settings :

a MidoriWebSettings instance, or NULL

uri :

an URI string

Returns :

TRUE on success

sokoke_prepare_command ()

gchar *             sokoke_prepare_command              (const gchar *command,
                                                         gboolean quote_command,
                                                         const gchar *argument,
                                                         gboolean quote_argument);

If command contains s, argument will be quoted and inserted into command, which is left unquoted regardless of quote_command.

command :

the command, properly quoted

argument :

any arguments, properly quoted

quote_command :

if TRUE, command will be quoted

quote_argument :

if TRUE, argument will be quoted, ie. a URI or filename

Returns :

the command prepared for spawning

sokoke_replace_variables ()

gchar *             sokoke_replace_variables            (const gchar *template,
                                                         const gchar *variable_first,
                                                         ...);

sokoke_resolve_hostname ()

gboolean            sokoke_resolve_hostname             (const gchar *hostname);

Takes a string that was typed by a user, resolves the hostname, and returns the status.

hostname :

a string typed by a user

Returns :

TRUE if is a valid host, else FALSE

sokoke_search_entry_new ()

GtkWidget *         sokoke_search_entry_new             (const gchar *placeholder_text);

sokoke_spawn_app ()

void                sokoke_spawn_app                    (const gchar *uri,
                                                         gboolean inherit_config);

sokoke_spawn_gdb ()

void                sokoke_spawn_gdb                    (const gchar *gdb,
                                                         gboolean sync);

sokoke_spawn_program ()

gboolean            sokoke_spawn_program                (const gchar *command,
                                                         gboolean quote_command,
                                                         const gchar *argument,
                                                         gboolean quote_argument,
                                                         gboolean sync);

If command contains s, argument will be quoted and inserted into command, which is left unquoted regardless of quote_command.

command :

the command, properly quoted

argument :

any arguments, properly quoted

quote_command :

if TRUE, command will be quoted

quote_argument :

if TRUE, argument will be quoted, ie. a URI or filename

sync :

spawn synchronously and wait for command to exit

Returns :

TRUE on success, FALSE if an error occurred

sokoke_time_t_to_julian ()

gint64              sokoke_time_t_to_julian             (const time_t *timestamp);

Calculates a unix timestamp to a julian day value.

timestamp :

a time_t timestamp value

Returns :

an integer.

sokoke_widget_copy_clipboard ()

void                sokoke_widget_copy_clipboard        (GtkWidget *widget,
                                                         const gchar *text,
                                                         GtkClipboardGetFunc get_cb,
                                                         gpointer owner);

sokoke_widget_get_text_size ()

void                sokoke_widget_get_text_size         (GtkWidget *widget,
                                                         const gchar *text,
                                                         gint *width,
                                                         gint *height);

sokoke_widget_set_visible ()

void                sokoke_widget_set_visible           (GtkWidget *widget,
                                                         gboolean visible);

sokoke_window_activate_key ()

gboolean            sokoke_window_activate_key          (GtkWindow *window,
                                                         GdkEventKey *event);

Attempts to activate they key from the event, much like gtk_window_activate_key(), including keys that gtk_accelerator_valid() considers invalid.

window :

a GtkWindow

event :

a GdkEventKey

Returns :

TRUE on success

sokoke_xfce_header_new ()

GtkWidget *         sokoke_xfce_header_new              (const gchar *icon,
                                                         const gchar *title);

Creates an Xfce style header *if* Xfce is running.

icon :

an icon name

title :

the title of the header

Returns :

A GtkWidget or NULL Since 0.1.2 icon may be NULL, and a default is used.