summaryrefslogtreecommitdiff
path: root/vcl/unx/inc
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2004-02-20 07:57:22 +0000
committerOliver Bolte <obo@openoffice.org>2004-02-20 07:57:22 +0000
commitcffc6fd03e3569d3d0996263932435d2e2bb1be9 (patch)
tree1d705f884f9377a782e6062f122cae84909aa937 /vcl/unx/inc
parent50b3cc532cf15cf2230b21050a525e6cea89938a (diff)
INTEGRATION: CWS vcl17 (1.1.2); FILE ADDED
2004/02/12 12:36:35 pl 1.1.2.20: #i25164# default size for frame, icons enabled again 2004/01/21 13:20:40 pl 1.1.2.19: added geometry, fixed some minor issues 2004/01/19 18:55:30 pl 1.1.2.18: add foundations for GtkSalObject 2004/01/19 15:44:48 pl 1.1.2.17: add: input method handling 2003/12/19 16:50:33 mmeeks 1.1.2.16: Revert PL's change, fixing linking Impl. StartPresentation. 2003/12/19 14:24:50 mmeeks 1.1.2.15: bin toolbar size bits fix key modifiers for CTL thing. 2003/12/18 19:04:43 pl 1.1.2.14: mouse enter/leave 2003/12/18 18:36:42 pl 1.1.2.13: wheel events 2003/12/18 17:19:48 pl 1.1.2.12: added default positioning for frames 2003/12/18 15:12:35 mmeeks 1.1.2.11: Fix grab issues, Fix display opening Misc. bits. 2003/12/18 13:09:59 mmeeks 1.1.2.10: cleanup cursors fix grab problems. 2003/12/18 11:44:17 mmeeks 1.1.2.9: Fix keyboard modifiers ... 2003/12/17 19:58:18 mmeeks 1.1.2.8: bin scattered GetDefDisp badness implement icon setting 2003/12/17 13:13:19 mmeeks 1.1.2.7: Cursor bits .. Flush/Sync Don't return TRUE from ConfigureEvent (eg.) SetPointerPos Use widget's mapped state not separate boolean 2003/12/16 17:53:29 pl 1.1.2.6: first shot at Get/SetWindowState 2003/12/16 15:13:40 pl 1.1.2.5: fix non rersizable dialogs 2003/12/16 14:45:31 pl 1.1.2.4: added style settings to gtk plugin 2003/12/15 18:12:08 pl 1.1.2.3: first cut at key events 2003/12/12 17:09:14 pl 1.1.2.2: motion events for frames 2003/12/12 14:56:02 pl 1.1.2.1: adding gtk frame: first steps
Diffstat (limited to 'vcl/unx/inc')
-rw-r--r--vcl/unx/inc/plugins/gtk/gtkframe.hxx241
1 files changed, 241 insertions, 0 deletions
diff --git a/vcl/unx/inc/plugins/gtk/gtkframe.hxx b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
new file mode 100644
index 000000000000..51049cc84fe9
--- /dev/null
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: gtkframe.hxx,v $
+ *
+ * $Revision: 1.2 $
+ *
+ * last change: $Author: obo $ $Date: 2004-02-20 08:57:22 $
+ *
+ * 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: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _VCL_GTKFRAME_HXX
+#define _VCL_GTKFRAME_HXX
+
+#include <prex.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+#include <gdk/gdkkeysyms.h>
+#include <postx.h>
+
+#ifndef _SV_SALFRAME_HXX
+#include <salframe.hxx>
+#endif
+#ifndef _SV_SYSDATA_HXX
+#include <sysdata.hxx>
+#endif
+
+class X11SalGraphics;
+class GtkSalDisplay;
+
+class GtkSalFrame : public SalFrame
+{
+ static const int nMaxGraphics = 2;
+
+ struct GraphicsHolder
+ {
+ X11SalGraphics* pGraphics;
+ bool bInUse;
+ GraphicsHolder()
+ : pGraphics( NULL ),
+ bInUse( false )
+ {}
+ ~GraphicsHolder();
+ };
+
+ GtkWindow* m_pWindow;
+ ULONG m_nStyle;
+ GtkFixed* m_pFixedContainer;
+ GtkSalFrame* m_pParent;
+ GdkWindowState m_nState;
+ GtkIMContext* m_pIMContext;
+ SystemEnvData m_aSystemData;
+ GraphicsHolder m_aGraphics[ nMaxGraphics ];
+ USHORT m_nKeyModifiers;
+ GdkCursor *m_pCurrentCursor;
+ int m_nSavedScreenSaverTimeout;
+ bool m_bResizeable;
+ bool m_bSingleAltPress;
+ bool m_bDefaultPos;
+ bool m_bDefaultSize;
+ bool m_bSendModChangeOnRelease;
+
+ void Init( SalFrame* pParent, ULONG nStyle );
+ void Init( SystemParentData* pSysData );
+ void InitCommon();
+
+ // signals
+ static gboolean signalButton( GtkWidget*, GdkEventButton*, gpointer );
+ static void signalStyleSet( GtkWidget*, GtkStyle* pPrevious, gpointer );
+ static gboolean signalExpose( GtkWidget*, GdkEventExpose*, gpointer );
+ static gboolean signalFocus( GtkWidget*, GdkEventFocus*, gpointer );
+ static gboolean signalMap( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalUnmap( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalConfigure( GtkWidget*, GdkEventConfigure*, gpointer );
+ static gboolean signalMotion( GtkWidget*, GdkEventMotion*, gpointer );
+ static gboolean signalKey( GtkWidget*, GdkEventKey*, gpointer );
+ static gboolean signalDelete( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalState( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalScroll( GtkWidget*, GdkEvent*, gpointer );
+ static gboolean signalCrossing( GtkWidget*, GdkEventCrossing*, gpointer );
+ static void signalIMCommit( GtkIMContext*, gchar*, gpointer );
+ static gboolean signalIMDeleteSurrounding( GtkIMContext*, gint, gint, gpointer );
+ static void signalIMPreeditChanged( GtkIMContext*, gpointer );
+ static void signalIMPreeditEnd( GtkIMContext*, gpointer );
+ static void signalIMPreeditStart( GtkIMContext*, gpointer );
+ static gboolean signalIMRetrieveSurrounding( GtkIMContext*, gpointer );
+
+
+ GtkSalDisplay* getDisplay();
+ GdkDisplay* getGdkDisplay();
+ void Center();
+ void SetDefaultSize();
+ void setAutoLock( bool bLock );
+ void setScreenSaverTimeout( int nTimeout );
+
+public:
+ GtkSalFrame( SalFrame* pParent, ULONG nStyle );
+ GtkSalFrame( SystemParentData* pSysData );
+
+ // dispatches an event, returns true if dispatched
+ // and false else; if true was returned the event should
+ // be swallowed
+ bool Dispatch( const XEvent* pEvent );
+ void grabPointer( BOOL bGrab );
+
+ GtkWindow* getWindow() const { return m_pWindow; }
+ GtkFixed* getFixedContainer() const { return m_pFixedContainer; }
+
+ virtual ~GtkSalFrame();
+
+ // SalGraphics or NULL, but two Graphics for all SalFrames
+ // must be returned
+ virtual SalGraphics* GetGraphics();
+ virtual void ReleaseGraphics( SalGraphics* pGraphics );
+
+ // Event must be destroyed, when Frame is destroyed
+ // When Event is called, SalInstance::Yield() must be returned
+ virtual BOOL PostEvent( void* pData );
+
+ virtual void SetTitle( const XubString& rTitle );
+ virtual void SetIcon( USHORT nIcon );
+ virtual void SetMenu( SalMenu *pSalMenu );
+ virtual void DrawMenuBar();
+
+ // Before the window is visible, a resize event
+ // must be sent with the correct size
+ virtual void Show( BOOL bVisible, BOOL bNoActivate = FALSE );
+ virtual void Enable( BOOL bEnable );
+ // Set ClientSize and Center the Window to the desktop
+ // and send/post a resize message
+ virtual void SetMinClientSize( long nWidth, long nHeight );
+ virtual void SetPosSize( long nX, long nY, long nWidth, long nHeight, USHORT nFlags );
+ virtual void GetClientSize( long& rWidth, long& rHeight );
+ virtual void GetWorkArea( Rectangle& rRect );
+ virtual SalFrame* GetParent() const;
+ virtual void SetWindowState( const SalFrameState* pState );
+ virtual BOOL GetWindowState( SalFrameState* pState );
+ virtual void ShowFullScreen( BOOL bFullScreen );
+ // Enable/Disable ScreenSaver, SystemAgents, ...
+ virtual void StartPresentation( BOOL bStart );
+ // Show Window over all other Windows
+ virtual void SetAlwaysOnTop( BOOL bOnTop );
+
+ // Window to top and grab focus
+ virtual void ToTop( USHORT nFlags );
+
+ // this function can call with the same
+ // pointer style
+ virtual void SetPointer( PointerStyle ePointerStyle );
+ virtual void CaptureMouse( BOOL bMouse );
+ virtual void SetPointerPos( long nX, long nY );
+
+ // flush output buffer
+ virtual void Flush();
+ // flush output buffer, wait till outstanding operations are done
+ virtual void Sync();
+
+ virtual void SetInputContext( SalInputContext* pContext );
+ virtual void EndExtTextInput( USHORT nFlags );
+
+ virtual String GetKeyName( USHORT nKeyCode );
+ virtual String GetSymbolKeyName( const XubString& rFontName, USHORT nKeyCode );
+
+ // returns the input language used for the last key stroke
+ // may be LANGUAGE_DONTKNOW if not supported by the OS
+ virtual LanguageType GetInputLanguage();
+
+ virtual SalBitmap* SnapShot();
+
+ virtual void UpdateSettings( AllSettings& rSettings );
+
+ virtual void Beep( SoundType eSoundType );
+
+ // returns system data (most prominent: window handle)
+ virtual const SystemEnvData* GetSystemData() const;
+
+
+ // get current modifier and button mask
+ virtual ULONG GetCurrentModButtons();
+
+ // set new parent window
+ virtual void SetParent( SalFrame* pNewParent );
+ // reparent window to act as a plugin; implementation
+ // may choose to use a new system window internally
+ // return false to indicate failure
+ virtual bool SetPluginParent( SystemParentData* pNewParent );
+
+};
+
+
+#endif //_VCL_GTKFRAME_HXX