eol style
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant.ab@184 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
@@ -1,70 +1,70 @@
|
||||
/*
|
||||
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:
|
||||
// a class to provide basic services for 2D view of a world
|
||||
// window <-> local 2D space transforms
|
||||
// snap to grid
|
||||
// TODO: this one could be placed under an interface, and provided to the editor as a service
|
||||
|
||||
#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;
|
||||
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; }
|
||||
|
||||
// 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
|
||||
/*
|
||||
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:
|
||||
// a class to provide basic services for 2D view of a world
|
||||
// window <-> local 2D space transforms
|
||||
// snap to grid
|
||||
// TODO: this one could be placed under an interface, and provided to the editor as a service
|
||||
|
||||
#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;
|
||||
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; }
|
||||
|
||||
// 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
|
||||
|
||||
@@ -1,133 +1,133 @@
|
||||
/*
|
||||
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:
|
||||
// a class to handle control points in a 2D view
|
||||
// TODO: this one can be placed under an interface, and provided to the editor as service
|
||||
//
|
||||
// NOTE: the C2DView *m_p2DView is the orthogonal mapping between window and ST space
|
||||
// in Drag mode (for rotation) we need an orthonormal XY space
|
||||
// we do ST <-> XY transformations using the texture size
|
||||
// ( for translation-only moves, orthogonal is enough )
|
||||
// FIXME: is there a better way to deal between Window space <-> ST space <-> XY space ?
|
||||
//
|
||||
// NOTE: ControlPointsManagers are a bit different between brush faces and patches
|
||||
// so there's a base virtual class, and we have two versions
|
||||
|
||||
#ifndef _CONTROLPOINTSMANAGER_H_
|
||||
#define _CONTROLPOINTSMANAGER_H_
|
||||
|
||||
class CControlPointsManager
|
||||
{
|
||||
protected:
|
||||
// used by Render
|
||||
_QERQglTable *m_pQglTable;
|
||||
C2DView *m_p2DView;
|
||||
public:
|
||||
CControlPointsManager() { m_pQglTable = NULL; m_p2DView = NULL; }
|
||||
virtual ~CControlPointsManager() { }
|
||||
void Init( C2DView *p2DView, _QERQglTable *pQglTable ) { m_pQglTable = pQglTable; m_p2DView = p2DView; }
|
||||
|
||||
virtual bool OnLButtonDown (int x, int y) = 0;
|
||||
virtual bool OnMouseMove (int x, int y) = 0;
|
||||
virtual bool OnLButtonUp (int x, int y) = 0;
|
||||
|
||||
virtual void Render() = 0;
|
||||
virtual void Commit() = 0;
|
||||
};
|
||||
|
||||
// brush face manager
|
||||
class CControlPointsManagerBFace : public CControlPointsManager
|
||||
{
|
||||
enum EManagerState { Idle, Drag } ManagerState;
|
||||
int m_NumPoints;
|
||||
// initial geometry
|
||||
CtrlPts_t m_RefPts;
|
||||
// current geometry
|
||||
CtrlPts_t *m_pPts;
|
||||
// transform matrix ( 2DView is Window <-> ST )
|
||||
float m_TM[2][3];
|
||||
// texture size for ST <-> XY
|
||||
int m_TexSize[2];
|
||||
// used when translating
|
||||
float m_TransOffset[2];
|
||||
// dragged point index
|
||||
int m_iDragPoint;
|
||||
// do we have an anchor ?
|
||||
bool m_bGotAnchor;
|
||||
// anchor point index
|
||||
int m_iAnchorPoint;
|
||||
// coordinates of Anchor
|
||||
float m_Anchor[2];
|
||||
// used for commit
|
||||
_QERFaceData *m_pFaceData;
|
||||
|
||||
public:
|
||||
// construction / init -------------------------------------------------
|
||||
CControlPointsManagerBFace() { ManagerState = Idle; }
|
||||
virtual ~CControlPointsManagerBFace() { }
|
||||
// NOTE: pQglTable is sent to CControlPointsManager::Init
|
||||
void Init(int iPts, CtrlPts_t *Pts, C2DView *p2DView, int TexSize[2], _QERFaceData* pFaceData, _QERQglTable *pQglTable);
|
||||
// CControlPointsManager interface -------------------------------------
|
||||
|
||||
virtual bool OnLButtonDown (int x, int y);
|
||||
virtual bool OnMouseMove (int x, int y);
|
||||
virtual bool OnLButtonUp (int x, int y);
|
||||
|
||||
virtual void Render();
|
||||
virtual void Commit();
|
||||
|
||||
private:
|
||||
// internal members
|
||||
void UpdateCtrlPts();
|
||||
void ComputeTransOffset(int i);
|
||||
void XYSpaceForSTSpace( float xy[2], const float st[2] );
|
||||
};
|
||||
|
||||
// patch manager
|
||||
class CControlPointsManagerPatch : public CControlPointsManager
|
||||
{
|
||||
enum EManagerState { Idle, Drag } ManagerState;
|
||||
// reference data, used for commits
|
||||
patchMesh_t* m_pPatch;
|
||||
// work patch, holds current data
|
||||
patchMesh_t* m_pWorkPatch;
|
||||
int m_iDragPoint[2];
|
||||
|
||||
public:
|
||||
// construction / init -------------------------------------------------
|
||||
CControlPointsManagerPatch() { ManagerState = Idle; }
|
||||
virtual ~CControlPointsManagerPatch() { }
|
||||
// NOTE: pQglTable is sent to CControlPointsManager::Init
|
||||
void Init( patchMesh_t* pWorkPatch, C2DView *p2DView, _QERQglTable *pQglTable, patchMesh_t* pPatch );
|
||||
// CControlPointsManager interface -------------------------------------
|
||||
|
||||
virtual bool OnLButtonDown (int x, int y);
|
||||
virtual bool OnMouseMove (int x, int y);
|
||||
virtual bool OnLButtonUp (int x, int y);
|
||||
|
||||
virtual void Render();
|
||||
virtual void Commit();
|
||||
};
|
||||
|
||||
#endif
|
||||
/*
|
||||
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:
|
||||
// a class to handle control points in a 2D view
|
||||
// TODO: this one can be placed under an interface, and provided to the editor as service
|
||||
//
|
||||
// NOTE: the C2DView *m_p2DView is the orthogonal mapping between window and ST space
|
||||
// in Drag mode (for rotation) we need an orthonormal XY space
|
||||
// we do ST <-> XY transformations using the texture size
|
||||
// ( for translation-only moves, orthogonal is enough )
|
||||
// FIXME: is there a better way to deal between Window space <-> ST space <-> XY space ?
|
||||
//
|
||||
// NOTE: ControlPointsManagers are a bit different between brush faces and patches
|
||||
// so there's a base virtual class, and we have two versions
|
||||
|
||||
#ifndef _CONTROLPOINTSMANAGER_H_
|
||||
#define _CONTROLPOINTSMANAGER_H_
|
||||
|
||||
class CControlPointsManager
|
||||
{
|
||||
protected:
|
||||
// used by Render
|
||||
_QERQglTable *m_pQglTable;
|
||||
C2DView *m_p2DView;
|
||||
public:
|
||||
CControlPointsManager() { m_pQglTable = NULL; m_p2DView = NULL; }
|
||||
virtual ~CControlPointsManager() { }
|
||||
void Init( C2DView *p2DView, _QERQglTable *pQglTable ) { m_pQglTable = pQglTable; m_p2DView = p2DView; }
|
||||
|
||||
virtual bool OnLButtonDown (int x, int y) = 0;
|
||||
virtual bool OnMouseMove (int x, int y) = 0;
|
||||
virtual bool OnLButtonUp (int x, int y) = 0;
|
||||
|
||||
virtual void Render() = 0;
|
||||
virtual void Commit() = 0;
|
||||
};
|
||||
|
||||
// brush face manager
|
||||
class CControlPointsManagerBFace : public CControlPointsManager
|
||||
{
|
||||
enum EManagerState { Idle, Drag } ManagerState;
|
||||
int m_NumPoints;
|
||||
// initial geometry
|
||||
CtrlPts_t m_RefPts;
|
||||
// current geometry
|
||||
CtrlPts_t *m_pPts;
|
||||
// transform matrix ( 2DView is Window <-> ST )
|
||||
float m_TM[2][3];
|
||||
// texture size for ST <-> XY
|
||||
int m_TexSize[2];
|
||||
// used when translating
|
||||
float m_TransOffset[2];
|
||||
// dragged point index
|
||||
int m_iDragPoint;
|
||||
// do we have an anchor ?
|
||||
bool m_bGotAnchor;
|
||||
// anchor point index
|
||||
int m_iAnchorPoint;
|
||||
// coordinates of Anchor
|
||||
float m_Anchor[2];
|
||||
// used for commit
|
||||
_QERFaceData *m_pFaceData;
|
||||
|
||||
public:
|
||||
// construction / init -------------------------------------------------
|
||||
CControlPointsManagerBFace() { ManagerState = Idle; }
|
||||
virtual ~CControlPointsManagerBFace() { }
|
||||
// NOTE: pQglTable is sent to CControlPointsManager::Init
|
||||
void Init(int iPts, CtrlPts_t *Pts, C2DView *p2DView, int TexSize[2], _QERFaceData* pFaceData, _QERQglTable *pQglTable);
|
||||
// CControlPointsManager interface -------------------------------------
|
||||
|
||||
virtual bool OnLButtonDown (int x, int y);
|
||||
virtual bool OnMouseMove (int x, int y);
|
||||
virtual bool OnLButtonUp (int x, int y);
|
||||
|
||||
virtual void Render();
|
||||
virtual void Commit();
|
||||
|
||||
private:
|
||||
// internal members
|
||||
void UpdateCtrlPts();
|
||||
void ComputeTransOffset(int i);
|
||||
void XYSpaceForSTSpace( float xy[2], const float st[2] );
|
||||
};
|
||||
|
||||
// patch manager
|
||||
class CControlPointsManagerPatch : public CControlPointsManager
|
||||
{
|
||||
enum EManagerState { Idle, Drag } ManagerState;
|
||||
// reference data, used for commits
|
||||
patchMesh_t* m_pPatch;
|
||||
// work patch, holds current data
|
||||
patchMesh_t* m_pWorkPatch;
|
||||
int m_iDragPoint[2];
|
||||
|
||||
public:
|
||||
// construction / init -------------------------------------------------
|
||||
CControlPointsManagerPatch() { ManagerState = Idle; }
|
||||
virtual ~CControlPointsManagerPatch() { }
|
||||
// NOTE: pQglTable is sent to CControlPointsManager::Init
|
||||
void Init( patchMesh_t* pWorkPatch, C2DView *p2DView, _QERQglTable *pQglTable, patchMesh_t* pPatch );
|
||||
// CControlPointsManager interface -------------------------------------
|
||||
|
||||
virtual bool OnLButtonDown (int x, int y);
|
||||
virtual bool OnMouseMove (int x, int y);
|
||||
virtual bool OnLButtonUp (int x, int y);
|
||||
|
||||
virtual void Render();
|
||||
virtual void Commit();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,154 +1,154 @@
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
// stdafx.h
|
||||
// precompiled headers
|
||||
|
||||
// standard headers
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
|
||||
// Necessary for proper boolean type declaration
|
||||
#include "qertypes.h"
|
||||
|
||||
typedef void* HMODULE;
|
||||
typedef void* LPVOID;
|
||||
typedef char* LPCSTR;
|
||||
|
||||
#define MB_OK 0x00000000L
|
||||
#define MB_OKCANCEL 0x00000001L
|
||||
#define MB_ABORTRETRYIGNORE 0x00000002L
|
||||
#define MB_YESNOCANCEL 0x00000003L
|
||||
#define MB_YESNO 0x00000004L
|
||||
#define MB_RETRYCANCEL 0x00000005L
|
||||
|
||||
|
||||
#define MB_ICONHAND 0x00000010L
|
||||
#define MB_ICONQUESTION 0x00000020L
|
||||
#define MB_ICONEXCLAMATION 0x00000030L
|
||||
#define MB_ICONASTERISK 0x00000040L
|
||||
|
||||
#define MB_USERICON 0x00000080L
|
||||
#define MB_ICONWARNING MB_ICONEXCLAMATION
|
||||
#define MB_ICONERROR MB_ICONHAND
|
||||
#define MB_ICONINFORMATION MB_ICONASTERISK
|
||||
#define MB_ICONSTOP MB_ICONHAND
|
||||
|
||||
#define MB_TYPEMASK 0x0000000FL
|
||||
#define MB_ICONMASK 0x000000F0L
|
||||
#define MB_DEFMASK 0x00000F00L
|
||||
#define MB_MODEMASK 0x00003000L
|
||||
#define MB_MISCMASK 0x0000C000L
|
||||
|
||||
#define IDOK 1
|
||||
#define IDCANCEL 2
|
||||
#define IDABORT 3
|
||||
#define IDRETRY 4
|
||||
#define IDIGNORE 5
|
||||
#define IDYES 6
|
||||
#define IDNO 7
|
||||
|
||||
typedef struct tagRECT
|
||||
{
|
||||
long left;
|
||||
long top;
|
||||
long right;
|
||||
long bottom;
|
||||
} RECT, *PRECT, *LPRECT;
|
||||
|
||||
#endif // __linux__
|
||||
|
||||
// plugin
|
||||
// FIXME TTimo: drop this
|
||||
extern "C" void Sys_Printf (char *text, ...);
|
||||
|
||||
#include "synapse.h"
|
||||
#include "iplugin.h"
|
||||
#include "qerplugin.h"
|
||||
#include "mathlib.h"
|
||||
#include "igl.h"
|
||||
#include "iselectedface.h"
|
||||
#include "isurfaceplugin.h"
|
||||
#include "iui.h"
|
||||
|
||||
// internals
|
||||
// the implementation of a IWindowListener interface to use with the native UI
|
||||
// TODO: move in it's own set of files?
|
||||
// NOTE: I'm not too sure about the bool flags being any use.. they are supposed to tell if we handle the event or not
|
||||
class CWindowListener : public IWindowListener
|
||||
{
|
||||
int refCount;
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
void IncRef () { refCount++; }
|
||||
// Decrement the reference count
|
||||
void DecRef () { if ( --refCount <= 0 ) delete this; }
|
||||
// IWindowListener ---------------------------------------
|
||||
bool OnLButtonDown(guint32 nFlags, double x, double y);
|
||||
bool OnMButtonDown(guint32 nFlags, double x, double y) { return false; }
|
||||
bool OnRButtonDown(guint32 nFlags, double x, double y);
|
||||
bool OnLButtonUp(guint32 nFlags, double x, double y);
|
||||
bool OnMButtonUp(guint32 nFlags, double x, double y) { return false; }
|
||||
bool OnRButtonUp(guint32 nFlags, double x, double y);
|
||||
bool OnMouseMove(guint32 nFlags, double x, double y);
|
||||
bool OnKeyPressed(char *s);
|
||||
bool Paint();
|
||||
void Close();
|
||||
};
|
||||
|
||||
#include "2DView.h"
|
||||
typedef struct
|
||||
{
|
||||
float data[MAX_POINTS_ON_WINDING][2];
|
||||
} CtrlPts_t;
|
||||
#include "ControlPointsManager.h"
|
||||
|
||||
extern _QERQglTable g_QglTable;
|
||||
extern _QERFuncTable_1 g_FuncTable;
|
||||
// prefs globals
|
||||
// NOTE: these are used by the CControlPointsManager classes, not very C++ish
|
||||
extern bool g_bPrefsUpdateCameraView;
|
||||
extern _QERSelectedFaceTable g_SelectedFaceTable;
|
||||
extern _QERFaceData g_CancelFaceData;
|
||||
|
||||
#define Sys_Printf g_FuncTable.m_pfnSysPrintf
|
||||
#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf
|
||||
|
||||
// call to validate the current changes into the editor
|
||||
extern void Textool_Validate();
|
||||
extern void Textool_Cancel();
|
||||
|
||||
class CSynapseClientTexTool : public CSynapseClient
|
||||
{
|
||||
public:
|
||||
// CSynapseClient API
|
||||
bool RequestAPI(APIDescriptor_t *pAPI);
|
||||
const char* GetInfo();
|
||||
|
||||
CSynapseClientTexTool() { }
|
||||
virtual ~CSynapseClientTexTool() { }
|
||||
};
|
||||
|
||||
extern IWindow *g_pToolWnd;
|
||||
/*
|
||||
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
|
||||
*/
|
||||
|
||||
// stdafx.h
|
||||
// precompiled headers
|
||||
|
||||
// standard headers
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined(__linux__) || defined(__APPLE__)
|
||||
|
||||
// Necessary for proper boolean type declaration
|
||||
#include "qertypes.h"
|
||||
|
||||
typedef void* HMODULE;
|
||||
typedef void* LPVOID;
|
||||
typedef char* LPCSTR;
|
||||
|
||||
#define MB_OK 0x00000000L
|
||||
#define MB_OKCANCEL 0x00000001L
|
||||
#define MB_ABORTRETRYIGNORE 0x00000002L
|
||||
#define MB_YESNOCANCEL 0x00000003L
|
||||
#define MB_YESNO 0x00000004L
|
||||
#define MB_RETRYCANCEL 0x00000005L
|
||||
|
||||
|
||||
#define MB_ICONHAND 0x00000010L
|
||||
#define MB_ICONQUESTION 0x00000020L
|
||||
#define MB_ICONEXCLAMATION 0x00000030L
|
||||
#define MB_ICONASTERISK 0x00000040L
|
||||
|
||||
#define MB_USERICON 0x00000080L
|
||||
#define MB_ICONWARNING MB_ICONEXCLAMATION
|
||||
#define MB_ICONERROR MB_ICONHAND
|
||||
#define MB_ICONINFORMATION MB_ICONASTERISK
|
||||
#define MB_ICONSTOP MB_ICONHAND
|
||||
|
||||
#define MB_TYPEMASK 0x0000000FL
|
||||
#define MB_ICONMASK 0x000000F0L
|
||||
#define MB_DEFMASK 0x00000F00L
|
||||
#define MB_MODEMASK 0x00003000L
|
||||
#define MB_MISCMASK 0x0000C000L
|
||||
|
||||
#define IDOK 1
|
||||
#define IDCANCEL 2
|
||||
#define IDABORT 3
|
||||
#define IDRETRY 4
|
||||
#define IDIGNORE 5
|
||||
#define IDYES 6
|
||||
#define IDNO 7
|
||||
|
||||
typedef struct tagRECT
|
||||
{
|
||||
long left;
|
||||
long top;
|
||||
long right;
|
||||
long bottom;
|
||||
} RECT, *PRECT, *LPRECT;
|
||||
|
||||
#endif // __linux__
|
||||
|
||||
// plugin
|
||||
// FIXME TTimo: drop this
|
||||
extern "C" void Sys_Printf (char *text, ...);
|
||||
|
||||
#include "synapse.h"
|
||||
#include "iplugin.h"
|
||||
#include "qerplugin.h"
|
||||
#include "mathlib.h"
|
||||
#include "igl.h"
|
||||
#include "iselectedface.h"
|
||||
#include "isurfaceplugin.h"
|
||||
#include "iui.h"
|
||||
|
||||
// internals
|
||||
// the implementation of a IWindowListener interface to use with the native UI
|
||||
// TODO: move in it's own set of files?
|
||||
// NOTE: I'm not too sure about the bool flags being any use.. they are supposed to tell if we handle the event or not
|
||||
class CWindowListener : public IWindowListener
|
||||
{
|
||||
int refCount;
|
||||
public:
|
||||
// Increment the number of references to this object
|
||||
void IncRef () { refCount++; }
|
||||
// Decrement the reference count
|
||||
void DecRef () { if ( --refCount <= 0 ) delete this; }
|
||||
// IWindowListener ---------------------------------------
|
||||
bool OnLButtonDown(guint32 nFlags, double x, double y);
|
||||
bool OnMButtonDown(guint32 nFlags, double x, double y) { return false; }
|
||||
bool OnRButtonDown(guint32 nFlags, double x, double y);
|
||||
bool OnLButtonUp(guint32 nFlags, double x, double y);
|
||||
bool OnMButtonUp(guint32 nFlags, double x, double y) { return false; }
|
||||
bool OnRButtonUp(guint32 nFlags, double x, double y);
|
||||
bool OnMouseMove(guint32 nFlags, double x, double y);
|
||||
bool OnKeyPressed(char *s);
|
||||
bool Paint();
|
||||
void Close();
|
||||
};
|
||||
|
||||
#include "2DView.h"
|
||||
typedef struct
|
||||
{
|
||||
float data[MAX_POINTS_ON_WINDING][2];
|
||||
} CtrlPts_t;
|
||||
#include "ControlPointsManager.h"
|
||||
|
||||
extern _QERQglTable g_QglTable;
|
||||
extern _QERFuncTable_1 g_FuncTable;
|
||||
// prefs globals
|
||||
// NOTE: these are used by the CControlPointsManager classes, not very C++ish
|
||||
extern bool g_bPrefsUpdateCameraView;
|
||||
extern _QERSelectedFaceTable g_SelectedFaceTable;
|
||||
extern _QERFaceData g_CancelFaceData;
|
||||
|
||||
#define Sys_Printf g_FuncTable.m_pfnSysPrintf
|
||||
#define Sys_FPrintf g_FuncTable.m_pfnSysFPrintf
|
||||
|
||||
// call to validate the current changes into the editor
|
||||
extern void Textool_Validate();
|
||||
extern void Textool_Cancel();
|
||||
|
||||
class CSynapseClientTexTool : public CSynapseClient
|
||||
{
|
||||
public:
|
||||
// CSynapseClient API
|
||||
bool RequestAPI(APIDescriptor_t *pAPI);
|
||||
const char* GetInfo();
|
||||
|
||||
CSynapseClientTexTool() { }
|
||||
virtual ~CSynapseClientTexTool() { }
|
||||
};
|
||||
|
||||
extern IWindow *g_pToolWnd;
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by TexTool.rc
|
||||
//
|
||||
#define IDUNDO 3
|
||||
#define IDD_DIALOG 101
|
||||
#define IDD_DIALOG2 102
|
||||
#define IDR_DROP_MENU 103
|
||||
#define ID_DROP_VALIDATE 40001
|
||||
#define ID_DROP_ZOOMIN 40002
|
||||
#define ID_DROP_ZOOMOUT 40003
|
||||
#define ID_DROP_CANCEL 40004
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||
#define _APS_NEXT_COMMAND_VALUE 40005
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Developer Studio generated include file.
|
||||
// Used by TexTool.rc
|
||||
//
|
||||
#define IDUNDO 3
|
||||
#define IDD_DIALOG 101
|
||||
#define IDD_DIALOG2 102
|
||||
#define IDR_DROP_MENU 103
|
||||
#define ID_DROP_VALIDATE 40001
|
||||
#define ID_DROP_ZOOMIN 40002
|
||||
#define ID_DROP_ZOOMOUT 40003
|
||||
#define ID_DROP_CANCEL 40004
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 104
|
||||
#define _APS_NEXT_COMMAND_VALUE 40005
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user