Skip to content

armgit / WacOS

Public Imported from GitHub
0

A new style desktop shell for Windows 11: menu bar, Dock, Finder, Spotlight, Control Center and Liquid Glass, in native C++.

Rust

macOS 27 Golden Gate theme across the Shell and apps

Eternity07062802c8e4da0b1c
diff --git a/.gitignore b/.gitignore
index 3642dc3..aa01833 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,6 @@ docs/vm-barra/
docs/**/*.dll
docs/**/*.exe
docs/nativo-fontes-*.zip
+
+# macOS 27 icons (Apple, exported by zagnut531): personal use, rebuilt by tools/icones-goldengate.py
+icones/goldengate/
diff --git a/docs/registro-mudancas.txt b/docs/registro-mudancas.txt
index 94ad20b..79b4a6f 100644
--- a/docs/registro-mudancas.txt
+++ b/docs/registro-mudancas.txt
@@ -569,3 +569,5 @@ Compilado (tudo), instalado, Shell e reserva do Finder reiniciados às 23:07 sem
[2026-11-17 13:10 PC] FOTOS PARA O README (docs\screenshots, 11 imagens): área de trabalho, Central de Controle, Notificações, Spotlight e Aplicativos, Finder, Ajustes, Monitor de Atividade, Forçar Encerrar, alerta e os quatro estilos do Dock. As janelas do usuário foram minimizadas durante as fotos e restauradas (wac-janelas.ps1); janelas de outros programas borradas automaticamente pela lista de janelas; borrado à mão: cidade do widget do tempo, miniaturas do Dock, texto das notificações, conta e fotos no Ajustes, usuário na barra do Finder e na coluna Usuário do Monitor. Estilo de ícones lido (padrao) e devolvido. Shell: mensagem nova ShellAbrirPainel (1 Launchpad, 2 Mission Control, 3-6 Spotlight no modo, 7 Spotlight), que entra na fila de entrada da janela da frente para poder vir para a frente. README com a seção Screenshots. Commit local.
[2026-11-17 14:40 PC] (1) Win+E abria o Explorador: com explorer=fundo quem atendia era o Explorador (página "Início", que não é pasta de disco e o Finder não troca; a chave HKCU CLSID\{52205fd8...}\opennewwindow estava certa, mas o Win+E do Windows 11 não passa por ela). main.cpp: o gancho do teclado atende o Win+E (sem Shift/Ctrl) em qualquer modo; mesa::WinKey abre o Finder, ou o Explorador se "Abrir pastas no Finder" estiver desligado. (2) Transparência do vidro no mínimo = totalmente transparente (o usuário): backdrop.cpp AdjustAlpha a *= 2*tintK abaixo de 0,5 (antes sobrava 35 %), véu branco de 5 % some junto; painéis com texto e menus mantêm no mínimo 25 % para dar para ler. Conferido numa foto do Dock com vidro_tinta=0.00 (o ajuste do usuário). Os apps (Finder, Ajustes) usam outro vidro, fora desse controle. Instalado e reiniciado; Win+E não testado (sem simular teclas).
+
+[2026-11-19 PC] TEMA macOS GOLDEN GATE (liquid_glass=1 + golden_gate=1). Registro só ao usar Ajustes > Aparência > Cor do realce do texto: grava HKCU\Control Panel\Colors\Hilight ("R G B") e chama SetSysColors(COLOR_HIGHLIGHT); o valor anterior fica em realce_original no ajustes.txt e volta ao escolher "Automática" (desfazer). Nada mais no registro. Cor das pastas (cor_pastas) e Escuro automático (estilo_escuro_auto) só no ajustes.txt.
diff --git a/src/ajustes/ajustes.h b/src/ajustes/ajustes.h
index 1b73479..283c631 100644
--- a/src/ajustes/ajustes.h
+++ b/src/ajustes/ajustes.h
@@ -28,7 +28,10 @@ struct Row {
bool hasDef = false; float def = 0; // Slider: valor padrão (marca "Padrão" embaixo e ímã ao arrastar)
std::function<void()> click; // Link/Button
std::wstring button; // Button: texto do botão à direita
- float height = 0; // Custom: altura (pt)
+ float height = 0; // Custom: altura (pt); nas outras, > 0 fixa a altura
+ bool noLine = false; // sem a divisória em cima (continua a linha de cima)
+ bool gg = false; // Slider/Popup no desenho do macOS 27 (Aparência)
+ std::function<D2D1_COLOR_F(int)> dot; // Popup do macOS 27: bolinha da opção (a < 0: degradê "automático")
std::function<void(Ctx&, D2D1_RECT_F)> draw; // Custom
std::function<void(D2D1_POINT_2F, D2D1_RECT_F)> clickAt; // Custom: clique (ponto, área da linha)
};
@@ -52,6 +55,7 @@ struct Ctx {
bool dark;
D2D1_COLOR_F text, text2, text3, accent, line, group, control;
IDWriteTextFormat *body, *note, *bold, *title, *glyph, *glyphSmall, *center, *noteCenter;
+ IDWriteTextFormat* noteBoldCenter = nullptr; // 11 pt em negrito, centrado (rótulo escolhido das miniaturas do macOS 27)
};
void Push(const std::wstring& title, Builder b); // abre uma subpágina (com Voltar)
diff --git a/src/ajustes/main.cpp b/src/ajustes/main.cpp
index f109a8c..f100922 100644
--- a/src/ajustes/main.cpp
+++ b/src/ajustes/main.cpp
@@ -27,8 +27,9 @@ float SIDE_W = 215;
const float TOOL_H = 52;
float SIDE_ROW = 28;
const float SIDE_GAP = 12;
-const float SEARCH_Y = 52, SEARCH_H = 28;
-const float ACCOUNT_Y = 90, ACCOUNT_H = 50;
+// SEARCH_Y e ACCOUNT_Y mudam no Golden Gate (ApplyWindowTheme): busca com o centro a 75 e a conta 6 mais abaixo (captura)
+float SEARCH_Y = 52, ACCOUNT_Y = 90;
+const float SEARCH_H = 28, ACCOUNT_H = 50;
const float PAD = 20, GROUP_R = 8, GROUP_GAP = 11;
float ROW_H = 38;
const UINT WM_APP_REBUILD = WM_APP + 1, WM_APP_BITMAP = WM_APP + 2;
@@ -40,6 +41,10 @@ FILE* g_log;
float g_dpi = 96, g_scale = 1;
bool g_dark, g_winActive = true, g_hoverLights;
bool g_tahoe; // tema macOS Tahoe (liquid_glass=1): janela de cantos grandes, barra lateral flutuante, cápsulas
+// macOS 27 Golden Gate (golden_gate=1 junto com o Tahoe), medido nas capturas do 512 Pixels (Ajustes do Sistema, 2x):
+// barra lateral de 231 pt que vai até a borda (cor cheia 236,235,236; sem painel flutuante), linhas de 32 pt com a
+// seleção na cor de destaque pura, 10 pt de recuo e raio 8; conteúdo branco com caixas (247) a ~20 pt das bordas
+bool Golden() { return g_tahoe && tahoe::Golden(); }
float GroupR() { return g_tahoe ? 11.f : GROUP_R; } // caixas mais redondas no Tahoe (guia: group_radius 11)
// Tahoe: estilo de ícones "transparente" (Aparência > Estilo de ícones): símbolos na cor do texto, sem o
// quadradinho colorido; na barra lateral, só o símbolo (como nas capturas do Ajustes do macOS 26)
@@ -48,7 +53,7 @@ bool g_tileBare; // desenhando a barra lateral: no estilo transparente, sem fun
float PanelR() { return std::max(10.f, tahoe::Radius(g_hwnd) - 7); }
D2D1_RECT_F PanelRect(float H) { return D2D1::RectF(7, 7, SIDE_W - 1, std::floor(H - 7)); } // bordas no grid de pixels
-IDWriteTextFormat *g_tfBody, *g_tfSmall, *g_tfBold, *g_tfTitle, *g_tfGlyph, *g_tfGlyphSmall, *g_tfSide, *g_tfCenter, *g_tfSmallCenter,
+IDWriteTextFormat *g_tfSmallBoldCenter, *g_tfBody, *g_tfSmall, *g_tfBold, *g_tfTitle, *g_tfGlyph, *g_tfGlyphSmall, *g_tfSide, *g_tfCenter, *g_tfSmallCenter,
*g_tfName, *g_tfTileText;
ID2D1StrokeStyle* g_round;
@@ -180,7 +185,7 @@ D2D1_COLOR_F aj::Accent() {
std::wstring d = Setting(L"destaque", L"azul");
static const std::pair<const wchar_t*, UINT32> cols[] = {
{ L"azul", 0x007AFF }, { L"roxo", 0x953D96 }, { L"rosa", 0xF74F9E }, { L"vermelho", 0xE0383E },
- { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C } };
+ { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C }, { L"lavanda", 0x98A8D9 } }; // lavanda: a 10ª cor do macOS 27
for (auto& [n, c] : cols) if (d == n) return Rgb(c);
return Rgb(g_dark ? 0x0A84FF : 0x007AFF);
}
@@ -238,6 +243,7 @@ void aj::Tile(Ctx& c, D2D1_RECT_F r, wchar_t glyph, UINT32 color, const std::wst
// Tahoe: os ícones seguem Aparência > Estilo de ícones e widgets, como no Ajustes do macOS 26 — Escuro (quadrado
// grafite com o símbolo na cor dele), Transparente (vidro claro, símbolo claro) e Tingido (vidro na cor de destaque)
std::wstring est = g_tahoe ? aj::Setting(L"estilo_icones", L"padrao") : L"padrao";
+ if (est == L"escuro" && aj::Setting(L"estilo_escuro_auto", L"0") == L"1" && !g_dark) est = L"padrao"; // macOS 27: Escuro "Auto"
if (est == L"escuro" || est == L"transparente" || est == L"tingido") {
auto rr = D2D1::RoundedRect(r, w * 0.24f, w * 0.24f);
D2D1_COLOR_F ink = D2D1::ColorF(1, 1, 1, 1);
@@ -444,7 +450,8 @@ void CreateFormats() {
g_tfTitle = Format(disp.c_str(), 15, DWRITE_FONT_WEIGHT_BOLD, L);
g_tfName = Format(disp.c_str(), 22, DWRITE_FONT_WEIGHT_BOLD, C);
g_tfCenter = Format(ui.c_str(), 13, body, C);
- g_tfSmallCenter = Format(ui.c_str(), 11, body, C); // uma linha só, com "…" (nomes das imagens de fundo)
+ g_tfSmallCenter = Format(ui.c_str(), 11, body, C);
+ g_tfSmallBoldCenter = Format(ui.c_str(), 11, DWRITE_FONT_WEIGHT_SEMI_BOLD, C); // uma linha só, com "…" (nomes das imagens de fundo)
g_tfGlyph = Format(icons.c_str(), 14, DWRITE_FONT_WEIGHT_NORMAL, C);
g_tfGlyphSmall = Format(icons.c_str(), 11.5f, DWRITE_FONT_WEIGHT_NORMAL, C);
g_tfTileText = Format(ui.c_str(), 13, DWRITE_FONT_WEIGHT_BOLD, C);
@@ -478,6 +485,16 @@ struct Pal {
Pal ColorsBase();
Pal Colors() { // Tahoe: o fundo da janela leva 10 % da cor do papel de parede (tahoe::Tint)
Pal p = ColorsBase();
+ if (Golden()) {
+ // medido: claro = barra (236,235,236), conteúdo branco, caixas 247; escuro = conteúdo (29,28,29), caixas (49,48,48),
+ // barra lateral (43,41,40); seleção na cor de destaque pura (0,122,255 no azul)
+ p.side = g_dark ? D2D1::ColorF(43 / 255.f, 41 / 255.f, 40 / 255.f, 1) : D2D1::ColorF(236 / 255.f, 235 / 255.f, 236 / 255.f, 1);
+ p.content = g_dark ? D2D1::ColorF(29 / 255.f, 28 / 255.f, 29 / 255.f, 1) : D2D1::ColorF(1, 1, 1, 1);
+ p.group = g_dark ? D2D1::ColorF(1, 1, 1, 0.088f) : D2D1::ColorF(0, 0, 0, 0.031f);
+ p.divider = g_dark ? D2D1::ColorF(0, 0, 0, 0.5f) : D2D1::ColorF(0, 0, 0, 0.06f);
+ if (g_winActive) p.sideSel = aj::Accent();
+ return p;
+ }
if (g_tahoe) p.content = tahoe::Tint(p.content);
return p;
}
@@ -549,8 +566,8 @@ void UpdateSideVisible() {
// ================= Layout do conteúdo
float RowHeight(const aj::Row& r, float w) {
- if (r.kind == aj::Kind::Custom) return r.height;
- float h = r.icon ? 42.f : ROW_H;
+ if (r.kind == aj::Kind::Custom || r.height > 0) return r.height;
+ float h = r.icon ? (Golden() ? 49.f : 42.f) : ROW_H;
if (r.kind == aj::Kind::Slider && r.hasDef) h += 14; // espaço para a marca "Padrão" embaixo do trilho
if (!r.detail.empty()) {
float textW = w - 20 - (r.icon ? 34 : 0) - (r.kind == aj::Kind::Toggle ? 50 : r.kind == aj::Kind::Button ? 120 : 0);
@@ -672,6 +689,9 @@ float SliderValue(const aj::Row& r) { return r.getF ? std::clamp((r.getF() - r.m
// trilho do slider (à direita da linha, com espaço para os ícones/rótulos das pontas)
D2D1_RECT_F SliderTrack(const aj::Row& r, D2D1_RECT_F row) {
+ // macOS 27 (Ajustes > Aparência, 2x): trilho de 5,75 de 213 da borda da caixa até 33,5 da outra, centro 15,75 abaixo
+ // do topo da linha
+ if (r.gg) return D2D1::RectF(row.left + 213, row.top + 15.75f - 2.875f, row.right - 33.5f, row.top + 15.75f + 2.875f);
float maxW = r.maxGlyph.empty() ? 0 : (r.maxGlyph[0] >= 0xE000 ? 22 : TextWidth(r.maxGlyph, g_tfSmall) + 10);
float minW = r.minGlyph.empty() ? 0 : (r.minGlyph[0] >= 0xE000 ? 22 : TextWidth(r.minGlyph, g_tfSmall) + 10);
float right = row.right - 12 - maxW;
@@ -689,6 +709,46 @@ float SliderDefault(const aj::Row& r) { return std::clamp((r.def - r.min) / std:
void DrawSlider(aj::Ctx& c, const aj::Row& r, D2D1_RECT_F row) {
D2D1_RECT_F t = SliderTrack(r, row);
float v = SliderValue(r);
+ if (r.gg) {
+ // macOS 27: trilho arredondado (cinza claro / azul), botão em cápsula branca de 20 × 16 com sombra, os dois
+ // pontinhos embaixo das pontas e, nas pontas, os ícones de "transparente" (contorno) e "opaco" (cheio)
+ float cy = (t.top + t.bottom) / 2, rad = (t.bottom - t.top) / 2;
+ c.br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.16f) : D2D1::ColorF(0, 0, 0, 0.09f));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(t, rad, rad), c.br);
+ float kx = t.left + 10 + v * (t.right - t.left - 20);
+ c.br->SetColor(c.accent);
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(t.left, t.top, kx, t.bottom), rad, rad), c.br);
+ c.br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.3f) : D2D1::ColorF(0, 0, 0, 0.25f));
+ c.dc->FillEllipse(D2D1::Ellipse({ t.left + 9.5f, cy + 8 }, 1.1f, 1.1f), c.br);
+ c.dc->FillEllipse(D2D1::Ellipse({ t.right - 9.5f, cy + 8 }, 1.1f, 1.1f), c.br);
+ D2D1_RECT_F kb = D2D1::RectF(kx - 10, cy - 8, kx + 10, cy + 8);
+ for (int s = 3; s >= 1; s--) {
+ c.br->SetColor(D2D1::ColorF(0, 0, 0, g_dark ? 0.10f : 0.045f));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(kb.left - s * 0.5f, kb.top + s * 0.4f, kb.right + s * 0.5f, kb.bottom + s * 0.8f), 8 + s * 0.5f, 8 + s * 0.5f), c.br);
+ }
+ c.br->SetColor(D2D1::ColorF(1, 1, 1, 1));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(kb, 8, 8), c.br);
+ auto twoBoxes = [&](float cx, bool filled) {
+ D2D1_RECT_F back = D2D1::RectF(cx - 7.5f, cy - 6, cx + 3, cy + 2), front = D2D1::RectF(cx - 4.5f, cy - 3, cx + 7.5f, cy + 6);
+ c.br->SetColor(c.text2);
+ if (filled) {
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(back, 2.5f, 2.5f), c.br);
+ c.br->SetColor(g_dark ? D2D1::ColorF(0.19f, 0.19f, 0.19f, 1) : D2D1::ColorF(0.97f, 0.97f, 0.97f, 1));
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(front, 4, 4), c.br, 1.4f);
+ c.br->SetColor(c.text2);
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(front, 4, 4), c.br);
+ } else {
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(back, 2.5f, 2.5f), c.br, 1.1f);
+ c.br->SetColor(g_dark ? D2D1::ColorF(0.19f, 0.19f, 0.19f, 1) : D2D1::ColorF(0.97f, 0.97f, 0.97f, 1));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(front, 4, 4), c.br);
+ c.br->SetColor(c.text2);
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(front, 4, 4), c.br, 1.1f);
+ }
+ };
+ twoBoxes(row.left + 199, false);
+ twoBoxes(row.right - 20, true);
+ return;
+ }
float cy = (t.top + t.bottom) / 2;
c.br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.14f) : D2D1::ColorF(0, 0, 0, 0.10f));
c.dc->FillRoundedRectangle(D2D1::RoundedRect(t, 2, 2), c.br);
@@ -765,6 +825,32 @@ void DrawRow(aj::Ctx& c, const aj::Row& r, D2D1_RECT_F rr, int gi, int ri) {
}
case aj::Kind::Popup: {
std::wstring v = r.value ? r.value() : (r.getIdx && r.getIdx() >= 0 && r.getIdx() < (int)r.options.size() ? r.options[r.getIdx()] : L"");
+ if (r.gg) {
+ // macOS 27 (Ajustes > Aparência, 2x): botão redondo de 19,5 a 13,5 da borda da caixa, o valor a 13 dele e a
+ // bolinha de 16 a 8,5 do texto
+ float sx = rr.right - 13.5f - 9.75f;
+ c.br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.10f) : D2D1::ColorF(0, 0, 0, 0.075f));
+ c.dc->FillEllipse(D2D1::Ellipse({ sx, cy }, 9.75f, 9.75f), c.br);
+ DrawUpDown(c, sx, cy, text);
+ float w = TextWidth(v, g_tfBody), tx = sx - 9.75f - 13 - w;
+ aj::Text(c, v, D2D1::RectF(tx, rr.top, sx - 9.75f - 13 + 2, rr.bottom), g_tfBody, text);
+ float dx = tx - 8.5f - 8;
+ if (r.dot) {
+ D2D1_COLOR_F col = r.dot(r.getIdx ? r.getIdx() : 0);
+ if (col.a < 0) {
+ D2D1_GRADIENT_STOP st[2] = { { 0, D2D1::ColorF(0.62f, 0.55f, 0.85f, 1) }, { 1, D2D1::ColorF(1.0f, 0.60f, 0.60f, 1) } };
+ ID2D1GradientStopCollection* gs = nullptr; ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(c.dc->CreateGradientStopCollection(st, 2, &gs)) &&
+ SUCCEEDED(c.dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ dx - 8, cy }, { dx + 8, cy }), gs, &lb)))
+ c.dc->FillEllipse(D2D1::Ellipse({ dx, cy }, 8, 8), lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ } else { c.br->SetColor(col); c.dc->FillEllipse(D2D1::Ellipse({ dx, cy }, 8, 8), c.br); }
+ }
+ g_hits.push_back({ H_POPUP, D2D1::RectF(dx - 10, rr.top, rr.right - 8, rr.bottom), gi, ri });
+ right = dx - 16;
+ break;
+ }
if (g_tahoe) { // Tahoe: ⌃⌄ num círculo cinza
c.br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.10f) : D2D1::ColorF(0, 0, 0, 0.06f));
c.dc->FillEllipse(D2D1::Ellipse({ right - 4, cy }, 10, 10), c.br);
@@ -840,6 +926,7 @@ void DrawLights(aj::Ctx& c) {
bool lit = g_winActive || g_hoverLights;
c.br->SetColor(lit ? on[k] : (g_dark ? D2D1::ColorF(1, 1, 1, 0.18f) : D2D1::ColorF(0, 0, 0, 0.16f)));
c.dc->FillEllipse(D2D1::Ellipse(p, 7, 7), c.br);
+ semaforo::Gloss(c.dc, p, 7, c.br);
c.br->SetColor(D2D1::ColorF(0, 0, 0, 0.14f));
c.dc->DrawEllipse(D2D1::Ellipse(p, 6.75f, 6.75f), c.br, 0.5f);
g_hits.push_back({ H_LIGHT, D2D1::RectF(p.x - 9, p.y - 9, p.x + 9, p.y + 9), k });
@@ -853,7 +940,8 @@ void DrawLights(aj::Ctx& c) {
}
void DrawSearch(aj::Ctx& c, const Pal& pal) {
- D2D1_RECT_F sr = g_tahoe ? D2D1::RectF(15, SEARCH_Y - 2, SIDE_W - 9, SEARCH_Y + SEARCH_H + 2) : D2D1::RectF(10, SEARCH_Y, SIDE_W - 10, SEARCH_Y + SEARCH_H);
+ D2D1_RECT_F sr = Golden() ? D2D1::RectF(10, SEARCH_Y - 1, SIDE_W - 10, SEARCH_Y + SEARCH_H) :
+ g_tahoe ? D2D1::RectF(15, SEARCH_Y - 2, SIDE_W - 9, SEARCH_Y + SEARCH_H + 2) : D2D1::RectF(10, SEARCH_Y, SIDE_W - 10, SEARCH_Y + SEARCH_H);
float srR = g_tahoe ? (sr.bottom - sr.top) / 2 : 6; // Tahoe: busca em cápsula
if (g_tahoe) {
// Tahoe: a busca flutua sobre a lista (que rola por baixo dela, desfocada): cápsula translúcida com
@@ -893,11 +981,11 @@ void DrawSidebar(aj::Ctx& c, const Pal& pal, float H) {
// Tahoe: a lista rola por baixo dos botões da janela e da busca (borda de rolagem desfocada)
ID2D1DeviceContext* mainDc = c.dc;
ID2D1DeviceContext* sdc = g_tahoe ? tahoe::SceneBegin(mainDc, 1, ClientDip(), g_dpi) : nullptr;
- D2D1_RECT_F panel = PanelRect(H);
+ D2D1_RECT_F panel = Golden() ? D2D1::RectF(0, 0, SIDE_W - 0.5f, H) : PanelRect(H);
{ static int n; if (g_tahoe && !sdc && n++ < 3) Log(L"tahoe: cena da barra lateral indisponível (%ls)", tahoe::SceneError()); }
if (!sdc) { DrawLights(c); DrawSearch(c, pal); }
else c.dc = sdc;
- c.dc->PushAxisAlignedClip(D2D1::RectF(0, sdc ? panel.top : SEARCH_Y + SEARCH_H + 6, SIDE_W, H - (g_tahoe ? 9 : 0)), D2D1_ANTIALIAS_MODE_ALIASED);
+ c.dc->PushAxisAlignedClip(D2D1::RectF(0, sdc ? panel.top : SEARCH_Y + SEARCH_H + 6, SIDE_W, H - (g_tahoe && !Golden() ? 9 : 0)), D2D1_ANTIALIAS_MODE_ALIASED);
float y = ACCOUNT_Y - g_sideScroll;
auto& items = SidebarItems();
// conta (no topo, como "Iniciar sessão com sua Conta Apple")
@@ -932,9 +1020,9 @@ void DrawSidebar(aj::Ctx& c, const Pal& pal, float H) {
auto& it = items[i];
if (g_search.text.empty() && lastGroup != -100 && it.group != lastGroup) y += SIDE_GAP;
lastGroup = it.group;
- D2D1_RECT_F rr = g_tahoe ? D2D1::RectF(13, y, SIDE_W - 8, y + SIDE_ROW) : D2D1::RectF(10, y, SIDE_W - 10, y + SIDE_ROW);
+ D2D1_RECT_F rr = g_tahoe && !Golden() ? D2D1::RectF(13, y, SIDE_W - 8, y + SIDE_ROW) : D2D1::RectF(10, y, SIDE_W - 10, y + SIDE_ROW);
bool sel = i == cur;
- float selR = g_tahoe ? 9.f : 6.f;
+ float selR = Golden() ? 8.f : g_tahoe ? 9.f : 6.f;
if (sel) { c.br->SetColor(pal.sideSel); c.dc->FillRoundedRectangle(D2D1::RoundedRect(rr, selR, selR), c.br); }
g_tileBare = true;
@@ -1021,14 +1109,23 @@ void Render() {
ID2D1SolidColorBrush* br = nullptr;
dc->CreateSolidColorBrush(pal.text, &br);
aj::Ctx c{ dc, br, g_dark, pal.text, pal.text2, pal.text3, aj::Accent(), pal.line, pal.group, pal.control,
- g_tfBody, g_tfSmall, g_tfBold, g_tfTitle, g_tfGlyph, g_tfGlyphSmall, g_tfCenter, g_tfSmallCenter };
+ g_tfBody, g_tfSmall, g_tfBold, g_tfTitle, g_tfGlyph, g_tfGlyphSmall, g_tfCenter, g_tfSmallCenter, g_tfSmallBoldCenter };
g_hits.clear();
auto s = ClientDip();
// fundo: barra lateral translúcida (acrílico do sistema) e conteúdo opaco
float winR = g_tahoe ? tahoe::Radius(g_hwnd) : 0;
bool winClip = g_tahoe && tahoe::PushWindowClip(dc, s, winR);
- if (g_tahoe) {
+ if (Golden()) {
+ // Golden Gate: a barra lateral é uma coluna de cor cheia até a borda (sem o vidro flutuante do Tahoe)
+ tahoe::SetPanel(g_hwnd, D2D1::RectF(0, 0, 0, 0), 0);
+ br->SetColor(pal.side);
+ dc->FillRectangle(D2D1::RectF(0, 0, SIDE_W, s.height), br);
+ br->SetColor(pal.content);
+ dc->FillRectangle(D2D1::RectF(SIDE_W, 0, s.width, s.height), br);
+ br->SetColor(pal.divider);
+ dc->FillRectangle(D2D1::RectF(SIDE_W - 0.5f, 0, SIDE_W, s.height), br);
+ } else if (g_tahoe) {
// Tahoe: janela inteira na cor do conteúdo; a barra lateral é um painel de vidro flutuante
D2D1_RECT_F panel = PanelRect(s.height);
tahoe::SetPanel(g_hwnd, panel, PanelR());
@@ -1060,17 +1157,23 @@ void Render() {
}
// conteúdo
- float x0 = SIDE_W + PAD, x1 = s.width - PAD, w = x1 - x0;
+ // Golden Gate (Aparência do macOS 27, 2x): caixas a 21 da barra lateral e 20,5 da direita, a primeira a 64,5 do alto
+ float x0 = SIDE_W + (Golden() ? 21.f : PAD), x1 = s.width - (Golden() ? 20.5f : PAD), w = x1 - x0;
// Tahoe: o conteúdo rola por baixo de Voltar/Avançar e do título (borda de rolagem desfocada), sem faixa opaca
ID2D1DeviceContext* mainDc = dc;
ID2D1DeviceContext* cdc = g_tahoe ? tahoe::SceneBegin(mainDc, 0, s, g_dpi) : nullptr;
if (cdc) { dc = cdc; c.dc = cdc; }
const float clipTop = cdc ? 0.f : TOOL_H;
dc->PushAxisAlignedClip(D2D1::RectF(SIDE_W + 0.5f, clipTop, s.width, s.height), D2D1_ANTIALIAS_MODE_ALIASED);
- float y = TOOL_H + 6 - g_scroll;
+ float y = (Golden() ? 64.5f : TOOL_H + 6) - g_scroll;
for (int gi = 0; gi < (int)g_page.groups.size(); gi++) {
auto& g = g_page.groups[gi];
- if (gi > 0) y += GROUP_GAP;
+ if (Golden() && !g.title.empty() && g.subtitle.empty()) {
+ // macOS 27: 57,5 entre as caixas, com o título em negrito centrado a 39,5 da caixa de cima
+ if (gi > 0) { aj::Text(c, g.title, D2D1::RectF(x0 + 10, y + 30.5f, x1 - 10, y + 48.5f), g_tfBold, pal.text); y += 57.5f; }
+ else { aj::Text(c, g.title, D2D1::RectF(x0 + 10, y, x1 - 10, y + 18), g_tfBold, pal.text); y += 25; }
+ } else {
+ if (gi > 0) y += Golden() ? 10.5f : GROUP_GAP;
float hh = HeaderHeight(g, w);
if (hh > 0) {
if (gi > 0) y += 10;
@@ -1084,6 +1187,7 @@ void Render() {
}
y += hh;
}
+ }
float gh = 0;
for (auto& r : g.rows) gh += RowHeight(r, w);
if (g.rows.empty()) continue;
@@ -1101,7 +1205,7 @@ void Render() {
float rh = RowHeight(g.rows[ri], w);
D2D1_RECT_F rr = D2D1::RectF(x0, ry, x1, ry + rh);
if (rr.bottom > clipTop - 50 && rr.top < s.height + 50) {
- if (ri > 0 && g.box) {
+ if (ri > 0 && g.box && !g.rows[ri].noLine) {
br->SetColor(pal.line);
dc->FillRectangle(D2D1::RectF(x0 + 10, ry - 0.5f, x1 - 10, ry + 0.5f), br);
}
@@ -1139,9 +1243,10 @@ void Render() {
chev(SIDE_W + 64, false, canFwd);
g_hits.push_back({ H_BACK, D2D1::RectF(SIDE_W + 14, 10, SIDE_W + 44, 40) });
g_hits.push_back({ H_FWD, D2D1::RectF(SIDE_W + 50, 10, SIDE_W + 80, 40) });
- aj::Text(c, g_page.title, D2D1::RectF(SIDE_W + (g_tahoe ? 94 : 88), 0, s.width - 20, 50), g_tfTitle, pal.text);
+ if (!(Golden() && g_page.title == L"Geral")) // macOS 27: a Geral não tem título na barra (tem o cartão grande)
+ aj::Text(c, g_page.title, D2D1::RectF(SIDE_W + (g_tahoe ? 94 : 88), 0, s.width - 20, 50), g_tfTitle, pal.text);
- if (g_tahoe) tahoe::Panel(dc, br, PanelRect(s.height), PanelR(), g_dark);
+ if (g_tahoe && !Golden()) tahoe::Panel(dc, br, PanelRect(s.height), PanelR(), g_dark); // Golden Gate: sem painel flutuante
DrawSidebar(c, pal, s.height);
if (g_sheet.open) { g_hits.clear(); DrawSheet(c, pal); }
if (winClip) { dc->PopLayer(); tahoe::WindowRim(dc, br, s, winR, g_dark); }
@@ -1232,16 +1337,18 @@ LRESULT HitTestNC(HWND h, LPARAM l) {
}
void ApplyWindowTheme() {
- SIDE_W = g_tahoe ? 247.f : 215.f; // Tahoe: 8 de recuo + 239 do painel
+ SIDE_W = g_tahoe ? (Golden() ? 231.f : 247.f) : 215.f; // Tahoe: 8 de recuo + 239 do painel; Golden Gate: 231 até a borda
SIDE_ROW = g_tahoe ? 32.f : 28.f;
- ROW_H = g_tahoe ? 42.f : 38.f;
+ ROW_H = g_tahoe ? (Golden() ? 37.5f : 42.f) : 38.f; // macOS 27: linhas de 37,5 (as com ícone, 49)
+ SEARCH_Y = Golden() ? 62.f : 52.f;
+ ACCOUNT_Y = Golden() ? 96.f : 90.f;
BOOL dark = g_dark;
DwmSetWindowAttribute(g_hwnd, 20 /*DWMWA_USE_IMMERSIVE_DARK_MODE*/, &dark, sizeof(dark));
if (g_tahoe) { // Tahoe: cantos de 26 pt com o vidro da Composição (finder/tahoe.cpp)
tahoe::Frame(g_hwnd, true);
RECT rc; GetClientRect(g_hwnd, &rc);
tahoe::Size(g_hwnd, (float)rc.right, (float)rc.bottom, g_dark);
- shadow::SetRadius(tahoe::WINDOW_R);
+ shadow::SetRadius(tahoe::WindowR());
return;
}
tahoe::Frame(g_hwnd, false);
@@ -1583,8 +1690,8 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, LPWSTR, int) {
UINT dpi = GetDpiForSystem();
g_dpi = (float)dpi; g_scale = g_dpi / 96.f;
RECT wa; SystemParametersInfoW(SPI_GETWORKAREA, 0, &wa, 0);
- const bool th0 = tahoe::On(); // Tahoe: 801 × 625 (guia, seção 43)
- int ww = (int)((th0 ? 801 : 715) * g_scale), wh = (int)(std::min(th0 ? 625.f : 640.f, (wa.bottom - wa.top) / g_scale - 60) * g_scale);
+ const bool th0 = tahoe::On(), gg0 = th0 && tahoe::Golden(); // Tahoe: 801 × 625 (guia, seção 43); macOS 27: 740 × 690 (captura)
+ int ww = (int)((gg0 ? 740 : th0 ? 801 : 715) * g_scale), wh = (int)(std::min(gg0 ? 690.f : th0 ? 625.f : 640.f, (wa.bottom - wa.top) / g_scale - 60) * g_scale);
int wx = wa.left + (wa.right - wa.left - ww) / 2, wy = wa.top + (wa.bottom - wa.top - wh) / 2 - (int)(20 * g_scale);
g_hwnd = CreateWindowExW(WS_EX_NOREDIRECTIONBITMAP, wc.lpszClassName, TrPick(L"Ajustes do Sistema", L"System Settings"), WS_OVERLAPPEDWINDOW,
wx, std::max<int>(wy, wa.top), ww, wh, nullptr, nullptr, hi, nullptr);
diff --git a/src/ajustes/paginas.cpp b/src/ajustes/paginas.cpp
index 9920e9e..b251355 100644
--- a/src/ajustes/paginas.cpp
+++ b/src/ajustes/paginas.cpp
@@ -13,6 +13,7 @@
#include <mfidl.h>
#include <mfreadwrite.h>
#include <mferror.h>
+#include "../comum/simbolos.h" // símbolos SF da prévia do Liquid Glass (Golden Gate)
#pragma comment(lib, "mfplat.lib")
#pragma comment(lib, "mfreadwrite.lib")
#pragma comment(lib, "mfuuid.lib")
@@ -552,6 +553,26 @@ static void TurnShellOff() {
Page Geral() {
Page p;
+ if (Setting(L"liquid_glass", L"0") == L"1" && Setting(L"golden_gate", L"0") == L"1") {
+ // macOS 27 (captura Settings-General, 2x): cartão de 163,5 no alto com o ícone de 50 (centro a 50), "Geral" em
+ // negrito de 22 (centro a 99) e a descrição cinza de 13 centrada embaixo
+ Row hero; hero.kind = Kind::Custom; hero.height = 163.5f;
+ hero.draw = [](Ctx& c, D2D1_RECT_F rr) {
+ float cx = (rr.left + rr.right) / 2;
+ Tile(c, D2D1::RectF(cx - 25, rr.top + 25, cx + 25, rr.top + 75), 0xE713, C_GRAY, L"gearshape.fill");
+ static IDWriteTextFormat* tfBig = nullptr;
+ if (!tfBig) { IDWriteFactory* dw = nullptr; DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), (IUnknown**)&dw);
+ if (dw) { dw->CreateTextFormat(L"SF Pro Display", nullptr, DWRITE_FONT_WEIGHT_BOLD, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 22, L"", &tfBig); dw->Release(); }
+ if (tfBig) { tfBig->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); tfBig->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); } }
+ if (tfBig) Text(c, L"Geral", D2D1::RectF(rr.left, rr.top + 85, rr.right, rr.top + 113), tfBig, c.text);
+ DWRITE_WORD_WRAPPING ww = c.noteCenter->GetWordWrapping();
+ c.noteCenter->SetWordWrapping(DWRITE_WORD_WRAPPING_WRAP);
+ Text(c, L"Gerencie a configuração geral e as preferências do computador, como atualizações de software, idioma, compartilhamento e mais.",
+ D2D1::RectF(rr.left + 30, rr.top + 106, rr.right - 30, rr.top + 146), c.noteCenter, c.text2);
+ c.noteCenter->SetWordWrapping(ww);
+ };
+ p.groups.push_back(G({ hero }));
+ }
p.groups.push_back(G({ Link(L"Sobre", [] { Push(L"Sobre", Sobre); }, 0xE7F4, C_GRAY),
Link(L"Atualização de Software", [] { Push(L"Atualização de Software", Atualizacao); }, 0xE895, C_GRAY) }));
p.groups.push_back(G({ Link(L"Armazenamento", [] { Push(L"Armazenamento", Armazenamento); }, 0xEDA2, C_GRAY) }));
@@ -622,7 +643,62 @@ const wchar_t* ACCENT_NAMES[] = { L"Multicor", L"Azul", L"Roxo", L"Rosa", L"Verm
Page TransparenciaEfeitos();
+Row TemaRow() {
+ // Tema: o vidro do Sequoia, o Liquid Glass do macOS Tahoe ou o macOS Golden Gate (macOS 27: o Tahoe com botões
+ // Aqua de vidro, um canto só e menor em todas as janelas e o controle de transparência). Golden Gate =
+ // liquid_glass=1 + golden_gate=1, então tudo o que só conhece o Tahoe continua funcionando. Detalhes do vidro em
+ // Transparência e Efeitos.
+ return Popup(L"Tema", { L"macOS Sequoia", L"macOS Tahoe", L"macOS Golden Gate" },
+ [] { return Setting(L"liquid_glass", L"0") != L"1" ? 0 : Setting(L"golden_gate", L"0") == L"1" ? 2 : 1; },
+ [](int i) {
+ if (i == 2) SetSetting(L"liquid_estilo", L"nitido"); // o vidro do Golden Gate é o controle deslizante
+ SetSetting(L"golden_gate", i == 2 ? L"1" : L"0");
+ SetSetting(L"liquid_glass", i >= 1 ? L"1" : L"0");
+ // o papel de parede do usuário nunca muda ao trocar de tema (o usuário pediu)
+ Rebuild();
+ });
+}
+
+Row GlassEstiloRow(bool title = true) { // title = false: embaixo da foto da página nova, que já tem o título
+ Row glass; glass.kind = Kind::Custom; glass.height = 96;
+ glass.enabled = Setting(L"reduzir_transparencia", L"0") != L"1";
+ glass.draw = [title](Ctx& c, D2D1_RECT_F rr) {
+ if (title) Text(c, L"Liquid Glass", D2D1::RectF(rr.left + 10, rr.top + 8, rr.left + 160, rr.top + 28), c.body, c.text);
+ const wchar_t* names[2] = { L"Transparente", L"Tingido" };
+ int cur = Setting(L"liquid_estilo", L"nitido") == L"tingido" ? 1 : 0;
+ float w = 66, h = 44, gap = 16, x = rr.right - 10 - 2 * w - gap;
+ for (int k = 0; k < 2; k++, x += w + gap) {
+ D2D1_RECT_F t = D2D1::RectF(x, rr.top + 12, x + w, rr.top + 12 + h);
+ // papel de parede colorido atrás e uma placa de vidro por cima: clara (transparente) ou fosca (tingida)
+ ID2D1GradientStopCollection* gs = nullptr;
+ D2D1_GRADIENT_STOP st[2] = { { 0, D2D1::ColorF(0.30f, 0.55f, 0.98f, 1) }, { 1, D2D1::ColorF(0.95f, 0.50f, 0.55f, 1) } };
+ c.dc->CreateGradientStopCollection(st, 2, &gs);
+ ID2D1LinearGradientBrush* lg = nullptr;
+ if (gs) c.dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ t.left, t.top }, { t.right, t.bottom }), gs, &lg);
+ if (lg) { c.dc->FillRoundedRectangle(D2D1::RoundedRect(t, 6, 6), lg); lg->Release(); }
+ if (gs) gs->Release();
+ D2D1_RECT_F pl = D2D1::RectF(t.left + 9, t.top + 9, t.right - 9, t.bottom - 9);
+ c.br->SetColor(k == 0 ? D2D1::ColorF(1, 1, 1, 0.18f) : (c.dark ? D2D1::ColorF(0.16f, 0.16f, 0.17f, 0.82f) : D2D1::ColorF(0.97f, 0.97f, 0.98f, 0.85f)));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(pl, 8, 8), c.br);
+ c.br->SetColor(D2D1::ColorF(1, 1, 1, 0.75f));
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(pl, 8, 8), c.br, 0.8f);
+ if (k == cur) { c.br->SetColor(c.accent); c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(t.left - 3, t.top - 3, t.right + 3, t.bottom + 3), 8, 8), c.br, 2.5f); }
+ Text(c, names[k], D2D1::RectF(t.left - 12, t.bottom + 6, t.right + 12, t.bottom + 24), c.noteCenter, k == cur ? c.text : c.text2);
+ }
+ };
+ glass.clickAt = [](D2D1_POINT_2F pt, D2D1_RECT_F rr) {
+ float w = 66, gap = 16, x = rr.right - 10 - 2 * w - gap;
+ for (int k = 0; k < 2; k++, x += w + gap)
+ if (pt.x >= x - 6 && pt.x <= x + w + 6) { SetSetting(L"liquid_estilo", k == 0 ? L"nitido" : L"tingido"); Rebuild(); }
+ };
+ return glass;
+}
+
+Page AparenciaGolden();
Page Aparencia() {
+ // a página do macOS 27 vale para os três temas (o usuário pediu): no Tahoe a foto ganha a escolha Transparente /
+ // Tingido no lugar do controle; no Sequoia (sem Liquid Glass) só Aparência, Tema e o resto. A antiga fica de reserva.
+ if (true) return AparenciaGolden();
Page p;
Row modes; modes.kind = Kind::Custom; modes.height = 108;
auto modeIdx = [] { return Setting(L"aparencia_auto", L"0") == L"1" ? 0 : sys::Theme() == 0 ? 1 : 2; };
@@ -705,10 +781,7 @@ Page Aparencia() {
for (int k = 0; k < 9; k++, x += 22)
if (std::fabs(pt.x - x) <= 10 && std::fabs(pt.y - (rr.top + 19)) <= 10) { SetSetting(L"destaque", k == 0 ? L"azul" : ACCENTS[k].first); Rebuild(); }
};
- // Tema: o vidro do Sequoia ou o Liquid Glass do macOS Tahoe (detalhes em Transparência e Efeitos)
- Row tema = Popup(L"Tema", { L"macOS Sequoia", L"macOS Tahoe" },
- [] { return Setting(L"liquid_glass", L"0") == L"1" ? 1 : 0; },
- [](int i) { SetSetting(L"liquid_glass", i == 1 ? L"1" : L"0"); Rebuild(); });
+ Row tema = TemaRow();
// o Tema fica sempre livre: com "Reduzir transparência" o vidro só fica opaco (como no Mac)
bool tahoeOn = Setting(L"liquid_glass", L"0") == L"1";
if (!tahoeOn) { p.groups.push_back(G({ tema, modes, acc })); }
@@ -716,37 +789,7 @@ Page Aparencia() {
// macOS 26 (Aparência): "Liquid Glass" com a escolha Transparente / Tingido (26.1) e "Estilo de ícones e widgets"
// em miniaturas — Padrão, Escuro, Transparente (o modo translúcido) e Tingido. A transparência fina continua em
// Transparência e Efeitos.
- Row glass; glass.kind = Kind::Custom; glass.height = 96;
- glass.enabled = Setting(L"reduzir_transparencia", L"0") != L"1";
- glass.draw = [](Ctx& c, D2D1_RECT_F rr) {
- Text(c, L"Liquid Glass", D2D1::RectF(rr.left + 10, rr.top + 8, rr.left + 160, rr.top + 28), c.body, c.text);
- const wchar_t* names[2] = { L"Transparente", L"Tingido" };
- int cur = Setting(L"liquid_estilo", L"nitido") == L"tingido" ? 1 : 0;
- float w = 66, h = 44, gap = 16, x = rr.right - 10 - 2 * w - gap;
- for (int k = 0; k < 2; k++, x += w + gap) {
- D2D1_RECT_F t = D2D1::RectF(x, rr.top + 12, x + w, rr.top + 12 + h);
- // papel de parede colorido atrás e uma placa de vidro por cima: clara (transparente) ou fosca (tingida)
- ID2D1GradientStopCollection* gs = nullptr;
- D2D1_GRADIENT_STOP st[2] = { { 0, D2D1::ColorF(0.30f, 0.55f, 0.98f, 1) }, { 1, D2D1::ColorF(0.95f, 0.50f, 0.55f, 1) } };
- c.dc->CreateGradientStopCollection(st, 2, &gs);
- ID2D1LinearGradientBrush* lg = nullptr;
- if (gs) c.dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ t.left, t.top }, { t.right, t.bottom }), gs, &lg);
- if (lg) { c.dc->FillRoundedRectangle(D2D1::RoundedRect(t, 6, 6), lg); lg->Release(); }
- if (gs) gs->Release();
- D2D1_RECT_F pl = D2D1::RectF(t.left + 9, t.top + 9, t.right - 9, t.bottom - 9);
- c.br->SetColor(k == 0 ? D2D1::ColorF(1, 1, 1, 0.18f) : (c.dark ? D2D1::ColorF(0.16f, 0.16f, 0.17f, 0.82f) : D2D1::ColorF(0.97f, 0.97f, 0.98f, 0.85f)));
- c.dc->FillRoundedRectangle(D2D1::RoundedRect(pl, 8, 8), c.br);
- c.br->SetColor(D2D1::ColorF(1, 1, 1, 0.75f));
- c.dc->DrawRoundedRectangle(D2D1::RoundedRect(pl, 8, 8), c.br, 0.8f);
- if (k == cur) { c.br->SetColor(c.accent); c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(t.left - 3, t.top - 3, t.right + 3, t.bottom + 3), 8, 8), c.br, 2.5f); }
- Text(c, names[k], D2D1::RectF(t.left - 12, t.bottom + 6, t.right + 12, t.bottom + 24), c.noteCenter, k == cur ? c.text : c.text2);
- }
- };
- glass.clickAt = [](D2D1_POINT_2F pt, D2D1_RECT_F rr) {
- float w = 66, gap = 16, x = rr.right - 10 - 2 * w - gap;
- for (int k = 0; k < 2; k++, x += w + gap)
- if (pt.x >= x - 6 && pt.x <= x + w + 6) { SetSetting(L"liquid_estilo", k == 0 ? L"nitido" : L"tingido"); Rebuild(); }
- };
+ Row glass = GlassEstiloRow();
p.groups.push_back(G({ tema, modes, glass }));
static const wchar_t* ESTILOS[] = { L"padrao", L"escuro", L"transparente", L"tingido" };
Row icons; icons.kind = Kind::Custom; icons.height = 96;
@@ -798,6 +841,337 @@ Page Aparencia() {
return p;
}
+// ================= Aparência no macOS 27 Golden Gate
+// Copiada da captura 2x dos Ajustes do macOS 27 (512 Pixels, Settings-Appearance.png), medidas em pt a partir da
+// caixa (ver Documents\macOS27-Theme-Reference\MEDIDAS.md):
+// caixa 1: Aparência (85,5) com miniaturas 71,5 x 48,5 de passo 82 (Claro, Escuro, Automático), a última a 11 da
+// borda, 10,5 do alto, rótulos centrados a 69; Liquid Glass (196 + 36) com a foto 267,5 x 179,5 a 10 da
+// borda e 11 do alto, e o controle (trilho a 213 / 33,5 das bordas)
+// "Tema" (57,5 entre as caixas); caixa 2: Cor (61) com bolinhas de 23,5, passo 36, a última a 21,75 da borda e o
+// centro a 21,25 do alto, nome da escolhida embaixo; Cor do realce do texto (37,5)
+// caixa 3: Estilo de ícones e widgets (87,5) com quadrinhos de 29,5, passo 51,5, a 13 da borda e 24 do alto, rótulos
+// a 54; Cor das pastas (40). Menus: bolinha de 16, texto a 8,5 dela e o botão redondo a 13,5 da borda.
+static D2D1_COLOR_F GGRgb(UINT32 c, float a = 1) { return D2D1::ColorF(((c >> 16) & 255) / 255.f, ((c >> 8) & 255) / 255.f, (c & 255) / 255.f, a); }
+
+// Cor do realce do texto: a cor de seleção do Windows (HKCU\Control Panel\Colors\Hilight + SetSysColors, vale na hora
+// para os programas clássicos). A original é guardada em realce_original na 1ª troca e volta com "Automática"
+// (registrado em docs egistro-mudancas.txt).
+static const UINT32 GG_REALCE[9] = { 0, 0x007AFF, 0x953D96, 0xF74F9E, 0xE0383E, 0xF7821B, 0xFFC726, 0x62BA46, 0x989898 };
+static void GGAplicaRealce(int i) {
+ wchar_t cur[64] = {}; DWORD cb = sizeof(cur);
+ RegGetValueW(HKEY_CURRENT_USER, L"Control Panel\\Colors", L"Hilight", RRF_RT_REG_SZ, nullptr, cur, &cb);
+ std::wstring orig = Setting(L"realce_original", L"");
+ if (i <= 0) {
+ if (orig.empty()) { SetSetting(L"realce_texto", L"0"); return; }
+ int r = 0, g = 0, b = 0;
+ if (swscanf_s(orig.c_str(), L"%d %d %d", &r, &g, &b) == 3) {
+ RegSetKeyValueW(HKEY_CURRENT_USER, L"Control Panel\\Colors", L"Hilight", REG_SZ, orig.c_str(), (DWORD)((orig.size() + 1) * sizeof(wchar_t)));
+ INT el = COLOR_HIGHLIGHT; COLORREF cr = RGB(r, g, b); SetSysColors(1, &el, &cr);
+ }
+ SetSetting(L"realce_original", L"");
+ SetSetting(L"realce_texto", L"0");
+ return;
+ }
+ if (orig.empty() && cur[0]) SetSetting(L"realce_original", cur);
+ UINT32 c = GG_REALCE[i];
+ int r = (c >> 16) & 255, g = (c >> 8) & 255, b = c & 255;
+ wchar_t v[32]; swprintf_s(v, L"%d %d %d", r, g, b);
+ RegSetKeyValueW(HKEY_CURRENT_USER, L"Control Panel\\Colors", L"Hilight", REG_SZ, v, (DWORD)((wcslen(v) + 1) * sizeof(wchar_t)));
+ INT el = COLOR_HIGHLIGHT; COLORREF cr = RGB(r, g, b); SetSysColors(1, &el, &cr);
+ SetSetting(L"realce_texto", std::to_wstring(i));
+}
+
+Page AparenciaGolden() {
+ Page p;
+ // ---- Aparência: Claro, Escuro, Automático
+ Row modes; modes.kind = Kind::Custom; modes.height = 85.5f;
+ auto modeIdx = [] { return Setting(L"aparencia_auto", L"0") == L"1" ? 2 : sys::Theme() == 0 ? 0 : 1; };
+ modes.draw = [modeIdx](Ctx& c, D2D1_RECT_F rr) {
+ Text(c, L"Aparência", D2D1::RectF(rr.left + 10, rr.top + 8, rr.left + 160, rr.top + 28), c.body, c.text);
+ const wchar_t* names[3] = { L"Claro", L"Escuro", L"Automático" };
+ int cur = modeIdx();
+ float w = 71.5f, h = 48.5f, pitch = 82, x = rr.right - 11 - w - 2 * pitch;
+ for (int k = 0; k < 3; k++, x += pitch) {
+ D2D1_RECT_F t = D2D1::RectF(x, rr.top + 10.5f, x + w, rr.top + 10.5f + h);
+ ID2D1Factory* fac = nullptr; c.dc->GetFactory(&fac);
+ ID2D1RoundedRectangleGeometry* rg = nullptr; fac->CreateRoundedRectangleGeometry(D2D1::RoundedRect(t, 7, 7), &rg);
+ c.dc->PushLayer(D2D1::LayerParameters(D2D1::InfiniteRect(), rg), nullptr);
+ auto mini = [&](bool dark, D2D1_RECT_F clip) {
+ c.dc->PushAxisAlignedClip(clip, D2D1_ANTIALIAS_MODE_ALIASED);
+ // o papel de parede azul das miniaturas do macOS 27 (claro: céu pálido -> azul; escuro: anil profundo)
+ D2D1_GRADIENT_STOP st[3] = { { 0, dark ? D2D1::ColorF(0.33f, 0.33f, 0.72f, 1) : D2D1::ColorF(0.80f, 0.82f, 0.86f, 1) },
+ { 0.55f, dark ? D2D1::ColorF(0.14f, 0.16f, 0.52f, 1) : D2D1::ColorF(0.35f, 0.58f, 0.92f, 1) },
+ { 1, dark ? D2D1::ColorF(0.05f, 0.07f, 0.28f, 1) : D2D1::ColorF(0.10f, 0.36f, 0.85f, 1) } };
+ ID2D1GradientStopCollection* gs = nullptr; ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(c.dc->CreateGradientStopCollection(st, 3, &gs)) &&
+ SUCCEEDED(c.dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ t.left, t.top }, { t.right, t.bottom }), gs, &lb)))
+ c.dc->FillRectangle(t, lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ // janelinha de cima à esquerda com a barra na cor de destaque
+ D2D1_RECT_F top = D2D1::RectF(t.left + 3, t.top + 3, t.left + 44, t.top + 21);
+ c.br->SetColor(dark ? D2D1::ColorF(0.10f, 0.10f, 0.22f, 0.85f) : D2D1::ColorF(1, 1, 1, 0.72f));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(top, 3.5f, 3.5f), c.br);
+ c.br->SetColor(c.accent);
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(top.left + 3, top.top + 8, top.right - 3, top.top + 14), 1.5f, 1.5f), c.br);
+ // janela de baixo à direita com os três botões
+ D2D1_RECT_F win = D2D1::RectF(t.left + 19, t.top + 26, t.right + 6, t.bottom + 6);
+ c.br->SetColor(dark ? D2D1::ColorF(0.07f, 0.07f, 0.09f, 1) : D2D1::ColorF(0.97f, 0.97f, 0.97f, 1));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(win, 5, 5), c.br);
+ const UINT32 lights[3] = { 0xFF6159, 0xFEBC2E, 0x28C840 };
+ for (int d = 0; d < 3; d++) {
+ c.br->SetColor(GGRgb(lights[d]));
+ c.dc->FillEllipse(D2D1::Ellipse({ win.left + 11 + d * 7.5f, win.top + 11 }, 2.6f, 2.6f), c.br);
+ }
+ c.dc->PopAxisAlignedClip();
+ };
+ if (k == 2) { mini(false, D2D1::RectF(t.left, t.top, (t.left + t.right) / 2, t.bottom)); mini(true, D2D1::RectF((t.left + t.right) / 2, t.top, t.right, t.bottom)); }
+ else mini(k == 1, t);
+ c.dc->PopLayer();
+ if (rg) rg->Release();
+ if (fac) fac->Release();
+ c.br->SetColor(c.dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.10f));
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(t.left + 0.25f, t.top + 0.25f, t.right - 0.25f, t.bottom - 0.25f), 7, 7), c.br, 0.5f);
+ if (k == cur) { c.br->SetColor(c.accent); c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(t.left - 2, t.top - 2, t.right + 2, t.bottom + 2), 9, 9), c.br, 3); }
+ // rótulo de 11 pt (escolhido em negrito), centrado a 69 do alto da linha
+ Text(c, names[k], D2D1::RectF(t.left - 20, rr.top + 61, t.right + 20, rr.top + 77), k == cur && c.noteBoldCenter ? c.noteBoldCenter : c.noteCenter, k == cur ? c.text : c.text2);
+ }
+ };
+ modes.clickAt = [](D2D1_POINT_2F pt, D2D1_RECT_F rr) {
+ float w = 71.5f, pitch = 82, x = rr.right - 11 - w - 2 * pitch;
+ for (int k = 0; k < 3; k++, x += pitch) {
+ if (pt.x < x - 4 || pt.x > x + w + 4) continue;
+ if (k == 2) { // automático: claro de dia, escuro à noite (o Shell troca na hora certa)
+ SetSetting(L"aparencia_auto", L"1");
+ SYSTEMTIME st; GetLocalTime(&st);
+ sys::SetTheme(st.wHour >= 7 && st.wHour < 19 ? 0 : 1);
+ } else {
+ SetSetting(L"aparencia_auto", L"0");
+ sys::SetTheme(k == 0 ? 0 : 1);
+ }
+ SetSetting(L"tema", L"auto");
+ Rebuild();
+ }
+ };
+ // ---- Liquid Glass: a foto com a barra de vidro de exemplo e o controle embaixo
+ bool reduce = Setting(L"reduzir_transparencia", L"0") == L"1";
+ const bool liquidOn = Setting(L"liquid_glass", L"0") == L"1", goldenOn = liquidOn && Setting(L"golden_gate", L"0") == L"1";
+ Row prev; prev.kind = Kind::Custom; prev.height = 196;
+ prev.enabled = !reduce;
+ prev.draw = [](Ctx& c, D2D1_RECT_F rr) {
+ Text(c, L"Liquid Glass", D2D1::RectF(rr.left + 10, rr.top + 9.5f, rr.left + 160, rr.top + 29.5f), c.body, c.text);
+ float w = 267.5f, h = 179.5f;
+ D2D1_RECT_F t = D2D1::RectF(rr.right - 10 - w, rr.top + 11, rr.right - 10, rr.top + 11 + h);
+ ID2D1Factory* fac = nullptr; c.dc->GetFactory(&fac);
+ ID2D1RoundedRectangleGeometry* rg = nullptr; fac->CreateRoundedRectangleGeometry(D2D1::RoundedRect(t, 14, 14), &rg);
+ c.dc->PushLayer(D2D1::LayerParameters(D2D1::InfiniteRect(), rg), nullptr);
+ c.br->SetColor(D2D1::ColorF(0.45f, 0.62f, 0.80f, 1));
+ c.dc->FillRectangle(t, c.br);
+ D2D1_RECT_F card = D2D1::RectF(t.left, t.bottom - 34.5f, t.right, t.bottom);
+ std::wstring photo;
+ wchar_t prof[MAX_PATH];
+ if (GetEnvironmentVariableW(L"USERPROFILE", prof, MAX_PATH)) photo = std::wstring(prof) + L"\\Pictures\\Wallpapers macOS\\macOS 27\\macos-27-golden-4096x2160-27635.jpg";
+ if (photo.empty() || GetFileAttributesW(photo.c_str()) == INVALID_FILE_ATTRIBUTES) photo = sys::Wallpaper();
+ if (ID2D1Bitmap* b = BitmapFromFile(photo, 640)) { // a foto ocupa o que fica acima do cartão
+ auto s2 = b->GetSize();
+ float ph = card.top - t.top, k = std::max(w / s2.width, ph / s2.height);
+ float bw = s2.width * k, bh = s2.height * k, cx = (t.left + t.right) / 2, cy = t.top + ph / 2;
+ c.dc->PushAxisAlignedClip(D2D1::RectF(t.left, t.top, t.right, card.top), D2D1_ANTIALIAS_MODE_ALIASED);
+ c.dc->DrawBitmap(b, D2D1::RectF(cx - bw / 2, cy - bh / 2, cx + bw / 2, cy + bh / 2), 1, D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC);
+ c.dc->PopAxisAlignedClip();
+ }
+ // cartão de baixo (medido: 234,230,224 no claro) com o título em negrito, cortado pela borda como na referência
+ c.br->SetColor(c.dark ? D2D1::ColorF(0.16f, 0.16f, 0.17f, 1) : GGRgb(0xEAE6E0));
+ c.dc->FillRectangle(card, c.br);
+ Text(c, L"Golden Gate Bridge", D2D1::RectF(card.left + 16.5f, card.top + 9, card.right - 10, card.top + 42), c.title, c.dark ? c.text : D2D1::ColorF(0, 0, 0, 0.85f));
+ // barra de vidro: quanto mais para a direita o controle, mais opaco o vidro
+ // Golden Gate: o controle; Tahoe: Transparente (quase nada) ou Tingido (fosco)
+ float v = Setting(L"golden_gate", L"0") == L"1" ? std::clamp((float)_wtof(Setting(L"vidro_tinta", L"0.5").c_str()), 0.f, 1.f)
+ : Setting(L"liquid_estilo", L"nitido") == L"tingido" ? 0.85f : 0.15f;
+ D2D1_COLOR_F fill = c.dark ? D2D1::ColorF(0.20f, 0.20f, 0.21f, 0.18f + 0.72f * v) : D2D1::ColorF(1, 1, 1, 0.28f + 0.66f * v);
+ D2D1_COLOR_F ink = c.dark ? D2D1::ColorF(1, 1, 1, 0.9f) : D2D1::ColorF(0, 0, 0, 0.82f);
+ auto pill = [&](D2D1_RECT_F q) {
+ float rad = (q.bottom - q.top) / 2;
+ c.br->SetColor(D2D1::ColorF(0, 0, 0, 0.08f));
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(q.left, q.top + 1, q.right, q.bottom + 1.5f), rad, rad), c.br);
+ c.br->SetColor(fill);
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(q, rad, rad), c.br);
+ c.br->SetColor(D2D1::ColorF(1, 1, 1, c.dark ? 0.25f : 0.8f));
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(q.left + 0.5f, q.top + 0.5f, q.right - 0.5f, q.bottom - 0.5f), rad - 0.5f, rad - 0.5f), c.br, 0.8f);
+ };
+ float y0 = t.top + 8, hh = 36;
+ D2D1_RECT_F g1 = D2D1::RectF(t.left + 8, y0, t.left + 8 + 73.5f, y0 + hh);
+ D2D1_RECT_F g2 = D2D1::RectF(g1.right + 7.5f, y0, g1.right + 7.5f + hh, y0 + hh);
+ D2D1_RECT_F g3 = D2D1::RectF(g2.right + 7.5f, y0, t.right - 8.5f, y0 + hh);
+ pill(g1); pill(g2); pill(g3);
+ c.br->SetColor(ink);
+ simbolo::Draw(c.dc, L"square.and.arrow.up", D2D1::RectF(g1.left + 11, y0 + 8, g1.left + 29, y0 + 28), c.br);
+ for (int k = 0; k < 3; k++) c.dc->FillEllipse(D2D1::Ellipse({ g1.left + 49.5f + k * 5.5f, y0 + hh / 2 }, 1.5f, 1.5f), c.br);
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(g2.left + 13, y0 + 13, g2.right - 8, y0 + 27), 3, 3), c.br, 1.5f);
+ c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(g2.left + 9, y0 + 9, g2.right - 12, y0 + 23), 3, 3), c.br, 1.5f);
+ simbolo::Draw(c.dc, L"magnifyingglass", D2D1::RectF(g3.left + 10, y0 + 11, g3.left + 24, y0 + 25), c.br);
+ Text(c, L"Buscar", D2D1::RectF(g3.left + 32, y0, g3.right - 6, y0 + hh), c.body, c.dark ? D2D1::ColorF(1, 1, 1, 0.6f) : D2D1::ColorF(0, 0, 0, 0.5f));
+ c.dc->PopLayer();
+ if (rg) rg->Release();
+ if (fac) fac->Release();
+ };
+ Row gg = Slider(L"", 0, 1, [] { return (float)_wtof(Setting(L"vidro_tinta", L"0.5").c_str()); },
+ [](float v) { wchar_t b[16]; swprintf_s(b, L"%.2f", v); SetSetting(L"vidro_tinta", b); Redraw(); }, L"", L"");
+ gg.height = 36; gg.noLine = true; gg.gg = true; gg.enabled = !reduce;
+ if (goldenOn) p.groups.push_back(G({ modes, prev, gg }));
+ else if (liquidOn) { Row ge = GlassEstiloRow(false); ge.noLine = true; p.groups.push_back(G({ modes, prev, ge })); }
+ else p.groups.push_back(G({ modes }));
+
+ // ---- Tema: cor de destaque (Multicor + 10 cores; as do macOS 27 lidas na captura) e cor do realce do texto
+ Row color; color.kind = Kind::Custom; color.height = 61;
+ static const UINT32 GG_COLS[10] = { 0, 0x007AFF, 0x953D96, 0xF74F9E, 0xE0383E, 0xF7821B, 0xFFC726, 0x62BA46, 0x989898, 0x98A8D9 };
+ static const wchar_t* GG_KEYS[10] = { L"multicor", L"azul", L"roxo", L"rosa", L"vermelho", L"laranja", L"amarelo", L"verde", L"grafite", L"lavanda" };
+ static const wchar_t* GG_NAMES[10] = { L"Multicor", L"Azul", L"Roxo", L"Rosa", L"Vermelho", L"Laranja", L"Amarelo", L"Verde", L"Grafite", L"Lavanda" };
+ color.draw = [](Ctx& c, D2D1_RECT_F rr) {
+ Text(c, L"Cor", D2D1::RectF(rr.left + 10, rr.top + 8, rr.left + 120, rr.top + 28), c.body, c.text);
+ std::wstring cur = Setting(L"destaque", L"azul");
+ int sel = 1;
+ for (int k = 0; k < 10; k++) if (cur == GG_KEYS[k]) sel = k;
+ ID2D1Factory* f = nullptr; c.dc->GetFactory(&f);
+ for (int k = 0; k < 10; k++) {
+ D2D1_POINT_2F m{ rr.right - 21.75f - (9 - k) * 36.f, rr.top + 21.25f };
+ if (k == 0) { // multicor: disco de cores feito em fatias
+ for (int s = 0; s < 36 && f; s++) {
+ float a0 = s * 10.f * 3.14159f / 180, a1 = (s + 1.2f) * 10.f * 3.14159f / 180;
+ float hue = s / 36.f;
+ float r = std::clamp(std::fabs(hue * 6 - 3) - 1, 0.f, 1.f), g = std::clamp(2 - std::fabs(hue * 6 - 2), 0.f, 1.f), b = std::clamp(2 - std::fabs(hue * 6 - 4), 0.f, 1.f);
+ ID2D1PathGeometry* pg = nullptr;
+ if (SUCCEEDED(f->CreatePathGeometry(&pg))) {
+ ID2D1GeometrySink* sk = nullptr;
+ if (SUCCEEDED(pg->Open(&sk))) {
+ sk->BeginFigure(m, D2D1_FIGURE_BEGIN_FILLED);
+ sk->AddLine({ m.x + 11.75f * std::cos(a0), m.y + 11.75f * std::sin(a0) });
+ sk->AddLine({ m.x + 11.75f * std::cos(a1), m.y + 11.75f * std::sin(a1) });
+ sk->EndFigure(D2D1_FIGURE_END_CLOSED);
+ sk->Close(); sk->Release();
+ }
+ c.br->SetColor(D2D1::ColorF(r, g, b, 1));
+ c.dc->FillGeometry(pg, c.br);
+ pg->Release();
+ }
+ }
+ } else {
+ c.br->SetColor(GGRgb(GG_COLS[k]));
+ c.dc->FillEllipse(D2D1::Ellipse(m, 11.75f, 11.75f), c.br);
+ }
+ if (k == sel) { // anel na cor de destaque, com um respiro da cor da caixa
+ c.br->SetColor(c.dark ? D2D1::ColorF(0.19f, 0.19f, 0.19f, 1) : D2D1::ColorF(0.97f, 0.97f, 0.97f, 1));
+ c.dc->DrawEllipse(D2D1::Ellipse(m, 12.9f, 12.9f), c.br, 1.5f);
+ c.br->SetColor(c.accent);
+ c.dc->DrawEllipse(D2D1::Ellipse(m, 14.5f, 14.5f), c.br, 2.5f);
+ Text(c, GG_NAMES[k], D2D1::RectF(m.x - 50, rr.top + 36, m.x + 50, rr.top + 52), c.noteCenter, c.text2); // 11 pt, a 44 do alto
+ }
+ }
+ if (f) f->Release();
+ };
+ color.clickAt = [](D2D1_POINT_2F pt, D2D1_RECT_F rr) {
+ for (int k = 0; k < 10; k++) {
+ float x = rr.right - 21.75f - (9 - k) * 36.f;
+ if (std::fabs(pt.x - x) <= 15 && std::fabs(pt.y - (rr.top + 21.25f)) <= 15) { SetSetting(L"destaque", k == 0 ? L"azul" : GG_KEYS[k]); Rebuild(); }
+ }
+ };
+ Row hl = Popup(L"Cor do realce do texto", { L"Automática", L"Azul", L"Roxo", L"Rosa", L"Vermelho", L"Laranja", L"Amarelo", L"Verde", L"Grafite" },
+ [] { return std::clamp(_wtoi(Setting(L"realce_texto", L"0").c_str()), 0, 8); }, [](int i) { GGAplicaRealce(i); Rebuild(); });
+ hl.gg = true; hl.height = 37.5f;
+ hl.dot = [](int i) { return i <= 0 ? D2D1::ColorF(0, 0, 0, -1) : GGRgb(GG_REALCE[std::clamp(i, 0, 8)]); };
+ p.groups.push_back(G({ color, hl }, L"Tema"));
+
+ // ---- Estilo de ícones e widgets (o símbolo do Tempo em cada estilo) e cor das pastas
+ static const wchar_t* ESTILOS[] = { L"padrao", L"escuro", L"transparente", L"tingido" };
+ Row icons; icons.kind = Kind::Custom;
+ // com Escuro escolhido o macOS 27 mostra embaixo "Sempre / Auto" (Auto: escuro só no modo escuro) e a linha cresce
+ icons.height = Setting(L"estilo_icones", L"padrao") == L"escuro" ? 102.5f : 87.5f;
+ icons.draw = [](Ctx& c, D2D1_RECT_F rr) {
+ Text(c, L"Estilo de ícones e widgets", D2D1::RectF(rr.left + 10, rr.top + 8, rr.left + 220, rr.top + 28), c.body, c.text);
+ const wchar_t* names[4] = { L"Padrão", L"Escuro", L"Transparente", L"Tingido" };
+ std::wstring v = Setting(L"estilo_icones", L"padrao");
+ int cur = 0;
+ for (int k = 0; k < 4; k++) if (v == ESTILOS[k]) cur = k;
+ const float s = 29.5f, pitch = 51.5f;
+ for (int k = 0; k < 4; k++) {
+ float x = rr.right - 13 - s - (3 - k) * pitch;
+ D2D1_RECT_F t = D2D1::RectF(x, rr.top + 13, x + s, rr.top + 13 + s); // medido: 13 do alto da linha
+ D2D1_COLOR_F top, bot;
+ if (k == 0) { top = GGRgb(0x5AB8F5); bot = GGRgb(0x1E7AE6); }
+ else if (k == 1) { top = GGRgb(0x2A2A2C); bot = GGRgb(0x0E0E10); }
+ else if (k == 2) { top = GGRgb(0xA9A9AE); bot = GGRgb(0x7E7E84); }
+ else { top = D2D1::ColorF(std::min(1.f, c.accent.r + 0.25f), std::min(1.f, c.accent.g + 0.25f), std::min(1.f, c.accent.b + 0.25f), 1); bot = c.accent; }
+ D2D1_GRADIENT_STOP st[2] = { { 0, top }, { 1, bot } };
+ ID2D1GradientStopCollection* gs = nullptr; ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(c.dc->CreateGradientStopCollection(st, 2, &gs)) &&
+ SUCCEEDED(c.dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ t.left, t.top }, { t.left, t.bottom }), gs, &lb)))
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(t, 7, 7), lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ // nuvem com o sol atrás (o ícone do Tempo da referência)
+ float cx = (t.left + t.right) / 2, cy = (t.top + t.bottom) / 2;
+ if (k <= 1) { c.br->SetColor(GGRgb(0xFFC52E)); c.dc->FillEllipse(D2D1::Ellipse({ cx + 4.5f, cy - 4 }, 5.5f, 5.5f), c.br); }
+ c.br->SetColor(k == 2 ? D2D1::ColorF(0.93f, 0.93f, 0.95f, 1) : D2D1::ColorF(1, 1, 1, 1));
+ c.dc->FillEllipse(D2D1::Ellipse({ cx - 4, cy + 2.5f }, 5, 4.5f), c.br);
+ c.dc->FillEllipse(D2D1::Ellipse({ cx + 1, cy }, 5.5f, 5.5f), c.br);
+ c.dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cx - 9, cy + 1.5f, cx + 9, cy + 7.5f), 3, 3), c.br);
+ if (k == cur) { c.br->SetColor(c.accent); c.dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(t.left - 2.5f, t.top - 2.5f, t.right + 2.5f, t.bottom + 2.5f), 9, 9), c.br, 3); }
+ Text(c, names[k], D2D1::RectF(t.left - 22, rr.top + 46, t.right + 22, rr.top + 62), k == cur && c.noteBoldCenter ? c.noteBoldCenter : c.noteCenter, k == cur ? c.text : c.text2);
+ }
+ if (cur == 1) { // medido: bolinhas a 123,5 e 52,5 da borda, textos a 13 delas, centro a 85,5 do alto
+ bool autoOn = Setting(L"estilo_escuro_auto", L"0") == L"1";
+ float cy = rr.top + 85.5f;
+ const wchar_t* labels[2] = { L"Sempre", L"Automático" };
+ float xs[2] = { rr.right - 123.5f, rr.right - 52.5f };
+ for (int k = 0; k < 2; k++) {
+ bool on = (k == 1) == autoOn;
+ D2D1_POINT_2F m{ xs[k], cy };
+ if (on) {
+ c.br->SetColor(c.accent); c.dc->FillEllipse(D2D1::Ellipse(m, 7, 7), c.br);
+ c.br->SetColor(D2D1::ColorF(1, 1, 1, 1)); c.dc->FillEllipse(D2D1::Ellipse(m, 2.8f, 2.8f), c.br);
+ } else {
+ c.br->SetColor(c.dark ? D2D1::ColorF(1, 1, 1, 0.16f) : D2D1::ColorF(0, 0, 0, 0.08f)); c.dc->FillEllipse(D2D1::Ellipse(m, 7, 7), c.br);
+ }
+ Text(c, labels[k], D2D1::RectF(m.x + 13, cy - 10, m.x + 80, cy + 10), c.body, c.text);
+ }
+ }
+ };
+ icons.clickAt = [](D2D1_POINT_2F pt, D2D1_RECT_F rr) {
+ const float s = 29.5f, pitch = 51.5f;
+ for (int k = 0; k < 4; k++) {
+ float x = rr.right - 13 - s - (3 - k) * pitch;
+ if (pt.x >= x - 10 && pt.x <= x + s + 10 && pt.y >= rr.top + 8 && pt.y <= rr.top + 64) { SetSetting(L"estilo_icones", ESTILOS[k]); Rebuild(); }
+ }
+ if (Setting(L"estilo_icones", L"padrao") == L"escuro" && std::fabs(pt.y - (rr.top + 85.5f)) <= 10) {
+ if (pt.x >= rr.right - 132 && pt.x < rr.right - 60) { SetSetting(L"estilo_escuro_auto", L"0"); Rebuild(); }
+ else if (pt.x >= rr.right - 60) { SetSetting(L"estilo_escuro_auto", L"1"); Rebuild(); }
+ }
+ };
+ // Cor das pastas: "Automática" segue a cor de destaque; as outras retingem as pastas comuns do Finder (as mesmas cores
+ // de Personalizar Pasta, finder\pastacor.cpp), gravado em cor_pastas (-1 = automática)
+ static const UINT32 GG_PASTAS[9] = { 0xFF453A, 0xFF9F0A, 0xFFD60A, 0x30D158, 0x64D2FF, 0x0A84FF, 0xBF5AF2, 0xFF375F, 0x8E8E93 };
+ Row folder = Popup(L"Cor das pastas", { L"Automática", L"Vermelho", L"Laranja", L"Amarelo", L"Verde", L"Menta", L"Azul", L"Roxo", L"Rosa", L"Cinza" },
+ [] { return std::clamp(_wtoi(Setting(L"cor_pastas", L"-1").c_str()) + 1, 0, 9); },
+ [](int i) { SetSetting(L"cor_pastas", std::to_wstring(i - 1)); Rebuild(); });
+ folder.gg = true; folder.height = 40;
+ folder.dot = [](int i) { return i <= 0 ? Accent() : GGRgb(GG_PASTAS[std::clamp(i - 1, 0, 8)]); };
+ p.groups.push_back(G({ icons, folder }));
+
+ // ---- Janelas (barras de rolagem), Transparência e Efeitos e o tema do WacOS
+ p.groups.push_back(G({ Popup(L"Mostrar barras de rolagem", { L"Ao rolar", L"Sempre" },
+ [] { DWORD v = 1, cb = sizeof(v); RegGetValueW(HKEY_CURRENT_USER, L"Control Panel\\Accessibility", L"DynamicScrollbars", RRF_RT_REG_DWORD, nullptr, &v, &cb); return v ? 0 : 1; },
+ [](int i) {
+ DWORD v = i == 0 ? 1 : 0;
+ RegSetKeyValueW(HKEY_CURRENT_USER, L"Control Panel\\Accessibility", L"DynamicScrollbars", REG_DWORD, &v, sizeof(v));
+ SendMessageTimeoutW(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)L"Accessibility", SMTO_ABORTIFHUNG, 200, nullptr);
+ }) }, L"Janelas"));
+ p.groups.push_back(G({ Link(L"Transparência e Efeitos", [] { Push(L"Transparência e Efeitos", TransparenciaEfeitos); }, 0xE790, C_BLUE) }));
+ Row tema = TemaRow();
+ tema.label = L"Estilo do WacOS";
+ p.groups.push_back(G({ tema }));
+ return p;
+}
+
// ================= Aparência > Transparência e Efeitos
// O vidro do Shell (Dock, barra de menus, menus, Central de Controle, Spotlight e painéis): o do
// Sequoia, ou o Liquid Glass do macOS Tahoe (lente nas bordas, brilho especular, cantos redondos)
@@ -869,13 +1243,13 @@ Page TransparenciaEfeitos() {
float w = 92, gap = 16, x = rr.right - 10 - 3 * w - 2 * gap;
for (int k = 0; k < 3; k++, x += w + gap) {
if (pt.x < x - 6 || pt.x > x + w + 6) continue;
- if (k == 0) SetSetting(L"liquid_glass", L"0");
+ if (k == 0) { SetSetting(L"liquid_glass", L"0"); SetSetting(L"golden_gate", L"0"); } // Sequoia: sai do Golden Gate também
else { SetSetting(L"liquid_estilo", k == 1 ? L"nitido" : L"tingido"); SetSetting(L"liquid_glass", L"1"); }
Rebuild();
}
};
Row lg = Toggle(L"Liquid Glass", [] { return Setting(L"liquid_glass", L"0") == L"1"; },
- [](bool v) { SetSetting(L"liquid_glass", v ? L"1" : L"0"); Rebuild(); },
+ [](bool v) { SetSetting(L"liquid_glass", v ? L"1" : L"0"); if (!v) SetSetting(L"golden_gate", L"0"); Rebuild(); },
L"O vidro do macOS Tahoe: pouco fosco e mais vivo, com brilho nas bordas e cantos mais redondos.");
lg.enabled = !reduce;
// vidro real: a tela por baixo, com refração de verdade na borda (como o Tahoe); desligado, o vidro
diff --git a/src/calculadora/main.cpp b/src/calculadora/main.cpp
index ab8200d..d7e24be 100644
--- a/src/calculadora/main.cpp
+++ b/src/calculadora/main.cpp
@@ -1214,6 +1214,7 @@ void DrawLights(ID2D1RenderTarget* rt, ID2D1SolidColorBrush* br) {
bool enabled = k < 2; // a Calculadora não amplia (o verde fica apagado, como no Mac)
br->SetColor(lit && enabled ? fill[k] : off);
rt->FillEllipse(D2D1::Ellipse(c, 7, 7), br);
+ semaforo::Gloss(rt, c, 7, br);
br->SetColor(lit && enabled ? ring[k] : offRing);
rt->DrawEllipse(D2D1::Ellipse(c, 6.75f, 6.75f), br, 0.5f);
if (!g_hoverLights || !enabled) continue;
diff --git a/src/calendario/main.cpp b/src/calendario/main.cpp
index 22272be..b5ebbb1 100644
--- a/src/calendario/main.cpp
+++ b/src/calendario/main.cpp
@@ -11,7 +11,8 @@ using namespace app2d;
namespace {
-const float TB = 64, WEEKHEAD = 30, HOUR = 48, ALLDAY = 26, LEFTCOL = 56;
+float TB = 64; // macOS 27: 112 (barra de 52 + a linha do título)
+const float WEEKHEAD = 30, HOUR = 48, ALLDAY = 26, LEFTCOL = 56;
const UINT WM_FIELDLOST = WM_APP + 77;
struct Ev { int id; long long start, end; bool allDay; std::wstring title; int color; std::wstring notes; int cal = 1; };
@@ -20,7 +21,8 @@ std::vector<Ev> g_ev;
struct Cal { int id; std::wstring name; int color; bool on; };
std::vector<Cal> g_cals;
bool g_side = true;
-const float SIDE = 200;
+float SIDE = 200; // macOS 27: 218,5
+std::wstring g_search; // macOS 27: busca (Enter vai ao próximo evento com o texto)
Cal* FindCal(int id) { for (auto& c : g_cals) if (c.id == id) return &c; return nullptr; }
bool CalOn(const Ev& e) { Cal* c = FindCal(e.cal); return !c || c->on; }
int g_nextId = 1;
@@ -32,6 +34,7 @@ long long g_selDay; // dia escolhido
int g_selEv = -1;
float g_scrollH = 8 * 48; // Semana/Dia: rolagem (começa às 8h)
int g_editing = -1;
+IDWriteTextFormat *g_tfTitleG, *g_tfTitleYG, *g_tfSeg, *g_tfSideG, *g_tfSideBold, *g_tfSecG, *g_tfMiniT, *g_tfMiniD, *g_tfMiniW;
IDWriteTextFormat *g_tfYearDay, *g_tfMonth, *g_tfYear, *g_tfBtn, *g_tfDay, *g_tfDayNum, *g_tfEv, *g_tfEvSmall, *g_tfHour, *g_tfHeadDay, *g_tfIcon;
D2D1_COLOR_F EvColor(int i) {
@@ -268,9 +271,146 @@ void PaintYear(D2D1_SIZE_F sz, bool dark, D2D1_COLOR_F text, D2D1_COLOR_F gray)
}
}
+// ================= macOS 27 (captura Calendar do 512 Pixels, 2x, medida em pt)
+// Barra unificada de 52: na barra lateral (218,5, tingida) os botões de vidro calendários/caixa de entrada (77,5 × 36 a
+// 133,5); no conteúdo o "+" redondo de 37 a 6 da lateral, a cápsula Dia/Semana/Mês/Ano de 241 × 36 no meio do conteúdo
+// e a busca redonda de 36 a 8 da borda. Embaixo da barra o título (mês em negrito de 34 + ano normal) a 16,5 do
+// conteúdo, centro a 79, e "‹ Hoje ›" (cápsulas cinza de 24) à direita. Lateral: seção a 68, linhas de 31,5 com a
+// caixinha de 13 a 17,5 e o nome a 41,5; o mini mês embaixo (título a 190 do fundo, letras a 157,5, dias a cada
+// 28 × 23,5 a partir de 133,5 do fundo).
+void MiniMonth(float x0, float bottom, bool dark, D2D1_COLOR_F text, D2D1_COLOR_F gray) {
+ D2D1_COLOR_F soft = dark ? Rgb(255, 255, 255, 0.5f) : Rgb(0, 0, 0, 0.45f), faint = dark ? Rgb(255, 255, 255, 0.28f) : Rgb(0, 0, 0, 0.25f);
+ Fill(D2D1::RectF(x0 + 19, bottom - 223.5f, x0 + 199, bottom - 223), dark ? Rgb(255, 255, 255, 0.12f) : Rgb(0, 0, 0, 0.10f));
+ long long ms = MonthStart(g_selDay ? g_selDay : g_anchor), first = WeekStart(ms);
+ SYSTEMTIME am = FromMin(ms);
+ std::wstring mn = MonthName(am.wMonth);
+ if (!idioma::En() && !mn.empty()) mn[0] = towupper(mn[0]);
+ float ty = bottom - 190;
+ Text(mn + L" " + std::to_wstring(am.wYear), g_tfMiniT, D2D1::RectF(x0 + 40, ty - 10, x0 + 180, ty + 10), soft);
+ D2D1_RECT_F pv = D2D1::RectF(x0 + 16, ty - 10, x0 + 36, ty + 10), nx = D2D1::RectF(x0 + 184.5f, ty - 10, x0 + 204.5f, ty + 10);
+ Text(L"‹", g_tfMonth, D2D1::RectF(pv.left, pv.top - 8, pv.right, pv.bottom + 4), soft);
+ Text(L"›", g_tfMonth, D2D1::RectF(nx.left, nx.top - 8, nx.right, nx.bottom + 4), soft);
+ g_hits.push_back({ 10, -1, 0, pv }); g_hits.push_back({ 10, 1, 0, nx });
+ for (int d = 0; d < 7; d++) {
+ float cx = x0 + 26.5f + d * 28;
+ Text(std::wstring(1, WeekdayShort(d)[0]), g_tfMiniW, D2D1::RectF(cx - 12, bottom - 167.5f, cx + 12, bottom - 147.5f), soft);
+ }
+ long long today = DayStart(NowMin());
+ for (int i = 0; i < 42; i++) {
+ long long day = AddDays(first, i);
+ SYSTEMTIME s = FromMin(day);
+ float cx = x0 + 26.5f + (i % 7) * 28, cy = bottom - 133.5f + (i / 7) * 23.5f;
+ D2D1_RECT_F c = D2D1::RectF(cx - 12, cy - 11, cx + 12, cy + 11);
+ bool other = s.wMonth != am.wMonth, wk = s.wDayOfWeek == 0 || s.wDayOfWeek == 6;
+ if (day == today) Circle({ cx, cy }, 9.5f, Rgb(255, 59, 48), true);
+ else if (day == g_selDay) Circle({ cx, cy }, 9.5f, dark ? Rgb(255, 255, 255, 0.14f) : Rgb(0, 0, 0, 0.08f), true);
+ Text(std::to_wstring(s.wDay), g_tfMiniD, c, day == today ? Rgb(255, 255, 255) : other ? faint : wk ? soft : text);
+ g_hits.push_back({ 11, -1, day, c });
+ }
+}
+
+void PaintGolden() {
+ bool dark = Dark();
+ D2D1_SIZE_F sz = Size();
+ D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
+ rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ auto rems = Reminders();
+ float X0 = g_side ? SIDE : 0;
+ D2D1_SIZE_F csz{ sz.width - X0, sz.height };
+ rt->SetTransform(D2D1::Matrix3x2F::Translation(X0, 0));
+ size_t h0 = g_hits.size();
+ if (g_view == V_YEAR) PaintYear(csz, dark, text, gray);
+ else if (g_view == V_MONTH) PaintMonth(csz, dark, text, gray, rems); else PaintGrid(csz, dark, text, gray, rems);
+ rt->SetTransform(D2D1::Matrix3x2F::Identity());
+ for (size_t i = h0; i < g_hits.size(); i++) { g_hits[i].r.left += X0; g_hits[i].r.right += X0; }
+ // a faixa de cima do conteúdo (barra + título) por cima da grade
+ Fill(D2D1::RectF(X0, 0, sz.width, TB), dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ if (g_side) {
+ Fill(D2D1::RectF(0, 0, SIDE, sz.height), dark ? Rgb(43, 41, 40) : Rgb(237, 237, 236));
+ Fill(D2D1::RectF(SIDE - 0.5f, 0, SIDE, sz.height), dark ? Rgb(0, 0, 0, 0.5f) : Rgb(0, 0, 0, 0.08f));
+ // calendários / caixa de entrada (vidro): o primeiro esconde a lateral
+ D2D1_RECT_F grp = D2D1::RectF(133.5f, 8, 211, 44);
+ GlassButton(grp, dark);
+ D2D1_RECT_F b1 = D2D1::RectF(grp.left + 4, 12, grp.left + 35, 40), b2 = D2D1::RectF(grp.right - 35, 12, grp.right - 4, 40);
+ Fill(b1, dark ? Rgb(255, 255, 255, 0.14f) : Rgb(0, 0, 0, 0.08f), 14);
+ IconSidebar({ (b1.left + b1.right) / 2, (b1.top + b1.bottom) / 2 }, text);
+ { // bandeja (caixa de entrada)
+ float cx = (b2.left + b2.right) / 2, cy = (b2.top + b2.bottom) / 2;
+ br->SetColor(text);
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cx - 8, cy - 5, cx + 8, cy + 6), 2.5f, 2.5f), br, 1.4f);
+ rt->DrawLine({ cx - 8, cy + 0.5f }, { cx - 3, cy + 0.5f }, br, 1.4f); rt->DrawLine({ cx + 3, cy + 0.5f }, { cx + 8, cy + 0.5f }, br, 1.4f);
+ rt->DrawLine({ cx - 3, cy + 0.5f }, { cx - 2, cy + 2.5f }, br, 1.4f); rt->DrawLine({ cx - 2, cy + 2.5f }, { cx + 2, cy + 2.5f }, br, 1.4f); rt->DrawLine({ cx + 2, cy + 2.5f }, { cx + 3, cy + 0.5f }, br, 1.4f);
+ }
+ g_hits.push_back({ 5, 0, 0, b1 }); BarButton(grp);
+ Text(Tr(L"Calendários"), g_tfSecG, D2D1::RectF(20, 58, SIDE - 14, 78), gray);
+ float y = 84.5f;
+ for (int i = 0; i < (int)g_cals.size(); i++) {
+ auto& c = g_cals[i];
+ D2D1_RECT_F r = D2D1::RectF(10, y, SIDE - 10, y + 31.5f);
+ D2D1_RECT_F box = D2D1::RectF(17.5f, y + 9.25f, 30.5f, y + 22.25f);
+ D2D1_COLOR_F col = EvColor(c.color);
+ if (c.on) {
+ Fill(box, col, 3);
+ br->SetColor(Rgb(255, 255, 255));
+ rt->DrawLine({ box.left + 3, box.top + 6.8f }, { box.left + 5.5f, box.top + 9.3f }, br, 1.6f);
+ rt->DrawLine({ box.left + 5.5f, box.top + 9.3f }, { box.left + 10, box.top + 3.8f }, br, 1.6f);
+ } else { br->SetColor(col); rt->DrawRoundedRectangle(D2D1::RoundedRect(box, 3, 3), br, 1.3f); }
+ Text(c.name, g_tfSideG, D2D1::RectF(41.5f, r.top, r.right, r.bottom), text);
+ g_hits.push_back({ 6, i, 0, r });
+ y += 31.5f;
+ }
+ D2D1_RECT_F add = D2D1::RectF(17.5f, y + 2, SIDE - 14, y + 30);
+ Text(L"+ " + std::wstring(Tr(L"Novo Calendário")), g_tfSideG, add, gray);
+ g_hits.push_back({ 7, 0, 0, add });
+ MiniMonth(0, sz.height, dark, text, gray);
+ }
+ // barra: "+" redondo, Dia/Semana/Mês/Ano, busca
+ float cl = X0, cr = sz.width;
+ float plusL = g_side ? cl + 6 : 84;
+ D2D1_RECT_F plus = D2D1::RectF(plusL, 7.5f, plusL + 37, 44.5f);
+ GlassButton(plus, dark);
+ br->SetColor(text);
+ { float cx = (plus.left + plus.right) / 2, cy = 26; rt->DrawLine({ cx - 7, cy }, { cx + 7, cy }, br, 1.6f); rt->DrawLine({ cx, cy - 7 }, { cx, cy + 7 }, br, 1.6f); }
+ g_hits.push_back({ 9, 0, 0, plus }); BarButton(plus);
+ const wchar_t* names[] = { L"Dia", L"Semana", L"Mês", L"Ano" };
+ float segW = 241, mid = (cl + cr) / 2;
+ D2D1_RECT_F seg = D2D1::RectF(mid - segW / 2, 8, mid + segW / 2, 44);
+ GlassButton(seg, dark);
+ BarButton(seg);
+ float iw = (segW - 8) / 4;
+ for (int i = 0; i < 4; i++) {
+ D2D1_RECT_F r = D2D1::RectF(seg.left + 4 + i * iw, 12, seg.left + 4 + (i + 1) * iw, 40);
+ if (g_view == i) Fill(r, dark ? Rgb(255, 255, 255, 0.16f) : Rgb(0, 0, 0, 0.075f), 14);
+ Text(Tr(names[i]), g_tfSeg, r, text);
+ g_hits.push_back({ 4, i, 0, r });
+ }
+ D2D1_RECT_F srch = D2D1::RectF(cr - 8 - 36, 8, cr - 8, 44);
+ GlassButton(srch, dark);
+ IconSearch({ (srch.left + srch.right) / 2, 26 }, text);
+ g_hits.push_back({ 12, 0, 0, srch }); BarButton(srch);
+ // título
+ SYSTEMTIME a = FromMin(g_anchor);
+ std::wstring mon = g_view == V_YEAR ? L"" : MonthName(a.wMonth);
+ if (!idioma::En() && !mon.empty()) mon[0] = towupper(mon[0]);
+ float tx = cl + 16.5f, mw = mon.empty() ? 0 : TextW(g_tfTitleG, mon) + 10;
+ if (!mon.empty()) Text(mon, g_tfTitleG, D2D1::RectF(tx, 58, tx + mw + 4, 100), text);
+ Text(std::to_wstring(a.wYear), g_tfTitleYG, D2D1::RectF(tx + mw, 58, tx + mw + 160, 100), text);
+ // ‹ Hoje ›
+ D2D1_COLOR_F pill = dark ? Rgb(255, 255, 255, 0.12f) : Rgb(234, 234, 234);
+ D2D1_RECT_F nx = D2D1::RectF(cr - 34.5f, 69, cr - 10.5f, 93), td = D2D1::RectF(nx.left - 71, 69, nx.left - 6, 93), pv = D2D1::RectF(td.left - 29.5f, 69, td.left - 5.5f, 93);
+ Fill(pv, pill, 12); Fill(td, pill, 12); Fill(nx, pill, 12);
+ Text(Tr(L"Hoje"), g_tfSeg, td, text);
+ br->SetColor(text);
+ { float cx = (pv.left + pv.right) / 2, cy = 81; rt->DrawLine({ cx + 2, cy - 5 }, { cx - 3, cy }, br, 1.6f); rt->DrawLine({ cx - 3, cy }, { cx + 2, cy + 5 }, br, 1.6f); }
+ { float cx = (nx.left + nx.right) / 2, cy = 81; rt->DrawLine({ cx - 2, cy - 5 }, { cx + 3, cy }, br, 1.6f); rt->DrawLine({ cx + 3, cy }, { cx - 2, cy + 5 }, br, 1.6f); }
+ g_hits.push_back({ 3, -1, 0, pv }); g_hits.push_back({ 3, 0, 0, td }); g_hits.push_back({ 3, 1, 0, nx });
+}
+
void Paint() {
if (!BeginPaint()) return;
g_hits.clear();
+ barButtons.clear();
+ if (BAR > 0) { PaintGolden(); EndPaint(); return; }
bool dark = Dark();
D2D1_SIZE_F sz = Size();
D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
@@ -489,6 +629,27 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
return 0;
}
for (auto& ht : g_hits) if (ht.kind == 3 && In(ht.r, x, y)) { Nav(ht.ev); return 0; }
+ for (auto& ht : g_hits) if (ht.kind == 9 && In(ht.r, x, y)) { NewEvent(g_selDay, g_selDay + 9 * 60, g_view == V_MONTH); return 0; }
+ for (auto& ht : g_hits) if (ht.kind == 10 && In(ht.r, x, y)) { g_selDay = AddMonths(MonthStart(g_selDay), ht.ev); InvalidateRect(h, nullptr, FALSE); return 0; }
+ for (auto& ht : g_hits) if (ht.kind == 11 && In(ht.r, x, y)) { g_anchor = g_selDay = ht.day; InvalidateRect(h, nullptr, FALSE); return 0; }
+ for (auto& ht : g_hits) if (ht.kind == 12 && In(ht.r, x, y)) { // busca: digita e Enter vai ao próximo evento com o texto
+ D2D1_RECT_F fr = D2D1::RectF(ht.r.left - 200, ht.r.top + 8, ht.r.left - 8, ht.r.bottom - 8);
+ FieldOpen(fr, g_search, 13, false, [](const std::wstring& q, int key) {
+ g_search = q;
+ if (key != VK_RETURN || q.empty()) return;
+ std::wstring lq = q; for (auto& c : lq) c = towlower(c);
+ const Ev* best = nullptr;
+ for (auto& e : g_ev) {
+ std::wstring tt = e.title; for (auto& c : tt) c = towlower(c);
+ if (tt.find(lq) == std::wstring::npos) continue;
+ if (!best || (e.start >= g_selDay && (best->start < g_selDay || e.start < best->start))) best = &e;
+ }
+ if (best) { g_anchor = g_selDay = DayStart(best->start); g_selEv = best->id; }
+ else MessageBeep(MB_ICONASTERISK);
+ InvalidateRect(wnd, nullptr, FALSE);
+ });
+ return 0;
+ }
for (int i = (int)g_hits.size() - 1; i >= 0; i--) {
auto& ht = g_hits[i];
if (ht.kind != 1 || !In(ht.r, x, y)) continue;
@@ -555,7 +716,18 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
g_tfHour = Fmt(10.5f, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_TRAILING);
g_tfIcon = Fmt(14, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
if (g_tfMonth) { g_tfMonth->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING); }
- if (!CreateMain(hi, L"CalendarioJanela", Tr(L"Calendário"), Proc, 1100, 760)) return 1;
+ g_tfTitleG = Fmt(34, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_LEADING, false, disp.c_str());
+ g_tfTitleYG = Fmt(34, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_LEADING, false, disp.c_str());
+ g_tfSeg = Fmt(13, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfSideG = Fmt(13);
+ g_tfSideBold = Fmt(13, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfSecG = Fmt(11, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfMiniT = Fmt(13, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfMiniD = Fmt(12.5f, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfMiniW = Fmt(11.5f, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ barWanted = 52; // macOS 27: barra unificada
+ if (semaforo::Aqua()) { TB = 112; SIDE = 218.5f; }
+ if (!CreateMain(hi, L"CalendarioJanela", Tr(L"Calendário"), Proc, semaforo::Aqua() ? 1137 : 1100, semaforo::Aqua() ? 760 : 760)) return 1;
SetTimer(wnd, 1, 30000, nullptr);
ShowWindow(wnd, show);
return Run();
diff --git a/src/clima/main.cpp b/src/clima/main.cpp
index 9163264..45e1dbb 100644
--- a/src/clima/main.cpp
+++ b/src/clima/main.cpp
@@ -1,414 +1,631 @@
-// Clima (Weather do Mac): à esquerda as cidades (a primeira é a dos Ajustes, a mesma do widget); à direita, sobre
-// um fundo da cor do céu, a cidade, a temperatura grande, a condição, máx./mín., a previsão por hora (24 h), a de
-// 10 dias (com a barra de mín.–máx.) e os quadros de sensação, umidade, vento e sol. Dados do Open-Meteo (sem chave).
-// "+" procura uma cidade pelo nome (geocodificação do Open-Meteo); botão direito numa cidade remove.
-// Cidades em %APPDATA%\Shell\clima.txt.
-#include "../comum/app2d.h"
-#include <winhttp.h>
-#include <map>
-#include <mutex>
-#include <thread>
-#pragma comment(lib, "winhttp.lib")
-
-using namespace app2d;
-
-namespace {
-
-const float SB = 230;
-const UINT WM_DATA = WM_APP + 5, WM_FIELDLOST = WM_APP + 77;
-
-struct Hour { double t; float temp; int code; bool day; };
-struct Day { double t; float hi, lo; int code; double rise, set; };
-struct Wx { bool ok = false; float temp = 0, feels = 0, hum = 0, wind = 0; int code = 0; bool day = true; int off = 0; std::vector<Hour> hours; std::vector<Day> days; };
-struct Place { std::wstring name; std::wstring lat, lon; Wx wx; bool loading = false; };
-std::vector<Place> g_places;
-int g_sel = 0;
-std::mutex g_mx;
-std::wstring g_file;
-std::wstring g_status;
-IDWriteTextFormat *g_tfSmallC, *g_tfCity, *g_tfTemp, *g_tfCond, *g_tfSmall, *g_tfCard, *g_tfCardBig, *g_tfEmoji, *g_tfEmojiSmall, *g_tfSide, *g_tfSideTemp, *g_tfIcon, *g_tfRowR;
-
-std::string HttpGet(const wchar_t* host, const std::wstring& path) {
- std::string body;
- HINTERNET ses = WinHttpOpen(L"SequoiaClima/1.0", WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0);
- if (!ses) return body;
- WinHttpSetTimeouts(ses, 5000, 5000, 8000, 8000);
- HINTERNET con = WinHttpConnect(ses, host, INTERNET_DEFAULT_HTTPS_PORT, 0);
- HINTERNET req = con ? WinHttpOpenRequest(con, L"GET", path.c_str(), nullptr, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_SECURE) : nullptr;
- if (req && WinHttpSendRequest(req, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA, 0, 0, 0) && WinHttpReceiveResponse(req, nullptr)) {
- DWORD status = 0, sz = sizeof(status);
- WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, nullptr, &status, &sz, nullptr);
- DWORD avail = 0;
- while (WinHttpQueryDataAvailable(req, &avail) && avail && body.size() < 512 * 1024) {
- std::string chunk(avail, '\0'); DWORD got = 0;
- if (!WinHttpReadData(req, chunk.data(), avail, &got) || !got) break;
- body.append(chunk.data(), got);
- }
- if (status != 200) body.clear();
- }
- if (req) WinHttpCloseHandle(req);
- if (con) WinHttpCloseHandle(con);
- WinHttpCloseHandle(ses);
- return body;
-}
-std::string Section(const std::string& j, const char* key) {
- size_t p = j.find(std::string("\"") + key + "\":{");
- if (p == std::string::npos) return "";
- p = j.find('{', p);
- int depth = 0;
- for (size_t i = p; i < j.size(); i++) { if (j[i] == '{') depth++; else if (j[i] == '}' && --depth == 0) return j.substr(p, i - p + 1); }
- return "";
-}
-double Number(const std::string& s, const char* key) {
- size_t p = s.find(std::string("\"") + key + "\":");
- if (p == std::string::npos) return NAN;
- p += strlen(key) + 3;
- while (p < s.size() && s[p] == ' ') p++;
- if (s.compare(p, 4, "null") == 0) return NAN;
- return strtod(s.c_str() + p, nullptr);
-}
-std::vector<double> Array(const std::string& s, const char* key) {
- std::vector<double> v;
- size_t p = s.find(std::string("\"") + key + "\":[");
- if (p == std::string::npos) return v;
- p = s.find('[', p) + 1;
- while (p < s.size() && s[p] != ']') {
- while (p < s.size() && (s[p] == ' ' || s[p] == ',')) p++;
- if (s[p] == ']') break;
- if (s.compare(p, 4, "null") == 0) { v.push_back(NAN); p += 4; continue; }
- char* e = nullptr; v.push_back(strtod(s.c_str() + p, &e));
- if (e == s.c_str() + p) break;
- p = e - s.c_str();
- }
- return v;
-}
-std::wstring Utf8(const std::string& s) { int n = MultiByteToWideChar(CP_UTF8, 0, s.data(), (int)s.size(), nullptr, 0); std::wstring w(n, L'\0'); MultiByteToWideChar(CP_UTF8, 0, s.data(), (int)s.size(), w.data(), n); return w; }
-std::string ToUtf8(const std::wstring& w) { int n = WideCharToMultiByte(CP_UTF8, 0, w.data(), (int)w.size(), nullptr, 0, nullptr, nullptr); std::string s(n, '\0'); WideCharToMultiByte(CP_UTF8, 0, w.data(), (int)w.size(), s.data(), n, nullptr, nullptr); return s; }
-std::string StrField(const std::string& s, const char* key) {
- size_t p = s.find(std::string("\"") + key + "\":\"");
- if (p == std::string::npos) return "";
- p += strlen(key) + 4;
- size_t e = s.find('"', p);
- return e == std::string::npos ? "" : s.substr(p, e - p);
-}
-
-bool Parse(const std::string& j, Wx& w) {
- std::string cur = Section(j, "current"), hr = Section(j, "hourly"), dl = Section(j, "daily");
- if (cur.empty() || hr.empty() || dl.empty()) return false;
- double off = Number(j, "utc_offset_seconds"); if (!std::isnan(off)) w.off = (int)off;
- w.temp = (float)Number(cur, "temperature_2m"); w.feels = (float)Number(cur, "apparent_temperature");
- w.hum = (float)Number(cur, "relative_humidity_2m"); w.wind = (float)Number(cur, "wind_speed_10m");
- w.code = (int)Number(cur, "weather_code"); w.day = Number(cur, "is_day") > 0.5;
- auto t = Array(hr, "time"), tp = Array(hr, "temperature_2m"), c = Array(hr, "weather_code"), d = Array(hr, "is_day");
- for (size_t i = 0; i < t.size() && i < tp.size() && i < c.size() && i < d.size(); i++) w.hours.push_back({ t[i], (float)tp[i], (int)c[i], d[i] > 0.5 });
- auto dt = Array(dl, "time"), mx = Array(dl, "temperature_2m_max"), mn = Array(dl, "temperature_2m_min"), dc = Array(dl, "weather_code"), sr = Array(dl, "sunrise"), ss = Array(dl, "sunset");
- for (size_t i = 0; i < dt.size() && i < mx.size() && i < mn.size() && i < dc.size(); i++)
- w.days.push_back({ dt[i], (float)mx[i], (float)mn[i], (int)dc[i], i < sr.size() ? sr[i] : 0, i < ss.size() ? ss[i] : 0 });
- w.ok = !std::isnan(w.temp) && !w.days.empty();
- return w.ok;
-}
-
-void Fetch(int i) {
- Place& p = g_places[i];
- if (p.loading) return;
- p.loading = true;
- std::wstring lat = p.lat, lon = p.lon;
- HWND h = wnd;
- std::thread([i, lat, lon, h] {
- std::wstring path = L"/v1/forecast?latitude=" + lat + L"&longitude=" + lon +
- L"&current=temperature_2m,apparent_temperature,relative_humidity_2m,wind_speed_10m,weather_code,is_day"
- L"&hourly=temperature_2m,weather_code,is_day&daily=weather_code,temperature_2m_max,temperature_2m_min,sunrise,sunset"
- L"&timezone=auto&forecast_days=10&timeformat=unixtime";
- std::string body = HttpGet(L"api.open-meteo.com", path);
- auto* w = new Wx;
- if (body.empty() || !Parse(body, *w)) w->ok = false;
- if (!PostMessageW(h, WM_DATA, (WPARAM)i, (LPARAM)w)) delete w;
- }).detach();
-}
-
-void Save() {
- std::vector<std::wstring> out{ L"# Cidades do Clima (nome, latitude, longitude); a primeira vem dos Ajustes" };
- for (size_t i = 1; i < g_places.size(); i++) out.push_back(L"C\t" + Esc(g_places[i].name) + L"\t" + g_places[i].lat + L"\t" + g_places[i].lon);
- WriteLines(g_file, out);
-}
-
-std::wstring Setting(const wchar_t* key, const wchar_t* def) {
- for (auto& l : ReadLines(DataPath(L"ajustes.txt"))) { size_t e = l.find(L'='); if (e != std::wstring::npos && l.substr(0, e) == key) return l.substr(e + 1); }
- return def;
-}
-void Load() {
- g_places.clear();
- g_places.push_back({ Setting(L"tempoCidade", L"Campinas"), Setting(L"tempoLat", L"-22.9056"), Setting(L"tempoLon", L"-47.0608") });
- for (auto& l : ReadLines(g_file)) { auto f = Split(l); if (f.size() >= 4 && f[0] == L"C") g_places.push_back({ Unesc(f[1]), f[2], f[3] }); }
-}
-
-// procura a cidade (geocodificação) e põe na lista
-void Search(const std::wstring& q) {
- if (q.empty()) return;
- g_status = Tr(L"Procurando…");
- InvalidateRect(wnd, nullptr, FALSE);
- HWND h = wnd;
- std::thread([q, h] {
- std::string u = ToUtf8(q), enc;
- for (unsigned char c : u) { if (isalnum(c) || c == '-' || c == '.') enc += (char)c; else { char b[4]; sprintf_s(b, "%%%02X", c); enc += b; } }
- std::wstring path = L"/v1/search?count=1&language=" + std::wstring(idioma::En() ? L"en" : L"pt") + L"&name=" + Utf8(enc);
- std::string body = HttpGet(L"geocoding-api.open-meteo.com", path);
- auto* p = new Place;
- if (!body.empty() && body.find("\"results\"") != std::string::npos) {
- double la = Number(body, "latitude"), lo = Number(body, "longitude");
- std::string name = StrField(body, "name"), adm = StrField(body, "admin1");
- if (!std::isnan(la)) {
- wchar_t a[32], b[32]; swprintf_s(a, L"%.4f", la); swprintf_s(b, L"%.4f", lo);
- p->name = Utf8(name); p->lat = a; p->lon = b;
- }
- }
- if (!PostMessageW(h, WM_DATA, (WPARAM)-1, (LPARAM)p)) delete p;
- }).detach();
-}
-
-// ---- condições (códigos WMO)
-const wchar_t* CondText(int c) {
- if (c == 0) return Tr(L"Céu Limpo");
- if (c <= 2) return Tr(L"Parcialmente Nublado");
- if (c == 3) return Tr(L"Nublado");
- if (c == 45 || c == 48) return Tr(L"Neblina");
- if (c >= 51 && c <= 57) return Tr(L"Garoa");
- if ((c >= 61 && c <= 67) || (c >= 80 && c <= 82)) return Tr(L"Chuva");
- if ((c >= 71 && c <= 77) || c == 85 || c == 86) return Tr(L"Neve");
- if (c >= 95) return Tr(L"Tempestade");
- return L"";
-}
-const wchar_t* CondEmoji(int c, bool day) {
- if (c == 0) return day ? L"☀️" : L"\U0001F319";
- if (c <= 2) return day ? L"⛅" : L"☁️";
- if (c == 3) return L"☁️";
- if (c == 45 || c == 48) return L"\U0001F32B️";
- if (c >= 51 && c <= 57) return L"\U0001F326️";
- if ((c >= 61 && c <= 67) || (c >= 80 && c <= 82)) return L"\U0001F327️";
- if ((c >= 71 && c <= 77) || c == 85 || c == 86) return L"❄️";
- if (c >= 95) return L"⛈️";
- return L"☁️";
-}
-// cor do céu (em cima, embaixo)
-void Sky(const Wx& w, D2D1_COLOR_F& a, D2D1_COLOR_F& b) {
- bool cloudy = w.code >= 3, rain = w.code >= 51;
- if (!w.day) { a = Rgb(16, 24, 48); b = Rgb(38, 48, 80); }
- else if (rain) { a = Rgb(70, 84, 104); b = Rgb(110, 124, 140); }
- else if (cloudy) { a = Rgb(92, 120, 150); b = Rgb(140, 160, 182); }
- else { a = Rgb(40, 110, 200); b = Rgb(110, 170, 230); }
-}
-std::wstring HourOf(double unix, int off) { time_t t = (time_t)unix + off; tm g{}; gmtime_s(&g, &t); wchar_t b[8]; swprintf_s(b, L"%d", g.tm_hour); return b; }
-std::wstring HmOf(double unix, int off) { time_t t = (time_t)unix + off; tm g{}; gmtime_s(&g, &t); wchar_t b[8]; swprintf_s(b, L"%d:%02d", g.tm_hour, g.tm_min); return b; }
-int WdayOf(double unix, int off) { time_t t = (time_t)unix + off; tm g{}; gmtime_s(&g, &t); return g.tm_wday; }
-
-struct Hit { int kind, arg; D2D1_RECT_F r; };
-std::vector<Hit> g_hits;
-
-void Card(D2D1_RECT_F r) { Fill(r, Rgb(255, 255, 255, 0.14f), 14); }
-
-void Paint() {
- if (!BeginPaint()) return;
- g_hits.clear();
- bool dark = Dark();
- D2D1_SIZE_F sz = Size();
- D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139), white = Rgb(255, 255, 255), dim = Rgb(255, 255, 255, 0.7f);
- rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(242, 242, 245));
- // ---- cidades
- Fill(D2D1::RectF(0, 0, SB, sz.height), dark ? Rgb(40, 40, 42) : Rgb(236, 236, 240));
- D2D1_RECT_F add = D2D1::RectF(SB - 40, 10, SB - 10, 38);
- wchar_t p[2] = { 0xE710, 0 }; Text(p, g_tfIcon, add, text);
- g_hits.push_back({ 2, 0, add });
- float y = 48;
- for (int i = 0; i < (int)g_places.size(); i++) {
- auto& pl = g_places[i];
- D2D1_RECT_F r = D2D1::RectF(8, y, SB - 8, y + 70);
- if (pl.wx.ok) {
- D2D1_COLOR_F a, b; Sky(pl.wx, a, b);
- ID2D1GradientStopCollection* st = nullptr; D2D1_GRADIENT_STOP gs[2] = { { 0, a }, { 1, b } };
- rt->CreateGradientStopCollection(gs, 2, &st);
- ID2D1LinearGradientBrush* lg = nullptr;
- if (st) rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ r.left, r.top }, { r.right, r.bottom }), st, &lg);
- if (lg) { rt->FillRoundedRectangle(D2D1::RoundedRect(r, 12, 12), lg); lg->Release(); }
- if (st) st->Release();
- } else Fill(r, dark ? Rgb(58, 58, 60) : Rgb(255, 255, 255), 12);
- D2D1_COLOR_F tc = pl.wx.ok ? white : text;
- if (i == g_sel) { br->SetColor(Rgb(10, 132, 255)); rt->DrawRoundedRectangle(D2D1::RoundedRect(r, 12, 12), br, 2.5f); }
- Text(i == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfSide, D2D1::RectF(r.left + 12, r.top + 8, r.right - 60, r.top + 30), tc);
- if (i == 0) Text(pl.name, g_tfSmall, D2D1::RectF(r.left + 12, r.top + 28, r.right - 60, r.top + 46), pl.wx.ok ? dim : gray);
- if (pl.wx.ok) {
- Text(CondText(pl.wx.code), g_tfSmall, D2D1::RectF(r.left + 12, r.bottom - 24, r.right - 60, r.bottom - 6), dim);
- wchar_t t[16]; swprintf_s(t, L"%d°", (int)std::lround(pl.wx.temp));
- Text(t, g_tfSideTemp, D2D1::RectF(r.right - 70, r.top + 4, r.right - 10, r.top + 44), white);
- }
- g_hits.push_back({ 1, i, r });
- y += 78;
- }
- if (!g_status.empty()) Text(g_status, g_tfSmall, D2D1::RectF(12, sz.height - 30, SB - 10, sz.height - 8), gray);
- // ---- cidade escolhida
- if (g_sel < 0 || g_sel >= (int)g_places.size()) { EndPaint(); return; }
- Place pl; { std::lock_guard<std::mutex> l(g_mx); pl = g_places[g_sel]; }
- D2D1_RECT_F main = D2D1::RectF(SB, 0, sz.width, sz.height);
- if (!pl.wx.ok) { Text(pl.loading ? Tr(L"Carregando…") : Tr(L"Sem conexão com o serviço do tempo."), g_tfCond, main, gray); EndPaint(); return; }
- const Wx& w = pl.wx;
- {
- D2D1_COLOR_F a, b; Sky(w, a, b);
- ID2D1GradientStopCollection* st = nullptr; D2D1_GRADIENT_STOP gs[2] = { { 0, a }, { 1, b } };
- rt->CreateGradientStopCollection(gs, 2, &st);
- ID2D1LinearGradientBrush* lg = nullptr;
- if (st) rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ 0, 0 }, { 0, sz.height }), st, &lg);
- if (lg) { rt->FillRectangle(main, lg); lg->Release(); }
- if (st) st->Release();
- }
- float cx = (SB + sz.width) / 2, W = sz.width - SB;
- Text(g_sel == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfCity, D2D1::RectF(SB, 24, sz.width, 62), white);
- if (g_sel == 0) Text(pl.name, g_tfSmallC, D2D1::RectF(SB, 58, sz.width, 76), dim);
- wchar_t t[32]; swprintf_s(t, L" %d°", (int)std::lround(w.temp));
- Text(t, g_tfTemp, D2D1::RectF(SB, 70, sz.width, 170), white);
- Text(CondText(w.code), g_tfCond, D2D1::RectF(SB, 168, sz.width, 194), white);
- if (!w.days.empty()) { swprintf_s(t, Tr(L"Máx.: %d° Mín.: %d°"), (int)std::lround(w.days[0].hi), (int)std::lround(w.days[0].lo)); Text(t, g_tfCond, D2D1::RectF(SB, 192, sz.width, 218), white); }
- float pad = 20, y0 = 236;
- // por hora
- D2D1_RECT_F hr = D2D1::RectF(SB + pad, y0, sz.width - pad, y0 + 124);
- Card(hr);
- Text(Tr(L"PREVISÃO POR HORA"), g_tfSmall, D2D1::RectF(hr.left + 14, hr.top + 6, hr.right, hr.top + 26), dim);
- time_t now = time(nullptr);
- int start = 0; for (int i = 0; i < (int)w.hours.size(); i++) if (w.hours[i].t <= now) start = i;
- int n = std::min(24, (int)w.hours.size() - start);
- float cw = (hr.right - hr.left - 20) / std::max(1, std::min(n, (int)((hr.right - hr.left - 20) / 52)));
- int vis = (int)((hr.right - hr.left - 20) / cw);
- for (int k = 0; k < n && k < vis; k++) {
- auto& h = w.hours[start + k];
- float x = hr.left + 10 + k * cw;
- Text(k == 0 ? std::wstring(Tr(L"Agora")) : HourOf(h.t, w.off), g_tfCard, D2D1::RectF(x, hr.top + 30, x + cw, hr.top + 50), white);
- Text(CondEmoji(h.code, h.day), g_tfEmojiSmall, D2D1::RectF(x, hr.top + 52, x + cw, hr.top + 84), white);
- swprintf_s(t, L"%d°", (int)std::lround(h.temp));
- Text(t, g_tfCardBig, D2D1::RectF(x, hr.top + 88, x + cw, hr.top + 114), white);
- }
- // 10 dias
- float colW = (W - 3 * pad) / 2;
- D2D1_RECT_F dr = D2D1::RectF(SB + pad, hr.bottom + pad, SB + pad + colW, sz.height - pad);
- Card(dr);
- Text(Tr(L"PREVISÃO PARA 10 DIAS"), g_tfSmall, D2D1::RectF(dr.left + 14, dr.top + 6, dr.right, dr.top + 26), dim);
- float lo = 999, hi = -999; for (auto& d : w.days) { lo = std::min(lo, d.lo); hi = std::max(hi, d.hi); }
- float rowH = std::min(44.f, (dr.bottom - dr.top - 34) / std::max<size_t>(1, w.days.size()));
- for (int k = 0; k < (int)w.days.size(); k++) {
- auto& d = w.days[k];
- float yy = dr.top + 30 + k * rowH;
- if (yy + rowH > dr.bottom) break;
- Text(k == 0 ? std::wstring(Tr(L"Hoje")) : std::wstring(WeekdayShort(WdayOf(d.t + 12 * 3600, w.off))), g_tfCard, D2D1::RectF(dr.left + 14, yy, dr.left + 70, yy + rowH), white);
- Text(CondEmoji(d.code, true), g_tfEmojiSmall, D2D1::RectF(dr.left + 64, yy, dr.left + 100, yy + rowH), white);
- swprintf_s(t, L"%d°", (int)std::lround(d.lo)); Text(t, g_tfRowR, D2D1::RectF(dr.left + 96, yy, dr.left + 136, yy + rowH), dim);
- float bx0 = dr.left + 146, bx1 = dr.right - 56, by = yy + rowH / 2;
- Fill(D2D1::RectF(bx0, by - 2.5f, bx1, by + 2.5f), Rgb(0, 0, 0, 0.18f), 2.5f);
- float span = std::max(1.f, hi - lo), a = bx0 + (d.lo - lo) / span * (bx1 - bx0), b = bx0 + (d.hi - lo) / span * (bx1 - bx0);
- Fill(D2D1::RectF(a, by - 2.5f, std::max(a + 6, b), by + 2.5f), Rgb(255, 196, 64), 2.5f);
- swprintf_s(t, L"%d°", (int)std::lround(d.hi)); Text(t, g_tfRowR, D2D1::RectF(dr.right - 52, yy, dr.right - 12, yy + rowH), white);
- }
- // quadros
- float qx = dr.right + pad, qw = (sz.width - pad - qx - pad) / 2, qh = std::min(150.f, (dr.bottom - dr.top - pad) / 2);
- auto quad = [&](int i, const wchar_t* title, const std::wstring& big, const std::wstring& sub) {
- float x = qx + (i % 2) * (qw + pad), yy = dr.top + (i / 2) * (qh + pad);
- D2D1_RECT_F r = D2D1::RectF(x, yy, x + qw, yy + qh);
- Card(r);
- Text(title, g_tfSmall, D2D1::RectF(r.left + 14, r.top + 6, r.right, r.top + 26), dim);
- Text(big, g_tfCity, D2D1::RectF(r.left + 14, r.top + 30, r.right - 8, r.top + 70), white);
- IDWriteTextFormat* f = g_tfSmall; if (f) f->SetWordWrapping(DWRITE_WORD_WRAPPING_WRAP);
- Text(sub, g_tfSmall, D2D1::RectF(r.left + 14, r.top + 72, r.right - 10, r.bottom - 8), white);
- if (f) f->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
- };
- if (g_tfCity) g_tfCity->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
- swprintf_s(t, L"%d°", (int)std::lround(w.feels));
- quad(0, Tr(L"SENSAÇÃO"), t, w.feels < w.temp - 1 ? Tr(L"O vento deixa mais frio do que a temperatura real.") : w.feels > w.temp + 1 ? Tr(L"A umidade deixa mais quente do que a temperatura real.") : Tr(L"Parecida com a temperatura real."));
- swprintf_s(t, L"%d%%", (int)std::lround(w.hum));
- quad(1, Tr(L"UMIDADE"), t, L"");
- swprintf_s(t, L"%d km/h", (int)std::lround(w.wind));
- quad(2, Tr(L"VENTO"), t, L"");
- if (!w.days.empty()) quad(3, Tr(L"NASCER DO SOL"), HmOf(w.days[0].rise, w.off), std::wstring(Tr(L"Pôr do sol: ")) + HmOf(w.days[0].set, w.off));
- if (g_tfCity) g_tfCity->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER);
- (void)cx;
- EndPaint();
-}
-
-LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
- switch (m) {
- case WM_PAINT: { PAINTSTRUCT ps; ::BeginPaint(h, &ps); Paint(); ::EndPaint(h, &ps); return 0; }
- case WM_ERASEBKGND: return 1;
- case WM_SIZE: OnSize(l); return 0;
- case WM_DPICHANGED: OnDpi(w, l); return 0;
- case WM_SETTINGCHANGE: InvalidateRect(h, nullptr, FALSE); return 0;
- case WM_CTLCOLOREDIT: return FieldColors((HDC)w, Dark() ? RGB(40, 40, 42) : RGB(236, 236, 240));
- case WM_FIELDLOST: if (field.h && GetFocus() != field.h) FieldEnd(0); return 0;
- case WM_DATA: {
- int i = (int)w;
- if (i == -1) { // cidade procurada
- auto* p = (Place*)l;
- if (!p->name.empty()) { g_places.push_back(*p); g_sel = (int)g_places.size() - 1; Save(); Fetch(g_sel); g_status.clear(); }
- else g_status = Tr(L"Cidade não encontrada.");
- delete p;
- } else {
- auto* wx = (Wx*)l;
- if (i >= 0 && i < (int)g_places.size()) { std::lock_guard<std::mutex> lk(g_mx); g_places[i].loading = false; if (wx->ok) g_places[i].wx = *wx; }
- delete wx;
- }
- InvalidateRect(h, nullptr, FALSE);
- return 0;
- }
- case WM_TIMER: for (int i = 0; i < (int)g_places.size(); i++) Fetch(i); return 0; // a cada 15 min
- case WM_LBUTTONDOWN: case WM_RBUTTONUP: {
- if (field.h) FieldEnd(0);
- float s = Sc(), x = GET_X_LPARAM(l) / s, y = GET_Y_LPARAM(l) / s;
- for (auto& ht : g_hits) if (In(ht.r, x, y)) {
- if (ht.kind == 2) {
- FieldOpen(D2D1::RectF(12, 12, SB - 46, 36), L"", 13, false, [](const std::wstring& t, int key) { if (key == VK_RETURN) Search(t); });
- return 0;
- }
- if (ht.kind == 1) {
- if (m == WM_RBUTTONUP && ht.arg > 0) {
- POINT scr{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ClientToScreen(h, &scr);
- HMENU mm = CreatePopupMenu(); AppendMenuW(mm, MF_STRING, 1, Tr(L"Apagar"));
- if (TrackPopupMenu(mm, TPM_RETURNCMD | TPM_RIGHTBUTTON, scr.x, scr.y, 0, h, nullptr) == 1) { g_places.erase(g_places.begin() + ht.arg); g_sel = 0; Save(); }
- DestroyMenu(mm);
- } else g_sel = ht.arg;
- InvalidateRect(h, nullptr, FALSE);
- }
- return 0;
- }
- return 0;
- }
- case WM_KEYDOWN:
- if (GetKeyState(VK_CONTROL) < 0 && w == 'W') DestroyWindow(h);
- if (GetKeyState(VK_CONTROL) < 0 && w == 'R') for (int i = 0; i < (int)g_places.size(); i++) Fetch(i);
- if (w == VK_UP && g_sel > 0) { g_sel--; InvalidateRect(h, nullptr, FALSE); }
- if (w == VK_DOWN && g_sel + 1 < (int)g_places.size()) { g_sel++; InvalidateRect(h, nullptr, FALSE); }
- return 0;
- case WM_DESTROY: PostQuitMessage(0); return 0;
- }
- return DefWindowProcW(h, m, w, l);
-}
-
-} // namespace
-
-int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
- if (!Init()) return 1;
- g_file = DataPath(L"clima.txt");
- Load();
- std::wstring disp = HasFont(L"SF Pro Display") ? L"SF Pro Display" : family;
- g_tfCity = Fmt(30, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
- g_tfTemp = Fmt(92, DWRITE_FONT_WEIGHT_THIN, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
- g_tfCond = Fmt(18, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+// Clima (Weather do Mac): à esquerda as cidades (a primeira é a dos Ajustes, a mesma do widget); à direita, sobre
+// um fundo da cor do céu, a cidade, a temperatura grande, a condição, máx./mín., a previsão por hora (24 h), a de
+// 10 dias (com a barra de mín.–máx.) e os quadros de sensação, umidade, vento e sol. Dados do Open-Meteo (sem chave).
+// "+" procura uma cidade pelo nome (geocodificação do Open-Meteo); botão direito numa cidade remove.
+// Cidades em %APPDATA%\Shell\clima.txt.
+#include "../comum/app2d.h"
+#include <winhttp.h>
+#include <map>
+#include <mutex>
+#include <thread>
+#pragma comment(lib, "winhttp.lib")
+
+using namespace app2d;
+
+namespace {
+
+const float SB = 230;
+const UINT WM_DATA = WM_APP + 5, WM_FIELDLOST = WM_APP + 77;
+
+struct Hour { double t; float temp; int code; bool day; };
+struct Day { double t; float hi, lo; int code; double rise, set; };
+struct Wx { bool ok = false; float temp = 0, feels = 0, hum = 0, wind = 0; int code = 0; bool day = true; int off = 0; std::vector<Hour> hours; std::vector<Day> days; };
+struct Place { std::wstring name; std::wstring lat, lon; Wx wx; bool loading = false; };
+std::vector<Place> g_places;
+int g_sel = 0;
+std::mutex g_mx;
+std::wstring g_file;
+std::wstring g_status;
+IDWriteTextFormat *g_tfSmallC, *g_tfCity, *g_tfTemp, *g_tfCond, *g_tfSmall, *g_tfCard, *g_tfCardBig, *g_tfEmoji, *g_tfEmojiSmall, *g_tfSide, *g_tfSideTemp, *g_tfIcon, *g_tfRowR;
+IDWriteTextFormat *g_tfHdrC, *g_tfCardG; // macOS 27
+
+std::string HttpGet(const wchar_t* host, const std::wstring& path) {
+ std::string body;
+ HINTERNET ses = WinHttpOpen(L"SequoiaClima/1.0", WINHTTP_ACCESS_TYPE_AUTOMATIC_PROXY, WINHTTP_NO_PROXY_NAME, WINHTTP_NO_PROXY_BYPASS, 0);
+ if (!ses) return body;
+ WinHttpSetTimeouts(ses, 5000, 5000, 8000, 8000);
+ HINTERNET con = WinHttpConnect(ses, host, INTERNET_DEFAULT_HTTPS_PORT, 0);
+ HINTERNET req = con ? WinHttpOpenRequest(con, L"GET", path.c_str(), nullptr, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, WINHTTP_FLAG_SECURE) : nullptr;
+ if (req && WinHttpSendRequest(req, WINHTTP_NO_ADDITIONAL_HEADERS, 0, WINHTTP_NO_REQUEST_DATA, 0, 0, 0) && WinHttpReceiveResponse(req, nullptr)) {
+ DWORD status = 0, sz = sizeof(status);
+ WinHttpQueryHeaders(req, WINHTTP_QUERY_STATUS_CODE | WINHTTP_QUERY_FLAG_NUMBER, nullptr, &status, &sz, nullptr);
+ DWORD avail = 0;
+ while (WinHttpQueryDataAvailable(req, &avail) && avail && body.size() < 512 * 1024) {
+ std::string chunk(avail, '\0'); DWORD got = 0;
+ if (!WinHttpReadData(req, chunk.data(), avail, &got) || !got) break;
+ body.append(chunk.data(), got);
+ }
+ if (status != 200) body.clear();
+ }
+ if (req) WinHttpCloseHandle(req);
+ if (con) WinHttpCloseHandle(con);
+ WinHttpCloseHandle(ses);
+ return body;
+}
+std::string Section(const std::string& j, const char* key) {
+ size_t p = j.find(std::string("\"") + key + "\":{");
+ if (p == std::string::npos) return "";
+ p = j.find('{', p);
+ int depth = 0;
+ for (size_t i = p; i < j.size(); i++) { if (j[i] == '{') depth++; else if (j[i] == '}' && --depth == 0) return j.substr(p, i - p + 1); }
+ return "";
+}
+double Number(const std::string& s, const char* key) {
+ size_t p = s.find(std::string("\"") + key + "\":");
+ if (p == std::string::npos) return NAN;
+ p += strlen(key) + 3;
+ while (p < s.size() && s[p] == ' ') p++;
+ if (s.compare(p, 4, "null") == 0) return NAN;
+ return strtod(s.c_str() + p, nullptr);
+}
+std::vector<double> Array(const std::string& s, const char* key) {
+ std::vector<double> v;
+ size_t p = s.find(std::string("\"") + key + "\":[");
+ if (p == std::string::npos) return v;
+ p = s.find('[', p) + 1;
+ while (p < s.size() && s[p] != ']') {
+ while (p < s.size() && (s[p] == ' ' || s[p] == ',')) p++;
+ if (s[p] == ']') break;
+ if (s.compare(p, 4, "null") == 0) { v.push_back(NAN); p += 4; continue; }
+ char* e = nullptr; v.push_back(strtod(s.c_str() + p, &e));
+ if (e == s.c_str() + p) break;
+ p = e - s.c_str();
+ }
+ return v;
+}
+std::wstring Utf8(const std::string& s) { int n = MultiByteToWideChar(CP_UTF8, 0, s.data(), (int)s.size(), nullptr, 0); std::wstring w(n, L'\0'); MultiByteToWideChar(CP_UTF8, 0, s.data(), (int)s.size(), w.data(), n); return w; }
+std::string ToUtf8(const std::wstring& w) { int n = WideCharToMultiByte(CP_UTF8, 0, w.data(), (int)w.size(), nullptr, 0, nullptr, nullptr); std::string s(n, '\0'); WideCharToMultiByte(CP_UTF8, 0, w.data(), (int)w.size(), s.data(), n, nullptr, nullptr); return s; }
+std::string StrField(const std::string& s, const char* key) {
+ size_t p = s.find(std::string("\"") + key + "\":\"");
+ if (p == std::string::npos) return "";
+ p += strlen(key) + 4;
+ size_t e = s.find('"', p);
+ return e == std::string::npos ? "" : s.substr(p, e - p);
+}
+
+bool Parse(const std::string& j, Wx& w) {
+ std::string cur = Section(j, "current"), hr = Section(j, "hourly"), dl = Section(j, "daily");
+ if (cur.empty() || hr.empty() || dl.empty()) return false;
+ double off = Number(j, "utc_offset_seconds"); if (!std::isnan(off)) w.off = (int)off;
+ w.temp = (float)Number(cur, "temperature_2m"); w.feels = (float)Number(cur, "apparent_temperature");
+ w.hum = (float)Number(cur, "relative_humidity_2m"); w.wind = (float)Number(cur, "wind_speed_10m");
+ w.code = (int)Number(cur, "weather_code"); w.day = Number(cur, "is_day") > 0.5;
+ auto t = Array(hr, "time"), tp = Array(hr, "temperature_2m"), c = Array(hr, "weather_code"), d = Array(hr, "is_day");
+ for (size_t i = 0; i < t.size() && i < tp.size() && i < c.size() && i < d.size(); i++) w.hours.push_back({ t[i], (float)tp[i], (int)c[i], d[i] > 0.5 });
+ auto dt = Array(dl, "time"), mx = Array(dl, "temperature_2m_max"), mn = Array(dl, "temperature_2m_min"), dc = Array(dl, "weather_code"), sr = Array(dl, "sunrise"), ss = Array(dl, "sunset");
+ for (size_t i = 0; i < dt.size() && i < mx.size() && i < mn.size() && i < dc.size(); i++)
+ w.days.push_back({ dt[i], (float)mx[i], (float)mn[i], (int)dc[i], i < sr.size() ? sr[i] : 0, i < ss.size() ? ss[i] : 0 });
+ w.ok = !std::isnan(w.temp) && !w.days.empty();
+ return w.ok;
+}
+
+void Fetch(int i) {
+ Place& p = g_places[i];
+ if (p.loading) return;
+ p.loading = true;
+ std::wstring lat = p.lat, lon = p.lon;
+ HWND h = wnd;
+ std::thread([i, lat, lon, h] {
+ std::wstring path = L"/v1/forecast?latitude=" + lat + L"&longitude=" + lon +
+ L"&current=temperature_2m,apparent_temperature,relative_humidity_2m,wind_speed_10m,weather_code,is_day"
+ L"&hourly=temperature_2m,weather_code,is_day&daily=weather_code,temperature_2m_max,temperature_2m_min,sunrise,sunset"
+ L"&timezone=auto&forecast_days=10&timeformat=unixtime";
+ std::string body = HttpGet(L"api.open-meteo.com", path);
+ auto* w = new Wx;
+ if (body.empty() || !Parse(body, *w)) w->ok = false;
+ if (!PostMessageW(h, WM_DATA, (WPARAM)i, (LPARAM)w)) delete w;
+ }).detach();
+}
+
+void Save() {
+ std::vector<std::wstring> out{ L"# Cidades do Clima (nome, latitude, longitude); a primeira vem dos Ajustes" };
+ for (size_t i = 1; i < g_places.size(); i++) out.push_back(L"C\t" + Esc(g_places[i].name) + L"\t" + g_places[i].lat + L"\t" + g_places[i].lon);
+ WriteLines(g_file, out);
+}
+
+std::wstring Setting(const wchar_t* key, const wchar_t* def) {
+ for (auto& l : ReadLines(DataPath(L"ajustes.txt"))) { size_t e = l.find(L'='); if (e != std::wstring::npos && l.substr(0, e) == key) return l.substr(e + 1); }
+ return def;
+}
+void Load() {
+ g_places.clear();
+ g_places.push_back({ Setting(L"tempoCidade", L"Campinas"), Setting(L"tempoLat", L"-22.9056"), Setting(L"tempoLon", L"-47.0608") });
+ for (auto& l : ReadLines(g_file)) { auto f = Split(l); if (f.size() >= 4 && f[0] == L"C") g_places.push_back({ Unesc(f[1]), f[2], f[3] }); }
+}
+
+// procura a cidade (geocodificação) e põe na lista
+void Search(const std::wstring& q) {
+ if (q.empty()) return;
+ g_status = Tr(L"Procurando…");
+ InvalidateRect(wnd, nullptr, FALSE);
+ HWND h = wnd;
+ std::thread([q, h] {
+ std::string u = ToUtf8(q), enc;
+ for (unsigned char c : u) { if (isalnum(c) || c == '-' || c == '.') enc += (char)c; else { char b[4]; sprintf_s(b, "%%%02X", c); enc += b; } }
+ std::wstring path = L"/v1/search?count=1&language=" + std::wstring(idioma::En() ? L"en" : L"pt") + L"&name=" + Utf8(enc);
+ std::string body = HttpGet(L"geocoding-api.open-meteo.com", path);
+ auto* p = new Place;
+ if (!body.empty() && body.find("\"results\"") != std::string::npos) {
+ double la = Number(body, "latitude"), lo = Number(body, "longitude");
+ std::string name = StrField(body, "name"), adm = StrField(body, "admin1");
+ if (!std::isnan(la)) {
+ wchar_t a[32], b[32]; swprintf_s(a, L"%.4f", la); swprintf_s(b, L"%.4f", lo);
+ p->name = Utf8(name); p->lat = a; p->lon = b;
+ }
+ }
+ if (!PostMessageW(h, WM_DATA, (WPARAM)-1, (LPARAM)p)) delete p;
+ }).detach();
+}
+
+// ---- condições (códigos WMO)
+const wchar_t* CondText(int c) {
+ if (c == 0) return Tr(L"Céu Limpo");
+ if (c <= 2) return Tr(L"Parcialmente Nublado");
+ if (c == 3) return Tr(L"Nublado");
+ if (c == 45 || c == 48) return Tr(L"Neblina");
+ if (c >= 51 && c <= 57) return Tr(L"Garoa");
+ if ((c >= 61 && c <= 67) || (c >= 80 && c <= 82)) return Tr(L"Chuva");
+ if ((c >= 71 && c <= 77) || c == 85 || c == 86) return Tr(L"Neve");
+ if (c >= 95) return Tr(L"Tempestade");
+ return L"";
+}
+const wchar_t* CondEmoji(int c, bool day) {
+ if (c == 0) return day ? L"☀️" : L"\U0001F319";
+ if (c <= 2) return day ? L"⛅" : L"☁️";
+ if (c == 3) return L"☁️";
+ if (c == 45 || c == 48) return L"\U0001F32B️";
+ if (c >= 51 && c <= 57) return L"\U0001F326️";
+ if ((c >= 61 && c <= 67) || (c >= 80 && c <= 82)) return L"\U0001F327️";
+ if ((c >= 71 && c <= 77) || c == 85 || c == 86) return L"❄️";
+ if (c >= 95) return L"⛈️";
+ return L"☁️";
+}
+// cor do céu (em cima, embaixo)
+void Sky(const Wx& w, D2D1_COLOR_F& a, D2D1_COLOR_F& b) {
+ bool cloudy = w.code >= 3, rain = w.code >= 51;
+ if (!w.day) { a = Rgb(16, 24, 48); b = Rgb(38, 48, 80); }
+ else if (rain) { a = Rgb(70, 84, 104); b = Rgb(110, 124, 140); }
+ else if (cloudy) { a = Rgb(92, 120, 150); b = Rgb(140, 160, 182); }
+ else { a = Rgb(40, 110, 200); b = Rgb(110, 170, 230); }
+}
+std::wstring HourOf(double unix, int off) { time_t t = (time_t)unix + off; tm g{}; gmtime_s(&g, &t); wchar_t b[8]; swprintf_s(b, L"%d", g.tm_hour); return b; }
+std::wstring HmOf(double unix, int off) { time_t t = (time_t)unix + off; tm g{}; gmtime_s(&g, &t); wchar_t b[8]; swprintf_s(b, L"%d:%02d", g.tm_hour, g.tm_min); return b; }
+int WdayOf(double unix, int off) { time_t t = (time_t)unix + off; tm g{}; gmtime_s(&g, &t); return g.tm_wday; }
+
+struct Hit { int kind, arg; D2D1_RECT_F r; };
+std::vector<Hit> g_hits;
+
+void Card(D2D1_RECT_F r) { Fill(r, Rgb(255, 255, 255, 0.14f), 14); }
+const wchar_t* CondText(int c);
+const wchar_t* CondEmoji(int c, bool day);
+// ---- macOS 27 (captura Weather do 512 Pixels, 2x, medida em pt): o céu ocupa a janela toda (a barra é
+// transparente); lateral de 270 com o céu escurecido, o botão de "barra lateral" (244, 26) e a busca em cápsula
+// (9–262, 63–97); o "+" redondo fica no conteúdo (297, 26). No meio: cidade (20), temperatura fina (64), condição e
+// máx./mín. Embaixo uma grade de 622 de largura, centrada: dois quadros de 143 e um largo de 304 por linha (141 de
+// altura, 16 entre eles), vidro claro com cantos 18 e o título em maiúsculas pequenas.
+float g_gScroll;
+float g_gTotal;
+IDWriteTextFormat *g_tfCityG, *g_tfTempG, *g_tfCondG, *g_tfHdr, *g_tfBigG, *g_tfSmallW, *g_tfSearchG, *g_tfCondTitle;
+
+void SkyFill(D2D1_RECT_F r, const Wx& w, float darken) {
+ D2D1_COLOR_F a, b; Sky(w, a, b);
+ auto dk = [&](D2D1_COLOR_F c) { return D2D1::ColorF(c.r * (1 - darken), c.g * (1 - darken), c.b * (1 - darken), 1); };
+ D2D1_GRADIENT_STOP gs[2] = { { 0, dk(a) }, { 1, dk(b) } };
+ ID2D1GradientStopCollection* st = nullptr; rt->CreateGradientStopCollection(gs, 2, &st);
+ ID2D1LinearGradientBrush* lg = nullptr;
+ if (st) rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ 0, 0 }, { 0, Size().height }), st, &lg);
+ if (lg) { rt->FillRectangle(r, lg); lg->Release(); }
+ if (st) st->Release();
+}
+void GlassCard(D2D1_RECT_F r) {
+ Fill(r, Rgb(255, 255, 255, 0.15f), 18);
+ br->SetColor(Rgb(255, 255, 255, 0.20f));
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.25f, r.top + 0.25f, r.right - 0.25f, r.bottom - 0.25f), 17.75f, 17.75f), br, 0.5f);
+}
+void CardHead(D2D1_RECT_F r, const wchar_t* title) { Text(title, g_tfHdr, D2D1::RectF(r.left + 14, r.top + 8, r.right - 10, r.top + 24), Rgb(255, 255, 255, 0.62f)); }
+
+void PaintGoldenWx() {
+ g_hits.clear();
+ D2D1_SIZE_F sz = Size();
+ D2D1_COLOR_F white = Rgb(255, 255, 255), dim = Rgb(255, 255, 255, 0.72f);
+ const float SBG = 270;
+ Place pl; bool have = g_sel >= 0 && g_sel < (int)g_places.size();
+ if (have) { std::lock_guard<std::mutex> l(g_mx); pl = g_places[g_sel]; }
+ Wx sky = have && pl.wx.ok ? pl.wx : Wx{};
+ if (!have || !pl.wx.ok) { sky.day = true; sky.code = 1; }
+ SkyFill(D2D1::RectF(0, 0, sz.width, sz.height), sky, 0);
+ // ---- lateral
+ SkyFill(D2D1::RectF(0, 0, SBG, sz.height), sky, 0.28f);
+ Fill(D2D1::RectF(SBG - 0.5f, 0, SBG, sz.height), Rgb(0, 0, 0, 0.18f));
+ D2D1_RECT_F tb = D2D1::RectF(244 - 18, 8, 244 + 18, 44);
+ Fill(tb, Rgb(255, 255, 255, 0.16f), 18); IconSidebar({ 244, 26 }, white); BarButton(tb);
+ D2D1_RECT_F sr = D2D1::RectF(9, 63, 262, 97);
+ Fill(sr, Rgb(255, 255, 255, 0.16f), 17);
+ br->SetColor(Rgb(255, 255, 255, 0.22f)); rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(sr.left + 0.25f, sr.top + 0.25f, sr.right - 0.25f, sr.bottom - 0.25f), 16.75f, 16.75f), br, 0.5f);
+ IconSearch({ 25, 80 }, dim, 0.9f);
+ Text(Tr(L"Buscar"), g_tfSearchG, D2D1::RectF(38, sr.top, sr.right - 10, sr.bottom), dim);
+ g_hits.push_back({ 2, 0, sr });
+ float y = 108;
+ for (int i = 0; i < (int)g_places.size(); i++) {
+ auto& p = g_places[i];
+ D2D1_RECT_F r = D2D1::RectF(9, y, 262, y + 70);
+ if (i == g_sel) Fill(r, Rgb(255, 255, 255, 0.18f), 14);
+ Text(i == 0 ? std::wstring(Tr(L"Meu Local")) : p.name, g_tfSide, D2D1::RectF(r.left + 12, r.top + 8, r.right - 60, r.top + 30), white);
+ if (i == 0) Text(p.name, g_tfSmall, D2D1::RectF(r.left + 12, r.top + 28, r.right - 60, r.top + 46), dim);
+ if (p.wx.ok) {
+ Text(CondText(p.wx.code), g_tfSmall, D2D1::RectF(r.left + 12, r.bottom - 24, r.right - 60, r.bottom - 6), dim);
+ wchar_t t[16]; swprintf_s(t, L"%d°", (int)std::lround(p.wx.temp));
+ Text(t, g_tfSideTemp, D2D1::RectF(r.right - 80, r.top + 4, r.right - 12, r.top + 44), white);
+ }
+ g_hits.push_back({ 1, i, r });
+ y += 76;
+ }
+ if (!g_status.empty()) Text(g_status, g_tfSmall, D2D1::RectF(12, sz.height - 30, SBG - 10, sz.height - 8), dim);
+ // "+" no conteúdo
+ D2D1_RECT_F add = D2D1::RectF(297 - 18, 8, 297 + 18, 44);
+ Fill(add, Rgb(255, 255, 255, 0.16f), 18); IconPlus({ 297, 26 }, white);
+ g_hits.push_back({ 2, 0, add }); BarButton(add);
+ if (!have) return;
+ float X0 = SBG, cx = (SBG + sz.width) / 2;
+ if (!pl.wx.ok) { Text(pl.loading ? Tr(L"Carregando…") : Tr(L"Sem conexão com o serviço do tempo."), g_tfCondG, D2D1::RectF(X0, 0, sz.width, sz.height), white); return; }
+ const Wx& w = pl.wx;
+ rt->PushAxisAlignedClip(D2D1::RectF(X0, 52, sz.width, sz.height), D2D1_ANTIALIAS_MODE_ALIASED);
+ float oy = -g_gScroll;
+ wchar_t t[64];
+ Text(g_sel == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfCityG, D2D1::RectF(X0, oy + 94, sz.width, oy + 120), white);
+ swprintf_s(t, L" %d°", (int)std::lround(w.temp));
+ Text(t, g_tfTempG, D2D1::RectF(X0, oy + 118, sz.width, oy + 182), white);
+ Text(CondText(w.code), g_tfCondG, D2D1::RectF(X0, oy + 177, sz.width, oy + 195), white);
+ if (!w.days.empty()) { swprintf_s(t, Tr(L"Máx.: %d° Mín.: %d°"), (int)std::lround(w.days[0].hi), (int)std::lround(w.days[0].lo)); Text(t, g_tfCondG, D2D1::RectF(X0, oy + 194, sz.width, oy + 212), white); }
+ float GW = 622, x0 = cx - GW / 2, y0 = oy + 266;
+ if (x0 < X0 + 12) { x0 = X0 + 12; GW = sz.width - X0 - 24; }
+ float sm = (GW - 32 - 304) / 2 > 100 ? 143.f : (GW - 16) / 2, wideX = x0 + 2 * sm + 32, wideW = x0 + GW - wideX;
+ // linha 1: sensação, vento, condições por hora
+ D2D1_RECT_F c1 = D2D1::RectF(x0, y0, x0 + sm, y0 + 141), c2 = D2D1::RectF(x0 + sm + 16, y0, x0 + 2 * sm + 16, y0 + 141);
+ D2D1_RECT_F c3 = D2D1::RectF(wideX, y0, wideX + wideW, y0 + 141);
+ GlassCard(c1); CardHead(c1, Tr(L"SENSAÇÃO"));
+ swprintf_s(t, L"%d°", (int)std::lround(w.feels));
+ Text(t, g_tfBigG, D2D1::RectF(c1.left + 14, c1.top + 28, c1.right, c1.top + 62), white);
+ {
+ IDWriteTextFormat* f = g_tfSmallW;
+ const wchar_t* s = w.feels < w.temp - 1 ? Tr(L"O vento deixa mais frio do que a temperatura real.") : w.feels > w.temp + 1 ? Tr(L"A umidade deixa mais quente do que a temperatura real.") : Tr(L"Parecida com a temperatura real.");
+ br->SetColor(white); rt->DrawTextW(s, (UINT32)wcslen(s), f, D2D1::RectF(c1.left + 14, c1.top + 66, c1.right - 12, c1.bottom - 8), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ }
+ GlassCard(c2); CardHead(c2, Tr(L"VENTO"));
+ { // bússola com a velocidade no meio
+ D2D1_POINT_2F c{ (c2.left + c2.right) / 2, c2.top + 82 };
+ br->SetColor(Rgb(255, 255, 255, 0.35f));
+ for (int k = 0; k < 72; k++) {
+ double a = k * 3.14159265 / 36; float r0 = k % 18 == 0 ? 36.f : 40.f;
+ rt->DrawLine({ c.x + (float)sin(a) * r0, c.y - (float)cos(a) * r0 }, { c.x + (float)sin(a) * 44, c.y - (float)cos(a) * 44 }, br, 0.8f);
+ }
+ const wchar_t* L4[4] = { L"N", L"L", L"S", L"O" };
+ if (idioma::En()) L4[1] = L"E", L4[3] = L"W";
+ for (int k = 0; k < 4; k++) { double a = k * 3.14159265 / 2; Text(L4[k], g_tfHdr, D2D1::RectF(c.x + (float)sin(a) * 30 - 8, c.y - (float)cos(a) * 30 - 8, c.x + (float)sin(a) * 30 + 8, c.y - (float)cos(a) * 30 + 8), white); }
+ swprintf_s(t, L"%d", (int)std::lround(w.wind));
+ Text(t, g_tfCondTitle, D2D1::RectF(c.x - 20, c.y - 12, c.x + 20, c.y + 6), white);
+ Text(L"km/h", g_tfHdr, D2D1::RectF(c.x - 20, c.y + 3, c.x + 20, c.y + 15), white);
+ }
+ GlassCard(c3);
+ Text(Tr(L"Condições"), g_tfCondTitle, D2D1::RectF(c3.left + 14, c3.top + 10, c3.right, c3.top + 28), white);
+ Text(Tr(L"Temperatura (°C)"), g_tfHdr, D2D1::RectF(c3.left + 14, c3.top + 26, c3.right, c3.top + 40), dim);
+ {
+ time_t now = time(nullptr);
+ int start = 0; for (int i = 0; i < (int)w.hours.size(); i++) if (w.hours[i].t <= now) start = i;
+ int n = std::min(6, (int)w.hours.size() - start);
+ float cw = (c3.right - c3.left - 16) / 6;
+ for (int k = 0; k < n; k++) {
+ auto& hh = w.hours[start + k];
+ float x = c3.left + 8 + k * cw;
+ Text(k == 0 ? std::wstring(Tr(L"Agora")) : HourOf(hh.t, w.off), g_tfHdrC, D2D1::RectF(x, c3.top + 50, x + cw, c3.top + 66), white);
+ Text(CondEmoji(hh.code, hh.day), g_tfEmojiSmall, D2D1::RectF(x, c3.top + 70, x + cw, c3.top + 100), white);
+ swprintf_s(t, L"%d°", (int)std::lround(hh.temp));
+ Text(t, g_tfCardG, D2D1::RectF(x, c3.top + 104, x + cw, c3.top + 126), white);
+ }
+ }
+ // linha 2: umidade (larga) e a previsão de 10 dias (alta, na coluna da direita)
+ float y1 = y0 + 141 + 16;
+ D2D1_RECT_F c4 = D2D1::RectF(x0, y1, x0 + 2 * sm + 16, y1 + 143);
+ GlassCard(c4); CardHead(c4, Tr(L"UMIDADE"));
+ swprintf_s(t, L"%d%%", (int)std::lround(w.hum));
+ Text(t, g_tfBigG, D2D1::RectF(c4.left + 14, c4.top + 28, c4.right, c4.top + 62), white);
+ {
+ D2D1_RECT_F bar = D2D1::RectF(c4.left + 14, c4.top + 86, c4.right - 14, c4.top + 91);
+ D2D1_GRADIENT_STOP gs[3] = { { 0, Rgb(255, 210, 120) }, { 0.5f, Rgb(120, 220, 255) }, { 1, Rgb(40, 110, 255) } };
+ ID2D1GradientStopCollection* st = nullptr; rt->CreateGradientStopCollection(gs, 3, &st);
+ ID2D1LinearGradientBrush* lg = nullptr;
+ if (st) rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ bar.left, 0 }, { bar.right, 0 }), st, &lg);
+ if (lg) { rt->FillRoundedRectangle(D2D1::RoundedRect(bar, 2.5f, 2.5f), lg); lg->Release(); }
+ if (st) st->Release();
+ float px = bar.left + (bar.right - bar.left) * std::clamp(w.hum / 100.f, 0.f, 1.f);
+ Circle({ px, (bar.top + bar.bottom) / 2 }, 4.5f, white, true);
+ const wchar_t* s = w.hum >= 70 ? Tr(L"O ar está úmido agora.") : w.hum <= 35 ? Tr(L"O ar está seco agora.") : Tr(L"Umidade confortável agora.");
+ Text(s, g_tfSmallW, D2D1::RectF(c4.left + 14, c4.top + 100, c4.right - 12, c4.bottom - 8), white);
+ }
+ float rows = (float)std::min<size_t>(10, w.days.size());
+ D2D1_RECT_F c5 = D2D1::RectF(wideX, y1, wideX + wideW, y1 + 30 + rows * 42 + 8);
+ GlassCard(c5);
+ {
+ float lo = 999, hi = -999; for (auto& d : w.days) { lo = std::min(lo, d.lo); hi = std::max(hi, d.hi); }
+ for (int k = 0; k < (int)rows; k++) {
+ auto& d = w.days[k];
+ float yy = c5.top + 8 + k * 42;
+ if (k) Fill(D2D1::RectF(c5.left + 14, yy, c5.right - 14, yy + 0.5f), Rgb(255, 255, 255, 0.22f));
+ Text(k == 0 ? std::wstring(Tr(L"Hoje")) : std::wstring(WeekdayShort(WdayOf(d.t + 12 * 3600, w.off))), g_tfCondTitle, D2D1::RectF(c5.left + 14, yy, c5.left + 64, yy + 42), white);
+ Text(CondEmoji(d.code, true), g_tfEmojiSmall, D2D1::RectF(c5.left + 64, yy, c5.left + 100, yy + 42), white);
+ swprintf_s(t, L"%d°", (int)std::lround(d.lo)); Text(t, g_tfRowR, D2D1::RectF(c5.left + 100, yy, c5.left + 138, yy + 42), dim);
+ float bx0 = c5.left + 146, bx1 = c5.right - 52, by = yy + 21;
+ Fill(D2D1::RectF(bx0, by - 2.5f, bx1, by + 2.5f), Rgb(0, 0, 0, 0.16f), 2.5f);
+ float span = std::max(1.f, hi - lo), a = bx0 + (d.lo - lo) / span * (bx1 - bx0), b = bx0 + (d.hi - lo) / span * (bx1 - bx0);
+ D2D1_GRADIENT_STOP gs[2] = { { 0, Rgb(255, 196, 64) }, { 1, Rgb(255, 120, 40) } };
+ ID2D1GradientStopCollection* st = nullptr; rt->CreateGradientStopCollection(gs, 2, &st);
+ ID2D1LinearGradientBrush* lg = nullptr;
+ if (st) rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ a, 0 }, { std::max(a + 6, b), 0 }), st, &lg);
+ if (lg) { rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(a, by - 2.5f, std::max(a + 6, b), by + 2.5f), 2.5f, 2.5f), lg); lg->Release(); }
+ if (st) st->Release();
+ swprintf_s(t, L"%d°", (int)std::lround(d.hi)); Text(t, g_tfRowR, D2D1::RectF(c5.right - 50, yy, c5.right - 14, yy + 42), white);
+ }
+ }
+ // linha 3: nascer e pôr do sol
+ float y2 = y1 + 143 + 16;
+ if (!w.days.empty()) {
+ D2D1_RECT_F c6 = D2D1::RectF(x0, y2, x0 + sm, y2 + 141), c7 = D2D1::RectF(x0 + sm + 16, y2, x0 + 2 * sm + 16, y2 + 141);
+ GlassCard(c6); CardHead(c6, Tr(L"NASCER DO SOL"));
+ Text(HmOf(w.days[0].rise, w.off), g_tfBigG, D2D1::RectF(c6.left + 14, c6.top + 28, c6.right, c6.top + 62), white);
+ GlassCard(c7); CardHead(c7, Tr(L"PÔR DO SOL"));
+ Text(HmOf(w.days[0].set, w.off), g_tfBigG, D2D1::RectF(c7.left + 14, c7.top + 28, c7.right, c7.top + 62), white);
+ for (D2D1_RECT_F c : { c6, c7 }) { // a curva do sol
+ br->SetColor(Rgb(255, 255, 255, 0.45f));
+ ID2D1PathGeometry* g = nullptr; d2d->CreatePathGeometry(&g);
+ if (g) {
+ ID2D1GeometrySink* s = nullptr; g->Open(&s);
+ float bx = c.left + 12, bw = c.right - c.left - 24, base = c.top + 112;
+ s->BeginFigure({ bx, base + 6 }, D2D1_FIGURE_BEGIN_HOLLOW);
+ for (int k = 1; k <= 30; k++) { float u = k / 30.f; s->AddLine({ bx + bw * u, base + 6 - (float)sin(u * 3.14159265) * 28 + 14 * (1 - (float)sin(u * 3.14159265)) * 0 }); }
+ s->EndFigure(D2D1_FIGURE_END_OPEN); s->Close(); s->Release();
+ rt->DrawGeometry(g, br, 2); g->Release();
+ }
+ Fill(D2D1::RectF(c.left + 12, c.top + 112, c.right - 12, c.top + 112.6f), Rgb(255, 255, 255, 0.5f));
+ }
+ }
+ g_gTotal = std::max(c5.bottom, y2 + 141) + g_gScroll + 20;
+ rt->PopAxisAlignedClip();
+}
+
+
+void Paint() {
+ if (!BeginPaint()) return;
+ if (BAR > 0) { PaintGoldenWx(); EndPaint(); return; } // macOS 27
+ g_hits.clear();
+ bool dark = Dark();
+ D2D1_SIZE_F sz = Size();
+ D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139), white = Rgb(255, 255, 255), dim = Rgb(255, 255, 255, 0.7f);
+ rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(242, 242, 245));
+ // ---- cidades
+ Fill(D2D1::RectF(0, 0, SB, sz.height), dark ? Rgb(40, 40, 42) : Rgb(236, 236, 240));
+ D2D1_RECT_F add = D2D1::RectF(SB - 40, 10, SB - 10, 38);
+ wchar_t p[2] = { 0xE710, 0 }; Text(p, g_tfIcon, add, text);
+ g_hits.push_back({ 2, 0, add });
+ float y = 48;
+ for (int i = 0; i < (int)g_places.size(); i++) {
+ auto& pl = g_places[i];
+ D2D1_RECT_F r = D2D1::RectF(8, y, SB - 8, y + 70);
+ if (pl.wx.ok) {
+ D2D1_COLOR_F a, b; Sky(pl.wx, a, b);
+ ID2D1GradientStopCollection* st = nullptr; D2D1_GRADIENT_STOP gs[2] = { { 0, a }, { 1, b } };
+ rt->CreateGradientStopCollection(gs, 2, &st);
+ ID2D1LinearGradientBrush* lg = nullptr;
+ if (st) rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ r.left, r.top }, { r.right, r.bottom }), st, &lg);
+ if (lg) { rt->FillRoundedRectangle(D2D1::RoundedRect(r, 12, 12), lg); lg->Release(); }
+ if (st) st->Release();
+ } else Fill(r, dark ? Rgb(58, 58, 60) : Rgb(255, 255, 255), 12);
+ D2D1_COLOR_F tc = pl.wx.ok ? white : text;
+ if (i == g_sel) { br->SetColor(Rgb(10, 132, 255)); rt->DrawRoundedRectangle(D2D1::RoundedRect(r, 12, 12), br, 2.5f); }
+ Text(i == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfSide, D2D1::RectF(r.left + 12, r.top + 8, r.right - 60, r.top + 30), tc);
+ if (i == 0) Text(pl.name, g_tfSmall, D2D1::RectF(r.left + 12, r.top + 28, r.right - 60, r.top + 46), pl.wx.ok ? dim : gray);
+ if (pl.wx.ok) {
+ Text(CondText(pl.wx.code), g_tfSmall, D2D1::RectF(r.left + 12, r.bottom - 24, r.right - 60, r.bottom - 6), dim);
+ wchar_t t[16]; swprintf_s(t, L"%d°", (int)std::lround(pl.wx.temp));
+ Text(t, g_tfSideTemp, D2D1::RectF(r.right - 70, r.top + 4, r.right - 10, r.top + 44), white);
+ }
+ g_hits.push_back({ 1, i, r });
+ y += 78;
+ }
+ if (!g_status.empty()) Text(g_status, g_tfSmall, D2D1::RectF(12, sz.height - 30, SB - 10, sz.height - 8), gray);
+ // ---- cidade escolhida
+ if (g_sel < 0 || g_sel >= (int)g_places.size()) { EndPaint(); return; }
+ Place pl; { std::lock_guard<std::mutex> l(g_mx); pl = g_places[g_sel]; }
+ D2D1_RECT_F main = D2D1::RectF(SB, 0, sz.width, sz.height);
+ if (!pl.wx.ok) { Text(pl.loading ? Tr(L"Carregando…") : Tr(L"Sem conexão com o serviço do tempo."), g_tfCond, main, gray); EndPaint(); return; }
+ const Wx& w = pl.wx;
+ {
+ D2D1_COLOR_F a, b; Sky(w, a, b);
+ ID2D1GradientStopCollection* st = nullptr; D2D1_GRADIENT_STOP gs[2] = { { 0, a }, { 1, b } };
+ rt->CreateGradientStopCollection(gs, 2, &st);
+ ID2D1LinearGradientBrush* lg = nullptr;
+ if (st) rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ 0, 0 }, { 0, sz.height }), st, &lg);
+ if (lg) { rt->FillRectangle(main, lg); lg->Release(); }
+ if (st) st->Release();
+ }
+ float cx = (SB + sz.width) / 2, W = sz.width - SB;
+ Text(g_sel == 0 ? std::wstring(Tr(L"Meu Local")) : pl.name, g_tfCity, D2D1::RectF(SB, 24, sz.width, 62), white);
+ if (g_sel == 0) Text(pl.name, g_tfSmallC, D2D1::RectF(SB, 58, sz.width, 76), dim);
+ wchar_t t[32]; swprintf_s(t, L" %d°", (int)std::lround(w.temp));
+ Text(t, g_tfTemp, D2D1::RectF(SB, 70, sz.width, 170), white);
+ Text(CondText(w.code), g_tfCond, D2D1::RectF(SB, 168, sz.width, 194), white);
+ if (!w.days.empty()) { swprintf_s(t, Tr(L"Máx.: %d° Mín.: %d°"), (int)std::lround(w.days[0].hi), (int)std::lround(w.days[0].lo)); Text(t, g_tfCond, D2D1::RectF(SB, 192, sz.width, 218), white); }
+ float pad = 20, y0 = 236;
+ // por hora
+ D2D1_RECT_F hr = D2D1::RectF(SB + pad, y0, sz.width - pad, y0 + 124);
+ Card(hr);
+ Text(Tr(L"PREVISÃO POR HORA"), g_tfSmall, D2D1::RectF(hr.left + 14, hr.top + 6, hr.right, hr.top + 26), dim);
+ time_t now = time(nullptr);
+ int start = 0; for (int i = 0; i < (int)w.hours.size(); i++) if (w.hours[i].t <= now) start = i;
+ int n = std::min(24, (int)w.hours.size() - start);
+ float cw = (hr.right - hr.left - 20) / std::max(1, std::min(n, (int)((hr.right - hr.left - 20) / 52)));
+ int vis = (int)((hr.right - hr.left - 20) / cw);
+ for (int k = 0; k < n && k < vis; k++) {
+ auto& h = w.hours[start + k];
+ float x = hr.left + 10 + k * cw;
+ Text(k == 0 ? std::wstring(Tr(L"Agora")) : HourOf(h.t, w.off), g_tfCard, D2D1::RectF(x, hr.top + 30, x + cw, hr.top + 50), white);
+ Text(CondEmoji(h.code, h.day), g_tfEmojiSmall, D2D1::RectF(x, hr.top + 52, x + cw, hr.top + 84), white);
+ swprintf_s(t, L"%d°", (int)std::lround(h.temp));
+ Text(t, g_tfCardBig, D2D1::RectF(x, hr.top + 88, x + cw, hr.top + 114), white);
+ }
+ // 10 dias
+ float colW = (W - 3 * pad) / 2;
+ D2D1_RECT_F dr = D2D1::RectF(SB + pad, hr.bottom + pad, SB + pad + colW, sz.height - pad);
+ Card(dr);
+ Text(Tr(L"PREVISÃO PARA 10 DIAS"), g_tfSmall, D2D1::RectF(dr.left + 14, dr.top + 6, dr.right, dr.top + 26), dim);
+ float lo = 999, hi = -999; for (auto& d : w.days) { lo = std::min(lo, d.lo); hi = std::max(hi, d.hi); }
+ float rowH = std::min(44.f, (dr.bottom - dr.top - 34) / std::max<size_t>(1, w.days.size()));
+ for (int k = 0; k < (int)w.days.size(); k++) {
+ auto& d = w.days[k];
+ float yy = dr.top + 30 + k * rowH;
+ if (yy + rowH > dr.bottom) break;
+ Text(k == 0 ? std::wstring(Tr(L"Hoje")) : std::wstring(WeekdayShort(WdayOf(d.t + 12 * 3600, w.off))), g_tfCard, D2D1::RectF(dr.left + 14, yy, dr.left + 70, yy + rowH), white);
+ Text(CondEmoji(d.code, true), g_tfEmojiSmall, D2D1::RectF(dr.left + 64, yy, dr.left + 100, yy + rowH), white);
+ swprintf_s(t, L"%d°", (int)std::lround(d.lo)); Text(t, g_tfRowR, D2D1::RectF(dr.left + 96, yy, dr.left + 136, yy + rowH), dim);
+ float bx0 = dr.left + 146, bx1 = dr.right - 56, by = yy + rowH / 2;
+ Fill(D2D1::RectF(bx0, by - 2.5f, bx1, by + 2.5f), Rgb(0, 0, 0, 0.18f), 2.5f);
+ float span = std::max(1.f, hi - lo), a = bx0 + (d.lo - lo) / span * (bx1 - bx0), b = bx0 + (d.hi - lo) / span * (bx1 - bx0);
+ Fill(D2D1::RectF(a, by - 2.5f, std::max(a + 6, b), by + 2.5f), Rgb(255, 196, 64), 2.5f);
+ swprintf_s(t, L"%d°", (int)std::lround(d.hi)); Text(t, g_tfRowR, D2D1::RectF(dr.right - 52, yy, dr.right - 12, yy + rowH), white);
+ }
+ // quadros
+ float qx = dr.right + pad, qw = (sz.width - pad - qx - pad) / 2, qh = std::min(150.f, (dr.bottom - dr.top - pad) / 2);
+ auto quad = [&](int i, const wchar_t* title, const std::wstring& big, const std::wstring& sub) {
+ float x = qx + (i % 2) * (qw + pad), yy = dr.top + (i / 2) * (qh + pad);
+ D2D1_RECT_F r = D2D1::RectF(x, yy, x + qw, yy + qh);
+ Card(r);
+ Text(title, g_tfSmall, D2D1::RectF(r.left + 14, r.top + 6, r.right, r.top + 26), dim);
+ Text(big, g_tfCity, D2D1::RectF(r.left + 14, r.top + 30, r.right - 8, r.top + 70), white);
+ IDWriteTextFormat* f = g_tfSmall; if (f) f->SetWordWrapping(DWRITE_WORD_WRAPPING_WRAP);
+ Text(sub, g_tfSmall, D2D1::RectF(r.left + 14, r.top + 72, r.right - 10, r.bottom - 8), white);
+ if (f) f->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
+ };
+ if (g_tfCity) g_tfCity->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
+ swprintf_s(t, L"%d°", (int)std::lround(w.feels));
+ quad(0, Tr(L"SENSAÇÃO"), t, w.feels < w.temp - 1 ? Tr(L"O vento deixa mais frio do que a temperatura real.") : w.feels > w.temp + 1 ? Tr(L"A umidade deixa mais quente do que a temperatura real.") : Tr(L"Parecida com a temperatura real."));
+ swprintf_s(t, L"%d%%", (int)std::lround(w.hum));
+ quad(1, Tr(L"UMIDADE"), t, L"");
+ swprintf_s(t, L"%d km/h", (int)std::lround(w.wind));
+ quad(2, Tr(L"VENTO"), t, L"");
+ if (!w.days.empty()) quad(3, Tr(L"NASCER DO SOL"), HmOf(w.days[0].rise, w.off), std::wstring(Tr(L"Pôr do sol: ")) + HmOf(w.days[0].set, w.off));
+ if (g_tfCity) g_tfCity->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER);
+ (void)cx;
+ EndPaint();
+}
+
+LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ switch (m) {
+ case WM_PAINT: { PAINTSTRUCT ps; ::BeginPaint(h, &ps); Paint(); ::EndPaint(h, &ps); return 0; }
+ case WM_ERASEBKGND: return 1;
+ case WM_SIZE: OnSize(l); return 0;
+ case WM_DPICHANGED: OnDpi(w, l); return 0;
+ case WM_SETTINGCHANGE: InvalidateRect(h, nullptr, FALSE); return 0;
+ case WM_CTLCOLOREDIT:
+ if (BAR > 0) { LRESULT r = FieldColors((HDC)w, RGB(60, 110, 170)); SetTextColor((HDC)w, RGB(255, 255, 255)); return r; }
+ return FieldColors((HDC)w, Dark() ? RGB(40, 40, 42) : RGB(236, 236, 240));
+ case WM_FIELDLOST: if (field.h && GetFocus() != field.h) FieldEnd(0); return 0;
+ case WM_DATA: {
+ int i = (int)w;
+ if (i == -1) { // cidade procurada
+ auto* p = (Place*)l;
+ if (!p->name.empty()) { g_places.push_back(*p); g_sel = (int)g_places.size() - 1; Save(); Fetch(g_sel); g_status.clear(); }
+ else g_status = Tr(L"Cidade não encontrada.");
+ delete p;
+ } else {
+ auto* wx = (Wx*)l;
+ if (i >= 0 && i < (int)g_places.size()) { std::lock_guard<std::mutex> lk(g_mx); g_places[i].loading = false; if (wx->ok) g_places[i].wx = *wx; }
+ delete wx;
+ }
+ InvalidateRect(h, nullptr, FALSE);
+ return 0;
+ }
+ case WM_TIMER: for (int i = 0; i < (int)g_places.size(); i++) Fetch(i); return 0; // a cada 15 min
+ case WM_MOUSEWHEEL: if (BAR > 0) { // macOS 27: o conteúdo rola
+ g_gScroll = std::clamp(g_gScroll - GET_WHEEL_DELTA_WPARAM(w) / 120.f * 60, 0.f, std::max(0.f, g_gTotal - Size().height));
+ InvalidateRect(h, nullptr, FALSE);
+ } return 0;
+ case WM_LBUTTONDOWN: case WM_RBUTTONUP: {
+ if (field.h) FieldEnd(0);
+ float s = Sc(), x = GET_X_LPARAM(l) / s, y = GET_Y_LPARAM(l) / s;
+ for (auto& ht : g_hits) if (In(ht.r, x, y)) {
+ if (ht.kind == 2) {
+ D2D1_RECT_F fr = BAR > 0 ? D2D1::RectF(38, 71, 256, 89) : D2D1::RectF(12, 12, SB - 46, 36);
+ FieldOpen(fr, L"", 13, false, [](const std::wstring& t, int key) { if (key == VK_RETURN) Search(t); });
+ return 0;
+ }
+ if (ht.kind == 1) {
+ if (m == WM_RBUTTONUP && ht.arg > 0) {
+ POINT scr{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ClientToScreen(h, &scr);
+ HMENU mm = CreatePopupMenu(); AppendMenuW(mm, MF_STRING, 1, Tr(L"Apagar"));
+ if (TrackPopupMenu(mm, TPM_RETURNCMD | TPM_RIGHTBUTTON, scr.x, scr.y, 0, h, nullptr) == 1) { g_places.erase(g_places.begin() + ht.arg); g_sel = 0; Save(); }
+ DestroyMenu(mm);
+ } else g_sel = ht.arg;
+ InvalidateRect(h, nullptr, FALSE);
+ }
+ return 0;
+ }
+ return 0;
+ }
+ case WM_KEYDOWN:
+ if (GetKeyState(VK_CONTROL) < 0 && w == 'W') DestroyWindow(h);
+ if (GetKeyState(VK_CONTROL) < 0 && w == 'R') for (int i = 0; i < (int)g_places.size(); i++) Fetch(i);
+ if (w == VK_UP && g_sel > 0) { g_sel--; InvalidateRect(h, nullptr, FALSE); }
+ if (w == VK_DOWN && g_sel + 1 < (int)g_places.size()) { g_sel++; InvalidateRect(h, nullptr, FALSE); }
+ return 0;
+ case WM_DESTROY: PostQuitMessage(0); return 0;
+ }
+ return DefWindowProcW(h, m, w, l);
+}
+
+} // namespace
+
+int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
+ if (!Init()) return 1;
+ g_file = DataPath(L"clima.txt");
+ Load();
+ std::wstring disp = HasFont(L"SF Pro Display") ? L"SF Pro Display" : family;
+ g_tfCity = Fmt(30, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
+ g_tfTemp = Fmt(92, DWRITE_FONT_WEIGHT_THIN, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
+ g_tfCond = Fmt(18, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
g_tfSmall = Fmt(12, DWRITE_FONT_WEIGHT_MEDIUM);
- g_tfSmallC = Fmt(13, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
- g_tfCard = Fmt(14, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
- g_tfCardBig = Fmt(18, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
- g_tfRowR = Fmt(16, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_TRAILING);
- g_tfEmojiSmall = nullptr; dw->CreateTextFormat(L"Segoe UI Emoji", nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 20, L"", &g_tfEmojiSmall);
- if (g_tfEmojiSmall) { g_tfEmojiSmall->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); g_tfEmojiSmall->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); }
- g_tfSide = Fmt(15, DWRITE_FONT_WEIGHT_SEMI_BOLD);
- g_tfSideTemp = Fmt(30, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_TRAILING, false, disp.c_str());
- g_tfIcon = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
- if (!CreateMain(hi, L"ClimaJanela", Tr(L"Clima"), Proc, 1080, 760)) return 1;
- for (int i = 0; i < (int)g_places.size(); i++) Fetch(i);
- SetTimer(wnd, 1, 15 * 60 * 1000, nullptr);
- ShowWindow(wnd, show);
- return Run();
-}
+ g_tfSmallC = Fmt(13, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfCard = Fmt(14, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfCardBig = Fmt(18, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfRowR = Fmt(16, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ g_tfEmojiSmall = nullptr; dw->CreateTextFormat(L"Segoe UI Emoji", nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 20, L"", &g_tfEmojiSmall);
+ if (g_tfEmojiSmall) { g_tfEmojiSmall->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); g_tfEmojiSmall->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); }
+ g_tfSide = Fmt(15, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfSideTemp = Fmt(30, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_TRAILING, false, disp.c_str());
+ g_tfIcon = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
+ g_tfCityG = Fmt(22, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
+ g_tfTempG = Fmt(64, DWRITE_FONT_WEIGHT_THIN, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
+ g_tfCondG = Fmt(14, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfHdr = Fmt(11, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfHdrC = Fmt(12, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfBigG = Fmt(26, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_LEADING, false, disp.c_str());
+ g_tfSmallW = Fmt(11.5f, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_LEADING, true);
+ if (g_tfSmallW) g_tfSmallW->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
+ g_tfSearchG = Fmt(14);
+ g_tfCondTitle = Fmt(14, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfCardG = Fmt(14, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ barWanted = 52; // macOS 27: o céu atrás da barra
+ if (!CreateMain(hi, L"ClimaJanela", Tr(L"Clima"), Proc, semaforo::Aqua() ? 1070 : 1080, semaforo::Aqua() ? 768 : 760)) return 1;
+ for (int i = 0; i < (int)g_places.size(); i++) Fetch(i);
+ SetTimer(wnd, 1, 15 * 60 * 1000, nullptr);
+ ShowWindow(wnd, show);
+ return Run();
+}
diff --git a/src/comum/app2d.h b/src/comum/app2d.h
index f91552d..8cf6f9c 100644
--- a/src/comum/app2d.h
+++ b/src/comum/app2d.h
@@ -20,6 +20,10 @@
#include <string>
#include <vector>
#include "idioma.h"
+#include "semaforo.h" // semaforo::Aqua(): tema macOS Golden Gate
+#include <commctrl.h>
+#include <shellapi.h>
+#pragma comment(lib, "comctl32.lib")
#pragma comment(lib, "d2d1.lib")
#pragma comment(lib, "dwrite.lib")
#pragma comment(lib, "dwmapi.lib")
@@ -30,7 +34,9 @@ inline ID2D1Factory* d2d;
inline IDWriteFactory* dw;
inline std::wstring family = L"Segoe UI";
inline HWND wnd;
-inline ID2D1HwndRenderTarget* rt;
+inline ID2D1RenderTarget* rt; // onde se desenha agora (a janela, ou a foto do --foto)
+inline ID2D1HwndRenderTarget* hrt; // o da janela
+inline ID2D1SolidColorBrush* hbr;
inline ID2D1SolidColorBrush* br;
inline bool HasFont(const wchar_t* name) {
@@ -99,26 +105,159 @@ inline void Circle(D2D1_POINT_2F c, float r, D2D1_COLOR_F col, bool fill, float
inline D2D1_COLOR_F Rgb(int r, int g, int b, float a = 1) { return D2D1::ColorF(r / 255.f, g / 255.f, b / 255.f, a); }
inline bool In(D2D1_RECT_F r, float x, float y) { return x >= r.left && x < r.right && y >= r.top && y < r.bottom; }
+// ---- macOS 27 (Golden Gate): barra de ferramentas unificada. Sem a barra de título do Windows: a área do app
+// começa no topo da janela e os primeiros BAR pt são a barra dele (botões redondos de vidro na mesma linha dos
+// três botões da janela, que a WacOSWindow.dll desenha por cima a 26 pt da borda). Arrasta pela barra, menos
+// pelos botões que o app registra ao pintar (BarButton).
+inline float BAR = 0; // 0: barra comum do Windows (Sequoia/Tahoe)
+inline float barWanted = 0; // o app que já tem o layout do macOS 27 pede (52) antes do CreateMain
+inline std::vector<D2D1_RECT_F> barButtons;
+inline void BarButton(D2D1_RECT_F r) { barButtons.push_back(r); }
+inline LRESULT CALLBACK UnifiedSub(HWND h, UINT m, WPARAM w, LPARAM l, UINT_PTR, DWORD_PTR) {
+ if (m == WM_NCCALCSIZE && w) { // tira só a barra de cima; as bordas de redimensionar continuam
+ auto* p = (NCCALCSIZE_PARAMS*)l;
+ LONG top = p->rgrc[0].top;
+ LRESULT r = DefSubclassProc(h, m, w, l);
+ p->rgrc[0].top = top;
+ if (IsZoomed(h)) { UINT dpi = GetDpiForWindow(h); p->rgrc[0].top += GetSystemMetricsForDpi(SM_CYFRAME, dpi) + GetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi); }
+ return r;
+ }
+ if (m == WM_NCHITTEST) {
+ LRESULT r = DefSubclassProc(h, m, w, l);
+ if (r != HTCLIENT) return r;
+ POINT p{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ScreenToClient(h, &p);
+ float s = GetDpiForWindow(h) / 96.f, x = p.x / s, y = p.y / s;
+ if (!IsZoomed(h) && p.y < (int)(5 * s)) return HTTOP;
+ if (y >= BAR || x < (BAR > 40 ? 84 : 72)) return HTCLIENT;
+ for (auto& b : barButtons) if (x >= b.left && x < b.right && y >= b.top && y < b.bottom) return HTCLIENT;
+ return HTCAPTION;
+ }
+ return DefSubclassProc(h, m, w, l);
+}
+
+// Botão redondo de vidro da barra do macOS 27 (círculo de 36 ou cápsula): branco leitoso com contorno fino e
+// sombra curta no claro; cinza translúcido no escuro
+inline void GlassButton(D2D1_RECT_F r, bool dark, bool hot = false) {
+ float rad = (r.bottom - r.top) / 2;
+ for (int k = 3; k >= 1; k--) {
+ br->SetColor(D2D1::ColorF(0, 0, 0, dark ? 0.10f : 0.035f));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left - k * 0.5f, r.top + k * 0.6f, r.right + k * 0.5f, r.bottom + k * 1.1f), rad + k, rad + k), br);
+ }
+ br->SetColor(dark ? D2D1::ColorF(0.24f, 0.24f, 0.245f, 1) : D2D1::ColorF(hot ? 0.95f : 0.985f, hot ? 0.95f : 0.985f, hot ? 0.95f : 0.985f, 1));
+ if (dark && hot) br->SetColor(D2D1::ColorF(0.29f, 0.29f, 0.295f, 1));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(r, rad, rad), br);
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.13f) : D2D1::ColorF(0, 0, 0, 0.09f));
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.25f, r.top + 0.25f, r.right - 0.25f, r.bottom - 0.25f), rad - 0.25f, rad - 0.25f), br, 0.5f);
+}
+// campo de busca em cápsula do macOS 27 (barra lateral): vidro claro com contorno
+inline void GlassField(D2D1_RECT_F r, bool dark) {
+ float rad = (r.bottom - r.top) / 2;
+ br->SetColor(D2D1::ColorF(0, 0, 0, dark ? 0.12f : 0.03f));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left, r.top + 1, r.right, r.bottom + 1.5f), rad, rad), br);
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.08f) : D2D1::ColorF(0.975f, 0.98f, 0.985f, 1));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(r, rad, rad), br);
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.08f));
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.25f, r.top + 0.25f, r.right - 0.25f, r.bottom - 0.25f), rad - 0.25f, rad - 0.25f), br, 0.5f);
+}
+// ícone de "barra lateral" (retângulo com a coluna da esquerda e três tracinhos) e lupa, desenhados
+inline void IconSidebar(D2D1_POINT_2F c, D2D1_COLOR_F col) {
+ br->SetColor(col);
+ D2D1_RECT_F r = D2D1::RectF(c.x - 9, c.y - 7, c.x + 9, c.y + 7);
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(r, 3, 3), br, 1.5f);
+ rt->DrawLine({ c.x - 3, r.top }, { c.x - 3, r.bottom }, br, 1.5f);
+ for (int i = 0; i < 3; i++) rt->DrawLine({ c.x - 7, c.y - 3.5f + i * 2.5f }, { c.x - 5, c.y - 3.5f + i * 2.5f }, br, 1.1f);
+}
+inline void IconPlus(D2D1_POINT_2F c, D2D1_COLOR_F col, float s = 7) {
+ br->SetColor(col);
+ rt->DrawLine({ c.x - s, c.y }, { c.x + s, c.y }, br, 1.6f);
+ rt->DrawLine({ c.x, c.y - s }, { c.x, c.y + s }, br, 1.6f);
+}
+inline void IconSearch(D2D1_POINT_2F c, D2D1_COLOR_F col, float s = 1) {
+ br->SetColor(col);
+ rt->DrawEllipse(D2D1::Ellipse({ c.x - 1.5f * s, c.y - 1.5f * s }, 5 * s, 5 * s), br, 1.5f);
+ rt->DrawLine({ c.x + 2.2f * s, c.y + 2.2f * s }, { c.x + 6 * s, c.y + 6 * s }, br, 1.6f);
+}
+
+// --foto <arquivo.png> (teste): o app abre escondido, desenha a janela inteira num bitmap e salva (sem passar pela
+// tela). Assim dá para conferir o desenho mesmo quando a tela não mostra o app (programas abertos de dentro de
+// outros contêineres).
+inline ID2D1RenderTarget* fotoRt;
+inline ID2D1SolidColorBrush* fotoBr;
+inline IWICBitmap* fotoBmp;
+inline std::wstring FotoPath() {
+ static int done = 0; static std::wstring p;
+ if (done) return p;
+ done = 1;
+ int n = 0; LPWSTR* a = CommandLineToArgvW(GetCommandLineW(), &n);
+ for (int i = 1; a && i + 1 < n; i++) if (!wcscmp(a[i], L"--foto")) p = a[i + 1];
+ if (a) LocalFree(a);
+ return p;
+}
+// no modo foto tudo é desenhado desde o começo no bitmap (miniaturas e ícones criados lá valem no desenho final)
+inline void FotoTarget() {
+ if (fotoRt || FotoPath().empty() || !wnd) return;
+ RECT r; GetClientRect(wnd, &r);
+ if (r.right <= 0 || r.bottom <= 0) return;
+ float dpi = (float)GetDpiForWindow(wnd);
+ IWICImagingFactory* wic = nullptr;
+ CoCreateInstance(CLSID_WICImagingFactory, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&wic));
+ if (!wic) return;
+ if (SUCCEEDED(wic->CreateBitmap(r.right, r.bottom, GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnLoad, &fotoBmp)))
+ d2d->CreateWicBitmapRenderTarget(fotoBmp, D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_SOFTWARE,
+ D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), dpi, dpi), &fotoRt);
+ if (fotoRt) { fotoRt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0), &fotoBr); rt = fotoRt; br = fotoBr; }
+ wic->Release();
+}
inline bool BeginPaint() {
- if (!rt) {
+ FotoTarget();
+ if (fotoRt) { // desenhando para a foto
+ rt = fotoRt; br = fotoBr;
+ rt->BeginDraw();
+ barButtons.clear();
+ return true;
+ }
+ if (!hrt) {
RECT r; GetClientRect(wnd, &r);
float dpi = (float)GetDpiForWindow(wnd);
d2d->CreateHwndRenderTarget(D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(), dpi, dpi),
- D2D1::HwndRenderTargetProperties(wnd, D2D1::SizeU(r.right, r.bottom)), &rt);
- if (rt) rt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0), &br);
+ D2D1::HwndRenderTargetProperties(wnd, D2D1::SizeU(r.right, r.bottom)), &hrt);
+ if (hrt) hrt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0), &hbr);
}
+ rt = hrt; br = hbr;
if (!rt) return false;
rt->BeginDraw();
+ barButtons.clear();
return true;
}
inline void EndPaint() {
- if (rt->EndDraw() == D2DERR_RECREATE_TARGET) { br->Release(); br = nullptr; rt->Release(); rt = nullptr; InvalidateRect(wnd, nullptr, FALSE); }
+ if (rt->EndDraw() == D2DERR_RECREATE_TARGET && rt == hrt) { hbr->Release(); hbr = nullptr; hrt->Release(); hrt = nullptr; rt = nullptr; br = nullptr; InvalidateRect(wnd, nullptr, FALSE); }
}
-inline void OnSize(LPARAM l) { if (rt) rt->Resize(D2D1::SizeU(LOWORD(l), HIWORD(l))); InvalidateRect(wnd, nullptr, FALSE); }
+inline void OnSize(LPARAM l) { if (hrt) hrt->Resize(D2D1::SizeU(LOWORD(l), HIWORD(l))); InvalidateRect(wnd, nullptr, FALSE); }
inline void OnDpi(WPARAM w, LPARAM l) {
RECT* r = (RECT*)l;
SetWindowPos(wnd, nullptr, r->left, r->top, r->right - r->left, r->bottom - r->top, SWP_NOZORDER | SWP_NOACTIVATE);
- if (rt) rt->SetDpi((float)HIWORD(w), (float)HIWORD(w));
+ if (hrt) hrt->SetDpi((float)HIWORD(w), (float)HIWORD(w));
+}
+inline void CALLBACK FotoTick(HWND, UINT, UINT_PTR id, DWORD) {
+ KillTimer(nullptr, id);
+ FotoTarget();
+ std::wstring path = FotoPath();
+ if (fotoRt && fotoBmp) {
+ SendMessageW(wnd, WM_PAINT, 0, 0);
+ UINT w = 0, h = 0; fotoBmp->GetSize(&w, &h);
+ IWICImagingFactory* wic = nullptr;
+ CoCreateInstance(CLSID_WICImagingFactory, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&wic));
+ IWICStream* st = nullptr; IWICBitmapEncoder* enc = nullptr; IWICBitmapFrameEncode* fr = nullptr;
+ if (wic && SUCCEEDED(wic->CreateStream(&st)) && SUCCEEDED(st->InitializeFromFilename(path.c_str(), GENERIC_WRITE)) &&
+ SUCCEEDED(wic->CreateEncoder(GUID_ContainerFormatPng, nullptr, &enc)) && SUCCEEDED(enc->Initialize(st, WICBitmapEncoderNoCache)) &&
+ SUCCEEDED(enc->CreateNewFrame(&fr, nullptr)) && SUCCEEDED(fr->Initialize(nullptr))) {
+ fr->SetSize(w, h);
+ WICPixelFormatGUID f = GUID_WICPixelFormat32bppPBGRA; fr->SetPixelFormat(&f);
+ fr->WriteSource(fotoBmp, nullptr); fr->Commit(); enc->Commit();
+ }
+ if (fr) fr->Release(); if (enc) enc->Release(); if (st) st->Release(); if (wic) wic->Release();
+ }
+ DestroyWindow(wnd);
}
inline D2D1_SIZE_F Size() { RECT r; GetClientRect(wnd, &r); float s = Sc(); return { r.right / s, r.bottom / s }; }
@@ -277,6 +416,12 @@ inline HWND CreateMain(HINSTANCE hi, const wchar_t* cls, const wchar_t* title, W
wnd = CreateWindowExW(0, cls, title, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, mi.rcWork.left + (mi.rcWork.right - mi.rcWork.left - W) / 2,
mi.rcWork.top + (mi.rcWork.bottom - mi.rcWork.top - H) / 2, W, H, nullptr, nullptr, hi, nullptr);
if (wnd) { BOOL dark = Dark(); DwmSetWindowAttribute(wnd, 20, &dark, sizeof(dark)); }
+ if (wnd && semaforo::Aqua() && barWanted > 0) { // macOS 27: barra de ferramentas unificada
+ BAR = barWanted;
+ SetPropW(wnd, L"WacOSBarraUnificada", (HANDLE)(INT_PTR)std::lround(BAR));
+ SetWindowSubclass(wnd, UnifiedSub, 0x55A1, 0);
+ SetWindowPos(wnd, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ }
return wnd;
}
@@ -330,9 +475,14 @@ inline D2D1_COLOR_F Tinted(D2D1_COLOR_F base) {
auto cl = [](float v) { return std::clamp(v, 0.f, 1.f); };
return D2D1::ColorF(cl(base.r + dr * k), cl(base.g + dg * k), cl(base.b + db * k), base.a);
}
-inline D2D1_COLOR_F SidebarColor() { return Tinted(Dark() ? D2D1::ColorF(40 / 255.f, 40 / 255.f, 42 / 255.f) : D2D1::ColorF(242 / 255.f, 242 / 255.f, 245 / 255.f)); }
+// macOS 27 Golden Gate (capturas do 512 Pixels): a barra lateral é uma cor cheia, sem a tinta do papel de parede
+inline D2D1_COLOR_F SidebarColor() {
+ if (semaforo::Aqua()) return Dark() ? D2D1::ColorF(43 / 255.f, 41 / 255.f, 40 / 255.f) : D2D1::ColorF(237 / 255.f, 237 / 255.f, 236 / 255.f);
+ return Tinted(Dark() ? D2D1::ColorF(40 / 255.f, 40 / 255.f, 42 / 255.f) : D2D1::ColorF(242 / 255.f, 242 / 255.f, 245 / 255.f));
+}
inline int Run() {
+ if (!FotoPath().empty() && wnd) SetTimer(nullptr, 0, 1800, FotoTick); // teste: espera carregar e salva a foto
MSG m;
while (GetMessageW(&m, nullptr, 0, 0)) { TranslateMessage(&m); DispatchMessageW(&m); }
return 0;
diff --git a/src/comum/barra_video.h b/src/comum/barra_video.h
new file mode 100644
index 0000000..b02029b
--- /dev/null
+++ b/src/comum/barra_video.h
@@ -0,0 +1,245 @@
+#pragma once
+// Barra de controles de vídeo do macOS 27 (QuickTime Player e Quick Look), medida na captura QuickTime do 512 Pixels
+// em pt: 458 × 98, cantos 22; linha de cima a 30,5 (alto-falante a 27, volume de 40,5 a 117,5, ⏪ ⏵ ⏩ no meio,
+// AirPlay, legendas e » a 124,5/81/26 da direita); linha de baixo a 73 (tempos a 17 das bordas, linha do tempo de
+// 113,5 até 113 da direita). Trilhos de 5, botões em pílula de 20 × 15. A cor vem do vidro fosco de trás (Acrilico)
+// com um véu quente por cima. Quem usa: src\quicktime e src\shell\quicklook.cpp.
+#include <windows.h>
+#include <d2d1.h>
+#include <d2d1_1.h>
+#include <d2d1effects.h>
+#pragma comment(lib, "dxguid.lib")
+#include <dwrite.h>
+#include <dwmapi.h>
+#include <algorithm>
+#include <cmath>
+#include <string>
+#include <vector>
+
+namespace barravideo {
+
+enum { VOL = 1, BACK, PLAY, FWD, FULL, SCRUB };
+struct Hit { int id; D2D1_RECT_F r; };
+const float LARGURA = 458, ALTURA = 98;
+
+// desenha a barra em (0, 0, W, H) do alvo; hits recebe os retângulos clicáveis (em pt)
+inline void Desenha(ID2D1RenderTarget* rt2, ID2D1SolidColorBrush* b, float W, float H, float volume, bool playing, double pos, double len,
+ IDWriteTextFormat* tfL, IDWriteTextFormat* tfR, std::vector<Hit>& hits) {
+ (void)H;
+ ID2D1Factory* fac = nullptr; rt2->GetFactory(&fac);
+ b->SetColor(D2D1::ColorF(0.36f, 0.34f, 0.31f, 0.52f));
+ rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0, 0, W, H), 22, 22), b);
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.20f)); rt2->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.5f, 0.5f, W - 0.5f, H - 0.5f), 21.5f, 21.5f), b, 1.f);
+ auto fill = [&](auto build) {
+ ID2D1PathGeometry* g = nullptr;
+ if (!fac || FAILED(fac->CreatePathGeometry(&g))) return;
+ ID2D1GeometrySink* sk = nullptr;
+ if (SUCCEEDED(g->Open(&sk))) { build(sk); sk->Close(); sk->Release(); }
+ rt2->FillGeometry(g, b); g->Release();
+ };
+ auto stroke = [&](auto build, float wd) {
+ ID2D1PathGeometry* g = nullptr;
+ if (!fac || FAILED(fac->CreatePathGeometry(&g))) return;
+ ID2D1GeometrySink* sk = nullptr;
+ if (SUCCEEDED(g->Open(&sk))) { build(sk); sk->Close(); sk->Release(); }
+ D2D1_STROKE_STYLE_PROPERTIES sp{ D2D1_CAP_STYLE_ROUND, D2D1_CAP_STYLE_ROUND, D2D1_CAP_STYLE_ROUND, D2D1_LINE_JOIN_ROUND, 10, D2D1_DASH_STYLE_SOLID, 0 };
+ ID2D1StrokeStyle* ss = nullptr; fac->CreateStrokeStyle(sp, nullptr, 0, &ss);
+ rt2->DrawGeometry(g, b, wd, ss); if (ss) ss->Release(); g->Release();
+ };
+ auto tri = [&](D2D1_POINT_2F a, D2D1_POINT_2F c, D2D1_POINT_2F d) { fill([&](ID2D1GeometrySink* sk) { sk->BeginFigure(a, D2D1_FIGURE_BEGIN_FILLED); sk->AddLine(c); sk->AddLine(d); sk->EndFigure(D2D1_FIGURE_END_CLOSED); }); };
+ auto knob = [&](float x, float y) { // pílula branca com sombra curta
+ for (int k = 3; k >= 1; k--) { b->SetColor(D2D1::ColorF(0, 0, 0, 0.07f)); rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(x - 10 - k * 0.4f, y - 7.5f + k * 0.4f, x + 10 + k * 0.4f, y + 7.5f + k * 0.8f), 7.5f + k * 0.4f, 7.5f + k * 0.4f), b); }
+ b->SetColor(D2D1::ColorF(0.96f, 0.96f, 0.95f, 1)); rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(x - 10, y - 7.5f, x + 10, y + 7.5f), 7.5f, 7.5f), b);
+ };
+ auto track = [&](D2D1_RECT_F r, float f) { // trilho de 5: o que passou branco, o resto translúcido
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.26f)); rt2->FillRoundedRectangle(D2D1::RoundedRect(r, 2.5f, 2.5f), b);
+ float kx = r.left + 10 + (r.right - r.left - 20) * f;
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.94f)); rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left, r.top, kx, r.bottom), 2.5f, 2.5f), b);
+ knob(kx, (r.top + r.bottom) / 2);
+ };
+ const D2D1_COLOR_F ic = D2D1::ColorF(1, 1, 1, 0.86f);
+ float cy = 30.5f, cx = W / 2;
+ // alto-falante (corpo cheio) e as ondas conforme o volume
+ b->SetColor(ic);
+ fill([&](ID2D1GeometrySink* sk) {
+ sk->BeginFigure({ 20.f, cy - 2.6f }, D2D1_FIGURE_BEGIN_FILLED);
+ sk->AddLine({ 23.2f, cy - 2.6f }); sk->AddLine({ 27.5f, cy - 6.5f }); sk->AddLine({ 27.5f, cy + 6.5f }); sk->AddLine({ 23.2f, cy + 2.6f }); sk->AddLine({ 20.f, cy + 2.6f });
+ sk->EndFigure(D2D1_FIGURE_END_CLOSED);
+ });
+ for (int k = 0; k < 2; k++) {
+ if (volume <= (k ? 0.5f : 0.01f)) break;
+ float rr = k ? 6.5f : 3.6f, a = k ? 0.95f : 0.85f;
+ stroke([&](ID2D1GeometrySink* sk) {
+ sk->BeginFigure({ 28.5f + rr * 0.6f, cy - rr * a }, D2D1_FIGURE_BEGIN_HOLLOW);
+ sk->AddArc(D2D1::ArcSegment({ 28.5f + rr * 0.6f, cy + rr * a }, { rr, rr }, 0, D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ sk->EndFigure(D2D1_FIGURE_END_OPEN);
+ }, 1.4f);
+ }
+ D2D1_RECT_F vol = D2D1::RectF(40.5f, cy - 2.5f, 117.5f, cy + 2.5f);
+ track(vol, volume);
+ hits.push_back({ VOL, D2D1::RectF(vol.left - 6, cy - 12, vol.right + 6, cy + 12) });
+ // ⏪ ⏵/⏸ ⏩: triângulos cheios
+ b->SetColor(ic);
+ float bx = cx - 41, fx = cx + 39;
+ tri({ bx - 11, cy }, { bx, cy - 6.5f }, { bx, cy + 6.5f }); tri({ bx, cy }, { bx + 11, cy - 6.5f }, { bx + 11, cy + 6.5f });
+ tri({ fx + 11, cy }, { fx, cy - 6.5f }, { fx, cy + 6.5f }); tri({ fx, cy }, { fx - 11, cy - 6.5f }, { fx - 11, cy + 6.5f });
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.94f));
+ if (playing) {
+ rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cx - 8.5f, cy - 12.5f, cx - 2.5f, cy + 12.5f), 1.5f, 1.5f), b);
+ rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cx + 2.5f, cy - 12.5f, cx + 8.5f, cy + 12.5f), 1.5f, 1.5f), b);
+ } else {
+ fill([&](ID2D1GeometrySink* sk) { // ⏵ de 24 × 27 com as pontas levemente arredondadas
+ sk->BeginFigure({ cx - 9.f, cy - 12.f }, D2D1_FIGURE_BEGIN_FILLED);
+ sk->AddQuadraticBezier(D2D1::QuadraticBezierSegment({ cx - 9.f, cy - 14.5f }, { cx - 6.8f, cy - 13.2f }));
+ sk->AddLine({ cx + 13.f, cy - 1.4f });
+ sk->AddQuadraticBezier(D2D1::QuadraticBezierSegment({ cx + 15.f, cy }, { cx + 13.f, cy + 1.4f }));
+ sk->AddLine({ cx - 6.8f, cy + 13.2f });
+ sk->AddQuadraticBezier(D2D1::QuadraticBezierSegment({ cx - 9.f, cy + 14.5f }, { cx - 9.f, cy + 12.f }));
+ sk->EndFigure(D2D1_FIGURE_END_CLOSED);
+ });
+ }
+ hits.push_back({ BACK, D2D1::RectF(bx - 16, cy - 14, bx + 16, cy + 14) });
+ hits.push_back({ PLAY, D2D1::RectF(cx - 18, cy - 18, cx + 18, cy + 18) });
+ hits.push_back({ FWD, D2D1::RectF(fx - 16, cy - 14, fx + 16, cy + 14) });
+ // AirPlay (tela com o triângulo), legendas (balão com linhas) e » (mais / tela cheia)
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.78f));
+ float ax = W - 124.5f, sx = W - 81, mx = W - 26;
+ stroke([&](ID2D1GeometrySink* sk) {
+ sk->BeginFigure({ ax - 4.5f, cy + 5.5f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ sk->AddLine({ ax - 9.f, cy + 5.5f }); sk->AddLine({ ax - 9.f, cy - 7.f }); sk->AddLine({ ax + 9.f, cy - 7.f }); sk->AddLine({ ax + 9.f, cy + 5.5f }); sk->AddLine({ ax + 4.5f, cy + 5.5f });
+ sk->EndFigure(D2D1_FIGURE_END_OPEN);
+ }, 1.3f);
+ tri({ ax, cy + 1.f }, { ax + 5.f, cy + 8.f }, { ax - 5.f, cy + 8.f });
+ stroke([&](ID2D1GeometrySink* sk) {
+ sk->BeginFigure({ sx - 6.f, cy + 5.f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ sk->AddLine({ sx - 7.f, cy + 5.f });
+ sk->AddArc(D2D1::ArcSegment({ sx - 9.f, cy + 3.f }, { 2, 2 }, 0, D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ sk->AddLine({ sx - 9.f, cy - 5.f });
+ sk->AddArc(D2D1::ArcSegment({ sx - 7.f, cy - 7.f }, { 2, 2 }, 0, D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ sk->AddLine({ sx + 7.f, cy - 7.f });
+ sk->AddArc(D2D1::ArcSegment({ sx + 9.f, cy - 5.f }, { 2, 2 }, 0, D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ sk->AddLine({ sx + 9.f, cy + 3.f });
+ sk->AddArc(D2D1::ArcSegment({ sx + 7.f, cy + 5.f }, { 2, 2 }, 0, D2D1_SWEEP_DIRECTION_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ sk->AddLine({ sx - 2.f, cy + 5.f }); sk->AddLine({ sx - 6.f, cy + 8.5f });
+ sk->EndFigure(D2D1_FIGURE_END_CLOSED);
+ }, 1.3f);
+ rt2->DrawLine({ sx - 5.f, cy - 1.5f }, { sx + 5.f, cy - 1.5f }, b, 1.2f);
+ rt2->DrawLine({ sx - 5.f, cy + 1.5f }, { sx + 2.f, cy + 1.5f }, b, 1.2f);
+ stroke([&](ID2D1GeometrySink* sk) {
+ for (float o : { -3.5f, 2.5f }) {
+ sk->BeginFigure({ mx + o - 2.5f, cy - 5.5f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ sk->AddLine({ mx + o + 2.5f, cy }); sk->AddLine({ mx + o - 2.5f, cy + 5.5f });
+ sk->EndFigure(D2D1_FIGURE_END_OPEN);
+ }
+ }, 1.4f);
+ D2D1_RECT_F rfull = D2D1::RectF(mx - 14, cy - 14, mx + 14, cy + 14);
+ hits.push_back({ FULL, rfull });
+ // linha de baixo: tempo, linha do tempo e duração, no formato do QuickTime (hh:mm:ss:quadros)
+ auto tc = [](double v) { v = std::max(0.0, v); int t2 = (int)v, fr = (int)((v - t2) * 30); wchar_t s2[24]; swprintf_s(s2, L"%02d:%02d:%02d:%02d", t2 / 3600, t2 / 60 % 60, t2 % 60, fr); return std::wstring(s2); };
+ float by = 73;
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.72f));
+ std::wstring a1 = tc(pos), a2 = tc(len);
+ rt2->DrawTextW(a1.c_str(), (UINT32)a1.size(), tfL, D2D1::RectF(17, by - 10, 120, by + 10), b);
+ rt2->DrawTextW(a2.c_str(), (UINT32)a2.size(), tfR, D2D1::RectF(W - 120, by - 10, W - 17, by + 10), b);
+ D2D1_RECT_F bar = D2D1::RectF(113.5f, by - 2.5f, W - 113, by + 2.5f);
+ track(bar, len > 0 ? (float)std::clamp(pos / len, 0.0, 1.0) : 0.f);
+ hits.push_back({ SCRUB, D2D1::RectF(bar.left, by - 12, bar.right, by + 12) });
+ if (fac) fac->Release();
+}
+
+// posição do volume a partir do x clicado (o centro da pílula anda de 10 a 10 das pontas do trilho)
+inline float VolumeEm(const D2D1_RECT_F& hit, float x) { return std::clamp((x - hit.left - 16) / (hit.right - hit.left - 32), 0.f, 1.f); }
+// posição na linha do tempo (0..1) a partir do x clicado
+inline float PosicaoEm(const D2D1_RECT_F& hit, float x) { return std::clamp((x - hit.left - 10) / (hit.right - hit.left - 20), 0.f, 1.f); }
+
+// Vidro fosco de verdade, sem o acrílico (que não aceita recorte e deixava uma faixa sem desfoque em volta): copia o
+// que a janela src mostra (PrintWindow, pega o vídeo) no retângulo da tela scr, desfoca (Gaussian) e desenha em dst
+// (DIP do alvo) recortado no canto rad. Sem src ou se falhar, não desenha nada (fica só a tinta por cima).
+inline bool FundoBorrado(ID2D1RenderTarget* rt, HWND src, RECT scr, float sc, D2D1_RECT_F dst, float rad, float sigma = 18.f) {
+ if (!rt || !src || !IsWindowVisible(src)) return false;
+ RECT wr; GetWindowRect(src, &wr);
+ int ww = wr.right - wr.left, wh = wr.bottom - wr.top;
+ if (ww <= 0 || wh <= 0) return false;
+ // a cópia da janela fica guardada (uma por quadro serve à barra de título e à de controles)
+ static HDC mem; static HBITMAP bmp; static void* bits; static int bw, bh; static HWND last; static DWORD at;
+ if (!mem) mem = CreateCompatibleDC(nullptr);
+ if (ww != bw || wh != bh) {
+ if (bmp) DeleteObject(bmp);
+ BITMAPINFO bi{}; bi.bmiHeader = { sizeof(BITMAPINFOHEADER), ww, -wh, 1, 32, BI_RGB };
+ bmp = CreateDIBSection(mem, &bi, DIB_RGB_COLORS, &bits, nullptr, 0);
+ if (!bmp) { bw = bh = 0; return false; }
+ SelectObject(mem, bmp); bw = ww; bh = wh; last = nullptr;
+ }
+ DWORD now = GetTickCount();
+ if (last != src || now - at > 25) {
+ if (!PrintWindow(src, mem, 2 /*PW_RENDERFULLCONTENT*/)) return false;
+ GdiFlush(); last = src; at = now;
+ }
+ int x0 = std::clamp((int)(scr.left - wr.left), 0, ww), y0 = std::clamp((int)(scr.top - wr.top), 0, wh);
+ int x1 = std::clamp((int)(scr.right - wr.left), 0, ww), y1 = std::clamp((int)(scr.bottom - wr.top), 0, wh);
+ if (x1 - x0 < 2 || y1 - y0 < 2) return false;
+ ID2D1Bitmap* b = nullptr;
+ auto bp = D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE), 96 * sc, 96 * sc);
+ if (FAILED(rt->CreateBitmap(D2D1::SizeU(x1 - x0, y1 - y0), (BYTE*)bits + ((size_t)y0 * ww + x0) * 4, ww * 4, bp, &b)) || !b) return false;
+ D2D1_POINT_2F at2{ dst.left + (x0 - (scr.left - wr.left)) / sc, dst.top + (y0 - (scr.top - wr.top)) / sc };
+ ID2D1Factory* fac = nullptr; rt->GetFactory(&fac);
+ ID2D1RoundedRectangleGeometry* rg = nullptr;
+ if (fac) fac->CreateRoundedRectangleGeometry(D2D1::RoundedRect(dst, rad, rad), &rg);
+ if (rg) rt->PushLayer(D2D1::LayerParameters(D2D1::InfiniteRect(), rg), nullptr);
+ bool ok = false;
+ ID2D1DeviceContext* dc = nullptr;
+ if (SUCCEEDED(rt->QueryInterface(IID_PPV_ARGS(&dc))) && dc) {
+ ID2D1Effect* fx = nullptr;
+ if (SUCCEEDED(dc->CreateEffect(CLSID_D2D1GaussianBlur, &fx)) && fx) {
+ fx->SetInput(0, b);
+ fx->SetValue(D2D1_GAUSSIANBLUR_PROP_STANDARD_DEVIATION, sigma);
+ fx->SetValue(D2D1_GAUSSIANBLUR_PROP_BORDER_MODE, D2D1_BORDER_MODE_HARD);
+ dc->DrawImage(fx, at2);
+ fx->Release(); ok = true;
+ }
+ dc->Release();
+ }
+ if (!ok) { // sem efeitos: reduz e amplia de volta (borra também)
+ ID2D1BitmapRenderTarget* reduz = nullptr;
+ auto sz = b->GetSize();
+ if (SUCCEEDED(rt->CreateCompatibleRenderTarget(D2D1::SizeF(std::max(1.f, sz.width / 10), std::max(1.f, sz.height / 10)), &reduz)) && reduz) {
+ reduz->BeginDraw();
+ reduz->DrawBitmap(b, D2D1::RectF(0, 0, std::max(1.f, sz.width / 10), std::max(1.f, sz.height / 10)), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
+ reduz->EndDraw();
+ ID2D1Bitmap* sb = nullptr; reduz->GetBitmap(&sb);
+ if (sb) { rt->DrawBitmap(sb, D2D1::RectF(at2.x, at2.y, at2.x + sz.width, at2.y + sz.height), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR); sb->Release(); ok = true; }
+ reduz->Release();
+ }
+ }
+ if (rg) { rt->PopLayer(); rg->Release(); }
+ if (fac) fac->Release();
+ b->Release();
+ return ok;
+}
+
+// O vidro fosco de trás: uma janela com o acrílico do Windows (desfoca o que está atrás). O acrílico ignora recorte
+// (SetWindowRgn); quem usa a põe 4,5 pt para dentro da barra, com o canto redondo de 8 do Windows.
+inline LRESULT CALLBACK AcrilicoProc(HWND h, UINT m, WPARAM w, LPARAM l) { if (m == WM_MOUSEACTIVATE) return MA_NOACTIVATE; return DefWindowProcW(h, m, w, l); }
+inline HWND Acrilico(HINSTANCE hi, HWND owner, DWORD tintAABBGGRR = 0x18403C38, DWORD corner = 2 /*DWMWCP_ROUND*/) {
+ static bool reg = false;
+ if (!reg) {
+ WNDCLASSEXW gc{ sizeof(gc) };
+ gc.lpfnWndProc = AcrilicoProc; gc.hInstance = hi; gc.lpszClassName = L"WacOSVidroAcrilico"; gc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
+ RegisterClassExW(&gc);
+ reg = true;
+ }
+ HWND g = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TRANSPARENT, L"WacOSVidroAcrilico", L"", WS_POPUP, 0, 0, 10, 10, owner, nullptr, hi, nullptr);
+ if (!g) return nullptr;
+ COLORREF none = 0xFFFFFFFE;
+ DwmSetWindowAttribute(g, 33, &corner, sizeof(corner)); DwmSetWindowAttribute(g, 34, &none, sizeof(none));
+ struct ACCENT_POLICY { int state, flags; DWORD gradient; int anim; };
+ struct WCA_DATA { int attr; void* data; SIZE_T size; };
+ using Fn = BOOL(WINAPI*)(HWND, WCA_DATA*);
+ auto fn = (Fn)GetProcAddress(GetModuleHandleW(L"user32.dll"), "SetWindowCompositionAttribute");
+ ACCENT_POLICY ap{ 4 /*ACCENT_ENABLE_ACRYLICBLURBEHIND*/, 0, tintAABBGGRR, 0 };
+ WCA_DATA d{ 19 /*WCA_ACCENT_POLICY*/, &ap, sizeof(ap) };
+ if (!fn || !fn(g, &d)) { DestroyWindow(g); return nullptr; }
+ return g;
+}
+
+} // namespace barravideo
diff --git a/src/comum/idioma_en.inc b/src/comum/idioma_en.inc
index 4e48a23..6eb9f8b 100644
--- a/src/comum/idioma_en.inc
+++ b/src/comum/idioma_en.inc
@@ -111,7 +111,7 @@
{ L"Forçar Encerrar…", L"Force Quit…" },
{ L"Repousar", L"Sleep" },
{ L"Bloquear Tela", L"Lock Screen" },
-{ L"Encerrar Sessão de ", L"Log Out" },
+{ L"Encerrar Sessão de ", L"Log Out " },
{ L"Sair do Shell (voltar à barra do Windows)", L"Quit Shell (back to the Windows taskbar)" },
{ L"Sobre ", L"About" },
{ L"Ocultar ", L"Hide" },
@@ -1384,3 +1384,37 @@
{ L"Só no Organizador Visual", L"Only in Stage Manager" },
{ L"Área de Trabalho", L"Desktop" },
{ L"Alinhar à Grade", L"Snap to Grid" },
+{ L"Cor do realce do texto", L"Text highlight color" },
+{ L"Cor das pastas", L"Folder color" },
+{ L"Lavanda", L"Lavender" },
+{ L"Estilo do WacOS", L"WacOS style" },
+{ L"Pesquisar ou Perguntar", L"Search or Ask" },
+{ L"Ir para:", L"Go to:" },
+{ L"Digite um caminho", L"Enter a path" },
+{ L"Ir para a Pasta…", L"Go to Folder…" },
+{ L"Gerencie a configuração geral e as preferências do computador, como atualizações de software, idioma, compartilhamento e mais.", L"Manage your overall setup and preferences for your computer, such as software updates, language, sharing and more." },
+{ L"Compartilhar Contato", L"Share Contact" },
+{ L"Apagar Contato", L"Delete Contact" },
+{ L"Negrito Itálico", L"Bold Italic" },
+{ L"Fixados", L"Pinned" },
+{ L"Meses", L"Months" },
+{ L"Todas as Fotos", L"All Photos" },
+{ L"%d Fotos", L"%d Photos" },
+{ L"%d Vídeos", L"%d Videos" },
+{ L"%d Fotos, %d Vídeos", L"%d Photos, %d Videos" },
+{ L"Buscar em Álbuns", L"Find in Albums" },
+{ L"Buscar em Artistas", L"Find in Artists" },
+{ L"Buscar em Músicas", L"Find in Songs" },
+{ L"Condições", L"Conditions" },
+{ L"Temperatura (°C)", L"Temperature (°C)" },
+{ L"O ar está úmido agora.", L"The air feels humid right now." },
+{ L"O ar está seco agora.", L"The air feels dry right now." },
+{ L"Umidade confortável agora.", L"Comfortable humidity right now." },
+{ L"Mostrar", L"Show" },
+{ L"%d Concluídos", L"%d Completed" },
+{ L"Ver como Lista", L"View as List" },
+{ L"Ver como Galeria", L"View as Gallery" },
+{ L"%d nota", L"%d note" },
+{ L"%d notas", L"%d notes" },
+{ L"Apagar Nota", L"Delete Note" },
+{ L"Ordem Padrão", L"Default Order" },
diff --git a/src/comum/semaforo.h b/src/comum/semaforo.h
index d80e14d..b55147a 100644
--- a/src/comum/semaforo.h
+++ b/src/comum/semaforo.h
@@ -7,38 +7,177 @@
#include <d2d1.h>
#include <cstdio>
#include <cwchar>
+#include <algorithm>
+#include <cmath>
#include <string>
namespace semaforo {
enum Kind { FILL, RING, GLYPH };
-inline bool Grafite() {
- static bool on = false;
+// lê destaque= e o tema (golden_gate=1 junto com liquid_glass=1 = macOS Golden Gate) do ajustes.txt
+struct Estado { bool grafite = false, aqua = false; };
+inline const Estado& Ler() {
+ static Estado st;
static DWORD lastCheck = 0;
static FILETIME lastWrite{};
DWORD now = GetTickCount();
- if (lastCheck && now - lastCheck < 500) return on;
+ if (lastCheck && now - lastCheck < 500) return st;
lastCheck = now;
wchar_t ad[MAX_PATH];
DWORD n = GetEnvironmentVariableW(L"APPDATA", ad, MAX_PATH);
- if (!n || n >= MAX_PATH) return on;
+ if (!n || n >= MAX_PATH) return st;
std::wstring path = std::wstring(ad) + L"\\Shell\\ajustes.txt";
WIN32_FILE_ATTRIBUTE_DATA fa{};
- if (!GetFileAttributesExW(path.c_str(), GetFileExInfoStandard, &fa)) return on;
- if (!CompareFileTime(&fa.ftLastWriteTime, &lastWrite)) return on;
+ if (!GetFileAttributesExW(path.c_str(), GetFileExInfoStandard, &fa)) return st;
+ if (!CompareFileTime(&fa.ftLastWriteTime, &lastWrite)) return st;
lastWrite = fa.ftLastWriteTime;
FILE* f = nullptr;
- if (_wfopen_s(&f, path.c_str(), L"r, ccs=UTF-8") || !f) return on;
- bool g = false;
+ if (_wfopen_s(&f, path.c_str(), L"r, ccs=UTF-8") || !f) return st;
+ bool g = false, liquid = false, golden = false;
wchar_t line[512];
- while (fgetws(line, 512, f)) if (wcsncmp(line, L"destaque=", 9) == 0) g = wcsncmp(line + 9, L"grafite", 7) == 0;
+ while (fgetws(line, 512, f)) {
+ if (wcsncmp(line, L"destaque=", 9) == 0) g = wcsncmp(line + 9, L"grafite", 7) == 0;
+ if (wcsncmp(line, L"liquid_glass=", 13) == 0) liquid = line[13] == L'1';
+ if (wcsncmp(line, L"golden_gate=", 12) == 0) golden = line[12] == L'1';
+ }
fclose(f);
- on = g;
- return on;
+ st.grafite = g;
+ st.aqua = liquid && golden;
+ return st;
+}
+
+inline bool Grafite() { return Ler().grafite; }
+
+// Tema macOS Golden Gate (macOS 27, beta 6 em diante): os botões ganharam volume de novo. Medido nas capturas do
+// 512 Pixels (Finder, 2x, botão de 28 px): o círculo é um degradê de cima para baixo — mais saturado no alto, mais
+// claro embaixo, chapado a partir de ~78 % da altura — e tem um aro escuro de 0,5 pt que só aparece dos lados (some
+// em cima e fica fraco embaixo). Nada de reflexo branco. Cores lidas (topo -> base; aro):
+// fechar (254,111,100) -> (243,139,131); aro (196,9,10)
+// minim. (251,185,39) -> (254,211,66); aro (157,9,9)
+// zoom (96,208,40) -> (152,218,120); aro (9,85,9)
+inline bool Aqua() { return Ler().aqua; }
+
+#include "semaforo_mac27.inc" // os três botões do macOS 27 tirados da captura 2x (tools/semaforo-mac27.py)
+
+// Desenha o botão k (0 fechar, 1 minimizar, 2 zoom) do macOS 27 pixel a pixel: a imagem tirada da captura do Mac
+// (36 px = o botão de 28 px e o brilho em volta), escalada para o raio pedido. dark > 0 escurece (botão apertado).
+inline void DrawMac27(ID2D1RenderTarget* rt, int k, D2D1_POINT_2F c, float r, float dark) {
+ // escolhe a imagem mais perto do tamanho na tela (36 px = 2x, 18 px = 1x, já reduzida com Lanczos): encolher na hora
+ // com o filtro simples serrilhava a borda. Em escala inteira, o centro vai para o meio de um pixel (sem borrão).
+ float dpiX = 96, dpiY = 96; rt->GetDpi(&dpiX, &dpiY);
+ float k1 = dpiX / 96.f, sizePx = 2 * r * 36.f / 28.f * k1; // lado da imagem na tela, em px
+ bool one = sizePx < 27;
+ UINT n = one ? 18 : 36;
+ ID2D1Bitmap* bmp = nullptr;
+ D2D1_BITMAP_PROPERTIES bp = D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), dpiX, dpiY);
+ if (FAILED(rt->CreateBitmap(D2D1::SizeU(n, n), one ? MAC27_LIGHTS_1X[k] : MAC27_LIGHTS[k], n * 4, bp, &bmp)) || !bmp) return;
+ float h = r * 36.f / 28.f; // a imagem tem 36 px para um botão de 28 px
+ D2D1_RECT_F dst = D2D1::RectF(c.x - h, c.y - h, c.x + h, c.y + h);
+ if (std::fabs(sizePx - (float)n) < 0.6f) { // 1:1 na tela: encaixa na grade de pixels
+ float x0 = std::round((c.x - h) * k1) / k1, y0 = std::round((c.y - h) * k1) / k1;
+ dst = D2D1::RectF(x0, y0, x0 + n / k1, y0 + n / k1);
+ }
+ rt->DrawBitmap(bmp, dst, 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
+ bmp->Release();
+ if (dark > 0.01f) {
+ ID2D1SolidColorBrush* b = nullptr;
+ if (SUCCEEDED(rt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0, dark), &b))) { rt->FillEllipse(D2D1::Ellipse(c, r, r), b); b->Release(); }
+ }
+}
+
+// Chame logo depois de pintar o círculo do botão (FillEllipse), com o mesmo pincel: pinta por cima o degradê e o aro
+// do Golden Gate, escolhidos pela cor que está no pincel (vermelho, amarelo, verde; cinza/apagado fica com um degradê
+// leve da própria cor). Não mexe na cor do pincel. Fora do Golden Gate não faz nada.
+inline void Gloss(ID2D1RenderTarget* rt, D2D1_POINT_2F c, float r, ID2D1SolidColorBrush* fillBrush) {
+ if (!rt || !fillBrush || !Aqua()) return;
+ D2D1_COLOR_F base = fillBrush->GetColor();
+ auto C = [](int R, int G, int B, float a = 1) { return D2D1::ColorF(R / 255.f, G / 255.f, B / 255.f, a); };
+ D2D1_COLOR_F top, bot, rim;
+ bool solid = base.a >= 0.9f;
+ { // vermelho, amarelo ou verde (também apertado, mais escuro): a imagem do Mac
+ float mx = (std::max)(base.r, (std::max)(base.g, base.b));
+ if (solid && mx > 0.5f) {
+ float nr = base.r / mx, ng = base.g / mx, nb = base.b / mx;
+ int k = nr > 0.9f && ng < 0.5f ? 0 : nr > 0.9f && ng >= 0.5f && nb < 0.5f ? 1 : ng > 0.9f && nr < 0.45f ? 2 : -1;
+ static const float ref[3] = { 1.0f, 0.996f, 0.784f }; // o canal mais forte da cor normal de cada um
+ if (k >= 0) { DrawMac27(rt, k, c, r, (std::min)(0.6f, (std::max)(0.f, 1 - mx / ref[k]))); return; }
+ }
+ // cinza (janela inativa, Grafite): o botão inativo do Mac, o claro ou o escuro (pelo fundo que o app pediu)
+ bool darkUi = solid ? (0.2126f * base.r + 0.7152f * base.g + 0.0722f * base.b) < 0.5f : base.r > 0.5f;
+ DrawMac27(rt, darkUi ? 4 : 3, c, r, 0);
+ return;
+ }
+ if (solid && base.r > 0.85f && base.g < 0.5f) { top = C(254, 111, 100); bot = C(243, 139, 131); rim = C(196, 9, 10); }
+ else if (solid && base.r > 0.85f && base.g >= 0.5f) { top = C(251, 185, 39); bot = C(254, 211, 66); rim = C(157, 9, 9); }
+ else if (solid && base.g > 0.55f && base.r < 0.45f) { top = C(96, 208, 40); bot = C(152, 218, 120); rim = C(9, 85, 9); }
+ else {
+ // cinza (janela inativa, Grafite) ou apagado. Medido na janela inativa do modo escuro: (84,83,83) em cima ->
+ // (74,73,73) embaixo, com um fio claro na borda de cima (128) e outro mais claro embaixo (171), sem aro escuro
+ auto mix = [](D2D1_COLOR_F a, float k, float t) { return D2D1::ColorF(a.r + (k - a.r) * t, a.g + (k - a.g) * t, a.b + (k - a.b) * t, a.a); };
+ top = mix(base, 1, 0.05f); bot = mix(base, 0, 0.06f);
+ D2D1_GRADIENT_STOP st[3] = { { 0, top }, { 0.2f, top }, { 0.9f, bot } };
+ ID2D1GradientStopCollection* gs = nullptr;
+ ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(rt->CreateGradientStopCollection(st, 3, &gs)) &&
+ SUCCEEDED(rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ c.x, c.y - r }, { c.x, c.y + r }), gs, &lb)))
+ rt->FillEllipse(D2D1::Ellipse(c, r, r), lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ D2D1_GRADIENT_STOP rs[4] = { { 0, D2D1::ColorF(1, 1, 1, 0.28f) }, { 0.25f, D2D1::ColorF(1, 1, 1, 0) }, { 0.75f, D2D1::ColorF(1, 1, 1, 0) }, { 1, D2D1::ColorF(1, 1, 1, 0.5f) } };
+ gs = nullptr; lb = nullptr;
+ if (SUCCEEDED(rt->CreateGradientStopCollection(rs, 4, &gs)) &&
+ SUCCEEDED(rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ c.x, c.y - r }, { c.x, c.y + r }), gs, &lb)))
+ rt->DrawEllipse(D2D1::Ellipse(c, r - 0.25f, r - 0.25f), lb, 0.5f);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ return;
+ }
+ D2D1_ELLIPSE disc = D2D1::Ellipse(c, r, r);
+ {
+ D2D1_GRADIENT_STOP st[3] = { { 0, top }, { 0.29f, top }, { 0.80f, bot } }; // medido: chapado até 29 %, a cor de baixo em 80 %
+ ID2D1GradientStopCollection* gs = nullptr;
+ ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(rt->CreateGradientStopCollection(st, 3, &gs)) &&
+ SUCCEEDED(rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ c.x, c.y - r }, { c.x, c.y + r }), gs, &lb)))
+ rt->FillEllipse(disc, lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ }
+ {
+ // aro: a força depende da distância horizontal ao centro (pincel radial bem alto = |dx| / r): forte dos lados,
+ // fraco em cima e embaixo (medido pixel a pixel na captura 2x do Finder)
+ D2D1_COLOR_F a0 = rim; a0.a = 0.10f;
+ D2D1_COLOR_F a1 = rim; a1.a = 0.35f;
+ D2D1_COLOR_F a2 = rim; a2.a = 1;
+ D2D1_GRADIENT_STOP st[3] = { { 0, a0 }, { 0.6f, a1 }, { 0.92f, a2 } };
+ ID2D1GradientStopCollection* gs = nullptr;
+ ID2D1RadialGradientBrush* rb = nullptr;
+ if (SUCCEEDED(rt->CreateGradientStopCollection(st, 3, &gs)) &&
+ SUCCEEDED(rt->CreateRadialGradientBrush(D2D1::RadialGradientBrushProperties(c, { 0, 0 }, r, r * 60), gs, &rb)))
+ rt->DrawEllipse(D2D1::Ellipse(c, r - 0.4f, r - 0.4f), rb, 0.8f);
+ if (rb) rb->Release();
+ if (gs) gs->Release();
+ }
+ // o brilho colorido que o botão solta em volta, mais forte embaixo (medido: ~12 % da cor logo abaixo)
+ if (solid) {
+ D2D1_COLOR_F a0 = top; a0.a = 0.03f;
+ D2D1_COLOR_F a1 = top; a1.a = 0.20f;
+ D2D1_GRADIENT_STOP st[2] = { { 0, a0 }, { 1, a1 } };
+ ID2D1GradientStopCollection* gs = nullptr;
+ ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(rt->CreateGradientStopCollection(st, 2, &gs)) &&
+ SUCCEEDED(rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ c.x, c.y - r }, { c.x, c.y + r + 1 }), gs, &lb)))
+ rt->DrawEllipse(D2D1::Ellipse(c, r + 0.6f, r + 0.6f), lb, 1.2f);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ }
}
inline const D2D1_COLOR_F* Pick(const D2D1_COLOR_F* normal, Kind k) {
+ // Golden Gate: o aro é o do Gloss (escuro só dos lados); o contorno claro antigo some
+ static const D2D1_COLOR_F none[3] = { { 0, 0, 0, 0 }, { 0, 0, 0, 0 }, { 0, 0, 0, 0 } };
+ if (k == RING && Aqua()) return none;
if (!Grafite()) return normal;
static const D2D1_COLOR_F fill[3] = { { 0.58f, 0.58f, 0.59f, 1 }, { 0.58f, 0.58f, 0.59f, 1 }, { 0.58f, 0.58f, 0.59f, 1 } };
static const D2D1_COLOR_F ring[3] = { { 0.47f, 0.47f, 0.48f, 1 }, { 0.47f, 0.47f, 0.48f, 1 }, { 0.47f, 0.47f, 0.48f, 1 } };
diff --git a/src/comum/semaforo_mac27.inc b/src/comum/semaforo_mac27.inc
new file mode 100644
index 0000000..31480bc
--- /dev/null
+++ b/src/comum/semaforo_mac27.inc
@@ -0,0 +1,15 @@
+// gerado por tools/semaforo-mac27.py: os botões do macOS 27 (captura 2x do Finder), 36 x 36 px BGRA pré-multiplicado
+static const unsigned char MAC27_LIGHTS[5][36 * 36 * 4] = {
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,6,0,0,0,0,3,4,5,6,0,0,0,0,3,4,5,6,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,6,3,4,5,6,7,6,9,9,3,3,7,7,3,3,7,8,4,4,8,9,4,5,10,10,3,3,7,7,3,3,7,7,8,6,9,11,9,8,11,13,0,0,0,0,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,6,6,5,9,9,6,7,16,17,37,41,90,94,52,58,140,145,73,78,187,193,92,100,232,240,97,106,247,255,97,106,247,255,88,97,230,237,72,81,189,195,53,59,141,145,37,41,90,95,8,7,18,18,9,8,11,13,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,6,8,7,6,9,10,9,10,23,24,45,47,114,120,85,93,207,217,89,99,245,255,93,100,247,255,94,106,250,255,97,108,251,255,99,107,251,255,97,106,251,255,95,105,251,255,94,106,250,255,94,103,248,255,89,99,245,255,84,91,205,214,44,47,113,120,9,10,23,24,7,6,9,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,8,11,13,10,10,15,16,35,38,83,88,80,85,189,202,87,97,243,255,93,102,247,255,101,109,253,255,102,110,254,255,100,109,254,255,100,111,254,255,100,111,254,255,100,111,254,255,101,110,255,255,102,112,254,255,100,111,254,255,100,110,252,255,93,102,247,255,88,97,242,255,78,83,188,200,36,39,84,91,12,11,15,17,3,4,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,5,8,9,13,13,17,19,39,43,103,112,98,106,230,247,89,98,243,255,101,108,250,255,102,110,254,255,101,113,253,255,102,112,254,255,102,112,254,255,102,112,254,255,102,112,254,255,102,112,254,255,101,111,253,255,102,112,254,255,101,111,253,255,104,111,254,255,102,110,254,255,98,109,252,255,90,98,241,255,101,105,230,248,42,42,103,112,10,10,14,16,8,7,10,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,5,9,7,10,12,13,13,17,20,40,42,104,114,91,98,233,255,90,98,241,255,101,111,252,255,104,113,254,255,103,112,253,255,101,113,253,255,101,111,253,255,101,111,253,255,101,111,253,255,101,111,253,255,101,111,253,255,99,112,253,255,101,111,253,255,100,111,254,255,103,112,253,255,103,112,253,255,104,113,253,255,102,112,253,255,90,100,241,255,91,98,233,255,40,42,104,114,11,11,15,16,7,6,8,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,6,6,10,10,15,16,40,43,90,100,97,103,229,255,88,96,239,255,102,111,252,255,102,113,252,255,102,112,253,255,103,112,253,255,101,111,253,255,103,112,253,255,101,111,253,255,101,111,253,255,101,111,253,255,102,110,254,255,103,110,253,255,101,111,253,255,101,111,253,255,101,113,253,255,102,112,253,255,102,111,252,255,102,112,252,255,103,113,251,255,88,96,239,255,97,103,229,255,41,44,90,101,10,10,14,15,8,6,10,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,10,10,15,16,13,16,33,35,95,98,210,236,81,89,233,255,104,111,250,255,103,113,251,255,103,113,252,255,102,112,253,255,101,111,252,255,101,113,252,255,100,112,252,255,103,110,253,255,100,110,252,255,101,111,253,255,102,111,252,255,101,111,253,255,100,110,252,255,102,112,253,255,103,112,253,255,102,112,253,255,101,110,252,255,104,114,252,255,103,113,251,255,104,113,250,255,81,89,233,255,91,96,206,231,13,14,31,34,11,12,16,17,3,4,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,4,4,6,5,8,8,12,12,18,20,41,45,117,135,63,68,221,255,101,110,247,255,105,114,251,255,103,113,251,255,103,112,252,255,103,111,252,255,103,110,252,255,102,110,253,255,101,111,253,255,101,111,252,255,101,111,253,255,100,110,252,255,101,111,252,255,100,112,252,255,100,110,252,255,100,110,252,255,101,110,252,255,104,113,253,255,101,112,252,255,103,113,251,255,105,112,251,255,105,114,251,255,99,109,247,255,63,68,221,255,41,45,118,135,11,12,18,18,7,5,8,10,5,5,6,8,3,3,4,4,0,0,0,0,0,0,0,0,0,0,0,0,5,5,7,8,10,10,13,16,11,12,26,28,88,93,219,255,78,84,230,255,106,116,250,255,105,114,251,255,105,114,251,255,104,113,250,255,101,112,252,255,102,112,250,255,101,111,252,255,101,111,252,255,101,111,252,255,100,110,250,255,101,111,252,255,101,111,252,255,101,111,252,255,103,112,252,255,103,112,252,255,101,112,252,255,101,112,252,255,103,113,252,255,103,111,251,255,104,113,250,255,105,114,251,255,106,116,250,255,77,86,231,255,90,93,220,255,13,11,26,29,10,10,14,16,3,4,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,6,8,10,14,14,19,20,61,65,127,145,30,36,210,255,102,110,246,255,106,116,250,255,105,114,251,255,104,113,250,255,104,113,250,255,104,111,250,255,102,114,250,255,101,112,252,255,104,113,250,255,100,112,250,255,103,112,252,255,101,112,252,255,102,110,250,255,101,112,252,255,102,112,250,255,102,112,250,255,104,111,250,255,104,113,250,255,104,111,250,255,105,114,251,255,105,114,251,255,106,114,250,255,106,114,250,255,101,109,245,255,30,36,210,255,60,63,124,144,17,15,23,24,7,6,8,10,3,5,5,6,0,0,0,0,0,0,0,0,0,0,0,0,7,7,11,12,11,12,19,19,37,38,156,186,49,54,215,255,108,115,250,255,107,116,249,255,104,115,250,255,106,114,250,255,104,113,250,255,104,113,250,255,104,113,250,255,103,112,249,255,104,113,250,255,104,113,250,255,104,113,250,255,104,113,250,255,103,114,249,255,105,114,251,255,104,113,250,255,104,113,250,255,104,113,250,255,104,115,250,255,104,113,250,255,104,113,250,255,104,113,250,255,106,116,250,255,106,116,250,255,106,116,250,255,48,53,214,255,34,38,153,183,13,13,21,21,8,9,13,14,2,3,4,5,0,0,0,0,0,0,0,0,2,4,5,5,10,11,17,18,4,4,13,14,61,62,211,255,65,71,221,255,109,117,249,255,106,116,250,255,107,114,249,255,106,116,250,255,106,116,250,255,106,114,250,255,105,115,249,255,104,115,250,255,107,114,249,255,106,114,250,255,107,116,249,255,108,117,250,255,109,117,249,255,107,114,249,255,109,117,249,255,107,116,249,255,106,114,250,255,104,115,250,255,106,116,250,255,106,114,250,255,105,115,249,255,107,114,249,255,107,116,249,255,108,117,250,255,66,72,222,255,61,62,211,255,3,4,14,14,10,11,17,18,2,3,5,5,0,0,0,0,0,0,0,0,5,4,7,8,13,12,19,21,4,6,16,16,25,25,201,255,75,81,227,255,109,117,249,255,108,118,248,255,109,117,249,255,109,115,249,255,107,118,249,255,107,116,249,255,109,117,249,255,109,117,249,255,109,119,249,255,111,118,249,255,111,118,249,255,109,117,249,255,109,119,249,255,109,119,249,255,109,119,249,255,109,119,249,255,109,117,249,255,107,116,249,255,107,116,249,255,107,116,249,255,107,116,249,255,107,116,249,255,107,118,249,255,109,117,249,255,75,81,227,255,24,25,202,255,4,6,15,16,10,11,17,18,5,4,7,8,0,0,0,0,0,0,0,0,9,10,14,16,13,16,22,23,10,10,25,29,10,9,196,255,84,92,232,255,109,119,249,255,108,118,248,255,109,119,249,255,108,118,248,255,109,119,249,255,111,118,248,255,111,120,249,255,110,120,249,255,111,119,247,255,112,122,248,255,112,122,248,255,114,121,248,255,114,121,248,255,112,122,248,255,110,121,248,255,112,120,248,255,111,120,247,255,110,120,249,255,111,120,248,255,111,120,249,255,108,118,248,255,109,117,249,255,109,119,249,255,109,119,249,255,84,92,232,255,10,11,196,255,10,10,25,29,15,14,20,22,9,10,14,16,0,0,0,0,0,0,0,0,9,10,14,16,16,17,25,26,10,12,29,32,10,9,196,255,85,90,231,255,110,119,248,255,111,120,248,255,111,118,248,255,110,118,248,255,111,119,247,255,113,120,247,255,113,122,247,255,114,123,248,255,116,124,248,255,114,123,248,255,116,124,248,255,116,124,248,255,116,124,248,255,116,124,248,255,116,124,248,255,114,125,248,255,114,123,248,255,114,121,248,255,112,122,248,255,111,120,249,255,109,118,248,255,111,120,248,255,109,117,249,255,110,119,248,255,83,91,231,255,9,10,195,255,11,10,27,30,16,17,25,26,9,10,14,15,3,5,6,7,3,4,5,5,10,9,13,15,15,14,23,24,6,7,20,20,23,23,199,255,75,82,225,255,111,119,247,255,111,119,247,255,110,121,248,255,112,120,248,255,114,121,248,255,115,123,247,255,115,123,247,255,117,124,247,255,117,126,247,255,120,128,248,255,119,127,247,255,116,126,247,255,119,128,248,255,118,127,247,255,118,127,247,255,118,125,248,255,118,125,248,255,117,126,247,255,114,123,248,255,113,122,247,255,113,122,247,255,111,121,248,255,111,119,247,255,111,121,247,255,75,80,225,255,24,24,200,255,5,7,20,20,15,14,23,24,9,8,13,14,2,3,5,5,3,4,4,5,8,8,11,13,10,11,17,18,5,5,18,19,60,60,208,255,64,69,218,255,112,122,248,255,113,120,247,255,113,120,247,255,114,123,248,255,117,124,247,255,117,126,247,255,119,127,247,255,120,127,247,255,120,127,247,255,120,129,246,255,122,130,246,255,122,130,246,255,122,130,246,255,122,130,246,255,120,129,247,255,121,127,245,255,120,128,247,255,118,127,247,255,118,125,247,255,117,126,247,255,115,123,247,255,114,121,248,255,113,122,247,255,113,120,247,255,65,70,219,255,60,60,208,255,4,5,18,19,14,14,21,23,7,6,10,11,0,0,0,0,2,3,3,5,7,9,13,14,12,12,20,21,21,23,36,37,29,30,145,178,38,46,210,255,113,122,247,255,115,123,247,255,115,123,247,255,116,125,246,255,119,127,247,255,119,128,245,255,120,129,246,255,123,130,245,255,123,130,245,255,123,132,245,255,123,130,245,255,125,133,245,255,125,131,245,255,125,131,245,255,123,130,245,255,124,131,246,255,121,131,245,255,121,129,245,255,120,130,247,255,117,126,246,255,117,124,247,255,116,123,246,255,113,124,247,255,113,120,247,255,38,44,210,255,28,29,145,177,22,23,35,38,10,13,19,20,7,7,10,12,0,0,0,0,0,0,0,0,13,14,18,19,20,19,26,28,33,33,45,48,84,84,160,184,0,0,204,255,107,116,241,255,118,124,246,255,118,126,246,255,118,127,247,255,119,128,245,255,121,131,245,255,123,132,245,255,125,131,245,255,127,134,245,255,126,133,244,255,127,134,245,255,127,134,245,255,125,135,245,255,127,134,245,255,126,133,244,255,125,133,245,255,125,131,245,255,123,132,245,255,120,130,245,255,121,127,245,255,119,128,246,255,118,126,246,255,116,125,246,255,109,115,241,255,0,0,204,255,83,84,162,185,32,33,45,47,18,21,27,28,8,7,10,11,2,3,4,4,0,0,0,0,8,7,11,11,20,18,27,29,26,27,38,39,20,22,43,47,74,80,214,255,79,87,223,255,118,126,246,255,118,128,245,255,122,127,245,255,123,130,245,255,126,131,244,255,125,133,245,255,127,136,245,255,128,133,245,255,128,137,245,255,128,136,245,255,128,136,245,255,128,136,245,255,128,136,244,255,127,135,244,255,128,135,245,255,126,136,245,255,126,133,244,255,126,131,244,255,122,129,244,255,122,127,245,255,119,128,246,255,118,126,246,255,79,85,223,255,74,80,214,255,20,22,45,48,27,29,41,41,15,16,22,23,10,8,12,13,0,0,0,0,0,0,0,0,4,5,5,6,15,16,20,23,17,18,27,28,23,24,36,38,46,48,123,144,62,68,214,255,113,121,241,255,122,129,245,255,124,130,244,255,124,132,244,255,126,133,244,255,128,135,245,255,129,134,243,255,129,138,244,255,129,136,244,255,130,137,244,255,129,138,243,255,130,137,244,255,129,137,244,255,129,136,244,255,128,138,244,255,127,137,243,255,128,135,245,255,126,134,244,255,124,132,244,255,122,129,244,255,122,129,244,255,111,120,241,255,62,68,214,255,45,50,125,146,25,26,38,41,17,18,26,28,15,16,20,23,4,5,5,6,0,0,0,0,0,0,0,0,0,0,0,0,7,8,11,12,14,14,23,23,38,40,52,56,24,26,50,55,111,114,222,255,85,93,225,255,119,127,243,255,124,130,244,255,126,133,244,255,126,136,245,255,129,136,243,255,128,138,244,255,131,137,243,255,131,139,243,255,131,139,243,255,131,139,243,255,132,139,242,255,130,139,244,255,131,137,243,255,131,139,243,255,130,137,244,255,127,135,243,255,126,136,245,255,126,133,244,255,124,132,244,255,119,127,243,255,85,93,225,255,111,117,222,255,24,25,49,54,30,31,43,45,14,14,22,23,7,8,11,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,10,14,16,22,20,28,30,27,27,37,39,41,43,57,60,61,63,115,129,97,103,222,255,98,104,230,255,122,129,244,255,124,132,244,255,127,133,244,255,129,134,243,255,129,136,244,255,131,137,244,255,131,137,243,255,131,137,243,255,131,139,243,255,131,139,243,255,131,139,243,255,131,139,244,255,129,136,244,255,129,138,244,255,129,136,244,255,127,133,244,255,126,133,244,255,122,129,244,255,98,104,230,255,97,103,222,255,61,63,115,129,42,43,58,62,26,26,37,38,21,19,26,29,10,8,11,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,6,7,14,13,17,19,11,13,19,19,39,40,53,57,52,53,69,75,50,53,116,130,96,102,224,255,103,110,233,255,123,131,243,255,125,133,244,255,128,135,244,255,129,136,244,255,129,136,244,255,131,139,243,255,131,139,243,255,131,137,243,255,131,139,243,255,131,139,243,255,131,137,243,255,129,136,244,255,130,135,244,255,127,135,243,255,125,133,244,255,124,132,244,255,103,110,233,255,96,102,224,255,50,53,116,130,54,54,73,77,35,35,46,50,15,15,23,24,12,12,15,17,3,3,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,5,8,9,17,18,24,25,27,28,38,39,31,34,46,49,55,57,74,79,51,57,116,130,113,119,228,255,105,111,233,255,122,128,242,255,126,134,245,255,127,135,243,255,129,136,243,255,129,136,243,255,131,137,244,255,131,137,243,255,131,139,243,255,131,137,244,255,129,138,243,255,130,137,244,255,127,135,243,255,126,136,245,255,121,129,241,255,105,111,233,255,113,119,229,255,51,56,115,129,53,55,72,76,31,32,45,47,25,27,35,36,18,20,24,27,7,7,9,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,6,7,8,9,12,13,12,15,20,21,27,29,38,40,37,40,54,57,54,56,73,78,56,59,106,116,109,114,208,228,104,112,232,255,115,122,237,255,124,131,242,255,128,135,245,255,129,135,243,255,129,137,244,255,129,138,244,255,129,136,243,255,129,136,244,255,129,136,243,255,126,137,242,255,124,131,242,255,113,121,237,255,105,111,233,255,109,114,208,228,56,60,107,116,55,56,74,78,34,37,51,53,33,36,45,49,17,16,22,25,8,9,12,13,5,8,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,7,9,9,15,14,19,21,17,18,25,26,36,35,48,49,41,42,56,59,53,55,72,76,26,26,49,53,65,68,132,143,115,119,215,234,110,117,235,255,113,121,237,255,118,126,238,255,122,129,240,255,122,130,241,255,122,131,240,255,122,129,240,255,119,127,239,255,114,121,236,255,110,117,235,255,115,119,215,234,62,66,129,140,27,26,50,54,55,56,74,78,46,49,63,67,33,35,45,48,17,18,25,26,13,13,18,19,4,6,7,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,4,6,4,7,8,11,11,15,16,19,21,27,28,26,28,38,40,39,39,54,56,51,50,67,71,49,51,68,72,24,25,46,48,61,62,111,120,70,73,144,156,95,100,190,204,120,125,230,249,117,124,236,255,117,125,236,255,119,128,232,250,95,102,190,204,70,74,147,157,61,62,110,120,23,24,45,47,48,50,67,71,52,52,71,74,40,42,56,58,26,28,39,40,19,22,28,29,10,9,14,14,6,7,9,10,6,8,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,4,5,10,9,13,14,22,21,28,30,25,27,35,37,33,33,46,48,41,44,58,61,50,50,66,71,57,59,75,81,51,53,70,74,16,18,34,36,18,21,38,39,21,21,40,42,20,21,39,41,19,21,38,41,17,19,36,37,52,53,71,75,55,58,74,79,55,56,73,78,42,45,59,63,37,38,52,54,27,28,38,39,17,20,25,26,9,10,13,14,6,8,9,10,4,6,6,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,8,11,11,15,14,19,21,20,22,27,29,19,20,27,28,28,29,38,40,44,44,58,61,44,45,58,61,47,47,64,67,55,57,74,79,56,56,74,79,56,56,75,79,54,55,73,77,54,55,72,77,54,55,72,77,48,48,64,68,47,48,63,66,45,46,60,64,28,29,38,40,21,21,29,30,22,23,29,32,15,14,19,21,11,9,13,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,6,7,8,7,10,11,14,13,18,20,17,17,23,24,27,26,35,37,32,32,42,44,31,33,44,45,39,39,53,56,39,40,54,56,41,42,55,58,41,42,55,59,40,42,54,58,39,39,53,56,31,33,44,46,32,32,42,44,19,20,26,27,24,22,31,33,12,12,16,17,12,12,15,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,6,7,6,8,8,9,9,8,10,12,15,16,19,22,16,17,21,24,21,20,27,29,20,23,28,30,19,21,27,28,23,23,31,33,24,26,33,35,24,25,32,35,20,23,28,30,17,18,23,25,16,17,23,24,14,14,19,20,10,10,12,14,5,6,7,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,4,5,0,0,0,0,3,4,4,5,0,0,0,0,5,6,7,8,3,4,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,6,3,4,5,6,4,4,5,6,1,3,5,5,1,3,5,5,1,3,4,6,2,4,7,8,1,3,5,5,1,2,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,7,9,3,4,5,5,3,9,16,17,17,61,86,92,20,95,134,145,28,123,175,188,38,160,222,239,38,172,238,255,37,164,231,248,32,155,218,233,28,124,176,189,22,98,136,148,15,58,82,89,3,8,13,15,3,4,5,5,3,4,4,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,7,8,3,4,5,6,5,16,22,25,18,78,109,120,37,139,193,211,30,166,234,255,34,170,238,255,35,175,243,255,39,178,245,255,42,178,246,255,36,179,246,255,33,177,245,255,36,175,242,255,37,172,239,255,32,167,234,255,32,132,184,202,15,75,106,117,4,15,21,24,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,4,5,7,8,10,12,16,53,75,85,37,127,177,198,31,163,231,255,37,172,239,255,42,181,248,255,44,185,250,255,41,186,251,255,38,184,250,255,39,185,251,255,41,186,251,255,41,184,251,255,44,185,250,255,38,186,250,255,37,182,247,255,31,173,239,255,32,163,230,255,31,119,168,189,16,55,76,86,6,9,10,11,2,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,5,8,10,12,14,18,67,96,112,43,144,202,233,33,165,233,255,44,181,246,255,39,185,251,255,38,186,250,255,39,187,251,255,43,187,251,255,41,186,251,255,39,185,251,255,41,186,251,255,40,185,250,255,39,187,251,255,43,185,251,255,47,187,251,255,43,185,251,255,37,182,247,255,36,166,232,255,46,147,205,236,16,65,93,108,6,8,9,11,2,4,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,5,3,4,5,6,8,10,12,14,18,66,96,112,48,155,218,255,36,166,232,255,41,187,249,255,43,189,251,255,43,187,251,255,41,188,251,255,41,188,251,255,41,186,251,255,37,186,251,255,41,186,251,255,41,186,251,255,37,186,251,255,43,187,251,255,38,187,252,255,41,186,251,255,41,188,251,255,47,187,251,255,44,187,250,255,32,166,232,255,48,155,218,255,17,64,93,110,5,7,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,6,6,8,10,11,19,55,77,92,52,149,209,250,35,162,229,255,43,187,251,255,41,188,251,255,43,189,251,255,42,189,252,255,41,188,251,255,43,187,251,255,41,188,251,255,40,188,252,255,41,188,251,255,40,188,252,255,45,188,251,255,39,187,251,255,43,187,251,255,39,187,251,255,41,188,251,255,41,188,251,255,43,189,251,255,42,188,250,255,34,163,228,255,50,145,204,245,19,50,73,89,4,6,7,8,3,4,4,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,4,5,5,6,8,10,11,6,18,28,32,42,116,171,211,30,150,218,255,46,188,250,255,43,189,251,255,45,190,251,255,43,189,251,255,41,188,251,255,41,188,251,255,39,187,251,255,44,188,252,255,37,186,251,255,39,189,251,255,43,187,251,255,40,188,252,255,41,188,251,255,43,187,251,255,44,188,252,255,42,189,252,255,41,188,251,255,44,190,252,255,45,188,251,255,45,189,249,255,30,150,218,255,40,116,167,209,6,15,24,28,4,6,7,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,5,5,8,11,15,15,21,66,103,131,22,126,198,255,41,183,245,255,43,191,251,255,43,189,251,255,42,189,252,255,42,189,252,255,42,189,252,255,42,189,252,255,38,189,252,255,42,189,252,255,40,188,253,255,38,190,253,255,40,188,252,255,37,188,252,255,38,190,253,255,39,189,252,255,41,188,251,255,44,190,252,255,41,190,251,255,43,191,251,255,44,190,252,255,46,191,252,255,39,182,245,255,20,125,198,255,21,65,101,129,7,12,13,15,0,0,0,0,3,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,8,9,5,11,18,22,57,131,193,251,30,149,216,255,45,192,251,255,46,191,252,255,44,190,252,255,44,190,252,255,38,191,252,255,41,190,252,255,38,190,253,255,43,190,253,255,39,190,253,255,38,189,252,255,43,190,253,255,41,189,253,255,43,190,253,255,45,191,253,255,43,190,253,255,38,191,253,255,42,189,252,255,42,191,252,255,42,191,252,255,42,191,252,255,46,193,252,255,49,192,251,255,31,150,217,255,52,126,188,246,5,13,20,24,4,6,7,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,11,14,15,27,58,90,117,1,91,177,255,46,183,244,255,44,192,252,255,44,192,252,255,44,192,252,255,44,192,253,255,44,190,252,255,41,191,253,255,41,191,253,255,43,191,253,255,39,190,253,255,43,192,253,255,39,192,253,255,41,191,253,255,37,191,253,255,41,191,253,255,39,190,253,255,45,191,253,255,43,191,253,255,40,191,253,255,43,191,253,255,44,192,252,255,46,191,252,255,46,193,252,255,42,183,244,255,1,91,177,255,25,56,88,115,8,11,13,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,7,7,5,8,11,11,9,54,107,154,1,111,189,255,48,192,252,255,46,193,252,255,41,193,253,255,44,192,253,255,40,192,253,255,43,191,253,255,45,192,253,255,43,191,253,255,44,192,254,255,45,192,253,255,43,191,253,255,45,192,253,255,41,192,253,255,44,192,254,255,43,191,253,255,39,192,253,255,43,191,253,255,43,191,253,255,41,192,253,255,45,192,253,255,40,192,253,255,46,193,252,255,42,193,252,255,44,192,252,255,0,110,188,255,9,53,106,154,5,8,11,11,3,5,6,6,0,0,0,0,0,0,0,0,0,0,0,0,3,3,5,6,7,9,13,13,0,4,10,10,31,73,152,222,9,132,203,255,48,194,252,255,41,193,254,255,44,192,253,255,47,193,253,255,44,195,254,255,45,192,253,255,45,194,253,255,42,194,254,255,44,192,253,255,41,193,254,255,42,193,253,255,44,194,253,255,46,193,253,255,44,192,253,255,47,193,253,255,47,193,253,255,44,192,254,255,42,193,254,255,46,194,254,255,45,192,253,255,43,193,253,255,48,195,253,255,46,193,252,255,48,194,252,255,15,133,203,255,35,79,158,227,0,6,10,10,7,11,13,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,9,11,13,1,6,12,12,25,49,165,255,24,147,214,255,50,195,252,255,44,194,253,255,48,194,254,255,48,195,254,255,43,195,253,255,43,193,253,255,47,193,253,255,48,194,253,255,46,195,252,255,51,196,253,255,48,196,252,255,47,196,253,255,46,195,252,255,49,197,253,255,45,195,253,255,47,196,253,255,47,193,252,255,45,194,253,255,45,194,253,255,45,194,253,255,44,195,254,255,45,194,253,255,44,194,254,255,46,195,252,255,24,147,214,255,25,53,165,255,1,7,12,12,6,9,11,12,0,0,0,0,0,0,0,0,0,0,0,0,5,6,8,8,8,12,15,16,4,11,19,21,9,9,157,255,32,162,224,255,48,196,254,255,45,196,253,255,48,197,254,255,45,194,253,255,48,196,254,255,48,196,253,255,48,196,254,255,49,197,253,255,47,198,253,255,51,198,253,255,49,197,253,255,52,198,252,255,51,198,253,255,48,198,252,255,48,196,252,255,49,197,253,255,50,197,252,255,48,197,254,255,48,197,253,255,50,197,254,255,47,195,253,255,44,197,254,255,48,196,254,255,49,195,254,255,32,162,224,255,10,11,156,255,3,10,17,20,7,10,12,13,5,6,7,8,0,0,0,0,0,0,0,0,5,6,8,8,8,11,15,16,4,12,22,24,9,9,157,255,32,162,224,255,46,197,254,255,48,197,254,255,46,198,254,255,46,197,254,255,48,196,253,255,49,199,253,255,50,197,252,255,51,198,253,255,55,198,253,255,51,200,253,255,53,201,253,255,53,201,253,255,55,200,253,255,57,199,253,255,53,199,253,255,51,200,253,255,49,199,253,255,51,198,253,255,49,199,253,255,46,198,255,255,48,196,254,255,49,196,253,255,46,198,254,255,48,196,254,255,28,162,224,255,9,9,157,255,3,11,18,21,7,11,14,14,4,6,7,7,2,4,4,4,0,0,0,0,4,5,6,7,7,11,15,15,0,6,13,13,24,37,166,255,0,147,214,255,49,199,253,255,49,200,255,255,48,199,254,255,49,199,254,255,51,200,253,255,51,200,253,255,51,200,253,255,55,200,253,255,53,201,253,255,57,203,253,255,57,201,253,255,54,201,252,255,57,203,253,255,58,201,252,255,57,201,253,255,55,202,253,255,53,201,253,255,51,200,253,255,51,200,253,255,49,199,253,255,49,199,254,255,50,200,254,255,48,199,254,255,50,200,254,255,0,147,214,255,24,41,166,255,0,7,13,13,6,10,13,13,4,7,8,8,0,0,0,0,0,0,0,0,4,5,7,7,6,9,12,13,0,6,12,13,25,63,149,217,0,132,204,255,49,200,255,255,52,201,254,255,49,199,254,255,51,200,255,255,55,200,253,255,52,201,254,255,55,202,253,255,59,204,253,255,57,203,253,255,57,203,253,255,61,203,253,255,59,204,253,255,57,203,253,255,60,205,254,255,56,205,254,255,61,203,253,255,58,204,254,255,57,203,253,255,55,202,253,255,53,201,253,255,51,200,253,255,49,199,255,255,52,200,254,255,50,200,254,255,0,134,204,255,26,63,148,217,0,6,12,13,6,10,13,13,4,5,6,7,0,0,0,0,0,0,0,0,3,4,6,7,6,9,12,13,12,18,25,26,10,52,109,156,1,109,189,255,52,201,254,255,50,201,254,255,48,202,255,255,51,202,253,255,56,203,254,255,55,202,253,255,58,204,254,255,59,204,253,255,60,205,254,255,59,204,253,255,61,205,253,255,64,205,254,255,63,206,252,255,63,204,253,255,59,204,253,255,60,205,254,255,55,204,253,255,57,205,253,255,54,204,254,255,53,203,253,255,54,200,254,255,51,200,254,255,49,202,255,255,50,202,254,255,1,109,189,255,10,52,109,156,11,17,23,23,5,9,12,12,4,5,6,7,0,0,0,0,0,0,0,0,3,4,5,6,9,10,14,15,17,22,28,29,30,63,98,124,1,88,179,255,48,193,246,255,54,201,254,255,55,202,255,255,54,204,254,255,55,204,253,255,56,205,254,255,60,205,254,255,62,206,254,255,63,206,253,255,63,208,253,255,62,208,254,255,64,207,254,255,62,208,254,255,64,207,254,255,65,207,253,255,62,206,254,255,62,206,254,255,60,207,254,255,57,205,253,255,58,204,254,255,54,204,254,255,55,202,255,255,50,204,254,255,49,192,247,255,0,89,178,255,29,64,99,126,15,20,25,26,8,11,14,14,3,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,10,13,17,18,17,22,29,29,8,19,32,35,52,133,198,255,0,155,218,255,51,202,255,255,54,204,254,255,57,205,253,255,60,205,254,255,62,206,254,255,61,207,253,255,62,208,254,255,64,207,254,255,66,208,254,255,65,208,252,255,64,209,254,255,66,210,254,255,64,209,254,255,64,208,252,255,66,208,254,255,63,208,253,255,63,206,253,255,62,206,254,255,56,205,254,255,56,205,254,255,54,204,254,255,51,202,255,255,1,155,217,255,52,133,198,255,8,21,32,34,16,22,27,28,8,11,13,14,3,5,5,5,0,0,0,0,0,0,0,0,0,0,0,0,9,11,14,15,9,13,17,18,13,19,25,27,7,60,99,126,0,130,200,255,50,197,248,255,56,207,254,255,58,208,254,255,56,207,254,255,61,207,253,255,64,209,254,255,65,209,253,255,66,210,254,255,64,211,254,255,68,211,254,255,66,210,252,255,68,211,253,255,64,211,253,255,66,210,254,255,64,209,254,255,64,209,254,255,62,208,254,255,60,209,254,255,60,207,254,255,56,207,254,255,58,206,254,255,50,197,248,255,0,130,200,255,7,62,101,128,13,19,25,27,8,13,17,17,8,11,13,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,6,7,6,9,13,13,20,27,33,34,10,26,38,43,53,148,199,240,25,163,221,255,55,204,253,255,57,207,253,255,60,207,254,255,60,209,254,255,66,210,254,255,62,210,254,255,66,210,254,255,64,211,254,255,66,212,252,255,68,211,254,255,68,211,252,255,68,211,254,255,68,211,254,255,66,210,254,255,66,210,254,255,64,209,254,255,60,209,254,255,62,208,254,255,58,208,254,255,55,204,253,255,25,163,221,255,53,147,199,240,10,26,38,43,16,23,28,29,7,10,13,14,2,3,4,5,2,3,3,5,0,0,0,0,0,0,0,0,0,0,0,0,4,4,5,6,10,13,16,18,16,20,26,27,26,33,42,44,26,72,98,112,35,161,215,255,46,177,232,255,61,205,253,255,58,208,254,255,64,209,254,255,64,209,254,255,66,210,254,255,67,211,254,255,66,210,254,255,69,212,254,255,63,211,254,255,67,211,254,255,63,211,254,255,67,211,254,255,66,210,254,255,64,211,254,255,66,210,254,255,64,209,254,255,60,207,254,255,59,206,253,255,44,178,232,255,35,161,215,255,27,75,101,116,25,34,41,43,14,21,25,25,10,13,16,17,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,8,10,12,8,11,15,15,21,27,34,36,28,36,44,47,26,88,118,134,46,165,220,255,46,183,236,255,57,207,253,255,64,209,254,255,62,210,254,255,64,209,254,255,64,211,254,255,67,211,254,255,66,210,254,255,68,211,254,255,68,210,253,255,66,210,254,255,66,210,254,255,64,209,254,255,66,210,254,255,64,209,254,255,58,208,254,255,59,206,253,255,46,183,235,255,46,165,220,255,25,85,114,131,28,36,44,47,17,22,28,30,7,11,14,14,5,7,8,8,3,4,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,11,13,15,14,19,23,24,19,26,32,34,29,37,46,49,24,80,108,121,56,164,212,239,48,184,234,255,58,202,250,255,62,210,254,255,64,209,254,255,66,210,254,255,64,211,254,255,68,211,254,255,68,210,253,255,66,210,254,255,68,211,254,255,64,211,254,255,68,211,254,255,64,209,254,255,62,210,254,255,59,202,249,255,49,185,235,255,58,166,214,241,24,80,107,122,28,38,46,48,19,25,31,34,14,19,23,24,9,11,13,15,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,7,9,9,13,16,16,14,19,24,24,21,28,35,37,26,35,42,44,23,65,88,97,48,142,182,201,48,183,234,255,54,194,242,255,60,205,250,255,66,210,254,255,65,209,252,255,64,209,254,255,64,211,254,255,66,210,254,255,66,210,254,255,66,210,254,255,65,209,253,255,59,205,251,255,53,194,243,255,51,183,235,255,49,146,186,204,24,69,90,99,30,39,48,51,23,30,37,40,16,21,26,27,8,10,12,15,4,6,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,8,9,9,9,13,16,16,17,24,29,30,21,28,33,35,30,40,47,51,10,30,40,43,28,92,118,129,52,157,199,214,54,188,238,255,54,194,242,255,59,198,245,255,60,202,248,255,63,204,249,255,60,204,248,255,61,202,247,255,58,200,246,255,54,192,242,255,52,187,238,255,50,155,195,209,28,91,118,128,10,29,40,41,29,38,46,48,25,33,40,42,18,23,29,31,11,15,19,20,5,7,8,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,9,10,11,10,14,18,18,17,24,28,31,21,29,34,36,25,33,40,42,27,37,45,47,9,25,35,36,28,78,100,105,32,109,139,147,47,151,187,199,57,179,222,236,62,193,240,255,61,192,239,253,58,179,224,238,46,147,184,196,32,111,141,150,28,78,100,106,9,25,34,36,26,34,42,44,27,35,43,46,21,29,35,36,15,22,28,28,12,17,20,21,5,7,8,8,0,0,0,0,3,5,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,7,8,8,7,9,11,12,14,19,23,24,17,23,28,29,24,32,39,41,25,34,42,43,29,37,45,47,27,35,44,46,7,17,25,26,7,17,25,27,7,17,26,26,7,17,26,27,7,18,27,28,6,14,22,23,28,38,46,48,28,37,45,47,29,37,45,49,24,32,39,41,20,27,34,35,14,19,23,24,11,15,18,18,5,7,8,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,10,11,12,11,15,17,18,11,14,18,18,14,19,23,24,23,31,37,39,24,32,39,40,27,36,43,45,29,38,46,49,29,38,46,49,30,39,47,50,29,38,46,49,28,36,44,46,31,41,49,52,26,36,43,45,24,32,38,40,21,29,35,36,13,17,21,21,10,14,17,17,11,15,17,18,5,7,8,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,5,5,6,0,0,0,0,7,9,11,12,9,11,14,16,11,15,18,19,15,20,24,25,18,24,29,30,18,24,29,30,22,29,35,36,24,32,38,40,22,29,35,36,21,30,36,36,18,24,29,31,18,24,29,30,16,22,26,27,11,15,17,18,9,11,14,15,7,9,11,12,5,7,8,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,9,10,12,8,12,14,15,9,12,14,15,11,14,17,18,11,14,17,18,11,15,18,18,11,15,18,18,11,14,17,19,11,14,17,19,9,12,14,15,9,11,13,15,5,7,9,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,4,0,0,0,0,0,0,0,0,3,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,4,0,0,0,0,3,3,2,4,0,0,0,0,3,3,2,4,3,3,2,4,0,0,0,0,3,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,4,5,5,4,8,3,3,2,4,0,0,0,0,0,0,0,0,2,4,1,5,2,4,1,6,0,0,0,0,0,0,0,0,5,5,4,7,3,3,2,4,0,0,0,0,3,3,2,4,3,3,2,4,3,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,5,4,3,2,6,3,13,5,17,17,71,35,94,19,110,48,146,28,145,63,190,36,184,84,241,35,196,89,255,37,191,85,251,32,181,82,237,27,146,65,192,21,111,48,146,17,69,33,93,3,13,6,17,5,6,5,9,4,5,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,5,3,3,2,5,5,19,8,24,19,88,41,119,39,161,78,214,29,190,83,255,33,193,85,255,33,197,89,255,37,201,89,255,39,202,89,255,34,200,90,255,34,199,88,255,34,197,88,255,36,195,86,255,31,191,83,255,36,157,72,208,18,87,40,119,4,18,9,24,5,5,4,8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,4,6,5,5,4,8,5,7,4,7,18,64,33,87,40,144,74,199,36,186,84,255,38,194,88,255,42,205,96,255,45,208,95,255,40,208,96,255,38,206,96,255,40,208,96,255,41,207,97,255,41,207,97,255,44,208,96,255,40,206,96,255,38,204,94,255,35,195,87,255,34,185,84,255,36,140,68,194,20,65,33,88,5,7,4,7,3,3,2,4,0,0,0,0,0,0,0,0,3,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,4,8,8,11,8,13,22,76,35,110,53,170,87,239,36,189,86,255,47,201,96,255,43,206,97,255,42,207,96,255,44,206,97,255,45,207,97,255,45,207,97,255,44,206,97,255,44,206,96,255,44,206,96,255,43,208,97,255,45,207,97,255,48,206,97,255,47,206,97,255,40,204,96,255,39,188,86,255,55,172,89,241,19,75,36,108,9,11,8,14,3,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,4,6,6,5,8,7,9,6,11,22,75,37,113,53,175,89,255,43,187,87,255,48,206,100,255,49,209,101,255,49,207,101,255,47,207,99,255,48,208,100,255,47,207,99,255,45,207,97,255,49,206,99,255,48,207,98,255,44,207,98,255,49,208,99,255,46,207,100,255,48,207,98,255,49,207,101,255,53,207,101,255,50,207,100,255,39,187,87,255,53,175,89,255,21,74,36,110,7,9,6,11,3,3,2,5,3,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,5,3,3,2,5,7,9,6,11,27,65,36,95,64,172,96,255,43,183,87,255,51,207,103,255,50,208,102,255,52,207,102,255,50,208,102,255,50,208,102,255,52,207,102,255,50,207,100,255,51,208,101,255,50,207,100,255,50,208,102,255,52,208,100,255,48,208,100,255,51,208,101,255,49,207,101,255,51,208,101,255,51,208,101,255,53,208,103,255,53,206,103,255,42,182,86,255,64,172,96,255,26,63,36,95,5,7,4,8,3,3,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,2,4,5,7,4,8,8,20,12,31,60,146,85,224,39,171,79,255,59,206,105,255,55,208,105,255,57,208,103,255,55,209,103,255,53,208,103,255,52,207,102,255,51,208,101,255,55,207,103,255,50,206,102,255,52,209,102,255,54,208,102,255,52,207,102,255,52,207,102,255,55,207,103,255,55,207,103,255,55,208,105,255,53,206,103,255,56,208,104,255,56,208,104,255,58,207,104,255,40,172,80,255,59,144,83,222,8,21,12,31,5,7,4,8,3,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,13,9,16,26,80,40,132,31,149,63,255,57,202,103,255,59,209,107,255,59,209,107,255,58,208,106,255,58,208,106,255,59,206,105,255,59,208,105,255,55,208,105,255,57,207,105,255,58,208,106,255,54,207,104,255,55,208,105,255,54,207,104,255,55,208,105,255,54,207,104,255,57,206,103,255,59,208,105,255,56,207,106,255,58,208,106,255,59,209,107,255,61,209,109,255,55,201,103,255,29,148,63,255,26,79,40,132,8,11,8,14,3,3,2,4,4,5,4,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,3,5,8,10,7,12,8,17,9,25,69,154,91,255,43,169,79,255,63,208,111,255,63,208,109,255,63,210,109,255,63,208,109,255,58,209,108,255,59,209,107,255,58,208,106,255,59,207,107,255,58,208,106,255,58,206,106,255,62,208,106,255,59,208,105,255,62,208,106,255,62,208,106,255,61,208,107,255,59,207,107,255,60,208,108,255,60,208,108,255,61,209,109,255,62,209,108,255,63,210,109,255,66,210,110,255,42,169,80,255,69,154,91,255,8,17,10,26,5,7,4,8,4,5,4,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,3,5,11,13,10,16,45,84,54,134,6,120,38,255,65,200,107,255,65,210,111,255,65,208,111,255,65,208,111,255,66,208,110,255,65,209,109,255,64,209,110,255,63,210,109,255,64,209,110,255,61,209,109,255,65,209,109,255,61,209,109,255,64,207,110,255,61,209,109,255,63,208,109,255,62,208,110,255,65,207,109,255,64,209,110,255,63,208,109,255,65,208,111,255,66,208,110,255,67,208,111,255,67,208,111,255,63,201,107,255,8,121,38,255,43,82,51,129,12,17,13,19,4,4,3,5,4,4,3,5,0,0,0,0,0,0,0,0,0,0,0,0,4,6,3,6,9,14,10,18,23,88,31,170,26,136,54,255,71,208,113,255,69,210,113,255,68,209,114,255,68,209,113,255,65,210,111,255,67,210,113,255,69,208,113,255,68,208,112,255,67,208,113,255,68,210,112,255,68,210,112,255,69,208,113,255,67,208,111,255,68,209,114,255,68,210,112,255,65,209,113,255,68,210,112,255,68,210,112,255,66,208,112,255,68,210,112,255,66,210,114,255,71,210,113,255,69,210,115,255,68,209,114,255,26,134,54,255,23,87,30,169,7,12,9,15,6,8,5,9,0,0,0,0,0,0,0,0,0,0,0,0,4,5,4,6,9,12,9,15,1,9,3,10,55,127,55,248,37,153,68,255,74,209,116,255,71,210,117,255,72,208,116,255,73,208,115,255,69,210,115,255,71,209,115,255,70,210,114,255,70,208,114,255,71,209,115,255,69,209,117,255,71,209,115,255,72,210,116,255,74,209,116,255,73,208,115,255,73,208,115,255,73,210,115,255,71,209,115,255,68,208,116,255,72,210,115,255,71,209,115,255,70,208,114,255,72,210,114,255,72,208,116,255,74,209,116,255,38,154,70,255,56,129,57,250,1,8,3,9,9,11,9,15,3,5,4,6,0,0,0,0,3,3,2,4,3,3,2,4,8,13,9,16,2,9,3,12,24,100,24,255,47,164,81,255,78,210,118,255,75,210,117,255,76,211,118,255,77,209,117,255,73,209,117,255,75,210,117,255,76,209,118,255,77,210,119,255,77,210,119,255,80,210,120,255,78,209,120,255,79,210,121,255,77,210,119,255,78,211,120,255,76,210,120,255,77,210,119,255,77,210,119,255,75,210,117,255,74,210,118,255,75,210,117,255,75,209,119,255,75,209,119,255,74,210,118,255,75,209,119,255,46,165,80,255,24,102,24,255,3,10,4,14,8,10,7,13,3,3,2,4,0,0,0,0,0,0,0,0,5,7,4,7,9,13,9,15,6,17,7,24,9,85,9,255,56,176,92,255,79,210,121,255,78,209,120,255,79,210,121,255,78,210,122,255,79,210,121,255,82,210,122,255,81,212,123,255,82,211,124,255,82,211,124,255,83,211,124,255,84,211,125,255,83,212,124,255,84,211,126,255,81,211,124,255,82,212,124,255,82,211,124,255,83,211,123,255,82,212,122,255,82,210,122,255,81,211,121,255,80,210,120,255,77,211,121,255,80,210,120,255,80,210,120,255,56,176,92,255,10,84,10,255,6,17,7,24,10,16,12,18,4,5,2,6,0,0,0,0,0,0,0,0,5,7,4,7,12,17,13,20,7,18,8,26,9,83,9,255,59,176,93,255,82,211,124,255,84,211,122,255,84,210,124,255,82,211,124,255,83,210,124,255,85,212,126,255,86,210,126,255,86,212,126,255,90,211,128,255,88,212,128,255,90,213,128,255,90,213,128,255,89,213,129,255,90,211,128,255,88,212,128,255,87,213,127,255,86,212,126,255,86,210,126,255,85,212,126,255,83,211,126,255,82,211,124,255,84,210,124,255,82,211,124,255,83,211,123,255,56,177,94,255,9,83,9,255,6,17,7,24,12,17,13,20,5,7,4,7,3,3,2,5,4,5,4,6,4,6,3,7,9,15,11,17,3,13,5,16,23,99,23,255,50,165,84,255,85,210,126,255,87,210,127,255,86,210,126,255,87,212,128,255,90,211,128,255,89,211,129,255,92,213,130,255,93,212,131,255,92,214,132,255,96,213,134,255,95,214,133,255,93,213,133,255,96,213,134,255,95,212,133,255,94,213,132,255,93,213,133,255,92,214,132,255,92,213,130,255,89,211,129,255,88,212,128,255,87,211,127,255,87,213,126,255,85,210,126,255,87,211,125,255,50,165,84,255,24,98,24,255,2,13,6,18,10,15,12,18,3,5,3,5,4,5,4,6,3,3,2,5,6,8,5,10,9,14,10,16,1,12,4,15,60,132,60,255,43,152,73,255,88,212,128,255,90,211,128,255,91,210,129,255,91,213,131,255,96,212,132,255,93,213,133,255,96,214,135,255,98,212,134,255,97,214,135,255,98,213,136,255,101,214,136,255,101,215,137,255,98,215,136,255,99,214,138,255,98,213,136,255,99,213,135,255,98,213,135,255,98,213,135,255,97,213,133,255,95,213,131,255,91,211,131,255,90,212,130,255,90,211,128,255,90,211,128,255,43,152,73,255,60,132,60,255,2,11,3,14,13,18,14,22,6,8,5,10,0,0,0,0,3,3,2,4,4,5,2,5,10,15,11,18,17,25,17,30,32,94,32,182,32,135,58,255,93,212,131,255,93,212,131,255,93,213,133,255,97,213,133,255,99,213,135,255,100,214,137,255,102,214,138,255,103,213,139,255,103,215,139,255,103,214,141,255,104,216,140,255,105,215,141,255,106,215,140,255,105,215,141,255,104,214,140,255,103,215,139,255,102,214,138,255,102,214,138,255,100,215,138,255,97,213,136,255,97,212,135,255,97,213,133,255,93,212,131,255,93,210,131,255,32,133,58,255,32,94,31,181,15,24,16,28,7,11,7,13,4,6,3,6,0,0,0,0,0,0,0,0,7,9,6,10,14,18,14,20,26,33,27,39,71,117,81,170,1,118,27,255,88,202,124,255,98,213,135,255,100,214,136,255,101,214,138,255,102,215,138,255,104,214,140,255,106,216,142,255,107,215,143,255,109,216,143,255,109,216,143,255,109,215,145,255,110,215,144,255,109,215,145,255,110,217,144,255,111,215,143,255,108,216,144,255,107,215,143,255,107,216,141,255,104,214,140,255,103,214,139,255,102,214,138,255,100,214,136,255,96,213,134,255,90,203,124,255,0,119,26,255,72,118,81,171,25,31,25,37,15,20,16,22,0,0,0,0,3,3,2,4,0,0,0,0,5,5,4,6,14,19,15,21,19,28,22,31,15,32,19,41,73,153,93,255,63,168,93,255,99,213,138,255,102,214,139,255,106,213,140,255,108,215,142,255,110,215,144,255,111,216,145,255,111,217,146,255,112,216,147,255,114,217,147,255,113,216,147,255,114,216,149,255,116,217,148,255,112,218,147,255,112,215,147,255,112,216,147,255,110,217,147,255,111,216,145,255,110,215,144,255,105,215,141,255,106,213,140,255,103,213,140,255,99,212,138,255,63,169,95,255,74,154,94,255,15,32,20,42,20,28,22,31,12,14,11,18,5,5,4,6,0,0,0,0,0,0,0,0,4,4,3,6,14,15,12,20,15,21,15,25,22,31,24,38,39,89,50,144,46,148,74,255,96,206,132,255,105,213,141,255,108,216,144,255,110,214,146,255,112,216,147,255,114,218,149,255,115,216,149,255,117,217,149,255,116,217,150,255,118,216,150,255,118,218,150,255,118,218,150,255,116,217,150,255,116,217,150,255,115,216,149,255,114,217,148,255,114,217,148,255,113,217,148,255,110,214,146,255,107,215,143,255,107,214,141,255,97,205,133,255,48,147,74,255,40,90,51,144,20,31,24,36,13,19,13,21,12,14,11,18,6,5,4,8,0,0,0,0,0,0,0,0,4,4,3,5,5,8,5,9,10,15,11,17,29,38,30,43,23,38,25,53,100,174,120,255,69,173,101,255,105,213,141,255,110,215,144,255,112,215,146,255,114,218,149,255,117,217,150,255,117,216,151,255,118,216,150,255,118,217,152,255,119,217,151,255,120,218,152,255,120,218,152,255,120,218,152,255,120,218,152,255,118,218,150,255,119,217,151,255,117,215,149,255,114,218,150,255,114,216,146,255,110,215,144,255,105,213,141,255,69,173,101,255,100,174,120,255,23,38,25,53,27,34,28,40,9,13,9,15,4,5,2,6,4,4,3,5,0,0,0,0,0,0,0,0,0,0,0,0,6,7,6,9,16,22,18,25,23,30,25,35,38,48,41,57,59,97,69,131,86,172,110,255,83,188,115,255,109,214,143,255,112,215,146,255,115,216,148,255,115,217,150,255,118,217,151,255,118,216,150,255,118,217,152,255,120,218,152,255,117,217,152,255,119,218,152,255,118,217,152,255,119,217,151,255,118,216,150,255,117,216,151,255,116,217,149,255,115,216,148,255,111,215,146,255,109,214,143,255,83,188,115,255,85,172,111,255,60,98,70,134,33,44,37,51,22,30,24,33,16,22,18,25,5,5,4,6,0,0,0,0,0,0,0,0,0,0,0,0,3,4,3,4,7,6,5,8,10,12,9,14,12,16,12,20,32,41,33,47,44,57,48,65,45,93,59,133,83,177,111,255,89,193,121,255,110,215,144,255,113,216,147,255,115,216,150,255,115,216,149,255,118,216,150,255,119,217,151,255,119,217,151,255,120,218,152,255,119,217,151,255,120,218,152,255,118,216,150,255,118,218,150,255,117,217,150,255,114,215,149,255,111,215,147,255,110,213,144,255,88,193,122,255,83,177,111,255,45,91,56,129,46,58,49,68,31,38,32,45,13,18,14,21,7,9,6,10,6,7,6,9,4,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,5,4,7,17,18,15,22,25,31,25,35,26,36,29,42,46,58,50,67,47,95,61,130,100,187,126,255,90,192,122,255,107,210,141,255,113,216,147,255,116,216,148,255,117,217,149,255,117,216,151,255,119,217,151,255,118,216,150,255,117,218,151,255,119,217,151,255,116,217,150,255,118,217,150,255,115,216,149,255,113,217,148,255,107,210,141,255,91,193,123,255,101,189,128,255,47,95,61,130,46,58,50,67,26,36,29,42,23,30,24,33,17,18,15,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,3,2,4,6,8,5,8,12,17,13,20,25,33,27,37,32,43,36,51,45,57,48,65,55,92,65,119,101,177,125,230,89,191,121,255,100,202,132,255,110,213,144,255,115,216,149,255,117,215,149,255,115,216,149,255,116,217,150,255,117,217,149,255,117,215,149,255,117,215,150,255,115,215,148,255,110,212,144,255,99,202,133,255,91,192,121,255,101,177,125,230,54,92,63,117,49,60,51,70,31,41,34,49,27,34,28,39,12,16,12,18,6,8,5,8,4,3,2,4,4,3,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,3,6,13,16,13,18,13,18,14,21,32,40,35,47,39,49,41,56,46,59,51,68,24,42,29,54,55,105,72,138,106,187,131,237,97,196,127,255,99,202,133,255,105,207,137,255,108,209,142,255,111,211,143,255,109,210,143,255,109,209,141,255,104,207,138,255,99,200,133,255,95,197,127,255,107,188,132,239,56,106,71,139,23,41,28,52,50,62,53,73,43,55,47,63,29,37,31,42,14,20,16,23,13,16,13,18,4,4,3,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,4,3,6,7,10,7,11,18,23,19,26,22,30,24,35,33,44,38,50,42,53,45,62,44,56,48,67,20,34,23,43,57,98,69,122,61,121,79,154,86,162,110,205,110,200,138,251,106,203,136,255,104,202,136,255,109,200,139,252,86,161,109,205,61,123,81,156,57,97,69,121,21,37,24,45,45,58,49,68,43,56,47,64,39,49,40,56,21,29,22,32,17,23,19,25,7,10,7,11,0,0,0,0,3,4,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,3,2,4,9,11,8,13,15,20,16,22,25,31,25,36,27,34,28,40,35,45,39,53,41,53,46,61,50,61,54,72,47,59,50,69,15,27,18,35,17,28,19,37,17,30,20,37,16,28,19,36,16,27,18,35,15,26,17,33,47,59,50,69,53,65,57,76,50,62,54,73,35,45,39,53,29,38,31,44,22,28,22,31,17,22,18,25,6,8,5,9,5,5,4,7,3,3,3,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,4,6,8,9,7,11,9,12,9,13,16,18,15,21,18,24,20,28,24,31,25,34,35,45,37,51,39,49,43,57,40,52,43,60,45,58,49,67,50,63,55,74,50,62,54,73,47,60,52,70,49,61,52,72,47,59,50,68,41,54,44,61,39,49,42,56,34,43,35,48,24,30,25,35,19,23,20,28,17,20,17,24,9,12,9,13,6,5,5,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,7,7,10,5,4,4,7,12,14,10,16,18,21,17,25,22,27,24,32,25,32,27,36,27,35,29,40,28,36,30,41,36,46,37,52,40,51,43,58,31,41,33,45,34,44,36,50,27,34,28,39,24,30,24,35,25,32,26,36,18,24,20,27,19,25,21,28,5,7,5,7,8,11,8,12,0,0,0,0,3,3,4,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,3,2,4,5,5,4,6,5,5,4,7,8,7,6,9,10,12,8,13,13,16,13,19,18,22,19,26,19,23,19,27,19,23,19,27,23,27,24,33,21,26,22,30,23,27,23,32,19,23,19,27,14,16,13,20,16,17,14,21,11,12,9,14,8,7,6,9,5,5,4,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,26,26,28,26,26,26,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,33,33,36,236,236,236,255,130,129,128,146,231,230,229,255,230,226,226,255,230,226,226,255,230,226,226,255,228,227,226,255,231,230,229,255,130,129,128,146,236,236,236,255,33,33,33,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,51,51,56,152,152,152,171,227,226,225,255,225,221,221,255,229,225,225,255,233,229,229,255,235,231,231,255,234,233,232,255,234,233,232,255,235,231,231,255,233,229,229,255,229,225,225,255,225,221,221,255,227,226,225,255,155,154,153,173,58,58,58,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,234,234,234,255,225,224,223,255,223,219,219,255,230,226,226,255,236,235,234,255,240,236,236,255,240,236,236,255,240,236,236,255,238,237,236,255,238,237,236,255,238,237,236,255,240,236,236,255,238,237,236,255,238,234,234,255,230,226,226,255,223,219,219,255,225,224,223,255,234,234,234,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,133,132,131,153,219,215,215,255,224,220,220,255,236,232,232,255,238,237,236,255,238,237,236,255,239,237,235,255,238,235,236,255,239,235,235,255,239,235,235,255,239,235,235,255,239,235,235,255,239,237,235,255,239,235,235,255,238,237,236,255,238,237,236,255,237,233,233,255,224,220,220,255,219,215,215,255,138,137,136,158,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,138,137,161,212,208,208,255,223,219,219,255,238,234,234,255,238,235,236,255,237,236,235,255,238,237,236,255,238,237,236,255,237,234,235,255,239,235,235,255,238,234,234,255,239,235,235,255,238,234,234,255,238,234,234,255,237,236,235,255,238,237,236,255,240,236,236,255,239,235,235,255,239,237,235,255,223,220,220,255,213,209,209,255,139,138,137,161,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,229,229,229,255,210,206,206,255,221,217,217,255,239,235,235,255,238,237,236,255,239,235,235,255,239,235,235,255,237,236,235,255,237,236,235,255,238,234,234,255,238,234,234,255,238,234,234,255,238,234,234,255,238,234,234,255,238,234,234,255,237,236,235,255,237,236,235,255,239,235,235,255,237,236,235,255,238,237,236,255,238,235,236,255,221,217,217,255,210,206,206,255,231,230,229,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,56,56,62,211,207,207,255,211,207,207,255,237,233,233,255,238,234,234,255,239,235,235,255,237,236,235,255,238,234,234,255,236,235,234,255,237,233,233,255,237,233,233,255,236,235,234,255,237,233,233,255,235,234,233,255,237,233,233,255,237,233,233,255,236,235,234,255,236,235,234,255,238,234,234,255,237,236,235,255,239,235,235,255,238,234,234,255,237,233,233,255,211,207,207,255,211,207,207,255,63,63,63,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,9,9,10,0,0,0,0,0,0,0,0,0,0,0,0,140,139,138,171,195,191,191,255,233,228,229,255,237,236,235,255,238,234,234,255,238,234,234,255,236,233,234,255,236,235,234,255,235,234,233,255,237,233,233,255,236,232,232,255,236,232,232,255,237,233,233,255,237,233,233,255,234,233,232,255,236,232,232,255,237,233,232,255,235,234,233,255,238,234,234,255,237,233,233,255,238,234,234,255,237,236,235,255,239,235,235,255,234,230,230,255,195,191,191,255,143,142,141,174,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,59,59,63,0,0,0,0,34,34,34,37,43,43,44,48,200,196,196,255,209,205,205,255,237,235,233,255,237,233,233,255,236,235,234,255,234,233,233,255,236,232,233,255,234,232,231,255,235,233,232,255,234,233,233,255,235,231,231,255,235,231,231,255,235,231,231,255,235,231,232,255,235,231,231,255,235,231,231,255,235,233,232,255,236,232,232,255,233,232,231,255,236,232,232,255,235,234,233,255,236,233,234,255,238,234,234,255,238,236,234,255,210,205,206,255,199,195,195,255,49,49,49,55,0,0,0,0,25,24,24,27,0,0,0,0,35,36,35,38,0,0,0,0,59,59,59,63,59,59,59,63,0,0,0,0,222,221,221,255,182,177,176,255,231,227,227,255,238,234,234,255,237,233,233,255,235,234,233,255,236,232,232,255,234,233,232,255,235,231,231,255,235,231,231,255,235,231,232,255,233,232,231,255,233,232,231,255,233,232,231,255,233,232,232,255,233,232,232,255,233,232,231,255,233,232,231,255,235,231,231,255,235,231,231,255,234,233,232,255,235,231,231,255,236,232,232,255,237,233,233,255,238,234,234,255,231,227,227,255,181,177,177,255,223,222,221,255,0,0,0,0,47,46,46,49,59,59,59,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,128,127,126,172,191,186,185,255,237,233,233,255,237,233,233,255,236,232,232,255,234,233,232,255,235,231,231,255,235,231,231,255,233,232,231,255,233,232,231,255,235,231,231,255,233,232,231,255,235,231,231,255,233,232,231,255,235,231,231,255,233,232,231,255,233,232,231,255,233,232,231,255,233,232,231,255,233,232,231,255,235,231,231,255,235,231,231,255,234,233,232,255,236,232,232,255,235,234,233,255,237,233,233,255,189,185,185,255,125,124,123,169,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,192,189,189,255,200,196,196,255,235,234,233,255,236,232,232,255,236,232,232,255,236,232,232,255,234,233,232,255,234,233,232,255,233,232,231,255,234,233,232,255,235,231,231,255,235,231,231,255,235,234,233,255,234,233,232,255,234,233,232,255,234,233,232,255,235,231,231,255,235,231,231,255,235,231,231,255,236,232,232,255,233,232,231,255,234,233,232,255,236,232,232,255,234,233,232,255,234,233,232,255,235,234,233,255,199,195,195,255,192,189,189,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,177,173,173,255,208,204,204,255,234,233,232,255,234,231,232,255,235,231,231,255,234,233,232,255,233,232,231,255,236,232,232,255,235,231,231,255,236,234,232,255,234,233,232,255,236,232,232,255,236,232,232,255,235,232,233,255,235,234,233,255,236,232,232,255,236,232,232,255,237,233,233,255,235,231,231,255,236,232,232,255,235,231,231,255,235,231,231,255,233,232,231,255,236,232,232,255,234,233,232,255,234,233,232,255,208,204,204,255,180,175,174,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,14,14,16,171,167,167,255,213,211,209,255,234,233,232,255,234,233,231,255,234,233,232,255,234,233,232,255,235,231,231,255,236,232,232,255,235,234,233,255,237,233,233,255,235,234,233,255,237,233,233,255,237,233,233,255,237,233,233,255,237,233,233,255,237,233,233,255,235,234,233,255,235,234,233,255,234,233,232,255,234,233,232,255,235,231,231,255,236,232,232,255,233,232,231,255,234,233,232,255,236,232,232,255,235,233,231,255,214,210,210,255,173,168,167,255,21,21,21,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,14,14,16,14,14,14,16,20,20,20,24,172,167,166,255,213,209,209,255,235,231,231,255,233,233,231,255,234,232,231,255,236,231,231,255,235,231,232,255,235,231,232,255,236,232,232,255,236,232,232,255,236,234,232,255,235,234,233,255,237,234,233,255,238,234,234,255,238,234,234,255,237,233,233,255,236,235,234,255,236,235,234,255,237,233,233,255,234,233,232,255,234,233,233,255,235,231,232,255,235,231,231,255,233,232,231,255,233,232,231,255,235,231,231,255,212,208,208,255,172,167,166,255,13,13,13,16,14,14,14,16,14,14,14,16,14,14,14,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,177,173,173,255,205,201,201,255,233,232,231,255,233,232,231,255,233,232,231,255,235,233,231,255,234,233,232,255,235,234,233,255,237,233,233,255,236,235,234,255,238,234,234,255,236,235,234,255,237,236,235,255,239,235,235,255,237,236,235,255,237,236,235,255,236,235,234,255,238,234,234,255,236,235,234,255,237,233,233,255,235,234,233,255,234,233,232,255,235,231,231,255,233,232,231,255,233,232,231,255,233,232,231,255,205,201,201,255,176,172,172,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,191,187,187,255,199,194,193,255,234,230,230,255,233,230,231,255,233,232,231,255,234,233,232,255,236,232,232,255,237,233,233,255,236,235,234,255,238,234,234,255,239,235,235,255,237,234,235,255,237,236,235,255,237,236,235,255,237,236,235,255,237,236,235,255,238,237,236,255,237,236,235,255,237,236,235,255,236,235,234,255,237,233,233,255,236,234,232,255,235,231,231,255,235,231,231,255,233,232,231,255,234,230,230,255,197,195,193,255,191,187,187,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,123,122,121,169,186,182,182,255,234,230,230,255,233,232,231,255,235,231,231,255,236,232,232,255,237,233,233,255,236,235,234,255,237,234,235,255,239,235,235,255,238,237,236,255,239,235,235,255,239,235,235,255,238,237,236,255,238,237,236,255,240,236,236,255,238,237,236,255,238,237,236,255,239,235,235,255,238,234,234,255,236,235,234,255,235,234,233,255,235,234,233,255,234,233,232,255,235,231,231,255,235,231,231,255,186,182,182,255,123,122,121,169,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,221,220,219,255,179,174,173,255,227,223,223,255,234,233,231,255,236,232,232,255,236,232,232,255,237,233,233,255,238,234,234,255,239,235,235,255,237,236,235,255,240,236,236,255,239,238,237,255,238,237,236,255,238,237,236,255,239,238,237,255,239,238,236,255,238,237,236,255,240,236,236,255,237,236,235,255,237,236,234,255,238,234,234,255,236,235,234,255,236,232,232,255,236,232,232,255,234,233,232,255,228,224,224,255,177,173,173,255,220,220,220,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,16,17,18,0,0,0,0,38,38,38,43,196,192,192,255,204,200,200,255,233,232,231,255,234,233,232,255,236,232,232,255,236,235,234,255,236,236,234,255,238,234,234,255,239,235,236,255,239,237,235,255,238,237,236,255,237,237,236,255,240,237,236,255,238,238,236,255,238,238,236,255,238,237,236,255,238,237,236,255,237,236,235,255,238,234,234,255,236,235,234,255,236,235,234,255,236,231,231,255,235,233,232,255,233,233,231,255,204,201,200,255,196,194,192,255,37,36,36,41,0,0,0,0,0,0,0,0,29,29,30,32,0,0,0,0,0,0,0,0,16,17,16,18,16,17,16,18,0,0,0,0,0,0,0,0,125,124,123,157,190,186,186,255,229,224,224,255,234,233,232,255,236,232,232,255,236,235,234,255,237,236,235,255,237,236,235,255,239,235,235,255,238,237,236,255,238,237,236,255,240,236,236,255,240,236,236,255,239,237,235,255,241,236,236,255,238,238,236,255,238,237,236,255,239,235,235,255,238,236,234,255,236,235,235,255,236,235,234,255,234,233,232,255,234,233,232,255,229,225,225,255,190,186,186,255,126,125,124,158,0,0,0,0,0,0,0,0,28,28,28,30,17,18,17,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,54,54,54,61,207,203,203,255,206,202,202,255,234,232,230,255,235,234,233,255,236,235,234,255,237,236,235,255,237,236,235,255,239,237,235,255,238,237,236,255,240,236,236,255,240,236,236,255,239,238,237,255,240,236,236,255,240,238,236,255,238,237,236,255,238,237,236,255,239,235,235,255,237,236,235,255,237,236,235,255,236,235,234,255,237,233,233,255,234,230,230,255,206,204,202,255,207,203,203,255,57,57,57,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,10,11,11,227,227,227,255,206,202,202,255,216,212,212,255,234,233,232,255,236,235,234,255,237,236,235,255,237,236,235,255,239,235,235,255,238,237,236,255,240,236,236,255,240,238,236,255,240,236,236,255,239,238,237,255,240,236,236,255,241,237,237,255,238,237,236,255,238,235,236,255,237,236,235,255,237,236,235,255,236,235,234,255,234,233,232,255,216,212,212,255,206,202,202,255,227,227,227,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,29,30,32,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,15,16,17,0,0,0,0,126,126,126,151,208,204,204,255,220,216,216,255,236,234,232,255,237,236,235,255,238,234,234,255,240,236,236,255,239,237,237,255,238,237,236,255,241,237,237,255,239,238,237,255,240,239,238,255,240,236,236,255,238,237,236,255,239,238,237,255,239,235,235,255,238,234,234,255,237,236,235,255,236,232,232,255,220,216,216,255,208,204,204,255,120,119,118,142,0,0,0,0,0,0,0,0,0,0,0,0,22,21,21,23,0,0,0,0,0,0,0,0,0,0,0,0,28,28,28,31,28,28,28,31,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,16,16,18,52,52,52,56,133,132,131,155,213,212,211,255,220,216,216,255,233,229,229,255,238,234,234,255,237,236,235,255,238,237,236,255,238,236,235,255,238,237,236,255,237,236,235,255,239,235,235,255,238,237,236,255,238,236,235,255,238,237,236,255,237,237,235,255,239,235,235,255,234,230,230,255,220,217,216,255,216,212,212,255,131,129,128,152,0,0,0,0,0,0,0,0,0,0,0,0,43,43,43,46,12,12,12,13,29,29,29,32,0,0,0,0,0,0,0,0,21,20,20,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,19,19,21,0,0,0,0,231,231,231,255,223,219,219,255,219,215,215,255,227,223,223,255,236,232,232,255,240,235,236,255,240,235,235,255,238,237,236,255,238,237,236,255,238,236,235,255,239,235,235,255,238,237,236,255,237,236,235,255,236,232,232,255,227,226,223,255,219,215,214,255,223,220,220,255,231,229,228,251,0,0,0,0,0,0,0,0,52,52,52,56,16,16,16,18,0,0,0,0,43,43,43,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,38,38,43,153,152,151,172,224,223,223,255,223,219,219,255,227,223,223,255,231,227,227,255,232,231,230,255,234,230,230,255,233,232,231,255,232,231,230,255,232,227,227,255,228,223,223,255,223,219,219,255,225,223,223,255,149,148,147,168,38,36,36,41,0,0,0,0,0,0,0,0,0,0,0,0,12,13,12,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,26,26,28,235,235,235,255,140,139,138,158,229,228,227,255,225,225,224,255,227,223,223,255,227,223,223,255,228,224,224,255,229,228,227,255,142,141,140,160,235,235,235,255,26,26,26,28,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,21,21,23,23,23,23,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,16,16,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,13,14,14,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,5,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,57,57,61,0,0,0,0,0,0,0,0,39,39,39,43,0,0,0,0,0,0,0,0,26,26,26,29,0,0,0,0,81,81,81,86,81,81,81,86,0,0,0,0,43,43,43,46,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,43,43,43,46,0,0,0,0,47,47,48,51,0,0,0,0,52,52,52,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,52,52,56,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,26,26,28,29,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
+ { 1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,5,9,4,4,5,9,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,12,74,74,75,225,96,96,95,163,138,138,138,252,167,167,167,255,180,180,180,255,180,180,180,255,168,168,168,255,139,139,140,252,96,96,96,162,74,74,74,223,7,7,7,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,11,11,28,66,66,66,141,122,122,123,255,155,155,156,255,150,150,150,255,140,140,141,255,133,133,134,255,128,128,128,255,128,128,128,255,133,133,134,255,140,140,141,255,151,151,151,255,155,155,156,255,122,122,123,255,66,66,66,139,9,9,9,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,43,43,44,128,101,101,102,255,132,132,133,255,119,119,120,255,106,106,106,255,84,84,85,255,83,83,83,255,83,83,83,255,83,83,83,255,83,83,84,255,83,83,84,255,83,83,84,255,84,84,85,255,106,106,106,255,120,120,121,255,130,130,131,255,102,102,104,255,42,42,43,124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,4,0,0,0,0,1,1,2,4,1,1,2,4,0,0,0,0,0,0,0,0,47,47,47,119,106,106,106,255,112,112,112,255,97,97,97,255,83,83,83,255,83,83,83,255,83,83,83,255,83,83,83,255,83,83,83,255,83,83,84,255,83,83,83,255,83,83,83,255,83,83,84,255,82,82,83,255,83,83,83,255,83,83,83,255,99,99,99,255,111,111,112,255,106,106,106,255,46,46,48,118,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,4,2,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,43,43,43,114,103,103,104,255,100,100,101,255,86,86,87,255,83,83,83,255,82,82,83,255,83,83,83,255,83,83,83,255,83,83,84,255,83,83,83,255,83,83,83,255,83,83,84,255,83,83,84,255,83,83,83,255,83,83,83,255,83,83,84,255,83,83,83,255,82,82,83,255,87,87,89,255,101,101,102,255,103,104,104,255,43,43,44,115,1,1,2,4,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,1,1,2,4,32,32,34,99,92,92,93,255,96,96,96,255,85,85,86,255,82,82,83,255,81,81,82,255,83,83,83,255,82,82,82,255,82,82,82,255,82,82,82,255,83,82,82,255,82,82,82,255,82,82,84,255,82,82,84,255,82,82,82,255,82,82,82,255,82,82,82,255,82,82,82,255,83,83,83,255,82,82,83,255,84,84,85,255,96,96,97,255,91,92,92,255,32,32,33,99,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,18,73,73,74,219,92,92,93,255,84,84,85,255,82,82,82,255,82,82,82,255,82,82,82,255,82,82,82,255,82,82,82,255,82,82,82,255,82,82,83,255,82,82,83,255,82,82,83,255,82,82,83,255,82,82,83,255,82,82,82,255,82,82,83,255,82,82,82,255,82,82,82,255,81,81,82,255,82,82,82,255,81,81,82,255,83,83,85,255,93,93,95,255,73,73,75,221,6,6,7,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,4,0,0,0,0,0,0,0,0,41,41,42,123,91,91,92,255,85,85,86,255,81,81,82,255,81,81,82,255,82,82,82,255,82,82,82,255,82,82,82,255,82,82,83,255,82,82,83,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,81,255,81,81,81,255,82,82,83,255,82,82,82,255,81,81,82,255,81,82,82,255,81,81,82,255,85,85,86,255,92,92,93,255,42,42,43,126,1,1,2,4,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,4,4,4,13,72,72,73,223,86,86,86,255,80,80,81,255,81,81,82,255,82,82,82,255,80,80,81,255,81,81,81,255,81,81,81,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,82,255,81,81,82,255,80,80,81,255,85,85,87,255,72,72,73,227,6,6,5,17,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,29,29,30,94,85,85,85,255,82,82,83,255,81,81,82,255,81,81,82,255,80,80,81,255,81,81,81,255,81,81,81,255,81,81,82,255,81,81,82,255,81,81,81,255,81,81,82,255,81,81,82,255,81,81,83,255,81,81,81,255,81,81,82,255,81,81,82,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,80,80,81,255,81,81,82,255,81,82,82,255,85,85,87,255,27,27,28,87,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,43,43,44,134,82,82,83,255,80,80,81,255,79,79,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,82,255,81,81,82,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,80,80,81,255,80,80,81,255,80,80,81,255,80,80,81,255,82,82,83,255,45,45,47,142,2,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,58,58,58,186,79,79,80,255,80,79,80,255,80,80,81,255,80,80,81,255,80,80,81,255,81,81,81,255,80,80,81,255,81,81,81,255,81,81,81,255,81,80,80,255,80,80,81,255,81,81,81,255,80,80,81,255,80,80,81,255,80,80,81,255,80,80,81,255,80,80,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,80,80,81,255,80,80,81,255,80,80,81,255,79,79,80,255,80,80,81,255,57,57,58,181,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,70,70,71,227,79,79,80,255,79,79,80,255,79,79,80,255,80,80,81,255,80,80,81,255,80,80,81,255,81,81,80,255,80,80,81,255,79,79,80,255,79,79,81,255,80,81,81,255,79,79,80,255,79,79,80,255,79,79,80,255,79,79,80,255,79,79,80,255,81,80,81,255,79,79,79,255,80,80,81,255,80,80,81,255,79,79,80,255,80,80,81,255,80,80,81,255,80,80,81,255,79,79,80,255,79,79,80,255,70,70,71,227,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,72,72,232,79,79,80,255,79,79,81,255,79,79,81,255,79,79,80,255,78,78,79,255,80,80,81,255,79,79,80,255,79,79,80,255,79,79,80,255,78,78,79,255,78,78,79,255,78,78,79,255,78,78,79,255,78,78,79,255,78,78,79,255,78,78,79,255,79,79,80,255,79,79,80,255,79,79,80,255,79,79,80,255,80,80,81,255,79,79,80,255,79,79,80,255,79,79,80,255,79,79,80,255,79,79,80,255,73,73,74,234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,73,73,74,234,79,79,80,255,79,79,81,255,78,78,79,255,79,79,81,255,79,78,79,255,78,78,79,255,79,79,80,255,78,78,79,255,78,79,78,255,77,77,78,255,77,77,79,255,78,78,79,255,77,77,79,255,78,78,79,255,77,77,78,255,77,77,79,255,77,77,79,255,77,77,78,255,78,78,79,255,78,78,79,255,79,79,80,255,78,78,79,255,78,78,79,255,79,79,80,255,79,79,80,255,78,78,79,255,74,74,75,241,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,71,71,73,236,77,77,78,255,77,77,78,255,78,78,79,255,77,77,78,255,78,78,80,255,78,78,79,255,77,77,79,255,77,78,77,255,77,77,78,255,77,77,78,255,77,77,78,255,77,77,78,255,77,77,77,255,77,77,79,255,77,77,78,255,77,77,79,255,77,77,78,255,77,78,78,255,77,77,79,255,77,78,78,255,78,78,79,255,78,78,80,255,78,78,79,255,77,77,78,255,78,78,79,255,78,78,80,255,69,69,70,225,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,56,56,181,79,79,79,255,77,77,79,255,78,77,78,255,77,77,78,255,78,78,79,255,77,77,78,255,77,77,78,255,77,76,77,255,77,77,78,255,77,77,77,255,77,77,77,255,77,77,77,255,76,76,77,255,76,76,77,255,77,77,77,255,77,77,78,255,77,77,77,255,77,77,79,255,76,76,78,255,76,76,77,255,77,77,78,255,77,77,78,255,77,77,78,255,77,77,78,255,77,77,78,255,78,78,79,255,56,56,56,182,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,3,3,2,9,0,0,0,0,0,0,0,0,43,43,43,138,79,79,80,255,77,77,78,255,76,76,77,255,76,76,78,255,76,76,77,255,77,77,78,255,76,76,76,255,77,77,77,255,76,76,77,255,76,76,76,255,75,75,76,255,76,76,77,255,75,75,76,255,75,75,76,255,75,75,77,255,75,75,77,255,76,76,77,255,76,76,77,255,76,76,77,255,76,77,77,255,76,76,77,255,77,77,78,255,76,77,77,255,77,77,77,255,77,77,78,255,79,79,80,255,43,43,43,138,0,0,0,0,2,1,1,5,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,2,1,1,5,29,29,29,95,82,82,82,255,78,78,79,255,76,76,77,255,76,76,77,255,76,76,77,255,76,76,76,255,76,76,76,255,76,76,77,255,76,76,77,255,75,75,76,255,75,75,76,255,74,74,75,255,75,75,77,255,74,74,75,255,75,75,76,255,75,76,76,255,75,75,76,255,76,76,77,255,76,76,77,255,75,75,76,255,76,76,77,255,76,76,77,255,76,76,77,255,76,76,78,255,79,79,79,255,81,81,82,255,29,29,29,95,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,5,1,1,2,5,1,1,2,5,0,0,0,0,0,0,0,0,6,6,5,19,69,69,70,227,82,82,82,255,75,76,76,255,75,75,76,255,76,76,76,255,76,76,76,255,75,75,76,255,75,75,75,255,75,75,76,255,74,74,75,255,75,75,76,255,74,74,75,255,74,75,74,255,74,74,75,255,74,74,75,255,74,74,76,255,75,75,76,255,74,74,75,255,75,75,76,255,76,76,77,255,76,76,76,255,76,76,76,255,75,75,76,255,75,75,76,255,81,81,82,255,67,68,66,216,6,6,5,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,37,37,38,116,86,86,87,255,79,79,80,255,75,75,75,255,76,76,76,255,75,76,76,255,74,74,75,255,75,75,76,255,74,74,75,255,74,74,75,255,74,74,75,255,74,74,76,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,74,74,75,255,74,74,75,255,75,75,76,255,74,74,75,255,75,75,76,255,75,75,76,255,75,75,75,255,80,80,81,255,86,86,87,255,39,39,39,122,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,4,0,0,0,0,0,0,0,0,6,6,6,21,70,70,70,225,88,88,88,255,78,78,79,255,75,75,76,255,75,75,76,255,74,74,74,255,75,75,76,255,74,74,75,255,74,74,75,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,75,255,73,73,74,255,74,74,75,255,74,74,75,255,74,74,75,255,74,74,75,255,76,76,76,255,78,78,79,255,87,87,88,255,69,69,69,219,6,6,5,18,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,30,31,99,85,85,86,255,89,89,90,255,78,77,78,255,75,75,76,255,75,74,75,255,74,74,75,255,74,74,75,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,74,74,75,255,74,74,75,255,74,74,74,255,74,74,75,255,77,77,79,255,89,89,90,255,86,86,87,255,30,30,29,97,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,5,40,40,42,116,95,95,96,255,94,94,94,255,80,79,80,255,74,74,75,255,75,75,76,255,74,74,75,255,75,74,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,74,255,73,73,75,255,73,73,74,255,73,73,74,255,74,74,75,255,74,74,75,255,74,74,75,255,80,80,80,255,94,94,94,255,96,96,96,255,40,40,42,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,5,0,0,0,0,0,0,0,0,0,0,0,0,46,46,47,125,98,98,99,255,102,102,104,255,91,91,92,255,76,75,76,255,75,74,75,255,74,74,75,255,74,74,75,255,73,73,75,255,73,73,74,255,73,73,74,255,73,73,74,255,74,74,76,255,74,74,75,255,74,74,76,255,75,75,77,255,90,90,91,255,103,103,104,255,99,99,100,255,44,44,44,118,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,1,5,42,42,43,137,95,95,95,255,124,124,124,255,110,110,110,255,95,95,95,255,76,76,77,255,73,73,74,255,74,74,76,255,73,73,74,255,74,74,75,255,73,73,74,255,74,74,75,255,76,76,76,255,96,96,96,255,110,110,110,255,123,123,123,255,96,96,97,255,42,42,43,135,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,7,7,8,21,63,63,63,146,115,115,116,255,147,147,147,255,142,142,143,255,132,132,132,255,124,124,124,255,119,119,119,255,117,117,117,255,125,125,125,255,132,132,133,255,141,141,142,255,147,147,147,255,115,115,116,255,63,63,63,146,8,9,8,23,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,4,15,77,77,77,255,91,91,90,162,132,132,132,255,159,159,159,255,171,171,171,255,172,172,172,255,160,160,160,255,132,132,132,254,92,92,92,167,76,76,76,255,6,6,7,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,5,10,3,3,3,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,1,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,1,7,0,0,0,0 },
+};
+static const unsigned char MAC27_LIGHTS_1X[5][18 * 18 * 4] = {
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,2,2,1,1,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,1,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,4,4,7,7,7,8,16,18,7,8,17,18,4,3,6,7,0,0,0,0,0,0,0,0,0,0,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,17,18,40,43,54,60,140,146,77,84,202,208,92,101,235,240,90,99,234,239,77,86,203,208,55,60,140,147,18,19,41,44,0,0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,46,49,106,115,91,99,234,245,101,111,255,255,102,112,255,255,101,112,255,255,101,112,255,255,102,113,255,255,101,111,255,255,91,99,234,244,47,48,106,115,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,49,51,109,122,95,103,246,255,103,113,255,255,101,111,249,251,101,111,251,253,101,111,252,254,101,111,252,254,100,110,251,253,101,111,249,251,103,113,255,255,96,104,246,255,48,50,109,121,0,0,0,0,0,0,2,2,0,0,0,1,0,1,2,2,0,0,0,0,22,23,49,56,89,95,232,254,104,113,253,255,102,111,250,252,101,111,252,255,101,111,253,255,101,110,252,255,101,111,252,255,101,111,252,255,102,112,253,255,102,111,249,252,105,114,252,255,87,95,231,253,23,24,50,57,0,0,0,0,1,1,2,3,0,0,1,2,2,2,2,2,51,54,144,169,97,106,248,255,105,115,248,251,103,112,250,255,102,112,251,255,101,112,251,255,101,111,251,255,101,111,252,255,102,112,251,255,103,112,251,255,103,112,251,255,106,114,248,251,97,105,248,255,51,53,143,168,3,3,3,3,1,2,3,4,0,0,0,0,10,11,21,24,56,60,197,231,106,114,250,255,106,115,249,254,105,114,250,255,104,114,250,255,105,114,250,255,106,115,250,255,106,115,250,255,106,114,250,255,105,114,250,255,105,114,250,255,106,115,249,254,105,115,250,255,56,60,197,230,11,12,22,25,0,0,0,0,3,3,3,3,11,12,28,36,61,66,208,244,109,119,251,255,108,117,248,254,108,117,249,255,110,118,249,255,111,119,248,255,112,120,249,255,111,120,249,255,110,120,248,255,109,118,249,255,109,118,249,255,107,116,248,254,109,119,251,255,61,66,209,245,11,11,27,35,3,3,3,3,5,5,6,6,12,12,30,37,60,65,207,244,111,120,250,255,110,119,247,254,113,121,247,255,115,123,247,255,117,125,248,255,117,126,248,255,117,126,248,255,116,125,248,255,116,124,248,255,113,122,248,255,111,120,247,254,111,120,250,255,60,65,207,244,12,11,30,37,6,7,7,7,5,5,6,7,16,16,29,33,56,60,195,232,111,120,247,255,115,123,246,254,117,126,247,255,120,128,246,255,122,130,246,255,123,131,245,255,123,131,246,255,122,129,246,255,120,129,246,255,118,126,247,255,115,123,246,254,111,120,247,255,57,58,195,232,16,17,29,33,3,3,4,4,6,6,8,9,22,22,27,27,53,56,151,180,104,111,241,255,121,129,244,251,122,129,244,255,125,133,245,255,127,134,245,255,127,135,245,255,127,135,245,255,127,134,244,255,125,133,245,255,122,129,244,255,121,128,244,251,103,111,241,255,54,56,153,182,20,21,26,26,5,5,7,8,2,2,3,3,12,12,15,15,36,38,70,80,94,100,226,255,123,130,245,255,126,133,242,253,128,136,244,255,130,137,244,255,130,138,243,255,130,138,243,255,130,138,244,255,128,136,244,255,126,133,242,253,122,130,245,255,94,101,226,255,35,37,69,78,11,12,14,14,2,2,3,4,0,0,0,0,11,10,15,16,29,30,38,39,68,72,132,150,104,111,236,255,126,134,246,255,128,135,241,251,130,137,242,253,131,138,242,254,131,139,242,254,130,137,242,253,128,135,241,251,127,135,246,255,104,111,236,255,68,71,132,149,29,29,36,38,10,9,13,15,0,0,0,0,0,0,0,0,2,2,3,3,16,18,24,25,34,36,46,48,72,75,133,147,108,115,228,247,125,132,247,255,130,137,247,255,131,138,245,255,131,138,245,255,130,138,246,255,124,132,247,255,108,115,228,247,72,76,133,147,35,36,46,48,17,18,24,26,2,3,3,4,0,0,0,0,0,0,0,0,0,0,0,0,6,5,8,8,21,21,29,30,37,38,48,49,52,53,84,91,79,83,154,167,98,103,198,213,111,119,224,239,112,119,224,240,98,104,199,213,79,82,154,167,52,53,85,91,38,40,50,52,20,22,29,31,6,7,9,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,4,6,7,20,20,27,29,30,31,39,41,42,43,53,56,43,45,62,66,43,44,66,71,42,44,65,70,44,45,62,66,43,44,55,58,32,33,42,44,20,21,28,30,5,5,7,8,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,5,6,6,12,12,16,17,24,24,32,34,30,31,40,43,34,35,44,46,35,36,46,49,30,31,40,42,23,23,31,33,12,12,16,18,3,3,4,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,2,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,3,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,0,0,0,2,3,5,6,4,10,14,16,5,10,15,18,1,1,2,3,0,0,0,0,0,0,0,0,0,1,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,10,26,37,42,23,94,132,145,29,139,194,207,37,164,227,239,34,162,225,237,30,140,194,207,20,92,129,141,8,24,34,40,0,0,0,0,0,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,23,67,94,110,37,161,224,243,40,185,253,255,41,188,254,255,40,186,253,255,40,187,253,255,41,188,254,255,40,186,253,255,35,160,222,241,22,67,94,109,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,3,0,0,0,0,26,67,96,116,41,171,237,255,42,190,253,255,41,186,248,251,41,186,249,253,40,186,250,254,41,186,250,254,41,185,249,253,42,185,248,251,43,190,253,255,41,171,237,255,24,64,92,112,0,0,0,0,0,1,2,2,0,0,0,0,0,1,1,2,0,0,0,0,14,26,41,52,37,149,213,249,44,191,253,255,42,188,249,252,41,188,251,255,41,188,252,255,39,188,252,255,41,188,252,255,41,188,252,255,42,188,251,255,42,188,249,252,44,192,254,255,37,148,212,248,12,25,37,49,0,0,0,0,0,1,2,2,0,0,1,2,0,0,0,0,29,73,119,160,42,180,243,255,44,192,250,250,42,190,252,255,41,190,253,255,41,190,253,255,41,190,253,255,41,190,253,255,41,191,253,255,42,190,253,255,41,190,252,255,45,192,250,250,42,180,244,255,26,72,117,158,0,0,0,0,0,1,1,2,0,0,0,0,5,4,11,14,20,98,163,216,44,192,253,255,44,192,252,253,44,192,253,255,44,192,253,255,43,192,253,255,43,193,253,255,44,192,253,255,44,192,253,255,43,192,253,255,43,192,253,255,45,193,252,253,44,192,252,255,21,98,164,217,5,6,10,14,0,0,0,0,0,0,0,0,8,0,17,29,25,117,189,244,46,197,255,255,47,194,253,254,46,195,253,255,47,195,253,255,48,197,253,255,49,197,253,255,49,197,253,255,48,196,253,255,47,195,253,255,47,195,253,255,45,194,253,254,47,197,255,255,25,118,189,244,7,0,16,27,0,0,0,0,1,1,1,1,8,0,18,30,20,116,189,244,47,201,255,255,48,197,253,254,50,198,253,255,52,199,253,255,54,201,253,255,54,201,253,255,56,201,253,255,54,201,253,255,52,200,253,255,49,199,253,255,48,197,253,254,48,200,255,255,20,116,188,243,7,0,17,28,1,2,2,2,1,2,2,2,8,8,16,20,20,97,164,217,49,200,254,255,51,200,253,253,54,202,253,255,57,203,253,255,59,204,253,255,61,204,253,255,61,205,253,255,59,204,254,255,57,204,253,255,54,202,253,255,51,200,253,253,49,200,255,255,20,97,164,217,7,8,16,19,1,2,2,2,2,2,3,4,8,10,10,10,27,76,125,165,44,188,245,255,55,205,251,251,58,204,253,255,62,206,254,255,64,207,254,255,64,208,254,255,64,208,254,255,64,207,253,255,62,207,254,255,58,204,253,255,55,204,251,251,44,188,245,255,27,76,125,165,7,9,9,9,2,4,4,5,0,1,1,2,5,6,7,7,20,36,54,66,35,162,219,253,57,209,255,255,60,206,252,253,64,209,253,255,65,210,254,255,67,211,253,255,67,211,253,255,66,210,254,255,64,209,254,255,61,207,252,253,57,208,255,255,36,162,220,254,19,36,53,65,5,6,6,6,1,2,2,3,0,0,0,0,5,6,8,9,15,18,22,22,37,88,118,138,46,186,239,255,62,211,255,255,64,208,251,251,66,209,252,253,67,210,253,254,66,210,253,254,66,209,252,253,65,208,251,251,62,210,255,255,46,186,239,255,36,88,117,138,14,17,19,19,5,7,8,9,0,0,0,0,0,0,0,0,0,0,0,0,9,12,14,15,19,23,28,28,37,86,112,127,47,178,225,242,61,209,255,255,66,212,255,255,67,212,255,255,67,212,255,255,66,213,255,255,60,208,255,255,48,179,226,242,39,88,114,129,19,23,28,29,8,11,13,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,11,15,18,19,18,23,26,27,27,50,64,69,38,113,145,155,47,160,199,209,54,185,228,238,54,185,228,238,47,159,200,209,37,113,144,154,27,49,63,69,20,24,29,29,12,16,20,21,1,2,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,2,2,10,14,17,18,16,19,23,24,21,24,29,30,23,32,40,42,23,36,46,49,22,35,46,49,23,32,40,43,21,25,29,31,16,20,24,24,10,15,18,19,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,4,6,7,8,12,17,20,21,15,20,24,25,18,23,27,28,17,22,26,27,16,21,25,26,11,16,19,20,4,6,7,8,1,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 },
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,2,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,3,0,1,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,1,2,0,0,0,0,0,0,0,0,2,3,2,5,4,11,5,15,4,11,5,15,2,3,2,5,0,0,0,0,0,0,0,0,1,2,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,0,0,0,0,10,30,14,41,24,109,50,146,28,158,70,207,34,187,84,239,32,185,83,238,29,159,71,207,22,108,49,144,11,30,15,43,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,0,0,0,0,26,77,39,110,41,183,87,244,42,208,96,255,43,210,97,255,42,208,97,255,42,208,97,255,43,210,97,255,42,208,96,255,39,182,85,243,26,77,39,110,0,0,0,0,1,1,1,2,0,0,0,1,0,0,0,0,0,0,0,0,1,2,1,4,0,0,0,0,32,78,43,118,49,192,94,255,50,210,102,255,49,205,100,251,49,206,99,253,49,206,99,254,49,207,99,254,48,206,99,253,50,205,100,251,51,210,102,255,49,192,94,255,31,77,43,117,0,0,0,0,0,1,1,3,0,0,0,0,0,1,1,2,0,0,0,0,16,31,18,52,51,172,87,252,58,210,107,255,56,206,104,252,55,207,103,255,55,207,104,255,54,207,104,255,54,208,103,255,54,207,103,255,56,207,104,255,56,206,104,252,58,210,106,255,50,172,87,252,16,31,18,52,0,0,0,0,0,1,1,2,0,1,0,2,0,0,0,0,38,93,50,165,58,198,102,255,64,209,111,250,63,208,109,255,62,209,108,255,61,208,108,255,61,208,108,255,61,208,108,255,61,208,108,255,62,208,108,255,62,208,109,255,65,209,110,250,59,198,102,255,37,92,49,164,0,0,0,0,1,2,1,3,0,0,0,0,8,12,8,19,39,127,56,226,69,208,113,255,70,208,114,254,68,209,113,255,69,209,113,255,69,209,114,255,70,209,114,255,70,208,114,255,70,209,114,255,69,209,114,255,68,209,113,255,70,209,114,254,69,208,114,255,38,127,56,225,9,12,8,19,0,0,0,0,1,1,1,1,9,12,6,30,42,138,66,245,78,212,120,255,77,209,119,254,77,210,119,255,79,210,121,255,80,210,122,255,81,211,122,255,80,211,122,255,79,211,121,255,79,210,120,255,78,210,119,255,77,209,119,254,77,212,120,255,41,139,66,245,9,11,6,30,0,0,0,0,2,2,2,2,8,13,7,32,42,138,68,244,84,212,125,255,85,210,125,254,87,211,127,255,89,212,129,255,91,213,130,255,92,213,131,255,92,212,131,255,90,213,130,255,89,212,129,255,87,211,127,255,84,210,125,254,84,213,125,255,42,138,68,244,9,13,8,32,3,3,3,3,3,4,3,4,13,20,13,28,48,132,63,232,89,210,128,255,94,212,131,254,97,213,134,255,99,213,136,255,101,214,138,255,102,215,139,255,102,215,139,255,101,214,138,255,100,214,137,255,97,213,134,255,94,212,132,254,90,210,128,255,48,131,62,232,13,20,13,28,1,2,2,2,3,4,3,6,15,19,16,19,47,103,59,177,86,199,122,255,103,215,140,251,106,214,141,255,109,216,144,255,111,216,145,255,112,216,146,255,112,216,146,255,110,216,145,255,109,216,144,255,105,214,141,255,104,214,140,251,86,199,122,255,48,104,59,177,14,17,14,17,3,3,2,4,2,3,2,4,9,10,9,10,32,52,36,76,81,177,109,255,107,216,143,255,113,215,147,253,116,217,149,255,117,216,150,255,119,217,151,255,119,218,151,255,117,217,150,255,116,216,149,255,113,215,147,253,107,216,143,255,81,177,110,255,31,51,36,75,7,8,7,8,3,3,2,5,0,1,0,1,8,11,8,13,25,31,26,33,62,105,73,148,90,195,123,255,114,218,148,255,116,214,149,251,118,215,150,253,119,217,152,254,119,217,152,254,118,216,150,253,116,214,149,251,113,217,148,255,90,195,123,255,62,104,73,147,24,29,25,31,7,9,7,11,0,0,0,0,0,0,0,0,2,1,1,3,15,18,14,22,29,37,32,41,65,108,77,145,95,193,126,249,111,216,145,255,117,218,151,255,118,218,151,255,118,218,151,255,117,218,151,255,110,216,145,255,96,193,126,248,66,109,78,146,29,37,32,41,14,18,14,21,2,1,0,2,0,0,0,1,0,0,0,0,0,0,0,0,4,4,3,5,18,23,19,27,32,40,35,44,46,68,52,86,71,130,89,166,87,170,114,214,100,194,131,240,100,194,131,240,87,170,114,214,72,131,90,168,47,70,53,87,34,42,36,47,17,23,19,26,4,5,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,6,4,7,16,20,16,24,25,31,26,34,35,43,38,48,38,50,41,59,38,54,43,66,37,52,41,63,38,50,41,59,37,45,39,50,26,32,27,36,16,20,16,23,4,4,3,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,5,4,4,6,11,12,9,15,20,25,20,29,25,31,26,36,31,38,33,43,30,37,32,42,24,29,24,34,19,23,19,27,9,12,9,14,2,2,2,3,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0 },
+ { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,3,3,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,7,7,7,8,18,18,18,21,18,18,18,21,7,7,7,8,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,0,0,0,0,0,0,0,0,55,55,55,62,168,167,167,188,207,204,204,228,224,221,220,245,223,221,220,245,207,204,204,228,168,167,167,188,56,56,56,64,0,0,0,0,0,0,0,0,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,138,136,136,157,234,231,231,255,239,237,236,255,241,238,238,255,240,237,237,255,240,237,237,255,241,238,237,255,239,237,236,255,235,232,231,255,139,138,137,159,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135,134,134,159,227,223,223,255,238,235,235,254,236,234,233,252,236,234,234,254,237,233,233,254,238,233,233,254,236,234,233,254,236,234,233,252,238,235,235,253,227,224,224,255,136,134,134,159,0,0,0,0,0,0,0,1,0,0,0,0,6,6,6,7,0,0,0,0,52,52,51,64,221,217,217,255,237,234,234,254,237,234,234,254,236,234,233,255,236,233,233,255,237,233,233,255,236,233,233,255,236,233,233,255,236,234,233,255,237,234,234,254,237,234,234,253,222,218,218,255,54,54,53,66,0,0,0,0,3,3,3,4,28,28,28,30,25,25,25,25,150,147,147,190,229,225,225,255,236,234,233,252,234,232,232,255,235,232,232,255,234,232,232,255,234,231,231,255,234,231,232,255,234,232,231,255,235,232,231,255,234,232,231,255,237,233,233,252,230,226,225,255,149,147,147,190,16,16,16,16,24,24,24,26,0,0,0,0,10,10,10,13,179,176,176,232,236,233,233,255,235,232,231,254,234,232,231,255,234,232,231,255,234,231,231,255,234,232,232,255,234,232,232,255,234,231,231,255,234,231,231,255,234,232,231,255,234,232,231,254,235,233,232,255,178,176,175,231,10,10,10,13,0,0,0,0,0,0,0,0,9,8,8,19,188,185,184,244,236,234,233,255,234,231,231,254,235,232,232,255,236,233,232,255,236,233,232,255,236,233,233,255,236,233,233,255,236,233,233,255,235,232,232,255,235,231,231,255,233,231,231,254,236,234,234,255,189,185,184,244,10,10,10,20,0,0,0,0,0,0,0,0,14,14,14,24,187,183,182,243,235,234,233,255,233,231,230,254,235,232,232,255,236,233,233,255,236,234,233,255,238,235,234,255,237,235,234,255,236,235,234,255,236,234,233,255,235,232,232,255,233,231,230,254,235,233,233,255,186,182,182,243,12,12,12,22,3,3,3,3,0,0,0,0,5,5,5,8,178,175,174,233,233,230,230,255,234,232,231,254,236,233,233,255,238,235,235,255,239,235,235,255,238,236,235,255,238,237,236,255,238,236,236,255,238,235,235,255,236,234,233,255,234,232,231,254,234,231,230,255,178,175,174,233,6,6,6,9,0,0,0,0,2,3,3,3,3,3,3,3,146,144,143,189,225,222,221,255,235,232,232,252,236,234,233,255,238,235,235,255,239,237,236,255,238,237,236,255,239,238,236,255,238,237,236,255,238,235,235,255,236,234,233,255,235,233,232,252,225,222,222,255,146,144,143,189,2,2,2,2,8,8,8,9,6,6,6,7,0,0,0,0,47,46,46,59,216,212,212,255,234,232,231,254,236,235,234,254,238,236,235,255,239,236,236,255,240,236,236,255,240,237,236,255,238,237,236,255,238,235,235,255,236,235,234,254,234,232,231,254,217,214,213,255,46,46,46,59,0,0,0,0,10,10,10,11,9,9,9,10,0,0,0,0,5,5,5,5,137,135,135,163,223,220,219,255,236,235,233,254,236,234,233,252,238,236,235,254,239,237,236,254,239,236,236,254,238,236,235,254,236,234,233,252,236,235,234,254,223,219,219,255,128,126,126,153,2,2,2,2,5,5,5,6,0,0,0,0,18,18,18,20,1,1,1,1,0,0,0,0,1,1,1,1,139,138,138,161,230,227,227,255,238,234,234,255,241,238,237,255,239,238,237,255,240,238,237,255,240,238,237,255,238,235,234,255,232,228,228,255,134,132,131,154,0,0,0,0,18,18,18,19,20,20,20,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,51,50,50,58,164,163,163,185,207,204,204,230,220,218,218,244,221,218,218,244,207,205,204,230,166,164,164,187,50,49,49,57,0,0,0,0,6,6,6,7,3,3,3,3,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,3,3,3,3,3,3,3,3,1,1,1,2,0,0,0,0,6,6,6,6,11,12,12,13,17,17,17,20,18,17,17,20,11,12,12,13,0,0,0,0,0,0,0,0,3,3,3,4,0,0,0,0,2,2,2,2,1,1,1,1,4,4,4,5,0,0,0,0,4,4,4,4,11,11,11,12,6,6,6,7,4,4,4,4,11,11,11,12,32,32,32,34,9,9,9,10,0,0,0,0,0,0,0,0,9,8,9,9,12,12,12,13,13,13,13,14,0,0,0,0,4,4,5,5,13,13,13,14,3,3,3,3,0,0,0,0 },
+ { 0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,2,1,1,1,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,0,0,0,0,0,0,0,0,5,5,5,10,14,14,13,16,14,14,14,16,5,5,5,10,0,0,0,0,0,0,0,0,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,22,22,22,47,90,90,91,178,127,127,127,230,144,144,144,243,144,144,144,243,127,127,128,230,91,91,91,178,21,21,21,46,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,2,1,1,1,3,0,0,0,0,49,49,49,123,111,111,111,255,108,108,109,255,92,92,92,255,82,82,82,255,82,82,82,255,91,91,92,255,109,109,109,255,111,111,112,255,49,49,49,123,0,0,0,0,1,1,0,1,0,1,0,2,0,0,0,1,0,0,0,0,1,1,1,4,0,0,0,0,42,42,43,115,99,99,100,255,83,83,84,255,75,75,75,251,80,80,80,254,83,83,83,254,83,83,84,254,80,80,80,254,75,75,75,251,84,84,84,255,99,99,100,255,42,42,43,117,0,0,0,0,1,1,1,3,0,0,0,0,1,1,1,3,0,0,0,0,14,14,14,41,86,86,87,250,82,82,83,255,80,80,80,253,83,83,83,255,82,82,83,255,82,82,83,255,82,82,83,255,82,82,82,255,83,83,83,255,80,80,80,253,81,82,83,255,87,87,88,251,14,14,15,43,0,0,0,0,1,1,1,2,1,1,1,4,0,0,0,0,48,48,48,145,85,85,86,255,79,79,80,251,81,81,81,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,82,255,81,81,81,255,81,81,81,255,79,79,80,251,84,85,86,255,48,48,49,147,0,0,0,0,1,1,1,3,0,0,0,0,0,0,0,1,64,64,65,203,81,81,82,255,80,80,80,253,81,81,81,255,81,81,81,255,81,81,81,255,81,81,81,255,81,80,81,255,81,81,81,255,81,81,81,255,81,81,81,255,80,79,80,253,81,81,82,255,64,64,65,203,1,1,1,2,0,0,0,0,0,0,0,0,3,3,3,10,72,72,72,231,80,80,81,255,79,79,80,254,80,80,80,255,79,79,80,255,79,79,80,255,79,79,80,255,78,78,79,255,79,79,80,255,79,79,80,255,80,80,81,255,79,79,80,254,80,80,81,255,72,72,72,232,3,3,3,11,0,0,0,0,0,0,0,0,3,3,3,11,71,71,72,233,79,79,80,255,78,78,79,254,78,78,79,255,77,78,78,255,77,77,78,255,77,77,78,255,77,77,78,255,77,77,79,255,77,77,79,255,78,78,79,255,78,78,79,254,79,79,80,255,71,71,72,232,4,4,4,12,0,0,0,0,0,0,0,1,1,1,1,2,63,63,63,203,78,78,79,255,76,76,77,253,77,77,77,255,77,77,77,255,76,76,77,255,76,76,77,255,76,76,77,255,76,76,77,255,76,76,78,255,76,76,77,255,76,76,77,253,78,78,79,255,62,62,63,203,1,1,1,3,0,0,0,1,2,2,2,7,0,0,0,0,47,47,47,148,80,80,81,255,74,74,75,251,76,76,76,255,75,75,76,255,75,75,76,255,74,74,75,255,74,74,75,255,75,75,76,255,75,75,76,255,76,76,77,255,74,74,75,251,80,80,81,255,46,46,46,146,0,0,0,0,1,1,1,4,1,1,1,4,0,0,0,0,13,13,13,40,82,82,82,251,76,76,76,255,73,73,74,253,75,75,76,255,74,74,75,255,74,74,75,255,73,73,74,255,74,74,75,255,75,75,76,255,73,73,74,253,76,76,76,255,81,81,82,250,13,13,13,40,0,0,0,0,1,1,1,3,0,0,0,1,1,1,1,3,0,0,0,0,40,39,40,117,92,92,93,255,76,75,77,255,67,67,68,251,71,71,71,254,73,73,74,254,73,73,74,254,70,70,72,254,67,67,68,251,75,75,76,255,92,92,93,255,39,39,40,115,0,0,0,0,1,1,1,3,0,0,0,1,0,0,0,1,0,0,0,1,1,1,1,3,0,0,0,0,46,46,47,127,103,103,104,255,100,100,100,255,83,82,83,255,71,71,73,255,71,71,72,255,83,83,84,255,100,100,100,255,103,103,104,255,46,46,47,125,0,0,0,0,0,0,0,1,0,0,1,2,0,0,0,1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,2,0,0,0,0,20,20,20,46,87,87,87,185,120,120,121,232,135,135,135,243,136,136,136,243,121,121,121,233,87,87,87,185,20,20,20,46,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,1,1,1,2,0,0,0,0,0,0,0,0,5,5,5,10,13,13,13,16,13,13,13,15,5,5,5,11,0,0,0,0,0,0,0,0,1,1,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,3,1,1,1,3,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,1 },
+};
diff --git a/src/contatos/main.cpp b/src/contatos/main.cpp
index a23c8e4..b1f1610 100644
--- a/src/contatos/main.cpp
+++ b/src/contatos/main.cpp
@@ -20,6 +20,8 @@ int g_nextId = 1, g_sel = -1;
std::wstring g_query, g_file;
float g_scroll = 0;
IDWriteTextFormat *g_tfCenter, *g_tfName, *g_tfRow, *g_tfLetter, *g_tfLabel, *g_tfValue, *g_tfInit, *g_tfIcon, *g_tfSmall;
+IDWriteTextFormat *g_tfInitBig, *g_tfNameG, *g_tfSmallL, *g_tfWrap, *g_tfRowB, *g_tfSub, *g_tfInitSmall, *g_tfSearch; // macOS 27
+float g_detailH;
void Save() {
std::vector<std::wstring> out{ L"# Contatos do WacOS: P id nome empresa celular e-mail endereço aniversário notas" };
@@ -63,8 +65,150 @@ D2D1_COLOR_F AvatarColor(const std::wstring& n) {
struct Hit { int kind, arg; D2D1_RECT_F r; }; // 1 contato, 2 campo, 3 +, 4 busca
std::vector<Hit> g_hits;
+// ---- macOS 27 (captura Contacts do 512 Pixels, 2x, medida em pt): barra lateral de 424 com os três botões, o
+// botão redondo de "barra lateral" (centro 114, 26) e o "+" (centro 397, 26), ambos de 37; busca em cápsula de 8 a
+// 415, 53 a 89; linhas de 51 com a foto de 36 e o nome em negrito sobre a segunda linha cinza; a seleção é a pílula
+// azul de 10 a 413. À direita o cartão sobre um fundo tingido pela cor da foto: "Editar" em cápsula no alto, a foto
+// de 158 com o centro a 144, o nome em negrito a 252 e os campos em cartões translúcidos de 339 (cantos 10).
+const float G_SB = 424, G_ROW = 51, G_LIST = 100, G_CARD_W = 339;
+float g_dscroll;
+bool g_sbHidden;
+COLORREF g_editBg = RGB(30, 30, 30);
+
+float GSide() { return g_sbHidden ? 0.f : G_SB; }
+
+void PaintGolden() {
+ g_hits.clear();
+ bool dark = Dark();
+ D2D1_SIZE_F sz = Size();
+ D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
+ float SBW = GSide();
+ // cartão: fundo tingido pela cor da foto (o Mac usa a foto desfocada)
+ Contact* c = Find(g_sel);
+ D2D1_COLOR_F base = c ? AvatarColor(c->f[F_NAME]) : Rgb(140, 140, 140);
+ auto mix = [](D2D1_COLOR_F a, D2D1_COLOR_F b, float k) { return D2D1::ColorF(a.r + (b.r - a.r) * k, a.g + (b.g - a.g) * k, a.b + (b.b - a.b) * k, 1); };
+ D2D1_COLOR_F neutral = dark ? Rgb(52, 49, 46) : Rgb(126, 118, 106);
+ D2D1_COLOR_F top = mix(base, neutral, 0.78f), bottom = mix(base, dark ? Rgb(40, 38, 36) : Rgb(150, 143, 132), 0.85f);
+ {
+ D2D1_GRADIENT_STOP st[2] = { { 0, top }, { 1, bottom } };
+ ID2D1GradientStopCollection* gs = nullptr; ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(rt->CreateGradientStopCollection(st, 2, &gs)) && SUCCEEDED(rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ 0, 0 }, { 0, sz.height }), gs, &lb)))
+ rt->FillRectangle(D2D1::RectF(SBW, 0, sz.width, sz.height), lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ }
+ D2D1_COLOR_F white = Rgb(255, 255, 255), white2 = Rgb(255, 255, 255, 0.72f), card = Rgb(255, 255, 255, dark ? 0.10f : 0.16f);
+ { // a cor do campo de edição por cima dos cartões
+ D2D1_COLOR_F e = mix(top, Rgb(255, 255, 255), dark ? 0.10f : 0.16f);
+ g_editBg = RGB((int)(e.r * 255), (int)(e.g * 255), (int)(e.b * 255));
+ }
+ float X0 = SBW, CW = sz.width - SBW, cx = X0 + CW / 2;
+ // "Editar"
+ {
+ std::wstring ed = Tr(L"Editar");
+ float w = std::max(58.f, TextW(g_tfRow, ed) + 26);
+ D2D1_RECT_F r = D2D1::RectF(sz.width - 10 - w, 8, sz.width - 10, 44);
+ if (c) { // sem cartão, sem "Editar"
+ GlassButton(r, true);
+ Text(ed, g_tfCenter, r, white);
+ g_hits.push_back({ 5, 0, r }); BarButton(r);
+ }
+ }
+ if (!c) Text(Tr(L"Nenhum Cartão Selecionado"), g_tfCenter, D2D1::RectF(X0, 0, sz.width, sz.height), white2);
+ else {
+ rt->PushAxisAlignedClip(D2D1::RectF(X0, BAR, sz.width, sz.height), D2D1_ANTIALIAS_MODE_ALIASED);
+ float y0 = -g_dscroll;
+ D2D1_POINT_2F av{ cx, y0 + 144 };
+ Circle(av, 81, Rgb(255, 255, 255, 0.85f), true);
+ Circle(av, 78, AvatarColor(c->f[F_NAME]), true);
+ Text(Initials(c->f[F_NAME]), g_tfInitBig, D2D1::RectF(av.x - 78, av.y - 78, av.x + 78, av.y + 78), white);
+ D2D1_RECT_F nr = D2D1::RectF(X0 + 20, y0 + 238, sz.width - 20, y0 + 266);
+ Text(c->f[F_NAME].empty() ? std::wstring(Tr(L"Sem Nome")) : c->f[F_NAME], g_tfNameG, nr, white);
+ g_hits.push_back({ 2, F_NAME, nr });
+ float L = cx - G_CARD_W / 2, R = cx + G_CARD_W / 2, y = y0 + 281;
+ auto group = [&](std::initializer_list<int> fl) {
+ float h = 46.f * fl.size();
+ Fill(D2D1::RectF(L, y, R, y + h), card, 10);
+ int k = 0;
+ for (int f : fl) {
+ float ry = y + k * 46;
+ if (k) Fill(D2D1::RectF(L + 12, ry, R, ry + 0.5f), Rgb(255, 255, 255, 0.18f));
+ Text(Tr(FIELD_LABELS[f]), g_tfSmallL, D2D1::RectF(L + 12, ry + 6, R - 12, ry + 20), white2);
+ D2D1_RECT_F vr = D2D1::RectF(L + 12, ry + 20, R - 12, ry + 42);
+ bool empty = c->f[f].empty();
+ Text(empty ? std::wstring(Tr(L"adicionar")) : c->f[f], g_tfRow, vr, empty ? Rgb(255, 255, 255, 0.45f) : white);
+ g_hits.push_back({ 2, f, vr });
+ k++;
+ }
+ y += h + 7;
+ };
+ group({ F_PHONE, F_EMAIL });
+ group({ F_COMPANY, F_ADDRESS, F_BIRTHDAY });
+ { // notas: cartão alto
+ float h = 92;
+ Fill(D2D1::RectF(L, y, R, y + h), card, 10);
+ Text(Tr(L"Notas"), g_tfSmallL, D2D1::RectF(L + 12, y + 8, R - 12, y + 22), white2);
+ D2D1_RECT_F vr = D2D1::RectF(L + 12, y + 24, R - 12, y + h - 6);
+ ID2D1SolidColorBrush* b = br; b->SetColor(c->f[F_NOTES].empty() ? Rgb(255, 255, 255, 0.45f) : white);
+ std::wstring nt = c->f[F_NOTES].empty() ? std::wstring(Tr(L"adicionar")) : c->f[F_NOTES];
+ rt->DrawTextW(nt.c_str(), (UINT32)nt.size(), g_tfWrap, vr, b, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ g_hits.push_back({ 2, F_NOTES, D2D1::RectF(vr.left, vr.top, vr.right, vr.top + 22) });
+ y += h + 7;
+ }
+ for (int k = 0; k < 2; k++) { // Compartilhar Contato / Apagar Contato
+ D2D1_RECT_F r = D2D1::RectF(L, y, R, y + 36);
+ Fill(r, card, 10);
+ Text(k ? Tr(L"Apagar Contato") : Tr(L"Compartilhar Contato"), g_tfRow, D2D1::RectF(L + 12, y, R - 12, y + 36), k ? Rgb(255, 120, 110) : white);
+ g_hits.push_back({ 6 + k, 0, r });
+ y += 36 + 6;
+ }
+ g_detailH = y + g_dscroll + 20;
+ rt->PopAxisAlignedClip();
+ }
+ if (SBW > 0) {
+ // barra lateral
+ Fill(D2D1::RectF(0, 0, SBW, sz.height), dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ Fill(D2D1::RectF(SBW - 0.5f, 0, SBW, sz.height), dark ? Rgb(0, 0, 0, 0.5f) : Rgb(0, 0, 0, 0.12f));
+ D2D1_RECT_F sb = D2D1::RectF(114 - 18.5f, 26 - 18.5f, 114 + 18.5f, 26 + 18.5f);
+ GlassButton(sb, dark); IconSidebar({ 114, 26 }, text);
+ g_hits.push_back({ 8, 0, sb }); BarButton(sb);
+ D2D1_RECT_F add = D2D1::RectF(397 - 18.5f, 26 - 18.5f, 397 + 18.5f, 26 + 18.5f);
+ GlassButton(add, dark); IconPlus({ 397, 26 }, text);
+ g_hits.push_back({ 3, 0, add }); BarButton(add);
+ D2D1_RECT_F sr = D2D1::RectF(8, 53, 415, 89);
+ GlassField(sr, dark);
+ IconSearch({ 30, 71 }, gray);
+ Text(g_query.empty() ? std::wstring(Tr(L"Buscar")) : g_query, g_tfSearch, D2D1::RectF(sr.left + 38, sr.top, sr.right - 12, sr.bottom), g_query.empty() ? gray : text);
+ g_hits.push_back({ 4, 0, sr });
+ rt->PushAxisAlignedClip(D2D1::RectF(0, 92, SBW, sz.height), D2D1_ANTIALIAS_MODE_ALIASED);
+ float y = G_LIST - g_scroll;
+ for (Contact* p : Shown()) {
+ std::wstring n = p->f[F_NAME].empty() ? Tr(L"Sem Nome") : p->f[F_NAME];
+ std::wstring sub = !p->f[F_COMPANY].empty() ? p->f[F_COMPANY] : !p->f[F_PHONE].empty() ? p->f[F_PHONE] : p->f[F_EMAIL];
+ D2D1_RECT_F r = D2D1::RectF(10, y, 413, y + G_ROW);
+ bool on = p->id == g_sel;
+ if (on) Fill(r, semaforo::Aqua() ? Rgb(0, 136, 255) : Rgb(10, 132, 255), 10);
+ D2D1_POINT_2F a{ 34, y + G_ROW / 2 };
+ Circle(a, 18, AvatarColor(p->f[F_NAME]), true);
+ Text(Initials(p->f[F_NAME]), g_tfInitSmall, D2D1::RectF(a.x - 18, a.y - 18, a.x + 18, a.y + 18), white);
+ bool two = !sub.empty();
+ Text(n, g_tfRowB, D2D1::RectF(60, two ? y + 7 : y, r.right - 8, two ? y + 26 : y + G_ROW), on ? white : text);
+ if (two) Text(sub, g_tfSub, D2D1::RectF(60, y + 26, r.right - 8, y + 44), on ? Rgb(255, 255, 255, 0.78f) : gray);
+ g_hits.push_back({ 1, p->id, r });
+ y += G_ROW;
+ }
+ rt->PopAxisAlignedClip();
+ if (g_c.empty()) Text(Tr(L"Nenhum Contato"), g_tfCenter, D2D1::RectF(0, G_LIST, SBW, sz.height * 0.6f), gray);
+ } else {
+ D2D1_RECT_F sb = D2D1::RectF(114 - 18.5f, 26 - 18.5f, 114 + 18.5f, 26 + 18.5f);
+ GlassButton(sb, true); IconSidebar({ 114, 26 }, white);
+ g_hits.push_back({ 8, 0, sb }); BarButton(sb);
+ }
+}
+
void Paint() {
if (!BeginPaint()) return;
+ if (BAR > 0) { PaintGolden(); EndPaint(); return; }
g_hits.clear();
bool dark = Dark();
D2D1_SIZE_F sz = Size();
@@ -185,12 +329,13 @@ void ImportVcf() {
wchar_t b[96]; swprintf_s(b, Tr(L"%d contatos importados."), n);
MessageBoxW(wnd, b, Tr(L"Contatos"), MB_OK | MB_ICONINFORMATION);
}
-void ExportVcf() {
+void ExportVcf(int only = -1) {
std::wstring path = PickFile(true);
if (path.empty()) return;
std::vector<std::wstring> out;
auto e = [](const std::wstring& s) { std::wstring o; for (wchar_t c : s) { if (c == L',' || c == L';' || c == L'\\') o += L'\\'; if (c == L'\n') { o += L"\\n"; continue; } o += c; } return o; };
for (auto& c : g_c) {
+ if (only >= 0 && c.id != only) continue;
out.push_back(L"BEGIN:VCARD"); out.push_back(L"VERSION:3.0");
out.push_back(L"FN:" + e(c.f[F_NAME]));
if (!c.f[F_COMPANY].empty()) out.push_back(L"ORG:" + e(c.f[F_COMPANY]));
@@ -211,12 +356,21 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
case WM_SIZE: OnSize(l); return 0;
case WM_DPICHANGED: OnDpi(w, l); return 0;
case WM_SETTINGCHANGE: InvalidateRect(h, nullptr, FALSE); return 0;
- case WM_CTLCOLOREDIT: return FieldColors((HDC)w, Dark() ? RGB(30, 30, 30) : RGB(255, 255, 255));
+ case WM_CTLCOLOREDIT:
+ if (BAR > 0 && field.h) { // macOS 27: o campo no cartão tingido tem texto branco
+ RECT fr; GetWindowRect(field.h, &fr); POINT p{ fr.left, fr.top }; ScreenToClient(h, &p);
+ if (p.x / Sc() >= GSide()) { LRESULT r = FieldColors((HDC)w, g_editBg); SetTextColor((HDC)w, RGB(255, 255, 255)); return r; }
+ }
+ return FieldColors((HDC)w, Dark() ? RGB(30, 30, 30) : RGB(255, 255, 255));
case WM_FIELDLOST: if (field.h && GetFocus() != field.h) FieldEnd(0); return 0;
case WM_APP + 11: Paint(); EditField((int)w); return 0;
case WM_MOUSEWHEEL: {
float s = Sc(); POINT p{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ScreenToClient(h, &p);
- if (p.x / s < SB) { g_scroll = std::max(0.f, g_scroll - GET_WHEEL_DELTA_WPARAM(w) / 120.f * 60); InvalidateRect(h, nullptr, FALSE); }
+ float d = GET_WHEEL_DELTA_WPARAM(w) / 120.f * 60;
+ if (BAR > 0 && p.x / s >= GSide()) { // macOS 27: o cartão rola
+ float mx = std::max(0.f, g_detailH - Size().height);
+ g_dscroll = std::clamp(g_dscroll - d, 0.f, mx); InvalidateRect(h, nullptr, FALSE);
+ } else if (p.x / s < (BAR > 0 ? GSide() : SB)) { g_scroll = std::max(0.f, g_scroll - d); InvalidateRect(h, nullptr, FALSE); }
return 0;
}
case WM_LBUTTONDOWN: case WM_RBUTTONUP: {
@@ -225,6 +379,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
POINT scr{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ClientToScreen(h, &scr);
for (auto& ht : g_hits) if (In(ht.r, x, y)) {
if (ht.kind == 1) {
+ if (g_sel != ht.arg) g_dscroll = 0;
g_sel = ht.arg;
if (m == WM_RBUTTONUP) {
HMENU mm = CreatePopupMenu(); AppendMenuW(mm, MF_STRING, 1, Tr(L"Apagar Cartão"));
@@ -236,9 +391,18 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
} else if (ht.kind == 2) { EditField(ht.arg); return 0; }
else if (ht.kind == 3) { NewContact(); return 0; }
else if (ht.kind == 4) {
- FieldOpen(D2D1::RectF(ht.r.left + 28, ht.r.top, ht.r.right - 6, ht.r.bottom), g_query, 13, false, [](const std::wstring& t, int key) { if (key != VK_ESCAPE) g_query = t; else g_query.clear(); g_scroll = 0; });
+ float in = BAR > 0 ? 38.f : 28.f;
+ FieldOpen(D2D1::RectF(ht.r.left + in, ht.r.top + (BAR > 0 ? 8.f : 0.f), ht.r.right - 12, ht.r.bottom - (BAR > 0 ? 8.f : 0.f)), g_query, 13, false, [](const std::wstring& t, int key) { if (key != VK_ESCAPE) g_query = t; else g_query.clear(); g_scroll = 0; });
return 0;
}
+ else if (ht.kind == 5) { EditField(F_NAME); return 0; }
+ else if (ht.kind == 6) { ExportVcf(g_sel); return 0; }
+ else if (ht.kind == 7) {
+ if (MessageBoxW(h, Tr(L"Apagar este cartão?"), Tr(L"Contatos"), MB_OKCANCEL | MB_ICONWARNING) == IDOK) {
+ int id = g_sel; g_c.erase(std::remove_if(g_c.begin(), g_c.end(), [id](const Contact& c) { return c.id == id; }), g_c.end()); g_sel = -1; Save();
+ }
+ }
+ else if (ht.kind == 8) g_sbHidden = !g_sbHidden;
InvalidateRect(h, nullptr, FALSE);
return 0;
}
@@ -284,7 +448,17 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
g_tfInit = Fmt(32, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
g_tfIcon = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
g_tfSmall = Fmt(12, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
- if (!CreateMain(hi, L"ContatosJanela", Tr(L"Contatos"), Proc, 860, 600)) return 1;
+ g_tfInitBig = Fmt(56, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
+ g_tfNameG = Fmt(17, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfSmallL = Fmt(11);
+ g_tfWrap = Fmt(13, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_LEADING, true);
+ if (g_tfWrap) g_tfWrap->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
+ g_tfRowB = Fmt(13, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfSub = Fmt(12);
+ g_tfInitSmall = Fmt(14, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfSearch = Fmt(15);
+ barWanted = 52; // macOS 27: barra unificada (os botões na linha dos três da janela)
+ if (!CreateMain(hi, L"ContatosJanela", Tr(L"Contatos"), Proc, semaforo::Aqua() ? 848 : 860, semaforo::Aqua() ? 640 : 600)) return 1;
ShowWindow(wnd, show);
return Run();
}
diff --git a/src/finder/finder.h b/src/finder/finder.h
index e06ac2a..7faa319 100644
--- a/src/finder/finder.h
+++ b/src/finder/finder.h
@@ -1,186 +1,188 @@
-// Arquivos — gerenciador de arquivos no estilo do Finder (shell próprio, fase 4).
-// Declarações compartilhadas entre os arquivos de src/finder.
-#pragma once
-#define WIN32_LEAN_AND_MEAN
-#define NOMINMAX
-#include <windows.h>
-#include <ole2.h>
-#include <d2d1_1.h>
-#include <dwrite.h>
-#include <string>
-#include <vector>
-#include <functional>
-#include <cstdio>
-#include <cmath>
-#include <algorithm>
-#include "../comum/idioma.h"
-
-void Log(const wchar_t* fmt, ...);
-// Caminho do WacOSFinder.exe (no modo nativo, dentro do explorer.exe, GetModuleFileName(nullptr) seria o explorer)
-void ExePath(wchar_t* out, DWORD n);
-extern bool g_finderNativo;
-extern bool g_finderEmbutido; // Abrir/Salvar dentro do programa que pediu (MacDialogo.dll): a janela só se esconde no fim // Finder dentro do explorer.exe (MacFinder.dll): uma janela só, com abas
-
-// ---- gfx.cpp: Direct2D sobre DirectComposition. A janela não tem bitmap de redirecionamento;
-// o conteúdo tem alfa real e o acrílico do DWM aparece onde desenhamos transparente.
-namespace gfx {
-extern IDWriteFactory* dw;
-bool Init(HWND hwnd);
-void Resize(UINT w, UINT h);
-ID2D1DeviceContext* Begin(float dpi); // já com BeginDraw; desenhe em DIPs
-void End(); // EndDraw + Present
-ID2D1Bitmap* CreateBitmapBGRA(UINT w, UINT h, const void* pixels, UINT stride); // pré-multiplicado
-IUnknown* Device(); // ID3D11Device
-ID2D1Bitmap* BitmapFromTexture(IUnknown* texture); // ID3D11Texture2D BGRA -> bitmap (sem cópia)
-}
-
-// ---- thumbs.cpp: miniaturas e ícones (IShellItemImageFactory) em threads de fundo.
-namespace thumbs {
-enum Kind { KIND_IMAGE, KIND_DOCUMENT, KIND_FOLDER }; // documento sem miniatura / atalho para pasta
-struct Result {
- UINT gen;
- std::wstring key;
- UINT w, h;
- std::vector<BYTE> bgra; // BGRA pré-multiplicado, de cima para baixo (só KIND_IMAGE)
- Kind kind;
-};
-void Start(HWND notify, UINT msg); // resultados chegam como PostMessage(notify, msg, 0, Result*)
-void SetGeneration(UINT gen); // descarta pedidos de pastas anteriores
-void Request(UINT gen, const std::wstring& path, const std::wstring& key, int px);
-void Stop();
-}
-
-// ---- textfield.cpp: campo de texto desenhado com DirectWrite (busca e renomear).
-struct TextField {
- std::wstring text;
- int caret = 0, anchor = 0; // seleção = [min(caret, anchor), max(...))
- float scrollX = 0;
- D2D1_RECT_F lastRect{}; // onde foi desenhado (para cliques)
- float lastOffset = 0;
-
- void SetText(const std::wstring& t, bool selectAll);
- void Select(int from, int to) { anchor = from; caret = to; }
- bool OnKey(UINT vk, bool shift, bool ctrl); // true quando a tecla foi tratada
- void OnChar(wchar_t c);
- // center: centraliza quando o texto cabe (renomear); senão alinha à esquerda (busca)
- void Draw(ID2D1DeviceContext* dc, IDWriteTextFormat* tf, D2D1_RECT_F rc, ID2D1Brush* textBrush,
- ID2D1Brush* selBrush, ID2D1Brush* caretBrush, bool showCaret, bool center);
- void Click(IDWriteTextFormat* tf, D2D1_POINT_2F pt, bool shift);
-
-private:
- int SelMin() const { return caret < anchor ? caret : anchor; }
- int SelMax() const { return caret > anchor ? caret : anchor; }
- void EraseSelection();
- void Insert(const std::wstring& s);
-};
-
-// ---- tags.cpp: etiquetas coloridas gravadas no próprio arquivo (fluxo alternativo do NTFS).
-namespace tags {
-const int COUNT = 7;
-extern const wchar_t* names[COUNT];
-extern UINT32 colors[COUNT]; // 0xRRGGBB (Tema troca para as cores do macOS 26)
-void Tema(bool tahoe, bool dark);
-unsigned Read(const std::wstring& path); // máscara de bits (bit n = etiqueta n)
-bool Write(const std::wstring& path, unsigned mask); // preserva as datas do arquivo
-std::vector<std::wstring> Tagged(int tag); // todos os itens com a etiqueta (pelo índice)
-}
-
-// ---- shadow.cpp: sombra grande e difusa (estilo Mac) atrás da janela principal.
-namespace shadow {
-void Create(HWND main);
-void SetActive(bool active);
-void Update(); // chamar quando a janela mudar de posição, tamanho, ordem ou estado
-void Destroy();
-void SetRadius(float dip); // cantos da janela (0 = retângulo, como no Sequoia; 26 no Tahoe)
-}
-
-// ---- tahoe.cpp: tema macOS Tahoe (Liquid Glass) quando liquid_glass=1 no ajustes.txt do Shell.
-namespace tahoe {
-const float WINDOW_R = 26; // cantos das janelas com barra de ferramentas no Tahoe (pt)
-bool On(); // tema Tahoe (liquid_glass=1)
-bool Reduced(); // reduzir_transparencia=1: o vidro fica opaco
-D2D1_COLOR_F Tint(D2D1_COLOR_F base); // 10 % da cor do papel de parede (tingir_janelas), só no Tahoe
-D2D1_COLOR_F Accent(bool dark); // a cor de destaque escolhida no Ajustes (destaque=)
-bool Reload(); // relê o ajustes.txt se mudou; true quando On() mudou
-void Frame(HWND h, bool on); // janela de cantos grandes com o vidro da Composição (ou de volta ao DWM)
-void Size(HWND h, float wpx, float hpx, bool dark); // acompanha o tamanho (WM_SIZE) e o tema
-bool IsDarkTheme();
-void SetPanel(HWND h, D2D1_RECT_F dip, float radiusDip); // onde o vidro aparece (a barra lateral flutuante)
-float Radius(HWND h); // raio atual da janela em DIPs (0 maximizada)
-bool PushWindowClip(ID2D1DeviceContext* dc, D2D1_SIZE_F s, float radius); // PopLayer depois, se true
-ID2D1PathGeometry* Squircle(ID2D1Factory* f, D2D1_RECT_F r, float radius); // canto contínuo da Apple (superelipse n = 5)
-void WindowRim(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_SIZE_F s, float radius, bool dark);
-// cápsula de vidro (radius < 0: meia altura); lift = força da sombra
-void Capsule(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_RECT_F r, float radius, bool dark, float lift = 1);
-void Panel(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_RECT_F r, float radius, bool dark); // painel flutuante
-// Borda de rolagem: desenhe a parte que rola num contexto fora da tela (SceneBegin..SceneEnd, mesmo DIP do
-// principal) e componha com SceneDraw: nítida em `area` e, na faixa de cima (`band` DIPs), desfocada e sumindo.
-ID2D1DeviceContext* SceneBegin(ID2D1DeviceContext* main, int slot, D2D1_SIZE_F dip, float dpi); // nullptr: desenhe direto
-void SceneEnd(int slot);
-const wchar_t* SceneError(); // por que SceneBegin devolveu nullptr
-void SceneDraw(ID2D1DeviceContext* dc, int slot, D2D1_RECT_F area, float band, D2D1_COLOR_F fade = D2D1::ColorF(0, 0, 0, 0)); // fade: cor do fundo para onde a faixa vai
-}
-
-// ---- drop.cpp: soltar arquivos arrastados de outros apps (e colar).
-IDropTarget* CreateDropTarget(HWND hwnd);
-HRESULT PasteInto(HWND hwnd, const std::wstring& folder);
-
-// ---- main.cpp: usado pelo alvo de soltar.
-struct DropSpot {
- enum Kind { NONE, FOLDER, SIDEBAR_INSERT, TAG } kind = NONE;
- std::wstring path; // FOLDER: pasta que recebe os arquivos
- int index = -1; // SIDEBAR_INSERT: posição nos favoritos; TAG: etiqueta
- int item = -1; // item do conteúdo destacado
- int row = -1; // linha da barra lateral destacada
-};
-DropSpot DropSpotAt(POINT clientPx);
-void SetDropFeedback(const DropSpot& spot);
-void DropCustom(const DropSpot& spot, const std::vector<std::wstring>& paths); // inserir favorito / etiquetar
-void SpringLoad(const std::wstring& path); // arrastando parado sobre uma pasta: ela abre (pastas com mola do Mac)
-
-// Busca: índice do Windows Search (folder vazio = tudo que está indexado) e varredura pelo nome.
-// onPath devolve false para parar. Index devolve -1 se o índice não respondeu.
-namespace search {
-int Index(const std::wstring& q, const std::wstring& folder, int max, const std::function<bool(const std::wstring&)>& onPath);
-int Walk(const std::wstring& q, const std::wstring& folder, int max, const std::function<bool(const std::wstring&)>& onPath);
-// o índice do Spotlight do Shell (nomes de tudo, instantâneo); -1 se não houver índice
-int Spotlight(const std::wstring& q, const std::wstring& folder, int max, const std::function<bool(const std::wstring&)>& onPath);
-}
-
-// Arquivos como padrão para abrir pastas (HKCU, reversível; ver padrao.cpp).
-namespace padrao {
-bool Enabled();
-bool Enable(FILE* log);
-bool Disable(FILE* log);
-}
-
-// ---- media.cpp: áudio e vídeo do Quick Look (Media Foundation Media Engine).
-namespace media {
-void Init(HWND hwnd, UINT msg); // eventos chegam como msg(wParam = evento)
-bool Open(const std::wstring& path);
-void Close();
-void OnEvent(DWORD ev);
-const std::wstring& Path();
-bool Active();
-bool Ready();
-bool Failed();
-bool HasVideo();
-UINT VideoW();
-UINT VideoH();
-bool Paused();
-bool Ended();
-double Duration();
-double Time();
-void Seek(double t);
-bool Muted();
-void SetMuted(bool m);
-void TogglePlay();
-bool UpdateFrame(); // fora do BeginDraw; true se chegou quadro novo
-ID2D1Bitmap* Frame();
-}
-
-// ---- info.cpp: janela "Obter Informações" (uma por item).
-namespace info {
-// admin: janela aberta como administrador (privilégios editáveis); px/py: posição (INT_MIN = ao lado do Finder)
-void Show(const std::wstring& path, HWND anchor, const std::wstring& family, bool dark, bool admin = false, int px = -2147483647 - 1, int py = 0);
-}
+// Arquivos — gerenciador de arquivos no estilo do Finder (shell próprio, fase 4).
+// Declarações compartilhadas entre os arquivos de src/finder.
+#pragma once
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <windows.h>
+#include <ole2.h>
+#include <d2d1_1.h>
+#include <dwrite.h>
+#include <string>
+#include <vector>
+#include <functional>
+#include <cstdio>
+#include <cmath>
+#include <algorithm>
+#include "../comum/idioma.h"
+
+void Log(const wchar_t* fmt, ...);
+// Caminho do WacOSFinder.exe (no modo nativo, dentro do explorer.exe, GetModuleFileName(nullptr) seria o explorer)
+void ExePath(wchar_t* out, DWORD n);
+extern bool g_finderNativo;
+extern bool g_finderEmbutido; // Abrir/Salvar dentro do programa que pediu (MacDialogo.dll): a janela só se esconde no fim // Finder dentro do explorer.exe (MacFinder.dll): uma janela só, com abas
+
+// ---- gfx.cpp: Direct2D sobre DirectComposition. A janela não tem bitmap de redirecionamento;
+// o conteúdo tem alfa real e o acrílico do DWM aparece onde desenhamos transparente.
+namespace gfx {
+extern IDWriteFactory* dw;
+bool Init(HWND hwnd);
+void Resize(UINT w, UINT h);
+ID2D1DeviceContext* Begin(float dpi); // já com BeginDraw; desenhe em DIPs
+void End(); // EndDraw + Present
+ID2D1Bitmap* CreateBitmapBGRA(UINT w, UINT h, const void* pixels, UINT stride); // pré-multiplicado
+IUnknown* Device(); // ID3D11Device
+ID2D1Bitmap* BitmapFromTexture(IUnknown* texture); // ID3D11Texture2D BGRA -> bitmap (sem cópia)
+}
+
+// ---- thumbs.cpp: miniaturas e ícones (IShellItemImageFactory) em threads de fundo.
+namespace thumbs {
+enum Kind { KIND_IMAGE, KIND_DOCUMENT, KIND_FOLDER }; // documento sem miniatura / atalho para pasta
+struct Result {
+ UINT gen;
+ std::wstring key;
+ UINT w, h;
+ std::vector<BYTE> bgra; // BGRA pré-multiplicado, de cima para baixo (só KIND_IMAGE)
+ Kind kind;
+};
+void Start(HWND notify, UINT msg); // resultados chegam como PostMessage(notify, msg, 0, Result*)
+void SetGeneration(UINT gen); // descarta pedidos de pastas anteriores
+void Request(UINT gen, const std::wstring& path, const std::wstring& key, int px);
+void Stop();
+}
+
+// ---- textfield.cpp: campo de texto desenhado com DirectWrite (busca e renomear).
+struct TextField {
+ std::wstring text;
+ int caret = 0, anchor = 0; // seleção = [min(caret, anchor), max(...))
+ float scrollX = 0;
+ D2D1_RECT_F lastRect{}; // onde foi desenhado (para cliques)
+ float lastOffset = 0;
+
+ void SetText(const std::wstring& t, bool selectAll);
+ void Select(int from, int to) { anchor = from; caret = to; }
+ bool OnKey(UINT vk, bool shift, bool ctrl); // true quando a tecla foi tratada
+ void OnChar(wchar_t c);
+ // center: centraliza quando o texto cabe (renomear); senão alinha à esquerda (busca)
+ void Draw(ID2D1DeviceContext* dc, IDWriteTextFormat* tf, D2D1_RECT_F rc, ID2D1Brush* textBrush,
+ ID2D1Brush* selBrush, ID2D1Brush* caretBrush, bool showCaret, bool center);
+ void Click(IDWriteTextFormat* tf, D2D1_POINT_2F pt, bool shift);
+
+private:
+ int SelMin() const { return caret < anchor ? caret : anchor; }
+ int SelMax() const { return caret > anchor ? caret : anchor; }
+ void EraseSelection();
+ void Insert(const std::wstring& s);
+};
+
+// ---- tags.cpp: etiquetas coloridas gravadas no próprio arquivo (fluxo alternativo do NTFS).
+namespace tags {
+const int COUNT = 7;
+extern const wchar_t* names[COUNT];
+extern UINT32 colors[COUNT]; // 0xRRGGBB (Tema troca para as cores do macOS 26)
+void Tema(bool tahoe, bool dark);
+unsigned Read(const std::wstring& path); // máscara de bits (bit n = etiqueta n)
+bool Write(const std::wstring& path, unsigned mask); // preserva as datas do arquivo
+std::vector<std::wstring> Tagged(int tag); // todos os itens com a etiqueta (pelo índice)
+}
+
+// ---- shadow.cpp: sombra grande e difusa (estilo Mac) atrás da janela principal.
+namespace shadow {
+void Create(HWND main);
+void SetActive(bool active);
+void Update(); // chamar quando a janela mudar de posição, tamanho, ordem ou estado
+void Destroy();
+void SetRadius(float dip); // cantos da janela (0 = retângulo, como no Sequoia; 26 no Tahoe)
+}
+
+// ---- tahoe.cpp: tema macOS Tahoe (Liquid Glass) quando liquid_glass=1 no ajustes.txt do Shell.
+namespace tahoe {
+float WindowR(); // cantos das janelas: 26 pt no Tahoe, 16 pt no Golden Gate (um raio só para todas)
+int FolderColor(); // Aparência > Cor das pastas (índice de pastacor::colors; -1 = automática)
+bool Golden(); // tema macOS Golden Gate (liquid_glass=1 e golden_gate=1): o Tahoe com os ajustes do macOS 27
+bool On(); // tema Tahoe (liquid_glass=1)
+bool Reduced(); // reduzir_transparencia=1: o vidro fica opaco
+D2D1_COLOR_F Tint(D2D1_COLOR_F base); // 10 % da cor do papel de parede (tingir_janelas), só no Tahoe
+D2D1_COLOR_F Accent(bool dark); // a cor de destaque escolhida no Ajustes (destaque=)
+bool Reload(); // relê o ajustes.txt se mudou; true quando On() mudou
+void Frame(HWND h, bool on); // janela de cantos grandes com o vidro da Composição (ou de volta ao DWM)
+void Size(HWND h, float wpx, float hpx, bool dark); // acompanha o tamanho (WM_SIZE) e o tema
+bool IsDarkTheme();
+void SetPanel(HWND h, D2D1_RECT_F dip, float radiusDip); // onde o vidro aparece (a barra lateral flutuante)
+float Radius(HWND h); // raio atual da janela em DIPs (0 maximizada)
+bool PushWindowClip(ID2D1DeviceContext* dc, D2D1_SIZE_F s, float radius); // PopLayer depois, se true
+ID2D1PathGeometry* Squircle(ID2D1Factory* f, D2D1_RECT_F r, float radius); // canto contínuo da Apple (superelipse n = 5)
+void WindowRim(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_SIZE_F s, float radius, bool dark);
+// cápsula de vidro (radius < 0: meia altura); lift = força da sombra
+void Capsule(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_RECT_F r, float radius, bool dark, float lift = 1);
+void Panel(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_RECT_F r, float radius, bool dark); // painel flutuante
+// Borda de rolagem: desenhe a parte que rola num contexto fora da tela (SceneBegin..SceneEnd, mesmo DIP do
+// principal) e componha com SceneDraw: nítida em `area` e, na faixa de cima (`band` DIPs), desfocada e sumindo.
+ID2D1DeviceContext* SceneBegin(ID2D1DeviceContext* main, int slot, D2D1_SIZE_F dip, float dpi); // nullptr: desenhe direto
+void SceneEnd(int slot);
+const wchar_t* SceneError(); // por que SceneBegin devolveu nullptr
+void SceneDraw(ID2D1DeviceContext* dc, int slot, D2D1_RECT_F area, float band, D2D1_COLOR_F fade = D2D1::ColorF(0, 0, 0, 0)); // fade: cor do fundo para onde a faixa vai
+}
+
+// ---- drop.cpp: soltar arquivos arrastados de outros apps (e colar).
+IDropTarget* CreateDropTarget(HWND hwnd);
+HRESULT PasteInto(HWND hwnd, const std::wstring& folder);
+
+// ---- main.cpp: usado pelo alvo de soltar.
+struct DropSpot {
+ enum Kind { NONE, FOLDER, SIDEBAR_INSERT, TAG } kind = NONE;
+ std::wstring path; // FOLDER: pasta que recebe os arquivos
+ int index = -1; // SIDEBAR_INSERT: posição nos favoritos; TAG: etiqueta
+ int item = -1; // item do conteúdo destacado
+ int row = -1; // linha da barra lateral destacada
+};
+DropSpot DropSpotAt(POINT clientPx);
+void SetDropFeedback(const DropSpot& spot);
+void DropCustom(const DropSpot& spot, const std::vector<std::wstring>& paths); // inserir favorito / etiquetar
+void SpringLoad(const std::wstring& path); // arrastando parado sobre uma pasta: ela abre (pastas com mola do Mac)
+
+// Busca: índice do Windows Search (folder vazio = tudo que está indexado) e varredura pelo nome.
+// onPath devolve false para parar. Index devolve -1 se o índice não respondeu.
+namespace search {
+int Index(const std::wstring& q, const std::wstring& folder, int max, const std::function<bool(const std::wstring&)>& onPath);
+int Walk(const std::wstring& q, const std::wstring& folder, int max, const std::function<bool(const std::wstring&)>& onPath);
+// o índice do Spotlight do Shell (nomes de tudo, instantâneo); -1 se não houver índice
+int Spotlight(const std::wstring& q, const std::wstring& folder, int max, const std::function<bool(const std::wstring&)>& onPath);
+}
+
+// Arquivos como padrão para abrir pastas (HKCU, reversível; ver padrao.cpp).
+namespace padrao {
+bool Enabled();
+bool Enable(FILE* log);
+bool Disable(FILE* log);
+}
+
+// ---- media.cpp: áudio e vídeo do Quick Look (Media Foundation Media Engine).
+namespace media {
+void Init(HWND hwnd, UINT msg); // eventos chegam como msg(wParam = evento)
+bool Open(const std::wstring& path);
+void Close();
+void OnEvent(DWORD ev);
+const std::wstring& Path();
+bool Active();
+bool Ready();
+bool Failed();
+bool HasVideo();
+UINT VideoW();
+UINT VideoH();
+bool Paused();
+bool Ended();
+double Duration();
+double Time();
+void Seek(double t);
+bool Muted();
+void SetMuted(bool m);
+void TogglePlay();
+bool UpdateFrame(); // fora do BeginDraw; true se chegou quadro novo
+ID2D1Bitmap* Frame();
+}
+
+// ---- info.cpp: janela "Obter Informações" (uma por item).
+namespace info {
+// admin: janela aberta como administrador (privilégios editáveis); px/py: posição (INT_MIN = ao lado do Finder)
+void Show(const std::wstring& path, HWND anchor, const std::wstring& family, bool dark, bool admin = false, int px = -2147483647 - 1, int py = 0);
+}
diff --git a/src/finder/info.cpp b/src/finder/info.cpp
index 11fda29..8b4d750 100644
--- a/src/finder/info.cpp
+++ b/src/finder/info.cpp
@@ -25,7 +25,12 @@
namespace {
-const float W = 265, TITLE_H = 28, PAD = 16, HDR_ROW = 24, ROW = 17, LABEL_X = 92;
+const float PAD = 16, HDR_ROW = 24, ROW = 17;
+// macOS 27 Golden Gate (captura Finder-Get-Info, 2x): janela de 301,5 de largura, barra de título de 31,5 (botões com
+// o centro em 15,75), rótulos alinhados a 107 da borda
+#define W (semaforo::Aqua() ? 301.5f : 265.f)
+#define TITLE_H (semaforo::Aqua() ? 31.5f : 28.f)
+#define LABEL_X (semaforo::Aqua() ? 107.f : 92.f)
const UINT WM_INFO_CALC = WM_APP + 1;
enum Sec { S_GENERAL, S_MORE, S_NAME, S_COMMENTS, S_OPENWITH, S_PREVIEW, S_SHARING, S_COUNT };
@@ -443,10 +448,11 @@ void Paint(Info& in) {
static const D2D1_COLOR_F fill_c[3] = { D2D1::ColorF(1.0f, 0.373f, 0.345f), D2D1::ColorF(0.996f, 0.737f, 0.180f), D2D1::ColorF(0.157f, 0.784f, 0.251f) }; const D2D1_COLOR_F* fill = semaforo::Pick(fill_c, semaforo::FILL);
static const D2D1_COLOR_F ring_c[3] = { D2D1::ColorF(0.886f, 0.275f, 0.247f), D2D1::ColorF(0.882f, 0.631f, 0.086f), D2D1::ColorF(0.071f, 0.675f, 0.157f) }; const D2D1_COLOR_F* ring = semaforo::Pick(ring_c, semaforo::RING);
for (int k = 0; k < 3; k++) {
- D2D1_POINT_2F c{ 19.f + k * 23, 14 }; // padrão do projeto: 14 pt, 23 entre centros
+ D2D1_POINT_2F c{ (semaforo::Aqua() ? 15.75f : 19.f) + k * 23, semaforo::Aqua() ? 15.75f : 14.f }; // padrão do projeto: 14 pt, 23 entre centros (macOS 27: centro em 15,75)
bool lit = k < 2 && (in.active || in.hoverLights);
br->SetColor(lit ? fill[k] : dark ? D2D1::ColorF(0.30f, 0.30f, 0.31f) : D2D1::ColorF(0.84f, 0.84f, 0.84f));
rt->FillEllipse(D2D1::Ellipse(c, 7, 7), br);
+ semaforo::Gloss(rt, c, 7, br);
br->SetColor(lit ? ring[k] : dark ? D2D1::ColorF(0, 0, 0, 0.3f) : D2D1::ColorF(0.73f, 0.73f, 0.74f));
rt->DrawEllipse(D2D1::Ellipse(c, 6.75f, 6.75f), br, 0.5f);
if (in.hoverLights && k < 2) {
@@ -708,7 +714,7 @@ void UpdateCalcText(Info& in) {
}
int HitLight(D2D1_POINT_2F p) {
- for (int k = 0; k < 2; k++) if (std::fabs(p.x - (19.f + k * 23)) <= 9 && std::fabs(p.y - 14) <= 9) return k;
+ for (int k = 0; k < 2; k++) if (std::fabs(p.x - ((semaforo::Aqua() ? 15.75f : 19.f) + k * 23)) <= 9 && std::fabs(p.y - (semaforo::Aqua() ? 15.75f : 14.f)) <= 9) return k;
return -1;
}
diff --git a/src/finder/main.cpp b/src/finder/main.cpp
index 5b113fb..7c05421 100644
--- a/src/finder/main.cpp
+++ b/src/finder/main.cpp
@@ -769,11 +769,38 @@ static void ToggleSection(int header) {
static bool SearchExpanded() { return g_searchFocus || !g_search.text.empty(); }
// Tahoe: um botão só para a visão (ícone da atual + ⌃⌄), como no macOS 26
-static bool WideToolbar() { return !g_tahoe && ClientDip().width - Lay::SIDEBAR_W >= 650; } // estreita: seletor de visão vira um botão (650 = botões da direita + voltar/avançar + um pedaço do título)
+static bool Golden();
+// macOS 27 Golden Gate: os quatro modos de visualização voltam a ficar abertos numa cápsula (se couber)
+static bool WideToolbar() { return Golden() ? ClientDip().width - Lay::SIDEBAR_W >= 560 : !g_tahoe && ClientDip().width - Lay::SIDEBAR_W >= 650; } // estreita: seletor de visão vira um botão (650 = botões da direita + voltar/avançar + um pedaço do título)
static D2D1_RECT_F ToolRect(int k) {
auto s = ClientDip();
float cy = Lay::TOOL_CY, h = Lay::BTN / 2;
+ if (Golden()) {
+ // macOS 27 (captura 2x do 512 Pixels): tudo a 8 de distância; Voltar/Avançar 73 × 36; os quatro modos numa
+ // cápsula de 160 (pílula de 33 × 26 a cada 39,17, a primeira a 4,5 da borda); Agrupar 47; Compartilhar,
+ // Etiquetas e ⋯ com 37 cada; busca num círculo de 36 a 8 da borda da janela
+ const float B = 36, G = 8;
+ auto bx = [&](float right, float w) { return D2D1_RECT_F{ right - w, cy - B / 2, right, cy + B / 2 }; };
+ if (k == TB_BACK) return { Lay::SIDEBAR_W + G, cy - B / 2, Lay::SIDEBAR_W + G + 36.5f, cy + B / 2 };
+ if (k == TB_FWD) return { Lay::SIDEBAR_W + G + 36.5f, cy - B / 2, Lay::SIDEBAR_W + G + 73, cy + B / 2 };
+ float right = s.width - 8;
+ float sw = std::min(307.f, std::max(160.f, (s.width - Lay::SIDEBAR_W) * 0.35f));
+ D2D1_RECT_F search = SearchExpanded() ? D2D1_RECT_F{ right - sw, cy - B / 2, right, cy + B / 2 } : bx(right, 36);
+ if (k == TB_SEARCH) return search;
+ D2D1_RECT_F action = bx(search.left - G, 37);
+ if (k == TB_ACTION) return action;
+ D2D1_RECT_F tag = bx(action.left, 37);
+ if (k == TB_TAG) return tag;
+ D2D1_RECT_F share = bx(tag.left, 37);
+ if (k == TB_SHARE) return share;
+ D2D1_RECT_F group = bx(share.left - G, 47);
+ if (k == TB_GROUP) return group;
+ if (!WideToolbar()) return k == TB_V_ICONS ? bx(group.left - G, B) : D2D1_RECT_F{ 0, 0, 0, 0 };
+ if (k < TB_V_ICONS || k > TB_V_GALLERY) return { 0, 0, 0, 0 };
+ float capL = group.left - G - 160, mid = capL + 21 + (k - TB_V_ICONS) * 39.17f;
+ return { mid - 16.5f, cy - 13, mid + 16.5f, cy + 13 };
+ }
if (g_tahoe) {
// Tahoe (guia, seções 31 e 42, medido): ilhas de vidro de 36 de altura (raio 18) com botões de 36 × 36,
// 8 entre as ilhas; Voltar/Avançar = dois segmentos colados; busca = cápsula de 39 × 38 que abre num campo
@@ -1690,7 +1717,8 @@ struct Palette {
static Palette ColorsBase();
static Palette Colors() { // Tahoe: o fundo da janela leva 10 % da cor do papel de parede (tahoe::Tint)
Palette p = ColorsBase();
- if (g_tahoe) p.content = tahoe::Tint(p.content);
+ if (g_tahoe && tahoe::Golden()) p.content = g_dark ? D2D1::ColorF(30 / 255.f, 30 / 255.f, 30 / 255.f, 1) : D2D1::ColorF(1, 1, 1, 1); // Golden Gate: branco puro (medido)
+ else if (g_tahoe) p.content = tahoe::Tint(p.content);
p.accent = tahoe::Accent(false); // Ajustes > Aparência > Cor de destaque (seleção, ícones da barra lateral...)
return p;
}
@@ -2054,6 +2082,7 @@ static void DrawLights(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br) {
if (lit) br->SetColor(fill[k]);
else br->SetColor(g_dark ? D2D1::ColorF(0.24f, 0.24f, 0.25f) : D2D1::ColorF(0.839f, 0.839f, 0.839f)); // inativa: cinza
dc->FillEllipse(D2D1::Ellipse(c, 7, 7), br);
+ semaforo::Gloss(dc, c, 7, br);
if (lit) br->SetColor(ring[k]);
else br->SetColor(g_dark ? D2D1::ColorF(0, 0, 0, 0.30f) : D2D1::ColorF(0.729f, 0.729f, 0.737f));
dc->DrawEllipse(D2D1::Ellipse(c, 6.75f, 6.75f), br, 0.5f);
@@ -2086,7 +2115,11 @@ static void DrawLights(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br) {
// Tahoe: painel de vidro da barra lateral, solto das bordas e com o raio concêntrico ao da janela
static float SidePanelR() { return std::max(10.f, tahoe::Radius(g_hwnd) - 7); }
+// macOS 27 Golden Gate (medido no Finder das capturas do 512 Pixels): a barra lateral volta a ir até a borda, uma coluna
+// de cor cheia (237,237,236) que encosta direto no conteúdo branco, sem divisa, sem painel de vidro e sem sombra
+static bool Golden() { return g_tahoe && tahoe::Golden(); }
static D2D1_RECT_F SidePanelRect() {
+ if (Golden()) return { 0, 0, std::floor(Lay::SIDEBAR_W), ClientDip().height };
float m = IsZoomed(g_hwnd) ? 6.f : 8.f; // Tahoe: painel flutuante com 8 de recuo (guia, seção 42)
return { m, m, std::floor(Lay::SIDEBAR_W) - 1, std::floor(ClientDip().height - m) }; // bordas no grid de pixels
@@ -2095,7 +2128,7 @@ static D2D1_RECT_F SidePanelRect() {
static float g_sideClipTop = Lay::SIDE_TOP; // Tahoe (cena): a lista rola até o alto do painel, por baixo dos botões
static void DrawSidebar(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidColorBrush* br) {
const float dx = g_tahoe ? 4.f : 0.f; // Tahoe: conteúdo um pouco para dentro do painel
- dc->PushAxisAlignedClip(D2D1::RectF(0, g_sideClipTop, Lay::SIDEBAR_W, ClientDip().height - (g_tahoe ? 9 : 0)), D2D1_ANTIALIAS_MODE_ALIASED);
+ dc->PushAxisAlignedClip(D2D1::RectF(0, g_sideClipTop, Lay::SIDEBAR_W, ClientDip().height - (g_tahoe && !Golden() ? 9 : 0)), D2D1_ANTIALIAS_MODE_ALIASED);
struct PopClip { ID2D1DeviceContext* d; ~PopClip() { d->PopAxisAlignedClip(); } } pop{ dc };
if (g_sideInsert >= 0) { // linha azul onde o favorito vai entrar
float y = -1;
@@ -2183,11 +2216,11 @@ static void DrawToolbar(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidCo
g_toolLuzAt = now;
}
cap(U(ToolRect(TB_BACK), ToolRect(TB_FWD)), 0);
- if (WideToolbar()) cap(U(ToolRect(TB_V_ICONS), ToolRect(TB_V_GALLERY)), 3);
+ if (WideToolbar()) cap(U(ToolRect(TB_V_ICONS), ToolRect(TB_V_GALLERY)), Golden() ? 4.5f : 3);
else cap(ToolRect(TB_V_ICONS), 0);
cap(ToolRect(TB_GROUP), 0);
cap(U(ToolRect(TB_SHARE), ToolRect(TB_ACTION)), 0); // Compartilhar, Etiquetas e ⋯ juntos (Tahoe)
- if (!SearchExpanded()) cap(ToolRect(TB_SEARCH), 0, 19); // busca recolhida: cápsula de 39 × 38
+ if (!SearchExpanded()) cap(ToolRect(TB_SEARCH), 0, Golden() ? 18.f : 19.f); // busca recolhida: cápsula de 39 × 38 (macOS 27: círculo de 36)
}
for (int k = 0; k < TB_COUNT; k++) {
if (k == TB_SEARCH && SearchExpanded()) continue;
@@ -2200,6 +2233,7 @@ static void DrawToolbar(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidCo
if (current || (enabled && g_hoverTool == k)) {
float a = current ? (g_dark ? 0.06f : 0.06f) : pal.hover.a * (g_pressTool == k ? 2 : 1);
if (g_tahoe && current) a = g_dark ? 0.14f : 0.08f; // segmento escolhido: pílula dentro da cápsula
+ if (Golden() && current) a = g_dark ? 0.16f : 0.075f; // macOS 27: pílula (230,230,230) na cápsula clara
br->SetColor(D2D1::ColorF(pal.hover.r, pal.hover.g, pal.hover.b, a));
float rr = g_tahoe ? (r.bottom - r.top) / 2 : 6;
dc->FillRoundedRectangle(D2D1::RoundedRect(r, rr, rr), br);
@@ -2207,7 +2241,7 @@ static void DrawToolbar(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidCo
br->SetColor(enabled ? icon : dim);
DrawToolIcon(dc, k, r, br);
}
- if (WideToolbar() && !g_tahoe) { // divisória fina entre dois botões de visão quando nenhum dos dois é o atual
+ if (WideToolbar() && (!g_tahoe || Golden())) { // divisória fina entre dois botões de visão quando nenhum dos dois é o atual
int cur = g_view == View::Icons ? 0 : g_view == View::List ? 1 : g_view == View::Columns ? 2 : 3;
br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.07f) : D2D1::ColorF(0, 0, 0, 0.10f));
for (int i = 0; i < 3; i++) {
@@ -2306,6 +2340,7 @@ static float ThumbAlpha(const std::wstring& key) {
static void DrawEntryIcon(ID2D1DeviceContext* dc, const Entry& e, D2D1_RECT_F ir, ID2D1SolidColorBrush* br) {
if (e.dir && e.path.size() == 3 && e.path[1] == L':') { DrawDrive(dc, ir, br); return; }
if (e.dir && pastacor::Draw(dc, e.path, ir, g_tahoe)) return; // cor e símbolo escolhidos (Personalizar Pasta)
+ if (e.dir && !e.emblem && g_tahoe && pastacor::DrawColor(dc, tahoe::FolderColor(), ir, g_tahoe)) return; // Aparência > Cor das pastas
if (e.dir) { DrawFolder(dc, ir, e.emblem, br); return; }
if (!g_showThumbs && !IsAppFile(e)) { DrawDocument(dc, ir, e.name, br); return; } // "Mostrar prévia do ícone" desligado
float icon = ir.right - ir.left;
@@ -2335,6 +2370,7 @@ static void DrawItemIcon(ID2D1DeviceContext* dc, int i, D2D1_RECT_F ir, ID2D1Sol
// Ícone grande (prévia das colunas e da galeria): pede uma miniatura em alta resolução à parte.
static void DrawBigIcon(ID2D1DeviceContext* dc, const Entry& e, D2D1_RECT_F box, ID2D1SolidColorBrush* br) {
if (e.dir && pastacor::Draw(dc, e.path, box, g_tahoe)) return;
+ if (e.dir && !e.emblem && g_tahoe && pastacor::DrawColor(dc, tahoe::FolderColor(), box, g_tahoe)) return;
if (e.dir) { DrawFolder(dc, box, e.emblem, br); return; }
std::wstring big = e.Key() + L"|G";
auto it = g_images.find(big);
@@ -2943,7 +2979,10 @@ static std::wstring DefaultAppName(const Entry& e) {
return L"";
}
-const float QL_TITLE_H = 40;
+// macOS 27 (captura Finder-Quick-Look, 2x): barra de título de 38, moldura clara de 5 em volta da prévia, cantos 16 na
+// janela e 12 na foto; fechar = círculo escuro de 16 a 9 da borda, título em negrito de 15 à esquerda, "Abrir com…"
+// numa cápsula de 26 a 7 da borda
+#define QL_TITLE_H (semaforo::Aqua() ? 38.f : 40.f)
static void RunVerb(const char* verb);
static ID2D1Bitmap* QlImage(const Entry& e) { // miniatura grande, se já chegou (senão a pequena)
@@ -3035,12 +3074,13 @@ static D2D1_RECT_F QlPanel() {
float cx = s.width / 2, cy = s.height / 2 + 8;
return { cx - w / 2, cy - h / 2, cx + w / 2, cy + h / 2 };
}
-static D2D1_RECT_F QlCloseRect() { auto r = QlPanel(); return { r.left + 10, r.top + 10, r.left + 30, r.top + 30 }; }
+static D2D1_RECT_F QlCloseRect() { auto r = QlPanel(); if (semaforo::Aqua()) return { r.left + 9, r.top + 11, r.left + 25, r.top + 27 }; return { r.left + 10, r.top + 10, r.left + 30, r.top + 30 }; }
static D2D1_RECT_F QlOpenRect() {
auto r = QlPanel();
int i = QlItem();
std::wstring app = i >= 0 ? DefaultAppName(g_items[i]) : L"";
float w = std::clamp(TextWidth(app.empty() ? Tr(L"Abrir") : Tr(L"Abrir com ") + app, g_tfQlButton) + 22, 60.f, 220.f);
+ if (semaforo::Aqua()) return { r.right - 7 - w - 8, r.top + 6, r.right - 7, r.top + 32 };
return { r.right - 12 - w, r.top + 8, r.right - 12, r.top + 32 };
}
static D2D1_RECT_F QlShareRect() { auto o = QlOpenRect(); return { o.left - 36, o.top, o.left - 8, o.bottom }; }
@@ -3099,9 +3139,33 @@ static void QlClose() { // volta para o ícone; o timer 6 desenha e no fim some
Invalidate();
}
+// Golden Gate: o Quick Look é o do Shell (janela própria de vidro fosco, arrastável, por cima de tudo, como no Mac).
+// O Finder fica com o foco: espaço fecha, Esc fecha e as setas trocam o arquivo mostrado. Vídeo e música também vão
+// para lá (o Shell toca com a barra do QuickTime); o painel daqui fica para os outros temas.
+static std::wstring g_qlExtPath;
+static HWND QlShellWnd() { HWND q = FindWindowW(L"ShellQuickLook", nullptr); return q && IsWindowVisible(q) ? q : nullptr; }
+static bool QlSend(const std::wstring& p) {
+ HWND sh = FindWindowW(L"ShellMensagens", nullptr);
+ if (!sh) return false;
+ COPYDATASTRUCT cd{ 0x514C4F4B /*'QLOK'*/, (DWORD)((p.size() + 1) * sizeof(wchar_t)), (PVOID)p.c_str() };
+ DWORD_PTR r = 0;
+ if (!SendMessageTimeoutW(sh, WM_COPYDATA, (WPARAM)g_hwnd, (LPARAM)&cd, SMTO_ABORTIFHUNG, 800, &r) || !r) return false;
+ g_qlExtPath = p;
+ return true;
+}
+static void QlSyncShell() { // a seleção mudou com o Quick Look do Shell aberto: mostra o novo
+ if (g_qlExtPath.empty()) return;
+ if (!QlShellWnd()) { g_qlExtPath.clear(); return; }
+ int i = QlItem();
+ if (i < 0 || !_wcsicmp(g_items[i].path.c_str(), g_qlExtPath.c_str())) return;
+ QlSend(g_items[i].path); // vídeo e música também tocam no Quick Look do Shell
+}
+
static void QlToggle() {
+ if (!g_qlExtPath.empty() && QlShellWnd()) { QlSend(L""); return; }
if (g_ql) { QlClose(); return; }
if (QlItem() < 0) return;
+ if (Golden() && QlSend(g_items[QlItem()].path)) return; // tudo no Quick Look do Shell (vídeo e música também)
g_ql = true;
g_qlClosing = false;
g_qlFrom = IconDoc(QlItem());
@@ -3114,6 +3178,7 @@ static void QlToggle() {
Invalidate();
}
+static IDWriteTextFormat* Format(const wchar_t* family, float size, DWRITE_FONT_WEIGHT weight, DWRITE_TEXT_ALIGNMENT align, DWRITE_PARAGRAPH_ALIGNMENT para, bool wrap);
static void DrawQuickLook(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidColorBrush* br) {
int i = QlItem();
if (i < 0) { g_ql = false; return; }
@@ -3154,14 +3219,30 @@ static void DrawQuickLook(ID2D1DeviceContext* dc, const Palette& pal, ID2D1Solid
br->SetColor(D2D1::ColorF(0, 0, 0, 0.03f));
dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left - k * 2.5f, r.top - k * 1.5f + 10, r.right + k * 2.5f, r.bottom + k * 3.f + 10), 12 + k * 2.f, 12 + k * 2.f), br);
}
+ const bool gg = semaforo::Aqua();
D2D1_COLOR_F bg = g_dark ? D2D1::ColorF(0.11f, 0.11f, 0.12f, 1) : D2D1::ColorF(0.97f, 0.97f, 0.975f, 1);
+ if (gg) bg = g_dark ? D2D1::ColorF(0.18f, 0.18f, 0.19f, 1) : D2D1::ColorF(0.945f, 0.94f, 0.935f, 1); // moldura clara
br->SetColor(bg);
- dc->FillRoundedRectangle(D2D1::RoundedRect(r, 12, 12), br);
+ dc->FillRoundedRectangle(D2D1::RoundedRect(r, gg ? 16.f : 12.f, gg ? 16.f : 12.f), br);
+ if (gg) { // vidro: a barra escurece no meio e clareia em cima e perto da foto (medido: 240 -> 196 -> 238), fio claro em cima
+ D2D1_COLOR_F f1 = g_dark ? D2D1::ColorF(0.13f, 0.13f, 0.14f, 1) : D2D1::ColorF(0.80f, 0.78f, 0.76f, 1);
+ D2D1_GRADIENT_STOP st[3] = { { 0, bg }, { 0.45f, f1 }, { 1, bg } };
+ ID2D1GradientStopCollection* gs = nullptr; ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(dc->CreateGradientStopCollection(st, 3, &gs)) && SUCCEEDED(dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ 0, r.top }, { 0, r.top + QL_TITLE_H }), gs, &lb)))
+ dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left, r.top, r.right, r.top + QL_TITLE_H + 16), 16, 16), lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ br->SetColor(bg);
+ dc->FillRectangle(D2D1::RectF(r.left, r.top + QL_TITLE_H, r.right, r.top + QL_TITLE_H + 16), br);
+ br->SetColor(D2D1::ColorF(1, 1, 1, g_dark ? 0.18f : 0.7f));
+ dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.5f, r.top + 0.5f, r.right - 0.5f, r.bottom - 0.5f), 15.5f, 15.5f), br, 1);
+ }
ID2D1Bitmap* bmp = QlImage(e);
bool text = !e.dir && IsTextFile(e);
bool video = QlVideoOn(e), audio = !video && QlAudioOn(e);
D2D1_RECT_F body{ r.left, r.top + QL_TITLE_H, r.right, r.bottom };
+ if (gg) body = D2D1::RectF(r.left + 5, r.top + QL_TITLE_H, r.right - 5, r.bottom - 5); // macOS 27: moldura de 5
if (video) { // vídeo: quadro atual (ou a miniatura enquanto o primeiro não chega) no corpo todo
ID2D1RoundedRectangleGeometry* clip = nullptr;
ID2D1Factory* f = nullptr; dc->GetFactory(&f);
@@ -3203,11 +3284,12 @@ static void DrawQuickLook(ID2D1DeviceContext* dc, const Palette& pal, ID2D1Solid
} else if (bmp) { // foto: ocupa o corpo todo
ID2D1RoundedRectangleGeometry* clip = nullptr;
ID2D1Factory* f = nullptr; dc->GetFactory(&f);
- f->CreateRoundedRectangleGeometry(D2D1::RoundedRect(r, 12, 12), &clip);
+ f->CreateRoundedRectangleGeometry(gg ? D2D1::RoundedRect(body, 12, 12) : D2D1::RoundedRect(r, 12, 12), &clip);
ID2D1Layer* cl = nullptr; dc->CreateLayer(nullptr, &cl);
dc->PushLayer(D2D1::LayerParameters(D2D1::InfiniteRect(), clip), cl);
auto sz = bmp->GetPixelSize();
- float k = std::min((body.right - body.left) / sz.width, (body.bottom - body.top) / sz.height);
+ float k = gg ? std::max((body.right - body.left) / sz.width, (body.bottom - body.top) / sz.height) // macOS 27: a foto preenche a moldura
+ : std::min((body.right - body.left) / sz.width, (body.bottom - body.top) / sz.height);
float w = sz.width * k, h = sz.height * k, cx = (body.left + body.right) / 2, cy = (body.top + body.bottom) / 2;
DrawBigIcon(dc, e, D2D1::RectF(cx - w / 2, cy - h / 2, cx + w / 2, cy + h / 2), br);
dc->PopLayer(); cl->Release(); clip->Release(); f->Release();
@@ -3250,23 +3332,34 @@ static void DrawQuickLook(ID2D1DeviceContext* dc, const Palette& pal, ID2D1Solid
ID2D1Layer* cl = nullptr; dc->CreateLayer(nullptr, &cl);
dc->PushLayer(D2D1::LayerParameters(bar, clip), cl);
br->SetColor(g_dark ? D2D1::ColorF(0.19f, 0.19f, 0.2f, bmp || video ? 0.86f : 1.f) : D2D1::ColorF(0.93f, 0.93f, 0.935f, bmp || video ? 0.86f : 1.f));
- dc->FillRectangle(bar, br);
+ if (!gg) dc->FillRectangle(bar, br); // macOS 27: a barra é a própria moldura de vidro (já pintada)
dc->PopLayer(); cl->Release(); clip->Release(); f->Release();
}
- br->SetColor(pal.line);
- dc->DrawLine({ r.left, bar.bottom - 0.5f }, { r.right, bar.bottom - 0.5f }, br, 1);
+ if (!gg) { br->SetColor(pal.line); dc->DrawLine({ r.left, bar.bottom - 0.5f }, { r.right, bar.bottom - 0.5f }, br, 1); }
auto cr = QlCloseRect();
float ccx = (cr.left + cr.right) / 2, ccy = (cr.top + cr.bottom) / 2;
+ if (gg) { // macOS 27: círculo escuro cheio com o × claro
+ br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.75f) : D2D1::ColorF(0.24f, 0.22f, 0.21f, 0.9f));
+ dc->FillEllipse(D2D1::Ellipse({ ccx, ccy }, 8, 8), br);
+ br->SetColor(bg);
+ Line(dc, br, ccx - 2.8f, ccy - 2.8f, ccx + 2.8f, ccy + 2.8f, 1.6f);
+ Line(dc, br, ccx - 2.8f, ccy + 2.8f, ccx + 2.8f, ccy - 2.8f, 1.6f);
+ } else {
br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.16f) : D2D1::ColorF(0, 0, 0, 0.10f));
dc->FillEllipse(D2D1::Ellipse({ ccx, ccy }, 9, 9), br);
br->SetColor(pal.text2);
Line(dc, br, ccx - 3, ccy - 3, ccx + 3, ccy + 3, 1.5f);
Line(dc, br, ccx - 3, ccy + 3, ccx + 3, ccy - 3, 1.5f);
+ }
auto orr = QlOpenRect(), sr = QlShareRect();
br->SetColor(pal.text);
+ if (gg) { // macOS 27: título em negrito de 15 à esquerda, logo depois do fechar
+ static IDWriteTextFormat* tfT = Format(g_uiFamily.c_str(), 15, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, false);
+ dc->DrawTextW(e.label.c_str(), (UINT32)e.label.size(), tfT, D2D1::RectF(cr.right + 9, bar.top, sr.left - 8, bar.bottom), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ } else
dc->DrawTextW(e.label.c_str(), (UINT32)e.label.size(), g_tfQlTitle, D2D1::RectF(cr.right + 12, bar.top, sr.left - 8, bar.bottom), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.07f));
- dc->FillRoundedRectangle(D2D1::RoundedRect(orr, 6, 6), br);
+ dc->FillRoundedRectangle(D2D1::RoundedRect(orr, gg ? 13.f : 6.f, gg ? 13.f : 6.f), br);
std::wstring app = DefaultAppName(e);
std::wstring openLabel = e.dir ? Tr(L"Abrir") : app.empty() ? Tr(L"Abrir") : Tr(L"Abrir com ") + app;
br->SetColor(pal.text);
@@ -3308,6 +3401,168 @@ static void DrawScopeBar(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidC
static void DrawTrashBar(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidColorBrush* br);
static bool g_trashPress;
+// ---------------------------------------------------------------------------
+// Ir para a Pasta (Ctrl+Shift+G), como o do macOS 27 (captura Finder-Go-To-Folder, 2x): painel de 460 × 183 no alto da
+// janela, cantos 16; campo de 34 com o texto de 17 a 16 da borda e o × cinza à direita, divisa embaixo; "Ir para:" em
+// cinza e as pastas sugeridas em linhas de 22 com o caminho separado por "›" e a parte digitada em negrito; a escolhida
+// numa pílula azul (cantos 11, a 10 das bordas). "~" é a pasta do usuário.
+static bool g_goOpen;
+static TextField g_go;
+static std::vector<std::wstring> g_goSugg;
+static int g_goSel;
+
+static std::wstring GoExpand(std::wstring t) {
+ wchar_t prof[MAX_PATH] = {};
+ GetEnvironmentVariableW(L"USERPROFILE", prof, MAX_PATH);
+ if (!t.empty() && t[0] == L'~') t = std::wstring(prof) + t.substr(1);
+ for (auto& c : t) if (c == L'/') c = L'\\';
+ wchar_t buf[2048] = {};
+ if (ExpandEnvironmentStringsW(t.c_str(), buf, 2048)) t = buf;
+ return t;
+}
+
+static void GoRefresh() {
+ g_goSugg.clear();
+ g_goSel = 0;
+ std::wstring full = GoExpand(g_go.text);
+ if (full.empty()) return;
+ size_t cut = full.find_last_of(L'\\');
+ std::wstring dir = cut == std::wstring::npos ? full : full.substr(0, cut + 1), pre = cut == std::wstring::npos ? L"" : full.substr(cut + 1);
+ if (dir.size() == 2 && dir[1] == L':') dir += L'\\';
+ WIN32_FIND_DATAW fd;
+ HANDLE h = FindFirstFileW((dir + L"*").c_str(), &fd);
+ if (h == INVALID_HANDLE_VALUE) return;
+ do {
+ if (!(fd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) || fd.cFileName[0] == L'.' || (fd.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)) continue;
+ if (_wcsnicmp(fd.cFileName, pre.c_str(), pre.size())) continue;
+ g_goSugg.push_back(dir + fd.cFileName);
+ } while (FindNextFileW(h, &fd) && g_goSugg.size() < 6);
+ FindClose(h);
+}
+
+static void GoOpen(bool on) {
+ g_goOpen = on;
+ if (on) { g_go.SetText(L"", false); GoRefresh(); g_caretOn = true; }
+ Invalidate();
+}
+
+static void GoAccept() {
+ std::wstring target = g_goSel >= 0 && g_goSel < (int)g_goSugg.size() ? g_goSugg[g_goSel] : GoExpand(g_go.text);
+ while (target.size() > 3 && target.back() == L'\\') target.pop_back();
+ DWORD a = GetFileAttributesW(target.c_str());
+ if (a == INVALID_FILE_ATTRIBUTES) { MessageBeep(MB_ICONWARNING); return; }
+ GoOpen(false);
+ if (a & FILE_ATTRIBUTE_DIRECTORY) Navigate(target);
+ else { size_t k = target.find_last_of(L'\\'); Navigate(target.substr(0, k), true, target.substr(k + 1)); }
+}
+
+static D2D1_RECT_F GoRect() {
+ auto s = ClientDip();
+ float w = std::min(460.f, s.width - 20), x = (s.width - w) / 2;
+ return D2D1::RectF(x, 8, x + w, 8 + 183);
+}
+
+static bool GoKey(UINT vk, bool shift, bool ctrl) {
+ if (!g_goOpen) return false;
+ if (vk == VK_ESCAPE) { GoOpen(false); return true; }
+ if (vk == VK_RETURN) { GoAccept(); return true; }
+ if (vk == VK_DOWN) { if (!g_goSugg.empty()) g_goSel = std::min(g_goSel + 1, (int)g_goSugg.size() - 1); Invalidate(); return true; }
+ if (vk == VK_UP) { g_goSel = std::max(g_goSel - 1, 0); Invalidate(); return true; }
+ if (vk == VK_TAB && g_goSel >= 0 && g_goSel < (int)g_goSugg.size()) { // completa com a escolhida
+ g_go.SetText(g_goSugg[g_goSel] + L"\\", false); g_go.Select((int)g_go.text.size(), (int)g_go.text.size()); GoRefresh(); Invalidate(); return true;
+ }
+ if (g_go.OnKey(vk, shift, ctrl)) { GoRefresh(); Invalidate(); }
+ return true; // com o painel aberto, as teclas não vão para a lista de arquivos
+}
+
+static bool GoClick(D2D1_POINT_2F p) {
+ if (!g_goOpen) return false;
+ D2D1_RECT_F r = GoRect();
+ if (!In(r, p)) { GoOpen(false); return true; }
+ if (p.y < r.top + 34 && p.x > r.right - 40) { GoOpen(false); return true; } // o ×
+ float y0 = r.top + 68;
+ int i = (int)std::floor((p.y - y0) / 22);
+ if (p.y >= y0 && i >= 0 && i < (int)g_goSugg.size()) { g_goSel = i; GoAccept(); }
+ return true;
+}
+
+static void DrawGoTo(ID2D1DeviceContext* dc, const Palette& pal, ID2D1SolidColorBrush* br) {
+ if (!g_goOpen) return;
+ D2D1_RECT_F r = GoRect();
+ static IDWriteTextFormat *tfField, *tfRow, *tfRowB, *tfHead;
+ if (!tfField) {
+ tfField = Format(g_uiFamily.c_str(), 17, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, false);
+ tfRow = Format(g_uiFamily.c_str(), 15, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, false);
+ tfRowB = Format(g_uiFamily.c_str(), 15, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, false);
+ tfHead = Format(g_uiFamily.c_str(), 13, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, false);
+ }
+ for (int k = 4; k >= 1; k--) { // sombra
+ br->SetColor(D2D1::ColorF(0, 0, 0, g_dark ? 0.10f : 0.05f));
+ dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left - k * 1.5f, r.top - k + 4, r.right + k * 1.5f, r.bottom + k * 2.5f), 16 + k, 16 + k), br);
+ }
+ br->SetColor(g_dark ? D2D1::ColorF(0.17f, 0.17f, 0.18f, 1) : D2D1::ColorF(0.98f, 0.98f, 0.98f, 1));
+ dc->FillRoundedRectangle(D2D1::RoundedRect(r, 16, 16), br);
+ br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.14f) : D2D1::ColorF(0, 0, 0, 0.10f));
+ dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.5f, r.top + 0.5f, r.right - 0.5f, r.bottom - 0.5f), 15.5f, 15.5f), br, 1);
+ // campo
+ D2D1_RECT_F fr = D2D1::RectF(r.left + 16, r.top, r.right - 44, r.top + 34);
+ ID2D1SolidColorBrush *sel = nullptr, *txt = nullptr;
+ dc->CreateSolidColorBrush(D2D1::ColorF(pal.accent.r, pal.accent.g, pal.accent.b, 0.30f), &sel);
+ dc->CreateSolidColorBrush(pal.text, &txt);
+ if (g_go.text.empty()) {
+ br->SetColor(pal.text2);
+ std::wstring ph = Tr(L"Digite um caminho");
+ dc->DrawTextW(ph.c_str(), (UINT32)ph.size(), tfField, fr, br);
+ }
+ if (txt && sel) g_go.Draw(dc, tfField, fr, txt, sel, txt, g_caretOn, false);
+ if (sel) sel->Release();
+ if (txt) txt->Release();
+ D2D1_POINT_2F xc{ r.right - 24, r.top + 17 }; // × cinza
+ br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.45f) : D2D1::ColorF(0, 0, 0, 0.45f));
+ dc->FillEllipse(D2D1::Ellipse(xc, 7.5f, 7.5f), br);
+ br->SetColor(g_dark ? D2D1::ColorF(0.17f, 0.17f, 0.18f, 1) : D2D1::ColorF(1, 1, 1, 1));
+ dc->DrawLine({ xc.x - 3, xc.y - 3 }, { xc.x + 3, xc.y + 3 }, br, 1.5f);
+ dc->DrawLine({ xc.x - 3, xc.y + 3 }, { xc.x + 3, xc.y - 3 }, br, 1.5f);
+ br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.10f) : D2D1::ColorF(0, 0, 0, 0.10f));
+ dc->FillRectangle(D2D1::RectF(r.left, r.top + 34, r.right, r.top + 35), br);
+ if (g_goSugg.empty()) return;
+ br->SetColor(pal.text2);
+ std::wstring head = Tr(L"Ir para:");
+ dc->DrawTextW(head.c_str(), (UINT32)head.size(), tfHead, D2D1::RectF(r.left + 18, r.top + 46, r.right - 18, r.top + 66), br);
+ std::wstring typed = GoExpand(g_go.text);
+ size_t cut = typed.find_last_of(L'\\');
+ size_t preLen = cut == std::wstring::npos ? 0 : typed.size() - cut - 1;
+ for (int i = 0; i < (int)g_goSugg.size(); i++) {
+ float y = r.top + 68 + i * 22;
+ if (y + 22 > r.bottom - 4) break;
+ bool on = i == g_goSel;
+ if (on) { br->SetColor(pal.accent); dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 10, y, r.right - 10, y + 22), 11, 11), br); }
+ // as três últimas partes do caminho, separadas por "›"; a parte digitada do nome em negrito
+ std::vector<std::wstring> parts;
+ std::wstring p = g_goSugg[i];
+ size_t st = 0;
+ while (st < p.size()) { size_t e = p.find(L'\\', st); if (e == std::wstring::npos) e = p.size(); if (e > st) parts.push_back(p.substr(st, e - st)); st = e + 1; }
+ if (parts.size() > 3) parts.erase(parts.begin(), parts.end() - 3);
+ float x = r.left + 18;
+ D2D1_COLOR_F col = on ? D2D1::ColorF(1, 1, 1, 1) : pal.text;
+ for (size_t k = 0; k < parts.size(); k++) {
+ bool last = k + 1 == parts.size();
+ auto draw = [&](const std::wstring& s, IDWriteTextFormat* tf) {
+ IDWriteTextLayout* lay = nullptr;
+ if (FAILED(gfx::dw->CreateTextLayout(s.c_str(), (UINT32)s.size(), tf, 1000, 22, &lay))) return;
+ DWRITE_TEXT_METRICS m{}; lay->GetMetrics(&m);
+ br->SetColor(col);
+ dc->DrawTextLayout({ x, y }, lay, br);
+ x += m.widthIncludingTrailingWhitespace;
+ lay->Release();
+ };
+ if (last && preLen > 0 && preLen <= parts[k].size()) { draw(parts[k].substr(0, preLen), tfRowB); draw(parts[k].substr(preLen), tfRow); }
+ else draw(parts[k], tfRow);
+ if (!last) { x += 6; draw(L"›", tfRow); x += 6; }
+ }
+ }
+}
+
static void Render() {
QlSyncMedia();
media::UpdateFrame();
@@ -3328,7 +3583,14 @@ static void Render() {
dc->Clear(D2D1::ColorF(0, 0, 0, 0));
float winR = g_tahoe ? tahoe::Radius(g_hwnd) : 0;
bool winClip = g_tahoe && tahoe::PushWindowClip(dc, s, winR);
- if (g_tahoe) {
+ if (Golden()) {
+ pal.bar = pal.content;
+ tahoe::SetPanel(g_hwnd, D2D1::RectF(0, 0, 0, 0), 0);
+ br->SetColor(g_dark ? D2D1::ColorF(43 / 255.f, 41 / 255.f, 40 / 255.f, 1) : D2D1::ColorF(237 / 255.f, 237 / 255.f, 236 / 255.f, 1));
+ dc->FillRectangle(D2D1::RectF(0, 0, Lay::SIDEBAR_W, s.height), br);
+ br->SetColor(pal.content);
+ dc->FillRectangle(D2D1::RectF(Lay::SIDEBAR_W, 0, s.width, s.height), br);
+ } else if (g_tahoe) {
// Tahoe: a janela inteira na cor do conteúdo, com a barra lateral num painel de vidro flutuante
// (o desfoque da janela aparece só dentro dele); barras de cima e de baixo sem faixa nem divisa
pal.bar = pal.content;
@@ -3375,7 +3637,8 @@ static void Render() {
}
br->SetColor(pal.bar); // status também um tom mais claro; a barra de caminho fica na cor da lista
dc->FillRectangle(D2D1::RectF(Lay::SIDEBAR_W, s.height - Lay::STATUS_H, s.width, s.height), br);
- if (g_tahoe) {
+ if (Golden()) {
+ } else if (g_tahoe) {
tahoe::Panel(dc, br, SidePanelRect(), SidePanelR(), g_dark);
} else {
br->SetColor(g_dark ? D2D1::ColorF(0, 0, 0, 0.6f) : D2D1::ColorF(0, 0, 0, 0.12f)); // divisas escuras
@@ -3412,7 +3675,9 @@ static void Render() {
DrawScopeBar(dc, pal, br);
DrawTrashBar(dc, pal, br);
if (g_viewOpts) DrawViewOptions(dc, pal, br);
+ QlSyncShell();
if (g_ql) DrawQuickLook(dc, pal, br);
+ DrawGoTo(dc, pal, br);
if (winClip) { dc->PopLayer(); tahoe::WindowRim(dc, br, s, winR, g_dark); }
br->Release();
@@ -4839,6 +5104,8 @@ static bool HandleKey(UINT vk) {
if (g_pickName.OnKey(vk, shift, ctrl)) { Invalidate(); return true; }
return false;
}
+ if (GoKey(vk, shift, ctrl)) return true; // Ir para a Pasta aberto
+ if (ctrl && shift && vk == 'G') { GoOpen(true); return true; }
if (g_pick.on && !g_searchFocus && vk == VK_RETURN) { PickerAccept(-1); return true; }
if (g_pick.on && !g_searchFocus && vk == VK_ESCAPE && !g_ql && !g_viewOpts) { PickerCancel(); return true; }
if (g_searchFocus) {
@@ -4849,6 +5116,7 @@ static bool HandleKey(UINT vk) {
return false;
}
+ if (vk == VK_ESCAPE && !g_qlExtPath.empty() && QlShellWnd()) { QlSend(L""); return true; }
if (g_ql && vk == VK_ESCAPE) { QlClose(); return true; }
if (g_viewOpts && vk == VK_ESCAPE) { g_viewOpts = false; Invalidate(); return true; }
if (g_searching && vk == VK_ESCAPE) { ExitSearch(); return true; }
@@ -5000,7 +5268,7 @@ static void ApplyWindowTheme() {
tahoe::Frame(g_hwnd, true);
RECT rc; GetClientRect(g_hwnd, &rc);
tahoe::Size(g_hwnd, (float)rc.right, (float)rc.bottom, g_dark);
- shadow::SetRadius(tahoe::WINDOW_R);
+ shadow::SetRadius(tahoe::WindowR());
return;
}
tahoe::Frame(g_hwnd, false);
@@ -5192,6 +5460,7 @@ static LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {
return 0;
case WM_LBUTTONDOWN: {
D2D1_POINT_2F p = ToDip(GET_X_LPARAM(l), GET_Y_LPARAM(l));
+ if (GoClick(p)) return 0; // Ir para a Pasta
if (QlClick(p)) return 0; // clique no painel do Quick Look
if (ViewOptsClick(p)) return 0; // clique no painel de Opções de Visualização
if (PickerClick(p)) return 0; // barra de Abrir/Salvar
@@ -5420,7 +5689,8 @@ static LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {
break;
case WM_CHAR:
if (w < 32) return 0;
- if (g_renameIdx >= 0) { g_rename.OnChar((wchar_t)w); Invalidate(); }
+ if (g_goOpen) { g_go.OnChar((wchar_t)w); GoRefresh(); Invalidate(); }
+ else if (g_renameIdx >= 0) { g_rename.OnChar((wchar_t)w); Invalidate(); }
else if (g_pickNameFocus) { g_pickName.OnChar((wchar_t)w); Invalidate(); }
else if (g_searchFocus) { g_search.OnChar((wchar_t)w); OnSearchChanged(); Invalidate(); }
else if (GetKeyState(VK_CONTROL) >= 0 && w != L' ') TypeAhead((wchar_t)w); // espaço é o Quick Look
diff --git a/src/finder/pastacor.cpp b/src/finder/pastacor.cpp
index d5d144e..d2f7d45 100644
--- a/src/finder/pastacor.cpp
+++ b/src/finder/pastacor.cpp
@@ -224,9 +224,19 @@ void Set(const std::wstring& path, int color, const std::wstring& emoji, bool ta
ApplySystemIcon(path, &in, tahoe);
}
+bool DrawColor(ID2D1DeviceContext* dc, int color, D2D1_RECT_F box, bool tahoe) {
+ if (color < 0 || color >= COUNT) return false;
+ Info in; in.color = color;
+ return DrawInfo(dc, in, box, tahoe);
+}
+
bool Draw(ID2D1DeviceContext* dc, const std::wstring& path, D2D1_RECT_F box, bool tahoe) {
Info in;
if (!Get(path, in)) return false;
+ return DrawInfo(dc, in, box, tahoe);
+}
+
+bool DrawInfo(ID2D1DeviceContext* dc, const Info& in, D2D1_RECT_F box, bool tahoe) {
if (g_bmpDc != dc) { for (auto& [k, b] : g_bmps) if (b) b->Release(); g_bmps.clear(); g_bmpDc = dc; }
std::wstring key = std::wstring(tahoe ? L"t|" : L"s|") + std::to_wstring(in.color);
auto it = g_bmps.find(key);
diff --git a/src/finder/pastacor.h b/src/finder/pastacor.h
index bc3a0be..dd719b2 100644
--- a/src/finder/pastacor.h
+++ b/src/finder/pastacor.h
@@ -14,5 +14,8 @@ bool Get(const std::wstring& path, Info& out);
void Set(const std::wstring& path, int color, const std::wstring& emoji, bool tahoe);
// desenha a pasta personalizada (false: a pasta não tem personalização)
bool Draw(ID2D1DeviceContext* dc, const std::wstring& path, D2D1_RECT_F box, bool tahoe);
+bool DrawInfo(ID2D1DeviceContext* dc, const Info& in, D2D1_RECT_F box, bool tahoe);
+// pasta comum retingida numa das cores (Aparência > Cor das pastas, macOS 27)
+bool DrawColor(ID2D1DeviceContext* dc, int color, D2D1_RECT_F box, bool tahoe);
const std::vector<std::wstring>& Emojis();
}
diff --git a/src/finder/tahoe.cpp b/src/finder/tahoe.cpp
index 6e3f08b..2bcc959 100644
--- a/src/finder/tahoe.cpp
+++ b/src/finder/tahoe.cpp
@@ -59,7 +59,8 @@ struct Fx : winrt::implements<Fx, IGraphicsEffect, IGraphicsEffectSource, abifx:
HRESULT __stdcall GetSourceCount(UINT* c) noexcept override { *c = 1; return S_OK; }
};
-bool g_on = false, g_reduce = false, g_tint = true;
+bool g_on = false, g_reduce = false, g_tint = true, g_golden = false;
+int g_folderColor = -1; // Aparência > Cor das pastas (cor_pastas; -1 = automática)
std::wstring g_accent = L"azul"; // Ajustes > Aparência > Cor de destaque (destaque=)
FILETIME g_stamp{};
bool g_read = false;
@@ -84,19 +85,24 @@ std::wstring Path() {
bool ReadOn() {
FILE* fp = nullptr;
if (_wfopen_s(&fp, Path().c_str(), L"r, ccs=UTF-8") || !fp) return false;
- bool liquid = false, reduce = false;
+ bool liquid = false, reduce = false, golden = false;
+ int folder = -1;
wchar_t line[512];
while (fgetws(line, 512, fp)) {
std::wstring s = line;
while (!s.empty() && (s.back() == L'\n' || s.back() == L'\r' || s.back() == L' ')) s.pop_back();
if (s == L"liquid_glass=1") liquid = true;
if (s == L"reduzir_transparencia=1") reduce = true;
+ if (s == L"golden_gate=1") golden = true;
+ if (s.rfind(L"cor_pastas=", 0) == 0) folder = _wtoi(s.c_str() + 11);
if (s.rfind(L"destaque=", 0) == 0) g_accent = s.substr(9);
if (s == L"tingir_janelas=0") g_tint = false;
if (s == L"tingir_janelas=1") g_tint = true;
}
fclose(fp);
g_reduce = reduce;
+ g_golden = liquid && golden;
+ g_folderColor = folder;
return liquid;
}
@@ -149,7 +155,7 @@ D2D1_COLOR_F tahoe::Accent(bool dark) {
if (!g_read) Reload();
static const std::pair<const wchar_t*, UINT32> cols[] = {
{ L"azul", 0x007AFF }, { L"roxo", 0x953D96 }, { L"rosa", 0xF74F9E }, { L"vermelho", 0xE0383E },
- { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C } };
+ { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C }, { L"lavanda", 0x98A8D9 } }; // lavanda: a 10ª cor do macOS 27
UINT32 c = 0x007AFF;
for (auto& [n, v] : cols) if (g_accent == n) c = v;
float r = ((c >> 16) & 255) / 255.f, g = ((c >> 8) & 255) / 255.f, b = (c & 255) / 255.f;
@@ -211,11 +217,12 @@ bool tahoe::Reload() {
if (g_read && !CompareFileTime(&fa.ftLastWriteTime, &g_stamp)) return false;
g_stamp = fa.ftLastWriteTime;
std::wstring accWas = g_accent;
- bool was = g_on, first = !g_read;
+ bool was = g_on, goldWas = g_golden, first = !g_read;
+ int folderWas = g_folderColor;
g_read = true;
g_on = ReadOn();
- if (first || was != g_on) Log(L"tema: liquid_glass=%d reduzir=%d (%ls)", (int)g_on, (int)g_reduce, Path().c_str());
- return !first && (was != g_on || accWas != g_accent); // a cor de destaque também redesenha
+ if (first || was != g_on || goldWas != g_golden) Log(L"tema: liquid_glass=%d golden_gate=%d reduzir=%d (%ls)", (int)g_on, (int)g_golden, (int)g_reduce, Path().c_str());
+ return !first && (was != g_on || goldWas != g_golden || accWas != g_accent || folderWas != g_folderColor); // a cor de destaque também redesenha
}
void tahoe::Frame(HWND h, bool on) {
@@ -292,6 +299,7 @@ void tahoe::SetPanel(HWND h, D2D1_RECT_F r, float radius) {
float k = GetDpiForWindow(h) / 96.f;
try {
auto& g = it->second.geo;
+ if (r.right <= r.left || r.bottom <= r.top) { g.Size({ 0, 0 }); return; } // sem painel de vidro (Golden Gate)
// 1 px para FORA: o conteúdo opaco do D2D cobre a sobra; para dentro, os pixels de borda
// (meio transparentes no D2D) mostravam o que está atrás da janela como um tracejado escuro
g.Offset({ r.left * k - 1, r.top * k - 1 });
@@ -301,7 +309,11 @@ void tahoe::SetPanel(HWND h, D2D1_RECT_F r, float radius) {
} catch (...) {}
}
-float tahoe::Radius(HWND h) { return IsZoomed(h) ? 0 : WINDOW_R; }
+float tahoe::Radius(HWND h) { return IsZoomed(h) ? 0 : WindowR(); }
+// macOS 27 Golden Gate: todas as janelas com o mesmo canto, 16 pt (medido nas capturas do 512 Pixels), bem menos redondo que os 26 pt do Tahoe
+float tahoe::WindowR() { if (!g_read) Reload(); return g_golden ? 16.f : 26.f; }
+bool tahoe::Golden() { if (!g_read) Reload(); return g_golden; }
+int tahoe::FolderColor() { if (!g_read) Reload(); return g_on ? g_folderColor : -1; }
// Cápsula de vidro desenhada em D2D (botões da barra de ferramentas, campos, painéis): corpo claro
// translúcido, sombra curta e difusa, contorno especular claro em cima e uma linha escura fina embaixo.
diff --git a/src/forcar/main.cpp b/src/forcar/main.cpp
index 9013f4a..6e5f38e 100644
--- a/src/forcar/main.cpp
+++ b/src/forcar/main.cpp
@@ -10,6 +10,7 @@
#include "../comum/app2d.h"
#include "../comum/nomes.h"
#include "../comum/pressao.h"
+#include "../comum/semaforo.h"
#include <tlhelp32.h>
#include <shellapi.h>
#include <map>
@@ -37,9 +38,15 @@ IDWriteTextFormat *g_tfBody, *g_tfBold, *g_tfRow, *g_tfSmall, *g_tfBtn, *g_tfMem
IWICImagingFactory* g_wic;
std::map<std::wstring, IWICBitmapSource*> g_wicIcons;
std::map<std::wstring, ID2D1Bitmap*> g_icons;
-ID2D1HwndRenderTarget* g_iconsRt;
+ID2D1RenderTarget* g_iconsRt;
const UINT_PTR T_REFRESH = 1;
-const float W = 440, PAD = 20, ROW = 24, BTN_H = 24;
+const float PAD = 20;
+// macOS 27 Golden Gate (Force-Quit.png, 2x): janela de 370 × 310, fundo branco, lista branca com borda, linhas de 22,
+// seleção azul de borda a borda (sem canto) e o botão em cápsula de 28 (semaforo::Aqua = tema Golden Gate)
+#define GG (semaforo::Aqua())
+#define W (GG ? 370.f : 440.f)
+#define ROW (GG ? 22.f : 24.f)
+#define BTN_H (GG ? 28.f : 24.f)
std::wstring Lower(std::wstring s) { for (auto& c : s) c = (wchar_t)towlower(c); return s; }
@@ -205,6 +212,8 @@ std::wstring Bytes(ULONGLONG b) {
struct Pal { D2D1_COLOR_F bg, list, border, text, text2, sel, red, btn, btnText, dim; };
Pal P() {
bool d = Dark();
+ if (GG) return d ? Pal{ Rgb(30, 30, 30), Rgb(30, 30, 30), Rgb(255, 255, 255, 0.14f), Rgb(255, 255, 255, 0.88f), Rgb(255, 255, 255, 0.55f), Rgb(0, 100, 220), Rgb(255, 69, 58), Rgb(255, 255, 255, 0.14f), Rgb(255, 255, 255, 0.9f), Rgb(0, 0, 0, 0.35f) }
+ : Pal{ Rgb(255, 255, 255), Rgb(255, 255, 255), Rgb(0, 0, 0, 0.16f), Rgb(0, 0, 0, 0.85f), Rgb(0, 0, 0, 0.5f), Rgb(0, 100, 220), Rgb(255, 59, 48), Rgb(0, 0, 0, 0.06f), Rgb(0, 0, 0, 0.85f), Rgb(0, 0, 0, 0.18f) };
return d ? Pal{ Rgb(44, 44, 46), Rgb(30, 30, 31), Rgb(255, 255, 255, 0.12f), Rgb(255, 255, 255, 0.88f), Rgb(255, 255, 255, 0.55f), Rgb(0, 88, 208), Rgb(255, 69, 58), Rgb(255, 255, 255, 0.16f), Rgb(255, 255, 255, 0.9f), Rgb(0, 0, 0, 0.35f) }
: Pal{ Rgb(236, 236, 236), Rgb(255, 255, 255), Rgb(0, 0, 0, 0.14f), Rgb(0, 0, 0, 0.85f), Rgb(0, 0, 0, 0.5f), Rgb(0, 100, 225), Rgb(255, 59, 48), Rgb(255, 255, 255), Rgb(0, 0, 0, 0.85f), Rgb(0, 0, 0, 0.18f) };
}
@@ -216,10 +225,11 @@ Layout L() {
Layout l;
float headH = g_memory ? 74 : 54;
l.head = D2D1::RectF(PAD, 14, s.width - PAD, 14 + headH);
- l.list = D2D1::RectF(PAD, l.head.bottom + 4, s.width - PAD, s.height - 56);
- float bw = std::max(TextW(g_tfBtn, Tr(L"Forçar Encerrar")) + 28, 110.f);
- l.btn = D2D1::RectF(s.width - PAD - bw, s.height - 40, s.width - PAD, s.height - 40 + BTN_H);
- l.note = D2D1::RectF(PAD, s.height - 44, l.btn.left - 12, s.height - 12);
+ l.list = D2D1::RectF(PAD, l.head.bottom + 4, s.width - PAD, s.height - (GG ? 61 : 56));
+ float bw = std::max(TextW(g_tfBtn, Tr(L"Forçar Encerrar")) + (GG ? 36 : 28), GG ? 84.f : 110.f);
+ l.btn = GG ? D2D1::RectF(s.width - 16 - bw, s.height - 16 - BTN_H, s.width - 16, s.height - 16) // macOS 27: a 16 das bordas
+ : D2D1::RectF(s.width - PAD - bw, s.height - 40, s.width - PAD, s.height - 40 + BTN_H);
+ l.note = D2D1::RectF(PAD, s.height - (GG ? 50 : 44), l.btn.left - 12, s.height - 12);
float sw = std::min(s.width - 40, 320.f), sh = 196;
l.sheet = D2D1::RectF((s.width - sw) / 2, 0, (s.width + sw) / 2, sh);
float half = (sw - 48) / 2;
@@ -229,7 +239,7 @@ Layout L() {
}
void Button(D2D1_RECT_F r, const std::wstring& label, bool primary, bool enabled, bool hover, const Pal& p) {
- float rad = (r.bottom - r.top) / 2 < 7 ? (r.bottom - r.top) / 2 : 6;
+ float rad = GG ? (r.bottom - r.top) / 2 : (r.bottom - r.top) / 2 < 7 ? (r.bottom - r.top) / 2 : 6; // macOS 27: cápsula
if (primary && enabled) Fill(r, hover ? Rgb(20, 120, 245) : Rgb(0, 122, 255), rad);
else {
Fill(r, p.btn, rad);
@@ -253,7 +263,7 @@ void Paint() {
Text(Tr(L"Se um aplicativo não responder por algum tempo, selecione o nome dele e clique em Forçar Encerrar."), g_tfBody, l.head, p.text);
}
// lista
- Fill(l.list, p.list, 5);
+ Fill(l.list, p.list, GG ? 0.f : 5.f);
rt->PushAxisAlignedClip(l.list, D2D1_ANTIALIAS_MODE_ALIASED);
int first = (int)g_scroll;
float y = l.list.top + 1;
@@ -261,9 +271,10 @@ void Paint() {
App& a = g_apps[i];
D2D1_RECT_F rr = D2D1::RectF(l.list.left + 1, y, l.list.right - 1, y + ROW);
bool sel = a.pid == g_sel;
- if (sel) Fill(D2D1::RectF(rr.left + 4, rr.top + 1, rr.right - 4, rr.bottom - 1), p.sel, 5);
- if (ID2D1Bitmap* b = Icon(a.path)) rt->DrawBitmap(b, D2D1::RectF(rr.left + 10, rr.top + 3, rr.left + 28, rr.top + 21), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
- float tx = rr.left + 36, right = rr.right - 10;
+ if (sel) { if (GG) Fill(rr, p.sel, 0); else Fill(D2D1::RectF(rr.left + 4, rr.top + 1, rr.right - 4, rr.bottom - 1), p.sel, 5); }
+ float iy = (rr.top + rr.bottom) / 2;
+ if (ID2D1Bitmap* b = Icon(a.path)) rt->DrawBitmap(b, GG ? D2D1::RectF(rr.left + 7, iy - 8.5f, rr.left + 24, iy + 8.5f) : D2D1::RectF(rr.left + 10, rr.top + 3, rr.left + 28, rr.top + 21), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
+ float tx = rr.left + (GG ? 29 : 36), right = rr.right - 10;
if (g_memory) {
std::wstring m = Bytes(a.mem);
float mw = TextW(g_tfMem, m);
@@ -277,7 +288,7 @@ void Paint() {
}
rt->PopAxisAlignedClip();
br->SetColor(p.border);
- rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(l.list.left + 0.5f, l.list.top + 0.5f, l.list.right - 0.5f, l.list.bottom - 0.5f), 5, 5), br, 1);
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(l.list.left + 0.5f, l.list.top + 0.5f, l.list.right - 0.5f, l.list.bottom - 0.5f), GG ? 0.f : 5.f, GG ? 0.f : 5.f), br, 1);
// rodapé
Text(Tr(L"Você pode abrir esta janela pressionando Ctrl\u00A0+\u00A0Alt\u00A0+\u00A0Esc."), g_tfSmall, l.note, p.text2);
Button(l.btn, Tr(L"Forçar Encerrar"), true, g_sel != 0 && !g_sheet, g_hover == -2, p);
@@ -428,7 +439,7 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR cmd, int show) {
g_tfSheetTitle = Fmt(13, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER, true);
g_tfSheet = Fmt(11.5f, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, true);
if (g_tfBody) g_tfBody->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_NEAR);
- if (!CreateMain(hi, L"ForcarEncerrarJanela", Tr(L"Forçar Encerrar Aplicativos"), Proc, (int)W, 470)) return 1;
+ if (!CreateMain(hi, L"ForcarEncerrarJanela", Tr(L"Forçar Encerrar Aplicativos"), Proc, (int)W, GG ? 310 : 470)) return 1;
// como o do Mac: tamanho fixo, sem maximizar
SetWindowLongW(wnd, GWL_STYLE, GetWindowLongW(wnd, GWL_STYLE) & ~(WS_THICKFRAME | WS_MAXIMIZEBOX));
SetWindowPos(wnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
diff --git a/src/fotos/main.cpp b/src/fotos/main.cpp
index f3ea437..ea4969c 100644
--- a/src/fotos/main.cpp
+++ b/src/fotos/main.cpp
@@ -23,7 +23,7 @@ using namespace app2d;
namespace {
-const float SB = 210, TB = 52, GAP = 3, HEADH = 40;
+float SB = 210, TB = 52, GAP = 3, HEADH = 40; // macOS 27: lateral 216 (0 escondida), 17,5 entre as fotos
const UINT WM_SCAN = WM_APP + 3, WM_THUMB = WM_APP + 4;
struct Item { std::wstring path; FILETIME time; bool video, shot; };
@@ -37,6 +37,7 @@ int g_sel = -1; // índice em g_shown
std::vector<int> g_shown;
bool g_scanning = true;
IDWriteTextFormat *g_tfSide2, *g_tfSmallC, *g_tfSide, *g_tfHead, *g_tfTitle, *g_tfSmall, *g_tfIcon, *g_tfBadge;
+IDWriteTextFormat *g_tfTitleG, *g_tfSideB, *g_tfSec, *g_tfSeg, *g_tfFootB; // macOS 27
// ---- miniaturas
struct Thumb { ID2D1Bitmap* bmp = nullptr; bool asked = false; ULONGLONG used = 0; };
@@ -111,8 +112,11 @@ void Scan() {
void LoadFav() { g_fav.clear(); for (auto& l : ReadLines(g_favFile)) if (!l.empty() && l[0] != L'#') g_fav.insert(l); }
void SaveFav() { std::vector<std::wstring> v{ L"# Fotos favoritas" }; for (auto& f : g_fav) v.push_back(f); WriteLines(g_favFile, v); }
+std::wstring g_search; // macOS 27: a lupa filtra pelo nome do arquivo
+int g_showMode = 2; // 0 anos, 1 meses, 2 todas: a grade ganha um cabeçalho por ano ou por mês
void Filter() {
g_shown.clear();
+ std::wstring q = g_search; for (auto& c : q) c = towlower(c);
FILETIME now; GetSystemTimeAsFileTime(&now);
ULONGLONG n = ((ULONGLONG)now.dwHighDateTime << 32) | now.dwLowDateTime, month = 30ULL * 24 * 3600 * 10000000ULL;
std::lock_guard<std::mutex> l(g_mx);
@@ -120,6 +124,7 @@ void Filter() {
auto& it = g_all[i];
ULONGLONG t = ((ULONGLONG)it.time.dwHighDateTime << 32) | it.time.dwLowDateTime;
bool ok = g_view == 0 || (g_view == 1 && g_fav.count(it.path)) || (g_view == 2 && n - t < month) || (g_view == 3 && it.shot) || (g_view == 4 && it.video);
+ if (ok && !q.empty()) { std::wstring nm = it.path.substr(it.path.find_last_of(L"\\/") + 1); for (auto& c : nm) c = towlower(c); ok = nm.find(q) != std::wstring::npos; }
if (ok) g_shown.push_back(i);
}
if (g_sel >= (int)g_shown.size()) g_sel = -1;
@@ -132,38 +137,214 @@ std::vector<Cell> g_cells; std::vector<Head> g_heads; float g_total = 0;
void Layout() {
g_cells.clear(); g_heads.clear();
D2D1_SIZE_F sz = Size();
- float W = sz.width - SB - 2 * 16;
+ const bool gg = BAR > 0; // macOS 27: margens de 17, sem cabeçalhos de mês
+ float M = gg ? 17.f : 16.f;
+ float W = sz.width - SB - 2 * M;
int cols = std::max(1, (int)((W + GAP) / (g_cell + GAP)));
float cw = (W - (cols - 1) * GAP) / cols;
- float y = 8; int col = 0, lastKey = -1;
+ float y = gg ? 6.f : 8.f; int col = 0, lastKey = -1;
std::lock_guard<std::mutex> l(g_mx);
for (int k = 0; k < (int)g_shown.size(); k++) {
auto& it = g_all[g_shown[k]];
SYSTEMTIME st; FILETIME loc; FileTimeToLocalFileTime(&it.time, &loc); FileTimeToSystemTime(&loc, &st);
- int key = st.wYear * 12 + st.wMonth;
- if (key != lastKey) {
+ bool years = gg && g_showMode == 0;
+ int key = years ? st.wYear : st.wYear * 12 + st.wMonth;
+ if (key != lastKey && (!gg || g_showMode < 2)) { // macOS 27: Anos e Meses separam a grade; Todas as Fotos não
if (col) { y += cw + GAP; col = 0; }
lastKey = key;
- wchar_t b[64]; swprintf_s(b, idioma::En() ? L"%ls %d" : L"%ls de %d", MonthName(st.wMonth), st.wYear);
+ wchar_t b[64];
+ if (years) swprintf_s(b, L"%d", st.wYear);
+ else swprintf_s(b, idioma::En() ? L"%ls %d" : L"%ls de %d", MonthName(st.wMonth), st.wYear);
g_heads.push_back({ b, y });
y += HEADH;
}
- float x = SB + 16 + col * (cw + GAP);
+ float x = SB + M + col * (cw + GAP);
g_cells.push_back({ k, D2D1::RectF(x, TB + y, x + cw, TB + y + cw) });
if (++col >= cols) { col = 0; y += cw + GAP; }
}
if (col) y += cw + GAP;
- g_total = y + 20;
+ g_total = y + (gg ? 70.f : 20.f);
+}
+
+bool EdOn();
+void PaintEditor(D2D1_SIZE_F sz, bool dark);
+std::wstring SelPath();
+// ---- macOS 27 (captura Photos do 512 Pixels, 2x, medida em pt): barra lateral de 216 com o botão redondo de
+// "barra lateral" (centro 190, 26); linhas de 32 com o ícone azul a 37 e o nome a 55, a escolhida numa pílula cinza
+// (10–206); "Fixados" em cinza. Em cima, à esquerda do conteúdo, o nome em negrito e as datas em cinza; à direita
+// grupos de vidro: −|+ (73), Anos/Meses/Todas as Fotos (253), três ícones (110), quatro ícones (146) e a lupa (36),
+// a 8 da borda. Divisa a 52. Grade sem cabeçalhos: fotos inteiras (sem cortar) em quadrados de 176 com 17,5 entre
+// eles e cantos 8; no fim, "N Fotos" em negrito.
+struct GHit { int kind, arg; D2D1_RECT_F r; }; // 1 lado, 2 barra lateral, 3 −, 4 +, 5 favoritar, 6 compartilhar, 7 info, 8 editar, 10 mostrar
+std::vector<GHit> g_gh;
+bool g_sbHidden;
+// g_showMode: lá em cima, antes do Layout
+
+void Glyph(wchar_t g, D2D1_RECT_F r, D2D1_COLOR_F c) { wchar_t s[2] = { g, 0 }; Text(s, g_tfIcon, r, c); }
+
+void PaintGolden2(D2D1_SIZE_F sz, bool dark) {
+ g_gh.clear();
+ D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
+ D2D1_COLOR_F accent = Rgb(0, 136, 255), sep = dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.09f);
+ rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ Layout();
+ g_scroll = std::clamp(g_scroll, 0.f, std::max(0.f, g_total - (sz.height - TB)));
+ float X0 = SB;
+ // grade
+ rt->PushAxisAlignedClip(D2D1::RectF(X0, TB, sz.width, sz.height), D2D1_ANTIALIAS_MODE_ALIASED);
+ ULONGLONG now = GetTickCount64();
+ float lastBottom = TB;
+ {
+ std::lock_guard<std::mutex> l(g_mx);
+ for (auto& c : g_cells) {
+ D2D1_RECT_F r = c.r; r.top -= g_scroll; r.bottom -= g_scroll;
+ lastBottom = std::max(lastBottom, r.bottom);
+ if (r.bottom < TB - 200 || r.top > sz.height + 200) continue;
+ auto& it = g_all[g_shown[c.idx]];
+ Thumb& t = g_thumbs[it.path];
+ t.used = now;
+ if (!t.bmp && !t.asked) { t.asked = true; std::lock_guard<std::mutex> q(g_qmx); g_queue.push_back(it.path); g_qcv.notify_one(); }
+ D2D1_RECT_F ir = r;
+ if (t.bmp) { // a foto inteira dentro do quadrado (como no Mac 27)
+ D2D1_SIZE_F bs = t.bmp->GetSize();
+ float k = std::min((r.right - r.left) / bs.width, (r.bottom - r.top) / bs.height);
+ float w = bs.width * k, hh = bs.height * k, cx = (r.left + r.right) / 2, cy = (r.top + r.bottom) / 2;
+ ir = D2D1::RectF(cx - w / 2, cy - hh / 2, cx + w / 2, cy + hh / 2);
+ ID2D1BitmapBrush* bb = nullptr;
+ rt->CreateBitmapBrush(t.bmp, D2D1::BitmapBrushProperties(D2D1_EXTEND_MODE_CLAMP, D2D1_EXTEND_MODE_CLAMP, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR), &bb);
+ if (bb) {
+ bb->SetTransform(D2D1::Matrix3x2F::Scale(k, k) * D2D1::Matrix3x2F::Translation(ir.left, ir.top));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(ir, 8, 8), bb);
+ bb->Release();
+ }
+ } else {
+ float cx = (r.left + r.right) / 2, cy = (r.top + r.bottom) / 2, w = (r.right - r.left), hh = w * 0.66f;
+ ir = D2D1::RectF(r.left, cy - hh / 2, r.right, cy + hh / 2);
+ Fill(ir, dark ? Rgb(48, 48, 50) : Rgb(238, 238, 240), 8);
+ (void)cx;
+ }
+ if (it.video) Glyph(0xE714, D2D1::RectF(ir.left + 4, ir.bottom - 22, ir.left + 24, ir.bottom - 2), Rgb(255, 255, 255));
+ if (g_fav.count(it.path)) Text(L"♥", g_tfBadge, D2D1::RectF(ir.left + 4, ir.bottom - 22, ir.left + 24, ir.bottom - 2), Rgb(255, 255, 255));
+ if (c.idx == g_sel) { br->SetColor(accent); rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(ir.left - 2, ir.top - 2, ir.right + 2, ir.bottom + 2), 10, 10), br, 3); }
+ }
+ }
+ for (auto& hd : g_heads) { // Anos / Meses
+ float y = TB + hd.y - g_scroll;
+ if (y < TB - HEADH || y > sz.height) continue;
+ Text(hd.text, g_tfTitleG, D2D1::RectF(X0 + 17, y + 8, sz.width - 17, y + HEADH - 6), text);
+ }
+ if (g_shown.empty()) Text(g_scanning ? Tr(L"Lendo a biblioteca…") : !g_search.empty() ? Tr(L"Nenhum Resultado") : Tr(L"Nenhuma Foto"), g_tfTitle, D2D1::RectF(X0, TB, sz.width, sz.height), gray);
+ else { // rodapé: "N Fotos"
+ int nv = 0; { std::lock_guard<std::mutex> l(g_mx); for (int k : g_shown) if (g_all[k].video) nv++; }
+ int np = (int)g_shown.size() - nv;
+ wchar_t b[96];
+ if (nv && np) swprintf_s(b, Tr(L"%d Fotos, %d Vídeos"), np, nv); else if (nv) swprintf_s(b, Tr(L"%d Vídeos"), nv); else swprintf_s(b, Tr(L"%d Fotos"), np);
+ Text(b, g_tfFootB, D2D1::RectF(X0, lastBottom + 22, sz.width, lastBottom + 40), text);
+ }
+ rt->PopAxisAlignedClip();
+ // barra de cima
+ Fill(D2D1::RectF(X0, 0, sz.width, TB), dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ Fill(D2D1::RectF(X0, TB - 0.5f, sz.width, TB), sep);
+ const wchar_t* names[] = { L"Biblioteca", L"Favoritos", L"Recentes", L"Capturas de Tela", L"Vídeos" };
+ float tx = X0 + (g_sbHidden ? 140.f : 20.f);
+ Text(Tr(names[g_view]), g_tfTitleG, D2D1::RectF(tx, 10, tx + 300, 29), text);
+ {
+ std::wstring range;
+ std::lock_guard<std::mutex> l(g_mx);
+ if (!g_shown.empty()) {
+ auto fmt = [](const FILETIME& f) {
+ SYSTEMTIME st; FILETIME loc; FileTimeToLocalFileTime(&f, &loc); FileTimeToSystemTime(&loc, &st);
+ static const wchar_t* en[] = { L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" };
+ static const wchar_t* pt[] = { L"jan.", L"fev.", L"mar.", L"abr.", L"mai.", L"jun.", L"jul.", L"ago.", L"set.", L"out.", L"nov.", L"dez." };
+ wchar_t b[48];
+ if (idioma::En()) swprintf_s(b, L"%ls %d, %d", en[st.wMonth - 1], st.wDay, st.wYear); else swprintf_s(b, L"%d de %ls de %d", st.wDay, pt[st.wMonth - 1], st.wYear);
+ return std::wstring(b);
+ };
+ range = fmt(g_all[g_shown.front()].time) + L" – " + fmt(g_all[g_shown.back()].time);
+ }
+ Text(range, g_tfSmall, D2D1::RectF(tx, 27, tx + 320, 42), gray);
+ }
+ // botões da direita, da borda para dentro
+ float R = sz.width - 8, cy = 26;
+ auto group = [&](float w) { D2D1_RECT_F r = D2D1::RectF(R - w, cy - 18, R, cy + 18); GlassButton(r, dark); BarButton(r); R = r.left; return r; };
+ { // lupa (com busca: o campo aberto com o texto)
+ D2D1_RECT_F r = group(g_search.empty() ? 36.f : 200.f);
+ IconSearch({ g_search.empty() ? (r.left + r.right) / 2 - 0.5f : r.left + 18, cy - 0.5f }, text, 1.05f);
+ if (!g_search.empty()) Text(g_search, g_tfSeg, D2D1::RectF(r.left + 32, r.top, r.right - 10, r.bottom), text);
+ g_gh.push_back({ 11, 0, r });
+ R -= 8;
+ }
+ { // info, compartilhar, favoritar, girar/editar
+ D2D1_RECT_F r = group(146);
+ wchar_t gl[4] = { 0xE946, 0xE72D, (wchar_t)(g_sel >= 0 && g_fav.count(SelPath()) ? 0xEB52 : 0xEB51), 0xE7AD };
+ int kinds[4] = { 7, 6, 5, 8 };
+ for (int i = 0; i < 4; i++) {
+ D2D1_RECT_F c = D2D1::RectF(r.left + 6 + i * 33.5f, r.top, r.left + 6 + (i + 1) * 33.5f, r.bottom);
+ Glyph(gl[i], c, i == 0 || g_sel >= 0 ? text : gray);
+ g_gh.push_back({ kinds[i], 0, c });
+ }
+ R -= 7;
+ }
+ { // tamanho, ordem, mais
+ D2D1_RECT_F r = group(110);
+ wchar_t gl[3] = { 0xE9A6, 0xE8CB, 0xE712 };
+ for (int i = 0; i < 3; i++) Glyph(gl[i], D2D1::RectF(r.left + 6 + i * 32.6f, r.top, r.left + 6 + (i + 1) * 32.6f, r.bottom), text);
+ R -= 12;
+ }
+ if (R - 253 - 16 - 73 > tx + 160) {
+ D2D1_RECT_F r = group(253);
+ const wchar_t* seg[3] = { L"Anos", L"Meses", L"Todas as Fotos" };
+ float ws[3] = { 70, 76, 107 }, x = r.left;
+ for (int i = 0; i < 3; i++) {
+ D2D1_RECT_F c = D2D1::RectF(x, r.top, x + ws[i], r.bottom);
+ if (i == g_showMode) Fill(D2D1::RectF(c.left + 4, c.top + 4, c.right - 4, c.bottom - 4), dark ? Rgb(255, 255, 255, 0.14f) : Rgb(0, 0, 0, 0.08f), 14);
+ Text(Tr(seg[i]), g_tfSeg, c, text);
+ g_gh.push_back({ 10, i, c });
+ x += ws[i];
+ }
+ R -= 16;
+ D2D1_RECT_F z = group(73);
+ D2D1_RECT_F a = D2D1::RectF(z.left, z.top, z.left + 36.5f, z.bottom), b = D2D1::RectF(z.left + 36.5f, z.top, z.right, z.bottom);
+ br->SetColor(text);
+ rt->DrawLine({ a.left + 11, cy }, { a.right - 11, cy }, br, 1.6f);
+ IconPlus({ (b.left + b.right) / 2, cy }, text, 7);
+ Fill(D2D1::RectF(z.left + 36.25f, cy - 9, z.left + 36.75f, cy + 9), sep);
+ g_gh.push_back({ 3, 0, a }); g_gh.push_back({ 4, 0, b });
+ }
+ // barra lateral
+ if (!g_sbHidden) {
+ Fill(D2D1::RectF(0, 0, SB, sz.height), SidebarColor());
+ Fill(D2D1::RectF(SB - 0.5f, 0, SB, sz.height), dark ? Rgb(0, 0, 0, 0.5f) : Rgb(0, 0, 0, 0.08f));
+ D2D1_RECT_F tb = D2D1::RectF(190 - 18, cy - 18, 190 + 18, cy + 18);
+ GlassButton(tb, dark); IconSidebar({ 190, cy }, text);
+ g_gh.push_back({ 2, 0, tb }); BarButton(tb);
+ wchar_t icons[] = { 0xE8B9, 0xEB51, 0xE823, 0xE714, 0xE722 };
+ int order[5] = { 0, 1, 2, 4, 3 }; // Biblioteca; Fixados: Favoritos, Recentes, Vídeos, Capturas de Tela
+ float ys[5] = { 68, 132, 164, 196, 228 };
+ Text(Tr(L"Fixados"), g_tfSec, D2D1::RectF(16, 98, SB, 114), gray);
+ for (int k = 0; k < 5; k++) {
+ int v = order[k];
+ D2D1_RECT_F r = D2D1::RectF(10, ys[k] - 16, SB - 10, ys[k] + 16);
+ bool on = v == g_view;
+ if (on) Fill(r, dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.07f), 9);
+ Glyph(icons[k], D2D1::RectF(26, r.top, 48, r.bottom), accent);
+ Text(Tr(names[v]), on ? g_tfSideB : g_tfSide, D2D1::RectF(55, r.top, r.right - 6, r.bottom), text);
+ g_gh.push_back({ 1, v, r });
+ }
+ } else {
+ D2D1_RECT_F tb = D2D1::RectF(108 - 18, cy - 18, 108 + 18, cy + 18);
+ GlassButton(tb, dark); IconSidebar({ 108, cy }, text);
+ g_gh.push_back({ 2, 0, tb }); BarButton(tb);
+ }
}
-bool EdOn();
-void PaintEditor(D2D1_SIZE_F sz, bool dark);
void Paint() {
if (!BeginPaint()) return;
bool dark = Dark();
D2D1_SIZE_F sz = Size();
D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
if (EdOn()) { PaintEditor(sz, dark); EndPaint(); return; } // editando uma foto
+ if (BAR > 0) { PaintGolden2(sz, dark); EndPaint(); return; }
rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
Layout();
g_scroll = std::clamp(g_scroll, 0.f, std::max(0.f, g_total - (sz.height - TB)));
@@ -236,7 +417,7 @@ struct Edit {
D2D1_RECT_F crop{ 0, 0, 0, 0 }; // aplicado (fração 0..1 da imagem), vazio = inteira
int drag = -1; // slider sendo arrastado
D2D1_RECT_F imgRect{};
-} g_ed;
+} g_ed;
bool EdOn() { return g_ed.on; }
const wchar_t* FILTERS[] = { L"Original", L"Vívido", L"Dramático", L"Quente", L"Frio", L"Mono", L"Prata", L"Noir" };
struct Hit2 { int kind, arg; D2D1_RECT_F r; }; // 1 slider, 2 filtro, 3 girar, 4 recortar, 5 restaurar, 6 cancelar, 7 salvar
@@ -499,7 +680,32 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: case WM_RBUTTONUP: {
float s = Sc(), x = GET_X_LPARAM(l) / s, y = GET_Y_LPARAM(l) / s;
if (g_ed.on) { if (m != WM_RBUTTONUP) EditMouse(WM_LBUTTONDOWN, x, y); return 0; }
- if (x < SB) {
+ if (BAR > 0) { // macOS 27: botões da barra e da lateral
+ for (auto& gh : g_gh) if (In(gh.r, x, y)) {
+ if (m == WM_RBUTTONUP) return 0;
+ switch (gh.kind) {
+ case 1: g_view = gh.arg; g_sel = -1; Filter(); g_scroll = 1e9f; break;
+ case 2: g_sbHidden = !g_sbHidden; SB = g_sbHidden ? 0.f : 216.f; break;
+ case 3: Zoom(1 / 1.2f); break;
+ case 4: Zoom(1.2f); break;
+ case 5: ToggleFav(); break;
+ case 6: { std::wstring p = SelPath(); if (!p.empty()) { SHELLEXECUTEINFOW se{ sizeof(se) }; se.fMask = SEE_MASK_INVOKEIDLIST; se.lpVerb = L"windows.modernshare"; se.lpFile = p.c_str(); se.nShow = SW_SHOWNORMAL; ShellExecuteExW(&se); } break; }
+ case 7: { std::wstring p = SelPath(); if (!p.empty()) { SHELLEXECUTEINFOW se{ sizeof(se) }; se.fMask = SEE_MASK_INVOKEIDLIST; se.lpVerb = L"properties"; se.lpFile = p.c_str(); se.nShow = SW_SHOWNORMAL; ShellExecuteExW(&se); } break; }
+ case 8: EditOpen(SelPath()); break;
+ case 10: g_showMode = gh.arg; g_scroll = 0; break;
+ case 11: { // busca: o campo abre na barra e filtra pelo nome enquanto digita
+ D2D1_RECT_F fr = D2D1::RectF(gh.r.right - 200 + 32, gh.r.top + 9, gh.r.right - 10, gh.r.bottom - 9);
+ FieldOpen(fr, g_search, 13, false, [](const std::wstring& q, int key) {
+ g_search = key == VK_ESCAPE ? L"" : q; g_sel = -1; Filter(); g_scroll = 0; InvalidateRect(wnd, nullptr, FALSE);
+ });
+ return 0;
+ }
+ }
+ InvalidateRect(h, nullptr, FALSE);
+ return 0;
+ }
+ if (x < SB || y < TB) return 0;
+ } else if (x < SB) {
int i = (int)((y - 48) / 34);
if (y >= 48 && i >= 0 && i < 5) { g_view = i; g_sel = -1; Filter(); g_scroll = 1e9f; InvalidateRect(h, nullptr, FALSE); }
return 0;
@@ -567,7 +773,14 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
g_tfSmall = Fmt(12);
g_tfIcon = Fmt(15, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
g_tfBadge = Fmt(13, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
- if (!CreateMain(hi, L"FotosJanela", Tr(L"Fotos"), Proc, 1200, 800)) return 1;
+ g_tfTitleG = Fmt(13, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfSideB = Fmt(13, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfSec = Fmt(11, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfSeg = Fmt(13, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfFootB = Fmt(12, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ barWanted = 52; // macOS 27: barra unificada
+ if (!CreateMain(hi, L"FotosJanela", Tr(L"Fotos"), Proc, semaforo::Aqua() ? 1222 : 1200, semaforo::Aqua() ? 720 : 800)) return 1;
+ if (BAR > 0) { SB = 216; GAP = 17.5f; g_cell = 176; }
g_px = (int)std::lround(256 * Sc());
for (int i = 0; i < 2; i++) std::thread(ThumbWorker).detach();
Scan();
diff --git a/src/janelas/macjanela.cpp b/src/janelas/macjanela.cpp
index 796dfb5..ea562c3 100644
--- a/src/janelas/macjanela.cpp
+++ b/src/janelas/macjanela.cpp
@@ -107,6 +107,11 @@ RECT CaptionRect(HWND h) {
return { c.x, top, c.x + cr.right, c.y };
}
+// Barra unificada (macOS 27, apps do WacOS feitos com o app2d.h): o app tira a barra do Windows e desenha a
+// barra de ferramentas dele nos primeiros N pt da área do app (prop "WacOSBarraUnificada" = N). A DLL continua
+// com os cantos, a sombra, o ampliar e os três botões, desenhados por cima no meio dessa faixa, a 26 pt da borda.
+int UnifiedBar(HWND h) { return (int)(INT_PTR)GetPropW(h, L"WacOSBarraUnificada"); }
+
// 0: não mexe; 1: barra padrão do Windows; 2: barra desenhada pelo próprio app (Chromium/Electron e afins)
int Mode(HWND h, bool showing = false) { // showing: chamada no WM_SHOWWINDOW, antes de ficar visível
if (GetAncestor(h, GA_ROOT) != h || (!showing && !IsWindowVisible(h)) || GetPropW(h, PROP)) return 0;
@@ -124,6 +129,7 @@ int Mode(HWND h, bool showing = false) { // showing: chamada no WM_SHOWWINDOW,
int top = IsZoomed(h) ? wr.top + (c.x - wr.left) : wr.top;
int cap = c.y - top;
if ((st & WS_CAPTION) == WS_CAPTION && cap >= 20 * sc && cap <= 90 * sc) return 1;
+ if ((st & WS_CAPTION) == WS_CAPTION && UnifiedBar(h) > 0) return 1; // barra unificada: a faixa é do app
// sem barra do Windows: janela principal redimensionável, com título e de bom tamanho
// Apps com barra própria (Chrome, Discord, Electron): desligado. Converter o maximizar quebrava o F11
// (tela cheia passa pelo maximizado), o recorte errava as bordas deles e o ganho era pequeno
@@ -146,9 +152,15 @@ RECT FrameRect(HWND h) {
}
bool TemaTahoe(); // mais abaixo: tema Tahoe ligado no ajustes.txt do Shell
+bool OwnApp(); // mais abaixo: um dos apps do WacOS
const float PATCH_L = 80, PATCH_R = 3 * 46 + 6; // pt: botões do Mac / os três botões do app (46 pt cada no Windows)
RECT BarRect(Info* in) {
+ if (int u = UnifiedBar(in->owner)) { // a faixa de cima da área do app
+ POINT c{ 0, 0 }; ClientToScreen(in->owner, &c);
+ RECT cr; GetClientRect(in->owner, &cr);
+ return { c.x, c.y, c.x + cr.right, c.y + (int)std::lround(u * Scale(in->owner)) };
+ }
if (!in->custom) return CaptionRect(in->owner);
RECT f = FrameRect(in->owner);
float sc = Scale(in->owner);
@@ -216,11 +228,13 @@ void Paint(Info* in) {
// Tahoe (guia macOS26-Theme-Reference, seção 9.1, medido): só título = 14×14 com o 1º em x 9 (centro 16),
// 23 entre eles; painel utilitário = 10×10 em x 8 (centro 13), 17 entre eles
if (TemaTahoe()) { lx0 = in->tool ? 13.f : 16.f; lpitch = in->tool ? 17.f : 23.f; lr = in->tool ? 5.f : 7.f; }
+ if (int u = UnifiedBar(in->owner)) { lx0 = u > 40 ? 26.f : 16.f; lpitch = 23; lr = 7; } // macOS 27: com barra de ferramentas 26, 49, 72; só título 16, 39, 62
for (int k = 0; k < 3; k++) {
D2D1_POINT_2F c{ lx0 + k * lpitch, H / 2 };
bool lit = (in->active || in->hoverLights) && can[k];
b->SetColor(lit ? on[k] : (in->dark ? D2D1::ColorF(1, 1, 1, 0.22f) : D2D1::ColorF(0, 0, 0, 0.18f)));
rt->FillEllipse(D2D1::Ellipse(c, lr, lr), b);
+ semaforo::Gloss(rt, c, lr, b);
b->SetColor(D2D1::ColorF(0, 0, 0, 0.12f));
rt->DrawEllipse(D2D1::Ellipse(c, lr - 0.25f, lr - 0.25f), b, 0.5f);
if (!in->hoverLights || !can[k]) continue;
@@ -253,7 +267,7 @@ void Paint(Info* in) {
if (in->tool && g_tfTool && t[0]) { // plug-in: título cinza, menor, no meio
b->SetColor(D2D1::ColorF(1, 1, 1, in->active ? 0.62f : 0.38f));
rt->DrawTextW(t, (UINT32)wcslen(t), g_tfTool, D2D1::RectF(70, 0, W - 70, H), b);
- } else if (g_tf && t[0] && !in->custom) {
+ } else if (g_tf && t[0] && !in->custom && !(semaforo::Aqua() && OwnApp())) { // macOS 27: os apps do sistema não mostram o título
b->SetColor(in->dark ? D2D1::ColorF(1, 1, 1, in->active ? 0.86f : 0.42f) : D2D1::ColorF(0, 0, 0, in->active ? 0.85f : 0.40f));
rt->DrawTextW(t, (UINT32)wcslen(t), g_tf, D2D1::RectF(80, 0, W - 80, H), b);
}
@@ -278,6 +292,7 @@ int HitLight(Info* in, POINT clientPt) {
float x = clientPt.x / sc, y = clientPt.y / sc;
float lx0 = in->tool ? 14.f : 19.f, lpitch = in->tool ? 20.f : 23.f;
if (TemaTahoe()) { lx0 = in->tool ? 13.f : 16.f; lpitch = in->tool ? 17.f : 23.f; } // mesmas posições do desenho
+ if (int u = UnifiedBar(in->owner)) { lx0 = u > 40 ? 26.f : 16.f; lpitch = 23; }
for (int k = 0; k < 3; k++) if (std::fabs(x - (lx0 + k * lpitch)) <= 9 && std::fabs(y - H / 2) <= 8) return k;
return -1;
}
@@ -389,6 +404,12 @@ bool Fullscreen(HWND h) {
// Tema macOS Tahoe (liquid_glass=1 no ajustes.txt do Shell): as janelas são mais redondas (16 pt; Sequoia: 12 pt).
// Lido do arquivo no máximo a cada 3 s (a DLL roda dentro dos outros programas, sem acesso aos ajustes do Shell).
+// um dos apps do próprio WacOS (WacOS*.exe): no macOS 27 a barra deles não tem título (Lembretes, Calendário…)
+bool OwnApp() {
+ static int own = -1;
+ if (own < 0) { wchar_t p[MAX_PATH] = {}; GetModuleFileNameW(nullptr, p, MAX_PATH); const wchar_t* n = wcsrchr(p, L'\\'); own = n && !_wcsnicmp(n + 1, L"WacOS", 5) ? 1 : 0; }
+ return own == 1;
+}
bool TemaTahoe() {
static DWORD at; static bool on;
DWORD now = GetTickCount();
@@ -406,7 +427,7 @@ bool TemaTahoe() {
on = strstr(buf, "liquid_glass=1") != nullptr;
return on;
}
-int CornerRadius(HWND h) { return (int)std::lround((TemaTahoe() ? 16 : 12) * Scale(h)); }
+int CornerRadius(HWND h) { return (int)std::lround((TemaTahoe() ? 16 : 12) /* Golden Gate: também 16 pt (medido) */ * Scale(h)); }
// Moldura e prévia: transparentes para cliques. A moldura confere sozinha (timer) se a janela dela
// ainda existe, está visível e ainda a reconhece como moldura: senão some (sobrava um contorno
@@ -790,7 +811,7 @@ LRESULT CALLBACK OverlayProc(HWND h, UINT m, WPARAM w, LPARAM l) {
RECT r = BarRect(in);
p.x -= r.left; p.y -= r.top;
float sc = Scale(in->owner);
- if (p.x / sc < (in->custom ? PATCH_L : 72)) return HTCLIENT;
+ if (p.x / sc < (in->custom ? PATCH_L : UnifiedBar(in->owner) > 40 ? 84 : 72)) return HTCLIENT;
if (in->custom && p.x / sc > (r.right - r.left) / sc - PATCH_R) return HTCLIENT; // os três botões; o resto deixa o clique passar para a barra (arrastar)
return HTTRANSPARENT;
}
diff --git a/src/lembretes/main.cpp b/src/lembretes/main.cpp
index f2c87b9..d6174a6 100644
--- a/src/lembretes/main.cpp
+++ b/src/lembretes/main.cpp
@@ -13,7 +13,11 @@ using namespace app2d;
namespace {
-const float SB = 250, ROW = 40, ROW2 = 54, HEAD = 76, PADX = 22;
+const float ROW = 40, ROW2 = 54, PADX = 22;
+float SB = 250, HEAD = 76; // macOS 27: 358 e 143
+bool g_hideSide; // macOS 27: o botão da barra lateral a esconde
+std::wstring g_filter; // macOS 27: a busca da barra filtra pelo nome
+IDWriteTextFormat *g_tfCardG, *g_tfCardNumG, *g_tfTitleG, *g_tfTitleRG, *g_tfRowG, *g_tfSubG, *g_tfListG, *g_tfListBoldG, *g_tfHeadG, *g_tfInfoG, *g_tfInfoRG;
const UINT WM_FIELDLOST = WM_APP + 77;
struct List { int id; std::wstring name; int color; };
@@ -87,7 +91,12 @@ int Count(int sel) { int n = 0; for (auto& r : g_rems) if ((sel == S_DONE ? r.do
std::vector<Rem*> Shown() {
std::vector<Rem*> v;
- for (auto& r : g_rems) if (Visible(r, g_sel)) v.push_back(&r);
+ std::wstring lf = g_filter; for (auto& c : lf) c = towlower(c);
+ for (auto& r : g_rems) {
+ if (!Visible(r, g_sel)) continue;
+ if (!lf.empty()) { std::wstring tt = r.title + L" " + r.notes; for (auto& c : tt) c = towlower(c); if (tt.find(lf) == std::wstring::npos) continue; }
+ v.push_back(&r);
+ }
if (g_sel == S_SCHED || g_sel == S_TODAY) { std::stable_sort(v.begin(), v.end(), [](Rem* a, Rem* b) { return a->due < b->due; }); return v; }
// subtarefas logo abaixo da tarefa de cima (como no Mac); sem a de cima à vista, ficam soltas
std::vector<Rem*> o;
@@ -127,9 +136,174 @@ std::vector<Hit> g_hits;
struct RowPos { int id; float top, bottom; D2D1_RECT_F circle, title; };
std::vector<RowPos> g_rows;
+// ================= macOS 27 (captura Reminders do 512 Pixels, 2x, medida em pt)
+// Barra unificada de 52. Lateral de 358 (tingida): botões de vidro redondos de 36 (nova lista e esconder a lateral) a
+// 271 e 315; cartões de 162,5 × 59 em degradê (cantos 10) a cada 66 a partir de 53,5, a 17,5 e 186,5 da borda, com
+// o símbolo e o número (negrito de 18) em cima e o nome (negrito de 15) embaixo; "Minhas Listas" e as listas em
+// linhas de 36 com o círculo de 24 a 38 e o nome a 63, a contagem à direita; a escolhida numa pílula cinza.
+// Conteúdo: cápsula de vidro (compartilhar, formato, +) de 110 e a busca de 224,5 a 8 da borda; título em negrito de
+// 31 na cor da lista a 17 do conteúdo (centro 78,5) com a contagem à direita; "N Concluídos • Limpar" e "Mostrar" a
+// 125,5; linha a 142; lembretes em linhas de 32 (com notas, 49,5) com o círculo de 17 a 26,5 e o nome a 47.
+void PaintGolden() {
+ bool dark = Dark();
+ D2D1_SIZE_F sz = Size();
+ D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
+ rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ float S0 = g_hideSide ? 0.f : SB;
+ if (!g_hideSide) {
+ Fill(D2D1::RectF(0, 0, SB, sz.height), dark ? Rgb(43, 41, 40) : Rgb(237, 237, 236));
+ Fill(D2D1::RectF(SB - 0.5f, 0, SB, sz.height), dark ? Rgb(0, 0, 0, 0.5f) : Rgb(0, 0, 0, 0.08f));
+ D2D1_RECT_F nl = D2D1::RectF(271, 8, 307, 44), tg = D2D1::RectF(315, 8, 351, 44);
+ GlassButton(nl, dark); GlassButton(tg, dark);
+ { // nova lista: a lista com o "+" no canto
+ float cx = 289, cy = 26;
+ br->SetColor(text);
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cx - 8, cy - 7, cx + 7, cy + 7), 2.5f, 2.5f), br, 1.4f);
+ rt->DrawEllipse(D2D1::Ellipse({ cx - 4, cy - 2.5f }, 1.2f, 1.2f), br, 1.1f); rt->DrawLine({ cx - 1.5f, cy - 2.5f }, { cx + 4, cy - 2.5f }, br, 1.3f);
+ rt->DrawEllipse(D2D1::Ellipse({ cx - 4, cy + 2.5f }, 1.2f, 1.2f), br, 1.1f); rt->DrawLine({ cx - 1.5f, cy + 2.5f }, { cx + 2, cy + 2.5f }, br, 1.3f);
+ Circle({ cx + 6, cy + 5.5f }, 4.6f, text, true);
+ br->SetColor(dark ? Rgb(60, 58, 57) : Rgb(245, 245, 245));
+ rt->DrawLine({ cx + 3.6f, cy + 5.5f }, { cx + 8.4f, cy + 5.5f }, br, 1.3f); rt->DrawLine({ cx + 6, cy + 3.1f }, { cx + 6, cy + 7.9f }, br, 1.3f);
+ }
+ IconSidebar({ 333, 26 }, text);
+ g_hits.push_back({ 3, 0, nl }); g_hits.push_back({ 9, 0, tg }); BarButton(nl); BarButton(tg);
+ struct T { int sel; const wchar_t* name; wchar_t glyph; UINT32 top, bot; } tiles[] = {
+ { S_TODAY, L"Hoje", 0xE787, 0x6EB6EB, 0x4A96DE }, { S_SCHED, L"Agendados", 0xE787, 0xEE8C8C, 0xE1696E },
+ { S_ALL, L"Todos", 0xE8FD, 0x737373, 0x505050 }, { S_FLAG, L"Sinalizados", 0xE7C1, 0xF3BE8C, 0xE8A064 },
+ { S_DONE, L"Concluídos", 0xE73E, 0xA5AAAF, 0x82878E } };
+ for (int i = 0; i < 5; i++) {
+ float x = i % 2 ? 186.5f : 17.5f, y = 53.5f + (i / 2) * 66.f;
+ D2D1_RECT_F r = D2D1::RectF(x, y, x + 162.5f, y + 59);
+ auto col = [](UINT32 c) { return Rgb((c >> 16) & 255, (c >> 8) & 255, c & 255); };
+ D2D1_GRADIENT_STOP st[2] = { { 0, col(tiles[i].top) }, { 1, col(tiles[i].bot) } };
+ ID2D1GradientStopCollection* gs = nullptr; ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(rt->CreateGradientStopCollection(st, 2, &gs)) && SUCCEEDED(rt->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ r.left, r.top }, { r.right, r.bottom }), gs, &lb)))
+ rt->FillRoundedRectangle(D2D1::RoundedRect(r, 10, 10), lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ if (g_sel == tiles[i].sel) { br->SetColor(Rgb(255, 255, 255, 0.85f)); rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1), 9, 9), br, 2); }
+ wchar_t g[2] = { tiles[i].glyph, 0 };
+ Text(g, g_tfIcon, D2D1::RectF(x + 8, y + 6, x + 32, y + 30), Rgb(255, 255, 255));
+ Text(std::to_wstring(Count(tiles[i].sel)), g_tfCardNumG, D2D1::RectF(x, y + 6, x + 162.5f - 12, y + 32), Rgb(255, 255, 255));
+ Text(tiles[i].sel == S_ALL ? TrPick(L"Todos", L"All") : Tr(tiles[i].name), g_tfCardG, D2D1::RectF(x + 10, y + 28, x + 158, y + 52), Rgb(255, 255, 255));
+ g_hits.push_back({ 1, tiles[i].sel, r });
+ }
+ float y = 53.5f + 3 * 66.f + 12;
+ Text(Tr(L"Minhas Listas"), g_tfHeadG, D2D1::RectF(25, y, SB - 10, y + 22), gray);
+ y += 26;
+ for (auto& l : g_lists) {
+ D2D1_RECT_F r = D2D1::RectF(13, y, SB - 6, y + 36);
+ bool on = g_sel == l.id;
+ if (on) Fill(r, dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.075f), 10);
+ Circle({ 38, y + 18 }, 12, ListColor(l.color), true);
+ br->SetColor(Rgb(255, 255, 255));
+ for (int k = -1; k <= 1; k++) { rt->FillEllipse(D2D1::Ellipse({ 33.5f, y + 18 + k * 4.f }, 1.2f, 1.2f), br); rt->DrawLine({ 36, y + 18 + k * 4.f }, { 43.5f, y + 18 + k * 4.f }, br, 1.4f); }
+ Text(l.name, on ? g_tfListBoldG : g_tfListG, D2D1::RectF(63, r.top, r.right - 40, r.bottom), text);
+ Text(std::to_wstring(Count(l.id)), g_tfInfoRG, D2D1::RectF(r.right - 60, r.top, r.right - 14, r.bottom), gray);
+ g_hits.push_back({ 2, l.id, r });
+ y += 36;
+ }
+ D2D1_RECT_F add = D2D1::RectF(17.5f, sz.height - 40, SB - 10, sz.height - 10);
+ Text(L"+ " + std::wstring(Tr(L"Adicionar Lista")), g_tfInfoG, add, gray);
+ g_hits.push_back({ 3, 0, add });
+ }
+ // ---- barra do conteúdo
+ float W = sz.width;
+ if (g_hideSide) { // a lateral escondida: o botão de mostrar vai para a barra, depois dos três botões
+ D2D1_RECT_F tg = D2D1::RectF(84, 8, 120, 44);
+ GlassButton(tg, dark); IconSidebar({ 102, 26 }, text);
+ g_hits.push_back({ 9, 0, tg }); BarButton(tg);
+ }
+ D2D1_RECT_F srch = D2D1::RectF(W - 8 - 224.5f, 8, W - 8, 44);
+ D2D1_RECT_F grp = D2D1::RectF(srch.left - 7 - 110, 8, srch.left - 7, 44);
+ GlassButton(grp, dark); GlassButton(srch, dark);
+ BarButton(grp); BarButton(srch);
+ br->SetColor(text);
+ { // compartilhar
+ float cx = grp.left + 20, cy = 27;
+ rt->DrawLine({ cx - 2.5f, cy - 3 }, { cx - 6, cy - 3 }, br, 1.4f); rt->DrawLine({ cx - 6, cy - 3 }, { cx - 6, cy + 8 }, br, 1.4f);
+ rt->DrawLine({ cx - 6, cy + 8 }, { cx + 6, cy + 8 }, br, 1.4f); rt->DrawLine({ cx + 6, cy + 8 }, { cx + 6, cy - 3 }, br, 1.4f); rt->DrawLine({ cx + 6, cy - 3 }, { cx + 2.5f, cy - 3 }, br, 1.4f);
+ rt->DrawLine({ cx, cy + 3 }, { cx, cy - 9 }, br, 1.4f); rt->DrawLine({ cx - 3.5f, cy - 5.5f }, { cx, cy - 9 }, br, 1.4f); rt->DrawLine({ cx, cy - 9 }, { cx + 3.5f, cy - 5.5f }, br, 1.4f);
+ g_hits.push_back({ 10, 0, D2D1::RectF(grp.left + 2, 10, grp.left + 38, 42) });
+ }
+ { // mostrar/esconder concluídos (o símbolo da lista com o "+")
+ float cx = grp.left + 55, cy = 26;
+ for (int k = 0; k < 3; k++) rt->DrawLine({ cx - 7 + k * 1.f, cy - 4 + k * 4.f }, { cx + (k == 0 ? 3.f : 7.f), cy - 4 + k * 4.f }, br, 1.4f);
+ Circle({ cx + 6.5f, cy - 5 }, 4, g_showDone ? SelColor() : text, true);
+ g_hits.push_back({ 7, 0, D2D1::RectF(grp.left + 38, 10, grp.left + 72, 42) });
+ }
+ { // + novo lembrete
+ float cx = grp.right - 20, cy = 26;
+ rt->DrawLine({ cx - 7, cy }, { cx + 7, cy }, br, 1.6f); rt->DrawLine({ cx, cy - 7 }, { cx, cy + 7 }, br, 1.6f);
+ if (g_sel != S_DONE) g_hits.push_back({ 6, 0, D2D1::RectF(grp.right - 38, 10, grp.right - 2, 42) });
+ }
+ IconSearch({ srch.left + 18, 26 }, gray);
+ Text(g_filter.empty() ? std::wstring(Tr(L"Buscar")) : g_filter, g_tfInfoG, D2D1::RectF(srch.left + 32, 8, srch.right - 12, 44), g_filter.empty() ? gray : text);
+ g_hits.push_back({ 11, 0, srch });
+ // ---- título, concluídos e a lista
+ float X = S0 + 17, R = W - 15.5f;
+ D2D1_COLOR_F sc = SelColor();
+ int n = 0; for (auto* r : Shown()) if (!r->done || g_sel == S_DONE) n++;
+ Text(SelName(), g_tfTitleG, D2D1::RectF(X, 58, R - 90, 99), sc);
+ Text(std::to_wstring(n), g_tfTitleRG, D2D1::RectF(R - 90, 58, R, 99), sc);
+ if (g_sel >= 0) {
+ int done = 0; for (auto& r : g_rems) if (r.list == g_sel && r.done) done++;
+ wchar_t b[64]; swprintf_s(b, Tr(L"%d Concluídos"), done);
+ std::wstring s = b;
+ float w1 = TextW(g_tfInfoG, s);
+ Text(s, g_tfInfoG, D2D1::RectF(X, 115, X + w1 + 4, 136), gray);
+ if (done) {
+ Text(L"•", g_tfInfoG, D2D1::RectF(X + w1 + 8, 115, X + w1 + 20, 136), gray);
+ D2D1_RECT_F clr = D2D1::RectF(X + w1 + 22, 115, X + w1 + 22 + TextW(g_tfInfoG, Tr(L"Limpar")) + 4, 136);
+ Text(Tr(L"Limpar"), g_tfInfoG, clr, Rgb(10, 132, 255));
+ g_hits.push_back({ 12, 0, clr });
+ }
+ std::wstring sh = g_showDone ? Tr(L"Ocultar") : Tr(L"Mostrar");
+ D2D1_RECT_F shr = D2D1::RectF(R - TextW(g_tfInfoG, sh) - 4, 115, R, 136);
+ Text(sh, g_tfInfoRG, shr, Rgb(10, 132, 255));
+ g_hits.push_back({ 7, 0, shr });
+ }
+ Fill(D2D1::RectF(X, 141.5f, R + 3, 142), dark ? Rgb(255, 255, 255, 0.12f) : Rgb(0, 0, 0, 0.12f));
+ rt->PushAxisAlignedClip(D2D1::RectF(S0, HEAD, sz.width, sz.height), D2D1_ANTIALIAS_MODE_ALIASED);
+ float ry = HEAD + 2 - g_scroll;
+ for (Rem* r : Shown()) {
+ bool sub = !r->notes.empty() || r->due || r->repeat || (g_sel < 0 && g_sel != S_DONE);
+ float h = sub ? 49.5f : 32;
+ RowPos rp{ r->id, ry, ry + h };
+ D2D1_COLOR_F lc = g_sel >= 0 ? sc : (FindList(r->list) ? ListColor(FindList(r->list)->color) : sc);
+ float ind = r->parent && FindRem(r->parent) ? 30.f : 0.f;
+ D2D1_POINT_2F cc{ X + 9.5f + ind, ry + 16 };
+ rp.circle = D2D1::RectF(cc.x - 12, cc.y - 12, cc.x + 12, cc.y + 12);
+ if (r->done) { Circle(cc, 8.5f, lc, false, 1.3f); Circle(cc, 5.5f, lc, true); }
+ else Circle(cc, 8.5f, dark ? Rgb(110, 110, 114) : Rgb(190, 190, 195), false, 1.3f);
+ rp.title = D2D1::RectF(X + 30 + ind, ry + 4, R - 30, ry + 28);
+ if (r->id != g_editing) Text(r->title.empty() ? L" " : r->title, g_tfRowG, rp.title, r->done ? gray : text);
+ if (r->flag) { wchar_t f[2] = { 0xE7C1, 0 }; Text(f, g_tfSmall, D2D1::RectF(R - 24, ry + 4, R, ry + 28), Rgb(255, 159, 10)); }
+ if (sub) {
+ std::wstring s;
+ if (r->due) s = DueText(r->due, true);
+ if (r->repeat) { static const wchar_t* rn[] = { L"", L"Diariamente", L"Dias de Semana", L"Semanalmente", L"Mensalmente", L"Anualmente" }; s += L" ↻ " + std::wstring(Tr(rn[std::clamp(r->repeat, 0, 5)])); }
+ if (g_sel < 0 && g_sel != S_DONE) { List* l = FindList(r->list); if (l) s = s.empty() ? l->name : s + L" · " + l->name; }
+ if (!r->notes.empty()) s = s.empty() ? r->notes : r->notes + L" · " + s;
+ bool late = r->due && r->due < NowMin() && !r->done;
+ Text(s, g_tfSubG, D2D1::RectF(X + 30 + ind, ry + 26, R - 30, ry + 44), late ? Rgb(255, 69, 58) : gray);
+ }
+ g_rows.push_back(rp);
+ ry += h;
+ }
+ if (g_rows.empty() && g_editing < 0) {
+ const wchar_t* tx = g_sel == S_DONE ? Tr(L"Nenhum Lembrete Concluído") : Tr(L"Nenhum Lembrete");
+ static IDWriteTextFormat* tfC = Fmt(17, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER);
+ Text(tx, tfC, D2D1::RectF(S0, HEAD, sz.width, sz.height * 0.7f), gray); // no meio, como no Mac
+ }
+ rt->PopAxisAlignedClip();
+}
+
void Paint() {
if (!BeginPaint()) return;
g_hits.clear(); g_rows.clear();
+ barButtons.clear();
+ if (BAR > 0) { PaintGolden(); EndPaint(); return; }
bool dark = Dark();
D2D1_SIZE_F sz = Size();
D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
@@ -146,6 +320,19 @@ void Paint() {
float x = 10 + (i % 2) * (tw + 10), y = 14 + (i / 2) * (th + 10);
D2D1_RECT_F r = D2D1::RectF(x, y, x + tw, y + th);
bool on = g_sel == tiles[i].sel;
+ if (semaforo::Aqua()) {
+ // macOS 27 (captura Reminders): os cartões são da cor da lista, cheios, com o símbolo, o número e o nome
+ // brancos; o escolhido fica um pouco mais escuro
+ D2D1_COLOR_F c = tiles[i].c;
+ if (on) { c.r *= 0.85f; c.g *= 0.85f; c.b *= 0.85f; }
+ Fill(r, c, 12);
+ wchar_t g[2] = { tiles[i].glyph, 0 };
+ Text(g, g_tfIcon, D2D1::RectF(x + 6, y + 6, x + 30, y + 30), Rgb(255, 255, 255));
+ Text(std::to_wstring(Count(tiles[i].sel)), g_tfTileNum, D2D1::RectF(x, y + 4, x + tw - 10, y + 32), Rgb(255, 255, 255));
+ Text(tiles[i].sel == S_ALL ? TrPick(L"Todos", L"All") : Tr(tiles[i].name), g_tfTile, D2D1::RectF(x + 10, y + 36, x + tw - 6, y + th - 4), Rgb(255, 255, 255));
+ g_hits.push_back({ 1, tiles[i].sel, r });
+ continue;
+ }
Fill(r, on ? tiles[i].c : (dark ? Rgb(58, 58, 60) : Rgb(255, 255, 255)), 10);
Circle({ x + 18, y + 18 }, 12, on ? Rgb(255, 255, 255) : tiles[i].c, true);
wchar_t g[2] = { tiles[i].glyph, 0 };
@@ -482,10 +669,30 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
else if (ht.kind == 3) { NewList(); return 0; }
else if (ht.kind == 6) { NewReminder(); return 0; }
else if (ht.kind == 7) g_showDone = !g_showDone;
+ else if (ht.kind == 9) g_hideSide = !g_hideSide;
+ else if (ht.kind == 12) { // Limpar: apaga os concluídos da lista
+ int list = g_sel;
+ g_rems.erase(std::remove_if(g_rems.begin(), g_rems.end(), [list](const Rem& r) { return r.list == list && r.done; }), g_rems.end());
+ Save();
+ } else if (ht.kind == 10) { // compartilhar: a lista como texto na área de transferência
+ std::wstring s = SelName() + L"\r\n";
+ for (auto* r : Shown()) s += std::wstring(r->done ? L"☑ " : L"☐ ") + r->title + L"\r\n";
+ if (OpenClipboard(h)) {
+ EmptyClipboard();
+ HGLOBAL g = GlobalAlloc(GMEM_MOVEABLE, (s.size() + 1) * sizeof(wchar_t));
+ if (g) { memcpy(GlobalLock(g), s.c_str(), (s.size() + 1) * sizeof(wchar_t)); GlobalUnlock(g); SetClipboardData(CF_UNICODETEXT, g); }
+ CloseClipboard();
+ }
+ } else if (ht.kind == 11) { // busca: filtra enquanto digita
+ FieldOpen(D2D1::RectF(ht.r.left + 32, ht.r.top + 8, ht.r.right - 12, ht.r.bottom - 8), g_filter, 13, false, [](const std::wstring& q, int key) {
+ g_filter = key == VK_ESCAPE ? L"" : q; g_scroll = 0; InvalidateRect(wnd, nullptr, FALSE);
+ });
+ return 0;
+ }
InvalidateRect(h, nullptr, FALSE);
return 0;
}
- for (auto& rp : g_rows) if (x > SB && y >= rp.top && y < rp.bottom && y >= HEAD) {
+ for (auto& rp : g_rows) if (x > (BAR > 0 && g_hideSide ? 0 : SB) && y >= rp.top && y < rp.bottom && y >= HEAD) {
Rem* r = FindRem(rp.id);
if (!r) return 0;
if (right) { RowMenu(rp.id, scr); return 0; }
@@ -496,7 +703,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
InvalidateRect(h, nullptr, FALSE);
return 0;
}
- if (!right && x > SB && y > HEAD) NewReminder(); // clique no vazio: lembrete novo
+ if (!right && x > (BAR > 0 && g_hideSide ? 0 : SB) && y > HEAD) NewReminder(); // clique no vazio: lembrete novo
return 0;
}
case WM_KEYDOWN:
@@ -526,7 +733,20 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
g_tfTileNum = Fmt(22, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_TRAILING);
g_tfIcon = Fmt(14, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
g_tfSmall = Fmt(11, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
- if (!CreateMain(hi, L"LembretesJanela", Tr(L"Lembretes"), Proc, 900, 620)) return 1;
+ g_tfCardG = Fmt(15, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfCardNumG = Fmt(18, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ g_tfTitleG = Fmt(31, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfTitleRG = Fmt(31, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ g_tfRowG = Fmt(15);
+ g_tfSubG = Fmt(13);
+ g_tfListG = Fmt(15);
+ g_tfListBoldG = Fmt(15, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfHeadG = Fmt(13, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfInfoG = Fmt(15);
+ g_tfInfoRG = Fmt(15, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ barWanted = 52; // macOS 27: barra unificada
+ if (semaforo::Aqua()) { SB = 358; HEAD = 143; }
+ if (!CreateMain(hi, L"LembretesJanela", Tr(L"Lembretes"), Proc, semaforo::Aqua() ? 900 : 900, semaforo::Aqua() ? 708 : 620)) return 1;
g_tfBigR = Fmt(28, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_TRAILING);
SetTimer(wnd, 1, 20000, nullptr);
ShowWindow(wnd, show);
diff --git a/src/menu/context_menu.cpp b/src/menu/context_menu.cpp
index ca28079..a1079f6 100644
--- a/src/menu/context_menu.cpp
+++ b/src/menu/context_menu.cpp
@@ -424,6 +424,7 @@ void ctxmenu::SetGlass(const Glass& g) { g_glass = g; g_glassSet = true; }
// Tema Tahoe ligado (Ajustes > Aparência: liquid_glass=1 em %APPDATA%\Shell\ajustes.txt). O Shell avisa
// pelo SetGlass; os outros apps (Finder, Notas...) leem o arquivo, no máximo a cada 2 s.
+static bool g_fileGolden; // golden_gate=1 lido do arquivo (apps fora do Shell)
static bool Tahoe() {
if (g_glassSet) return g_glass.liquid;
static DWORD last; static bool on;
@@ -439,10 +440,19 @@ static bool Tahoe() {
while (!l.empty() && (l.back() == L'\n' || l.back() == L'\r' || l.back() == L' ')) l.pop_back();
if (l == L"liquid_glass=1") on = true;
if (l == L"liquid_glass=0") on = false;
+ if (l == L"golden_gate=1") g_fileGolden = true;
+ if (l == L"golden_gate=0") g_fileGolden = false;
}
fclose(f);
return on;
}
+// macOS 27 Golden Gate (menu Go do Finder, captura 2x): linhas de 24, separador de 11, 5,5 de folga e de recuo do
+// destaque, destaque com canto 7, menu com canto 11, texto a 16 da borda (41 com símbolo) e símbolo só em Ajustes…
+static bool Golden() { bool t = Tahoe(); return t && (g_glassSet ? g_glass.golden : g_fileGolden); }
+static bool GoldenIcon(const std::wstring& l) {
+ for (const wchar_t* k : { L"Ajustes", L"Settings", L"System Settings", L"Preferências", L"Preferences", L"Sobre Este", L"About This", L"App Store", L"Microsoft Store" }) // macOS 27: o menu da Apple tem símbolo nestes if (l.rfind(k, 0) == 0) return true;
+ return false;
+}
// Ícone do Tahoe pelo nome do item, para os menus que não escolhem os seus (glifos da Segoe Fluent Icons).
// O macOS 26 põe um símbolo em quase todo item de menu; os que não casam ficam sem, alinhados com os outros.
@@ -462,6 +472,8 @@ wchar_t ctxmenu::AutoIcon(const std::wstring& label) {
if (has(L"lixo") || has(L"excluir") || has(L"apagar") || has(L"delete") || has(L"trash")) return 0xE74D;
if (has(L"remover do dock") || has(L"desafixar")) return 0xE77A;
if (has(L"manter no dock") || has(L"fixar")) return 0xE718;
+ if (starts(L"sobre este") || starts(L"about this")) return 0xE7F8; // notebook (menu da Apple do macOS 27)
+ if (has(L"app store") || has(L"microsoft store")) return 0xE719; // sacola da loja
if (has(L"informaç") || has(L"propriedades") || has(L"properties") || starts(L"sobre")) return 0xE946;
if (has(L"renomear") || has(L"rename")) return 0xE8AC;
if (has(L"comprimir") || has(L"compactar") || has(L"compress") || has(L"zip")) return 0xF012;
@@ -529,10 +541,11 @@ static bool Selectable(const MItem& m) { return !m.sep && !m.header && !m.disabl
// raio ~8. Bolinhas das etiquetas: 12 a cada 20, numa linha de 22.
static float SepH() { return Tahoe() ? 11.f : M::SEP_H; }
static float ItemH() { return Tahoe() ? 24.f : M::ITEM_H; }
-static float PadY() { return Tahoe() ? 5.f : M::PAD_Y; }
+static float PadY() { return Golden() ? 5.5f : Tahoe() ? 5.f : M::PAD_Y; }
+static float Inset() { return Golden() ? 5.5f : M::INSET; }
const float DOT_D = 12, DOT_PITCH = 20, DOT_ROW_H = 22, ICON_CX = 23, ICON_TEXT_L = 34;
-static float IconCx() { return Tahoe() ? 22.5f : ICON_CX; } // ícone 13 de largura começando em x 16
-static float HotR() { return Tahoe() ? 8.f : M::RADIUS; }
+static float IconCx() { return Golden() ? 23.f : Tahoe() ? 22.5f : ICON_CX; } // ícone 13 de largura começando em x 16
+static float HotR() { return Golden() ? 7.f : Tahoe() ? 8.f : M::RADIUS; }
// Bolinha da fileira sob o x (pixels da janela) ou -1
static int DotAt(const Level& L, const MItem& m, float x) {
@@ -551,7 +564,8 @@ static wuc::CompositionGraphicsDevice g_wgfx{ nullptr };
static winrt::Windows::System::DispatcherQueueController g_wdq{ nullptr };
static ID2D1Device* g_wd2d;
static bool g_wcTried, g_wcOk;
-const float CARD_R = 12; // raio do canto do menu (DIP)
+const float CARD_R_TAHOE = 12; // raio do canto do menu (DIP)
+#define CARD_R (Golden() ? 11.f : CARD_R_TAHOE) // macOS 27: 11 (medido)
static bool CompReady() {
if (g_wcTried) return g_wcOk;
@@ -742,7 +756,7 @@ static void OpenLevel(Session& s, std::vector<MItem>* items, POINT anchor, const
L.tf = MakeFormat(M::FONT * sc, DWRITE_FONT_WEIGHT_NORMAL);
L.tfHdr = MakeFormat(M::HDR_FONT * sc, DWRITE_FONT_WEIGHT_SEMI_BOLD);
if (Tahoe() && !g_plain)
- for (auto& m : *items) if (!m.sep && !m.header && !m.icon && m.dots.empty()) m.icon = ctxmenu::AutoIcon(m.label);
+ for (auto& m : *items) if (!m.sep && !m.header && !m.icon && m.dots.empty() && (!Golden() || GoldenIcon(m.label))) m.icon = ctxmenu::AutoIcon(m.label);
bool hasCheck = false, hasSub = false, hasIcon = false;
float maxW = 0, maxShort = 0;
for (auto& m : *items) {
@@ -756,7 +770,7 @@ static void OpenLevel(Session& s, std::vector<MItem>* items, POINT anchor, const
g_dw->CreateTextFormat(L"Segoe Fluent Icons", nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 13 * sc, L"", &L.tfIcon);
if (L.tfIcon) { L.tfIcon->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); L.tfIcon->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); }
}
- L.textL = (hasIcon ? (Tahoe() ? 33.f : ICON_TEXT_L) : hasCheck ? 26.f : Tahoe() ? 14.f : 16.f) * sc;
+ L.textL = (hasIcon ? (Golden() ? 41.f : Tahoe() ? 33.f : ICON_TEXT_L) : hasCheck ? 26.f : Golden() ? 16.f : Tahoe() ? 14.f : 16.f) * sc;
L.textR = (hasSub ? 34.f : Tahoe() ? 8.f + 6.f : 18.f) * sc; // Tahoe: o atalho termina 8 antes da borda (+ folga do texto)
float W = L.textL + ceilf(maxW) + 2 * sc + L.textR;
W = std::clamp(W, M::MIN_W * sc, M::MAX_W * sc);
@@ -988,6 +1002,8 @@ static void DrawLevel(Session& s, int li) {
// claro = 0,23 × fundo + 0,74. Em alfa sobre o desfoque: escuro 85 % de 0,165; claro 77 % de 0,96.
if (Tahoe()) bg = dk ? D2D1::ColorF(0.165f, 0.165f, 0.172f, 0.85f) : D2D1::ColorF(0.96f, 0.96f, 0.965f, 0.77f);
if (g_glass.alpha) bg.a = g_glass.alpha(bg.a);
+ // macOS 27 Golden Gate: o menu de contexto é vidro fosco (leitoso), não o Liquid Glass transparente do Dock
+ if (Golden()) { bg = dk ? D2D1::ColorF(0.17f, 0.165f, 0.165f, 0.88f) : D2D1::ColorF(0.95f, 0.945f, 0.94f, 0.84f); }
ID2D1SolidColorBrush *text, *dim, *sep, *hdr, *accent, *white;
rt->CreateSolidColorBrush(dk ? D2D1::ColorF(1, 1, 1, 0.92f) : D2D1::ColorF(0, 0, 0, 0.88f), &text);
rt->CreateSolidColorBrush(dk ? D2D1::ColorF(1, 1, 1, 0.30f) : D2D1::ColorF(0, 0, 0, 0.30f), &dim);
@@ -1008,7 +1024,7 @@ static void DrawLevel(Session& s, int li) {
D2D1_RECT_F r = L.rects[i];
if (m.sep) {
float yy = floorf((r.top + r.bottom) / 2) + 0.5f;
- rt->DrawLine(D2D1::Point2F(M::INSET * sc + 5 * sc, yy), D2D1::Point2F(W - M::INSET * sc - 5 * sc, yy), sep, 1.0f);
+ rt->DrawLine(D2D1::Point2F(Inset() * sc + 5 * sc, yy), D2D1::Point2F(W - Inset() * sc - 5 * sc, yy), sep, 1.0f);
continue;
}
D2D1_RECT_F tr = D2D1::RectF(L.textL, r.top, W - L.textR, r.bottom);
@@ -1038,7 +1054,7 @@ static void DrawLevel(Session& s, int li) {
}
bool hot = (int)i == L.hover || ((int)i == L.openChild && L.hover < 0);
if (hot && !m.disabled) {
- D2D1_ROUNDED_RECT rr{ D2D1::RectF(M::INSET * sc, r.top, W - M::INSET * sc, r.bottom), HotR() * sc, HotR() * sc };
+ D2D1_ROUNDED_RECT rr{ D2D1::RectF(Inset() * sc, r.top, W - Inset() * sc, r.bottom), HotR() * sc, HotR() * sc };
rt->FillRoundedRectangle(rr, accent);
}
ID2D1SolidColorBrush* fg = m.disabled ? dim : (hot ? white : text);
@@ -1254,7 +1270,14 @@ static MItem* RunMenu(HWND owner, std::vector<MItem>& items, POINT pt) {
break;
case WM_LBUTTONDOWN: case WM_MBUTTONDOWN:
case WM_NCLBUTTONDOWN: case WM_NCRBUTTONDOWN:
- if (!onPopup) { s.done = true; continue; } // clique fora fecha e é consumido, como no macOS
+ if (!onPopup) {
+ // clique na barra de menus (outro título, relógio, Central...): fecha este e o clique segue para a barra,
+ // que abre o próximo — antes o clique era consumido e era preciso clicar duas vezes
+ wchar_t cls[64] = {}; GetClassNameW(msg.hwnd, cls, 64);
+ s.done = true;
+ if (!wcscmp(cls, L"ShellBarraDeMenus")) PostMessageW(msg.hwnd, msg.message, msg.wParam, msg.lParam); // a barra recebe depois que este fechar
+ continue; // clique fora fecha e é consumido, como no macOS
+ }
break;
}
TranslateMessage(&msg);
diff --git a/src/menu/context_menu.h b/src/menu/context_menu.h
index dd3e368..a3c7ef2 100644
--- a/src/menu/context_menu.h
+++ b/src/menu/context_menu.h
@@ -29,6 +29,7 @@ void WarmupAsync(const std::wstring& folder, const std::wstring& file); // o me
// tinta a partir da original (nullptr = sem mudança).
struct Glass {
bool liquid = false; // Liquid Glass (Tahoe): reflexo e contorno especular
+ bool golden = false; // macOS 27 Golden Gate: medidas do menu do macOS 27 e quase sem símbolos
float (*alpha)(float) = nullptr;
};
void SetGlass(const Glass& g);
diff --git a/src/monitor/main.cpp b/src/monitor/main.cpp
index a6ba45a..9aef4bc 100644
--- a/src/monitor/main.cpp
+++ b/src/monitor/main.cpp
@@ -49,7 +49,7 @@
namespace gfx { bool Init(HWND hwnd); void Resize(UINT w, UINT h); ID2D1DeviceContext* Begin(float dpi); void End(); }
namespace shadow { void Create(HWND main); void SetActive(bool active); void Update(); void Destroy(); void SetRadius(float dip); }
namespace tahoe {
-const float WINDOW_R = 26;
+float WindowR(); // 26 pt no Tahoe, 16 pt no Golden Gate
bool On(); bool Reload(); void Frame(HWND h, bool on); void Size(HWND h, float wpx, float hpx, bool dark); float Radius(HWND h);
bool PushWindowClip(ID2D1DeviceContext* dc, D2D1_SIZE_F s, float radius);
void WindowRim(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, D2D1_SIZE_F s, float radius, bool dark);
@@ -760,6 +760,7 @@ void DrawLights(ID2D1RenderTarget* rt, ID2D1SolidColorBrush* br) {
auto c = LightCenter(k);
br->SetColor(lit ? fill[k] : g_dark ? D2D1::ColorF(0.30f, 0.30f, 0.31f) : D2D1::ColorF(0.84f, 0.84f, 0.84f));
rt->FillEllipse(D2D1::Ellipse(c, 7, 7), br);
+ semaforo::Gloss(rt, c, 7, br);
br->SetColor(lit ? ring[k] : g_dark ? D2D1::ColorF(0, 0, 0, 0.3f) : D2D1::ColorF(0.73f, 0.73f, 0.74f));
rt->DrawEllipse(D2D1::Ellipse(c, 6.75f, 6.75f), br, 0.5f);
if (!g_hoverLights) continue;
@@ -1155,7 +1156,7 @@ void ApplyTheme() {
tahoe::Frame(g_hwnd, true);
RECT rc; GetClientRect(g_hwnd, &rc);
tahoe::Size(g_hwnd, (float)rc.right, (float)rc.bottom, g_dark);
- shadow::SetRadius(tahoe::WINDOW_R);
+ shadow::SetRadius(tahoe::WindowR());
return;
}
tahoe::Frame(g_hwnd, false);
diff --git a/src/musica/main.cpp b/src/musica/main.cpp
index 9d6bfbe..e34567b 100644
--- a/src/musica/main.cpp
+++ b/src/musica/main.cpp
@@ -27,7 +27,7 @@ namespace wmc = winrt::Windows::Media::Core;
namespace {
-const float SB = 200, TB = 70, ROWH = 28;
+float SB = 200, TB = 70, ROWH = 28; // macOS 27: barra de 52 (o player vai para baixo)
const UINT WM_SCAN = WM_APP + 3, WM_ART = WM_APP + 4, WM_ENDED = WM_APP + 6;
struct Song { std::wstring path, title, artist, album; int track = 0; double secs = 0; FILETIME added{}; };
@@ -45,6 +45,7 @@ wmp::MediaPlayer g_player{ nullptr };
std::map<std::wstring, ID2D1Bitmap*> g_art; // por álbum
std::map<std::wstring, bool> g_artAsked;
IDWriteTextFormat *g_tfSide, *g_tfHead, *g_tfRow, *g_tfRowR, *g_tfSmall, *g_tfLcd, *g_tfLcdSub, *g_tfIcon, *g_tfIconBig, *g_tfAlbum;
+IDWriteTextFormat *g_tfSec, *g_tfSideB, *g_tfTitleG, *g_tfIconS, *g_tfLcdL, *g_tfLcdSubL; // macOS 27
float g_volume = 0.8f;
std::wstring Prop(IPropertyStore* ps, const PROPERTYKEY& k) {
@@ -199,16 +200,26 @@ double LenSecs() { try { return g_player.PlaybackSession().NaturalDuration().cou
std::wstring Mmss(double s) { int t = (int)s; wchar_t b[16]; swprintf_s(b, L"%d:%02d", t / 60, t % 60); return b; }
// ---- listas
+// macOS 27: a busca da barra filtra (título, artista ou álbum) e o botão de filtro escolhe a ordem das músicas
+std::wstring g_search;
+int g_sortBy; // 0 padrão, 1 título, 2 artista, 3 álbum
+bool Matches(const std::wstring& a) {
+ if (g_search.empty()) return true;
+ std::wstring x = a, q = g_search;
+ for (auto& c : x) c = towlower(c);
+ for (auto& c : q) c = towlower(c);
+ return x.find(q) != std::wstring::npos;
+}
std::vector<std::wstring> Albums() {
std::vector<std::wstring> v;
std::map<std::wstring, bool> seen;
- for (auto& s : g_songs) if (!seen[s.album] && (g_artistSel.empty() || s.artist == g_artistSel)) { seen[s.album] = true; v.push_back(s.album); }
+ for (auto& s : g_songs) if (!seen[s.album] && (g_artistSel.empty() || s.artist == g_artistSel) && (Matches(s.album) || Matches(s.artist))) { seen[s.album] = true; v.push_back(s.album); }
std::sort(v.begin(), v.end());
return v;
}
std::vector<std::wstring> Artists() {
std::vector<std::wstring> v; std::map<std::wstring, bool> seen;
- for (auto& s : g_songs) if (!seen[s.artist]) { seen[s.artist] = true; v.push_back(s.artist); }
+ for (auto& s : g_songs) if (!seen[s.artist] && Matches(s.artist)) { seen[s.artist] = true; v.push_back(s.artist); }
std::sort(v.begin(), v.end());
return v;
}
@@ -218,8 +229,15 @@ void BuildRows() {
auto& s = g_songs[i];
if (g_view == 1 && !g_artistSel.empty() && s.artist != g_artistSel) continue;
if (g_view == 2 && !g_albumSel.empty() && s.album != g_albumSel) continue;
+ if (!Matches(s.title) && !Matches(s.artist) && !Matches(s.album)) continue;
g_rows.push_back(i);
}
+ if (g_sortBy && (g_view == 3 || g_view == 0)) std::stable_sort(g_rows.begin(), g_rows.end(), [](int a, int b) {
+ auto& x = g_songs[a]; auto& y = g_songs[b];
+ const std::wstring& p = g_sortBy == 1 ? x.title : g_sortBy == 2 ? x.artist : x.album;
+ const std::wstring& q = g_sortBy == 1 ? y.title : g_sortBy == 2 ? y.artist : y.album;
+ return _wcsicmp(p.c_str(), q.c_str()) < 0;
+ });
if (g_view == 0) std::sort(g_rows.begin(), g_rows.end(), [](int a, int b) { return CompareFileTime(&g_songs[a].added, &g_songs[b].added) > 0; });
if (g_view == 2 && !g_albumSel.empty()) std::sort(g_rows.begin(), g_rows.end(), [](int a, int b) { return g_songs[a].track < g_songs[b].track; });
if (g_view == 0 && g_rows.size() > 100) g_rows.resize(100);
@@ -228,6 +246,99 @@ void BuildRows() {
struct Hit { int kind, arg; D2D1_RECT_F r; }; // 1 vista, 2 linha, 3 álbum, 4 artista, 5 botões do visor, 6 progresso, 7 volume, 8 voltar
std::vector<Hit> g_hits;
+// ---- macOS 27 (captura Music do 512 Pixels, 2x, medida em pt): lateral de 200, cheia, com os três botões em cima;
+// seções em cinza ("Biblioteca") e linhas de 32 com o ícone vermelho a 37 e o nome a 55 (a escolhida numa pílula
+// cinza de 10 a 190). O título da vista fica na barra, em negrito, a 20 do conteúdo, com a divisa a 52; à direita o
+// botão redondo de filtro e a busca em cápsula. O player é uma cápsula de vidro de 56 flutuando a 18 do fundo, no
+// meio do conteúdo: aleatório, anterior, tocar, próxima e repetir à esquerda, o que toca no meio, fila e volume à
+// direita.
+void PaintSideGolden(D2D1_SIZE_F sz, bool dark, D2D1_COLOR_F text, D2D1_COLOR_F gray, D2D1_COLOR_F pink) {
+ Fill(D2D1::RectF(0, 0, SB, sz.height), SidebarColor());
+ Fill(D2D1::RectF(SB - 0.5f, 0, SB, sz.height), dark ? Rgb(0, 0, 0, 0.5f) : Rgb(0, 0, 0, 0.08f));
+ Text(Tr(L"Biblioteca"), g_tfSec, D2D1::RectF(16, 58, SB, 74), gray);
+ const wchar_t* titles[] = { L"Recentes", L"Artistas", L"Álbuns", L"Músicas" };
+ wchar_t icons[] = { 0xE823, 0xE77B, 0xE93C, 0xEC4F };
+ for (int i = 0; i < 4; i++) {
+ float cy = 92 + i * 32.f;
+ D2D1_RECT_F r = D2D1::RectF(10, cy - 16, SB - 10, cy + 16);
+ bool on = i == g_view;
+ if (on) Fill(r, dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.07f), 9);
+ wchar_t g[2] = { icons[i], 0 };
+ Text(g, g_tfIcon, D2D1::RectF(26, r.top, 48, r.bottom), pink);
+ Text(i == 3 ? TrPick(L"Músicas", L"Songs") : Tr(titles[i]), on ? g_tfSideB : g_tfSide, D2D1::RectF(55, r.top, r.right - 6, r.bottom), text);
+ g_hits.push_back({ 1, i, r });
+ }
+}
+
+void PaintBarGolden(D2D1_SIZE_F sz, bool dark, D2D1_COLOR_F text, D2D1_COLOR_F gray, const std::wstring& head) {
+ Fill(D2D1::RectF(SB, 0, sz.width, TB), dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ Fill(D2D1::RectF(SB, TB - 0.5f, sz.width, TB), dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.09f));
+ Text(head, g_tfTitleG, D2D1::RectF(SB + 20, 0, sz.width - 240, TB), dark ? Rgb(255, 255, 255, 0.85f) : Rgb(0, 0, 0, 0.75f));
+ // busca em cápsula e o filtro
+ D2D1_RECT_F f = D2D1::RectF(sz.width - 8 - 141, 8, sz.width - 8, 44);
+ GlassField(f, dark);
+ IconSearch({ f.left + 18, 26 }, gray, 0.85f);
+ std::wstring ph = g_view == 2 ? Tr(L"Buscar em Álbuns") : g_view == 1 ? Tr(L"Buscar em Artistas") : Tr(L"Buscar em Músicas");
+ Text(g_search.empty() ? ph : g_search, g_tfSmall, D2D1::RectF(f.left + 30, f.top, f.right - 10, f.bottom), g_search.empty() ? gray : text);
+ g_hits.push_back({ 20, 0, f });
+ D2D1_RECT_F b = D2D1::RectF(f.left - 8 - 36, 8, f.left - 8, 44);
+ GlassButton(b, dark);
+ br->SetColor(text);
+ for (int i = 0; i < 3; i++) { float w = 7.f - i * 2; rt->DrawLine({ (b.left + b.right) / 2 - w, 21.f + i * 5 }, { (b.left + b.right) / 2 + w, 21.f + i * 5 }, br, 1.4f); }
+ BarButton(b); BarButton(f);
+ g_hits.push_back({ 21, 0, b });
+}
+
+void PaintPlayerGolden(D2D1_SIZE_F sz, bool dark, D2D1_COLOR_F text, D2D1_COLOR_F gray, D2D1_COLOR_F pink) {
+ float cx = (SB + sz.width) / 2, w = std::min(702.f, sz.width - SB - 40);
+ D2D1_RECT_F cap = D2D1::RectF(cx - w / 2, sz.height - 18 - 56, cx + w / 2, sz.height - 18);
+ for (int k = 4; k >= 1; k--) { // sombra
+ br->SetColor(D2D1::ColorF(0, 0, 0, dark ? 0.12f : 0.035f));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cap.left - k, cap.top + k * 0.8f, cap.right + k, cap.bottom + k * 1.6f), 28.f + k, 28.f + k), br);
+ }
+ Fill(cap, dark ? Rgb(44, 44, 46, 0.96f) : Rgb(252, 252, 252, 0.97f), 28);
+ br->SetColor(dark ? Rgb(255, 255, 255, 0.12f) : Rgb(0, 0, 0, 0.07f));
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cap.left + 0.25f, cap.top + 0.25f, cap.right - 0.25f, cap.bottom - 0.25f), 27.75f, 27.75f), br, 0.5f);
+ float cy = (cap.top + cap.bottom) / 2;
+ bool has = g_pos >= 0 && g_pos < (int)g_queue.size();
+ D2D1_COLOR_F off = dark ? Rgb(255, 255, 255, 0.35f) : Rgb(0, 0, 0, 0.28f);
+ struct B { int id; wchar_t g; float x; bool big; bool on; } btns[] = {
+ { 0, 0xE8B1, 24, false, g_shuffle }, { 1, 0xE892, 56, false, false }, { 2, Playing() ? (wchar_t)0xE769 : (wchar_t)0xE768, 92, true, false },
+ { 3, 0xE893, 128, false, false }, { 4, g_repeat == 2 ? (wchar_t)0xE8ED : (wchar_t)0xE8EE, 160, false, g_repeat != 0 } };
+ for (auto& b : btns) {
+ D2D1_RECT_F r = D2D1::RectF(cap.left + b.x - 15, cy - 15, cap.left + b.x + 15, cy + 15);
+ wchar_t g[2] = { b.g, 0 };
+ Text(g, b.big ? g_tfIconBig : g_tfIconS, r, b.on ? pink : has || b.id == 2 ? text : off);
+ g_hits.push_back({ 5, b.id, r });
+ }
+ // o que toca: capa, nome e artista, e a barra de progresso
+ D2D1_RECT_F mid = D2D1::RectF(cap.left + 190, cap.top + 6, cap.right - 150, cap.bottom - 6);
+ if (has) {
+ const Song& s = g_songs[g_queue[g_pos]];
+ D2D1_RECT_F art = D2D1::RectF(mid.left, cy - 20, mid.left + 40, cy + 20);
+ if (ID2D1Bitmap* b = Art(s)) rt->DrawBitmap(b, art); else Fill(art, dark ? Rgb(72, 72, 74) : Rgb(220, 220, 225), 6);
+ float tx = art.right + 10;
+ Text(s.title, g_tfLcdL, D2D1::RectF(tx, cy - 19, mid.right, cy - 3), text);
+ Text(s.artist, g_tfLcdSubL, D2D1::RectF(tx, cy - 3, mid.right, cy + 11), gray);
+ double pos = PosSecs(), len = std::max(LenSecs(), s.secs);
+ D2D1_RECT_F bar = D2D1::RectF(tx, cy + 15, mid.right, cy + 17.5f);
+ Fill(bar, dark ? Rgb(255, 255, 255, 0.15f) : Rgb(0, 0, 0, 0.10f), 1.25f);
+ if (len > 0) Fill(D2D1::RectF(bar.left, bar.top, bar.left + (bar.right - bar.left) * (float)std::clamp(pos / len, 0.0, 1.0), bar.bottom), gray, 1.25f);
+ g_hits.push_back({ 6, 0, D2D1::RectF(bar.left, bar.top - 6, bar.right, bar.bottom + 6) });
+ } else {
+ wchar_t g[2] = { 0xEC4F, 0 };
+ Text(g, g_tfIconBig, mid, off);
+ }
+ // direita: fila e volume
+ wchar_t q[2] = { 0xE8FD, 0 };
+ Text(q, g_tfIconS, D2D1::RectF(cap.right - 140, cy - 15, cap.right - 112, cy + 15), text);
+ D2D1_RECT_F vol = D2D1::RectF(cap.right - 84, cy - 1.5f, cap.right - 24, cy + 1.5f);
+ wchar_t vg[2] = { 0xE767, 0 }; Text(vg, g_tfIconS, D2D1::RectF(vol.left - 26, cy - 12, vol.left - 4, cy + 12), text);
+ Fill(vol, dark ? Rgb(255, 255, 255, 0.15f) : Rgb(0, 0, 0, 0.12f), 1.5f);
+ Fill(D2D1::RectF(vol.left, vol.top, vol.left + (vol.right - vol.left) * g_volume, vol.bottom), gray, 1.5f);
+ g_hits.push_back({ 7, 0, D2D1::RectF(vol.left - 4, cy - 10, vol.right + 4, cy + 10) });
+}
+
void Paint() {
if (!BeginPaint()) return;
g_hits.clear();
@@ -236,23 +347,32 @@ void Paint() {
D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139), pink = Rgb(250, 45, 72), line = dark ? Rgb(255, 255, 255, 0.07f) : Rgb(0, 0, 0, 0.06f);
rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
std::lock_guard<std::mutex> lk(g_mx);
+ const bool gg = BAR > 0;
float X = SB + 20, W = sz.width - 20;
// ---- conteúdo
rt->PushAxisAlignedClip(D2D1::RectF(SB, TB, sz.width, sz.height), D2D1_ANTIALIAS_MODE_ALIASED);
- float y = TB + 14 - g_scroll;
+ float y = TB + (gg ? 30.f : 14.f) - g_scroll;
const wchar_t* titles[] = { L"Recentes", L"Artistas", L"Álbuns", L"Músicas" };
std::wstring head = g_view == 3 ? TrPick(L"Músicas", L"Songs") : Tr(titles[g_view]);
if (g_view == 1 && !g_artistSel.empty()) head = g_artistSel;
if (g_view == 2 && !g_albumSel.empty()) head = g_albumSel;
- if ((g_view == 1 && !g_artistSel.empty()) || (g_view == 2 && !g_albumSel.empty())) {
+ if (gg) { // macOS 27: o título vai para a barra; aqui só o "voltar"
+ if ((g_view == 1 && !g_artistSel.empty()) || (g_view == 2 && !g_albumSel.empty())) {
+ D2D1_RECT_F back = D2D1::RectF(X, y - 20, X + 160, y + 4);
+ Text(L"‹ " + std::wstring(g_view == 1 ? Tr(L"Artistas") : Tr(L"Álbuns")), g_tfRow, back, pink);
+ g_hits.push_back({ 8, 0, back });
+ y += 14;
+ }
+ } else if ((g_view == 1 && !g_artistSel.empty()) || (g_view == 2 && !g_albumSel.empty())) {
D2D1_RECT_F back = D2D1::RectF(X, y, X + 24, y + 34);
Text(L"‹", g_tfHead, back, pink);
g_hits.push_back({ 8, 0, back });
Text(head, g_tfHead, D2D1::RectF(X + 26, y, W, y + 34), text);
} else Text(head, g_tfHead, D2D1::RectF(X, y, W, y + 34), text);
- y += 46;
+ if (!gg) y += 46;
if (g_view == 2 && g_albumSel.empty()) { // grade de álbuns
- float cell = 170, gap = 22;
+ float cell = gg ? 200.f : 170.f, gap = 22;
+ if (gg) X = SB + 33;
int cols = std::max(1, (int)((W - X + gap) / (cell + gap)));
auto al = Albums();
for (int i = 0; i < (int)al.size(); i++) {
@@ -268,6 +388,7 @@ void Paint() {
g_hits.push_back({ 3, i, r });
}
y += ((int)al.size() + cols - 1) / cols * (cell + 52);
+ if (gg) X = SB + 20;
} else if (g_view == 1 && g_artistSel.empty()) { // artistas
auto ar = Artists();
for (int i = 0; i < (int)ar.size(); i++) {
@@ -305,6 +426,13 @@ void Paint() {
if (g_rows.empty()) Text(g_scanning ? Tr(L"Lendo a biblioteca…") : Tr(L"Nenhuma música na pasta Música."), g_tfRow, D2D1::RectF(SB, TB + 80, sz.width, TB + 160), gray);
}
rt->PopAxisAlignedClip();
+ if (gg) { // macOS 27: lateral cheia, título na barra e o player numa cápsula embaixo
+ PaintSideGolden(sz, dark, text, gray, pink);
+ PaintBarGolden(sz, dark, text, gray, head);
+ PaintPlayerGolden(sz, dark, text, gray, pink);
+ EndPaint();
+ return;
+ }
// ---- barra lateral
Fill(D2D1::RectF(0, TB, SB, sz.height), SidebarColor());
Text(Tr(L"Biblioteca"), g_tfSmall, D2D1::RectF(16, TB + 12, SB, TB + 30), gray);
@@ -402,11 +530,28 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
case WM_LBUTTONDOWN: case WM_LBUTTONDBLCLK: {
float s = Sc(), x = GET_X_LPARAM(l) / s, y = GET_Y_LPARAM(l) / s;
bool dbl = m == WM_LBUTTONDBLCLK;
- for (auto& ht : g_hits) {
+ for (auto hit = g_hits.rbegin(); hit != g_hits.rend(); ++hit) { // o desenhado por cima (o player) primeiro
+ auto& ht = *hit;
if (!In(ht.r, x, y)) continue;
switch (ht.kind) {
case 1: g_view = ht.arg; g_artistSel.clear(); g_albumSel.clear(); g_scroll = 0; g_selRow = -1; BuildRows(); break;
case 8: if (g_view == 1) g_artistSel.clear(); else g_albumSel.clear(); g_scroll = 0; g_selRow = -1; BuildRows(); break;
+ case 20: { // busca: filtra enquanto digita
+ FieldOpen(D2D1::RectF(ht.r.left + 30, ht.r.top + 9, ht.r.right - 10, ht.r.bottom - 9), g_search, 12, false, [](const std::wstring& q, int key) {
+ g_search = key == VK_ESCAPE ? L"" : q; g_scroll = 0; g_selRow = -1; BuildRows(); InvalidateRect(wnd, nullptr, FALSE);
+ });
+ return 0;
+ }
+ case 21: { // filtro: a ordem das músicas
+ HMENU mm = CreatePopupMenu();
+ const wchar_t* nm[4] = { L"Ordem Padrão", L"Título", L"Artista", L"Álbum" };
+ for (int k = 0; k < 4; k++) AppendMenuW(mm, MF_STRING | (g_sortBy == k ? MF_CHECKED : 0), 100 + k, Tr(nm[k]));
+ POINT scr{ (LONG)(ht.r.left * s), (LONG)(ht.r.bottom * s) }; ClientToScreen(h, &scr);
+ int c = TrackPopupMenu(mm, TPM_RETURNCMD, scr.x, scr.y, 0, h, nullptr);
+ DestroyMenu(mm);
+ if (c >= 100) { g_sortBy = c - 100; BuildRows(); }
+ break;
+ }
case 2: g_selRow = ht.arg; if (dbl) PlayFrom(g_rows, ht.arg); break;
case 3: { auto al = Albums(); g_albumSel = al[ht.arg]; g_scroll = 0; g_selRow = -1; BuildRows(); if (dbl && !g_rows.empty()) PlayFrom(g_rows, 0); break; }
case 4: { auto ar = Artists(); g_artistSel = ar[ht.arg]; g_scroll = 0; g_selRow = -1; BuildRows(); break; }
@@ -448,7 +593,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
std::wstring arg;
- { int argc = 0; LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc); if (argc > 1) arg = argv[1]; if (argv) LocalFree(argv); }
+ { int argc = 0; LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc); if (argc > 1 && wcscmp(argv[1], L"--foto")) arg = argv[1]; if (argv) LocalFree(argv); }
// já aberto: manda o arquivo para a janela que existe (uma janela só, como no Mac)
if (HWND other = FindWindowW(L"MusicaJanela", nullptr)) {
if (!arg.empty()) { COPYDATASTRUCT cd{ 0x4D555343, (DWORD)((arg.size() + 1) * 2), (PVOID)arg.c_str() }; DWORD_PTR r; SendMessageTimeoutW(other, WM_COPYDATA, 0, (LPARAM)&cd, SMTO_ABORTIFHUNG, 3000, &r); }
@@ -466,7 +611,15 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
g_tfLcdSub = Fmt(11, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER);
g_tfIcon = Fmt(15, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
g_tfIconBig = Fmt(24, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
- if (!CreateMain(hi, L"MusicaJanela", Tr(L"Música"), Proc, 1150, 760)) return 1;
+ g_tfSec = Fmt(11, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfSideB = Fmt(13, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfTitleG = Fmt(13, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfIconS = Fmt(14, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
+ g_tfLcdL = Fmt(12, DWRITE_FONT_WEIGHT_SEMI_BOLD);
+ g_tfLcdSubL = Fmt(11);
+ barWanted = 52; // macOS 27: barra unificada
+ if (!CreateMain(hi, L"MusicaJanela", Tr(L"Música"), Proc, semaforo::Aqua() ? 1145 : 1150, semaforo::Aqua() ? 735 : 760)) return 1;
+ if (BAR > 0) TB = 52;
try {
g_player = wmp::MediaPlayer();
g_player.Volume(g_volume);
diff --git a/src/notas/main.cpp b/src/notas/main.cpp
index c6abb5a..7eb97a4 100644
--- a/src/notas/main.cpp
+++ b/src/notas/main.cpp
@@ -308,7 +308,7 @@ int HitCard(D2D1_POINT_2F p) {
// ---------------------------------------------------------------------------
// botões das barras de ferramentas
-enum Btn { B_SIDEBAR, B_LIST, B_GALLERY, B_TRASH, B_BACK, B_COMPOSE, B_FORMAT, B_CHECK, B_TABLE, B_AUDIO, B_MEDIA, B_COLLAB, B_LOCK, B_SHARE, B_SEARCH, B_COUNT };
+enum Btn { B_SIDEBAR, B_LIST, B_GALLERY, B_TRASH, B_BACK, B_COMPOSE, B_FORMAT, B_CHECK, B_TABLE, B_AUDIO, B_MEDIA, B_COLLAB, B_LOCK, B_SHARE, B_SEARCH, B_FOLDER, B_MORE, B_COUNT }; // B_FOLDER/B_MORE: macOS 27
struct BtnInfo { D2D1_RECT_F r{}; bool shown = false, enabled = true; const wchar_t* glyph = L""; bool chevron = false; float gw = 17, gh = 15; };
BtnInfo g_btn[B_COUNT];
D2D1_RECT_F g_searchRect;
@@ -330,9 +330,19 @@ void LayoutButtons() {
return;
}
put(B_SIDEBAR, g_sideHidden ? 104.f : std::min(108.f, SideW() - 22), L"sidebar.left", 32, 18, 14);
+ const bool gg = semaforo::Aqua();
+ if (gg) {
+ // macOS 27 (captura Notes, 2x): na lateral, "nova pasta" e esconder a lateral em botões redondos de vidro; na
+ // coluna das notas, o nome da pasta e a contagem à esquerda e "⋯" (Lista/Galeria, Apagar) à direita; nada de
+ // colaborar e cadeado; a busca é um campo sempre à vista
+ auto round = [&](int id, float cx, const wchar_t* glyph, float gw, float gh) { put(id, cx, glyph, 36, gw, gh); g_btn[id].r.top = TOOL_CY - 18; g_btn[id].r.bottom = TOOL_CY + 18; };
+ if (!g_sideHidden) { round(B_SIDEBAR, SideW() - 26, L"sidebar.left", 18, 14); round(B_FOLDER, SideW() - 70, L"folder.badge.plus", 19, 14); }
+ else round(B_SIDEBAR, 104.f, L"sidebar.left", 18, 14);
+ }
float L0 = ToolStart() + (g_sideHidden ? 0 : 0);
put(B_LIST, L0 + 30, L"list.bullet", 36, 15, 12);
put(B_GALLERY, L0 + 69, L"square.grid.2x2", 36, 14, 14);
+ if (gg) { g_btn[B_LIST].shown = g_btn[B_GALLERY].shown = false; }
float e0;
if (g_gallery) {
put(B_TRASH, L0 + 110, L"trash", 32, 14, 16);
@@ -341,6 +351,7 @@ void LayoutButtons() {
} else {
put(B_TRASH, ListR() - 26, L"trash", 32, 14, 16);
e0 = ListR();
+ if (gg) { g_btn[B_TRASH].shown = false; put(B_MORE, ListR() - 28, L"", 36, 16, 4); g_btn[B_MORE].r.top = TOOL_CY - 18; g_btn[B_MORE].r.bottom = TOOL_CY + 18; }
}
float e1 = c.width;
put(B_COMPOSE, e0 + 29, L"square.and.pencil", 32, 16, 16);
@@ -355,10 +366,21 @@ void LayoutButtons() {
float w = std::clamp((e1 - e0) * 0.32f, 150.f, 230.f);
g_searchRect = { right - w, TOOL_CY - 13, right, TOOL_CY + 13 };
right = g_searchRect.left - 6;
+ } else if (gg) { // macOS 27: o campo da busca já fica à vista (clique abre para digitar)
+ float w = std::clamp((e1 - e0) * 0.32f, 150.f, 230.f);
+ put(B_SEARCH, right - w / 2, L"magnifyingglass", w, 13, 13);
+ g_btn[B_SEARCH].r.top = TOOL_CY - 18; g_btn[B_SEARCH].r.bottom = TOOL_CY + 18;
+ right = right - w - 6;
} else { put(B_SEARCH, e1 - 28, L"magnifyingglass", 32, 15, 15); right = e1 - 44; }
put(B_SHARE, right - 22, L"square.and.arrow.up", 32, 14, 17);
put(B_LOCK, right - 22 - 44, L"lock", 40, 12, 16, true);
put(B_COLLAB, right - 22 - 92, L"person.crop.circle.badge.plus", 34, 18, 16);
+ if (gg) { // macOS 27: só compartilhar (redondo) à direita dos do meio
+ g_btn[B_COLLAB].shown = g_btn[B_LOCK].shown = false;
+ put(B_SHARE, right - 20, L"square.and.arrow.up", 36, 14, 17);
+ g_btn[B_SHARE].r.top = TOOL_CY - 18; g_btn[B_SHARE].r.bottom = TOOL_CY + 18;
+ g_btn[B_COLLAB].r = g_btn[B_SHARE].r; // para os do meio sumirem antes de encostar
+ }
// sem espaço: os do meio somem antes de encostar nos da direita
for (int id : { B_MEDIA, B_AUDIO, B_TABLE, B_CHECK, B_FORMAT })
if (g_btn[id].r.right > g_btn[B_COLLAB].r.left - 6) g_btn[id].shown = false;
@@ -414,6 +436,7 @@ void DrawLights(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br) {
auto c = LightCenter(k);
br->SetColor(lit ? fill[k] : g_dark ? D2D1::ColorF(0.24f, 0.24f, 0.25f) : D2D1::ColorF(0.839f, 0.839f, 0.839f));
dc->FillEllipse(D2D1::Ellipse(c, 7, 7), br);
+ semaforo::Gloss(dc, c, 7, br);
br->SetColor(lit ? ring[k] : g_dark ? D2D1::ColorF(0, 0, 0, 0.3f) : D2D1::ColorF(0.729f, 0.729f, 0.737f));
dc->DrawEllipse(D2D1::Ellipse(c, 6.75f, 6.75f), br, 0.5f);
if (!g_hoverLights) continue;
@@ -473,7 +496,8 @@ void DrawSidebar(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const Pal& pa
if (s.count) Text(dc, br, std::to_wstring(s.count), g_fCount, D2D1::RectF(r.right - 60, r.top, r.right - 8, r.bottom), pal.text2);
}
dc->PopAxisAlignedClip();
- // + Nova Pasta
+ // + Nova Pasta (macOS 27: no botão de vidro da lateral)
+ if (semaforo::Aqua()) return;
auto nr = NewFolderRect();
float cy = (nr.top + nr.bottom) / 2;
Glyph(dc, br, L"plus.circle", 27, cy, 15, 15, pal.text2);
@@ -481,6 +505,36 @@ void DrawSidebar(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const Pal& pa
}
void DrawToolbarButtons(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const Pal& pal) {
+ if (semaforo::Aqua()) {
+ // macOS 27 (captura Notes, 2x): os botões ficam em cápsulas de vidro de 36 de altura — escrever; Aa, lista,
+ // tabela, áudio e mídia juntos; cadeado e compartilhar juntos; a busca numa cápsula própria
+ auto cap = [&](int a, int b) {
+ if (!g_btn[a].shown || !g_btn[b].shown) return;
+ D2D1_RECT_F r = D2D1::RectF(std::min(g_btn[a].r.left, g_btn[b].r.left) - 4, TOOL_CY - 18, std::max(g_btn[a].r.right, g_btn[b].r.right) + 4, TOOL_CY + 18);
+ br->SetColor(D2D1::ColorF(0, 0, 0, g_dark ? 0.22f : 0.05f));
+ dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left, r.top + 1, r.right, r.bottom + 1.5f), 18, 18), br);
+ br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.09f) : D2D1::ColorF(1, 1, 1, 0.92f));
+ dc->FillRoundedRectangle(D2D1::RoundedRect(r, 18, 18), br);
+ br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.14f) : D2D1::ColorF(0, 0, 0, 0.07f));
+ dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.5f, r.top + 0.5f, r.right - 0.5f, r.bottom - 0.5f), 17.5f, 17.5f), br, 1);
+ };
+ cap(B_COMPOSE, B_COMPOSE);
+ cap(B_FORMAT, B_MEDIA);
+ if (g_btn[B_LOCK].shown) cap(B_LOCK, B_SHARE); else cap(B_SHARE, B_SHARE);
+ cap(B_SEARCH, B_SEARCH);
+ cap(B_SIDEBAR, B_SIDEBAR);
+ cap(B_FOLDER, B_FOLDER);
+ cap(B_MORE, B_MORE);
+ // nome da pasta e quantas notas, à esquerda da coluna das notas (no lugar do seletor lista/galeria)
+ if (!g_gallery && !g_quick) {
+ float L = ToolStart() + 18, R = g_btn[B_MORE].shown ? g_btn[B_MORE].r.left - 6 : ListR() - 10;
+ int n = 0; for (auto& r : g_rows) if (!r.header) n++;
+ std::wstring name = Searching() ? std::wstring(Tr(L"Resultados")) : store::FolderName(g_folder);
+ wchar_t b[48]; swprintf_s(b, Tr(n == 1 ? L"%d nota" : L"%d notas"), n);
+ Text(dc, br, name, g_f13b, D2D1::RectF(L, TOOL_CY - 16, R, TOOL_CY + 1), pal.text);
+ Text(dc, br, b, g_f11, D2D1::RectF(L, TOOL_CY + 1, R, TOOL_CY + 15), pal.text2);
+ }
+ }
// seletor lista/galeria: o escolhido fica num quadrado cinza arredondado
auto& seg = g_btn[g_gallery ? B_GALLERY : B_LIST];
br->SetColor(g_dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.075f));
@@ -495,6 +549,12 @@ void DrawToolbarButtons(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const
D2D1_COLOR_F col = b.enabled ? pal.icon : pal.iconOff;
if ((i == B_LIST && !g_gallery) || (i == B_GALLERY && g_gallery)) col = g_dark ? D2D1::ColorF(1, 1, 1, 0.85f) : D2D1::ColorF(0, 0, 0, 0.75f);
float cx = (b.r.left + b.r.right) / 2 - (b.chevron ? 6 : 0);
+ if (i == B_MORE) { br->SetColor(col); for (int k = -1; k <= 1; k++) dc->FillEllipse(D2D1::Ellipse({ cx + k * 5.5f, TOOL_CY }, 1.6f, 1.6f), br); continue; }
+ if (i == B_SEARCH && semaforo::Aqua()) { // campo fechado: lupa e "Buscar"
+ Glyph(dc, br, b.glyph, b.r.left + 18, TOOL_CY, 13, 13, pal.text2);
+ Text(dc, br, Tr(L"Buscar"), g_f13, D2D1::RectF(b.r.left + 32, b.r.top, b.r.right - 8, b.r.bottom), pal.text3);
+ continue;
+ }
Glyph(dc, br, b.glyph, cx, TOOL_CY, b.gw, b.gh, col);
if (b.chevron) Chevron(dc, br, b.r.right - 9, TOOL_CY + 0.5f, 2.6f, col);
}
@@ -1096,6 +1156,15 @@ void ClickButton(int b) {
case B_FORMAT: g_fmtOpen = !g_fmtOpen; if (g_fmtOpen) { g_focus = F_EDITOR; editor::Focus(true); } break;
case B_CHECK: editor::ToggleList(L_CHECK); g_focus = F_EDITOR; editor::Focus(true); break;
case B_SEARCH: OpenSearch(); break;
+ case B_FOLDER: NewFolderCmd(); break;
+ case B_MORE: { // macOS 27: Lista / Galeria e apagar a nota
+ auto r = g_btn[B_MORE].r;
+ Item sep; sep.separator = true;
+ std::vector<Item> items = { I(Tr(L"Ver como Lista"), 1, false, !g_gallery), I(Tr(L"Ver como Galeria"), 2, false, g_gallery), sep, I(Tr(L"Apagar Nota"), 3, !g_sel) };
+ int id = ctxmenu::ShowItems(g_hwnd, ScreenPt(r.left, r.bottom + 4), items);
+ if (id == 1) SetGallery(false); else if (id == 2) SetGallery(true); else if (id == 3 && g_sel) DeleteNoteCmd(g_sel);
+ break;
+ }
default: UnavailableMenu(b); break;
}
Invalidate();
@@ -1355,7 +1424,7 @@ LRESULT CALLBACK WndProc(HWND h, UINT m, WPARAM w, LPARAM l) {
if (!g_gallery && std::fabs(p.x - ListR()) <= 4) { g_divDrag = 2; SetCapture(h); return 0; }
// barra lateral
if (p.x < SideW()) {
- if (In(NewFolderRect(), p)) { NewFolderCmd(); return 0; }
+ if (!semaforo::Aqua() && In(NewFolderRect(), p)) { NewFolderCmd(); return 0; }
int s = HitSide(p);
if (s >= 0) {
if (g_focus == F_RENAME && g_side[s].id == g_renameId) { g_rename.Click(g_f13, p, false); Invalidate(); return 0; }
diff --git a/src/preview/main.cpp b/src/preview/main.cpp
index 0f30d03..3bb0bfb 100644
--- a/src/preview/main.cpp
+++ b/src/preview/main.cpp
@@ -28,6 +28,7 @@
#include <string>
#include <thread>
#include <vector>
+#include "../comum/semaforo.h" // semaforo::Aqua(): tema macOS Golden Gate
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Data.Pdf.h>
#include <winrt/Windows.Storage.h>
@@ -51,7 +52,10 @@ HWND g_wnd;
ID2D1Factory* g_d2d;
IDWriteFactory* g_dw;
IWICImagingFactory* g_wic;
-ID2D1HwndRenderTarget* g_rt;
+ID2D1RenderTarget* g_rt; // a janela (ou, no teste --foto, um bitmap)
+ID2D1HwndRenderTarget* g_hrt;
+IWICBitmap* g_fotoBmp; // --foto <arquivo.png> (teste): desenha num bitmap e salva, sem passar pela tela
+std::wstring g_fotoPath;
ID2D1SolidColorBrush* g_br;
IDWriteTextFormat *g_tfTitle, *g_tfSub, *g_tfIcon, *g_tfEmpty;
@@ -72,9 +76,20 @@ int g_rot = 0; // imagem: 0..3 (x90 graus)
float g_sx = 0, g_sy = 0; // rolagem (DIP)
bool g_drag = false; POINT g_dragAt{}; float g_dragSx = 0, g_dragSy = 0;
int g_hoverBtn = -1;
+// macOS 27 (captura Preview do 512 Pixels): barra unificada de 52 (sem a barra do Windows; a WacOSWindow.dll põe os
+// três botões a 26/49/72), o nome em negrito e "Página 1 de 81" à esquerda depois deles, e os botões em grupos de
+// vidro redondos à direita (−/1:1/+ juntos numa cápsula)
struct Btn { wchar_t glyph; const wchar_t* tip; int id; D2D1_RECT_F r; };
std::vector<Btn> g_btns;
-enum { B_ROT, B_OUT, B_IN, B_FIT, B_PRINT, B_MARK, B_EXPORT };
+enum { B_ROT, B_OUT, B_IN, B_FIT, B_PRINT, B_MARK, B_EXPORT, B_SIDE };
+// macOS 27 (captura Preview, 2x): PDF com mais de uma página abre com a coluna das miniaturas à esquerda (206 pt,
+// por baixo dos três botões da janela); a página atual fica num fundo azul-acinzentado arredondado, o número embaixo.
+// O botão da lateral (com ⌄) fica na barra, no fim da coluna.
+bool g_side = true;
+float g_thumbTotal = 0;
+IDWriteTextFormat* g_tfThumbNum;
+float g_thumbScroll = 0;
+std::vector<std::pair<int, D2D1_RECT_F>> g_thumbHits;
// ---- marcação (Marcar do Mac): os traços ficam nas unidades da página (pixels da imagem / pontos do PDF)
enum Tool { T_PEN, T_HILITE, T_RECT, T_OVAL, T_ARROW, T_TEXT, T_SIGN, T_CROP, T_COUNT };
@@ -233,10 +248,12 @@ void Neighbor(int dir) {
}
// ---- geometria: tamanho de cada página na tela (DIP), com o zoom atual
+bool g_unified;
+float SideW() { return g_unified && g_side && g_pdf && g_pages.size() > 1 ? 206.f : 0.f; }
D2D1_SIZE_F ViewSize() {
RECT r; GetClientRect(g_wnd, &r);
float sc = Sc();
- return { r.right / sc, r.bottom / sc - TB };
+ return { r.right / sc - SideW(), r.bottom / sc - TB };
}
float FitZoom() {
if (g_pages.empty()) return 1;
@@ -291,7 +308,7 @@ void SetZoom(float z, POINT anchorClient = { -1, -1 }) {
z = std::clamp(z, 0.05f, 16.f);
D2D1_SIZE_F v = ViewSize();
float sc = Sc();
- float ax = anchorClient.x >= 0 ? anchorClient.x / sc : v.width / 2, ay = anchorClient.y >= 0 ? anchorClient.y / sc - TB : v.height / 2;
+ float ax = anchorClient.x >= 0 ? anchorClient.x / sc - SideW() : v.width / 2, ay = anchorClient.y >= 0 ? anchorClient.y / sc - TB : v.height / 2;
float cx = (g_sx + ax) / old, cy = (g_sy + ay) / old; // ponto do documento sob o mouse fica parado
g_fit = false; g_zoom = z;
g_sx = cx * z - ax; g_sy = cy * z - ay;
@@ -304,14 +321,23 @@ void CreateRes() {
if (g_rt) return;
RECT r; GetClientRect(g_wnd, &r);
float dpi = (float)GetDpiForWindow(g_wnd);
- auto props = D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(), dpi, dpi);
- g_d2d->CreateHwndRenderTarget(props, D2D1::HwndRenderTargetProperties(g_wnd, D2D1::SizeU(r.right, r.bottom)), &g_rt);
+ if (!g_fotoPath.empty()) {
+ IWICImagingFactory* wic = nullptr;
+ CoCreateInstance(CLSID_WICImagingFactory, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&wic));
+ if (wic && r.right > 0 && r.bottom > 0 && SUCCEEDED(wic->CreateBitmap(r.right, r.bottom, GUID_WICPixelFormat32bppPBGRA, WICBitmapCacheOnLoad, &g_fotoBmp)))
+ g_d2d->CreateWicBitmapRenderTarget(g_fotoBmp, D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_SOFTWARE, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), dpi, dpi), &g_rt);
+ if (wic) wic->Release();
+ } else {
+ auto props = D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(), dpi, dpi);
+ g_d2d->CreateHwndRenderTarget(props, D2D1::HwndRenderTargetProperties(g_wnd, D2D1::SizeU(r.right, r.bottom)), &g_hrt);
+ g_rt = g_hrt;
+ }
if (g_rt) g_rt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0), &g_br);
}
void DropRes() {
for (auto& p : g_pages) if (p.bmp) { p.bmp->Release(); p.bmp = nullptr; p.renderedW = 0; }
if (g_br) { g_br->Release(); g_br = nullptr; }
- if (g_rt) { g_rt->Release(); g_rt = nullptr; }
+ if (g_rt) { g_rt->Release(); g_rt = nullptr; g_hrt = nullptr; }
if (!g_pdf && !g_path.empty()) { std::wstring p = g_path; CreateRes(); float z = g_zoom; bool f = g_fit; int ro = g_rot; float sx = g_sx, sy = g_sy; Open(p); g_zoom = z; g_fit = f; g_rot = ro; g_sx = sx; g_sy = sy; }
}
@@ -319,7 +345,7 @@ void DropRes() {
bool PageRect(int idx, D2D1_RECT_F& out) {
D2D1_SIZE_F v = ViewSize();
float tw, th; auto pl = Layout(tw, th);
- float offX = tw < v.width ? (v.width - tw) / 2 : -g_sx, offY = TB - g_sy;
+ float offX = (tw < v.width ? (v.width - tw) / 2 : -g_sx) + SideW(), offY = TB - g_sy;
for (auto& p : pl) if (p.idx == idx) {
out = D2D1::RectF(offX + MARGIN + (tw - 2 * MARGIN - (p.r.right - p.r.left)) / 2, offY + p.r.top, 0, offY + p.r.bottom);
out.right = out.left + (p.r.right - p.r.left);
@@ -604,9 +630,10 @@ void Paint() {
g_rt->Clear(dark ? D2D1::ColorF(0.118f, 0.118f, 0.122f) : D2D1::ColorF(0.89f, 0.89f, 0.90f));
// páginas
float tw, th; auto pl = Layout(tw, th);
- float offX = tw < W ? (W - tw) / 2 : -g_sx, offY = TB - g_sy;
+ const float XS = SideW();
+ float offX = (tw < W ? (W - tw) / 2 : -g_sx) + XS, offY = TB - g_sy;
float z = Zoom(), sc = Sc();
- g_rt->PushAxisAlignedClip(D2D1::RectF(0, TB, W, TB + v.height), D2D1_ANTIALIAS_MODE_ALIASED);
+ g_rt->PushAxisAlignedClip(D2D1::RectF(XS, TB, XS + W, TB + v.height), D2D1_ANTIALIAS_MODE_ALIASED);
for (auto& p : pl) {
D2D1_RECT_F r = D2D1::RectF(offX + MARGIN + (tw - 2 * MARGIN - (p.r.right - p.r.left)) / 2, offY + p.r.top, 0, offY + p.r.bottom);
r.right = r.left + (p.r.right - p.r.left);
@@ -635,14 +662,46 @@ void Paint() {
if (g_drawing && g_cur.page == p.idx) DrawAnn(g_rt, g_cur, r, z);
}
g_rt->PopAxisAlignedClip();
+ g_thumbHits.clear();
+ if (XS > 0) { // coluna das miniaturas
+ g_br->SetColor(dark ? D2D1::ColorF(0.17f, 0.165f, 0.16f) : D2D1::ColorF(0.93f, 0.93f, 0.925f));
+ g_rt->FillRectangle(D2D1::RectF(0, 0, XS, TB + v.height), g_br);
+ g_br->SetColor(dark ? D2D1::ColorF(0, 0, 0, 0.5f) : D2D1::ColorF(0, 0, 0, 0.10f));
+ g_rt->FillRectangle(D2D1::RectF(XS - 0.5f, 0, XS, TB + v.height), g_br);
+ g_rt->PushAxisAlignedClip(D2D1::RectF(0, TOOLH, XS, TB + v.height), D2D1_ANTIALIAS_MODE_ALIASED);
+ int cur = CurrentPage();
+ float y = TOOLH + 8 - g_thumbScroll, tw2 = XS - 62;
+ for (int i = 0; i < (int)g_pages.size(); i++) {
+ auto& pg = g_pages[i];
+ float th2 = pg.w > 0 ? tw2 * pg.h / pg.w : tw2 * 1.3f;
+ D2D1_RECT_F pr = D2D1::RectF((XS - tw2) / 2, y + 8, (XS + tw2) / 2, y + 8 + th2);
+ D2D1_RECT_F cell = D2D1::RectF(14, y, XS - 14, pr.bottom + 26);
+ if (cell.bottom > TOOLH && cell.top < TB + v.height) {
+ if (i == cur) { g_br->SetColor(dark ? D2D1::ColorF(0.33f, 0.42f, 0.58f, 0.85f) : D2D1::ColorF(0.55f, 0.64f, 0.78f, 0.85f)); g_rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cell.left, cell.top, cell.right, pr.bottom + 8), 8, 8), g_br); }
+ g_br->SetColor(D2D1::ColorF(0, 0, 0, 0.15f)); g_rt->FillRectangle(D2D1::RectF(pr.left + 0.5f, pr.top + 1, pr.right + 0.5f, pr.bottom + 1.5f), g_br);
+ g_br->SetColor(D2D1::ColorF(1, 1, 1)); g_rt->FillRectangle(pr, g_br);
+ if (pg.bmp) g_rt->DrawBitmap(pg.bmp, pr, 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
+ else if (!pg.pending && pg.renderedW == 0) { pg.pending = true; Request(i, (int)std::lround(tw2 * 2 * sc)); } // a miniatura também serve de primeira imagem
+ wchar_t nb[16]; swprintf_s(nb, L"%d", i + 1);
+ g_br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.75f) : D2D1::ColorF(0, 0, 0, 0.7f));
+ g_rt->DrawTextW(nb, (UINT32)wcslen(nb), g_tfThumbNum ? g_tfThumbNum : g_tfSub, D2D1::RectF(cell.left, pr.bottom + 8, cell.right, pr.bottom + 24), g_br);
+ }
+ g_thumbHits.push_back({ i, cell });
+ y = pr.bottom + 34;
+ }
+ g_thumbTotal = y + g_thumbScroll - TOOLH;
+ g_rt->PopAxisAlignedClip();
+ }
if (g_pages.empty()) {
const wchar_t* t = !g_error.empty() ? g_error.c_str() : g_path.empty() ? Tr(L"Abra uma imagem ou um PDF (Ctrl+O) ou solte um arquivo aqui.") : Tr(L"Abrindo…");
g_br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.5f) : D2D1::ColorF(0, 0, 0, 0.5f));
g_rt->DrawTextW(t, (UINT32)wcslen(t), g_tfEmpty, D2D1::RectF(20, TB, W - 20, TB + v.height), g_br);
}
- // barra de ferramentas
+ // barra de ferramentas (a janela toda; com a coluna, ela fica atrás só do conteúdo)
+ W = v.width + XS;
g_br->SetColor(dark ? D2D1::ColorF(0.17f, 0.17f, 0.18f) : D2D1::ColorF(0.965f, 0.965f, 0.965f));
- g_rt->FillRectangle(D2D1::RectF(0, 0, W, TOOLH), g_br);
+ g_rt->FillRectangle(D2D1::RectF(XS, 0, W, TOOLH), g_br);
+ if (XS > 0) { g_br->SetColor(dark ? D2D1::ColorF(0.17f, 0.165f, 0.16f) : D2D1::ColorF(0.93f, 0.93f, 0.925f)); g_rt->FillRectangle(D2D1::RectF(0, 0, XS - 0.5f, TOOLH), g_br); }
g_br->SetColor(dark ? D2D1::ColorF(0, 0, 0, 0.6f) : D2D1::ColorF(0, 0, 0, 0.14f));
g_rt->DrawLine({ 0, TOOLH - 0.5f }, { W, TOOLH - 0.5f }, g_br, 1);
std::wstring name = g_path.empty() ? Tr(L"Pré-Visualização") : g_path.substr(g_path.find_last_of(L"\\/") + 1);
@@ -654,6 +713,46 @@ void Paint() {
// botões à direita
g_btns = { { 0xE70F, L"Marcar", B_MARK }, { 0xE78C, L"Exportar", B_EXPORT }, { 0xE7AD, L"Girar", B_ROT }, { 0xE71F, L"Reduzir", B_OUT }, { 0xE8A3, L"Ampliar", B_IN }, { 0xE9A6, L"Ajustar", B_FIT }, { 0xE749, L"Imprimir", B_PRINT } };
float bx = W - 14;
+ if (g_unified) { // macOS 27: grupos de vidro
+ auto glass = [&](D2D1_RECT_F r) {
+ float rad = (r.bottom - r.top) / 2;
+ for (int k = 3; k >= 1; k--) { g_br->SetColor(D2D1::ColorF(0, 0, 0, dark ? 0.10f : 0.035f)); g_rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left - k * 0.5f, r.top + k * 0.6f, r.right + k * 0.5f, r.bottom + k * 1.1f), rad + k, rad + k), g_br); }
+ g_br->SetColor(dark ? D2D1::ColorF(0.24f, 0.24f, 0.245f, 1) : D2D1::ColorF(0.985f, 0.985f, 0.985f, 1));
+ g_rt->FillRoundedRectangle(D2D1::RoundedRect(r, rad, rad), g_br);
+ g_br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.13f) : D2D1::ColorF(0, 0, 0, 0.09f));
+ g_rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.25f, r.top + 0.25f, r.right - 0.25f, r.bottom - 0.25f), rad - 0.25f, rad - 0.25f), g_br, 0.5f);
+ };
+ // da direita para a esquerda: imprimir, exportar, girar, marcar (redondos) e a cápsula −/ajustar/+
+ int order[4] = { 6, 1, 2, 0 };
+ bx = W - 8;
+ for (int k = 0; k < 4; k++) { auto& bt = g_btns[order[k]]; bt.r = D2D1::RectF(bx - 36, 8, bx, 44); glass(bt.r); bx -= 36 + 8; }
+ D2D1_RECT_F cap = D2D1::RectF(bx - 108, 8, bx, 44);
+ glass(cap);
+ g_btns[3].r = D2D1::RectF(cap.left + 2, 8, cap.left + 36, 44);
+ g_btns[5].r = D2D1::RectF(cap.left + 37, 8, cap.left + 71, 44);
+ g_btns[4].r = D2D1::RectF(cap.left + 72, 8, cap.left + 106, 44);
+ bx = cap.left - 8;
+ if (g_pdf && g_pages.size() > 1) { // lateral (com ⌄): no fim da coluna, ou depois dos três botões sem ela
+ float sx = XS > 0 ? XS - 58 : 84;
+ g_btns.push_back({ 0xE8A0, L"Barra Lateral", B_SIDE, D2D1::RectF(sx, 8, sx + 50, 44) });
+ glass(g_btns.back().r);
+ }
+ for (int i = 0; i < (int)g_btns.size(); i++) {
+ auto& bt = g_btns[i];
+ if (i == g_hoverBtn || (bt.id == B_MARK && g_markup)) { g_br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.06f)); g_rt->FillRoundedRectangle(D2D1::RoundedRect(bt.r, 18, 18), g_br); }
+ bool off = (bt.id == B_ROT && g_pdf) || g_pages.empty();
+ g_br->SetColor(dark ? D2D1::ColorF(1, 1, 1, off ? 0.3f : 0.88f) : D2D1::ColorF(0, 0, 0, off ? 0.25f : 0.8f));
+ if (bt.id == B_SIDE) { // o ícone da lateral e o ⌄
+ float cx = bt.r.left + 19, cy = 26;
+ g_rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(cx - 8, cy - 6.5f, cx + 8, cy + 6.5f), 2.5f, 2.5f), g_br, 1.3f);
+ g_rt->DrawLine({ cx - 3, cy - 6 }, { cx - 3, cy + 6 }, g_br, 1.3f);
+ g_rt->DrawLine({ bt.r.right - 17, cy - 1.5f }, { bt.r.right - 14, cy + 1.5f }, g_br, 1.3f); g_rt->DrawLine({ bt.r.right - 14, cy + 1.5f }, { bt.r.right - 11, cy - 1.5f }, g_br, 1.3f);
+ continue;
+ }
+ wchar_t g[2] = { bt.glyph, 0 };
+ g_rt->DrawTextW(g, 1, g_tfIcon, bt.r, g_br);
+ }
+ } else
for (int i = (int)g_btns.size() - 1; i >= 0; i--) {
auto& bt = g_btns[i];
bt.r = D2D1::RectF(bx - 34, TOOLH / 2 - 15, bx, TOOLH / 2 + 15);
@@ -668,9 +767,10 @@ void Paint() {
g_rt->DrawTextW(g, 1, g_tfIcon, bt.r, g_br);
}
g_br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.92f) : D2D1::ColorF(0, 0, 0, 0.88f));
- g_rt->DrawTextW(name.c_str(), (UINT32)name.size(), g_tfTitle, D2D1::RectF(16, 8, bx - 10, 28), g_br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ float tx = g_unified ? (XS > 0 ? XS + 12.f : g_pdf && g_pages.size() > 1 ? 146.f : 96.f) : 16.f; // macOS 27: depois dos três botões (ou da coluna)
+ g_rt->DrawTextW(name.c_str(), (UINT32)name.size(), g_tfTitle, D2D1::RectF(tx, 8, bx - 10, 28), g_br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
g_br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.5f) : D2D1::ColorF(0, 0, 0, 0.5f));
- g_rt->DrawTextW(sub.c_str(), (UINT32)sub.size(), g_tfSub, D2D1::RectF(16, 28, bx - 10, 46), g_br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ g_rt->DrawTextW(sub.c_str(), (UINT32)sub.size(), g_tfSub, D2D1::RectF(tx, 28, bx - 10, 46), g_br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
PaintMarkupBar(dark, W);
if (g_rt->EndDraw() == D2DERR_RECREATE_TARGET) DropRes();
}
@@ -703,6 +803,7 @@ void OpenDialog() {
}
void Action(int id) {
+ if (id == B_SIDE) { g_side = !g_side; ClampScroll(); InvalidateRect(g_wnd, nullptr, FALSE); return; }
if (g_pages.empty()) return;
switch (id) {
case B_ROT: if (!g_pdf) { g_rot = (g_rot + 3) % 4; ClampScroll(); InvalidateRect(g_wnd, nullptr, FALSE); } break;
@@ -716,14 +817,32 @@ void Action(int id) {
}
LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ if (g_unified && m == WM_NCCALCSIZE && w) { // macOS 27: sem a barra de cima do Windows (as bordas ficam)
+ auto* p = (NCCALCSIZE_PARAMS*)l;
+ LONG top = p->rgrc[0].top;
+ LRESULT r = DefWindowProcW(h, m, w, l);
+ p->rgrc[0].top = top;
+ if (IsZoomed(h)) { UINT dpi = GetDpiForWindow(h); p->rgrc[0].top += GetSystemMetricsForDpi(SM_CYFRAME, dpi) + GetSystemMetricsForDpi(SM_CXPADDEDBORDER, dpi); }
+ return r;
+ }
+ if (g_unified && m == WM_NCHITTEST) { // arrasta pela barra, menos pelos botões
+ LRESULT r = DefWindowProcW(h, m, w, l);
+ if (r != HTCLIENT) return r;
+ POINT p{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ScreenToClient(h, &p);
+ float s = Sc(), x = p.x / s, y = p.y / s;
+ if (!IsZoomed(h) && p.y < (int)(5 * s)) return HTTOP;
+ if (y >= TOOLH || x < 84) return HTCLIENT;
+ for (auto& b : g_btns) if (x >= b.r.left && x < b.r.right && y >= b.r.top && y < b.r.bottom) return HTCLIENT;
+ return HTCAPTION;
+ }
switch (m) {
case WM_PAINT: { PAINTSTRUCT ps; BeginPaint(h, &ps); Paint(); EndPaint(h, &ps); return 0; }
case WM_ERASEBKGND: return 1;
- case WM_SIZE: if (g_rt) g_rt->Resize(D2D1::SizeU(LOWORD(l), HIWORD(l))); ClampScroll(); InvalidateRect(h, nullptr, FALSE); return 0;
+ case WM_SIZE: if (g_hrt) g_hrt->Resize(D2D1::SizeU(LOWORD(l), HIWORD(l))); ClampScroll(); InvalidateRect(h, nullptr, FALSE); return 0;
case WM_DPICHANGED: {
RECT* r = (RECT*)l;
SetWindowPos(h, nullptr, r->left, r->top, r->right - r->left, r->bottom - r->top, SWP_NOZORDER | SWP_NOACTIVATE);
- if (g_rt) g_rt->SetDpi((float)HIWORD(w), (float)HIWORD(w));
+ if (g_hrt) g_hrt->SetDpi((float)HIWORD(w), (float)HIWORD(w));
InvalidateRect(h, nullptr, FALSE);
return 0;
}
@@ -759,6 +878,9 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
if (m == WM_MOUSEWHEEL && (GET_KEYSTATE_WPARAM(w) & MK_CONTROL)) {
POINT p{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ScreenToClient(h, &p);
SetZoom(Zoom() * std::pow(1.15f, d), p);
+ } else if (POINT p{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ScreenToClient(h, &p), p.x / Sc() < SideW()) { // a coluna rola sozinha
+ g_thumbScroll = std::clamp(g_thumbScroll - d * 80, 0.f, std::max(0.f, g_thumbTotal - ViewSize().height));
+ InvalidateRect(h, nullptr, FALSE);
} else if (m == WM_MOUSEHWHEEL || (GET_KEYSTATE_WPARAM(w) & MK_SHIFT)) Scroll(m == WM_MOUSEHWHEEL ? d * 60 : -d * 60, 0);
else Scroll(0, -d * 80);
return 0;
@@ -766,6 +888,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
case WM_LBUTTONDOWN: {
float sc = Sc(), x = GET_X_LPARAM(l) / sc, y = GET_Y_LPARAM(l) / sc;
for (auto& b : g_btns) if (x >= b.r.left && x < b.r.right && y >= b.r.top && y < b.r.bottom) { Action(b.id); return 0; }
+ if (x < SideW() && y > TOOLH) { for (auto& th : g_thumbHits) if (y >= th.second.top && y < th.second.bottom) { GoPage(th.first); return 0; } return 0; }
for (auto& b : g_mbtns) if (x >= b.r.left && x < b.r.right && y >= b.r.top && y < b.r.bottom) {
CommitText();
if (b.kind == 0) { if (g_tool == T_SIGN && b.arg != T_SIGN) EndSignCapture(); g_tool = b.arg; }
@@ -920,6 +1043,7 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
const wchar_t* fam = HasFont(L"SF Pro Text") ? L"SF Pro Text" : HasFont(L"Inter") ? L"Inter" : L"Segoe UI";
g_tfTitle = Fmt(fam, 13, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
g_tfSub = Fmt(fam, 11, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+ g_tfThumbNum = Fmt(fam, 11, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
g_tfIcon = Fmt(HasFont(L"Segoe Fluent Icons") ? L"Segoe Fluent Icons" : L"Segoe MDL2 Assets", 15, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
g_tfEmpty = Fmt(fam, 14, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
if (g_tfEmpty) g_tfEmpty->SetWordWrapping(DWRITE_WORD_WRAPPING_WRAP);
@@ -940,12 +1064,39 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
nullptr, nullptr, hi, nullptr);
if (!g_wnd) return 1;
BOOL dark = Dark(); DwmSetWindowAttribute(g_wnd, 20 /*DWMWA_USE_IMMERSIVE_DARK_MODE*/, &dark, sizeof(dark));
+ if (semaforo::Aqua()) { // macOS 27: barra unificada (a DLL só desenha os três botões)
+ g_unified = true;
+ SetPropW(g_wnd, L"WacOSBarraUnificada", (HANDLE)(INT_PTR)52);
+ SetWindowPos(g_wnd, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ }
std::thread(PdfThread).detach();
ShowWindow(g_wnd, show);
UpdateWindow(g_wnd);
int argc = 0;
LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
- if (argc > 1 && argv[1][0]) Open(argv[1]); else PostMessageW(g_wnd, WM_PV_ASK, 0, 0); // sem arquivo: pergunta qual, como o Mac
+ for (int i = 1; i + 1 < argc; i++) if (!wcscmp(argv[i], L"--foto")) g_fotoPath = argv[i + 1];
+ if (!g_fotoPath.empty()) { // teste: salva a foto da janela daqui a pouco e fecha
+ if (g_rt) { g_rt->Release(); g_rt = nullptr; g_hrt = nullptr; }
+ if (g_br) { g_br->Release(); g_br = nullptr; }
+ CreateRes();
+ SetTimer(nullptr, 0, 2500, [](HWND, UINT, UINT_PTR id, DWORD) {
+ KillTimer(nullptr, id);
+ Paint();
+ IWICImagingFactory* wic = nullptr;
+ CoCreateInstance(CLSID_WICImagingFactory, nullptr, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&wic));
+ IWICStream* st = nullptr; IWICBitmapEncoder* enc = nullptr; IWICBitmapFrameEncode* fr = nullptr;
+ UINT w = 0, hh = 0; if (g_fotoBmp) g_fotoBmp->GetSize(&w, &hh);
+ if (g_fotoBmp && wic && SUCCEEDED(wic->CreateStream(&st)) && SUCCEEDED(st->InitializeFromFilename(g_fotoPath.c_str(), GENERIC_WRITE)) &&
+ SUCCEEDED(wic->CreateEncoder(GUID_ContainerFormatPng, nullptr, &enc)) && SUCCEEDED(enc->Initialize(st, WICBitmapEncoderNoCache)) &&
+ SUCCEEDED(enc->CreateNewFrame(&fr, nullptr)) && SUCCEEDED(fr->Initialize(nullptr))) {
+ fr->SetSize(w, hh); WICPixelFormatGUID f = GUID_WICPixelFormat32bppPBGRA; fr->SetPixelFormat(&f);
+ fr->WriteSource(g_fotoBmp, nullptr); fr->Commit(); enc->Commit();
+ }
+ if (fr) fr->Release(); if (enc) enc->Release(); if (st) st->Release(); if (wic) wic->Release();
+ DestroyWindow(g_wnd);
+ });
+ }
+ if (argc > 1 && argv[1][0] && wcscmp(argv[1], L"--foto")) Open(argv[1]); else if (g_fotoPath.empty()) PostMessageW(g_wnd, WM_PV_ASK, 0, 0); // sem arquivo: pergunta qual, como o Mac
if (argv) LocalFree(argv);
MSG msg;
while (GetMessageW(&msg, nullptr, 0, 0)) { TranslateMessage(&msg); DispatchMessageW(&msg); }
diff --git a/src/quicktime/main.cpp b/src/quicktime/main.cpp
index 16f6330..f3afc72 100644
--- a/src/quicktime/main.cpp
+++ b/src/quicktime/main.cpp
@@ -4,6 +4,7 @@
// Espaço tocar/pausar; ← → 5 s; ↑ ↓ volume; Ctrl+F ou duplo clique tela cheia; Esc sai; Ctrl+O abrir; soltar arquivo.
// Uma janela por vídeo, como no Mac.
#include "../comum/app2d.h"
+#include "../comum/barra_video.h"
#include <mfplay.h>
#include <mfapi.h>
#include <shellapi.h>
@@ -32,6 +33,19 @@ struct BarHit { int id; D2D1_RECT_F r; };
std::vector<BarHit> g_hits;
enum { B_VOL = 1, B_BACK, B_PLAY, B_FWD, B_FULL, B_SCRUB };
const float BAR_W = 520, BAR_H = 76;
+// macOS 27 (captura QuickTime do 512 Pixels, 2x, medida em pt): 454 × 98, cantos 22, vidro claro e quente sobre o
+// vídeo; em cima o volume com o botão redondo, ⏪ ⏯ ⏩ no meio e AirPlay, legendas e "»" à direita; embaixo os dois
+// tempos e a linha do tempo com o botão redondo, a 20 do fundo da janela
+const float GG_W = 458, GG_H = 98, GG_TOP = 32;
+// a barra de controles tem vidro fosco de verdade: uma janela com o acrílico do Windows (desfoca o vídeo) logo
+// abaixo da barra em camadas, recortada nos mesmos cantos de 22
+HWND g_barBack;
+// macOS 27: a barra de título é vidro fosco por cima do vídeo (o vídeo ocupa a janela toda). g_topBack = acrílico
+// (desfoca), g_top = camada com a tinta escura, os cantos de 16 da janela, o ícone do documento e o nome. As duas ficam
+// logo acima da janela e abaixo dos três botões da WacOSWindow.dll; o mouse passa direto (arrasta pela janela).
+HWND g_topBack, g_top;
+IDWriteTextFormat *g_tfTimeL, *g_tfTimeR, *g_tfTop;
+bool Unified() { return semaforo::Aqua() && !g_full; } // macOS 27: barra de título de 32 desenhada pelo app
// ---- MFPlay
class Callback : public IMFPMediaPlayerCallback {
@@ -95,7 +109,8 @@ void PaintBar() {
float s = GetDpiForWindow(wnd) / 96.f;
RECT cr; GetClientRect(wnd, &cr);
POINT org{ 0, 0 }; ClientToScreen(wnd, &org);
- int w = (int)std::lround(std::min(BAR_W, cr.right / s - 40) * s), h = (int)std::lround(BAR_H * s);
+ const bool gg = semaforo::Aqua();
+ int w = (int)std::lround(std::min(gg ? GG_W : BAR_W, cr.right / s - 40) * s), h = (int)std::lround((gg ? GG_H : BAR_H) * s);
if (w < 200) { ShowWindow(g_bar, SW_HIDE); return; }
int x = org.x + (cr.right - w) / 2, y = org.y + cr.bottom - h - (int)std::lround(24 * s);
HDC screen = GetDC(nullptr), mem = CreateCompatibleDC(screen);
@@ -110,6 +125,30 @@ void PaintBar() {
rt2->BeginDraw(); rt2->Clear(D2D1::ColorF(0, 0, 0, 0));
ID2D1SolidColorBrush* b = nullptr; rt2->CreateSolidColorBrush(D2D1::ColorF(0.12f, 0.12f, 0.13f, 0.78f), &b);
float W = w / s, H = h / s;
+ if (gg && b) {
+ // macOS 27 (captura QuickTime, medida em pt): 458 × 98, cantos 22, a 20 do fundo; linha de cima a 30,5
+ // (alto-falante a 27, volume de 40,5 a 117,5, ⏪ ⏵ ⏩ no meio, AirPlay, legendas e » a 124,5/81/26 da
+ // direita); linha de baixo a 73 (tempos de 13 a 17 das bordas, linha do tempo de 113,5 a 344,5). Trilhos
+ // de 5, botões em pílula de 20 × 15. A cor vem do vidro (fosco atrás) com um véu quente por cima.
+ {
+ std::vector<barravideo::Hit> hv;
+ int by0 = org.y + cr.bottom - h - (int)std::lround(20 * s);
+ barravideo::FundoBorrado(rt2, g_video, RECT{ x, by0, x + w, by0 + h }, s, D2D1::RectF(0, 0, W, H), 22); // o vídeo desfocado atrás
+ barravideo::Desenha(rt2, b, W, H, g_volume, Playing(), Pos(), Len(), g_tfTimeL, g_tfTimeR, hv);
+ for (auto& x : hv) g_hits.push_back({ x.id, x.r });
+ }
+ b->Release(); rt2->EndDraw(); rt2->Release();
+ POINT dst{ x, org.y + cr.bottom - h - (int)std::lround(20 * s) }, src{ 0, 0 }; SIZE szz{ w, h };
+ BLENDFUNCTION bf{ AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ UpdateLayeredWindow(g_bar, screen, &dst, &szz, mem, &src, 0, &bf, ULW_ALPHA);
+ SelectObject(mem, old); DeleteObject(bmp); DeleteDC(mem); ReleaseDC(nullptr, screen);
+ if (g_barBack) { // o vidro fosco logo abaixo. O acrílico ignora recorte (SetWindowRgn): fica 4,5 pt para
+ // dentro, com o canto redondo de 8 do Windows, que assim cabe inteiro dentro do canto de 22 da barra
+ int in = (int)std::lround(4.5f * s);
+ SetWindowPos(g_barBack, g_bar, dst.x + in, dst.y + in, w - 2 * in, h - 2 * in, SWP_NOACTIVATE | (g_barShown ? SWP_SHOWWINDOW : 0));
+ }
+ return;
+ }
rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.5f, 0.5f, W - 0.5f, H - 0.5f), 14, 14), b);
b->SetColor(D2D1::ColorF(1, 1, 1, 0.14f)); rt2->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.5f, 0.5f, W - 0.5f, H - 0.5f), 14, 14), b, 1);
auto txt = [&](const std::wstring& t, IDWriteTextFormat* f, D2D1_RECT_F r, float a) { b->SetColor(D2D1::ColorF(1, 1, 1, a)); rt2->DrawTextW(t.c_str(), (UINT32)t.size(), f, r, b); };
@@ -142,19 +181,90 @@ void PaintBar() {
UpdateLayeredWindow(g_bar, screen, &dst, &sz, mem, &src, 0, &bf, ULW_ALPHA);
SelectObject(mem, old); DeleteObject(bmp); DeleteDC(mem); ReleaseDC(nullptr, screen);
}
+void PaintTop() {
+ if (!g_top) return;
+ bool on = Unified() && IsWindowVisible(wnd) && !IsIconic(wnd);
+ if (!on) { ShowWindow(g_top, SW_HIDE); if (g_topBack) ShowWindow(g_topBack, SW_HIDE); return; }
+ float s = GetDpiForWindow(wnd) / 96.f;
+ RECT cr; GetClientRect(wnd, &cr);
+ POINT org{ 0, 0 }; ClientToScreen(wnd, &org);
+ int w = cr.right, h = (int)std::lround(GG_TOP * s);
+ if (w <= 0) return;
+ HDC screen = GetDC(nullptr), mem = CreateCompatibleDC(screen);
+ BITMAPINFO bi{}; bi.bmiHeader = { sizeof(BITMAPINFOHEADER), w, -h, 1, 32, BI_RGB };
+ void* bits = nullptr; HBITMAP bmp = CreateDIBSection(mem, &bi, DIB_RGB_COLORS, &bits, nullptr, 0);
+ HGDIOBJ old = SelectObject(mem, bmp);
+ ID2D1DCRenderTarget* rt2 = nullptr;
+ auto props = D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), 96 * s, 96 * s);
+ if (SUCCEEDED(d2d->CreateDCRenderTarget(&props, &rt2))) {
+ RECT rb{ 0, 0, w, h }; rt2->BindDC(mem, &rb);
+ rt2->BeginDraw(); rt2->Clear(D2D1::ColorF(0, 0, 0, 0));
+ ID2D1SolidColorBrush* b = nullptr; rt2->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0, 0), &b);
+ if (b) {
+ float W = w / s, R = IsZoomed(wnd) ? 0.f : 16.f;
+ // tinta cinza-escura (medida: 62,63,64 sobre o preto) com os cantos de cima da janela
+ rt2->PushAxisAlignedClip(D2D1::RectF(0, 0, W, GG_TOP), D2D1_ANTIALIAS_MODE_ALIASED);
+ barravideo::FundoBorrado(rt2, g_video, RECT{ org.x, org.y, org.x + w, org.y + h }, s, D2D1::RectF(0, 0, W, GG_TOP + R + 2), R); // o vídeo desfocado
+ b->SetColor(D2D1::ColorF(0.235f, 0.24f, 0.25f, 0.62f));
+ rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0, 0, W, GG_TOP + R + 2), R, R), b);
+ rt2->PopAxisAlignedClip();
+ b->SetColor(D2D1::ColorF(0, 0, 0, 0.18f));
+ rt2->FillRectangle(D2D1::RectF(0, GG_TOP - 0.5f, W, GG_TOP), b);
+ // folha com o canto dobrado (10 × 13) a 84 e o nome em negrito de 13 a 101,5
+ float cy = GG_TOP / 2;
+ b->SetColor(D2D1::ColorF(0.93f, 0.93f, 0.94f, 1));
+ rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(84, cy - 6.5f, 94, cy + 6.5f), 1.2f, 1.2f), b);
+ b->SetColor(D2D1::ColorF(0.6f, 0.6f, 0.62f, 1));
+ rt2->FillRectangle(D2D1::RectF(90.5f, cy - 6.5f, 94, cy - 3.f), b);
+ wchar_t ttl[512] = {}; GetWindowTextW(wnd, ttl, 512);
+ std::wstring name = ttl;
+ size_t dot = name.find_last_of(L'.'); if (dot != std::wstring::npos && dot > 0) name = name.substr(0, dot);
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.92f));
+ if (g_tfTop) rt2->DrawTextW(name.c_str(), (UINT32)name.size(), g_tfTop, D2D1::RectF(101.5f, 0, W - 12, GG_TOP), b, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ b->Release();
+ }
+ rt2->EndDraw(); rt2->Release();
+ }
+ POINT src{ 0, 0 }; SIZE sz{ w, h };
+ BLENDFUNCTION bf{ AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ UpdateLayeredWindow(g_top, screen, &org, &sz, mem, &src, 0, &bf, ULW_ALPHA);
+ SelectObject(mem, old); DeleteObject(bmp); DeleteDC(mem); ReleaseDC(nullptr, screen);
+ // logo acima da janela (abaixo de tudo o que já estava por cima dela, como os três botões da DLL)
+ HWND above = GetWindow(wnd, GW_HWNDPREV);
+ if (g_topBack) {
+ int in = IsZoomed(wnd) ? 0 : (int)std::lround(12 * s); // o acrílico não aceita recorte: fica dentro dos cantos de 16
+ if (above == g_top || above == g_topBack) above = GetWindow(above, GW_HWNDPREV);
+ SetWindowPos(g_topBack, above ? above : HWND_TOP, org.x + in, org.y, w - 2 * in, h, SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
+ HWND a2 = GetWindow(g_topBack, GW_HWNDPREV);
+ if (a2 == g_top) a2 = GetWindow(a2, GW_HWNDPREV);
+ SetWindowPos(g_top, a2 ? a2 : HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
+ } else {
+ if (above == g_top) above = GetWindow(above, GW_HWNDPREV);
+ SetWindowPos(g_top, above ? above : HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW | SWP_NOOWNERZORDER);
+ }
+}
void ShowBar(bool on) {
if (!g_bar) return;
- if (on && g_ready) { PaintBar(); if (!g_barShown) { SetWindowPos(g_bar, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW); g_barShown = true; } }
- else if (!on && g_barShown) { ShowWindow(g_bar, SW_HIDE); g_barShown = false; }
+ if (on && g_ready) {
+ PaintBar();
+ if (!g_barShown) {
+ SetWindowPos(g_bar, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW); g_barShown = true;
+ if (g_barBack) SetWindowPos(g_barBack, g_bar, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
+ }
+ }
+ else if (!on && g_barShown) { ShowWindow(g_bar, SW_HIDE); if (g_barBack) ShowWindow(g_barBack, SW_HIDE); g_barShown = false; }
}
void Poke() { g_lastMove = GetTickCount(); ShowBar(true); }
void ScrubTo(float x) {
- for (auto& h : g_hits) if (h.id == B_SCRUB) { double f = std::clamp((x - h.r.left) / (h.r.right - h.r.left), 0.f, 1.f); Seek(f * Len()); }
+ for (auto& h : g_hits) if (h.id == B_SCRUB) { double f = semaforo::Aqua() ? barravideo::PosicaoEm(h.r, x) : std::clamp((x - h.r.left) / (h.r.right - h.r.left), 0.f, 1.f); Seek(f * Len()); }
}
void BarAction(int id, float x) {
switch (id) {
- case B_VOL: for (auto& h : g_hits) if (h.id == B_VOL) { g_volume = std::clamp((x - h.r.left - 4) / (h.r.right - h.r.left - 8), 0.f, 1.f); if (g_mp) g_mp->SetVolume(g_volume); } break;
+ case B_VOL: for (auto& h : g_hits) if (h.id == B_VOL) {
+ g_volume = semaforo::Aqua() ? barravideo::VolumeEm(h.r, x) : std::clamp((x - h.r.left - 4) / (h.r.right - h.r.left - 8), 0.f, 1.f);
+ if (g_mp) g_mp->SetVolume(g_volume);
+ } break;
case B_BACK: Seek(Pos() - 15); break;
case B_FWD: Seek(Pos() + 15); break;
case B_PLAY: Toggle(); break;
@@ -180,10 +290,16 @@ void FitWindowToVideo() {
if (!g_mp || g_full) return;
SIZE vs{}, ar{};
if (FAILED(g_mp->GetNativeVideoSize(&vs, &ar)) || !vs.cx || !vs.cy) return;
+ // a proporção da imagem (pixels não quadrados, vídeo de celular): a altura que ela ocupa de verdade
+ if (ar.cx > 0 && ar.cy > 0) vs.cy = std::max<LONG>(1, (LONG)std::lround((double)vs.cx * ar.cy / ar.cx));
MONITORINFO mi{ sizeof(mi) }; GetMonitorInfoW(MonitorFromWindow(wnd, MONITOR_DEFAULTTONEAREST), &mi);
float maxW = (mi.rcWork.right - mi.rcWork.left) * 0.72f, maxH = (mi.rcWork.bottom - mi.rcWork.top) * 0.78f;
float k = std::min({ 1.f, maxW / vs.cx, maxH / vs.cy });
RECT r{ 0, 0, (LONG)(vs.cx * k), (LONG)(vs.cy * k) };
+ if (Unified()) { // macOS 27: a barra de 32 do app no lugar da barra de título (as bordas continuam)
+ AdjustWindowRectExForDpi(&r, WS_THICKFRAME, FALSE, 0, GetDpiForWindow(wnd));
+ r.top = 0;
+ } else
AdjustWindowRectExForDpi(&r, WS_OVERLAPPEDWINDOW, FALSE, 0, GetDpiForWindow(wnd));
int W = r.right - r.left, H = r.bottom - r.top;
SetWindowPos(wnd, nullptr, mi.rcWork.left + (mi.rcWork.right - mi.rcWork.left - W) / 2, mi.rcWork.top + (mi.rcWork.bottom - mi.rcWork.top - H) / 2, W, H, SWP_NOZORDER);
@@ -198,6 +314,7 @@ void Open(const std::wstring& path) {
HRESULT hr = MFPCreateMediaPlayer(path.c_str(), TRUE, 0, g_cb, g_video, &g_mp);
if (FAILED(hr)) { MessageBoxW(wnd, Tr(L"Não foi possível abrir este vídeo."), L"QuickTime Player", MB_OK | MB_ICONERROR); return; }
g_mp->SetVolume(g_volume);
+ g_mp->SetBorderColor(RGB(0, 0, 0)); // a sobra em volta do vídeo (vertical numa janela larga): preta, não lixo da tela
SHAddToRecentDocs(SHARD_PATHW, path.c_str());
}
@@ -226,6 +343,13 @@ void SetFull(bool on) {
SetWindowPos(wnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED);
}
g_full = on;
+ if (semaforo::Aqua()) { // tela cheia: sem a barra de título de 32 (nem arrastar por ela)
+ BAR = on ? 0.f : GG_TOP;
+ RECT cr; GetClientRect(wnd, &cr);
+ SendMessageW(wnd, WM_SIZE, 0, MAKELPARAM(cr.right, cr.bottom));
+ InvalidateRect(wnd, nullptr, TRUE);
+ PaintTop();
+ }
Poke();
}
@@ -246,6 +370,12 @@ LRESULT CALLBACK VideoProc(HWND h, UINT m, WPARAM w, LPARAM l) {
EndPaint(h, &ps); return 0;
}
case WM_ERASEBKGND: return 1;
+ case WM_NCHITTEST:
+ if (Unified()) {
+ POINT p{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ScreenToClient(h, &p);
+ if (p.y < (int)std::lround(GG_TOP * GetDpiForWindow(h) / 96.f)) return HTTRANSPARENT;
+ }
+ break;
case WM_MOUSEMOVE: { static LPARAM last; if (l != last) { last = l; Poke(); } return 0; }
case WM_LBUTTONDOWN: SetFocus(wnd); return 0;
case WM_LBUTTONDBLCLK: SetFull(!g_full); return 0;
@@ -256,9 +386,51 @@ LRESULT CALLBACK VideoProc(HWND h, UINT m, WPARAM w, LPARAM l) {
LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
switch (m) {
- case WM_SIZE: if (g_video) { SetWindowPos(g_video, nullptr, 0, 0, LOWORD(l), HIWORD(l), SWP_NOZORDER); if (g_mp) g_mp->UpdateVideo(); } if (g_barShown) PaintBar(); return 0;
- case WM_MOVE: if (g_barShown) PaintBar(); return 0;
+ case WM_SIZE: if (g_video) {
+ int top = 0; // macOS 27: o vídeo ocupa a janela toda, a barra de título é vidro por cima
+ SetWindowPos(g_video, nullptr, 0, top, LOWORD(l), std::max(0, (int)HIWORD(l) - top), SWP_NOZORDER);
+ if (g_mp) g_mp->UpdateVideo();
+ }
+ PaintTop();
+ if (g_barShown) PaintBar(); return 0;
+ case WM_PAINT: { // macOS 27: a barra de título escura com o ícone do documento e o nome em negrito depois dos botões
+ PAINTSTRUCT ps; HDC dc = BeginPaint(h, &ps);
+ RECT cr; GetClientRect(h, &cr);
+ float s = GetDpiForWindow(h) / 96.f;
+ int top = 0; // a barra de título agora é a janela de vidro g_top (PaintTop)
+ if (top) {
+ ID2D1DCRenderTarget* rt2 = nullptr;
+ auto props = D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_IGNORE), 96 * s, 96 * s);
+ if (SUCCEEDED(d2d->CreateDCRenderTarget(&props, &rt2))) {
+ RECT rb{ 0, 0, cr.right, top }; rt2->BindDC(dc, &rb);
+ rt2->BeginDraw();
+ rt2->Clear(D2D1::ColorF(0.235f, 0.24f, 0.25f));
+ ID2D1SolidColorBrush* b = nullptr; rt2->CreateSolidColorBrush(D2D1::ColorF(1, 1, 1, 0.9f), &b);
+ if (b) {
+ float W = cr.right / s, cy = GG_TOP / 2;
+ // folha com o canto dobrado (10 × 13), a 84
+ b->SetColor(D2D1::ColorF(0.93f, 0.93f, 0.94f, 1));
+ rt2->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(84, cy - 6.5f, 94, cy + 6.5f), 1.2f, 1.2f), b);
+ b->SetColor(D2D1::ColorF(0.6f, 0.6f, 0.62f, 1));
+ rt2->FillRectangle(D2D1::RectF(90.5f, cy - 6.5f, 94, cy - 3.f), b);
+ b->SetColor(D2D1::ColorF(1, 1, 1, 0.92f));
+ wchar_t ttl[512] = {}; GetWindowTextW(h, ttl, 512);
+ std::wstring name = ttl;
+ size_t dot = name.find_last_of(L'.'); if (dot != std::wstring::npos && dot > 0) name = name.substr(0, dot);
+ if (g_tfTop) rt2->DrawTextW(name.c_str(), (UINT32)name.size(), g_tfTop, D2D1::RectF(101.5f, 0, W - 12, GG_TOP), b, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ b->Release();
+ }
+ rt2->EndDraw(); rt2->Release();
+ }
+ }
+ EndPaint(h, &ps);
+ return 0;
+ }
+ case WM_MOVE: PaintTop(); if (g_barShown) PaintBar(); return 0;
+ case WM_SHOWWINDOW: { LRESULT r = DefWindowProcW(h, m, w, l); PostMessageW(h, WM_APP + 9, 0, 0); return r; }
+ case WM_APP + 9: PaintTop(); return 0;
case WM_ERASEBKGND: { RECT r; GetClientRect(h, &r); FillRect((HDC)w, &r, (HBRUSH)GetStockObject(BLACK_BRUSH)); return 1; }
+ case WM_SETTEXT: { LRESULT r = DefWindowProcW(h, m, w, l); PaintTop(); return r; }
case WM_MFEVENT:
if (w == 1) {
if (l) { MessageBoxW(h, Tr(L"Não foi possível abrir este vídeo."), L"QuickTime Player", MB_OK | MB_ICONERROR); return 0; }
@@ -268,6 +440,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
} else if (w == 2) { g_ended = true; ShowBar(true); }
return 0;
case WM_TIMER: // a barra some depois de 2,5 s sem mexer o mouse (tocando); o tempo anda
+ if (g_top && (IsWindowVisible(g_top) || Unified())) PaintTop(); // macOS 27: o vidro acompanha o vídeo (15 quadros/s)
if (g_barShown) {
POINT p; GetCursorPos(&p); RECT br; GetWindowRect(g_bar, &br);
bool over = PtInRect(&br, p) != FALSE;
@@ -297,6 +470,9 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
case WM_DESTROY:
if (g_mp) { g_mp->Shutdown(); g_mp->Release(); g_mp = nullptr; }
if (g_bar) DestroyWindow(g_bar);
+ if (g_barBack) DestroyWindow(g_barBack);
+ if (g_top) DestroyWindow(g_top);
+ if (g_topBack) DestroyWindow(g_topBack);
PostQuitMessage(0);
return 0;
}
@@ -311,6 +487,10 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
g_tfTime = Fmt(11, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
g_tfIcon = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
g_tfIconBig = Fmt(24, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
+ g_tfTimeL = Fmt(13, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_LEADING);
+ g_tfTimeR = Fmt(13, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ g_tfTop = Fmt(13, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_LEADING);
+ for (auto* f : { g_tfTimeL, g_tfTimeR, g_tfTop }) if (f) { f->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); f->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP); }
WNDCLASSEXW wc{ sizeof(wc) }; wc.style = CS_DBLCLKS; wc.lpfnWndProc = Proc; wc.hInstance = hi; wc.lpszClassName = L"QuickTimeJanela";
wc.hCursor = LoadCursorW(nullptr, IDC_ARROW); wc.hIcon = LoadIconW(hi, MAKEINTRESOURCEW(1)); wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
RegisterClassExW(&wc);
@@ -326,7 +506,17 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
BOOL dark = TRUE; DwmSetWindowAttribute(wnd, 20, &dark, sizeof(dark)); // o QuickTime é sempre escuro
g_video = CreateWindowExW(WS_EX_ACCEPTFILES, vc.lpszClassName, L"", WS_CHILD | WS_VISIBLE, 0, 0, W, H, wnd, nullptr, hi, nullptr);
g_bar = CreateWindowExW(WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, bc.lpszClassName, L"", WS_POPUP, 0, 0, 10, 10, wnd, nullptr, hi, nullptr);
- SetTimer(wnd, 1, 250, nullptr);
+ if (semaforo::Aqua()) {
+ // a barra de título de 32 do app (a DLL só põe os três botões a 16)
+ SetPropW(wnd, L"WacOSBarraUnificada", (HANDLE)(INT_PTR)std::lround(GG_TOP));
+ BAR = GG_TOP;
+ SetWindowSubclass(wnd, UnifiedSub, 0x55A1, 0);
+ SetWindowPos(wnd, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ // o vidro fosco da barra de controles (desfoca o vídeo atrás), em barra_video.h
+ // o vidro fosco das barras é desenhado aqui (barravideo::FundoBorrado), já recortado nos cantos certos
+ g_top = CreateWindowExW(WS_EX_LAYERED | WS_EX_TRANSPARENT | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, bc.lpszClassName, L"", WS_POPUP, 0, 0, 10, 10, wnd, nullptr, hi, nullptr);
+ }
+ SetTimer(wnd, 1, semaforo::Aqua() ? 66 : 250, nullptr); // macOS 27: o vidro das barras desfoca o vídeo que anda
ShowWindow(wnd, show);
int argc = 0; LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
if (argc > 1 && argv[1][0]) Open(argv[1]); else PostMessageW(wnd, WM_KEYDOWN, 'O', 0x1D0001);
diff --git a/src/relogio/main.cpp b/src/relogio/main.cpp
index 107402c..fec676a 100644
--- a/src/relogio/main.cpp
+++ b/src/relogio/main.cpp
@@ -1,379 +1,591 @@
-// Relógio (Clock do Mac): Relógio Mundial, Alarmes, Cronômetro e Timer, nas abas do alto (Ctrl+1..4).
-// - Mundial: cidades (fusos do Windows), hora, "Hoje/Amanhã" e a diferença; + adiciona, botão direito remove.
-// - Alarmes: hora grande, nome, dias e o interruptor; + cria, clique edita a hora, botão direito apaga/renomeia.
-// Quem toca é o Shell (banner do Mac + som), mesmo com o app fechado: %APPDATA%\Shell\alarmes.txt.
-// - Cronômetro: Iniciar/Parar, Volta/Zerar e a lista de voltas (a melhor em verde, a pior em vermelho).
-// - Timer: escolher minutos (atalhos e − / +), Iniciar/Pausar/Cancelar; ao acabar toca e a janela vem para frente.
-#include "../comum/app2d.h"
-#include <mmsystem.h>
-#pragma comment(lib, "winmm.lib")
-
-using namespace app2d;
-
-namespace {
-
-const float TB = 56;
-const UINT WM_FIELDLOST = WM_APP + 77;
-int g_tab = 0; // 0 mundial, 1 alarmes, 2 cronômetro, 3 timer
-IDWriteTextFormat *g_tfSeg, *g_tfBig, *g_tfBigR, *g_tfHuge, *g_tfRow, *g_tfSub, *g_tfBtn, *g_tfIcon, *g_tfMono;
-
-// ---- relógio mundial (fusos do Windows por cidade)
-struct City { const wchar_t* name; const wchar_t* tz; };
-const City CITIES[] = {
- { L"São Paulo", L"E. South America Standard Time" }, { L"Rio de Janeiro", L"E. South America Standard Time" }, { L"Manaus", L"SA Western Standard Time" },
- { L"Fortaleza", L"SA Eastern Standard Time" }, { L"Lisboa", L"GMT Standard Time" }, { L"Londres", L"GMT Standard Time" }, { L"Paris", L"Romance Standard Time" },
- { L"Berlim", L"W. Europe Standard Time" }, { L"Madri", L"Romance Standard Time" }, { L"Roma", L"W. Europe Standard Time" }, { L"Atenas", L"GTB Standard Time" },
- { L"Istambul", L"Turkey Standard Time" }, { L"Moscou", L"Russian Standard Time" }, { L"Dubai", L"Arabian Standard Time" }, { L"Mumbai", L"India Standard Time" },
- { L"Singapura", L"Singapore Standard Time" }, { L"Pequim", L"China Standard Time" }, { L"Tóquio", L"Tokyo Standard Time" }, { L"Seul", L"Korea Standard Time" },
- { L"Sydney", L"AUS Eastern Standard Time" }, { L"Auckland", L"New Zealand Standard Time" }, { L"Honolulu", L"Hawaiian Standard Time" },
- { L"Los Angeles", L"Pacific Standard Time" }, { L"Denver", L"Mountain Standard Time" }, { L"Chicago", L"Central Standard Time" },
- { L"Nova York", L"Eastern Standard Time" }, { L"Cidade do México", L"Central Standard Time (Mexico)" }, { L"Bogotá", L"SA Pacific Standard Time" },
- { L"Buenos Aires", L"Argentina Standard Time" }, { L"Santiago", L"Pacific SA Standard Time" }, { L"Joanesburgo", L"South Africa Standard Time" },
- { L"Cairo", L"Egypt Standard Time" }, { L"Nairóbi", L"E. Africa Standard Time" }, { L"UTC", L"UTC" },
-};
-const int NCITIES = (int)(sizeof(CITIES) / sizeof(CITIES[0]));
-std::vector<int> g_world; // índices em CITIES
-
-bool CityTime(int i, SYSTEMTIME& out) {
- DYNAMIC_TIME_ZONE_INFORMATION d{};
- for (DWORD k = 0; EnumDynamicTimeZoneInformation(k, &d) == ERROR_SUCCESS; k++)
- if (!wcscmp(d.TimeZoneKeyName, CITIES[i].tz)) {
- SYSTEMTIME utc; GetSystemTime(&utc);
- return SystemTimeToTzSpecificLocalTimeEx(&d, &utc, &out) != FALSE;
- }
- return false;
-}
-
-// ---- alarmes
-struct Alarm { int id; int hh, mm; bool on; std::wstring label; int days; }; // days: bits 0 = dom ... 6 = sáb; 0 = uma vez
-std::vector<Alarm> g_alarms;
-int g_nextId = 1;
-std::wstring g_file;
-
-void Save() {
- std::vector<std::wstring> out{ L"# Relógio do WacOS: W = cidade do Relógio Mundial, A = alarme (id, hora, minuto, ligado, nome, dias)" };
- for (int i : g_world) out.push_back(L"W\t" + std::to_wstring(i));
- for (auto& a : g_alarms) out.push_back(L"A\t" + std::to_wstring(a.id) + L"\t" + std::to_wstring(a.hh) + L"\t" + std::to_wstring(a.mm) + L"\t" + (a.on ? L"1" : L"0") + L"\t" + Esc(a.label) + L"\t" + std::to_wstring(a.days));
- WriteLines(g_file, out);
-}
-void Load() {
- g_world.clear(); g_alarms.clear();
- bool any = false;
- for (auto& l : ReadLines(g_file)) {
- auto f = Split(l);
- if (f.size() >= 2 && f[0] == L"W") { int i = _wtoi(f[1].c_str()); if (i >= 0 && i < NCITIES) g_world.push_back(i); any = true; }
- else if (f.size() >= 7 && f[0] == L"A") g_alarms.push_back({ _wtoi(f[1].c_str()), _wtoi(f[2].c_str()), _wtoi(f[3].c_str()), f[4] == L"1", Unesc(f[5]), _wtoi(f[6].c_str()) });
- }
- if (!any && g_world.empty()) g_world = { 0, 5, 25, 17 }; // São Paulo, Londres, Nova York, Tóquio
- for (auto& a : g_alarms) g_nextId = std::max(g_nextId, a.id + 1);
-}
-
-// ---- cronômetro
-bool g_swRun = false;
-ULONGLONG g_swStart = 0, g_swAcc = 0;
-std::vector<ULONGLONG> g_laps; // duração de cada volta
-ULONGLONG SwNow() { return g_swAcc + (g_swRun ? GetTickCount64() - g_swStart : 0); }
-std::wstring FmtTime(ULONGLONG ms, bool cs = true) {
- wchar_t b[32];
- ULONGLONG s = ms / 1000;
- if (s >= 3600) swprintf_s(b, L"%llu:%02llu:%02llu", s / 3600, s / 60 % 60, s % 60);
- else if (cs) swprintf_s(b, L"%02llu:%02llu,%02llu", s / 60, s % 60, ms / 10 % 100);
- else swprintf_s(b, L"%02llu:%02llu", s / 60, s % 60);
- return b;
-}
-
-// ---- timer
-int g_tmMin = 5; // escolhido
-bool g_tmRun = false, g_tmPaused = false;
-ULONGLONG g_tmEnd = 0, g_tmLeft = 0; // fim (tick) / restante quando pausado
-ULONGLONG TmLeft() { if (!g_tmRun) return (ULONGLONG)g_tmMin * 60000; if (g_tmPaused) return g_tmLeft; ULONGLONG n = GetTickCount64(); return g_tmEnd > n ? g_tmEnd - n : 0; }
-
-struct Hit { int kind, arg; D2D1_RECT_F r; };
-std::vector<Hit> g_hits;
-enum { H_TAB = 1, H_ADD, H_WORLD, H_ALARM, H_ALARMTIME, H_SWITCH, H_SW_A, H_SW_B, H_TM_PRESET, H_TM_MINUS, H_TM_PLUS, H_TM_A, H_TM_B };
-
-void Button(D2D1_RECT_F r, const std::wstring& t, D2D1_COLOR_F bg, D2D1_COLOR_F fg, int kind, int arg = 0) {
- float rad = (r.bottom - r.top) / 2;
- Fill(r, bg, rad);
- Text(t, g_tfBtn, r, fg);
- g_hits.push_back({ kind, arg, r });
-}
-
-void Paint() {
- if (!BeginPaint()) return;
- g_hits.clear();
- bool dark = Dark();
- D2D1_SIZE_F sz = Size();
- D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
- D2D1_COLOR_F line = dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.10f);
- rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
- // abas
- const wchar_t* tabs[] = { L"Relógio Mundial", L"Alarmes", L"Cronômetro", L"Timer" };
- float segW = 120, sx = sz.width / 2 - segW * 2;
- Fill(D2D1::RectF(sx, 14, sx + segW * 4, 40), dark ? Rgb(58, 58, 60) : Rgb(232, 232, 237), 7);
- for (int i = 0; i < 4; i++) {
- D2D1_RECT_F r = D2D1::RectF(sx + i * segW + 2, 16, sx + (i + 1) * segW - 2, 38);
- if (g_tab == i) Fill(r, dark ? Rgb(99, 99, 102) : Rgb(255, 255, 255), 6);
- Text(Tr(tabs[i]), g_tfSeg, r, text);
- g_hits.push_back({ H_TAB, i, r });
- }
- if (g_tab <= 1) {
- D2D1_RECT_F add = D2D1::RectF(sz.width - 46, 12, sz.width - 14, 42);
- wchar_t p[2] = { 0xE710, 0 };
- Text(p, g_tfIcon, add, text);
- g_hits.push_back({ H_ADD, 0, add });
- }
- Fill(D2D1::RectF(0, TB - 1, sz.width, TB), line);
- float X = 28, W = sz.width - 28;
- if (g_tab == 0) {
- SYSTEMTIME here; GetLocalTime(&here);
- float y = TB + 8;
- for (int k = 0; k < (int)g_world.size(); k++) {
- int i = g_world[k];
- SYSTEMTIME t{};
- if (!CityTime(i, t)) continue;
- FILETIME a, b; SystemTimeToFileTime(&here, &a); SystemTimeToFileTime(&t, &b);
- long long diffMin = ((long long)(((ULONGLONG)b.dwHighDateTime << 32 | b.dwLowDateTime) - ((ULONGLONG)a.dwHighDateTime << 32 | a.dwLowDateTime))) / 600000000LL;
- long long dh = (diffMin + (diffMin >= 0 ? 15 : -15)) / 30; // em meias horas
- std::wstring day = t.wDay == here.wDay ? Tr(L"Hoje") : (diffMin > 0 ? Tr(L"Amanhã") : Tr(L"Ontem"));
- wchar_t off[32];
- if (dh == 0) wcscpy_s(off, L"");
- else if (dh % 2) swprintf_s(off, L", %+lld h 30", dh / 2);
- else swprintf_s(off, L", %+lld h", dh / 2);
- D2D1_RECT_F row = D2D1::RectF(X, y, W, y + 74);
- Text(day + off, g_tfSub, D2D1::RectF(X, y + 10, W - 200, y + 30), gray);
- Text(Tr(CITIES[i].name), g_tfRow, D2D1::RectF(X, y + 30, W - 200, y + 60), text);
- wchar_t hm[16]; swprintf_s(hm, L"%d:%02d", t.wHour, t.wMinute);
- Text(hm, g_tfBigR, D2D1::RectF(W - 220, y, W, y + 74), text);
- Fill(D2D1::RectF(X, y + 74, W, y + 75), line);
- g_hits.push_back({ H_WORLD, k, row });
- y += 75;
- }
- } else if (g_tab == 1) {
- float y = TB + 8;
- if (g_alarms.empty()) Text(Tr(L"Nenhum Alarme"), g_tfRow, D2D1::RectF(0, TB, sz.width, sz.height * 0.6f), gray);
- for (int k = 0; k < (int)g_alarms.size(); k++) {
- auto& a = g_alarms[k];
- wchar_t hm[16]; swprintf_s(hm, L"%d:%02d", a.hh, a.mm);
- D2D1_RECT_F tr = D2D1::RectF(X, y, X + 220, y + 60);
- Text(hm, g_tfBig, tr, a.on ? text : gray);
- std::wstring sub = a.label.empty() ? Tr(L"Alarme") : a.label;
- if (a.days == 0x7F) sub += L", " + std::wstring(Tr(L"todos os dias"));
- else if (a.days == 0x3E) sub += L", " + std::wstring(Tr(L"dias de semana"));
- else if (a.days == 0x41) sub += L", " + std::wstring(Tr(L"fins de semana"));
- Text(sub, g_tfSub, D2D1::RectF(X, y + 56, W - 100, y + 76), gray);
- g_hits.push_back({ H_ALARMTIME, k, tr });
- // interruptor
- D2D1_RECT_F sw = D2D1::RectF(W - 60, y + 26, W - 10, y + 54);
- Fill(sw, a.on ? Rgb(48, 209, 88) : (dark ? Rgb(72, 72, 74) : Rgb(229, 229, 234)), 14);
- Circle({ a.on ? sw.right - 14 : sw.left + 14, (sw.top + sw.bottom) / 2 }, 12, Rgb(255, 255, 255), true);
- g_hits.push_back({ H_SWITCH, k, sw });
- g_hits.push_back({ H_ALARM, k, D2D1::RectF(X, y, W - 70, y + 84) });
- Fill(D2D1::RectF(X, y + 84, W, y + 85), line);
- y += 86;
- }
- } else if (g_tab == 2) {
- ULONGLONG now = SwNow();
- Text(FmtTime(now), g_tfHuge, D2D1::RectF(0, TB + 20, sz.width, TB + 150), text);
- float by = TB + 170, cx = sz.width / 2;
- bool running = g_swRun;
- Button(D2D1::RectF(cx - 190, by, cx - 30, by + 44), running ? Tr(L"Volta") : Tr(L"Zerar"), dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), text, H_SW_A);
- Button(D2D1::RectF(cx + 30, by, cx + 190, by + 44), running ? Tr(L"Parar") : Tr(L"Iniciar"), running ? Rgb(255, 69, 58, 0.25f) : Rgb(48, 209, 88, 0.25f), running ? Rgb(255, 69, 58) : Rgb(48, 209, 88), H_SW_B);
- // voltas (a atual em cima)
- std::vector<ULONGLONG> laps = g_laps;
- ULONGLONG done = 0; for (auto l : g_laps) done += l;
- if (now || !laps.empty()) laps.push_back(now - done);
- int best = -1, worst = -1;
- if (g_laps.size() >= 2) for (int i = 0; i < (int)g_laps.size(); i++) { if (best < 0 || g_laps[i] < g_laps[best]) best = i; if (worst < 0 || g_laps[i] > g_laps[worst]) worst = i; }
- float y = by + 70;
- for (int i = (int)laps.size() - 1; i >= 0 && y < sz.height - 20; i--) {
- D2D1_COLOR_F c = i == best ? Rgb(48, 209, 88) : i == worst ? Rgb(255, 69, 58) : text;
- wchar_t n[32]; swprintf_s(n, Tr(L"Volta %d"), i + 1);
- Text(n, g_tfRow, D2D1::RectF(X + 60, y, W, y + 34), c);
- Text(FmtTime(laps[i]), g_tfMono, D2D1::RectF(X, y, W - 60, y + 34), c);
- Fill(D2D1::RectF(X + 60, y + 34, W - 60, y + 35), line);
- y += 35;
- }
- } else {
- ULONGLONG left = TmLeft();
- Text(FmtTime(left + 999, false), g_tfHuge, D2D1::RectF(0, TB + 20, sz.width, TB + 150), g_tmRun && !g_tmPaused ? Rgb(255, 159, 10) : text);
- float cx = sz.width / 2, y = TB + 160;
- if (!g_tmRun) {
- int presets[] = { 1, 3, 5, 10, 15, 30, 60 };
- float pw = 64, px = cx - pw * 3.5f - 9;
- for (int i = 0; i < 7; i++) {
- D2D1_RECT_F r = D2D1::RectF(px + i * (pw + 3), y, px + i * (pw + 3) + pw, y + 34);
- bool on = g_tmMin == presets[i];
- wchar_t b[16]; swprintf_s(b, presets[i] >= 60 ? L"%d h" : L"%d min", presets[i] >= 60 ? presets[i] / 60 : presets[i]);
- Fill(r, on ? Rgb(255, 159, 10, 0.3f) : (dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234)), 8);
- Text(b, g_tfBtn, r, on ? Rgb(255, 159, 10) : text);
- g_hits.push_back({ H_TM_PRESET, presets[i], r });
- }
- Button(D2D1::RectF(cx - 90, y + 50, cx - 50, y + 84), L"−", dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), text, H_TM_MINUS);
- Button(D2D1::RectF(cx + 50, y + 50, cx + 90, y + 84), L"+", dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), text, H_TM_PLUS);
- wchar_t m[16]; swprintf_s(m, L"%d min", g_tmMin);
- Text(m, g_tfRow, D2D1::RectF(cx - 50, y + 50, cx + 50, y + 84), text);
- y += 110;
- }
- Button(D2D1::RectF(cx - 190, y, cx - 30, y + 44), Tr(L"Cancelar"), dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), g_tmRun ? text : gray, H_TM_A);
- const wchar_t* b = !g_tmRun ? Tr(L"Iniciar") : g_tmPaused ? Tr(L"Retomar") : Tr(L"Pausar");
- Button(D2D1::RectF(cx + 30, y, cx + 190, y + 44), b, g_tmRun && !g_tmPaused ? Rgb(255, 159, 10, 0.25f) : Rgb(48, 209, 88, 0.25f), g_tmRun && !g_tmPaused ? Rgb(255, 159, 10) : Rgb(48, 209, 88), H_TM_B);
- }
- EndPaint();
-}
-
-void Tick() {
- if (g_tmRun && !g_tmPaused && TmLeft() == 0) { // timer acabou
- g_tmRun = false;
- PlaySoundW(L"SystemExclamation", nullptr, SND_ALIAS | SND_ASYNC);
- FLASHWINFO fw{ sizeof(fw), wnd, FLASHW_ALL | FLASHW_TIMERNOFG, 6, 0 }; FlashWindowEx(&fw);
- ShowWindow(wnd, SW_RESTORE); SetForegroundWindow(wnd);
- MessageBoxW(wnd, Tr(L"O timer terminou."), Tr(L"Relógio"), MB_OK | MB_ICONINFORMATION | MB_TOPMOST);
- }
- static int n;
- if (g_swRun || (g_tmRun && !g_tmPaused) || ++n % 20 == 0) InvalidateRect(wnd, nullptr, FALSE);
-}
-
-void AddCity(POINT scr) {
- HMENU m = CreatePopupMenu();
- for (int i = 0; i < NCITIES; i++) AppendMenuW(m, MF_STRING | (std::find(g_world.begin(), g_world.end(), i) != g_world.end() ? MF_CHECKED : 0), i + 1, Tr(CITIES[i].name));
- int c = TrackPopupMenu(m, TPM_RETURNCMD, scr.x, scr.y, 0, wnd, nullptr);
- DestroyMenu(m);
- if (c > 0 && std::find(g_world.begin(), g_world.end(), c - 1) == g_world.end()) { g_world.push_back(c - 1); Save(); }
-}
-
-// hora do alarme digitada ("7:30", "0730", "19h")
-bool ParseTime(const std::wstring& s, int& hh, int& mm) {
- std::wstring d; for (wchar_t c : s) if (iswdigit(c)) d += c;
- if (d.empty()) return false;
- if (d.size() <= 2) { hh = _wtoi(d.c_str()); mm = 0; }
- else { hh = _wtoi(d.substr(0, d.size() - 2).c_str()); mm = _wtoi(d.substr(d.size() - 2).c_str()); }
- return hh >= 0 && hh < 24 && mm >= 0 && mm < 60;
-}
-void EditAlarmTime(int k) {
- for (auto& h : g_hits) if (h.kind == H_ALARMTIME && h.arg == k) {
- int id = g_alarms[k].id;
- wchar_t cur[16]; swprintf_s(cur, L"%d:%02d", g_alarms[k].hh, g_alarms[k].mm);
- FieldOpen(D2D1::RectF(h.r.left, h.r.top + 10, h.r.left + 160, h.r.bottom - 10), cur, 30, false, [id](const std::wstring& t, int key) {
- if (key == VK_ESCAPE) return;
- for (auto& a : g_alarms) if (a.id == id) { int hh, mm; if (ParseTime(t, hh, mm)) { a.hh = hh; a.mm = mm; a.on = true; Save(); } }
- });
- }
-}
-void AddAlarm() {
- SYSTEMTIME t; GetLocalTime(&t);
- g_alarms.push_back({ g_nextId++, (t.wHour + 1) % 24, 0, true, L"", 0 });
- Save();
- Paint();
- EditAlarmTime((int)g_alarms.size() - 1);
-}
-void AlarmMenu(int k, POINT scr) {
- HMENU m = CreatePopupMenu(), rep = CreatePopupMenu();
- int d = g_alarms[k].days;
- AppendMenuW(rep, MF_STRING | (d == 0 ? MF_CHECKED : 0), 10, Tr(L"Nunca"));
- AppendMenuW(rep, MF_STRING | (d == 0x7F ? MF_CHECKED : 0), 11, Tr(L"Todos os Dias"));
- AppendMenuW(rep, MF_STRING | (d == 0x3E ? MF_CHECKED : 0), 12, Tr(L"Dias de Semana"));
- AppendMenuW(rep, MF_STRING | (d == 0x41 ? MF_CHECKED : 0), 13, Tr(L"Fins de Semana"));
- AppendMenuW(m, MF_STRING, 1, Tr(L"Editar Hora"));
- AppendMenuW(m, MF_STRING, 2, Tr(L"Renomear"));
- AppendMenuW(m, MF_POPUP, (UINT_PTR)rep, Tr(L"Repetir"));
- AppendMenuW(m, MF_SEPARATOR, 0, nullptr);
- AppendMenuW(m, MF_STRING, 3, Tr(L"Apagar"));
- int c = TrackPopupMenu(m, TPM_RETURNCMD | TPM_RIGHTBUTTON, scr.x, scr.y, 0, wnd, nullptr);
- DestroyMenu(m);
- if (c == 1) EditAlarmTime(k);
- else if (c == 2) {
- for (auto& h : g_hits) if (h.kind == H_ALARM && h.arg == k) {
- int id = g_alarms[k].id;
- FieldOpen(D2D1::RectF(h.r.left, h.r.top + 56, h.r.right, h.r.top + 76), g_alarms[k].label, 13, false, [id](const std::wstring& t, int key) {
- if (key == VK_ESCAPE) return; for (auto& a : g_alarms) if (a.id == id) { a.label = t; Save(); } });
- }
- } else if (c == 3) { g_alarms.erase(g_alarms.begin() + k); Save(); }
- else if (c >= 10) { static const int v[] = { 0, 0x7F, 0x3E, 0x41 }; g_alarms[k].days = v[c - 10]; Save(); }
- InvalidateRect(wnd, nullptr, FALSE);
-}
-
-LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
- switch (m) {
- case WM_PAINT: { PAINTSTRUCT ps; ::BeginPaint(h, &ps); Paint(); ::EndPaint(h, &ps); return 0; }
- case WM_ERASEBKGND: return 1;
- case WM_SIZE: OnSize(l); return 0;
- case WM_DPICHANGED: OnDpi(w, l); return 0;
- case WM_SETTINGCHANGE: InvalidateRect(h, nullptr, FALSE); return 0;
- case WM_CTLCOLOREDIT: return FieldColors((HDC)w, Dark() ? RGB(30, 30, 30) : RGB(255, 255, 255));
- case WM_FIELDLOST: if (field.h && GetFocus() != field.h) FieldEnd(0); return 0;
- case WM_TIMER: Tick(); return 0;
- case WM_LBUTTONDOWN: case WM_RBUTTONUP: {
- if (field.h) FieldEnd(0);
- float s = Sc(), x = GET_X_LPARAM(l) / s, y = GET_Y_LPARAM(l) / s;
- POINT scr{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ClientToScreen(h, &scr);
- bool right = m == WM_RBUTTONUP;
- for (auto& ht : g_hits) {
- if (!In(ht.r, x, y)) continue;
- switch (ht.kind) {
- case H_TAB: g_tab = ht.arg; break;
- case H_ADD: if (g_tab == 0) AddCity(scr); else AddAlarm(); break;
- case H_WORLD:
- if (right) {
- HMENU mm = CreatePopupMenu(); AppendMenuW(mm, MF_STRING, 1, Tr(L"Apagar"));
- if (TrackPopupMenu(mm, TPM_RETURNCMD | TPM_RIGHTBUTTON, scr.x, scr.y, 0, h, nullptr) == 1) { g_world.erase(g_world.begin() + ht.arg); Save(); }
- DestroyMenu(mm);
- }
- break;
- case H_SWITCH: g_alarms[ht.arg].on = !g_alarms[ht.arg].on; Save(); break;
- case H_ALARMTIME: if (right) AlarmMenu(ht.arg, scr); else EditAlarmTime(ht.arg); break;
- case H_ALARM: if (right) AlarmMenu(ht.arg, scr); break;
- case H_SW_A: if (g_swRun) { ULONGLONG done = 0; for (auto v : g_laps) done += v; g_laps.push_back(SwNow() - done); } else { g_swAcc = 0; g_laps.clear(); } break;
- case H_SW_B: if (g_swRun) { g_swAcc = SwNow(); g_swRun = false; } else { g_swStart = GetTickCount64(); g_swRun = true; } break;
- case H_TM_PRESET: g_tmMin = ht.arg; break;
- case H_TM_MINUS: g_tmMin = std::max(1, g_tmMin - 1); break;
- case H_TM_PLUS: g_tmMin = std::min(24 * 60, g_tmMin + 1); break;
- case H_TM_A: g_tmRun = false; g_tmPaused = false; break;
- case H_TM_B:
- if (!g_tmRun) { g_tmRun = true; g_tmPaused = false; g_tmEnd = GetTickCount64() + (ULONGLONG)g_tmMin * 60000; }
- else if (g_tmPaused) { g_tmPaused = false; g_tmEnd = GetTickCount64() + g_tmLeft; }
- else { g_tmLeft = TmLeft(); g_tmPaused = true; }
- break;
- default: continue;
- }
- InvalidateRect(h, nullptr, FALSE);
- return 0;
- }
- return 0;
- }
- case WM_KEYDOWN: {
- bool ctrl = GetKeyState(VK_CONTROL) < 0;
- if (ctrl && w >= '1' && w <= '4') { g_tab = (int)(w - '1'); InvalidateRect(h, nullptr, FALSE); return 0; }
- if (ctrl && w == 'W') { DestroyWindow(h); return 0; }
- if (w == VK_SPACE && g_tab == 2) { { if (g_swRun) { g_swAcc = SwNow(); g_swRun = false; } else { g_swStart = GetTickCount64(); g_swRun = true; } } InvalidateRect(h, nullptr, FALSE); }
- return 0;
- }
- case WM_DESTROY: PostQuitMessage(0); return 0;
- }
- return DefWindowProcW(h, m, w, l);
-}
-
-} // namespace
-
-int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
- if (!Init()) return 1;
- g_file = DataPath(L"relogio.txt");
- Load();
- std::wstring disp = HasFont(L"SF Pro Display") ? L"SF Pro Display" : family;
- g_tfSeg = Fmt(12.5f, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
- g_tfBig = Fmt(44, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_TRAILING, false, disp.c_str());
- g_tfHuge = Fmt(84, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
- if (g_tfHuge) { DWRITE_FONT_FEATURE f{ DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES, 1 }; (void)f; }
- g_tfRow = Fmt(16);
- g_tfSub = Fmt(13);
- g_tfBtn = Fmt(15, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
- g_tfIcon = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
- g_tfMono = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_TRAILING);
- if (!CreateMain(hi, L"RelogioJanela", Tr(L"Relógio"), Proc, 720, 640)) return 1;
- // alarmes: o tempo do Mac é a hora grande alinhada à esquerda
+// Relógio (Clock do Mac): Relógio Mundial, Alarmes, Cronômetro e Timer, nas abas do alto (Ctrl+1..4).
+// - Mundial: cidades (fusos do Windows), hora, "Hoje/Amanhã" e a diferença; + adiciona, botão direito remove.
+// - Alarmes: hora grande, nome, dias e o interruptor; + cria, clique edita a hora, botão direito apaga/renomeia.
+// Quem toca é o Shell (banner do Mac + som), mesmo com o app fechado: %APPDATA%\Shell\alarmes.txt.
+// - Cronômetro: Iniciar/Parar, Volta/Zerar e a lista de voltas (a melhor em verde, a pior em vermelho).
+// - Timer: escolher minutos (atalhos e − / +), Iniciar/Pausar/Cancelar; ao acabar toca e a janela vem para frente.
+#include "../comum/app2d.h"
+#include <mmsystem.h>
+#pragma comment(lib, "winmm.lib")
+
+using namespace app2d;
+
+namespace {
+
+float TB = 56; // macOS 27: 52 (barra unificada)
+const UINT WM_FIELDLOST = WM_APP + 77;
+int g_tab = 0; // 0 mundial, 1 alarmes, 2 cronômetro, 3 timer
+IDWriteTextFormat *g_tfSeg, *g_tfBig, *g_tfBigR, *g_tfHuge, *g_tfRow, *g_tfSub, *g_tfBtn, *g_tfIcon, *g_tfMono;
+
+// ---- relógio mundial (fusos do Windows por cidade)
+struct City { const wchar_t* name; const wchar_t* tz; };
+const City CITIES[] = {
+ { L"São Paulo", L"E. South America Standard Time" }, { L"Rio de Janeiro", L"E. South America Standard Time" }, { L"Manaus", L"SA Western Standard Time" },
+ { L"Fortaleza", L"SA Eastern Standard Time" }, { L"Lisboa", L"GMT Standard Time" }, { L"Londres", L"GMT Standard Time" }, { L"Paris", L"Romance Standard Time" },
+ { L"Berlim", L"W. Europe Standard Time" }, { L"Madri", L"Romance Standard Time" }, { L"Roma", L"W. Europe Standard Time" }, { L"Atenas", L"GTB Standard Time" },
+ { L"Istambul", L"Turkey Standard Time" }, { L"Moscou", L"Russian Standard Time" }, { L"Dubai", L"Arabian Standard Time" }, { L"Mumbai", L"India Standard Time" },
+ { L"Singapura", L"Singapore Standard Time" }, { L"Pequim", L"China Standard Time" }, { L"Tóquio", L"Tokyo Standard Time" }, { L"Seul", L"Korea Standard Time" },
+ { L"Sydney", L"AUS Eastern Standard Time" }, { L"Auckland", L"New Zealand Standard Time" }, { L"Honolulu", L"Hawaiian Standard Time" },
+ { L"Los Angeles", L"Pacific Standard Time" }, { L"Denver", L"Mountain Standard Time" }, { L"Chicago", L"Central Standard Time" },
+ { L"Nova York", L"Eastern Standard Time" }, { L"Cidade do México", L"Central Standard Time (Mexico)" }, { L"Bogotá", L"SA Pacific Standard Time" },
+ { L"Buenos Aires", L"Argentina Standard Time" }, { L"Santiago", L"Pacific SA Standard Time" }, { L"Joanesburgo", L"South Africa Standard Time" },
+ { L"Cairo", L"Egypt Standard Time" }, { L"Nairóbi", L"E. Africa Standard Time" }, { L"UTC", L"UTC" },
+};
+const int NCITIES = (int)(sizeof(CITIES) / sizeof(CITIES[0]));
+std::vector<int> g_world; // índices em CITIES
+
+bool CityTime(int i, SYSTEMTIME& out) {
+ DYNAMIC_TIME_ZONE_INFORMATION d{};
+ for (DWORD k = 0; EnumDynamicTimeZoneInformation(k, &d) == ERROR_SUCCESS; k++)
+ if (!wcscmp(d.TimeZoneKeyName, CITIES[i].tz)) {
+ SYSTEMTIME utc; GetSystemTime(&utc);
+ return SystemTimeToTzSpecificLocalTimeEx(&d, &utc, &out) != FALSE;
+ }
+ return false;
+}
+
+// ---- alarmes
+struct Alarm { int id; int hh, mm; bool on; std::wstring label; int days; }; // days: bits 0 = dom ... 6 = sáb; 0 = uma vez
+std::vector<Alarm> g_alarms;
+int g_nextId = 1;
+std::wstring g_file;
+
+void Save() {
+ std::vector<std::wstring> out{ L"# Relógio do WacOS: W = cidade do Relógio Mundial, A = alarme (id, hora, minuto, ligado, nome, dias)" };
+ for (int i : g_world) out.push_back(L"W\t" + std::to_wstring(i));
+ for (auto& a : g_alarms) out.push_back(L"A\t" + std::to_wstring(a.id) + L"\t" + std::to_wstring(a.hh) + L"\t" + std::to_wstring(a.mm) + L"\t" + (a.on ? L"1" : L"0") + L"\t" + Esc(a.label) + L"\t" + std::to_wstring(a.days));
+ WriteLines(g_file, out);
+}
+void Load() {
+ g_world.clear(); g_alarms.clear();
+ bool any = false;
+ for (auto& l : ReadLines(g_file)) {
+ auto f = Split(l);
+ if (f.size() >= 2 && f[0] == L"W") { int i = _wtoi(f[1].c_str()); if (i >= 0 && i < NCITIES) g_world.push_back(i); any = true; }
+ else if (f.size() >= 7 && f[0] == L"A") g_alarms.push_back({ _wtoi(f[1].c_str()), _wtoi(f[2].c_str()), _wtoi(f[3].c_str()), f[4] == L"1", Unesc(f[5]), _wtoi(f[6].c_str()) });
+ }
+ if (!any && g_world.empty()) g_world = { 0, 5, 25, 17 }; // São Paulo, Londres, Nova York, Tóquio
+ for (auto& a : g_alarms) g_nextId = std::max(g_nextId, a.id + 1);
+}
+
+// ---- cronômetro
+bool g_swRun = false;
+ULONGLONG g_swStart = 0, g_swAcc = 0;
+std::vector<ULONGLONG> g_laps; // duração de cada volta
+ULONGLONG SwNow() { return g_swAcc + (g_swRun ? GetTickCount64() - g_swStart : 0); }
+std::wstring FmtTime(ULONGLONG ms, bool cs = true) {
+ wchar_t b[32];
+ ULONGLONG s = ms / 1000;
+ if (s >= 3600) swprintf_s(b, L"%llu:%02llu:%02llu", s / 3600, s / 60 % 60, s % 60);
+ else if (cs) swprintf_s(b, L"%02llu:%02llu,%02llu", s / 60, s % 60, ms / 10 % 100);
+ else swprintf_s(b, L"%02llu:%02llu", s / 60, s % 60);
+ return b;
+}
+
+// ---- timer
+int g_tmMin = 5; // escolhido
+bool g_tmRun = false, g_tmPaused = false;
+ULONGLONG g_tmEnd = 0, g_tmLeft = 0; // fim (tick) / restante quando pausado
+ULONGLONG TmLeft() { if (!g_tmRun) return (ULONGLONG)g_tmMin * 60000; if (g_tmPaused) return g_tmLeft; ULONGLONG n = GetTickCount64(); return g_tmEnd > n ? g_tmEnd - n : 0; }
+
+struct Hit { int kind, arg; D2D1_RECT_F r; };
+std::vector<Hit> g_hits;
+enum { H_TAB = 1, H_ADD, H_WORLD, H_ALARM, H_ALARMTIME, H_SWITCH, H_SW_A, H_SW_B, H_TM_PRESET, H_TM_MINUS, H_TM_PLUS, H_TM_A, H_TM_B };
+
+void Button(D2D1_RECT_F r, const std::wstring& t, D2D1_COLOR_F bg, D2D1_COLOR_F fg, int kind, int arg = 0) {
+ float rad = (r.bottom - r.top) / 2;
+ Fill(r, bg, rad);
+ Text(t, g_tfBtn, r, fg);
+ g_hits.push_back({ kind, arg, r });
+}
+
+// ---- macOS 27 (captura Clock do 512 Pixels, 2x, medida em pt): abas num controle de vidro no meio da barra de 52
+// e o "+" redondo à direita; o mapa-múndi ocupa a largura toda logo abaixo (equirretangular, 360° na largura,
+// do polo norte até ~-86°), continentes cinza (63) sobre o preto, a parte da noite escurecida (25) e contornada por
+// uma linha clara, meridianos de 15° bem fracos; as cidades num ponto laranja com o nome em negrito e a hora.
+// Embaixo, cartões de 170 × 180 com o relógio analógico (mostrador branco de dia, preto de noite).
+#include "mapa_mundi.inc"
+struct LatLon { double lat, lon; };
+const LatLon COORDS[] = {
+ { -23.55, -46.63 }, { -22.91, -43.17 }, { -3.12, -60.02 }, { -3.73, -38.53 }, { 38.72, -9.14 }, { 51.51, -0.13 }, { 48.86, 2.35 },
+ { 52.52, 13.40 }, { 40.42, -3.70 }, { 41.90, 12.50 }, { 37.98, 23.73 }, { 41.01, 28.98 }, { 55.76, 37.62 }, { 25.20, 55.27 }, { 19.08, 72.88 },
+ { 1.35, 103.82 }, { 39.90, 116.41 }, { 35.68, 139.69 }, { 37.57, 126.98 }, { -33.87, 151.21 }, { -36.85, 174.76 }, { 21.31, -157.86 },
+ { 34.05, -118.24 }, { 39.74, -104.99 }, { 41.88, -87.63 }, { 40.71, -74.01 }, { 19.43, -99.13 }, { 4.71, -74.07 }, { -34.60, -58.38 },
+ { -33.45, -70.67 }, { -26.20, 28.05 }, { 30.04, 31.24 }, { -1.29, 36.82 }, { 51.48, 0.0 },
+};
+ID2D1Bitmap* g_map; ID2D1RenderTarget* g_mapRt;
+IDWriteTextFormat *g_tfCityB, *g_tfCityT, *g_tfDial, *g_tfCard, *g_tfCardSub, *g_tfCardSubL;
+
+ID2D1Bitmap* MapBitmap() {
+ if (g_mapRt != rt && g_map) { g_map->Release(); g_map = nullptr; }
+ if (g_map) return g_map;
+ std::vector<BYTE> px((size_t)MAPA_W * MAPA_H * 4, 0);
+ for (int y = 0; y < MAPA_H; y++)
+ for (int x = 0; x < MAPA_W; x++)
+ if (MAPA_BITS[y * (MAPA_W / 8) + x / 8] & (0x80 >> (x % 8))) { BYTE* p = &px[((size_t)y * MAPA_W + x) * 4]; p[0] = p[1] = p[2] = 63; p[3] = 255; }
+ rt->CreateBitmap(D2D1::SizeU(MAPA_W, MAPA_H), px.data(), MAPA_W * 4, D2D1::BitmapProperties(D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED)), &g_map);
+ g_mapRt = rt;
+ return g_map;
+}
+
+// ponto do sol a pino agora (declinação e longitude), aproximado (sem a equação do tempo)
+void SubSolar(double& decl, double& lon) {
+ SYSTEMTIME u; GetSystemTime(&u);
+ FILETIME f; SystemTimeToFileTime(&u, &f);
+ SYSTEMTIME j{ u.wYear, 1, 0, 1, 0, 0, 0, 0 }; FILETIME fj; SystemTimeToFileTime(&j, &fj);
+ double day = (((ULONGLONG)f.dwHighDateTime << 32 | f.dwLowDateTime) - ((ULONGLONG)fj.dwHighDateTime << 32 | fj.dwLowDateTime)) / 864e9;
+ decl = 23.44 * sin(2 * 3.14159265 * (284 + day) / 365.0);
+ double h = u.wHour + u.wMinute / 60.0 + u.wSecond / 3600.0;
+ lon = -15 * (h - 12);
+}
+
+// nascer e pôr do sol (hora local da cidade, em horas; false nos dias sem nascer ou sem pôr, perto dos polos):
+// declinação do dia, ângulo horário do nascer (-0,83° pela refração e o raio do sol) e a equação do tempo
+bool SunTimes(double lat, double lon, double utcOffsetH, double& rise, double& set) {
+ const double PI = 3.14159265358979;
+ SYSTEMTIME u; GetSystemTime(&u);
+ SYSTEMTIME j{ u.wYear, 1, 0, 1, 0, 0, 0, 0 }; FILETIME fu, fj; SystemTimeToFileTime(&u, &fu); SystemTimeToFileTime(&j, &fj);
+ double n = (((ULONGLONG)fu.dwHighDateTime << 32 | fu.dwLowDateTime) - ((ULONGLONG)fj.dwHighDateTime << 32 | fj.dwLowDateTime)) / 864e9 + 1;
+ double decl = 23.44 * sin(2 * PI * (284 + n) / 365.0) * PI / 180;
+ double B = 2 * PI * (n - 81) / 364, eot = 9.87 * sin(2 * B) - 7.53 * cos(B) - 1.5 * sin(B);
+ double c = (sin(-0.83 * PI / 180) - sin(lat * PI / 180) * sin(decl)) / (cos(lat * PI / 180) * cos(decl));
+ if (c < -1 || c > 1) return false;
+ double h0 = acos(c) * 180 / PI / 15; // horas
+ double noon = 12 - lon / 15 - eot / 60 + utcOffsetH;
+ rise = fmod(noon - h0 + 48, 24); set = fmod(noon + h0 + 48, 24);
+ return true;
+}
+
+void PaintWorldGolden(D2D1_SIZE_F sz, bool dark) {
+ const double PI = 3.14159265358979;
+ float mapH = sz.width * MAPA_H / (float)MAPA_W, top = TB;
+ Fill(D2D1::RectF(0, top, sz.width, top + mapH), Rgb(0, 0, 0));
+ if (ID2D1Bitmap* b = MapBitmap()) rt->DrawBitmap(b, D2D1::RectF(0, top, sz.width, top + mapH), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
+ auto X = [&](double lon) { return (float)((lon + 180) / 360 * sz.width); };
+ double latBottom = MAPA_LAT_BAIXO;
+ auto Y = [&](double lat) { return (float)(top + (90 - lat) / (90 - latBottom) * mapH); };
+ for (int k = 1; k < 24; k++) Fill(D2D1::RectF(k * sz.width / 24, top, k * sz.width / 24 + 0.5f, top + mapH), Rgb(255, 255, 255, 0.06f));
+ // noite
+ double decl, slon; SubSolar(decl, slon);
+ if (fabs(decl) < 0.1) decl = decl < 0 ? -0.1 : 0.1;
+ ID2D1PathGeometry* g = nullptr; d2d->CreatePathGeometry(&g);
+ ID2D1PathGeometry* line = nullptr; d2d->CreatePathGeometry(&line);
+ if (g && line) {
+ ID2D1GeometrySink *s = nullptr, *ls = nullptr; g->Open(&s); line->Open(&ls);
+ bool northLit = decl > 0;
+ float edge = northLit ? top + mapH : top;
+ int N = 180;
+ for (int i = 0; i <= N; i++) {
+ double lon = -180 + 360.0 * i / N, H = (lon - slon) * PI / 180;
+ double lat = atan(-cos(H) / tan(decl * PI / 180)) * 180 / PI;
+ D2D1_POINT_2F p{ X(lon), std::clamp(Y(lat), top, top + mapH) };
+ if (!i) { s->BeginFigure({ p.x, edge }, D2D1_FIGURE_BEGIN_FILLED); ls->BeginFigure(p, D2D1_FIGURE_BEGIN_HOLLOW); }
+ s->AddLine(p);
+ if (i) ls->AddLine(p);
+ }
+ s->AddLine({ sz.width, edge });
+ s->EndFigure(D2D1_FIGURE_END_CLOSED); ls->EndFigure(D2D1_FIGURE_END_OPEN);
+ s->Close(); ls->Close(); s->Release(); ls->Release();
+ rt->PushAxisAlignedClip(D2D1::RectF(0, top, sz.width, top + mapH), D2D1_ANTIALIAS_MODE_ALIASED);
+ br->SetColor(Rgb(0, 0, 0, 0.6f)); rt->FillGeometry(g, br);
+ br->SetColor(Rgb(255, 255, 255, 0.55f)); rt->DrawGeometry(line, br, 1);
+ rt->PopAxisAlignedClip();
+ }
+ if (g) g->Release();
+ if (line) line->Release();
+ // cidades
+ for (int k = 0; k < (int)g_world.size(); k++) {
+ int i = g_world[k];
+ if (i < 0 || i >= (int)(sizeof(COORDS) / sizeof(COORDS[0]))) continue;
+ SYSTEMTIME t{}; if (!CityTime(i, t)) continue;
+ float x = X(COORDS[i].lon), y = Y(COORDS[i].lat);
+ Circle({ x, y }, 4.2f, Rgb(255, 255, 255, 0.9f), true);
+ Circle({ x, y }, 3.2f, Rgb(255, 149, 0), true);
+ wchar_t hm[24]; swprintf_s(hm, L"%d:%02d", t.wHour, t.wMinute);
+ Text(Tr(CITIES[i].name), g_tfCityB, D2D1::RectF(x + 7, y - 9, x + 160, y + 5), Rgb(255, 255, 255));
+ Text(hm, g_tfCityT, D2D1::RectF(x + 7, y + 4, x + 160, y + 15), Rgb(255, 255, 255, 0.85f));
+ }
+ // cartões com o relógio analógico
+ SYSTEMTIME here; GetLocalTime(&here);
+ float cy0 = top + mapH + 14;
+ for (int k = 0; k < (int)g_world.size(); k++) {
+ int i = g_world[k];
+ SYSTEMTIME t{}; if (!CityTime(i, t)) continue;
+ float x0 = 14 + k * 184.f;
+ if (x0 + 170 > sz.width) break;
+ D2D1_RECT_F card = D2D1::RectF(x0, cy0, x0 + 170, cy0 + 196); // macOS 27: com a linha do nascer e pôr do sol
+ Fill(card, dark ? Rgb(255, 255, 255, 0.08f) : Rgb(0, 0, 0, 0.05f), 12);
+ bool day = t.wHour >= 6 && t.wHour < 18;
+ D2D1_POINT_2F c{ x0 + 85, cy0 + 72 };
+ Circle(c, 55, day ? Rgb(255, 255, 255) : Rgb(0, 0, 0), true);
+ if (!day) { br->SetColor(Rgb(255, 255, 255, 0.25f)); rt->DrawEllipse(D2D1::Ellipse(c, 55, 55), br, 0.75f); }
+ D2D1_COLOR_F ink = day ? Rgb(0, 0, 0) : Rgb(255, 255, 255);
+ for (int n = 1; n <= 12; n++) {
+ double a = n * PI / 6;
+ float nx = c.x + (float)sin(a) * 43, ny = c.y - (float)cos(a) * 43;
+ Text(std::to_wstring(n), g_tfDial, D2D1::RectF(nx - 10, ny - 8, nx + 10, ny + 8), ink);
+ }
+ double hm = (t.wHour % 12 + t.wMinute / 60.0) * PI / 6, mm = (t.wMinute + t.wSecond / 60.0) * PI / 30, ss = t.wSecond * PI / 30;
+ br->SetColor(ink);
+ rt->DrawLine(c, { c.x + (float)sin(hm) * 26, c.y - (float)cos(hm) * 26 }, br, 3.2f);
+ rt->DrawLine(c, { c.x + (float)sin(mm) * 40, c.y - (float)cos(mm) * 40 }, br, 2.4f);
+ br->SetColor(Rgb(255, 149, 0));
+ rt->DrawLine({ c.x - (float)sin(ss) * 8, c.y + (float)cos(ss) * 8 }, { c.x + (float)sin(ss) * 46, c.y - (float)cos(ss) * 46 }, br, 1);
+ Circle(c, 3, Rgb(255, 149, 0), true);
+ Circle(c, 1.4f, day ? Rgb(255, 255, 255) : Rgb(0, 0, 0), true);
+ wchar_t nm[96]; swprintf_s(nm, L"%ls, %d:%02d", Tr(CITIES[i].name), t.wHour, t.wMinute);
+ Text(nm, g_tfCard, D2D1::RectF(x0 + 6, cy0 + 136, x0 + 164, cy0 + 154), dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31));
+ FILETIME a, b2; SystemTimeToFileTime(&here, &a); SystemTimeToFileTime(&t, &b2);
+ long long diffMin = ((long long)(((ULONGLONG)b2.dwHighDateTime << 32 | b2.dwLowDateTime) - ((ULONGLONG)a.dwHighDateTime << 32 | a.dwLowDateTime))) / 600000000LL;
+ long long dh = (diffMin + (diffMin >= 0 ? 15 : -15)) / 30;
+ std::wstring dayS = t.wDay == here.wDay ? Tr(L"Hoje") : (diffMin > 0 ? Tr(L"Amanhã") : Tr(L"Ontem"));
+ wchar_t off[32] = L"";
+ if (dh % 2) swprintf_s(off, L", %+lld h 30", dh / 2); else if (dh) swprintf_s(off, L", %+lld h", dh / 2);
+ Text(dayS + off, g_tfCardSub, D2D1::RectF(x0 + 6, cy0 + 154, x0 + 164, cy0 + 170), dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139));
+ { // ⤒ nascer ⤓ pôr (sol pela metade com a seta), como na captura
+ SYSTEMTIME ut; GetSystemTime(&ut);
+ FILETIME fu, fc; SystemTimeToFileTime(&ut, &fu); SystemTimeToFileTime(&t, &fc);
+ double offH = (double)((long long)(((ULONGLONG)fc.dwHighDateTime << 32 | fc.dwLowDateTime) - ((ULONGLONG)fu.dwHighDateTime << 32 | fu.dwLowDateTime))) / 36e9;
+ offH = std::round(offH * 4) / 4;
+ double rise, set;
+ if (i < (int)(sizeof(COORDS) / sizeof(COORDS[0])) && SunTimes(COORDS[i].lat, COORDS[i].lon, offH, rise, set)) {
+ D2D1_COLOR_F g2 = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
+ auto hm2 = [](double h) { int m = (int)std::lround(h * 60) % 1440; wchar_t b[16]; swprintf_s(b, L"%d:%02d", m / 60, m % 60); return std::wstring(b); };
+ std::wstring a1 = hm2(rise), a2 = hm2(set);
+ float w1 = TextW(g_tfCardSub, a1), w2 = TextW(g_tfCardSub, a2), gap = 14, iw = 12;
+ float total = iw + 3 + w1 + gap + iw + 3 + w2, sx = x0 + 85 - total / 2, yy = cy0 + 178;
+ auto sun = [&](float x, bool up) {
+ br->SetColor(g2);
+ rt->DrawLine({ x, yy + 4 }, { x + iw, yy + 4 }, br, 1.1f);
+ rt->PushAxisAlignedClip(D2D1::RectF(x - 1, yy - 1, x + iw + 1, yy + 4), D2D1_ANTIALIAS_MODE_ALIASED); // só a metade de cima do sol
+ rt->DrawEllipse(D2D1::Ellipse({ x + iw / 2, yy + 4 }, 3, 3), br, 1.1f);
+ rt->PopAxisAlignedClip();
+ float ax = x + iw / 2, ay0 = yy - 4.5f, ay1 = yy - 1;
+ if (up) { rt->DrawLine({ ax, ay1 }, { ax, ay0 }, br, 1); rt->DrawLine({ ax - 1.8f, ay0 + 1.8f }, { ax, ay0 }, br, 1); rt->DrawLine({ ax + 1.8f, ay0 + 1.8f }, { ax, ay0 }, br, 1); }
+ else { rt->DrawLine({ ax, ay0 }, { ax, ay1 }, br, 1); rt->DrawLine({ ax - 1.8f, ay1 - 1.8f }, { ax, ay1 }, br, 1); rt->DrawLine({ ax + 1.8f, ay1 - 1.8f }, { ax, ay1 }, br, 1); }
+ };
+ sun(sx, true);
+ Text(a1, g_tfCardSubL, D2D1::RectF(sx + iw + 3, yy - 8, sx + iw + 3 + w1 + 2, yy + 8), g2);
+ float sx2 = sx + iw + 3 + w1 + gap;
+ sun(sx2, false);
+ Text(a2, g_tfCardSubL, D2D1::RectF(sx2 + iw + 3, yy - 8, sx2 + iw + 3 + w2 + 2, yy + 8), g2);
+ }
+ }
+ g_hits.push_back({ H_WORLD, k, card });
+ }
+}
+
+void PaintTabsGolden(D2D1_SIZE_F sz, bool dark) {
+ D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31);
+ const wchar_t* tabs[] = { L"Relógio Mundial", L"Alarmes", L"Cronômetro", L"Timer" };
+ float ws[4], total = 8;
+ for (int i = 0; i < 4; i++) { ws[i] = TextW(g_tfSeg, Tr(tabs[i])) + 34; total += ws[i]; }
+ D2D1_RECT_F seg = D2D1::RectF(sz.width / 2 - total / 2, 10, sz.width / 2 + total / 2, 42);
+ GlassButton(seg, dark);
+ BarButton(seg);
+ float x = seg.left + 4;
+ for (int i = 0; i < 4; i++) {
+ D2D1_RECT_F r = D2D1::RectF(x, seg.top + 3, x + ws[i], seg.bottom - 3);
+ if (g_tab == i) Fill(r, dark ? Rgb(255, 255, 255, 0.14f) : Rgb(0, 0, 0, 0.08f), 13);
+ Text(Tr(tabs[i]), g_tfSeg, r, text);
+ g_hits.push_back({ H_TAB, i, r });
+ x += ws[i];
+ }
+ if (g_tab <= 1) {
+ D2D1_RECT_F add = D2D1::RectF(sz.width - 8 - 36, 8, sz.width - 8, 44);
+ GlassButton(add, dark); IconPlus({ (add.left + add.right) / 2, 26 }, text);
+ g_hits.push_back({ H_ADD, 0, add }); BarButton(add);
+ }
+}
+
+void Paint() {
+ if (!BeginPaint()) return;
+ g_hits.clear();
+ bool dark = Dark();
+ D2D1_SIZE_F sz = Size();
+ D2D1_COLOR_F text = dark ? Rgb(245, 245, 247) : Rgb(29, 29, 31), gray = dark ? Rgb(152, 152, 157) : Rgb(134, 134, 139);
+ D2D1_COLOR_F line = dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.10f);
+ rt->Clear(dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255));
+ const bool gg = BAR > 0;
+ if (gg) PaintTabsGolden(sz, dark);
+ // abas
+ if (!gg) {
+ const wchar_t* tabs[] = { L"Relógio Mundial", L"Alarmes", L"Cronômetro", L"Timer" };
+ float segW = 120, sx = sz.width / 2 - segW * 2;
+ Fill(D2D1::RectF(sx, 14, sx + segW * 4, 40), dark ? Rgb(58, 58, 60) : Rgb(232, 232, 237), 7);
+ for (int i = 0; i < 4; i++) {
+ D2D1_RECT_F r = D2D1::RectF(sx + i * segW + 2, 16, sx + (i + 1) * segW - 2, 38);
+ if (g_tab == i) Fill(r, dark ? Rgb(99, 99, 102) : Rgb(255, 255, 255), 6);
+ Text(Tr(tabs[i]), g_tfSeg, r, text);
+ g_hits.push_back({ H_TAB, i, r });
+ }
+ if (g_tab <= 1) {
+ D2D1_RECT_F add = D2D1::RectF(sz.width - 46, 12, sz.width - 14, 42);
+ wchar_t p[2] = { 0xE710, 0 };
+ Text(p, g_tfIcon, add, text);
+ g_hits.push_back({ H_ADD, 0, add });
+ }
+ } // !gg
+ Fill(D2D1::RectF(0, TB - 1, sz.width, TB), line);
+ float X = 28, W = sz.width - 28;
+ if (g_tab == 0 && gg) PaintWorldGolden(sz, dark);
+ else if (g_tab == 0) {
+ SYSTEMTIME here; GetLocalTime(&here);
+ float y = TB + 8;
+ for (int k = 0; k < (int)g_world.size(); k++) {
+ int i = g_world[k];
+ SYSTEMTIME t{};
+ if (!CityTime(i, t)) continue;
+ FILETIME a, b; SystemTimeToFileTime(&here, &a); SystemTimeToFileTime(&t, &b);
+ long long diffMin = ((long long)(((ULONGLONG)b.dwHighDateTime << 32 | b.dwLowDateTime) - ((ULONGLONG)a.dwHighDateTime << 32 | a.dwLowDateTime))) / 600000000LL;
+ long long dh = (diffMin + (diffMin >= 0 ? 15 : -15)) / 30; // em meias horas
+ std::wstring day = t.wDay == here.wDay ? Tr(L"Hoje") : (diffMin > 0 ? Tr(L"Amanhã") : Tr(L"Ontem"));
+ wchar_t off[32];
+ if (dh == 0) wcscpy_s(off, L"");
+ else if (dh % 2) swprintf_s(off, L", %+lld h 30", dh / 2);
+ else swprintf_s(off, L", %+lld h", dh / 2);
+ D2D1_RECT_F row = D2D1::RectF(X, y, W, y + 74);
+ Text(day + off, g_tfSub, D2D1::RectF(X, y + 10, W - 200, y + 30), gray);
+ Text(Tr(CITIES[i].name), g_tfRow, D2D1::RectF(X, y + 30, W - 200, y + 60), text);
+ wchar_t hm[16]; swprintf_s(hm, L"%d:%02d", t.wHour, t.wMinute);
+ Text(hm, g_tfBigR, D2D1::RectF(W - 220, y, W, y + 74), text);
+ Fill(D2D1::RectF(X, y + 74, W, y + 75), line);
+ g_hits.push_back({ H_WORLD, k, row });
+ y += 75;
+ }
+ } else if (g_tab == 1) {
+ float y = TB + 8;
+ if (g_alarms.empty()) Text(Tr(L"Nenhum Alarme"), g_tfRow, D2D1::RectF(0, TB, sz.width, sz.height * 0.6f), gray);
+ for (int k = 0; k < (int)g_alarms.size(); k++) {
+ auto& a = g_alarms[k];
+ wchar_t hm[16]; swprintf_s(hm, L"%d:%02d", a.hh, a.mm);
+ D2D1_RECT_F tr = D2D1::RectF(X, y, X + 220, y + 60);
+ Text(hm, g_tfBig, tr, a.on ? text : gray);
+ std::wstring sub = a.label.empty() ? Tr(L"Alarme") : a.label;
+ if (a.days == 0x7F) sub += L", " + std::wstring(Tr(L"todos os dias"));
+ else if (a.days == 0x3E) sub += L", " + std::wstring(Tr(L"dias de semana"));
+ else if (a.days == 0x41) sub += L", " + std::wstring(Tr(L"fins de semana"));
+ Text(sub, g_tfSub, D2D1::RectF(X, y + 56, W - 100, y + 76), gray);
+ g_hits.push_back({ H_ALARMTIME, k, tr });
+ // interruptor
+ D2D1_RECT_F sw = D2D1::RectF(W - 60, y + 26, W - 10, y + 54);
+ Fill(sw, a.on ? Rgb(48, 209, 88) : (dark ? Rgb(72, 72, 74) : Rgb(229, 229, 234)), 14);
+ Circle({ a.on ? sw.right - 14 : sw.left + 14, (sw.top + sw.bottom) / 2 }, 12, Rgb(255, 255, 255), true);
+ g_hits.push_back({ H_SWITCH, k, sw });
+ g_hits.push_back({ H_ALARM, k, D2D1::RectF(X, y, W - 70, y + 84) });
+ Fill(D2D1::RectF(X, y + 84, W, y + 85), line);
+ y += 86;
+ }
+ } else if (g_tab == 2) {
+ ULONGLONG now = SwNow();
+ Text(FmtTime(now), g_tfHuge, D2D1::RectF(0, TB + 20, sz.width, TB + 150), text);
+ float by = TB + 170, cx = sz.width / 2;
+ bool running = g_swRun;
+ Button(D2D1::RectF(cx - 190, by, cx - 30, by + 44), running ? Tr(L"Volta") : Tr(L"Zerar"), dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), text, H_SW_A);
+ Button(D2D1::RectF(cx + 30, by, cx + 190, by + 44), running ? Tr(L"Parar") : Tr(L"Iniciar"), running ? Rgb(255, 69, 58, 0.25f) : Rgb(48, 209, 88, 0.25f), running ? Rgb(255, 69, 58) : Rgb(48, 209, 88), H_SW_B);
+ // voltas (a atual em cima)
+ std::vector<ULONGLONG> laps = g_laps;
+ ULONGLONG done = 0; for (auto l : g_laps) done += l;
+ if (now || !laps.empty()) laps.push_back(now - done);
+ int best = -1, worst = -1;
+ if (g_laps.size() >= 2) for (int i = 0; i < (int)g_laps.size(); i++) { if (best < 0 || g_laps[i] < g_laps[best]) best = i; if (worst < 0 || g_laps[i] > g_laps[worst]) worst = i; }
+ float y = by + 70;
+ for (int i = (int)laps.size() - 1; i >= 0 && y < sz.height - 20; i--) {
+ D2D1_COLOR_F c = i == best ? Rgb(48, 209, 88) : i == worst ? Rgb(255, 69, 58) : text;
+ wchar_t n[32]; swprintf_s(n, Tr(L"Volta %d"), i + 1);
+ Text(n, g_tfRow, D2D1::RectF(X + 60, y, W, y + 34), c);
+ Text(FmtTime(laps[i]), g_tfMono, D2D1::RectF(X, y, W - 60, y + 34), c);
+ Fill(D2D1::RectF(X + 60, y + 34, W - 60, y + 35), line);
+ y += 35;
+ }
+ } else {
+ ULONGLONG left = TmLeft();
+ Text(FmtTime(left + 999, false), g_tfHuge, D2D1::RectF(0, TB + 20, sz.width, TB + 150), g_tmRun && !g_tmPaused ? Rgb(255, 159, 10) : text);
+ float cx = sz.width / 2, y = TB + 160;
+ if (!g_tmRun) {
+ int presets[] = { 1, 3, 5, 10, 15, 30, 60 };
+ float pw = 64, px = cx - pw * 3.5f - 9;
+ for (int i = 0; i < 7; i++) {
+ D2D1_RECT_F r = D2D1::RectF(px + i * (pw + 3), y, px + i * (pw + 3) + pw, y + 34);
+ bool on = g_tmMin == presets[i];
+ wchar_t b[16]; swprintf_s(b, presets[i] >= 60 ? L"%d h" : L"%d min", presets[i] >= 60 ? presets[i] / 60 : presets[i]);
+ Fill(r, on ? Rgb(255, 159, 10, 0.3f) : (dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234)), 8);
+ Text(b, g_tfBtn, r, on ? Rgb(255, 159, 10) : text);
+ g_hits.push_back({ H_TM_PRESET, presets[i], r });
+ }
+ Button(D2D1::RectF(cx - 90, y + 50, cx - 50, y + 84), L"−", dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), text, H_TM_MINUS);
+ Button(D2D1::RectF(cx + 50, y + 50, cx + 90, y + 84), L"+", dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), text, H_TM_PLUS);
+ wchar_t m[16]; swprintf_s(m, L"%d min", g_tmMin);
+ Text(m, g_tfRow, D2D1::RectF(cx - 50, y + 50, cx + 50, y + 84), text);
+ y += 110;
+ }
+ Button(D2D1::RectF(cx - 190, y, cx - 30, y + 44), Tr(L"Cancelar"), dark ? Rgb(58, 58, 60) : Rgb(229, 229, 234), g_tmRun ? text : gray, H_TM_A);
+ const wchar_t* b = !g_tmRun ? Tr(L"Iniciar") : g_tmPaused ? Tr(L"Retomar") : Tr(L"Pausar");
+ Button(D2D1::RectF(cx + 30, y, cx + 190, y + 44), b, g_tmRun && !g_tmPaused ? Rgb(255, 159, 10, 0.25f) : Rgb(48, 209, 88, 0.25f), g_tmRun && !g_tmPaused ? Rgb(255, 159, 10) : Rgb(48, 209, 88), H_TM_B);
+ }
+ EndPaint();
+}
+
+void Tick() {
+ if (g_tmRun && !g_tmPaused && TmLeft() == 0) { // timer acabou
+ g_tmRun = false;
+ PlaySoundW(L"SystemExclamation", nullptr, SND_ALIAS | SND_ASYNC);
+ FLASHWINFO fw{ sizeof(fw), wnd, FLASHW_ALL | FLASHW_TIMERNOFG, 6, 0 }; FlashWindowEx(&fw);
+ ShowWindow(wnd, SW_RESTORE); SetForegroundWindow(wnd);
+ MessageBoxW(wnd, Tr(L"O timer terminou."), Tr(L"Relógio"), MB_OK | MB_ICONINFORMATION | MB_TOPMOST);
+ }
+ static int n;
+ if (g_swRun || (g_tmRun && !g_tmPaused) || ++n % 20 == 0) InvalidateRect(wnd, nullptr, FALSE);
+}
+
+void AddCity(POINT scr) {
+ HMENU m = CreatePopupMenu();
+ for (int i = 0; i < NCITIES; i++) AppendMenuW(m, MF_STRING | (std::find(g_world.begin(), g_world.end(), i) != g_world.end() ? MF_CHECKED : 0), i + 1, Tr(CITIES[i].name));
+ int c = TrackPopupMenu(m, TPM_RETURNCMD, scr.x, scr.y, 0, wnd, nullptr);
+ DestroyMenu(m);
+ if (c > 0 && std::find(g_world.begin(), g_world.end(), c - 1) == g_world.end()) { g_world.push_back(c - 1); Save(); }
+}
+
+// hora do alarme digitada ("7:30", "0730", "19h")
+bool ParseTime(const std::wstring& s, int& hh, int& mm) {
+ std::wstring d; for (wchar_t c : s) if (iswdigit(c)) d += c;
+ if (d.empty()) return false;
+ if (d.size() <= 2) { hh = _wtoi(d.c_str()); mm = 0; }
+ else { hh = _wtoi(d.substr(0, d.size() - 2).c_str()); mm = _wtoi(d.substr(d.size() - 2).c_str()); }
+ return hh >= 0 && hh < 24 && mm >= 0 && mm < 60;
+}
+void EditAlarmTime(int k) {
+ for (auto& h : g_hits) if (h.kind == H_ALARMTIME && h.arg == k) {
+ int id = g_alarms[k].id;
+ wchar_t cur[16]; swprintf_s(cur, L"%d:%02d", g_alarms[k].hh, g_alarms[k].mm);
+ FieldOpen(D2D1::RectF(h.r.left, h.r.top + 10, h.r.left + 160, h.r.bottom - 10), cur, 30, false, [id](const std::wstring& t, int key) {
+ if (key == VK_ESCAPE) return;
+ for (auto& a : g_alarms) if (a.id == id) { int hh, mm; if (ParseTime(t, hh, mm)) { a.hh = hh; a.mm = mm; a.on = true; Save(); } }
+ });
+ }
+}
+void AddAlarm() {
+ SYSTEMTIME t; GetLocalTime(&t);
+ g_alarms.push_back({ g_nextId++, (t.wHour + 1) % 24, 0, true, L"", 0 });
+ Save();
+ Paint();
+ EditAlarmTime((int)g_alarms.size() - 1);
+}
+void AlarmMenu(int k, POINT scr) {
+ HMENU m = CreatePopupMenu(), rep = CreatePopupMenu();
+ int d = g_alarms[k].days;
+ AppendMenuW(rep, MF_STRING | (d == 0 ? MF_CHECKED : 0), 10, Tr(L"Nunca"));
+ AppendMenuW(rep, MF_STRING | (d == 0x7F ? MF_CHECKED : 0), 11, Tr(L"Todos os Dias"));
+ AppendMenuW(rep, MF_STRING | (d == 0x3E ? MF_CHECKED : 0), 12, Tr(L"Dias de Semana"));
+ AppendMenuW(rep, MF_STRING | (d == 0x41 ? MF_CHECKED : 0), 13, Tr(L"Fins de Semana"));
+ AppendMenuW(m, MF_STRING, 1, Tr(L"Editar Hora"));
+ AppendMenuW(m, MF_STRING, 2, Tr(L"Renomear"));
+ AppendMenuW(m, MF_POPUP, (UINT_PTR)rep, Tr(L"Repetir"));
+ AppendMenuW(m, MF_SEPARATOR, 0, nullptr);
+ AppendMenuW(m, MF_STRING, 3, Tr(L"Apagar"));
+ int c = TrackPopupMenu(m, TPM_RETURNCMD | TPM_RIGHTBUTTON, scr.x, scr.y, 0, wnd, nullptr);
+ DestroyMenu(m);
+ if (c == 1) EditAlarmTime(k);
+ else if (c == 2) {
+ for (auto& h : g_hits) if (h.kind == H_ALARM && h.arg == k) {
+ int id = g_alarms[k].id;
+ FieldOpen(D2D1::RectF(h.r.left, h.r.top + 56, h.r.right, h.r.top + 76), g_alarms[k].label, 13, false, [id](const std::wstring& t, int key) {
+ if (key == VK_ESCAPE) return; for (auto& a : g_alarms) if (a.id == id) { a.label = t; Save(); } });
+ }
+ } else if (c == 3) { g_alarms.erase(g_alarms.begin() + k); Save(); }
+ else if (c >= 10) { static const int v[] = { 0, 0x7F, 0x3E, 0x41 }; g_alarms[k].days = v[c - 10]; Save(); }
+ InvalidateRect(wnd, nullptr, FALSE);
+}
+
+LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ switch (m) {
+ case WM_PAINT: { PAINTSTRUCT ps; ::BeginPaint(h, &ps); Paint(); ::EndPaint(h, &ps); return 0; }
+ case WM_ERASEBKGND: return 1;
+ case WM_SIZE: OnSize(l); return 0;
+ case WM_DPICHANGED: OnDpi(w, l); return 0;
+ case WM_SETTINGCHANGE: InvalidateRect(h, nullptr, FALSE); return 0;
+ case WM_CTLCOLOREDIT: return FieldColors((HDC)w, Dark() ? RGB(30, 30, 30) : RGB(255, 255, 255));
+ case WM_FIELDLOST: if (field.h && GetFocus() != field.h) FieldEnd(0); return 0;
+ case WM_TIMER: Tick(); return 0;
+ case WM_LBUTTONDOWN: case WM_RBUTTONUP: {
+ if (field.h) FieldEnd(0);
+ float s = Sc(), x = GET_X_LPARAM(l) / s, y = GET_Y_LPARAM(l) / s;
+ POINT scr{ GET_X_LPARAM(l), GET_Y_LPARAM(l) }; ClientToScreen(h, &scr);
+ bool right = m == WM_RBUTTONUP;
+ for (auto& ht : g_hits) {
+ if (!In(ht.r, x, y)) continue;
+ switch (ht.kind) {
+ case H_TAB: g_tab = ht.arg; break;
+ case H_ADD: if (g_tab == 0) AddCity(scr); else AddAlarm(); break;
+ case H_WORLD:
+ if (right) {
+ HMENU mm = CreatePopupMenu(); AppendMenuW(mm, MF_STRING, 1, Tr(L"Apagar"));
+ if (TrackPopupMenu(mm, TPM_RETURNCMD | TPM_RIGHTBUTTON, scr.x, scr.y, 0, h, nullptr) == 1) { g_world.erase(g_world.begin() + ht.arg); Save(); }
+ DestroyMenu(mm);
+ }
+ break;
+ case H_SWITCH: g_alarms[ht.arg].on = !g_alarms[ht.arg].on; Save(); break;
+ case H_ALARMTIME: if (right) AlarmMenu(ht.arg, scr); else EditAlarmTime(ht.arg); break;
+ case H_ALARM: if (right) AlarmMenu(ht.arg, scr); break;
+ case H_SW_A: if (g_swRun) { ULONGLONG done = 0; for (auto v : g_laps) done += v; g_laps.push_back(SwNow() - done); } else { g_swAcc = 0; g_laps.clear(); } break;
+ case H_SW_B: if (g_swRun) { g_swAcc = SwNow(); g_swRun = false; } else { g_swStart = GetTickCount64(); g_swRun = true; } break;
+ case H_TM_PRESET: g_tmMin = ht.arg; break;
+ case H_TM_MINUS: g_tmMin = std::max(1, g_tmMin - 1); break;
+ case H_TM_PLUS: g_tmMin = std::min(24 * 60, g_tmMin + 1); break;
+ case H_TM_A: g_tmRun = false; g_tmPaused = false; break;
+ case H_TM_B:
+ if (!g_tmRun) { g_tmRun = true; g_tmPaused = false; g_tmEnd = GetTickCount64() + (ULONGLONG)g_tmMin * 60000; }
+ else if (g_tmPaused) { g_tmPaused = false; g_tmEnd = GetTickCount64() + g_tmLeft; }
+ else { g_tmLeft = TmLeft(); g_tmPaused = true; }
+ break;
+ default: continue;
+ }
+ InvalidateRect(h, nullptr, FALSE);
+ return 0;
+ }
+ return 0;
+ }
+ case WM_KEYDOWN: {
+ bool ctrl = GetKeyState(VK_CONTROL) < 0;
+ if (ctrl && w >= '1' && w <= '4') { g_tab = (int)(w - '1'); InvalidateRect(h, nullptr, FALSE); return 0; }
+ if (ctrl && w == 'W') { DestroyWindow(h); return 0; }
+ if (w == VK_SPACE && g_tab == 2) { { if (g_swRun) { g_swAcc = SwNow(); g_swRun = false; } else { g_swStart = GetTickCount64(); g_swRun = true; } } InvalidateRect(h, nullptr, FALSE); }
+ return 0;
+ }
+ case WM_DESTROY: PostQuitMessage(0); return 0;
+ }
+ return DefWindowProcW(h, m, w, l);
+}
+
+} // namespace
+
+int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
+ if (!Init()) return 1;
+ g_file = DataPath(L"relogio.txt");
+ Load();
+ std::wstring disp = HasFont(L"SF Pro Display") ? L"SF Pro Display" : family;
+ g_tfSeg = Fmt(12.5f, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfBig = Fmt(44, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_TRAILING, false, disp.c_str());
+ g_tfHuge = Fmt(84, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_CENTER, false, disp.c_str());
+ if (g_tfHuge) { DWRITE_FONT_FEATURE f{ DWRITE_FONT_FEATURE_TAG_TABULAR_FIGURES, 1 }; (void)f; }
+ g_tfRow = Fmt(16);
+ g_tfSub = Fmt(13);
+ g_tfBtn = Fmt(15, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfIcon = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, IconFamily());
+ g_tfMono = Fmt(16, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ g_tfCityB = Fmt(11, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfCityT = Fmt(9);
+ g_tfDial = Fmt(12.5f, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfCard = Fmt(12.5f, DWRITE_FONT_WEIGHT_MEDIUM, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfCardSub = Fmt(12, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfCardSubL = Fmt(12, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_LEADING);
+ barWanted = 52; // macOS 27: abas na barra unificada
+ if (!CreateMain(hi, L"RelogioJanela", Tr(L"Relógio"), Proc, semaforo::Aqua() ? 1046 : 720, semaforo::Aqua() ? 768 : 640)) return 1;
+ if (BAR > 0) TB = 52;
+ // alarmes: o tempo do Mac é a hora grande alinhada à esquerda
if (g_tfBig) g_tfBig->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_LEADING);
- g_tfBigR = Fmt(44, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_TRAILING, false, disp.c_str());
- SetTimer(wnd, 1, 50, nullptr);
- ShowWindow(wnd, show);
- return Run();
-}
+ g_tfBigR = Fmt(44, DWRITE_FONT_WEIGHT_LIGHT, DWRITE_TEXT_ALIGNMENT_TRAILING, false, disp.c_str());
+ SetTimer(wnd, 1, 50, nullptr);
+ ShowWindow(wnd, show);
+ return Run();
+}
diff --git a/src/relogio/mapa_mundi.inc b/src/relogio/mapa_mundi.inc
new file mode 100644
index 0000000..3eab536
--- /dev/null
+++ b/src/relogio/mapa_mundi.inc
@@ -0,0 +1,1130 @@
+// gerado por tools/mapa-mundi.py: continentes (1 = terra), 768 x 375, 1 bit por ponto, da esquerda (bit 7)
+static const int MAPA_W = 768, MAPA_H = 375;
+static const double MAPA_LAT_BAIXO = -85.957; // latitude da última linha
+static const unsigned char MAPA_BITS[36000] = {
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0x80,
+ 0x00,0x00,0x38,0x1f,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,
+ 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf9,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x03,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x21,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xe3,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfe,0x01,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xf0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x00,0x0c,0x7f,0xff,0xff,0xff,0xff,0x83,0x07,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x00,0x1f,0xf1,0xfc,0x7f,0xff,0xff,0xff,0xff,0x03,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0xf8,0xfc,0x3f,0xff,0xff,0xff,0xfe,0x07,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xf8,0x00,0x00,0x00,0x3f,0x80,0x0f,0xff,0xff,0xc0,0x00,0x7f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfe,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x80,0x80,0x00,0x00,0x00,0x3f,0x80,0x0f,0xff,0xff,0xc0,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0x80,0x01,0x80,0x00,0x00,0x3f,0x80,0x3f,0xff,0xff,0xc0,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x03,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xe0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xf8,0x03,0x80,0x3f,0xff,0x1f,0xff,0xff,0xff,0xff,0x80,0x00,0x07,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x1f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xc3,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0xc0,0x00,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x0f,0xfc,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xe3,0xff,0x1f,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xf0,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xfc,0x00,0x3e,0x1f,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xe0,0x7f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0c,0x03,0x83,0xe0,0x00,0x00,0x06,0x0f,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf8,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x80,0x00,0x00,0x00,0x06,0x0f,0xfe,0x1f,0x8f,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x80,0x00,0x07,0x80,0x7f,0x8f,0xfe,0x1f,0x8f,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xc0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x01,0xc0,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xf8,0x00,0x3f,0x80,0x7f,0x8f,0xfe,0x3f,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,
+ 0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x03,0xff,0xc0,0x00,0x00,0x1f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xe3,0xff,0x83,0xff,0x8f,0xf8,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,
+ 0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,
+ 0x00,0x00,0x1f,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x1f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,
+ 0x00,0x00,0x3f,0xc0,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x3f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0x1f,0xff,0xff,0xff,0x80,0x1f,0xff,0x80,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,
+ 0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x00,
+ 0x00,0x00,0x3f,0xc6,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x7f,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x0f,0xff,0xff,0xff,0xc0,0x07,0xff,0x80,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x38,0x7f,0xff,0xff,0xff,0xff,0xff,0xfc,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x00,
+ 0x00,0x00,0xff,0xff,0x07,0xfe,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7f,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+ 0xf8,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xc0,0x00,0x3f,0xc0,0x3f,0xff,0xff,0xff,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,
+ 0x00,0x01,0xff,0xcf,0xff,0xfe,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,
+ 0x80,0x00,0x00,0x00,0x00,0x0f,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xfc,0x00,0x3f,0xf0,0x1f,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,
+ 0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0xff,0xc7,0xff,0xfe,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xc3,0x00,0x00,0x00,0x31,0x80,0x00,0x01,0xff,0xff,0xff,0xff,0x80,0x3f,0xf0,0x03,0xff,0xff,0xff,0xff,0xff,0x00,0x00,
+ 0x00,0x0c,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0xff,0xc6,0x3c,0x01,0xff,0xff,0xff,0xff,0x81,0xff,0xf0,0x00,0x3f,0xe6,0x0f,0xff,0xff,0x00,0x00,
+ 0x00,0x0f,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x01,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x0e,0x3f,0xfe,0x01,
+ 0x80,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xfe,0x03,0xf1,0xfc,0x60,0x3f,0xc0,0x07,0xff,0xfe,0x00,0x00,
+ 0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xfc,0x00,0x00,0x00,0x01,0x80,0x00,0x00,
+ 0x7f,0x81,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x3f,0xff,0xf9,
+ 0xe0,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x03,0xf1,0xff,0xf0,0x3f,0xc0,0x07,0xff,0xfe,0x00,0x00,
+ 0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x01,0x80,0x00,0x08,
+ 0x7f,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xf8,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x03,0xf1,0xff,0xf8,0x7f,0xc0,0x07,0xff,0xff,0xc0,0x00,
+ 0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x80,0xe3,0xff,
+ 0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x03,0xff,0xff,0xf8,0xff,0xc0,0x0f,0x0f,0xff,0xfc,0x00,
+ 0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xf8,0x03,0xc0,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xe0,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x1f,0x0f,0xff,0xff,0x00,
+ 0x00,0x03,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xfe,0x03,0xc3,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xf0,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x0f,0xff,0xff,0xc0,
+ 0x00,0x03,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x03,0xc3,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf0,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x0f,0xff,0xff,0xf8,
+ 0x00,0x01,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x03,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xfc,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x3f,0xff,0xff,0xf0,
+ 0x00,0x01,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x3f,0xff,0xff,0xe0,
+ 0x00,0x01,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0xc7,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfe,0x0f,0xff,0xff,0xc0,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xc0,0x7f,0xc0,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x1f,0xff,0xff,0xff,0x80,
+ 0x00,0x00,0x7f,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x7f,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xf8,0x0f,0xff,0xff,0xc0,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x80,0x3f,0x80,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0xff,0xff,0xfc,0x00,
+ 0x00,0x00,0x7f,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x7f,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xf8,0x0f,0xff,0xff,0xc3,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x80,0x07,0x00,0x00,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x3f,0x9f,0xff,0xfc,0x00,
+ 0x00,0x00,0x3f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xf8,0x0f,0xff,0xff,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,
+ 0x80,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x81,0xff,0xf0,0x00,0x07,0xff,0xfc,0x00,
+ 0x00,0x00,0x3f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xf8,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,
+ 0x80,0x00,0x04,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xff,0xf0,0x00,0x01,0xff,0xfe,0x00,
+ 0x00,0x00,0x1f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf1,
+ 0x80,0x00,0x04,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x03,0x00,0x00,0x00,0xff,0xfc,0x00,
+ 0x00,0x00,0x0f,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xfe,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x80,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x03,0x00,0x00,0x00,0x7f,0xf0,0x00,
+ 0x00,0x00,0x07,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xf8,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0x80,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x02,0x06,0x7f,0xf8,0x03,0xe0,0x00,
+ 0x00,0x00,0x01,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xf0,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x01,
+ 0x80,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x06,0x3f,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xf0,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x01,
+ 0x80,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x3f,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x7f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xf0,0x07,0xff,0xff,0xcf,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0f,0xff,0xff,0xff,0x00,0x01,
+ 0x80,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x3f,0xff,0xe0,0x00,0x00,
+ 0x00,0x00,0x00,0x01,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xf0,0x07,0xff,0xff,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0f,0xff,0xff,0xfc,0x00,0x01,
+ 0x80,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x3f,0xff,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xf0,0x01,0xff,0x1f,0xc7,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x07,0xff,0xf8,0xe0,0x00,0x01,
+ 0x80,0x00,0x00,0x06,0x3f,0xff,0xff,0xff,0xf0,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x3f,0xff,0xf0,0x06,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xfe,0x00,0x3f,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x07,0xfe,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x0f,0xff,0xff,0x87,0x80,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x3f,0xff,0xf0,0x07,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xfe,0x00,0x3f,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x07,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x01,0xff,0xff,0x80,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x7f,0xff,0xf8,0x0f,0x80,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xf0,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x02,0x00,0x1f,0x80,0x0f,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x07,0xff,0x80,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x7f,0xff,0xfe,0x3f,0xc0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0xff,0xe0,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x1f,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x01,0xff,0x80,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x07,0x80,0xff,0xe0,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x7f,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x01,0xff,0xe0,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x7f,0xe0,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x01,0xff,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x01,0xe1,0xe0,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xf0,0x00,0x00,0x08,0x7f,0xe0,0x03,0x9f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x03,0xff,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x07,0xc0,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x0f,0xff,0xff,0xff,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x38,0x3f,0xc0,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x0f,0xff,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x0f,0xff,0xff,0xff,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x78,0x1f,0xc0,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x1f,0xff,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x0f,0xff,0xff,0xff,0xf8,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x00,0x78,0x1c,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x1f,0xff,0x80,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x03,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x1f,0xff,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xf0,0x00,0x00,0x38,0x5c,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x1f,0xff,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x7f,0xff,0xff,0xff,0xff,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe3,0xf8,0x00,0x00,0x38,0x40,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x1f,0xff,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf0,0x78,0x00,0x00,0x38,0x40,0x06,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x1f,0xff,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x81,0xff,0xff,0xff,0xff,0xff,
+ 0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xe0,0x7e,0x00,0x00,0x3f,0xf0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0x80,0x00,0x00,0x00,0x1f,0xf8,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0x3f,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0x3f,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x0f,0xf0,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe1,0xff,0x80,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x0f,0xc0,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xe1,0xff,0xe0,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x0f,0x80,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x01,0xff,0xe0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xe0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xe3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xe3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0x80,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xc3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf0,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,
+ 0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,
+ 0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,
+ 0x07,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,
+ 0x0f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,
+ 0x1f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x7f,0xff,0xff,0xff,0xff,0xfc,0x00,
+ 0x1f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x1f,0xff,0xff,0xff,0xff,0xfc,0x00,
+ 0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x1f,0xff,0xff,0xff,0xff,0xfc,0x00,
+ 0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x1f,0xff,0xff,0xff,0xff,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0x00,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x02,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x87,0xe0,0xff,0xff,0xfe,0x00,0x3f,0xfe,
+ 0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0xff,0xff,0xff,0xff,0x06,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x03,0xe0,0xff,0xff,0xf8,0x00,0x3f,0xf8,
+ 0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0f,0xff,0xff,0xff,0xff,0xf8,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xc7,0xff,0xff,0xff,0xfe,0x01,0xe1,0xff,0xff,0xf0,0x00,0x3f,0xf0,
+ 0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0f,0xff,0xff,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xc0,0xff,0xff,0xff,0xf8,0x01,0xc1,0xff,0xff,0xf0,0x03,0xff,0xf0,
+ 0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x3f,0xff,0xff,0xff,0x1e,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xc0,0xff,0xff,0xff,0xf8,0x00,0x00,0x7f,0xff,0xf0,0x07,0xff,0xf0,
+ 0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x3f,0xff,0xff,0xf8,0x1e,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0x87,0xc0,0x7f,0xff,0xff,0xf8,0x00,0x00,0x1f,0xff,0xf0,0x0f,0xff,0xf0,
+ 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x07,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xe0,0x08,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x07,0xff,0xfe,0x03,0xf8,0x3f,0xff,0xff,0xf0,0x00,0x00,0x07,0xff,0xf8,0x07,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x07,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xfe,0x0c,0x03,0xf8,0x0f,0xff,0xff,0xe0,0x00,0x00,0x03,0xff,0xf8,0x07,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x1f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xfe,0x00,0x01,0xfc,0x03,0xff,0xff,0xe0,0x00,0x00,0x00,0xff,0xf8,0x01,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x3f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xfe,0x00,0x30,0x7c,0x00,0xff,0xff,0xe0,0x00,0x00,0x00,0xff,0xfc,0x00,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x71,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xfe,0x00,0x30,0x3f,0x80,0x7f,0xff,0xe0,0x03,0xe0,0x00,0xff,0xfe,0x00,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xf8,0x00,0x30,0x1f,0xc0,0x7f,0xff,0xf0,0x0f,0xf8,0x00,0xff,0xff,0x00,0x1f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xc0,0x00,0x30,0x03,0xf0,0x7f,0xf3,0xf0,0xff,0xff,0x3f,0xff,0xff,0x80,0x1f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0x80,0x00,0x30,0x00,0xf0,0x7f,0xc0,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0x80,0x00,0x30,0x00,0x70,0x3f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0x00,0x00,0x30,0x00,0x30,0x1f,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x3c,0x7f,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0x00,0x00,0x30,0x00,0x30,0x0f,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x30,0x3f,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x07,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x3f,0x80,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x3f,0x80,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xfe,0x00,0x00,0x00,0x1f,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x3f,0xc0,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xf8,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf9,0xc0,0x0f,0xe0,0x00,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf0,0x00,0x00,0x1c,0x03,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xe0,0x3f,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x0f,0xe0,0x00,0x07,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x1f,0xff,0xfc,0x00,0x00,0x00,0x00,0x03,0x8f,0x8f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x0f,0xe0,0x00,0x3f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xe1,0xff,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x7f,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x07,0xe0,0x00,0x3f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x81,0xff,0x04,0x3f,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x03,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x07,0xe0,0x03,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x81,0xff,0x04,0x3f,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xc7,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x07,0xe0,0x3f,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xcf,0xff,0x81,0xff,0x04,0x3f,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x07,0x00,0x7f,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xf1,0xff,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x01,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x01,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x0f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x0f,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x0f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0x80,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x3f,0xf8,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x3f,0xff,0x80,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x79,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x39,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x3f,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xfc,0x07,0x80,0x03,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x0f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x07,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0x01,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xff,0xff,0xff,0x80,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xf3,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x0f,0xff,0xff,0xff,0xc0,0x3c,0x7f,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe1,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x07,0xff,0xff,0xff,0xc0,0x00,0x7f,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0xff,0xc0,0x00,0x7f,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x83,0xff,0xff,0xff,0xf8,0x02,0x07,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x3f,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xff,0xf8,0x07,0x00,
+ 0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x3f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xff,0xf8,0x0f,0x00,
+ 0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x1f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x7f,0xff,0xff,0xf8,0x1f,0x80,
+ 0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x0f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x3f,0xff,0xff,0xff,0xff,0xe0,
+ 0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x07,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x3f,0xff,0xff,0xff,0xff,0xf8,
+ 0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0x00,0x00,0x00,0x03,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x1f,0xff,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x00,0x00,0x00,0x0f,0xff,0xc0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x1f,0xff,0xff,0xff,0xff,0xfe,
+ 0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0x00,0x00,0x00,0x08,0x3f,0xe0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0xff,0xff,0xff,0xff,0xfe,
+ 0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0x1f,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x80,0x00,0x1e,0x00,0x03,0xf0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0xff,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xc0,0x0f,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x80,0x00,0xfe,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1f,0xff,0xff,0xff,0xff,0xf8,
+ 0x00,0x00,0x07,0xff,0xff,0xff,0xff,0x80,0x0f,0xff,0xff,0xff,0xf0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x01,0xfe,0x00,0x00,0x3f,0x80,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x0f,0xff,0xff,0xff,0xff,0xf0,
+ 0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0x80,0x0f,0xff,0xff,0xff,0xe0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xc0,0x01,0xfc,0x00,0x00,0x1f,0x80,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x07,0xff,0xff,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0x00,0x07,0xff,0xff,0xff,0xc0,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xe0,0x01,0xfc,0x00,0x00,0x00,0x0f,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x01,0xff,0xff,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x3f,0xff,0xff,0xfc,0x00,0x01,0xff,0xff,0xff,0x80,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xf0,0x03,0xfc,0x00,0x00,0x00,0x0f,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x01,0xff,0xff,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x3f,0xff,0xff,0xf8,0x00,0x01,0xff,0xff,0xff,0x81,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xf0,0x07,0xfc,0x00,0x00,0x00,0x0f,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x01,0xff,0xff,0xff,0xff,0x80,
+ 0x00,0x00,0x00,0x1f,0xff,0xff,0xf0,0x00,0x00,0xff,0xff,0xff,0x81,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xf0,0x00,0x00,0x30,0x3f,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x1f,0xff,0xff,0xe0,0x00,0x00,0x7f,0xff,0xff,0x80,0xc0,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xf0,0x00,0x00,0x38,0x01,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0xff,0xff,0xff,0xff,0x00,
+ 0x00,0x00,0x00,0x1f,0xff,0xff,0xc0,0x00,0x00,0x7f,0xff,0xff,0xc0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x3f,0xff,0xff,0xf8,0x00,
+ 0x00,0x00,0x00,0x1f,0xff,0xff,0x80,0x00,0x00,0x7f,0xff,0xff,0xc0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x3f,0xff,0xff,0xf8,0x00,
+ 0x00,0x00,0x00,0x0f,0xff,0xfe,0x00,0x00,0x00,0x7f,0xff,0xff,0xe0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x1f,0xff,0xff,0x80,0x00,
+ 0x00,0x00,0x00,0x0f,0xff,0xfe,0x00,0x00,0x00,0x7f,0xff,0xff,0xf0,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x1f,0xff,0xfe,0x00,0x00,
+ 0x00,0x00,0x00,0x0f,0xff,0xf8,0x00,0x00,0x00,0x70,0xff,0xff,0xf8,0x00,0x00,0x00,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x1f,0xff,0xfe,0x00,0x00,
+ 0x00,0x00,0x00,0x0f,0xff,0xe0,0x00,0x00,0x00,0x00,0xff,0xff,0xfc,0x00,0x00,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x1f,0xff,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x07,0xff,0xc0,0x00,0x00,0x00,0x00,0xff,0xff,0xfe,0x00,0x00,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x1f,0xff,0xe0,0x00,0x00,
+ 0x00,0x00,0x00,0x07,0xff,0xc0,0x00,0x00,0x00,0x00,0xff,0xff,0xfe,0x00,0x00,0x01,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x1f,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x03,0xff,0xc0,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x1f,0xfe,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x03,0xff,0xc0,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x01,0xff,0xc0,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0x00,0x00,0x00,0xe6,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x01,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x00,0x00,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x01,0xff,0xc0,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x00,0x00,0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xfc,0x00,0x00,0x01,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xc0,0x00,0x00,0x00,0x00,0x30,0x7f,0xff,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xfc,0x00,0x00,0x03,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0xff,0xc0,0x00,0x00,0x00,0x00,0x30,0x1f,0xff,0x00,0x00,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x0f,0xfc,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x70,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x7f,0xc0,0x00,0x00,0x00,0x00,0x30,0x1f,0xfe,0x00,0x00,0x00,0x1c,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0xff,0xfe,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x0f,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x7f,0xc0,0x00,0x00,0x00,0x00,0x20,0x0f,0xfc,0x00,0x00,0x00,0x1c,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x01,0xff,0xff,0xe0,0xc0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x3f,0xc0,0x00,0x00,0x00,0x00,0x20,0x03,0xe0,0x00,0x00,0x00,0x0f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7e,0x00,0x01,0xff,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x3f,0xc0,0x00,0x00,0x00,0x00,0x20,0x01,0xc0,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x01,0xff,0xff,0xff,0xf8,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x3f,0xc0,0x00,0x00,0x00,0x00,0x20,0x01,0xc0,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x87,0xc3,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x1e,0x30,0x00,0x00,0x00,0x00,0x60,0x01,0x80,0x00,0x00,0x00,0x07,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x1c,0x30,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x00,0x07,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xfc,0x7f,0xff,0xff,0xff,0xff,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x08,0x38,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x07,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x7f,0xff,0xff,0xff,0xff,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x18,0x00,0x00,0x00,0x00,0x00,0x0f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0x3f,0xff,0xff,0xff,0xff,
+ 0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,
+ 0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x3c,0x00,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x00,0x00,0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x38,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x01,0xc0,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xe0,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x00,0x07,0xc0,0x00,0x00,0x01,0xc0,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0x80,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xe0,0x00,0x00,0x03,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xfc,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x03,0xf0,0x00,0x00,0x03,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x10,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x03,0xf0,0x00,0x00,0x1f,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x83,0xf0,0x00,0x00,0x3f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xc3,0xf0,0x00,0x00,0x7f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe3,0xf0,0x00,0x00,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xf0,0x00,0x01,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xf8,0x00,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf8,0x00,0x07,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf8,0x00,0xff,0xff,0xf0,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xe0,0x00,0xff,0xff,0xf0,0x40,0xc1,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xe0,0x00,0xff,0xff,0xe1,0xff,0x81,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf0,0x00,0xff,0xff,0xc1,0x87,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xf0,0x00,0xff,0xff,0xc1,0x86,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xf0,0x00,0x7f,0xff,0xc1,0x86,0x00,0x00,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0x80,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xf8,0x00,0x3f,0xff,0x83,0xfc,0x00,0x01,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xff,0x80,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x00,0x3f,0xff,0x03,0xf8,0x00,0x01,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xfe,0x00,0x3f,0xff,0x03,0xf0,0x00,0x00,0xf8,0x0f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xf0,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xfe,0x00,0x3f,0xff,0x07,0xf0,0x00,0x00,0x78,0x3f,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x80,0x1f,0xff,0x07,0xf0,0x00,0x00,0x3e,0x7f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x80,0x00,0x7e,0x07,0xf0,0x0f,0xfc,0x3f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x80,0x00,0x1e,0x03,0xf0,0x0c,0x04,0x3f,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x80,0x00,0x08,0x03,0xf8,0x00,0x00,0x13,0xff,0xff,0xf0,0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x80,0x00,0x00,0x03,0xf8,0x00,0x00,0x00,0xff,0xff,0xfc,0x00,0x38,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x03,0x8c,0x00,0x00,0x00,0x1f,0xff,0xfc,0x00,0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x03,0x88,0x00,0x00,0x00,0x07,0xff,0xfe,0x01,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0x8f,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x03,0xff,0xff,0xe1,0x80,0x30,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3e,0x18,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xe0,0x00,0x10,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xc3,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xc0,0x18,0x00,0x00,0x00,0x1f,0x81,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xc7,0xc0,0x78,0x00,0x00,0x00,0x0f,0x80,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0xe0,0x00,0x00,0x00,0x00,0x00,0x7c,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x81,0xc0,0x00,0x00,0x00,0x00,0x00,0x3e,0x00,0x00,0x08,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x81,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xf8,0x00,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xe0,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x01,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xc0,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x01,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xc0,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x03,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0x80,0x07,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x03,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0e,0x1f,0xff,0x80,0x07,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x07,0xc0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0x1f,0xff,0x80,0x07,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x0f,0xe0,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0x80,0x07,0xf8,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x1f,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xc0,0x0f,0xf8,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x7f,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xf0,0x0f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x03,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xf8,0x0f,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x03,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xfe,0x0f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x07,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0x1f,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x07,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x03,0xff,0x80,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x61,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x03,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x03,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x03,0xff,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x03,0xfe,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x03,0xfe,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x07,0xfe,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x07,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x0f,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x0f,0xfc,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x0f,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x07,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x07,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x07,0xf8,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x07,0xf0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x07,0xf0,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,
+ 0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x01,0x80,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0x80,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xe0,0x00,0x0f,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,
+ 0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xc0,0x00,0x07,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,
+ 0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,
+ 0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xfe,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xfe,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,
+ 0xff,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xf0,0x00,0x00,0x00,0x00,0x8f,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x40,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x18,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,
+ 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,
+ 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,
+ 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,
+ 0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x21,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,
+ 0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xe1,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,
+ 0xe0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xc7,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xe1,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xf0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xc1,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xe0,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x08,0x20,0x00,0x00,0x00,0x00,0x00,0x02,0x0e,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xe0,0x00,0x00,0x00,0x00,0x00,0x07,0xc0,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0xff,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x00,0x00,0x0f,0xc0,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0xff,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xe0,0x00,0x00,0x00,0x00,0x00,0x0f,0x80,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xff,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xc0,0x00,0x00,0x00,0x00,0x00,0x3f,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x23,0xff,0xfc,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x7f,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xf8,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xfe,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xf8,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xf8,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xf0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xf0,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xc0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf0,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0x80,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xe0,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x80,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xe0,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x80,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0x80,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xc0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xf0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xf0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xe0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0x80,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfe,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xf8,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xc0,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,
+ 0xc0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x1c,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x0f,0xff,0xfc,0x00,0x03,0xe0,0x00,0x20,0x00,0x06,0x03,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xfe,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x03,0x81,0xf8,0x00,0x1f,0xff,0xff,0xf0,0x0f,0xff,0x00,0x38,0xfe,0x0f,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0x00,
+ 0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xfe,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0xff,0xff,0x0f,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xf8,
+ 0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,
+ 0xff,0xe0,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf8,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xfe,0x70,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xc0,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfe,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf3,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x00,0x03,0x00,0x00,0x00,0x01,0xff,0xf0,0x0f,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xfe,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3f,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xc0,0x00,0x00,0x1f,0xfe,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xc0,0x00,0x00,0x00,0x00,0x00,0xe7,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0x9f,0xfc,0x00,0x00,0x18,0xe7,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe7,0xff,0xff,0xff,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x80,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xe0,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x0f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xfc,0x1f,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc0,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc3,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfe,
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x1f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xfe,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xf0,0x00,0x00,0x00,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xe0,0x00,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x00,0x7f,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xc0,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x10,0x00,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xf0,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf8,0x3f,0x80,0x00,0x01,
+ 0x80,0x00,0x00,0x00,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xf0,0x07,0xc0,0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xc1,
+ 0xf0,0x00,0x00,0x00,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+ 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
+};
diff --git a/src/shell/alertas.cpp b/src/shell/alertas.cpp
index 86e301d..1d9a64b 100644
--- a/src/shell/alertas.cpp
+++ b/src/shell/alertas.cpp
@@ -13,6 +13,7 @@
// com o id dele, sem depender do idioma). Três botões (Sim/Não/Cancelar...) ficam empilhados, como no Mac.
// As de programas elevados ficam com o Windows.
#include "shell.h"
+#include "../comum/semaforo.h"
#include <UIAutomation.h>
#include <dwmapi.h>
#include <shlwapi.h>
@@ -22,7 +23,9 @@
namespace {
-const float AW = 260, APAD = 20, AICON = 64, ABTN = 28, AGAP = 8, RADIUS = 12;
+float AlertWidth();
+#define AW AlertWidth()
+const float AW0 = 260, APAD = 20, AICON = 64, ABTN = 28, AGAP = 8, RADIUS = 12;
const UINT WM_AL_CHECK = WM_APP + 70, WM_AL_FRAME = WM_APP + 71;
double g_openAt; // a mola comum dos painéis ao aparecer
@@ -98,8 +101,20 @@ float TextH(const std::wstring& s, float size, DWRITE_FONT_WEIGHT w, float width
const float T_PAD = 20, T_TOP = 20, T_ICON = 32, T_BM = 16, T_BTN = 28, T_GAP = 6;
bool TahoeAlert() { return liquid::On(); }
int Buttons() { return g.single ? 1 : g.idThird ? 3 : 2; }
-float AlertR() { return TahoeAlert() ? 26.f : RADIUS; }
+// macOS 27 Golden Gate (Finder-Empty-Trash.png, 2x): 260 de largura, cantos 26; ícone de 64 no canto de cima à esquerda
+// (20, 17); título em negrito 13 e texto 13 alinhados à esquerda a 23 da borda, o título a ~100 do alto; botões em
+// cápsula de 27,5 LADO A LADO (110 cada, 8 entre eles, 16 das bordas), o padrão azul (0,122,255) à direita
+const float G_ICON = 64, G_IX = 20, G_IY = 17, G_PAD = 23, G_BTN = 27.5f, G_BM = 16, G_GAP = 8;
+bool GoldenAlert() { return liquid::Golden(); }
+// macOS 27, três botões (o "já existe" do Finder, captura Finder-Replace, 2x): janela opaca de 404 × 120 com os botões da
+// janela, o ícone de 32 a 20 / 36, o texto normal de 13 a 62 da borda e, embaixo à direita, três botões cinza de
+// 85,5 × 19,5 lado a lado (8,5 entre eles, 12,5 da borda e 13 de baixo): o terceiro, Cancelar e o de confirmar
+bool GoldenWide() { return GoldenAlert() && g.idThird; }
+float AlertWidth() { return GoldenWide() ? 404.f : AW0; }
+float AlertR() { return GoldenWide() ? 16.f : TahoeAlert() ? 26.f : RADIUS; }
float PanelH() {
+ if (GoldenWide()) return std::max(120.f, 34 + g.titleH + (g.infoH > 0 ? 2 + g.infoH : 0) + 14 + 19.5f + 13);
+ if (GoldenAlert()) { int n = Buttons(); int rows = n == 3 ? 3 : 1; return G_IY + G_ICON + 19 + g.titleH + (g.infoH > 0 ? 10 + g.infoH : 0) + 17 + rows * G_BTN + (rows - 1) * G_GAP + G_BM; }
if (TahoeAlert()) { int n = Buttons(); return T_TOP + T_ICON + 12 + g.titleH + (g.infoH > 0 ? 6 + g.infoH : 0) + 18 + n * T_BTN + (n - 1) * T_GAP + T_BM; }
return APAD + AICON + 12 + g.titleH + (g.infoH > 0 ? 6 + g.infoH : 0) + 16 + ABTN + (g.idThird ? 2 * (ABTN + AGAP) : 0) + APAD; }
@@ -163,6 +178,102 @@ void Paint() {
}
}
if (!g.icon && !g.px.empty()) g.icon = ui::Bitmap(dc, g.iw, g.ih, g.px);
+ if (GoldenWide()) {
+ D2D1_COLOR_F text = dark ? D2D1::ColorF(1, 1, 1, 0.92f) : D2D1::ColorF(0, 0, 0, 0.88f);
+ // botões da janela: só o do meio aceso (como na captura), os outros apagados
+ for (int k = 0; k < 3; k++) {
+ D2D1_POINT_2F c{ 16.f + k * 23, 16 };
+ br->SetColor(k == 1 ? D2D1::ColorF(0.996f, 0.737f, 0.18f) : (dark ? D2D1::ColorF(1, 1, 1, 0.20f) : D2D1::ColorF(0.86f, 0.86f, 0.86f)));
+ dc->FillEllipse(D2D1::Ellipse(c, 7, 7), br);
+ semaforo::Gloss(dc, c, 7, br);
+ }
+ if (g.icon) dc->DrawBitmap(g.icon, D2D1::RectF(20, 36, 52, 68), 1, D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC);
+ IDWriteTextFormat* ti = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_LEADING);
+ if (ti) ti->SetWordWrapping(DWRITE_WORD_WRAPPING_WRAP);
+ br->SetColor(text);
+ float y = 34;
+ if (ti) dc->DrawTextW(g.title.c_str(), (UINT32)g.title.size(), ti, D2D1::RectF(62, y, AW - 14, y + g.titleH), br);
+ y += g.titleH + 2;
+ if (ti && g.infoH > 0) dc->DrawTextW(g.info.c_str(), (UINT32)g.info.size(), ti, D2D1::RectF(62, y, AW - 14, y + g.infoH), br);
+ IDWriteTextFormat* tbtn = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ if (tbtn) tbtn->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+ const std::wstring* labels[3] = { &g.no, &g.yes, &g.third };
+ const int order[3] = { 2, 0, 1 }; // da esquerda: o terceiro (Manter Ambos), Parar/Cancelar, Substituir
+ float bw = 85.5f, gap = 8.5f, by = H - 13 - 19.5f, x = AW - 12.5f - 3 * bw - 2 * gap;
+ for (int k = 0; k < 3; k++, x += bw + gap) {
+ int i = order[k];
+ D2D1_RECT_F r = D2D1::RectF(x, by, x + bw, by + 19.5f);
+ g.btn[i] = r;
+ bool down = g.press == i && g.hover == i;
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, down ? 0.24f : g.hover == i ? 0.18f : 0.13f) : D2D1::ColorF(0, 0, 0, down ? 0.16f : g.hover == i ? 0.12f : 0.085f));
+ dc->FillRoundedRectangle(D2D1::RoundedRect(r, 5.5f, 5.5f), br);
+ if (g.focus == i) {
+ br->SetColor(D2D1::ColorF(0.04f, 0.52f, 1.0f, 0.55f));
+ dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left - 1.5f, r.top - 1.5f, r.right + 1.5f, r.bottom + 1.5f), 7, 7), br, 3);
+ }
+ br->SetColor(text);
+ if (tbtn) dc->DrawTextW(labels[i]->c_str(), (UINT32)labels[i]->size(), tbtn, r, br);
+ }
+ for (auto* f : { ti, tbtn }) if (f) f->Release();
+ br->Release();
+ ui::GpuEnd(g_s);
+ if (g_glass) backdrop::SetPieces(g_back, (float)wpx, (float)hpx, { { D2D1::RectF(0, 0, (float)wpx, (float)hpx), 16 * sc } },
+ dark ? D2D1::ColorF(0.16f, 0.16f, 0.17f, 0.98f) : D2D1::ColorF(1, 1, 1, 0.98f), 30.f); // opaca
+ anim::Panel mo = anim::PanelIn(anim::Now() - g_openAt);
+ ui::GpuMotion(g_s, mo.scale, wpx / 2.f, hpx / 2.f, mo.fade);
+ if (g_glass) backdrop::Fade(g_back, mo.fade, mo.scale, wpx / 2.f, hpx / 2.f);
+ return;
+ }
+ if (GoldenAlert()) {
+ D2D1_COLOR_F text = dark ? D2D1::ColorF(1, 1, 1, 0.92f) : D2D1::ColorF(0, 0, 0, 0.88f);
+ if (g.icon) dc->DrawBitmap(g.icon, D2D1::RectF(G_IX, G_IY, G_IX + G_ICON, G_IY + G_ICON), 1, D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC);
+ float y = G_IY + G_ICON + 19;
+ IDWriteTextFormat* tb = ui::Format(13, DWRITE_FONT_WEIGHT_BOLD, false, DWRITE_TEXT_ALIGNMENT_LEADING);
+ IDWriteTextFormat* ti = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_LEADING);
+ for (auto* f : { tb, ti }) if (f) f->SetWordWrapping(DWRITE_WORD_WRAPPING_WRAP);
+ br->SetColor(text);
+ if (tb) dc->DrawTextW(g.title.c_str(), (UINT32)g.title.size(), tb, D2D1::RectF(G_PAD, y, AW - G_PAD, y + g.titleH), br);
+ y += g.titleH + 10;
+ if (ti && g.infoH > 0) dc->DrawTextW(g.info.c_str(), (UINT32)g.info.size(), ti, D2D1::RectF(G_PAD, y, AW - G_PAD, y + g.infoH), br);
+ IDWriteTextFormat* tbtn = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ if (tbtn) tbtn->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+ const std::wstring* labels[3] = { &g.no, &g.yes, &g.third };
+ for (int i = 0; i < 3; i++) g.btn[i] = D2D1::RectF(0, 0, 0, 0);
+ float bottom = H - G_BM;
+ if (g.idThird) { // três: empilhados (confirmar, o terceiro, cancelar), de borda a borda
+ const int order[3] = { 1, 2, 0 };
+ for (int k = 0; k < 3; k++) { float y0 = bottom - (3 - k) * G_BTN - (2 - k) * G_GAP; g.btn[order[k]] = D2D1::RectF(G_BM, y0, AW - G_BM, y0 + G_BTN); }
+ } else if (g.single) g.btn[1] = D2D1::RectF(G_BM, bottom - G_BTN, AW - G_BM, bottom);
+ else {
+ float bw = (AW - 2 * G_BM - G_GAP) / 2;
+ g.btn[0] = D2D1::RectF(G_BM, bottom - G_BTN, G_BM + bw, bottom);
+ g.btn[1] = D2D1::RectF(G_BM + bw + G_GAP, bottom - G_BTN, AW - G_BM, bottom);
+ }
+ for (int i = 0; i < 3; i++) {
+ D2D1_RECT_F r = g.btn[i];
+ if (r.right <= r.left) continue;
+ bool down = g.press == i && g.hover == i;
+ float a = dark ? (down ? 0.22f : g.hover == i ? 0.17f : 0.12f) : (down ? 0.14f : g.hover == i ? 0.10f : 0.07f);
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, a) : D2D1::ColorF(0, 0, 0, a));
+ if (i == 1) br->SetColor(down ? D2D1::ColorF(0.0f, 0.40f, 0.86f, 1) : D2D1::ColorF(0.0f, 122 / 255.f, 1.0f, g.hover == i ? 0.92f : 1));
+ dc->FillRoundedRectangle(D2D1::RoundedRect(r, G_BTN / 2, G_BTN / 2), br);
+ if (g.focus == i && i != 1) {
+ br->SetColor(D2D1::ColorF(0.04f, 0.52f, 1.0f, 0.55f));
+ dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left - 1.5f, r.top - 1.5f, r.right + 1.5f, r.bottom + 1.5f), G_BTN / 2 + 1.5f, G_BTN / 2 + 1.5f), br, 3);
+ }
+ br->SetColor(i == 1 ? D2D1::ColorF(1, 1, 1, 1) : text);
+ if (tbtn) dc->DrawTextW(labels[i]->c_str(), (UINT32)labels[i]->size(), tbtn, r, br);
+ }
+ for (auto* f : { tb, ti, tbtn }) if (f) f->Release();
+ br->Release();
+ ui::GpuEnd(g_s);
+ if (g_glass) backdrop::SetPieces(g_back, (float)wpx, (float)hpx, { { D2D1::RectF(0, 0, (float)wpx, (float)hpx), R * sc } },
+ dark ? D2D1::ColorF(0.16f, 0.16f, 0.17f, 0.82f) : D2D1::ColorF(0.96f, 0.95f, 0.94f, 0.80f), 30.f);
+ anim::Panel mo = anim::PanelIn(anim::Now() - g_openAt);
+ ui::GpuMotion(g_s, mo.scale, wpx / 2.f, hpx / 2.f, mo.fade);
+ if (g_glass) backdrop::Fade(g_back, mo.fade, mo.scale, wpx / 2.f, hpx / 2.f);
+ return;
+ }
if (TahoeAlert()) {
D2D1_COLOR_F text = dark ? D2D1::ColorF(1, 1, 1, 0.92f) : D2D1::ColorF(0, 0, 0, 0.88f);
if (g.icon) dc->DrawBitmap(g.icon, D2D1::RectF(AW / 2 - T_ICON / 2, T_TOP, AW / 2 + T_ICON / 2, T_TOP + T_ICON), 1, D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC);
@@ -546,9 +657,9 @@ void TakeMessage(HWND dlg) {
}
void Show(int cx, int cy) {
- float inner = TahoeAlert() ? AW - 2 * T_PAD : AW - 2 * APAD;
- g.titleH = TextH(g.title, 13, DWRITE_FONT_WEIGHT_BOLD, inner);
- g.infoH = TextH(g.info, 11.f, DWRITE_FONT_WEIGHT_NORMAL, inner);
+ float inner = GoldenWide() ? AW - 62 - 14 : GoldenAlert() ? AW - 2 * G_PAD : TahoeAlert() ? AW - 2 * T_PAD : AW - 2 * APAD;
+ g.titleH = TextH(g.title, 13, GoldenWide() ? DWRITE_FONT_WEIGHT_NORMAL : DWRITE_FONT_WEIGHT_BOLD, inner);
+ g.infoH = TextH(g.info, GoldenAlert() ? 13.f : 11.f, DWRITE_FONT_WEIGHT_NORMAL, inner);
g.hover = g.press = -1;
g.focus = 1;
if (g.px.empty()) SetIcon(g.iconOf);
diff --git a/src/shell/ampliar.cpp b/src/shell/ampliar.cpp
index 9f1b61a..26595b2 100644
--- a/src/shell/ampliar.cpp
+++ b/src/shell/ampliar.cpp
@@ -224,6 +224,7 @@ void DrawChrome(ID2D1DeviceContext* dc, HWND h, UINT w, UINT hh, const std::vect
D2D1_POINT_2F p{ x0 + k * pitch, cap / 2 };
b->SetColor(on[k]);
dc->FillEllipse(D2D1::Ellipse(p, r, r), b);
+ semaforo::Gloss(dc, p, r, b);
b->SetColor(D2D1::ColorF(0, 0, 0, 0.12f));
dc->DrawEllipse(D2D1::Ellipse(p, r - 0.25f * sc, r - 0.25f * sc), b, 0.5f * sc);
}
diff --git a/src/shell/apps.cpp b/src/shell/apps.cpp
index 970ede1..38f8b67 100644
--- a/src/shell/apps.cpp
+++ b/src/shell/apps.cpp
@@ -399,14 +399,15 @@ static std::wstring Norm(const std::wstring& s) {
static std::wstring PackIconFor(const App& a) {
static std::map<std::wstring, std::wstring> pack; // nome normalizado -> arquivo
static int loaded = -1; // tema com que a lista foi montada (Tahoe usa icones\tahoe antes do Sequoia)
- if (loaded != (int)liquid::On()) {
- loaded = (int)liquid::On();
+ int tema = liquid::Golden() ? 2 : liquid::On() ? 1 : 0; // Golden Gate usa icones\goldengate antes do Tahoe
+ if (loaded != tema) {
+ loaded = tema;
pack.clear();
// icones\extra (ícones escolhidos pelo usuário, ex.: baixados do macOSicons.com) tem prioridade
// sobre o pacote do Sequoia; o nome do arquivo é o nome do app ("Discord.png", "Steam.png").
// Tema Tahoe: icones\tahoe (tools\baixar-icones.ps1) vem antes do Sequoia; o que faltar, segue o Sequoia
std::wstring root = shell::dir.substr(0, shell::dir.find_last_of(L'\\')) + L"\\icones";
- for (const wchar_t* sub : { L"\\extra", loaded ? L"\\tahoe" : L"", L"\\sequoia" }) {
+ for (const wchar_t* sub : { L"\\extra", loaded == 2 ? L"\\goldengate" : L"", loaded ? L"\\tahoe" : L"", L"\\sequoia" }) {
if (!*sub) continue;
std::wstring dir = root + sub;
if (std::wstring custom = shell::Setting(L"icones", L""); !custom.empty() && !wcscmp(sub, L"\\sequoia")) dir = custom;
diff --git a/src/shell/backdrop.cpp b/src/shell/backdrop.cpp
index a9065a9..c9c649d 100644
--- a/src/shell/backdrop.cpp
+++ b/src/shell/backdrop.cpp
@@ -1154,6 +1154,8 @@ void DrawPiece(ID2D1DeviceContext* dc, float ox, float oy, float sx, float sy, f
float dmax = std::min(H * 0.8f, 60 * px) * (0.4f + 1.0f * k);
float scale = 2 * dmax + 2;
// Transparência (vidro_tinta): 0 = quase nítido, 0,5 = o do Tahoe, 1 = bem fosco
+ // macOS 27 Golden Gate: mesmo no mínimo o vidro continua fosco (o controle vai de "quase transparente" a opaco;
+ // vídeo do MacVince e capturas do 512 Pixels: o fundo sempre aparece bem desfocado)
float sigma = std::max(0.6f + 11.f * st.tintK, minFrost) * px;
float m = 3 * sigma + dmax + 2;
ID2D1Effect *crop = Fx(dc, 0, CLSID_D2D1Crop), *blur = Fx(dc, 1, CLSID_D2D1GaussianBlur), *sat = Fx(dc, 2, CLSID_D2D1Saturation),
@@ -1228,7 +1230,7 @@ void DrawPiece(ID2D1DeviceContext* dc, float ox, float oy, float sx, float sy, f
}
{ // véu branco de 5% por dentro (rgba(255,255,255,0.05) do estudo; a referência é mais clara por dentro)
ID2D1SolidColorBrush* v = nullptr;
- dc->CreateSolidColorBrush(D2D1::ColorF(1, 1, 1, 0.05f * std::min(1.f, 2 * g_style.tintK)), &v); // some com a transparência no mínimo
+ dc->CreateSolidColorBrush(D2D1::ColorF(1, 1, 1, 0.05f * std::min(1.f, 2 * g_style.tintK)), &v); // some com a transparência no mínimo (no Golden Gate fica)
if (v) { dc->FillRectangle(D2D1::RectF(ox, oy, ox + w, oy + h), v); v->Release(); }
}
if (noise) { // ruído de 2,5%: some com os degraus de cor do desfoque
@@ -1336,6 +1338,7 @@ void backdrop::Reload() {
Style s;
s.liquid = shell::Setting(L"liquid_glass", L"0") == L"1";
s.tinted = shell::Setting(L"liquid_estilo", L"nitido") == L"tingido";
+ s.golden = s.liquid && shell::Setting(L"golden_gate", L"0") == L"1";
s.refraction = (float)_wtof(shell::Setting(L"liquid_refracao", L"0.6").c_str());
s.reduce = shell::Setting(L"reduzir_transparencia", L"0") == L"1";
s.tintK = (float)_wtof(shell::Setting(L"vidro_tinta", L"0.5").c_str());
@@ -1347,9 +1350,10 @@ void backdrop::Reload() {
// menus (barra de menus, Dock, Central): mais opacos que os painéis, para ler bem
ctxmenu::Glass mg;
mg.liquid = s.liquid && !s.reduce;
+ mg.golden = s.golden;
mg.alpha = [](float a) {
const auto& st = g_style;
- if (st.tintK < 0.5f) a *= 0.25f + 1.5f * st.tintK; // menus: no mínimo 25 % (texto legível)
+ if (st.tintK < 0.5f) a *= 0.25f + 1.5f * st.tintK; // menus: no mínimo 25 % (texto legível); Golden Gate 60 %
else a += (1 - a) * (st.tintK - 0.5f) * 1.4f;
if (st.reduce) return std::max(a, 0.97f);
if (st.liquid) a = st.tinted ? a + (1 - a) * 0.3f : a * 0.72f;
diff --git a/src/shell/barras.cpp b/src/shell/barras.cpp
index 2507872..f21ca93 100644
--- a/src/shell/barras.cpp
+++ b/src/shell/barras.cpp
@@ -297,6 +297,7 @@ void Pintar(Info& in) {
if (lit && in.press == k) { col.r *= 0.78f; col.g *= 0.78f; col.b *= 0.78f; }
b->SetColor(col);
rt->FillEllipse(D2D1::Ellipse(c, LR, LR), b);
+ semaforo::Gloss(rt, c, LR, b);
b->SetColor(D2D1::ColorF(0, 0, 0, 0.12f));
rt->DrawEllipse(D2D1::Ellipse(c, LR - 0.25f, LR - 0.25f), b, 0.5f);
if (!in.hover || !can[k]) continue;
diff --git a/src/shell/central.cpp b/src/shell/central.cpp
index 1eccf29..8fa5c8a 100644
--- a/src/shell/central.cpp
+++ b/src/shell/central.cpp
@@ -629,7 +629,11 @@ float PanelR() { return liquid::On() ? 26.f : RADIUS; } // Tahoe: painel bem ma
void Tile(ID2D1DeviceContext* dc, ID2D1SolidColorBrush* br, const Pal& p, D2D1_RECT_F r) {
if (liquid::On()) { // Tahoe: módulos em cápsulas de vidro (meia altura até 24 pt)
- liquid::Tile(dc, r, std::min((r.bottom - r.top) / 2, 24.f), ui::Dark());
+ float h = r.bottom - r.top, w = r.right - r.left, rad = std::min(h / 2, 24.f);
+ // macOS 27 (captura 2x do 512 Pixels): mesma grade do Tahoe, cantos maiores nos botões (~27) e no Tocando
+ // Agora (~28), menores nas faixas de Tela e Som (~18)
+ if (liquid::Golden()) rad = w > 200 ? 18.f : h > 100 ? 28.f : std::min(h / 2, 27.f);
+ liquid::Tile(dc, r, rad, ui::Dark());
return;
}
br->SetColor(p.tile);
@@ -1117,7 +1121,8 @@ void PaintTahoe() {
dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(tr.left, tr.top, std::max(kx, tr.left + 5), tr.bottom), 2.5f, 2.5f), br);
};
drawTrack();
- { // o botão: pílula branca; arrastando vira lente (o mesmo do menu de som)
+ // macOS 27 (captura Finder-Control-Center): Tela e Som sem o botão; ele só aparece arrastando (vira lente)
+ if (!liquid::Golden() || g_kPress[track == H_BRIGHT ? 0 : 1] > 0.001f) { // o botão: pílula branca; arrastando vira lente (o mesmo do menu de som)
int ki = track == H_BRIGHT ? 0 : 1;
float pr = std::clamp(g_kPress[ki], 0.f, 1.f), grow = 1 + (KN_LENS - 1) * pr;
float kw = KN_W * grow * (1 + g_kStretch[ki]), kh = KN_H * grow * (1 - g_kStretch[ki] * 0.35f), krad = kh / 2;
diff --git a/src/shell/liquid.cpp b/src/shell/liquid.cpp
index 1dd4a1a..ac17350 100644
--- a/src/shell/liquid.cpp
+++ b/src/shell/liquid.cpp
@@ -7,6 +7,7 @@
#include "../comum/vidro.h"
bool liquid::On() { return backdrop::Current().liquid; }
+bool liquid::Golden() { return backdrop::Current().golden; }
// Contorno do Liquid Glass: a borda escurecida e o brilho especular (comum/vidro.h, o mesmo dos menus)
void liquid::Rim(ID2D1DeviceContext* dc, D2D1_RECT_F r, float rad, bool dark, float strength, float spec, float lx, float ly) {
diff --git a/src/shell/main.cpp b/src/shell/main.cpp
index 5a4d976..66b1b50 100644
--- a/src/shell/main.cpp
+++ b/src/shell/main.cpp
@@ -712,6 +712,12 @@ static LRESULT CALLBACK MsgProc(HWND h, UINT m, WPARAM w, LPARAM l) {
else if (w >= 3 && w <= 6) spotlight::OpenMode((int)w - 2);
else if (w == 7) spotlight::Toggle();
else if (w == 8) sobre::Show(); // Sobre Este Mac
+ else if (w == 9) central::Toggle(); // Central de Controle (testes)
+ else if (w == 10) notificacoes::Toggle(); // Central de Notificações (testes)
+ else if (w == 11) { // Quick Look de uma foto do macOS 27 (testes)
+ wchar_t p[MAX_PATH] = {}; GetEnvironmentVariableW(L"USERPROFILE", p, MAX_PATH);
+ quicklook::Toggle(std::wstring(p) + L"\\Pictures\\Wallpapers macOS\\macOS 27\\macos-27-golden-4096x2160-27635.jpg");
+ }
if (att) AttachThreadInput(me, ft, FALSE);
return 0;
}
@@ -729,6 +735,23 @@ static LRESULT CALLBACK MsgProc(HWND h, UINT m, WPARAM w, LPARAM l) {
mesa::WallpaperNow(p);
return TRUE;
}
+ if (m == WM_COPYDATA && l && ((COPYDATASTRUCT*)l)->dwData == 0x514C4F4B /*'QLOK'*/) { // Finder: Quick Look (vazio = fechar)
+ auto* cd = (COPYDATASTRUCT*)l;
+ if (cd->cbData > 8192) return FALSE;
+ std::wstring p = cd->lpData ? std::wstring((const wchar_t*)cd->lpData, cd->cbData / sizeof(wchar_t)) : L"";
+ while (!p.empty() && !p.back()) p.pop_back();
+ // responde já e abre logo depois: o vídeo leva mais que o tempo de espera do Finder (0,8 s), e ele achava
+ // que tinha falhado e abria também o painel antigo dele
+ auto* copy = new std::wstring(p);
+ PostMessageW(h, WM_APP + 77, 0, (LPARAM)copy);
+ return TRUE;
+ }
+ if (m == WM_APP + 77 && l) { // o Quick Look pedido pelo Finder (acima)
+ std::unique_ptr<std::wstring> p((std::wstring*)l);
+ if (p->empty()) quicklook::Close();
+ else quicklook::Toggle(*p, false); // o Finder fica com o foco
+ return 0;
+ }
if (m == WM_COPYDATA && l && ((COPYDATASTRUCT*)l)->dwData == 0x414D504C /*'AMPL'*/) { // MacJanela.dll: ampliar animado
struct Msg { unsigned long long hwnd; RECT from, to; int flags; COLORREF cap; };
auto* cd = (COPYDATASTRUCT*)l;
@@ -767,7 +790,7 @@ static LRESULT CALLBACK MsgProc(HWND h, UINT m, WPARAM w, LPARAM l) {
if (m == reload && reload) { // o Ajustes do Sistema gravou ajustes.txt
g_macKeys = shell::Setting(L"atalhos_mac", L"1") == L"1";
static int lastLiquid = -1;
- if (lastLiquid < 0) lastLiquid = liquid::On();
+ if (lastLiquid < 0) lastLiquid = liquid::Golden() ? 2 : liquid::On();
LoadSettings();
static int lastEn = -1;
if (lastEn < 0) lastEn = idioma::En();
@@ -778,8 +801,8 @@ static LRESULT CALLBACK MsgProc(HWND h, UINT m, WPARAM w, LPARAM l) {
dock::IconsChanged();
Log(L"idioma: %ls", en ? L"en" : L"pt");
}
- if ((int)liquid::On() != lastLiquid) { // tema Sequoia/Tahoe: outro pacote de ícones (antes só ao reiniciar)
- lastLiquid = liquid::On();
+ if ((liquid::Golden() ? 2 : (int)liquid::On()) != lastLiquid) { // tema Sequoia/Tahoe/Golden Gate: outro pacote de ícones
+ lastLiquid = liquid::Golden() ? 2 : liquid::On();
for (auto& a : apps::list) { a.icon.clear(); a.iw = a.ih = 0; a.mac = false; }
dock::IconsChanged();
seletor::IconsChanged();
diff --git a/src/shell/menubar.cpp b/src/shell/menubar.cpp
index 1c37a54..7985932 100644
--- a/src/shell/menubar.cpp
+++ b/src/shell/menubar.cpp
@@ -32,6 +32,7 @@ const float PAD_SEQUOIA = 10; // espaço de cada lado de um ícone de status
// Tahoe (guia, seção 35): cada item da direita = o ícone + ~8 pt de respiro de cada lado (31–42 pt por item)
#define PAD (liquid::On() ? 8.f : PAD_SEQUOIA)
+bool g_overflow; // macOS 27: algum ícone da bandeja não coube na barra (mostra a »)
enum Kind { K_LOGO, K_APP, K_MENU, K_TRAY, K_NET, K_SPOT, K_CC, K_CLOCK, K_MORE, K_BATT, K_SOUND, K_BT, K_INPUT };
struct Hit { D2D1_RECT_F r; Kind kind; int index; };
@@ -130,6 +131,7 @@ const KeyCmd g_keyCmds[] = {
{ 1040, L"Voltar", L"Alt+←", { VK_MENU, VK_LEFT } },
{ 1041, L"Avançar", L"Alt+→", { VK_MENU, VK_RIGHT } },
{ 1042, L"Pasta Superior", L"Ctrl+↑", { VK_CONTROL, VK_UP } },
+ { 1043, L"Ir para a Pasta…", L"Ctrl+Shift+G", { VK_CONTROL, VK_SHIFT, 'G' } },
{ 1050, L"Ajuda", L"F1", { VK_F1 } },
{ 1051, L"Ajustes…", L"Ctrl+,", { VK_CONTROL, VK_OEM_COMMA } },
// menus próprios dos apps sem menu Win32 (AppMenus): os atalhos do Windows de cada um
@@ -704,8 +706,36 @@ void Render() {
if (g_st.batt && shell::Setting(L"barra_bateria", L"1") == L"1") {
const wchar_t* name = g_st.charging ? L"battery.100percent.bolt" : g_st.pct > 87 ? L"battery.100percent" : g_st.pct > 62 ? L"battery.75percent"
: g_st.pct > 37 ? L"battery.50percent" : g_st.pct > 12 ? L"battery.25percent" : L"battery.0percent";
+ if (liquid::Golden()) {
+ // macOS 27 (vídeo do MacVince, 2:44): a porcentagem DENTRO do ícone — corpo cheio de 25 × 12 com canto 4,
+ // o número vazado (e o raio quando carrega) e a ponta à direita
+ auto bx = slot(29, K_BATT, 0);
+ float cy = H / 2;
+ D2D1_RECT_F body = D2D1::RectF(bx.left, cy - 6, bx.left + 25, cy + 6);
+ rt->FillRoundedRectangle(D2D1::RoundedRect(body, 4, 4), br);
+ rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(body.right + 1, cy - 2.5f, body.right + 2.8f, cy + 2.5f), 1, 1), br);
+ static IDWriteTextFormat* tfB = ui::Format(9.5f, DWRITE_FONT_WEIGHT_BOLD, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ wchar_t num[8]; swprintf_s(num, L"%d", std::clamp(g_st.pct, 0, 100));
+ br->SetColor(dark ? D2D1::ColorF(0.15f, 0.13f, 0.12f, 0.92f) : D2D1::ColorF(1, 1, 1, 0.95f));
+ D2D1_RECT_F tr = D2D1::RectF(body.left, body.top - 0.5f, body.right - (g_st.charging ? 6.f : 0.f), body.bottom - 0.5f);
+ if (tfB) { tfB->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); rt->DrawTextW(num, (UINT32)wcslen(num), tfB, tr, br); }
+ if (g_st.charging) { // raio
+ float bx0 = body.right - 6.5f;
+ ID2D1PathGeometry* g = nullptr;
+ if (SUCCEEDED(ui::d2d->CreatePathGeometry(&g))) {
+ ID2D1GeometrySink* sk = nullptr; g->Open(&sk);
+ sk->BeginFigure({ bx0 + 2.6f, cy - 4.5f }, D2D1_FIGURE_BEGIN_FILLED);
+ D2D1_POINT_2F pts[] = { { bx0, cy + 0.6f }, { bx0 + 1.9f, cy + 0.6f }, { bx0 + 1.1f, cy + 4.5f }, { bx0 + 3.8f, cy - 0.8f }, { bx0 + 1.9f, cy - 0.8f } };
+ sk->AddLines(pts, 5); sk->EndFigure(D2D1_FIGURE_END_CLOSED); sk->Close(); sk->Release();
+ rt->FillGeometry(g, br);
+ g->Release();
+ }
+ }
+ br->SetColor(fgc);
+ } else {
auto bx = slot(27, K_BATT, 0);
sym(name, bx, 13);
+ }
}
// Som e Bluetooth: no Mac ficam fora da barra por padrão (Ajustes > Central de Controle liga)
if (g_st.sound && shell::Setting(L"barra_som", L"0") == L"1") {
@@ -734,7 +764,7 @@ void Render() {
for (int i = (int)tray::icons.size() - 1; i >= 0; i--) {
auto& t = tray::icons[i];
if (t.hidden || !t.icon || !IsShown(t)) continue;
- if (r - 37 < leftEnd + 60) break; // sem espaço: some, como no Mac
+ if (r - 37 < leftEnd + 60) { g_overflow = true; break; } // sem espaço: some, como no Mac (macOS 27: aparece a »)
auto bx = slot(17, K_TRAY, i);
std::vector<BYTE> mono = IconPixels(t.icon, px);
// como os ícones-modelo do Mac: uma cor só, a mesma do texto da barra (branco no escuro, preto no claro);
@@ -773,6 +803,18 @@ void Render() {
}
bool anyHidden = false;
for (auto& t : tray::icons) if (!t.hidden && t.icon && !IsShown(t)) anyHidden = true;
+ if (liquid::Golden() && (g_overflow || anyHidden)) {
+ // macOS 27 (vídeo, 2:16): quando os ícones não cabem, uma seta dupla » mostra os escondidos
+ auto bx = slot(14, K_MORE, 0);
+ float cx = (bx.left + bx.right) / 2, cy = H / 2;
+ for (int k = 0; k < 2; k++) {
+ float ox = cx - 3.5f + k * 5.5f;
+ rt->DrawLine({ ox - 2.2f, cy - 4.5f }, { ox + 2.2f, cy }, br, 1.5f);
+ rt->DrawLine({ ox + 2.2f, cy }, { ox - 2.2f, cy + 4.5f }, br, 1.5f);
+ }
+ anyHidden = false; // já desenhada
+ }
+ g_overflow = false;
// setinha dos ícones guardados: não existe no Mac, desligada por padrão (barra_seta=1 liga); a lista abre
// também no botão direito da Central de Controle
if (anyHidden && shell::Setting(L"barra_seta", L"0") == L"1") { // setinha dos ícones guardados: o chevron do SF Symbols, apontando para onde eles abrem
@@ -906,7 +948,7 @@ std::vector<ctxmenu::Item> GenericMenu(const std::wstring& title, App* app) {
}
if (title == Tr(L"Editar")) return { K(1010), K(1011), Sep(), K(1012), K(1013), K(1014), K(1015), Sep(), K(1016) };
if (title == Tr(L"Visualizar")) return { K(1030), K(1031), K(1032), K(1033), Sep(), K(1034) };
- if (title == Tr(L"Ir")) return { K(1040), K(1041), K(1042), Sep(), I(Tr(L"Recentes"), 1100), I(Tr(L"Documentos"), 1101), I(Tr(L"Mesa"), 1102), I(Tr(L"Downloads"), 1103), I(Tr(L"Início"), 1104), I(Tr(L"Este Computador"), 1105), I(Tr(L"Aplicativos"), 1106) };
+ if (title == Tr(L"Ir")) return { K(1040), K(1041), K(1042), Sep(), K(1043), Sep(), I(Tr(L"Recentes"), 1100), I(Tr(L"Documentos"), 1101), I(Tr(L"Mesa"), 1102), I(Tr(L"Downloads"), 1103), I(Tr(L"Início"), 1104), I(Tr(L"Este Computador"), 1105), I(Tr(L"Aplicativos"), 1106) };
if (title == Tr(L"Janela")) {
std::vector<ctxmenu::Item> v{ I(Tr(L"Minimizar"), 1200), I(Tr(L"Zoom"), 1201), Sep(), I(Tr(L"Trazer Tudo para a Frente"), 1202) };
v.insert(v.begin(), pre.begin(), pre.end());
@@ -1028,6 +1070,7 @@ void Run(int id, App* app) {
}
}
+int g_closedHit = -1; DWORD g_closedHitAt; // o título cujo menu acabou de fechar (clicar nele de novo só fecha)
void ShowAt(int hit, const std::vector<ctxmenu::Item>& items, std::function<void(int)> done) {
g_open = hit;
g_openBar = Cur();
@@ -1039,6 +1082,7 @@ void ShowAt(int hit, const std::vector<ctxmenu::Item>& items, std::function<void
if (liquid::On()) pt = { wr.left + (LONG)std::lround((g_hits[hit].r.left + 6) * sc), wr.bottom + (LONG)std::lround(sc) };
SetForegroundWindow(g_owner); // o menu fecha se a janela dona não estiver na frente
int id = ctxmenu::ShowItems(g_owner, pt, items);
+ g_closedHit = hit; g_closedHitAt = GetTickCount();
g_open = -1;
Render();
if (g_fg && IsWindow(g_fg)) SetForegroundWindow(g_fg);
@@ -1050,6 +1094,8 @@ void Click(D2D1_POINT_2F p, bool right) {
for (int i = 0; i < (int)g_hits.size(); i++)
if (p.x >= g_hits[i].r.left && p.x < g_hits[i].r.right) { hit = i; break; }
if (hit < 0) return;
+ if (!right && hit == g_closedHit && GetTickCount() - g_closedHitAt < 400) { g_closedHit = -1; return; } // clique no mesmo título: só fechou
+ g_closedHit = -1;
Hit h = g_hits[hit];
App* app = ActiveApp();
float sc = ui::Scale(Cur());
diff --git a/src/shell/menus.cpp b/src/shell/menus.cpp
index f98a0a6..923c6df 100644
--- a/src/shell/menus.cpp
+++ b/src/shell/menus.cpp
@@ -1,774 +1,786 @@
-// Menus do Windows no visual do Mac, em todos os programas, sem injetar nada:
-// 1. O Windows avisa (WinEvent, fora do processo) quando um menu nativo (#32768) abre.
-// 2. Lemos os itens pelo HMENU (MN_GETHMENU), tiramos a janela nativa da tela e mostramos a nossa.
-// 3. O mouse é nosso (gancho de mouse só enquanto há menu aberto); ao escolher, selecionamos o
-// mesmo item no menu nativo (MN_SELECTITEM) e mandamos Enter: o programa recebe o comando como
-// sempre recebeu, inclusive menus que esperam a resposta direta (TrackPopupMenu com TPM_RETURNCMD).
-// 4. O teclado continua indo para o menu nativo; acompanhamos o destaque pelo evento de foco.
-// Programas que desenham o próprio menu (Chrome, Electron, WinUI) não usam #32768 e ficam como estão.
-#include "shell.h"
-#include "../menu/context_menu.h"
-#include <dwmapi.h>
-#include <dcomp.h>
-#include <shellscalingapi.h>
-#include <algorithm>
-#include <cmath>
-#include <atomic>
-#include <mutex>
-#include <thread>
-
-namespace {
-
-const UINT MN_SELECT = 0x01E5; // MN_SELECTITEM (não documentada): destaca o item no menu nativo
-const ULONG_PTR KEY_MARK = 0x53484C4C; // o mesmo de main.cpp: teclas nossas não passam pelo gancho da tecla Windows
-const UINT T_SUBMENU = 1, T_SUBCHECK = 2, T_SCROLL = 3, T_CHOOSECHECK = 4, T_SHOWNOW = 5;
-const UINT MN_BTNDOWN = 0x01ED, MN_BTNUP = 0x01EF; // MN_BUTTONDOWN/UP (não documentadas): clique no item pela posição
-const UINT MN_OPENHIER = 0x01E3; // MN_OPENHIERARCHY (não documentada): abre o submenu do item destacado
-const UINT WM_MENU_MOVE = WM_APP + 1, WM_MENU_CLICK = WM_APP + 2, WM_MENU_WHEEL = WM_APP + 3, WM_MENU_SHOWNOW = WM_APP + 4, WM_HOOK_ON = WM_USER + 1, WM_HOOK_OFF = WM_USER + 2;
-
-struct Item {
- int pos; // posição no menu nativo
- std::wstring label, shortcut;
- bool sep = false, disabled = false, checked = false, radio = false, sub = false;
- wchar_t icon = 0; // Tahoe: símbolo à esquerda (pelo nome do item)
- D2D1_RECT_F r{};
-};
-
-struct Level {
- HWND native = nullptr;
- HMENU menu = nullptr;
- HWND wnd = nullptr;
- HWND back = nullptr; // só o desfoque, atrás do menu
- ui::GpuSurface s; // GPU + desfoque nativo do Windows 11: sem destaque cortado ao meio
- bool glass = false; // o vidro de trás é o do Shell (cantos de 12 lisos, como o menu do Tahoe)
- bool clipped = false; // o desenho já tem o recorte arredondado
- std::vector<Item> items;
- int hover = -1;
- float w = 0, h = 0; // DIPs (h = altura de todos os itens)
- float textL = 21; // onde o texto começa (mais à direita com ícones)
- float view = 0; // altura visível: menor que h quando o menu não cabe na tela e rola, como no Mac
- float scroll = 0; // quanto já rolou (DIPs)
- float scale = 1;
-};
-
-std::vector<Level*> g_levels;
-HWINEVENTHOOK g_menuHook, g_focusHook, g_createHook;
-HHOOK g_mouse;
-HWND g_host; // janela de mensagens (timers)
-DWORD g_selfPid;
-IDWriteTextFormat *g_tf, *g_tfR, *g_tfIcon;
-int g_subWanted = -1; // item com submenu esperando o atraso para abrir
-// Submenu pedido ao nativo: se não abrir em 250 ms, tenta outros caminhos (alguns programas ignoram a tecla)
-Level* g_subFrom; int g_subIdx = -1, g_subTry;
-// Item escolhido esperando o programa aceitar: guardado pela janela nativa e posição (não pelo nível, que
-// pode ser apagado e outro nascer no mesmo endereço); o mouse mexendo para outro item cancela
-HWND g_chooseNative; int g_choosePos = -1, g_chooseIdx = -1, g_chooseTry;
-float g_scaleFmt;
-// O gancho de mouse roda numa thread só dele e não faz nada pesado: diz se o ponto está sobre um
-// menu nosso (retângulos copiados aqui), engole os cliques e avisa a janela principal. Trabalho
-// pesado dentro do gancho segura o cursor do sistema inteiro.
-std::mutex g_rmu;
-std::vector<RECT> g_rects;
-std::atomic<bool> g_movePending;
-DWORD g_hookTid;
-DWORD g_lastMouse; // última vez que o mouse mexeu (o foco do menu nativo só manda no teclado)
-
-Level* LevelOf(HWND native) {
- for (auto* l : g_levels) if (l->native == native) return l;
- return nullptr;
-}
-
-std::wstring Clean(const wchar_t* s, std::wstring* shortcut) {
- std::wstring out;
- for (const wchar_t* p = s; *p; p++) {
- if (*p == L'\t') { if (shortcut) *shortcut = p + 1; break; }
- if (*p == L'&') { if (p[1] == L'&') { out += L'&'; p++; } continue; }
- out += *p;
- }
- return out;
-}
-
-void ReadItems(Level& l) {
- l.items.clear();
- int n = GetMenuItemCount(l.menu);
- for (int k = 0; k < n; k++) {
- wchar_t buf[512] = {};
- MENUITEMINFOW mi{ sizeof(mi) };
- mi.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_SUBMENU | MIIM_STRING;
- mi.dwTypeData = buf; mi.cch = 511;
- if (!GetMenuItemInfoW(l.menu, k, TRUE, &mi)) continue;
- Item it; it.pos = k;
- if (mi.fType & MFT_SEPARATOR) {
- if (l.items.empty() || l.items.back().sep) continue; // sem separadores repetidos
- it.sep = true;
- } else {
- if (!buf[0]) continue; // desenhado pelo próprio programa, sem texto: fica de fora
- it.label = Clean(buf, &it.shortcut);
- it.disabled = (mi.fState & (MFS_DISABLED | MFS_GRAYED)) != 0;
- it.checked = (mi.fState & MFS_CHECKED) != 0;
- it.radio = (mi.fType & MFT_RADIOCHECK) != 0;
- it.sub = mi.hSubMenu != nullptr;
- }
- l.items.push_back(it);
- }
- while (!l.items.empty() && l.items.back().sep) l.items.pop_back();
-}
-
-void Formats(float scale) {
- if (g_tf && g_scaleFmt == scale) return;
- if (g_tf) { g_tf->Release(); g_tfR->Release(); }
- g_tf = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL);
- g_tfR = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_TRAILING);
- if (!g_tfIcon) {
- IDWriteFactory* dw = nullptr;
- if (SUCCEEDED(DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), (IUnknown**)&dw))) {
- dw->CreateTextFormat(L"Segoe Fluent Icons", nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 13, L"", &g_tfIcon);
- if (g_tfIcon) { g_tfIcon->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); g_tfIcon->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); }
- dw->Release();
- }
- }
- g_scaleFmt = scale;
-}
-
-// Medidas do menu do macOS: linhas de 22, 5 de folga em cima/embaixo, texto a 21 da borda (espaço
-// do ✓), destaque azul arredondado com 5 de margem, separador de 11.
-const float ROW = 22, SEP = 11, PADY = 5, TEXTL = 21, TEXTR = 14, INSET = 5;
-const float MENU_R = 12; // canto do menu (DIP), como o menu de contexto do Tahoe
-const float ARROW = 18; // faixa com a setinha em cima/embaixo de um menu que rola
-
-bool Scrolls(const Level& l) { return l.h > l.view + 0.5f; }
-float MaxScroll(const Level& l) { return std::max(0.f, l.h - l.view); }
-bool UpArrow(const Level& l) { return Scrolls(l) && l.scroll > 0.5f; }
-bool DownArrow(const Level& l) { return Scrolls(l) && l.scroll < MaxScroll(l) - 0.5f; }
-
-// Deixa o item à vista (teclado descendo um menu longo).
-void Reveal(Level& l, int i) {
- if (!Scrolls(l) || i < 0) return;
- float top = l.items[i].r.top - l.scroll, bot = l.items[i].r.bottom - l.scroll;
- if (top < ARROW) l.scroll -= ARROW - top;
- else if (bot > l.view - ARROW) l.scroll += bot - (l.view - ARROW);
- l.scroll = std::clamp(l.scroll, 0.f, MaxScroll(l));
-}
-
-void Measure(Level& l) {
- Formats(l.scale);
- float maxL = 0, maxS = 0;
- bool anySub = false, anyIcon = false;
- for (auto& it : l.items) {
- if (it.sep) continue;
- it.icon = backdrop::Liquid() ? ctxmenu::AutoIcon(it.label) : 0; // Tahoe: símbolo em cada item
- anyIcon |= it.icon != 0;
- maxL = std::max(maxL, ui::TextWidth(g_tf, it.label));
- if (!it.shortcut.empty()) maxS = std::max(maxS, ui::TextWidth(g_tf, it.shortcut));
- anySub |= it.sub;
- }
- l.textL = anyIcon ? 34.f : TEXTL;
- l.w = std::max(160.f, l.textL + maxL + (maxS > 0 ? 30 + maxS : 0) + (anySub ? 22 : 0) + TEXTR);
- bool tahoe = backdrop::Liquid(); // medidas do menu do Tahoe: linhas de 20, separador de 9, 6 de folga
- float pad = tahoe ? 6.f : PADY;
- float y = pad;
- for (auto& it : l.items) {
- float h = it.sep ? (tahoe ? 9.f : SEP) : (tahoe ? 20.f : ROW);
- it.r = D2D1::RectF(0, y, l.w, y + h);
- y += h;
- }
- l.h = y + pad;
- l.view = l.h;
-}
-
-void Paint(Level& l) {
- int wpx = (int)std::ceil(l.w * l.scale), hpx = (int)std::ceil(l.view * l.scale);
- auto* rt = ui::GpuBegin(l.s, wpx, hpx, l.scale);
- if (!rt) return;
- bool dark = ui::Dark();
- ID2D1SolidColorBrush* br = nullptr;
- rt->CreateSolidColorBrush(dark ? D2D1::ColorF(0.16f, 0.16f, 0.17f, 0.40f) : D2D1::ColorF(0.97f, 0.97f, 0.97f, 0.45f), &br);
- rt->FillRectangle(D2D1::RectF(0, 0, l.w, l.view), br);
- bool up = UpArrow(l), down = DownArrow(l);
- D2D1_MATRIX_3X2_F base; rt->GetTransform(&base);
- rt->PushAxisAlignedClip(D2D1::RectF(0, up ? ARROW : 0, l.w, l.view - (down ? ARROW : 0)), D2D1_ANTIALIAS_MODE_ALIASED);
- rt->SetTransform(D2D1::Matrix3x2F::Translation(0, -l.scroll) * base);
- D2D1_COLOR_F text = dark ? D2D1::ColorF(1, 1, 1, 0.92f) : D2D1::ColorF(0, 0, 0, 0.88f);
- D2D1_COLOR_F dim = dark ? D2D1::ColorF(1, 1, 1, 0.30f) : D2D1::ColorF(0, 0, 0, 0.28f);
- D2D1_COLOR_F gray = dark ? D2D1::ColorF(1, 1, 1, 0.45f) : D2D1::ColorF(0, 0, 0, 0.45f);
- for (int i = 0; i < (int)l.items.size(); i++) {
- auto& it = l.items[i];
- if (it.sep) {
- float y = std::floor((it.r.top + it.r.bottom) / 2) + 0.5f;
- br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.10f));
- rt->DrawLine({ INSET + 5, y }, { l.w - INSET - 5, y }, br, 1);
- continue;
- }
- bool hot = i == l.hover && !it.disabled;
- if (hot) {
- br->SetColor(D2D1::ColorF(0.04f, 0.40f, 0.95f, 1)); // azul de destaque do Mac
- rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(INSET, it.r.top, l.w - INSET, it.r.bottom), 4, 4), br);
- }
- br->SetColor(it.disabled ? dim : hot ? D2D1::ColorF(1, 1, 1, 1) : text);
- float cy = (it.r.top + it.r.bottom) / 2;
- if (it.checked) {
- if (it.radio) rt->FillEllipse(D2D1::Ellipse({ 12, cy }, 3, 3), br);
- else {
- rt->DrawLine({ 8, cy }, { 11, cy + 3.5f }, br, 1.6f);
- rt->DrawLine({ 11, cy + 3.5f }, { 16.5f, cy - 4 }, br, 1.6f);
- }
- }
- if (it.icon && !it.checked && g_tfIcon) {
- wchar_t g[2] = { it.icon, 0 };
- rt->DrawTextW(g, 1, g_tfIcon, D2D1::RectF(13, it.r.top, 33, it.r.bottom), br);
- }
- rt->DrawTextW(it.label.c_str(), (UINT32)it.label.size(), g_tf, D2D1::RectF(l.textL, it.r.top, l.w - TEXTR, it.r.bottom), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
- if (!it.shortcut.empty()) {
- if (!hot) br->SetColor(it.disabled ? dim : gray);
- rt->DrawTextW(it.shortcut.c_str(), (UINT32)it.shortcut.size(), g_tfR, D2D1::RectF(l.textL, it.r.top, l.w - TEXTR - (it.sub ? 16 : 0), it.r.bottom), br);
- }
- if (it.sub) { // ›
- float x = l.w - TEXTR - 4;
- br->SetColor(it.disabled ? dim : hot ? D2D1::ColorF(1, 1, 1, 1) : text);
- rt->DrawLine({ x - 3, cy - 4 }, { x + 1, cy }, br, 1.5f);
- rt->DrawLine({ x + 1, cy }, { x - 3, cy + 4 }, br, 1.5f);
- }
- }
- rt->SetTransform(base);
- rt->PopAxisAlignedClip();
- br->SetColor(text); // setinhas de rolagem, como no Mac
- float cx = l.w / 2;
- if (up) {
- D2D1_POINT_2F a{ cx - 4, ARROW / 2 + 2 }, b{ cx, ARROW / 2 - 2 }, c{ cx + 4, ARROW / 2 + 2 };
- rt->DrawLine(a, b, br, 1.5f); rt->DrawLine(b, c, br, 1.5f);
- }
- if (down) {
- float yy = l.view - ARROW / 2;
- D2D1_POINT_2F a{ cx - 4, yy - 2 }, b{ cx, yy + 2 }, c{ cx + 4, yy - 2 };
- rt->DrawLine(a, b, br, 1.5f); rt->DrawLine(b, c, br, 1.5f);
- }
- if (l.glass) { // contorno fino no canto arredondado (no lugar da borda do Windows)
- br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.14f) : D2D1::ColorF(0, 0, 0, 0.12f));
- float in = 0.5f / l.scale, rad = MENU_R - in;
- rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(in, in, l.w - in, l.view - in), rad, rad), br, 1.f / l.scale);
- }
- br->Release();
- ui::GpuEnd(l.s);
- if (l.glass && !l.clipped && l.s.visual) { // o desenho recortado no mesmo canto do vidro
- IDCompositionDevice* dev = ui::Comp();
- IDCompositionRectangleClip* clip = nullptr;
- if (dev && SUCCEEDED(dev->CreateRectangleClip(&clip))) {
- float r = MENU_R * l.scale;
- clip->SetLeft(0.f); clip->SetTop(0.f);
- clip->SetRight(std::ceil(l.w * l.scale)); clip->SetBottom(std::ceil(l.view * l.scale));
- clip->SetTopLeftRadiusX(r); clip->SetTopLeftRadiusY(r); clip->SetTopRightRadiusX(r); clip->SetTopRightRadiusY(r);
- clip->SetBottomLeftRadiusX(r); clip->SetBottomLeftRadiusY(r); clip->SetBottomRightRadiusX(r); clip->SetBottomRightRadiusY(r);
- l.s.visual->SetClip(clip);
- dev->Commit();
- clip->Release();
- l.clipped = true;
- }
- }
-}
-
-LRESULT CALLBACK PopupProc(HWND h, UINT m, WPARAM w, LPARAM l) {
- if (m == WM_MOUSEACTIVATE) return MA_NOACTIVATE;
- if (m == WM_PAINT) {
- PAINTSTRUCT ps; BeginPaint(h, &ps); EndPaint(h, &ps);
- for (auto* lv : g_levels) if (lv->wnd == h) Paint(*lv);
- return 0;
- }
- return DefWindowProcW(h, m, w, l);
-}
-
-void UpdateRects() {
- std::lock_guard<std::mutex> lk(g_rmu);
- g_rects.clear();
- for (auto* l : g_levels) { RECT r; GetWindowRect(l->wnd, &r); g_rects.push_back(r); }
-}
-
-void CloseLevel(Level* l) {
- if (l->glass && l->back) backdrop::Detach(l->back);
- ui::GpuFree(l->s);
- if (l->wnd) DestroyWindow(l->wnd);
- if (l->back) DestroyWindow(l->back);
- g_levels.erase(std::remove(g_levels.begin(), g_levels.end(), l), g_levels.end());
- delete l;
- UpdateRects();
-}
-
-void StopHooks();
-void ShowNative(HWND hwnd);
-
-// Fechando o menu inteiro (escolheu, Esc, clique fora): some em fade, como no Mac (~150 ms, desacelerando
-// no fim). Submenus trocados com o mouse fecham na hora (CloseLevel), também como no Mac.
-void FadeAll() {
- if (g_levels.empty() || shell::Setting(L"menus_fade", L"1") != L"1") return;
- IDCompositionDevice* dev = ui::Comp();
- std::vector<IDCompositionEffectGroup*> fx;
- for (auto* l : g_levels) {
- IDCompositionEffectGroup* e = nullptr;
- if (dev && l->s.visual && SUCCEEDED(dev->CreateEffectGroup(&e))) { l->s.visual->SetEffect(e); fx.push_back(e); }
- }
- const double D = 150;
- double t0 = anim::Now();
- for (;;) {
- float p = (float)std::min(1.0, (anim::Now() - t0) / D);
- float a = (1 - p) * (1 - p);
- for (auto* e : fx) e->SetOpacity(a);
- for (auto* l : g_levels) if (l->glass && l->back) backdrop::Fade(l->back, a, 1, 0, 0);
- if (dev) dev->Commit();
- if (p >= 1) break;
- DwmFlush();
- }
- for (auto* e : fx) e->Release();
-}
-
-void CloseAll(bool fade = true) {
- if (fade) FadeAll();
- while (!g_levels.empty()) CloseLevel(g_levels.back());
- StopHooks();
-}
-
-// Item com o mouse em cima, em qualquer nível (devolve o nível e o índice).
-bool HitAt(POINT pt, Level** lv, int* idx) {
- for (int k = (int)g_levels.size() - 1; k >= 0; k--) {
- Level* l = g_levels[k];
- RECT wr; GetWindowRect(l->wnd, &wr);
- if (!PtInRect(&wr, pt)) continue;
- *lv = l;
- *idx = -1;
- float y = (pt.y - wr.top) / l->scale;
- if ((UpArrow(*l) && y < ARROW) || (DownArrow(*l) && y >= l->view - ARROW)) return true; // na setinha: rola, não escolhe
- y += l->scroll;
- for (int i = 0; i < (int)l->items.size(); i++)
- if (!l->items[i].sep && y >= l->items[i].r.top && y < l->items[i].r.bottom) *idx = i;
- return true;
- }
- return false;
-}
-
-// Tecla direto na janela do menu nativo (o laço do menu lê a fila da thread dele): funciona mesmo quando
-// o teclado não está com aquele programa, como menus de plug-ins (Omnisphere dentro do Ableton), onde a
-// tecla simulada ia para outra janela e o submenu nunca abria.
-void NativeKey(HWND native, WORD vk) {
- LPARAM down = 1 | (MapVirtualKeyW(vk, MAPVK_VK_TO_VSC) << 16);
- if (vk == VK_LEFT || vk == VK_RIGHT) down |= 1 << 24; // tecla estendida
- PostMessageW(native, WM_KEYDOWN, vk, down);
- PostMessageW(native, WM_KEYUP, vk, down | (1u << 30) | (1u << 31));
-}
-
-void Key(WORD vk) {
- INPUT in[2]{};
- in[0].type = in[1].type = INPUT_KEYBOARD;
- in[0].ki.wVk = in[1].ki.wVk = vk;
- in[1].ki.dwFlags = KEYEVENTF_KEYUP;
- in[0].ki.dwExtraInfo = in[1].ki.dwExtraInfo = KEY_MARK;
- SendInput(2, in, sizeof(INPUT));
-}
-
-// Destaca o item no menu nativo também (o teclado continua coerente).
-void SelectNative(Level* l, int idx) {
- // níveis abertos abaixo deste fecham antes (Esquerda fecha o submenu mais fundo)
- while (g_levels.back() != l) { NativeKey(g_levels.back()->native, VK_LEFT); CloseLevel(g_levels.back()); }
- PostMessageW(l->native, MN_SELECT, idx >= 0 ? l->items[idx].pos : (WPARAM)-1, 0); // sem esperar o outro programa
-}
-
-void OpenSub(Level* l, int idx) {
- SelectNative(l, idx);
- HMENU sub = GetSubMenu(l->menu, l->items[idx].pos);
- Log(L"menu: abrindo submenu \"%ls\" (%d itens no nativo)", l->items[idx].label.c_str(), sub ? GetMenuItemCount(sub) : -1);
- NativeKey(l->native, VK_RIGHT);
- g_subFrom = l; g_subIdx = idx; g_subTry = 0;
- SetTimer(g_host, T_SUBCHECK, 250, nullptr);
-}
-
-// Itens do menu da Área de Trabalho (Explorer) que abrem o Ajustes do Windows: vão para o nosso Ajustes
-// do Sistema, na página certa. "" = não é um desses.
-std::wstring OurSettingsPage(Level* l, const Item& it) {
- DWORD pid = 0; GetWindowThreadProcessId(l->native, &pid);
- HANDLE hp = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
- wchar_t path[MAX_PATH] = {}; DWORD n = MAX_PATH;
- bool explorer = hp && QueryFullProcessImageNameW(hp, 0, path, &n) && !_wcsicmp(wcsrchr(path, L'\\') ? wcsrchr(path, L'\\') + 1 : path, L"explorer.exe");
- if (hp) CloseHandle(hp);
- if (!explorer) return L"";
- std::wstring t;
- for (wchar_t c : it.label) if (c != L'&') t += towlower(c);
- if (t == L"display settings" || t == L"configurações de exibição" || t == L"configurações de vídeo" || t == L"configurações da tela") return L"telas";
- if (t == L"personalize" || t == L"personalizar") return L"fundo";
- return L"";
-}
-
-void Choose(Level* l, int idx) {
- auto& it = l->items[idx];
- if (it.disabled || it.sep) return;
- if (std::wstring page = OurSettingsPage(l, it); !page.empty()) { // o nosso Ajustes no lugar do Windows
- Log(L"menu: \"%ls\" -> Ajustes do Sistema (%ls)", it.label.c_str(), page.c_str());
- for (size_t k = 0; k < g_levels.size(); k++) Key(VK_ESCAPE); // fecha o menu nativo sem escolher nada
- shell::OpenSettings(page);
- return;
- }
- SelectNative(l, idx);
- if (it.sub) { OpenSub(l, idx); return; } // o nativo abre o submenu; o nosso aparece no evento
- // pisca o item escolhido, como no Mac, e confirma no nativo
- l->hover = -1; Paint(*l); Sleep(70); // apaga e acende uma vez (o tempo do Mac)
- l->hover = idx; Paint(*l);
- // Confirma no nativo. Alguns programas ignoram a tecla mandada para a janela do menu (Omnisphere): se o
- // menu ainda estiver aberto em 250 ms, tenta o clique interno do menu e depois a tecla simulada.
- Log(L"menu: escolhido \"%ls\"", it.label.c_str());
- NativeKey(l->native, VK_RETURN);
- g_chooseNative = l->native; g_choosePos = it.pos; g_chooseIdx = idx; g_chooseTry = 0;
- SetTimer(g_host, T_CHOOSECHECK, 250, nullptr);
-}
-
-LRESULT CALLBACK MouseHook(int code, WPARAM w, LPARAM lp) {
- if (code == HC_ACTION) {
- auto* ms = (MSLLHOOKSTRUCT*)lp;
- bool over = false;
- { std::lock_guard<std::mutex> lk(g_rmu); for (auto& r : g_rects) if (PtInRect(&r, ms->pt)) { over = true; break; } }
- if (w == WM_MOUSEWHEEL && over) { // roda do mouse rola o menu longo
- PostMessageW(g_host, WM_MENU_WHEEL, (WPARAM)(short)HIWORD(ms->mouseData), MAKELPARAM(ms->pt.x, ms->pt.y));
- return 1;
- }
- if (w == WM_MOUSEMOVE) {
- if (!g_movePending.exchange(true)) PostMessageW(g_host, WM_MENU_MOVE, 0, 0); // um aviso por vez
- } else if (over) {
- if (w == WM_LBUTTONUP || w == WM_RBUTTONUP) PostMessageW(g_host, WM_MENU_CLICK, ms->pt.x, ms->pt.y);
- return 1; // clique nosso: o menu nativo não vê
- }
- // fora dos nossos: segue (o nativo, fora da tela, vê o clique fora e fecha)
- }
- return CallNextHookEx(nullptr, code, w, lp);
-}
-
-void HookThread() {
- MSG m;
- PeekMessageW(&m, nullptr, 0, 0, PM_NOREMOVE); // cria a fila de mensagens da thread
- g_hookTid = GetCurrentThreadId();
- while (GetMessageW(&m, nullptr, 0, 0)) {
- if (m.message == WM_HOOK_ON && !g_mouse) g_mouse = SetWindowsHookExW(WH_MOUSE_LL, MouseHook, GetModuleHandleW(nullptr), 0);
- if (m.message == WM_HOOK_OFF && g_mouse) { UnhookWindowsHookEx(g_mouse); g_mouse = nullptr; }
- }
-}
-
-// Mouse numa setinha: rola sozinho (timer), como no Mac.
-Level* ArrowUnder(POINT pt, int* dir) {
- for (int k = (int)g_levels.size() - 1; k >= 0; k--) {
- Level* l = g_levels[k];
- RECT wr; GetWindowRect(l->wnd, &wr);
- if (!PtInRect(&wr, pt)) continue;
- float y = (pt.y - wr.top) / l->scale;
- if (UpArrow(*l) && y < ARROW) { *dir = -1; return l; }
- if (DownArrow(*l) && y >= l->view - ARROW) { *dir = 1; return l; }
- return nullptr;
- }
- return nullptr;
-}
-
-void ScrollBy(Level* l, float dy) {
- float v = std::clamp(l->scroll + dy, 0.f, MaxScroll(*l));
- if (v == l->scroll) return;
- l->scroll = v;
- // submenus abertos a partir deste nível fecham (o item que os abriu saiu do lugar)
- while (g_levels.back() != l) { NativeKey(g_levels.back()->native, VK_LEFT); CloseLevel(g_levels.back()); }
- Paint(*l);
-}
-
-void OnMove() {
- g_movePending = false;
- g_lastMouse = GetTickCount();
- POINT pt; GetCursorPos(&pt);
- { int dir = 0; if (ArrowUnder(pt, &dir)) SetTimer(g_host, T_SCROLL, 16, nullptr); }
- Level* lv = nullptr; int idx = -1;
- if (!HitAt(pt, &lv, &idx)) { // fora: tira o destaque do nível mais fundo (como no Mac)
- if (!g_levels.empty() && g_levels.back()->hover >= 0 && !g_levels.back()->items[g_levels.back()->hover].sub) {
- g_levels.back()->hover = -1; Paint(*g_levels.back());
- }
- return;
- }
- if (idx == lv->hover) return;
- KillTimer(g_host, T_CHOOSECHECK);
- lv->hover = idx;
- Paint(*lv);
- if (idx >= 0) SelectNative(lv, idx);
- KillTimer(g_host, T_SUBMENU);
- g_subWanted = -1;
- if (idx >= 0 && lv->items[idx].sub && !lv->items[idx].disabled) { // submenu abre com um pequeno atraso
- g_subWanted = idx;
- SetTimer(g_host, T_SUBMENU, 200, nullptr);
- }
-}
-
-void OnClick(POINT pt) {
- Level* lv = nullptr; int idx = -1;
- if (HitAt(pt, &lv, &idx) && idx >= 0) Choose(lv, idx);
-}
-
-void OpenLevel(HWND native, HMENU menu, RECT nr) {
- auto* l = new Level;
- l->native = native;
- l->menu = menu;
- ReadItems(*l);
- if (l->items.empty()) {
- Log(L"menu: sem itens com texto (%d no nativo), fica o nativo", GetMenuItemCount(menu));
- SetPropW(native, L"ShellMenuLivre", (HANDLE)1); // antes de mover: a DLL não o manda de volta para fora
- if (!g_levels.empty()) { // o pai está fora da tela: o nativo vem para perto do nosso
- RECT pr; GetWindowRect(g_levels.back()->wnd, &pr);
- SetWindowPos(native, HWND_TOPMOST, pr.right - 4, pr.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
- } else SetWindowPos(native, nullptr, nr.left, nr.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); // volta ao lugar
- ShowNative(native);
- delete l; return;
- }
- POINT anchor{ nr.left, nr.top };
- // submenu: ao lado do item do nível de cima
- if (!g_levels.empty()) {
- Level* p = g_levels.back();
- RECT pr; GetWindowRect(p->wnd, &pr);
- float top = p->hover >= 0 ? p->items[p->hover].r.top - p->scroll : 0;
- anchor = { pr.right - (LONG)(4 * p->scale), pr.top + (LONG)((top - PADY) * p->scale) };
- }
- HMONITOR mon = MonitorFromPoint(anchor, MONITOR_DEFAULTTONEAREST);
- UINT dx = 96, dy = 96; GetDpiForMonitor(mon, MDT_EFFECTIVE_DPI, &dx, &dy);
- l->scale = dx / 96.f;
- Measure(*l);
- MONITORINFO mi{ sizeof(mi) }; GetMonitorInfoW(mon, &mi);
- float room = (mi.rcWork.bottom - mi.rcWork.top) / l->scale - 8; // não cabe: fica da altura da tela e rola
- if (l->h > room) l->view = room;
- int wpx = (int)std::ceil(l->w * l->scale), hpx = (int)std::ceil(l->view * l->scale);
- int x = anchor.x, y = anchor.y;
- if (x + wpx > mi.rcWork.right) { // não cabe à direita: submenu abre para a esquerda do pai; menu encosta na borda
- if (g_levels.empty()) x = mi.rcWork.right - wpx;
- else { RECT pr; GetWindowRect(g_levels.back()->wnd, &pr); x = pr.left - wpx + (int)(4 * l->scale); }
- }
- if (y + hpx > mi.rcWork.bottom) y = mi.rcWork.bottom - (int)(4 * l->scale) - hpx;
- if (y < mi.rcWork.top) y = mi.rcWork.top + (int)(4 * l->scale);
- // tira o nativo da tela (continua aberto, recebendo o teclado)
- if (!SetWindowPos(native, nullptr, -32000, -32000, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE)) { ShowNative(native); delete l; return; } // programa elevado: fica o nativo
- // Duas janelas: atrás, só o desfoque (acrílico); na frente, o menu desenhado na GPU. O desfoque
- // não pode ficar na mesma janela: ele seria pintado por cima do conteúdo da GPU.
- // Vidro do Shell (o mesmo do Dock e do seletor): recorte arredondado liso de 12, como o menu do Tahoe.
- // Sem ele, o acrílico do Windows com o canto de 8 do DWM (o jeito antigo).
- l->back = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TRANSPARENT | WS_EX_NOREDIRECTIONBITMAP, L"ShellMenuMac", L"", WS_POPUP,
- x, y, wpx, hpx, nullptr, nullptr, shell::inst, nullptr);
- l->glass = backdrop::Attach(l->back);
- DWORD corner = l->glass ? 1 /*sem arredondar*/ : 2;
- if (!l->glass) {
- DestroyWindow(l->back);
- l->back = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TRANSPARENT, L"ShellMenuMac", L"", WS_POPUP,
- x, y, wpx, hpx, nullptr, nullptr, shell::inst, nullptr);
- DwmSetWindowAttribute(l->back, 33, &corner, sizeof(corner));
- ui::Acrylic(l->back, ui::Dark() ? 0x60201E1Eu : 0x70F4F4F4u);
- } else {
- DwmSetWindowAttribute(l->back, 33, &corner, sizeof(corner));
- // bem fosco e com tinta firme, como os menus de contexto: o texto não pode disputar com o que está atrás
- // (a "Transparência do vidro" no mínimo deixava o menu quase nítido)
- std::vector<backdrop::Piece> pcs{ { D2D1::RectF(0, 0, (float)wpx, (float)hpx), MENU_R * l->scale } };
- backdrop::SetPieces(l->back, (float)wpx, (float)hpx, pcs,
- ui::Dark() ? D2D1::ColorF(0.13f, 0.13f, 0.14f, 0.62f) : D2D1::ColorF(0.97f, 0.97f, 0.98f, 0.66f), 18.f);
- }
- l->wnd = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_NOREDIRECTIONBITMAP, L"ShellMenuMac", L"", WS_POPUP,
- x, y, wpx, hpx, nullptr, nullptr, shell::inst, nullptr);
- l->s.hwnd = l->wnd;
- DwmSetWindowAttribute(l->wnd, 33, &corner, sizeof(corner));
- COLORREF border = l->glass ? 0xFFFFFFFE /*DWMWA_COLOR_NONE*/ : ui::Dark() ? RGB(72, 72, 74) : RGB(198, 198, 202);
- DwmSetWindowAttribute(l->wnd, 34, &border, sizeof(border));
- g_levels.push_back(l);
- Paint(*l); // desenha antes de aparecer: sem um quadro vazio piscando
- UpdateRects();
- // Com o vidro do Shell: mostra só depois que o vidro desenhado chegou à tela (em menu grande ele demora
- // mais, e aparecendo antes o menu piscava transparente). Sem resposta em 60 ms, mostra assim mesmo.
- if (l->glass) { backdrop::AfterCommit(g_host, WM_MENU_SHOWNOW); SetTimer(g_host, T_SHOWNOW, 60, nullptr); }
- else { ShowWindow(l->back, SW_SHOWNOACTIVATE); ShowWindow(l->wnd, SW_SHOWNOACTIVATE); }
-}
-
-void CALLBACK OnFocus(HWINEVENTHOOK, DWORD, HWND hwnd, LONG obj, LONG child, DWORD, DWORD) {
- // teclado no menu nativo: o destaque muda e o nosso acompanha (child = posição + 1)
- Level* l = LevelOf(hwnd);
- if (!l || obj != OBJID_CLIENT || child <= 0) return;
- if (GetTickCount() - g_lastMouse < 400) return; // é o eco do nosso próprio destaque: o mouse manda
- for (int i = 0; i < (int)l->items.size(); i++)
- if (l->items[i].pos == child - 1 && l->hover != i) { l->hover = i; Reveal(*l, i); Paint(*l); }
-}
-
-// Submenu grande (centenas de itens): o Windows leva um tempo montando e mostra a janela antes do aviso
-// de "abriu" chegar até nós, e ela piscava no canto. Enquanto há menu nosso aberto, todo menu nativo novo
-// fica invisível (alfa 0) assim que a janela nasce; se não der para trocar pelo nosso, volta a aparecer.
-void CALLBACK OnCreate(HWINEVENTHOOK, DWORD, HWND hwnd, LONG obj, LONG, DWORD, DWORD) {
- if (obj != OBJID_WINDOW || !hwnd) return;
- wchar_t cls[16] = {}; GetClassNameW(hwnd, cls, 16);
- if (wcscmp(cls, L"#32768")) return;
- LONG_PTR ex = GetWindowLongPtrW(hwnd, GWL_EXSTYLE);
- if (!(ex & WS_EX_LAYERED)) SetWindowLongPtrW(hwnd, GWL_EXSTYLE, ex | WS_EX_LAYERED);
- SetLayeredWindowAttributes(hwnd, 0, 0, LWA_ALPHA);
-}
-
-void ShowNative(HWND hwnd) { // o nativo fica de verdade (não conseguimos ler os itens)
- SetPropW(hwnd, L"ShellMenuLivre", (HANDLE)1); // a DLL dentro do programa para de mandá-lo para fora da tela
- BYTE a = 0; DWORD fl = 0;
- if (GetLayeredWindowAttributes(hwnd, nullptr, &a, &fl) && (fl & LWA_ALPHA) && a == 0) SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
-}
-
-void StartHooks() {
- if (g_hookTid) PostThreadMessageW(g_hookTid, WM_HOOK_ON, 0, 0);
- if (!g_createHook) g_createHook = SetWinEventHook(EVENT_OBJECT_CREATE, EVENT_OBJECT_CREATE, nullptr, OnCreate, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
- if (!g_focusHook) g_focusHook = SetWinEventHook(EVENT_OBJECT_FOCUS, EVENT_OBJECT_FOCUS, nullptr, OnFocus, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
-}
-
-void StopHooks() {
- if (g_hookTid) PostThreadMessageW(g_hookTid, WM_HOOK_OFF, 0, 0);
- if (g_focusHook) { UnhookWinEvent(g_focusHook); g_focusHook = nullptr; }
- if (g_createHook) { UnhookWinEvent(g_createHook); g_createHook = nullptr; }
- KillTimer(g_host, T_SUBMENU);
- KillTimer(g_host, T_SUBCHECK);
- KillTimer(g_host, T_CHOOSECHECK);
- KillTimer(g_host, T_SCROLL);
-}
-
-void CALLBACK OnMenu(HWINEVENTHOOK, DWORD ev, HWND hwnd, LONG, LONG, DWORD, DWORD) {
- switch (ev) {
- case EVENT_SYSTEM_MENUPOPUPSTART: {
- wchar_t cls[16] = {}; GetClassNameW(hwnd, cls, 16);
- if (wcscmp(cls, L"#32768")) return;
- DWORD pid = 0; GetWindowThreadProcessId(hwnd, &pid);
- if (pid == g_selfPid) return;
- // Tira o nativo da tela já, antes de perguntar qualquer coisa ao programa: a pergunta leva alguns
- // milissegundos e o menu do Windows piscava no lugar dele (no Serum, no canto de cima à esquerda).
- RECT nr; GetWindowRect(hwnd, &nr);
- // a DLL dentro do programa já o mandou para fora da tela antes de aparecer: o lugar dele ficou guardado
- if (HANDLE px = GetPropW(hwnd, L"ShellMenuX")) {
- int ox = (int)(INT_PTR)px - 40000, oy = (int)(INT_PTR)GetPropW(hwnd, L"ShellMenuY") - 40000;
- OffsetRect(&nr, ox - nr.left, oy - nr.top);
- }
- bool moved = SetWindowPos(hwnd, nullptr, -32000, -32000, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE) != 0;
- DWORD_PTR r = 0;
- BOOL ok = SendMessageTimeoutW(hwnd, MN_GETHMENU, 0, 0, SMTO_ABORTIFHUNG, 600, &r);
- Log(L"menu: nativo abriu (pid %lu, nível %d, %ld,%ld %ldx%ld, hmenu %p, %d itens%ls)", pid, (int)g_levels.size(), nr.left, nr.top,
- nr.right - nr.left, nr.bottom - nr.top, (void*)r, r && IsMenu((HMENU)r) ? GetMenuItemCount((HMENU)r) : -1, ok ? L"" : L", sem resposta");
- if (!ok || !r || !IsMenu((HMENU)r)) {
- // submenu que não conseguimos ler: o nativo nasceu ao lado do pai, que está fora da tela; traz para perto do nosso
- SetPropW(hwnd, L"ShellMenuLivre", (HANDLE)1); // antes de mover: a DLL não o manda de volta para fora
- if (!g_levels.empty()) {
- RECT pr; GetWindowRect(g_levels.back()->wnd, &pr);
- SetWindowPos(hwnd, HWND_TOPMOST, pr.right - 4, pr.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
- } else if (moved) SetWindowPos(hwnd, nullptr, nr.left, nr.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
- ShowNative(hwnd);
- return;
- }
- StartHooks();
- OpenLevel(hwnd, (HMENU)r, nr);
- break;
- }
- case EVENT_SYSTEM_MENUPOPUPEND:
- if (Level* l = LevelOf(hwnd)) {
- while (!g_levels.empty() && g_levels.back() != l) CloseLevel(g_levels.back());
- CloseLevel(l);
- if (g_levels.empty()) StopHooks();
- }
- break;
- case EVENT_SYSTEM_MENUEND:
- if (!g_levels.empty()) CloseAll();
- break;
- }
-}
-
-LRESULT CALLBACK HostProc(HWND h, UINT m, WPARAM w, LPARAM l) {
- if (m == WM_MENU_MOVE) { OnMove(); return 0; }
- if (m == WM_MENU_CLICK) { OnClick({ (LONG)w, (LONG)l }); return 0; }
- if (m == WM_MENU_SHOWNOW || (m == WM_TIMER && w == T_SHOWNOW)) { // o vidro já está na tela: mostra os níveis novos
- if (m == WM_TIMER) KillTimer(h, T_SHOWNOW);
- for (auto* lv : g_levels)
- if (!IsWindowVisible(lv->wnd)) { ShowWindow(lv->back, SW_SHOWNOACTIVATE); ShowWindow(lv->wnd, SW_SHOWNOACTIVATE); }
- return 0;
- }
- if (m == WM_MENU_WHEEL) {
- POINT pt{ (short)LOWORD(l), (short)HIWORD(l) };
- Level* lv = nullptr;
- for (auto* x : g_levels) { RECT wr; GetWindowRect(x->wnd, &wr); if (PtInRect(&wr, pt)) lv = x; }
- if (lv && Scrolls(*lv)) {
- ScrollBy(lv, -(float)(short)w / WHEEL_DELTA * ROW * 3);
- Level* hit = nullptr; int idx = -1;
- if (HitAt(pt, &hit, &idx) && hit == lv) { lv->hover = idx; Paint(*lv); }
- }
- return 0;
- }
- if (m == WM_TIMER && w == T_SCROLL) {
- POINT pt; GetCursorPos(&pt);
- int dir = 0;
- Level* lv = ArrowUnder(pt, &dir);
- if (!lv) { KillTimer(h, T_SCROLL); return 0; }
- lv->hover = -1;
- ScrollBy(lv, dir * 6.f);
- return 0;
- }
- if (m == WM_TIMER && w == T_CHOOSECHECK) {
- KillTimer(h, T_CHOOSECHECK);
- HWND nat = g_chooseNative;
- Level* l = LevelOf(nat);
- // fechou (o programa recebeu) ou o mouse já está em outro item: não insiste
- if (!l || !IsWindow(nat) || !IsWindowVisible(nat) || l->hover != g_chooseIdx) return 0;
- int pos = g_choosePos;
- g_chooseTry++;
- if (g_chooseTry == 1) {
- Log(L"menu: a tecla não escolheu; tentando o clique interno do menu");
- PostMessageW(l->native, MN_SELECT, pos, 0);
- PostMessageW(l->native, MN_BTNDOWN, pos, 0);
- PostMessageW(l->native, MN_BTNUP, pos, 0);
- } else {
- Log(L"menu: o programa não aceitou a escolha");
- return 0;
- }
- SetTimer(h, T_CHOOSECHECK, 250, nullptr);
- return 0;
- }
- if (m == WM_TIMER && w == T_SUBCHECK) {
- KillTimer(h, T_SUBCHECK);
- Level* l = g_subFrom;
- bool alive = std::find(g_levels.begin(), g_levels.end(), l) != g_levels.end();
- if (!alive || g_levels.back() != l || l->hover != g_subIdx) return 0; // abriu (há nível novo) ou o mouse saiu
- g_subTry++;
- if (g_subTry == 1) {
- Log(L"menu: submenu não abriu pela tecla; tentando MN_OPENHIERARCHY");
- PostMessageW(l->native, MN_SELECT, l->items[g_subIdx].pos, 0);
- PostMessageW(l->native, MN_OPENHIER, 0, 0);
- } else if (g_subTry == 2) {
- Log(L"menu: tentando tecla simulada");
- PostMessageW(l->native, MN_SELECT, l->items[g_subIdx].pos, 0);
- Key(VK_RIGHT);
- } else {
- Log(L"menu: submenu não abriu");
- return 0;
- }
- SetTimer(h, T_SUBCHECK, 250, nullptr);
- return 0;
- }
- if (m == WM_TIMER && w == T_SUBMENU) {
- KillTimer(h, T_SUBMENU);
- if (!g_levels.empty() && g_subWanted >= 0) {
- Level* lv = g_levels.back();
- // o pedido é sempre do nível de cima com o mouse; acha qual
- for (auto* x : g_levels) if (x->hover == g_subWanted && x->items[g_subWanted].sub) lv = x;
- if (lv->hover == g_subWanted) OpenSub(lv, g_subWanted);
- }
- g_subWanted = -1;
- return 0;
- }
- return DefWindowProcW(h, m, w, l);
-}
-
-} // namespace
-
-void menus::Start() {
- if (shell::Setting(L"menus_do_windows", L"1") != L"1") return;
- g_selfPid = GetCurrentProcessId();
- WNDCLASSW pc{}; pc.lpfnWndProc = PopupProc; pc.hInstance = shell::inst; pc.lpszClassName = L"ShellMenuMac";
- pc.hCursor = LoadCursorW(nullptr, IDC_ARROW);
- RegisterClassW(&pc);
- WNDCLASSW hc{}; hc.lpfnWndProc = HostProc; hc.hInstance = shell::inst; hc.lpszClassName = L"ShellMenusHost";
- RegisterClassW(&hc);
- g_host = CreateWindowExW(0, hc.lpszClassName, L"", 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, shell::inst, nullptr);
- std::thread(HookThread).detach();
- g_menuHook = SetWinEventHook(EVENT_SYSTEM_MENUSTART, EVENT_SYSTEM_MENUPOPUPEND, nullptr, OnMenu, 0, 0,
- WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
- Log(L"menus do Windows: interceptando (%ls)", g_menuHook ? L"ok" : L"falhou");
-}
-
-void menus::Stop() {
- CloseAll(false);
- if (g_menuHook) UnhookWinEvent(g_menuHook);
- g_menuHook = nullptr;
-}
+// Menus do Windows no visual do Mac, em todos os programas, sem injetar nada:
+// 1. O Windows avisa (WinEvent, fora do processo) quando um menu nativo (#32768) abre.
+// 2. Lemos os itens pelo HMENU (MN_GETHMENU), tiramos a janela nativa da tela e mostramos a nossa.
+// 3. O mouse é nosso (gancho de mouse só enquanto há menu aberto); ao escolher, selecionamos o
+// mesmo item no menu nativo (MN_SELECTITEM) e mandamos Enter: o programa recebe o comando como
+// sempre recebeu, inclusive menus que esperam a resposta direta (TrackPopupMenu com TPM_RETURNCMD).
+// 4. O teclado continua indo para o menu nativo; acompanhamos o destaque pelo evento de foco.
+// Programas que desenham o próprio menu (Chrome, Electron, WinUI) não usam #32768 e ficam como estão.
+#include "shell.h"
+#include "../menu/context_menu.h"
+#include <dwmapi.h>
+#include <dcomp.h>
+#include <shellscalingapi.h>
+#include <algorithm>
+#include <cmath>
+#include <atomic>
+#include <mutex>
+#include <thread>
+
+namespace {
+
+const UINT MN_SELECT = 0x01E5; // MN_SELECTITEM (não documentada): destaca o item no menu nativo
+const ULONG_PTR KEY_MARK = 0x53484C4C; // o mesmo de main.cpp: teclas nossas não passam pelo gancho da tecla Windows
+const UINT T_SUBMENU = 1, T_SUBCHECK = 2, T_SCROLL = 3, T_CHOOSECHECK = 4, T_SHOWNOW = 5;
+const UINT MN_BTNDOWN = 0x01ED, MN_BTNUP = 0x01EF; // MN_BUTTONDOWN/UP (não documentadas): clique no item pela posição
+const UINT MN_OPENHIER = 0x01E3; // MN_OPENHIERARCHY (não documentada): abre o submenu do item destacado
+const UINT WM_MENU_MOVE = WM_APP + 1, WM_MENU_CLICK = WM_APP + 2, WM_MENU_WHEEL = WM_APP + 3, WM_MENU_SHOWNOW = WM_APP + 4, WM_HOOK_ON = WM_USER + 1, WM_HOOK_OFF = WM_USER + 2;
+
+struct Item {
+ int pos; // posição no menu nativo
+ std::wstring label, shortcut;
+ bool sep = false, disabled = false, checked = false, radio = false, sub = false;
+ wchar_t icon = 0; // Tahoe: símbolo à esquerda (pelo nome do item)
+ D2D1_RECT_F r{};
+};
+
+struct Level {
+ HWND native = nullptr;
+ HMENU menu = nullptr;
+ HWND wnd = nullptr;
+ HWND back = nullptr; // só o desfoque, atrás do menu
+ ui::GpuSurface s; // GPU + desfoque nativo do Windows 11: sem destaque cortado ao meio
+ bool glass = false; // o vidro de trás é o do Shell (cantos de 12 lisos, como o menu do Tahoe)
+ bool clipped = false; // o desenho já tem o recorte arredondado
+ std::vector<Item> items;
+ int hover = -1;
+ float w = 0, h = 0; // DIPs (h = altura de todos os itens)
+ float textL = 21; // onde o texto começa (mais à direita com ícones)
+ float view = 0; // altura visível: menor que h quando o menu não cabe na tela e rola, como no Mac
+ float scroll = 0; // quanto já rolou (DIPs)
+ float scale = 1;
+};
+
+std::vector<Level*> g_levels;
+HWINEVENTHOOK g_menuHook, g_focusHook, g_createHook;
+HHOOK g_mouse;
+HWND g_host; // janela de mensagens (timers)
+DWORD g_selfPid;
+IDWriteTextFormat *g_tf, *g_tfR, *g_tfIcon;
+int g_subWanted = -1; // item com submenu esperando o atraso para abrir
+// Submenu pedido ao nativo: se não abrir em 250 ms, tenta outros caminhos (alguns programas ignoram a tecla)
+Level* g_subFrom; int g_subIdx = -1, g_subTry;
+// Item escolhido esperando o programa aceitar: guardado pela janela nativa e posição (não pelo nível, que
+// pode ser apagado e outro nascer no mesmo endereço); o mouse mexendo para outro item cancela
+HWND g_chooseNative; int g_choosePos = -1, g_chooseIdx = -1, g_chooseTry;
+float g_scaleFmt;
+// O gancho de mouse roda numa thread só dele e não faz nada pesado: diz se o ponto está sobre um
+// menu nosso (retângulos copiados aqui), engole os cliques e avisa a janela principal. Trabalho
+// pesado dentro do gancho segura o cursor do sistema inteiro.
+std::mutex g_rmu;
+std::vector<RECT> g_rects;
+std::atomic<bool> g_movePending;
+DWORD g_hookTid;
+DWORD g_lastMouse; // última vez que o mouse mexeu (o foco do menu nativo só manda no teclado)
+
+Level* LevelOf(HWND native) {
+ for (auto* l : g_levels) if (l->native == native) return l;
+ return nullptr;
+}
+
+std::wstring Clean(const wchar_t* s, std::wstring* shortcut) {
+ std::wstring out;
+ for (const wchar_t* p = s; *p; p++) {
+ if (*p == L'\t') { if (shortcut) *shortcut = p + 1; break; }
+ if (*p == L'&') { if (p[1] == L'&') { out += L'&'; p++; } continue; }
+ out += *p;
+ }
+ return out;
+}
+
+void ReadItems(Level& l) {
+ l.items.clear();
+ int n = GetMenuItemCount(l.menu);
+ for (int k = 0; k < n; k++) {
+ wchar_t buf[512] = {};
+ MENUITEMINFOW mi{ sizeof(mi) };
+ mi.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_SUBMENU | MIIM_STRING;
+ mi.dwTypeData = buf; mi.cch = 511;
+ if (!GetMenuItemInfoW(l.menu, k, TRUE, &mi)) continue;
+ Item it; it.pos = k;
+ if (mi.fType & MFT_SEPARATOR) {
+ if (l.items.empty() || l.items.back().sep) continue; // sem separadores repetidos
+ it.sep = true;
+ } else {
+ if (!buf[0]) continue; // desenhado pelo próprio programa, sem texto: fica de fora
+ it.label = Clean(buf, &it.shortcut);
+ it.disabled = (mi.fState & (MFS_DISABLED | MFS_GRAYED)) != 0;
+ it.checked = (mi.fState & MFS_CHECKED) != 0;
+ it.radio = (mi.fType & MFT_RADIOCHECK) != 0;
+ it.sub = mi.hSubMenu != nullptr;
+ }
+ l.items.push_back(it);
+ }
+ while (!l.items.empty() && l.items.back().sep) l.items.pop_back();
+}
+
+void Formats(float scale) {
+ if (g_tf && g_scaleFmt == scale) return;
+ if (g_tf) { g_tf->Release(); g_tfR->Release(); }
+ g_tf = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL);
+ g_tfR = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ if (!g_tfIcon) {
+ IDWriteFactory* dw = nullptr;
+ if (SUCCEEDED(DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory), (IUnknown**)&dw))) {
+ dw->CreateTextFormat(L"Segoe Fluent Icons", nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 13, L"", &g_tfIcon);
+ if (g_tfIcon) { g_tfIcon->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); g_tfIcon->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); }
+ dw->Release();
+ }
+ }
+ g_scaleFmt = scale;
+}
+
+// Medidas do menu do macOS: linhas de 22, 5 de folga em cima/embaixo, texto a 21 da borda (espaço
+// do ✓), destaque azul arredondado com 5 de margem, separador de 11.
+const float ROW = 22, SEP = 11, PADY = 5, TEXTL = 21, TEXTR = 14, INSET = 5;
+const float MENU_R_TAHOE = 12; // canto do menu (DIP), como o menu de contexto do Tahoe
+const float ARROW = 18; // faixa com a setinha em cima/embaixo de um menu que rola
+// macOS 27 Golden Gate (menu Go do Finder, captura 2x do 512 Pixels): linhas de 24, separador de 11, 5,5 de folga,
+// destaque (0,122,255) com 5,5 de margem e canto 7, canto do menu 11; texto a 16 da borda (a 41 com símbolo) e
+// símbolos só em poucos itens (Ajustes…), como no Golden Gate
+bool GoldenMenus() { return backdrop::Liquid() && backdrop::Current().golden; }
+#define MENU_R (GoldenMenus() ? 11.f : MENU_R_TAHOE) // Golden Gate: canto de 11 (medido)
+bool GoldenIcon(const std::wstring& label) {
+ for (const wchar_t* k : { L"Ajustes", L"Settings", L"System Settings", L"Preferências", L"Preferences", L"Sobre Este", L"About This", L"App Store", L"Microsoft Store" }) // macOS 27: o menu da Apple tem símbolo nestes if (label.rfind(k, 0) == 0) return true;
+ return false;
+}
+
+bool Scrolls(const Level& l) { return l.h > l.view + 0.5f; }
+float MaxScroll(const Level& l) { return std::max(0.f, l.h - l.view); }
+bool UpArrow(const Level& l) { return Scrolls(l) && l.scroll > 0.5f; }
+bool DownArrow(const Level& l) { return Scrolls(l) && l.scroll < MaxScroll(l) - 0.5f; }
+
+// Deixa o item à vista (teclado descendo um menu longo).
+void Reveal(Level& l, int i) {
+ if (!Scrolls(l) || i < 0) return;
+ float top = l.items[i].r.top - l.scroll, bot = l.items[i].r.bottom - l.scroll;
+ if (top < ARROW) l.scroll -= ARROW - top;
+ else if (bot > l.view - ARROW) l.scroll += bot - (l.view - ARROW);
+ l.scroll = std::clamp(l.scroll, 0.f, MaxScroll(l));
+}
+
+void Measure(Level& l) {
+ Formats(l.scale);
+ float maxL = 0, maxS = 0;
+ bool anySub = false, anyIcon = false;
+ for (auto& it : l.items) {
+ if (it.sep) continue;
+ it.icon = backdrop::Liquid() && (!GoldenMenus() || GoldenIcon(it.label)) ? ctxmenu::AutoIcon(it.label) : 0; // Tahoe: símbolo em cada item
+ anyIcon |= it.icon != 0;
+ maxL = std::max(maxL, ui::TextWidth(g_tf, it.label));
+ if (!it.shortcut.empty()) maxS = std::max(maxS, ui::TextWidth(g_tf, it.shortcut));
+ anySub |= it.sub;
+ }
+ l.textL = GoldenMenus() ? (anyIcon ? 41.f : 16.f) : anyIcon ? 34.f : TEXTL;
+ l.w = std::max(160.f, l.textL + maxL + (maxS > 0 ? 30 + maxS : 0) + (anySub ? 22 : 0) + TEXTR);
+ bool tahoe = backdrop::Liquid(); // medidas do menu do Tahoe: linhas de 20, separador de 9, 6 de folga
+ bool golden = GoldenMenus();
+ float pad = golden ? 5.5f : tahoe ? 6.f : PADY;
+ float y = pad;
+ for (auto& it : l.items) {
+ float h = it.sep ? (golden ? 11.f : tahoe ? 9.f : SEP) : (golden ? 24.f : tahoe ? 20.f : ROW);
+ it.r = D2D1::RectF(0, y, l.w, y + h);
+ y += h;
+ }
+ l.h = y + pad;
+ l.view = l.h;
+}
+
+void Paint(Level& l) {
+ int wpx = (int)std::ceil(l.w * l.scale), hpx = (int)std::ceil(l.view * l.scale);
+ auto* rt = ui::GpuBegin(l.s, wpx, hpx, l.scale);
+ if (!rt) return;
+ bool dark = ui::Dark();
+ ID2D1SolidColorBrush* br = nullptr;
+ rt->CreateSolidColorBrush(dark ? D2D1::ColorF(0.16f, 0.16f, 0.17f, 0.40f) : D2D1::ColorF(0.97f, 0.97f, 0.97f, 0.45f), &br);
+ rt->FillRectangle(D2D1::RectF(0, 0, l.w, l.view), br);
+ bool up = UpArrow(l), down = DownArrow(l);
+ D2D1_MATRIX_3X2_F base; rt->GetTransform(&base);
+ rt->PushAxisAlignedClip(D2D1::RectF(0, up ? ARROW : 0, l.w, l.view - (down ? ARROW : 0)), D2D1_ANTIALIAS_MODE_ALIASED);
+ rt->SetTransform(D2D1::Matrix3x2F::Translation(0, -l.scroll) * base);
+ D2D1_COLOR_F text = dark ? D2D1::ColorF(1, 1, 1, 0.92f) : D2D1::ColorF(0, 0, 0, 0.88f);
+ D2D1_COLOR_F dim = dark ? D2D1::ColorF(1, 1, 1, 0.30f) : D2D1::ColorF(0, 0, 0, 0.28f);
+ D2D1_COLOR_F gray = dark ? D2D1::ColorF(1, 1, 1, 0.45f) : D2D1::ColorF(0, 0, 0, 0.45f);
+ for (int i = 0; i < (int)l.items.size(); i++) {
+ auto& it = l.items[i];
+ if (it.sep) {
+ float y = std::floor((it.r.top + it.r.bottom) / 2) + 0.5f;
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.10f));
+ rt->DrawLine({ INSET + 5, y }, { l.w - INSET - 5, y }, br, 1);
+ continue;
+ }
+ bool hot = i == l.hover && !it.disabled;
+ if (hot) {
+ bool golden = GoldenMenus();
+ br->SetColor(golden ? D2D1::ColorF(0, 122 / 255.f, 1, 1) : D2D1::ColorF(0.04f, 0.40f, 0.95f, 1)); // azul de destaque do Mac
+ float in = golden ? 5.5f : INSET, rad = golden ? 7.f : 4.f;
+ rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(in, it.r.top, l.w - in, it.r.bottom), rad, rad), br);
+ }
+ br->SetColor(it.disabled ? dim : hot ? D2D1::ColorF(1, 1, 1, 1) : text);
+ float cy = (it.r.top + it.r.bottom) / 2;
+ if (it.checked) {
+ if (it.radio) rt->FillEllipse(D2D1::Ellipse({ 12, cy }, 3, 3), br);
+ else {
+ rt->DrawLine({ 8, cy }, { 11, cy + 3.5f }, br, 1.6f);
+ rt->DrawLine({ 11, cy + 3.5f }, { 16.5f, cy - 4 }, br, 1.6f);
+ }
+ }
+ if (it.icon && !it.checked && g_tfIcon) {
+ wchar_t g[2] = { it.icon, 0 };
+ rt->DrawTextW(g, 1, g_tfIcon, D2D1::RectF(13, it.r.top, 33, it.r.bottom), br);
+ }
+ rt->DrawTextW(it.label.c_str(), (UINT32)it.label.size(), g_tf, D2D1::RectF(l.textL, it.r.top, l.w - TEXTR, it.r.bottom), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ if (!it.shortcut.empty()) {
+ if (!hot) br->SetColor(it.disabled ? dim : gray);
+ rt->DrawTextW(it.shortcut.c_str(), (UINT32)it.shortcut.size(), g_tfR, D2D1::RectF(l.textL, it.r.top, l.w - TEXTR - (it.sub ? 16 : 0), it.r.bottom), br);
+ }
+ if (it.sub) { // ›
+ float x = l.w - TEXTR - 4;
+ br->SetColor(it.disabled ? dim : hot ? D2D1::ColorF(1, 1, 1, 1) : text);
+ rt->DrawLine({ x - 3, cy - 4 }, { x + 1, cy }, br, 1.5f);
+ rt->DrawLine({ x + 1, cy }, { x - 3, cy + 4 }, br, 1.5f);
+ }
+ }
+ rt->SetTransform(base);
+ rt->PopAxisAlignedClip();
+ br->SetColor(text); // setinhas de rolagem, como no Mac
+ float cx = l.w / 2;
+ if (up) {
+ D2D1_POINT_2F a{ cx - 4, ARROW / 2 + 2 }, b{ cx, ARROW / 2 - 2 }, c{ cx + 4, ARROW / 2 + 2 };
+ rt->DrawLine(a, b, br, 1.5f); rt->DrawLine(b, c, br, 1.5f);
+ }
+ if (down) {
+ float yy = l.view - ARROW / 2;
+ D2D1_POINT_2F a{ cx - 4, yy - 2 }, b{ cx, yy + 2 }, c{ cx + 4, yy - 2 };
+ rt->DrawLine(a, b, br, 1.5f); rt->DrawLine(b, c, br, 1.5f);
+ }
+ if (l.glass) { // contorno fino no canto arredondado (no lugar da borda do Windows)
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.14f) : D2D1::ColorF(0, 0, 0, 0.12f));
+ float in = 0.5f / l.scale, rad = MENU_R - in;
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(in, in, l.w - in, l.view - in), rad, rad), br, 1.f / l.scale);
+ }
+ br->Release();
+ ui::GpuEnd(l.s);
+ if (l.glass && !l.clipped && l.s.visual) { // o desenho recortado no mesmo canto do vidro
+ IDCompositionDevice* dev = ui::Comp();
+ IDCompositionRectangleClip* clip = nullptr;
+ if (dev && SUCCEEDED(dev->CreateRectangleClip(&clip))) {
+ float r = MENU_R * l.scale;
+ clip->SetLeft(0.f); clip->SetTop(0.f);
+ clip->SetRight(std::ceil(l.w * l.scale)); clip->SetBottom(std::ceil(l.view * l.scale));
+ clip->SetTopLeftRadiusX(r); clip->SetTopLeftRadiusY(r); clip->SetTopRightRadiusX(r); clip->SetTopRightRadiusY(r);
+ clip->SetBottomLeftRadiusX(r); clip->SetBottomLeftRadiusY(r); clip->SetBottomRightRadiusX(r); clip->SetBottomRightRadiusY(r);
+ l.s.visual->SetClip(clip);
+ dev->Commit();
+ clip->Release();
+ l.clipped = true;
+ }
+ }
+}
+
+LRESULT CALLBACK PopupProc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ if (m == WM_MOUSEACTIVATE) return MA_NOACTIVATE;
+ if (m == WM_PAINT) {
+ PAINTSTRUCT ps; BeginPaint(h, &ps); EndPaint(h, &ps);
+ for (auto* lv : g_levels) if (lv->wnd == h) Paint(*lv);
+ return 0;
+ }
+ return DefWindowProcW(h, m, w, l);
+}
+
+void UpdateRects() {
+ std::lock_guard<std::mutex> lk(g_rmu);
+ g_rects.clear();
+ for (auto* l : g_levels) { RECT r; GetWindowRect(l->wnd, &r); g_rects.push_back(r); }
+}
+
+void CloseLevel(Level* l) {
+ if (l->glass && l->back) backdrop::Detach(l->back);
+ ui::GpuFree(l->s);
+ if (l->wnd) DestroyWindow(l->wnd);
+ if (l->back) DestroyWindow(l->back);
+ g_levels.erase(std::remove(g_levels.begin(), g_levels.end(), l), g_levels.end());
+ delete l;
+ UpdateRects();
+}
+
+void StopHooks();
+void ShowNative(HWND hwnd);
+
+// Fechando o menu inteiro (escolheu, Esc, clique fora): some em fade, como no Mac (~150 ms, desacelerando
+// no fim). Submenus trocados com o mouse fecham na hora (CloseLevel), também como no Mac.
+void FadeAll() {
+ if (g_levels.empty() || shell::Setting(L"menus_fade", L"1") != L"1") return;
+ IDCompositionDevice* dev = ui::Comp();
+ std::vector<IDCompositionEffectGroup*> fx;
+ for (auto* l : g_levels) {
+ IDCompositionEffectGroup* e = nullptr;
+ if (dev && l->s.visual && SUCCEEDED(dev->CreateEffectGroup(&e))) { l->s.visual->SetEffect(e); fx.push_back(e); }
+ }
+ const double D = 150;
+ double t0 = anim::Now();
+ for (;;) {
+ float p = (float)std::min(1.0, (anim::Now() - t0) / D);
+ float a = (1 - p) * (1 - p);
+ for (auto* e : fx) e->SetOpacity(a);
+ for (auto* l : g_levels) if (l->glass && l->back) backdrop::Fade(l->back, a, 1, 0, 0);
+ if (dev) dev->Commit();
+ if (p >= 1) break;
+ DwmFlush();
+ }
+ for (auto* e : fx) e->Release();
+}
+
+void CloseAll(bool fade = true) {
+ if (fade) FadeAll();
+ while (!g_levels.empty()) CloseLevel(g_levels.back());
+ StopHooks();
+}
+
+// Item com o mouse em cima, em qualquer nível (devolve o nível e o índice).
+bool HitAt(POINT pt, Level** lv, int* idx) {
+ for (int k = (int)g_levels.size() - 1; k >= 0; k--) {
+ Level* l = g_levels[k];
+ RECT wr; GetWindowRect(l->wnd, &wr);
+ if (!PtInRect(&wr, pt)) continue;
+ *lv = l;
+ *idx = -1;
+ float y = (pt.y - wr.top) / l->scale;
+ if ((UpArrow(*l) && y < ARROW) || (DownArrow(*l) && y >= l->view - ARROW)) return true; // na setinha: rola, não escolhe
+ y += l->scroll;
+ for (int i = 0; i < (int)l->items.size(); i++)
+ if (!l->items[i].sep && y >= l->items[i].r.top && y < l->items[i].r.bottom) *idx = i;
+ return true;
+ }
+ return false;
+}
+
+// Tecla direto na janela do menu nativo (o laço do menu lê a fila da thread dele): funciona mesmo quando
+// o teclado não está com aquele programa, como menus de plug-ins (Omnisphere dentro do Ableton), onde a
+// tecla simulada ia para outra janela e o submenu nunca abria.
+void NativeKey(HWND native, WORD vk) {
+ LPARAM down = 1 | (MapVirtualKeyW(vk, MAPVK_VK_TO_VSC) << 16);
+ if (vk == VK_LEFT || vk == VK_RIGHT) down |= 1 << 24; // tecla estendida
+ PostMessageW(native, WM_KEYDOWN, vk, down);
+ PostMessageW(native, WM_KEYUP, vk, down | (1u << 30) | (1u << 31));
+}
+
+void Key(WORD vk) {
+ INPUT in[2]{};
+ in[0].type = in[1].type = INPUT_KEYBOARD;
+ in[0].ki.wVk = in[1].ki.wVk = vk;
+ in[1].ki.dwFlags = KEYEVENTF_KEYUP;
+ in[0].ki.dwExtraInfo = in[1].ki.dwExtraInfo = KEY_MARK;
+ SendInput(2, in, sizeof(INPUT));
+}
+
+// Destaca o item no menu nativo também (o teclado continua coerente).
+void SelectNative(Level* l, int idx) {
+ // níveis abertos abaixo deste fecham antes (Esquerda fecha o submenu mais fundo)
+ while (g_levels.back() != l) { NativeKey(g_levels.back()->native, VK_LEFT); CloseLevel(g_levels.back()); }
+ PostMessageW(l->native, MN_SELECT, idx >= 0 ? l->items[idx].pos : (WPARAM)-1, 0); // sem esperar o outro programa
+}
+
+void OpenSub(Level* l, int idx) {
+ SelectNative(l, idx);
+ HMENU sub = GetSubMenu(l->menu, l->items[idx].pos);
+ Log(L"menu: abrindo submenu \"%ls\" (%d itens no nativo)", l->items[idx].label.c_str(), sub ? GetMenuItemCount(sub) : -1);
+ NativeKey(l->native, VK_RIGHT);
+ g_subFrom = l; g_subIdx = idx; g_subTry = 0;
+ SetTimer(g_host, T_SUBCHECK, 250, nullptr);
+}
+
+// Itens do menu da Área de Trabalho (Explorer) que abrem o Ajustes do Windows: vão para o nosso Ajustes
+// do Sistema, na página certa. "" = não é um desses.
+std::wstring OurSettingsPage(Level* l, const Item& it) {
+ DWORD pid = 0; GetWindowThreadProcessId(l->native, &pid);
+ HANDLE hp = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
+ wchar_t path[MAX_PATH] = {}; DWORD n = MAX_PATH;
+ bool explorer = hp && QueryFullProcessImageNameW(hp, 0, path, &n) && !_wcsicmp(wcsrchr(path, L'\\') ? wcsrchr(path, L'\\') + 1 : path, L"explorer.exe");
+ if (hp) CloseHandle(hp);
+ if (!explorer) return L"";
+ std::wstring t;
+ for (wchar_t c : it.label) if (c != L'&') t += towlower(c);
+ if (t == L"display settings" || t == L"configurações de exibição" || t == L"configurações de vídeo" || t == L"configurações da tela") return L"telas";
+ if (t == L"personalize" || t == L"personalizar") return L"fundo";
+ return L"";
+}
+
+void Choose(Level* l, int idx) {
+ auto& it = l->items[idx];
+ if (it.disabled || it.sep) return;
+ if (std::wstring page = OurSettingsPage(l, it); !page.empty()) { // o nosso Ajustes no lugar do Windows
+ Log(L"menu: \"%ls\" -> Ajustes do Sistema (%ls)", it.label.c_str(), page.c_str());
+ for (size_t k = 0; k < g_levels.size(); k++) Key(VK_ESCAPE); // fecha o menu nativo sem escolher nada
+ shell::OpenSettings(page);
+ return;
+ }
+ SelectNative(l, idx);
+ if (it.sub) { OpenSub(l, idx); return; } // o nativo abre o submenu; o nosso aparece no evento
+ // pisca o item escolhido, como no Mac, e confirma no nativo
+ l->hover = -1; Paint(*l); Sleep(70); // apaga e acende uma vez (o tempo do Mac)
+ l->hover = idx; Paint(*l);
+ // Confirma no nativo. Alguns programas ignoram a tecla mandada para a janela do menu (Omnisphere): se o
+ // menu ainda estiver aberto em 250 ms, tenta o clique interno do menu e depois a tecla simulada.
+ Log(L"menu: escolhido \"%ls\"", it.label.c_str());
+ NativeKey(l->native, VK_RETURN);
+ g_chooseNative = l->native; g_choosePos = it.pos; g_chooseIdx = idx; g_chooseTry = 0;
+ SetTimer(g_host, T_CHOOSECHECK, 250, nullptr);
+}
+
+LRESULT CALLBACK MouseHook(int code, WPARAM w, LPARAM lp) {
+ if (code == HC_ACTION) {
+ auto* ms = (MSLLHOOKSTRUCT*)lp;
+ bool over = false;
+ { std::lock_guard<std::mutex> lk(g_rmu); for (auto& r : g_rects) if (PtInRect(&r, ms->pt)) { over = true; break; } }
+ if (w == WM_MOUSEWHEEL && over) { // roda do mouse rola o menu longo
+ PostMessageW(g_host, WM_MENU_WHEEL, (WPARAM)(short)HIWORD(ms->mouseData), MAKELPARAM(ms->pt.x, ms->pt.y));
+ return 1;
+ }
+ if (w == WM_MOUSEMOVE) {
+ if (!g_movePending.exchange(true)) PostMessageW(g_host, WM_MENU_MOVE, 0, 0); // um aviso por vez
+ } else if (over) {
+ if (w == WM_LBUTTONUP || w == WM_RBUTTONUP) PostMessageW(g_host, WM_MENU_CLICK, ms->pt.x, ms->pt.y);
+ return 1; // clique nosso: o menu nativo não vê
+ }
+ // fora dos nossos: segue (o nativo, fora da tela, vê o clique fora e fecha)
+ }
+ return CallNextHookEx(nullptr, code, w, lp);
+}
+
+void HookThread() {
+ MSG m;
+ PeekMessageW(&m, nullptr, 0, 0, PM_NOREMOVE); // cria a fila de mensagens da thread
+ g_hookTid = GetCurrentThreadId();
+ while (GetMessageW(&m, nullptr, 0, 0)) {
+ if (m.message == WM_HOOK_ON && !g_mouse) g_mouse = SetWindowsHookExW(WH_MOUSE_LL, MouseHook, GetModuleHandleW(nullptr), 0);
+ if (m.message == WM_HOOK_OFF && g_mouse) { UnhookWindowsHookEx(g_mouse); g_mouse = nullptr; }
+ }
+}
+
+// Mouse numa setinha: rola sozinho (timer), como no Mac.
+Level* ArrowUnder(POINT pt, int* dir) {
+ for (int k = (int)g_levels.size() - 1; k >= 0; k--) {
+ Level* l = g_levels[k];
+ RECT wr; GetWindowRect(l->wnd, &wr);
+ if (!PtInRect(&wr, pt)) continue;
+ float y = (pt.y - wr.top) / l->scale;
+ if (UpArrow(*l) && y < ARROW) { *dir = -1; return l; }
+ if (DownArrow(*l) && y >= l->view - ARROW) { *dir = 1; return l; }
+ return nullptr;
+ }
+ return nullptr;
+}
+
+void ScrollBy(Level* l, float dy) {
+ float v = std::clamp(l->scroll + dy, 0.f, MaxScroll(*l));
+ if (v == l->scroll) return;
+ l->scroll = v;
+ // submenus abertos a partir deste nível fecham (o item que os abriu saiu do lugar)
+ while (g_levels.back() != l) { NativeKey(g_levels.back()->native, VK_LEFT); CloseLevel(g_levels.back()); }
+ Paint(*l);
+}
+
+void OnMove() {
+ g_movePending = false;
+ g_lastMouse = GetTickCount();
+ POINT pt; GetCursorPos(&pt);
+ { int dir = 0; if (ArrowUnder(pt, &dir)) SetTimer(g_host, T_SCROLL, 16, nullptr); }
+ Level* lv = nullptr; int idx = -1;
+ if (!HitAt(pt, &lv, &idx)) { // fora: tira o destaque do nível mais fundo (como no Mac)
+ if (!g_levels.empty() && g_levels.back()->hover >= 0 && !g_levels.back()->items[g_levels.back()->hover].sub) {
+ g_levels.back()->hover = -1; Paint(*g_levels.back());
+ }
+ return;
+ }
+ if (idx == lv->hover) return;
+ KillTimer(g_host, T_CHOOSECHECK);
+ lv->hover = idx;
+ Paint(*lv);
+ if (idx >= 0) SelectNative(lv, idx);
+ KillTimer(g_host, T_SUBMENU);
+ g_subWanted = -1;
+ if (idx >= 0 && lv->items[idx].sub && !lv->items[idx].disabled) { // submenu abre com um pequeno atraso
+ g_subWanted = idx;
+ SetTimer(g_host, T_SUBMENU, 200, nullptr);
+ }
+}
+
+void OnClick(POINT pt) {
+ Level* lv = nullptr; int idx = -1;
+ if (HitAt(pt, &lv, &idx) && idx >= 0) Choose(lv, idx);
+}
+
+void OpenLevel(HWND native, HMENU menu, RECT nr) {
+ auto* l = new Level;
+ l->native = native;
+ l->menu = menu;
+ ReadItems(*l);
+ if (l->items.empty()) {
+ Log(L"menu: sem itens com texto (%d no nativo), fica o nativo", GetMenuItemCount(menu));
+ SetPropW(native, L"ShellMenuLivre", (HANDLE)1); // antes de mover: a DLL não o manda de volta para fora
+ if (!g_levels.empty()) { // o pai está fora da tela: o nativo vem para perto do nosso
+ RECT pr; GetWindowRect(g_levels.back()->wnd, &pr);
+ SetWindowPos(native, HWND_TOPMOST, pr.right - 4, pr.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
+ } else SetWindowPos(native, nullptr, nr.left, nr.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); // volta ao lugar
+ ShowNative(native);
+ delete l; return;
+ }
+ POINT anchor{ nr.left, nr.top };
+ // submenu: ao lado do item do nível de cima
+ if (!g_levels.empty()) {
+ Level* p = g_levels.back();
+ RECT pr; GetWindowRect(p->wnd, &pr);
+ float top = p->hover >= 0 ? p->items[p->hover].r.top - p->scroll : 0;
+ anchor = { pr.right - (LONG)(4 * p->scale), pr.top + (LONG)((top - PADY) * p->scale) };
+ }
+ HMONITOR mon = MonitorFromPoint(anchor, MONITOR_DEFAULTTONEAREST);
+ UINT dx = 96, dy = 96; GetDpiForMonitor(mon, MDT_EFFECTIVE_DPI, &dx, &dy);
+ l->scale = dx / 96.f;
+ Measure(*l);
+ MONITORINFO mi{ sizeof(mi) }; GetMonitorInfoW(mon, &mi);
+ float room = (mi.rcWork.bottom - mi.rcWork.top) / l->scale - 8; // não cabe: fica da altura da tela e rola
+ if (l->h > room) l->view = room;
+ int wpx = (int)std::ceil(l->w * l->scale), hpx = (int)std::ceil(l->view * l->scale);
+ int x = anchor.x, y = anchor.y;
+ if (x + wpx > mi.rcWork.right) { // não cabe à direita: submenu abre para a esquerda do pai; menu encosta na borda
+ if (g_levels.empty()) x = mi.rcWork.right - wpx;
+ else { RECT pr; GetWindowRect(g_levels.back()->wnd, &pr); x = pr.left - wpx + (int)(4 * l->scale); }
+ }
+ if (y + hpx > mi.rcWork.bottom) y = mi.rcWork.bottom - (int)(4 * l->scale) - hpx;
+ if (y < mi.rcWork.top) y = mi.rcWork.top + (int)(4 * l->scale);
+ // tira o nativo da tela (continua aberto, recebendo o teclado)
+ if (!SetWindowPos(native, nullptr, -32000, -32000, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE)) { ShowNative(native); delete l; return; } // programa elevado: fica o nativo
+ // Duas janelas: atrás, só o desfoque (acrílico); na frente, o menu desenhado na GPU. O desfoque
+ // não pode ficar na mesma janela: ele seria pintado por cima do conteúdo da GPU.
+ // Vidro do Shell (o mesmo do Dock e do seletor): recorte arredondado liso de 12, como o menu do Tahoe.
+ // Sem ele, o acrílico do Windows com o canto de 8 do DWM (o jeito antigo).
+ l->back = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TRANSPARENT | WS_EX_NOREDIRECTIONBITMAP, L"ShellMenuMac", L"", WS_POPUP,
+ x, y, wpx, hpx, nullptr, nullptr, shell::inst, nullptr);
+ l->glass = backdrop::Attach(l->back);
+ DWORD corner = l->glass ? 1 /*sem arredondar*/ : 2;
+ if (!l->glass) {
+ DestroyWindow(l->back);
+ l->back = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TRANSPARENT, L"ShellMenuMac", L"", WS_POPUP,
+ x, y, wpx, hpx, nullptr, nullptr, shell::inst, nullptr);
+ DwmSetWindowAttribute(l->back, 33, &corner, sizeof(corner));
+ ui::Acrylic(l->back, ui::Dark() ? 0x60201E1Eu : 0x70F4F4F4u);
+ } else {
+ DwmSetWindowAttribute(l->back, 33, &corner, sizeof(corner));
+ // bem fosco e com tinta firme, como os menus de contexto: o texto não pode disputar com o que está atrás
+ // (a "Transparência do vidro" no mínimo deixava o menu quase nítido)
+ std::vector<backdrop::Piece> pcs{ { D2D1::RectF(0, 0, (float)wpx, (float)hpx), MENU_R * l->scale } };
+ backdrop::SetPieces(l->back, (float)wpx, (float)hpx, pcs,
+ ui::Dark() ? D2D1::ColorF(0.13f, 0.13f, 0.14f, 0.62f) : D2D1::ColorF(0.97f, 0.97f, 0.98f, 0.66f), 18.f);
+ }
+ l->wnd = CreateWindowExW(WS_EX_TOPMOST | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_NOREDIRECTIONBITMAP, L"ShellMenuMac", L"", WS_POPUP,
+ x, y, wpx, hpx, nullptr, nullptr, shell::inst, nullptr);
+ l->s.hwnd = l->wnd;
+ DwmSetWindowAttribute(l->wnd, 33, &corner, sizeof(corner));
+ COLORREF border = l->glass ? 0xFFFFFFFE /*DWMWA_COLOR_NONE*/ : ui::Dark() ? RGB(72, 72, 74) : RGB(198, 198, 202);
+ DwmSetWindowAttribute(l->wnd, 34, &border, sizeof(border));
+ g_levels.push_back(l);
+ Paint(*l); // desenha antes de aparecer: sem um quadro vazio piscando
+ UpdateRects();
+ // Com o vidro do Shell: mostra só depois que o vidro desenhado chegou à tela (em menu grande ele demora
+ // mais, e aparecendo antes o menu piscava transparente). Sem resposta em 60 ms, mostra assim mesmo.
+ if (l->glass) { backdrop::AfterCommit(g_host, WM_MENU_SHOWNOW); SetTimer(g_host, T_SHOWNOW, 60, nullptr); }
+ else { ShowWindow(l->back, SW_SHOWNOACTIVATE); ShowWindow(l->wnd, SW_SHOWNOACTIVATE); }
+}
+
+void CALLBACK OnFocus(HWINEVENTHOOK, DWORD, HWND hwnd, LONG obj, LONG child, DWORD, DWORD) {
+ // teclado no menu nativo: o destaque muda e o nosso acompanha (child = posição + 1)
+ Level* l = LevelOf(hwnd);
+ if (!l || obj != OBJID_CLIENT || child <= 0) return;
+ if (GetTickCount() - g_lastMouse < 400) return; // é o eco do nosso próprio destaque: o mouse manda
+ for (int i = 0; i < (int)l->items.size(); i++)
+ if (l->items[i].pos == child - 1 && l->hover != i) { l->hover = i; Reveal(*l, i); Paint(*l); }
+}
+
+// Submenu grande (centenas de itens): o Windows leva um tempo montando e mostra a janela antes do aviso
+// de "abriu" chegar até nós, e ela piscava no canto. Enquanto há menu nosso aberto, todo menu nativo novo
+// fica invisível (alfa 0) assim que a janela nasce; se não der para trocar pelo nosso, volta a aparecer.
+void CALLBACK OnCreate(HWINEVENTHOOK, DWORD, HWND hwnd, LONG obj, LONG, DWORD, DWORD) {
+ if (obj != OBJID_WINDOW || !hwnd) return;
+ wchar_t cls[16] = {}; GetClassNameW(hwnd, cls, 16);
+ if (wcscmp(cls, L"#32768")) return;
+ LONG_PTR ex = GetWindowLongPtrW(hwnd, GWL_EXSTYLE);
+ if (!(ex & WS_EX_LAYERED)) SetWindowLongPtrW(hwnd, GWL_EXSTYLE, ex | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(hwnd, 0, 0, LWA_ALPHA);
+}
+
+void ShowNative(HWND hwnd) { // o nativo fica de verdade (não conseguimos ler os itens)
+ SetPropW(hwnd, L"ShellMenuLivre", (HANDLE)1); // a DLL dentro do programa para de mandá-lo para fora da tela
+ BYTE a = 0; DWORD fl = 0;
+ if (GetLayeredWindowAttributes(hwnd, nullptr, &a, &fl) && (fl & LWA_ALPHA) && a == 0) SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
+}
+
+void StartHooks() {
+ if (g_hookTid) PostThreadMessageW(g_hookTid, WM_HOOK_ON, 0, 0);
+ if (!g_createHook) g_createHook = SetWinEventHook(EVENT_OBJECT_CREATE, EVENT_OBJECT_CREATE, nullptr, OnCreate, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
+ if (!g_focusHook) g_focusHook = SetWinEventHook(EVENT_OBJECT_FOCUS, EVENT_OBJECT_FOCUS, nullptr, OnFocus, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
+}
+
+void StopHooks() {
+ if (g_hookTid) PostThreadMessageW(g_hookTid, WM_HOOK_OFF, 0, 0);
+ if (g_focusHook) { UnhookWinEvent(g_focusHook); g_focusHook = nullptr; }
+ if (g_createHook) { UnhookWinEvent(g_createHook); g_createHook = nullptr; }
+ KillTimer(g_host, T_SUBMENU);
+ KillTimer(g_host, T_SUBCHECK);
+ KillTimer(g_host, T_CHOOSECHECK);
+ KillTimer(g_host, T_SCROLL);
+}
+
+void CALLBACK OnMenu(HWINEVENTHOOK, DWORD ev, HWND hwnd, LONG, LONG, DWORD, DWORD) {
+ switch (ev) {
+ case EVENT_SYSTEM_MENUPOPUPSTART: {
+ wchar_t cls[16] = {}; GetClassNameW(hwnd, cls, 16);
+ if (wcscmp(cls, L"#32768")) return;
+ DWORD pid = 0; GetWindowThreadProcessId(hwnd, &pid);
+ if (pid == g_selfPid) return;
+ // Tira o nativo da tela já, antes de perguntar qualquer coisa ao programa: a pergunta leva alguns
+ // milissegundos e o menu do Windows piscava no lugar dele (no Serum, no canto de cima à esquerda).
+ RECT nr; GetWindowRect(hwnd, &nr);
+ // a DLL dentro do programa já o mandou para fora da tela antes de aparecer: o lugar dele ficou guardado
+ if (HANDLE px = GetPropW(hwnd, L"ShellMenuX")) {
+ int ox = (int)(INT_PTR)px - 40000, oy = (int)(INT_PTR)GetPropW(hwnd, L"ShellMenuY") - 40000;
+ OffsetRect(&nr, ox - nr.left, oy - nr.top);
+ }
+ bool moved = SetWindowPos(hwnd, nullptr, -32000, -32000, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE) != 0;
+ DWORD_PTR r = 0;
+ BOOL ok = SendMessageTimeoutW(hwnd, MN_GETHMENU, 0, 0, SMTO_ABORTIFHUNG, 600, &r);
+ Log(L"menu: nativo abriu (pid %lu, nível %d, %ld,%ld %ldx%ld, hmenu %p, %d itens%ls)", pid, (int)g_levels.size(), nr.left, nr.top,
+ nr.right - nr.left, nr.bottom - nr.top, (void*)r, r && IsMenu((HMENU)r) ? GetMenuItemCount((HMENU)r) : -1, ok ? L"" : L", sem resposta");
+ if (!ok || !r || !IsMenu((HMENU)r)) {
+ // submenu que não conseguimos ler: o nativo nasceu ao lado do pai, que está fora da tela; traz para perto do nosso
+ SetPropW(hwnd, L"ShellMenuLivre", (HANDLE)1); // antes de mover: a DLL não o manda de volta para fora
+ if (!g_levels.empty()) {
+ RECT pr; GetWindowRect(g_levels.back()->wnd, &pr);
+ SetWindowPos(hwnd, HWND_TOPMOST, pr.right - 4, pr.top, 0, 0, SWP_NOSIZE | SWP_NOACTIVATE);
+ } else if (moved) SetWindowPos(hwnd, nullptr, nr.left, nr.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ ShowNative(hwnd);
+ return;
+ }
+ StartHooks();
+ OpenLevel(hwnd, (HMENU)r, nr);
+ break;
+ }
+ case EVENT_SYSTEM_MENUPOPUPEND:
+ if (Level* l = LevelOf(hwnd)) {
+ while (!g_levels.empty() && g_levels.back() != l) CloseLevel(g_levels.back());
+ CloseLevel(l);
+ if (g_levels.empty()) StopHooks();
+ }
+ break;
+ case EVENT_SYSTEM_MENUEND:
+ if (!g_levels.empty()) CloseAll();
+ break;
+ }
+}
+
+LRESULT CALLBACK HostProc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ if (m == WM_MENU_MOVE) { OnMove(); return 0; }
+ if (m == WM_MENU_CLICK) { OnClick({ (LONG)w, (LONG)l }); return 0; }
+ if (m == WM_MENU_SHOWNOW || (m == WM_TIMER && w == T_SHOWNOW)) { // o vidro já está na tela: mostra os níveis novos
+ if (m == WM_TIMER) KillTimer(h, T_SHOWNOW);
+ for (auto* lv : g_levels)
+ if (!IsWindowVisible(lv->wnd)) { ShowWindow(lv->back, SW_SHOWNOACTIVATE); ShowWindow(lv->wnd, SW_SHOWNOACTIVATE); }
+ return 0;
+ }
+ if (m == WM_MENU_WHEEL) {
+ POINT pt{ (short)LOWORD(l), (short)HIWORD(l) };
+ Level* lv = nullptr;
+ for (auto* x : g_levels) { RECT wr; GetWindowRect(x->wnd, &wr); if (PtInRect(&wr, pt)) lv = x; }
+ if (lv && Scrolls(*lv)) {
+ ScrollBy(lv, -(float)(short)w / WHEEL_DELTA * ROW * 3);
+ Level* hit = nullptr; int idx = -1;
+ if (HitAt(pt, &hit, &idx) && hit == lv) { lv->hover = idx; Paint(*lv); }
+ }
+ return 0;
+ }
+ if (m == WM_TIMER && w == T_SCROLL) {
+ POINT pt; GetCursorPos(&pt);
+ int dir = 0;
+ Level* lv = ArrowUnder(pt, &dir);
+ if (!lv) { KillTimer(h, T_SCROLL); return 0; }
+ lv->hover = -1;
+ ScrollBy(lv, dir * 6.f);
+ return 0;
+ }
+ if (m == WM_TIMER && w == T_CHOOSECHECK) {
+ KillTimer(h, T_CHOOSECHECK);
+ HWND nat = g_chooseNative;
+ Level* l = LevelOf(nat);
+ // fechou (o programa recebeu) ou o mouse já está em outro item: não insiste
+ if (!l || !IsWindow(nat) || !IsWindowVisible(nat) || l->hover != g_chooseIdx) return 0;
+ int pos = g_choosePos;
+ g_chooseTry++;
+ if (g_chooseTry == 1) {
+ Log(L"menu: a tecla não escolheu; tentando o clique interno do menu");
+ PostMessageW(l->native, MN_SELECT, pos, 0);
+ PostMessageW(l->native, MN_BTNDOWN, pos, 0);
+ PostMessageW(l->native, MN_BTNUP, pos, 0);
+ } else {
+ Log(L"menu: o programa não aceitou a escolha");
+ return 0;
+ }
+ SetTimer(h, T_CHOOSECHECK, 250, nullptr);
+ return 0;
+ }
+ if (m == WM_TIMER && w == T_SUBCHECK) {
+ KillTimer(h, T_SUBCHECK);
+ Level* l = g_subFrom;
+ bool alive = std::find(g_levels.begin(), g_levels.end(), l) != g_levels.end();
+ if (!alive || g_levels.back() != l || l->hover != g_subIdx) return 0; // abriu (há nível novo) ou o mouse saiu
+ g_subTry++;
+ if (g_subTry == 1) {
+ Log(L"menu: submenu não abriu pela tecla; tentando MN_OPENHIERARCHY");
+ PostMessageW(l->native, MN_SELECT, l->items[g_subIdx].pos, 0);
+ PostMessageW(l->native, MN_OPENHIER, 0, 0);
+ } else if (g_subTry == 2) {
+ Log(L"menu: tentando tecla simulada");
+ PostMessageW(l->native, MN_SELECT, l->items[g_subIdx].pos, 0);
+ Key(VK_RIGHT);
+ } else {
+ Log(L"menu: submenu não abriu");
+ return 0;
+ }
+ SetTimer(h, T_SUBCHECK, 250, nullptr);
+ return 0;
+ }
+ if (m == WM_TIMER && w == T_SUBMENU) {
+ KillTimer(h, T_SUBMENU);
+ if (!g_levels.empty() && g_subWanted >= 0) {
+ Level* lv = g_levels.back();
+ // o pedido é sempre do nível de cima com o mouse; acha qual
+ for (auto* x : g_levels) if (x->hover == g_subWanted && x->items[g_subWanted].sub) lv = x;
+ if (lv->hover == g_subWanted) OpenSub(lv, g_subWanted);
+ }
+ g_subWanted = -1;
+ return 0;
+ }
+ return DefWindowProcW(h, m, w, l);
+}
+
+} // namespace
+
+void menus::Start() {
+ if (shell::Setting(L"menus_do_windows", L"1") != L"1") return;
+ g_selfPid = GetCurrentProcessId();
+ WNDCLASSW pc{}; pc.lpfnWndProc = PopupProc; pc.hInstance = shell::inst; pc.lpszClassName = L"ShellMenuMac";
+ pc.hCursor = LoadCursorW(nullptr, IDC_ARROW);
+ RegisterClassW(&pc);
+ WNDCLASSW hc{}; hc.lpfnWndProc = HostProc; hc.hInstance = shell::inst; hc.lpszClassName = L"ShellMenusHost";
+ RegisterClassW(&hc);
+ g_host = CreateWindowExW(0, hc.lpszClassName, L"", 0, 0, 0, 0, 0, HWND_MESSAGE, nullptr, shell::inst, nullptr);
+ std::thread(HookThread).detach();
+ g_menuHook = SetWinEventHook(EVENT_SYSTEM_MENUSTART, EVENT_SYSTEM_MENUPOPUPEND, nullptr, OnMenu, 0, 0,
+ WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS);
+ Log(L"menus do Windows: interceptando (%ls)", g_menuHook ? L"ok" : L"falhou");
+}
+
+void menus::Stop() {
+ CloseAll(false);
+ if (g_menuHook) UnhookWinEvent(g_menuHook);
+ g_menuHook = nullptr;
+}
diff --git a/src/shell/notificacoes.cpp b/src/shell/notificacoes.cpp
index fc67b0b..83db541 100644
--- a/src/shell/notificacoes.cpp
+++ b/src/shell/notificacoes.cpp
@@ -62,7 +62,7 @@ const float GAP = 8, GROUP_GAP = 10, PEEK = 7, PEEK_INSET = 10;
const float HEADER_H = 26, PILL_H = 24, CIRCLE = 24;
const float WIDGET_S = 164, WIDGET_GAP = 16, WIDGET_R_SEQ = 20;
// Tahoe (Tema nos Ajustes): cartões e widgets bem mais redondos, com o contorno especular do Liquid Glass
-inline float CardR() { return liquid::On() ? 22.f : CARD_R_SEQ; }
+inline float CardR() { return liquid::Golden() ? 18.f : liquid::On() ? 22.f : CARD_R_SEQ; } // macOS 27: ~18 (captura 2x)
inline float WidgetR() { return liquid::On() ? 26.f : WIDGET_R_SEQ; }
const int MAX_GROUPS = 6; // grupos mostrados antes de "N notificações a mais"
@@ -70,6 +70,7 @@ const UINT WM_NC_FRAME = WM_APP + 90, WM_NC_DATA = WM_APP + 91, WM_NC_NEW = WM_A
const UINT_PTR T_TICK = 1;
HWND g_wnd, g_back;
+bool IsOurBanner(HWND h) { wchar_t c[64] = {}; GetClassNameW(h, c, 64); return wcsstr(c, L"Notifica") != nullptr || wcsstr(c, L"Banner") != nullptr; }
ui::GpuSurface g_s;
bool g_open, g_closing, g_menu;
double g_slideAt; // ms (anim::Now) do começo da animação de entrar/sair
@@ -499,6 +500,16 @@ std::vector<El> Layout() {
out.push_back(e);
y += 30 + GROUP_GAP;
}
+ if (liquid::Golden() && !g_groups.empty()) {
+ // macOS 27 (captura Notification-Center): título "Central de Notificações" em negrito de 17 e, à direita, o × num
+ // círculo cinza que limpa tudo (no lugar do "Limpar" de baixo)
+ El h{ L"h:central", K_HEADER, D2D1::RectF(0, y, CARD_W, y + 30) };
+ h.text = Tr(L"Central de Notificações"); h.layer = 7;
+ out.push_back(h);
+ El x{ L"hx:central", K_CIRCLE, D2D1::RectF(CARD_W - 20, y + 5, CARD_W, y + 25), A_CLEAR_ALL };
+ out.push_back(x);
+ y += 30 + 6;
+ }
int shown = 0, hiddenNotes = 0;
for (int gi = 0; gi < (int)g_groups.size(); gi++) {
auto& g = g_groups[gi];
@@ -552,7 +563,7 @@ std::vector<El> Layout() {
y += h2 + PEEK * layers + GROUP_GAP;
}
}
- if (hiddenNotes > 0 || g_groups.size() > 1) {
+ if (hiddenNotes > 0 || (g_groups.size() > 1 && !liquid::Golden())) {
El p{ L"p:list", K_PILL };
if (hiddenNotes > 0) { p.act = A_MORE; p.text = std::to_wstring(hiddenNotes) + (hiddenNotes == 1 ? Tr(L" notificação a mais") : Tr(L" notificações a mais")); }
else { p.act = A_CLEAR_ALL; p.text = Tr(L"Limpar"); }
@@ -879,7 +890,8 @@ void Paint() {
break;
}
case K_HEADER: {
- IDWriteTextFormat* tf = g_tfHeader;
+ static IDWriteTextFormat* tfBig = Fmt(17, DWRITE_FONT_WEIGHT_BOLD, L"SF Pro Display");
+ IDWriteTextFormat* tf = e.layer == 7 && tfBig ? tfBig : g_tfHeader;
Text(dc, br, e.text, tf, D2D1::RectF(r.left + 2, r.top, r.right - 150, r.bottom), D2D1::ColorF(1, 1, 1, 0.97f), DWRITE_TEXT_ALIGNMENT_LEADING, true);
break;
}
@@ -1175,7 +1187,21 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
Animate();
return 0;
case WM_KEYDOWN: if (w == VK_ESCAPE) Close(); return 0;
- case WM_ACTIVATE: if (LOWORD(w) == WA_INACTIVE && !g_menu) Close(); return 0;
+ case WM_ACTIVATE:
+ if (LOWORD(w) == WA_INACTIVE && !g_menu) {
+ // a ativação foi para outra janela do próprio Shell (o vidro de trás, o banner, a barra): não fecha. Antes um
+ // clique que caía no vidro (g_back) ou um menu da barra tirava o foco e a Central sumia da tela
+ HWND to = (HWND)l; DWORD pid = 0;
+ if (to) GetWindowThreadProcessId(to, &pid);
+ if (to && pid == GetCurrentProcessId() && (to == g_back || GetAncestor(to, GA_ROOTOWNER) == g_wnd || IsOurBanner(to))) {
+ SetForegroundWindow(g_wnd);
+ return 0;
+ }
+ wchar_t cls[64] = {}; if (to) GetClassNameW(to, cls, 64);
+ Log(L"notificações: fechou (perdeu o foco para %ls)", cls);
+ Close();
+ }
+ return 0;
case WM_DPICHANGED: if (g_open) { Place(); Paint(); } return 0;
}
return DefWindowProcW(h, m, w, l);
diff --git a/src/shell/progresso.cpp b/src/shell/progresso.cpp
index 31d3048..cf7dcb4 100644
--- a/src/shell/progresso.cpp
+++ b/src/shell/progresso.cpp
@@ -27,7 +27,14 @@
namespace {
const UINT WM_PG_SHOWN = WM_APP + 90, WM_PG_SNAP = WM_APP + 91, WM_PG_FRAME = WM_APP + 92;
-const float W = 452, ROW = 68, PAD = 16, ICON = 38, BTN = 16;
+// macOS 27 Golden Gate (Finder-Copy.png, 2x): janela opaca de 404 de largura, sem título, botões da janela de 14
+// centrados em (16, 16) a cada 23, cantos 16; cada cópia em 56: documento de 32 a 22 da borda, texto a 62, barra azul
+// de 8 de altura até 33 da borda direita, o "x" cinza de 11 depois dela e a linha de baixo em cinza de 13
+#define W (liquid::Golden() ? 404.f : 452.f)
+#define ROW (liquid::Golden() ? 56.f : 68.f)
+#define PAD (liquid::Golden() ? 22.f : 16.f)
+#define ICON (liquid::Golden() ? 32.f : 38.f)
+#define BTN (liquid::Golden() ? 11.f : 16.f)
enum Kind { K_COPY, K_MOVE, K_DELETE, K_EXTRACT, K_COMPRESS, K_OTHER };
@@ -77,7 +84,7 @@ std::thread g_worker;
float Sc() { return ui::Scale(g_wnd); }
bool Tahoe() { return liquid::On(); }
float TitleH() { return Tahoe() ? 32.f : 28.f; }
-float Radius() { return Tahoe() ? 22.f : 10.f; }
+float Radius() { return liquid::Golden() ? 16.f : Tahoe() ? 22.f : 10.f; }
float PanelH() { return TitleH() + std::max<size_t>(g_rows.size(), 1) * ROW + 6; }
std::wstring Lower(std::wstring s) { for (auto& c : s) c = towlower(c); return s; }
@@ -376,8 +383,10 @@ std::wstring Title() {
// ---------------------------------------------------------------------------
// Desenho
-D2D1_RECT_F CloseRect() { float cy = TitleH() / 2, d = Tahoe() ? 14.f : 12.f; return { 13, cy - d / 2, 13 + d, cy + d / 2 }; }
-D2D1_RECT_F StopRect(int i) { float y = TitleH() + i * ROW + 31; return { W - PAD - BTN, y - BTN / 2, W - PAD, y + BTN / 2 }; }
+D2D1_RECT_F CloseRect() { float cy = TitleH() / 2, d = Tahoe() ? 14.f : 12.f, x = liquid::Golden() ? 9.f : 13.f; return { x, cy - d / 2, x + d, cy + d / 2 }; }
+D2D1_RECT_F StopRect(int i) {
+ if (liquid::Golden()) { float y = TitleH() + i * ROW + 23.5f; return { W - 14 - BTN, y - BTN / 2, W - 14, y + BTN / 2 }; }
+ float y = TitleH() + i * ROW + 31; return { W - PAD - BTN, y - BTN / 2, W - PAD, y + BTN / 2 }; }
D2D1_RECT_F PauseRect(int i) { auto r = StopRect(i); return { r.left - BTN - 8, r.top, r.left - 8, r.bottom }; }
bool In(const D2D1_RECT_F& r, D2D1_POINT_2F p) { return p.x >= r.left - 3 && p.x < r.right + 3 && p.y >= r.top - 3 && p.y < r.bottom + 3; }
@@ -414,9 +423,10 @@ void Paint() {
float sc = Sc();
float H = PanelH();
int wpx = (int)std::lround(W * sc), hpx = (int)std::lround(H * sc);
- bool dark = ui::Dark(), tahoe = Tahoe();
+ bool dark = ui::Dark(), tahoe = Tahoe(), golden = liquid::Golden();
const float R = Radius();
if (g_glass) backdrop::SetPieces(g_back, (float)wpx, (float)hpx, { { D2D1::RectF(0, 0, (float)wpx, (float)hpx), R * sc } },
+ golden ? (dark ? D2D1::ColorF(0.17f, 0.17f, 0.17f, 0.98f) : D2D1::ColorF(1, 1, 1, 0.98f)) : // macOS 27: janela opaca
dark ? D2D1::ColorF(0.15f, 0.15f, 0.16f, tahoe ? 0.62f : 0.84f) : D2D1::ColorF(0.95f, 0.95f, 0.96f, tahoe ? 0.55f : 0.80f), 30.f);
ID2D1DeviceContext* dc = g_glass ? backdrop::ContentBegin(g_back, wpx, hpx, sc) : nullptr;
g_inGlass = dc != nullptr;
@@ -429,7 +439,10 @@ void Paint() {
br->SetColor(dark ? D2D1::ColorF(0.17f, 0.17f, 0.18f, 0.97f) : D2D1::ColorF(0.95f, 0.95f, 0.96f, 0.97f));
dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0, 0, W, H), R, R), br);
}
- if (tahoe) liquid::Rim(dc, D2D1::RectF(0, 0, W, H), R, dark);
+ if (golden) {
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(0, 0, 0, 0.10f));
+ dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.5f, 0.5f, W - 0.5f, H - 0.5f), R - 0.5f, R - 0.5f), br, 1);
+ } else if (tahoe) liquid::Rim(dc, D2D1::RectF(0, 0, W, H), R, dark);
else {
br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.16f) : D2D1::ColorF(0, 0, 0, 0.14f));
dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.5f, 0.5f, W - 0.5f, H - 0.5f), R - 0.5f, R - 0.5f), br, 1);
@@ -444,7 +457,9 @@ void Paint() {
for (int k = 0; k < 3; k++) {
D2D1_ELLIPSE e = D2D1::Ellipse({ c.left + d / 2 + k * (d + gap), (c.top + c.bottom) / 2 }, d / 2, d / 2);
br->SetColor(k == 0 ? semaforo::Close() : (dark ? D2D1::ColorF(1, 1, 1, 0.16f) : D2D1::ColorF(0, 0, 0, 0.13f)));
+ if (golden && k == 1) br->SetColor(D2D1::ColorF(0.996f, 0.737f, 0.18f)); // macOS 27: minimizar aceso, zoom apagado
dc->FillEllipse(e, br);
+ semaforo::Gloss(dc, e.point, d / 2, br);
if (k == 0) {
br->SetColor(D2D1::ColorF(0.75f, 0.2f, 0.18f, 0.6f));
dc->DrawEllipse(D2D1::Ellipse(e.point, d / 2 - 0.25f, d / 2 - 0.25f), br, 0.5f);
@@ -459,12 +474,12 @@ void Paint() {
IDWriteTextFormat* tt = Trimmed(13, DWRITE_FONT_WEIGHT_SEMI_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
if (tt) tt->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.80f) : D2D1::ColorF(0, 0, 0, 0.75f));
- DrawText(dc, Title(), tt, D2D1::RectF(90, 0, W - 90, TitleH()), br);
+ if (!golden) DrawText(dc, Title(), tt, D2D1::RectF(90, 0, W - 90, TitleH()), br); // macOS 27: sem título
if (tt) tt->Release();
}
IDWriteTextFormat* t1 = Trimmed(12.5f, DWRITE_FONT_WEIGHT_NORMAL);
- IDWriteTextFormat* t2 = Trimmed(11, DWRITE_FONT_WEIGHT_NORMAL);
+ IDWriteTextFormat* t2 = Trimmed(golden ? 13.f : 11.f, DWRITE_FONT_WEIGHT_NORMAL);
const D2D1_COLOR_F accent = dark ? D2D1::ColorF(0.04f, 0.52f, 1.0f) : D2D1::ColorF(0.0f, 0.48f, 1.0f);
float now = (float)(anim::Now() / 1000.0);
for (int i = 0; i < (int)g_rows.size(); i++) {
@@ -474,14 +489,14 @@ void Paint() {
br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.10f) : D2D1::ColorF(0, 0, 0, 0.09f));
dc->FillRectangle(D2D1::RectF(PAD + ICON + 12, y, W - PAD, y + 1 / std::max(1.f, Sc())), br);
}
- D2D1_RECT_F ic = D2D1::RectF(PAD, y + 14, PAD + ICON, y + 14 + ICON);
+ D2D1_RECT_F ic = golden ? D2D1::RectF(PAD, y + 8, PAD + ICON, y + 8 + ICON) : D2D1::RectF(PAD, y + 14, PAD + ICON, y + 14 + ICON);
if (r.kind == K_DELETE) ui::DrawTrash(dc, ic, true);
else ui::DrawFolder(dc, ic, 0);
- float x0 = PAD + ICON + 12, xr = (r.canPause ? PauseRect(i).left : StopRect(i).left) - 10;
+ float x0 = golden ? 62.f : PAD + ICON + 12, xr = (r.canPause ? PauseRect(i).left : StopRect(i).left) - 10;
br->SetColor(text);
- DrawText(dc, r.line1, t1, D2D1::RectF(x0, y + 9, W - PAD, y + 26), br);
+ DrawText(dc, r.line1, t1, golden ? D2D1::RectF(x0, y + 4, W - 14, y + 20) : D2D1::RectF(x0, y + 9, W - PAD, y + 26), br);
// barra fina do Mac: trilho cinza e o azul crescendo (calculando: um pedaço indo e voltando)
- float bh = tahoe ? 6.f : 5.f, by = y + 31 - bh / 2;
+ float bh = golden ? 8.f : tahoe ? 6.f : 5.f, by = golden ? y + 23.5f - bh / 2 : y + 31 - bh / 2;
D2D1_RECT_F track = D2D1::RectF(x0, by, xr, by + bh);
br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.14f) : D2D1::ColorF(0, 0, 0, 0.10f));
dc->FillRoundedRectangle(D2D1::RoundedRect(track, bh / 2, bh / 2), br);
@@ -497,7 +512,7 @@ void Paint() {
dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(track.left, by, track.left + wfill, by + bh), bh / 2, bh / 2), br);
}
br->SetColor(gray);
- DrawText(dc, r.line2, t2, D2D1::RectF(x0, y + 40, W - PAD, y + 56), br);
+ DrawText(dc, r.line2, t2, golden ? D2D1::RectF(x0, y + 33, W - 14, y + 51) : D2D1::RectF(x0, y + 40, W - PAD, y + 56), br);
// pausar/continuar e parar: círculos cinza com o desenho branco (o "xmark.circle.fill" do Mac)
for (int b = r.canPause ? 0 : 1; b < 2; b++) {
D2D1_RECT_F rc = b == 0 ? PauseRect(i) : StopRect(i);
diff --git a/src/shell/quicklook.cpp b/src/shell/quicklook.cpp
index 18d5bf2..eeb53c9 100644
--- a/src/shell/quicklook.cpp
+++ b/src/shell/quicklook.cpp
@@ -3,16 +3,27 @@
// Windows (fotos, PDFs, vídeos e documentos com visualizador instalado) ou o texto, nos arquivos de texto.
// Barra de cima: fechar à esquerda, nome no meio, "Abrir com <app>" à direita. Arrasta pela barra.
#include "shell.h"
+#include <shlobj.h>
+#include <shobjidl.h>
+#include <dwmapi.h>
+#include <windowsx.h>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
#include <algorithm>
#include <cmath>
#include <thread>
#include "../comum/idioma.h"
+#include "../comum/barra_video.h"
+#include <mfplay.h>
+#include <mfapi.h>
+#pragma comment(lib, "mfplay.lib")
+#pragma comment(lib, "mfplat.lib")
+#pragma comment(lib, "mfuuid.lib")
namespace {
const UINT WM_QL_READY = WM_APP + 91;
+const UINT WM_QL_MEDIA = WM_APP + 92; // evento do MFPlay (vídeo/música pronto, terminou, erro)
const float BAR = 38, R = 12, PAD = 0;
HWND g_wnd;
ui::Surface g_s;
@@ -23,10 +34,97 @@ ID2D1RenderTarget* g_bmpRt;
int g_gen;
bool g_loading, g_hoverClose, g_hoverOpen;
IDWriteTextFormat *g_tfTitle, *g_tfBtn, *g_tfText;
-D2D1_RECT_F g_closeR, g_openR;
+D2D1_RECT_F g_closeR, g_openR, g_shareR;
+// Golden Gate: vidro fosco de verdade (o mesmo dos menus de contexto) numa janela atrás (g_back), com o desenho
+// dentro do vidro; a g_wnd (camadas, quase invisível) só recebe o mouse e o teclado. Arrasta por qualquer ponto.
+HWND g_back;
+bool g_glass, g_hoverShare, g_hoverFull, g_hoverRot, g_hoverMark;
+bool g_full; // botão de tela cheia: a prévia ocupa o monitor
+D2D1_RECT_F g_fullR, g_rotR, g_markR;
+bool g_dragging; POINT g_dragFrom, g_dragOrg; // arrastar o painel
+// Vídeo e música (Golden Gate, como no Mac): o MFPlay toca numa janela própria por cima do vidro (g_vid, na moldura
+// de 5, cantos 15) e a barra do QuickTime (barra_video.h) fica numa janela em camadas (g_ctl) com o vidro fosco
+// (acrílico, g_ctlBack) atrás. Vídeo: a barra aparece com o mouse e some 2,5 s depois. Música: o ícone (ou a capa) e
+// a barra sempre visível embaixo.
+IMFPMediaPlayer* g_mp;
+HWND g_vid, g_ctl, g_ctlBack;
+bool g_media, g_hasVideo, g_scrub, g_ended;
+float g_vol = 1;
+DWORD g_ctlMoveAt;
+std::vector<barravideo::Hit> g_vhits;
+const float CTL_DOWN = 20; // a barra fica a 20 do fundo da moldura
+
+bool IsMediaPath(const std::wstring& p, bool* video = nullptr) {
+ std::wstring x = PathFindExtensionW(p.c_str());
+ for (auto& c : x) c = towlower(c);
+ for (auto e : { L".mp4", L".mov", L".m4v", L".mkv", L".avi", L".wmv", L".webm" }) if (x == e) { if (video) *video = true; return true; }
+ for (auto e : { L".mp3", L".m4a", L".flac", L".wav", L".aac", L".ogg", L".wma", L".aif", L".aiff", L".opus" }) if (x == e) { if (video) *video = false; return true; }
+ return false;
+}
+
+class MediaCb : public IMFPMediaPlayerCallback {
+ LONG ref = 1;
+public:
+ STDMETHODIMP QueryInterface(REFIID riid, void** p) override {
+ if (riid == IID_IUnknown || riid == __uuidof(IMFPMediaPlayerCallback)) { *p = this; AddRef(); return S_OK; }
+ *p = nullptr; return E_NOINTERFACE;
+ }
+ STDMETHODIMP_(ULONG) AddRef() override { return InterlockedIncrement(&ref); }
+ STDMETHODIMP_(ULONG) Release() override { LONG r = InterlockedDecrement(&ref); if (!r) delete this; return r; }
+ void STDMETHODCALLTYPE OnMediaPlayerEvent(MFP_EVENT_HEADER* e) override {
+ if (!e) return;
+ HWND w = FindWindowW(L"ShellQuickLook", nullptr);
+ if (e->eEventType == MFP_EVENT_TYPE_MEDIAITEM_SET) PostMessageW(w, WM_QL_MEDIA, 1, FAILED(e->hrEvent));
+ else if (e->eEventType == MFP_EVENT_TYPE_PLAYBACK_ENDED) PostMessageW(w, WM_QL_MEDIA, 2, 0);
+ else if (e->eEventType == MFP_EVENT_TYPE_ERROR) PostMessageW(w, WM_QL_MEDIA, 3, e->hrEvent);
+ }
+};
+MediaCb* g_mcb;
+
+double MPos() { if (!g_mp) return 0; PROPVARIANT v; PropVariantInit(&v); double s = 0; if (SUCCEEDED(g_mp->GetPosition(MFP_POSITIONTYPE_100NS, &v)) && v.vt == VT_I8) s = v.hVal.QuadPart / 1e7; PropVariantClear(&v); return s; }
+double MLen() { if (!g_mp) return 0; PROPVARIANT v; PropVariantInit(&v); double s = 0; if (SUCCEEDED(g_mp->GetDuration(MFP_POSITIONTYPE_100NS, &v)) && v.vt == VT_UI8) s = v.uhVal.QuadPart / 1e7; PropVariantClear(&v); return s; }
+bool MPlaying() { MFP_MEDIAPLAYER_STATE st = MFP_MEDIAPLAYER_STATE_EMPTY; if (g_mp) g_mp->GetState(&st); return st == MFP_MEDIAPLAYER_STATE_PLAYING; }
+void MSeek(double s) {
+ if (!g_mp) return;
+ double len = MLen(); s = std::clamp(s, 0.0, len > 0 ? len - 0.05 : s);
+ PROPVARIANT v; PropVariantInit(&v); v.vt = VT_I8; v.hVal.QuadPart = (LONGLONG)(s * 1e7);
+ g_mp->SetPosition(MFP_POSITIONTYPE_100NS, &v);
+ g_ended = false;
+}
+void MToggle() { if (!g_mp) return; if (MPlaying()) g_mp->Pause(); else { if (g_ended) MSeek(0); g_mp->Play(); } }
+void MediaStop() {
+ if (g_mp) { g_mp->Shutdown(); g_mp->Release(); g_mp = nullptr; }
+ g_media = g_hasVideo = g_scrub = g_ended = false;
+ if (g_vid) ShowWindow(g_vid, SW_HIDE);
+ if (g_ctl) ShowWindow(g_ctl, SW_HIDE);
+ if (g_ctlBack) ShowWindow(g_ctlBack, SW_HIDE);
+ if (g_wnd) KillTimer(g_wnd, 7);
+}
+const float GG_R = 20; // cantos do painel (a foto: 15, concêntrica com a moldura de 5)
+bool g_isIcon; // sem prévia (pasta, arquivo sem miniatura): ícone grande e informações
+std::wstring g_kind, g_info, g_date; // "Pasta · 5 itens", "Modificado: 13 de nov. de 2026 às 19:50"
float Sc() { return ui::Scale(g_wnd); }
+// Por cima do Finder (como o painel do Mac): fica "sempre visível" enquanto a janela da frente é do Finder ou do
+// próprio Shell; trocando para outro app, volta a ser uma janela comum e fica atrás dele.
+bool WantTop() {
+ HWND f = GetForegroundWindow();
+ if (!f) return false;
+ DWORD pid = 0; GetWindowThreadProcessId(f, &pid);
+ if (pid == GetCurrentProcessId()) return true;
+ // pela classe da janela do Finder (ArquivosJanela...), não pelo nome do .exe: ao instalar uma versão nova, o
+ // .exe em uso é renomeado (inst-...-WacOSFinder.exe) e o nome deixava de bater
+ wchar_t cls[64] = {}; GetClassNameW(GetAncestor(f, GA_ROOT), cls, 64);
+ return !wcsncmp(cls, L"Arquivos", 8);
+}
+void SyncBack();
+void KeepTop() {
+ if (!g_wnd || !IsWindowVisible(g_wnd)) return;
+ bool want = WantTop(), is = (GetWindowLongW(g_wnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0;
+ if (want != is) { SetWindowPos(g_wnd, want ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); SyncBack(); }
+}
+
bool IsTextFile(const std::wstring& p) {
std::wstring x = PathFindExtensionW(p.c_str());
for (auto& c : x) c = towlower(c);
@@ -95,9 +193,347 @@ SIZE PanelSize(float sc) {
k = std::min(k, 1.6f / sc); // imagem pequena não estoura
w = std::max(360.f, g_iw * k); h = std::max(240.f, g_ih * k);
}
+ if (liquid::Golden() && g_isIcon && g_media) return { 540, 520 }; // música: o ícone e a barra embaixo
+ if (liquid::Golden() && g_isIcon) return { 540, 440 }; // medido na captura do usuário (19/11/2026)
+ if (liquid::Golden()) return { (LONG)std::lround(w + 10), (LONG)std::lround(h + BAR + 5) }; // moldura de 5
return { (LONG)std::lround(w), (LONG)std::lround(h + BAR) };
}
+std::wstring DateText(const FILETIME& ft) {
+ FILETIME lf; SYSTEMTIME st;
+ FileTimeToLocalFileTime(&ft, &lf); FileTimeToSystemTime(&lf, &st);
+ static const wchar_t* en[] = { L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" };
+ static const wchar_t* pt[] = { L"jan.", L"fev.", L"mar.", L"abr.", L"mai.", L"jun.", L"jul.", L"ago.", L"set.", L"out.", L"nov.", L"dez." };
+ wchar_t b[96];
+ int mo = std::clamp((int)st.wMonth, 1, 12) - 1;
+ if (idioma::En()) swprintf_s(b, L"%ls %d, %d at %02d:%02d", en[mo], st.wDay, st.wYear, st.wHour, st.wMinute);
+ else swprintf_s(b, L"%d de %ls de %d às %02d:%02d", st.wDay, pt[mo], st.wYear, st.wHour, st.wMinute);
+ return b;
+}
+
+std::wstring SizeText(ULONGLONG n) { // como o Mac: unidades de 1000
+ wchar_t b[48];
+ if (n < 1000) swprintf_s(b, L"%llu bytes", n);
+ else if (n < 1000ull * 1000) swprintf_s(b, L"%.0f KB", n / 1000.0);
+ else if (n < 1000ull * 1000 * 1000) swprintf_s(b, L"%.1f MB", n / 1e6);
+ else swprintf_s(b, L"%.2f GB", n / 1e9);
+ return b;
+}
+
+// as linhas de baixo do ícone: tipo · itens (ou tamanho) e a data de modificação
+void LoadInfo(const std::wstring& p) {
+ WIN32_FILE_ATTRIBUTE_DATA fa{};
+ g_kind = g_info = g_date = L"";
+ if (!GetFileAttributesExW(p.c_str(), GetFileExInfoStandard, &fa)) return;
+ bool dir = (fa.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
+ if (dir) {
+ g_kind = Tr(L"Pasta");
+ size_t n = 0;
+ WIN32_FIND_DATAW fd;
+ HANDLE h = FindFirstFileW((p + L"\\*").c_str(), &fd);
+ if (h != INVALID_HANDLE_VALUE) {
+ do {
+ if (fd.cFileName[0] == L'.' || (fd.dwFileAttributes & (FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))) continue;
+ n++;
+ } while (FindNextFileW(h, &fd) && n < 100000);
+ FindClose(h);
+ }
+ g_info = g_kind + L" · " + std::to_wstring(n) + (n == 1 ? std::wstring(Tr(L" item")) : std::wstring(Tr(L" itens")));
+ } else {
+ SHFILEINFOW sfi{};
+ if (SHGetFileInfoW(p.c_str(), 0, &sfi, sizeof(sfi), SHGFI_TYPENAME) && sfi.szTypeName[0]) g_kind = sfi.szTypeName;
+ else g_kind = Tr(L"Documento");
+ g_info = g_kind + L" · " + SizeText(((ULONGLONG)fa.nFileSizeHigh << 32) | fa.nFileSizeLow);
+ }
+ g_date = std::wstring(Tr(L"Modificado: ")) + DateText(fa.ftLastWriteTime);
+}
+
+// macOS 27 (capturas Finder-Quick-Look e a do usuário de 19/11/2026, 1x): painel de vidro fosco (o dos menus de
+// contexto), cantos 16, sem barra separada; fechar = círculo cinza de 16 com o × escuro, a 16 da borda e 19 do topo;
+// nome em negrito de 15 a 33 da borda; compartilhar e "Abrir" numa cápsula de 26 (cantos 13) a 8 da borda.
+// Sem prévia: ícone de 200 com o centro a 210 do topo, nome em negrito a 311, "Pasta · 5 itens" a 354 e a data a 372.
+// Com prévia: a foto (cantos 12) numa moldura de 5 do próprio vidro.
+void DrawGolden(ID2D1RenderTarget* rt, float W, float H, bool dark, bool glass) {
+ ID2D1SolidColorBrush* br = nullptr;
+ rt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0), &br);
+ if (!br) return;
+ ID2D1Factory* fac = nullptr; rt->GetFactory(&fac); // a geometria tem que ser da fábrica do alvo (o vidro tem a dele)
+ if (!fac) { br->Release(); return; }
+ const float RR = GG_R, M = 5;
+ D2D1_RECT_F all = D2D1::RectF(0, 0, W, H);
+ if (!glass) { // sem vidro (falhou): o fundo opaco na mesma cor
+ br->SetColor(dark ? D2D1::ColorF(0.17f, 0.165f, 0.165f, 1) : D2D1::ColorF(0.95f, 0.945f, 0.94f, 1));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(all, RR, RR), br);
+ }
+ // borda: só o fio claro por dentro (o vidro é o próprio painel, sem gradiente) e um contorno bem leve
+ br->SetColor(D2D1::ColorF(1, 1, 1, dark ? 0.16f : 0.6f));
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(1, 1, W - 1, H - 1), RR - 1, RR - 1), br, 1);
+ br->SetColor(dark ? D2D1::ColorF(0, 0, 0, 0.5f) : D2D1::ColorF(0, 0, 0, 0.12f));
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.25f, 0.25f, W - 0.25f, H - 0.25f), RR - 0.25f, RR - 0.25f), br, 0.5f);
+ // cores da captura: texto (67,62,56), ícones (61,51,48), botões redondos (89,70,50) sobre o vidro
+ D2D1_COLOR_F text = dark ? D2D1::ColorF(1, 1, 1, 0.9f) : D2D1::ColorF(0, 0, 0, 0.76f);
+ D2D1_COLOR_F text2 = dark ? D2D1::ColorF(1, 1, 1, 0.55f) : D2D1::ColorF(0, 0, 0, 0.5f);
+ D2D1_COLOR_F icon = dark ? D2D1::ColorF(1, 1, 1, 0.82f) : D2D1::ColorF(0, 0, 0, 0.74f);
+ const float cy = 19.5f;
+ bool canFull = !g_isIcon; // pasta e ícone: sem tela cheia (o nome vem logo depois do fechar)
+ bool image = !g_isIcon && g_text.empty() && !g_px.empty() && !g_media;
+ // fechar e tela cheia: círculos cheios de 13 com o símbolo vazado, a 18 e 38 da borda
+ auto roundBtn = [&](D2D1_POINT_2F c, bool hot) {
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, hot ? 0.75f : 0.6f) : D2D1::ColorF(0.30f, 0.23f, 0.16f, hot ? 0.95f : 0.82f));
+ rt->FillEllipse(D2D1::Ellipse(c, 6.5f, 6.5f), br);
+ br->SetColor(dark ? D2D1::ColorF(0.16f, 0.16f, 0.16f) : D2D1::ColorF(0.95f, 0.93f, 0.90f));
+ };
+ D2D1_POINT_2F cc{ 18, cy };
+ g_closeR = D2D1::RectF(cc.x - 9, cc.y - 10, cc.x + 9, cc.y + 10);
+ roundBtn(cc, g_hoverClose);
+ rt->DrawLine({ cc.x - 2.4f, cc.y - 2.4f }, { cc.x + 2.4f, cc.y + 2.4f }, br, 1.6f);
+ rt->DrawLine({ cc.x - 2.4f, cc.y + 2.4f }, { cc.x + 2.4f, cc.y - 2.4f }, br, 1.6f);
+ g_fullR = D2D1::RectF(0, 0, 0, 0);
+ if (canFull) {
+ D2D1_POINT_2F fc{ 38, cy };
+ g_fullR = D2D1::RectF(fc.x - 10, fc.y - 10, fc.x + 10, fc.y + 10);
+ roundBtn(fc, g_hoverFull);
+ rt->DrawLine({ fc.x - 2.6f, fc.y + 2.6f }, { fc.x + 2.6f, fc.y - 2.6f }, br, 2.4f); // a barra em diagonal
+ }
+ // "Abrir com <app>": cápsula de 24 a 7,5 da borda, texto normal de 13 com 12,5 de cada lado
+ static IDWriteTextFormat* tfBtn = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ if (tfBtn) tfBtn->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+ bool folder = g_kind == Tr(L"Pasta");
+ std::wstring btn = g_app.empty() || folder ? std::wstring(Tr(L"Abrir")) : std::wstring(Tr(L"Abrir com ")) + g_app;
+ float bw = std::max(56.f, ui::TextWidth(tfBtn, btn) + 25);
+ g_openR = D2D1::RectF(W - 7.5f - bw, cy - 12, W - 7.5f, cy + 12);
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, g_hoverOpen ? 0.17f : 0.10f) : D2D1::ColorF(0, 0, 0, g_hoverOpen ? 0.10f : 0.05f));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(g_openR, 12, 12), br);
+ br->SetColor(text);
+ rt->DrawTextW(btn.c_str(), (UINT32)btn.size(), tfBtn, g_openR, br);
+ // ícones à esquerda da cápsula, de 40 em 40: compartilhar (24 antes dela), girar e marcação (só imagens)
+ auto path = [&](auto build, float w) {
+ ID2D1PathGeometry* g = nullptr;
+ if (FAILED(fac->CreatePathGeometry(&g))) return;
+ ID2D1GeometrySink* s = nullptr;
+ if (SUCCEEDED(g->Open(&s))) { build(s); s->Close(); s->Release(); }
+ rt->DrawGeometry(g, br, w);
+ g->Release();
+ };
+ auto hoverBg = [&](D2D1_RECT_F r, bool hot) {
+ if (!hot) return;
+ br->SetColor(dark ? D2D1::ColorF(1, 1, 1, 0.1f) : D2D1::ColorF(0, 0, 0, 0.06f));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(r, 12, 12), br);
+ };
+ float sx = g_openR.left - 24;
+ g_shareR = D2D1::RectF(sx - 16, cy - 12, sx + 16, cy + 12);
+ hoverBg(g_shareR, g_hoverShare);
+ br->SetColor(icon);
+ path([&](ID2D1GeometrySink* s) { // caixa aberta em cima (11 × 9) e a seta
+ s->BeginFigure({ sx - 2.5f, cy - 2.5f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ s->AddLine({ sx - 4.5f, cy - 2.5f });
+ s->AddArc(D2D1::ArcSegment({ sx - 5.5f, cy - 1.5f }, { 1, 1 }, 0, D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ s->AddLine({ sx - 5.5f, cy + 6.f });
+ s->AddArc(D2D1::ArcSegment({ sx - 4.5f, cy + 7.f }, { 1, 1 }, 0, D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ s->AddLine({ sx + 4.5f, cy + 7.f });
+ s->AddArc(D2D1::ArcSegment({ sx + 5.5f, cy + 6.f }, { 1, 1 }, 0, D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ s->AddLine({ sx + 5.5f, cy - 1.5f });
+ s->AddArc(D2D1::ArcSegment({ sx + 4.5f, cy - 2.5f }, { 1, 1 }, 0, D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ s->AddLine({ sx + 2.5f, cy - 2.5f });
+ s->EndFigure(D2D1_FIGURE_END_OPEN);
+ }, 1.2f);
+ rt->DrawLine({ sx, cy + 2.5f }, { sx, cy - 7.5f }, br, 1.2f);
+ path([&](ID2D1GeometrySink* s) {
+ s->BeginFigure({ sx - 2.8f, cy - 4.8f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ s->AddLine({ sx, cy - 7.6f }); s->AddLine({ sx + 2.8f, cy - 4.8f });
+ s->EndFigure(D2D1_FIGURE_END_OPEN);
+ }, 1.2f);
+ g_rotR = g_markR = D2D1::RectF(0, 0, 0, 0);
+ if (image) {
+ float rx = sx - 39;
+ g_rotR = D2D1::RectF(rx - 16, cy - 12, rx + 16, cy + 12);
+ hoverBg(g_rotR, g_hoverRot);
+ br->SetColor(icon);
+ rt->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(rx - 5.5f, cy - 3.f, rx + 3.5f, cy + 6.f), 1.3f, 1.3f), br, 1.2f);
+ path([&](ID2D1GeometrySink* s) { // a seta curva em cima, girando para a esquerda
+ s->BeginFigure({ rx + 6.f, cy - 1.f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ s->AddArc(D2D1::ArcSegment({ rx + 1.5f, cy - 6.f }, { 4.5f, 5.f }, 0, D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ s->EndFigure(D2D1_FIGURE_END_OPEN);
+ s->BeginFigure({ rx + 3.6f, cy - 8.3f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ s->AddLine({ rx + 1.3f, cy - 6.f }); s->AddLine({ rx + 3.6f, cy - 3.8f });
+ s->EndFigure(D2D1_FIGURE_END_OPEN);
+ }, 1.2f);
+ float mx = rx - 41;
+ g_markR = D2D1::RectF(mx - 16, cy - 12, mx + 16, cy + 12);
+ hoverBg(g_markR, g_hoverMark);
+ br->SetColor(icon);
+ rt->DrawEllipse(D2D1::Ellipse({ mx, cy }, 6.3f, 6.3f), br, 1.2f);
+ path([&](ID2D1GeometrySink* s) { // a ponta da caneta
+ s->BeginFigure({ mx - 2.9f, cy + 5.4f }, D2D1_FIGURE_BEGIN_HOLLOW);
+ s->AddLine({ mx - 2.9f, cy + 1.2f }); s->AddLine({ mx, cy - 4.2f }); s->AddLine({ mx + 2.9f, cy + 1.2f }); s->AddLine({ mx + 2.9f, cy + 5.4f });
+ s->EndFigure(D2D1_FIGURE_END_OPEN);
+ }, 1.2f);
+ rt->FillEllipse(D2D1::Ellipse({ mx, cy - 0.6f }, 0.9f, 0.9f), br);
+ }
+ float iconsLeft = image ? g_markR.left : g_shareR.left;
+ // nome: negrito de 13, a 53,5 da borda (33 sem o botão de tela cheia)
+ static IDWriteTextFormat* tfT = ui::Format(13, DWRITE_FONT_WEIGHT_BOLD);
+ if (tfT) {
+ tfT->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+ tfT->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
+ DWRITE_TRIMMING tr{ DWRITE_TRIMMING_GRANULARITY_CHARACTER, 0, 0 }; tfT->SetTrimming(&tr, nullptr);
+ br->SetColor(text);
+ rt->DrawTextW(g_name.c_str(), (UINT32)g_name.size(), tfT, D2D1::RectF(canFull ? 53.5f : 33.f, cy - 11, iconsLeft - 8, cy + 11), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ }
+ if (g_bmpRt != rt && g_bmp) { g_bmp->Release(); g_bmp = nullptr; }
+ if (!g_bmp && !g_px.empty()) { g_bmp = ui::Bitmap(rt, g_iw, g_ih, g_px); g_bmpRt = rt; }
+ if (g_hasVideo) { // vídeo: a moldura preta; o MFPlay desenha na janela g_vid por cima
+ br->SetColor(D2D1::ColorF(0, 0, 0, 1));
+ rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(M, BAR, W - M, H - M), RR - M, RR - M), br);
+ br->Release(); fac->Release();
+ return;
+ }
+ if (g_isIcon || (g_text.empty() && !g_bmp)) { // sem prévia: ícone grande e informações, direto no vidro
+ float k = g_media ? 1.f : H / 440; // música: posições fixas (a barra fica embaixo)
+ if (g_bmp) {
+ float s = std::min(200.f / g_iw, 200.f / g_ih), w = g_iw * s, h = g_ih * s, x = W / 2, y = 210 * k;
+ rt->DrawBitmap(g_bmp, D2D1::RectF(x - w / 2, y - h / 2, x + w / 2, y + h / 2), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
+ }
+ static IDWriteTextFormat* tfN = ui::Format(14, DWRITE_FONT_WEIGHT_BOLD, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ static IDWriteTextFormat* tfI = ui::Format(11.5f, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ for (auto* f : { tfN, tfI }) if (f) { f->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); f->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP); DWRITE_TRIMMING tr{ DWRITE_TRIMMING_GRANULARITY_CHARACTER, 0, 0 }; f->SetTrimming(&tr, nullptr); }
+ br->SetColor(text);
+ if (tfN) rt->DrawTextW(g_name.c_str(), (UINT32)g_name.size(), tfN, D2D1::RectF(20, 311 * k - 11, W - 20, 311 * k + 11), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ br->SetColor(text2);
+ if (tfI) {
+ rt->DrawTextW(g_info.c_str(), (UINT32)g_info.size(), tfI, D2D1::RectF(20, 354 * k - 9, W - 20, 354 * k + 9), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ rt->DrawTextW(g_date.c_str(), (UINT32)g_date.size(), tfI, D2D1::RectF(20, 372 * k - 9, W - 20, 372 * k + 9), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ }
+ br->Release(); fac->Release();
+ return;
+ }
+ D2D1_RECT_F body = D2D1::RectF(M, BAR, W - M, H - M);
+ ID2D1RoundedRectangleGeometry* clip = nullptr;
+ fac->CreateRoundedRectangleGeometry(D2D1::RoundedRect(body, RR - M, RR - M), &clip);
+ if (clip) rt->PushLayer(D2D1::LayerParameters(D2D1::InfiniteRect(), clip), nullptr);
+ if (!g_text.empty()) { // texto: folha dentro da moldura
+ br->SetColor(dark ? D2D1::ColorF(0.1f, 0.1f, 0.1f) : D2D1::ColorF(1, 1, 1));
+ rt->FillRectangle(body, br);
+ br->SetColor(text);
+ rt->DrawTextW(g_text.c_str(), (UINT32)std::min<size_t>(g_text.size(), 20000), g_tfText, D2D1::RectF(body.left + 18, body.top + 14, body.right - 18, body.bottom), br, D2D1_DRAW_TEXT_OPTIONS_CLIP);
+ } else if (g_bmp) { // a foto preenche a moldura
+ float bwid = body.right - body.left, bh = body.bottom - body.top;
+ // tela cheia: a foto inteira (o vidro aparece nas sobras); normal: o painel já tem a proporção da foto
+ float k = g_full ? std::min(bwid / g_iw, bh / g_ih) : std::max(bwid / g_iw, bh / g_ih), w = g_iw * k, h = g_ih * k;
+ float x = body.left + (bwid - w) / 2, y = body.top + (bh - h) / 2;
+ rt->DrawBitmap(g_bmp, D2D1::RectF(x, y, x + w, y + h), 1, D2D1_BITMAP_INTERPOLATION_MODE_LINEAR);
+ }
+ if (clip) { rt->PopLayer(); clip->Release(); }
+ br->Release();
+ fac->Release();
+}
+
+void PaintGolden(ID2D1RenderTarget* rt, RECT wr, int wpx, int hpx, float sc, bool dark) {
+ float W = wpx / sc, H = hpx / sc;
+ if (g_glass) {
+ // o vidro dos menus de contexto: fosco, não segue o controle de transparência
+ // vidro bem fosco e com tinta firme (a dos menus deixava o painel transparente demais): o fundo só aparece
+ // como cor, sem dar para ler o que está atrás, como no Quick Look do macOS 27
+ D2D1_COLOR_F tint = dark ? D2D1::ColorF(0.16f, 0.155f, 0.155f, 0.86f) : D2D1::ColorF(0.95f, 0.945f, 0.94f, 0.86f);
+ backdrop::SetPieces(g_back, (float)wpx, (float)hpx, { { D2D1::RectF(0, 0, (float)wpx, (float)hpx), GG_R * sc } }, tint, 32.f);
+ if (ID2D1DeviceContext* dc = backdrop::ContentBegin(g_back, wpx, hpx, sc)) {
+ DrawGolden(dc, W, H, dark, true);
+ backdrop::ContentEnd(g_back);
+ backdrop::Fade(g_back, 1, 1, 0, 0);
+ // a janela de cima só pega o mouse: um véu de 1/255 (pixel transparente deixaria o clique passar)
+ ID2D1SolidColorBrush* b = nullptr;
+ rt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0, 1.f / 255), &b);
+ if (b) { rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0, 0, W, H), GG_R, GG_R), b); b->Release(); }
+ ui::End(g_s, true, POINT{ wr.left, wr.top });
+ return;
+ }
+ }
+ DrawGolden(rt, W, H, dark, false);
+ ui::End(g_s, true, POINT{ wr.left, wr.top });
+}
+
+void PaintCtl();
+// o vídeo e a barra ficam por cima do painel no mesmo "sempre visível" dele (por cima do Finder, o painel é
+// sempre visível; um HWND_TOP comum deixava o vídeo atrás do painel, só com a moldura preta à vista)
+UINT PlaceOver(HWND x) {
+ bool top = (GetWindowLongW(g_wnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0;
+ if (!top && (GetWindowLongW(x, GWL_EXSTYLE) & WS_EX_TOPMOST))
+ SetWindowPos(x, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ return 0;
+}
+HWND OverAfter() { return (GetWindowLongW(g_wnd, GWL_EXSTYLE) & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_TOP; }
+void PlaceMedia() {
+ if (!g_media || !g_wnd || !IsWindowVisible(g_wnd)) return;
+ float sc = Sc();
+ RECT wr; GetWindowRect(g_wnd, &wr);
+ int m = (int)std::lround(5 * sc), top = (int)std::lround(BAR * sc);
+ if (g_hasVideo && g_vid) {
+ int w = wr.right - wr.left - 2 * m, h = wr.bottom - wr.top - top - m;
+ if (w > 0 && h > 0) {
+ int rr = (int)std::lround(2 * (GG_R - 5) * sc);
+ SetWindowRgn(g_vid, CreateRoundRectRgn(0, 0, w + 1, h + 1, rr, rr), FALSE);
+ PlaceOver(g_vid);
+ SetWindowPos(g_vid, OverAfter(), wr.left + m, wr.top + top, w, h, SWP_NOACTIVATE | SWP_SHOWWINDOW);
+ if (g_mp) g_mp->UpdateVideo();
+ }
+ }
+ PaintCtl();
+}
+void SyncBack() { // o vidro acompanha a janela (mesmo lugar, logo abaixo dela)
+ PlaceMedia();
+ if (!g_back) return;
+ if (!liquid::Golden() || !g_wnd || !IsWindowVisible(g_wnd)) { ShowWindow(g_back, SW_HIDE); return; }
+ RECT r; GetWindowRect(g_wnd, &r);
+ // o vidro acompanha o "sempre visível" do painel (não é janela dona dele: o Windows não faz isso sozinho)
+ bool top = (GetWindowLongW(g_wnd, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0;
+ if (top != ((GetWindowLongW(g_back, GWL_EXSTYLE) & WS_EX_TOPMOST) != 0))
+ SetWindowPos(g_back, top ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetWindowPos(g_back, g_wnd, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOACTIVATE | SWP_SHOWWINDOW);
+}
+
+bool CtlVisible() { return g_media && (!g_hasVideo || g_scrub || !MPlaying() || GetTickCount() - g_ctlMoveAt < 2500); }
+void PaintCtl() {
+ if (!g_ctl) return;
+ if (!CtlVisible() || !g_wnd || !IsWindowVisible(g_wnd)) { ShowWindow(g_ctl, SW_HIDE); if (g_ctlBack) ShowWindow(g_ctlBack, SW_HIDE); return; }
+ float sc = Sc();
+ RECT wr; GetWindowRect(g_wnd, &wr);
+ float PW = (wr.right - wr.left) / sc;
+ float W = std::min(barravideo::LARGURA, PW - 10 - 40), H = barravideo::ALTURA;
+ if (W < 300) { ShowWindow(g_ctl, SW_HIDE); if (g_ctlBack) ShowWindow(g_ctlBack, SW_HIDE); return; }
+ int w = (int)std::lround(W * sc), h = (int)std::lround(H * sc);
+ int x = wr.left + ((wr.right - wr.left) - w) / 2, y = wr.bottom - (int)std::lround((5 + CTL_DOWN) * sc) - h;
+ HDC screen = GetDC(nullptr), mem = CreateCompatibleDC(screen);
+ BITMAPINFO bi{}; bi.bmiHeader = { sizeof(BITMAPINFOHEADER), w, -h, 1, 32, BI_RGB };
+ void* bits = nullptr; HBITMAP bmp = CreateDIBSection(mem, &bi, DIB_RGB_COLORS, &bits, nullptr, 0);
+ HGDIOBJ old = SelectObject(mem, bmp);
+ ID2D1DCRenderTarget* rt2 = nullptr;
+ auto props = D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), 96 * sc, 96 * sc);
+ g_vhits.clear();
+ if (SUCCEEDED(ui::d2d->CreateDCRenderTarget(&props, &rt2))) {
+ RECT rb{ 0, 0, w, h }; rt2->BindDC(mem, &rb);
+ rt2->BeginDraw(); rt2->Clear(D2D1::ColorF(0, 0, 0, 0));
+ ID2D1SolidColorBrush* b = nullptr; rt2->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0, 0), &b);
+ static IDWriteTextFormat* tfL = nullptr; static IDWriteTextFormat* tfR = nullptr;
+ if (!tfL) {
+ tfL = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL); tfR = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ for (auto* f : { tfL, tfR }) if (f) { f->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); f->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP); }
+ }
+ if (b && g_hasVideo) barravideo::FundoBorrado(rt2, g_vid, RECT{ x, y, x + w, y + h }, sc, D2D1::RectF(0, 0, W, H), 22); // o vídeo desfocado atrás
+ if (b) { barravideo::Desenha(rt2, b, W, H, g_vol, MPlaying(), g_ended ? MLen() : MPos(), MLen(), tfL, tfR, g_vhits); b->Release(); }
+ rt2->EndDraw(); rt2->Release();
+ }
+ POINT dst{ x, y }, src{ 0, 0 }; SIZE sz{ w, h };
+ BLENDFUNCTION bf{ AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ UpdateLayeredWindow(g_ctl, screen, &dst, &sz, mem, &src, 0, &bf, ULW_ALPHA);
+ SelectObject(mem, old); DeleteObject(bmp); DeleteDC(mem); ReleaseDC(nullptr, screen);
+ if (g_ctlBack) { // o vidro fosco de trás, 4,5 pt para dentro (o acrílico não aceita recorte)
+ int in = (int)std::lround(4.5f * sc);
+ SetWindowPos(g_ctlBack, HWND_TOP, x + in, y + in, w - 2 * in, h - 2 * in, SWP_NOACTIVATE | SWP_SHOWWINDOW);
+ }
+ PlaceOver(g_ctl);
+ SetWindowPos(g_ctl, OverAfter(), 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_SHOWWINDOW);
+}
+
void Paint() {
if (!g_wnd || !IsWindowVisible(g_wnd)) return;
float sc = Sc();
@@ -109,6 +545,7 @@ void Paint() {
bool dark = ui::Dark();
ID2D1SolidColorBrush* br = nullptr;
rt->CreateSolidColorBrush(D2D1::ColorF(0, 0, 0), &br);
+ if (liquid::Golden()) { br->Release(); PaintGolden(rt, wr, wpx, hpx, sc, dark); return; }
// corpo e barra
br->SetColor(dark ? D2D1::ColorF(0.12f, 0.12f, 0.13f, 0.97f) : D2D1::ColorF(0.97f, 0.97f, 0.97f, 0.98f));
rt->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.5f, 0.5f, W - 0.5f, H - 0.5f), R, R), br);
@@ -162,6 +599,13 @@ void Paint() {
void Place() {
float sc = Sc();
+ if (g_full && liquid::Golden()) { // tela cheia: o monitor inteiro
+ MONITORINFO mi{ sizeof(mi) };
+ GetMonitorInfoW(MonitorFromWindow(g_wnd, MONITOR_DEFAULTTONEAREST), &mi);
+ SetWindowPos(g_wnd, HWND_TOPMOST, mi.rcMonitor.left, mi.rcMonitor.top, mi.rcMonitor.right - mi.rcMonitor.left, mi.rcMonitor.bottom - mi.rcMonitor.top, SWP_NOACTIVATE);
+ return;
+ }
+ SetWindowPos(g_wnd, WantTop() ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
SIZE s = PanelSize(sc);
int w = (int)std::lround(s.cx * sc), h = (int)std::lround(s.cy * sc);
RECT wr; GetWindowRect(g_wnd, &wr);
@@ -171,35 +615,151 @@ void Place() {
GetMonitorInfoW(MonitorFromPoint(c, MONITOR_DEFAULTTOPRIMARY), &mi);
cx = (mi.rcWork.left + mi.rcWork.right) / 2; cy = (mi.rcWork.top + mi.rcWork.bottom) / 2;
}
- SetWindowPos(g_wnd, HWND_TOP, cx - w / 2, cy - h / 2, w, h, SWP_NOACTIVATE);
+ SetWindowPos(g_wnd, nullptr, cx - w / 2, cy - h / 2, w, h, SWP_NOACTIVATE | SWP_NOZORDER);
}
+void MediaStart(const std::wstring& path);
void Load(const std::wstring& path) {
+ MediaStop();
g_path = path;
g_name = path.substr(path.find_last_of(L"\\/") + 1);
g_app = DefaultAppName(path);
g_text.clear(); g_px.clear(); g_iw = g_ih = 0;
if (g_bmp) { g_bmp->Release(); g_bmp = nullptr; }
int gen = ++g_gen;
+ LoadInfo(path);
+ DWORD at = GetFileAttributesW(path.c_str());
+ bool dir = at != INVALID_FILE_ATTRIBUTES && (at & FILE_ATTRIBUTE_DIRECTORY);
+ // Golden Gate: o que não tem miniatura (pasta, arquivo comum) mostra o ícone grande; sabe antes de abrir
+ g_isIcon = false;
+ if (liquid::Golden() && !IsTextFile(path)) {
+ g_isIcon = true;
+ IShellItemImageFactory* f = nullptr;
+ HBITMAP hb = nullptr;
+ if (!dir && SUCCEEDED(SHCreateItemFromParsingName(path.c_str(), nullptr, IID_PPV_ARGS(&f)))) {
+ if (FAILED(f->GetImage(SIZE{ 64, 64 }, SIIGBF_RESIZETOFIT | SIIGBF_THUMBNAILONLY, &hb))) hb = nullptr;
+ f->Release();
+ }
+ if (hb) { DeleteObject(hb); g_isIcon = false; }
+ }
if (IsTextFile(path)) { g_text = ReadText(path); g_loading = false; return; }
+ bool isVideo = false;
+ if (liquid::Golden() && IsMediaPath(path, &isVideo)) {
+ g_media = true;
+ if (!isVideo) g_isIcon = true; // música: o ícone (ou a capa) e a barra embaixo
+ MediaStart(path);
+ }
g_loading = true;
HWND w = g_wnd;
- int px = (int)std::lround(1200 * Sc());
- std::thread([path, gen, w, px] {
+ int px = (int)std::lround((g_isIcon ? 400 : 1200) * Sc());
+ bool icon = g_isIcon;
+ std::thread([path, gen, w, px, icon, dir] {
HRESULT co = CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
auto* r = new std::tuple<int, UINT, UINT, std::vector<BYTE>>(gen, 0, 0, std::vector<BYTE>{});
auto& [g, iw, ih, px2] = *r;
- if (!ui::ShellImage(path, px, iw, ih, px2, false)) ui::ShellImage(path, 256, iw, ih, px2, true);
+ bool got = false;
+ if (icon && dir && GetFileAttributesW((path + L"\\desktop.ini").c_str()) == INVALID_FILE_ATTRIBUTES) { // a pasta do Mac (pacote de ícones)
+ std::wstring png = ui::PackIcon(L"folder default");
+ got = !png.empty() && ui::LoadPng(png, iw, ih, px2);
+ }
+ bool vid2 = false;
+ if (!got && icon && IsMediaPath(path, &vid2) && !vid2) got = ui::ShellImage(path, px, iw, ih, px2, false); // a capa do álbum
+ if (!got && icon) got = ui::FileImage(path, px, iw, ih, px2);
+ if (!got && !ui::ShellImage(path, px, iw, ih, px2, false)) ui::ShellImage(path, 256, iw, ih, px2, true);
if (SUCCEEDED(co)) CoUninitialize();
if (!PostMessageW(w, WM_QL_READY, 0, (LPARAM)r)) delete r;
}).detach();
}
+LRESULT CALLBACK VidProc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ switch (m) {
+ case WM_MOUSEACTIVATE: return MA_NOACTIVATE;
+ case WM_PAINT: { PAINTSTRUCT ps; HDC dc = BeginPaint(h, &ps); if (g_mp) g_mp->UpdateVideo(); else FillRect(dc, &ps.rcPaint, (HBRUSH)GetStockObject(BLACK_BRUSH)); EndPaint(h, &ps); return 0; }
+ case WM_ERASEBKGND: return 1;
+ case WM_MOUSEMOVE: { static LPARAM last; if (l != last) { last = l; bool was = CtlVisible(); g_ctlMoveAt = GetTickCount(); if (!was) PaintCtl(); } return 0; }
+ case WM_LBUTTONDOWN: MToggle(); PaintCtl(); return 0; // clique no vídeo pausa/continua
+ case WM_LBUTTONDBLCLK: g_full = !g_full; Place(); Paint(); SyncBack(); return 0;
+ }
+ return DefWindowProcW(h, m, w, l);
+}
+LRESULT CALLBACK CtlProc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ float sc = Sc();
+ switch (m) {
+ case WM_MOUSEACTIVATE: return MA_NOACTIVATE;
+ case WM_MOUSEMOVE: {
+ g_ctlMoveAt = GetTickCount();
+ if (g_scrub) { float x = GET_X_LPARAM(l) / sc; for (auto& ht : g_vhits) if (ht.id == barravideo::SCRUB) MSeek(barravideo::PosicaoEm(ht.r, x) * MLen()); PaintCtl(); }
+ return 0;
+ }
+ case WM_LBUTTONDOWN: {
+ float x = GET_X_LPARAM(l) / sc, y = GET_Y_LPARAM(l) / sc;
+ for (auto& ht : g_vhits) {
+ if (x < ht.r.left || x >= ht.r.right || y < ht.r.top || y >= ht.r.bottom) continue;
+ switch (ht.id) {
+ case barravideo::VOL: g_vol = barravideo::VolumeEm(ht.r, x); if (g_mp) g_mp->SetVolume(g_vol); break;
+ case barravideo::BACK: MSeek(MPos() - 15); break;
+ case barravideo::FWD: MSeek(MPos() + 15); break;
+ case barravideo::PLAY: MToggle(); break;
+ case barravideo::FULL: if (g_hasVideo) { g_full = !g_full; Place(); Paint(); SyncBack(); } break;
+ case barravideo::SCRUB: g_scrub = true; SetCapture(h); MSeek(barravideo::PosicaoEm(ht.r, x) * MLen()); break;
+ }
+ break;
+ }
+ PaintCtl();
+ return 0;
+ }
+ case WM_LBUTTONUP: if (g_scrub) { g_scrub = false; ReleaseCapture(); PaintCtl(); } return 0;
+ case WM_CAPTURECHANGED: g_scrub = false; return 0;
+ }
+ return DefWindowProcW(h, m, w, l);
+}
+
+void MediaStart(const std::wstring& path) {
+ static bool mf = SUCCEEDED(MFStartup(MF_VERSION));
+ if (!mf) return;
+ HINSTANCE hi = GetModuleHandleW(nullptr);
+ if (!g_vid) {
+ WNDCLASSW vc{}; vc.style = CS_DBLCLKS; vc.lpfnWndProc = VidProc; vc.hInstance = hi; vc.lpszClassName = L"ShellQuickLookVideo"; vc.hCursor = LoadCursorW(nullptr, IDC_ARROW);
+ RegisterClassW(&vc);
+ g_vid = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, vc.lpszClassName, L"", WS_POPUP, 0, 0, 10, 10, g_wnd, nullptr, hi, nullptr);
+ WNDCLASSW cc{}; cc.lpfnWndProc = CtlProc; cc.hInstance = hi; cc.lpszClassName = L"ShellQuickLookControles"; cc.hCursor = LoadCursorW(nullptr, IDC_ARROW);
+ RegisterClassW(&cc);
+ g_ctl = CreateWindowExW(WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE, cc.lpszClassName, L"", WS_POPUP, 0, 0, 10, 10, g_wnd, nullptr, hi, nullptr);
+ // o vidro fosco da barra é desenhado nela mesma (barravideo::FundoBorrado), recortado nos cantos de 22
+ for (HWND x : { g_vid, g_ctl, g_ctlBack }) if (x) apps::ours.push_back(x);
+ }
+ if (!g_mcb) g_mcb = new MediaCb;
+ if (FAILED(MFPCreateMediaPlayer(path.c_str(), FALSE, 0, g_mcb, g_vid, &g_mp))) { g_mp = nullptr; return; }
+ g_mp->SetVolume(g_vol);
+ g_mp->SetBorderColor(RGB(0, 0, 0));
+ g_ctlMoveAt = GetTickCount();
+ SetTimer(g_wnd, 7, 66, nullptr); // a barra acompanha o vídeo (o desfoque de trás anda junto)
+}
+
LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
switch (m) {
+ case WM_QL_MEDIA:
+ if (!g_mp) return 0;
+ if (w == 1 && !l) { // pronto: vídeo ganha o tamanho dele; toca sozinho, como no Mac
+ SIZE vs{}, ar{};
+ if (SUCCEEDED(g_mp->GetNativeVideoSize(&vs, &ar)) && vs.cx && vs.cy) {
+ if (ar.cx > 0 && ar.cy > 0) vs.cy = std::max<LONG>(1, (LONG)std::lround((double)vs.cx * ar.cy / ar.cx));
+ g_hasVideo = true; g_isIcon = false;
+ g_px.clear(); if (g_bmp) { g_bmp->Release(); g_bmp = nullptr; }
+ g_iw = vs.cx; g_ih = vs.cy; g_loading = false;
+ }
+ g_mp->Play();
+ Place(); Paint(); SyncBack();
+ } else if (w == 2) { g_ended = true; PaintCtl(); }
+ else if (w == 1 || w == 3) { g_hasVideo = false; PaintCtl(); } // não deu para tocar: fica a prévia
+ return 0;
+ case WM_TIMER:
+ if (w == 7) { if (g_media) PaintCtl(); return 0; }
+ if (w == 8) { KeepTop(); return 0; }
+ break;
case WM_QL_READY: {
auto* r = (std::tuple<int, UINT, UINT, std::vector<BYTE>>*)l;
- if (std::get<0>(*r) == g_gen) {
+ if (std::get<0>(*r) == g_gen && !g_hasVideo) {
g_iw = std::get<1>(*r); g_ih = std::get<2>(*r); g_px = std::move(std::get<3>(*r)); g_loading = false;
if (g_bmp) { g_bmp->Release(); g_bmp = nullptr; }
Place(); Paint();
@@ -210,20 +770,63 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
case WM_NCHITTEST: {
POINT p{ (short)LOWORD(l), (short)HIWORD(l) }; ScreenToClient(h, &p);
float sc = Sc(), x = p.x / sc, y = p.y / sc;
+ auto in = [&](D2D1_RECT_F r) { return x >= r.left && x < r.right && y >= r.top && y < r.bottom; };
+ if (liquid::Golden()) return HTCLIENT; // arrasta à mão (WM_LBUTTONDOWN): o HTCAPTION não movia este painel // como no Mac: arrasta pelo painel todo
if (y < BAR && !(x >= g_closeR.left && x < g_closeR.right) && !(x >= g_openR.left && x < g_openR.right)) return HTCAPTION;
return HTCLIENT;
}
+ case WM_LBUTTONDOWN:
+ // como no Mac: arrasta por qualquer ponto do painel que não seja botão
+ if (liquid::Golden() && !g_full && !g_hoverClose && !g_hoverOpen && !g_hoverShare && !g_hoverFull && !g_hoverRot && !g_hoverMark) {
+ GetCursorPos(&g_dragFrom);
+ RECT r; GetWindowRect(h, &r); g_dragOrg = { r.left, r.top };
+ g_dragging = true; SetCapture(h);
+ }
+ return 0;
+ case WM_CAPTURECHANGED: g_dragging = false; return 0;
case WM_MOUSEMOVE: {
+ if (g_dragging) {
+ POINT p; GetCursorPos(&p);
+ SetWindowPos(h, nullptr, g_dragOrg.x + p.x - g_dragFrom.x, g_dragOrg.y + p.y - g_dragFrom.y, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ return 0;
+ }
float sc = Sc(), x = (short)LOWORD(l) / sc, y = (short)HIWORD(l) / sc;
bool hc = x >= g_closeR.left && x < g_closeR.right && y >= g_closeR.top && y < g_closeR.bottom;
bool ho = x >= g_openR.left && x < g_openR.right && y >= g_openR.top && y < g_openR.bottom;
- if (hc != g_hoverClose || ho != g_hoverOpen) { g_hoverClose = hc; g_hoverOpen = ho; Paint(); }
+ auto in = [&](D2D1_RECT_F r) { return liquid::Golden() && x >= r.left && x < r.right && y >= r.top && y < r.bottom; };
+ bool hs = in(g_shareR), hf = in(g_fullR), hr = in(g_rotR), hm = in(g_markR);
+ if (hc != g_hoverClose || ho != g_hoverOpen || hs != g_hoverShare || hf != g_hoverFull || hr != g_hoverRot || hm != g_hoverMark) {
+ g_hoverClose = hc; g_hoverOpen = ho; g_hoverShare = hs; g_hoverFull = hf; g_hoverRot = hr; g_hoverMark = hm; Paint();
+ }
TRACKMOUSEEVENT t{ sizeof(t), TME_LEAVE, h, 0 }; TrackMouseEvent(&t);
return 0;
}
- case WM_MOUSELEAVE: if (g_hoverClose || g_hoverOpen) { g_hoverClose = g_hoverOpen = false; Paint(); } return 0;
+ case WM_MOUSELEAVE:
+ if (g_hoverClose || g_hoverOpen || g_hoverShare || g_hoverFull || g_hoverRot || g_hoverMark) {
+ g_hoverClose = g_hoverOpen = g_hoverShare = g_hoverFull = g_hoverRot = g_hoverMark = false; Paint();
+ }
+ return 0;
case WM_LBUTTONUP:
+ if (g_dragging) { g_dragging = false; ReleaseCapture(); return 0; }
if (g_hoverClose) { quicklook::Close(); return 0; }
+ if (g_hoverFull) { g_full = !g_full; Place(); Paint(); SyncBack(); return 0; }
+ if (g_hoverRot && g_iw && g_ih && g_px.size() >= (size_t)g_iw * g_ih * 4) { // gira 90° para a esquerda, como o Mac
+ std::vector<BYTE> o(g_px.size());
+ for (UINT y = 0; y < g_ih; y++)
+ for (UINT x = 0; x < g_iw; x++)
+ memcpy(&o[((size_t)(g_iw - 1 - x) * g_ih + y) * 4], &g_px[((size_t)y * g_iw + x) * 4], 4);
+ g_px.swap(o); std::swap(g_iw, g_ih);
+ if (g_bmp) { g_bmp->Release(); g_bmp = nullptr; }
+ Place(); Paint(); SyncBack();
+ return 0;
+ }
+ if (g_hoverMark) { std::wstring p = g_path; quicklook::Close(); OpenPath(p); return 0; } // marcação: abre no app
+ if (g_hoverShare) { // a janela de Compartilhar do Windows
+ SHELLEXECUTEINFOW se{ sizeof(se) };
+ se.fMask = SEE_MASK_INVOKEIDLIST; se.lpVerb = L"windows.modernshare"; se.lpFile = g_path.c_str(); se.nShow = SW_SHOWNORMAL;
+ ShellExecuteExW(&se);
+ return 0;
+ }
if (g_hoverOpen) {
std::wstring p = g_path; quicklook::Close();
OpenPath(p);
@@ -231,15 +834,22 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
}
return 0;
case WM_KEYDOWN:
+ if (w == VK_ESCAPE && g_full) { g_full = false; Place(); Paint(); SyncBack(); return 0; }
if (w == VK_ESCAPE || w == VK_SPACE) { quicklook::Close(); return 0; }
if (w == VK_RETURN) { std::wstring p = g_path; quicklook::Close(); OpenPath(p); return 0; }
return 0;
case WM_MOVE: Paint(); return 0;
+ case WM_WINDOWPOSCHANGED: SyncBack(); break;
case WM_DPICHANGED: Place(); Paint(); return 0;
}
return DefWindowProcW(h, m, w, l);
}
+LRESULT CALLBACK BackProc(HWND h, UINT m, WPARAM w, LPARAM l) {
+ if (m == WM_MOUSEACTIVATE) return MA_NOACTIVATE;
+ return DefWindowProcW(h, m, w, l);
+}
+
bool Ensure() {
if (g_wnd) return true;
HINSTANCE hi = GetModuleHandleW(nullptr);
@@ -249,6 +859,17 @@ bool Ensure() {
if (!g_wnd) return false;
g_s.hwnd = g_wnd;
apps::ours.push_back(g_wnd);
+ {
+ WNDCLASSW bc{}; bc.lpfnWndProc = BackProc; bc.hInstance = hi; bc.lpszClassName = L"ShellQuickLookFundo";
+ RegisterClassW(&bc);
+ g_back = CreateWindowExW(WS_EX_TOOLWINDOW | WS_EX_NOACTIVATE | WS_EX_TRANSPARENT | WS_EX_NOREDIRECTIONBITMAP, bc.lpszClassName, L"", WS_POPUP, 0, 0, 10, 10, nullptr, nullptr, hi, nullptr);
+ g_glass = g_back && backdrop::Attach(g_back);
+ if (g_back) {
+ DWORD c1 = 1; COLORREF none = 0xFFFFFFFE;
+ DwmSetWindowAttribute(g_back, 33, &c1, sizeof(c1)); DwmSetWindowAttribute(g_back, 34, &none, sizeof(none));
+ apps::ours.push_back(g_back);
+ }
+ }
g_tfTitle = ui::Format(13, DWRITE_FONT_WEIGHT_SEMI_BOLD, false, DWRITE_TEXT_ALIGNMENT_CENTER);
g_tfBtn = ui::Format(12.5f, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_CENTER);
g_tfText = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL);
@@ -264,20 +885,30 @@ std::wstring quicklook::Path() { return IsOpen() ? g_path : L""; }
void quicklook::Close() {
if (!g_wnd) return;
+ MediaStop();
+ KillTimer(g_wnd, 8);
+ SetWindowPos(g_wnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
ShowWindow(g_wnd, SW_HIDE);
+ if (g_back) ShowWindow(g_back, SW_HIDE);
+ g_full = false;
g_gen++;
if (g_bmp) { g_bmp->Release(); g_bmp = nullptr; }
g_px.clear(); g_text.clear();
}
-void quicklook::Toggle(const std::wstring& path) {
+void quicklook::Toggle(const std::wstring& path, bool activate) {
if (path.empty() || GetFileAttributesW(path.c_str()) == INVALID_FILE_ATTRIBUTES) return;
if (IsOpen() && !_wcsicmp(path.c_str(), g_path.c_str())) { Close(); return; }
if (!Ensure()) return;
Load(path);
Place(); // fechado: no meio do monitor do mouse; aberto: fica onde está, no tamanho da prévia nova
- ShowWindow(g_wnd, SW_SHOW);
- SetForegroundWindow(g_wnd);
+ // do Finder: não tira o foco dele (as setas trocam o arquivo e o espaço fecha, como no Mac)
+ ShowWindow(g_wnd, activate ? SW_SHOW : SW_SHOWNOACTIVATE);
+ // por cima do Finder, que está na frente (o Windows não deixa outro programa passar à frente dele sem isso)
+ SetWindowPos(g_wnd, WantTop() ? HWND_TOPMOST : HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+ SetTimer(g_wnd, 8, 300, nullptr);
+ if (activate) SetForegroundWindow(g_wnd);
Paint();
+ SyncBack();
Log(L"quick look: %ls", path.c_str());
}
diff --git a/src/shell/shell.h b/src/shell/shell.h
index 06581aa..98b1d79 100644
--- a/src/shell/shell.h
+++ b/src/shell/shell.h
@@ -399,7 +399,7 @@ void Toggle(); // Central de Controle
void Stop(); // Shell saindo: devolve as janelas
}
namespace quicklook { // Quick Look (quicklook.cpp): painel só com a prévia de um arquivo (espaço abre e fecha)
-void Toggle(const std::wstring& path);
+void Toggle(const std::wstring& path, bool activate = true);
void Close();
bool IsOpen();
std::wstring Path();
@@ -496,6 +496,7 @@ void AfterCommit(HWND to, UINT msg);
// Transparência e Efeitos (Ajustes do Sistema): Liquid Glass, reduzir transparência, tinta do vidro
struct Style {
bool liquid = false; // liquid_glass: vidro líquido do macOS Tahoe
+ bool golden = false; // golden_gate (com liquid_glass): tema macOS 27 Golden Gate
bool tinted = false; // liquid_estilo: "nitido" ou "tingido"
float refraction = 0.6f; // liquid_refracao 0..1: força da lente nas bordas
bool reduce = false; // reduzir_transparencia
@@ -520,6 +521,7 @@ D2D1_COLOR_F AdjustTint(D2D1_COLOR_F c);
}
namespace liquid { // tema macOS Tahoe nos painéis do Shell (liquid.cpp): detalhes D2D por cima do vidro
bool On(); // Tema = macOS Tahoe (liquid_glass), mesmo com a transparência reduzida
+bool Golden(); // Tema = macOS Golden Gate (liquid_glass + golden_gate): o Tahoe com o que mudou no macOS 27
// contorno especular; spec = força do brilho dos cantos (0 em repouso, 1 com o ponteiro em cima), lx/ly = de onde vem a
// luz (0..1 dentro da peça, a posição do ponteiro; < 0 = canto de cima à esquerda)
void Rim(ID2D1DeviceContext* dc, D2D1_RECT_F r, float rad, bool dark, float strength = 1, float spec = 1, float lx = -1, float ly = -1);
diff --git a/src/shell/sobre.cpp b/src/shell/sobre.cpp
index 8c6ff2a..cbd6feb 100644
--- a/src/shell/sobre.cpp
+++ b/src/shell/sobre.cpp
@@ -12,7 +12,11 @@
namespace {
-const float W = 280, H = 474;
+const float W = 280;
+// macOS 27 Golden Gate (About-This-Mac.png, 2x): 280 × 487, nome a 245,5 sem a linha do ano, dados a partir de 285,5
+// a cada 16, "Mais Informações…" de 24 em 376,5 e o rodapé em 422 / 437 / 451
+#define GG (liquid::Golden())
+#define H (GG ? 487.f : 474.f)
const float LIGHT_PITCH = 23, LIGHT_R = 7; // padrão do projeto (o do Monitor de Atividade)
// Tahoe (guia macOS26-Theme-Reference, seção 9.1): janela só com título = cantos de 16 e o 1º botão em x 9, y 9
// (centro 16, 16); Sequoia: cantos de 10, centro em 19, 14
@@ -20,10 +24,16 @@ const float LIGHT_PITCH = 23, LIGHT_R = 7; // padrão do projeto (o do Monitor
#define LIGHT_X0 (liquid::On() ? 16.f : 19.f)
#define LIGHT_Y (liquid::On() ? 16.f : 14.f)
const float IMG_TOP = 90, IMG_W = 145.5f, IMG_H = 70.7f;
-const float TITLE_CY = 240.6f, YEAR_CY = 262, ROW0_CY = 295.7f, ROW_PITCH = 15.2f;
+const float YEAR_CY = 262;
+#define TITLE_CY (GG ? 245.5f : 240.6f)
+#define ROW0_CY (GG ? 285.5f : 295.7f)
+#define ROW_PITCH (GG ? 16.f : 15.2f)
const float COL_SPLIT = 119, COL_GAP = 10;
-const float BTN_TOP = 370.4f, BTN_H = 20;
-const float REG_CY = 411, TM_CY = 425, RIGHTS_CY = 439.4f;
+#define BTN_TOP (GG ? 376.5f : 370.4f)
+#define BTN_H (GG ? 24.f : 20.f)
+#define REG_CY (GG ? 422.f : 411.f)
+#define TM_CY (GG ? 437.f : 425.f)
+#define RIGHTS_CY (GG ? 451.f : 439.4f)
HWND g_wnd, g_back;
bool g_glass, g_active;
@@ -182,13 +192,13 @@ void Paint() {
D2D1_COLOR_F text2 = dark ? D2D1::ColorF(1, 1, 1, 0.52f) : D2D1::ColorF(0, 0, 0, 0.50f);
auto C = DWRITE_TEXT_ALIGNMENT_CENTER;
Text(dc, br, L"Mac Studio", 21.5f, DWRITE_FONT_WEIGHT_BOLD, C, D2D1::RectF(0, TITLE_CY - 16, W, TITLE_CY + 16), text, false, true);
- Text(dc, br, L"2025", 11, DWRITE_FONT_WEIGHT_NORMAL, C, D2D1::RectF(0, YEAR_CY - 8, W, YEAR_CY + 8), text2);
+ if (!GG) Text(dc, br, L"2025", 11, DWRITE_FONT_WEIGHT_NORMAL, C, D2D1::RectF(0, YEAR_CY - 8, W, YEAR_CY + 8), text2); // macOS 27: sem o ano
const wchar_t* rows[4][2] = {
{ L"Chip", L"Apple M4 Max" },
{ Tr(L"Memória"), Tr(L"128 GB") },
{ Tr(L"Número de série"), g_serial.c_str() },
- { L"macOS", liquid::On() ? L"Tahoe 26.7.2" : L"Sequoia 15.3" }, // Tahoe: a última lançada (26.7.2, out. 2026)
+ { L"macOS", GG ? L"Golden Gate 27.2.1" : liquid::On() ? L"Tahoe 26.7.2" : L"Sequoia 15.3" }, // Golden Gate: a última (27.2.1, nov. 2026) // Tahoe: a última lançada (26.7.2, out. 2026)
};
for (int i = 0; i < 4; i++) {
float cy = ROW0_CY + i * ROW_PITCH;
diff --git a/src/shell/spotlight.cpp b/src/shell/spotlight.cpp
index c9adec2..6c15432 100644
--- a/src/shell/spotlight.cpp
+++ b/src/shell/spotlight.cpp
@@ -39,6 +39,11 @@ float APP_CELL_H = 92, APP_ICON = 77, APP_COLS = 7, APP_ICON_TOP = 1, APP_NAME_T
const float CHIPS_H = 42;
float WIN_H = FIELD_H + 1 + MAX_LIST_H; // as janelas têm sempre este tamanho; só o recorte do vidro anima
float CIRC_GAP = 12;
+// macOS 27 Golden Gate (capturas 2x do 512 Pixels: Spotlight-Search-v2, Spotlight-Actions, Apps): a barra é uma
+// cápsula escura e esfumada de 520 × 85 e os resultados vêm num painel de vidro separado, 11 abaixo, com cantos de 30;
+// linhas de 63,5 com ícone de 36 e a escolhida numa pílula clara (não azul). Sem a cápsula com os quatro círculos.
+float GG_GAP = 0;
+const float GG_BAR_W = 520;
// Tahoe, guia macOS26-Theme-Reference (seções 39 e 56, medido com Acessibilidade): barra de 640 × 56 (a cápsula e
// os 4 círculos de modo, um a cada 64), lista de 640 de largura, linhas de 57 com ícone de 38, topo a 30 % da
// altura da tela; com resultados, cantos de 26
@@ -49,7 +54,14 @@ void Metricas() {
FIELD_H = t ? 56.f : 60.f;
CARD_H = t ? 57.f : 66.f;
CIRC_GAP = t ? 8.f : 12.f;
- WIN_H = FIELD_H + 1 + MAX_LIST_H;
+ GG_GAP = 0;
+ if (t && liquid::Golden()) {
+ W = g_mode == 1 ? 842.f : GG_BAR_W; // Apps (captura Apps.png): painel de 842 sob a barra de 520 centrada
+ FIELD_H = 85;
+ CARD_H = 63.5f;
+ GG_GAP = 11;
+ }
+ WIN_H = FIELD_H + 1 + GG_GAP + MAX_LIST_H;
}
const UINT WM_SP_FILES = WM_APP + 60, WM_SP_ICON = WM_APP + 61, WM_SP_APPS = WM_APP + 62, WM_SP_FRAME = WM_APP + 63, WM_SP_SUGG = WM_APP + 64;
const UINT_PTR T_SEARCH = 1, T_CARET = 2, T_ICONS = 3, T_REGRAB = 4;
@@ -62,7 +74,7 @@ struct Result {
int score = 0;
};
-enum RowType { R_HEAD, R_CARD, R_ROW, R_TILE, R_APP }; // R_APP: célula da grade de apps do Tahoe (ícone e nome embaixo)
+enum RowType { R_HEAD, R_CARD, R_ROW, R_TILE, R_APP, R_MODE }; // R_MODE: macOS 27, os modos na lista do Spotlight vazio // R_APP: célula da grade de apps do Tahoe (ícone e nome embaixo)
struct Row { // cabeçalho (res < 0), cartão do melhor resultado, linha ou miniatura
std::wstring head;
int res = -1;
@@ -100,6 +112,8 @@ bool g_glass, g_open, g_visible; // open: aceita teclado; visible: na tela (inc
// animação (no ritmo do monitor): altura do painel, destaque e rolagem deslizam até o alvo; abrir e
// fechar esmaecem com uma leve mudança de escala, como no Mac
float g_h = FIELD_H, g_selTop = -1, g_selBot = -1, g_scrollNow = 0;
+bool g_keyNav; // macOS 27: o app escolhido só aparece realçado depois das setas (a grade abre sem realce)
+double g_panelInAt = -1e9; // macOS 27: quando o painel de baixo apareceu (entra esmaecendo, sem crescer)
double g_openAt, g_closeAt, g_lastFrame; // ms de anim::Now (relógio de alta precisão)
ui::GpuSurface g_s;
IDWriteTextFormat *g_tfField, *g_tfRow, *g_tfHead, *g_tfTitle, *g_tfSub, *g_tfCell, *g_tfChip;
@@ -173,23 +187,65 @@ std::wstring LearnFile() {
if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_RoamingAppData, 0, nullptr, &p))) { f = std::wstring(p) + L"\\Shell\\spotlight-uso.txt"; CoTaskMemFree(p); }
return f;
}
+// Roda a cada vez que a lista de apps é refeita: SUBSTITUI o que está na memória. Antes somava os textos do
+// arquivo aos que já estavam carregados; a cada recarga a lista dobrava e o próximo SaveLearned gravava a lista
+// dobrada (spotlight-uso.txt chegou a 442 MB e o Shell a 30 GB de memória). Agora cada app guarda no máximo 8
+// textos diferentes, e um arquivo inchado por esse erro é consertado aqui mesmo (lido em pedaços, campo a campo:
+// as linhas dele passam de milhões de caracteres) e regravado.
+constexpr size_t MAX_QUERIES = 8;
+void SaveLearned();
void LoadLearned() {
+ std::wstring file = LearnFile();
FILE* f = nullptr;
- if (_wfopen_s(&f, LearnFile().c_str(), L"r, ccs=UTF-8") || !f) return;
- wchar_t line[4096];
- std::lock_guard<std::mutex> l(g_learnMu);
- while (fgetws(line, 4096, f)) {
- std::wstring ln = line;
- while (!ln.empty() && (ln.back() == L'\n' || ln.back() == L'\r')) ln.pop_back();
- std::vector<std::wstring> parts; size_t a = 0, b;
- while ((b = ln.find(L'\t', a)) != std::wstring::npos) { parts.push_back(ln.substr(a, b - a)); a = b + 1; }
- parts.push_back(ln.substr(a));
- if (parts.size() < 3 || parts[0].empty()) continue;
- Learned& L = g_learn[parts[0]];
- L.opens = _wtoi(parts[1].c_str()); L.last = _wtoi64(parts[2].c_str());
- for (size_t i = 3; i < parts.size(); i++) if (!parts[i].empty()) L.queries.push_back(parts[i]);
- }
+ if (_wfopen_s(&f, file.c_str(), L"r, ccs=UTF-8") || !f) return;
+ std::map<std::wstring, Learned> got;
+ bool repaired = false;
+ std::vector<std::wstring> fields;
+ std::wstring cur;
+ bool curTooLong = false;
+ auto endField = [&] {
+ if (curTooLong) { cur.clear(); repaired = true; } // texto absurdo: não é algo que alguém digitou
+ fields.push_back(std::move(cur));
+ cur.clear(); curTooLong = false;
+ if (fields.size() > 3) { // textos digitados: sem repetir, até 8
+ auto& q = fields.back();
+ bool drop = q.empty() || fields.size() > 3 + MAX_QUERIES || std::find(fields.begin() + 3, fields.end() - 1, q) != fields.end() - 1;
+ if (drop) { if (!q.empty()) repaired = true; fields.pop_back(); }
+ }
+ };
+ auto endLine = [&] {
+ endField();
+ if (fields.size() >= 3 && !fields[0].empty()) {
+ Learned& L = got[fields[0]];
+ L.opens = _wtoi(fields[1].c_str()); L.last = _wtoi64(fields[2].c_str());
+ L.queries.assign(fields.begin() + 3, fields.end());
+ }
+ fields.clear();
+ };
+ static wchar_t buf[64 * 1024];
+ bool any = false;
+ while (fgetws(buf, (int)std::size(buf), f)) {
+ for (const wchar_t* p = buf; *p; p++) {
+ wchar_t c = *p;
+ if (c == 0xFEFF) continue;
+ any = true;
+ if (c == L'\n') { endLine(); any = false; }
+ else if (c == L'\r') {}
+ else if (c == L'\t') endField();
+ else if (cur.size() < 256) cur += c;
+ else curTooLong = true;
+ }
+ }
+ if (any) endLine();
fclose(f);
+ {
+ std::lock_guard<std::mutex> l(g_learnMu);
+ g_learn = std::move(got);
+ }
+ if (repaired) {
+ SaveLearned();
+ Log(L"spotlight: spotlight-uso.txt consertado (textos repetidos de versões antigas)");
+ }
}
void SaveLearned() {
FILE* f = nullptr;
@@ -197,7 +253,7 @@ void SaveLearned() {
std::lock_guard<std::mutex> l(g_learnMu);
for (auto& [t, L] : g_learn) {
fwprintf(f, L"%ls\t%d\t%lld", t.c_str(), L.opens, L.last);
- for (auto& q : L.queries) fwprintf(f, L"\t%ls", q.c_str());
+ for (size_t i = 0; i < L.queries.size() && i < MAX_QUERIES; i++) fwprintf(f, L"\t%ls", L.queries[i].c_str());
fputwc(L'\n', f);
}
fclose(f);
@@ -793,15 +849,17 @@ std::vector<std::wstring> Chips() {
std::vector<std::wstring> v;
if (!liquid::On()) return v;
if (g_mode == 1) for (int k = 1; k < launchpad::CategoryCount(); k++) v.push_back(launchpad::CategoryName(k));
- else if (g_mode == 2) v = { Tr(L"Documentos"), Tr(L"Pastas"), Tr(L"Imagens"), Tr(L"Músicas e Filmes"), Tr(L"Outros") };
+ else if (g_mode == 2 || (g_mode == 0 && liquid::Golden())) v = { Tr(L"Documentos"), Tr(L"Pastas"), Tr(L"Imagens"), Tr(L"Músicas e Filmes"), Tr(L"Outros") };
return v;
}
-bool HasChips() { return ModePanel() && g_mode != 3; }
-float ListTop() { return FIELD_H + 1 + (HasChips() ? CHIPS_H : 0); }
+bool HasChips() { return (ModePanel() && g_mode != 3) || (liquid::Golden() && g_mode == 0 && !g_query.empty()); }
+// macOS 27: com fichas, a lista começa 6 abaixo delas (fichas de 26 com o centro a 33 do alto do painel)
+float ListTop() { return liquid::Golden() && HasChips() ? FIELD_H + GG_GAP + 52 : FIELD_H + 1 + GG_GAP + (HasChips() ? CHIPS_H : 0); }
bool ChipAllows(Kind k, const std::wstring& name) {
- if (!g_chip || !ModePanel()) return true;
+ bool ggAll = liquid::Golden() && g_mode == 0; // macOS 27: as fichas também no Spotlight comum
+ if (!g_chip || (!ModePanel() && !ggAll)) return true;
if (g_mode == 1) return k != K_APP || launchpad::Category(name) == g_chip;
- if (g_mode == 2) {
+ if (g_mode == 2 || ggAll) {
static const Kind kinds[] = { K_OTHER, K_DOC, K_FOLDER, K_IMAGE, K_MEDIA, K_OTHER };
return g_chip < 6 && k == kinds[g_chip];
}
@@ -923,7 +981,20 @@ void BuildMode() {
auto rk = [&](const Result& r) { auto it = rank.find(r.name); return it == rank.end() ? 1 << 30 : it->second; };
std::stable_sort(v.begin(), v.end(), [&](const Result& a, const Result& b) { return rk(a) < rk(b); });
}
- for (auto& r : v) { g_res.push_back(r); g_rows.push_back({ L"", (int)g_res.size() - 1, g_appsList ? R_ROW : R_APP }); }
+ // macOS 27 (Apps.png): a primeira fileira são os 7 apps mais usados, separada do resto por uma linha fina
+ if (liquid::Golden() && !g_appsList && g_chip == 0 && v.size() > 14) {
+ std::vector<Result> top = v;
+ std::stable_sort(top.begin(), top.end(), [](const Result& a, const Result& b) { return a.score > b.score; });
+ for (int k = 0; k < 7; k++) { g_res.push_back(top[k]); Row s{ L"", (int)g_res.size() - 1, R_APP }; s.sect = 7; g_rows.push_back(s); }
+ }
+ bool firstAfter = true;
+ for (auto& r : v) {
+ g_res.push_back(r);
+ Row a{ L"", (int)g_res.size() - 1, g_appsList ? R_ROW : R_APP };
+ if (firstAfter && !g_rows.empty() && g_rows.back().sect == 7) a.sect = 8; // a primeira depois da linha
+ firstAfter = false;
+ g_rows.push_back(a);
+ }
} else if (g_mode == 2) {
// lidos do disco no máximo a cada 5 s (trocar de filtro e voltar não relê)
static std::vector<Result> cache;
@@ -954,7 +1025,14 @@ void Rebuild() {
g_scroll = 0;
std::wstring q = Fold(g_query);
while (!q.empty() && q.back() == L' ') q.pop_back();
- if (q.empty()) { if (ModePanel()) BuildMode(); return; }
+ if (q.empty()) {
+ if (ModePanel()) BuildMode();
+ else if (liquid::Golden() && g_mode == 0) {
+ // macOS 27 (vídeo do MacVince, 5:56): com o campo vazio, a lista mostra os modos com os atalhos à direita
+ for (int k = 0; k < 4; k++) { Row m; m.type = R_MODE; m.sect = k; g_rows.push_back(m); }
+ }
+ return;
+ }
std::vector<Result> appsR, setR;
{
std::lock_guard<std::mutex> l(g_mu);
@@ -1026,11 +1104,14 @@ void Rebuild() {
}
groups.push_back({ Tr(L"Sugestões do Google"), web });
}
+ // macOS 27 Golden Gate: uma lista só, sem cabeçalhos, sem o cartão do melhor resultado e sem miniaturas (cada
+ // resultado numa linha de 63,5 com o nome e, embaixo, o tipo e o lugar em cinza)
+ const bool flat = liquid::Golden();
for (size_t g = 0; g < groups.size(); g++) {
auto& [head, list] = groups[g];
- bool card = hasTop && g == 0; // melhor resultado: cartão, sem cabeçalho
- bool tiles = !wcscmp(head, Section(K_IMAGE));
- if (!card) {
+ bool card = hasTop && g == 0 && !flat; // melhor resultado: cartão, sem cabeçalho
+ bool tiles = !flat && !wcscmp(head, Section(K_IMAGE));
+ if (!card && !flat) {
Row hr{ head, -1, R_HEAD };
for (int k = K_APP; k <= K_OTHER; k++) if (!wcscmp(head, Section((Kind)k))) hr.sect = k;
g_rows.push_back(hr);
@@ -1044,18 +1125,22 @@ void Rebuild() {
// posições de tudo no conteúdo (a partir do topo da lista); devolve a altura total
float Layout() {
- float y = 8, x = PAD;
+ const bool gg = liquid::Golden();
+ float y = gg ? (g_mode == 1 ? 17.5f : HasChips() ? 7.5f : 8.f) : 8, x = PAD; // (a lista já começa 6 abaixo das fichas)
bool inTiles = false;
- const float cellW = (W - 2 * PAD) / APP_COLS;
+ // macOS 27 (Apps.png): 7 colunas de 115 a 18,5 da borda, fileiras de 102, linha de 15 depois dos mais usados
+ const float gpad = gg ? 18.5f : PAD, cellW = gg ? 115.f : (W - 2 * PAD) / APP_COLS, cellH = gg ? 102.f : APP_CELL_H;
int col = 0;
for (auto& row : g_rows) {
if (row.type == R_APP) { // grade de 5, como o Apps do macOS 26
- if (col == (int)APP_COLS) { col = 0; y += APP_CELL_H; }
- row.r = D2D1::RectF(PAD + col * cellW, y, PAD + (col + 1) * cellW, y + APP_CELL_H);
+ if (row.sect == 8 && col) { col = 0; y += cellH; }
+ if (row.sect == 8) y += 15;
+ if (col == (int)APP_COLS) { col = 0; y += cellH; }
+ row.r = D2D1::RectF(gpad + col * cellW, y, gpad + (col + 1) * cellW, y + cellH);
col++;
continue;
}
- if (col) { y += APP_CELL_H; col = 0; }
+ if (col) { y += cellH; col = 0; }
if (row.type == R_TILE) {
if (!inTiles) { x = PAD + 4; inTiles = true; }
if (x + TILE > W - PAD) { x = PAD + 4; y += TILE + TILE_GAP; }
@@ -1064,12 +1149,12 @@ float Layout() {
continue;
}
if (inTiles) { y += TILE + TILE_GAP; inTiles = false; }
- float h = row.type == R_HEAD ? HEAD_H : row.type == R_CARD ? CARD_H : ROW_H;
+ float h = row.type == R_MODE ? 47.f : row.type == R_HEAD ? HEAD_H : row.type == R_CARD ? CARD_H : liquid::Golden() ? CARD_H : ROW_H;
row.r = D2D1::RectF(PAD, y, W - PAD, y + h);
y += h + (row.type == R_CARD ? 4 : 0);
}
if (inTiles) y += TILE + TILE_GAP;
- if (col) y += APP_CELL_H;
+ if (col) y += cellH;
return y + 6;
}
@@ -1081,6 +1166,11 @@ float Sc() { return ui::Scale(g_wnd); }
struct Pal { D2D1_COLOR_F tint, text, text2, sep, sel, hi, card, place; };
Pal Colors() {
+ // macOS 27: o Spotlight é sempre escuro e esfumado, com texto branco, também no modo claro (captura e vídeo)
+ if (liquid::Golden())
+ return { D2D1::ColorF(0.09f, 0.07f, 0.06f, 0.42f), D2D1::ColorF(1, 1, 1, 0.95f), D2D1::ColorF(1, 1, 1, 0.55f),
+ D2D1::ColorF(1, 1, 1, 0.10f), D2D1::ColorF(0.04f, 0.45f, 0.96f, 1), D2D1::ColorF(1, 1, 1, 0.14f),
+ D2D1::ColorF(1, 1, 1, 0.08f), D2D1::ColorF(1, 1, 1, 0.50f) };
if (ui::Dark()) return { D2D1::ColorF(0.12f, 0.12f, 0.13f, 0.62f), D2D1::ColorF(1, 1, 1, 0.92f), D2D1::ColorF(1, 1, 1, 0.50f),
D2D1::ColorF(1, 1, 1, 0.10f), D2D1::ColorF(0.04f, 0.40f, 0.86f, 1), D2D1::ColorF(1, 1, 1, 0.12f),
D2D1::ColorF(1, 1, 1, 0.07f), D2D1::ColorF(1, 1, 1, 0.32f) };
@@ -1187,7 +1277,7 @@ void Transition(float& fade, float& scale);
// altura) seguida de 4 círculos de vidro do tamanho da altura: Aplicativos, Arquivos, Ações e Área de
// Transferência. Escolher um círculo põe o campo nesse modo (só aquele tipo de resultado).
// (g_mode: declarado antes de Rebuild; a área de transferência abre a do Windows)
-bool Compact() { return liquid::On() && g_query.empty() && g_mode == 0 && g_h <= FIELD_H + 1.5f; }
+bool Compact() { return liquid::On() && !liquid::Golden() && g_query.empty() && g_mode == 0 && g_h <= FIELD_H + 1.5f; }
// Tahoe (vídeo do macOS 26, quadro a quadro): o Spotlight abre como uma cápsula comprida, sem círculos. Com o
// ponteiro em cima, a ponta direita recua rápido (passa um pouco e volta, numa mola) e o que sobra vira uma gota
// ondulada que se divide nos quatro círculos: eles saem juntos, quase encostados, e se afastam um depois do outro;
@@ -1207,7 +1297,7 @@ float CircE(int i) { // 0 = ainda na gota, 1 = no lugar (medido no vídeo: se s
bool GooAnimating() { return g_reveal && anim::Now() - g_revealAt < 950; }
unsigned g_broken; // pescoços da gosma que já romperam (não religam)
float PillW() { return W - 4 * (FIELD_H + CIRC_GAP); }
-float MorphT() { return liquid::On() && g_pill >= 0 ? std::clamp((g_pill - PillW()) / (W - PillW()), 0.f, 1.f) : 1.f; } // 0 cápsula, 1 painel
+float MorphT() { return liquid::On() && !liquid::Golden() && g_pill >= 0 ? std::clamp((g_pill - PillW()) / (W - PillW()), 0.f, 1.f) : 1.f; } // 0 cápsula, 1 painel
D2D1_RECT_F CircleRect(int i) { float x = PillW() + CIRC_GAP + i * (FIELD_H + CIRC_GAP); return D2D1::RectF(x, 0, x + FIELD_H, FIELD_H); }
// o círculo i agora (DIP): começa agrupado logo depois da ponta da cápsula (a gota), cresce e vai para o lugar
D2D1_RECT_F CircleNow(int i, float cdx) {
@@ -1228,7 +1318,7 @@ float CapEnd(float pw) {
float e = anim::Spring(Since(), 0.20f, 0.64f); // recua ~50% em 70 ms, passa um pouco em ~170 ms e assenta em ~400
return W - (W - pw) * e;
}
-const wchar_t* ModeName(int m) { return m == 1 ? Tr(L"Aplicativos") : m == 2 ? Tr(L"Arquivos") : m == 3 ? Tr(L"Ações") : Tr(L"Busca do Spotlight"); }
+const wchar_t* ModeName(int m) { return m == 1 ? Tr(L"Aplicativos") : m == 2 ? Tr(L"Arquivos") : m == 3 ? Tr(L"Ações") : liquid::Golden() ? Tr(L"Pesquisar ou Perguntar") : Tr(L"Busca do Spotlight"); }
const wchar_t* ModeSymbol(int m) { return m == 1 ? L"square.grid.2x2" : m == 2 ? L"folder" : m == 3 ? L"slider.horizontal.3" : L"magnifyingglass"; }
bool ModeAllows(int k) {
if (g_mode == 1) return k == K_APP || k == K_CALC;
@@ -1317,37 +1407,83 @@ void Paint() {
}
if (ca > 0.01f) dc->PopLayer();
} else if (liquid::On()) {
- if (!backdrop::Liquid() || backdrop::Real()) liquid::Rim(dc, D2D1::RectF(0, 0, W, H), R, ui::Dark()); // vidro real em peças: o contorno é nosso
+ if ((!backdrop::Liquid() || backdrop::Real()) && !liquid::Golden()) liquid::Rim(dc, D2D1::RectF(0, 0, W, H), R, ui::Dark()); // vidro real em peças: o contorno é nosso (Golden Gate: cada peça tem o seu)
} else {
br->SetColor(ui::Dark() ? D2D1::ColorF(1, 1, 1, 0.14f) : D2D1::ColorF(0, 0, 0, 0.10f));
dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(0.5f, 0.5f, W - 0.5f, H - 0.5f), R - 0.5f, R - 0.5f), br, 1);
}
+ // Golden Gate: a barra é uma cápsula escura e esfumada (preto 88 % em cima -> 62 % embaixo), com texto branco, e
+ // fica centrada quando o painel é mais largo (Apps)
+ const bool gg = liquid::Golden();
+ const float fpw = gg ? std::min(W, GG_BAR_W) : pw, fx0 = gg ? (W - fpw) / 2 : 0;
+ Pal pf = p;
+ D2D1_MATRIX_3X2_F fieldOld; dc->GetTransform(&fieldOld);
+ if (gg) {
+ pf.text = D2D1::ColorF(1, 1, 1, 0.96f); pf.text2 = D2D1::ColorF(1, 1, 1, 0.62f); pf.place = D2D1::ColorF(1, 1, 1, 0.50f);
+ D2D1_RECT_F bar = D2D1::RectF(fx0, 0, fx0 + fpw, FIELD_H);
+ D2D1_GRADIENT_STOP st[2] = { { 0, D2D1::ColorF(0, 0, 0, 0.88f) }, { 1, D2D1::ColorF(0.10f, 0.08f, 0.07f, 0.62f) } };
+ ID2D1GradientStopCollection* gs = nullptr; ID2D1LinearGradientBrush* lb = nullptr;
+ if (SUCCEEDED(dc->CreateGradientStopCollection(st, 2, &gs)) &&
+ SUCCEEDED(dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ 0, 0 }, { 0, FIELD_H }), gs, &lb)))
+ dc->FillRoundedRectangle(D2D1::RoundedRect(bar, FIELD_H / 2, FIELD_H / 2), lb);
+ if (lb) lb->Release();
+ if (gs) gs->Release();
+ liquid::Rim(dc, bar, FIELD_H / 2, true, 0.8f);
+ if (H > FIELD_H + 1.5f) liquid::Rim(dc, D2D1::RectF(0, FIELD_H + GG_GAP, W, H), 30, ui::Dark(), 0.8f);
+ dc->SetTransform(D2D1::Matrix3x2F::Translation(fx0 + 18, 0) * fieldOld); // texto a 38 da borda (20 + 18)
+ }
// campo
- br->SetColor(p.text2);
- simbolo::Draw(dc, ModeSymbol(g_mode), D2D1::RectF(20, FIELD_H / 2 - 12, 44, FIELD_H / 2 + 12), br);
- D2D1_RECT_F field = D2D1::RectF(56, 0, pw - 20, FIELD_H);
+ br->SetColor(pf.text2);
+ // macOS 27: o símbolo do modo só aparece com o campo vazio (a 31,5 da borda, o texto a 76); digitando, sem símbolo
+ // e o texto a 38 (texto de 22 pt)
+ if (!gg) simbolo::Draw(dc, ModeSymbol(g_mode), D2D1::RectF(20, FIELD_H / 2 - 12, 44, FIELD_H / 2 + 12), br);
+ else if (g_query.empty() && g_mode != 0) simbolo::Draw(dc, ModeSymbol(g_mode), D2D1::RectF(13.5f, FIELD_H / 2 - 12, 37.5f, FIELD_H / 2 + 12), br);
+ D2D1_RECT_F field = gg ? D2D1::RectF(g_query.empty() && g_mode != 0 ? 58.f : 20.f, 0, fpw - 38, FIELD_H) : D2D1::RectF(56, 0, fpw - 20, FIELD_H);
+ static IDWriteTextFormat* tfFieldGG = ui::Format(22, DWRITE_FONT_WEIGHT_NORMAL);
+ IDWriteTextFormat* const tfF = gg && tfFieldGG ? tfFieldGG : g_tfField;
+ if (g_query.empty() && gg && g_mode == 0) { // macOS 27: microfone (contorno) a ~50 da borda direita, só com o campo vazio
+ float mx = fpw - 50 - 18, my = FIELD_H / 2;
+ br->SetColor(pf.text2);
+ dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(mx - 4.5f, my - 11, mx + 4.5f, my + 3), 4.5f, 4.5f), br, 1.6f);
+ ID2D1Factory* fac = nullptr; dc->GetFactory(&fac);
+ ID2D1PathGeometry* pg = nullptr;
+ if (fac && SUCCEEDED(fac->CreatePathGeometry(&pg))) {
+ ID2D1GeometrySink* sk = nullptr;
+ if (SUCCEEDED(pg->Open(&sk))) {
+ sk->BeginFigure({ mx - 8, my - 3 }, D2D1_FIGURE_BEGIN_HOLLOW);
+ sk->AddArc(D2D1::ArcSegment({ mx + 8, my - 3 }, { 8, 8 }, 0, D2D1_SWEEP_DIRECTION_COUNTER_CLOCKWISE, D2D1_ARC_SIZE_SMALL));
+ sk->EndFigure(D2D1_FIGURE_END_OPEN);
+ sk->Close(); sk->Release();
+ }
+ dc->DrawGeometry(pg, br, 1.6f);
+ pg->Release();
+ }
+ if (fac) fac->Release();
+ dc->DrawLine({ mx, my + 5 }, { mx, my + 10 }, br, 1.6f);
+ dc->DrawLine({ mx - 4, my + 10.5f }, { mx + 4, my + 10.5f }, br, 1.6f);
+ }
if (g_query.empty()) {
- Text(dc, ModeName(g_mode), g_tfField, field, br, p.place);
- if (g_mode >= 1 && g_mode <= 3) { // o atalho do modo, à direita (o "⌘1" do Mac; aqui Ctrl+1)
+ Text(dc, ModeName(g_mode), tfF, field, br, pf.place);
+ if (g_mode >= 1 && g_mode <= 3 && !gg) { // o atalho do modo, à direita (o "⌘1" do Mac; aqui Ctrl+1); macOS 27: sem
static IDWriteTextFormat* tfKey = ui::Format(13, DWRITE_FONT_WEIGHT_MEDIUM, false, DWRITE_TEXT_ALIGNMENT_TRAILING);
wchar_t k[16]; swprintf_s(k, L"Ctrl %d", g_mode);
- float right = (ModePanel() && g_mode == 1) ? W - 60 : pw - 20;
- if (tfKey) Text(dc, k, tfKey, D2D1::RectF(right - 90, 0, right, FIELD_H), br, p.place);
+ float right = gg ? fpw - 56 : (ModePanel() && g_mode == 1) ? W - 60 : fpw - 20; // Golden Gate: a 38 da borda (o desenho vai 18 para a direita)
+ if (tfKey) Text(dc, k, tfKey, D2D1::RectF(right - 90, 0, right, FIELD_H), br, pf.place);
}
} else {
- float tw = ui::TextWidth(g_tfField, g_query);
+ float tw = ui::TextWidth(tfF, g_query);
if (g_selAll) { // tudo selecionado (Ctrl+A / ao reabrir)
br->SetColor(D2D1::ColorF(p.sel.r, p.sel.g, p.sel.b, 0.45f));
dc->FillRectangle(D2D1::RectF(field.left - 1, FIELD_H / 2 - 17, field.left + tw + 1, FIELD_H / 2 + 17), br);
}
- Text(dc, g_query, g_tfField, field, br, p.text);
+ Text(dc, g_query, tfF, field, br, pf.text);
// completa o melhor resultado em cinza ("saf" → "ari"), como no Mac
if (!g_selAll && g_sel >= 0 && g_rows[g_sel].res >= 0) {
const Result& r = g_res[g_rows[g_sel].res];
if (r.kind != K_WEB && r.kind != K_CALC && Lower(r.name).rfind(Lower(g_query), 0) == 0 && r.name.size() > g_query.size())
- Text(dc, r.name.substr(g_query.size()), g_tfField, D2D1::RectF(field.left + tw, 0, field.right, FIELD_H), br, p.place);
- else if (r.kind == K_CALC) Text(dc, L" = " + r.name, g_tfField, D2D1::RectF(field.left + tw, 0, field.right, FIELD_H), br, p.place);
+ Text(dc, r.name.substr(g_query.size()), tfF, D2D1::RectF(field.left + tw, 0, field.right, FIELD_H), br, pf.place);
+ else if (r.kind == K_CALC) Text(dc, L" = " + r.name, tfF, D2D1::RectF(field.left + tw, 0, field.right, FIELD_H), br, pf.place);
}
if (g_caretOn && !g_selAll) {
br->SetColor(p.sel);
@@ -1356,50 +1492,70 @@ void Paint() {
}
if (ModePanel() && g_query.empty() && g_mode == 1) { // botão ⋯ (grade ou lista), à direita do campo
- g_moreR = D2D1::RectF(W - 20 - 30, FIELD_H / 2 - 15, W - 20, FIELD_H / 2 + 15);
+ float mr = gg ? fpw - 18 - 30 : W - 20; // Golden Gate: "⋯" solto, sem círculo, centrado a 45 da borda da barra
+ g_moreR = D2D1::RectF(mr - 30, FIELD_H / 2 - 15, mr, FIELD_H / 2 + 15);
float cx = (g_moreR.left + g_moreR.right) / 2;
- br->SetColor(p.text2);
- dc->DrawEllipse(D2D1::Ellipse({ cx, FIELD_H / 2 }, 11, 11), br, 1.5f);
+ br->SetColor(pf.text2);
+ if (!gg) dc->DrawEllipse(D2D1::Ellipse({ cx, FIELD_H / 2 }, 11, 11), br, 1.5f);
for (int k = -1; k <= 1; k++) dc->FillEllipse(D2D1::Ellipse({ cx + k * 5.f, FIELD_H / 2 }, 1.5f, 1.5f), br);
+ if (gg) { g_moreR.left += fx0 + 18; g_moreR.right += fx0 + 18; } // o clique é sem o deslocamento do desenho
} else g_moreR = {};
+ dc->SetTransform(fieldOld);
if (H > FIELD_H + 1.5f) {
br->SetColor(p.sep);
- if (liquid::On()) dc->FillRectangle(D2D1::RectF(20, FIELD_H, W - 20, FIELD_H + 1), br); // Tahoe: divisa solta das bordas
+ if (gg) {} // Golden Gate: barra e painel separados, sem divisa
+ else if (liquid::On()) dc->FillRectangle(D2D1::RectF(20, FIELD_H, W - 20, FIELD_H + 1), br); // Tahoe: divisa solta das bordas
else dc->FillRectangle(D2D1::RectF(0, FIELD_H, W, FIELD_H + 1), br);
float listTop = ListTop();
Layout();
// conteúdo novo (trocou de modo): entra esmaecendo e subindo 10 pt, como no Mac
float lin = anim::Ease(std::clamp((float)((anim::Now() - g_listIn) / 240.0), 0.f, 1.f));
+ // macOS 27: o painel entra só esmaecendo (~140 ms), sem subir
+ const float ggIn = gg ? anim::Ease(std::clamp((float)((anim::Now() - g_panelInAt) / 140.0), 0.f, 1.f)) : 1.f;
D2D1_MATRIX_3X2_F listOld; dc->GetTransform(&listOld);
- const bool listAnim = lin < 0.999f;
+ const bool listAnim = lin < 0.999f || ggIn < 0.999f;
if (listAnim) {
- dc->SetTransform(D2D1::Matrix3x2F::Translation(0, (1 - lin) * 10) * listOld);
- dc->PushLayer(D2D1::LayerParameters1(D2D1::InfiniteRect(), nullptr, D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, D2D1::IdentityMatrix(), lin), nullptr);
+ dc->SetTransform(D2D1::Matrix3x2F::Translation(0, gg ? 0.f : (1 - lin) * 10) * listOld);
+ dc->PushLayer(D2D1::LayerParameters1(D2D1::InfiniteRect(), nullptr, D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, D2D1::IdentityMatrix(), (gg ? 1.f : lin) * ggIn), nullptr);
}
if (HasChips()) { // Tahoe: fileira de filtros (categorias / tipos), pílulas de vidro fracas
auto chips = Chips();
g_chipR.clear();
- float x = PAD + 4, cy = FIELD_H + 1 + CHIPS_H / 2;
+ float x = PAD + 4, cy = gg ? FIELD_H + GG_GAP + 33 : FIELD_H + 1 + GG_GAP + CHIPS_H / 2; // macOS 27: centro a 33 do alto do painel
bool dark = ui::Dark();
+ static IDWriteTextFormat* tfChipGG = ui::Format(15, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ IDWriteTextFormat* tfC = gg && tfChipGG ? tfChipGG : g_tfChip;
+ if (tfC) tfC->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER);
+ if (gg) x = 20; // macOS 27: fichas de 26 com texto de 15, a 20 da borda do painel
for (int i = 0; i < (int)chips.size(); i++) {
- float tw = ui::TextWidth(g_tfChip, chips[i]);
- D2D1_RECT_F c = D2D1::RectF(x, cy - 12, x + tw + 26, cy + 12); // pílulas de 24 de altura (guia, seção 39)
+ float tw = ui::TextWidth(tfC, chips[i]), ch = gg ? 13.f : 12.f;
+ D2D1_RECT_F c = D2D1::RectF(x, cy - ch, x + tw + (gg ? 24 : 26), cy + ch); // pílulas de 24 de altura (guia, seção 39)
if (c.right > W - PAD) break;
bool on = g_chip == i + 1;
br->SetColor(on ? D2D1::ColorF(p.sel.r, p.sel.g, p.sel.b, 0.85f) : dark ? D2D1::ColorF(1, 1, 1, 0.07f) : D2D1::ColorF(1, 1, 1, 0.38f));
- dc->FillRoundedRectangle(D2D1::RoundedRect(c, 12, 12), br);
- if (!on) liquid::Rim(dc, c, 12, dark, 0.6f);
- Text(dc, chips[i], g_tfChip, c, br, on ? D2D1::ColorF(1, 1, 1, 1) : p.text2);
+ dc->FillRoundedRectangle(D2D1::RoundedRect(c, ch, ch), br);
+ if (!on) liquid::Rim(dc, c, ch, dark, 0.6f);
+ Text(dc, chips[i], tfC, c, br, on ? D2D1::ColorF(1, 1, 1, 1) : gg ? p.text : p.text2);
g_chipR.push_back(c);
x = c.right + 8;
}
}
dc->PushAxisAlignedClip(D2D1::RectF(0, listTop, W, H - 1), D2D1_ANTIALIAS_MODE_ALIASED);
+ // macOS 27: o que rola some esmaecendo nos 26 de cima da lista (antes cortava seco, colado nas fichas)
+ ID2D1LinearGradientBrush* edgeMask = nullptr;
+ if (gg && g_scrollNow > 0.5f) {
+ D2D1_GRADIENT_STOP st[2] = { { 0, D2D1::ColorF(0, 0, 0, 0) }, { 1, D2D1::ColorF(0, 0, 0, 1) } };
+ ID2D1GradientStopCollection* gs = nullptr;
+ if (SUCCEEDED(dc->CreateGradientStopCollection(st, 2, &gs)))
+ dc->CreateLinearGradientBrush(D2D1::LinearGradientBrushProperties({ 0, listTop }, { 0, listTop + 26 }), gs, &edgeMask);
+ if (gs) gs->Release();
+ if (edgeMask) dc->PushLayer(D2D1::LayerParameters1(D2D1::InfiniteRect(), nullptr, D2D1_ANTIALIAS_MODE_PER_PRIMITIVE, D2D1::IdentityMatrix(), 1, edgeMask), nullptr);
+ }
float oy = listTop - g_scrollNow;
// destaque que desliza entre as linhas
if (g_sel >= 0 && g_rows[g_sel].type == R_ROW && g_selBot > g_selTop) {
- br->SetColor(p.hi);
- float hr = liquid::On() ? std::min(16.f, (g_selBot - g_selTop) / 2) : 9.f; // Tahoe: destaque em cápsula
+ br->SetColor(gg ? (ui::Dark() ? D2D1::ColorF(1, 1, 1, 0.12f) : D2D1::ColorF(1, 1, 1, 0.30f)) : p.hi); // Golden Gate: pílula clara
+ float hr = gg ? std::min(22.f, (g_selBot - g_selTop) / 2) : liquid::On() ? std::min(16.f, (g_selBot - g_selTop) / 2) : 9.f; // Tahoe: destaque em cápsula
dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(PAD, g_selTop + oy, W - PAD, g_selBot + oy), hr, hr), br);
}
for (int i = 0; i < (int)g_rows.size(); i++) {
@@ -1407,6 +1563,20 @@ void Paint() {
D2D1_RECT_F r = D2D1::RectF(row.r.left, row.r.top + oy, row.r.right, row.r.bottom + oy);
if (r.bottom < listTop || r.top > H) continue;
bool s = i == g_sel;
+ if (row.type == R_MODE) { // macOS 27: símbolo de 24 a 36 da borda, nome de 17 a 70 e o atalho em cinza à direita
+ static IDWriteTextFormat* tfM = ui::Format(17, DWRITE_FONT_WEIGHT_NORMAL);
+ static IDWriteTextFormat* tfK = ui::Format(17, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_TRAILING);
+ static const wchar_t* names[4] = { L"Aplicativos", L"Arquivos", L"Ações", L"Área de Transferência" };
+ static const wchar_t* syms[4] = { L"square.grid.2x2", L"folder", L"slider.horizontal.3", L"rectangle.on.rectangle" };
+ float cy = (r.top + r.bottom) / 2, ix = r.left + 24;
+ if (g_spHover.x >= r.left && g_spHover.x < r.right && g_spHover.y >= r.top && g_spHover.y < r.bottom) { br->SetColor(D2D1::ColorF(1, 1, 1, 0.10f)); dc->FillRoundedRectangle(D2D1::RoundedRect(r, 14, 14), br); }
+ br->SetColor(p.text);
+ simbolo::Draw(dc, syms[row.sect], D2D1::RectF(ix - 12, cy - 11, ix + 12, cy + 11), br);
+ Text(dc, Tr(names[row.sect]), tfM, D2D1::RectF(r.left + 58, r.top, r.right - 90, r.bottom), br, p.text);
+ wchar_t k[16]; swprintf_s(k, L"Ctrl %d", row.sect + 1);
+ if (tfK) Text(dc, k, tfK, D2D1::RectF(r.right - 140, r.top, r.right - 28, r.bottom), br, p.text2);
+ continue;
+ }
if (row.type == R_HEAD) {
Text(dc, row.head, g_tfHead, D2D1::RectF(r.left + 10, r.top + 8, r.right - 10, r.bottom), br, p.text2);
bool open = g_more.count(row.sect) > 0;
@@ -1418,11 +1588,15 @@ void Paint() {
}
const Result& res = g_res[row.res];
if (row.type == R_APP) { // ícone grande e o nome embaixo (duas linhas no máximo)
+ if (gg && row.sect == 8) { // macOS 27: a linha fina entre os mais usados e o resto
+ br->SetColor(D2D1::ColorF(1, 1, 1, 0.24f));
+ dc->FillRectangle(D2D1::RectF(18.5f, r.top - 8, W - 18.5f, r.top - 7), br);
+ }
if (g_dragging && i == g_press) continue; // o arrastado vai por cima, no ponteiro
if (auto it = g_cellAt.find(res.target); it != g_cellAt.end()) // deslizando até o lugar novo
r = D2D1::RectF(it->second.x, it->second.y + oy, it->second.x + (row.r.right - row.r.left), it->second.y + oy + (row.r.bottom - row.r.top));
bool edit = g_edit && CanArrange();
- if (s && !edit) { br->SetColor(p.hi); dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 6, r.top + 4, r.right - 6, r.bottom - 4), 16, 16), br); }
+ if (s && !edit && (!gg || g_keyNav)) { br->SetColor(p.hi); dc->FillRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 6, r.top + 4, r.right - 6, r.bottom - 4), 16, 16), br); }
float cx = (r.left + r.right) / 2;
D2D1_RECT_F ir = D2D1::RectF(cx - APP_ICON / 2, r.top + APP_ICON_TOP, cx + APP_ICON / 2, r.top + APP_ICON_TOP + APP_ICON);
D2D1_MATRIX_3X2_F base; dc->GetTransform(&base);
@@ -1442,7 +1616,21 @@ void Paint() {
dc->DrawLine({ xc.x - 4, xc.y - 4 }, { xc.x + 4, xc.y + 4 }, br, 1.8f);
dc->DrawLine({ xc.x - 4, xc.y + 4 }, { xc.x + 4, xc.y - 4 }, br, 1.8f);
}
- Text(dc, res.name, g_tfCell, D2D1::RectF(r.left + 4, r.top + APP_NAME_TOP, r.right - 4, r.top + APP_NAME_TOP + 18), br, p.text);
+ {
+ static IDWriteTextFormat* tfCellGG = ui::Format(13, DWRITE_FONT_WEIGHT_NORMAL, false, DWRITE_TEXT_ALIGNMENT_CENTER);
+ float nt = gg ? 78.f : APP_NAME_TOP; // macOS 27: nome de 13 com o centro 47 abaixo do centro do ícone
+ static bool trimmed;
+ if (gg && tfCellGG && !trimmed) { // uma linha só, terminando em "…" (System Informat…), como no macOS 27
+ trimmed = true;
+ tfCellGG->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
+ IDWriteInlineObject* dots = nullptr;
+ ui::dw->CreateEllipsisTrimmingSign(tfCellGG, &dots);
+ DWRITE_TRIMMING tr{ DWRITE_TRIMMING_GRANULARITY_CHARACTER, 0, 0 };
+ tfCellGG->SetTrimming(&tr, dots);
+ if (dots) dots->Release();
+ }
+ Text(dc, res.name, gg && tfCellGG ? tfCellGG : g_tfCell, D2D1::RectF(r.left + 2, r.top + nt, r.right - 2, r.top + nt + 18), br, p.text);
+ }
if (edit) dc->SetTransform(base);
continue;
}
@@ -1475,6 +1663,21 @@ void Paint() {
dc->DrawRoundedRectangle(D2D1::RoundedRect(D2D1::RectF(r.left + 0.5f, r.top + 0.5f, r.right - 0.5f, r.bottom - 0.5f), 13.5f, 13.5f), br, 1);
}
}
+ if (gg && !card) { // macOS 27: ícone de 36 a 30 da borda, nome de 17 a 80 e o tipo · lugar em cinza de 15 embaixo
+ static IDWriteTextFormat* tfT = ui::Format(17, DWRITE_FONT_WEIGHT_NORMAL);
+ static IDWriteTextFormat* tfS = ui::Format(15, DWRITE_FONT_WEIGHT_NORMAL);
+ float cy2 = (r.top + r.bottom) / 2;
+ DrawIcon(dc, br, res, D2D1::RectF(r.left + 18, cy2 - 18, r.left + 54, cy2 + 18), p);
+ std::wstring name = res.kind == K_CALC ? res.detail + L" = " + res.name : res.name;
+ NameText(dc, name, tfT, D2D1::RectF(r.left + 68, r.top + 11, r.right - 14, r.top + 33), br, p.text);
+ const wchar_t* kindName = res.kind == K_APP ? L"Aplicativo" : res.kind == K_FOLDER ? L"Pasta" : res.kind == K_DOC ? L"Documento" :
+ res.kind == K_IMAGE ? L"Imagem" : res.kind == K_WEB ? L"Pesquisar na Web" : nullptr;
+ std::wstring acc = Accessory(res), sub = kindName ? Tr(kindName) : L"";
+ if (res.kind == K_WEB) acc.clear();
+ if (!acc.empty()) sub += (sub.empty() ? L"" : L" · ") + acc;
+ if (!sub.empty()) Text(dc, sub, tfS, D2D1::RectF(r.left + 68, r.top + 33, r.right - 14, r.top + 53), br, p.text2);
+ continue;
+ }
float ic = card ? (liquid::On() ? 38.f : 40.f) : 24.f, cy = (r.top + r.bottom) / 2;
if (card) { // ícone num círculo, como no cartão do Mac (apps ficam com o ícone deles)
if (res.kind != K_APP) {
@@ -1494,6 +1697,7 @@ void Paint() {
float k = APP_ICON * 1.12f;
DrawIcon(dc, br, g_res[g_rows[g_press].res], D2D1::RectF(g_dragPt.x - k / 2, g_dragPt.y - k / 2, g_dragPt.x + k / 2, g_dragPt.y + k / 2), p);
}
+ if (edgeMask) { dc->PopLayer(); edgeMask->Release(); }
dc->PopAxisAlignedClip();
if (listAnim) { dc->PopLayer(); dc->SetTransform(listOld); }
}
@@ -1534,6 +1738,12 @@ void Paint() {
}
}
backdrop::SetPieces(g_back, W * sc, H * sc, pcs, tint, 10.f);
+ } else if (gg && backdrop::Real()) { // Golden Gate: a barra e o painel em duas peças de vidro
+ tint = D2D1::ColorF(0.09f, 0.07f, 0.06f, 0.42f); // tinta escura por cima do fundo bem desfocado (nunca transparente)
+ const float fpw2 = std::min(W, GG_BAR_W), fx2 = (W - fpw2) / 2;
+ std::vector<backdrop::Piece> pcs{ { D2D1::RectF(fx2 * sc, 0, (fx2 + fpw2) * sc, FIELD_H * sc), FIELD_H / 2 * sc } };
+ if (H > FIELD_H + 1.5f) pcs.push_back({ D2D1::RectF(0, (FIELD_H + GG_GAP) * sc, W * sc, H * sc), 30 * sc });
+ backdrop::SetPieces(g_back, W * sc, H * sc, pcs, tint, 10.f); // o desfoque segue o controle (mínimo igual ao do Tahoe)
} else if (liquid::On() && backdrop::Real()) { // Tahoe: vidro claro atrás do texto, como o Spotlight do macOS 26
std::vector<backdrop::Piece> pcs{ { D2D1::RectF(0, 0, pw * sc, H * sc), SpotR(H) * sc } };
backdrop::SetPieces(g_back, W * sc, H * sc, pcs, tint, 10.f);
@@ -1593,6 +1803,13 @@ bool Step() {
}
float targetH = PanelH();
float listH = std::max(0.f, targetH - ListTop());
+ if (liquid::Golden()) {
+ // macOS 27 (vídeo, 5:58,8–5:58,9, quadro a quadro): o painel não cresce; aparece já do tamanho final, esmaecido e
+ // desfocado, e fica nítido em ~140 ms. Ao mudar de tamanho (digitando), troca direto
+ if (g_h <= FIELD_H + 1.5f && targetH > FIELD_H + 1.5f) g_panelInAt = now + (now - g_openAt < 100 ? 110 : 0); // ao abrir, a barra vem antes e a lista ~110 ms depois (vídeo)
+ g_h = targetH;
+ moving |= now - g_panelInAt < 160; // (inclui a espera antes de começar)
+ } else
moving |= ease(g_h, targetH, 0.045f); // cresce/encolhe rápido, como o do Mac
// rolagem para mostrar o escolhido (com o cabeçalho dele)
if (g_sel >= 0 && g_sel < (int)g_rows.size()) {
@@ -1855,7 +2072,7 @@ void EndEdit() {
}
void SaveOrder() { // a ordem de agora (todos os apps não tirados)
std::vector<std::wstring> v;
- for (auto& row : g_rows) if (row.type == R_APP && row.res >= 0) v.push_back(g_res[row.res].name);
+ for (auto& row : g_rows) if (row.type == R_APP && row.res >= 0 && row.sect != 7) v.push_back(g_res[row.res].name); // sem a fileira dos mais usados
shell::SetSetting(L"apps_ordem", JoinBar(v));
Log(L"spotlight: ordem dos apps guardada (%zu)", v.size());
}
@@ -1999,6 +2216,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
}
break;
case VK_UP: case VK_DOWN: { // nas miniaturas, sobe/desce pula a fileira inteira
+ g_keyNav = true;
int dir = w == VK_UP ? -1 : 1;
if (g_sel >= 0 && g_rows[g_sel].type == R_APP) { // grade de apps: a mesma coluna na fileira de cima/baixo
int i = g_sel + dir * 5;
@@ -2014,6 +2232,7 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
return 0;
}
case VK_LEFT: case VK_RIGHT: // entre as miniaturas
+ g_keyNav = true;
if (g_sel >= 0 && (g_rows[g_sel].type == R_TILE || g_rows[g_sel].type == R_APP)) {
int i = g_sel + (w == VK_LEFT ? -1 : 1);
if (i >= 0 && i < (int)g_rows.size() && g_rows[i].type == g_rows[g_sel].type) { g_sel = i; Animate(); Paint(); }
@@ -2091,6 +2310,20 @@ LRESULT CALLBACK Proc(HWND h, UINT m, WPARAM w, LPARAM l) {
}
int i = RowAt(Pt(l));
if (i < 0) { if (g_edit) EndEdit(); return 0; } // clicar no vazio termina a edição
+ if (g_rows[i].type == R_MODE) { // macOS 27: a linha do modo entra nele (Área de Transferência: o Win+V)
+ int k = g_rows[i].sect;
+ if (k == 3) {
+ Close();
+ INPUT in[4]{};
+ for (auto& x : in) x.type = INPUT_KEYBOARD;
+ in[0].ki.wVk = VK_LWIN; in[1].ki.wVk = 'V'; in[2].ki.wVk = 'V'; in[2].ki.dwFlags = KEYEVENTF_KEYUP;
+ in[3].ki.wVk = VK_LWIN; in[3].ki.dwFlags = KEYEVENTF_KEYUP;
+ SendInput(4, in, sizeof(INPUT));
+ return 0;
+ }
+ g_mode = k + 1; g_chip = 0; g_scroll = 0; ModeChanged(); Refresh();
+ return 0;
+ }
if (g_rows[i].type == R_APP && CanArrange()) {
g_press = i; g_dragging = false; g_downPt = Pt(l); g_pressWasSel = i == g_sel;
SetCapture(h);
@@ -2336,6 +2569,7 @@ static void OpenWith(int mode) {
if (!g_visible) Metricas(); // tema (ou o modo Apps, mais largo) pode ter mudado desde a última vez
g_scroll = 0;
g_openAt = anim::Now();
+ g_keyNav = false;
const bool wasVisible = g_visible;
if (!g_visible) { g_h = FIELD_H; g_scrollNow = 0; } // nasce só com o campo; os resultados crescem dele
g_visible = true;
diff --git a/src/shell/ui.cpp b/src/shell/ui.cpp
index 6a0a1ab..39f5bed 100644
--- a/src/shell/ui.cpp
+++ b/src/shell/ui.cpp
@@ -294,7 +294,7 @@ std::vector<Clock*> g_clocks;
// ---- Estilo dos ícones do macOS 26 (Aparência > Estilo de ícones e widgets)
D2D1_COLOR_F ui::Accent() {
static const std::pair<const wchar_t*, UINT32> acc[] = { { L"azul", 0x007AFF }, { L"roxo", 0x953D96 }, { L"rosa", 0xF74F9E }, { L"vermelho", 0xE0383E },
- { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C } };
+ { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C }, { L"lavanda", 0x98A8D9 } }; // lavanda: a 10ª cor do macOS 27
std::wstring d = shell::Setting(L"destaque", L"azul");
UINT32 c = 0x007AFF;
for (auto& [n, v] : acc) if (d == n) c = v;
@@ -308,7 +308,10 @@ std::wstring ui::IconStyleKey() {
std::wstring ui::IconStyle() {
if (!liquid::On()) return L"padrao";
- return shell::Setting(L"estilo_icones", L"padrao");
+ std::wstring st = shell::Setting(L"estilo_icones", L"padrao");
+ // macOS 27: Escuro com "Auto" (estilo_escuro_auto=1) só vale no modo escuro
+ if (st == L"escuro" && shell::Setting(L"estilo_escuro_auto", L"0") == L"1" && !Dark()) return L"padrao";
+ return st;
}
// Ícones "Transparente" e "Tingido" do macOS 26: o ícone não ganha só um filtro de cor, vira uma peça de Liquid Glass.
@@ -475,7 +478,7 @@ void ui::StyleIcon(UINT w, UINT h, std::vector<BYTE>& px, const std::wstring& st
float tr = 0.04f, tg = 0.52f, tb = 1.0f; // azul do Mac
{
static const std::pair<const wchar_t*, UINT32> acc[] = { { L"roxo", 0x953D96 }, { L"rosa", 0xF74F9E }, { L"vermelho", 0xE0383E },
- { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C } };
+ { L"laranja", 0xF7821B }, { L"amarelo", 0xFCB827 }, { L"verde", 0x62BA46 }, { L"grafite", 0x8C8C8C }, { L"lavanda", 0x98A8D9 } }; // lavanda: a 10ª cor do macOS 27
std::wstring d = shell::Setting(L"destaque", L"azul");
for (auto& [n, c] : acc) if (d == n) { tr = ((c >> 16) & 255) / 255.f; tg = ((c >> 8) & 255) / 255.f; tb = (c & 255) / 255.f; }
}
@@ -670,6 +673,10 @@ std::wstring ui::PackIcon(const std::wstring& name) {
std::wstring root = shell::dir.substr(0, shell::dir.find_last_of(L'\\')) + L"\\icones";
std::wstring extra = root + L"\\extra\\" + name + L".png"; // escolhidos pelo usuário vencem
if (GetFileAttributesW(extra.c_str()) != INVALID_FILE_ATTRIBUTES) return extra;
+ if (liquid::Golden()) { // Golden Gate: os ícones do macOS 27 (icones\goldengate, tools\icones-goldengate.py)
+ std::wstring g = root + L"\\goldengate\\" + name + L".png";
+ if (GetFileAttributesW(g.c_str()) != INVALID_FILE_ATTRIBUTES) return g;
+ }
if (liquid::On()) { // Tema Tahoe: icones\tahoe antes do pacote do Sequoia
std::wstring t = root + L"\\tahoe\\" + name + L".png";
if (GetFileAttributesW(t.c_str()) != INVALID_FILE_ATTRIBUTES) return t;
diff --git a/src/shell/verde.cpp b/src/shell/verde.cpp
index af5626b..e8c515c 100644
--- a/src/shell/verde.cpp
+++ b/src/shell/verde.cpp
@@ -140,6 +140,11 @@ void Paint() {
ui::GpuEnd(g_s);
if (g_glass) {
D2D1_COLOR_F tint = dark ? D2D1::ColorF(0.165f, 0.165f, 0.172f, 0.85f) : D2D1::ColorF(0.96f, 0.96f, 0.965f, 0.77f); // vidro dos menus (seção 52)
+ // é um menu: vidro fosco que não segue o controle de transparência (no mínimo ele sumia e o texto de trás aparecia)
+ if (liquid::On()) {
+ tint = dark ? D2D1::ColorF(0.17f, 0.165f, 0.165f, 0.90f) : D2D1::ColorF(0.95f, 0.945f, 0.94f, 0.86f);
+ backdrop::SetPieces(g_back, (float)wpx, (float)hpx, { { D2D1::RectF(0, 0, (float)wpx, (float)hpx), R * sc } }, tint, 24.f);
+ } else
backdrop::Set(g_back, (float)wpx, (float)hpx, R * sc, tint);
backdrop::Fade(g_back, 1, 1, 0, 0);
}
diff --git a/src/shell/widgets.cpp b/src/shell/widgets.cpp
index 1b4ce91..2d93887 100644
--- a/src/shell/widgets.cpp
+++ b/src/shell/widgets.cpp
@@ -594,7 +594,7 @@ void Paint(Widget& wd) {
ID2D1SolidColorBrush* br = nullptr;
dc->CreateSolidColorBrush(WHITE, &br);
ID2D1StrokeStyle* st = RoundCaps(dc);
- std::wstring est = liquid::On() ? shell::Setting(L"estilo_icones", L"padrao") : L"padrao";
+ std::wstring est = ui::IconStyle(); // Tahoe/Golden Gate: Aparência > Estilo de ícones e widgets (Escuro "Auto" incluído)
g_vidroWidgets = est == L"transparente" || est == L"tingido";
bool dark = g_dark || g_vidroWidgets; // vidro: o conteúdo em branco, como no modo escuro
if (br) {
diff --git a/src/terminal/main.cpp b/src/terminal/main.cpp
index a94c8cc..80d4969 100644
--- a/src/terminal/main.cpp
+++ b/src/terminal/main.cpp
@@ -591,6 +591,7 @@ void Render() {
D2D1_POINT_2F c{ 19.f + k * 23, TITLE_H / 2 };
br->SetColor(lit ? fill[k] : D2D1::ColorF(0.30f, 0.30f, 0.31f));
g_rt->FillEllipse(D2D1::Ellipse(c, 7, 7), br);
+ semaforo::Gloss(g_rt, c, 7, br);
br->SetColor(lit ? ring[k] : D2D1::ColorF(0, 0, 0, 0.3f));
g_rt->DrawEllipse(D2D1::Ellipse(c, 6.75f, 6.75f), br, 0.5f);
if (!g_hoverLights) continue;
diff --git a/src/textedit/main.cpp b/src/textedit/main.cpp
index 4d271fc..8ed6d82 100644
--- a/src/textedit/main.cpp
+++ b/src/textedit/main.cpp
@@ -13,7 +13,7 @@ using namespace app2d;
namespace {
-const float BAR = 40;
+const float TBAR = 40; // barra de formatação (Sequoia/Tahoe)
HWND g_edit;
std::wstring g_path;
bool g_plain = false;
@@ -21,7 +21,9 @@ IDWriteTextFormat *g_tfBtn, *g_tfIcon, *g_tfB, *g_tfI, *g_tfU;
struct Btn { int id; D2D1_RECT_F r; };
std::vector<Btn> g_btns;
int g_hover = -1;
-enum { B_FONT = 1, B_SMALLER, B_SIZE, B_BIGGER, B_COLOR, B_BOLD, B_ITALIC, B_UNDER, B_LEFT, B_CENTER, B_RIGHT, B_JUST, B_LIST };
+enum { B_FONT = 1, B_SMALLER, B_SIZE, B_BIGGER, B_COLOR, B_BOLD, B_ITALIC, B_UNDER, B_LEFT, B_CENTER, B_RIGHT, B_JUST, B_LIST, B_STRIKE, B_CLEAR, B_STYLE, B_SPACING };
+float g_spacing = 1.0f;
+bool pnone(const PARAFORMAT2& p) { return p.wNumbering == 0; }
CHARFORMAT2W CurChar() { CHARFORMAT2W cf{ sizeof(cf) }; cf.dwMask = CFM_ALL2; SendMessageW(g_edit, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); return cf; }
PARAFORMAT2 CurPara() { PARAFORMAT2 pf{}; pf.cbSize = sizeof(pf); pf.dwMask = PFM_ALIGNMENT | PFM_NUMBERING; SendMessageW(g_edit, EM_GETPARAFORMAT, 0, (LPARAM)&pf); return pf; }
@@ -47,7 +49,7 @@ void Size(int delta) {
void ApplyTheme() {
bool dark = Dark();
- SendMessageW(g_edit, EM_SETBKGNDCOLOR, 0, dark ? RGB(30, 30, 30) : RGB(255, 255, 255));
+ SendMessageW(g_edit, EM_SETBKGNDCOLOR, 0, dark ? RGB(30, 30, 30) : RGB(255, 255, 255)); // (macOS 27: o mesmo branco/escuro da janela)
CHARFORMAT2W cf{ sizeof(cf) }; cf.dwMask = CFM_COLOR; cf.crTextColor = dark ? RGB(235, 235, 235) : RGB(20, 20, 20);
SendMessageW(g_edit, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM)&cf);
}
@@ -56,7 +58,7 @@ void SetTitle() {
std::wstring n = g_path.empty() ? Tr(L"Sem Título") : std::wstring(PathFindFileNameW(g_path.c_str()));
if (SendMessageW(g_edit, EM_GETMODIFY, 0, 0)) n += L" — " + std::wstring(Tr(L"Editado"));
wchar_t cur[512]; GetWindowTextW(wnd, cur, 512);
- if (n != cur) SetWindowTextW(wnd, n.c_str());
+ if (n != cur) { SetWindowTextW(wnd, n.c_str()); if (app2d::BAR > 0) InvalidateRect(wnd, nullptr, FALSE); }
}
DWORD CALLBACK ReadCb(DWORD_PTR c, LPBYTE buf, LONG n, LONG* got) { return !ReadFile((HANDLE)c, buf, n, (DWORD*)got, nullptr); }
@@ -64,11 +66,11 @@ DWORD CALLBACK WriteCb(DWORD_PTR c, LPBYTE buf, LONG n, LONG* got) { return !Wri
void Layout() {
RECT r; GetClientRect(wnd, &r);
- int top = g_plain ? 0 : (int)std::lround(BAR * Sc());
+ int top = (int)std::lround((app2d::BAR > 0 ? (g_plain ? 32.f : 100.f) : g_plain ? 0.f : TBAR) * Sc()); // macOS 27: título, formatação e régua
SetWindowPos(g_edit, nullptr, 0, top, r.right, r.bottom - top, SWP_NOZORDER);
// margens do documento, como as do TextEdit
- RECT fr{ 0, 0, r.right, r.bottom - top }; int m = (int)std::lround(22 * Sc());
- InflateRect(&fr, -m, -(int)std::lround(14 * Sc()));
+ RECT fr{ 0, 0, r.right, r.bottom - top }; int m = (int)std::lround((app2d::BAR > 0 ? 5 : 22) * Sc());
+ InflateRect(&fr, -m, -(int)std::lround((app2d::BAR > 0 ? 3 : 14) * Sc()));
SendMessageW(g_edit, EM_SETRECT, 0, (LPARAM)&fr);
InvalidateRect(wnd, nullptr, FALSE);
}
@@ -212,13 +214,228 @@ void Action(int id, POINT scr) {
case B_CENTER: Align(PFA_CENTER); break;
case B_RIGHT: Align(PFA_RIGHT); break;
case B_JUST: Align(PFA_JUSTIFY); break;
+ case B_STRIKE: Toggle(CFM_STRIKEOUT, CFE_STRIKEOUT); break;
+ case B_CLEAR: { CHARFORMAT2W n{ sizeof(n) }; n.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT | CFM_COLOR; n.dwEffects = CFE_AUTOCOLOR; SetChar(n); break; }
+ case B_STYLE: {
+ HMENU m = CreatePopupMenu();
+ const wchar_t* st[4] = { L"Normal", L"Negrito", L"Itálico", L"Negrito Itálico" };
+ for (int i = 0; i < 4; i++) AppendMenuW(m, MF_STRING, i + 1, Tr(st[i]));
+ int c = TrackPopupMenu(m, TPM_RETURNCMD, scr.x, scr.y, 0, wnd, nullptr);
+ DestroyMenu(m);
+ if (c > 0) { CHARFORMAT2W n{ sizeof(n) }; n.dwMask = CFM_BOLD | CFM_ITALIC; n.dwEffects = (c == 2 || c == 4 ? CFE_BOLD : 0) | (c >= 3 ? CFE_ITALIC : 0); SetChar(n); }
+ break;
+ }
+ case B_SIZE: if (app2d::BAR > 0) {
+ HMENU m = CreatePopupMenu();
+ static const int steps[] = { 9, 10, 11, 12, 13, 14, 18, 24, 36, 48, 64, 72 };
+ for (int i = 0; i < 12; i++) AppendMenuW(m, MF_STRING, i + 1, std::to_wstring(steps[i]).c_str());
+ int c = TrackPopupMenu(m, TPM_RETURNCMD, scr.x, scr.y, 0, wnd, nullptr);
+ DestroyMenu(m);
+ if (c > 0) { CHARFORMAT2W n{ sizeof(n) }; n.dwMask = CFM_SIZE; n.yHeight = steps[c - 1] * 20; SetChar(n); }
+ } break;
+ case B_SPACING: {
+ HMENU m = CreatePopupMenu();
+ const float v[4] = { 1.0f, 1.15f, 1.5f, 2.0f };
+ for (int i = 0; i < 4; i++) { wchar_t b[16]; swprintf_s(b, i == 1 ? L"%.2f" : L"%.1f", v[i]); AppendMenuW(m, MF_STRING | (g_spacing == v[i] ? MF_CHECKED : 0), i + 1, b); }
+ int c = TrackPopupMenu(m, TPM_RETURNCMD, scr.x, scr.y, 0, wnd, nullptr);
+ DestroyMenu(m);
+ if (c > 0) {
+ g_spacing = v[c - 1];
+ PARAFORMAT2 n{}; n.cbSize = sizeof(n); n.dwMask = PFM_LINESPACING; n.bLineSpacingRule = 5; n.dyLineSpacing = (LONG)std::lround(g_spacing * 20);
+ SendMessageW(g_edit, EM_SETPARAFORMAT, 0, (LPARAM)&n); SetFocus(g_edit); InvalidateRect(wnd, nullptr, FALSE);
+ }
+ break;
+ }
case B_LIST: { PARAFORMAT2 pf = CurPara(); PARAFORMAT2 n{}; n.cbSize = sizeof(n); n.dwMask = PFM_NUMBERING | PFM_OFFSET; n.wNumbering = pf.wNumbering ? 0 : PFN_BULLET; n.dxOffset = n.wNumbering ? 360 : 0;
SendMessageW(g_edit, EM_SETPARAFORMAT, 0, (LPARAM)&n); SetFocus(g_edit); InvalidateRect(wnd, nullptr, FALSE); break; }
}
}
+// ---- macOS 27 (captura TextEdit do 512 Pixels, 2x, medida em pt): barra de 32 com os três botões a 16/39/62 e o
+// ícone do documento + nome em negrito cinza a 88; linha de formatação com o meio a 50 (controles de 20 de altura,
+// cápsulas cinza claras): B|I|U|S (8–93), cor (99–118), limpar (123–144), fonte (149–228), estilo (234–312),
+// tamanho (318–369, campo branco com a seta), alinhamento (374–469, o escolhido em azul), lista (475–520) e
+// espaçamento (526–569); divisa a 68, régua de 68 a 100 (polegadas de 72 pt, número em cada uma, marcas de tabulação
+// a cada meia), divisa a 100 e o texto logo abaixo.
+const float G_TITLE = 32, G_ROW_Y = 50, G_RULER0 = 68, G_RULER1 = 100;
+IDWriteTextFormat *g_tfTitleG, *g_tfCtl, *g_tfCtlB, *g_tfCtlI, *g_tfRuler;
+
+void Chevron(float x, float y, D2D1_COLOR_F c, bool updown) { // ⌄ ou ⌃⌄
+ br->SetColor(c);
+ if (updown) {
+ rt->DrawLine({ x - 3.5f, y - 1.5f }, { x, y - 5 }, br, 1.3f); rt->DrawLine({ x, y - 5 }, { x + 3.5f, y - 1.5f }, br, 1.3f);
+ rt->DrawLine({ x - 3.5f, y + 1.5f }, { x, y + 5 }, br, 1.3f); rt->DrawLine({ x, y + 5 }, { x + 3.5f, y + 1.5f }, br, 1.3f);
+ } else {
+ rt->DrawLine({ x - 4, y - 2 }, { x, y + 2 }, br, 1.4f); rt->DrawLine({ x, y + 2 }, { x + 4, y - 2 }, br, 1.4f);
+ }
+}
+void AlignIcon(float cx, float cy, int kind, D2D1_COLOR_F c) { // 0 esquerda 1 centro 2 direita 3 justificado
+ br->SetColor(c);
+ const float L[4] = { 16, 10, 16, 10 };
+ for (int i = 0; i < 4; i++) {
+ float w = (i % 2) ? (kind == 3 ? 16.f : 10.f) : 16.f, y = cy - 4.5f + i * 3;
+ float x0 = kind == 1 ? cx - w / 2 : kind == 2 ? cx + 8 - w : cx - 8;
+ rt->DrawLine({ x0, y }, { x0 + w, y }, br, 1.1f);
+ }
+ (void)L;
+}
+
+void PaintGolden() {
+ g_btns.clear();
+ bool dark = Dark();
+ D2D1_SIZE_F sz = app2d::Size();
+ D2D1_COLOR_F bg = dark ? Rgb(30, 30, 30) : Rgb(255, 255, 255);
+ D2D1_COLOR_F text = dark ? Rgb(235, 235, 235) : Rgb(29, 29, 31), pill = dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.075f);
+ D2D1_COLOR_F gray = dark ? Rgb(160, 160, 165) : Rgb(120, 120, 124), sep = dark ? Rgb(255, 255, 255, 0.10f) : Rgb(0, 0, 0, 0.10f);
+ rt->Clear(bg);
+ // título: ícone do documento e o nome
+ {
+ float x = 88, cy = 16;
+ D2D1_RECT_F ic = D2D1::RectF(x, cy - 8, x + 12, cy + 8);
+ Fill(ic, dark ? Rgb(230, 230, 230) : Rgb(250, 250, 250), 1.5f);
+ br->SetColor(dark ? Rgb(255, 255, 255, 0.4f) : Rgb(0, 0, 0, 0.35f)); rt->DrawRoundedRectangle(D2D1::RoundedRect(ic, 1.5f, 1.5f), br, 0.75f);
+ for (int i = 0; i < 4; i++) Fill(D2D1::RectF(x + 2.5f, cy - 4.5f + i * 3, x + 9.5f, cy - 3.8f + i * 3), Rgb(120, 120, 120));
+ wchar_t t[512] = {}; GetWindowTextW(wnd, t, 512);
+ Text(t, g_tfTitleG, D2D1::RectF(x + 18, 0, sz.width - 20, G_TITLE), dark ? Rgb(255, 255, 255, 0.55f) : Rgb(0, 0, 0, 0.55f));
+ }
+ if (g_plain) { Fill(D2D1::RectF(0, G_TITLE - 0.5f, sz.width, G_TITLE), sep); return; }
+ CHARFORMAT2W cf = CurChar();
+ PARAFORMAT2 pf = CurPara();
+ float y0 = G_ROW_Y - 10, y1 = G_ROW_Y + 10;
+ auto reg = [&](int id, D2D1_RECT_F r) { g_btns.push_back({ id, r }); };
+ // B | I | U | S
+ {
+ D2D1_RECT_F r = D2D1::RectF(8, y0, 93, y1);
+ Fill(r, pill, 6);
+ bool on[4] = { (cf.dwMask & CFM_BOLD) && (cf.dwEffects & CFE_BOLD), (cf.dwMask & CFM_ITALIC) && (cf.dwEffects & CFE_ITALIC),
+ (cf.dwMask & CFM_UNDERLINE) && (cf.dwEffects & CFE_UNDERLINE), (cf.dwMask & CFM_STRIKEOUT) && (cf.dwEffects & CFE_STRIKEOUT) };
+ const wchar_t* lab[4] = { L"B", L"I", L"U", L"S" };
+ IDWriteTextFormat* fm[4] = { g_tfCtlB, g_tfCtlI, g_tfCtl, g_tfCtl };
+ int ids[4] = { B_BOLD, B_ITALIC, B_UNDER, B_STRIKE };
+ for (int i = 0; i < 4; i++) {
+ D2D1_RECT_F c = D2D1::RectF(8 + i * 21.25f, y0, 8 + (i + 1) * 21.25f, y1);
+ if (on[i]) Fill(D2D1::RectF(c.left + 2, y0 + 2, c.right - 2, y1 - 2), dark ? Rgb(255, 255, 255, 0.22f) : Rgb(0, 0, 0, 0.14f), 4);
+ Text(lab[i], fm[i], c, text);
+ if (i == 2) Fill(D2D1::RectF(c.left + 7.5f, G_ROW_Y + 5.5f, c.right - 7.5f, G_ROW_Y + 6.3f), text);
+ if (i == 3) Fill(D2D1::RectF(c.left + 6.5f, G_ROW_Y + 0.2f, c.right - 6.5f, G_ROW_Y + 1), text);
+ if (i) Fill(D2D1::RectF(c.left - 0.5f, y0 + 5, c.left, y1 - 5), sep);
+ reg(ids[i], c);
+ }
+ }
+ // cor do texto
+ {
+ D2D1_RECT_F r = D2D1::RectF(99, y0, 118, y1);
+ COLORREF cc = (cf.dwEffects & CFE_AUTOCOLOR) || !(cf.dwMask & CFM_COLOR) ? (dark ? RGB(235, 235, 235) : RGB(0, 0, 0)) : cf.crTextColor;
+ Fill(r, Rgb(GetRValue(cc), GetGValue(cc), GetBValue(cc)), 5);
+ br->SetColor(sep); rt->DrawRoundedRectangle(D2D1::RoundedRect(r, 5, 5), br, 0.5f);
+ reg(B_COLOR, r);
+ }
+ // limpar a formatação: "A" cortado em vermelho
+ {
+ D2D1_RECT_F r = D2D1::RectF(123, y0, 144, y1);
+ Fill(r, dark ? Rgb(255, 255, 255, 0.06f) : Rgb(255, 255, 255), 6);
+ br->SetColor(sep); rt->DrawRoundedRectangle(D2D1::RoundedRect(r, 6, 6), br, 0.75f);
+ Text(L"A", g_tfCtlI, r, gray);
+ br->SetColor(Rgb(255, 59, 48)); rt->DrawLine({ r.left + 5, r.bottom - 4 }, { r.right - 5, r.top + 4 }, br, 1.1f);
+ reg(B_CLEAR, r);
+ }
+ auto popup = [&](int id, D2D1_RECT_F r, const std::wstring& label) {
+ Fill(r, pill, 6);
+ Text(label, g_tfCtl, D2D1::RectF(r.left + 10, r.top, r.right - 18, r.bottom), text);
+ Chevron(r.right - 10, G_ROW_Y, text, true);
+ reg(id, r);
+ };
+ std::wstring face = cf.szFaceName[0] ? cf.szFaceName : L"Helvetica";
+ popup(B_FONT, D2D1::RectF(149, y0, 228, y1), face);
+ {
+ bool b = (cf.dwMask & CFM_BOLD) && (cf.dwEffects & CFE_BOLD), it = (cf.dwMask & CFM_ITALIC) && (cf.dwEffects & CFE_ITALIC);
+ std::wstring st = b && it ? Tr(L"Negrito Itálico") : b ? Tr(L"Negrito") : it ? Tr(L"Itálico") : Tr(L"Normal");
+ popup(B_STYLE, D2D1::RectF(234, y0, 312, y1), st);
+ }
+ // tamanho: campo branco com o número e a seta num botão cinza
+ {
+ D2D1_RECT_F r = D2D1::RectF(318, y0, 369, y1);
+ Fill(r, dark ? Rgb(255, 255, 255, 0.06f) : Rgb(255, 255, 255), 6);
+ br->SetColor(dark ? Rgb(255, 255, 255, 0.18f) : Rgb(0, 0, 0, 0.16f)); rt->DrawRoundedRectangle(D2D1::RoundedRect(r, 6, 6), br, 0.75f);
+ Text(std::to_wstring(cf.yHeight > 0 ? cf.yHeight / 20 : 12), g_tfCtl, D2D1::RectF(r.left + 6, r.top, r.right - 22, r.bottom), text);
+ D2D1_RECT_F a = D2D1::RectF(r.right - 21, r.top + 3, r.right - 3, r.bottom - 3);
+ Fill(a, pill, 4);
+ Chevron((a.left + a.right) / 2, G_ROW_Y, text, false);
+ reg(B_SIZE, r);
+ }
+ // alinhamento
+ {
+ D2D1_RECT_F r = D2D1::RectF(374, y0, 469, y1);
+ Fill(r, pill, 6);
+ int cur = pf.wAlignment == PFA_CENTER ? 1 : pf.wAlignment == PFA_RIGHT ? 2 : pf.wAlignment == PFA_JUSTIFY ? 3 : 0;
+ int ids[4] = { B_LEFT, B_CENTER, B_RIGHT, B_JUST };
+ float w = (r.right - r.left) / 4;
+ for (int i = 0; i < 4; i++) {
+ D2D1_RECT_F c = D2D1::RectF(r.left + i * w, y0, r.left + (i + 1) * w, y1);
+ bool on = i == cur;
+ if (on) Fill(c, semaforo::Aqua() ? Rgb(0, 136, 255) : Rgb(10, 132, 255), 6);
+ else if (i && i != cur + 1) Fill(D2D1::RectF(c.left - 0.5f, y0 + 5, c.left, y1 - 5), sep);
+ AlignIcon((c.left + c.right) / 2, G_ROW_Y, i, on ? Rgb(255, 255, 255) : text);
+ reg(ids[i], c);
+ }
+ }
+ // lista
+ {
+ D2D1_RECT_F r = D2D1::RectF(475, y0, 520, y1);
+ Fill(r, pnone(pf) ? pill : (dark ? Rgb(255, 255, 255, 0.22f) : Rgb(0, 0, 0, 0.14f)), 6);
+ br->SetColor(text);
+ for (int i = 0; i < 3; i++) {
+ float y = G_ROW_Y - 4 + i * 4;
+ rt->FillEllipse(D2D1::Ellipse({ r.left + 11, y }, 1.1f, 1.1f), br);
+ rt->DrawLine({ r.left + 14.5f, y }, { r.left + 23, y }, br, 1.1f);
+ }
+ Chevron(r.right - 11, G_ROW_Y, text, false);
+ reg(B_LIST, r);
+ }
+ // espaçamento
+ {
+ wchar_t b[16]; swprintf_s(b, L"%.1f", g_spacing);
+ D2D1_RECT_F r = D2D1::RectF(526, y0, 569, y1);
+ Fill(r, pill, 6);
+ Text(b, g_tfCtl, D2D1::RectF(r.left + 8, r.top, r.right - 15, r.bottom), text);
+ Chevron(r.right - 9, G_ROW_Y, text, true);
+ reg(B_SPACING, r);
+ }
+ for (auto& b : g_btns) BarButton(b.r);
+ // divisa, régua e divisa
+ Fill(D2D1::RectF(0, G_RULER0 - 0.5f, sz.width, G_RULER0), sep);
+ {
+ D2D1_COLOR_F tick = dark ? Rgb(170, 170, 170) : Rgb(140, 140, 140);
+ float x0 = 5, base = G_RULER1 - 13;
+ Fill(D2D1::RectF(0, base, sz.width, base + 0.75f), tick);
+ for (int k = 0; x0 + k * 9 < sz.width; k++) { // 1/8 de polegada = 9 pt
+ float x = x0 + k * 9, h = k % 8 == 0 ? 9.f : k % 4 == 0 ? 5.f : 3.f;
+ Fill(D2D1::RectF(x, base, x + 0.75f, base + h), tick);
+ if (k % 8 == 0) Text(std::to_wstring(k / 8), g_tfRuler, D2D1::RectF(x + 2, base + 1, x + 30, base + 11), text);
+ }
+ br->SetColor(dark ? Rgb(150, 150, 150) : Rgb(110, 110, 110));
+ for (int k = 1; x0 + k * 36 < sz.width - 20 && k <= 13; k++) { // tabulações a cada meia polegada
+ float x = x0 + k * 36 + 1, y = G_RULER0 + 10;
+ ID2D1PathGeometry* g = nullptr; d2d->CreatePathGeometry(&g);
+ if (g) { ID2D1GeometrySink* s = nullptr; g->Open(&s); s->BeginFigure({ x - 1, y - 5 }, D2D1_FIGURE_BEGIN_FILLED); s->AddLine({ x + 5, y }); s->AddLine({ x - 1, y + 5 }); s->EndFigure(D2D1_FIGURE_END_CLOSED); s->Close(); s->Release(); rt->FillGeometry(g, br); g->Release(); }
+ }
+ // recuos: à esquerda o "T" invertido, à direita o triângulo para baixo
+ Fill(D2D1::RectF(x0 - 4, G_RULER0 + 7, x0 + 4, G_RULER0 + 8.5f), br->GetColor());
+ {
+ ID2D1PathGeometry* g = nullptr; d2d->CreatePathGeometry(&g);
+ float x = x0, y = G_RULER0 + 9;
+ if (g) { ID2D1GeometrySink* s = nullptr; g->Open(&s); s->BeginFigure({ x - 4, y }, D2D1_FIGURE_BEGIN_FILLED); s->AddLine({ x + 4, y }); s->AddLine({ x, y + 5 }); s->EndFigure(D2D1_FIGURE_END_CLOSED); s->Close(); s->Release(); rt->FillGeometry(g, br); g->Release(); }
+ g = nullptr; d2d->CreatePathGeometry(&g);
+ x = sz.width - 10;
+ if (g) { ID2D1GeometrySink* s = nullptr; g->Open(&s); s->BeginFigure({ x - 5, y - 1 }, D2D1_FIGURE_BEGIN_FILLED); s->AddLine({ x + 5, y - 1 }); s->AddLine({ x, y + 5 }); s->EndFigure(D2D1_FIGURE_END_CLOSED); s->Close(); s->Release(); rt->FillGeometry(g, br); g->Release(); }
+ }
+ }
+ Fill(D2D1::RectF(0, G_RULER1 - 0.75f, sz.width, G_RULER1), sep);
+}
+
void Paint() {
if (!BeginPaint()) return;
+ if (app2d::BAR > 0) { PaintGolden(); EndPaint(); return; }
g_btns.clear();
bool dark = Dark();
D2D1_SIZE_F sz = app2d::Size();
@@ -227,7 +444,7 @@ void Paint() {
if (!g_plain) {
CHARFORMAT2W cf = CurChar();
PARAFORMAT2 pf = CurPara();
- float x = 14, y0 = 7, y1 = BAR - 7;
+ float x = 14, y0 = 7, y1 = TBAR - 7;
auto box = [&](int id, float w, const std::wstring& label, IDWriteTextFormat* f, bool lit, bool frame) {
D2D1_RECT_F r = D2D1::RectF(x, y0, x + w, y1);
if (frame) Fill(r, dark ? Rgb(66, 66, 68) : Rgb(255, 255, 255), 5);
@@ -258,7 +475,7 @@ void Paint() {
(void)g4;
x += 10;
box(B_LIST, 30, gl, g_tfIcon, pf.wNumbering != 0, false);
- Fill(D2D1::RectF(0, BAR - 1, sz.width, BAR), dark ? Rgb(0, 0, 0, 0.6f) : Rgb(0, 0, 0, 0.12f));
+ Fill(D2D1::RectF(0, TBAR - 1, sz.width, TBAR), dark ? Rgb(0, 0, 0, 0.6f) : Rgb(0, 0, 0, 0.12f));
}
EndPaint();
}
@@ -312,7 +529,14 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
g_tfI = nullptr; dw->CreateTextFormat(L"Georgia", nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_ITALIC, DWRITE_FONT_STRETCH_NORMAL, 14, L"", &g_tfI);
if (g_tfI) { g_tfI->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); g_tfI->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); }
g_tfU = Fmt(14, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER, false, L"Georgia");
- if (!CreateMain(hi, L"TextEditJanela", Tr(L"Sem Título"), Proc, 760, 860)) return 1;
+ g_tfTitleG = Fmt(13, DWRITE_FONT_WEIGHT_BOLD);
+ g_tfCtl = Fmt(12.5f, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfCtlB = Fmt(12.5f, DWRITE_FONT_WEIGHT_BOLD, DWRITE_TEXT_ALIGNMENT_CENTER);
+ g_tfCtlI = nullptr; dw->CreateTextFormat(family.c_str(), nullptr, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_ITALIC, DWRITE_FONT_STRETCH_NORMAL, 12.5f, L"", &g_tfCtlI);
+ if (g_tfCtlI) { g_tfCtlI->SetTextAlignment(DWRITE_TEXT_ALIGNMENT_CENTER); g_tfCtlI->SetParagraphAlignment(DWRITE_PARAGRAPH_ALIGNMENT_CENTER); }
+ g_tfRuler = Fmt(9.5f);
+ barWanted = 32; // macOS 27: a barra de título é do app (o nome à esquerda, com o ícone)
+ if (!CreateMain(hi, L"TextEditJanela", Tr(L"Sem Título"), Proc, semaforo::Aqua() ? 586 : 760, semaforo::Aqua() ? 488 : 860)) return 1;
g_edit = CreateWindowExW(0, MSFTEDIT_CLASS, L"", WS_CHILD | WS_VISIBLE | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_WANTRETURN,
0, 0, 10, 10, wnd, nullptr, hi, nullptr);
if (!g_edit) return 1;
@@ -324,13 +548,15 @@ int WINAPI wWinMain(HINSTANCE hi, HINSTANCE, PWSTR, int show) {
SendMessageW(g_edit, EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf);
}
ApplyTheme();
+ SendMessageW(g_edit, EM_SETMODIFY, FALSE, 0); // o formato inicial não conta como alteração
DragAcceptFiles(g_edit, FALSE);
int argc = 0; LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
- if (argc > 1 && argv[1][0]) { if (!LoadFile(argv[1])) MessageBoxW(wnd, Tr(L"Não foi possível abrir o documento."), L"TextEdit", MB_OK | MB_ICONERROR); }
+ if (argc > 1 && argv[1][0] && wcscmp(argv[1], L"--foto")) { if (!LoadFile(argv[1])) MessageBoxW(wnd, Tr(L"Não foi possível abrir o documento."), L"TextEdit", MB_OK | MB_ICONERROR); }
if (argv) LocalFree(argv);
Layout(); SetTitle();
ShowWindow(wnd, show);
SetFocus(g_edit);
+ if (!FotoPath().empty()) SetTimer(nullptr, 0, 1500, FotoTick); // teste: salva a foto da janela e fecha
// atalhos (o RichEdit tem o foco: vêm pelo laço de mensagens)
MSG msg;
while (GetMessageW(&msg, nullptr, 0, 0)) {
diff --git a/tools/icones-goldengate.py b/tools/icones-goldengate.py
new file mode 100644
index 0000000..2520295
--- /dev/null
+++ b/tools/icones-goldengate.py
@@ -0,0 +1,29 @@
+# Monta icones\goldengate com os ícones do macOS 27 Golden Gate (repositório zagnut531/macOS-27-Icons,
+# exportados do Mac em 1024 px). Vale a versão mais recente de cada um: Beta 1 < 2 < 3 < 4 < 5 < 6 < 27.2.
+# Os nomes viram os que o WacOS procura (ex.: "System Settings" -> "Settings", "Apps" -> "Launchpad").
+# Uso pessoal, como os outros pacotes de icones\ (ver icones\LEIA-ME.txt): não vai para o GitHub.
+# python -I tools\icones-goldengate.py <pasta do repositório clonado>
+import os, re, sys
+from PIL import Image
+repo = sys.argv[1]
+out = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'icones', 'goldengate')
+os.makedirs(out, exist_ok=True)
+ordem = ['Apple apps', 'Beta 1', 'Beta 2', 'Beta 3', 'Beta 4', 'Beta 5', 'Beta 6', 'Beta 7 (Xcode)', '27.2']
+nomes = {'System Settings': 'Settings', 'Apps': 'Launchpad'}
+final = {}
+for pasta in ordem:
+ base = os.path.join(repo, pasta)
+ if not os.path.isdir(base): continue
+ for raiz, _, arqs in os.walk(base):
+ for a in arqs:
+ if not a.lower().endswith('.png'): continue
+ n = re.sub(r'\s*\((beta|Beta)[^)]*\)', '', a[:-4]).strip()
+ final[nomes.get(n, n)] = os.path.join(raiz, a)
+for n, p in sorted(final.items()):
+ im = Image.open(p).convert('RGBA')
+ if im.width > 512: im = im.resize((512, 512), Image.LANCZOS)
+ im.save(os.path.join(out, n + '.png'), optimize=True)
+with open(os.path.join(out, 'CREDITOS.txt'), 'w', encoding='utf-8') as f:
+ f.write('Icones do macOS 27 Golden Gate exportados por zagnut531 (github.com/zagnut531/macOS-27-Icons).\n'
+ 'Copyright Apple. Uso pessoal: NAO distribuir junto com o projeto.\n')
+print(len(final), 'ícones em', out)
diff --git a/tools/mapa-mundi.py b/tools/mapa-mundi.py
new file mode 100644
index 0000000..96161a6
--- /dev/null
+++ b/tools/mapa-mundi.py
@@ -0,0 +1,30 @@
+# Gera src/relogio/mapa_mundi.inc: a máscara dos continentes do Relógio Mundial do macOS 27, tirada da captura
+# Clock (512 Pixels, 2x). O mapa é equirretangular: largura = 360° (de -180 à esquerda), altura = do polo norte
+# (90°) até ~-85,8° (a Antártica cortada embaixo, como no Mac). Texto, pontos das cidades e a curva dia/noite
+# da captura saem com abertura/fechamento morfológico.
+# python -I tools\mapa-mundi.py <pasta 512pixels>
+import sys, os
+import numpy as np
+from PIL import Image, ImageFilter
+pasta = sys.argv[1]
+a = np.array(Image.open(os.path.join(pasta, 'Clock.png')).convert('L')).astype(int)
+w = a[76:1612, 112:2160][104:1105] # a faixa do mapa (2x): 2048 x 1001
+land = ((w >= 20) & (w < 120)).astype(np.uint8) * 255 # terra: 63 de dia, 25 na parte da noite; oceano 0
+im = Image.fromarray(land)
+im = im.filter(ImageFilter.MinFilter(3)).filter(ImageFilter.MaxFilter(3)) # tira linhas finas (curva, meridianos)
+im = im.filter(ImageFilter.MaxFilter(7)).filter(ImageFilter.MinFilter(7)) # fecha os buracos do texto e da curva
+W, H = 768, 375
+small = np.array(im.resize((W, H), Image.BOX)) > 127
+fn = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src', 'relogio', 'mapa_mundi.inc')
+bits = np.packbits(small, axis=1) # 96 bytes por linha
+with open(fn, 'w', encoding='utf-8') as f:
+ f.write('// gerado por tools/mapa-mundi.py: continentes (1 = terra), %d x %d, 1 bit por ponto, da esquerda (bit 7)\n' % (W, H))
+ f.write('static const int MAPA_W = %d, MAPA_H = %d;\n' % (W, H))
+ f.write('static const double MAPA_LAT_BAIXO = %.3f; // latitude da última linha\n' % (90 - 180 * (1001 / 1024)))
+ f.write('static const unsigned char MAPA_BITS[%d] = {\n' % bits.size)
+ flat = bits.ravel()
+ for i in range(0, flat.size, 32):
+ f.write(' ' + ','.join('0x%02x' % v for v in flat[i:i + 32]) + ',\n')
+ f.write('};\n')
+Image.fromarray((small * 255).astype(np.uint8)).save(os.path.join(os.environ.get('TEMP', '.'), 'mapa-mundi-teste.png'))
+print('gravado', fn, small.mean())
diff --git a/tools/semaforo-mac27.py b/tools/semaforo-mac27.py
new file mode 100644
index 0000000..69e0741
--- /dev/null
+++ b/tools/semaforo-mac27.py
@@ -0,0 +1,76 @@
+# Gera src/comum/semaforo_mac27.inc: os botões fechar/minimizar/zoom do macOS 27 tirados pixel a pixel das capturas 2x
+# (512 Pixels), separados do fundo da janela. Cada um vira um quadrado de 36 × 36 px (o botão de 28 px e o brilho em
+# volta) em BGRA pré-multiplicado, para o semaforo.h desenhar escalado:
+# 0 fechar, 1 minimizar, 2 zoom (janela ativa, Finder-Home-Folder); 3 inativo claro (Finder-Get-Info);
+# 4 inativo escuro (Apperance-Dark-Automatic)
+# python -I tools\semaforo-mac27.py <pasta 512pixels>
+import sys, os, math
+import numpy as np
+from PIL import Image
+pasta = sys.argv[1]
+N, R = 36, 14.0
+SRC = [('Finder-Home-Folder.png', 164, 128, (237, 236, 235)), ('Finder-Home-Folder.png', 210, 128, (237, 236, 235)),
+ ('Finder-Home-Folder.png', 256, 128, (237, 236, 235)), ('Finder-Get-Info.png', 788, 250, (242, 242, 242)),
+ ('Apperance-Dark-Automatic.png', 1344, 182, (43, 42, 42))]
+out = []
+imgs = {}
+for (name, cxx, cyy, bgc) in SRC:
+ if name not in imgs: imgs[name] = np.array(Image.open(os.path.join(pasta, name)).convert('RGB')).astype(float)
+ a = imgs[name]; bg = np.array(bgc, dtype=float)
+ x0, y0 = cxx - N // 2, cyy - N // 2 # centro contínuo do botão no meio do quadrado
+ c = N / 2 - 0.5
+ px = a[y0:y0 + N, x0:x0 + N]
+ rgba = np.zeros((N, N, 4))
+ for y in range(N):
+ for x in range(N):
+ p = px[y, x]
+ dx, dy = x - c, y - c
+ d = math.hypot(dx, dy)
+ if d <= R - 1.2:
+ rgba[y, x] = [*p, 1.0]
+ continue
+ # cor de dentro na mesma direção (a borda), para achar quanto do pixel é botão
+ k = (R - 1.6) / max(d, 1e-6)
+ ix, iy = int(round(c + dx * k)), int(round(c + dy * k))
+ fg = px[iy, ix] if d <= R + 0.8 else px[iy, ix] * 0.5 + bg * 0.5 # o brilho de fora: a cor do botão
+ v = fg - bg
+ al = float(np.clip(np.dot(p - bg, v) / max(np.dot(v, v), 1e-6), 0, 1))
+ if al < 0.015: rgba[y, x] = [0, 0, 0, 0]; continue
+ col = np.clip(bg + (p - bg) / al, 0, 255) # a cor que, com essa opacidade, dá o pixel medido
+ rgba[y, x] = [*col, al]
+ out.append(rgba)
+fn = os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src', 'comum', 'semaforo_mac27.inc')
+with open(fn, 'w', encoding='utf-8') as f:
+ f.write('// gerado por tools/semaforo-mac27.py: os botões do macOS 27 (captura 2x do Finder), 36 x 36 px BGRA pré-multiplicado\n')
+ f.write('static const unsigned char MAC27_LIGHTS[5][36 * 36 * 4] = {\n')
+ for rgba in out:
+ vals = []
+ for y in range(N):
+ for x in range(N):
+ r, g, b, al = rgba[y, x]
+ vals += [int(round(b * al)), int(round(g * al)), int(round(r * al)), int(round(al * 255))]
+ f.write(' { ' + ','.join(map(str, vals)) + ' },\n')
+ f.write('};\n')
+ # versão 1x (18 x 18), reduzida com Lanczos em luz linear sobre o alfa pré-multiplicado: sem serrilhado em telas 100 %
+ f.write('static const unsigned char MAC27_LIGHTS_1X[5][18 * 18 * 4] = {\n')
+ for rgba in out:
+ pm = np.zeros((N, N, 4))
+ pm[..., :3] = (rgba[..., :3] / 255.0) ** 2.2 * rgba[..., 3:]
+ pm[..., 3] = rgba[..., 3]
+ ch = [np.array(Image.fromarray(pm[..., k].astype(np.float32), 'F').resize((18, 18), Image.LANCZOS)) for k in range(4)]
+ a1 = np.clip(ch[3], 0, 1)
+ vals = []
+ for y in range(18):
+ for x in range(18):
+ al = float(a1[y, x])
+ lin = [float(np.clip(ch[k][y, x], 0, 1)) / al if al > 1e-4 else 0.0 for k in range(3)]
+ s1 = [min(1.0, v) ** (1 / 2.2) for v in lin]
+ vals += [int(round(s1[2] * al * 255)), int(round(s1[1] * al * 255)), int(round(s1[0] * al * 255)), int(round(al * 255))]
+ f.write(' { ' + ','.join(map(str, vals)) + ' },\n')
+ f.write('};\n')
+# conferência: compõe de volta sobre o fundo e mede a diferença
+for i, (rgba, (name, cxx, cyy, bgc)) in enumerate(zip(out, SRC)):
+ a = imgs[name]; bg = np.array(bgc, dtype=float); x0, y0 = cxx - N // 2, cyy - N // 2
+ comp = rgba[..., :3] * rgba[..., 3:] + bg * (1 - rgba[..., 3:])
+ print('botão', i, 'erro médio de volta: %.2f' % np.abs(comp - a[y0:y0 + N, x0:x0 + N]).sum(2).mean())
+print('gravado', fn)