]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - radiant/ui.h
uncrustify! now the code is only ugly on the *inside*
[xonotic/netradiant.git] / radiant / ui.h
index 135ed93e4973e8406ddef56de4e26b71ffed7870..213f9541320dabbc637c2a32062af0726e2ffbd4 100644 (file)
@@ -1,84 +1,89 @@
-/*\r
-Copyright (C) 1999-2007 id Software, Inc. and contributors.\r
-For a list of contributors, see the accompanying CONTRIBUTORS file.\r
-\r
-This file is part of GtkRadiant.\r
-\r
-GtkRadiant is free software; you can redistribute it and/or modify\r
-it under the terms of the GNU General Public License as published by\r
-the Free Software Foundation; either version 2 of the License, or\r
-(at your option) any later version.\r
-\r
-GtkRadiant is distributed in the hope that it will be useful,\r
-but WITHOUT ANY WARRANTY; without even the implied warranty of\r
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
-GNU General Public License for more details.\r
-\r
-You should have received a copy of the GNU General Public License\r
-along with GtkRadiant; if not, write to the Free Software\r
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
-*/\r
-\r
-//-----------------------------------------------------------------------------\r
-//\r
-// DESCRIPTION:\r
-// headers for internal classes used in Messaging.cpp\r
-// \r
-\r
-#ifndef __MESSAGING_H_\r
-#define __MESSAGING_H_\r
-\r
-class CXYWndWrapper : public IXYWndWrapper\r
-{\r
-public:\r
-  void SnapToGrid( int x1, int y1, vec3_t pt );\r
-  VIEWTYPE GetViewType( void );\r
-};\r
-\r
-// implementation of the IWindow API\r
-class CGtkWindow : public IWindow\r
-{\r
-  int refCount;\r
-  GtkWidget *m_pWnd;\r
-  GtkWidget *m_pGLWidget;\r
-  int m_nWidthParam,m_nHeightParam;\r
-  IWindowListener *m_pListen;\r
-  Str m_Name;\r
-public:\r
-  CGtkWindow() { refCount = 0; m_pWnd = NULL; m_pGLWidget = NULL; m_nWidthParam = 0; m_nHeightParam = 0; m_pListen = 0; m_Name = "CGtkWindow"; }\r
-  virtual ~CGtkWindow()\r
-  {\r
-    if (m_pListen) { m_pListen->DecRef(); m_pListen = NULL; }\r
-    if (m_pWnd) { gtk_widget_destroy(m_pWnd); m_pWnd = NULL; }\r
-  }\r
-  // refcounting ----------------------------------------\r
-       // Increment the number of references to this object\r
-       void IncRef () { refCount++; }\r
-       // Decrement the reference count\r
-       void DecRef ()\r
-       { if ( --refCount <= 0 )\r
-               delete this;\r
-       }\r
-  // IWindow --------------------------------------------\r
-  // get pixel size\r
-  int getHeight() { return m_pWnd->allocation.height; }\r
-  int getWidth() { return m_pWnd->allocation.width; }\r
-  // set pixel size and other parameters before showing it\r
-  void setSizeParm(int width, int height) { m_nWidthParam = width; m_nHeightParam = height; }\r
-  // set the IWindowListener (implemented by the plugin using this window)\r
-  void setListener(IWindowListener * pListen) { m_pListen = pListen; m_pListen->IncRef(); }\r
-  // set the name (optional)\r
-  void setName(char *name) { m_Name = name; }\r
-  // will actually create the GL and the window based on the parameters\r
-  bool Show();\r
-  // CGtkWindow -----------------------------------------\r
-  // called upon a closure of the widget\r
-  void Close();\r
-  // called to manage GL context and buffer swapping before display\r
-  void DoExpose();\r
-  // commands -------------------------------------------\r
-  // call this to ask for a Redraw\r
-  void Redraw();\r
-};\r
-\r
-#endif\r
+/*
+   Copyright (C) 1999-2007 id Software, Inc. and contributors.
+   For a list of contributors, see the accompanying CONTRIBUTORS file.
+
+   This file is part of GtkRadiant.
+
+   GtkRadiant is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   GtkRadiant is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with GtkRadiant; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+//-----------------------------------------------------------------------------
+//
+// DESCRIPTION:
+// headers for internal classes used in Messaging.cpp
+//
+
+#ifndef __MESSAGING_H_
+#define __MESSAGING_H_
+
+class CXYWndWrapper : public IXYWndWrapper
+{
+public:
+virtual ~CXYWndWrapper() {}
+void SnapToGrid( int x1, int y1, vec3_t pt );
+VIEWTYPE GetViewType( void );
+};
+
+// implementation of the IWindow API
+class CGtkWindow : public IWindow
+{
+int refCount;
+GtkWidget *m_pWnd;
+GtkWidget *m_pGLWidget;
+int m_nWidthParam,m_nHeightParam;
+IWindowListener *m_pListen;
+Str m_Name;
+public:
+CGtkWindow() { refCount = 0; m_pWnd = NULL; m_pGLWidget = NULL; m_nWidthParam = 0; m_nHeightParam = 0; m_pListen = 0; m_Name = "CGtkWindow"; }
+virtual ~CGtkWindow(){
+       if ( m_pListen ) {
+               m_pListen->DecRef(); m_pListen = NULL;
+       }
+       if ( m_pWnd ) {
+               gtk_widget_destroy( m_pWnd ); m_pWnd = NULL;
+       }
+}
+// refcounting ----------------------------------------
+// Increment the number of references to this object
+void IncRef() { refCount++; }
+// Decrement the reference count
+void DecRef(){
+       if ( --refCount <= 0 ) {
+               delete this;
+       }
+}
+// IWindow --------------------------------------------
+// get pixel size
+int getHeight() { return m_pWnd->allocation.height; }
+int getWidth() { return m_pWnd->allocation.width; }
+// set pixel size and other parameters before showing it
+void setSizeParm( int width, int height ) { m_nWidthParam = width; m_nHeightParam = height; }
+// set the IWindowListener (implemented by the plugin using this window)
+void setListener( IWindowListener * pListen ) { m_pListen = pListen; m_pListen->IncRef(); }
+// set the name (optional)
+void setName( char *name ) { m_Name = name; }
+// will actually create the GL and the window based on the parameters
+bool Show();
+// CGtkWindow -----------------------------------------
+// called upon a closure of the widget
+void Close();
+// called to manage GL context and buffer swapping before display
+void DoExpose();
+// commands -------------------------------------------
+// call this to ask for a Redraw
+void Redraw();
+};
+
+#endif