X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=plugins%2Ftextool%2F2DView.h;h=439a30308b7d2ddebc2125c6023ac50160b62bd8;hb=9dfae1c9b270ee369c6362903a9205b30751b95f;hp=59163f8019ea29b5d1fa41d2b6aa2197a6eeb7b8;hpb=ab3a99dbbe84a0d130fea4d0ceb7b79d7ed07eb7;p=xonotic%2Fnetradiant.git diff --git a/plugins/textool/2DView.h b/plugins/textool/2DView.h index 59163f80..439a3030 100644 --- a/plugins/textool/2DView.h +++ b/plugins/textool/2DView.h @@ -1,23 +1,23 @@ /* -Copyright (C) 1999-2007 id Software, Inc. and contributors. -For a list of contributors, see the accompanying CONTRIBUTORS file. + Copyright (C) 1999-2006 Id Software, Inc. and contributors. + For a list of contributors, see the accompanying CONTRIBUTORS file. -This file is part of GtkRadiant. + 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 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. + 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 -*/ + 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 + */ //----------------------------------------------------------------------------- // @@ -30,41 +30,56 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef _2DVIEW_H_ #define _2DVIEW_H_ -class C2DView -{ - enum E2DViewState { View_Idle, View_Move } ViewState; - int m_xPosMove, m_yPosMove; - float m_MinsMove[2], m_MaxsMove[2]; - qboolean m_bDoGrid; - float m_GridStep[2]; - qboolean m_bPopup; +class C2DView { + enum E2DViewState { View_Idle, View_Move } ViewState; + int m_xPosMove, m_yPosMove; + float m_MinsMove[2], m_MaxsMove[2]; + qboolean m_bDoGrid; + float m_GridStep[2]; + qboolean m_bPopup; public: - RECT m_rect; - float m_Mins[2],m_Maxs[2],m_Center[2]; - C2DView() + RECT m_rect; + float m_Mins[2], m_Maxs[2], m_Center[2]; + + C2DView() + { + ViewState = View_Idle; + m_bDoGrid = false; + m_bPopup = false; + } + + ~C2DView() + {} + + void SetGrid(float xGridStep, float yGridStep) { - ViewState = View_Idle; - m_bDoGrid = false; - m_bPopup = false; + m_bDoGrid = true; + m_GridStep[0] = xGridStep; + m_GridStep[1] = yGridStep; } - ~C2DView() { } - void SetGrid( float xGridStep, float yGridStep ) - { m_bDoGrid = true; m_GridStep[0] = xGridStep; m_GridStep[1] = yGridStep; } - - // get window coordinates for space coordinates - void WindowForSpace( int &x, int &y, const float c[2]); - void SpaceForWindow( float c[2], int x, int y); - void GridForWindow( float c[2], int x, int y); - qboolean DoesSelect( int x, int y, float c[2] ); - void PreparePaint(); - - bool OnRButtonDown (int x, int y); - bool OnMouseMove (int x, int y); - bool OnRButtonUp (int x, int y); - bool OnKeyDown (char *s); - - void ZoomIn(); - void ZoomOut(); + +// get window coordinates for space coordinates + void WindowForSpace(int &x, int &y, const float c[2]); + + void SpaceForWindow(float c[2], int x, int y); + + void GridForWindow(float c[2], int x, int y); + + qboolean DoesSelect(int x, int y, float c[2]); + + void PreparePaint(); + + bool OnRButtonDown(int x, int y); + + bool OnMouseMove(int x, int y); + + bool OnRButtonUp(int x, int y); + + bool OnKeyDown(char *s); + + void ZoomIn(); + + void ZoomOut(); }; #endif