📄 qwindowsystem_qws.h
字号:
/****************************************************************************** $Id: qt/src/kernel/qwindowsystem_qws.h 2.3.6 edited 2003-05-16 $**** Definition of Qt/FB central server classes**** Created : 991025**** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.**** This file is part of the kernel module of the Qt GUI Toolkit.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses for Qt/Embedded may use this file in accordance with the** Qt Embedded Commercial License Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for** information about Qt Commercial License Agreements.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#ifndef QTFB_H#define QTFB_H#ifndef QT_H#include <qwssocket_qws.h>#include <qmap.h>#include <qdatetime.h>#include <qlist.h>#include <qimage.h>#include <qintdict.h>#include "qwsproperty_qws.h"#include "qwscommand_qws.h"#include "qwsevent_qws.h"#include "qkeyboard_qws.h"#endif // QT_Hstruct SWCursorData;class QWSCursor;class QWSClient;class QWSRegionManager;class QGfx;class QWSServerData;class QWSInternalWindowInfo{public: int winid; unsigned int clientid; QString name; // Corresponds to QObject name of top-level widget};struct QWSWindowData;class QWSScreenSaver{public: virtual ~QWSScreenSaver(); virtual void restore()=0; virtual bool save(int level)=0;};class QWSWindow{ friend class QWSServer;public: QWSWindow(int i, QWSClient* client); ~QWSWindow(); int winId() const { return id; } const QString &name() const { return rgnName; } const QString &caption() const { return rgnCaption; } QWSClient* client() const { return c; } QRegion requested() const { return requested_region; } QRegion allocation() const { return allocated_region; } bool isVisible() const { return !requested_region.isEmpty(); } bool isPartiallyObscured() const { return requested_region!=allocated_region; } bool isFullyObscured() const { return allocated_region.isEmpty(); } void raise(); void lower(); void show(); void hide(); void setActiveWindow();private: bool hidden() const { return requested_region.isEmpty(); } bool forClient(const QWSClient* cl) const { return cl==c; } void setName( const QString &n ); void setCaption( const QString &c ); void addAllocation( QWSRegionManager *, const QRegion & ); void removeAllocation( QWSRegionManager *, const QRegion & ); int allocationIndex() const { return alloc_region_idx; } void setAllocationIndex( int i ) { alloc_region_idx = i; modified = TRUE; } void updateAllocation(); void setNeedAck( bool n ) { needAck = n; } void focus(bool get); int focusPriority() const { return last_focus_time; } void operation( QWSWindowOperationEvent::Operation o ); void shuttingDown() { last_focus_time=0; }private: int id; QString rgnName; QString rgnCaption; int alloc_region_idx; bool modified; bool needAck; bool onTop; QWSClient* c; QRegion requested_region; QRegion allocated_region; QRegion exposed; int last_focus_time; QWSWindowData *d;};#ifndef QT_NO_SOUNDclass QWSSoundServer;#ifdef QT_USE_OLD_QWS_SOUNDclass QWSSoundServer : public QObject { Q_OBJECTpublic: QWSSoundServer(QObject* parent); ~QWSSoundServer(); void playFile(const QString& filename);private slots: void feedDevice(int fd);private: QWSSoundServerData* d;};#endif#endif/********************************************************************* * * Class: QWSServer * *********************************************************************/class QWSMouseHandler;struct QWSCommandStruct;#ifndef QT_NO_QWS_MULTIPROCESSclass QWSServer : public QWSServerSocket#elseclass QWSServer : public QObject#endif{ friend class QCopChannel; friend class QWSMouseHandler; friend class QWSWindow; friend class QWSDisplay; friend class QWSInputMethod; Q_OBJECTpublic: QWSServer( int flags = 0, QObject *parent=0, const char *name=0 ); ~QWSServer(); enum ServerFlags { DisableKeyboard = 0x01, DisableMouse = 0x02 }; enum GUIMode { NoGui = FALSE, NormalGUI = TRUE, Server }; static void sendKeyEvent(int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat); static void processKeyEvent(int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat);#ifndef QT_NO_QWS_IM enum IMState { Reserved, IMCompose, IMEnd, IMInternal = 42, IMMarkedText }; enum IMMouse { MousePress, MouseRelease, MouseMove }; //MouseMove reserved but not used void sendIMEvent( IMState state, const QString& txt, int cpos, int selLen );#endif#ifndef QT_NO_QWS_KEYBOARD typedef struct KeyMap { int key_code; ushort unicode; ushort shift_unicode; ushort ctrl_unicode; }; static const KeyMap *keyMap();#if !defined(QT_EZX_INPUT) static void setOverrideKeys( QIntDict<QWSServer::KeyMap> *map );#endif class KeyboardFilter { public: virtual bool filter(int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat)=0; }; static void setKeyboardFilter( KeyboardFilter *f );#endif #ifndef QT_NO_QWS_IM static void setCurrentInputMethod( QWSInputMethod *im ); static void resetInputMethod(); static void setMicroFocus( int x, int y ); static void requestMarkedText();#endif static void setDefaultMouse( const char * ); static void setDefaultKeyboard( const char * ); static void setMaxWindowRect(const QRect&); static void sendMouseEvent(const QPoint& pos, int state); static void setDesktopBackground( const QImage &img ); static void setDesktopBackground( const QColor & ); static QWSMouseHandler *mouseHandler(); static void setMouseHandler(QWSMouseHandler*);#ifndef QT_NO_QWS_KEYBOARD static QWSKeyboardHandler* keyboardHandler(); static void setKeyboardHandler(QWSKeyboardHandler* kh);#endif QWSWindow *windowAt( const QPoint& pos ); const QList<QWSWindow> &clientWindows() { return windows; } void openMouse(); void closeMouse();#ifndef QT_NO_QWS_KEYBOARD void openKeyboard(); void closeKeyboard();#endif static void setScreenSaver(QWSScreenSaver*); static void setScreenSaverIntervals(int* ms); static void setScreenSaverInterval(int); static bool screenSaverActive(); static void screenSaverActivate(bool); // the following are internal. void refresh(); void enablePainting(bool); static void processEventQueue(); static QList<QWSInternalWindowInfo> * windowList(); void sendPropertyNotifyEvent( int property, int state );#ifndef QT_NO_QWS_PROPERTIES QWSPropertyManager *manager() { return &propertyManager; }#endif static QPoint mousePosition; static void startup( int flags ); static void closedown(); static void beginDisplayReconfigure(); static void endDisplayReconfigure();#ifndef QT_NO_QWS_CURSOR static void setCursorVisible( bool ); static bool isCursorVisible();#endif enum WindowEvent { Create=0x01, Destroy=0x02, Hide=0x04, Show=0x08, Raise=0x10, Lower=0x20, Geometry=0x40, Active=0x80 };signals: void windowEvent( QWSWindow *w, QWSServer::WindowEvent e );#ifndef QT_NO_COP void newChannel( const QString& channel); void removedChannel(const QString& channel);#endif#ifndef QT_NO_QWS_IM void markedText( const QString & );
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -