2001-09-15 18:13:08 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: wx/gtk/toplevel.h
|
|
|
|
// Purpose:
|
|
|
|
// Author: Robert Roebling
|
|
|
|
// Id: $Id$
|
|
|
|
// Copyright: (c) 1998 Robert Roebling, Julian Smart
|
2004-05-23 16:53:33 -04:00
|
|
|
// Licence: wxWindows licence
|
2001-09-15 18:13:08 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-09-07 12:06:47 -04:00
|
|
|
#ifndef _WX_GTK_TOPLEVEL_H_
|
|
|
|
#define _WX_GTK_TOPLEVEL_H_
|
2001-09-15 18:13:08 -04:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// wxTopLevelWindowGTK
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
|
2005-08-02 18:58:06 -04:00
|
|
|
class WXDLLIMPEXP_CORE wxTopLevelWindowGTK : public wxTopLevelWindowBase
|
2001-09-15 18:13:08 -04: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 06:11:22 -05:00
|
|
|
virtual void Maximize(bool maximize = true);
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual bool IsMaximized() const;
|
2005-11-04 06:11:22 -05:00
|
|
|
virtual void Iconize(bool iconize = true);
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual bool IsIconized() const;
|
2002-03-26 16:54:23 -05:00
|
|
|
virtual void SetIcons(const wxIconBundle& icons);
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual void Restore();
|
|
|
|
|
2006-10-27 04:18:26 -04:00
|
|
|
virtual bool EnableCloseButton(bool enable = true);
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
|
|
|
|
virtual bool IsFullScreen() const { return m_fsIsShowing; };
|
|
|
|
|
2003-03-28 18:05:05 -05:00
|
|
|
virtual bool SetShape(const wxRegion& region);
|
|
|
|
|
2005-07-28 19:32:42 -04:00
|
|
|
virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO);
|
|
|
|
|
2005-11-07 15:00:50 -05:00
|
|
|
virtual void SetWindowStyleFlag( long style );
|
|
|
|
|
2005-11-04 06:11:22 -05:00
|
|
|
virtual bool Show(bool show = true);
|
2001-09-15 18:13:08 -04:00
|
|
|
|
2005-02-11 18:00:31 -05:00
|
|
|
virtual void Raise();
|
|
|
|
|
2004-09-26 10:32:09 -04:00
|
|
|
virtual bool IsActive();
|
2004-09-26 10:17:23 -04:00
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual void SetTitle( const wxString &title );
|
|
|
|
virtual wxString GetTitle() const { return m_title; }
|
|
|
|
|
2006-07-19 13:18:12 -04:00
|
|
|
virtual bool SetTransparent(wxByte alpha);
|
|
|
|
virtual bool CanSetTransparent();
|
|
|
|
|
2002-06-18 17:46:42 -04: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 18:30:54 -05:00
|
|
|
|
|
|
|
virtual void Refresh( bool eraseBackground = true,
|
|
|
|
const wxRect *rect = (const wxRect *) NULL );
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
// implementation from now on
|
|
|
|
// --------------------------
|
|
|
|
|
|
|
|
// GTK callbacks
|
|
|
|
virtual void OnInternalIdle();
|
|
|
|
|
|
|
|
// 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 00:36:06 -04:00
|
|
|
int m_fsSaveGdkFunc, m_fsSaveGdkDecor;
|
2001-09-15 18:13:08 -04:00
|
|
|
wxRect m_fsSaveFrame;
|
2002-04-20 09:53:11 -04:00
|
|
|
|
|
|
|
// m_windowStyle translated to GDK's terms
|
2007-09-13 00:36:06 -04:00
|
|
|
int m_gdkFunc,
|
2002-04-20 09:53:11 -04:00
|
|
|
m_gdkDecor;
|
2001-09-15 18:13:08 -04:00
|
|
|
|
2007-11-22 12:07:27 -05:00
|
|
|
// size of WM decorations
|
|
|
|
wxSize m_decorSize;
|
|
|
|
|
2008-04-06 12:14:49 -04:00
|
|
|
// shape of the frame
|
|
|
|
wxRegion m_shape;
|
|
|
|
|
2005-09-21 03:04:58 -04: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;
|
|
|
|
|
2007-09-13 00:36:06 -04:00
|
|
|
// return the size of the window without WM decorations
|
2007-02-15 07:38:55 -05:00
|
|
|
void GTKDoGetSize(int *width, int *height) const;
|
|
|
|
|
2008-02-26 01:14:32 -05:00
|
|
|
void GTKUpdateDecorSize(const wxSize& decorSize);
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
protected:
|
2007-11-22 01:12:56 -05: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 18:13:08 -04:00
|
|
|
// common part of all ctors
|
|
|
|
void Init();
|
|
|
|
|
2007-05-19 13:34:42 -04:00
|
|
|
// move the window to the specified location and resize it
|
2006-02-08 16:47:09 -05:00
|
|
|
virtual void DoMoveWindow(int x, int y, int width, int height);
|
|
|
|
|
2007-02-10 18:44:52 -05:00
|
|
|
// take into account WM decorations here
|
2001-09-15 18:13:08 -04:00
|
|
|
virtual void DoSetSize(int x, int y,
|
|
|
|
int width, int height,
|
|
|
|
int sizeFlags = wxSIZE_AUTO);
|
2007-02-10 18:44:52 -05:00
|
|
|
|
2008-01-12 21:00:27 -05:00
|
|
|
virtual void DoSetClientSize(int width, int height);
|
2007-02-10 18:44:52 -05:00
|
|
|
virtual void DoGetClientSize(int *width, int *height) const;
|
|
|
|
|
|
|
|
// string shown in the title bar
|
|
|
|
wxString m_title;
|
2005-11-04 06:11:22 -05:00
|
|
|
|
2008-12-24 02:51:15 -05:00
|
|
|
bool m_deferShow;
|
|
|
|
|
2007-10-24 14:07:24 -04:00
|
|
|
private:
|
2008-04-23 13:05:47 -04:00
|
|
|
wxSize& GetCachedDecorSize();
|
|
|
|
|
2001-09-15 18:13:08 -04:00
|
|
|
// is the frame currently iconized?
|
|
|
|
bool m_isIconized;
|
2007-02-10 18:44:52 -05:00
|
|
|
|
|
|
|
// is the frame currently grabbed explicitly by the application?
|
2002-06-18 17:46:42 -04:00
|
|
|
bool m_grabbed;
|
2008-12-24 02:51:15 -05:00
|
|
|
|
|
|
|
bool m_updateDecorSize;
|
2009-02-16 22:32:40 -05:00
|
|
|
bool m_deferShowAllowed;
|
2001-09-15 18:13:08 -04:00
|
|
|
};
|
|
|
|
|
2006-09-07 12:06:47 -04:00
|
|
|
#endif // _WX_GTK_TOPLEVEL_H_
|