Seregon/StratoSDK

StratoSDK is a framework with a declarative approach similar to Flutter/React, written and designed entirely for Rust.

Rust/27.3 KB/No license
crates/strato-ui-renderer/src/platform/mac/objc/menus.h
1#import <AppKit/AppKit.h>
2 
3// WarpCustomMenuItemHandler is set as both the target and represented object of NSMenuItem.
4// It gives the Rust side a chance to dynamically update menu items, and
5// respond to their actions.
6@interface WarpCustomMenuItemHandler : NSObject <NSMenuItemValidation> {
7 void *rustContext;
8}
9 
10// Init, wrapping a pointer which is significant to Rust.
11- (id)initWithContext:(void *)wrapper;
12 
13// Action set on menu items.
14- (void)itemWasTriggered:(NSMenuItem *)item;
15 
16// Called when the menu item needs updating.
17- (void)itemNeedsUpdate:(NSMenuItem *)item;
18 
19@end
20