OS no longer mentioned in information window.
[tangerine.git] / workbench / tools / Edit / Project.h
blob621c3a41e253293ad2cfa128a79c97d39ce9e1af
1 /**********************************************************
2 ** **
3 ** $VER: Project.h v1.3 (16.2.2000) **
4 ** Data-types for handling multi-project window **
5 ** **
6 ** © T.Pierron, C.Guilaume. Free software under **
7 ** terms of GNU public license. **
8 ** **
9 **********************************************************/
11 #ifndef PROJECT_H
12 #define PROJECT_H
14 typedef struct _project * Project;
16 #ifndef MEMORY_H
17 #include "Memory.h"
18 #endif
19 #ifndef PREFS_H
20 #include "Prefs.h"
21 #endif
22 #ifndef CLIPLOC_H
23 #include "ClipLoc.h"
24 #endif
26 #include "UndoRedo.h"
28 typedef struct _project /* MAIN PROJECT STRUCTURE */
30 struct _project *next,*prev; /* Linked list of opened project */
31 struct cutcopypast ccp; /* The lines selected */
32 STRPTR buffer; /* Main file buffer */
33 ULONG date[3]; /* Last modification time */
34 char tabsize; /* Local tabulation size */
35 char cursmode; /* Cursor movement mode */
36 char syntax; /* Local syntax mode */
37 unsigned char eol; /* End of line type, see below */
39 UWORD xcurs, ycurs; /* Screen position of cursor */
40 ULONG nbc,nbrc, nbl; /* Nb. char where cursor is and real column */
41 ULONG nbrwc; /* Nb. of real wanted column */
43 WORD pleft, pwidth; /* Panel tab information */
44 WORD labwid, labsize; /* Label width in pixels and size in bytes */
45 WORD modwid; /* Modification-flag width in pixels */
47 STRPTR path, name; /* Access path */
48 LONG protection; /* protection flags */
49 UBYTE state; /* See below */
50 LINE *show,*the_line; /* First shown & first line */
51 LINE *edited; /* Line being edited */
52 ULONG top_line; /* Number of first line displayed */
53 ULONG left_pos; /* Number of first real column displayed */
54 ULONG max_lines; /* Number of total lines */
56 JBUF undo, redo; /* Journalized buffers */
57 STRPTR savepoint; /* Last modification saved */
59 } PROJECT;
61 /** State of a project **/
62 #define MODIFIED 1 /* Don't close it without asking user */
63 #define PAGINATED 2 /* Remain on disk (reduce disk usage) */
64 #define DONT_FLUSH 4 /* Do not flush redo log */
65 #define DUPLICATE 8 /* Do not free edit buffer */
67 /** String added to project when modified **/
68 #define STR_MODIF "+"
70 /** End of line type **/
71 #define AMIGA_EOL 0
72 #define MACOS_EOL 1
73 #define MSDOS_EOL 2
75 Project close_projects ( void ); /* Try to close all projects */
76 Project new_project (Project, PREFS *); /* Alloc a new empty project */
77 Project save_projects (Project active, char close); /* Save all modified projects */
78 Project select_panel (Project current, WORD x); /* Search for panel under position x */
79 Project create_projects (Project, APTR, ULONG); /* Create a list of projects */
80 Project load_and_activate (Project, STRPTR name, BYTE); /* Load and create a project */
81 WORD load_in_project (Project, STRPTR file); /* Try to a load a file */
82 void reload_project (Project); /* Load project and flush changes */
83 char active_project (Project, char); /* Makes specified project, the active one */
84 char close_project (Project); /* Try to close a project */
85 char save_project (Project, char refresh, char); /* Save one projet, asking for filename */
86 void set_project_name (Project, STRPTR path); /* Set path of project */
87 void change_project (Project, LINE *); /* Change content of a project (no redraw) */
88 void reshape_panel (Project); /* Resize item's project bar */
89 void set_modif_mark (Project); /* Set and show modification flag */
90 void unset_modif_mark (Project, char showmodif); /* Unset modification flag */
91 void update_panel_name (Project); /* Change name of ectiv project */
92 void insert_file (Project);
94 /** Special values for select_panel **/
95 #define NEXT_PROJECT 0x7FFF
96 #define PREV_PROJECT -0x7FFF
98 /** Read only! **/
99 extern UBYTE NbProject;
101 #define REDRAW_CURLINE(prj) \
102 { Move(RP,gui.left,prj->ycurs); write_text(prj, prj->edited); }
104 #endif