forked from Mirrors/openclonk
Rename CStdWindow to C4Window
parent
eac2ce9034
commit
d835ab002a
|
@ -149,7 +149,7 @@ LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
case SIZE_RESTORED:
|
||||
case SIZE_MAXIMIZED:
|
||||
::Application.OnResolutionChanged(LOWORD(lParam), HIWORD(lParam));
|
||||
if(Application.pWindow) // this might be called from CStdWindow::Init in which case Application.pWindow is not yet set
|
||||
if(Application.pWindow) // this might be called from C4Window::Init in which case Application.pWindow is not yet set
|
||||
::SetWindowPos(Application.pWindow->hRenderWindow, NULL, 0, 0, LOWORD(lParam), HIWORD(lParam), SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_NOZORDER);
|
||||
break;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM l
|
|||
void C4FullScreen::HandleMessage (XEvent &e)
|
||||
{
|
||||
// Parent handling
|
||||
CStdWindow::HandleMessage(e);
|
||||
C4Window::HandleMessage(e);
|
||||
|
||||
switch (e.type)
|
||||
{
|
||||
|
@ -415,9 +415,9 @@ C4FullScreen::~C4FullScreen()
|
|||
}
|
||||
|
||||
|
||||
CStdWindow * C4FullScreen::Init(C4AbstractApp * pApp)
|
||||
C4Window * C4FullScreen::Init(C4AbstractApp * pApp)
|
||||
{
|
||||
return Init(CStdWindow::W_Fullscreen, pApp, C4ENGINENAME);
|
||||
return Init(C4Window::W_Fullscreen, pApp, C4ENGINENAME);
|
||||
}
|
||||
|
||||
void C4FullScreen::Close()
|
||||
|
@ -432,7 +432,7 @@ void C4FullScreen::Clear()
|
|||
{
|
||||
if (pSurface) delete pSurface;
|
||||
pSurface = 0;
|
||||
CStdWindow::Clear();
|
||||
C4Window::Clear();
|
||||
}
|
||||
|
||||
void C4FullScreen::Execute()
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
bool IsKeyDown(int iKey);
|
||||
|
||||
class C4FullScreen: public CStdWindow
|
||||
class C4FullScreen: public C4Window
|
||||
{
|
||||
public:
|
||||
C4MainMenu *pMenu;
|
||||
|
@ -43,8 +43,8 @@ public:
|
|||
bool MenuCommand(const char *szCommand);
|
||||
void CloseMenu();
|
||||
bool MenuKeyControl(BYTE byCom); // direct keyboard callback
|
||||
using CStdWindow::Init;
|
||||
virtual CStdWindow * Init(C4AbstractApp * pApp);
|
||||
using C4Window::Init;
|
||||
virtual C4Window * Init(C4AbstractApp * pApp);
|
||||
// User requests close
|
||||
virtual void Close();
|
||||
virtual void Clear();
|
||||
|
|
|
@ -139,7 +139,7 @@ class CTexRef;
|
|||
class CTexMgr;
|
||||
class CStdDDraw;
|
||||
class C4AbstractApp;
|
||||
class CStdWindow;
|
||||
class C4Window;
|
||||
class CSurface;
|
||||
|
||||
namespace C4GUI
|
||||
|
|
|
@ -88,7 +88,7 @@ void C4Console::HandleMessage (XEvent & e)
|
|||
}
|
||||
#endif // USE_X11
|
||||
|
||||
CStdWindow * C4Console::Init(C4AbstractApp * pApp)
|
||||
C4Window * C4Console::Init(C4AbstractApp * pApp)
|
||||
{
|
||||
return C4ConsoleGUI::CreateConsoleWindow(pApp);
|
||||
}
|
||||
|
@ -580,7 +580,7 @@ bool C4ConsoleGUI::ClearLog() {return 0;}
|
|||
void C4ConsoleGUI::ClearNetMenu() {}
|
||||
void C4ConsoleGUI::ClearPlayerMenu() {}
|
||||
void C4ConsoleGUI::ClearViewportMenu() {}
|
||||
CStdWindow * C4ConsoleGUI::CreateConsoleWindow(C4AbstractApp*) {return 0;}
|
||||
C4Window * C4ConsoleGUI::CreateConsoleWindow(C4AbstractApp*) {return 0;}
|
||||
void C4ConsoleGUI::DisplayInfoText(C4ConsoleGUI::InfoTextType, StdStrBuf&) {}
|
||||
void C4ConsoleGUI::DoEnableControls(bool) {}
|
||||
bool C4ConsoleGUI::DoUpdateHaltCtrls(bool) {return 0;}
|
||||
|
@ -612,7 +612,7 @@ void C4ToolsDlg::UpdateTextures() {}
|
|||
void C4ToolsDlg::UpdateToolCtrls() {}
|
||||
bool C4Viewport::ScrollBarsByViewPosition() {return 0;}
|
||||
bool C4Viewport::TogglePlayerLock() {return 0;}
|
||||
void CStdWindow::RequestUpdate() {}
|
||||
void C4Window::RequestUpdate() {}
|
||||
bool OpenURL(char const*) {return 0;}
|
||||
#include "C4ConsoleGUICommon.h"
|
||||
#endif
|
||||
|
|
|
@ -45,9 +45,9 @@ const int C4CNS_ModePlay = 0,
|
|||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#include <StdGtkWindow.h>
|
||||
typedef CStdGtkWindow C4ConsoleBase;
|
||||
typedef C4GtkWindow C4ConsoleBase;
|
||||
#else
|
||||
typedef CStdWindow C4ConsoleBase;
|
||||
typedef C4Window C4ConsoleBase;
|
||||
#endif
|
||||
|
||||
class C4Console: public C4ConsoleGUI
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
virtual void Clear();
|
||||
virtual void Close();
|
||||
using C4ConsoleBase::Init;
|
||||
virtual CStdWindow * Init(C4AbstractApp * app);
|
||||
virtual C4Window * Init(C4AbstractApp * app);
|
||||
void Execute();
|
||||
void ClearPointers(C4Object *pObj);
|
||||
bool Message(const char *szMessage, bool fQuery=false);
|
||||
|
|
|
@ -312,10 +312,10 @@ void C4ConsoleGUI::State::OnScriptActivate(GtkWidget* widget, gpointer data)
|
|||
Console.EditCursor.In(text);
|
||||
}
|
||||
|
||||
CStdWindow* C4ConsoleGUI::CreateConsoleWindow(C4AbstractApp* pApp)
|
||||
C4Window* C4ConsoleGUI::CreateConsoleWindow(C4AbstractApp* pApp)
|
||||
{
|
||||
// Calls InitGUI
|
||||
CStdWindow* retval = C4ConsoleBase::Init(CStdWindow::W_GuiWindow, pApp, LoadResStr("IDS_CNS_CONSOLE"), NULL, false);
|
||||
C4Window* retval = C4ConsoleBase::Init(C4Window::W_GuiWindow, pApp, LoadResStr("IDS_CNS_CONSOLE"), NULL, false);
|
||||
UpdateHaltCtrls(true);
|
||||
EnableControls(fGameOpen);
|
||||
ClearViewportMenu();
|
||||
|
|
|
@ -26,9 +26,9 @@
|
|||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#include <StdGtkWindow.h>
|
||||
typedef CStdGtkWindow C4ConsoleBase;
|
||||
typedef C4GtkWindow C4ConsoleBase;
|
||||
#else
|
||||
typedef CStdWindow C4ConsoleBase;
|
||||
typedef C4Window C4ConsoleBase;
|
||||
#endif
|
||||
|
||||
namespace OpenFileFlags
|
||||
|
@ -100,7 +100,7 @@ public:
|
|||
void ClearPlayerMenu();
|
||||
void SetInputFunctions(std::list<char*> &functions);
|
||||
|
||||
CStdWindow* CreateConsoleWindow(C4AbstractApp *application);
|
||||
C4Window* CreateConsoleWindow(C4AbstractApp *application);
|
||||
void Out(const char* message);
|
||||
bool ClearLog();
|
||||
void DisplayInfoText(InfoTextType type, StdStrBuf& text);
|
||||
|
|
|
@ -604,7 +604,7 @@ bool C4ConsoleGUI::UpdateModeCtrls(int iMode)
|
|||
return true;
|
||||
}
|
||||
|
||||
CStdWindow* C4ConsoleGUI::CreateConsoleWindow(C4AbstractApp *application)
|
||||
C4Window* C4ConsoleGUI::CreateConsoleWindow(C4AbstractApp *application)
|
||||
{
|
||||
hWindow = CreateDialog(application->GetInstance(), MAKEINTRESOURCE(IDD_CONSOLE), NULL, ConsoleDlgProc);
|
||||
if (!hWindow)
|
||||
|
|
|
@ -687,7 +687,7 @@ namespace C4GUI
|
|||
return NULL;
|
||||
}
|
||||
#endif
|
||||
Dialog *Screen::GetDialog(CStdWindow * pWindow)
|
||||
Dialog *Screen::GetDialog(C4Window * pWindow)
|
||||
{
|
||||
// get dialog with matching window
|
||||
Dialog *pDlg;
|
||||
|
|
|
@ -1947,13 +1947,13 @@ namespace C4GUI
|
|||
class Dialog;
|
||||
|
||||
// EM window class
|
||||
class DialogWindow : public CStdWindow
|
||||
class DialogWindow : public C4Window
|
||||
{
|
||||
public:
|
||||
Dialog* pDialog;
|
||||
DialogWindow(): CStdWindow(), pDialog(NULL) {}
|
||||
using CStdWindow::Init;
|
||||
CStdWindow * Init(CStdWindow::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent, const C4Rect &rcBounds, const char *szID);
|
||||
DialogWindow(): C4Window(), pDialog(NULL) {}
|
||||
using C4Window::Init;
|
||||
C4Window * Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent, const C4Rect &rcBounds, const char *szID);
|
||||
virtual void Close();
|
||||
#ifdef USE_X11
|
||||
virtual void HandleMessage (XEvent &);
|
||||
|
@ -2567,7 +2567,7 @@ namespace C4GUI
|
|||
#ifdef _WIN32
|
||||
Dialog *GetDialog(HWND hWindow); // get console dialog
|
||||
#endif
|
||||
Dialog *GetDialog(CStdWindow * pWindow); // get console dialog
|
||||
Dialog *GetDialog(C4Window * pWindow); // get console dialog
|
||||
void DoContext(ContextMenu *pNewCtx, Element *pAtElement, int32_t iX, int32_t iY); // open context menu (closes any other contextmenu)
|
||||
void AbortContext(bool fByUser) { if (pContext) pContext->Abort(fByUser); } // close context menu
|
||||
int32_t GetContextMenuIndex() { return pContext ? pContext->GetMenuIndex() : 0; } // get current context-menu (lowest level)
|
||||
|
|
|
@ -194,7 +194,7 @@ namespace C4GUI
|
|||
// DialogWindow
|
||||
|
||||
#ifdef _WIN32
|
||||
CStdWindow * DialogWindow::Init(CStdWindow::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent, const C4Rect &rcBounds, const char *szID)
|
||||
C4Window * DialogWindow::Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent, const C4Rect &rcBounds, const char *szID)
|
||||
{
|
||||
Active = true;
|
||||
// calculate required size
|
||||
|
@ -316,10 +316,10 @@ namespace C4GUI
|
|||
return !!RegisterClassExW(&WndClass);
|
||||
}
|
||||
#else
|
||||
CStdWindow * DialogWindow::Init(CStdWindow::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent, const C4Rect &rcBounds, const char *szID)
|
||||
C4Window * DialogWindow::Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent, const C4Rect &rcBounds, const char *szID)
|
||||
{
|
||||
CStdWindow *result;
|
||||
if (CStdWindow::Init(windowKind, pApp, Title, pParent, false))
|
||||
C4Window *result;
|
||||
if (C4Window::Init(windowKind, pApp, Title, pParent, false))
|
||||
{
|
||||
// update pos
|
||||
if (szID && *szID)
|
||||
|
@ -336,7 +336,7 @@ namespace C4GUI
|
|||
void DialogWindow::HandleMessage (XEvent &e)
|
||||
{
|
||||
// Parent handling
|
||||
CStdWindow::HandleMessage(e);
|
||||
C4Window::HandleMessage(e);
|
||||
|
||||
// Determine dialog
|
||||
Dialog *pDlg = ::pGUI->GetDialog(this);
|
||||
|
@ -468,7 +468,7 @@ namespace C4GUI
|
|||
if (pWindow) return true;
|
||||
// create it!
|
||||
pWindow = new DialogWindow();
|
||||
if (!pWindow->Init(CStdWindow::W_GuiWindow, &Application, TitleString.getData(), &Console, rcBounds, GetID()))
|
||||
if (!pWindow->Init(C4Window::W_GuiWindow, &Application, TitleString.getData(), &Console, rcBounds, GetID()))
|
||||
{
|
||||
delete pWindow;
|
||||
pWindow = NULL;
|
||||
|
|
|
@ -376,7 +376,7 @@ void C4Viewport::Execute()
|
|||
AdjustPosition();
|
||||
// Current graphics output
|
||||
C4TargetFacet cgo;
|
||||
CStdWindow * w = pWindow;
|
||||
C4Window * w = pWindow;
|
||||
if (!w) w = &FullScreen;
|
||||
cgo.Set(w->pSurface,DrawX,DrawY,int32_t(ceilf(float(ViewWdt)/Zoom)),int32_t(ceilf(float(ViewHgt)/Zoom)),ViewX,ViewY,Zoom);
|
||||
lpDDraw->PrepareRendering(w->pSurface);
|
||||
|
@ -648,7 +648,7 @@ bool C4Viewport::Init(int32_t iPlayer, bool fSetTempOnly)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool C4Viewport::Init(CStdWindow * pParent, C4AbstractApp * pApp, int32_t iPlayer)
|
||||
bool C4Viewport::Init(C4Window * pParent, C4AbstractApp * pApp, int32_t iPlayer)
|
||||
{
|
||||
// Console viewport initialization
|
||||
// Set Player
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
float GetZoomLimitMax() const { return ZoomLimitMax; }
|
||||
float GetZoomTarget() const { return ZoomTarget; }
|
||||
bool Init(int32_t iPlayer, bool fSetTempOnly);
|
||||
bool Init(CStdWindow * pParent, C4AbstractApp * pApp, int32_t iPlayer);
|
||||
bool Init(C4Window * pParent, C4AbstractApp * pApp, int32_t iPlayer);
|
||||
void DropFile(const char* fileName, float x, float y);
|
||||
#ifdef _WIN32
|
||||
bool DropFiles(HANDLE hDrop);
|
||||
|
|
|
@ -824,9 +824,9 @@ void C4ViewportWindow::PerformUpdate()
|
|||
}
|
||||
|
||||
|
||||
CStdWindow * C4ViewportWindow::Init(CStdWindow * pParent, C4AbstractApp * pApp, int32_t Player)
|
||||
C4Window * C4ViewportWindow::Init(C4Window * pParent, C4AbstractApp * pApp, int32_t Player)
|
||||
{
|
||||
CStdWindow* result;
|
||||
C4Window* result;
|
||||
const char * Title = Player == NO_OWNER ? LoadResStr("IDS_CNS_VIEWPORT") : ::Players.Get(Player)->GetName();
|
||||
#ifdef _WIN32
|
||||
Active = true;
|
||||
|
@ -844,7 +844,7 @@ CStdWindow * C4ViewportWindow::Init(CStdWindow * pParent, C4AbstractApp * pApp,
|
|||
|
||||
result = this;
|
||||
#else
|
||||
result = C4ViewportBase::Init(CStdWindow::W_Viewport, pApp, Title, pParent, false);
|
||||
result = C4ViewportBase::Init(C4Window::W_Viewport, pApp, Title, pParent, false);
|
||||
#endif
|
||||
if (!result) return result;
|
||||
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
|
||||
#ifdef WITH_DEVELOPER_MODE
|
||||
#include <StdGtkWindow.h>
|
||||
typedef CStdGtkWindow C4ViewportBase;
|
||||
typedef C4GtkWindow C4ViewportBase;
|
||||
#else
|
||||
typedef CStdWindow C4ViewportBase;
|
||||
typedef C4Window C4ViewportBase;
|
||||
#endif
|
||||
|
||||
class C4ViewportWindow: public C4ViewportBase
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
virtual void HandleMessage (XEvent &);
|
||||
#endif
|
||||
void EditCursorMove(int X, int Y, uint16_t);
|
||||
CStdWindow * Init(CStdWindow * pParent, C4AbstractApp * pApp, int32_t iPlayer);
|
||||
C4Window * Init(C4Window * pParent, C4AbstractApp * pApp, int32_t iPlayer);
|
||||
virtual void Close();
|
||||
virtual void PerformUpdate();
|
||||
};
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
class CStdWindow;
|
||||
class C4Window;
|
||||
class C4ViewportWindow;
|
||||
class C4Viewport;
|
||||
|
||||
|
@ -27,7 +27,7 @@ class C4Viewport;
|
|||
@interface ClonkWindowController : NSWindowController<NSWindowDelegate> {
|
||||
IBOutlet ClonkOpenGLView* openGLView;
|
||||
IBOutlet NSScrollView* scrollView;
|
||||
CStdWindow* stdWindow;
|
||||
C4Window* stdWindow;
|
||||
NSWindow* fullscreenWindow;
|
||||
}
|
||||
- (C4Viewport*) viewport;
|
||||
|
@ -36,7 +36,7 @@ class C4Viewport;
|
|||
|
||||
- (IBAction) scroll:(id)sender;
|
||||
|
||||
@property (readwrite) CStdWindow* stdWindow;
|
||||
@property (readwrite) C4Window* stdWindow;
|
||||
@property (readonly) ClonkOpenGLView* openGLView;
|
||||
@property (readonly) NSScrollView* scrollView;
|
||||
@property (readonly) BOOL isLiveResizing;
|
||||
|
|
|
@ -115,7 +115,7 @@ public:
|
|||
void RestoreVideoMode();
|
||||
bool ScheduleProcs(int iTimeout = -1);
|
||||
bool FlushMessages();
|
||||
CStdWindow * pWindow;
|
||||
C4Window * pWindow;
|
||||
bool fQuitMsgReceived; // if true, a quit message has been received and the application should terminate
|
||||
|
||||
// Copy the text to the clipboard or the primary selection
|
||||
|
@ -210,8 +210,8 @@ protected:
|
|||
|
||||
friend class CStdGL;
|
||||
friend class CStdGLCtx;
|
||||
friend class CStdWindow;
|
||||
friend class CStdGtkWindow;
|
||||
friend class C4Window;
|
||||
friend class C4GtkWindow;
|
||||
};
|
||||
|
||||
#endif // INC_STDAPP
|
||||
|
|
|
@ -55,7 +55,7 @@ bool EraseItemSafe(const char *szFilename)
|
|||
|
||||
#endif
|
||||
|
||||
void CStdWindow::PerformUpdate()
|
||||
void C4Window::PerformUpdate()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ void CStdD3D::Clear()
|
|||
|
||||
/* Direct3D initialization */
|
||||
|
||||
bool CStdD3D::PageFlip(C4Rect *pSrcRt, C4Rect *pDstRt, CStdWindow * pWindow)
|
||||
bool CStdD3D::PageFlip(C4Rect *pSrcRt, C4Rect *pDstRt, C4Window * pWindow)
|
||||
{
|
||||
RECT SrcRt, DstRt;
|
||||
if (pSrcRt)
|
||||
|
@ -1140,7 +1140,7 @@ bool CStdD3D::ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdD3D::SaveDefaultGammaRamp(CStdWindow * pWindow)
|
||||
bool CStdD3D::SaveDefaultGammaRamp(C4Window * pWindow)
|
||||
{
|
||||
if (!lpDevice) return false;
|
||||
lpDevice->GetGammaRamp(0, &DefRamp.ramp);
|
||||
|
|
|
@ -118,7 +118,7 @@ public:
|
|||
// General
|
||||
void Clear();
|
||||
void Default();
|
||||
bool PageFlip(C4Rect *pSrcRt=NULL, C4Rect *pDstRt=NULL, CStdWindow * pWindow = NULL);
|
||||
bool PageFlip(C4Rect *pSrcRt=NULL, C4Rect *pDstRt=NULL, C4Window * pWindow = NULL);
|
||||
bool BeginScene(); // prepare device for drawing
|
||||
void EndScene(); // prepare device for surface locking, flipping etc.
|
||||
virtual int GetEngine() { return fSoftware ? 2 : 0; } // get indexed engine
|
||||
|
@ -144,7 +144,7 @@ public:
|
|||
void DrawPixPrimary(SURFACE sfcDest, int tx, int ty, DWORD dwCol);
|
||||
// Gamma
|
||||
virtual bool ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce);
|
||||
virtual bool SaveDefaultGammaRamp(CStdWindow * pWindow);
|
||||
virtual bool SaveDefaultGammaRamp(C4Window * pWindow);
|
||||
// device objects
|
||||
bool InitDeviceObjects(); // init device dependent objects
|
||||
bool InitShaders(); // parse and set shaders
|
||||
|
|
|
@ -37,7 +37,7 @@ class CSurface;
|
|||
struct CStdPalette;
|
||||
class CStdGLCtx;
|
||||
class C4AbstractApp;
|
||||
class CStdWindow;
|
||||
class C4Window;
|
||||
|
||||
class StdMeshMatrix;
|
||||
class StdMeshMaterial;
|
||||
|
@ -225,7 +225,7 @@ public:
|
|||
bool Init(C4AbstractApp * pApp, bool Editor, bool fUsePageLock, unsigned int iXRes, unsigned int iYRes, int iBitDepth, unsigned int iMonitor);
|
||||
virtual void Clear();
|
||||
virtual void Default();
|
||||
virtual CStdGLCtx *CreateContext(CStdWindow *, C4AbstractApp *) { return NULL; }
|
||||
virtual CStdGLCtx *CreateContext(C4Window *, C4AbstractApp *) { return NULL; }
|
||||
#ifdef _WIN32
|
||||
virtual CStdGLCtx *CreateContext(HWND, C4AbstractApp *) { return NULL; }
|
||||
#endif
|
||||
|
@ -292,7 +292,7 @@ public:
|
|||
void EnableGamma(); // set current gamma ramp
|
||||
DWORD ApplyGammaTo(DWORD dwClr); // apply gamma to given color
|
||||
virtual bool ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce)=0; // really apply gamma ramp
|
||||
virtual bool SaveDefaultGammaRamp(CStdWindow * pWindow)=0;
|
||||
virtual bool SaveDefaultGammaRamp(C4Window * pWindow)=0;
|
||||
// blit states
|
||||
void ActivateBlitModulation(DWORD dwWithClr) { BlitModulated=true; BlitModulateClr=dwWithClr; } // modulate following blits with a given color
|
||||
void DeactivateBlitModulation() { BlitModulated=false; } // stop color modulation of blits
|
||||
|
|
|
@ -1606,7 +1606,7 @@ void CStdGL::BlitLandscape(SURFACE sfcSource, float fx, float fy,
|
|||
ResetTexture();
|
||||
}
|
||||
|
||||
CStdGLCtx *CStdGL::CreateContext(CStdWindow * pWindow, C4AbstractApp *pApp)
|
||||
CStdGLCtx *CStdGL::CreateContext(C4Window * pWindow, C4AbstractApp *pApp)
|
||||
{
|
||||
DebugLog(" gl: Create Context...");
|
||||
// safety
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
#endif
|
||||
#include <StdDDraw2.h>
|
||||
|
||||
class CStdWindow;
|
||||
class C4Window;
|
||||
|
||||
// one OpenGL context
|
||||
class CStdGLCtx
|
||||
|
@ -48,10 +48,10 @@ public:
|
|||
void Clear(); // clear objects
|
||||
|
||||
#ifdef _WIN32
|
||||
bool Init(CStdWindow * pWindow, C4AbstractApp *pApp, HWND hWindow = NULL);
|
||||
bool Init(C4Window * pWindow, C4AbstractApp *pApp, HWND hWindow = NULL);
|
||||
std::vector<int> EnumerateMultiSamples() const;
|
||||
#else
|
||||
bool Init(CStdWindow * pWindow, C4AbstractApp *pApp);
|
||||
bool Init(C4Window * pWindow, C4AbstractApp *pApp);
|
||||
#endif
|
||||
|
||||
#ifdef USE_COCOA
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
protected:
|
||||
void SelectCommon();
|
||||
// this handles are declared as pointers to structs
|
||||
CStdWindow * pWindow; // window to draw in
|
||||
C4Window * pWindow; // window to draw in
|
||||
#ifdef _WIN32
|
||||
HGLRC hrc; // rendering context
|
||||
HWND hWindow; // used if pWindow==NULL
|
||||
|
@ -117,7 +117,7 @@ public:
|
|||
bool PrepareMaterial(StdMeshMaterial& mat);
|
||||
// Surface
|
||||
bool PrepareRendering(SURFACE sfcToSurface); // check if/make rendering possible to given surface
|
||||
virtual CStdGLCtx *CreateContext(CStdWindow * pWindow, C4AbstractApp *pApp);
|
||||
virtual CStdGLCtx *CreateContext(C4Window * pWindow, C4AbstractApp *pApp);
|
||||
#ifdef _WIN32
|
||||
virtual CStdGLCtx *CreateContext(HWND hWindow, C4AbstractApp *pApp);
|
||||
#endif
|
||||
|
@ -134,7 +134,7 @@ public:
|
|||
void PerformPix(SURFACE sfcDest, float tx, float ty, DWORD dwCol);
|
||||
// Gamma
|
||||
virtual bool ApplyGammaRamp(D3DGAMMARAMP &ramp, bool fForce);
|
||||
virtual bool SaveDefaultGammaRamp(CStdWindow * pWindow);
|
||||
virtual bool SaveDefaultGammaRamp(C4Window * pWindow);
|
||||
// device objects
|
||||
bool RestoreDeviceObjects(); // restore device dependent objects
|
||||
bool InvalidateDeviceObjects(); // free device dependent objects
|
||||
|
@ -158,7 +158,7 @@ protected:
|
|||
friend class CStdGLCtx;
|
||||
friend class C4StartupOptionsDlg;
|
||||
friend class C4FullScreen;
|
||||
friend class CStdWindow;
|
||||
friend class C4Window;
|
||||
};
|
||||
|
||||
// Global access pointer
|
||||
|
|
|
@ -267,7 +267,7 @@ void CStdGLCtx::Clear()
|
|||
pWindow = 0; hWindow = NULL;
|
||||
}
|
||||
|
||||
bool CStdGLCtx::Init(CStdWindow * pWindow, C4AbstractApp *pApp, HWND hWindow)
|
||||
bool CStdGLCtx::Init(C4Window * pWindow, C4AbstractApp *pApp, HWND hWindow)
|
||||
{
|
||||
// safety
|
||||
if (!pGL) return false;
|
||||
|
@ -411,7 +411,7 @@ bool CStdGLCtx::PageFlip()
|
|||
return true;
|
||||
}
|
||||
|
||||
bool CStdGL::SaveDefaultGammaRamp(CStdWindow * pWindow)
|
||||
bool CStdGL::SaveDefaultGammaRamp(C4Window * pWindow)
|
||||
{
|
||||
HDC hDC = GetDC(pWindow->hWindow);
|
||||
if (hDC)
|
||||
|
@ -460,7 +460,7 @@ void CStdGLCtx::Clear()
|
|||
pWindow = 0;
|
||||
}
|
||||
|
||||
bool CStdGLCtx::Init(CStdWindow * pWindow, C4AbstractApp *)
|
||||
bool CStdGLCtx::Init(C4Window * pWindow, C4AbstractApp *)
|
||||
{
|
||||
// safety
|
||||
if (!pGL) return false;
|
||||
|
@ -539,7 +539,7 @@ bool CStdGL::ApplyGammaRamp(_D3DGAMMARAMP& ramp, bool fForce)
|
|||
ramp.red, ramp.green, ramp.blue);
|
||||
}
|
||||
|
||||
bool CStdGL::SaveDefaultGammaRamp(CStdWindow * pWindow)
|
||||
bool CStdGL::SaveDefaultGammaRamp(C4Window * pWindow)
|
||||
{
|
||||
if (pApp->xf86vmode_major_version < 2) return false;
|
||||
// Get the Display
|
||||
|
@ -571,7 +571,7 @@ void CStdGLCtx::Clear()
|
|||
pWindow = 0;
|
||||
}
|
||||
|
||||
bool CStdGLCtx::Init(CStdWindow * pWindow, C4AbstractApp *)
|
||||
bool CStdGLCtx::Init(C4Window * pWindow, C4AbstractApp *)
|
||||
{
|
||||
// safety
|
||||
if (!pGL) return false;
|
||||
|
@ -626,7 +626,7 @@ bool CStdGL::ApplyGammaRamp(_D3DGAMMARAMP& ramp, bool fForce)
|
|||
return SDL_SetGammaRamp(ramp.red, ramp.green, ramp.blue) != -1;
|
||||
}
|
||||
|
||||
bool CStdGL::SaveDefaultGammaRamp(CStdWindow * pWindow)
|
||||
bool CStdGL::SaveDefaultGammaRamp(C4Window * pWindow)
|
||||
{
|
||||
return SDL_GetGammaRamp(DefRamp.ramp.red, DefRamp.ramp.green, DefRamp.ramp.blue) != -1;
|
||||
}
|
||||
|
|
|
@ -34,19 +34,19 @@
|
|||
#include <gtk/gtk.h>
|
||||
|
||||
|
||||
/* CStdGtkWindow */
|
||||
/* C4GtkWindow */
|
||||
|
||||
CStdGtkWindow::CStdGtkWindow():
|
||||
CStdWindow(), window(NULL)
|
||||
C4GtkWindow::C4GtkWindow():
|
||||
C4Window(), window(NULL)
|
||||
{
|
||||
}
|
||||
|
||||
CStdGtkWindow::~CStdGtkWindow()
|
||||
C4GtkWindow::~C4GtkWindow()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
CStdWindow* CStdGtkWindow::Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent, bool HideCursor)
|
||||
C4Window* C4GtkWindow::Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent, bool HideCursor)
|
||||
{
|
||||
Active = true;
|
||||
dpy = pApp->dpy;
|
||||
|
@ -148,7 +148,7 @@ CStdWindow* CStdGtkWindow::Init(WindowKind windowKind, C4AbstractApp * pApp, con
|
|||
return this;
|
||||
}
|
||||
|
||||
bool CStdGtkWindow::ReInit(C4AbstractApp* pApp)
|
||||
bool C4GtkWindow::ReInit(C4AbstractApp* pApp)
|
||||
{
|
||||
// TODO: Recreate the window with a newly chosen visual
|
||||
// Probably we don't need this, since there is no way to change
|
||||
|
@ -156,7 +156,7 @@ bool CStdGtkWindow::ReInit(C4AbstractApp* pApp)
|
|||
return false;
|
||||
}
|
||||
|
||||
void CStdGtkWindow::Clear()
|
||||
void C4GtkWindow::Clear()
|
||||
{
|
||||
if (window != NULL)
|
||||
{
|
||||
|
@ -171,7 +171,7 @@ void CStdGtkWindow::Clear()
|
|||
window = NULL;
|
||||
Active = false;
|
||||
|
||||
// We must free it here since we do not call CStdWindow::Clear()
|
||||
// We must free it here since we do not call C4Window::Clear()
|
||||
if (Info)
|
||||
{
|
||||
delete static_cast<XVisualInfo*>(Info);
|
||||
|
@ -179,9 +179,9 @@ void CStdGtkWindow::Clear()
|
|||
}
|
||||
}
|
||||
|
||||
void CStdGtkWindow::OnDestroyStatic(GtkWidget* widget, gpointer data)
|
||||
void C4GtkWindow::OnDestroyStatic(GtkWidget* widget, gpointer data)
|
||||
{
|
||||
CStdGtkWindow* wnd = static_cast<CStdGtkWindow*>(data);
|
||||
C4GtkWindow* wnd = static_cast<C4GtkWindow*>(data);
|
||||
|
||||
g_signal_handler_disconnect(wnd->window, wnd->handlerDestroy);
|
||||
//gtk_widget_destroy(wnd->window);
|
||||
|
@ -193,14 +193,14 @@ void CStdGtkWindow::OnDestroyStatic(GtkWidget* widget, gpointer data)
|
|||
wnd->Close();
|
||||
}
|
||||
|
||||
GdkFilterReturn CStdGtkWindow::OnFilter(GdkXEvent* xevent, GdkEvent* event, gpointer user_data)
|
||||
GdkFilterReturn C4GtkWindow::OnFilter(GdkXEvent* xevent, GdkEvent* event, gpointer user_data)
|
||||
{
|
||||
// Handle raw X message, then let GTK+ process it
|
||||
static_cast<CStdGtkWindow*>(user_data)->HandleMessage(*reinterpret_cast<XEvent*>(xevent));
|
||||
static_cast<C4GtkWindow*>(user_data)->HandleMessage(*reinterpret_cast<XEvent*>(xevent));
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
gboolean CStdGtkWindow::OnUpdateKeyMask(GtkWidget* widget, GdkEventKey* event, gpointer user_data)
|
||||
gboolean C4GtkWindow::OnUpdateKeyMask(GtkWidget* widget, GdkEventKey* event, gpointer user_data)
|
||||
{
|
||||
// Update mask so that Application.IsShiftDown,
|
||||
// Application.IsControlDown etc. work.
|
||||
|
@ -228,12 +228,12 @@ gboolean CStdGtkWindow::OnUpdateKeyMask(GtkWidget* widget, GdkEventKey* event, g
|
|||
return false;
|
||||
}
|
||||
|
||||
GtkWidget* CStdGtkWindow::InitGUI()
|
||||
GtkWidget* C4GtkWindow::InitGUI()
|
||||
{
|
||||
return window;
|
||||
}
|
||||
|
||||
void CStdWindow::RequestUpdate()
|
||||
void C4Window::RequestUpdate()
|
||||
{
|
||||
// just invoke directly
|
||||
PerformUpdate();
|
||||
|
|
|
@ -25,16 +25,16 @@
|
|||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
class CStdGtkWindow: public CStdWindow
|
||||
class C4GtkWindow: public C4Window
|
||||
{
|
||||
public:
|
||||
CStdGtkWindow();
|
||||
virtual ~CStdGtkWindow();
|
||||
C4GtkWindow();
|
||||
virtual ~C4GtkWindow();
|
||||
|
||||
virtual void Clear();
|
||||
|
||||
using CStdWindow::Init;
|
||||
virtual CStdWindow * Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent = 0, bool HideCursor = true);
|
||||
using C4Window::Init;
|
||||
virtual C4Window * Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent = 0, bool HideCursor = true);
|
||||
virtual bool ReInit(C4AbstractApp* pApp);
|
||||
|
||||
GtkWidget* window;
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
virtual void DrawQuadDw(SURFACE, float *, DWORD, DWORD, DWORD, DWORD) { }
|
||||
virtual void PerformPix(SURFACE, float, float, DWORD) { }
|
||||
virtual bool ApplyGammaRamp(D3DGAMMARAMP &, bool ) { return true; }
|
||||
virtual bool SaveDefaultGammaRamp(CStdWindow *) { return true; }
|
||||
virtual bool SaveDefaultGammaRamp(C4Window *) { return true; }
|
||||
virtual void SetTexture() { }
|
||||
virtual void ResetTexture() { }
|
||||
virtual bool InitDeviceObjects() { return true; }
|
||||
|
|
|
@ -155,7 +155,7 @@ bool C4AbstractApp::SetVideoMode(unsigned int iXRes, unsigned int iYRes, unsigne
|
|||
{
|
||||
//RECT r;
|
||||
//pWindow->GetSize(&r);
|
||||
// FIXME: optimize redundant calls away. maybe make all platforms implicitely call SetVideoMode in CStdWindow::Init?
|
||||
// FIXME: optimize redundant calls away. maybe make all platforms implicitely call SetVideoMode in C4Window::Init?
|
||||
// SDL doesn't support multiple monitors.
|
||||
if (!SDL_SetVideoMode(iXRes, iYRes, iColorDepth, SDL_OPENGL | (fFullScreen ? SDL_FULLSCREEN : 0)))
|
||||
{
|
||||
|
|
|
@ -33,19 +33,19 @@
|
|||
#include <C4Rect.h>
|
||||
#include <C4Config.h>
|
||||
|
||||
/* CStdWindow */
|
||||
/* C4Window */
|
||||
|
||||
CStdWindow::CStdWindow ():
|
||||
C4Window::C4Window ():
|
||||
Active(false), pSurface(0)
|
||||
{
|
||||
}
|
||||
|
||||
CStdWindow::~CStdWindow ()
|
||||
C4Window::~C4Window ()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
CStdWindow * CStdWindow::Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent, bool HideCursor)
|
||||
C4Window * C4Window::Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent, bool HideCursor)
|
||||
{
|
||||
Active = true;
|
||||
// SDL doesn't support multiple monitors.
|
||||
|
@ -60,40 +60,40 @@ CStdWindow * CStdWindow::Init(WindowKind windowKind, C4AbstractApp * pApp, const
|
|||
return this;
|
||||
}
|
||||
|
||||
bool CStdWindow::ReInit(C4AbstractApp* pApp)
|
||||
bool C4Window::ReInit(C4AbstractApp* pApp)
|
||||
{
|
||||
// TODO: How do we enable multisampling with SDL?
|
||||
// Maybe re-call SDL_SetVideoMode?
|
||||
return false;
|
||||
}
|
||||
|
||||
void CStdWindow::Clear() {}
|
||||
void C4Window::Clear() {}
|
||||
|
||||
void CStdWindow::EnumerateMultiSamples(std::vector<int>& samples) const
|
||||
void C4Window::EnumerateMultiSamples(std::vector<int>& samples) const
|
||||
{
|
||||
// TODO: Enumerate multi samples
|
||||
}
|
||||
|
||||
bool CStdWindow::StorePosition(const char *, const char *, bool) { return true; }
|
||||
bool C4Window::StorePosition(const char *, const char *, bool) { return true; }
|
||||
|
||||
bool CStdWindow::RestorePosition(const char *, const char *, bool) { return true; }
|
||||
bool C4Window::RestorePosition(const char *, const char *, bool) { return true; }
|
||||
|
||||
// Window size is automatically managed by C4AbstractApp's display mode management.
|
||||
// Just remember the size for others to query.
|
||||
|
||||
bool CStdWindow::GetSize(C4Rect * pRect)
|
||||
bool C4Window::GetSize(C4Rect * pRect)
|
||||
{
|
||||
pRect->x = pRect->y = 0;
|
||||
pRect->Wdt = width, pRect->Hgt = height;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CStdWindow::SetSize(unsigned int X, unsigned int Y)
|
||||
void C4Window::SetSize(unsigned int X, unsigned int Y)
|
||||
{
|
||||
width = X, height = Y;
|
||||
}
|
||||
|
||||
void CStdWindow::SetTitle(const char * Title)
|
||||
void C4Window::SetTitle(const char * Title)
|
||||
{
|
||||
SDL_WM_SetCaption(Title, 0);
|
||||
}
|
||||
|
@ -101,7 +101,7 @@ void CStdWindow::SetTitle(const char * Title)
|
|||
// For Max OS X, the implementation resides in StdMacApp.mm
|
||||
#ifndef __APPLE__
|
||||
|
||||
void CStdWindow::FlashWindow()
|
||||
void C4Window::FlashWindow()
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ CSurface::CSurface(int iWdt, int iHgt) : fIsBackground(false)
|
|||
Create(iWdt, iHgt);
|
||||
}
|
||||
|
||||
CSurface::CSurface(C4AbstractApp * pApp, CStdWindow * pWindow):
|
||||
CSurface::CSurface(C4AbstractApp * pApp, C4Window * pWindow):
|
||||
Wdt(0), Hgt(0)
|
||||
{
|
||||
Default();
|
||||
|
|
|
@ -83,7 +83,7 @@ public:
|
|||
CSurface();
|
||||
~CSurface();
|
||||
CSurface(int iWdt, int iHgt); // create new surface and init it
|
||||
CSurface(C4AbstractApp * pApp, CStdWindow * pWindow); // create new surface for a window
|
||||
CSurface(C4AbstractApp * pApp, C4Window * pWindow); // create new surface for a window
|
||||
public:
|
||||
int Wdt,Hgt; // size of surface
|
||||
int Scale; // scale of image; divide coordinates by this value to get the "original" image size
|
||||
|
@ -128,7 +128,7 @@ public:
|
|||
void MoveFrom(CSurface *psfcFrom); // grab data from other surface - invalidates other surface
|
||||
bool IsRenderTarget(); // surface can be used as a render target?
|
||||
protected:
|
||||
CStdWindow * pWindow;
|
||||
C4Window * pWindow;
|
||||
int Locked;
|
||||
bool Attached;
|
||||
bool fPrimary;
|
||||
|
|
|
@ -204,7 +204,7 @@ static void readline_callback (char * line)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool CStdDDraw::SaveDefaultGammaRamp(CStdWindow * pWindow)
|
||||
bool CStdDDraw::SaveDefaultGammaRamp(C4Window * pWindow)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -221,16 +221,16 @@ bool C4AbstractApp::FlushMessages()
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdWindow::Clear() {}
|
||||
CStdWindow::CStdWindow() {}
|
||||
CStdWindow::~CStdWindow() {}
|
||||
void CStdWindow::EnumerateMultiSamples(std::vector<int, std::allocator<int> >&) const {}
|
||||
void CStdWindow::FlashWindow() {}
|
||||
bool CStdWindow::GetSize(C4Rect*) {return 0;}
|
||||
CStdWindow* CStdWindow::Init(CStdWindow::WindowKind, C4AbstractApp*, char const*, CStdWindow*, bool) {return this;}
|
||||
bool CStdWindow::ReInit(C4AbstractApp*) {return 0;}
|
||||
bool CStdWindow::RestorePosition(char const*, char const*, bool) {return 0;}
|
||||
void CStdWindow::SetSize(unsigned int, unsigned int) {}
|
||||
void CStdWindow::SetTitle(char const*) {}
|
||||
void C4Window::Clear() {}
|
||||
C4Window::C4Window() {}
|
||||
C4Window::~C4Window() {}
|
||||
void C4Window::EnumerateMultiSamples(std::vector<int, std::allocator<int> >&) const {}
|
||||
void C4Window::FlashWindow() {}
|
||||
bool C4Window::GetSize(C4Rect*) {return 0;}
|
||||
C4Window* C4Window::Init(C4Window::WindowKind, C4AbstractApp*, char const*, C4Window*, bool) {return this;}
|
||||
bool C4Window::ReInit(C4AbstractApp*) {return 0;}
|
||||
bool C4Window::RestorePosition(char const*, char const*, bool) {return 0;}
|
||||
void C4Window::SetSize(unsigned int, unsigned int) {}
|
||||
void C4Window::SetTitle(char const*) {}
|
||||
|
||||
#endif // USE_CONSOLE
|
||||
|
|
|
@ -63,14 +63,14 @@
|
|||
#define C4FullScreenClassName L"C4FullScreen"
|
||||
LRESULT APIENTRY FullScreenWinProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
|
||||
CStdWindow::CStdWindow (): Active(false), pSurface(0), hWindow(0)
|
||||
C4Window::C4Window (): Active(false), pSurface(0), hWindow(0)
|
||||
{
|
||||
}
|
||||
CStdWindow::~CStdWindow ()
|
||||
C4Window::~C4Window ()
|
||||
{
|
||||
}
|
||||
|
||||
bool CStdWindow::RegisterWindowClass(HINSTANCE hInst)
|
||||
bool C4Window::RegisterWindowClass(HINSTANCE hInst)
|
||||
{
|
||||
WNDCLASSEXW WndClass = {0};
|
||||
WndClass.cbSize = sizeof(WNDCLASSEX);
|
||||
|
@ -84,7 +84,7 @@ bool CStdWindow::RegisterWindowClass(HINSTANCE hInst)
|
|||
return !!RegisterClassExW(&WndClass);
|
||||
}
|
||||
|
||||
CStdWindow * CStdWindow::Init(CStdWindow::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent, bool HideCursor)
|
||||
C4Window * C4Window::Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent, bool HideCursor)
|
||||
{
|
||||
Active = true;
|
||||
|
||||
|
@ -119,7 +119,7 @@ CStdWindow * CStdWindow::Init(CStdWindow::WindowKind windowKind, C4AbstractApp *
|
|||
return this;
|
||||
}
|
||||
|
||||
bool CStdWindow::ReInit(C4AbstractApp* pApp)
|
||||
bool C4Window::ReInit(C4AbstractApp* pApp)
|
||||
{
|
||||
// We don't need to change anything with the window for any
|
||||
// configuration option changes on Windows.
|
||||
|
@ -141,7 +141,7 @@ bool CStdWindow::ReInit(C4AbstractApp* pApp)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdWindow::Clear()
|
||||
void C4Window::Clear()
|
||||
{
|
||||
// Destroy window
|
||||
if (hRenderWindow) DestroyWindow(hRenderWindow);
|
||||
|
@ -150,24 +150,24 @@ void CStdWindow::Clear()
|
|||
hWindow = NULL;
|
||||
}
|
||||
|
||||
bool CStdWindow::StorePosition(const char *szWindowName, const char *szSubKey, bool fStoreSize)
|
||||
bool C4Window::StorePosition(const char *szWindowName, const char *szSubKey, bool fStoreSize)
|
||||
{
|
||||
return StoreWindowPosition(hWindow, szWindowName, szSubKey, fStoreSize) != 0;
|
||||
}
|
||||
|
||||
bool CStdWindow::RestorePosition(const char *szWindowName, const char *szSubKey, bool fHidden)
|
||||
bool C4Window::RestorePosition(const char *szWindowName, const char *szSubKey, bool fHidden)
|
||||
{
|
||||
if (!RestoreWindowPosition(hWindow, szWindowName, szSubKey, fHidden))
|
||||
ShowWindow(hWindow,SW_SHOWNORMAL);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CStdWindow::SetTitle(const char *szToTitle)
|
||||
void C4Window::SetTitle(const char *szToTitle)
|
||||
{
|
||||
if (hWindow) SetWindowTextW(hWindow, szToTitle ? GetWideChar(szToTitle) : L"");
|
||||
}
|
||||
|
||||
bool CStdWindow::GetSize(C4Rect * pRect)
|
||||
bool C4Window::GetSize(C4Rect * pRect)
|
||||
{
|
||||
RECT r;
|
||||
if (!(hWindow && GetClientRect(hWindow,&r))) return false;
|
||||
|
@ -178,7 +178,7 @@ bool CStdWindow::GetSize(C4Rect * pRect)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdWindow::SetSize(unsigned int cx, unsigned int cy)
|
||||
void C4Window::SetSize(unsigned int cx, unsigned int cy)
|
||||
{
|
||||
if (hWindow)
|
||||
{
|
||||
|
@ -195,14 +195,14 @@ void CStdWindow::SetSize(unsigned int cx, unsigned int cy)
|
|||
}
|
||||
}
|
||||
|
||||
void CStdWindow::FlashWindow()
|
||||
void C4Window::FlashWindow()
|
||||
{
|
||||
// please activate me!
|
||||
if (hWindow)
|
||||
::FlashWindow(hWindow, FLASHW_ALL | FLASHW_TIMERNOFG);
|
||||
}
|
||||
|
||||
void CStdWindow::EnumerateMultiSamples(std::vector<int>& samples) const
|
||||
void C4Window::EnumerateMultiSamples(std::vector<int>& samples) const
|
||||
{
|
||||
#ifdef USE_GL
|
||||
if(pGL && pGL->pMainCtx)
|
||||
|
@ -459,7 +459,7 @@ void C4AbstractApp::ClearClipboard(bool fClipboard)
|
|||
{
|
||||
}
|
||||
|
||||
void CStdWindow::RequestUpdate()
|
||||
void C4Window::RequestUpdate()
|
||||
{
|
||||
// just invoke directly
|
||||
PerformUpdate();
|
||||
|
|
|
@ -253,7 +253,7 @@ typedef union _XEvent XEvent;
|
|||
typedef struct _XDisplay Display;
|
||||
#endif
|
||||
|
||||
class CStdWindow
|
||||
class C4Window
|
||||
{
|
||||
public:
|
||||
enum WindowKind
|
||||
|
@ -263,8 +263,8 @@ public:
|
|||
W_Fullscreen
|
||||
};
|
||||
public:
|
||||
CStdWindow ();
|
||||
virtual ~CStdWindow ();
|
||||
C4Window ();
|
||||
virtual ~C4Window ();
|
||||
bool Active;
|
||||
CSurface * pSurface;
|
||||
virtual void Clear();
|
||||
|
@ -273,7 +273,7 @@ public:
|
|||
virtual void Close() = 0;
|
||||
// Keypress(es) translated to a char
|
||||
virtual void CharIn(const char *) { }
|
||||
virtual CStdWindow * Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent = 0, bool HideCursor = true);
|
||||
virtual C4Window * Init(WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent = 0, bool HideCursor = true);
|
||||
|
||||
// Reinitialize the window with updated configuration settings.
|
||||
// Keep window kind, title and size as they are. Currently the only point
|
||||
|
@ -334,7 +334,7 @@ public:
|
|||
friend class CStdGL;
|
||||
friend class CStdGLCtx;
|
||||
friend class C4AbstractApp;
|
||||
friend class CStdGtkWindow;
|
||||
friend class C4GtkWindow;
|
||||
};
|
||||
|
||||
#endif // INC_STDWINDOW
|
||||
|
|
|
@ -268,7 +268,7 @@ void C4AbstractApp::HandleXMessage()
|
|||
}
|
||||
if (c[0])
|
||||
{
|
||||
CStdWindow * pWindow = Priv->GetWindow(event.xany.window);
|
||||
C4Window * pWindow = Priv->GetWindow(event.xany.window);
|
||||
if (pWindow)
|
||||
{
|
||||
pWindow->CharIn(c);
|
||||
|
@ -327,7 +327,7 @@ void C4AbstractApp::HandleXMessage()
|
|||
{
|
||||
if (!strcmp(XGetAtomName(dpy, event.xclient.data.l[0]), "WM_DELETE_WINDOW"))
|
||||
{
|
||||
CStdWindow * pWindow = Priv->GetWindow(event.xclient.window);
|
||||
C4Window * pWindow = Priv->GetWindow(event.xclient.window);
|
||||
if (pWindow) pWindow->Close();
|
||||
}
|
||||
else if (!strcmp(XGetAtomName(dpy, event.xclient.data.l[0]), "_NET_WM_PING"))
|
||||
|
@ -344,7 +344,7 @@ void C4AbstractApp::HandleXMessage()
|
|||
break;
|
||||
case DestroyNotify:
|
||||
{
|
||||
CStdWindow * pWindow = Priv->GetWindow(event.xany.window);
|
||||
C4Window * pWindow = Priv->GetWindow(event.xany.window);
|
||||
if (pWindow)
|
||||
{
|
||||
pWindow->wnd = 0;
|
||||
|
@ -384,7 +384,7 @@ void C4AbstractApp::HandleXMessage()
|
|||
XRRUpdateConfiguration(&event);
|
||||
break;
|
||||
}
|
||||
CStdWindow * pWindow = Priv->GetWindow(event.xany.window);
|
||||
C4Window * pWindow = Priv->GetWindow(event.xany.window);
|
||||
if (pWindow)
|
||||
pWindow->HandleMessage(event);
|
||||
}
|
||||
|
@ -645,13 +645,13 @@ void C4AbstractApp::ClearClipboard(bool fClipboard)
|
|||
d.Text.Clear();
|
||||
}
|
||||
|
||||
CStdWindow * C4X11AppImpl::GetWindow(unsigned long wnd)
|
||||
C4Window * C4X11AppImpl::GetWindow(unsigned long wnd)
|
||||
{
|
||||
WindowListT::iterator i = WindowList.find(wnd);
|
||||
if (i != WindowList.end()) return i->second;
|
||||
return 0;
|
||||
}
|
||||
void C4X11AppImpl::SetWindow(unsigned long wnd, CStdWindow * pWindow)
|
||||
void C4X11AppImpl::SetWindow(unsigned long wnd, C4Window * pWindow)
|
||||
{
|
||||
if (!pWindow)
|
||||
{
|
||||
|
|
|
@ -167,8 +167,8 @@ public:
|
|||
LastEventTime(CurrentTime), tasked_out(false), pending_desktop(false),
|
||||
xim(0), xic(0), X11Proc(pApp),
|
||||
argc(0), argv(0) { }
|
||||
static CStdWindow * GetWindow(unsigned long wnd);
|
||||
static void SetWindow(unsigned long wnd, CStdWindow * pWindow);
|
||||
static C4Window * GetWindow(unsigned long wnd);
|
||||
static void SetWindow(unsigned long wnd, C4Window * pWindow);
|
||||
bool SwitchToFullscreen(C4AbstractApp * pApp, Window wnd);
|
||||
void SwitchToDesktop(C4AbstractApp * pApp, Window wnd);
|
||||
void SetEWMHFullscreen (C4AbstractApp * pApp, bool fFullScreen, Window wnd);
|
||||
|
@ -178,7 +178,7 @@ public:
|
|||
unsigned long AcquirationTime;
|
||||
} PrimarySelection, ClipboardSelection;
|
||||
unsigned long LastEventTime;
|
||||
typedef std::map<unsigned long, CStdWindow *> WindowListT;
|
||||
typedef std::map<unsigned long, C4Window *> WindowListT;
|
||||
static WindowListT WindowList;
|
||||
XF86VidModeModeInfo xf86vmode_oldmode, xf86vmode_targetmode;
|
||||
int xrandr_oldmode;
|
||||
|
|
|
@ -223,18 +223,18 @@ static Window CreateRenderWindow(Display* dpy, Window parent, XVisualInfo* info)
|
|||
info->depth, InputOutput, info->visual, attrmask, &attr);
|
||||
}
|
||||
|
||||
/* CStdWindow */
|
||||
/* C4Window */
|
||||
|
||||
CStdWindow::CStdWindow ():
|
||||
C4Window::C4Window ():
|
||||
Active(false), pSurface(0), wnd(0), renderwnd(0), dpy(0), Hints(0), HasFocus(false), Info(0)
|
||||
{
|
||||
}
|
||||
CStdWindow::~CStdWindow ()
|
||||
C4Window::~C4Window ()
|
||||
{
|
||||
Clear();
|
||||
}
|
||||
|
||||
CStdWindow * CStdWindow::Init(CStdWindow::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, CStdWindow * pParent, bool HideCursor)
|
||||
C4Window * C4Window::Init(C4Window::WindowKind windowKind, C4AbstractApp * pApp, const char * Title, C4Window * pParent, bool HideCursor)
|
||||
{
|
||||
Active = true;
|
||||
dpy = pApp->dpy;
|
||||
|
@ -388,7 +388,7 @@ CStdWindow * CStdWindow::Init(CStdWindow::WindowKind windowKind, C4AbstractApp *
|
|||
return this;
|
||||
}
|
||||
|
||||
bool CStdWindow::ReInit(C4AbstractApp* pApp)
|
||||
bool C4Window::ReInit(C4AbstractApp* pApp)
|
||||
{
|
||||
// Can only re-init if we have been initialized already
|
||||
if(!wnd) return false;
|
||||
|
@ -425,7 +425,7 @@ bool CStdWindow::ReInit(C4AbstractApp* pApp)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdWindow::Clear()
|
||||
void C4Window::Clear()
|
||||
{
|
||||
// Destroy window
|
||||
if (wnd)
|
||||
|
@ -446,7 +446,7 @@ void CStdWindow::Clear()
|
|||
Info = NULL;
|
||||
}
|
||||
|
||||
bool CStdWindow::FindInfo(int samples, void** info)
|
||||
bool C4Window::FindInfo(int samples, void** info)
|
||||
{
|
||||
#ifdef USE_GL
|
||||
std::vector<XVisualInfo> infos = EnumerateVisuals(dpy);
|
||||
|
@ -470,7 +470,7 @@ bool CStdWindow::FindInfo(int samples, void** info)
|
|||
return false;
|
||||
}
|
||||
|
||||
void CStdWindow::EnumerateMultiSamples(std::vector<int>& samples) const
|
||||
void C4Window::EnumerateMultiSamples(std::vector<int>& samples) const
|
||||
{
|
||||
#ifdef USE_GL
|
||||
std::vector<XVisualInfo> infos = EnumerateVisuals(dpy);
|
||||
|
@ -485,15 +485,15 @@ void CStdWindow::EnumerateMultiSamples(std::vector<int>& samples) const
|
|||
#endif
|
||||
}
|
||||
|
||||
bool CStdWindow::StorePosition(const char *, const char *, bool) { return true; }
|
||||
bool C4Window::StorePosition(const char *, const char *, bool) { return true; }
|
||||
|
||||
bool CStdWindow::RestorePosition(const char *, const char *, bool)
|
||||
bool C4Window::RestorePosition(const char *, const char *, bool)
|
||||
{
|
||||
// The Windowmanager is responsible for window placement.
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CStdWindow::GetSize(C4Rect * pRect)
|
||||
bool C4Window::GetSize(C4Rect * pRect)
|
||||
{
|
||||
Window winDummy;
|
||||
unsigned int borderDummy;
|
||||
|
@ -509,11 +509,11 @@ bool CStdWindow::GetSize(C4Rect * pRect)
|
|||
return true;
|
||||
}
|
||||
|
||||
void CStdWindow::SetSize(unsigned int X, unsigned int Y)
|
||||
void C4Window::SetSize(unsigned int X, unsigned int Y)
|
||||
{
|
||||
XResizeWindow(dpy, wnd, X, Y);
|
||||
}
|
||||
void CStdWindow::SetTitle(const char * Title)
|
||||
void C4Window::SetTitle(const char * Title)
|
||||
{
|
||||
XTextProperty title_property;
|
||||
StdStrBuf tbuf(Title, true);
|
||||
|
@ -522,7 +522,7 @@ void CStdWindow::SetTitle(const char * Title)
|
|||
XSetWMName(dpy, wnd, &title_property);
|
||||
}
|
||||
|
||||
void CStdWindow::FlashWindow()
|
||||
void C4Window::FlashWindow()
|
||||
{
|
||||
// This tries to implement flashing via
|
||||
// _NET_WM_STATE_DEMANDS_ATTENTION, but it simply does not work for me.
|
||||
|
@ -551,7 +551,7 @@ void CStdWindow::FlashWindow()
|
|||
}
|
||||
}
|
||||
|
||||
void CStdWindow::HandleMessage(XEvent& event)
|
||||
void C4Window::HandleMessage(XEvent& event)
|
||||
{
|
||||
if (event.type == FocusIn)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue