OSDN Git Service

* Implement: API MoveCursor(Right/Left/Up/Down) (non-tested)
[drdeamon64/drdeamon64.git] / libedittext / drd64_libedittext_types.h
1 /*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
2
3                          D r . D e a m o n  6 4
4                         for INTEL64(R), AMD64(R)
5         
6    Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
7
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
10
11  1. Redistributions of source code must retain the above copyright notice,
12     this list of conditions and the following disclaimer.
13  2. Redistributions in binary form must reproduce the above copyright
14     notice, this list of conditions and the following disclaimer in the
15     documentation and/or other materials provided with the distribution.
16
17 THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
18 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
21 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
27 OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
30
31 /* File Info -----------------------------------------------------------
32 File: drd64_.h
33 Function: Header 
34 Comment: 
35 ----------------------------------------------------------------------*/
36
37 #ifndef DRD64_HEADER_LIBEDITTEXT_TYPES
38 #define DRD64_HEADER_LIBEDITTEXT_TYPES
39
40 #define INVALID_LINE    (DWord)0xffffffff
41 #define MAXLINES                (DWord)0x7fffffff
42
43 #define LINFO(m,n)      (INVALID_LINE==(n) ? NULL : (((m)->p_lineinfo)+(n)))
44         /* (m): (Drd64_DrCC_TextInfo *) TextInfo Strcut Pointer */
45         /* (n): (DWord) LineInfo ID */
46 #define LINFO_ID(m,n)   ((((m)->p_lineinfo)+(n))->dw_id)
47         /* (m): (Drd64_DrCC_TextInfo *) TextInfo Strcut Pointer */
48         /* (n): (DWord) LineInfo ID */
49 #define LINFO_SORTNEXT(m,n)     (((m)->p_lineinfo)+((((m)->p_lineinfo)+(n))->dw_sortnext))
50         /* (m): (Drd64_DrCC_TextInfo *) TextInfo Strcut Pointer */
51         /* (n): (DWord) LineInfo ID */
52
53
54 typedef struct  {
55         DWord   dw_id;
56         DWord   dw_start;               /* Start Bytes of This Line in Text-Buffer */
57         DWord   dw_strlen;              /* Length of This LineString */
58         DWord   dw_linelen;             /* Line Alloced Bytes */
59         DWord   dw_before;
60         DWord   dw_next;
61         DWord   dw_sortnext;
62 } LibEditText_LineInfo;
63
64 typedef struct  {
65         DWord                                   dw_line;
66         DWord                                   dw_linfoid;
67 } LibEditText_LineSection;
68
69 typedef struct  {
70         /* Cursor Line --- */
71         DWord   dw_lineid;
72         DWord   dw_line;
73         DWord   dw_pos;                 // Cursor Pos. in line
74
75         /* Start Line --- */
76         DWord   dw_start_lineid;
77         DWord   dw_start_line;
78
79         /* End Line --- */
80         DWord   dw_end_lineid;
81         DWord   dw_end_line;
82          
83         DWord   dw_rangelines;
84
85         Byte    b_update;
86 } LibEditText_Cursor;
87
88 typedef struct  {
89         int                                             i_id;                   /* ID of TextInfo Struct */
90         int                                             i_fd;
91         int                                             i_cursor_now;
92         Word                                    w_subtype;              /* TextFile Sub-Type (.c/.h/Makefile/etc) */
93         Byte                                    *pb_text;               /* Buffer of TextData */
94         Byte                                    *pb_attr;               /* Attribute Buffer of Text */
95         DWord                                   dw_bufsize;             /* TextData Buffer Size */
96         DWord                                   dw_attrsize;    /* Attribute Buffer Size */
97         DWord                                   dw_maxline;             /* Max TextFile Lines */
98         DWord                                   dw_bufline;             /* Lines of Alloc LineInfo Strcut */
99         DWord                                   dw_lastsize;    /* Available Buffer Position */
100         DWord                                   dw_bufsections;
101         DWord                                   dw_maxcursors;
102         DWord                                   dw_sections;
103         DWord                                   dw_sect_steps;  
104         DWord                                   dw_line_start;
105         DWord                                   dw_line_end;
106         DWord                                   dw_linesort[DRD64_LIBEDITTEXT_DEFAULT_LINESORT_ARRAYS];
107         DWord                                   dw_empty[DRD64_LIBEDITTEXT_DEFAULT_LINESORT_ARRAYS];
108         LibEditText_LineInfo    *p_lineinfo;    /* LineInfo structs TopPointer */
109         LibEditText_LineSection *p_section;
110         LibEditText_Cursor              t_cursor[DRD64_LIBEDITTEXT_DEFAULT_MAX_CURSORS];
111         char                                    str_pathname[DRD64_MAX_PATH];
112         char                                    str_filename[DRD64_MAX_PATH];
113 } LibEditText_TextInfo;
114
115 #endif  /* DRD64_HEADER_LIBEDITTEXT */
116
117
118 /* EOF of drd64_.h ----------------------------------- */