-
Notifications
You must be signed in to change notification settings - Fork 4
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move colors and their handling in own translation unit and refactor them slightly #16
Conversation
d45a56e
to
8fa66b7
Compare
Doxyfile
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This Doxyfile
is fairly standard. The second commit gives an overview of the deviations from the default configuration.
callbacks.c
Outdated
grays[i].red = grays[i].green = grays[i].blue = i / (float)(GRAYS_MAX - 1); | ||
grays[i].alpha = 1.0; | ||
} | ||
screentest_colors_init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's a bit overkill, but I started to namespace identifiers with this pull request.
66e6955
to
86977eb
Compare
screentest_colors.c
Outdated
{1.0, 1.0, 0.0, 1.0}, | ||
// BLACK | ||
{0.0, 0.0, 0.0, 1.0}}; | ||
GdkRGBA bg_col = fgcolors[SCREENTEST_COLORS_BLACK]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clang does not seem to allow this. I tried to get rid of any initialization at runtime. I'll have to see if I can work around this somehow or this step needs to be executed somewhere in main
or so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted the code to initialize the bg_col
and fg_col
static variables with explicit values (leaving the respective reference to fgcolors
as an appended comment still).
86977eb
to
3f99bfb
Compare
Interesting that GStreamer's |
3f99bfb
to
184c5b7
Compare
This pull request moves the handling of colors out of the
callbacks
translation unit into an ownscreentest_colors
one, since it seemed to not really fit there.As an experiment all heap-allocated data structures got moved to the stack. On one hand this simplifies memory handling, but on the other hand it's against the common usage pattern of GTK, so I'm a bit in doubt if this is a smart idea or not.
Lastly I added a
Doxyfile
for Doxygen. I don't intend to document the entire codebase, but still having it around shouldn't do harm.Just as information on my general intention: my plan is to work on #2 and #3 and maybe attempt to migrate to GTK 4 too. I stumbled across this blog post and since I like working on and reviving old codebases, I thought I'd tackle this challenge. I'm not keen on becoming a maintainer, but just want to make screentest fit for the next "20 years".