2006-03-15 23:23:07 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/display_impl.h
|
|
|
|
// Purpose: wxDisplayImpl class declaration
|
|
|
|
// Author: Vadim Zeitlin
|
|
|
|
// Created: 2006-03-15
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) 2002-2006 Vadim Zeitlin <vadim@wxwindows.org>
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#ifndef _WX_DISPLAY_IMPL_H_BASE_
|
|
|
|
#define _WX_DISPLAY_IMPL_H_BASE_
|
|
|
|
|
2006-03-16 19:15:04 -05:00
|
|
|
#include "wx/gdicmn.h" // for wxRect
|
|
|
|
|
2006-03-15 23:23:07 -05:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDisplayFactory: allows to create wxDisplay objects
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxDisplayFactory
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxDisplayFactory() { }
|
|
|
|
virtual ~wxDisplayFactory() { }
|
|
|
|
|
|
|
|
// create a new display object
|
|
|
|
//
|
|
|
|
// it can return a NULL pointer if the display creation failed
|
2006-10-02 01:38:05 -04:00
|
|
|
virtual wxDisplayImpl *CreateDisplay(unsigned n) = 0;
|
2006-03-15 23:23:07 -05:00
|
|
|
|
|
|
|
// get the total number of displays
|
2006-10-02 01:38:05 -04:00
|
|
|
virtual unsigned GetCount() = 0;
|
2006-03-15 23:23:07 -05:00
|
|
|
|
|
|
|
// return the display for the given point or wxNOT_FOUND
|
|
|
|
virtual int GetFromPoint(const wxPoint& pt) = 0;
|
|
|
|
|
|
|
|
// return the display for the given window or wxNOT_FOUND
|
|
|
|
//
|
|
|
|
// the window pointer must not be NULL (i.e. caller should check it)
|
2007-02-10 19:13:22 -05:00
|
|
|
virtual int GetFromWindow(const wxWindow *window);
|
2006-03-15 23:23:07 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDisplayImpl: base class for all wxDisplay implementations
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxDisplayImpl
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
// virtual dtor for this base class
|
|
|
|
virtual ~wxDisplayImpl() { }
|
|
|
|
|
|
|
|
|
|
|
|
// return the full area of this display
|
|
|
|
virtual wxRect GetGeometry() const = 0;
|
|
|
|
|
2006-03-16 11:07:24 -05:00
|
|
|
// return the area of the display available for normal windows
|
|
|
|
virtual wxRect GetClientArea() const { return GetGeometry(); }
|
|
|
|
|
2006-03-15 23:23:07 -05:00
|
|
|
// return the name (may be empty)
|
|
|
|
virtual wxString GetName() const = 0;
|
|
|
|
|
|
|
|
// return the index of this display
|
2006-10-02 01:38:05 -04:00
|
|
|
unsigned GetIndex() const { return m_index; }
|
2006-03-15 23:23:07 -05:00
|
|
|
|
|
|
|
// return true if this is the primary monitor (usually one with index 0)
|
|
|
|
virtual bool IsPrimary() const { return GetIndex() == 0; }
|
|
|
|
|
|
|
|
|
|
|
|
#if wxUSE_DISPLAY
|
|
|
|
// implements wxDisplay::GetModes()
|
|
|
|
virtual wxArrayVideoModes GetModes(const wxVideoMode& mode) const = 0;
|
|
|
|
|
|
|
|
// get current video mode
|
|
|
|
virtual wxVideoMode GetCurrentMode() const = 0;
|
|
|
|
|
|
|
|
// change current mode, return true if succeeded, false otherwise
|
|
|
|
virtual bool ChangeMode(const wxVideoMode& mode) = 0;
|
|
|
|
#endif // wxUSE_DISPLAY
|
|
|
|
|
|
|
|
protected:
|
|
|
|
// create the object providing access to the display with the given index
|
2006-10-02 01:38:05 -04:00
|
|
|
wxDisplayImpl(unsigned n) : m_index(n) { }
|
2006-03-15 23:23:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
// the index of this display (0 is always the primary one)
|
2006-10-02 01:38:05 -04:00
|
|
|
const unsigned m_index;
|
2006-03-15 23:23:07 -05:00
|
|
|
|
|
|
|
|
|
|
|
friend class wxDisplayFactory;
|
|
|
|
|
|
|
|
DECLARE_NO_COPY_CLASS(wxDisplayImpl)
|
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxDisplayFactorySingle
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// this is a stub implementation using single/main display only, it is
|
|
|
|
// available even if wxUSE_DISPLAY == 0
|
|
|
|
class WXDLLEXPORT wxDisplayFactorySingle : public wxDisplayFactory
|
|
|
|
{
|
|
|
|
public:
|
2006-10-02 01:38:05 -04:00
|
|
|
virtual wxDisplayImpl *CreateDisplay(unsigned n);
|
|
|
|
virtual unsigned GetCount() { return 1; }
|
2006-03-15 23:23:07 -05:00
|
|
|
virtual int GetFromPoint(const wxPoint& pt);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _WX_DISPLAY_IMPL_H_BASE_
|
|
|
|
|