2020-09-15 17:50:19 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2020-09-24 17:25:56 +03:00
|
|
|
#ifndef PreXULSkeletonUI_h_
|
|
|
|
#define PreXULSkeletonUI_h_
|
2020-09-15 17:50:19 +03:00
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include "mozilla/Types.h"
|
2020-11-10 19:48:10 +03:00
|
|
|
#include "mozilla/Vector.h"
|
2020-09-15 17:50:19 +03:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
2020-10-29 22:04:02 +03:00
|
|
|
// These unfortunately need to be kept in sync with the window style and
|
|
|
|
// extended window style computations in nsWindow. Luckily those styles seem
|
|
|
|
// to not vary based off of any user settings for the initial toplevel window,
|
|
|
|
// so we're safe here for now.
|
|
|
|
static const DWORD kPreXULSkeletonUIWindowStyle =
|
|
|
|
WS_CLIPCHILDREN | WS_DLGFRAME | WS_BORDER | WS_MAXIMIZEBOX |
|
|
|
|
WS_MINIMIZEBOX | WS_SIZEBOX | WS_SYSMENU;
|
|
|
|
static const DWORD kPreXULSkeletonUIWindowStyleEx = WS_EX_WINDOWEDGE;
|
|
|
|
|
2020-11-10 19:48:10 +03:00
|
|
|
struct CSSPixelSpan {
|
|
|
|
double start;
|
|
|
|
double end;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DevPixelSpan {
|
|
|
|
int start;
|
|
|
|
int end;
|
|
|
|
};
|
|
|
|
|
2020-12-10 23:29:03 +03:00
|
|
|
struct SkeletonUISettings {
|
|
|
|
uint32_t screenX;
|
|
|
|
uint32_t screenY;
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
CSSPixelSpan urlbarSpan;
|
|
|
|
CSSPixelSpan searchbarSpan;
|
|
|
|
double cssToDevPixelScaling;
|
|
|
|
Vector<CSSPixelSpan> springs;
|
|
|
|
bool maximized;
|
|
|
|
bool menubarShown;
|
|
|
|
};
|
|
|
|
|
2020-11-13 02:56:44 +03:00
|
|
|
enum class ThemeMode : uint32_t { Invalid, Default, Dark, Light };
|
|
|
|
|
|
|
|
struct ThemeColors {
|
|
|
|
uint32_t backgroundColor;
|
|
|
|
uint32_t toolbarForegroundColor;
|
|
|
|
uint32_t tabBarColor;
|
|
|
|
uint32_t chromeContentDividerColor;
|
|
|
|
uint32_t tabLineColor;
|
|
|
|
uint32_t urlbarColor;
|
|
|
|
uint32_t animationColor;
|
|
|
|
};
|
|
|
|
|
2020-11-06 23:58:43 +03:00
|
|
|
MFBT_API void CreateAndStorePreXULSkeletonUI(HINSTANCE hInstance, int argc,
|
|
|
|
char** argv);
|
2020-09-24 17:25:56 +03:00
|
|
|
MFBT_API HWND ConsumePreXULSkeletonUIHandle();
|
2020-10-29 22:04:02 +03:00
|
|
|
MFBT_API bool WasPreXULSkeletonUIMaximized();
|
2020-12-10 23:29:03 +03:00
|
|
|
MFBT_API void PersistPreXULSkeletonUIValues(const SkeletonUISettings& settings);
|
2020-09-24 17:25:56 +03:00
|
|
|
MFBT_API bool GetPreXULSkeletonUIEnabled();
|
2020-11-06 23:58:43 +03:00
|
|
|
MFBT_API void SetPreXULSkeletonUIEnabledIfAllowed(bool value);
|
2020-09-25 02:51:42 +03:00
|
|
|
MFBT_API void PollPreXULSkeletonUIEvents();
|
2020-11-13 02:56:44 +03:00
|
|
|
MFBT_API void SetPreXULSkeletonUIThemeId(ThemeMode theme);
|
2020-09-15 17:50:19 +03:00
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif
|