2009-02-05 21:28:18 +03:00
|
|
|
|
|
|
|
/** \file panel.h
|
|
|
|
* \brief Header: defines WPanel structure
|
|
|
|
*/
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#ifndef MC_PANEL_H
|
|
|
|
#define MC_PANEL_H
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2002-11-11 09:23:59 +03:00
|
|
|
#include "dir.h" /* dir_list */
|
2003-10-25 03:20:30 +04:00
|
|
|
#include "dialog.h" /* Widget */
|
2009-02-06 02:30:45 +03:00
|
|
|
#include "fs.h" /* MC_MAXPATHLEN */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2002-11-11 08:55:22 +03:00
|
|
|
#define selection(p) (&(p->dir.list[p->selected]))
|
|
|
|
#define DEFAULT_USER_FORMAT "half type name | size | perm"
|
|
|
|
|
2002-09-27 04:47:29 +04:00
|
|
|
#define LIST_TYPES 4
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
enum list_types {
|
|
|
|
list_full, /* Name, size, perm/date */
|
|
|
|
list_brief, /* Name */
|
|
|
|
list_long, /* Like ls -l */
|
2002-09-27 04:47:29 +04:00
|
|
|
list_user /* User defined */
|
1998-02-27 07:54:42 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
enum view_modes {
|
|
|
|
view_listing, /* Directory listing */
|
|
|
|
view_info, /* Information panel */
|
|
|
|
view_tree, /* Tree view */
|
|
|
|
view_quick, /* Quick view */
|
|
|
|
view_nothing /* Undefined */
|
|
|
|
};
|
|
|
|
|
|
|
|
enum panel_display_enum {
|
|
|
|
frame_full, /* full screen frame */
|
|
|
|
frame_half /* half screen frame */
|
|
|
|
};
|
|
|
|
|
2002-11-11 08:55:22 +03:00
|
|
|
struct format_e;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2002-11-11 10:35:08 +03:00
|
|
|
typedef struct WPanel {
|
1998-02-27 07:54:42 +03:00
|
|
|
Widget widget;
|
|
|
|
dir_list dir; /* Directory contents */
|
1999-09-14 00:34:53 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
int list_type; /* listing type (was view_type) */
|
|
|
|
int active; /* If panel is currently selected */
|
|
|
|
char cwd [MC_MAXPATHLEN];/* Current Working Directory */
|
|
|
|
char lwd [MC_MAXPATHLEN];/* Last Working Directory */
|
2003-02-18 08:25:45 +03:00
|
|
|
GList *dir_history; /* directory history */
|
1998-03-31 01:04:59 +04:00
|
|
|
char *hist_name; /* directory history name for history file */
|
1998-02-27 07:54:42 +03:00
|
|
|
int count; /* Number of files in dir structure */
|
|
|
|
int marked; /* Count of marked files */
|
|
|
|
int dirs_marked; /* Count of marked directories */
|
2000-06-15 11:03:49 +04:00
|
|
|
double total; /* Bytes in marked files */
|
1998-02-27 07:54:42 +03:00
|
|
|
int top_file; /* The file showed on the top of the panel */
|
|
|
|
int selected; /* Index to the selected file */
|
|
|
|
int reverse; /* Show listing in reverse? */
|
|
|
|
int case_sensitive; /* Listing is case sensitive? */
|
2009-01-26 02:26:31 +03:00
|
|
|
int exec_first; /* Show executable top in list? */
|
1998-02-27 07:54:42 +03:00
|
|
|
int split; /* Split panel to allow two columns */
|
|
|
|
int is_panelized; /* Flag: special filelisting, can't reload */
|
|
|
|
int frame_size; /* half or full frame */
|
|
|
|
sortfn *sort_type; /* Sort type */
|
|
|
|
char *filter; /* File name filter */
|
|
|
|
|
|
|
|
int dirty; /* Should we redisplay the panel? */
|
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
int user_mini_status; /* Is user_status_format used */
|
|
|
|
char *user_format; /* User format */
|
1998-02-27 07:54:42 +03:00
|
|
|
char *user_status_format[LIST_TYPES];/* User format for status line */
|
|
|
|
|
2002-11-11 08:55:22 +03:00
|
|
|
struct format_e *format; /* Display format */
|
|
|
|
struct format_e *status_format; /* Mini status format */
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
int format_modified; /* If the format was changed this is set */
|
1999-09-14 00:34:53 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
char *panel_name; /* The panel name */
|
|
|
|
struct stat dir_stat; /* Stat of current dir: used by execute () */
|
|
|
|
|
|
|
|
int searching;
|
|
|
|
char search_buffer [256];
|
2008-12-29 01:56:59 +03:00
|
|
|
char search_char [MB_LEN_MAX]; /*buffer for multibytes characters*/
|
|
|
|
int search_chpoint; /*point after last characters in search_char*/
|
1998-02-27 07:54:42 +03:00
|
|
|
} WPanel;
|
|
|
|
|
2001-03-30 05:29:08 +04:00
|
|
|
WPanel *panel_new (const char *panel_name);
|
2009-08-12 16:03:36 +04:00
|
|
|
WPanel *panel_new_with_dir (const char *panel_name, const char *dr);
|
1999-03-03 00:33:48 +03:00
|
|
|
void panel_clean_dir (WPanel *panel);
|
1998-04-28 08:29:19 +04:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
extern int torben_fj_mode;
|
|
|
|
extern int permission_mode;
|
|
|
|
extern int filetype_mode;
|
|
|
|
extern int show_mini_info;
|
|
|
|
extern int panel_scroll_pages;
|
2001-11-15 02:20:37 +03:00
|
|
|
extern int fast_reload;
|
1998-02-27 07:54:42 +03:00
|
|
|
|
1998-12-31 02:49:58 +03:00
|
|
|
void panel_reload (WPanel *panel);
|
|
|
|
void panel_set_sort_order (WPanel *panel, sortfn *sort_order);
|
|
|
|
void panel_re_sort (WPanel *panel);
|
2009-04-21 12:48:13 +04:00
|
|
|
void set_panel_encoding (WPanel *);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
2009-08-04 14:44:47 +04:00
|
|
|
#define UP_OPTIMIZE 0
|
|
|
|
#define UP_RELOAD 1
|
|
|
|
#define UP_ONLY_CURRENT 2
|
|
|
|
|
|
|
|
#define UP_KEEPSEL ((char *) -1)
|
|
|
|
|
2003-09-10 08:42:13 +04:00
|
|
|
void update_dirty_panels (void);
|
2009-08-04 14:44:47 +04:00
|
|
|
void update_panels (int force_update, const char *current_file);
|
1998-02-27 07:54:42 +03:00
|
|
|
void panel_update_cols (Widget *widget, int frame_size);
|
|
|
|
int set_panel_formats (WPanel *p);
|
|
|
|
|
2003-10-26 09:32:42 +03:00
|
|
|
#define other_panel get_other_panel()
|
2002-11-14 10:25:18 +03:00
|
|
|
|
1998-02-27 07:54:42 +03:00
|
|
|
extern WPanel *left_panel;
|
|
|
|
extern WPanel *right_panel;
|
|
|
|
extern WPanel *current_panel;
|
|
|
|
|
2004-08-29 20:42:40 +04:00
|
|
|
void try_to_select (WPanel *panel, const char *name);
|
1998-02-27 07:54:42 +03:00
|
|
|
|
|
|
|
void unmark_files (WPanel *panel);
|
|
|
|
void select_item (WPanel *panel);
|
|
|
|
|
|
|
|
extern Hook *select_file_hook;
|
|
|
|
|
1998-12-25 00:37:24 +03:00
|
|
|
void recalculate_panel_summary (WPanel *panel);
|
1998-02-27 07:54:42 +03:00
|
|
|
void file_mark (WPanel *panel, int index, int val);
|
|
|
|
void do_file_mark (WPanel *panel, int index, int val);
|
|
|
|
|
2002-11-11 08:55:22 +03:00
|
|
|
void directory_history_next (WPanel *panel);
|
|
|
|
void directory_history_prev (WPanel *panel);
|
|
|
|
void directory_history_list (WPanel *panel);
|
1998-04-09 08:58:24 +04:00
|
|
|
|
2004-12-03 22:17:46 +03:00
|
|
|
#endif
|