11#import <UIKit/UIKit.h>
12#include "IGraphicsIOS.h"
15#import <libEGL/libEGL.h>
16#import <libGLESv2/angle_gl.h>
20BEGIN_IGRAPHICS_NAMESPACE
25 float x = floor(bounds.L * scale);
26 float y = floor(bounds.T * scale);
27 float x2 = ceil(bounds.R * scale);
28 float y2 = ceil(bounds.B * scale);
30 return CGRectMake(x, y, x2 - x, y2 - y);
33inline UIColor* ToUIColor(
const IColor& c)
35 return [UIColor colorWithRed:(double) c.R / 255.0 green:(
double) c.G / 255.0 blue:(double) c.B / 255.0 alpha:(
double) c.A / 255.0];
38inline IColor FromUIColor(
const UIColor* c)
41 [c getRed:&r green:&g blue:&b alpha:&a];
42 return IColor(a * 255., r * 255., g * 255., b * 255.);
45END_IGRAPHICS_NAMESPACE
49using namespace igraphics;
51@interface IGRAPHICS_UITABLEVC : UIViewController<UITableViewDataSource, UITableViewDelegate>
56@property (strong, nonatomic) UITableView* tableView;
57@property (strong, nonatomic) NSMutableArray* items;
62@interface IGRAPHICS_VIEW : UIView
65UIPopoverPresentationControllerDelegate,
66UIGestureRecognizerDelegate,
68UIDocumentPickerDelegate,
69UIColorPickerViewControllerDelegate
74 IGRAPHICS_UITABLEVC* mMenuTableController;
75 UINavigationController* mMenuNavigationController;
76 UITextField* mTextField;
77 UIAlertController* mAlertController;
79 IColorPickerHandlerFunc mColorPickerHandlerFunc;
80 IFileDialogCompletionHandlerFunc mFileDialogFunc;
84 EGLDisplay mEGLDisplay;
85 EGLSurface mEGLSurface;
86 EGLContext mEGLContext;
91- (BOOL) acceptsFirstResponder;
92- (BOOL) delaysContentTouches;
93- (void) removeFromSuperview;
95- (void) createTextEntry: (
int) paramIdx : (const
IText&) text : (const
char*) str : (
int) length : (CGRect) areaRect;
97- (void) showMessageBox: (const
char*) str : (const
char*) title : (EMsgBoxType) type : (IMsgBoxCompletionHandlerFunc) completionHandler;
98- (void) promptForFile: (NSString*) fileName : (NSString*) path : (EFileAction) action : (NSArray*) contentTypes : (IFileDialogCompletionHandlerFunc) completionHandler;
99- (void) promptForDirectory: (NSString*) path : (IFileDialogCompletionHandlerFunc) completionHandler;
100- (BOOL) promptForColor: (
IColor&) color : (const
char*) str : (IColorPickerHandlerFunc) func;
101- (void) presentationControllerDidDismiss: (UIPresentationController*) presentationController;
104- (void) documentPicker:(UIDocumentPickerViewController*) controller didPickDocumentsAtURLs:(NSArray <NSURL *>*)urls;
105- (void) documentPickerWasCancelled:(UIDocumentPickerViewController*) controller;
108- (void) colorPickerViewControllerDidSelectColor:(UIColorPickerViewController*) viewController;
109- (void) colorPickerViewControllerDidFinish:(UIColorPickerViewController*) viewController;
112- (void) attachGestureRecognizer: (EGestureType) type;
113- (BOOL) gestureRecognizer:(UIGestureRecognizer*) gestureRecognizer shouldReceiveTouch:(UITouch*)touch;
114- (void) onTapGesture: (UITapGestureRecognizer*) recognizer;
115- (void) onLongPressGesture: (UILongPressGestureRecognizer*) recognizer;
116- (void) onSwipeGesture: (UISwipeGestureRecognizer*) recognizer;
117- (void) onPinchGesture: (UIPinchGestureRecognizer*) recognizer;
118- (void) onRotateGesture: (UIRotationGestureRecognizer*) recognizer;
120- (void) getLastTouchLocation: (
float&) x : (
float&) y;
122- (void) traitCollectionDidChange: (UITraitCollection*) previousTraitCollection;
125- (void) activateGLContext;
126- (void) deactivateGLContext;
128@property (nonatomic, strong) CADisplayLink *displayLink;
The lowest level base class of an IGraphics context.
float GetDrawScale() const
Gets the graphics context scaling factor.
IGraphics platform class for IOS.
Used to manage color data, independent of draw class/platform.
Used to manage a rectangular area, independent of draw class/platform.
IText is used to manage font and text/text entry style for a piece of text on the UI,...