File: mac_context_cocoa.m

package info (click to toggle)
python-enable 4.3.0-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 7,280 kB
  • ctags: 13,899
  • sloc: cpp: 48,447; python: 28,502; ansic: 9,004; makefile: 315; sh: 44
file content (14 lines) | stat: -rw-r--r-- 287 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#import <Cocoa/Cocoa.h>

void *
get_cg_context_ref(void *view_ptr)
{
    id object = (id)view_ptr;

    if ([object isKindOfClass:[NSView class]])
    {
        NSView *view = (NSView *)object;
        return [[[view window] graphicsContext] graphicsPort];
    }
    return (void *)0;
}