2002-07-19 20:42:34 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2003-03-02 14:16:29 +00:00
|
|
|
// Name: wx/display.h
|
2002-07-19 20:42:34 +00:00
|
|
|
// Purpose: wxDisplay class
|
|
|
|
// Author: Royce Mitchell III
|
2003-03-02 14:16:29 +00:00
|
|
|
// Modified by: Vadim Zeitlin (resolution changes, display modes, ...)
|
2002-07-19 20:42:34 +00:00
|
|
|
// Created: 06/21/02
|
|
|
|
// RCS-ID: $Id$
|
2004-05-23 14:56:36 +00:00
|
|
|
// Copyright: (c) 2002-2003 wxWidgets team
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2002-07-19 20:42:34 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DISPLAY_H_BASE_
|
|
|
|
#define _WX_DISPLAY_H_BASE_
|
|
|
|
|
2004-03-19 08:53:09 +00:00
|
|
|
#if wxUSE_DISPLAY
|
2002-07-19 20:42:34 +00:00
|
|
|
|
2003-08-09 12:38:21 +00:00
|
|
|
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
|
2003-03-02 14:16:29 +00:00
|
|
|
#pragma interface "displaybase.h"
|
2002-07-19 20:42:34 +00:00
|
|
|
#endif
|
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
#include "wx/dynarray.h"
|
2003-09-27 12:55:46 +00:00
|
|
|
#include "wx/vidmode.h"
|
2003-03-02 14:16:29 +00:00
|
|
|
|
2003-04-29 22:39:02 +00:00
|
|
|
class WXDLLEXPORT wxWindow;
|
2003-09-27 12:36:30 +00:00
|
|
|
class WXDLLEXPORT wxPoint;
|
|
|
|
class WXDLLEXPORT wxRect;
|
2004-09-10 12:56:07 +00:00
|
|
|
class WXDLLEXPORT wxString;
|
2003-04-29 22:39:02 +00:00
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
WX_DECLARE_EXPORTED_OBJARRAY(wxVideoMode, wxArrayVideoModes);
|
|
|
|
|
|
|
|
// default, uninitialized, video mode object
|
|
|
|
WXDLLEXPORT_DATA(extern const wxVideoMode) wxDefaultVideoMode;
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDisplayBase: represents a display/monitor attached to the system
|
|
|
|
// ----------------------------------------------------------------------------
|
2002-07-19 20:42:34 +00:00
|
|
|
|
|
|
|
class WXDLLEXPORT wxDisplayBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// initialize the object containing all information about the given
|
|
|
|
// display
|
2003-03-02 14:16:29 +00:00
|
|
|
//
|
|
|
|
// the displays are numbered from 0 to GetCount() - 1, 0 is always the
|
|
|
|
// primary display and the only one which is always supported
|
|
|
|
wxDisplayBase(size_t index = 0);
|
2002-07-19 20:42:34 +00:00
|
|
|
|
|
|
|
// return the number of available displays, valid parameters to
|
|
|
|
// wxDisplay ctor are from 0 up to this number
|
|
|
|
static size_t GetCount();
|
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
// find the display where the given point lies, return wxNOT_FOUND if
|
2002-07-19 20:42:34 +00:00
|
|
|
// it doesn't belong to any display
|
2003-03-02 14:16:29 +00:00
|
|
|
static int GetFromPoint(const wxPoint& pt);
|
|
|
|
|
|
|
|
// find the display where the given window lies, return wxNOT_FOUND if it
|
|
|
|
// is not shown at all
|
|
|
|
static int GetFromWindow(wxWindow *window);
|
2002-07-19 20:42:34 +00:00
|
|
|
|
|
|
|
|
2003-04-07 00:30:18 +00:00
|
|
|
// return true if the object was initialized successfully
|
|
|
|
virtual bool IsOk() const { return true; }
|
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
// get the display size
|
|
|
|
virtual wxRect GetGeometry() const = 0;
|
2002-07-19 20:42:34 +00:00
|
|
|
|
|
|
|
// name may be empty
|
|
|
|
virtual wxString GetName() const = 0;
|
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
// display 0 is always the primary display
|
|
|
|
bool IsPrimary() const { return m_index == 0; }
|
|
|
|
|
2002-07-19 20:42:34 +00:00
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
// enumerate all video modes supported by this display matching the given
|
|
|
|
// one (in the sense of wxVideoMode::Match())
|
|
|
|
//
|
|
|
|
// as any mode matches the default value of the argument and there is
|
|
|
|
// always at least one video mode supported by display, the returned array
|
|
|
|
// is only empty for the default value of the argument if this function is
|
|
|
|
// not supported at all on this platform
|
|
|
|
virtual wxArrayVideoModes
|
|
|
|
GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const = 0;
|
2002-07-19 20:42:34 +00:00
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
// get current video mode
|
|
|
|
virtual wxVideoMode GetCurrentMode() const = 0;
|
|
|
|
|
|
|
|
// change current mode, return true if succeeded, false otherwise
|
|
|
|
//
|
|
|
|
// for the default value of the argument restores the video mode to default
|
|
|
|
virtual bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode) = 0;
|
|
|
|
|
|
|
|
// restore the default video mode (just a more readable synonym)
|
|
|
|
void ResetMode() { (void)ChangeMode(); }
|
|
|
|
|
|
|
|
// virtual dtor as for any base class
|
|
|
|
virtual ~wxDisplayBase() { }
|
2002-07-19 20:42:34 +00:00
|
|
|
|
|
|
|
protected:
|
2003-03-02 14:16:29 +00:00
|
|
|
// the index of this display (0 is always the primary one)
|
|
|
|
size_t m_index;
|
2002-07-19 20:42:34 +00:00
|
|
|
|
2003-07-06 21:33:35 +00:00
|
|
|
DECLARE_NO_COPY_CLASS(wxDisplayBase)
|
2002-07-19 20:42:34 +00:00
|
|
|
};
|
|
|
|
|
2003-03-02 14:16:29 +00:00
|
|
|
|
2002-07-19 20:42:34 +00:00
|
|
|
#if defined(__WXMSW__)
|
|
|
|
#include "wx/msw/display.h"
|
|
|
|
#elif defined(__WXMOTIF__)
|
2003-08-03 20:12:57 +00:00
|
|
|
#include "wx/unix/displayx11.h"
|
2002-07-19 20:42:34 +00:00
|
|
|
#elif defined(__WXGTK__)
|
2003-06-01 16:03:24 +00:00
|
|
|
#include "wx/unix/displayx11.h"
|
2004-05-08 19:56:40 +00:00
|
|
|
#elif defined(__WXX11__)
|
|
|
|
#include "wx/unix/displayx11.h"
|
2004-10-08 00:40:19 +00:00
|
|
|
#elif defined(__WXCOCOA__)
|
|
|
|
#include "wx/cocoa/display.h"
|
2002-07-19 20:42:34 +00:00
|
|
|
#elif defined(__WXMAC__)
|
|
|
|
#include "wx/mac/display.h"
|
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/display.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // wxUSE_DISPLAY
|
|
|
|
|
|
|
|
#endif // _WX_DISPLAY_H_BASE_
|