## IdeLayoutGrid IdeLayoutGrid — A grid for IdeLayoutView |

## Functions

GtkWidget * | ide_layout_grid_new ()
IdeLayoutGridColumn * | ide_layout_grid_get_nth_column ()
IdeLayoutView * | ide_layout_grid_focus_neighbor ()
IdeLayoutGridColumn * | ide_layout_grid_get_current_column ()
void | ide_layout_grid_set_current_column ()
IdeLayoutStack * | ide_layout_grid_get_current_stack ()
IdeLayoutView * | ide_layout_grid_get_current_view ()
guint | ide_layout_grid_count_views ()
void | ide_layout_grid_foreach_view ()

## Properties

IdeLayoutGridColumn * | current-column | Read / Write
IdeLayoutStack * | current-stack | Read
IdeLayoutView * | current-view | Read

## Signals

IdeLayoutStack* | create-stack | Run Last
IdeLayoutView* | create-view | Run Last

## Types and Values

#define | IDE_TYPE_LAYOUT_GRID
struct | IdeLayoutGridClass
| IdeLayoutGrid

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── DzlMultiPaned
                        ╰── IdeLayoutGrid

## Implemented Interfaces

IdeLayoutGrid implements AtkImplementorIface, GtkBuildable, GtkOrientable and GListModel.

## Description

The IdeLayoutGrid provides a grid of views that the user may manipulate.

Internally, this is implemented with IdeLayoutGrid at the top containing one or more of IdeLayoutGridColumn. Those columns contain one or more IdeLayoutStack. The stack can contain many IdeLayoutView.

IdeLayoutGrid implements the GListModel interface to simplify the process of listing (with deduplication) the views that are contianed within the IdeLayoutGrid. If you would instead like to see all possible views in the stack, use the `ide_layout_grid_foreach_view()` API.

## Functions

### ide_layout_grid_new ()

    GtkWidget *
    ide_layout_grid_new (void);

Creates a new IdeLayoutGrid.

#### Returns

A newly created IdeLayoutGrid.

[transfer full]

Since: 3.26

### ide_layout_grid_get_nth_column ()

    IdeLayoutGridColumn *
    ide_layout_grid_get_nth_column (IdeLayoutGrid *self,
                                    gint nth);

Gets the `nth` column from the grid.

If `nth` is -1, then a new column at the beginning of the grid is created.

If `nth` is >= the number of columns in the grid, then a new column at the end of the grid is created.

#### Parameters

self | a IdeLayoutGrid |
nth | the index of the column, or -1 |

#### Returns

An IdeLayoutGridColumn.

[transfer none]

### ide_layout_grid_focus_neighbor ()

    IdeLayoutView *
    ide_layout_grid_focus_neighbor (IdeLayoutGrid *self,
                                    GtkDirectionType dir);

Attempts to focus a neighbor IdeLayoutView in the grid based on the direction requested.

If an IdeLayoutView was focused, it will be returned to the caller.

#### Parameters

self | An IdeLayoutGrid |
dir | the direction for the focus change |

#### Returns

An IdeLayoutView or `NULL`.

[transfer none][nullable]

### ide_layout_grid_get_current_column ()

    IdeLayoutGridColumn *
    ide_layout_grid_get_current_column (IdeLayoutGrid *self);

Gets the most recently focused column of the grid.

#### Parameters

self | a IdeLayoutGrid |

#### Returns

An IdeLayoutGridColumn.

[transfer none][not nullable]

### ide_layout_grid_set_current_column ()

    void
    ide_layout_grid_set_current_column (IdeLayoutGrid *self,
                                        IdeLayoutGridColumn *column);

Sets the current column for the grid. Generally this is automatically updated for you when the focus changes within the workbench.

`column` can be `NULL` out of convenience.

#### Parameters

self | an IdeLayoutGrid |
column | an IdeLayoutGridColumn or `NULL`. | [nullable]

### ide_layout_grid_get_current_stack ()

    IdeLayoutStack *
    ide_layout_grid_get_current_stack (IdeLayoutGrid *self);

Gets the most recently focused stack. This is useful when you want to open a document on the stack the user last focused.

#### Parameters

self | a IdeLayoutGrid |

#### Returns

an IdeLayoutStack or `NULL`.

[transfer none][nullable]

Since: 3.26

### ide_layout_grid_get_current_view ()

    IdeLayoutView *
    ide_layout_grid_get_current_view (IdeLayoutGrid *self);

Gets the most recent view used by the user as determined by tracking the window focus.

#### Parameters

self | a IdeLayoutGrid |

#### Returns

An IdeLayoutView or `NULL`.

[transfer none]

Since: 3.26

### ide_layout_grid_count_views ()

    guint
    ide_layout_grid_count_views (IdeLayoutGrid *self);

### ide_layout_grid_foreach_view ()

    void
    ide_layout_grid_foreach_view (IdeLayoutGrid *self,
                                  GtkCallback callback,
                                  gpointer user_data);

This function will call `callback` for every view found in `self` .

#### Parameters

self | a IdeLayoutGrid |
callback | A callback for each view. | [scope call][closure user_data]
user_data | user data for `callback` |

Since: 3.26

## Types and Values

### IDE_TYPE_LAYOUT_GRID

    #define IDE_TYPE_LAYOUT_GRID (ide_layout_grid_get_type())

### struct IdeLayoutGridClass

    struct IdeLayoutGridClass {
      DzlMultiPanedClass parent_class;

      IdeLayoutStack *(*create_stack) (IdeLayoutGrid *self);
      IdeLayoutView  *(*create_view)  (IdeLayoutGrid *self,
                                       const gchar   *uri);
    };

### IdeLayoutGrid

    typedef struct _IdeLayoutGrid IdeLayoutGrid;

## Property Details

### The `“current-column”` property

      “current-column”           IdeLayoutGridColumn *

The most recently focused grid column.

Flags: Read / Write

### The `“current-stack”` property

      “current-stack”            IdeLayoutStack *

The most recently focused IdeLayoutStack.

Flags: Read

### The `“current-view”` property

      “current-view”             IdeLayoutView *

The most recently focused IdeLayoutView.

Flags: Read

## Signal Details

### The `“create-stack”` signal

    IdeLayoutStack*
    user_function (IdeLayoutGrid *self,
                   gpointer       user_data)

Creates a new stack to be added to the grid.

#### Parameters

self | an IdeLayoutGrid |
user_data | user data set when the signal handler was connected. |

#### Returns

A newly created IdeLayoutStack.

[transfer full]

Flags: Run Last

### The `“create-view”` signal

    IdeLayoutView*
    user_function (IdeLayoutGrid *self,
                   gchar         *uri,
                   gpointer       user_data)

Creates a new view for `uri` to be added to the grid.

#### Parameters

self | an IdeLayoutGrid |
uri | the URI to open |
user_data | user data set when the signal handler was connected. |

#### Returns

A newly created IdeLayoutView.

[transfer full]

Flags: Run Last

Since: 3.28