added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / tools / Edit / Project.h
blob65f7f9676e37a326dec417c9738c955d68e2cfb1
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 */
46 STRPTR path, name; /* Access path */
47 LONG protection; /* protection flags */
48 UBYTE state; /* See below */
49 LINE *show,*the_line; /* First shown & first line */
50 LINE *edited; /* Line being edited */
51 ULONG top_line; /* Number of first line displayed */
52 ULONG left_pos; /* Number of first real column displayed */
53 ULONG max_lines; /* Number of total lines */
55 JBUF undo, redo; /* Journalized buffers */
56 STRPTR savepoint; /* Last modification saved */
58 } PROJECT;
60 /** State of a project **/
61 #define MODIFIED 1 /* Don't close it without asking user */
62 #define PAGINATED 2 /* Remain on disk (reduce disk usage) */
63 #define DONT_FLUSH 4 /* Do not flush redo log */
64 #define DUPLICATE 8 /* Do not free edit buffer */
66 /** String added to project when modified **/
67 #define STR_MODIF "+"
69 /** End of line type **/
70 #define AMIGA_EOL 0
71 #define MACOS_EOL 1
72 #define MSDOS_EOL 2
74 Project close_projects ( void ); /* Try to close all projects */
75 Project new_project (Project, PREFS *); /* Alloc a new empty project */
76 Project save_projects (Project active, char close); /* Save all modified projects */
77 Project select_panel (Project current, WORD x); /* Search for panel under position x */
78 Project create_projects (Project, APTR, ULONG); /* Create a list of projects */
79 Project load_and_activate (Project, STRPTR name, BYTE); /* Load and create a project */
80 WORD load_in_project (Project, STRPTR file); /* Try to a load a file */
81 void reload_project (Project); /* Load project and flush changes */
82 char active_project (Project, char); /* Makes specified project, the active one */
83 char close_project (Project); /* Try to close a project */
84 char save_project (Project, char refresh, char); /* Save one projet, asking for filename */
85 void set_project_name (Project, STRPTR path); /* Set path of project */
86 void change_project (Project, LINE *); /* Change content of a project (no redraw) */
87 void reshape_panel (Project); /* Resize item's project bar */
88 void set_modif_mark (Project); /* Set and show modification flag */
89 void unset_modif_mark (Project, char showmodif); /* Unset modification flag */
90 void update_panel_name (Project); /* Change name of ectiv project */
91 void insert_file (Project);
93 /** Special values for select_panel **/
94 #define NEXT_PROJECT 0x7FFF
95 #define PREV_PROJECT -0x7FFF
97 /** Read only! **/
98 extern UBYTE NbProject;
100 #define REDRAW_CURLINE(prj) \
101 { Move(RP,gui.left,prj->ycurs); write_text(prj, prj->edited); }
103 #endif