Skip to content

Commit

Permalink
CI fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexhuszagh committed Sep 7, 2024
1 parent 4ef87f3 commit eb6301e
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions example/breeze_theme.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -461,17 +461,13 @@ namespace breeze_stylesheets
for (auto &line : lines)
{
// find if we have a matching line and get the right value.
::std::cout << "TODO: " << line << std::endl;
if (line.rfind(version_key, 0) != 0)
continue;
auto version = line.substr(version_key.length());
::std::cout << "TODO: " << version << std::endl;
_trim(version);
auto parts = _split(version, '.');
::std::cout << "TODO: " << parts.size() << std::endl;
auto major = ::std::stoi(parts.at(0));
auto minor = ::std::stoi(parts.at(1));
::std::cout << "TODO: " << major << "." << minor << std::endl;
auto patch = ::std::stoi(parts.at(2));
if (major < 10)
return false;
Expand All @@ -491,12 +487,31 @@ namespace breeze_stylesheets
if (!_macos_supported_version())
return ::breeze_stylesheets::theme::light;

auto auto_release_pool_t = objc_getClass(objc, "NSAutoreleasePool");
auto user_defaults_t = objc_getClass(objc, "NSUserDefaults");
auto ns_string_t = objc_getClass(objc, "NSString");

// sel_registerName
auto alloc = sel_registerName("alloc");
auto pool = objc_msgSend(auto_release_pool_t, alloc);
// TODO: Add our other approach


// pool = msg(auto_release_pool, _register_name(objc, 'alloc'))
// pool = msg(pool, _register_name(objc, 'init'))
// std_user_defaults = msg(user_defaults, _register_name(objc, 'standardUserDefaults'))
//
// key = msg(ns_string, _register_name(objc, "stringWithUTF8String:"), _as_utf8('AppleInterfaceStyle'))
// appearance_ns = msg(std_user_defaults, _register_name(objc, 'stringForKey:'), ctypes.c_void_p(key))
// appearance_c = msg(appearance_ns, _register_name(objc, 'UTF8String'))

// objc_getClass("NSAutoreleasePool")
// TODO: Implement here
::std::cout << "TODO" << std::endl;
return ::breeze_stylesheets::theme::unknown;
}

#elif __linux__
#elif __linux__

/// @brief Get the current system theme.
/// @return The type of the system theme.
Expand Down

0 comments on commit eb6301e

Please sign in to comment.