mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CtrlCore/CtrlLib: MacOS conditionals fixed to support Turtle
git-svn-id: svn://ultimatepp.org/upp/trunk@15996 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5fe4bcf4ab
commit
52403f0ff7
26 changed files with 50 additions and 37 deletions
|
|
@ -1,3 +1,5 @@
|
|||
#define GUI_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
struct PointCG; // represents CGPoint, used to isolate Cocoa/AppKit includes
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
@interface AppDelegate : NSObject<NSApplicationDelegate>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#define LLOG(x)
|
||||
#define LTIMING(x)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#define LLOG(x)
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include <Core/config.h>
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#if defined(PLATFORM_COCOA) && !defined(VIRTUALGUI)
|
||||
|
||||
#define Point NS_Point
|
||||
#define Rect NS_Rect
|
||||
|
|
@ -13,8 +13,12 @@
|
|||
#undef Rect
|
||||
#undef Size
|
||||
|
||||
#endif
|
||||
|
||||
#include "CtrlCore.h"
|
||||
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
template <class T>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
NSEvent *sCurrentMouseEvent__; // needed for drag operation
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#define LLOG(x)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ Tuple<dword, const char *> KeyNames__[ ] = {
|
|||
{ K_PLUS, tt_("key\v[+]") }, { K_MINUS, tt_("key\v[-]") }, { K_COMMA, tt_("key\v[,]") }, { K_PERIOD, tt_("key\v[.]") },
|
||||
{ K_SEMICOLON, tt_("key\v[;]") }, { K_SLASH, tt_("key\v[/]") }, { K_GRAVE, tt_("key\v[`]") }, { K_LBRACKET, tt_("key\v[[]") },
|
||||
{ K_BACKSLASH, tt_("key\v[\\]") }, { K_RBRACKET, tt_("key\v[]]") }, { K_QUOTEDBL, tt_("key\v[']") },
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
{ K_OPTION_KEY, tt_("key\vOption") },
|
||||
#endif
|
||||
{ IK_DBL_CLICK, tt_("key\v[double-click]") },
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ private:
|
|||
bool nodarkadjust;
|
||||
bool action_taken = false; // local menu resulted in action invoked (not cancel)
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
One<Bar> host_bar;
|
||||
bool ExecuteHostBar(Ctrl *owner, Point p);
|
||||
void CreateHostBar(One<Bar>& bar);
|
||||
|
|
@ -415,7 +415,7 @@ public:
|
|||
MenuBar& MaxIconSize(Size sz) { maxiconsize = sz; return *this; }
|
||||
Size GetMaxIconSize() const { return maxiconsize; }
|
||||
MenuBar& NoDarkAdjust(bool b = true) { nodarkadjust = b; return *this; }
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
MenuBar& UppMenu() { host_bar.Clear(); return *this; }
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "CtrlLib.h"
|
||||
#include "ChCocoMM.h"
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,13 @@
|
|||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#include <Carbon/Carbon.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#include <CtrlCore/CocoMM.h>
|
||||
#include "ChCocoMM.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
namespace Upp {
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
FileSelNative::FileSelNative()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ struct Win32PrintDlg_;
|
|||
|
||||
#ifndef PLATFORM_WINCE
|
||||
|
||||
#if defined(GUI_WIN) || defined(PLATFORM_X11) || defined(PLATFORM_COCOA)
|
||||
#ifndef VIRTUALGUI
|
||||
|
||||
class PrinterJob {
|
||||
#ifdef GUI_WIN
|
||||
|
|
|
|||
|
|
@ -398,7 +398,7 @@ Image GetFileIcon(const String& folder, const String& filename, bool isdir, bool
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
struct FileIconMaker : ImageMaker {
|
||||
String file;
|
||||
bool exe;
|
||||
|
|
@ -464,7 +464,7 @@ Image NativePathIcon0(const char *path, bool folder, bool large)
|
|||
#ifdef PLATFORM_POSIX
|
||||
String p = path;
|
||||
FindFile ff(path);
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
return GetFileIcon(path, folder, ff.GetMode() & 0111, large);
|
||||
#else
|
||||
bool isdrive = folder && ((p == "/media") || (p == "/mnt"));
|
||||
|
|
@ -529,7 +529,7 @@ bool Load(FileList& list, const String& dir, const char *patterns, bool dirs,
|
|||
filesystem.Find(AppendFileName(dir, filesystem.IsWin32() ? "*.*" : "*"));
|
||||
if(ffi.IsEmpty())
|
||||
return false;
|
||||
#if defined(PLATFORM_POSIX) && !defined(PLATFORM_COCOA)
|
||||
#if defined(PLATFORM_POSIX) && !defined(GUI_COCOA)
|
||||
bool isdrive = dir == "/media" || dir == "/mnt";
|
||||
#endif
|
||||
for(int t = 0; t < ffi.GetCount(); t++) {
|
||||
|
|
@ -549,7 +549,7 @@ bool Load(FileList& list, const String& dir, const char *patterns, bool dirs,
|
|||
MatchSearch(fi.filename, search) && show) {
|
||||
Image img;
|
||||
#ifdef PLATFORM_POSIX
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
img = GetFileIcon(AppendFileName(dir, fi.filename), fi.is_directory, fi.unix_mode & 0111, false, lazyicons);
|
||||
#else
|
||||
img = isdrive ? PosixGetDriveImage(fi.filename, false)
|
||||
|
|
@ -2178,7 +2178,7 @@ FileSel& FileSel::AddPlace(const String& path, const Image& m, const String& nam
|
|||
|
||||
FileSel& FileSel::AddPlace(const String& path, const String& name, const char* group, int row)
|
||||
{
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
return AddPlace(path, GetFileIcon(NormalizePath(path), true, false, false), name, group, row);
|
||||
#else
|
||||
return AddPlace(path, GetDirIcon(NormalizePath(path)), name, group, row);
|
||||
|
|
@ -2248,7 +2248,7 @@ void FileSel::AddSystemPlaces(int row)
|
|||
FileSel& FileSel::AddStandardPlaces()
|
||||
{
|
||||
AddPlace(GetHomeDirectory(), t_("Home"), "PLACES:FOLDER");
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
AddPlace(GetSpecialDirectory(SF_NSDesktopDirectory), t_("Desktop"), "PLACES:FOLDER");
|
||||
AddPlace(GetSpecialDirectory(SF_NSMusicDirectory), t_("Music"), "PLACES:FOLDER");
|
||||
AddPlace(GetSpecialDirectory(SF_NSPicturesDirectory), t_("Pictures"), "PLACES:FOLDER");
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
#ifndef flagSKELETON
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
#include <CtrlCore/CocoMM.h>
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
|
||||
#include <CtrlCore/CocoMM.h>
|
||||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ MenuBar::MenuBar()
|
|||
arealook = -1;
|
||||
maxiconsize = Null;
|
||||
nodarkadjust = false;
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
CreateHostBar(host_bar);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -124,7 +124,7 @@ void MenuBar::Clear()
|
|||
Bar::Item& MenuBar::AddItem(Event<> cb)
|
||||
{
|
||||
LLOG("MenuBar::AddItem " << Name());
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
if(host_bar && !IsChild())
|
||||
return host_bar->AddItem(cb);
|
||||
#endif
|
||||
|
|
@ -148,7 +148,7 @@ Bar::Item& MenuBar::AddItem(Event<> cb)
|
|||
Bar::Item& MenuBar::AddSubMenu(Event<Bar&> proc)
|
||||
{
|
||||
LLOG("MenuBar::AddSubMenu " << Name());
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
if(host_bar && !IsChild())
|
||||
return host_bar->AddSubMenu(proc);
|
||||
#endif
|
||||
|
|
@ -178,7 +178,7 @@ Bar::Item& MenuBar::AddSubMenu(Event<Bar&> proc)
|
|||
|
||||
void MenuBar::Separator()
|
||||
{
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
if(host_bar && !IsChild())
|
||||
return host_bar->Separator();
|
||||
#endif
|
||||
|
|
@ -604,7 +604,7 @@ void MenuBar::PopUp(Ctrl *owner, Point p, Size rsz)
|
|||
|
||||
bool MenuBar::IsEmpty() const
|
||||
{
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
if(host_bar && !IsChild())
|
||||
return host_bar->IsEmpty();
|
||||
#endif
|
||||
|
|
@ -619,7 +619,7 @@ bool MenuBar::Execute(Ctrl *owner, Point p)
|
|||
return false;
|
||||
ows.Add(owner);
|
||||
action_taken = false;
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
if(host_bar && !IsChild())
|
||||
action_taken = ExecuteHostBar(owner, p);
|
||||
else
|
||||
|
|
|
|||
|
|
@ -422,7 +422,7 @@ void SubMenuBase::Pull(Ctrl *item, Point p, Size sz)
|
|||
menu.KillDelayedClose();
|
||||
if(!item->IsOpen() || menu.IsOpen()) return;
|
||||
menu.Clear();
|
||||
#ifdef PLATFORM_COCOA
|
||||
#ifdef GUI_COCOA
|
||||
menu.UppMenu();
|
||||
#endif
|
||||
if(parentmenu)
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ PrinterJob& PrinterJob::CurrentPage(int i)
|
|||
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_X11) || defined(PLATFORM_COCOA)
|
||||
#if (defined(PLATFORM_X11) || defined(PLATFORM_COCOA)) && !defined(VIRTUALGUI)
|
||||
|
||||
struct PageSizeName {
|
||||
const char *name;
|
||||
|
|
|
|||
|
|
@ -107,11 +107,11 @@ class TopWindowFrame;
|
|||
#define GUIPLATFORM_TOPWINDOW_DECLS_INCLUDE <VirtualGui/Top.h>
|
||||
|
||||
class PrinterJob { // Dummy only...
|
||||
NilDraw nil;
|
||||
NilDraw nil_;
|
||||
Vector<int> pages;
|
||||
|
||||
public:
|
||||
Draw& GetDraw() { return nil; }
|
||||
Draw& GetDraw() { return nil_; }
|
||||
operator Draw&() { return GetDraw(); }
|
||||
const Vector<int>& GetPages() const { return pages; }
|
||||
int operator[](int i) const { return 0; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue