csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.6 KiB
51 lines
1.6 KiB
#ifndef common_h
|
|
#define common_h
|
|
#include "comimpl.h"
|
|
#include "avalonia-native.h"
|
|
#include <stdio.h>
|
|
#import <Foundation/Foundation.h>
|
|
#import <AppKit/AppKit.h>
|
|
#include <pthread.h>
|
|
|
|
extern IAvnPlatformThreadingInterface* CreatePlatformThreading();
|
|
extern IAvnWindow* CreateAvnWindow(IAvnWindowEvents*events, IAvnGlContext* gl);
|
|
extern IAvnPopup* CreateAvnPopup(IAvnWindowEvents*events, IAvnGlContext* gl);
|
|
extern IAvnSystemDialogs* CreateSystemDialogs();
|
|
extern IAvnScreens* CreateScreens();
|
|
extern IAvnClipboard* CreateClipboard();
|
|
extern IAvnCursorFactory* CreateCursorFactory();
|
|
extern IAvnGlDisplay* GetGlDisplay();
|
|
extern IAvnMenu* CreateAppMenu(IAvnMenuEvents* events, bool isTopLevel);
|
|
extern IAvnMenuItem* CreateAppMenuItem();
|
|
extern IAvnMenuItem* CreateAppMenuItemSeperator();
|
|
extern void SetAppMenu (NSString* appName, IAvnMenu* appMenu);
|
|
extern IAvnMenu* GetAppMenu ();
|
|
extern NSMenuItem* GetAppMenuItem ();
|
|
|
|
extern void InitializeAvnApp();
|
|
extern NSApplicationActivationPolicy AvnDesiredActivationPolicy;
|
|
extern NSPoint ToNSPoint (AvnPoint p);
|
|
extern AvnPoint ToAvnPoint (NSPoint p);
|
|
extern AvnPoint ConvertPointY (AvnPoint p);
|
|
extern NSSize ToNSSize (AvnSize s);
|
|
#ifdef DEBUG
|
|
#define NSDebugLog(...) NSLog(__VA_ARGS__)
|
|
#else
|
|
#define NSDebugLog(...) (void)0
|
|
#endif
|
|
|
|
template<typename T> inline T* objc_cast(id from) {
|
|
if(from == nil)
|
|
return nil;
|
|
if ([from isKindOfClass:[T class]]) {
|
|
return static_cast<T*>(from);
|
|
}
|
|
return nil;
|
|
}
|
|
|
|
@interface ActionCallback : NSObject
|
|
- (ActionCallback*) initWithCallback: (IAvnActionCallback*) callback;
|
|
- (void) action;
|
|
@end
|
|
|
|
#endif
|
|
|