Blender V2.61 - r43446

DNA_text_types.h

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00019  * All rights reserved.
00020  *
00021  * The Original Code is: all of this file.
00022  *
00023  * Contributor(s): none yet.
00024  *
00025  * ***** END GPL LICENSE BLOCK *****
00026  */
00033 #ifndef DNA_TEXT_TYPES_H
00034 #define DNA_TEXT_TYPES_H
00035 
00036 #include "DNA_listBase.h"
00037 #include "DNA_ID.h"
00038 
00039 typedef struct TextLine {
00040     struct TextLine *next, *prev;
00041 
00042     char *line;
00043     char *format; /* may be NULL if syntax is off or not yet formatted */
00044     int len, blen; /* blen unused */
00045 } TextLine;
00046 
00047 typedef struct TextMarker {
00048     struct TextMarker *next, *prev;
00049 
00050     int lineno, start, end, pad1; /* line number and start/end character indices */
00051     
00052     int group, flags; /* see BKE_text.h for flag defines */
00053     unsigned char color[4], pad[4]; /* draw color of the marker */
00054 } TextMarker;
00055 
00056 typedef struct Text {
00057     ID id;
00058     
00059     char *name;
00060 
00061     int flags, nlines;
00062     
00063     ListBase lines;
00064     TextLine *curl, *sell;
00065     int curc, selc;
00066     ListBase markers;
00067     
00068     char *undo_buf;
00069     int undo_pos, undo_len;
00070     
00071     void *compiled;
00072     double mtime;
00073 } Text;
00074 
00075 #define TXT_TABSIZE 4
00076 #define TXT_INIT_UNDO 1024
00077 #define TXT_MAX_UNDO    (TXT_INIT_UNDO*TXT_INIT_UNDO)
00078 
00079 /* text flags */
00080 #define TXT_ISDIRTY             0x0001
00081 #define TXT_DEPRECATED          0x0004 /* deprecated ISTMP flag */
00082 #define TXT_ISMEM               0x0004
00083 #define TXT_ISEXT               0x0008
00084 #define TXT_ISSCRIPT            0x0010 /* used by space handler scriptlinks */
00085 #define TXT_READONLY            0x0100
00086 #define TXT_FOLLOW              0x0200 /* always follow cursor (console) */
00087 #define TXT_TABSTOSPACES        0x0400 /* use space instead of tabs */
00088 
00089 /* format continuation flags */
00090 #define TXT_NOCONT              0x00 /* no continuation */
00091 #define TXT_SNGQUOTSTR          0x01 /* single quotes */
00092 #define TXT_DBLQUOTSTR          0x02 /* double quotes */
00093 #define TXT_TRISTR              0x04 /* triplets of quotes: """ or ''' */
00094 #define TXT_SNGTRISTR           0x05 /*(TXT_TRISTR | TXT_SNGQUOTSTR)*/
00095 #define TXT_DBLTRISTR           0x06 /*(TXT_TRISTR | TXT_DBLQUOTSTR)*/
00096 
00097 #endif