Fork for IVI: mesa fixing
[profile/ivi/uifw.git] / src / graphics / FGrp_FontUtil.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /*
19  * @file        FGrp_FontUtil.h
20  * @brief       This is the header file for _FontUtil class.
21  *
22  */
23
24 #ifndef _FGRP_INTERNAL_FONT_UTIL_H_
25 #define _FGRP_INTERNAL_FONT_UTIL_H_
26
27
28 #include <FGrpFont.h>
29
30 #include "FGrp_FontImpl.h"
31
32
33 namespace Tizen { namespace Graphics
34 {
35
36 class _FontImplHack
37         : public _FontImpl
38 {
39 public:
40         _Font* GetFontEx(void) const
41         {
42                 return (this && this->_pNativeFont) ? this->_pNativeFont : 0;
43         }
44 };
45
46 inline _Font*
47 GetFontEx(const Tizen::Graphics::_FontImpl& font)
48 {
49         const _FontImplHack* pFontImplHack = static_cast <const _FontImplHack*>(&font);
50         return (pFontImplHack) ? pFontImplHack->GetFontEx() : null;
51 }
52
53 inline _Font*
54 GetFontEx(const Tizen::Graphics::Font& font)
55 {
56         const _FontImpl* pFontImpl = _FontImpl::GetInstance(font);
57         return (pFontImpl) ? GetFontEx(*pFontImpl) : null;
58 }
59
60 }} // Tizen::Graphics
61
62 #endif // _FGRP_INTERNAL_FONT_UTIL_H_