1*161f4cd1SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*161f4cd1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*161f4cd1SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*161f4cd1SAndrew Rist * distributed with this work for additional information 6*161f4cd1SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*161f4cd1SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*161f4cd1SAndrew Rist * "License"); you may not use this file except in compliance 9*161f4cd1SAndrew Rist * with the License. You may obtain a copy of the License at 10*161f4cd1SAndrew Rist * 11*161f4cd1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*161f4cd1SAndrew Rist * 13*161f4cd1SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*161f4cd1SAndrew Rist * software distributed under the License is distributed on an 15*161f4cd1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*161f4cd1SAndrew Rist * KIND, either express or implied. See the License for the 17*161f4cd1SAndrew Rist * specific language governing permissions and limitations 18*161f4cd1SAndrew Rist * under the License. 19*161f4cd1SAndrew Rist * 20*161f4cd1SAndrew Rist *************************************************************/ 21*161f4cd1SAndrew Rist 22*161f4cd1SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef _VCL_GTKDATA_HXX 25cdf0e10cSrcweir #define _VCL_GTKDATA_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <tools/prex.h> 28cdf0e10cSrcweir #include <gdk/gdk.h> 29cdf0e10cSrcweir #include <gdk/gdkx.h> 30cdf0e10cSrcweir #include <gtk/gtk.h> 31cdf0e10cSrcweir #include <tools/postx.h> 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <unx/saldisp.hxx> 34cdf0e10cSrcweir #include <unx/saldata.hxx> 35cdf0e10cSrcweir #include <vcl/ptrstyle.hxx> 36cdf0e10cSrcweir 37cdf0e10cSrcweir #include <list> 38cdf0e10cSrcweir 39cdf0e10cSrcweir class GtkData : public X11SalData 40cdf0e10cSrcweir { 41cdf0e10cSrcweir public: GtkData()42cdf0e10cSrcweir GtkData() {} 43cdf0e10cSrcweir virtual ~GtkData(); 44cdf0e10cSrcweir 45cdf0e10cSrcweir virtual void Init(); 46cdf0e10cSrcweir 47cdf0e10cSrcweir virtual void initNWF(); 48cdf0e10cSrcweir virtual void deInitNWF(); 49cdf0e10cSrcweir }; 50cdf0e10cSrcweir 51cdf0e10cSrcweir class GtkSalFrame; 52cdf0e10cSrcweir 53cdf0e10cSrcweir class GtkSalDisplay : public SalDisplay 54cdf0e10cSrcweir { 55cdf0e10cSrcweir GdkDisplay* m_pGdkDisplay; 56cdf0e10cSrcweir GdkCursor *m_aCursors[ POINTER_COUNT ]; 57cdf0e10cSrcweir bool m_bStartupCompleted; 58cdf0e10cSrcweir std::vector< int > m_aXineramaScreenIndexMap; 59cdf0e10cSrcweir 60cdf0e10cSrcweir GdkCursor* getFromXPM( const char *pBitmap, const char *pMask, 61cdf0e10cSrcweir int nWidth, int nHeight, int nXHot, int nYHot ); 62cdf0e10cSrcweir public: 63cdf0e10cSrcweir GtkSalDisplay( GdkDisplay* pDisplay ); 64cdf0e10cSrcweir virtual ~GtkSalDisplay(); 65cdf0e10cSrcweir GetGdkDisplay() const66cdf0e10cSrcweir GdkDisplay* GetGdkDisplay() const { return m_pGdkDisplay; } 67cdf0e10cSrcweir 68cdf0e10cSrcweir virtual void deregisterFrame( SalFrame* pFrame ); 69cdf0e10cSrcweir GdkCursor *getCursor( PointerStyle ePointerStyle ); 70cdf0e10cSrcweir virtual int CaptureMouse( SalFrame* pFrame ); 71cdf0e10cSrcweir virtual long Dispatch( XEvent *pEvent ); 72cdf0e10cSrcweir virtual void initScreen( int nScreen ) const; 73cdf0e10cSrcweir 74cdf0e10cSrcweir virtual int GetDefaultMonitorNumber() const; 75cdf0e10cSrcweir 76cdf0e10cSrcweir static GdkFilterReturn filterGdkEvent( GdkXEvent* sys_event, 77cdf0e10cSrcweir GdkEvent* event, 78cdf0e10cSrcweir gpointer data ); HasMoreEvents()79cdf0e10cSrcweir inline bool HasMoreEvents() { return m_aUserEvents.size() > 1; } EventGuardAcquire()80cdf0e10cSrcweir inline void EventGuardAcquire() { osl_acquireMutex( hEventGuard_ ); } EventGuardRelease()81cdf0e10cSrcweir inline void EventGuardRelease() { osl_releaseMutex( hEventGuard_ ); } startupNotificationCompleted()82cdf0e10cSrcweir void startupNotificationCompleted() { m_bStartupCompleted = true; } 83cdf0e10cSrcweir 84cdf0e10cSrcweir void screenSizeChanged( GdkScreen* ); 85cdf0e10cSrcweir void monitorsChanged( GdkScreen* ); 86cdf0e10cSrcweir }; 87cdf0e10cSrcweir 88cdf0e10cSrcweir 89cdf0e10cSrcweir #endif // _VCL_GTKDATA_HXX 90