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