11#import <UIKit/UIKit.h>
12#include "IGraphicsIOS.h"
15BEGIN_IGRAPHICS_NAMESPACE
20 float x = floor(bounds.L * scale);
21 float y = floor(bounds.T * scale);
22 float x2 = ceil(bounds.R * scale);
23 float y2 = ceil(bounds.B * scale);
25 return CGRectMake(x, y, x2 - x, y2 - y);
28inline UIColor* ToUIColor(
const IColor& c)
30 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];
33inline IColor FromUIColor(
const UIColor* c)
36 [c getRed:&r green:&g blue:&b alpha:&a];
37 return IColor(a * 255., r * 255., g * 255., b * 255.);
40END_IGRAPHICS_NAMESPACE
44using namespace igraphics;
46@interface IGRAPHICS_UITABLEVC : UIViewController<UITableViewDataSource, UITableViewDelegate>
51@property (strong, nonatomic) UITableView* tableView;
52@property (strong, nonatomic) NSMutableArray* items;
57@interface IGRAPHICS_VIEW : UIView
60UIPopoverPresentationControllerDelegate,
61UIGestureRecognizerDelegate,
63UIDocumentPickerDelegate,
64UIColorPickerViewControllerDelegate
69 IGRAPHICS_UITABLEVC* mMenuTableController;
70 UINavigationController* mMenuNavigationController;
71 UITextField* mTextField;
72 UIAlertController* mAlertController;
73 CAMetalLayer* mMTLLayer;
75 IColorPickerHandlerFunc mColorPickerHandlerFunc;
76 IFileDialogCompletionHandlerFunc mFileDialogFunc;
81- (BOOL) acceptsFirstResponder;
82- (BOOL) delaysContentTouches;
83- (void) removeFromSuperview;
85- (void) createTextEntry: (
int) paramIdx : (const
IText&) text : (const
char*) str : (
int) length : (CGRect) areaRect;
87- (void) showMessageBox: (const
char*) str : (const
char*) title : (EMsgBoxType) type : (IMsgBoxCompletionHandlerFunc) completionHandler;
88- (void) promptForFile: (NSString*) fileName : (NSString*) path : (EFileAction) action : (NSArray*) contentTypes : (IFileDialogCompletionHandlerFunc) completionHandler;
89- (void) promptForDirectory: (NSString*) path : (IFileDialogCompletionHandlerFunc) completionHandler;
90- (BOOL) promptForColor: (
IColor&) color : (const
char*) str : (IColorPickerHandlerFunc) func;
91- (void) presentationControllerDidDismiss: (UIPresentationController*) presentationController;
94- (void) documentPicker:(UIDocumentPickerViewController*) controller didPickDocumentsAtURLs:(NSArray <NSURL *>*)urls;
95- (void) documentPickerWasCancelled:(UIDocumentPickerViewController*) controller;
98- (void) colorPickerViewControllerDidSelectColor:(UIColorPickerViewController*) viewController;
99- (void) colorPickerViewControllerDidFinish:(UIColorPickerViewController*) viewController;
102- (void) attachGestureRecognizer: (EGestureType) type;
103- (BOOL) gestureRecognizer:(UIGestureRecognizer*) gestureRecognizer shouldReceiveTouch:(UITouch*)touch;
104- (void) onTapGesture: (UITapGestureRecognizer*) recognizer;
105- (void) onLongPressGesture: (UILongPressGestureRecognizer*) recognizer;
106- (void) onSwipeGesture: (UISwipeGestureRecognizer*) recognizer;
107- (void) onPinchGesture: (UIPinchGestureRecognizer*) recognizer;
108- (void) onRotateGesture: (UIRotationGestureRecognizer*) recognizer;
110- (void) getLastTouchLocation: (
float&) x : (
float&) y;
112- (void) traitCollectionDidChange: (UITraitCollection*) previousTraitCollection;
114@property (readonly) CAMetalLayer* metalLayer;
115@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,...