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
73 refCount--; if ( refCount <= 0 ) {
77 void Draw2D( VIEWTYPE vt );
80 class CWindingMsg : public ISAXHandler, public IGL2DWindow
82 enum { WINDING_MESSAGE, WINDING_WINDING } EPointState;
88 CWindingMsg() { EPointState = WINDING_MESSAGE; refCount = 0; numpoints = 0; }
90 void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs );
91 void saxEndElement( message_info_t *ctx, const xmlChar *name );
92 void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len );
93 // for use in the dialog window
94 char *getName() { return message->str; }
98 // IGL2DWindow interface --------------------------------
99 // Increment the number of references to this object
100 void IncRef() { refCount++; }
101 // Decrement the reference count
103 refCount--; if ( refCount <= 0 ) {
107 void Draw2D( VIEWTYPE vt );
110 class CDbgDlg : public Dialog
112 GPtrArray *m_pFeedbackElements;
113 // the list widget we use in the dialog
114 GtkListStore* m_clist;
115 ISAXHandler *m_pHighlight;
117 CDbgDlg() { m_pFeedbackElements = g_ptr_array_new(); m_pHighlight = NULL; }
118 virtual ~CDbgDlg() { ClearFeedbackArray(); }
120 void Push( ISAXHandler * );
121 // clean the debug window, release all ISAXHanlders we have
123 ISAXHandler *GetElement( gint row );
124 void SetHighlight( gint row );
125 void DropHighlight();
128 void ClearFeedbackArray();
131 extern CDbgDlg g_DbgDlg;