mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
CtrlCore: Developing Cocoa
git-svn-id: svn://ultimatepp.org/upp/trunk@12100 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d8aebeb694
commit
fce079d34b
24 changed files with 142 additions and 101 deletions
|
|
@ -36,8 +36,10 @@
|
|||
#elif __APPLE__
|
||||
// zvzv note
|
||||
// s/b MACOSX
|
||||
#ifndef COCO
|
||||
#ifdef flagX11
|
||||
#define PLATFORM_OSX11 1
|
||||
#else
|
||||
#define PLATFORM_COCOA 1
|
||||
#endif
|
||||
#define PLATFORM_BSD 1
|
||||
#define flagNOGTK
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
#define GUI_COCO
|
||||
|
||||
NAMESPACE_UPP
|
||||
namespace Upp {
|
||||
|
||||
struct RectCG;
|
||||
|
||||
|
|
@ -173,6 +171,6 @@ public:
|
|||
~PrinterJob() {}
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
};
|
||||
|
||||
#define GUIPLATFORM_INCLUDE_AFTER <CtrlCore/CocoAfter.h>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define LLOG(x) DLOG(x)
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ static NSEvent *GetNextEvent(NSDate *until)
|
|||
return current_event;
|
||||
}
|
||||
|
||||
void ReleaseCurrentEvent()
|
||||
static void ReleaseCurrentEvent()
|
||||
{
|
||||
if(current_event) {
|
||||
[current_event release];
|
||||
|
|
@ -48,6 +48,15 @@ void Upp::CocoInit(int argc, const char **argv, const char **envptr)
|
|||
[appMenu addItem:quitMenuItem];
|
||||
[appMenuItem setSubmenu:appMenu];
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
Font::SetDefaultFont(Arial(12)); // TODO: Read from NSFont!
|
||||
NSFont *sysfont = [NSFont systemFontOfSize:0];
|
||||
DDUMP(Upp::ToString((CFStringRef)[sysfont familyName]));
|
||||
DDUMP(Upp::ToString((CFStringRef)[sysfont displayName]));
|
||||
DDUMP(Upp::ToString((CFStringRef)[sysfont fontName]));
|
||||
DDUMP([sysfont pointSize]);
|
||||
Font::SetFace(0, Upp::ToString((CFStringRef)[sysfont familyName]), Font::TTF);
|
||||
Font::SetDefaultFont(StdFont(fround([sysfont pointSize]))); // TODO: Read from NSFont!
|
||||
}
|
||||
|
||||
void Upp::CocoExit()
|
||||
|
|
@ -75,8 +84,9 @@ bool Upp::Ctrl::ProcessEvent(bool *)
|
|||
if(!event)
|
||||
return false;
|
||||
|
||||
current_event = nil;
|
||||
[NSApp sendEvent:event];
|
||||
ReleaseCurrentEvent();
|
||||
[event release];
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
@ -86,7 +96,7 @@ void SweepMkImageCache();
|
|||
bool Upp::Ctrl::ProcessEvents(bool *quit)
|
||||
{
|
||||
if(ProcessEvent(quit)) {
|
||||
while(ProcessEvent(quit) && (!LoopCtrl || LoopCtrl->InLoop())); // LoopCtrl-MF 071008
|
||||
while(ProcessEvent(quit) && (!LoopCtrl || LoopCtrl->InLoop()));
|
||||
TimerProc(GetTickCount());
|
||||
AnimateCaret();
|
||||
[NSApp updateWindows];
|
||||
|
|
@ -121,7 +131,6 @@ void Upp::Ctrl::EventLoop(Ctrl *ctrl)
|
|||
SyncCaret();
|
||||
AnimateCaret();
|
||||
GuiSleep(20);
|
||||
DDUMP(GetTickCount());
|
||||
// if(EndSession()) break;
|
||||
// LLOG(GetSysTime() << " % " << (unsigned)msecs() % 10000 << ": EventLoop / ProcessEvents");
|
||||
ProcessEvents(&quit);
|
||||
|
|
@ -145,7 +154,6 @@ void Upp::Ctrl::AnimateCaret()
|
|||
GuiLock __;
|
||||
int v = !(((GetTickCount() - WndCaretTime) / 500) & 1);
|
||||
if(v != WndCaretVisible) {
|
||||
DDUMP(WndCaretVisible);
|
||||
WndCaretVisible = v;
|
||||
RefreshCaret();
|
||||
}
|
||||
|
|
@ -178,7 +186,7 @@ void Upp::Ctrl::SetCaret(int x, int y, int cx, int cy)
|
|||
|
||||
void Upp::Ctrl::SyncCaret() {
|
||||
GuiLock __;
|
||||
LLOG("SyncCaret");
|
||||
// LLOG("SyncCaret");
|
||||
if(focusCtrl != caretCtrl) {
|
||||
LLOG("SyncCaret DO " << Upp::Name(caretCtrl) << " -> " << Upp::Name(focusCtrl));
|
||||
RefreshCaret();
|
||||
|
|
@ -228,4 +236,35 @@ Upp::Rect Upp::Ctrl::GetPrimaryScreenArea()
|
|||
return Rect(0, 0, 1024, 768);
|
||||
}
|
||||
|
||||
bool Upp::Ctrl::IsCompositedGui()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Upp::Rect Upp::Ctrl::GetDefaultWindowRect()
|
||||
{
|
||||
GuiLock __;
|
||||
Rect r = GetPrimaryWorkArea();
|
||||
Size sz = r.GetSize();
|
||||
|
||||
static int pos = min(sz.cx / 10, 50);
|
||||
pos += 10;
|
||||
int cx = sz.cx * 2 / 3;
|
||||
int cy = sz.cy * 2 / 3;
|
||||
if(pos + cx + 50 > sz.cx || pos + cy + 50 > sz.cy)
|
||||
pos = 0;
|
||||
return RectC(r.left + pos + 20, r.top + pos + 20, cx, cy);
|
||||
}
|
||||
|
||||
void Upp::Ctrl::GuiPlatformGetTopRect(Rect& r) const
|
||||
{
|
||||
}
|
||||
|
||||
void Upp::MMCtrl::SyncRect(CocoView *view)
|
||||
{
|
||||
NSWindow *win = [view window];
|
||||
view->ctrl->SetWndRect(
|
||||
MakeRect([win contentRectForFrameRect: [win frame]], [[win screen] frame].size.height));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
#include <plugin/bmp/bmp.h>
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define LLOG(x)
|
||||
|
||||
|
|
@ -15,11 +15,7 @@
|
|||
}
|
||||
@end
|
||||
|
||||
void Upp::MMCtrl::SyncRect(CocoView *view)
|
||||
{
|
||||
NSWindow *win = [view window];
|
||||
view->ctrl->SetWndRect(MakeRect([win contentRectForFrameRect: [win frame]], 1000));
|
||||
}
|
||||
static Upp::Vector<Upp::Ptr<Upp::Ctrl>> mmtopctrl; // should work without Ptr, but let us be defensive....
|
||||
|
||||
void Upp::Ctrl::Create(dword style)
|
||||
{
|
||||
|
|
@ -47,17 +43,29 @@ void Upp::Ctrl::Create(dword style)
|
|||
top->coco->view = view;
|
||||
MMCtrl::SyncRect(view);
|
||||
isopen = true;
|
||||
mmtopctrl.Add(this);
|
||||
}
|
||||
|
||||
void Upp::Ctrl::WndDestroy()
|
||||
{
|
||||
// TODO: Destroy window...
|
||||
if(!top)
|
||||
return;
|
||||
[top->coco->window release];
|
||||
delete top->coco;
|
||||
delete top;
|
||||
top = NULL;
|
||||
isopen = false;
|
||||
int ii = FindIndex(mmtopctrl, this);
|
||||
if(ii >= 0)
|
||||
mmtopctrl.Remove(ii);
|
||||
}
|
||||
|
||||
Upp::Vector<Upp::Ctrl *> Upp::Ctrl::GetTopCtrls()
|
||||
{
|
||||
Vector<Ctrl *> h;
|
||||
for(Ctrl *p : mmtopctrl)
|
||||
if(p) h.Add(p);
|
||||
return h;
|
||||
}
|
||||
|
||||
void Upp::Ctrl::WndInvalidateRect(const Rect& r)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
|
||||
|
|
@ -26,10 +26,6 @@ void Ctrl::GuiPlatformRemove()
|
|||
{
|
||||
}
|
||||
|
||||
void Ctrl::GuiPlatformGetTopRect(Rect& r) const
|
||||
{
|
||||
}
|
||||
|
||||
bool Ctrl::GuiPlatformRefreshFrameSpecial(const Rect& r)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
void SystemDraw::Init(void *cgContext, int cy)
|
||||
{
|
||||
DDUMP(cgContext);
|
||||
handle = cgContext;
|
||||
top = cy;
|
||||
Push();
|
||||
|
|
@ -21,7 +20,6 @@ SystemDraw::SystemDraw(void *cgContext, int cy)
|
|||
|
||||
SystemDraw::~SystemDraw()
|
||||
{
|
||||
DLOG("~SystemDraw");
|
||||
Pop();
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +38,6 @@ dword SystemDraw::GetInfo() const
|
|||
|
||||
void SystemDraw::Push()
|
||||
{
|
||||
DDUMP(cgHandle);
|
||||
CGContextSaveGState(cgHandle);
|
||||
offset.Add(GetOffset());
|
||||
clip.Add(GetClip());
|
||||
|
|
@ -152,7 +149,6 @@ Rect SystemDraw::GetPaintRect() const
|
|||
|
||||
void SystemDraw::DrawRectOp(int x, int y, int cx, int cy, Color color)
|
||||
{
|
||||
DLOG("DrawRectOp");
|
||||
CGRect cgr = Convert(x, y, cx, cy);
|
||||
if(color == InvertColor()) {
|
||||
Set(White());
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define LLOG(x)
|
||||
#define LTIMING(x)
|
||||
|
|
@ -18,7 +18,8 @@ CTFontRef CT_Font(Font fnt)
|
|||
if(fnt.IsItalic())
|
||||
symbolicTraits |= kCTFontItalicTrait;
|
||||
CGAffineTransform transform = CGAffineTransformIdentity;
|
||||
return CTFontCreateCopyWithSymbolicTraits(ctfont0, 32, &transform, symbolicTraits, symbolicTraits);
|
||||
return CTFontCreateCopyWithSymbolicTraits(ctfont0, fnt.GetHeight(),
|
||||
&transform, symbolicTraits, symbolicTraits);
|
||||
}
|
||||
return ctfont0.Detach();
|
||||
}
|
||||
|
|
@ -85,6 +86,7 @@ GlyphInfo GetGlyphInfoSys(Font font, int chr)
|
|||
Vector<FaceInfo> GetAllFacesSys()
|
||||
{
|
||||
Index<String> facename;
|
||||
|
||||
facename.Add("Arial"); // TODO: This should be default GUI font
|
||||
facename.Add("Times New Roman");
|
||||
facename.Add("Arial");
|
||||
|
|
@ -109,7 +111,7 @@ Vector<FaceInfo> GetAllFacesSys()
|
|||
for(String s : facename) {
|
||||
FaceInfo& fi = r.Add();
|
||||
fi.name = s;
|
||||
fi.info = 0;
|
||||
fi.info = Font::TTF;
|
||||
}
|
||||
|
||||
return r;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define LLOG(x)
|
||||
|
||||
|
|
@ -35,7 +35,6 @@ void ImageSysData::Init(const Image& m)
|
|||
|
||||
ImageSysData::~ImageSysData()
|
||||
{
|
||||
DLOG("destruct");
|
||||
SysImageReleased(img);
|
||||
CGImageRelease(cgimg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
K_BACK = 53000,
|
||||
K_BACKSPACE,
|
||||
K_BACK = kVK_Delete|K_DELTA,
|
||||
K_BACKSPACE = K_BACK,
|
||||
|
||||
K_TAB = 9,
|
||||
K_TAB = kVK_Tab|K_DELTA,
|
||||
|
||||
K_SPACE = 32,
|
||||
K_SPACE = kVK_Space|K_DELTA,
|
||||
|
||||
K_RETURN = 13,
|
||||
K_RETURN = kVK_Return|K_DELTA,
|
||||
K_ENTER = K_RETURN,
|
||||
|
||||
K_SHIFT_KEY,
|
||||
|
|
@ -24,8 +24,8 @@ K_LEFT = kVK_LeftArrow|K_DELTA,
|
|||
K_UP = kVK_UpArrow|K_DELTA,
|
||||
K_RIGHT = kVK_RightArrow|K_DELTA,
|
||||
K_DOWN = kVK_DownArrow|K_DELTA,
|
||||
K_INSERT = 0, // kVK_Insert|K_DELTA, // TODO
|
||||
K_DELETE = kVK_Delete|K_DELTA,
|
||||
K_INSERT = 999999999, // kVK_Insert|K_DELTA, // TODO
|
||||
K_DELETE = kVK_ForwardDelete|K_DELTA,
|
||||
|
||||
K_NUMPAD0 = kVK_ANSI_Keypad0|K_DELTA,
|
||||
K_NUMPAD1 = kVK_ANSI_Keypad1|K_DELTA,
|
||||
|
|
@ -96,28 +96,28 @@ K_7 = kVK_ANSI_7|K_DELTA,
|
|||
K_8 = kVK_ANSI_8|K_DELTA,
|
||||
K_9 = kVK_ANSI_9|K_DELTA,
|
||||
|
||||
K_CTRL_LBRACKET,
|
||||
K_CTRL_RBRACKET,
|
||||
K_CTRL_MINUS,
|
||||
K_CTRL_GRAVE,
|
||||
K_CTRL_SLASH,
|
||||
K_CTRL_BACKSLASH,
|
||||
K_CTRL_COMMA,
|
||||
K_CTRL_PERIOD,
|
||||
K_CTRL_SEMICOLON,
|
||||
K_CTRL_EQUAL,
|
||||
K_CTRL_LBRACKET = kVK_ANSI_LeftBracket|K_DELTA|K_CTRL,
|
||||
K_CTRL_RBRACKET = kVK_ANSI_RightBracket|K_DELTA|K_CTRL,
|
||||
K_CTRL_MINUS = kVK_ANSI_Minus|K_DELTA|K_CTRL,
|
||||
K_CTRL_GRAVE = kVK_ANSI_Grave|K_DELTA|K_CTRL,
|
||||
K_CTRL_SLASH = kVK_ANSI_Slash|K_DELTA|K_CTRL,
|
||||
K_CTRL_BACKSLASH = kVK_ANSI_Backslash|K_DELTA|K_CTRL,
|
||||
K_CTRL_COMMA = kVK_ANSI_Comma|K_DELTA|K_CTRL,
|
||||
K_CTRL_PERIOD = kVK_ANSI_Period|K_DELTA|K_CTRL,
|
||||
K_CTRL_SEMICOLON = kVK_ANSI_Semicolon|K_DELTA|K_CTRL,
|
||||
K_CTRL_EQUAL = kVK_ANSI_Equal|K_DELTA|K_CTRL,
|
||||
K_CTRL_APOSTROPHE,
|
||||
|
||||
K_BREAK,
|
||||
|
||||
K_PLUS = 0, // not yet defined
|
||||
K_MINUS = 0, // not yet defined
|
||||
K_COMMA = 0, // not yet defined
|
||||
K_PERIOD = 0, // not yet defined
|
||||
K_SEMICOLON = 0, // not yet defined
|
||||
K_SLASH = 0, // not yet defined
|
||||
K_GRAVE = 0, // not yet defined
|
||||
K_LBRACKET = 0, // not yet defined
|
||||
K_BACKSLASH = 0, // not yet defined
|
||||
K_RBRACKET = 0, // not yet defined
|
||||
K_QUOTEDBL = 0, // not yet defined
|
||||
K_PLUS = 999999999,
|
||||
K_MINUS = kVK_ANSI_Minus|K_DELTA,
|
||||
K_COMMA = kVK_ANSI_Comma|K_DELTA,
|
||||
K_PERIOD = kVK_ANSI_Period|K_DELTA,
|
||||
K_SEMICOLON = kVK_ANSI_Semicolon|K_DELTA,
|
||||
K_SLASH = kVK_ANSI_Slash|K_DELTA,
|
||||
K_GRAVE = kVK_ANSI_Grave|K_DELTA,
|
||||
K_LBRACKET = kVK_ANSI_LeftBracket|K_DELTA,
|
||||
K_BACKSLASH = kVK_ANSI_Backslash|K_DELTA,
|
||||
K_RBRACKET = kVK_ANSI_RightBracket|K_DELTA,
|
||||
K_QUOTEDBL = 999999999,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
#ifndef _CtrlCore_CocoMM_h_
|
||||
#define _CtrlCore_CocoMM_h_
|
||||
|
||||
#ifdef flagCOCOA
|
||||
#include <Core/config.h>
|
||||
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define Point NS_Point
|
||||
#define Rect NS_Rect
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
#define LLOG(x)
|
||||
|
||||
|
|
@ -65,10 +65,10 @@ struct MMImp {
|
|||
if(GetOption()) // TODO
|
||||
k |= K_OPTION;
|
||||
ctrl->DispatchKey(k, 1);
|
||||
if(!up) {
|
||||
if(!up && !(k & (K_CTRL|K_ALT))) {
|
||||
WString x = ToWString((CFStringRef)(e.characters));
|
||||
for(wchar c : x)
|
||||
if(c < 0xF700)
|
||||
if(c < 0xF700 && c >= 32 && c != 127)
|
||||
ctrl->DispatchKey(c, 1);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "CocoMM.h"
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
namespace Upp {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include <CtrlCore/CtrlCore.h>
|
||||
|
||||
#ifdef GUI_COCO
|
||||
#ifdef PLATFORM_COCOA
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
|
|
@ -19,17 +19,6 @@ bool Ctrl::IsAlphaSupported()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool Ctrl::IsCompositedGui()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
Vector<Ctrl *> Ctrl::GetTopCtrls()
|
||||
{
|
||||
Vector<Ctrl *> h;
|
||||
return h;
|
||||
}
|
||||
|
||||
Ctrl *Ctrl::GetOwner()
|
||||
{
|
||||
GuiLock __;
|
||||
|
|
@ -172,10 +161,6 @@ void Ctrl::WndScrollView(const Rect& r, int dx, int dy)
|
|||
GuiLock __;
|
||||
}
|
||||
|
||||
Rect Ctrl::GetDefaultWindowRect() {
|
||||
return Rect(0, 0, 100, 100);
|
||||
}
|
||||
|
||||
ViewDraw::ViewDraw(Ctrl *ctrl)
|
||||
{
|
||||
EnterGuiMutex();
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#elif VIRTUALGUI
|
||||
#define GUIPLATFORM_KEYCODES_INCLUDE <VirtualGui/Keys.h>
|
||||
#define GUIPLATFORM_INCLUDE <VirtualGui/VirtualGui.h>
|
||||
#elif flagCOCOA
|
||||
#elif PLATFORM_COCOA
|
||||
#define GUIPLATFORM_INCLUDE "Coco.h"
|
||||
#elif PLATFORM_WIN32
|
||||
#define GUIPLATFORM_INCLUDE "Win32Gui.h"
|
||||
|
|
@ -96,7 +96,7 @@ enum {
|
|||
|
||||
K_SHIFT_CTRL = K_SHIFT|K_CTRL,
|
||||
|
||||
#ifdef flagCOCOA
|
||||
#ifdef PLATFORM_COCOA
|
||||
K_OPTION = 0x4000000,
|
||||
#endif
|
||||
};
|
||||
|
|
@ -111,7 +111,7 @@ bool GetMouseLeft();
|
|||
bool GetMouseRight();
|
||||
bool GetMouseMiddle();
|
||||
|
||||
#ifdef flagCOCOA
|
||||
#ifdef PLATFORM_COCOA
|
||||
bool GetOption();
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ library(POSIX !NOGTK !RAINBOW GUI !OSX11) notify;
|
|||
|
||||
library(DRAGONFLY) "Xext Xinerama";
|
||||
|
||||
link(MACOSX) " -framework Foundation -framework Cocoa";
|
||||
|
||||
file
|
||||
Core readonly separator,
|
||||
CtrlCore.h options(BUILDER_OPTION) PCH,
|
||||
|
|
|
|||
|
|
@ -372,17 +372,20 @@ String GetKeyDesc(dword key)
|
|||
if(key == 0)
|
||||
return desc;
|
||||
|
||||
DDUMPHEX(key);
|
||||
DDUMPHEX(K_DELETE);
|
||||
|
||||
if(key & K_KEYUP) desc << t_("key\vUP ");
|
||||
if(key & K_CTRL) desc << t_("key\vCtrl+");
|
||||
if(key & K_ALT) desc << t_("key\vAlt+");
|
||||
if(key & K_SHIFT) desc << t_("key\vShift+");
|
||||
#ifdef flagCOCOA
|
||||
#ifdef PLATFORM_COCOA
|
||||
if(key & K_OPTION) desc << t_("key\vOption+");
|
||||
#endif
|
||||
|
||||
|
||||
key &= ~(K_CTRL | K_ALT | K_SHIFT | K_KEYUP);
|
||||
#ifdef flagCOCOA
|
||||
#ifdef PLATFORM_COCOA
|
||||
key &= ~(K_OPTION);
|
||||
#endif
|
||||
if(key < K_DELTA && key > 32 && key != K_DELETE)
|
||||
|
|
@ -457,11 +460,14 @@ String GetKeyDesc(dword key)
|
|||
{ K_BACKSLASH, tt_("key\v[\\]") }, { K_RBRACKET, tt_("key\v[]]") }, { K_QUOTEDBL, tt_("key\v[']") },
|
||||
{ 0, NULL }
|
||||
};
|
||||
for(int i = 0; nkey[i].key; i++)
|
||||
for(int i = 0; nkey[i].key; i++) {
|
||||
DDUMPHEX(nkey[i].key);
|
||||
DDUMP(nkey[i].name);
|
||||
if(nkey[i].key == key) {
|
||||
desc << GetLngString(nkey[i].name);
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
desc << Format("%04x", (int)key);
|
||||
}
|
||||
return desc;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
sooner:
|
||||
- backspace and delete not working
|
||||
- implement standard cursors
|
||||
- minimize, maximaze
|
||||
- fullscreen
|
||||
- Open/OpenMain variants
|
||||
- Enter Up
|
||||
- missing cursors (add to iml)
|
||||
- LabelBox is wrong
|
||||
- initial focus
|
||||
- SerializePlacement
|
||||
|
||||
later:
|
||||
DrawDragRect
|
||||
- fullscreen
|
||||
- missing cursors (add to iml, use undocumented cursor)
|
||||
- X11 on option
|
||||
- PrinterJob
|
||||
- DrawDragRect
|
||||
- CT_Font caching
|
||||
|
|
@ -41,3 +43,6 @@ done:
|
|||
- caret
|
||||
- implement caret
|
||||
- workarea and window placement
|
||||
- implement standard cursors
|
||||
- backspace and delete not working
|
||||
- Enter Up
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "Draw.h"
|
||||
|
||||
#define LLOG(x) // DLOG(x)
|
||||
#define LLOG(x) DLOG(x)
|
||||
|
||||
namespace Upp {
|
||||
|
||||
|
|
@ -118,6 +118,7 @@ void Font::SyncStdFont()
|
|||
{
|
||||
Mutex::Lock __(sFontLock);
|
||||
StdFontSize = Size(AStdFont.GetAveWidth(), AStdFont().Bold().GetCy());
|
||||
LLOG("SyncStdFont " << StdFontSize);
|
||||
SyncUHDMode();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#define LLOG(x) // LOG(x)
|
||||
#define LTIMING(x) // TIMING(x)
|
||||
|
||||
#if !defined(CUSTOM_FONTSYS) && !defined(flagCOCOA)
|
||||
#if !defined(CUSTOM_FONTSYS) && !defined(PLATFORM_COCOA)
|
||||
|
||||
#ifdef PLATFORM_POSIX
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue