XviewerApplication: Xviewer Reference Manual

## XviewerApplication

XviewerApplication

## Functions

XviewerApplication * | xviewer_application_get_instance ()
gboolean | xviewer_application_open_window ()
gboolean | xviewer_application_open_uri_list ()
gboolean | xviewer_application_open_file_list ()
gboolean | xviewer_application_open_uris ()
void | xviewer_application_screensaver_enable ()
void | xviewer_application_screensaver_disable ()

## Types and Values

#define | XVIEWER_APP
struct | XviewerApplication

## Description

## Functions

### xviewer_application_get_instance ()

    XviewerApplication *
    xviewer_application_get_instance (void);

Returns a singleton instance of XviewerApplication currently running. If not running yet, it will create one.

#### Returns

a running XviewerApplication.

[transfer none]

### xviewer_application_open_window ()

    gboolean
    xviewer_application_open_window (XviewerApplication *application,
                                     guint timestamp,
                                     XviewerStartupFlags flags,
                                     GError **error);

Opens and presents an empty XviewerWindow to the user. If there is an empty window already open, this will be used. Otherwise, a new one will be instantiated.

#### Parameters

application | An XviewerApplication. |
timestamp | The timestamp of the user interaction which triggered this call (see `gtk_window_present_with_time()`). |
flags | A set of XviewerStartupFlags influencing a new windows' state. |
error | Return location for a GError, or NULL to ignore errors. |

#### Returns

`FALSE` if `application` is invalid, `TRUE` otherwise

### xviewer_application_open_uri_list ()

    gboolean
    xviewer_application_open_uri_list (XviewerApplication *application,
                                       GSList *uri_list,
                                       guint timestamp,
                                       XviewerStartupFlags flags,
                                       GError **error);

Opens a list of images, from a list of URIs. See `xviewer_application_open_file_list()` for details.

#### Parameters

application | An XviewerApplication. |
uri_list | A list of URIs. | [element-type utf8]
timestamp | The timestamp of the user interaction which triggered this call (see `gtk_window_present_with_time()`). |
flags | A set of XviewerStartupFlags influencing a new windows' state. |
error | Return location for a GError, or NULL to ignore errors. |

#### Returns

Currently always `TRUE`.

### xviewer_application_open_file_list ()

    gboolean
    xviewer_application_open_file_list (XviewerApplication *application,
                                        GSList *file_list,
                                        guint timestamp,
                                        XviewerStartupFlags flags,
                                        GError **error);

Opens a list of files in a XviewerWindow. If an XviewerWindow displaying the first image in the list is already open, this will be used. Otherwise, an empty XviewerWindow is used, either already existing or newly created. If the XVIEWER_STARTUP_SINGLE_WINDOW flag is set, the files are opened in the first XviewerWindow and no new one is opened.

#### Parameters

application | An XviewerApplication. |
file_list | A list of GFiles. | [element-type GFile]
timestamp | The timestamp of the user interaction which triggered this call (see `gtk_window_present_with_time()`). |
flags | A set of XviewerStartupFlags influencing a new windows' state. |
error | Return location for a GError, or NULL to ignore errors. |

#### Returns

Currently always `TRUE`.

### xviewer_application_open_uris ()

    gboolean
    xviewer_application_open_uris (XviewerApplication *application,
                                   gchar **uris,
                                   guint timestamp,
                                   XviewerStartupFlags flags,
                                   GError **error);

Opens a list of images, from a list of URI strings. See `xviewer_application_open_file_list()` for details.

#### Parameters

application | an XviewerApplication |
uris | A GList of URI strings. |
timestamp | The timestamp of the user interaction which triggered this call (see `gtk_window_present_with_time()`). |
flags | A set of XviewerStartupFlags influencing a new windows' state. |
error | Return location for a GError, or NULL to ignore errors. |

#### Returns

Currently always `TRUE`.

### xviewer_application_screensaver_enable ()

    void
    xviewer_application_screensaver_enable
                                   (XviewerApplication *application);

### xviewer_application_screensaver_disable ()

    void
    xviewer_application_screensaver_disable
                                   (XviewerApplication *application);

## Types and Values

### XVIEWER_APP

    #define XVIEWER_APP				(xviewer_application_get_instance ())

### struct XviewerApplication

    struct XviewerApplication {
    	GtkApplication base_instance;

    	XviewerApplicationPrivate *priv;
    };