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