Update ooo320-m1
[ooovba.git] / vcl / unx / inc / plugins / gtk / gtkdata.hxx
blob651b75937ff72fed4b3e1f3cda8239a983e976e8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gtkdata.hxx,v $
10 * $Revision: 1.11 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _VCL_GTKDATA_HXX
32 #define _VCL_GTKDATA_HXX
34 #include <tools/prex.h>
35 #include <gdk/gdk.h>
36 #include <gdk/gdkx.h>
37 #include <gtk/gtk.h>
38 #include <tools/postx.h>
40 #include <saldisp.hxx>
41 #include <saldata.hxx>
42 #include <vcl/ptrstyle.hxx>
44 #include <list>
46 class GtkData : public X11SalData
48 public:
49 GtkData() {}
50 virtual ~GtkData();
52 virtual void Init();
54 virtual void initNWF();
55 virtual void deInitNWF();
58 class GtkSalFrame;
60 class GtkSalDisplay : public SalDisplay
62 GdkDisplay* m_pGdkDisplay;
63 GdkCursor *m_aCursors[ POINTER_COUNT ];
64 bool m_bStartupCompleted;
65 GdkCursor* getFromXPM( const char *pBitmap, const char *pMask,
66 int nWidth, int nHeight, int nXHot, int nYHot );
67 public:
68 GtkSalDisplay( GdkDisplay* pDisplay );
69 virtual ~GtkSalDisplay();
71 GdkDisplay* GetGdkDisplay() const { return m_pGdkDisplay; }
73 virtual void deregisterFrame( SalFrame* pFrame );
74 GdkCursor *getCursor( PointerStyle ePointerStyle );
75 virtual int CaptureMouse( SalFrame* pFrame );
76 virtual long Dispatch( XEvent *pEvent );
77 virtual void initScreen( int nScreen ) const;
79 static GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event,
80 GdkEvent* event,
81 gpointer data );
82 inline bool HasMoreEvents() { return m_aUserEvents.size() > 1; }
83 inline void EventGuardAcquire() { osl_acquireMutex( hEventGuard_ ); }
84 inline void EventGuardRelease() { osl_releaseMutex( hEventGuard_ ); }
85 void startupNotificationCompleted() { m_bStartupCompleted = true; }
87 void screenSizeChanged( GdkScreen* );
88 void monitorsChanged( GdkScreen* );
92 #endif // _VCL_GTKDATA_HXX