Skip to content

Commit

Permalink
Update manifest, reformat C++ files
Browse files Browse the repository at this point in the history
  • Loading branch information
mthierman committed Jun 2, 2024
1 parent a2be68e commit c0721df
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
3 changes: 3 additions & 0 deletions data/glow.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
</dependency>

<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true/pm</dpiAware>
</asmv3:windowsSettings>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<dpiAwareness>PerMonitorV2</dpiAwareness>
<longPathAware>true</longPathAware>
Expand Down
26 changes: 13 additions & 13 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,75 +1,75 @@
add_executable(
Glow_ExampleWin32
WIN32
)
)

target_sources(
Glow_ExampleWin32
PRIVATE "win32.cxx"
"${PROJECT_SOURCE_DIR}/data/glow.manifest"
)
)

target_link_libraries(
Glow_ExampleWin32
PRIVATE glow::glow
glow::flags
)
)

add_executable(Glow_ExampleConsole)

target_sources(
Glow_ExampleConsole
PRIVATE "console.cxx"
"${PROJECT_SOURCE_DIR}/data/glow.manifest"
)
)

target_link_libraries(
Glow_ExampleConsole
PRIVATE glow::glow
glow::flags
)
)

add_executable(
Glow_ExampleWindow
WIN32
)
)

target_sources(
Glow_ExampleWindow
PRIVATE "window/window.cxx"
"${PROJECT_SOURCE_DIR}/data/glow.manifest"
)
)

target_link_libraries(
Glow_ExampleWindow
PRIVATE glow::glow
glow::flags
)
)

add_executable(
Glow_ExampleErrors
WIN32
)
)

target_sources(
Glow_ExampleErrors
PRIVATE "errors/errors.cxx"
"${PROJECT_SOURCE_DIR}/data/glow.manifest"
)
)

target_link_libraries(
Glow_ExampleErrors
PRIVATE glow::glow
glow::flags
)
)

add_custom_command(
TARGET Glow_ExampleWin32
COMMAND
${CMAKE_COMMAND} -E copy "${webview2_SOURCE_DIR}/runtimes/win-x64/native/WebView2Loader.dll"
"${CMAKE_CURRENT_BINARY_DIR}$<$<CONFIG:DEBUG>:/Debug>$<$<CONFIG:RELEASE>:/Release>"
COMMENT "Copying WebView2Loader.dll..."
)
)

add_custom_command(
TARGET Glow_ExampleWin32
Expand All @@ -78,4 +78,4 @@ add_custom_command(
"${webview2_SOURCE_DIR}/runtimes/win-x64/native_uap/Microsoft.Web.WebView2.Core.dll"
"${CMAKE_CURRENT_BINARY_DIR}$<$<CONFIG:DEBUG>:/Debug>$<$<CONFIG:RELEASE>:/Release>"
COMMENT "Copying Microsoft.Web.WebView2.Core.dll..."
)
)
5 changes: 4 additions & 1 deletion examples/console.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@
#include <glow/glow.hxx>
#include <print>

auto main(int argc, char* argv[]) -> int { std::println("Glow"); }
auto main(int argc, char* argv[]) -> int
{
std::println("Glow");
}
6 changes: 4 additions & 2 deletions examples/window/window.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ auto Window::WndProc(::UINT uMsg, ::WPARAM wParam, ::LPARAM lParam) -> ::LRESULT
{
switch (uMsg)
{
case WM_DESTROY: return on_destroy(wParam, lParam);
case WM_WINDOWPOSCHANGED: return on_window_pos_changed(wParam, lParam);
case WM_DESTROY:
return on_destroy(wParam, lParam);
case WM_WINDOWPOSCHANGED:
return on_window_pos_changed(wParam, lParam);
}

return ::DefWindowProcA(m_hwnd.get(), uMsg, wParam, lParam);
Expand Down
10 changes: 8 additions & 2 deletions src/colors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

namespace glow
{
Colors::Colors() : settings{winrt::Windows::UI::ViewManagement::UISettings()} { update(); }
Colors::Colors() : settings{winrt::Windows::UI::ViewManagement::UISettings()}
{
update();
}

auto Colors::update() -> void
{
Expand Down Expand Up @@ -77,7 +80,10 @@ auto Colors::to_colorref(winrt::Windows::UI::Color uiColor) -> ::COLORREF
std::ranges::clamp(static_cast<int>(uiColor.B), 0, 255));
}

auto Colors::clamp(int value) -> int { return std::ranges::clamp(value, 0, 255); }
auto Colors::clamp(int value) -> int
{
return std::ranges::clamp(value, 0, 255);
}

auto Colors::rgb_to_colorref(int r, int g, int b) -> ::COLORREF
{
Expand Down

0 comments on commit c0721df

Please sign in to comment.