summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/app.c b/src/app.c
index b2b0f53c..43568ba6 100644
--- a/src/app.c
+++ b/src/app.c
@@ -61,7 +61,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
61#include <stdarg.h> 61#include <stdarg.h>
62#include <errno.h> 62#include <errno.h>
63 63
64#if defined (iPlatformApple) && !defined (iPlatformIOS) 64#if defined (iPlatformAppleDesktop)
65# include "macos.h" 65# include "macos.h"
66#endif 66#endif
67#if defined (iPlatformMsys) 67#if defined (iPlatformMsys)
@@ -73,10 +73,14 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
73 73
74iDeclareType(App) 74iDeclareType(App)
75 75
76#if defined (iPlatformApple) 76#if defined (iPlatformAppleDesktop)
77#define EMB_BIN "../../Resources/resources.lgr" 77#define EMB_BIN "../../Resources/resources.lgr"
78static const char *defaultDataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange"; 78static const char *defaultDataDir_App_ = "~/Library/Application Support/fi.skyjake.Lagrange";
79#endif 79#endif
80#if defined (iPlatformAppleMobile)
81#define EMB_BIN "../../Resources/resources.lgr"
82static const char *defaultDataDir_App_ = "~/config";
83#endif
80#if defined (iPlatformMsys) 84#if defined (iPlatformMsys)
81#define EMB_BIN "../resources.lgr" 85#define EMB_BIN "../resources.lgr"
82static const char *defaultDataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange"; 86static const char *defaultDataDir_App_ = "~/AppData/Roaming/fi.skyjake.Lagrange";
@@ -429,7 +433,7 @@ static void init_App_(iApp *d, int argc, char **argv) {
429 d->lastEventTime = 0; 433 d->lastEventTime = 0;
430 d->sleepTimer = SDL_AddTimer(1000, checkAsleep_App_, d); 434 d->sleepTimer = SDL_AddTimer(1000, checkAsleep_App_, d);
431#endif 435#endif
432#if defined (iPlatformApple) 436#if defined (iPlatformAppleDesktop)
433 setupApplication_MacOS(); 437 setupApplication_MacOS();
434#endif 438#endif
435 init_Keys(); 439 init_Keys();
@@ -628,7 +632,7 @@ void processEvents_App(enum iAppEventMode eventMode) {
628 wasUsed = processEvent_Keys(&ev); 632 wasUsed = processEvent_Keys(&ev);
629 } 633 }
630 if (ev.type == SDL_USEREVENT && ev.user.code == command_UserEventCode) { 634 if (ev.type == SDL_USEREVENT && ev.user.code == command_UserEventCode) {
631#if defined (iPlatformApple) && !defined (iPlatformIOS) 635#if defined (iPlatformAppleDesktop)
632 handleCommand_MacOS(command_UserEvent(&ev)); 636 handleCommand_MacOS(command_UserEvent(&ev));
633#endif 637#endif
634 if (isCommand_UserEvent(&ev, "metrics.changed")) { 638 if (isCommand_UserEvent(&ev, "metrics.changed")) {
@@ -1565,9 +1569,10 @@ void openInDefaultBrowser_App(const iString *url) {
1565 return; 1569 return;
1566 } 1570 }
1567#endif 1571#endif
1572#if !defined (iPlatformAppleMobile)
1568 iProcess *proc = new_Process(); 1573 iProcess *proc = new_Process();
1569 setArguments_Process(proc, 1574 setArguments_Process(proc,
1570#if defined (iPlatformApple) 1575#if defined (iPlatformAppleDesktop)
1571 iClob(newStringsCStr_StringList("/usr/bin/env", "open", cstr_String(url), NULL)) 1576 iClob(newStringsCStr_StringList("/usr/bin/env", "open", cstr_String(url), NULL))
1572#elif defined (iPlatformLinux) || defined (iPlatformOther) 1577#elif defined (iPlatformLinux) || defined (iPlatformOther)
1573 iClob(newStringsCStr_StringList("/usr/bin/env", "xdg-open", cstr_String(url), NULL)) 1578 iClob(newStringsCStr_StringList("/usr/bin/env", "xdg-open", cstr_String(url), NULL))
@@ -1581,10 +1586,11 @@ void openInDefaultBrowser_App(const iString *url) {
1581 ); 1586 );
1582 start_Process(proc); 1587 start_Process(proc);
1583 iRelease(proc); 1588 iRelease(proc);
1589#endif
1584} 1590}
1585 1591
1586void revealPath_App(const iString *path) { 1592void revealPath_App(const iString *path) {
1587#if defined (iPlatformApple) 1593#if defined (iPlatformAppleDesktop)
1588 const char *scriptPath = concatPath_CStr(dataDir_App_(), "revealfile.scpt"); 1594 const char *scriptPath = concatPath_CStr(dataDir_App_(), "revealfile.scpt");
1589 iFile *f = newCStr_File(scriptPath); 1595 iFile *f = newCStr_File(scriptPath);
1590 if (open_File(f, writeOnly_FileMode | text_FileMode)) { 1596 if (open_File(f, writeOnly_FileMode | text_FileMode)) {