Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate main logic into a library with C FFI interface #121

Merged
merged 13 commits into from Jan 28, 2023
Merged

Conversation

namazso
Copy link
Owner

@namazso namazso commented Oct 2, 2022

No description provided.

@namazso namazso linked an issue Oct 2, 2022 that may be closed by this pull request
this is a pretty shit solution, but it makes pipeline pass. If someone wants to integrate they can just compile it themselves
@namazso namazso marked this pull request as ready for review October 2, 2022 23:25
@namazso
Copy link
Owner Author

namazso commented Oct 2, 2022

@DoorsDev @OrthodoxWindows @boromyr @EnhancedJax @AlNexus @My3hab

This is now in a seemingly functional state (although not extensively tested yet). ThemeTool was also ported to this newly exposed API, so you can implement anything that ThemeTool can do.

You can find headers in the public folder, it's a pure C API, so you can invoke it from whatever language you wish.

CI has x86 builds of ThemeDll.dll in the Everything artifact (this can install to any of x86/x64/ARM64), if you need a different architecture build it yourself. The dll ships and registers (with secureuxtheme_set_dll_for_arch) the SecureUxTheme.dll builds, so you don't have to bother with that.

Feel free to comment if you'd like some more functionality exposed.

@Spiritreader
Copy link

Spiritreader commented Oct 17, 2022

Feel free to comment if you'd like some more functionality exposed.

Is it possible to include

/**
 * @brief Release (free) a theme pointer.
 * @param theme Opaque theme pointer
 */
void themetool_theme_release(ITheme* theme);

mentioned in the public/themetool.h file?

I see it's declared there but I get an unable to find an entry point error message when calling it.
I looked at my self-compiled x64 ThemeDlls and as well as the Win32 one I downloaded from Github Actions CI via a dependency walker.

image

The function seems to be missing

@namazso
Copy link
Owner Author

namazso commented Oct 17, 2022

I seem to have missed exporting it, good catch!
And glad you got your builds working.

@namazso namazso merged commit 57ffda6 into master Jan 28, 2023
@namazso namazso deleted the library branch January 28, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate main logic into a library with C FFI interface
2 participants