Exemplo n.º 1
0
void
gui_layout_window_apply_tree (struct t_gui_layout_window *layout_window,
                              int internal_id_current_window,
                              struct t_gui_window **current_window)
{
    struct t_gui_window *old_window;

    if (layout_window->split_pct != 0)
    {
        /* node */
        old_window = gui_current_window;

        if (layout_window->split_horiz)
        {
            gui_window_split_horizontal (gui_current_window,
                                         layout_window->split_pct);
        }
        else
        {
            gui_window_split_vertical (gui_current_window,
                                       layout_window->split_pct);
        }

        if (layout_window->child2)
        {
            gui_layout_window_apply_tree (layout_window->child2,
                                          internal_id_current_window,
                                          current_window);
        }

        if (old_window != gui_current_window)
            gui_window_switch (old_window);

        if (layout_window->child1)
        {
            gui_layout_window_apply_tree (layout_window->child1,
                                          internal_id_current_window,
                                          current_window);
        }
    }
    else
    {
        /* leaf */
        if (layout_window->internal_id == internal_id_current_window)
            *current_window = gui_current_window;

        gui_window_set_layout_plugin_name (gui_current_window,
                                           layout_window->plugin_name);
        gui_window_set_layout_buffer_name (gui_current_window,
                                           layout_window->buffer_name);
    }
}
Exemplo n.º 2
0
void
gui_layout_window_apply (struct t_gui_layout *layout,
                         int internal_id_current_window)
{
    struct t_gui_window *old_window, *ptr_current_window;

    if (!layout || !layout->layout_windows)
        return;

    gui_window_merge_all (gui_current_window);

    old_window = gui_current_window;
    ptr_current_window = NULL;

    gui_layout_window_apply_tree (layout->layout_windows,
                                  internal_id_current_window,
                                  &ptr_current_window);

    gui_layout_window_assign_all_buffers ();

    gui_window_switch ((ptr_current_window) ? ptr_current_window : old_window);
}
Exemplo n.º 3
0
void
gui_layout_window_apply (struct t_gui_layout_window *layout_windows,
                         int internal_id_current_window)
{
    struct t_gui_window *old_window;

    if (!layout_windows)
        return;

    gui_window_merge_all (gui_current_window);

    old_window = gui_current_window;
    gui_layout_ptr_current_window = NULL;

    gui_layout_window_apply_tree (layout_windows,
                                  internal_id_current_window);

    gui_layout_window_check_all_buffers ();

    gui_window_switch ((gui_layout_ptr_current_window) ?
                       gui_layout_ptr_current_window : old_window);
}