Merge branch '4650_shift_f4_segfault'
[midnight-commander.git] / src / filemanager / layout.h
blob4c70fba6f1f85f346dd942fc707771a7b1eacbea
1 /** \file layout.h
2 * \brief Header: panel layout module
3 */
5 #ifndef MC__LAYOUT_H
6 #define MC__LAYOUT_H
8 #include "lib/global.h"
9 #include "lib/widget.h"
11 #include "panel.h"
13 /*** typedefs(not structures) and defined constants **********************************************/
15 typedef enum
17 view_listing = 0, // Directory listing
18 view_info = 1, // Information panel
19 view_tree = 2, // Tree view
20 view_quick = 3, // Quick view
21 view_nothing = 4, // Undefined
22 } panel_view_mode_t;
24 /*** enums ***************************************************************************************/
26 /*** structures declarations (and typedefs of structures)*****************************************/
28 typedef struct
30 gboolean horizontal_split;
32 // vertical split
33 gboolean vertical_equal;
34 int left_panel_size;
36 // horizontal split
37 gboolean horizontal_equal;
38 int top_panel_size;
39 } panels_layout_t;
41 /*** global variables defined in .c file *********************************************************/
43 extern int output_lines;
44 extern gboolean command_prompt;
45 extern gboolean menubar_visible;
46 extern int output_start_y;
47 extern gboolean xterm_title;
48 extern gboolean free_space;
49 extern gboolean nice_rotating_dash;
51 extern int ok_to_refresh;
53 extern panels_layout_t panels_layout;
55 /*** declarations of public functions ************************************************************/
56 void layout_change (void);
57 void layout_box (void);
58 void panel_update_cols (Widget *widget, panel_display_t frame_size);
59 void setup_panels (void);
60 void panels_split_equal (void);
61 void panels_split_more (void);
62 void panels_split_less (void);
63 void destroy_panels (void);
64 void setup_cmdline (void);
65 void create_panel (int num, panel_view_mode_t type);
66 void swap_panels (void);
67 panel_view_mode_t get_panel_type (int idx);
68 MC_MOCKABLE panel_view_mode_t get_current_type (void);
69 panel_view_mode_t get_other_type (void);
70 int get_current_index (void);
71 int get_other_index (void);
72 const char *get_nth_panel_name (int num);
74 Widget *get_panel_widget (int idx);
76 WPanel *get_other_panel (void);
78 void save_panel_dir (int idx);
79 char *get_panel_dir_for (const WPanel *widget);
81 void set_hintbar (const char *str);
83 // Rotating dash routines
84 void use_dash (gboolean flag); // Disable/Enable rotate_dash routines
85 void rotate_dash (gboolean show);
87 #ifdef ENABLE_SUBSHELL
88 gboolean do_load_prompt (void);
89 int load_prompt (int fd, void *unused);
90 #endif
92 void update_xterm_title_path (void);
93 void update_terminal_cwd (void);
95 void title_path_prepare (char **path, char **login);
97 /*** inline functions ****************************************************************************/
99 #endif