-
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
Various minor adjustments to the code and preparation for GTK+ 3 #11
Conversation
Solved by the merge of #10. |
This ensures that only header files allowed to be used with GTK+ 3 are being included.
This ensure that _screentest_ does not utilize implementation details which will become private with GTK 3.
This ensures that _screentest_ does not utilize GTK+ symbols being removed by GTK+ 3.
17e1f75
to
4d0b0b7
Compare
@@ -231,3 +231,15 @@ G_MODULE_EXPORT void on_bg_color_activate(G_GNUC_UNUSED GtkMenuItem *menuitem, | |||
} | |||
gtk_widget_hide(GTK_WIDGET(bg_color_selector)); | |||
} | |||
|
|||
void set_color_bg(cairo_t *cr) { |
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.
These functions exist for no other purpose than saving typing elsewhere.
@@ -49,6 +50,7 @@ screentest_srcs = [ | |||
executable( | |||
meson.project_name(), | |||
'main.c', | |||
c_args: '-DGSEAL_ENABLE -DGTK_DISABLE_DEPRECATED -DGTK_DISABLE_SINGLE_INCLUDES', |
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.
When switching to GTK+ 3 I'd drop these again. They only serve to highlight the progress of the migration.
@@ -9,6 +9,7 @@ project( | |||
|
|||
i18n = import('i18n') | |||
|
|||
cairo_dep = dependency('cairo', version: '>= 1.0') |
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'm a bit in two minds if it's worth having this. Generally GTK+ should pull in a much more recent version, so I guess it just adds unnecessary verbosity.
Out of interest I conducted some performance measurement of the drawing of the LCD alignment test. The reported expired time with Cairo is greater than the one with GdkGC, but the drawing on the screen is much quicker on my hardware (Core i7-12700H). |
4d0b0b7
to
998ee13
Compare
Not very far. It was just an idea since toolkit-use in this program is very minimal (1 menu & some color pickers) and looking at the porting guides for newer GTK versions I figured I had to rewrite all the tests anyway (as you probably realized when writing this PR 😄), so switching to something "lighter" might have been a worthwhile idea... |
This pull request makes various minor adjustments all around the codebase and prepares the trivially adjustable tests for a port to GTK+ 3.
I don't know how far your considerations/coding in direction of porting to SDL went. I would have continued with GTK since it should be readily available on most Linux systems anyhow.
If I don't overlook anything the port to GTK+ 3 and beyond should mostly concern the drawing, which would need to be ported to Cairo. I realized this with this pull request, only the test cases containing text are more difficult (I know neither Cairo nor Pango).
I considered porting to GTK 4 directly, but I prefer to maintain a good deal of backwards compatibility. So I'd aim at GTK+ 3 first and then make optional adjustments to GTK 4.