home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / tree.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  2.7 KB  |  70 lines

  1. #ifndef __TREE_H
  2. #define __TREE_H
  3.  
  4. typedef struct tree_entry {
  5.     char *name;            /* The full path of directory */
  6.     int sublevel;        /* Number of parent directories (slashes) */
  7.     long submask;        /* Bitmask of existing sublevels after this entry */
  8.     char *subname;        /* The last part of name (the actual name) */
  9.     int mark;            /* Flag: Is this entry marked (e. g. for delete)? */
  10.     struct tree_entry *next;    /* Next item in the list */
  11.     struct tree_entry *prev;    /* Previous item in the list */
  12. } tree_entry;
  13.  
  14. #include "dlg.h"
  15. typedef struct {
  16.     Widget     widget;
  17.     tree_entry *tree_first;         /* First entry in the list */
  18.     tree_entry *tree_last;              /* Last entry in the list */
  19.     tree_entry *selected_ptr;            /* The selected directory */
  20.     char       search_buffer [256];     /* Current search string */
  21.     int        done;                /* Flag: exit tree */
  22.     char       check_name [MC_MAXPATHLEN];/* Directory which is been checked */
  23.     tree_entry *check_start;        /* Start of checked subdirectories */
  24.     int        check_sublevel;      /* Sublevel of check_name */
  25.     tree_entry **tree_shown;            /* Entries currently on screen */
  26.     int        is_panel;        /* panel or plain widget flag */
  27.     int        active;                /* if it's currently selected */
  28.     int        searching;            /* Are we on searching mode? */
  29.     int topdiff;                /* The difference between the topmost shown and the selected */
  30. } WTree;
  31.  
  32. #define tlines(t) (t->is_panel ? t->widget.lines-2 - (show_mini_info ? 2 : 0) : t->widget.lines)
  33.  
  34. int tree_init (char *current_dir, int lines);
  35. void load_tree (WTree *tree);
  36. void save_tree (WTree *tree);
  37. void show_tree (WTree *tree);
  38. void tree_chdir (WTree *tree, char *dir);
  39. int tree_rescan_cmd (WTree *tree);
  40. int tree_forget_cmd (WTree *tree);
  41. void tree_copy (WTree *tree, char *default_dest);
  42. void tree_move (WTree *tree, char *default_dest);
  43. void tree_event (WTree *tree, int y);
  44. char *tree (char *current_dir);
  45.  
  46. int search_tree (WTree *tree, char *text);
  47.  
  48. tree_entry *tree_add_entry (WTree *tree, char *name);
  49. void tree_remove_entry (WTree *tree, char *name);
  50. void tree_destroy (WTree *tree);
  51. void tree_check (const char *subname);
  52. void start_tree_check (WTree *tree);
  53. void do_tree_check (WTree *tree, const char *subname);
  54. void end_tree_check (WTree *tree);
  55.  
  56. void tree_move_backward (WTree *tree, int i);
  57. void tree_move_forward (WTree *tree, int i);
  58. int tree_move_to_parent (WTree *tree);
  59. void tree_move_to_child (WTree *tree);
  60. void tree_move_to_top (WTree *tree);
  61. void tree_move_to_bottom (WTree *tree);
  62.  
  63. extern int tree_navigation_flag;
  64. extern int xtree_mode;
  65.  
  66. WTree *tree_new (int is_panel, int y, int x, int lines, int cols);
  67. extern WTree *the_tree;
  68.  
  69. #endif
  70.