finalcut/src/fwindow.h

121 lines
3.8 KiB
C
Raw Normal View History

// File: fwindow.h
// Provides: class FWindow.h
//
// Inheritance diagram
// ═══════════════════
//
// ▕▔▔▔▔▔▔▔▔▔▏ ▕▔▔▔▔▔▔▔▔▔▏
// ▕ FObject ▏ ▕ FTerm ▏
// ▕▁▁▁▁▁▁▁▁▁▏ ▕▁▁▁▁▁▁▁▁▁▏
// ▲ ▲
// │ │
// └─────┬─────┘
// │
// ▕▔▔▔▔▔▔▔▔▔▏
// ▕ FWidget ▏
// ▕▁▁▁▁▁▁▁▁▁▏
// ▲
// │
// ▕▔▔▔▔▔▔▔▔▔▏ 1 *▕▔▔▔▔▔▔▔▔▏
// ▕ FWindow ▏-┬- - - -▕ FEvent ▏
// ▕▁▁▁▁▁▁▁▁▁▏ : ▕▁▁▁▁▁▁▁▁▏
// :
// : *▕▔▔▔▔▔▔▔▔▏
// :- - - -▕ FPoint ▏
// : ▕▁▁▁▁▁▁▁▁▏
// :
// : *▕▔▔▔▔▔▔▔▔▔▏
// └- - - -▕ FWidget ▏
// ▕▁▁▁▁▁▁▁▁▁▏
2015-05-23 13:35:12 +02:00
#ifndef _FWINDOW_H
#define _FWINDOW_H
#include "fwidget.h"
//----------------------------------------------------------------------
// class FWindow
//----------------------------------------------------------------------
#pragma pack(push)
#pragma pack(1)
class FWindow : public FWidget
{
private:
bool window_active;
private:
FWindow (const FWindow&);
FWindow& operator = (const FWindow&);
protected:
bool event (FEvent*);
virtual void onWindowActive (FEvent*);
virtual void onWindowInactive (FEvent*);
virtual void onWindowRaised (FEvent*);
virtual void onWindowLowered (FEvent*);
public:
2015-09-27 16:45:28 +02:00
explicit FWindow (FWidget* = 0); // constructor
2015-05-23 13:35:12 +02:00
~FWindow (); // destructor
const char* getClassName() const;
virtual void show();
virtual void hide();
2015-05-23 13:35:12 +02:00
static FWindow* windowWidgetAt (const FPoint&);
static FWindow* windowWidgetAt (int, int);
static void addWindow (FWidget*);
static void delWindow (FWidget*);
static FWindow* getWindowWidget (FWidget*);
static int getWindowLayer (FWidget*);
static void swapWindow (FWidget*, FWidget*);
static bool raiseWindow (FWidget*);
bool raiseWindow ();
static bool lowerWindow (FWidget*);
bool lowerWindow ();
static void setActiveWindow (FWindow*);
static FWindow* getActiveWindow();
static bool activatePrevWindow();
bool activateWindow(bool);
bool activateWindow();
bool deactivateWindow();
bool isActiveWindow() const;
};
#pragma pack(pop)
// FWindow inline functions
//----------------------------------------------------------------------
inline const char* FWindow::getClassName() const
{ return "FWindow"; }
2015-10-17 19:40:43 +02:00
//----------------------------------------------------------------------
inline FWindow* FWindow::windowWidgetAt (const FPoint& pos)
{ return windowWidgetAt(pos.getX(), pos.getY()); }
2015-05-23 13:35:12 +02:00
//----------------------------------------------------------------------
inline bool FWindow::raiseWindow()
{ return raiseWindow(this); }
//----------------------------------------------------------------------
inline bool FWindow::lowerWindow()
{ return lowerWindow(this); }
//----------------------------------------------------------------------
inline bool FWindow::activateWindow()
{ return activateWindow(true); }
//----------------------------------------------------------------------
inline bool FWindow::deactivateWindow()
{ return activateWindow(false); }
//----------------------------------------------------------------------
inline bool FWindow::isActiveWindow() const
{ return window_active; }
#endif // _FWINDOW_H