4 #include "dir.h" /* dir_list */
5 #include "dlg.h" /* Widget */
7 #define selection(p) (&(p->dir.list[p->selected]))
8 #define other_panel get_other_panel()
9 #define DEFAULT_USER_FORMAT "half type name | size | perm"
14 list_full
, /* Name, size, perm/date */
15 list_brief
, /* Name */
16 list_long
, /* Like ls -l */
17 list_user
/* User defined */
21 view_listing
, /* Directory listing */
22 view_info
, /* Information panel */
23 view_tree
, /* Tree view */
24 view_quick
, /* Quick view */
25 view_nothing
/* Undefined */
28 enum panel_display_enum
{
29 frame_full
, /* full screen frame */
30 frame_half
/* half screen frame */
36 typedef struct WPanel
{
38 dir_list dir
; /* Directory contents */
40 int list_type
; /* listing type (was view_type) */
41 int active
; /* If panel is currently selected */
42 char cwd
[MC_MAXPATHLEN
];/* Current Working Directory */
43 char lwd
[MC_MAXPATHLEN
];/* Last Working Directory */
44 GList
*dir_history
; /* directory history */
45 char *hist_name
; /* directory history name for history file */
46 int count
; /* Number of files in dir structure */
47 int marked
; /* Count of marked files */
48 int dirs_marked
; /* Count of marked directories */
49 double total
; /* Bytes in marked files */
50 int top_file
; /* The file showed on the top of the panel */
51 int selected
; /* Index to the selected file */
52 int reverse
; /* Show listing in reverse? */
53 int case_sensitive
; /* Listing is case sensitive? */
54 int split
; /* Split panel to allow two columns */
55 int is_panelized
; /* Flag: special filelisting, can't reload */
56 int frame_size
; /* half or full frame */
57 sortfn
*sort_type
; /* Sort type */
58 char *filter
; /* File name filter */
60 int dirty
; /* Should we redisplay the panel? */
62 int user_mini_status
; /* Is user_status_format used */
63 char *user_format
; /* User format */
64 char *user_status_format
[LIST_TYPES
];/* User format for status line */
66 struct format_e
*format
; /* Display format */
67 struct format_e
*status_format
; /* Mini status format */
69 int format_modified
; /* If the format was changed this is set */
71 char *panel_name
; /* The panel name */
72 struct stat dir_stat
; /* Stat of current dir: used by execute () */
75 char search_buffer
[256];
78 WPanel
*panel_new (const char *panel_name
);
79 void panel_clean_dir (WPanel
*panel
);
81 extern int torben_fj_mode
;
82 extern int permission_mode
;
83 extern int filetype_mode
;
84 extern int show_mini_info
;
85 extern int panel_scroll_pages
;
86 extern int fast_reload
;
88 void paint_panel (WPanel
*panel
);
89 void panel_reload (WPanel
*panel
);
91 void panel_set_sort_order (WPanel
*panel
, sortfn
*sort_order
);
92 void panel_re_sort (WPanel
*panel
);
94 void panel_update_contents (WPanel
*panel
);
95 void panel_update_cols (Widget
*widget
, int frame_size
);
96 int set_panel_formats (WPanel
*p
);
98 WPanel
*get_current_panel (void);
99 WPanel
*get_other_panel (void);
101 /* Useful macros to avoid too much typing */
102 #define cpanel get_current_panel()
103 #define opanel get_other_panel()
105 extern WPanel
*left_panel
;
106 extern WPanel
*right_panel
;
107 extern WPanel
*current_panel
;
109 void try_to_select (WPanel
*panel
, char *name
);
111 void unmark_files (WPanel
*panel
);
112 void select_item (WPanel
*panel
);
114 extern Hook
*select_file_hook
;
116 void recalculate_panel_summary (WPanel
*panel
);
117 void file_mark (WPanel
*panel
, int index
, int val
);
118 void do_file_mark (WPanel
*panel
, int index
, int val
);
120 void directory_history_next (WPanel
*panel
);
121 void directory_history_prev (WPanel
*panel
);
122 void directory_history_list (WPanel
*panel
);
124 #endif /* __PANEL_H */