diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2013-04-15 20:30:56 -0400 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-04-16 11:35:24 +0200 |
commit | 3bd4c28a4ddfe7b2928f5f6adb025b09b25f1887 (patch) | |
tree | 7712cf4688b982a5bfd019b8642ecaee2e8a808d /src/macextras/qmacfunctions_ios.mm | |
parent | dbbe46bf04399c6f4943a5c622c470b6d55809e6 (diff) |
Add a method for getting the current CGContext on both Darwin OSes.
Change-Id: I391f7ecaee0b57e5bb61bca1d0c966675af115e4
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Diffstat (limited to 'src/macextras/qmacfunctions_ios.mm')
-rw-r--r-- | src/macextras/qmacfunctions_ios.mm | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/macextras/qmacfunctions_ios.mm b/src/macextras/qmacfunctions_ios.mm new file mode 100644 index 0000000..ae09e1f --- /dev/null +++ b/src/macextras/qmacfunctions_ios.mm @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Petroules Corporation. +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtMacExtras module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include "qmacfunctions.h" +#include "qmacfunctions_p.h" +#import <UIKit/UIKit.h> + +QT_BEGIN_NAMESPACE + +namespace QtMacExtras +{ + +CGContextRef currentCGContext() +{ + return UIGraphicsGetCurrentContext(); +} + +} // namespace QtMacExtras + +QT_END_NAMESPACE |