11 #import <UIKit/UIKit.h> 12 #include "IGraphicsIOS.h" 15 BEGIN_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);
28 inline 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];
33 inline 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.);
40 END_IGRAPHICS_NAMESPACE
43 using namespace iplug;
44 using 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 : UIScrollView <UITextFieldDelegate, UIScrollViewDelegate, UIPopoverPresentationControllerDelegate, UIGestureRecognizerDelegate
59 , UIColorPickerViewControllerDelegate
65 IGRAPHICS_UITABLEVC* mMenuTableController;
66 UINavigationController* mMenuNavigationController;
67 UITextField* mTextField;
68 CAMetalLayer* mMTLLayer;
70 IColorPickerHandlerFunc mColorPickerHandlerFunc;
75 - (BOOL) acceptsFirstResponder;
76 - (BOOL) delaysContentTouches;
77 - (void) removeFromSuperview;
79 - (void) createTextEntry: (
int) paramIdx : (const
IText&) text : (const
char*) str : (
int) length : (CGRect) areaRect;
80 - (void) endUserInput;
81 - (void) showMessageBox: (const
char*) str : (const
char*) caption : (EMsgBoxType) type : (IMsgBoxCompletionHanderFunc) completionHandler;
82 - (BOOL) promptForColor: (
IColor&) color : (const
char*) str : (IColorPickerHandlerFunc) func;
83 - (void) presentationControllerDidDismiss: (UIPresentationController*) presentationController;
86 - (void) colorPickerViewControllerDidSelectColor:(UIColorPickerViewController*) viewController;
87 - (void) colorPickerViewControllerDidFinish:(UIColorPickerViewController*) viewController;
91 - (void) attachGestureRecognizer: (EGestureType) type;
92 -(BOOL) gestureRecognizer:(UIGestureRecognizer*) gestureRecognizer shouldReceiveTouch:(UITouch*)touch;
93 - (void) onTapGesture: (UITapGestureRecognizer*) recognizer;
94 - (void) onLongPressGesture: (UILongPressGestureRecognizer*) recognizer;
95 - (void) onSwipeGesture: (UISwipeGestureRecognizer*) recognizer;
96 - (void) onPinchGesture: (UIPinchGestureRecognizer*) recognizer;
97 - (void) onRotateGesture: (UIRotationGestureRecognizer*) recognizer;
99 - (void) getLastTouchLocation: (
float&) x : (
float&) y;
101 @property (readonly) CAMetalLayer* metalLayer;
102 @property (nonatomic, strong) CADisplayLink *displayLink;
106 #ifdef IGRAPHICS_IMGUI 107 #import <MetalKit/MetalKit.h> 109 @interface IGRAPHICS_IMGUIVIEW : MTKView
111 IGraphicsIOS_View* mView;
113 @property (nonatomic, strong) id <MTLCommandQueue> commandQueue;
114 - (id) initWithIGraphicsView: (IGraphicsIOS_View*) pView;
Used to manage a rectangular area, independent of draw class/platform.
Used to manage color data, independent of draw class/platform.
float R
Right side of the rectangle (X + W)
IText is used to manage font and text/text entry style for a piece of text on the UI...
float GetDrawScale() const
Gets the graphics context scaling factor.
The lowest level base class of an IGraphics context.
IGraphics platform class for IOS.
float L
Left side of the rectangle (X)
float T
Top of the rectangle (Y)
float B
Bottom of the rectangle (Y + H)