1*24f6443dSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*24f6443dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*24f6443dSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*24f6443dSAndrew Rist * distributed with this work for additional information 6*24f6443dSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*24f6443dSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*24f6443dSAndrew Rist * "License"); you may not use this file except in compliance 9*24f6443dSAndrew Rist * with the License. You may obtain a copy of the License at 10*24f6443dSAndrew Rist * 11*24f6443dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*24f6443dSAndrew Rist * 13*24f6443dSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*24f6443dSAndrew Rist * software distributed under the License is distributed on an 15*24f6443dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*24f6443dSAndrew Rist * KIND, either express or implied. See the License for the 17*24f6443dSAndrew Rist * specific language governing permissions and limitations 18*24f6443dSAndrew Rist * under the License. 19*24f6443dSAndrew Rist * 20*24f6443dSAndrew Rist *************************************************************/ 21*24f6443dSAndrew Rist 22*24f6443dSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // -=-= includes -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 25cdf0e10cSrcweir #ifndef _SV_SALINST_H 26cdf0e10cSrcweir #define _SV_SALINST_H 27cdf0e10cSrcweir 28cdf0e10cSrcweir #include <vcl/sv.h> 29cdf0e10cSrcweir #ifndef _VOS_MUTEX_HXX 30cdf0e10cSrcweir #include <vos/mutex.hxx> 31cdf0e10cSrcweir #endif 32cdf0e10cSrcweir #ifndef _VOS_THREAD_HXX 33cdf0e10cSrcweir #include <vos/thread.hxx> 34cdf0e10cSrcweir #endif 35cdf0e10cSrcweir #include <vclpluginapi.h> 36cdf0e10cSrcweir #include <salinst.hxx> 37cdf0e10cSrcweir 38cdf0e10cSrcweir class VCLPLUG_GEN_PUBLIC SalYieldMutex : public vos::OMutex 39cdf0e10cSrcweir { 40cdf0e10cSrcweir protected: 41cdf0e10cSrcweir sal_uIntPtr mnCount; 42cdf0e10cSrcweir vos::OThread::TThreadIdentifier mnThreadId; 43cdf0e10cSrcweir 44cdf0e10cSrcweir public: 45cdf0e10cSrcweir SalYieldMutex(); 46cdf0e10cSrcweir 47cdf0e10cSrcweir virtual void acquire(); 48cdf0e10cSrcweir virtual void release(); 49cdf0e10cSrcweir virtual sal_Bool tryToAcquire(); 50cdf0e10cSrcweir GetAcquireCount() const51cdf0e10cSrcweir sal_uIntPtr GetAcquireCount() const { return mnCount; } GetThreadId() const52cdf0e10cSrcweir vos::OThread::TThreadIdentifier GetThreadId() const { return mnThreadId; } 53cdf0e10cSrcweir }; 54cdf0e10cSrcweir 55cdf0e10cSrcweir // -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= 56cdf0e10cSrcweir class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalInstance 57cdf0e10cSrcweir { 58cdf0e10cSrcweir protected: 59cdf0e10cSrcweir SalYieldMutex* mpSalYieldMutex; 60cdf0e10cSrcweir bool mbPrinterInit; 61cdf0e10cSrcweir 62cdf0e10cSrcweir public: X11SalInstance(SalYieldMutex * pMutex)63cdf0e10cSrcweir X11SalInstance( SalYieldMutex* pMutex ) 64cdf0e10cSrcweir : mpSalYieldMutex( pMutex ), 65cdf0e10cSrcweir mbPrinterInit( false ) 66cdf0e10cSrcweir {} 67cdf0e10cSrcweir virtual ~X11SalInstance(); 68cdf0e10cSrcweir 69cdf0e10cSrcweir virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle ); 70cdf0e10cSrcweir virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle ); 71cdf0e10cSrcweir virtual void DestroyFrame( SalFrame* pFrame ); 72cdf0e10cSrcweir 73cdf0e10cSrcweir virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True ); 74cdf0e10cSrcweir virtual void DestroyObject( SalObject* pObject ); 75cdf0e10cSrcweir 76cdf0e10cSrcweir virtual SalVirtualDevice* CreateVirtualDevice( SalGraphics* pGraphics, 77cdf0e10cSrcweir long nDX, long nDY, 78cdf0e10cSrcweir sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL ); 79cdf0e10cSrcweir virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice ); 80cdf0e10cSrcweir 81cdf0e10cSrcweir virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, 82cdf0e10cSrcweir ImplJobSetup* pSetupData ); 83cdf0e10cSrcweir virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter ); 84cdf0e10cSrcweir virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter ); 85cdf0e10cSrcweir virtual void DestroyPrinter( SalPrinter* pPrinter ); 86cdf0e10cSrcweir 87cdf0e10cSrcweir virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList ); 88cdf0e10cSrcweir virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo ); 89cdf0e10cSrcweir virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ); 90cdf0e10cSrcweir virtual String GetDefaultPrinter(); 91cdf0e10cSrcweir 92cdf0e10cSrcweir virtual SalTimer* CreateSalTimer(); 93cdf0e10cSrcweir virtual SalI18NImeStatus* CreateI18NImeStatus(); 94cdf0e10cSrcweir virtual SalSystem* CreateSalSystem(); 95cdf0e10cSrcweir virtual SalBitmap* CreateSalBitmap(); 96cdf0e10cSrcweir virtual SalSession* CreateSalSession(); 97cdf0e10cSrcweir 98cdf0e10cSrcweir virtual vos::IMutex* GetYieldMutex(); 99cdf0e10cSrcweir virtual sal_uIntPtr ReleaseYieldMutex(); 100cdf0e10cSrcweir virtual void AcquireYieldMutex( sal_uIntPtr nCount ); 101cdf0e10cSrcweir virtual bool CheckYieldMutex(); 102cdf0e10cSrcweir 103cdf0e10cSrcweir virtual void Yield( bool bWait, bool bHandleAllCurrentEvents ); 104cdf0e10cSrcweir virtual bool AnyInput( sal_uInt16 nType ); 105cdf0e10cSrcweir 106cdf0e10cSrcweir virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes ); 107cdf0e10cSrcweir void FillFontPathList( std::list< rtl::OString >& o_rFontPaths ); 108cdf0e10cSrcweir 109cdf0e10cSrcweir // dtrans implementation 110cdf0e10cSrcweir virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > 111cdf0e10cSrcweir CreateClipboard( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& i_rArguments ); 112cdf0e10cSrcweir virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource(); 113cdf0e10cSrcweir virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget(); 114cdf0e10cSrcweir virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType); 115cdf0e10cSrcweir 116cdf0e10cSrcweir isPrinterInit() const117cdf0e10cSrcweir bool isPrinterInit() const 118cdf0e10cSrcweir { 119cdf0e10cSrcweir return mbPrinterInit; 120cdf0e10cSrcweir } 121cdf0e10cSrcweir }; 122cdf0e10cSrcweir 123cdf0e10cSrcweir #endif // _SV_SALINST_H 124cdf0e10cSrcweir 125