|
Blender
V2.59
|
00001 /* 00002 * $Id: textview.h 35242 2011-02-27 20:29:51Z jesterking $ 00003 * 00004 * ***** BEGIN GPL LICENSE BLOCK ***** 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU General Public License 00008 * as published by the Free Software Foundation; either version 2 00009 * of the License, or (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software Foundation, 00018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 * 00020 * Contributor(s): Campbell Barton 00021 * 00022 * ***** END GPL LICENSE BLOCK ***** 00023 */ 00024 00030 typedef struct TextViewContext { 00031 int lheight; 00032 int sel_start, sel_end; 00033 00034 /* view settings */ 00035 int cwidth; /* shouldnt be needed! */ 00036 int console_width; /* shouldnt be needed! */ 00037 00038 int winx; 00039 int ymin, ymax; 00040 00041 /* callbacks */ 00042 int (*begin)(struct TextViewContext *tvc); 00043 void (*end)(struct TextViewContext *tvc); 00044 void *arg1; 00045 void *arg2; 00046 00047 /* iterator */ 00048 int (*step)(struct TextViewContext *tvc); 00049 int (*line_get)(struct TextViewContext *tvc, const char **, int *); 00050 int (*line_color)(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3]); 00051 void *iter; 00052 int iter_index; 00053 int iter_char; /* char intex, used for multi-line report display */ 00054 int iter_char_next; /* same as above, next \n */ 00055 int iter_tmp; /* internal iterator use */ 00056 00057 } TextViewContext; 00058 00059 int textview_draw(struct TextViewContext *tvc, int draw, int mval[2], void **mouse_pick, int *pos_pick); 00060 00061 #define TVC_LINE_FG (1<<0) 00062 #define TVC_LINE_BG (1<<1)