diff options
author | Philipp Lohmann <pl@openoffice.org> | 2001-08-08 18:09:04 +0000 |
---|---|---|
committer | Philipp Lohmann <pl@openoffice.org> | 2001-08-08 18:09:04 +0000 |
commit | f7876d2e575e48680af5ab8ab33674b72690e53a (patch) | |
tree | 4bb592fea9573e8108f64350b6ccc39307adc9fd /vcl/unx/inc | |
parent | 2bd557c8cd4a9c00c0586865a4adf08fdd566f00 (diff) |
#88754# #88114# brushed up WM communication
Diffstat (limited to 'vcl/unx/inc')
-rw-r--r-- | vcl/unx/inc/saldisp.hxx | 52 | ||||
-rw-r--r-- | vcl/unx/inc/salframe.h | 16 | ||||
-rw-r--r-- | vcl/unx/inc/wmadaptor.hxx | 190 |
3 files changed, 210 insertions, 48 deletions
diff --git a/vcl/unx/inc/saldisp.hxx b/vcl/unx/inc/saldisp.hxx index 21579f5148f8..8a48bee14cb4 100644 --- a/vcl/unx/inc/saldisp.hxx +++ b/vcl/unx/inc/saldisp.hxx @@ -2,9 +2,9 @@ * * $RCSfile: saldisp.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: pl $ $Date: 2001-07-26 15:45:26 $ + * last change: $Author: pl $ $Date: 2001-08-08 19:09:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -65,7 +65,6 @@ // -=-= exports =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= struct SalAppXResource; class SalDisplay; -class SalICCCM; class SalColormap; class SalColormapRef; class SalTrueColorConverter; @@ -95,6 +94,8 @@ class SalFrameData; class ColorMask; class SalSystemData; +namespace vcl_sal { class WMAdaptor; } + #ifndef _XSHM_H_ struct XShmSegmentInfo; #endif @@ -163,46 +164,6 @@ enum SalWM { olwm, // Open Look pmwm, // SCO otherwm }; -// -=-= SalICCCM =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- -class SalICCCM -{ - STDAPI( SalICCCM ) - -public: - Atom aWM_Protocols_; // Window manager - Atom aWM_State_; - Atom aWM_DeleteWindow_; - Atom aWM_SaveYourself_; - Atom aWM_Command_; - - Atom aQuitEvent_; // client message events - Atom aUserEvent_; - #if !defined(__synchronous_extinput__) - Atom aExtTextEvent_; - #endif - - inline int IsQuitEvent( Atom a ) const - { return aQuitEvent_ == a; } - inline int IsUserEvent( Atom a ) const - { return aUserEvent_ == a; } - #if !defined(__synchronous_extinput__) - inline int IsExtTextEvent( Atom a ) const - { return aExtTextEvent_ == a; } - #endif - inline int IsWM_State( Atom a ) const - { return aWM_State_ == a; } - inline int IsWM_DeleteWindow( Atom a ) const - { return aWM_DeleteWindow_ == a; } - inline int IsWM_Protocols( Atom a ) const - { return aWM_Protocols_ == a; } - inline int IsWM_SaveYourself( Atom a ) const - { return aWM_SaveYourself_ == a; } - inline int IsWM_Command( Atom a ) const - { return aWM_Command_ == a; } - - SalICCCM( SalDisplay *pDisplay ); -}; - // -=-= SalRGB -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= // MSB/Bigendian Sicht (SalColor == RGB, r=0xFF0000, g=0xFF00, b=0xFF) @@ -367,7 +328,6 @@ class SalDisplay SalSystemData *mpSalSystemData; // the one to get create and destroy notify events - SalICCCM *pICCCM_; // Atoms Display *pDisp_; // X Display Screen *pScreen_; // XDefaultScreenOfDisplay int nScreen_; // XDefaultScreen @@ -429,6 +389,8 @@ class SalDisplay SalImageList SharedImages_; + ::vcl_sal::WMAdaptor* m_pWMAdaptor; + void DestroyFontCache(); long Dispatch( XEvent *pEvent ); @@ -509,7 +471,6 @@ public: inline void SetServerVendor() { meServerVendor = sal_GetServerVendor(pDisp_); } inline BOOL IsDisplay() const { return !!pXLib_; } - inline SalICCCM &GetICCCM() const { return *pICCCM_; } inline GC GetMonoGC() const { return pMonoGC_; } inline GC GetCopyGC() const { return pCopyGC_; } inline GC GetAndInvertedGC() const { return pAndInvertedGC_; } @@ -540,6 +501,7 @@ public: inline void SetKbdExtension(SalI18N_KeyboardExtension *pKbdExtension) { mpKbdExtension = pKbdExtension; } const char* GetKeyboardName( BOOL bRefresh = FALSE ); + ::vcl_sal::WMAdaptor* getWMAdaptor() const { return m_pWMAdaptor; } }; // -=-= inlines =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= diff --git a/vcl/unx/inc/salframe.h b/vcl/unx/inc/salframe.h index 5bc78e9e5779..3bad98b19484 100644 --- a/vcl/unx/inc/salframe.h +++ b/vcl/unx/inc/salframe.h @@ -2,9 +2,9 @@ * * $RCSfile: salframe.h,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: cp $ $Date: 2001-07-12 09:11:28 $ + * last change: $Author: pl $ $Date: 2001-08-08 19:09:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,6 +96,7 @@ class SalGraphics; class SalFrame; class SalColormap; class SalI18N_InputContext; +namespace vcl_sal { class WMAdaptor; } class SalFrameDelData { @@ -119,6 +120,7 @@ DECLARE_LIST( SalFrameList, SalFrame *); class SalFrameData { friend class SalFrame; + friend class ::vcl_sal::WMAdaptor; friend SalFrame* SalInstance::CreateFrame( SalFrame*, ULONG ); friend SalFrame* SalInstance::CreateChildFrame( SystemParentData*, ULONG ); @@ -179,6 +181,15 @@ class SalFrameData Rectangle maResizeBuffer; Rectangle maPaintRegion; + // data for WMAdaptor + int meWindowType; + int mnDecorationFlags; + bool mbMaximizedVert; + bool mbMaximizedHorz; + + // icon id + int mnIconID; + SystemChildData maSystemChildData; SalI18N_InputContext *mpInputContext; @@ -196,7 +207,6 @@ class SalFrameData void Minimize(); void Maximize(); void Restore(); - void ShowFullScreen( BOOL bFullScreen ); void RepositionFloatChildren(); void RepositionChildren(); diff --git a/vcl/unx/inc/wmadaptor.hxx b/vcl/unx/inc/wmadaptor.hxx new file mode 100644 index 000000000000..0e86b789de8b --- /dev/null +++ b/vcl/unx/inc/wmadaptor.hxx @@ -0,0 +1,190 @@ +/************************************************************************* + * + * $RCSfile: wmadaptor.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: pl $ $Date: 2001-08-08 19:09:03 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2001 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _VCL_WMADAPTOR_HXX_ +#define _VCL_WMADAPTOR_HXX_ + +#ifndef _TL_STRING_HXX +#include <tools/string.hxx> +#endif +#ifndef _SV_GEN_HXX +#include <tools/gen.hxx> +#endif +#ifndef _PREX_H +#include <prex.h> +#include <X11/Xlib.h> +#include <postx.h> +#endif +#include <vector> + +class SalDisplay; +class SalFrame; + +namespace vcl_sal { + +class WMAdaptor +{ +public: + enum WMAtom { + UTF8_STRING, + NET_SUPPORTED, + NET_SUPPORTING_WM_CHECK, + NET_WM_NAME, + NET_WM_ICON_NAME, + NET_WM_STATE, + NET_WM_STATE_MAXIMIZED_HORZ, + NET_WM_STATE_MAXIMIZED_VERT, + NET_WM_STATE_MODAL, + NET_WM_STATE_SHADED, + NET_WM_STATE_SKIP_PAGER, + NET_WM_STATE_SKIP_TASKBAR, + NET_WM_STATE_STAYS_ON_TOP, + NET_WM_STATE_STICKY, + NET_WM_WINDOW_TYPE, + NET_WM_WINDOW_TYPE_DESKTOP, + NET_WM_WINDOW_TYPE_DIALOG, + NET_WM_WINDOW_TYPE_DOCK, + NET_WM_WINDOW_TYPE_MENU, + NET_WM_WINDOW_TYPE_NORMAL, + NET_WM_WINDOW_TYPE_TOOLBAR, + NET_NUMBER_OF_DESKTOPS, + NET_WORKAREA, + WM_STATE, + MOTIF_WM_HINTS, + WM_PROTOCOLS, + WM_DELETE_WINDOW, + WM_SAVE_YOURSELF, + WM_COMMAND, + SAL_QUITEVENT, + SAL_USEREVENT, + SAL_EXTTEXTEVENT, + NetAtomMax + }; + + /* + * flags for frame decoration + */ + static const int decoration_Title = 0x00000001; + static const int decoration_Border = 0x00000002; + static const int decoration_Resize = 0x00000004; + static const int decoration_MinimizeBtn = 0x00000008; + static const int decoration_MaximizeBtn = 0x00000010; + static const int decoration_CloseBtn = 0x00000020; + static const int decoration_All = 0x10000000; + + /* + * window type + */ + enum WMWindowType + { + windowType_Normal, + windowType_ModalDialogue, + windowType_ModelessDialogue, + windowType_OverrideRedirect + }; + +private: + SalDisplay* m_pSalDisplay; // Display to use + Display* m_pDisplay; // X Display of SalDisplay + bool m_bNetWM; // true: _NET supporting WM is available + String m_aWMName; + Atom m_aWMAtoms[ NetAtomMax]; + int m_nDesktops; + bool m_bEqualWorkAreas; + ::std::vector< Rectangle > + m_aWMWorkAreas; + + void setNetWMState( SalFrame* pFrame ) const; +public: + WMAdaptor( SalDisplay * ); + ~WMAdaptor(); + + + /* + * sets WM_NAME and _NET_WM_NAME + */ + void setWMName( SalFrame* pFrame, const String& rWMName ) const; + + /* + * maximizes frame, if _NET is present and _NET_WM_STATE supported, + * then this is done via request to WM + * maximization can be toggled in either direction + * to get the original position and size + * use maximizeFrame( pFrame, false, false ) + */ + void maximizeFrame( SalFrame* pFrame, bool bHorizontal = true, bool bVertical = true ) const; + + /* + * set hints what decoration is needed; + * must be called before showing the frame + */ + void setFrameTypeAndDecoration( SalFrame* pFrame, WMWindowType eType, int nDecorationFlags, SalFrame* pTransientFrame = NULL ) const; + + /* + * gets a WM atom + */ + Atom getAtom( WMAtom eAtom ) const + { return m_aWMAtoms[ eAtom ]; } +}; + +} // namespace + +#endif |