Files
lingjhf 27e77fff39 feat: initial Cutdex application
Add the Flutter video editing application with project management, media
import, timeline editing, preview, AI assistance, diagnostics and settings.

Include shared UI and native host packages, platform runners, application
tests and release tooling.

Provide usage and contribution guides, the MIT license and third-party
notices. Exclude local credentials, build outputs and validation data.
2026-10-05 23:36:23 +08:00

46 lines
1.3 KiB
C++

#pragma once
#include <flutter/binary_messenger.h>
#include <flutter/encodable_value.h>
#include <flutter/method_channel.h>
#include <windows.h>
#include <commctrl.h>
#include <map>
#include <memory>
#include <optional>
#include <string>
// Keeps the system resize frame and window commands around a Flutter header.
class WindowChrome {
public:
WindowChrome(HWND window, HWND view, flutter::BinaryMessenger* messenger);
~WindowChrome();
std::optional<LRESULT> HandleMessage(UINT message, WPARAM wparam, LPARAM lparam);
private:
struct Region {
double x, y, width, height;
bool maximize;
};
void Configure(bool enabled, double height, bool intercept_close,
bool interactive);
LRESULT HitTest(LPARAM position) const;
void NotifyState();
void SetMaximizeHovered(bool hovered);
static LRESULT CALLBACK ViewProc(HWND window, UINT message, WPARAM wparam,
LPARAM lparam, UINT_PTR id, DWORD_PTR data);
HWND window_;
HWND view_;
bool enabled_ = false;
bool intercept_close_ = false;
bool interactive_ = true;
bool maximize_hovered_ = false;
bool maximize_pressed_ = false;
double header_height_ = 46;
std::map<std::string, Region> controls_;
std::unique_ptr<flutter::MethodChannel<flutter::EncodableValue>> chrome_;
std::unique_ptr<flutter::MethodChannel<flutter::EncodableValue>> controls_channel_;
};