LibreOffice Module vcl (master)  1
common.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_VCL_INC_QUARTZ_COMMON_H
21 #define INCLUDED_VCL_INC_QUARTZ_COMMON_H
22 
23 #include <iostream>
24 
25 #include <premac.h>
26 #ifdef MACOSX
27 #include <ApplicationServices/ApplicationServices.h>
28 #else
29 #include <CoreGraphics/CoreGraphics.h>
30 #include <CoreText/CoreText.h>
31 #endif
32 #include <postmac.h>
33 
34 #include <sal/types.h>
35 
36 // CoreFoundation designers, in their wisdom, decided that CFRelease of NULL
37 // cause a Crash, yet few API can return NULL when asking for the creation
38 // of an object, which force us to paper the code with ugly if construct everywhere
39 // and open the door to very nasty crash on rare occasion
40 // this macro hide the mess
41 #define SafeCFRelease(a) do { if(a) { CFRelease(a); (a)=NULL; } } while(false)
42 
43 #define round_to_long(a) ((a) >= 0 ? ((long)((a) + 0.5)) : ((long)((a) - 0.5)))
44 
45 #include <vcl/salgtype.hxx>
46 
47 std::ostream &operator <<(std::ostream& s, CTFontRef pFont);
48 
49 #endif // INCLUDED_VCL_INC_QUARTZ_COMMON_H
50 
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::ostream & operator<<(std::ostream &s, CTFontRef pFont)