2021-04-18 17:08:35 +02:00
|
|
|
#import <Foundation/Foundation.h>
|
2021-04-19 10:18:52 +02:00
|
|
|
#include "lua.h"
|
2021-04-18 17:08:35 +02:00
|
|
|
|
2021-08-19 11:32:18 +02:00
|
|
|
#ifdef MACOS_USE_BUNDLE
|
2021-04-18 17:51:31 +02:00
|
|
|
void set_macos_bundle_resources(lua_State *L)
|
2021-04-18 17:08:35 +02:00
|
|
|
{ @autoreleasepool
|
|
|
|
{
|
2021-08-19 23:30:44 +02:00
|
|
|
NSString* resource_path = [[NSBundle mainBundle] resourcePath];
|
|
|
|
lua_pushstring(L, [resource_path UTF8String]);
|
2021-04-18 17:51:31 +02:00
|
|
|
lua_setglobal(L, "MACOS_RESOURCES");
|
2021-04-18 17:08:35 +02:00
|
|
|
}}
|
2021-08-19 11:32:18 +02:00
|
|
|
#endif
|
2021-04-21 09:52:16 +02:00
|
|
|
|
|
|
|
/* Thanks to mathewmariani, taken from his lite-macos github repository. */
|
|
|
|
void enable_momentum_scroll() {
|
|
|
|
[[NSUserDefaults standardUserDefaults]
|
|
|
|
setBool: YES
|
|
|
|
forKey: @"AppleMomentumScrollSupported"];
|
|
|
|
}
|
|
|
|
|