Move type and function declarations.
(panel_view_mode_t): move from panel.h to layout.h. (panel_update_cols): move from layout.[ch] to panel.[ch] Fixed related includes. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
Этот коммит содержится в:
родитель
b49c165c59
Коммит
1b53918e0a
@ -64,6 +64,7 @@
|
||||
#include "src/filemanager/usermenu.h" /* user_menu_cmd() */
|
||||
|
||||
#include "src/setup.h" /* option_tab_spacing */
|
||||
#include "src/main.h" /* macro_index */
|
||||
#include "src/learn.h" /* learn_keys */
|
||||
#include "src/keybind-defaults.h"
|
||||
|
||||
|
@ -62,12 +62,12 @@
|
||||
|
||||
#include "src/history.h"
|
||||
#include "src/setup.h" /* option_tab_spacing */
|
||||
#include "src/main.h" /* mactos_t */
|
||||
#include "src/selcodepage.h"
|
||||
#include "src/keybind-defaults.h"
|
||||
#include "src/util.h" /* check_for_default() */
|
||||
#include "src/filemanager/layout.h" /* mc_refresh() */
|
||||
|
||||
|
||||
#include "edit-impl.h"
|
||||
#include "edit-widget.h"
|
||||
#include "editcmd_dialogs.h"
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "lib/charsets.h"
|
||||
|
||||
#include "src/setup.h" /* edit_tab_spacing */
|
||||
#include "src/main.h" /* macro_index */
|
||||
|
||||
#include "edit-impl.h"
|
||||
#include "edit-widget.h"
|
||||
|
@ -51,6 +51,7 @@
|
||||
#include "src/setup.h" /* use_file_to_check_type */
|
||||
#include "src/execute.h"
|
||||
#include "src/history.h"
|
||||
#include "src/main.h" /* do_cd */
|
||||
|
||||
#include "src/consaver/cons.saver.h"
|
||||
#include "src/viewer/mcviewer.h"
|
||||
@ -60,7 +61,6 @@
|
||||
#endif
|
||||
|
||||
#include "usermenu.h"
|
||||
#include "layout.h"
|
||||
|
||||
#include "ext.h"
|
||||
|
||||
|
@ -975,45 +975,6 @@ set_display_type (int num, panel_view_mode_t type)
|
||||
g_free (old_widget);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
panel_update_cols (Widget * widget, panel_display_t frame_size)
|
||||
{
|
||||
int cols, origin;
|
||||
|
||||
/* don't touch panel if it is not in dialog yet */
|
||||
/* if panel is not in dialog it is not in widgets list
|
||||
and cannot be compared with get_panel_widget() result */
|
||||
if (widget->owner == NULL)
|
||||
return;
|
||||
|
||||
if (horizontal_split)
|
||||
{
|
||||
widget->cols = COLS;
|
||||
return;
|
||||
}
|
||||
|
||||
if (frame_size == frame_full)
|
||||
{
|
||||
cols = COLS;
|
||||
origin = 0;
|
||||
}
|
||||
else if (widget == get_panel_widget (0))
|
||||
{
|
||||
cols = first_panel_size;
|
||||
origin = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cols = COLS - first_panel_size;
|
||||
origin = first_panel_size;
|
||||
}
|
||||
|
||||
widget->cols = cols;
|
||||
widget->x = origin;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
/** This routine is deeply sticked to the two panels idea.
|
||||
What should it do in more panels. ANSWER - don't use it
|
||||
|
@ -8,14 +8,23 @@
|
||||
#include "lib/global.h"
|
||||
#include "lib/widget.h"
|
||||
|
||||
#include "panel.h"
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
view_listing = 0, /* Directory listing */
|
||||
view_info = 1, /* Information panel */
|
||||
view_tree = 2, /* Tree view */
|
||||
view_quick = 3, /* Quick view */
|
||||
view_nothing = 4, /* Undefined */
|
||||
} panel_view_mode_t;
|
||||
|
||||
/*** enums ***************************************************************************************/
|
||||
|
||||
/*** structures declarations (and typedefs of structures)*****************************************/
|
||||
|
||||
struct WPanel;
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
||||
extern int equal_split;
|
||||
@ -38,7 +47,6 @@ void setup_panels (void);
|
||||
void destroy_panels (void);
|
||||
void setup_cmdline (void);
|
||||
void set_display_type (int num, panel_view_mode_t type);
|
||||
void panel_update_cols (Widget * widget, panel_display_t frame_size);
|
||||
void swap_panels (void);
|
||||
panel_view_mode_t get_display_type (int idx);
|
||||
panel_view_mode_t get_current_type (void);
|
||||
@ -52,7 +60,7 @@ struct Widget *get_panel_widget (int idx);
|
||||
struct WPanel *get_other_panel (void);
|
||||
|
||||
void save_panel_dir (int idx);
|
||||
const char *get_panel_dir_for (const WPanel * widget);
|
||||
const char *get_panel_dir_for (const struct WPanel * widget);
|
||||
|
||||
void set_hintbar (const char *str);
|
||||
|
||||
|
@ -3871,6 +3871,45 @@ set_panel_formats (WPanel * p)
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
void
|
||||
panel_update_cols (Widget * widget, panel_display_t frame_size)
|
||||
{
|
||||
int cols, origin;
|
||||
|
||||
/* don't touch panel if it is not in dialog yet */
|
||||
/* if panel is not in dialog it is not in widgets list
|
||||
and cannot be compared with get_panel_widget() result */
|
||||
if (widget->owner == NULL)
|
||||
return;
|
||||
|
||||
if (horizontal_split)
|
||||
{
|
||||
widget->cols = COLS;
|
||||
return;
|
||||
}
|
||||
|
||||
if (frame_size == frame_full)
|
||||
{
|
||||
cols = COLS;
|
||||
origin = 0;
|
||||
}
|
||||
else if (widget == get_panel_widget (0))
|
||||
{
|
||||
cols = first_panel_size;
|
||||
origin = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
cols = COLS - first_panel_size;
|
||||
origin = first_panel_size;
|
||||
}
|
||||
|
||||
widget->cols = cols;
|
||||
widget->x = origin;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------------------------------------- */
|
||||
|
||||
/* Select current item and readjust the panel */
|
||||
void
|
||||
select_item (WPanel * panel)
|
||||
|
@ -35,15 +35,6 @@ enum list_types
|
||||
list_user /* User defined */
|
||||
};
|
||||
|
||||
typedef enum
|
||||
{
|
||||
view_listing = 0, /* Directory listing */
|
||||
view_info = 1, /* Information panel */
|
||||
view_tree = 2, /* Tree view */
|
||||
view_quick = 3, /* Quick view */
|
||||
view_nothing = 4, /* Undefined */
|
||||
} panel_view_mode_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
frame_full, /* full screen frame */
|
||||
@ -157,6 +148,7 @@ void panel_change_encoding (WPanel * panel);
|
||||
|
||||
void update_panels (panel_update_flags_t flags, const char *current_file);
|
||||
int set_panel_formats (WPanel * p);
|
||||
void panel_update_cols (Widget * widget, panel_display_t frame_size);
|
||||
|
||||
void try_to_select (WPanel * panel, const char *name);
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "lib/global.h" /* GError */
|
||||
|
||||
#include "filemanager/panel.h" /* WPanel, panel_view_mode_t */
|
||||
#include "filemanager/layout.h" /* panel_view_mode_t */
|
||||
|
||||
/*** typedefs(not structures) and defined constants **********************************************/
|
||||
|
||||
@ -52,6 +52,8 @@ typedef struct
|
||||
gboolean torben_fj_mode; /* If TRUE, use some usability hacks by Torben */
|
||||
} panels_options_t;
|
||||
|
||||
struct WPanel;
|
||||
|
||||
/*** global variables defined in .c file *********************************************************/
|
||||
|
||||
/* global paremeters */
|
||||
@ -106,8 +108,8 @@ char *load_anon_passwd (void);
|
||||
void load_keymap_defs (gboolean load_from_file);
|
||||
void free_keymap_defs (void);
|
||||
|
||||
void panel_load_setup (WPanel * panel, const char *section);
|
||||
void panel_save_setup (WPanel * panel, const char *section);
|
||||
void panel_load_setup (struct WPanel * panel, const char *section);
|
||||
void panel_save_setup (struct WPanel * panel, const char *section);
|
||||
|
||||
void panels_load_options (void);
|
||||
void panels_save_options (void);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user