justinfrankel / reaper-sdk

REAPER C/C++ extension SDK
125 stars 20 forks source link

Missing icontheme.h #1

Open cfillion opened 3 years ago

cfillion commented 3 years ago

Using GetColorThemeStruct to access the current theme's colors requires knowing the layout of ColorTheme. SWS has a (likely very out of date) copy of icontheme.h, but it is otherwise not available anywhere I can find.

(from reaper_plugin_functions.h)

// GetColorThemeStruct
// returns the whole color theme (icontheme.h) and the size

// GetIconThemeStruct
// returns a pointer to the icon theme (icontheme.h) and the size of that struct
justinfrankel commented 2 years ago

It is a better idea to use GetThemeColor() with named colors. Exposing the ColorTheme struct was probably not a great idea to begin with.

cfillion commented 2 years ago

Thanks!

Back then I didn't want to use GetThemeColor to be compatible with prior versions. (Ended up reversing parts of struct's layout as of v6.24rc7–here in case anyone else needs it–but ultimately never used it...)

There are also use cases that can't be updated to today's GetThemeColor. For instance, SWS uses GetIconThemeStruct to read images and preset height values for envelopes/tracks.

justinfrankel commented 2 years ago

Ah yeah we should add ways to query those. Or we could put icontheme.h in the SDK, we go to efforts to only ever add to those structs anyway

justinfrankel commented 2 years ago

(but I don't like it)