From 03dcd3991861ee4caadd03457c407748fdbaeab2 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 2 Aug 2018 17:53:13 +0000 Subject: [PATCH] ide: OSX flags git-svn-id: svn://ultimatepp.org/upp/trunk@12140 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Core.upp | 4 ++-- uppsrc/Core/config.h | 6 +++++- uppsrc/CtrlCore/CocoCreate.mm | 11 +++++++++++ uppsrc/CtrlCore/CocoTop.cpp | 5 ----- uppsrc/CtrlCore/CtrlCore.upp | 2 +- uppsrc/CtrlCore/cocotodo.txt | 16 ++++++++++------ uppsrc/ide/Builders/GccBuilder.cpp | 17 +++++++---------- uppsrc/ide/Core/Host.cpp | 4 ++++ 8 files changed, 40 insertions(+), 25 deletions(-) diff --git a/uppsrc/Core/Core.upp b/uppsrc/Core/Core.upp index cba1f9120..cc086f158 100644 --- a/uppsrc/Core/Core.upp +++ b/uppsrc/Core/Core.upp @@ -11,7 +11,7 @@ library(WIN32 !GUI !GNU !GCC) "ole32 oleaut32 oldnames"; library(LINUX !ANDROID) "pthread dl rt"; -library(BSD !OSX11 !MACOSX) "pthread rt execinfo"; +library(BSD !OSX) "pthread rt execinfo"; library(WIN32 !MSC8ARM) "advapi32 shell32 winmm mpr"; @@ -23,7 +23,7 @@ library(MSC8ARM WIN32) "coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib library(!WIN32) z; -library(MACOSX) pthread; +library(OSX) pthread; library(ANDROID) atomic; diff --git a/uppsrc/Core/config.h b/uppsrc/Core/config.h index f7fd02583..c9f954e4c 100644 --- a/uppsrc/Core/config.h +++ b/uppsrc/Core/config.h @@ -43,7 +43,11 @@ #define PLATFORM_COCOA 1 #endif #define PLATFORM_BSD 1 - #define PLATFORM_MACOS + #define PLATFORM_MACOS 1 + #define PLATFORM_OSX 1 + #ifndef flagUSEMALLOC + #define flagUSEMALLOC // TODO: investigate why is this necessary... + #endif #else // zvzv mod // was: #if __FreeBSD__ || __OpenBSD__ || __NetBSD__ || __APPLE__ diff --git a/uppsrc/CtrlCore/CocoCreate.mm b/uppsrc/CtrlCore/CocoCreate.mm index 282c5aff4..2b1b96691 100644 --- a/uppsrc/CtrlCore/CocoCreate.mm +++ b/uppsrc/CtrlCore/CocoCreate.mm @@ -261,4 +261,15 @@ void Upp::Ctrl::WndSetPos(const Upp::Rect& rect) display:YES]; } +void Upp::TopWindow::SerializePlacement(Stream& s, bool reminimize) +{ + GuiLock __; + int version = 0; + s / version; + Rect rect = GetRect(); + s % rect; + if(s.IsLoading()) + SetRect(rect); +} + #endif diff --git a/uppsrc/CtrlCore/CocoTop.cpp b/uppsrc/CtrlCore/CocoTop.cpp index 97663ca33..cae3a162f 100644 --- a/uppsrc/CtrlCore/CocoTop.cpp +++ b/uppsrc/CtrlCore/CocoTop.cpp @@ -46,11 +46,6 @@ void TopWindow::GuiPlatformDestruct() { } -void TopWindow::SerializePlacement(Stream& s, bool reminimize) -{ - GuiLock __; -} - END_UPP_NAMESPACE #endif diff --git a/uppsrc/CtrlCore/CtrlCore.upp b/uppsrc/CtrlCore/CtrlCore.upp index 3c227d044..0b6de5aa2 100644 --- a/uppsrc/CtrlCore/CtrlCore.upp +++ b/uppsrc/CtrlCore/CtrlCore.upp @@ -33,7 +33,7 @@ library(POSIX !NOGTK !RAINBOW GUI !OSX11) notify; library(DRAGONFLY) "Xext Xinerama"; -link(MACOSX) " -framework Foundation -framework Cocoa"; +link(OSX !X11) " -framework Foundation -framework Cocoa"; file Core readonly separator, diff --git a/uppsrc/CtrlCore/cocotodo.txt b/uppsrc/CtrlCore/cocotodo.txt index 680c0e280..e76813174 100644 --- a/uppsrc/CtrlCore/cocotodo.txt +++ b/uppsrc/CtrlCore/cocotodo.txt @@ -1,9 +1,14 @@ sooner: +- X11 on option - OSX flag -- SerializePlacement -- rect loop (ViewDraw) +- flagCOCOA +- USEMALLOC +- triple click, hold... + +- package organizer initial size too small +- rect loop (ViewDraw) - minimize, maximaze - Ctrl+Shift+F wrong initial focus - menubar does not loose focus after click outside (or rather ActiveFocus does not work) @@ -14,9 +19,8 @@ sooner: later: - void WakeUpGuiThread(void) -- fullscreen +- fullscreen mode issues - missing cursors (add to iml, use undocumented cursor) -- X11 on option - PrinterJob - DrawDragRect - CT_Font caching @@ -37,10 +41,10 @@ later: - fix resizing arrows - RenderCharacterSys -- flagCOCOA -- USEMALLOC - multimonitor support +- SerializePlacement - probably improve + void SystemDraw::DrawPolyPolylineOp(const Point *vertices, int vertex_count, const int *counts, int count_count, int width, Color color, Color doxor) void SystemDraw::DrawPolyPolyPolygonOp(const Point *vertices, int vertex_count, const int *subpolygon_counts, int scc, const int *disjunct_polygon_counts, int dpcc, Color color, int width, Color outline, uint64 pattern, Color doxor) void SystemDraw::DrawArcOp(const Rect& rc, Point start, Point end, int width, Color color) diff --git a/uppsrc/ide/Builders/GccBuilder.cpp b/uppsrc/ide/Builders/GccBuilder.cpp index 56e3c6ed8..9e2d166c5 100644 --- a/uppsrc/ide/Builders/GccBuilder.cpp +++ b/uppsrc/ide/Builders/GccBuilder.cpp @@ -135,13 +135,14 @@ bool GccBuilder::BuildPackage(const String& package, Vector& linkfile, V cc << ' ' << Gather(pkg.option, config.GetKeys()); cc << " -fexceptions"; - if (HasFlag("OSX11")) { +#if 0 + if (HasFlag("OSX")) { if (HasFlag("POWERPC")) cc << " -arch ppc"; if (HasFlag("X86")) cc << " -arch i386"; } - +#endif // if(HasFlag("SSE2")) { // cc << " -msse2"; // if(!HasFlag("CLANG")) @@ -477,11 +478,11 @@ bool GccBuilder::Link(const Vector& linkfile, const String& linkoptions, if(HasFlag("DEBUG_MINIMAL") || HasFlag("DEBUG_FULL")) lnk << " -ggdb"; else - lnk << (!HasFlag("OSX11") && !HasFlag("COCOA") ? " -Wl,-s" : ""); + lnk << (!HasFlag("OSX") ? " -Wl,-s" : ""); for(i = 0; i < libpath.GetCount(); i++) lnk << " -L" << GetHostPathQ(libpath[i]); // lnk << " -Wl,--gc-sections,-O,2 "; - if(!HasFlag("OSX11") && !HasFlag("COCOA")) + if(!HasFlag("OSX") && !HasFlag("COCOA")) lnk << " -Wl,-O,2 "; lnk << linkoptions; /* @@ -518,10 +519,8 @@ bool GccBuilder::Link(const Vector& linkfile, const String& linkoptions, else lib.Add(linkfile[i]); } -#ifndef PLATFORM_MACOS - if(!HasFlag("SOLARIS") && !HasFlag("OSX11") && !HasFlag("OBJC")) + if(!HasFlag("SOLARIS") && !HasFlag("OSX") && !HasFlag("OBJC")) lnk << " -Wl,--start-group "; -#endif for(int pass = 0; pass < 2; pass++) { for(i = 0; i < lib.GetCount(); i++) { String ln = lib[i]; @@ -552,10 +551,8 @@ bool GccBuilder::Link(const Vector& linkfile, const String& linkoptions, lnk << " -l" << ln; } } -#ifndef PLATFORM_MACOS - if(pass == 1 && !HasFlag("SOLARIS") && !HasFlag("OSX11")) + if(pass == 1 && !HasFlag("SOLARIS") && !HasFlag("OSX")) lnk << " -Wl,--end-group"; -#endif } PutConsole("Linking..."); bool error = false; diff --git a/uppsrc/ide/Core/Host.cpp b/uppsrc/ide/Core/Host.cpp index 216642ade..ad3539055 100644 --- a/uppsrc/ide/Core/Host.cpp +++ b/uppsrc/ide/Core/Host.cpp @@ -338,6 +338,10 @@ void LocalHost::AddFlags(Index& cfg) cfg.Add("BSD"); #endif +#ifdef PLATFORM_OSX + cfg.Add("OSX"); +#endif + #ifdef PLATFORM_FREEBSD cfg.Add("FREEBSD"); #endif