1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: gtkinst.hxx,v $
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_GTKINST_HXX
32 #define _VCL_GTKINST_HXX
37 class GtkYieldMutex
: public SalYieldMutex
41 virtual void acquire();
42 virtual void release();
43 virtual sal_Bool
tryToAcquire();
46 virtual void Ungrab( int );
50 GtkYieldMutex
* m_pMutex
;
53 GtkYieldGuard( GtkYieldMutex
* pMutex
)
56 m_nGrab
= m_pMutex
->Grab();
60 m_pMutex
->Ungrab( m_nGrab
);
65 class GtkHookedYieldMutex
: public GtkYieldMutex
67 virtual int Grab() { return 0; };
68 virtual void Ungrab(int ) {};
69 std::list
<ULONG
> aYieldStack
;
71 GtkHookedYieldMutex();
72 virtual void acquire();
73 virtual void release();
74 virtual sal_Bool
tryToAcquire() { return SalYieldMutex::tryToAcquire(); }
80 #define GTK_YIELD_GRAB() GtkYieldMutex::GtkYieldGuard aLocalGtkYieldGuard( static_cast<GtkYieldMutex*>(GetSalData()->m_pInstance->GetYieldMutex()) )
82 class GtkInstance
: public X11SalInstance
85 GtkInstance( SalYieldMutex
* pMutex
)
86 : X11SalInstance( pMutex
)
88 virtual ~GtkInstance();
90 virtual SalFrame
* CreateFrame( SalFrame
* pParent
, ULONG nStyle
);
91 virtual SalFrame
* CreateChildFrame( SystemParentData
* pParent
, ULONG nStyle
);
92 virtual SalObject
* CreateObject( SalFrame
* pParent
, SystemWindowData
* pWindowData
, BOOL bShow
= TRUE
);
93 virtual SalSystem
* CreateSalSystem();
94 virtual void AddToRecentDocumentList(const rtl::OUString
& rFileUrl
, const rtl::OUString
& rMimeType
);
97 class GtkSalSystem
: public X11SalSystem
100 GtkSalSystem() : X11SalSystem() {}
101 virtual ~GtkSalSystem();
102 virtual int ShowNativeDialog( const String
& rTitle
,
103 const String
& rMessage
,
104 const std::list
< String
>& rButtons
,
108 #endif // _VCL_GTKINST_HXX