gedit Reference Manual: GeditWindow

## GeditWindow GeditWindow |

## Functions

GeditTab * | gedit_window_create_tab ()
GeditTab * | gedit_window_create_tab_from_location ()
GeditTab * | gedit_window_create_tab_from_stream ()
void | gedit_window_close_tab ()
void | gedit_window_close_all_tabs ()
void | gedit_window_close_tabs ()
GeditTab * | gedit_window_get_active_tab ()
void | gedit_window_set_active_tab ()
GeditView * | gedit_window_get_active_view ()
GeditDocument * | gedit_window_get_active_document ()
GList * | gedit_window_get_documents ()
GList * | gedit_window_get_unsaved_documents ()
GList * | gedit_window_get_views ()
GtkWindowGroup * | gedit_window_get_group ()
GtkWidget * | gedit_window_get_side_panel ()
GtkWidget * | gedit_window_get_bottom_panel ()
GtkWidget * | gedit_window_get_statusbar ()
GeditWindowState | gedit_window_get_state ()
GeditTab * | gedit_window_get_tab_from_location ()
GeditMessageBus * | gedit_window_get_message_bus ()

## Properties

GeditWindowState | state | Read

## Signals

void | active-tab-changed | Run First
void | active-tab-state-changed | Run First
void | tab-added | Run First
void | tab-removed | Run First
void | tabs-reordered | Run First

## Types and Values

enum | GeditWindowState
| GeditWindowPrivate
struct | GeditWindow

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── GtkApplicationWindow
                                ╰── GeditWindow

## Implemented Interfaces

GeditWindow implements AtkImplementorIface, GtkBuildable, GActionGroup and GActionMap.

## Description

## Functions

### gedit_window_create_tab ()

    GeditTab *
    gedit_window_create_tab (GeditWindow *window,
                             gboolean jump_to);

Creates a new GeditTab and adds the new tab to the GeditNotebook. In case `jump_to` is `TRUE` the GeditNotebook switches to that new GeditTab.

#### Parameters

window | a GeditWindow |
jump_to | `TRUE` to set the new GeditTab as active |

#### Returns

a new GeditTab.

[transfer none]

### gedit_window_create_tab_from_location ()

    GeditTab *
    gedit_window_create_tab_from_location (GeditWindow *window,
                                           GFile *location,
                                           const GeditEncoding *encoding,
                                           gint line_pos,
                                           gint column_pos,
                                           gboolean create,
                                           gboolean jump_to);

Creates a new GeditTab loading the document specified by `uri` . In case `jump_to` is `TRUE` the GeditNotebook swithes to that new GeditTab. Whether `create` is `TRUE`, creates a new empty document if location does not refer to an existing file

#### Parameters

window | a GeditWindow |
location | the location of the document |
encoding | a GeditEncoding, or `NULL`. | [allow-none]
line_pos | the line position to visualize |
column_pos | the column position to visualize |
create | `TRUE` to create a new document in case `uri` does exist |
jump_to | `TRUE` to set the new GeditTab as active |

#### Returns

a new GeditTab.

[transfer none]

### gedit_window_create_tab_from_stream ()

    GeditTab *
    gedit_window_create_tab_from_stream (GeditWindow *window,
                                         GInputStream *stream,
                                         const GeditEncoding *encoding,
                                         gint line_pos,
                                         gint column_pos,
                                         gboolean jump_to);

#### Parameters

window | a GeditWindow |
stream | a GInputStream |
encoding | a GeditEncoding, or `NULL`. | [allow-none]
line_pos | the line position to visualize |
column_pos | the column position to visualize |
jump_to | `TRUE` to set the new GeditTab as active |

#### Returns

a new GeditTab.

[transfer none]

### gedit_window_close_tab ()

    void
    gedit_window_close_tab (GeditWindow *window,
                            GeditTab *tab);

Closes the `tab` .

#### Parameters

window | a GeditWindow |
tab | the GeditTab to close |

### gedit_window_close_all_tabs ()

    void
    gedit_window_close_all_tabs (GeditWindow *window);

Closes all opened tabs.

#### Parameters

window | a GeditWindow |

### gedit_window_close_tabs ()

    void
    gedit_window_close_tabs (GeditWindow *window,
                             const GList *tabs);

Closes all tabs specified by `tabs` .

#### Parameters

window | a GeditWindow |
tabs | a list of GeditTab. | [element-type Gedit.Tab]

### gedit_window_get_active_tab ()

    GeditTab *
    gedit_window_get_active_tab (GeditWindow *window);

Gets the active GeditTab in the `window` .

#### Parameters

window | a GeditWindow |

#### Returns

the active GeditTab in the `window` .

[transfer none]

### gedit_window_set_active_tab ()

    void
    gedit_window_set_active_tab (GeditWindow *window,
                                 GeditTab *tab);

Switches to the tab that matches with `tab` .

#### Parameters

window | a GeditWindow |
tab | a GeditTab |

### gedit_window_get_active_view ()

    GeditView *
    gedit_window_get_active_view (GeditWindow *window);

Gets the active GeditView.

#### Parameters

window | a GeditWindow |

#### Returns

the active GeditView.

[transfer none]

### gedit_window_get_active_document ()

    GeditDocument *
    gedit_window_get_active_document (GeditWindow *window);

Gets the active GeditDocument.

#### Parameters

window | a GeditWindow |

#### Returns

the active GeditDocument.

[transfer none]

### gedit_window_get_documents ()

    GList *
    gedit_window_get_documents (GeditWindow *window);

Gets a newly allocated list with all the documents in the window. This list must be freed.

#### Parameters

window | a GeditWindow |

#### Returns

a newly allocated list with all the documents in the window.

[element-type Gedit.Document][transfer container]

### gedit_window_get_unsaved_documents ()

    GList *
    gedit_window_get_unsaved_documents (GeditWindow *window);

Gets the list of documents that need to be saved before closing the window.

#### Parameters

window | a GeditWindow |

#### Returns

a list of GeditDocument that need to be saved before closing the window.

[element-type Gedit.Document][transfer container]

### gedit_window_get_views ()

    GList *
    gedit_window_get_views (GeditWindow *window);

Gets a list with all the views in the window. This list must be freed.

#### Parameters

window | a GeditWindow |

#### Returns

a newly allocated list with all the views in the window.

[element-type Gedit.View][transfer container]

### gedit_window_get_group ()

    GtkWindowGroup *
    gedit_window_get_group (GeditWindow *window);

Gets the GtkWindowGroup in which `window` resides.

#### Parameters

window | a GeditWindow |

#### Returns

the GtkWindowGroup.

[transfer none]

### gedit_window_get_side_panel ()

    GtkWidget *
    gedit_window_get_side_panel (GeditWindow *window);

Gets the side panel of the `window` .

#### Parameters

window | a GeditWindow |

#### Returns

the side panel's GtkStack.

[transfer none]

### gedit_window_get_bottom_panel ()

    GtkWidget *
    gedit_window_get_bottom_panel (GeditWindow *window);

Gets the bottom panel of the `window` .

#### Parameters

window | a GeditWindow |

#### Returns

the bottom panel's GtkStack.

[transfer none]

### gedit_window_get_statusbar ()

    GtkWidget *
    gedit_window_get_statusbar (GeditWindow *window);

Gets the GeditStatusbar of the `window` .

#### Parameters

window | a GeditWindow |

#### Returns

the GeditStatusbar of the `window` .

[transfer none]

### gedit_window_get_state ()

    GeditWindowState
    gedit_window_get_state (GeditWindow *window);

Retrieves the state of the `window` .

#### Parameters

window | a GeditWindow |

#### Returns

the current GeditWindowState of the `window` .

### gedit_window_get_tab_from_location ()

    GeditTab *
    gedit_window_get_tab_from_location (GeditWindow *window,
                                        GFile *location);

Gets the GeditTab that matches with the given `location` .

#### Parameters

window | a GeditWindow |
location | a GFile |

#### Returns

the GeditTab that matches with the given `location` .

[transfer none]

### gedit_window_get_message_bus ()

    GeditMessageBus *
    gedit_window_get_message_bus (GeditWindow *window);

Gets the GeditMessageBus associated with `window` . The returned reference is owned by the window and should not be unreffed.

#### Parameters

window | a GeditWindow |

#### Returns

the GeditMessageBus associated with `window` .

[transfer none]

## Types and Values

### enum GeditWindowState

#### Members

GEDIT_WINDOW_STATE_NORMAL |  |
GEDIT_WINDOW_STATE_SAVING |  |
GEDIT_WINDOW_STATE_PRINTING |  |
GEDIT_WINDOW_STATE_LOADING |  |
GEDIT_WINDOW_STATE_ERROR |  |

### GeditWindowPrivate

    typedef struct _GeditWindowPrivate GeditWindowPrivate;

### struct GeditWindow

    struct GeditWindow;

## Property Details

### The `“state”` property

      “state”                    GeditWindowState

The window's state.

Flags: Read

## Signal Details

### The `“active-tab-changed”` signal

    void
    user_function (GeditWindow *geditwindow,
                   GeditTab    *arg1,
                   gpointer     user_data)

Flags: Run First

### The `“active-tab-state-changed”` signal

    void
    user_function (GeditWindow *geditwindow,
                   gpointer     user_data)

Flags: Run First

### The `“tab-added”` signal

    void
    user_function (GeditWindow *geditwindow,
                   GeditTab    *arg1,
                   gpointer     user_data)

Flags: Run First

### The `“tab-removed”` signal

    void
    user_function (GeditWindow *geditwindow,
                   GeditTab    *arg1,
                   gpointer     user_data)

Flags: Run First

### The `“tabs-reordered”` signal

    void
    user_function (GeditWindow *geditwindow,
                   gpointer     user_data)

Flags: Run First