X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=plugins%2Ftextool%2F2DView.h;h=439a30308b7d2ddebc2125c6023ac50160b62bd8;hb=9dfae1c9b270ee369c6362903a9205b30751b95f;hp=c2773abfcb2b56d475d3380d0bf6ff2ad43cb5a2;hpb=dac8329952745dbb494bad1c301e44bab05ec0db;p=xonotic%2Fnetradiant.git diff --git a/plugins/textool/2DView.h b/plugins/textool/2DView.h index c2773abf..439a3030 100644 --- a/plugins/textool/2DView.h +++ b/plugins/textool/2DView.h @@ -30,40 +30,56 @@ #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(){ - ViewState = View_Idle; - m_bDoGrid = false; - m_bPopup = false; -} -~C2DView() { } -void SetGrid( float xGridStep, float yGridStep ) -{ m_bDoGrid = true; m_GridStep[0] = xGridStep; m_GridStep[1] = yGridStep; } + 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) + { + 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(); + 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