-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0c3ef35
commit c03a89a
Showing
7 changed files
with
345 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
#import <Monet/MOView.h> | ||
|
||
@interface MOButton : MOView | ||
{ | ||
struct MOButtonData *buttonData; | ||
} | ||
|
||
- (void)clicked; | ||
|
||
@end | ||
// @interface MOButton : MOView | ||
// { | ||
// struct MOButtonData *buttonData; | ||
// } | ||
// | ||
// - (void)clicked; | ||
// | ||
// @end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,65 @@ | ||
#import <Foundation/Foundation.h> | ||
#import <SeaBase/SeaBase.h> | ||
|
||
typedef struct _MOView MOView; | ||
|
||
#import <Monet/MOApplication.h> | ||
#import <Monet/MOEvent.h> | ||
#import <Monet/MORect.h> | ||
|
||
@interface MOView : NSObject | ||
{ | ||
struct MOViewData *viewData; | ||
} | ||
typedef void (*MOViewDrawRectCallback)(MOView *self, MORect aRect); | ||
typedef void (*MOViewTickCallback)(MOView *self, double aSeconds); | ||
|
||
typedef bool (*MOViewKeyPressedCallback)(MOView *self, MOEvent *aEvent); | ||
typedef bool (*MOViewKeyReleasedCallback)(MOView *self, MOEvent *aEvent); | ||
typedef bool (*MOViewMouseButtonPressedCallback)(MOView *self, MOEvent *aEvent); | ||
typedef bool (*MOViewMouseButtonReleasedCallback)(MOView *self, MOEvent *aEvent); | ||
typedef bool (*MOViewMouseDraggedCallback)(MOView *self, MOEvent *aEvent); | ||
typedef bool (*MOViewTimerFiredCallback)(MOView *self, MOEvent *aEvent); | ||
|
||
MOView *MOViewCreate(MORect aFrame, MOApplication *aApplication); | ||
|
||
- (id)initWithFrame: (MORect)aFrame app: (MOApplication *)aApp; | ||
void MOViewSetDrawRectCallback(MOView *self, MOViewDrawRectCallback aCallback); | ||
void MOViewSetTickCallback(MOView *self, MOViewTickCallback aCallback); | ||
|
||
- (MOApplication *)app; | ||
void MOViewSetKeyPressedCallback(MOView *self, MOViewKeyPressedCallback aCallback); | ||
void MOViewSetKeyReleasedCallback(MOView *self, MOViewKeyReleasedCallback aCallback); | ||
void MOViewSetMouseButtonPressedCallback(MOView *self, MOViewMouseButtonPressedCallback aCallback); | ||
void MOViewSetMouseButtonReleasedCallback(MOView *self, MOViewMouseButtonReleasedCallback aCallback); | ||
void MOViewSetMouseDraggedCallback(MOView *self, MOViewMouseDraggedCallback aCallback); | ||
void MOViewSetTimerFiredCallback(MOView *self, MOViewTimerFiredCallback aCallback); | ||
|
||
- (MOView *)superview; | ||
- (NSArray *)subviews; | ||
- (void)addSubview: (MOView *)aSubview; | ||
MOApplication *MOViewGetApplication(MOView *self); | ||
void *MOViewGetExtra(MOView *self); | ||
void MOViewSetExtra(MOView *self, void *aExtra); | ||
|
||
- (MOPoint)convertPointFromScreen: (MOPoint)aPoint; | ||
- (MOPoint)convertPointToScreen: (MOPoint)aPoint; | ||
MOView *MOViewGetSuperview(MOView *self); | ||
void MOViewSetSuperview(MOView *self, MOView *aSuperview); | ||
SBArray *MOViewGetSubviews(MOView *self); | ||
void MOViewAddSubview(MOView *self, MOView *aSubview); | ||
|
||
- (MOView *)subviewAtPoint: (MOPoint)aPoint; | ||
- (MOView *)deepestSubviewAtPoint: (MOPoint)aPoint; | ||
MOPoint MOViewGetAbsoluteOrigin(MOView *self); | ||
MOPoint MOViewConvertPointFromScreen(MOView *self, MOPoint aPoint); | ||
MOPoint MOViewConvertPointToScreen(MOView *self, MOPoint aPoint); | ||
|
||
- (MORect)frame; | ||
- (MORect)bounds; | ||
- (MORect)boundsRelativeToWindow; | ||
MOView *MOViewGetSubviewAtPoint(MOView *self, MOPoint aPoint); | ||
MOView *MOViewGetDeepestSubviewAtPoint(MOView *self, MOPoint aPoint); | ||
|
||
- (void)lockFocus; | ||
- (void)unlockFocus; | ||
MORect MOViewGetFrame(MOView *self); | ||
MORect MOViewGetBounds(MOView *self); | ||
MORect MOViewGetBoundsRelativeToWindow(MOView *self); | ||
|
||
- (void)display; | ||
- (void)clear; | ||
- (void)drawRect: (MORect)aRect; | ||
void MOViewLockFocus(MOView *self); | ||
void MOViewUnlockFocus(MOView *self); | ||
|
||
- (void)tick: (double)aSeconds; | ||
void MOViewDisplay(MOView *self); | ||
void MOViewClear(MOView *self); | ||
|
||
- (BOOL)keyDown: (MOEvent *)aEvent; | ||
- (BOOL)keyUp: (MOEvent *)aEvent; | ||
- (void)mouseDown: (MOEvent *)aEvent; | ||
- (void)mouseUp: (MOEvent *)aEvent; | ||
- (void)mouseDragged: (MOEvent *)aEvent; | ||
- (void)timerFired: (MOEvent *)aEvent; | ||
void MOViewDrawRect(MOView *self, MORect aRect); | ||
void MOViewTick(MOView *self, double aSeconds); | ||
|
||
@end | ||
bool MOViewKeyPressed(MOView *self, MOEvent *aEvent); | ||
bool MOViewKeyReleased(MOView *self, MOEvent *aEvent); | ||
void MOViewMouseButtonPressed(MOView *self, MOEvent *aEvent); | ||
void MOViewMouseButtonReleased(MOView *self, MOEvent *aEvent); | ||
void MOViewMouseDragged(MOView *self, MOEvent *aEvent); | ||
void MOViewTimerFired(MOView *self, MOEvent *aEvent); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.