Blender V2.61 - r43446

textview.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  * Contributor(s): Campbell Barton
00019  *
00020  * ***** END GPL LICENSE BLOCK *****
00021  */
00022 
00028 typedef struct TextViewContext {
00029     int lheight;
00030     int sel_start, sel_end;
00031 
00032     /* view settings */
00033     int cwidth; /* shouldnt be needed! */
00034     int console_width; /* shouldnt be needed! */
00035 
00036     int winx;
00037     int ymin, ymax;
00038     
00039     /* callbacks */
00040     int (*begin)(struct TextViewContext *tvc);
00041     void (*end)(struct TextViewContext *tvc);
00042     void *arg1;
00043     void *arg2;
00044 
00045     /* iterator */
00046     int (*step)(struct TextViewContext *tvc);
00047     int (*line_get)(struct TextViewContext *tvc, const char **, int *);
00048     int (*line_color)(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3]);
00049     void *iter;
00050     int iter_index;
00051     int iter_char;      /* char intex, used for multi-line report display */
00052     int iter_char_next; /* same as above, next \n */
00053     int iter_tmp;       /* internal iterator use */
00054 
00055 } TextViewContext;
00056 
00057 int textview_draw(struct TextViewContext *tvc, int draw, int mval[2], void **mouse_pick, int *pos_pick);
00058 
00059 #define TVC_LINE_FG (1<<0)
00060 #define TVC_LINE_BG (1<<1)