diff --git a/include/lgi/common/AudioView.h b/include/lgi/common/AudioView.h --- a/include/lgi/common/AudioView.h +++ b/include/lgi/common/AudioView.h @@ -1,1882 +1,1983 @@ /// Audio waveform display control #pragma once #include "lgi/common/Layout.h" #include "lgi/common/DisplayString.h" #include "lgi/common/Menu.h" #include "lgi/common/ClipBoard.h" #include "lgi/common/FileSelect.h" #include "lgi/common/Thread.h" #include "lgi/common/ThreadEvent.h" #include "lgi/common/DragAndDrop.h" #include "lgi/common/DropFiles.h" #include "ao.h" #define CC(code) LgiSwap32(code) #define ERROR_ZERO_SAMPLE_COUNT 10 struct int24_t { int32_t s : 24; }; union sample_t { int8_t *i8; int16_t *i16; int24_t *i24; int32_t *i32; float *f; sample_t(void *ptr = NULL) { *this = ptr; } sample_t &operator=(void *ptr) { i8 = (int8_t*)ptr; return *this; } }; template -struct Rect +struct AvRect { T x1 = 0, y1 = 0, x2 = 0, y2 = 0; - Rect &operator =(const LRect &r) + AvRect &operator =(const LRect &r) { x1 = r.x1; y1 = r.y1; x2 = r.x2; y2 = r.y2; return *this; } T X() { return x2 - x1 + 1; } T Y() { return y2 - y1 + 1; } bool Valid() { return x2 >= x1 && y2 >= y1; } operator LRect() { LRect r((int)x1, (int)y1, (int)x2, (int)y2); return r; } void ZOff(T sx, T sy) { x1 = y1 = 0; x2 = sx; y2 = sy; } const char *GetStr() { static char s[96]; sprintf_s(s, sizeof(s), LPrintfInt64 "," LPrintfInt64 "," LPrintfInt64 "," LPrintfInt64, x1, y1, x2, y2); return s; } - Rect &Offset(T x, T y) + AvRect &Offset(T x, T y) { x1 += x; x2 += x; y1 += y; y2 += y; return *this; } }; typedef int32_t (*ConvertFn)(sample_t &ptr); class LPopupNotification : public LWindow { constexpr static int Border = 10; // px constexpr static int ShowMs = 2300; // milliseconds LColour Back = LColour(0xf7, 0xf0, 0xd5); LColour Fore = LColour(0xd4, 0xb8, 0x62); LWindow *RefWnd = NULL; LArray Msgs; LPoint Decor = LPoint(2, 2); uint64_t HideTs = 0; LPoint CalcSize() { LPoint p; for (auto ds: Msgs) { p.x = MAX(p.x, ds->X()); p.y += ds->Y(); } p.x += Border * 2 + Decor.x; p.y += Border * 2 + Decor.y; return p; } public: static LPopupNotification *Inst() { - static LAutoPtr inst; + #warning "Fix LPopupNotification leak." + static LPopupNotification *inst = NULL; if (!inst) - inst.Reset(new LPopupNotification(NULL, NULL)); + inst = new LPopupNotification(NULL, NULL); return inst; } LPopupNotification(LWindow *ref, LString msg) { SetTitleBar(false); Name("Notification"); if (ref) RefWnd = ref; if (ref && msg) Add(ref, msg); } void Init() { if (!RefWnd) { LAssert(!"No reference window."); return; } auto r = RefWnd->GetPos(); auto Sz = CalcSize(); LRect pos; pos.ZOff(Sz.x - 1, Sz.y - 1); pos.Offset(r.x2 - pos.X(), r.y2 - pos.Y()); SetPos(pos); SetAlwaysOnTop(true); SetPulse(500); if (!IsAttached()) Attach(0); Visible(true); } void Add(LWindow *ref, LString msg) { if (msg) { HideTs = LCurrentTime(); Msgs.Add(new LDisplayString(GetFont(), msg)); } if (ref && RefWnd != ref) RefWnd = ref; if (RefWnd && Msgs.Length() > 0) Init(); } void OnPaint(LSurface *pDC) { pDC->Colour(Fore); auto c = GetClient(); pDC->Box(&c); c.Inset(1, 1); pDC->Colour(Back); pDC->Rectangle(&c); auto f = GetFont(); f->Fore(Fore); f->Back(Back); f->Transparent(true); int x = c.x1 + Border; int y = c.y1 + Border; for (auto ds: Msgs) { ds->Draw(pDC, x, y); y += ds->Y(); } } void OnPulse() { if (HideTs && LCurrentTime() >= HideTs + ShowMs) { HideTs = 0; Visible(false); SetPulse(); Msgs.DeleteObjects(); } } }; class LAudioView : public LLayout, public LThread, public LCancel, public LDragDropTarget { public: + constexpr static int DefaultBorder = 10; // px enum LFileType { AudioUnknown, AudioRaw, AudioWav, + AudioAif, }; enum LSampleType { AudioS8, AudioS16LE, AudioS16BE, AudioS24LE, AudioS24BE, AudioS32LE, AudioS32BE, AudioFloat32, }; enum Messages { M_WAVE_FORMS_FINISHED = M_USER + 100, M_SAVE_FINISHED, }; struct LBookmark { int x = 0; bool error = false; int64_t sample; LColour colour; }; protected: enum LCmds { IDC_COPY_CURSOR, IDC_LOAD_WAV, IDC_LOAD_RAW, IDC_SAVE_WAV, IDC_SAVE_RAW, IDC_DRAW_AUTO, IDC_DRAW_LINE, IDC_SCAN_SAMPLES, IDC_SCAN_GROUPS, IDC_44K, IDC_48K, IDC_88K, IDC_96K, IDC_MONO, IDC_STEREO, IDC_2pt1_CHANNELS, IDC_5pt1_CHANNELS, }; enum LDrawMode { DrawAutoSelect, DrawSamples, ScanSamples, ScanGroups, }; enum CtrlState { CtrlNormal, CtrlLoading, CtrlBuildingWaveforms, CtrlSaving, } State = CtrlNormal; LArray Audio; LFileType Type = AudioUnknown; LSampleType SampleType = AudioS16LE; - int SampleBits = 0; - int SampleRate = 0; - int Channels = 0; + uint32_t SampleBits = 0; + uint32_t SampleRate = 0; + uint32_t Channels = 0; size_t DataStart = 0; int64_t CursorSample = 0; - Rect Data; - LArray> ChData; + AvRect Data; + LArray> ChData; double XZoom = 1.0; LString Msg, ErrorMsg; LDrawMode DrawMode = DrawAutoSelect; LArray> Bookmarks; LString FilePath; template struct Grp { T Min = 0, Max = 0; }; LArray>> IntGrps; LArray>> FloatGrps; // Libao stuff int AoDriver = -1; bool AoPlaying = false; ao_device *AoDev = NULL; LThreadEvent AoEvent; void MouseToCursor(LMouse &m) { auto idx = ViewToSample(m.x); if (idx != CursorSample) { CursorSample = idx; UpdateMsg(); Invalidate(); } } template void SetData(T &r) { Data = r; ChData.Length(Channels); auto Dy = (int)Data.Y() - 1; for (int i=0; iMsg()) { case M_WAVE_FORMS_FINISHED: OnWaveFormsFinished(); break; } return LView::OnEvent(m); } - int WillAccept(LDragFormats &Formats, LPoint Pt, int KeyState) + int WillAccept(LDragFormats &Formats, LPoint Pt, int KeyState) override { Formats.SupportsFileDrops(); return DROPEFFECT_COPY; } - int OnDrop(LArray &Data, LPoint Pt, int KeyState) + int OnDrop(LArray &Data, LPoint Pt, int KeyState) override { for (auto &d : Data) { if (d.IsFileDrop()) { LDropFiles df(d); auto w = GetWindow(); if (w) { w->OnReceiveFiles(df); return DROPEFFECT_COPY; } } } return DROPEFFECT_NONE; - } + } bool Empty() { Audio.Free(); Type = AudioUnknown; SampleType = AudioS16LE; SampleRate = 0; SampleBits = 0; DataStart = 0; Channels = 0; CursorSample = 0; Data.ZOff(-1, -1); ChData.Empty(); Msg.Empty(); FilePath.Empty(); IntGrps.Empty(); Bookmarks.Empty(); if (AoPlaying) { AoPlaying = false; LSleep(50); } if (AoDev) { ao_close(AoDev); AoDev = NULL; } Invalidate(); return false; } + + bool ParseAif() + { + LPointer p; + p.s8 = Audio.AddressOf(); + auto end = p.s8 + Audio.Length(); + + #define IsAtom(atom) (LgiSwap32(Id) == atom) + + while (p.s8 < end) + { + auto Id = *p.u32++; + auto Sz = *p.u32++; Sz = LgiSwap32(Sz); + + // printf("Id='%4.4s' Sz=%i\n", &Id, Sz); + + if (IsAtom('FORM')) + { + Id = *p.u32++; + if (!IsAtom('AIFF')) + return false; + } + else if (IsAtom('COMT')) + { + p.u8 += Sz + (Sz % 2); + } + else if (IsAtom('CHAN')) + { + p.u8 += Sz + (Sz % 2); + } + else if (IsAtom('COMM')) + { + auto channels = *p.u16++; Channels = LgiSwap16(channels); + p.u32++; // long numSampleFrames + uint16_t bits = *p.u16++; SampleBits = LgiSwap16(bits); + + uint32_t exp = ((int)p.u8[0]<<8) + p.u8[1]; //first 16 bits + exp = exp - 0x3fff; + uint32_t man = ((int)p.u8[2] << 24) + + ((int)p.u8[3] << 16) + + ((int)p.u8[4] << 8) + + p.u8[5]; //bits 16..47 + SampleRate = (uint32_t) (man >> (0x1f - exp)); + p.s8 += 10; + + if (SampleBits == 16) + SampleType = AudioS16BE; + else if (SampleBits == 24) + SampleType = AudioS24BE; + else if (SampleBits == 32) + SampleType = AudioS32BE; + + printf("Channels=%i, Bits=%i, Rate=%i\n", + Channels, SampleBits, SampleRate); + } + else if (IsAtom('SSND')) + { + p.u32 += 2; + DataStart = p.s8 - Audio.AddressOf(); + // printf("DataStart=%i\n", (int)DataStart); + + return true; + } + else + { + printf("%s:%i - Unexpected atom '%4.4s'\n", _FL, &Id); + return false; + } + } + + return false; + } + + bool ParseWav() + { + // Parse the wave file... + LPointer p; + p.s8 = Audio.AddressOf(); + auto end = p.s8 + Audio.Length(); + + if (*p.u32++ != CC('RIFF')) + return Empty(); + auto ChunkSz = *p.u32++; + auto Fmt = *p.u32++; + + while (p.s8 < end) + { + auto SubChunkId = *p.u32++; + auto SubChunkSz = *p.u32++; + auto NextChunk = p.u8 + SubChunkSz; + + if (SubChunkId == CC('fmt ')) + { + auto AudioFmt = *p.u16++; + Channels = *p.u16++; + SampleRate = *p.u32++; + auto ByteRate = *p.u32++; + auto BlockAlign = *p.u16++; + SampleBits = *p.u16++; + + if (SampleBits == 16) + SampleType = AudioS16LE; + else if (SampleBits == 24) + SampleType = AudioS24LE; + else if (SampleBits == 32) + SampleType = AudioS32LE; + + printf("Channels=%i\n", Channels); + printf("SampleRate=%i\n", SampleRate); + printf("SampleBits=%i\n", SampleBits); + } + else if (SubChunkId == CC('data')) + { + DataStart = p.s8 - Audio.AddressOf(); + + printf("DataStart=" LPrintfSizeT "\n", DataStart); + break; + } + + p.u8 = NextChunk; + } + + if (!DataStart) + { + ErrorMsg = "No 'data' element found."; + LPopupNotification::Inst()->Add(GetWindow(), ErrorMsg); + return Empty(); + } + + return true; + } bool Load(const char *FileName, int rate = 0, int bitDepth = 0, int channels = 0) { LFile f(FileName, O_READ); if (!f.IsOpen()) { ErrorMsg.Printf("Can't open '%s' for reading.", FileName); return false; } Empty(); Msg.Printf("Loading '%s'...", FileName); LPopupNotification::Inst()->Add(GetWindow(), Msg); FilePath = FileName; if (!Audio.Length(f.GetSize())) { ErrorMsg.Printf("Can't allocate %s.", LFormatSize(f.GetSize()).Get()); return Empty(); } auto rd = f.Read(Audio.AddressOf(), f.GetSize()); if (rd > 0 && rd != f.GetSize()) Audio.Length(rd); auto Ext = LGetExtension(FileName); if (!Stricmp(Ext, "wav")) Type = AudioWav; + else if (!Stricmp(Ext, "aif")) + Type = AudioAif; else if (!Stricmp(Ext, "raw")) Type = AudioRaw; else { ErrorMsg.Printf("Unknown format: %s", Ext); LPopupNotification::Inst()->Add(GetWindow(), ErrorMsg); return Empty(); } if (rate) SampleRate = rate; DataStart = 0; SampleBits = bitDepth; Channels = channels; if (bitDepth == 16) { SampleType = AudioS16LE; } else if (bitDepth == 32) { SampleType = AudioS32LE; } else if (Type == AudioWav) { - // Parse the wave file... - LPointer p; - p.s8 = Audio.AddressOf(); - auto end = p.s8 + Audio.Length(); - - if (*p.u32++ != CC('RIFF')) - return Empty(); - auto ChunkSz = *p.u32++; - auto Fmt = *p.u32++; - - while (p.s8 < end) - { - auto SubChunkId = *p.u32++; - auto SubChunkSz = *p.u32++; - auto NextChunk = p.u8 + SubChunkSz; - - if (SubChunkId == CC('fmt ')) - { - auto AudioFmt = *p.u16++; - Channels = *p.u16++; - SampleRate = *p.u32++; - auto ByteRate = *p.u32++; - auto BlockAlign = *p.u16++; - SampleBits = *p.u16++; - - if (SampleBits == 16) - SampleType = AudioS16LE; - else if (SampleBits == 24) - SampleType = AudioS24LE; - else if (SampleBits == 32) - SampleType = AudioS32LE; - - printf("Channels=%i\n", Channels); - printf("SampleRate=%i\n", SampleRate); - printf("SampleBits=%i\n", SampleBits); - } - else if (SubChunkId == CC('data')) - { - DataStart = p.s8 - Audio.AddressOf(); - - printf("DataStart=" LPrintfSizeT "\n", DataStart); - break; - } - - p.u8 = NextChunk; - } - - if (!DataStart) - { - ErrorMsg = "No 'data' element found."; - LPopupNotification::Inst()->Add(GetWindow(), ErrorMsg); - return Empty(); - } + if (!ParseWav()) + return false; + } + else if (Type == AudioAif) + { + if (!ParseAif()) + return false; } else if (Type == AudioRaw) { // Assume 32bit SampleType = AudioS32LE; SampleBits = 32; } if (!SampleRate) SampleRate = 44100; if (!Channels) Channels = 2; Invalidate(); LPopupNotification::Inst()->Add(GetWindow(), "Loaded ok..."); return true; } private: struct SaveThread : public LThread { LAudioView *view; LString ErrorMsg; LString FileName; SaveThread(LAudioView *v, const char *filename) : LThread("SaveThread", v->AddDispatch()) { view = v; FileName = filename; LString Msg; Msg.Printf("Saving '%s'...", FileName.Get()); LPopupNotification::Inst()->Add(view->GetWindow(), Msg); Run(); } ~SaveThread() { WaitForExit(); } void OnComplete() { if (ErrorMsg) LPopupNotification::Inst()->Add(view->GetWindow(), ErrorMsg); else LPopupNotification::Inst()->Add(view->GetWindow(), "Saved ok."); view->State = CtrlNormal; view->Saving.Release(); // it doesn't own the ptr anymore DeleteOnExit = true; } int Main() { LFile f; if (!f.Open(FileName, O_WRITE)) { - ErrorMsg.Printf("Can't open '%s' for writing.", FileName); + ErrorMsg.Printf("Can't open '%s' for writing.", FileName.Get()); return -1; } f.SetSize(0); auto wr = f.Write(view->Audio.AddressOf(0), view->Audio.Length()); if (wr != view->Audio.Length()) { ErrorMsg.Printf("Write error: only wrote " LPrintfSizeT " of " LPrintfSizeT " bytes", wr, view->Audio.Length()); return -1; } return 0; } }; LAutoPtr Saving; void Save(const char *FileName = NULL) { if (!FileName) FileName = FilePath; if (!FileName) return; Saving.Reset(new SaveThread(this, FileName)); } LRect DefaultPos() { auto c = GetClient(); c.y1 += LSysFont->GetHeight(); - c.Inset(10, 10); + c.Inset(DefaultBorder, DefaultBorder); return c; } size_t GetSamples() { return (Audio.Length() - DataStart) / (SampleBits >> 3) / Channels; } int SampleToView(size_t idx) { return (int) (Data.x1 + ((idx * Data.X()) / GetSamples())); } size_t ViewToSample(int x /*px*/) { int64_t offset = (int64_t)x - (int64_t)Data.x1; int64_t samples = GetSamples(); int64_t dx = (int64_t)Data.x2 - (int64_t)Data.x1 + 1; double pos = (double) offset / dx; int64_t idx = (int64_t)(samples * pos); + #if 0 printf("ViewToSample(%i) data=%s offset=" LPrintfInt64 " samples=" LPrintfInt64 " idx=" LPrintfInt64 " pos=%f\n", x, Data.GetStr(), offset, samples, idx, pos); + #endif if (idx < 0) idx = 0; else if (idx >= samples) idx = samples - 1; return idx; } - void OnPosChange() + void OnPosChange() override { auto def = DefaultPos(); LRect d = Data; d.y1 = def.y1; d.y2 = def.y2; SetData(d); } #define CheckItem(Sub, Name, Id, Chk) \ { \ auto item = Sub->AppendItem(Name, Id); \ if (item && Chk) item->Checked(true); \ } - void OnMouseClick(LMouse &m) + void OnMouseClick(LMouse &m) override { if (m.IsContextMenu()) { LSubMenu s; s.AppendItem("Copy Cursor Address", IDC_COPY_CURSOR); s.AppendSeparator(); auto File = s.AppendSub("File"); File->AppendItem("Load Wav", IDC_LOAD_WAV); File->AppendItem("Load Raw", IDC_LOAD_RAW); File->AppendItem("Save Wav", IDC_SAVE_WAV); File->AppendItem("Save Raw", IDC_SAVE_RAW); auto Draw = s.AppendSub("Draw Mode"); CheckItem(Draw, "Auto", IDC_DRAW_AUTO, DrawMode == DrawAutoSelect); CheckItem(Draw, "Line", IDC_DRAW_LINE, DrawMode == DrawSamples); CheckItem(Draw, "Scan Samples", IDC_SCAN_SAMPLES, DrawMode == ScanSamples); CheckItem(Draw, "Scan Groups", IDC_SCAN_GROUPS, DrawMode == ScanGroups); auto Rate = s.AppendSub("Sample Rate"); CheckItem(Rate, "44.1k", IDC_44K, SampleRate == 44100); CheckItem(Rate, "48k", IDC_48K, SampleRate == 4800); CheckItem(Rate, "88.2k", IDC_88K, SampleRate == 44100*2); CheckItem(Rate, "96k", IDC_96K, SampleRate == 48000*2); auto Ch = s.AppendSub("Channels"); CheckItem(Ch, "Mono", IDC_MONO, Channels == 1); CheckItem(Ch, "Stereo", IDC_STEREO, Channels == 2); CheckItem(Ch, "2.1", IDC_2pt1_CHANNELS, Channels == 3); CheckItem(Ch, "5.1", IDC_5pt1_CHANNELS, Channels == 6); bool Update = false; switch (s.Float(this, m)) { case IDC_COPY_CURSOR: { LClipBoard clip(this); size_t addrVal = DataStart + (CursorSample * Channels * SampleBits / 8); LString addr; addr.Printf(LPrintfSizeT, addrVal); clip.Text(addr); break; } case IDC_SAVE_RAW: { auto s = new LFileSelect; s->Parent(this); s->Save([this](auto s, auto ok) { if (ok) { LFile out(s->Name(), O_WRITE); if (out) { out.SetSize(0); auto ptr = Audio.AddressOf(DataStart); out.Write(ptr, Audio.Length() - DataStart); } else LgiMsg(this, "Can't open '%s' for writing.", "Error", MB_OK, s->Name()); } delete s; }); break; } case IDC_DRAW_AUTO: DrawMode = DrawAutoSelect; Update = true; break; case IDC_DRAW_LINE: DrawMode = DrawSamples; Update = true; break; case IDC_SCAN_SAMPLES: DrawMode = ScanSamples; Update = true; break; case IDC_SCAN_GROUPS: DrawMode = ScanGroups; Update = true; break; case IDC_44K: SampleRate = 44100; Update = true; break; case IDC_48K: SampleRate = 48000; Update = true; break; case IDC_88K: SampleRate = 44100*2; Update = true; break; case IDC_96K: SampleRate = 48000*2; Update = true; break; case IDC_MONO: Channels = 1; Update = true; break; case IDC_STEREO: Channels = 2; Update = true; break; case IDC_2pt1_CHANNELS: Channels = 3; Update = true; break; case IDC_5pt1_CHANNELS: Channels = 6; Update = true; break; default: break; } if (Update) { IntGrps.Length(0); FloatGrps.Length(0); SetData(Data); Invalidate(); } } else if (m.Left()) { Focus(true); MouseToCursor(m); } } - void OnMouseMove(LMouse &m) + void OnMouseMove(LMouse &m) override { if (m.Down()) MouseToCursor(m); } - bool OnKey(LKey &k) + bool OnKey(LKey &k) override { // k.Trace("key"); if (k.IsChar) { switch (k.c16) { case 'f': case 'F': { if (k.Down()) FindErrors(); return true; } case 'r': case 'R': { if (k.Down()) RepairNext(); return true; } case 'a': case 'A': { if (k.Down()) RepairAll(); return true; } case ' ': { if (k.Down()) TogglePlay(); return true; } } } else if (k.Ctrl()) { if (k.c16 == 'S') { if (k.Down()) Save(); return true; } else if (k.c16 == 'W') { if (k.Down()) Empty(); return true; } } return false; } sample_t AddressOf(size_t Sample) { int SampleBytes = Channels * (SampleBits >> 3); return sample_t(Audio.AddressOf(DataStart + (Sample * SampleBytes))); } void RepairBookmark(int Channel, LBookmark &bm) { auto Convert = GetConvert(); auto end = Audio.AddressOf(Audio.Length()-1) + 1; int sampleBytes = SampleBits / 8; int skipBytes = (Channels - 1) * sampleBytes; int channelOffset = Channel * sampleBytes; // Look at previous sample... auto repairSample = bm.sample; auto p = AddressOf(repairSample - 1); p.i8 += channelOffset; auto lastGood = Convert(p); p.i8 += skipBytes; // Seek over and find the end... auto nextGood = Convert(p); p.i8 += skipBytes; while (nextGood) { nextGood = Convert(p); p.i8 += skipBytes; repairSample++; } auto endRepair = repairSample; while (nextGood == 0) { nextGood = Convert(p); p.i8 += skipBytes; endRepair++; } int64_t sampleDiff = nextGood - lastGood; int64_t repairSamples = endRepair - repairSample + 1; // Write the new interpolated samples for (int64_t i = repairSample; i < endRepair; i++) { p = AddressOf(i); p.i8 += channelOffset; if (p.i8 >= end) break; switch (SampleType) { case AudioS24LE: { auto off = i - repairSample + 1; p.i24->s = lastGood + (off * sampleDiff / repairSamples); break; } default: { LAssert(!"Impl me."); break; } } } bm.colour = LColour::Green; bm.error = false; } void RepairNext() { for (int ch = 0; ch < Channels; ch++) { int64_t prev = 0; LBookmark *Bookmark = NULL; for (auto &bm: Bookmarks[ch]) { if (bm.sample >= CursorSample && prev < CursorSample && bm.error) { Bookmark = &bm; break; } } if (Bookmark) RepairBookmark(ch, *Bookmark); } Invalidate(); } void RepairAll() { for (int ch = 0; ch < Bookmarks.Length(); ch++) for (auto &bm: Bookmarks[ch]) RepairBookmark(ch, bm); Invalidate(); } int64_t PtrToSample(sample_t &ptr) { int sampleBytes = SampleBits >> 3; auto start = Audio.AddressOf(DataStart); return (ptr.i8 - start) / (sampleBytes * Channels); } private: struct ErrorThread : public LThread { LAudioView *view; int64_t start, end; int channel; LArray bookmarks; ErrorThread(LAudioView *v, int64_t startSample, int64_t endSample, int ch) : LThread("ErrorThread", v->AddDispatch()) { view = v; start = startSample; end = endSample; channel = ch; Run(); } void OnComplete() { view->Bookmarks[channel].Add(bookmarks); view->Bookmarks[channel].Sort([](auto a, auto b) { return (int)(a->sample - b->sample); }); view->Invalidate(); LAssert(view->ErrorThreads.HasItem(this)); view->ErrorThreads.Delete(this); if (view->ErrorThreads.Length() == 0) LPopupNotification::Inst()->Add(view->GetWindow(), "Done."); DeleteOnExit = true; } int Main() { auto Convert = view->GetConvert(); int32_t prev = 0; int sampleBytes = view->SampleBits / 8; int byteInc = (view->Channels - 1) * sampleBytes; int64_t zeroRunStart = -1; auto ptr = view->AddressOf(0); auto pStart = ptr.i8 + (start * view->Channels * sampleBytes) + (channel * sampleBytes); auto pEnd = ptr.i8 + (end * view->Channels * sampleBytes) + (channel * sampleBytes); ptr.i8 = pStart; while (ptr.i8 < pEnd) { auto s = Convert(ptr); ptr.i8 += byteInc; auto diff = s - prev; if (diff < 0) diff = -diff; if (s == 0) { if (zeroRunStart < 0) zeroRunStart = view->PtrToSample(ptr) - 1; } else if (zeroRunStart >= 0) { auto cur = view->PtrToSample(ptr) - 1; auto len = cur - zeroRunStart; if (len >= ERROR_ZERO_SAMPLE_COUNT) { // emit book mark auto &bm = bookmarks.New(); bm.sample = zeroRunStart; bm.colour = LColour::Red; bm.error = true; #if 0 if (Bookmarks.Length() >= 10000) break; #endif } zeroRunStart = -1; } prev = s; } return 0; } }; LArray ErrorThreads; public: void FindErrors() { if (ErrorThreads.Length() > 0) { LPopupNotification::Inst()->Add(GetWindow(), "Already finding errors."); return; } LPopupNotification::Inst()->Add(GetWindow(), "Finding errors..."); Bookmarks.Length(Channels); auto samples = GetSamples(); auto threads = LAppInst->GetCpuCount(); auto threadsPerCh = threads / Channels; for (int ch=0; ch cli.x1) + d.Offset(cli.x1 - d.x1, 0); + else if (d.x2 < cli.x2) + d.Offset(cli.x2 - d.x2, 0); + SetData(d); Invalidate(); } else { auto Client = GetClient(); int change = (int)(Lines * -6); auto d = Data; d.x1 += change; d.x2 += change; if (d.x2 < Client.x1) d.Offset(-d.x2, 0); else if (d.x1 >= Client.x2) d.Offset(-(d.x2 - Client.x2), 0); SetData(d); Invalidate(); } UpdateMsg(); return true; } #define PROFILE_PAINT_SAMPLES 0 #if PROFILE_PAINT_SAMPLES #define PROF(name) Prof.Add(name) #else #define PROF(name) #endif ConvertFn GetConvert() { switch (SampleType) { case AudioS8: return [](sample_t &s) -> int32_t { return *s.i8++; }; case AudioS16LE: return [](sample_t &s) -> int32_t { return *s.i16++; }; case AudioS16BE: return [](sample_t &s) -> int32_t { int16_t i = LgiSwap16(*s.i16); s.i16++; return i; }; case AudioS24LE: return [](sample_t &s) -> int32_t { int32_t i = s.i24->s; s.i8 += 3; return i; }; case AudioS24BE: return [](sample_t &s) -> int32_t { int24_t i; int8_t *p = (int8_t*)&i; p[0] = s.i8[2]; p[1] = s.i8[1]; p[2] = s.i8[0]; s.i8 += 3; return i.s; }; case AudioS32LE: return [](sample_t &s) -> int32_t { return *s.i32++; }; case AudioS32BE: return [](sample_t &s) -> int32_t { int32_t i = *s.i32++; return LgiSwap32(i); }; + default: + LAssert(!"Not impl."); + break; } return NULL; } private: constexpr static int WaveformBlockSize = 256; struct WaveFormWork { ConvertFn convert; sample_t start; int8_t *end = NULL; int stepBytes = 0; int blkBytes = 0; size_t blocks = 0; Grp *out = NULL; }; LArray WaveFormTodo; LArray WaveFormThreads; struct WaveFormThread : public LThread, public LCancel { LAudioView *view; WaveFormThread(LAudioView *v) : LThread("WaveFormThread", v->AddDispatch()) { view = v; Run(); } ~WaveFormThread() { Cancel(); } void OnComplete() { // Clean up thread array... LThread *t = this; LAssert(view->WaveFormThreads.HasItem(t)); view->WaveFormThreads.Delete(t); DeleteOnExit = true; // Last one finished? if (view->WaveFormThreads.Length() == 0) view->PostEvent(M_WAVE_FORMS_FINISHED); } int Main() { while (!IsCancelled()) { WaveFormWork *w = NULL; if (view->Lock(_FL, 500)) { // Is there work? if (view->WaveFormTodo.Length() > 0) { w = view->WaveFormTodo[0]; view->WaveFormTodo.DeleteAt(0); } view->Unlock(); if (!w) return 0; } auto s = w->start; auto block = w->out; auto convert = w->convert; // For all blocks we're assigned... for (int b = 0; b < w->blocks && !IsCancelled(); b++, s.i8 += w->blkBytes, block++) { auto ptr = s; auto blkEnd = s.i8 + w->blkBytes; auto stepBytes = w->stepBytes; // For all samples in the block... block->Min = block->Max = convert(ptr); // init min/max with first sample while (ptr.i8 < blkEnd) { auto n = convert(ptr); if (n < block->Min) block->Min = n; if (n > block->Max) block->Max = n; ptr.i8 += stepBytes; } } } return 0; } }; public: void BuildWaveForms(LArray>> *Grps) { LPopupNotification::Inst()->Add(GetWindow(), "Building waveform data..."); State = CtrlBuildingWaveforms; auto SampleBytes = SampleBits / 8; auto start = Audio.AddressOf(DataStart); size_t samples = GetSamples(); - auto end = start + (SampleBytes * samples * Channels); + // auto end = start + (SampleBytes * samples * Channels); auto BlkBytes = WaveformBlockSize * Channels * SampleBytes; auto Blocks = ((Audio.Length() - DataStart) + BlkBytes - 1) / BlkBytes; int Threads = LAppInst->GetCpuCount(); // Initialize the graph Grps->Length(Channels); for (int ch = 0; ch < Channels; ch++) { auto &GraphArr = (*Grps)[ch]; GraphArr.Length(Blocks); for (int Thread = 0; Thread < Threads; Thread++) { auto from = Thread * Blocks / Threads; auto to = (Thread + 1) * Blocks / Threads; WaveFormWork *work = new WaveFormWork; work->convert = GetConvert(); work->start.i8 = start + (from * BlkBytes) + (ch * SampleBytes); work->end = start + (to * BlkBytes) + (ch * SampleBytes); work->stepBytes = (Channels - 1) * SampleBytes; work->blkBytes = BlkBytes; work->blocks = to - from; work->out = GraphArr.AddressOf(from); WaveFormTodo.Add(work); } } for (int Thread = 0; Thread < Threads; Thread++) WaveFormThreads.Add(new WaveFormThread(this)); } void OnWaveFormsFinished() { State = CtrlNormal; LPopupNotification::Inst()->Add(GetWindow(), "Done."); Invalidate(); } void PaintSamples(LSurface *pDC, int ChannelIdx, LArray>> *Grps) { #if PROFILE_PAINT_SAMPLES LProfile Prof("PaintSamples", 10); #endif int32_t MaxT = 0; ConvertFn Convert = GetConvert(); if (SampleBits == 8) MaxT = 0x7f; else if (SampleBits == 16) MaxT = 0x7fff; else if (SampleBits == 24) MaxT = 0x7fffff; else MaxT = 0x7fffffff; auto SampleBytes = SampleBits / 8; auto Client = GetClient(); auto &c = ChData[ChannelIdx]; auto start = Audio.AddressOf(DataStart); size_t samples = GetSamples(); // printf("samples=" LPrintfSizeT "\n", samples); - auto end = start + (SampleBytes * samples * Channels); + // auto end = start + (SampleBytes * samples * Channels); auto cy = c.y1 + (c.Y() / 2); pDC->Colour(cGrid); - pDC->Box(&(LRect)c); + LRect cr = c; + pDC->Box(&cr); if (Grps->Length() == 0) { BuildWaveForms(Grps); return; } else if (State != CtrlNormal) { return; } PROF("PrePaint"); auto YScale = c.Y() / 2; int CursorX = SampleToView(CursorSample); double blkScale = Grps->Length() > 0 ? (double) (*Grps)[0].Length() / c.X() : 1.0; // printf("blkScale=%f blks/px\n", blkScale); LDrawMode EffectiveMode = DrawMode; auto StartSample = ViewToSample(Client.x1); auto EndSample = ViewToSample(Client.x2); auto SampleRange = EndSample - StartSample; if (EffectiveMode == DrawAutoSelect) { if (SampleRange < Client.X() * 32) EffectiveMode = DrawSamples; else if (blkScale < 1.0) EffectiveMode = ScanSamples; else EffectiveMode = ScanGroups; } // This is the bytes in channels we're not looking at int byteInc = (Channels - 1) * SampleBytes; pDC->Colour(cGrid); pDC->HLine((int)MAX(0,c.x1), (int)MIN(pDC->X(),c.x2), (int)cy); // Setup for drawing bookmarks.. auto &BookmarkArr = Bookmarks[ChannelIdx]; for (auto &bm: BookmarkArr) bm.x = SampleToView(bm.sample); auto nextBookmark = BookmarkArr.Length() ? BookmarkArr.AddressOf(0) : NULL; auto endBookmark = BookmarkArr.Length() ? nextBookmark + BookmarkArr.Length() : NULL; if (EffectiveMode == DrawSamples) { sample_t pSample(start + (((StartSample * Channels) + ChannelIdx) * SampleBytes)); bool DrawDots = SampleRange < (Client.X() >> 2); if (CursorX >= Client.x1 && CursorX <= Client.x2) { pDC->Colour(L_BLACK); pDC->VLine(CursorX, (int)c.y1, (int)c.y2); } while ( nextBookmark && nextBookmark < endBookmark) { pDC->Colour(nextBookmark->colour); pDC->VLine(nextBookmark->x, (int)c.y1, (int)c.y2); nextBookmark++; } // For all samples in the view space... pDC->Colour(cMax); LPoint Prev(-1, -1); for (auto idx = StartSample; idx <= EndSample + 1; idx++, pSample.i8 += byteInc) { auto n = Convert(pSample); auto x = SampleToView(idx); auto y = (cy - ((int64_t)n * YScale / MaxT)); if (idx != StartSample) pDC->Line(Prev.x, Prev.y, (int)x, (int)y); Prev.Set((int)x, (int)y); if (DrawDots) pDC->Rectangle((int)x-1, (int)y-1, (int)x+1, (int)y+1); } } else { // For all x coordinates in the view space.. for (int Vx=Client.x1; Vx<=Client.x2; Vx++) { if (Vx % 100 == 0) { PROF("Pixels"); } if (Vx < c.x1 || Vx > c.x2) continue; if (nextBookmark && nextBookmark->x <= Vx) { while ( nextBookmark < endBookmark && nextBookmark->x <= Vx) { pDC->Colour(nextBookmark->colour); pDC->VLine(nextBookmark->x, (int)c.y1, (int)c.y2); nextBookmark++; } } auto isCursor = CursorX == Vx; if (isCursor) { pDC->Colour(L_BLACK); pDC->VLine(Vx, (int)c.y1, (int)c.y2); } Grp Min, Max; StartSample = ViewToSample(Vx); EndSample = ViewToSample(Vx+1); // printf("SampleIdx: " LPrintfSizeT "-" LPrintfSizeT "\n", StartSample, EndSample); if (EffectiveMode == ScanSamples) { // Scan individual samples sample_t pStart(start + ((StartSample * Channels + ChannelIdx) * SampleBytes)); auto pEnd = start + ((EndSample * Channels + ChannelIdx) * SampleBytes); #if 0 if (Vx==Client.x1) { auto PosX = SampleToView((pStart - ChannelIdx - start) / Channels); LgiTrace(" ptr=%i " LPrintfSizeT "-" LPrintfSizeT " x=%i pos=%i\n", (int)((char*)pStart-(char*)start), StartSample, EndSample, Vx, PosX); } #endif for (auto i = pStart; i.i8 < pEnd; i.i8 += byteInc) { auto n = Convert(i); Max.Min = MIN(Max.Min, n); Max.Max = MAX(Max.Max, n); } } else { // Scan the buckets auto &Graph = (*Grps)[ChannelIdx]; double blkStart = (double)StartSample * Graph.Length() / samples; double blkEnd = (double)EndSample * Graph.Length() / samples; /* if (Vx % 10 == 0) printf("BlkRange[%i]: %g-%g of:%i\n", Vx, blkStart, blkEnd, (int)Graph.Length()); */ #if 0 if (isCursor) LgiTrace("Blk %g-%g of " LPrintfSizeT "\n", blkStart, blkEnd, Graph.Length()); #endif auto iEnd = (int)ceil(blkEnd); int count = 0; for (int i=(int)floor(blkStart); iColour(isCursor ? cCursorMax : cMax); pDC->VLine(Vx, (int)y1, (int)y2); if (EffectiveMode == ScanGroups) { y1 = (cy - (Min.Max * YScale / MaxT)); y2 = (cy - (Min.Min * YScale / MaxT)); pDC->Colour(isCursor ? cCursorMin : cMin); pDC->VLine(Vx, (int)y1, (int)y2); } } } } - void OnPaint(LSurface *pDC) + void OnPaint(LSurface *pDC) override { #ifdef WINDOWS LDoubleBuffer DblBuf(pDC); #endif pDC->Colour(L_WORKSPACE); pDC->Rectangle(); auto Fnt = GetFont(); Fnt->Transparent(true); if (!FilePath) { LDisplayString ds(Fnt, Msg); Fnt->Fore(L_LOW); auto c = GetClient().Center(); ds.Draw(pDC, c.x - (ds.X()/2), c.y - (ds.Y()/2)); return; } if (!Data.Valid()) { auto r = DefaultPos(); SetData(r); } LDisplayString ds(Fnt, ErrorMsg ? ErrorMsg : Msg); Fnt->Fore(ErrorMsg ? LColour::Red : LColour(L_LOW)); ds.Draw(pDC, 4, 4); if (ErrorMsg) return; switch (SampleType) { case AudioS16LE: case AudioS16BE: { for (int ch = 0; ch < Channels; ch++) PaintSamples(pDC, ch, &IntGrps); break; } case AudioS24LE: case AudioS24BE: { for (int ch = 0; ch < Channels; ch++) PaintSamples(pDC, ch, &IntGrps); break; } case AudioS32LE: case AudioS32BE: { for (int ch = 0; ch < Channels; ch++) PaintSamples(pDC, ch, &IntGrps); break; } - case AudioFloat32: + default: { - /* - for (int ch = 0; ch < Channels; ch++) - PaintSamples(pDC, ch, &FloatGrps); - */ + LAssert(!"Not impl."); break; } } } void TogglePlay() { if (AoPlaying) { LgiTrace("stopping...\n"); AoPlaying = false; } else // Start playback { if (AoDriver < 0) { AoDriver = ao_default_driver_id(); } if (!AoDev) { ao_sample_format fmt; fmt.bits = SampleBits; fmt.rate = SampleRate; fmt.channels = Channels; fmt.byte_format = AO_FMT_LITTLE; fmt.matrix = NULL; AoDev = ao_open_live(AoDriver, &fmt, NULL); } if (AoDev) { AoPlaying = true; AoEvent.Signal(); } } } - int Main() + int Main() override { int TimeSlice = 50; // ms int sliceBytes = 0; int sliceSamples = 0; int64_t playStart = 0; int64_t playSample = 0; bool playedSamples = false; while (!IsCancelled()) { if (AoPlaying) { // Play one timeslice of audio auto addr = AddressOf(CursorSample); /* auto startTs = LMicroTime(); auto elapsedSamples = CursorSample - playSample; while ((LMicroTime() - playStart) < elapsedSamples) ; auto waitTs = LMicroTime() - startTs; */ ao_play(AoDev, (char*)addr.i8, sliceBytes); CursorSample += sliceSamples; playedSamples = true; /* #if 1 LgiTrace("wait %.3fms\n", (double)waitTs / 1000.0); #else auto now = LMicroTime(); auto elapsedTime = now - playStart; double ms = (double)elapsedTime/1000.0; elapsedSamples = CursorSample - playSample; double sms = (double)elapsedSamples * 1000.0 / SampleRate; LgiTrace("play ms=%.3f sms=%.3f\n", ms, sms); #endif */ } else { if (playedSamples) { playedSamples = false; LgiTrace("stopped.\n"); } AoEvent.Wait(100); if (AoPlaying) { sliceSamples = SampleRate * TimeSlice / 1000; sliceBytes = Channels * sliceSamples * (SampleBits / 8); playStart = LMicroTime(); playSample = CursorSample; } } } return 0; } bool UnitTests() { SampleType = AudioS16LE; auto c = GetConvert(); int16_t le16 = (2 << 8) | (1); sample_t ptr(&le16); auto out = c(ptr); if (out != 0x201) { LAssert(0); return false; } SampleType = AudioS16BE; c = GetConvert(); int16_t be16 = (1 << 8) | (2); ptr = &be16; out = c(ptr); if (out != 0x201) { LAssert(0); return false; } SampleType = AudioS24LE; c = GetConvert(); uint8_t le24[] = {1, 2, 3}; ptr = &le24; out = c(ptr); if (out != 0x30201) { LAssert(0); return false; } SampleType = AudioS24BE; c = GetConvert(); uint8_t be24[] = {3, 2, 1}; ptr = &be24; out = c(ptr); if (out != 0x30201) { LAssert(0); return false; } SampleType = AudioS32LE; c = GetConvert(); uint8_t le32[] = {1, 2, 3, 4}; ptr = &le32; out = c(ptr); if (out != 0x4030201) { LAssert(0); return false; } SampleType = AudioS32BE; c = GetConvert(); uint8_t be32[] = {4, 3, 2, 1}; ptr = &be32; out = c(ptr); if (out != 0x4030201) { LAssert(0); return false; } return true; } }; diff --git a/src/mac/cocoa/LgiCocoa.xcodeproj/project.pbxproj b/src/mac/cocoa/LgiCocoa.xcodeproj/project.pbxproj --- a/src/mac/cocoa/LgiCocoa.xcodeproj/project.pbxproj +++ b/src/mac/cocoa/LgiCocoa.xcodeproj/project.pbxproj @@ -1,1186 +1,1190 @@ // !$*UTF8*$! { archiveVersion = 1; classes = { }; objectVersion = 51; objects = { /* Begin PBXBuildFile section */ 340833152698F8FF0028012F /* FontPriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 340833122698F8FE0028012F /* FontPriv.h */; }; 340833162698F8FF0028012F /* FontType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 340833132698F8FE0028012F /* FontType.cpp */; }; 340833172698F8FF0028012F /* TypeFace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 340833142698F8FE0028012F /* TypeFace.cpp */; }; 3409C0CA27580ED60050302A /* ListItemRadioBtn.h in Headers */ = {isa = PBXBuildFile; fileRef = 3409C0C727580ED60050302A /* ListItemRadioBtn.h */; }; 3409C0CB27580ED60050302A /* List.h in Headers */ = {isa = PBXBuildFile; fileRef = 3409C0C827580ED60050302A /* List.h */; }; 3409C0CC27580ED60050302A /* ListItemCheckBox.h in Headers */ = {isa = PBXBuildFile; fileRef = 3409C0C927580ED60050302A /* ListItemCheckBox.h */; }; 3409C0D0275812CB0050302A /* Profile.h in Headers */ = {isa = PBXBuildFile; fileRef = 3409C0CF275812CB0050302A /* Profile.h */; }; 34109857217A9805007020CE /* LCocoaView.h in Sources */ = {isa = PBXBuildFile; fileRef = 34109856217A9805007020CE /* LCocoaView.h */; }; 34114C8B23091E6E00F342B1 /* LgiClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = 34114C8A23091E6E00F342B1 /* LgiClasses.h */; }; 3413170E23068FFE008CE982 /* FileSelect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3413170D23068FFE008CE982 /* FileSelect.cpp */; }; 34131710230694D1008CE982 /* Gel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3413170F230694D1008CE982 /* Gel.cpp */; }; 3415168F26EC32E7007EE35F /* TextView4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3415168E26EC32E7007EE35F /* TextView4.cpp */; }; 3415169326EC32FF007EE35F /* TextView3.h in Headers */ = {isa = PBXBuildFile; fileRef = 3415169126EC32FF007EE35F /* TextView3.h */; }; 3415169426EC32FF007EE35F /* TextView4.h in Headers */ = {isa = PBXBuildFile; fileRef = 3415169226EC32FF007EE35F /* TextView4.h */; }; 3418EBCF25D9FEA600EA168A /* Progress.h in Headers */ = {isa = PBXBuildFile; fileRef = 3418EBCE25D9FEA600EA168A /* Progress.h */; }; 3418EBD125D9FEF500EA168A /* ProgressDlg.h in Headers */ = {isa = PBXBuildFile; fileRef = 3418EBD025D9FEF500EA168A /* ProgressDlg.h */; }; 3427064727A0E20C0043F733 /* CocoaView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3427064627A0E20C0043F733 /* CocoaView.mm */; }; 343874B5230F46B200CF96B4 /* Window.h in Headers */ = {isa = PBXBuildFile; fileRef = 343874B1230F46B200CF96B4 /* Window.h */; }; 343874B6230F46B200CF96B4 /* View.h in Headers */ = {isa = PBXBuildFile; fileRef = 343874B2230F46B200CF96B4 /* View.h */; }; 343874B7230F46B200CF96B4 /* App.h in Headers */ = {isa = PBXBuildFile; fileRef = 343874B3230F46B200CF96B4 /* App.h */; }; 343874B8230F46B200CF96B4 /* Layout.h in Headers */ = {isa = PBXBuildFile; fileRef = 343874B4230F46B200CF96B4 /* Layout.h */; }; 343BE8C72355D0CE00742E21 /* PopupList.h in Headers */ = {isa = PBXBuildFile; fileRef = 343BE8C62355D0CE00742E21 /* PopupList.h */; }; 3449B8CE26BBF6B10022A9B8 /* Notifications.h in Headers */ = {isa = PBXBuildFile; fileRef = 3449B8CD26BBF6B10022A9B8 /* Notifications.h */; }; 344CFBC8237365B800AE6B35 /* ClipBoard.h in Headers */ = {isa = PBXBuildFile; fileRef = 344CFBC7237365B800AE6B35 /* ClipBoard.h */; }; 345920FF1F25649000098DFD /* Font.h in Headers */ = {isa = PBXBuildFile; fileRef = 345920FC1F25649000098DFD /* Font.h */; }; 345921001F25649000098DFD /* FontCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 345920FD1F25649000098DFD /* FontCache.h */; }; 345921011F25649000098DFD /* FontSelect.h in Headers */ = {isa = PBXBuildFile; fileRef = 345920FE1F25649000098DFD /* FontSelect.h */; }; 345EB84E235C6C01007D05DB /* Popup.h in Headers */ = {isa = PBXBuildFile; fileRef = 345EB84D235C6C01007D05DB /* Popup.h */; }; 346DDEC1240C882900751380 /* RadioGroup.h in Headers */ = {isa = PBXBuildFile; fileRef = 346DDEC0240C882900751380 /* RadioGroup.h */; }; 346FACE71D3C720B00FFEBCE /* Message.h in Headers */ = {isa = PBXBuildFile; fileRef = 346FACE61D3C720B00FFEBCE /* Message.h */; }; 346FACEB1D3C75AE00FFEBCE /* Uri.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 346FACE91D3C75AE00FFEBCE /* Uri.cpp */; }; 346FACEC1D3C75AE00FFEBCE /* MDStringToDigest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 346FACEA1D3C75AE00FFEBCE /* MDStringToDigest.cpp */; }; 3471868823A9AF8900F8C952 /* SubProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3471868723A9AF8900F8C952 /* SubProcess.cpp */; }; 3477C2751CBF07DD0028B84B /* App.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2741CBF07DD0028B84B /* App.mm */; }; 3477C2781CBF08050028B84B /* ClipBoard.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2761CBF08050028B84B /* ClipBoard.mm */; }; 3477C2821CBF086A0028B84B /* General.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C27A1CBF086A0028B84B /* General.mm */; }; 3477C2831CBF086A0028B84B /* Layout.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C27B1CBF086A0028B84B /* Layout.mm */; }; 3477C2841CBF086A0028B84B /* Menu.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C27C1CBF086A0028B84B /* Menu.mm */; }; 3477C2851CBF086A0028B84B /* Printer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C27D1CBF086A0028B84B /* Printer.mm */; }; 3477C2861CBF086A0028B84B /* Thread.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C27E1CBF086A0028B84B /* Thread.mm */; }; 3477C2871CBF086A0028B84B /* View.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C27F1CBF086A0028B84B /* View.mm */; }; 3477C2881CBF086A0028B84B /* Widgets.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2801CBF086A0028B84B /* Widgets.mm */; }; 3477C2891CBF086A0028B84B /* Window.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2811CBF086A0028B84B /* Window.mm */; }; 3477C28F1CBF08C10028B84B /* Gdc2.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C28B1CBF08C10028B84B /* Gdc2.mm */; }; 3477C2901CBF08C10028B84B /* MemDC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C28C1CBF08C10028B84B /* MemDC.cpp */; }; 3477C2911CBF08C10028B84B /* PrintDC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C28D1CBF08C10028B84B /* PrintDC.cpp */; }; 3477C2921CBF08C10028B84B /* ScreenDC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C28E1CBF08C10028B84B /* ScreenDC.cpp */; }; 3477C2971CBF09320028B84B /* File.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2941CBF09320028B84B /* File.mm */; }; 3477C2981CBF09320028B84B /* Mem.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2951CBF09320028B84B /* Mem.mm */; }; 3477C2991CBF09320028B84B /* ShowFileProp_Mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2961CBF09320028B84B /* ShowFileProp_Mac.mm */; }; 3477C2A11CBF0A920028B84B /* Mem.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C29B1CBF0A920028B84B /* Mem.h */; }; 3477C2A21CBF0A920028B84B /* SymLookup.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C29C1CBF0A920028B84B /* SymLookup.h */; }; 3477C2A31CBF0A920028B84B /* LgiMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C29D1CBF0A920028B84B /* LgiMac.h */; }; 3477C2A41CBF0A920028B84B /* LgiOs.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C29E1CBF0A920028B84B /* LgiOs.h */; }; 3477C2A51CBF0A920028B84B /* LgiOsClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C29F1CBF0A920028B84B /* LgiOsClasses.h */; }; 3477C2A61CBF0A920028B84B /* LgiOsDefs.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C2A01CBF0A920028B84B /* LgiOsDefs.h */; }; 3477C2A81CBF0AAF0028B84B /* Lgi.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C2A71CBF0AAF0028B84B /* Lgi.h */; }; 3477C2AA1CBF22A00028B84B /* File.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C2A91CBF22A00028B84B /* File.h */; }; 3477C2AC1CBF72170028B84B /* ViewPriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C2AB1CBF72170028B84B /* ViewPriv.h */; }; 3477C2AF1CBF96B90028B84B /* LgiRes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2AE1CBF96B90028B84B /* LgiRes.cpp */; }; 3477C2B11CBF96C40028B84B /* Res.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2B01CBF96C40028B84B /* Res.cpp */; }; 3477C2B41CBF96F20028B84B /* LMsg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2B31CBF96F20028B84B /* LMsg.cpp */; }; 3477C2B71CBF973F0028B84B /* GuiUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2B61CBF973F0028B84B /* GuiUtils.cpp */; }; 3477C2B91CBF977F0028B84B /* LgiCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2B81CBF977F0028B84B /* LgiCommon.cpp */; }; 3477C2BB1CBF97C80028B84B /* GdcCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2BA1CBF97C80028B84B /* GdcCommon.cpp */; }; 3477C2C11CBF9A040028B84B /* String.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2C01CBF9A040028B84B /* String.cpp */; }; 3477C2C81CC046310028B84B /* TextView3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2C41CC046310028B84B /* TextView3.cpp */; }; 3477C2C91CC046310028B84B /* Unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2C51CC046310028B84B /* Unicode.cpp */; }; 3477C2CA1CC046310028B84B /* Utf8.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2C61CC046310028B84B /* Utf8.cpp */; }; 3477C2CB1CC046310028B84B /* XmlTree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2C71CC046310028B84B /* XmlTree.cpp */; }; 3477C2CE1CC047BE0028B84B /* Charset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2CD1CC047BE0028B84B /* Charset.cpp */; }; 3477C2D01CC047F50028B84B /* ToolBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2CF1CC047F50028B84B /* ToolBar.cpp */; }; 3477C2D31CC048100028B84B /* Containers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2D21CC048100028B84B /* Containers.cpp */; }; 3477C2D51CC0481B0028B84B /* Array.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C2D41CC0481B0028B84B /* Array.h */; }; 3477C2D71CC048390028B84B /* Popup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2D61CC048390028B84B /* Popup.cpp */; }; 3477C2DB1CC048F90028B84B /* DisplayString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2D81CC048F90028B84B /* DisplayString.cpp */; }; 3477C2DC1CC048F90028B84B /* Font.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2D91CC048F90028B84B /* Font.cpp */; }; 3477C2DD1CC048F90028B84B /* FontSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2DA1CC048F90028B84B /* FontSystem.cpp */; }; 3477C2DF1CC04A030028B84B /* ScrollBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2DE1CC04A030028B84B /* ScrollBar.cpp */; }; 3477C2E11CC04A3C0028B84B /* FontSelect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2E01CC04A3C0028B84B /* FontSelect.cpp */; }; 3477C2E31CC04A5C0028B84B /* Stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2E21CC04A5C0028B84B /* Stream.cpp */; }; 3477C2E51CC04A7F0028B84B /* ViewCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2E41CC04A7F0028B84B /* ViewCommon.cpp */; }; 3477C2E71CC04B1E0028B84B /* Surface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2E61CC04B1E0028B84B /* Surface.cpp */; }; 3477C2E91CC04B5D0028B84B /* Rand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2E81CC04B5D0028B84B /* Rand.cpp */; }; 3477C2EB1CC04B890028B84B /* Filter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2EA1CC04B890028B84B /* Filter.cpp */; }; 3477C2EF1CC04BBB0028B84B /* ItemContainer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2EC1CC04BBB0028B84B /* ItemContainer.cpp */; }; 3477C2F01CC04BBB0028B84B /* List.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2ED1CC04BBB0028B84B /* List.cpp */; }; 3477C2F11CC04BBB0028B84B /* Tree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2EE1CC04BBB0028B84B /* Tree.cpp */; }; 3477C2FF1CC04BF00028B84B /* Bitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F21CC04BF00028B84B /* Bitmap.cpp */; }; 3477C3001CC04BF00028B84B /* Box.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F31CC04BF00028B84B /* Box.cpp */; }; 3477C3011CC04BF00028B84B /* Button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F41CC04BF00028B84B /* Button.cpp */; }; 3477C3021CC04BF00028B84B /* CheckBox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F51CC04BF00028B84B /* CheckBox.cpp */; }; 3477C3031CC04BF00028B84B /* Combo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F61CC04BF00028B84B /* Combo.cpp */; }; 3477C3041CC04BF00028B84B /* Edit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F71CC04BF00028B84B /* Edit.cpp */; }; 3477C3051CC04BF00028B84B /* Panel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F81CC04BF00028B84B /* Panel.cpp */; }; 3477C3061CC04BF00028B84B /* Progress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2F91CC04BF00028B84B /* Progress.cpp */; }; 3477C3071CC04BF00028B84B /* RadioGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2FA1CC04BF00028B84B /* RadioGroup.cpp */; }; 3477C3081CC04BF00028B84B /* Splitter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2FB1CC04BF00028B84B /* Splitter.cpp */; }; 3477C3091CC04BF00028B84B /* TableLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2FC1CC04BF00028B84B /* TableLayout.cpp */; }; 3477C30A1CC04BF00028B84B /* TabView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2FD1CC04BF00028B84B /* TabView.cpp */; }; 3477C30B1CC04BF00028B84B /* TextLabel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C2FE1CC04BF00028B84B /* TextLabel.cpp */; }; 3477C30D1CC04C560028B84B /* FindReplace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C30C1CC04C560028B84B /* FindReplace.cpp */; }; 3477C3101CC04C790028B84B /* Css.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C30E1CC04C790028B84B /* Css.cpp */; }; 3477C3111CC04C790028B84B /* CssTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C30F1CC04C790028B84B /* CssTools.cpp */; }; 3477C3131CC04CB10028B84B /* Rect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3121CC04CB10028B84B /* Rect.cpp */; }; 3477C3161CC04CCB0028B84B /* Library.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3151CC04CCB0028B84B /* Library.cpp */; }; 3477C3191CC04CF10028B84B /* ThreadCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3181CC04CF10028B84B /* ThreadCommon.cpp */; }; 3477C31D1CC04D3F0028B84B /* Net.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C31B1CC04D3F0028B84B /* Net.cpp */; }; 3477C31E1CC04D3F0028B84B /* NetTools.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C31C1CC04D3F0028B84B /* NetTools.cpp */; }; 3477C3201CC04D630028B84B /* ThreadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C31F1CC04D630028B84B /* ThreadEvent.cpp */; }; 3477C3221CC04DA00028B84B /* Colour.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3211CC04DA00028B84B /* Colour.cpp */; }; 3477C3241CC04DD70028B84B /* Object.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3231CC04DD70028B84B /* Object.cpp */; }; 3477C3261CC04DE20028B84B /* Mutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3251CC04DE20028B84B /* Mutex.cpp */; }; 3477C3281CC04E020028B84B /* Variant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3271CC04E020028B84B /* Variant.cpp */; }; 3477C3311CC04E120028B84B /* 8Bit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3291CC04E120028B84B /* 8Bit.cpp */; }; 3477C3321CC04E120028B84B /* 64Bit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C32A1CC04E120028B84B /* 64Bit.cpp */; }; 3477C3331CC04E120028B84B /* 16Bit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C32B1CC04E120028B84B /* 16Bit.cpp */; }; 3477C3341CC04E120028B84B /* 24Bit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C32C1CC04E120028B84B /* 24Bit.cpp */; }; 3477C3351CC04E120028B84B /* 32Bit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C32D1CC04E120028B84B /* 32Bit.cpp */; }; 3477C3361CC04E120028B84B /* 48Bit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C32E1CC04E120028B84B /* 48Bit.cpp */; }; 3477C3381CC04E120028B84B /* Alpha.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3301CC04E120028B84B /* Alpha.cpp */; }; 3477C33A1CC04ED90028B84B /* DragAndDrop.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3391CC04ED90028B84B /* DragAndDrop.mm */; }; 3477C33D1CC088590028B84B /* FileCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C33C1CC088590028B84B /* FileCommon.cpp */; }; 3477C33F1CC0A6780028B84B /* Token.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C33E1CC0A6780028B84B /* Token.cpp */; }; 3477C3411CC0A68E0028B84B /* DateTime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3401CC0A68E0028B84B /* DateTime.cpp */; }; 3477C3431CC0A6B90028B84B /* DocView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3421CC0A6B90028B84B /* DocView.cpp */; }; 3477C3451CC0A9DE0028B84B /* Input.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3441CC0A9DE0028B84B /* Input.cpp */; }; 3477C3471CC0AA220028B84B /* WindowCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3461CC0AA220028B84B /* WindowCommon.cpp */; }; 3477C3491CC0AA7E0028B84B /* ProgressDlg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C3481CC0AA7E0028B84B /* ProgressDlg.cpp */; }; 3477C34B1CC0AB0B0028B84B /* ToolTip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C34A1CC0AB0B0028B84B /* ToolTip.cpp */; }; 3477C34D1CC0ACED0028B84B /* md5.c in Sources */ = {isa = PBXBuildFile; fileRef = 3477C34C1CC0ACED0028B84B /* md5.c */; }; 3477C3501CC0C3D60028B84B /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3477C34F1CC0C3D60028B84B /* Cocoa.framework */; }; 3477C35B1CC1AEEA0028B84B /* LgiInc.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C35A1CC1AEEA0028B84B /* LgiInc.h */; }; 3477C35D1CC2253E0028B84B /* LgiInterfaces.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C35C1CC2253E0028B84B /* LgiInterfaces.h */; }; 3477C43A1CC234750028B84B /* MemStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C4391CC234750028B84B /* MemStream.cpp */; }; 3477C46D1CC26DEB0028B84B /* Alert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C46C1CC26DEB0028B84B /* Alert.cpp */; }; 3477C4ED1CC27F1C0028B84B /* TrayIcon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3477C4EC1CC27F1C0028B84B /* TrayIcon.cpp */; }; 3477C5171CC303B70028B84B /* LgiUiBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 3477C5161CC303B70028B84B /* LgiUiBase.h */; }; 347AFB9827A0DC5E00BE4ABE /* 15Bit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 347AFB9727A0DC5E00BE4ABE /* 15Bit.cpp */; }; 348362421F233A77003B2A6D /* Stream.h in Headers */ = {isa = PBXBuildFile; fileRef = 348362411F233A77003B2A6D /* Stream.h */; }; 34837C4925C677ED00D103B4 /* AppPriv.h in Headers */ = {isa = PBXBuildFile; fileRef = 34837C4825C677ED00D103B4 /* AppPriv.h */; }; 348CD46A25C63E56001AA32B /* AppCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 348CD46925C63E56001AA32B /* AppCommon.cpp */; }; 348E99CE2876850F0067E92A /* ObjCWrapper.h in Headers */ = {isa = PBXBuildFile; fileRef = 348E99CD2876850F0067E92A /* ObjCWrapper.h */; }; 3491A28523678DB800604C29 /* DropFiles.h in Headers */ = {isa = PBXBuildFile; fileRef = 3491A28423678DB700604C29 /* DropFiles.h */; }; 34A3ACE820568D5800B1D62A /* StringLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34A3ACE720568D5800B1D62A /* StringLayout.cpp */; }; 34A3ACEA20568D9700B1D62A /* MenuCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34A3ACE920568D9700B1D62A /* MenuCommon.cpp */; }; 34B14E3426951C6E004C22CC /* Slider.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34B14E3326951C6E004C22CC /* Slider.cpp */; }; 34B531D822F65734002B50F7 /* Menu.h in Headers */ = {isa = PBXBuildFile; fileRef = 34B531D722F65734002B50F7 /* Menu.h */; }; 34B6B19123CFD0F100C24906 /* DragAndDropCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34B6B19023CFD0F100C24906 /* DragAndDropCommon.cpp */; }; 34BF15072871503B001B4CA5 /* DrawListSurface.h in Headers */ = {isa = PBXBuildFile; fileRef = 34BF15062871503B001B4CA5 /* DrawListSurface.h */; }; 34C072C12369878100E1E222 /* DropFiles.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34C072C02369878100E1E222 /* DropFiles.cpp */; }; 34C81A5A25DA0AA10053F93A /* Base64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34C81A5925DA0AA10053F93A /* Base64.cpp */; }; 34CD9F7223D5768B0039F259 /* Unicode.h in Headers */ = {isa = PBXBuildFile; fileRef = 34CD9F7123D5768B0039F259 /* Unicode.h */; }; 34D1B3C121748A2800BC6B58 /* Path.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 34D1B3C021748A2800BC6B58 /* Path.cpp */; }; 34D21CEC217981AE003D1EA6 /* EventTargetThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D21CEB217981AE003D1EA6 /* EventTargetThread.h */; }; 34D28926275B3D9F005961A8 /* DateTime.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D28925275B3D9F005961A8 /* DateTime.h */; }; 34D28929275B3DB0005961A8 /* Variant.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D28928275B3DB0005961A8 /* Variant.h */; }; 34D6AA1722D3749A005D739E /* Gdc2.h in Headers */ = {isa = PBXBuildFile; fileRef = 34D6AA1622D3749A005D739E /* Gdc2.h */; }; 34EE8BB12748A55600F12915 /* TextFile.h in Headers */ = {isa = PBXBuildFile; fileRef = 34EE8BB02748A55600F12915 /* TextFile.h */; }; + 34F3EC4329BD374E00BB9B58 /* Rect.h in Headers */ = {isa = PBXBuildFile; fileRef = 34F3EC4229BD374E00BB9B58 /* Rect.h */; }; 34F6151F27E55C5D00FE5B0C /* Thread.h in Headers */ = {isa = PBXBuildFile; fileRef = 34F6151D27E55C5D00FE5B0C /* Thread.h */; }; 34F6152027E55C5D00FE5B0C /* ThreadEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 34F6151E27E55C5D00FE5B0C /* ThreadEvent.h */; }; 34F6153E27E5628600FE5B0C /* Token.h in Headers */ = {isa = PBXBuildFile; fileRef = 34F6153D27E5628600FE5B0C /* Token.h */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ 340833122698F8FE0028012F /* FontPriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontPriv.h; path = ../../../private/common/FontPriv.h; sourceTree = SOURCE_ROOT; }; 340833132698F8FE0028012F /* FontType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontType.cpp; path = ../../common/Gdc2/Font/FontType.cpp; sourceTree = SOURCE_ROOT; }; 340833142698F8FE0028012F /* TypeFace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeFace.cpp; path = ../../common/Gdc2/Font/TypeFace.cpp; sourceTree = SOURCE_ROOT; }; 3409C0C727580ED60050302A /* ListItemRadioBtn.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ListItemRadioBtn.h; path = ../../../include/lgi/common/ListItemRadioBtn.h; sourceTree = SOURCE_ROOT; }; 3409C0C827580ED60050302A /* List.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = List.h; path = ../../../include/lgi/common/List.h; sourceTree = SOURCE_ROOT; }; 3409C0C927580ED60050302A /* ListItemCheckBox.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ListItemCheckBox.h; path = ../../../include/lgi/common/ListItemCheckBox.h; sourceTree = SOURCE_ROOT; }; 3409C0CF275812CB0050302A /* Profile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Profile.h; path = ../../../include/lgi/common/Profile.h; sourceTree = ""; }; 34109853217A975E007020CE /* View.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = View.h; path = ../../../include/lgi/common/View.h; sourceTree = SOURCE_ROOT; }; 34109856217A9805007020CE /* LCocoaView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LCocoaView.h; path = ../../../include/lgi/mac/cocoa/LCocoaView.h; sourceTree = SOURCE_ROOT; }; 34114C8A23091E6E00F342B1 /* LgiClasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiClasses.h; path = ../../../include/lgi/common/LgiClasses.h; sourceTree = ""; }; 3413170D23068FFE008CE982 /* FileSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSelect.cpp; path = ../../common/Lgi/FileSelect.cpp; sourceTree = SOURCE_ROOT; }; 3413170F230694D1008CE982 /* Gel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Gel.cpp; path = ../../common/Skins/Gel/Gel.cpp; sourceTree = SOURCE_ROOT; }; 3415168E26EC32E7007EE35F /* TextView4.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextView4.cpp; path = ../../common/Text/TextView4.cpp; sourceTree = SOURCE_ROOT; }; 3415169126EC32FF007EE35F /* TextView3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextView3.h; path = ../../../include/lgi/common/TextView3.h; sourceTree = SOURCE_ROOT; }; 3415169226EC32FF007EE35F /* TextView4.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextView4.h; path = ../../../include/lgi/common/TextView4.h; sourceTree = SOURCE_ROOT; }; 3418EBCE25D9FEA600EA168A /* Progress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Progress.h; path = ../../../include/lgi/common/Progress.h; sourceTree = ""; }; 3418EBD025D9FEF500EA168A /* ProgressDlg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ProgressDlg.h; path = ../../../include/lgi/common/ProgressDlg.h; sourceTree = ""; }; 3427064627A0E20C0043F733 /* CocoaView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CocoaView.mm; sourceTree = SOURCE_ROOT; }; 343874B1230F46B200CF96B4 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Window.h; path = ../../../include/lgi/common/Window.h; sourceTree = SOURCE_ROOT; }; 343874B2230F46B200CF96B4 /* View.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = View.h; path = ../../../include/lgi/common/View.h; sourceTree = ""; }; 343874B3230F46B200CF96B4 /* App.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = App.h; path = ../../../include/lgi/common/App.h; sourceTree = SOURCE_ROOT; }; 343874B4230F46B200CF96B4 /* Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Layout.h; path = ../../../include/lgi/common/Layout.h; sourceTree = ""; }; 343BE8C62355D0CE00742E21 /* PopupList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PopupList.h; path = ../../../include/lgi/common/PopupList.h; sourceTree = ""; }; 3449B8CD26BBF6B10022A9B8 /* Notifications.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Notifications.h; path = ../../../include/lgi/common/Notifications.h; sourceTree = ""; }; 344CFBC7237365B800AE6B35 /* ClipBoard.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClipBoard.h; path = ../../../include/lgi/common/ClipBoard.h; sourceTree = ""; }; 345920FC1F25649000098DFD /* Font.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Font.h; path = ../../../include/lgi/common/Font.h; sourceTree = SOURCE_ROOT; }; 345920FD1F25649000098DFD /* FontCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontCache.h; path = ../../../include/lgi/common/FontCache.h; sourceTree = SOURCE_ROOT; }; 345920FE1F25649000098DFD /* FontSelect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FontSelect.h; path = ../../../include/lgi/common/FontSelect.h; sourceTree = SOURCE_ROOT; }; 345EB84D235C6C01007D05DB /* Popup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Popup.h; path = ../../../include/lgi/common/Popup.h; sourceTree = SOURCE_ROOT; }; 346DDEC0240C882900751380 /* RadioGroup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RadioGroup.h; path = ../../../include/lgi/common/RadioGroup.h; sourceTree = SOURCE_ROOT; }; 346FACE61D3C720B00FFEBCE /* Message.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Message.h; path = ../../../include/lgi/common/Message.h; sourceTree = ""; }; 346FACE91D3C75AE00FFEBCE /* Uri.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Uri.cpp; path = ../../common/Net/Uri.cpp; sourceTree = SOURCE_ROOT; }; 346FACEA1D3C75AE00FFEBCE /* MDStringToDigest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MDStringToDigest.cpp; path = ../../common/Net/MDStringToDigest.cpp; sourceTree = SOURCE_ROOT; }; 3471868723A9AF8900F8C952 /* SubProcess.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = SubProcess.cpp; path = ../../common/Lgi/SubProcess.cpp; sourceTree = SOURCE_ROOT; }; 3477C2681CBF020F0028B84B /* LgiCocoa.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LgiCocoa.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3477C26D1CBF020F0028B84B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; 3477C2741CBF07DD0028B84B /* App.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = App.mm; sourceTree = SOURCE_ROOT; }; 3477C2761CBF08050028B84B /* ClipBoard.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ClipBoard.mm; sourceTree = SOURCE_ROOT; }; 3477C27A1CBF086A0028B84B /* General.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = General.mm; sourceTree = SOURCE_ROOT; }; 3477C27B1CBF086A0028B84B /* Layout.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Layout.mm; sourceTree = SOURCE_ROOT; }; 3477C27C1CBF086A0028B84B /* Menu.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Menu.mm; sourceTree = SOURCE_ROOT; }; 3477C27D1CBF086A0028B84B /* Printer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Printer.mm; sourceTree = SOURCE_ROOT; }; 3477C27E1CBF086A0028B84B /* Thread.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Thread.mm; sourceTree = SOURCE_ROOT; }; 3477C27F1CBF086A0028B84B /* View.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = View.mm; sourceTree = SOURCE_ROOT; }; 3477C2801CBF086A0028B84B /* Widgets.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Widgets.mm; sourceTree = SOURCE_ROOT; }; 3477C2811CBF086A0028B84B /* Window.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Window.mm; sourceTree = SOURCE_ROOT; }; 3477C28B1CBF08C10028B84B /* Gdc2.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Gdc2.mm; sourceTree = SOURCE_ROOT; }; 3477C28C1CBF08C10028B84B /* MemDC.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = MemDC.cpp; path = ../common/MemDC.cpp; sourceTree = SOURCE_ROOT; }; 3477C28D1CBF08C10028B84B /* PrintDC.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = PrintDC.cpp; path = ../common/PrintDC.cpp; sourceTree = SOURCE_ROOT; }; 3477C28E1CBF08C10028B84B /* ScreenDC.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = ScreenDC.cpp; path = ../common/ScreenDC.cpp; sourceTree = SOURCE_ROOT; }; 3477C2941CBF09320028B84B /* File.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = File.mm; sourceTree = SOURCE_ROOT; }; 3477C2951CBF09320028B84B /* Mem.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = Mem.mm; sourceTree = SOURCE_ROOT; }; 3477C2961CBF09320028B84B /* ShowFileProp_Mac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ShowFileProp_Mac.mm; sourceTree = SOURCE_ROOT; }; 3477C29B1CBF0A920028B84B /* Mem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mem.h; path = ../../../include/lgi/common/Mem.h; sourceTree = ""; }; 3477C29C1CBF0A920028B84B /* SymLookup.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymLookup.h; path = ../../../include/lgi/mac/cocoa/SymLookup.h; sourceTree = ""; }; 3477C29D1CBF0A920028B84B /* LgiMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiMac.h; path = ../../../include/lgi/mac/cocoa/LgiMac.h; sourceTree = ""; }; 3477C29E1CBF0A920028B84B /* LgiOs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiOs.h; path = ../../../include/lgi/mac/cocoa/LgiOs.h; sourceTree = ""; }; 3477C29F1CBF0A920028B84B /* LgiOsClasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiOsClasses.h; path = ../../../include/lgi/mac/cocoa/LgiOsClasses.h; sourceTree = ""; }; 3477C2A01CBF0A920028B84B /* LgiOsDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiOsDefs.h; path = ../../../include/lgi/mac/cocoa/LgiOsDefs.h; sourceTree = ""; }; 3477C2A71CBF0AAF0028B84B /* Lgi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Lgi.h; path = ../../../include/lgi/common/Lgi.h; sourceTree = ""; }; 3477C2A91CBF22A00028B84B /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = ../../../include/lgi/common/File.h; sourceTree = SOURCE_ROOT; }; 3477C2AB1CBF72170028B84B /* ViewPriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ViewPriv.h; path = ../../../private/common/ViewPriv.h; sourceTree = SOURCE_ROOT; }; 3477C2AE1CBF96B90028B84B /* LgiRes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LgiRes.cpp; path = ../../common/Resource/LgiRes.cpp; sourceTree = SOURCE_ROOT; }; 3477C2B01CBF96C40028B84B /* Res.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Res.cpp; path = ../../common/Resource/Res.cpp; sourceTree = SOURCE_ROOT; }; 3477C2B31CBF96F20028B84B /* LMsg.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = LMsg.cpp; path = ../../common/Lgi/LMsg.cpp; sourceTree = SOURCE_ROOT; }; 3477C2B61CBF973F0028B84B /* GuiUtils.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = GuiUtils.cpp; path = ../../common/Lgi/GuiUtils.cpp; sourceTree = SOURCE_ROOT; }; 3477C2B81CBF977F0028B84B /* LgiCommon.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = LgiCommon.cpp; path = ../../common/Lgi/LgiCommon.cpp; sourceTree = SOURCE_ROOT; }; 3477C2BA1CBF97C80028B84B /* GdcCommon.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = GdcCommon.cpp; path = ../../common/Gdc2/GdcCommon.cpp; sourceTree = SOURCE_ROOT; }; 3477C2C01CBF9A040028B84B /* String.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = String.cpp; path = ../../common/Text/String.cpp; sourceTree = SOURCE_ROOT; }; 3477C2C41CC046310028B84B /* TextView3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextView3.cpp; path = ../../common/Text/TextView3.cpp; sourceTree = SOURCE_ROOT; }; 3477C2C51CC046310028B84B /* Unicode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Unicode.cpp; path = ../../common/Text/Unicode.cpp; sourceTree = SOURCE_ROOT; }; 3477C2C61CC046310028B84B /* Utf8.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Utf8.cpp; path = ../../common/Text/Utf8.cpp; sourceTree = SOURCE_ROOT; }; 3477C2C71CC046310028B84B /* XmlTree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XmlTree.cpp; path = ../../common/Text/XmlTree.cpp; sourceTree = SOURCE_ROOT; }; 3477C2CD1CC047BE0028B84B /* Charset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Charset.cpp; path = ../../common/Gdc2/Font/Charset.cpp; sourceTree = SOURCE_ROOT; }; 3477C2CF1CC047F50028B84B /* ToolBar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolBar.cpp; path = ../../common/Widgets/ToolBar.cpp; sourceTree = SOURCE_ROOT; }; 3477C2D21CC048100028B84B /* Containers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Containers.cpp; path = ../../common/General/Containers.cpp; sourceTree = SOURCE_ROOT; }; 3477C2D41CC0481B0028B84B /* Array.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Array.h; path = ../../../include/lgi/common/Array.h; sourceTree = SOURCE_ROOT; }; 3477C2D61CC048390028B84B /* Popup.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp.preprocessed; fileEncoding = 4; name = Popup.cpp; path = ../../common/Widgets/Popup.cpp; sourceTree = SOURCE_ROOT; }; 3477C2D81CC048F90028B84B /* DisplayString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DisplayString.cpp; path = ../../common/Gdc2/Font/DisplayString.cpp; sourceTree = SOURCE_ROOT; }; 3477C2D91CC048F90028B84B /* Font.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Font.cpp; path = ../../common/Gdc2/Font/Font.cpp; sourceTree = SOURCE_ROOT; }; 3477C2DA1CC048F90028B84B /* FontSystem.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = FontSystem.cpp; path = ../../common/Gdc2/Font/FontSystem.cpp; sourceTree = SOURCE_ROOT; }; 3477C2DE1CC04A030028B84B /* ScrollBar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScrollBar.cpp; path = ../../common/Widgets/ScrollBar.cpp; sourceTree = SOURCE_ROOT; }; 3477C2E01CC04A3C0028B84B /* FontSelect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FontSelect.cpp; path = ../../common/Lgi/FontSelect.cpp; sourceTree = SOURCE_ROOT; }; 3477C2E21CC04A5C0028B84B /* Stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Stream.cpp; path = ../../common/Lgi/Stream.cpp; sourceTree = SOURCE_ROOT; }; 3477C2E41CC04A7F0028B84B /* ViewCommon.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = ViewCommon.cpp; path = ../../common/Lgi/ViewCommon.cpp; sourceTree = SOURCE_ROOT; }; 3477C2E61CC04B1E0028B84B /* Surface.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Surface.cpp; path = ../../common/Gdc2/Surface.cpp; sourceTree = SOURCE_ROOT; }; 3477C2E81CC04B5D0028B84B /* Rand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rand.cpp; path = ../../common/Lgi/Rand.cpp; sourceTree = SOURCE_ROOT; }; 3477C2EA1CC04B890028B84B /* Filter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Filter.cpp; path = ../../common/Gdc2/Filters/Filter.cpp; sourceTree = SOURCE_ROOT; }; 3477C2EC1CC04BBB0028B84B /* ItemContainer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ItemContainer.cpp; path = ../../common/Widgets/ItemContainer.cpp; sourceTree = SOURCE_ROOT; }; 3477C2ED1CC04BBB0028B84B /* List.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = List.cpp; path = ../../common/Widgets/List.cpp; sourceTree = SOURCE_ROOT; }; 3477C2EE1CC04BBB0028B84B /* Tree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Tree.cpp; path = ../../common/Widgets/Tree.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F21CC04BF00028B84B /* Bitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Bitmap.cpp; path = ../../common/Widgets/Bitmap.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F31CC04BF00028B84B /* Box.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Box.cpp; path = ../../common/Widgets/Box.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F41CC04BF00028B84B /* Button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Button.cpp; path = ../../common/Widgets/Button.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F51CC04BF00028B84B /* CheckBox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CheckBox.cpp; path = ../../common/Widgets/CheckBox.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F61CC04BF00028B84B /* Combo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Combo.cpp; path = ../../common/Widgets/Combo.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F71CC04BF00028B84B /* Edit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Edit.cpp; path = ../../common/Widgets/Edit.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F81CC04BF00028B84B /* Panel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Panel.cpp; path = ../../common/Widgets/Panel.cpp; sourceTree = SOURCE_ROOT; }; 3477C2F91CC04BF00028B84B /* Progress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Progress.cpp; path = ../../common/Widgets/Progress.cpp; sourceTree = SOURCE_ROOT; }; 3477C2FA1CC04BF00028B84B /* RadioGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RadioGroup.cpp; path = ../../common/Widgets/RadioGroup.cpp; sourceTree = SOURCE_ROOT; }; 3477C2FB1CC04BF00028B84B /* Splitter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Splitter.cpp; path = ../../common/Widgets/Splitter.cpp; sourceTree = SOURCE_ROOT; }; 3477C2FC1CC04BF00028B84B /* TableLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TableLayout.cpp; path = ../../common/Widgets/TableLayout.cpp; sourceTree = SOURCE_ROOT; }; 3477C2FD1CC04BF00028B84B /* TabView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TabView.cpp; path = ../../common/Widgets/TabView.cpp; sourceTree = SOURCE_ROOT; }; 3477C2FE1CC04BF00028B84B /* TextLabel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextLabel.cpp; path = ../../common/Widgets/TextLabel.cpp; sourceTree = SOURCE_ROOT; }; 3477C30C1CC04C560028B84B /* FindReplace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FindReplace.cpp; path = ../../common/Lgi/FindReplace.cpp; sourceTree = SOURCE_ROOT; }; 3477C30E1CC04C790028B84B /* Css.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Css.cpp; path = ../../common/Lgi/Css.cpp; sourceTree = SOURCE_ROOT; }; 3477C30F1CC04C790028B84B /* CssTools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CssTools.cpp; path = ../../common/Lgi/CssTools.cpp; sourceTree = SOURCE_ROOT; }; 3477C3121CC04CB10028B84B /* Rect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Rect.cpp; path = ../../common/Gdc2/Rect.cpp; sourceTree = SOURCE_ROOT; }; 3477C3151CC04CCB0028B84B /* Library.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Library.cpp; path = ../../common/Lgi/Library.cpp; sourceTree = SOURCE_ROOT; }; 3477C3181CC04CF10028B84B /* ThreadCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadCommon.cpp; path = ../../common/Lgi/ThreadCommon.cpp; sourceTree = SOURCE_ROOT; }; 3477C31B1CC04D3F0028B84B /* Net.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Net.cpp; path = ../../common/Net/Net.cpp; sourceTree = SOURCE_ROOT; }; 3477C31C1CC04D3F0028B84B /* NetTools.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetTools.cpp; path = ../../common/Net/NetTools.cpp; sourceTree = SOURCE_ROOT; }; 3477C31F1CC04D630028B84B /* ThreadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadEvent.cpp; path = ../../common/Lgi/ThreadEvent.cpp; sourceTree = SOURCE_ROOT; }; 3477C3211CC04DA00028B84B /* Colour.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Colour.cpp; path = ../../common/Gdc2/Colour.cpp; sourceTree = SOURCE_ROOT; }; 3477C3231CC04DD70028B84B /* Object.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Object.cpp; path = ../../common/Lgi/Object.cpp; sourceTree = SOURCE_ROOT; }; 3477C3251CC04DE20028B84B /* Mutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Mutex.cpp; path = ../../common/Lgi/Mutex.cpp; sourceTree = SOURCE_ROOT; }; 3477C3271CC04E020028B84B /* Variant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Variant.cpp; path = ../../common/Lgi/Variant.cpp; sourceTree = SOURCE_ROOT; }; 3477C3291CC04E120028B84B /* 8Bit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 8Bit.cpp; path = ../../common/Gdc2/8Bit.cpp; sourceTree = SOURCE_ROOT; }; 3477C32A1CC04E120028B84B /* 64Bit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 64Bit.cpp; path = ../../common/Gdc2/64Bit.cpp; sourceTree = SOURCE_ROOT; }; 3477C32B1CC04E120028B84B /* 16Bit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 16Bit.cpp; path = ../../common/Gdc2/16Bit.cpp; sourceTree = SOURCE_ROOT; }; 3477C32C1CC04E120028B84B /* 24Bit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 24Bit.cpp; path = ../../common/Gdc2/24Bit.cpp; sourceTree = SOURCE_ROOT; }; 3477C32D1CC04E120028B84B /* 32Bit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 32Bit.cpp; path = ../../common/Gdc2/32Bit.cpp; sourceTree = SOURCE_ROOT; }; 3477C32E1CC04E120028B84B /* 48Bit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 48Bit.cpp; path = ../../common/Gdc2/48Bit.cpp; sourceTree = SOURCE_ROOT; }; 3477C3301CC04E120028B84B /* Alpha.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Alpha.cpp; path = ../../common/Gdc2/Alpha.cpp; sourceTree = SOURCE_ROOT; }; 3477C3391CC04ED90028B84B /* DragAndDrop.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; path = DragAndDrop.mm; sourceTree = SOURCE_ROOT; }; 3477C33C1CC088590028B84B /* FileCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileCommon.cpp; path = ../../common/General/FileCommon.cpp; sourceTree = SOURCE_ROOT; }; 3477C33E1CC0A6780028B84B /* Token.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Token.cpp; path = ../../common/Text/Token.cpp; sourceTree = SOURCE_ROOT; }; 3477C3401CC0A68E0028B84B /* DateTime.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = DateTime.cpp; path = ../../common/General/DateTime.cpp; sourceTree = SOURCE_ROOT; }; 3477C3421CC0A6B90028B84B /* DocView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DocView.cpp; path = ../../common/Text/DocView.cpp; sourceTree = SOURCE_ROOT; }; 3477C3441CC0A9DE0028B84B /* Input.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Input.cpp; path = ../../common/Lgi/Input.cpp; sourceTree = SOURCE_ROOT; }; 3477C3461CC0AA220028B84B /* WindowCommon.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = WindowCommon.cpp; path = ../../common/Lgi/WindowCommon.cpp; sourceTree = SOURCE_ROOT; }; 3477C3481CC0AA7E0028B84B /* ProgressDlg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProgressDlg.cpp; path = ../../common/Widgets/ProgressDlg.cpp; sourceTree = SOURCE_ROOT; }; 3477C34A1CC0AB0B0028B84B /* ToolTip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ToolTip.cpp; path = ../../common/Lgi/ToolTip.cpp; sourceTree = SOURCE_ROOT; }; 3477C34C1CC0ACED0028B84B /* md5.c */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; name = md5.c; path = ../../common/Hash/md5/md5.c; sourceTree = SOURCE_ROOT; }; 3477C34F1CC0C3D60028B84B /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = ../../../../../../../../System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; 3477C35A1CC1AEEA0028B84B /* LgiInc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiInc.h; path = ../../../include/lgi/common/LgiInc.h; sourceTree = ""; }; 3477C35C1CC2253E0028B84B /* LgiInterfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiInterfaces.h; path = ../../../include/lgi/common/LgiInterfaces.h; sourceTree = ""; }; 3477C4391CC234750028B84B /* MemStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemStream.cpp; path = ../../common/Lgi/MemStream.cpp; sourceTree = SOURCE_ROOT; }; 3477C46C1CC26DEB0028B84B /* Alert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Alert.cpp; path = ../../common/Lgi/Alert.cpp; sourceTree = SOURCE_ROOT; }; 3477C4EC1CC27F1C0028B84B /* TrayIcon.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = TrayIcon.cpp; path = ../../common/Lgi/TrayIcon.cpp; sourceTree = SOURCE_ROOT; }; 3477C5161CC303B70028B84B /* LgiUiBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LgiUiBase.h; path = ../../../include/lgi/common/LgiUiBase.h; sourceTree = ""; }; 347AFB9727A0DC5E00BE4ABE /* 15Bit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = 15Bit.cpp; path = ../../common/Gdc2/15Bit.cpp; sourceTree = SOURCE_ROOT; }; 348362411F233A77003B2A6D /* Stream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stream.h; path = ../../../include/lgi/common/Stream.h; sourceTree = SOURCE_ROOT; }; 34837C4825C677ED00D103B4 /* AppPriv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppPriv.h; path = ../../../private/mac/AppPriv.h; sourceTree = SOURCE_ROOT; }; 348CD46925C63E56001AA32B /* AppCommon.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = AppCommon.cpp; path = ../../common/Lgi/AppCommon.cpp; sourceTree = SOURCE_ROOT; }; 348E99CD2876850F0067E92A /* ObjCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjCWrapper.h; path = ../../../include/lgi/mac/cocoa/ObjCWrapper.h; sourceTree = ""; }; 3491A28423678DB700604C29 /* DropFiles.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = DropFiles.h; path = ../../../include/lgi/common/DropFiles.h; sourceTree = SOURCE_ROOT; }; 34A3ACE720568D5800B1D62A /* StringLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringLayout.cpp; path = ../../common/Gdc2/Font/StringLayout.cpp; sourceTree = SOURCE_ROOT; }; 34A3ACE920568D9700B1D62A /* MenuCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MenuCommon.cpp; path = ../../common/Lgi/MenuCommon.cpp; sourceTree = SOURCE_ROOT; }; 34B14E3326951C6E004C22CC /* Slider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Slider.cpp; path = ../../common/Widgets/Slider.cpp; sourceTree = SOURCE_ROOT; }; 34B531D722F65734002B50F7 /* Menu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Menu.h; path = ../../../include/lgi/common/Menu.h; sourceTree = ""; }; 34B6B19023CFD0F100C24906 /* DragAndDropCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DragAndDropCommon.cpp; path = ../../common/Lgi/DragAndDropCommon.cpp; sourceTree = SOURCE_ROOT; }; 34BF15062871503B001B4CA5 /* DrawListSurface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DrawListSurface.h; path = ../../../../../lgi/trunk/include/lgi/common/DrawListSurface.h; sourceTree = ""; }; 34C072C02369878100E1E222 /* DropFiles.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; name = DropFiles.cpp; path = ../../common/Lgi/DropFiles.cpp; sourceTree = SOURCE_ROOT; }; 34C81A5925DA0AA10053F93A /* Base64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Base64.cpp; path = ../../common/Net/Base64.cpp; sourceTree = SOURCE_ROOT; }; 34CD9F7123D5768B0039F259 /* Unicode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Unicode.h; path = ../../../include/lgi/common/Unicode.h; sourceTree = SOURCE_ROOT; }; 34D1B3C021748A2800BC6B58 /* Path.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Path.cpp; path = ../../common/Gdc2/Path/Path.cpp; sourceTree = SOURCE_ROOT; }; 34D21CEB217981AE003D1EA6 /* EventTargetThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EventTargetThread.h; path = ../../../include/lgi/common/EventTargetThread.h; sourceTree = SOURCE_ROOT; }; 34D28925275B3D9F005961A8 /* DateTime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DateTime.h; path = ../../../include/lgi/common/DateTime.h; sourceTree = SOURCE_ROOT; }; 34D28928275B3DB0005961A8 /* Variant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Variant.h; path = ../../../include/lgi/common/Variant.h; sourceTree = SOURCE_ROOT; }; 34D6AA1622D3749A005D739E /* Gdc2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Gdc2.h; path = ../../../include/lgi/common/Gdc2.h; sourceTree = SOURCE_ROOT; }; 34EE8BB02748A55600F12915 /* TextFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TextFile.h; path = ../../../include/lgi/common/TextFile.h; sourceTree = ""; }; + 34F3EC4229BD374E00BB9B58 /* Rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Rect.h; path = ../../../include/lgi/common/Rect.h; sourceTree = SOURCE_ROOT; }; 34F6151D27E55C5D00FE5B0C /* Thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Thread.h; path = ../../../../../lgi/trunk/include/lgi/common/Thread.h; sourceTree = ""; }; 34F6151E27E55C5D00FE5B0C /* ThreadEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadEvent.h; path = ../../../../../lgi/trunk/include/lgi/common/ThreadEvent.h; sourceTree = ""; }; 34F6153D27E5628600FE5B0C /* Token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Token.h; path = ../../../../../lgi/trunk/include/lgi/common/Token.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ 3477C2641CBF020F0028B84B /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( 3477C3501CC0C3D60028B84B /* Cocoa.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ 3415168D26EC32C8007EE35F /* TextCtrls */ = { isa = PBXGroup; children = ( 3415169126EC32FF007EE35F /* TextView3.h */, 3415169226EC32FF007EE35F /* TextView4.h */, 3415168E26EC32E7007EE35F /* TextView4.cpp */, 3477C2C41CC046310028B84B /* TextView3.cpp */, ); name = TextCtrls; sourceTree = ""; }; 346FACE81D3C723700FFEBCE /* Resources */ = { isa = PBXGroup; children = ( 3477C26D1CBF020F0028B84B /* Info.plist */, ); name = Resources; sourceTree = ""; }; 3477C25E1CBF020F0028B84B = { isa = PBXGroup; children = ( 346FACE81D3C723700FFEBCE /* Resources */, 3477C26A1CBF020F0028B84B /* Classes */, 3477C29A1CBF0A700028B84B /* Headers */, 3477C34E1CC0C3A30028B84B /* Link */, 3477C2691CBF020F0028B84B /* Products */, ); sourceTree = ""; }; 3477C2691CBF020F0028B84B /* Products */ = { isa = PBXGroup; children = ( 3477C2681CBF020F0028B84B /* LgiCocoa.framework */, ); name = Products; sourceTree = ""; }; 3477C26A1CBF020F0028B84B /* Classes */ = { isa = PBXGroup; children = ( 3477C2B21CBF96E60028B84B /* Dialogs */, 3477C33B1CC0881E0028B84B /* Files */, 3477C2931CBF09240028B84B /* General */, 3477C28A1CBF08760028B84B /* Graphics */, 3477C2731CBF07410028B84B /* Interface_Cocoa */, 3477C2B51CBF972B0028B84B /* Interface_XP */, 3477C3141CC04CC00028B84B /* Libraries */, 3477C2D11CC048000028B84B /* Memory */, 3477C31A1CC04D290028B84B /* Network */, 3477C4051CC22F920028B84B /* Process */, 3477C2AD1CBF96AA0028B84B /* Resources */, 3477C2BF1CBF99F00028B84B /* Text */, 3477C3171CC04CDE0028B84B /* Threads */, 3477C2CC1CC046370028B84B /* Widgets */, ); name = Classes; path = Lgi; sourceTree = SOURCE_ROOT; usesTabs = 1; }; 3477C2731CBF07410028B84B /* Interface_Cocoa */ = { isa = PBXGroup; children = ( 343874B3230F46B200CF96B4 /* App.h */, 3477C2741CBF07DD0028B84B /* App.mm */, 344CFBC7237365B800AE6B35 /* ClipBoard.h */, 3477C2761CBF08050028B84B /* ClipBoard.mm */, 3427064627A0E20C0043F733 /* CocoaView.mm */, 3477C3391CC04ED90028B84B /* DragAndDrop.mm */, 3477C27A1CBF086A0028B84B /* General.mm */, 343874B4230F46B200CF96B4 /* Layout.h */, 3477C27B1CBF086A0028B84B /* Layout.mm */, 34109856217A9805007020CE /* LCocoaView.h */, 3477C27C1CBF086A0028B84B /* Menu.mm */, 3477C27D1CBF086A0028B84B /* Printer.mm */, 343874B2230F46B200CF96B4 /* View.h */, 3477C27F1CBF086A0028B84B /* View.mm */, 3477C2AB1CBF72170028B84B /* ViewPriv.h */, 3477C2801CBF086A0028B84B /* Widgets.mm */, 343874B1230F46B200CF96B4 /* Window.h */, 3477C2811CBF086A0028B84B /* Window.mm */, 34109853217A975E007020CE /* View.h */, ); name = Interface_Cocoa; sourceTree = ""; }; 3477C28A1CBF08760028B84B /* Graphics */ = { isa = PBXGroup; children = ( + 34F3EC4229BD374E00BB9B58 /* Rect.h */, 3413170F230694D1008CE982 /* Gel.cpp */, 34D6AA1622D3749A005D739E /* Gdc2.h */, 34D1B3C021748A2800BC6B58 /* Path.cpp */, 3477C3211CC04DA00028B84B /* Colour.cpp */, 3477C2BA1CBF97C80028B84B /* GdcCommon.cpp */, 3477C2EA1CC04B890028B84B /* Filter.cpp */, 3477C3121CC04CB10028B84B /* Rect.cpp */, 3477C28B1CBF08C10028B84B /* Gdc2.mm */, 3477C2BE1CBF97E20028B84B /* Applicators */, 3477C2BD1CBF97DA0028B84B /* Fonts */, 3477C2BC1CBF97D10028B84B /* Surfaces */, ); name = Graphics; sourceTree = ""; }; 3477C2931CBF09240028B84B /* General */ = { isa = PBXGroup; children = ( 34C81A5925DA0AA10053F93A /* Base64.cpp */, 3477C3401CC0A68E0028B84B /* DateTime.cpp */, 34D28925275B3D9F005961A8 /* DateTime.h */, 3477C3421CC0A6B90028B84B /* DocView.cpp */, 3477C2951CBF09320028B84B /* Mem.mm */, 3477C34C1CC0ACED0028B84B /* md5.c */, 3477C3231CC04DD70028B84B /* Object.cpp */, 3477C2E81CC04B5D0028B84B /* Rand.cpp */, 3477C2961CBF09320028B84B /* ShowFileProp_Mac.mm */, 3477C3271CC04E020028B84B /* Variant.cpp */, 34D28928275B3DB0005961A8 /* Variant.h */, ); name = General; sourceTree = ""; }; 3477C29A1CBF0A700028B84B /* Headers */ = { isa = PBXGroup; children = ( 348E99CD2876850F0067E92A /* ObjCWrapper.h */, 34BF15062871503B001B4CA5 /* DrawListSurface.h */, 3477C2A71CBF0AAF0028B84B /* Lgi.h */, 34114C8A23091E6E00F342B1 /* LgiClasses.h */, 3477C35A1CC1AEEA0028B84B /* LgiInc.h */, 3477C35C1CC2253E0028B84B /* LgiInterfaces.h */, 3477C29D1CBF0A920028B84B /* LgiMac.h */, 3477C29E1CBF0A920028B84B /* LgiOs.h */, 3477C29F1CBF0A920028B84B /* LgiOsClasses.h */, 3477C2A01CBF0A920028B84B /* LgiOsDefs.h */, 3477C5161CC303B70028B84B /* LgiUiBase.h */, 3477C29B1CBF0A920028B84B /* Mem.h */, 3449B8CD26BBF6B10022A9B8 /* Notifications.h */, 3409C0CF275812CB0050302A /* Profile.h */, 3477C29C1CBF0A920028B84B /* SymLookup.h */, 34EE8BB02748A55600F12915 /* TextFile.h */, 34F6151D27E55C5D00FE5B0C /* Thread.h */, 34F6151E27E55C5D00FE5B0C /* ThreadEvent.h */, 34F6153D27E5628600FE5B0C /* Token.h */, ); name = Headers; sourceTree = ""; }; 3477C2AD1CBF96AA0028B84B /* Resources */ = { isa = PBXGroup; children = ( 3477C2B01CBF96C40028B84B /* Res.cpp */, 3477C2AE1CBF96B90028B84B /* LgiRes.cpp */, ); name = Resources; path = ../../common/Gdc2/Rect.cpp; sourceTree = SOURCE_ROOT; }; 3477C2B21CBF96E60028B84B /* Dialogs */ = { isa = PBXGroup; children = ( 3413170D23068FFE008CE982 /* FileSelect.cpp */, 3477C46C1CC26DEB0028B84B /* Alert.cpp */, 3477C3481CC0AA7E0028B84B /* ProgressDlg.cpp */, 3477C3441CC0A9DE0028B84B /* Input.cpp */, 3477C30C1CC04C560028B84B /* FindReplace.cpp */, 3477C2E01CC04A3C0028B84B /* FontSelect.cpp */, 3477C2B31CBF96F20028B84B /* LMsg.cpp */, ); name = Dialogs; sourceTree = ""; }; 3477C2B51CBF972B0028B84B /* Interface_XP */ = { isa = PBXGroup; children = ( 34837C4825C677ED00D103B4 /* AppPriv.h */, 348CD46925C63E56001AA32B /* AppCommon.cpp */, 34B6B19023CFD0F100C24906 /* DragAndDropCommon.cpp */, 3491A28423678DB700604C29 /* DropFiles.h */, 34C072C02369878100E1E222 /* DropFiles.cpp */, 34B531D722F65734002B50F7 /* Menu.h */, 34A3ACE920568D9700B1D62A /* MenuCommon.cpp */, 346FACE61D3C720B00FFEBCE /* Message.h */, 3477C4EC1CC27F1C0028B84B /* TrayIcon.cpp */, 3477C34A1CC0AB0B0028B84B /* ToolTip.cpp */, 3477C3461CC0AA220028B84B /* WindowCommon.cpp */, 3477C2E41CC04A7F0028B84B /* ViewCommon.cpp */, 3477C2B81CBF977F0028B84B /* LgiCommon.cpp */, 3477C2B61CBF973F0028B84B /* GuiUtils.cpp */, ); name = Interface_XP; sourceTree = ""; }; 3477C2BC1CBF97D10028B84B /* Surfaces */ = { isa = PBXGroup; children = ( 3477C2E61CC04B1E0028B84B /* Surface.cpp */, 3477C28E1CBF08C10028B84B /* ScreenDC.cpp */, 3477C28C1CBF08C10028B84B /* MemDC.cpp */, 3477C28D1CBF08C10028B84B /* PrintDC.cpp */, ); name = Surfaces; sourceTree = ""; }; 3477C2BD1CBF97DA0028B84B /* Fonts */ = { isa = PBXGroup; children = ( 3477C2CD1CC047BE0028B84B /* Charset.cpp */, 3477C2D81CC048F90028B84B /* DisplayString.cpp */, 3477C2D91CC048F90028B84B /* Font.cpp */, 345920FC1F25649000098DFD /* Font.h */, 345920FD1F25649000098DFD /* FontCache.h */, 340833122698F8FE0028012F /* FontPriv.h */, 345920FE1F25649000098DFD /* FontSelect.h */, 3477C2DA1CC048F90028B84B /* FontSystem.cpp */, 340833132698F8FE0028012F /* FontType.cpp */, 34A3ACE720568D5800B1D62A /* StringLayout.cpp */, 340833142698F8FE0028012F /* TypeFace.cpp */, ); name = Fonts; sourceTree = ""; }; 3477C2BE1CBF97E20028B84B /* Applicators */ = { isa = PBXGroup; children = ( 3477C3291CC04E120028B84B /* 8Bit.cpp */, 347AFB9727A0DC5E00BE4ABE /* 15Bit.cpp */, 3477C32B1CC04E120028B84B /* 16Bit.cpp */, 3477C32C1CC04E120028B84B /* 24Bit.cpp */, 3477C32D1CC04E120028B84B /* 32Bit.cpp */, 3477C32E1CC04E120028B84B /* 48Bit.cpp */, 3477C32A1CC04E120028B84B /* 64Bit.cpp */, 3477C3301CC04E120028B84B /* Alpha.cpp */, ); name = Applicators; sourceTree = ""; }; 3477C2BF1CBF99F00028B84B /* Text */ = { isa = PBXGroup; children = ( 3477C30E1CC04C790028B84B /* Css.cpp */, 3477C30F1CC04C790028B84B /* CssTools.cpp */, 3477C2C01CBF9A040028B84B /* String.cpp */, 3477C33E1CC0A6780028B84B /* Token.cpp */, 3477C2C51CC046310028B84B /* Unicode.cpp */, 34CD9F7123D5768B0039F259 /* Unicode.h */, 3477C2C61CC046310028B84B /* Utf8.cpp */, 3477C2C71CC046310028B84B /* XmlTree.cpp */, ); name = Text; sourceTree = ""; }; 3477C2CC1CC046370028B84B /* Widgets */ = { isa = PBXGroup; children = ( 3477C2F21CC04BF00028B84B /* Bitmap.cpp */, 3477C2F31CC04BF00028B84B /* Box.cpp */, 3477C2F41CC04BF00028B84B /* Button.cpp */, 3477C2F51CC04BF00028B84B /* CheckBox.cpp */, 3477C2F61CC04BF00028B84B /* Combo.cpp */, 3477C2F71CC04BF00028B84B /* Edit.cpp */, 3477C2EC1CC04BBB0028B84B /* ItemContainer.cpp */, 3477C2ED1CC04BBB0028B84B /* List.cpp */, 3409C0C827580ED60050302A /* List.h */, 3409C0C927580ED60050302A /* ListItemCheckBox.h */, 3409C0C727580ED60050302A /* ListItemRadioBtn.h */, 3477C2F81CC04BF00028B84B /* Panel.cpp */, 3477C2D61CC048390028B84B /* Popup.cpp */, 345EB84D235C6C01007D05DB /* Popup.h */, 343BE8C62355D0CE00742E21 /* PopupList.h */, 3477C2F91CC04BF00028B84B /* Progress.cpp */, 3418EBCE25D9FEA600EA168A /* Progress.h */, 3418EBD025D9FEF500EA168A /* ProgressDlg.h */, 3477C2FA1CC04BF00028B84B /* RadioGroup.cpp */, 346DDEC0240C882900751380 /* RadioGroup.h */, 3477C2DE1CC04A030028B84B /* ScrollBar.cpp */, 34B14E3326951C6E004C22CC /* Slider.cpp */, 3477C2FB1CC04BF00028B84B /* Splitter.cpp */, 3477C2FC1CC04BF00028B84B /* TableLayout.cpp */, 3477C2FD1CC04BF00028B84B /* TabView.cpp */, 3415168D26EC32C8007EE35F /* TextCtrls */, 3477C2FE1CC04BF00028B84B /* TextLabel.cpp */, 3477C2CF1CC047F50028B84B /* ToolBar.cpp */, 3477C2EE1CC04BBB0028B84B /* Tree.cpp */, ); name = Widgets; sourceTree = ""; }; 3477C2D11CC048000028B84B /* Memory */ = { isa = PBXGroup; children = ( 3477C2D41CC0481B0028B84B /* Array.h */, 3477C2D21CC048100028B84B /* Containers.cpp */, 3477C4391CC234750028B84B /* MemStream.cpp */, 3477C2E21CC04A5C0028B84B /* Stream.cpp */, 348362411F233A77003B2A6D /* Stream.h */, ); name = Memory; sourceTree = ""; }; 3477C3141CC04CC00028B84B /* Libraries */ = { isa = PBXGroup; children = ( 3477C3151CC04CCB0028B84B /* Library.cpp */, ); name = Libraries; sourceTree = ""; }; 3477C3171CC04CDE0028B84B /* Threads */ = { isa = PBXGroup; children = ( 34D21CEB217981AE003D1EA6 /* EventTargetThread.h */, 3477C27E1CBF086A0028B84B /* Thread.mm */, 3477C3251CC04DE20028B84B /* Mutex.cpp */, 3477C31F1CC04D630028B84B /* ThreadEvent.cpp */, 3477C3181CC04CF10028B84B /* ThreadCommon.cpp */, ); name = Threads; sourceTree = ""; }; 3477C31A1CC04D290028B84B /* Network */ = { isa = PBXGroup; children = ( 346FACE91D3C75AE00FFEBCE /* Uri.cpp */, 346FACEA1D3C75AE00FFEBCE /* MDStringToDigest.cpp */, 3477C31B1CC04D3F0028B84B /* Net.cpp */, 3477C31C1CC04D3F0028B84B /* NetTools.cpp */, ); name = Network; sourceTree = ""; }; 3477C33B1CC0881E0028B84B /* Files */ = { isa = PBXGroup; children = ( 3477C33C1CC088590028B84B /* FileCommon.cpp */, 3477C2A91CBF22A00028B84B /* File.h */, 3477C2941CBF09320028B84B /* File.mm */, ); name = Files; sourceTree = ""; }; 3477C34E1CC0C3A30028B84B /* Link */ = { isa = PBXGroup; children = ( 3477C34F1CC0C3D60028B84B /* Cocoa.framework */, ); name = Link; sourceTree = ""; }; 3477C4051CC22F920028B84B /* Process */ = { isa = PBXGroup; children = ( 3471868723A9AF8900F8C952 /* SubProcess.cpp */, ); name = Process; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ 3477C2651CBF020F0028B84B /* Headers */ = { isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( 344CFBC8237365B800AE6B35 /* ClipBoard.h in Headers */, 3449B8CE26BBF6B10022A9B8 /* Notifications.h in Headers */, 343874B8230F46B200CF96B4 /* Layout.h in Headers */, 3477C2AC1CBF72170028B84B /* ViewPriv.h in Headers */, 3409C0CA27580ED60050302A /* ListItemRadioBtn.h in Headers */, 3477C35D1CC2253E0028B84B /* LgiInterfaces.h in Headers */, 34F6153E27E5628600FE5B0C /* Token.h in Headers */, 3477C2A51CBF0A920028B84B /* LgiOsClasses.h in Headers */, 3491A28523678DB800604C29 /* DropFiles.h in Headers */, 3415169326EC32FF007EE35F /* TextView3.h in Headers */, 34B531D822F65734002B50F7 /* Menu.h in Headers */, 34114C8B23091E6E00F342B1 /* LgiClasses.h in Headers */, 34D28926275B3D9F005961A8 /* DateTime.h in Headers */, 3477C35B1CC1AEEA0028B84B /* LgiInc.h in Headers */, 34F6152027E55C5D00FE5B0C /* ThreadEvent.h in Headers */, 348362421F233A77003B2A6D /* Stream.h in Headers */, 3477C2A61CBF0A920028B84B /* LgiOsDefs.h in Headers */, 3409C0CC27580ED60050302A /* ListItemCheckBox.h in Headers */, 345EB84E235C6C01007D05DB /* Popup.h in Headers */, 34BF15072871503B001B4CA5 /* DrawListSurface.h in Headers */, 34F6151F27E55C5D00FE5B0C /* Thread.h in Headers */, 34D21CEC217981AE003D1EA6 /* EventTargetThread.h in Headers */, 343BE8C72355D0CE00742E21 /* PopupList.h in Headers */, 34EE8BB12748A55600F12915 /* TextFile.h in Headers */, 34CD9F7223D5768B0039F259 /* Unicode.h in Headers */, 34837C4925C677ED00D103B4 /* AppPriv.h in Headers */, + 34F3EC4329BD374E00BB9B58 /* Rect.h in Headers */, 3409C0D0275812CB0050302A /* Profile.h in Headers */, 3477C2A11CBF0A920028B84B /* Mem.h in Headers */, 3477C2D51CC0481B0028B84B /* Array.h in Headers */, 3477C5171CC303B70028B84B /* LgiUiBase.h in Headers */, 3477C2AA1CBF22A00028B84B /* File.h in Headers */, 343874B5230F46B200CF96B4 /* Window.h in Headers */, 34D28929275B3DB0005961A8 /* Variant.h in Headers */, 348E99CE2876850F0067E92A /* ObjCWrapper.h in Headers */, 3477C2A21CBF0A920028B84B /* SymLookup.h in Headers */, 34D6AA1722D3749A005D739E /* Gdc2.h in Headers */, 3477C2A41CBF0A920028B84B /* LgiOs.h in Headers */, 340833152698F8FF0028012F /* FontPriv.h in Headers */, 343874B7230F46B200CF96B4 /* App.h in Headers */, 3418EBCF25D9FEA600EA168A /* Progress.h in Headers */, 346DDEC1240C882900751380 /* RadioGroup.h in Headers */, 345921011F25649000098DFD /* FontSelect.h in Headers */, 346FACE71D3C720B00FFEBCE /* Message.h in Headers */, 3477C2A31CBF0A920028B84B /* LgiMac.h in Headers */, 3418EBD125D9FEF500EA168A /* ProgressDlg.h in Headers */, 343874B6230F46B200CF96B4 /* View.h in Headers */, 345920FF1F25649000098DFD /* Font.h in Headers */, 3415169426EC32FF007EE35F /* TextView4.h in Headers */, 3477C2A81CBF0AAF0028B84B /* Lgi.h in Headers */, 345921001F25649000098DFD /* FontCache.h in Headers */, 3409C0CB27580ED60050302A /* List.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ 3477C2671CBF020F0028B84B /* LgiCocoa */ = { isa = PBXNativeTarget; buildConfigurationList = 3477C2701CBF020F0028B84B /* Build configuration list for PBXNativeTarget "LgiCocoa" */; buildPhases = ( 3477C2631CBF020F0028B84B /* Sources */, 3477C2641CBF020F0028B84B /* Frameworks */, 3477C2651CBF020F0028B84B /* Headers */, 3477C2661CBF020F0028B84B /* Resources */, ); buildRules = ( ); dependencies = ( ); name = LgiCocoa; productName = Lgi; productReference = 3477C2681CBF020F0028B84B /* LgiCocoa.framework */; productType = "com.apple.product-type.framework"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ 3477C25F1CBF020F0028B84B /* Project object */ = { isa = PBXProject; attributes = { LastUpgradeCheck = 1240; ORGANIZATIONNAME = Memecode; TargetAttributes = { 3477C2671CBF020F0028B84B = { CreatedOnToolsVersion = 7.3; ProvisioningStyle = Manual; }; }; }; buildConfigurationList = 3477C2621CBF020F0028B84B /* Build configuration list for PBXProject "LgiCocoa" */; compatibilityVersion = "Xcode 10.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); mainGroup = 3477C25E1CBF020F0028B84B; productRefGroup = 3477C2691CBF020F0028B84B /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( 3477C2671CBF020F0028B84B /* LgiCocoa */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ 3477C2661CBF020F0028B84B /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 3477C2631CBF020F0028B84B /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( 3477C2CE1CC047BE0028B84B /* Charset.cpp in Sources */, 3477C3111CC04C790028B84B /* CssTools.cpp in Sources */, 34A3ACE820568D5800B1D62A /* StringLayout.cpp in Sources */, 3477C2DB1CC048F90028B84B /* DisplayString.cpp in Sources */, 34B14E3426951C6E004C22CC /* Slider.cpp in Sources */, 3477C33A1CC04ED90028B84B /* DragAndDrop.mm in Sources */, 3477C2DC1CC048F90028B84B /* Font.cpp in Sources */, 3477C2831CBF086A0028B84B /* Layout.mm in Sources */, 3477C34D1CC0ACED0028B84B /* md5.c in Sources */, 3477C2C81CC046310028B84B /* TextView3.cpp in Sources */, 3477C2861CBF086A0028B84B /* Thread.mm in Sources */, 3477C2821CBF086A0028B84B /* General.mm in Sources */, 3477C3131CC04CB10028B84B /* Rect.cpp in Sources */, 3477C3451CC0A9DE0028B84B /* Input.cpp in Sources */, 34B6B19123CFD0F100C24906 /* DragAndDropCommon.cpp in Sources */, 3477C31D1CC04D3F0028B84B /* Net.cpp in Sources */, 3477C28F1CBF08C10028B84B /* Gdc2.mm in Sources */, 3477C30A1CC04BF00028B84B /* TabView.cpp in Sources */, 3427064727A0E20C0043F733 /* CocoaView.mm in Sources */, 3477C33F1CC0A6780028B84B /* Token.cpp in Sources */, 3477C2D01CC047F50028B84B /* ToolBar.cpp in Sources */, 3477C3011CC04BF00028B84B /* Button.cpp in Sources */, 3477C3061CC04BF00028B84B /* Progress.cpp in Sources */, 3477C3001CC04BF00028B84B /* Box.cpp in Sources */, 3477C2871CBF086A0028B84B /* View.mm in Sources */, 3477C3021CC04BF00028B84B /* CheckBox.cpp in Sources */, 3477C2BB1CBF97C80028B84B /* GdcCommon.cpp in Sources */, 3477C2E51CC04A7F0028B84B /* ViewCommon.cpp in Sources */, 347AFB9827A0DC5E00BE4ABE /* 15Bit.cpp in Sources */, 34131710230694D1008CE982 /* Gel.cpp in Sources */, 3477C2D71CC048390028B84B /* Popup.cpp in Sources */, 3477C3091CC04BF00028B84B /* TableLayout.cpp in Sources */, 3477C2E11CC04A3C0028B84B /* FontSelect.cpp in Sources */, 3477C2DF1CC04A030028B84B /* ScrollBar.cpp in Sources */, 3477C2F11CC04BBB0028B84B /* Tree.cpp in Sources */, 3413170E23068FFE008CE982 /* FileSelect.cpp in Sources */, 3477C3281CC04E020028B84B /* Variant.cpp in Sources */, 3477C2AF1CBF96B90028B84B /* LgiRes.cpp in Sources */, 3471868823A9AF8900F8C952 /* SubProcess.cpp in Sources */, 3477C3161CC04CCB0028B84B /* Library.cpp in Sources */, 3477C3051CC04BF00028B84B /* Panel.cpp in Sources */, 3477C2901CBF08C10028B84B /* MemDC.cpp in Sources */, 34C072C12369878100E1E222 /* DropFiles.cpp in Sources */, 3477C30D1CC04C560028B84B /* FindReplace.cpp in Sources */, 3477C34B1CC0AB0B0028B84B /* ToolTip.cpp in Sources */, 3415168F26EC32E7007EE35F /* TextView4.cpp in Sources */, 3477C3201CC04D630028B84B /* ThreadEvent.cpp in Sources */, 3477C3031CC04BF00028B84B /* Combo.cpp in Sources */, 3477C30B1CC04BF00028B84B /* TextLabel.cpp in Sources */, 3477C2B71CBF973F0028B84B /* GuiUtils.cpp in Sources */, 3477C2911CBF08C10028B84B /* PrintDC.cpp in Sources */, 3477C2B91CBF977F0028B84B /* LgiCommon.cpp in Sources */, 34D1B3C121748A2800BC6B58 /* Path.cpp in Sources */, 3477C2CA1CC046310028B84B /* Utf8.cpp in Sources */, 3477C2971CBF09320028B84B /* File.mm in Sources */, 3477C43A1CC234750028B84B /* MemStream.cpp in Sources */, 3477C3191CC04CF10028B84B /* ThreadCommon.cpp in Sources */, 3477C2781CBF08050028B84B /* ClipBoard.mm in Sources */, 346FACEC1D3C75AE00FFEBCE /* MDStringToDigest.cpp in Sources */, 3477C3491CC0AA7E0028B84B /* ProgressDlg.cpp in Sources */, 346FACEB1D3C75AE00FFEBCE /* Uri.cpp in Sources */, 3477C2B11CBF96C40028B84B /* Res.cpp in Sources */, 340833162698F8FF0028012F /* FontType.cpp in Sources */, 3477C4ED1CC27F1C0028B84B /* TrayIcon.cpp in Sources */, 3477C2991CBF09320028B84B /* ShowFileProp_Mac.mm in Sources */, 3477C2921CBF08C10028B84B /* ScreenDC.cpp in Sources */, 3477C2981CBF09320028B84B /* Mem.mm in Sources */, 3477C2CB1CC046310028B84B /* XmlTree.cpp in Sources */, 3477C2EF1CC04BBB0028B84B /* ItemContainer.cpp in Sources */, 3477C3081CC04BF00028B84B /* Splitter.cpp in Sources */, 34109857217A9805007020CE /* LCocoaView.h in Sources */, 3477C46D1CC26DEB0028B84B /* Alert.cpp in Sources */, 3477C3381CC04E120028B84B /* Alpha.cpp in Sources */, 3477C2EB1CC04B890028B84B /* Filter.cpp in Sources */, 3477C3321CC04E120028B84B /* 64Bit.cpp in Sources */, 3477C3041CC04BF00028B84B /* Edit.cpp in Sources */, 3477C3361CC04E120028B84B /* 48Bit.cpp in Sources */, 3477C3261CC04DE20028B84B /* Mutex.cpp in Sources */, 3477C2851CBF086A0028B84B /* Printer.mm in Sources */, 3477C33D1CC088590028B84B /* FileCommon.cpp in Sources */, 3477C3471CC0AA220028B84B /* WindowCommon.cpp in Sources */, 3477C3071CC04BF00028B84B /* RadioGroup.cpp in Sources */, 3477C2FF1CC04BF00028B84B /* Bitmap.cpp in Sources */, 3477C2E91CC04B5D0028B84B /* Rand.cpp in Sources */, 3477C2E71CC04B1E0028B84B /* Surface.cpp in Sources */, 3477C3241CC04DD70028B84B /* Object.cpp in Sources */, 3477C2E31CC04A5C0028B84B /* Stream.cpp in Sources */, 34A3ACEA20568D9700B1D62A /* MenuCommon.cpp in Sources */, 3477C3341CC04E120028B84B /* 24Bit.cpp in Sources */, 3477C3351CC04E120028B84B /* 32Bit.cpp in Sources */, 3477C31E1CC04D3F0028B84B /* NetTools.cpp in Sources */, 3477C2881CBF086A0028B84B /* Widgets.mm in Sources */, 340833172698F8FF0028012F /* TypeFace.cpp in Sources */, 3477C2891CBF086A0028B84B /* Window.mm in Sources */, 3477C3431CC0A6B90028B84B /* DocView.cpp in Sources */, 3477C2841CBF086A0028B84B /* Menu.mm in Sources */, 3477C2B41CBF96F20028B84B /* LMsg.cpp in Sources */, 3477C3311CC04E120028B84B /* 8Bit.cpp in Sources */, 3477C2DD1CC048F90028B84B /* FontSystem.cpp in Sources */, 3477C3101CC04C790028B84B /* Css.cpp in Sources */, 3477C2C91CC046310028B84B /* Unicode.cpp in Sources */, 3477C3221CC04DA00028B84B /* Colour.cpp in Sources */, 3477C2D31CC048100028B84B /* Containers.cpp in Sources */, 3477C2F01CC04BBB0028B84B /* List.cpp in Sources */, 3477C3331CC04E120028B84B /* 16Bit.cpp in Sources */, 3477C2751CBF07DD0028B84B /* App.mm in Sources */, 348CD46A25C63E56001AA32B /* AppCommon.cpp in Sources */, 3477C3411CC0A68E0028B84B /* DateTime.cpp in Sources */, 34C81A5A25DA0AA10053F93A /* Base64.cpp in Sources */, 3477C2C11CBF9A040028B84B /* String.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ 3477C26E1CBF020F0028B84B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = NO; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.15; MODULEMAP_FILE = module.modulemap; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Debug; }; 3477C26F1CBF020F0028B84B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ANALYZER_NONNULL = YES; CLANG_CXX_LANGUAGE_STANDARD = "c++14"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = NO; CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "-"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.15; MODULEMAP_FILE = module.modulemap; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = macosx; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; name = Release; }; 3477C2711CBF020F0028B84B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES_NONAGGRESSIVE; CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; GCC_C_LANGUAGE_STANDARD = c11; HEADER_SEARCH_PATHS = ( ../../../include, ../../../include/lgi/mac/cocoa, ../../../private/mac, ../../../private/common, ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); OTHER_CFLAGS = ( "-DMAC", "-DLGI_COCOA=1", "-DLGI_LIBRARY", "-D_DEBUG", ); OTHER_CODE_SIGN_FLAGS = "--timestamp"; OTHER_CPLUSPLUSFLAGS = ( "-DMAC", "-DLGI_COCOA=1", "-DLGI_LIBRARY", "-D_DEBUG", ); PRODUCT_BUNDLE_IDENTIFIER = com.memecode.Lgi; PRODUCT_NAME = LgiCocoa; SDKROOT = macosx; SKIP_INSTALL = YES; STRIP_INSTALLED_PRODUCT = NO; WARNING_CFLAGS = "-Wno-nullability-completeness"; }; name = Debug; }; 3477C2721CBF020F0028B84B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { CLANG_ANALYZER_NONNULL = YES_NONAGGRESSIVE; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_INJECT_BASE_ENTITLEMENTS = NO; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; GCC_C_LANGUAGE_STANDARD = c11; HEADER_SEARCH_PATHS = ( ../../../include, ../../../include/lgi/mac/cocoa, ../../../private/mac, ../../../private/common, ); INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/../Frameworks", "@loader_path/Frameworks", ); OTHER_CFLAGS = ( "-DMAC", "-DLGI_COCOA=1", "-DLGI_LIBRARY", ); OTHER_CODE_SIGN_FLAGS = "--timestamp"; OTHER_CPLUSPLUSFLAGS = ( "-DMAC", "-DLGI_COCOA=1", "-DLGI_LIBRARY", ); PRODUCT_BUNDLE_IDENTIFIER = com.memecode.Lgi; PRODUCT_NAME = LgiCocoa; SDKROOT = macosx; SKIP_INSTALL = YES; STRIP_INSTALLED_PRODUCT = NO; WARNING_CFLAGS = "-Wno-nullability-completeness"; }; name = Release; }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ 3477C2621CBF020F0028B84B /* Build configuration list for PBXProject "LgiCocoa" */ = { isa = XCConfigurationList; buildConfigurations = ( 3477C26E1CBF020F0028B84B /* Debug */, 3477C26F1CBF020F0028B84B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; 3477C2701CBF020F0028B84B /* Build configuration list for PBXNativeTarget "LgiCocoa" */ = { isa = XCConfigurationList; buildConfigurations = ( 3477C2711CBF020F0028B84B /* Debug */, 3477C2721CBF020F0028B84B /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; rootObject = 3477C25F1CBF020F0028B84B /* Project object */; } diff --git a/src/mac/cocoa/View.mm b/src/mac/cocoa/View.mm --- a/src/mac/cocoa/View.mm +++ b/src/mac/cocoa/View.mm @@ -1,1011 +1,1018 @@ /*hdr ** FILE: LView.cpp ** AUTHOR: Matthew Allen ** DATE: 23/4/98 ** DESCRIPTION: Linux LView Implementation ** ** Copyright (C) 1998-2003, Matthew Allen ** fret@memecode.com */ #include #include #include "lgi/common/Lgi.h" #include "lgi/common/DragAndDrop.h" #include "lgi/common/ScrollBar.h" #include "lgi/common/Edit.h" #include "lgi/common/Css.h" #include "lgi/common/Popup.h" #include "lgi/common/DisplayString.h" #include "ViewPriv.h" #include "LCocoaView.h" #define ADJ_LEFT 1 #define ADJ_RIGHT 2 #define ADJ_UP 3 #define ADJ_DOWN 4 // CursorData is a bitmap in an array of uint32's. This is generated from a graphics file: // ./Code/cursors.png // // The pixel values are turned into C code by a program called i.Mage: // http://www.memecode.com/image.php // // Load the graphic into i.Mage and then go Edit->CopyAsCode // Then paste the text into the CursorData variable at the bottom of this file. // // This saves a lot of time finding and loading an external resouce, and even having to // bundle extra files with your application. Which have a tendancy to get lost along the // way etc. extern uint32 CursorData[]; LInlineBmp Cursors = { 300, 20, 8, CursorData }; struct LgiCursorInfo { public: LRect Pos; LPoint HotSpot; } CursorMetrics[] = { // up arrow { LRect(0, 0, 8, 15), LPoint(4, 0) }, // cross hair { LRect(20, 0, 38, 18), LPoint(29, 9) }, // hourglass { LRect(40, 0, 51, 15), LPoint(45, 8) }, // I beam { LRect(60, 0, 66, 17), LPoint(63, 8) }, // N-S arrow { LRect(80, 0, 91, 16), LPoint(85, 8) }, // E-W arrow { LRect(100, 0, 116, 11), LPoint(108, 5) }, // NW-SE arrow { LRect(120, 0, 132, 12), LPoint(126, 6) }, // NE-SW arrow { LRect(140, 0, 152, 12), LPoint(146, 6) }, // 4 way arrow { LRect(160, 0, 178, 18), LPoint(169, 9) }, // Blank { LRect(0, 0, 0, 0), LPoint(0, 0) }, // Vertical split { LRect(180, 0, 197, 16), LPoint(188, 8) }, // Horizontal split { LRect(200, 0, 216, 17), LPoint(208, 8) }, // Hand { LRect(220, 0, 233, 13), LPoint(225, 0) }, // No drop { LRect(240, 0, 258, 18), LPoint(249, 9) }, // Copy drop { LRect(260, 0, 279, 19), LPoint(260, 0) }, // Move drop { LRect(280, 0, 299, 19), LPoint(280, 0) }, }; //////////////////////////////////////////////////////////////////////////// LView *GWindowFromHandle(OsView h) { if (!h) return 0; return 0; } //////////////////////////////////////////////////////////////////////////// bool LIsKeyDown(int Key) { LAssert(!"Not impl."); return false; } bool LIsMounted(char *Name) { LAssert(!"Not impl."); return false; } bool LMountVolume(char *Name) { LAssert(!"Not impl."); return false; } LKey::LKey(int Vkey, uint32_t flags) { c16 = vkey = Vkey; Flags = flags; Data = 0; IsChar = false; } //////////////////////////////////////////////////////////////////////////////////////////////////// #if 0 bool LViewPrivate::CursorSet = false; LView *LViewPrivate::LastCursor = 0; #endif LViewPrivate::LViewPrivate(LView *view) : View(view) { TabStop = false; AttachEvent = false; } LViewPrivate::~LViewPrivate() { DeleteObj(Popup); LAssert(PulseThread == NULL); } const char *LView::GetClass() { return "LView"; } LView *&LView::PopupChild() { return d->Popup; } bool LView::_Mouse(LMouse &m, bool Move) { #if 0 if (Move) { static bool First = true; if (First) { First = false; //_DumpHeirarchy(GetWindow()); //_Dump(0, GetWindow(), HIViewGetRoot(GetWindow()->WindowHandle())); } printf("_Mouse %p,%s %i,%i down=%i move=%i\n", this, GetClass(), m.x, m.y, m.Down(), Move); } #endif LWindow *Wnd = GetWindow(); if (_Capturing) { // Convert root NSView coords to capture view coords LViewI *par; for (auto i = _Capturing; i && i != this; i = par) { par = i->GetParent(); LRect cli, p = i->GetPos(); if (par) cli = i->GetClient(false); m.x -= p.x1 + cli.x1; m.y -= p.y1 + cli.y1; } // if (!m.IsMove()) m.Trace("Capture"); if (Move) { LViewI *c = _Capturing; c->OnMouseMove(m); } else { if (!Wnd || Wnd->HandleViewMouse(dynamic_cast(_Capturing), m)) _Capturing->OnMouseClick(m); } } else { // Convert root NSView coords to _Over coords auto t = WindowFromPoint(m.x, m.y); if (t) { /* GColour col(255, 0, 255); GArray rc; GArray names; auto w = GetWindow(); int yy = 200; bool Debug = !stricmp(t->GetClass(), "CtrlEditbox") && w->DebugDC.X() == 0 && !Move; if (Debug && w) { w->DebugDC.Create(w->X(), w->Y(), System32BitColourSpace); w->DebugDC.Colour(0, 32); w->DebugDC.Rectangle(); w->DebugDC.Colour(col); } */ for (auto i = t; i && i != this; i = i->GetParent()) { auto p = i->GetPos(); auto cli = i->GetClient(false); /* if (Debug) { LRect r = p; r.Offset(cli.x1, cli.y1); rc.AddAt(0,r); names.AddAt(0,i->GetClass()); printf("%s %s\n", i->GetClass(), p.GetStr()); } */ m.x -= p.x1 + cli.x1; m.y -= p.y1 + cli.y1; } /* if (Debug) { int x = rc[0].x1, y = rc[0].y1; for (unsigned i=0; iDebugDC.Line(x, y, x+r.x1, y+r.y1); x += r.x1; y += r.y1; GDisplayString ds(SysFont, names[i]); SysFont->Fore(col); SysFont->Transparent(true); ds.Draw(&w->DebugDC, 120-ds.X(), yy); w->DebugDC.Line(120, yy, x, y); yy += 10 + ds.Y(); } w->Invalidate(); } */ m.Target = t; } // if (!m.IsMove()) m.Trace("NonCapture"); if (_Over != m.Target) { if (_Over) _Over->OnMouseExit(m); _Over = m.Target; if (_Over) _Over->OnMouseEnter(m); } auto Target = dynamic_cast(_Over ? _Over : m.Target); auto Lo = dynamic_cast(Target); LRect Client = Lo ? Lo->GetClient(false) : Target->LView::GetClient(false); if (!Client.Valid() || Client.Overlap(m.x, m.y)) { if (Move) { // Do cursor stuff auto cursor = Target->GetCursor(m.x, m.y); auto cc = NSCursor.arrowCursor; if (cursor != LCUR_Normal) cc = LCocoaCursor(cursor); if (cc != NSCursor.currentSystemCursor) [cc set]; // Move event Target->OnMouseMove(m); } else if (!Wnd || Wnd->HandleViewMouse(Target, m)) { // Click event Target->OnMouseClick(m); } } else return false; } return true; } LRect &LView::GetClient(bool ClientSpace) { int Edge = (Sunken() || Raised()) ? _BorderSize : 0; static LRect c; c = Pos; c.Offset(-c.x1, -c.y1); if (ClientSpace) { c.x2 -= Edge << 1; c.y2 -= Edge << 1; } else { c.Inset(Edge, Edge); } return c; } void LView::Quit(bool DontDelete) { if (DontDelete) { Visible(false); } else { Detach(); delete this; } } LPoint LView::Flip(LPoint p) { auto Parent = GetParent() ? GetParent() : GetWindow(); if (Parent) { LRect r = Parent->GetClient(false); p.y = r.y2 - p.y; } return p; } void LView::OnDealloc() { #if LGI_VIEW_HASH LockHandler(this, OpDelete); #endif SetPulse(); for (auto c: Children) { auto gv = c->GetGView(); if (gv) gv->OnDealloc(); } } LRect LView::Flip(LRect p) { auto Parent = GetParent() ? GetParent() : GetWindow(); if (Parent) { LRect r = Parent->GetClient(false); int y2 = r.y2 - p.y1; int y1 = y2 - p.Y() + 1; p.Offset(0, y1-p.y1); } return p; } bool LView::SetPos(LRect &p, bool Repaint) { Pos = p; OnPosChange(); return true; } bool LView::Invalidate(LRect *rc, bool Repaint, bool Frame) { if (!InThread()) return PostEvent(M_INVALIDATE, (LMessage::Param) (rc ? new LRect(*rc) : NULL), (LMessage::Param) this); LRect r; if (rc) r = *rc; else r = GetClient(); if (!r.Valid()) return false; auto w = GetWindow(); LPopup *popup = NULL; LViewI *v; for (v = this; v; v = v->GetParent()) { if (!v->Visible()) return true; if (v == (LViewI*)w) break; if ((popup = dynamic_cast(v))) break; auto p = v->GetPos(); r.Offset(p.x1, p.y1); } NSView *nsview = NULL; if (popup) nsview = popup->Handle().p.contentView; else if (w) nsview = w->Handle(); if (!nsview) return false; #if 0 [nsview setNeedsDisplayInRect:v->GetGView()->Flip(r)]; printf("%s::Inval r=%s\n", GetClass(), r.GetStr()); #else nsview.needsDisplay = true; #endif return true; } void LView::SetPulse(int Length) { DeleteObj(d->PulseThread); if (Length > 0) d->PulseThread = new LPulseThread(this, Length); } LCursor LView::GetCursor(int x, int y) { return LCUR_Normal; } LMessage::Result LView::OnEvent(LMessage *Msg) { switch (Msg->m) { case M_PULSE: { OnPulse(); break; } case M_CHANGE: { LViewI *Ctrl; if (GetViewById((int)Msg->A(), Ctrl)) { LNotification note((LNotifyType)Msg->B()); return OnNotify(Ctrl, note); } break; } case M_COMMAND: { static int count = 0; if (++count == 2) printf("%s:%i - M_COMMAND\n", _FL); return OnCommand((int)Msg->A(), 0, (OsView)Msg->B()); } case M_INVALIDATE: { LAutoPtr rc((LRect*)Msg->A()); Invalidate(rc.Get()); break; } case M_THREAD_COMPLETED: { auto Th = (LThread*)Msg->A(); if (!Th) break; Th->OnComplete(); if (Th->GetDeleteOnExit()) delete Th; return true; } default: { break; } } return 0; } bool LView::PointToScreen(LPoint &p) { LViewI *c = this; // Find offset to window while ( c && !dynamic_cast(c) && !dynamic_cast(c)) { LRect pos = c->GetPos(); // printf("%s pos %s\n", c->GetClass(), pos.GetStr()); p.x += pos.x1; p.y += pos.y1; c = c->GetParent(); } if (c && c->WindowHandle()) { NSWindow *w = c->WindowHandle(); LRect wFrame = w.frame; LRect Screen(0, 0, -1, -1); for (NSScreen *s in [NSScreen screens]) { LRect pos = s.frame; if (wFrame.Overlap(&pos)) { Screen = pos; break; } } if (!Screen.Valid()) return false; LRect cli = c->GetClient(); p.y = cli.Y() - p.y; NSRect i = {{(double)p.x, (double)p.y}, {0.0, 0.0}}; NSRect o = [w convertRectToScreen:i]; p.x = (int)o.origin.x; p.y = Screen.Y() - (int)o.origin.y; } else return false; return true; } bool LView::PointToView(LPoint &p) { LViewI *c = this; int Ox = 0, Oy = 0; // Find offset to window while (c && c != c->GetWindow()) { LView *gv = c->GetGView(); LRect cli = gv ? gv->LView::GetClient(false) : c->GetClient(false); LRect pos = c->GetPos(); Ox += pos.x1 + cli.x1; Oy += pos.y1 + cli.y1; c = c->GetParent(); } // Apply window position if (c && c->WindowHandle()) { NSWindow *w = c->WindowHandle(); LRect wFrame = w.frame; LRect Screen(0, 0, -1, -1); for (NSScreen *s in [NSScreen screens]) { LRect pos = s.frame; if (wFrame.Overlap(&pos)) { Screen = pos; break; } } if (!Screen.Valid()) return false; // Flip into top-down to bottom up: NSRect i = {(double)p.x, (double)(Screen.Y()-p.y), 0.0, 0.0}; NSRect o = [w convertRectFromScreen:i]; p.x = (int)o.origin.x; p.y = (int)o.origin.y; // Flip back into top down.. in window space #if 1 p = c->GetGView()->Flip(p); #else LRect cli = c->GetClient(); p.y = cli.Y() - p.y; #endif // Now offset into view space. p.x += Ox; p.y += Oy; } else return false; return true; } #define DEBUG_GETMOUSE 0 bool LView::GetMouse(LMouse &m, bool ScreenCoords) { LViewI *w = GetWindow(); if (!w) return false; NSWindow *wh = w->WindowHandle(); if (!wh) return false; #if DEBUG_GETMOUSE GStringPipe log; #endif NSPoint pt = wh.mouseLocationOutsideOfEventStream; m.x = pt.x; m.y = pt.y; m.Target = this; #if DEBUG_GETMOUSE log.Print("Event=%i,%i", m.x, m.y); #endif LPoint p(pt.x, pt.y); p.y = wh.contentView.frame.size.height - p.y; #if DEBUG_GETMOUSE log.Print(" Flipped=%i,%i", p.x, p.y); #endif if (ScreenCoords) { PointToScreen(p); #if DEBUG_GETMOUSE log.Print(" Screen=%i,%i", p.x, p.y); #endif } m.x = p.x; m.y = p.y; m.Target = this; + auto Btns = [NSEvent pressedMouseButtons]; m.Left(Btns & 0x1); m.Right(Btns & 0x2); m.Middle(Btns & 0x4); + + auto Mods = [NSEvent modifierFlags]; + m.Ctrl (Mods & NSEventModifierFlagControl); + m.Alt (Mods & NSEventModifierFlagOption); + m.System(Mods & NSEventModifierFlagCommand); + m.Shift (Mods & NSEventModifierFlagShift); // Find offset to window for (LViewI *c = this; c && c != c->GetWindow(); c = c->GetParent()) { LRect pos = c->GetPos(); m.x -= pos.x1; m.y -= pos.y1; #if DEBUG_GETMOUSE log.Print(" Offset(%s,%i,%i)=%i,%i", c->GetClass(), pos.x1, pos.y1, m.x, m.y); #endif } #if DEBUG_GETMOUSE printf(" GetMouse: %s\n", log.NewGStr().Get()); #endif return true; } bool LView::IsAttached() { LWindow *w = GetWindow(); if (!w) return false; if (w == this) return WindowHandle() != 0; if (!d->AttachEvent) return false; if (GetParent() != NULL) return w->WindowHandle() != 0; return false; } void BuildTabStops(LArray &Stops, LViewI *v) { if (v && v->Visible()) { if (v->GetTabStop() && v->Enabled()) Stops.Add(v); for (LViewI *c: v->IterateViews()) BuildTabStops(Stops, c); } } void NextTabStop(LViewI *v, int dir) { LArray Stops; BuildTabStops(Stops, v->GetWindow()); ssize_t Idx = Stops.IndexOf(v); if (Idx >= 0) Idx += dir; else Idx = 0; if (Idx < 0) Idx = Stops.Length() - 1; else if (Idx >= Stops.Length()) Idx = 0; if (Idx < Stops.Length()) Stops[Idx]->Focus(true); } void SetDefaultFocus(LViewI *v) { LArray Stops; BuildTabStops(Stops, v->GetWindow()); if (Stops.Length()) { int Set = -1; for (int i=0; iFocus()) { Set = i; break; } } if (Set < 0) Set = 0; Stops[Set]->Focus(true); } } int VirtualKeyToLgi(int Virt) { switch (Virt) { // various case 122: return LK_F1; case 120: return LK_F2; case 99: return LK_F3; case 118: return LK_F4; case 96: return LK_F5; case 97: return LK_F6; case 98: return LK_F7; case 100: return LK_F8; case 101: return LK_F9; case 109: return LK_F10; case 103: return LK_F11; case 110: return LK_APPS; case 111: return LK_F12; case 123: return LK_LEFT; case 124: return LK_RIGHT; case 125: return LK_DOWN; case 126: return LK_UP; case 114: return LK_INSERT; case 116: return LK_PAGEUP; case 121: return LK_PAGEDOWN; case 53: return LK_ESCAPE; case 51: return LK_BACKSPACE; case 117: return LK_DELETE; case 115: return LK_HOME; case 119: return LK_END; // whitespace case 76: return LK_RETURN; case 36: return '\r'; case 48: return '\t'; case 49: return ' '; // delimiters case 27: return '-'; case 24: return '='; case 42: return '\\'; case 47: return '.'; case 50: return '`'; // digits case 18: return '1'; case 19: return '2'; case 20: return '3'; case 21: return '4'; case 23: return '5'; case 22: return '6'; case 26: return '7'; case 28: return '8'; case 25: return '9'; case 29: return '0'; // alpha case 0: return 'a'; case 11: return 'b'; case 8: return 'c'; case 2: return 'd'; case 14: return 'e'; case 3: return 'f'; case 5: return 'g'; case 4: return 'h'; case 34: return 'i'; case 38: return 'j'; case 40: return 'k'; case 37: return 'l'; case 46: return 'm'; case 45: return 'n'; case 31: return 'o'; case 35: return 'p'; case 12: return 'q'; case 15: return 'r'; case 1: return 's'; case 17: return 't'; case 32: return 'u'; case 9: return 'v'; case 13: return 'w'; case 7: return 'x'; case 16: return 'y'; case 6: return 'z'; default: printf("%s:%i - unimplemented virt->lgi code mapping: %d\n", _FL, (unsigned)Virt); break; } return 0; } #if 0 static int GetIsChar(LKey &k, int mods) { return k.IsChar = (mods & 0x100) == 0 && ( k.c16 >= ' ' || k.c16 == VK_RETURN || k.c16 == VK_TAB || k.c16 == VK_BACKSPACE ); } #endif bool LView::_Attach(LViewI *parent) { LAutoPool Pool; if (!parent) { LAssert(0); return false; } d->ClassName = GetClass(); d->ParentI = parent; d->Parent = d->ParentI ? parent->GetGView() : NULL; LAssert(!_InLock); _Window = d->GetParent() ? d->GetParent()->GetWindow() : 0; if (_Window) _Lock = _Window->_Lock; auto p = d->GetParent(); if (p) { LWindow *w = dynamic_cast(p); NSView *ph = nil; if (w) ph = w->WindowHandle().p.contentView; if (!d->AttachEvent) { d->AttachEvent = true; OnCreate(); } } else { LAssert(0); } if (!p->Children.HasItem(this)) { p->Children.Add(this); OnAttach(); } return true; } bool LView::Attach(LViewI *parent) { if (_Attach(parent)) { if (d->Parent && !d->Parent->HasView(this)) d->Parent->AddView(this); d->Parent->OnChildrenChanged(this, true); return true; } LgiTrace("%s:%i - Attaching '%s' failed.\n", _FL, GetClass()); return false; } void LView::_Delete() { LAutoPool Pool; if (_Over == this) _Over = 0; if (_Capturing == this) _Capturing = 0; if (LAppInst && LAppInst->AppWnd == this) { LAppInst->AppWnd = NULL; } SetPulse(); Pos.ZOff(-1, -1); LViewI *c; auto it = Children.begin(); while ((c = *it)) { LViewI *p = c->GetParent(); if (p != (LViewI*)this) { printf("Error: LView::_Delete, child not attached correctly: %p(%s) Parent: %p(%s)\n", c, c->Name(), c->GetParent(), c->GetParent() ? c->GetParent()->Name() : ""); Children.Delete(it); } DeleteObj(c); } Detach(); } bool LView::Detach() { LAutoPool Pool; bool Status = false; // Detach view if (_Window) { LWindow *Wnd = dynamic_cast(_Window); if (Wnd) Wnd->SetFocus(this, LWindow::ViewDelete); _Window = NULL; } if (d->Parent) { // Remove the view from the parent int D = 0; while (d->Parent->HasView(this)) { d->Parent->DelView(this); D++; } if (D > 1) { printf("%s:%i - Error: View %s(%p) was in %s(%p) list %i times.\n", _FL, GetClass(), this, d->Parent->GetClass(), d->Parent, D); } d->Parent->OnChildrenChanged(this, false); d->Parent = NULL; } Status = true; return Status; } //////////////////////////////// uint32 CursorData[] = { 0x02020202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020102, 0x02020202, 0x02020202, 0x01010101, 0x01010101, 0x01010101, 0x02020202, 0x02020202, 0x02010101, 0x02010101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010102, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020102, 0x01020202, 0x02020202, 0x02020202, 0x02020202, 0x01010101, 0x01010101, 0x02020201, 0x02020202, 0x01010101, 0x01010101, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020102, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02010101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02010102, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x01010101, 0x02020202, 0x02020202, 0x02020101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x01000000, 0x02020202, 0x02020202, 0x01000001, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020101, 0x01020202, 0x02020201, 0x02020202, 0x02020202, 0x00000102, 0x00000000, 0x02020201, 0x02020202, 0x00000001, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00010102, 0x00000000, 0x02020101, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x00010001, 0x00010001, 0x01000001, 0x02020202, 0x02020202, 0x00010102, 0x02020101, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x00010202, 0x00000000, 0x02020201, 0x02020202, 0x00000001, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02010000, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x01000102, 0x00000100, 0x02010000, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x00000000, 0x02020100, 0x02020202, 0x02020202, 0x00010202, 0x02020100, 0x01020202, 0x02010000, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x02020201, 0x02020202, 0x00000001, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x01020202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x00010101, 0x01000000, 0x02020202, 0x00000001, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x00010202, 0x00000001, 0x02020100, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x00000000, 0x02010000, 0x02020202, 0x02020202, 0x00000102, 0x01010100, 0x01010101, 0x01000000, 0x02020202, 0x02020201, 0x00010202, 0x00000000, 0x02020201, 0x02020202, 0x00000001, 0x02010000, 0x02020202, 0x02020201, 0x02020202, 0x02020202, 0x01010102, 0x01010001, 0x02020101, 0x02020202, 0x02020202, 0x01020201, 0x02010000, 0x02020102, 0x02020202, 0x02020202, 0x01010101, 0x01010100, 0x02020201, 0x02020202, 0x02020202, 0x01000001, 0x02020101, 0x02020202, 0x02020202, 0x00010202, 0x01010000, 0x01020202, 0x00000001, 0x02020201, 0x00000001, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x01010101, 0x01000001, 0x01010101, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x02020201, 0x02020101, 0x00000102, 0x00000100, 0x02020201, 0x02020202, 0x01000001, 0x01000000, 0x01020202, 0x02020201, 0x02020202, 0x02020202, 0x02020201, 0x02010001, 0x02010202, 0x02020202, 0x01020202, 0x01020201, 0x02010000, 0x02010102, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x01010000, 0x02020101, 0x02020202, 0x00000102, 0x01000000, 0x02020202, 0x00000102, 0x02020100, 0x00000001, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x02020201, 0x02010001, 0x00000001, 0x00010201, 0x02020201, 0x02020202, 0x02010001, 0x00000001, 0x00010201, 0x02020201, 0x02020202, 0x01020202, 0x02020201, 0x02010001, 0x01010202, 0x02020202, 0x00010202, 0x01020201, 0x02010000, 0x01000102, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02010102, 0x00000001, 0x00000000, 0x02010000, 0x02020202, 0x00000102, 0x00000001, 0x02020201, 0x00010202, 0x02020100, 0x00000001, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x01010100, 0x01010101, 0x01000000, 0x02020202, 0x01000001, 0x01000000, 0x01020202, 0x02020201, 0x02020202, 0x02020101, 0x00000102, 0x00000100, 0x02020201, 0x02020202, 0x00010202, 0x02020201, 0x02010001, 0x00010202, 0x02020201, 0x00000102, 0x01010101, 0x01010000, 0x00000101, 0x02020201, 0x01010101, 0x01010101, 0x01010100, 0x01010101, 0x02020201, 0x01000001, 0x00000001, 0x00000000, 0x02010000, 0x02020202, 0x00000001, 0x00000101, 0x02020100, 0x00010202, 0x02010000, 0x00000001, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x01010102, 0x01010101, 0x01010001, 0x01010101, 0x02020101, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02020100, 0x01020202, 0x02010000, 0x02020202, 0x00000001, 0x02010000, 0x02020202, 0x02020201, 0x02020202, 0x02020201, 0x00010202, 0x00000000, 0x02020201, 0x02020202, 0x00000102, 0x01010101, 0x01010001, 0x00010101, 0x02020100, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x02020100, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x02020201, 0x00000001, 0x00000000, 0x00000000, 0x02010000, 0x02020202, 0x01000001, 0x00010202, 0x02010000, 0x01020202, 0x02010000, 0x00000001, 0x00000000, 0x02020100, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02020100, 0x02020202, 0x02020202, 0x01010101, 0x01010100, 0x02020201, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x02010000, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x01020202, 0x02020100, 0x02020202, 0x00000001, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x02020201, 0x02020202, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x02010000, 0x00000102, 0x01010101, 0x01010000, 0x00000101, 0x02020201, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x02020201, 0x00000102, 0x00000000, 0x00000000, 0x02010000, 0x02020202, 0x01000001, 0x01020202, 0x01000000, 0x01020202, 0x02010000, 0x00000001, 0x00000000, 0x02010000, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02010000, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x01010102, 0x01010101, 0x01010001, 0x01010101, 0x02020101, 0x01020202, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020101, 0x01020202, 0x02020201, 0x02020202, 0x00000001, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x00000000, 0x02020201, 0x02020202, 0x00000102, 0x01010101, 0x01010001, 0x00010101, 0x02020100, 0x00010202, 0x01020201, 0x02010000, 0x01000102, 0x02020202, 0x01010101, 0x01010101, 0x01010100, 0x01010101, 0x02020201, 0x00010202, 0x00000000, 0x00000000, 0x02010000, 0x02020202, 0x01000001, 0x02020202, 0x00000001, 0x01020201, 0x02010000, 0x00000001, 0x01000000, 0x02010101, 0x02020202, 0x02020202, 0x00000001, 0x01000000, 0x02010101, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x00010202, 0x01000001, 0x02020100, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x01010101, 0x01000001, 0x01010101, 0x02020202, 0x02020202, 0x02020202, 0x02020102, 0x01020202, 0x02020202, 0x02020202, 0x00000001, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x00000000, 0x02020201, 0x02020202, 0x00010202, 0x02020201, 0x02010001, 0x00010202, 0x02020201, 0x01020202, 0x01020201, 0x02010000, 0x02010102, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x00000000, 0x02010000, 0x02020202, 0x00000001, 0x02020201, 0x00000102, 0x00010100, 0x02010000, 0x00000001, 0x01000001, 0x01020202, 0x01010101, 0x01010101, 0x00000001, 0x01000001, 0x01020202, 0x01010101, 0x01010101, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x01000102, 0x01000001, 0x02010001, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x00000000, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01010101, 0x01010101, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x01010101, 0x01010101, 0x02020201, 0x02020202, 0x01020202, 0x02020201, 0x02010001, 0x01010202, 0x02020202, 0x02020202, 0x01020201, 0x02010000, 0x02020102, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02020100, 0x02020202, 0x00000102, 0x02020201, 0x00010202, 0x00010000, 0x02020100, 0x01000001, 0x01000001, 0x01020202, 0x00000000, 0x01000000, 0x01000001, 0x01000001, 0x01020202, 0x00000000, 0x01000000, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x00010001, 0x00000000, 0x01000100, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x00000000, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020201, 0x02010001, 0x02010202, 0x02020202, 0x02020202, 0x01020202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x01010101, 0x01010100, 0x02020201, 0x02020202, 0x02020202, 0x00000102, 0x00000000, 0x02020201, 0x02020202, 0x00000102, 0x02020100, 0x01020202, 0x00000000, 0x02020100, 0x02010001, 0x00000102, 0x01020201, 0x01010000, 0x01000001, 0x02010001, 0x00000102, 0x01020201, 0x01010100, 0x01000001, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x01000000, 0x02020202, 0x02020202, 0x00010202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01010102, 0x01010001, 0x02020101, 0x02020202, 0x02020202, 0x01020202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x00000102, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x01010202, 0x01010101, 0x02020202, 0x02020202, 0x00010202, 0x01010000, 0x01020202, 0x00000001, 0x02020201, 0x02020101, 0x00000102, 0x01020201, 0x00000100, 0x01000100, 0x02020101, 0x00000102, 0x01020201, 0x01000100, 0x01000100, 0x01020202, 0x02020101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x01010101, 0x01010101, 0x01010101, 0x02020202, 0x02020202, 0x00010102, 0x02020101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x00000000, 0x02020201, 0x02020202, 0x02020202, 0x01020202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x00010202, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x00010101, 0x01000000, 0x02020202, 0x02020202, 0x00010202, 0x01020100, 0x00000100, 0x01000000, 0x02020202, 0x00010202, 0x01020100, 0x01000100, 0x01000100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01000001, 0x02010000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010102, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02010101, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x02020100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00000001, 0x00000000, 0x02010000, 0x02020202, 0x02020202, 0x00010202, 0x01020100, 0x00000100, 0x01000100, 0x02020202, 0x00010202, 0x01020100, 0x01000100, 0x01000100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010101, 0x02010101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02010001, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020201, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x00010102, 0x00000000, 0x02020101, 0x02020202, 0x02020202, 0x01020202, 0x01020201, 0x01010000, 0x01000001, 0x02020202, 0x01020202, 0x01020201, 0x01000100, 0x01000100, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020102, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020102, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x01010101, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x01000000, 0x02020202, 0x02020202, 0x01020202, 0x00000000, 0x01000000, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x02020202, 0x01020202, 0x01010101, 0x01010101, 0x02020202, 0x02020202, 0x01020202, 0x01010101, 0x01010101, }; diff --git a/src/mac/cocoa/Window.mm b/src/mac/cocoa/Window.mm --- a/src/mac/cocoa/Window.mm +++ b/src/mac/cocoa/Window.mm @@ -1,1424 +1,1430 @@ #include #include "lgi/common/Lgi.h" #include "lgi/common/DragAndDrop.h" #include "lgi/common/Popup.h" #include "lgi/common/DisplayString.h" #include "lgi/common/Menu.h" #include "LCocoaView.h" extern void NextTabStop(LViewI *v, int dir); extern void SetDefaultFocus(LViewI *v); extern void BuildTabStops(LArray &Stops, LViewI *v); #define DEBUG_KEYS 0 #define DEBUG_SETFOCUS 0 #define DEBUG_LOGGING 0 #if DEBUG_LOGGING #define LOG(...) printf(__VA_ARGS__) #else #define LOG(...) #endif /* Deleting a LWindow senarios: Users clicks close: NSWindowDelegate::windowWillClose GWindowPrivate::OnClose(CloseUser) LNsWindow::onDelete Something deletes the LWindow programmatically: LWindow::~LWindow GWindowPriv::OnClose(CloseDestructor) LNsWindow::onDelete self.close windowWillClose -> block Something calls LWindow::Quit() LNsWindow::onQuit (async) self.close NSWindowDelegate::windowWillClose GWindowPrivate::OnClose(CloseUser) LNsWindow::onDelete */ #if DEBUG_SETFOCUS || DEBUG_KEYS static GString DescribeView(GViewI *v) { if (!v) return GString(); char s[512]; int ch = 0; GArray p; for (GViewI *i = v; i; i = i->GetParent()) { p.Add(i); } for (int n=MIN(3, (int)p.Length()-1); n>=0; n--) { char Buf[256] = ""; if (!stricmp(v->GetClass(), "GMdiChild")) sprintf(Buf, "'%s'", v->Name()); v = p[n]; ch += sprintf_s(s + ch, sizeof(s) - ch, "%s>%s", Buf, v->GetClass()); } return s; } #endif LRect LScreenFlip(LRect r) { LRect screen(0, 0, -1, -1); for (NSScreen *s in [NSScreen screens]) { LRect pos = s.frame; if (r.Overlap(&pos)) { screen = pos; break; } } if (screen.Valid()) { LRect rc = r; rc.Offset(0, (screen.Y() - r.y1 - r.Y()) - r.y1); // printf("%s:%i - Flip %s -> %s (%s)\n", _FL, r.GetStr(), rc.GetStr(), screen.GetStr()); return rc; } else { // printf("%s:%i - No Screen?\n", _FL); r.ZOff(-1, -1); } return r; } /////////////////////////////////////////////////////////////////////// class HookInfo { public: int Flags; LView *Target; }; @interface LWindowDelegate : NSObject { } - (id)init; - (void)dealloc; - (void)windowDidResize:(NSNotification*)aNotification; - (void)windowDidMove:(NSNotification*)aNotification; - (void)windowWillClose:(NSNotification*)aNotification; - (BOOL)windowShouldClose:(id)sender; - (void)windowDidBecomeMain:(NSNotification*)notification; - (void)windowDidResignMain:(NSNotification*)notification; @end LWindowDelegate *Delegate = nil; class LWindowPrivate { public: LWindow *Wnd; LDialog *ChildDlg; LMenu *EmptyMenu; LViewI *Focus; NSView *ContentCache; int Sx, Sy; LKey LastKey; LArray Hooks; uint64 LastMinimize; uint64 LastDragDrop; bool DeleteOnClose; bool SnapToEdge; bool InitVisible; LWindowPrivate(LWindow *wnd) { ContentCache = NULL; Focus = NULL; InitVisible = false; LastMinimize = 0; Wnd = wnd; LastDragDrop = 0; DeleteOnClose = true; ChildDlg = 0; Sx = Sy = -1; SnapToEdge = false; EmptyMenu = 0; } ~LWindowPrivate() { DeleteObj(EmptyMenu); } void OnClose(LCloseContext Ctx) { LOG("GWindowPrivate::OnClose %p/%s\n", Wnd, Wnd?Wnd->GetClass():NULL); auto &osw = Wnd->Wnd; if (!osw) return; LCocoaView *cv = objc_dynamic_cast(LCocoaView, osw.p.contentView); if (cv) cv.w = NULL; LNsWindow *w = objc_dynamic_cast(LNsWindow, osw.p); if (w) [w onDelete:Ctx]; osw.p.delegate = nil; [osw.p autorelease]; osw = nil; if (DeleteOnClose) delete Wnd; } ssize_t GetHookIndex(LView *Target, bool Create = false) { for (int i=0; iTarget = Target; n->Flags = 0; return Hooks.Length() - 1; } } return -1; } void OnResize() { NSWindow *wnd = Wnd->WindowHandle().p; Wnd->Pos = wnd.frame; Wnd->OnPosChange(); wnd.contentView.needsLayout = YES; } }; @implementation LNsWindow - (id)init:(LWindowPrivate*)priv Frame:(NSRect)rc { NSUInteger windowStyleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable; if ((self = [super initWithContentRect:rc styleMask:windowStyleMask backing:NSBackingStoreBuffered defer:NO ]) != nil) { self.d = priv; self->ReqClose = CSNone; self.contentView = [[LCocoaView alloc] init:priv->Wnd]; [self makeFirstResponder:self.contentView]; self.acceptsMouseMovedEvents = true; self.ignoresMouseEvents = false; // printf("LNsWindow.init\n"); } return self; } - (void)dealloc { if (self.d) self.d->Wnd->OnDealloc(); LCocoaView *cv = objc_dynamic_cast(LCocoaView, self.contentView); cv.w = NULL; [cv release]; self.contentView = NULL; [super dealloc]; // printf("LNsWindow.dealloc.\n"); } - (LWindow*)getWindow { return self.d ? self.d->Wnd : nil; } - (BOOL)canBecomeKeyWindow { return YES; } - (void)onQuit { #if DEBUG_LOGGING LWindow *wnd = self.d ? self.d->Wnd : NULL; auto cls = wnd ? wnd->GetClass() : NULL; #endif LOG("LNsWindow::onQuit %p/%s %i\n", wnd, cls, self->ReqClose); if (self->ReqClose == CSNone) { self->ReqClose = CSInRequest; if (!self.d) LOG("%s:%i - No priv pointer?\n", _FL); if (!self.d || !self.d->Wnd || !self.d->Wnd->OnRequestClose(false)) { LOG(" ::onQuit %p/%s no 'd' or OnReqClose failed\n", wnd, cls); self->ReqClose = CSNone; return; } } else return; LOG(" ::onQuit %p/%s self.close\n", wnd, cls); self->ReqClose = CSClosed; self.d->Wnd->SetPulse(); [self close]; } - (void)onDelete:(LCloseContext)ctx { LOG("LNsWindow::onDelete %p/%s\n", self.d->Wnd, self.d->Wnd->GetClass()); if (ctx == CloseDestructor && self->ReqClose != CSClosed) { // This is called during the ~LWindow destructor to make sure we // closed the window self->ReqClose = CSClosed; LOG(" ::onDelete %p self.close\n", self.d->Wnd); [self close]; } self.d = NULL; } @end @implementation LWindowDelegate - (id)init { if ((self = [super init]) != nil) { } return self; } - (void)dealloc { [super dealloc]; } - (void)windowDidResize:(NSNotification*)event { LNsWindow *w = event.object; if (w && w.d) w.d->OnResize(); } - (void)windowDidMove:(NSNotification*)event { // LNsWindow *w = event.object; // GRect r = LScreenFlip(w.frame); // printf("windowDidMove: %s\n", r.GetStr()); } - (BOOL)windowShouldClose:(NSWindow*)sender { LNsWindow *w = objc_dynamic_cast(LNsWindow, sender); if (w && w.d && w.d->Wnd) return w.d->Wnd->OnRequestClose(false); return YES; } - (void)windowWillClose:(NSNotification*)event { LNsWindow *w = event.object; if (w && w.d) w.d->OnClose(CloseUser); } - (void)windowDidBecomeMain:(NSNotification*)event { LNsWindow *w = event.object; if (w && w.d) w.d->Wnd->OnFrontSwitch(true); } - (void)windowDidResignMain:(NSNotification*)event { LNsWindow *w = event.object; if (w && w.d) w.d->Wnd->OnFrontSwitch(false); } @end /////////////////////////////////////////////////////////////////////// #define GWND_CREATE 0x0010000 #if __has_feature(objc_arc) #error "NO ARC!" #endif LWindow::LWindow(OsWindow wnd) : LView(NULL) { d = new LWindowPrivate(this); _QuitOnClose = false; Wnd = NULL; Menu = 0; _Default = 0; _Window = this; WndFlags |= GWND_CREATE; LView::Visible(false); _Lock = new LMutex("LWindow"); LRect pos(200, 200, 200, 200); NSRect frame = pos; if (wnd) Wnd = wnd; else Wnd.p = [[LNsWindow alloc] init:d Frame:frame]; if (Wnd) { [Wnd.p retain]; if (!Delegate) Delegate = [[LWindowDelegate alloc] init]; //[Wnd.p makeKeyAndOrderFront:NSApp]; Wnd.p.delegate = Delegate; d->ContentCache = Wnd.p.contentView; } } LWindow::~LWindow() { LOG("LWindow::~LWindow %p\n", this); if (LAppInst->AppWnd == this) LAppInst->AppWnd = 0; _Delete(); d->DeleteOnClose = false; // We're already in the destructor, don't redelete. d->OnClose(CloseDestructor); DeleteObj(Menu); DeleteObj(d); DeleteObj(_Lock); } NSView *LWindow::Handle() { if (!InThread()) return d->ContentCache; if (Wnd.p != nil) return Wnd.p.contentView; return NULL; } +bool LWindow::SetTitleBar(bool ShowTitleBar) +{ + #warning "Impl LWindow::SetTitleBar" + return false; +} + bool LWindow::SetIcon(const char *FileName) { return false; } LViewI *LWindow::GetFocus() { return d->Focus; } void LWindow::SetFocus(LViewI *ctrl, FocusType type) { const char *TypeName = NULL; switch (type) { case GainFocus: TypeName = "Gain"; break; case LoseFocus: TypeName = "Lose"; break; case ViewDelete: TypeName = "Delete"; break; } switch (type) { case GainFocus: { // Check if the control already has focus if (d->Focus == ctrl) return; if (d->Focus) { LView *v = d->Focus->GetGView(); if (v) v->WndFlags &= ~GWF_FOCUS; d->Focus->OnFocus(false); d->Focus->Invalidate(); #if DEBUG_SETFOCUS auto _foc = DescribeView(d->Focus); LgiTrace(".....defocus: %s\n", _foc.Get()); #endif } d->Focus = ctrl; if (d->Focus) { LView *v = d->Focus->GetGView(); if (v) v->WndFlags |= GWF_FOCUS; d->Focus->OnFocus(true); d->Focus->Invalidate(); #if DEBUG_SETFOCUS auto _set = DescribeView(d->Focus); LgiTrace("LWindow::SetFocus(%s, %s) focusing\n", _set.Get(), TypeName); #endif } break; } case LoseFocus: { if (ctrl == d->Focus) { LView *v = d->Focus->GetGView(); if (v) { if (v->WndFlags & GWF_FOCUS) { // View thinks it has focus v->WndFlags &= ~GWF_FOCUS; d->Focus->OnFocus(false); // keep d->Focus pointer, as we want to be able to re-focus the child // view when we get focus again #if DEBUG_SETFOCUS auto _ctrl = DescribeView(ctrl); auto _foc = DescribeView(d->Focus); LgiTrace("LWindow::SetFocus(%s, %s) keep_focus: %s\n", _ctrl.Get(), TypeName, _foc.Get()); #endif } // else view doesn't think it has focus anyway... } else { // Non GView handler d->Focus->OnFocus(false); d->Focus->Invalidate(); d->Focus = NULL; } } else { /* LgiTrace("LWindow::SetFocus(%p.%s, %s) error on losefocus: %p(%s)\n", ctrl, ctrl ? ctrl->GetClass() : NULL, TypeName, d->Focus, d->Focus ? d->Focus->GetClass() : NULL); */ } break; } case ViewDelete: { if (ctrl == d->Focus) { #if DEBUG_SETFOCUS LgiTrace("LWindow::SetFocus(%p.%s, %s) delete_focus: %p(%s)\n", ctrl, ctrl ? ctrl->GetClass() : NULL, TypeName, d->Focus, d->Focus ? d->Focus->GetClass() : NULL); #endif d->Focus = NULL; } break; } } } void LWindow::SetDragHandlers(bool On) { #if 0 if (Wnd && _View) SetAutomaticControlDragTrackingEnabledForWindow(Wnd, On); #endif } void LWindow::Quit(bool DontDelete) { // LAutoPool Pool; if (_QuitOnClose) { _QuitOnClose = false; LCloseApp(); } if (Wnd) SetDragHandlers(false); if (d && DontDelete) { // If DontDelete is true, we should be already in the destructor of the LWindow. // Which means we DON'T call onQuit, as it's too late to ask the user if they don't // want to close the window. The window IS closed come what may, and the object is // going away. Futhermore we can't access the window's memory after it's deleted and // that may happen if the onQuit is processed after ~LWindow. d->DeleteOnClose = false; if (Wnd) [Wnd.p close]; } else if (Wnd) { [Wnd.p performSelectorOnMainThread:@selector(onQuit) withObject:nil waitUntilDone:false]; } } void LWindow::SetChildDialog(LDialog *Dlg) { d->ChildDlg = Dlg; } bool LWindow::GetSnapToEdge() { return d->SnapToEdge; } void LWindow::SetSnapToEdge(bool s) { d->SnapToEdge = s; } void LWindow::OnFrontSwitch(bool b) { if (b && Menu) { [NSApplication sharedApplication].mainMenu = Menu->Handle().p; } else { auto m = LAppInst->Default.Get(); [NSApplication sharedApplication].mainMenu = m ? m->Handle() : nil; } // printf("%s:%i - menu for %s is %p\n", _FL, Name(), [NSApplication sharedApplication].mainMenu); } bool LWindow::Visible() { // LAutoPool Pool; if (!Wnd) return false; return [Wnd.p isVisible]; } void LWindow::Visible(bool i) { // LAutoPool Pool; if (!Wnd) return; if (i) { d->InitVisible = true; PourAll(); [Wnd.p makeKeyAndOrderFront:NULL]; [NSApp activateIgnoringOtherApps:YES]; SetDefaultFocus(this); OnPosChange(); } else { [Wnd.p orderOut:Wnd.p]; } } bool LWindow::IsActive() { return Wnd ? [Wnd.p isKeyWindow] : false; } bool LWindow::SetActive() { [[NSApplication sharedApplication] activateIgnoringOtherApps : YES]; return false; } void LWindow::SetDeleteOnClose(bool i) { d->DeleteOnClose = i; } void LWindow::SetAlwaysOnTop(bool b) { } bool LWindow::PostEvent(int Event, LMessage::Param a, LMessage::Param b, int64_t TimeoutMs) { return LAppInst->PostEvent(this, Event, a, b); } bool LWindow::Attach(LViewI *p) { bool Status = false; if (Wnd) { if (LBase::Name()) Name(LBase::Name()); Status = true; // Setup default button... if (!_Default) { _Default = FindControl(IDOK); if (_Default) _Default->Invalidate(); } OnCreate(); OnAttach(); OnPosChange(); // Set the first control as the focus... NextTabStop(this, 0); } return Status; } bool LWindow::OnRequestClose(bool OsShuttingDown) { if (GetQuitOnClose()) { LCloseApp(); } return LView::OnRequestClose(OsShuttingDown); } bool LWindow::HandleViewMouse(LView *v, LMouse &m) { if (m.Down()) { bool ParentPopup = false; LViewI *p = m.Target; while (p && p->GetParent()) { if (dynamic_cast(p)) { ParentPopup = true; break; } p = p->GetParent(); } if (!ParentPopup) { for (int i=0; iVisible()) { // printf("Hiding popup %s\n", pu->GetClass()); pu->Visible(false); } } } if (!m.IsMove() && LAppInst) { auto mh = LAppInst->GetMouseHook(); if (mh) mh->TrackClick(v); } } for (int i=0; iHooks.Length(); i++) { if (d->Hooks[i].Flags & LMouseEvents) { if (!d->Hooks[i].Target->OnViewMouse(v, m)) { return false; } } } return true; } bool LWindow::HandleViewKey(LView *v, LKey &k) { bool Status = false; LViewI *Ctrl = NULL; if (!v && d->Focus) v = d->Focus->GetGView(); if (!v) { #if DEBUG_KEYS k.Trace("No focus view to handle key."); #endif return false; } // Give key to popups if (LAppInst && LAppInst->GetMouseHook() && LAppInst->GetMouseHook()->OnViewKey(v, k)) { goto AllDone; } // Allow any hooks to see the key... for (int i=0; iHooks.Length(); i++) { if (d->Hooks[i].Flags & LKeyEvents) { if (d->Hooks[i].Target->OnViewKey(v, k)) { Status = true; #if DEBUG_KEYS printf("Hook ate '%c'(%i) down=%i alt=%i ctrl=%i sh=%i\n", k.c16, k.c16, k.Down(), k.Alt(), k.Ctrl(), k.Shift()); #endif goto AllDone; } } } // Give the key to the window... if (v->OnKey(k)) { #if DEBUG_KEYS GString vv = DescribeView(v); printf("%s ate '%c'(%i) down=%i alt=%i ctrl=%i sh=%i\n", vv.Get(), k.c16, k.c16, k.Down(), k.Alt(), k.Ctrl(), k.Shift()); #endif Status = true; goto AllDone; } // Window didn't want the key... switch (k.vkey) { case LK_RETURN: case LK_KEYPADENTER: { Ctrl = _Default; break; } case LK_ESCAPE: { Ctrl = FindControl(IDCANCEL); break; } case LK_TAB: { // Go to the next control? if (k.Down()) { LArray Stops; BuildTabStops(Stops, v->GetWindow()); ssize_t Idx = Stops.IndexOf(v); if (Idx >= 0) { if (k.Shift()) { Idx--; if (Idx < 0) Idx = Stops.Length() - 1; } else { Idx++; if (Idx >= Stops.Length()) Idx = 0; } Stops[Idx]->Focus(true); } } return true; } } if (Ctrl && Ctrl->Enabled()) { if (Ctrl->OnKey(k)) { Status = true; #if DEBUG_KEYS printf("Default Button ate '%c'(%i) down=%i alt=%i ctrl=%i sh=%i\n", k.c16, k.c16, k.Down(), k.Alt(), k.Ctrl(), k.Shift()); #endif goto AllDone; } } if (Menu) { Status = Menu->OnKey(v, k); if (Status) { #if DEBUG_KEYS printf("Menu ate '%c' down=%i alt=%i ctrl=%i sh=%i\n", k.c16, k.Down(), k.Alt(), k.Ctrl(), k.Shift()); #endif } } // Command+W closes the window... if it doesn't get nabbed earlier. if (k.Down() && k.System() && tolower(k.c16) == 'w') { // Close Quit(); return true; } AllDone: if (d) d->LastKey = k; else LAssert(!"Window was deleted and we are accessing unallocated mem."); return Status; } void LWindow::Raise() { if (Wnd) { // BringToFront(Wnd); } } LWindowZoom LWindow::GetZoom() { if (Wnd) { #if 0 bool c = IsWindowCollapsed(Wnd); // printf("IsWindowCollapsed=%i\n", c); if (c) return LZoomMin; c = IsWindowInStandardState(Wnd, NULL, NULL); // printf("IsWindowInStandardState=%i\n", c); if (!c) return LZoomMax; #endif } return LZoomNormal; } void LWindow::SetZoom(LWindowZoom i) { #if 0 OSStatus e = 0; switch (i) { case LZoomMin: { e = CollapseWindow(Wnd, true); if (e) printf("%s:%i - CollapseWindow failed with %i\n", _FL, (int)e); // else printf("LZoomMin ok.\n"); break; } default: case LZoomNormal: { e = CollapseWindow(Wnd, false); if (e) printf("%s:%i - [Un]CollapseWindow failed with %i\n", _FL, (int)e); // else printf("LZoomNormal ok.\n"); break; } } #endif } LViewI *LWindow::GetDefault() { return _Default; } void LWindow::SetDefault(LViewI *v) { if (v && v->GetWindow() == (LViewI*)this) { if (_Default != v) { auto Old = _Default; _Default = v; if (Old) Old->Invalidate(); if (_Default) _Default->Invalidate(); } } else { _Default = 0; } } bool LWindow::Name(const char *n) { // LAutoPool Pool; bool Status = LBase::Name(n); if (Wnd) { NSString *ns = [NSString stringWithCString:n encoding:NSUTF8StringEncoding]; Wnd.p.title = ns; //[ns release]; } return Status; } const char *LWindow::Name() { return LBase::Name(); } LRect &LWindow::GetClient(bool ClientSpace) { // LAutoPool Pool; static LRect r; if (Wnd) { r = Wnd.p.contentView.frame; if (ClientSpace) r.Offset(-r.x1, -r.y1); } else { r.ZOff(-1, -1); } return r; } bool LWindow::SerializeState(LDom *Store, const char *FieldName, bool Load) { if (!Store || !FieldName) return false; if (Load) { LVariant v; if (Store->GetValue(FieldName, v) && v.Str()) { LRect Position(0, 0, -1, -1); LWindowZoom State = LZoomNormal; auto t = LString(v.Str()).SplitDelimit(";"); for (auto s: t) { auto v = s.SplitDelimit("=", 1); if (v.Length() == 2) { if (v[0].Equals("State")) State = (LWindowZoom)v[1].Int(); else if (v[0].Equals("Pos")) Position.SetStr(v[1]); } else return false; } if (Position.Valid()) { if (Position.X() < 64) Position.x2 = Position.x1 + 63; if (Position.Y() < 64) Position.y2 = Position.y1 + 63; SetPos(Position); } SetZoom(State); } else return false; } else { char s[256]; LWindowZoom State = GetZoom(); sprintf(s, "State=%i;Pos=%s", State, GetPos().GetStr()); LVariant v = s; if (!Store->SetValue(FieldName, v)) return false; } return true; } LPoint LWindow::GetDpi() { return LScreenDpi(); } LPointF LWindow::GetDpiScale() { auto Dpi = GetDpi(); return LPointF(Dpi.x / 100.0, Dpi.y / 100.0); } LRect &LWindow::GetPos() { // LAutoPool Pool; if (Wnd) { Pos = LScreenFlip(Wnd.p.frame); // printf("%s::GetPos %s\n", GetClass(), Pos.GetStr()); } return Pos; } bool LWindow::SetPos(LRect &p, bool Repaint) { // LAutoPool Pool; Pos = p; if (Wnd) { LRect r = LScreenFlip(p); [Wnd.p setFrame:r display:YES]; // printf("%s::SetPos %s\n", GetClass(), Pos.GetStr()); } return true; } void LWindow::OnChildrenChanged(LViewI *Wnd, bool Attaching) { if (dynamic_cast(Wnd)) { printf("%s:%i - Ignoring GPopup in OnChildrenChanged handler.\n", _FL); return; } PourAll(); } void LWindow::OnCreate() { } void LWindow::OnPaint(LSurface *pDC) { pDC->Colour(L_MED); pDC->Rectangle(); } void LWindow::OnPosChange() { LView::OnPosChange(); if (d->Sx != X() || d->Sy != Y()) { PourAll(); d->Sx = X(); d->Sy = Y(); } } #define IsTool(v) \ ( \ dynamic_cast(v) \ && \ dynamic_cast(v)->_IsToolBar \ ) void LWindow::PourAll() { LRect r = GetClient(); // printf("::Pour r=%s\n", r.GetStr()); LRegion Client(r); LRegion Update(Client); bool HasTools = false; LViewI *v; List::I Lst = Children.begin(); { LRegion Tools; for (v = *Lst; v; v = *++Lst) { if (IsTool(v)) { LRect OldPos = v->GetPos(); Update.Union(&OldPos); if (HasTools) { // 2nd and later toolbars if (v->Pour(Tools)) { if (!v->Visible()) { v->Visible(true); } if (OldPos != v->GetPos()) { // position has changed update... v->Invalidate(); } Tools.Subtract(&v->GetPos()); Update.Subtract(&v->GetPos()); } } else { // First toolbar if (v->Pour(Client)) { HasTools = true; if (!v->Visible()) { v->Visible(true); } if (OldPos != v->GetPos()) { v->Invalidate(); } LRect Bar(v->GetPos()); Bar.x2 = GetClient().x2; Tools = Bar; Tools.Subtract(&v->GetPos()); Client.Subtract(&Bar); Update.Subtract(&Bar); } } } } } Lst = Children.begin(); for (LViewI *v = *Lst; v; v = *++Lst) { if (!IsTool(v)) { LRect OldPos = v->GetPos(); Update.Union(&OldPos); if (v->Pour(Client)) { if (!v->Visible()) { v->Visible(true); } v->Invalidate(); Client.Subtract(&v->GetPos()); Update.Subtract(&v->GetPos()); } else { // non-pourable } } } for (int i=0; iMsg()) { case M_CLOSE: { if (Wnd) [Wnd.p performSelectorOnMainThread:@selector(onQuit) withObject:nil waitUntilDone:false]; else LAssert(!"No window?"); break; } case M_DESTROY: { delete this; return true; } } return LView::OnEvent(m); } bool LWindow::RegisterHook(LView *Target, LWindowHookType EventType, int Priority) { bool Status = false; if (Target && EventType) { ssize_t i = d->GetHookIndex(Target, true); if (i >= 0) { d->Hooks[i].Flags = EventType; Status = true; } } return Status; } bool LWindow::UnregisterHook(LView *Target) { ssize_t i = d->GetHookIndex(Target); if (i >= 0) { d->Hooks.DeleteAt(i); return true; } return false; } LViewI *LWindow::WindowFromPoint(int x, int y, int DebugDepth) { for (int i=0; iVisible()) { auto r = p->GetPos(); if (r.Overlap(x, y)) { // printf("WindowFromPoint got %s click (%i,%i)\n", p->GetClass(), x, y); return p->WindowFromPoint(x - r.x1, y - r.y1, DebugDepth ? DebugDepth + 1 : 0); } } } return LView::WindowFromPoint(x, y, DebugDepth ? DebugDepth + 1 : 0); } int LWindow::OnCommand(int Cmd, int Event, OsView SrcCtrl) { #if 0 OsView v; switch (Cmd) { case kHICommandCut: { OSErr e = GetKeyboardFocus(Wnd, (ControlRef*) &v); if (!e) LgiPostEvent(v, M_CUT); break; } case kHICommandCopy: { OSErr e = GetKeyboardFocus(Wnd, (ControlRef*) &v); if (!e) LgiPostEvent(v, M_COPY); break; } case kHICommandPaste: { OSErr e = GetKeyboardFocus(Wnd, (ControlRef*) &v); if (!e) LgiPostEvent(v, M_PASTE); break; } case 'dele': { OSErr e = GetKeyboardFocus(Wnd, (ControlRef*) &v); if (!e) LgiPostEvent(v, M_DELETE); break; } } #endif return 0; } void LWindow::OnTrayClick(LMouse &m) { if (m.Down() || m.IsContextMenu()) { LSubMenu RClick; OnTrayMenu(RClick); if (GetMouse(m, true)) { #if WINNATIVE SetForegroundWindow(Handle()); #endif int Result = RClick.Float(this, m.x, m.y); #if WINNATIVE PostMessage(Handle(), WM_NULL, 0, 0); #endif OnTrayMenuResult(Result); } } } bool LWindow::Obscured() { // LAutoPool Pool; if (!Wnd) return false; auto s = [Wnd.p occlusionState]; return !(s & NSWindowOcclusionStateVisible); }