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