2001-09-15 22:13:08 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gtk/toplevel.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
2004-05-23 20:53:33 +00:00
|
|
|
// Licence: wxWindows licence
|
2001-09-15 22:13:08 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-09-07 16:06:47 +00:00
|
|
|
#ifndef _WX_GTK_TOPLEVEL_H_
|
|
|
|
#define _WX_GTK_TOPLEVEL_H_
|
2001-09-15 22:13:08 +00:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxTopLevelWindowGTK
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 22:58:06 +00:00
|
|
|
class WXDLLIMPEXP_CORE wxTopLevelWindowGTK : public wxTopLevelWindowBase
|
2001-09-15 22:13:08 +00:00
|
|
|
{
|
2010-03-23 17:19:02 +00:00
|
|
|
typedef wxTopLevelWindowBase base_type;
|
2001-09-15 22:13:08 +00:00
|
|
|
public:
|
|
|
|
// construction
|
|
|
|
wxTopLevelWindowGTK() { Init(); }
|
|
|
|
wxTopLevelWindowGTK(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr)
|
|
|
|
{
|
|
|
|
Init();
|
|
|
|
|
|
|
|
Create(parent, id, title, pos, size, style, name);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Create(wxWindow *parent,
|
|
|
|
wxWindowID id,
|
|
|
|
const wxString& title,
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE,
|
|
|
|
const wxString& name = wxFrameNameStr);
|
|
|
|
|
|
|
|
virtual ~wxTopLevelWindowGTK();
|
|
|
|
|
|
|
|
// implement base class pure virtuals
|
2005-11-04 11:11:22 +00:00
|
|
|
virtual void Maximize(bool maximize = true);
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual bool IsMaximized() const;
|
2005-11-04 11:11:22 +00:00
|
|
|
virtual void Iconize(bool iconize = true);
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual bool IsIconized() const;
|
2002-03-26 21:54:23 +00:00
|
|
|
virtual void SetIcons(const wxIconBundle& icons);
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual void Restore();
|
|
|
|
|
2006-10-27 08:18:26 +00:00
|
|
|
virtual bool EnableCloseButton(bool enable = true);
|
|
|
|
|
2009-10-30 05:04:47 +00:00
|
|
|
virtual void ShowWithoutActivating();
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
2011-12-29 14:42:13 +00:00
|
|
|
virtual bool IsFullScreen() const { return m_fsIsShowing; }
|
2001-09-15 22:13:08 +00:00
|
|
|
|
2005-07-28 23:32:42 +00:00
|
|
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
|
|
|
|
2005-11-07 20:00:50 +00:00
|
|
|
virtual void SetWindowStyleFlag( long style );
|
|
|
|
|
2005-11-04 11:11:22 +00:00
|
|
|
virtual bool Show(bool show = true);
|
2001-09-15 22:13:08 +00:00
|
|
|
|
2005-02-11 23:00:31 +00:00
|
|
|
virtual void Raise();
|
|
|
|
|
2004-09-26 14:32:09 +00:00
|
|
|
virtual bool IsActive();
|
2004-09-26 14:17:23 +00:00
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual void SetTitle( const wxString &title );
|
|
|
|
virtual wxString GetTitle() const { return m_title; }
|
|
|
|
|
2010-08-21 09:53:25 +00:00
|
|
|
virtual void SetLabel(const wxString& label) { SetTitle( label ); }
|
|
|
|
virtual wxString GetLabel() const { return GetTitle(); }
|
|
|
|
|
|
|
|
|
2006-07-19 17:18:12 +00:00
|
|
|
virtual bool SetTransparent(wxByte alpha);
|
|
|
|
virtual bool CanSetTransparent();
|
|
|
|
|
2002-06-18 21:46:42 +00:00
|
|
|
// Experimental, to allow help windows to be
|
|
|
|
// viewable from within modal dialogs
|
|
|
|
virtual void AddGrab();
|
|
|
|
virtual void RemoveGrab();
|
|
|
|
virtual bool IsGrabbed() const { return m_grabbed; }
|
|
|
|
|
2009-03-06 23:30:54 +00:00
|
|
|
|
|
|
|
virtual void Refresh( bool eraseBackground = true,
|
|
|
|
const wxRect *rect = (const wxRect *) NULL );
|
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
|
|
|
// GTK callbacks
|
|
|
|
virtual void OnInternalIdle();
|
|
|
|
|
2011-10-12 16:22:14 +00:00
|
|
|
virtual void GTKHandleRealized();
|
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
// do *not* call this to iconize the frame, this is a private function!
|
|
|
|
void SetIconizeState(bool iconic);
|
|
|
|
|
|
|
|
GtkWidget *m_mainWidget;
|
|
|
|
|
|
|
|
bool m_fsIsShowing; /* full screen */
|
2007-09-13 04:36:06 +00:00
|
|
|
int m_fsSaveGdkFunc, m_fsSaveGdkDecor;
|
2001-09-15 22:13:08 +00:00
|
|
|
wxRect m_fsSaveFrame;
|
2002-04-20 13:53:11 +00:00
|
|
|
|
|
|
|
// m_windowStyle translated to GDK's terms
|
2007-09-13 04:36:06 +00:00
|
|
|
int m_gdkFunc,
|
2002-04-20 13:53:11 +00:00
|
|
|
m_gdkDecor;
|
2001-09-15 22:13:08 +00:00
|
|
|
|
2007-11-22 17:07:27 +00:00
|
|
|
// size of WM decorations
|
|
|
|
wxSize m_decorSize;
|
|
|
|
|
2005-09-21 07:04:58 +00:00
|
|
|
// private gtk_timeout_add result for mimicing wxUSER_ATTENTION_INFO and
|
|
|
|
// wxUSER_ATTENTION_ERROR difference, -2 for no hint, -1 for ERROR hint, rest for GtkTimeout handle.
|
|
|
|
int m_urgency_hint;
|
2011-04-15 18:31:57 +00:00
|
|
|
// timer for detecting WM with broken _NET_REQUEST_FRAME_EXTENTS handling
|
|
|
|
unsigned m_netFrameExtentsTimerId;
|
2005-09-21 07:04:58 +00:00
|
|
|
|
2007-09-13 04:36:06 +00:00
|
|
|
// return the size of the window without WM decorations
|
2007-02-15 12:38:55 +00:00
|
|
|
void GTKDoGetSize(int *width, int *height) const;
|
|
|
|
|
2008-02-26 06:14:32 +00:00
|
|
|
void GTKUpdateDecorSize(const wxSize& decorSize);
|
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
protected:
|
2007-11-22 06:12:56 +00:00
|
|
|
// give hints to the Window Manager for how the size
|
|
|
|
// of the TLW can be changed by dragging
|
|
|
|
virtual void DoSetSizeHints( int minW, int minH,
|
|
|
|
int maxW, int maxH,
|
|
|
|
int incW, int incH);
|
2001-09-15 22:13:08 +00:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2007-05-19 17:34:42 +00:00
|
|
|
// move the window to the specified location and resize it
|
2006-02-08 21:47:09 +00:00
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
|
|
|
2007-02-10 23:44:52 +00:00
|
|
|
// take into account WM decorations here
|
2001-09-15 22:13:08 +00:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
2007-02-10 23:44:52 +00:00
|
|
|
|
2008-01-13 02:00:27 +00:00
|
|
|
virtual void DoSetClientSize(int width, int height);
|
2007-02-10 23:44:52 +00:00
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
|
|
|
|
// string shown in the title bar
|
|
|
|
wxString m_title;
|
2005-11-04 11:11:22 +00:00
|
|
|
|
2008-12-24 07:51:15 +00:00
|
|
|
bool m_deferShow;
|
|
|
|
|
2007-10-24 18:07:24 +00:00
|
|
|
private:
|
2008-04-23 17:05:47 +00:00
|
|
|
wxSize& GetCachedDecorSize();
|
|
|
|
|
2001-09-15 22:13:08 +00:00
|
|
|
// is the frame currently iconized?
|
|
|
|
bool m_isIconized;
|
2007-02-10 23:44:52 +00:00
|
|
|
|
|
|
|
// is the frame currently grabbed explicitly by the application?
|
2002-06-18 21:46:42 +00:00
|
|
|
bool m_grabbed;
|
2008-12-24 07:51:15 +00:00
|
|
|
|
|
|
|
bool m_updateDecorSize;
|
2009-02-17 03:32:40 +00:00
|
|
|
bool m_deferShowAllowed;
|
2001-09-15 22:13:08 +00:00
|
|
|
};
|
|
|
|
|
2006-09-07 16:06:47 +00:00
|
|
|
#endif // _WX_GTK_TOPLEVEL_H_
|