2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 //-----------------------------------------------------------------------------
25 // classes used for describing geometry information from q3map feedback
28 #ifndef __Q3MAP_FEEDBACK__
29 #define __Q3MAP_FEEDBACK__
31 #include "libxml/parser.h"
33 // a select message with a brush/entity select information
34 class CSelectMsg : public ISAXHandler
36 enum { SELECT_MESSAGE, SELECT_BRUSH } ESelectState;
38 int entitynum, brushnum;
40 CSelectMsg() { ESelectState = SELECT_MESSAGE; }
42 void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs);
43 void saxEndElement (message_info_t *ctx, const xmlChar *name);
44 void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len);
45 // for use in the dialog window
46 char *getName() { return message->str; }
48 void DropHighlight() { }
51 class CPointMsg : public ISAXHandler, public IGL2DWindow
53 enum { POINT_MESSAGE, POINT_POINT } EPointState;
58 CPointMsg() { EPointState = POINT_MESSAGE; refCount = 0; }
60 void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs);
61 void saxEndElement (message_info_t *ctx, const xmlChar *name);
62 void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len);
63 // for use in the dialog window
64 char *getName() { return message->str; }
68 // IGL2DWindow interface --------------------------------
69 // Increment the number of references to this object
70 void IncRef () { refCount++; }
71 // Decrement the reference count
72 void DecRef () { refCount--; if (refCount <= 0) delete this; }
73 void Draw2D( VIEWTYPE vt );
76 class CWindingMsg : public ISAXHandler, public IGL2DWindow
78 enum { WINDING_MESSAGE, WINDING_WINDING } EPointState;
84 CWindingMsg() { EPointState = WINDING_MESSAGE; refCount = 0; numpoints = 0; }
86 void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs);
87 void saxEndElement (message_info_t *ctx, const xmlChar *name);
88 void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len);
89 // for use in the dialog window
90 char *getName() { return message->str; }
94 // IGL2DWindow interface --------------------------------
95 // Increment the number of references to this object
96 void IncRef () { refCount++; }
97 // Decrement the reference count
98 void DecRef () { refCount--; if (refCount <= 0) delete this; }
99 void Draw2D( VIEWTYPE vt );
102 class CDbgDlg : public Dialog
104 GPtrArray *m_pFeedbackElements;
105 // the list widget we use in the dialog
106 GtkListStore* m_clist;
107 ISAXHandler *m_pHighlight;
109 CDbgDlg() { m_pFeedbackElements = g_ptr_array_new(); m_pHighlight = NULL; }
110 virtual ~CDbgDlg() { ClearFeedbackArray(); }
112 void Push( ISAXHandler * );
113 // clean the debug window, release all ISAXHanlders we have
115 ISAXHandler *GetElement(gint row);
116 void SetHighlight(gint row);
117 void DropHighlight();
120 void ClearFeedbackArray();
123 extern CDbgDlg g_DbgDlg;