eclipse.platform.swt icon indicating copy to clipboard operation
eclipse.platform.swt copied to clipboard

GTK4 port no longer compiles

Open akurtakov opened this issue 2 years ago • 14 comments

While it's not officially built port it's a WIP towards the day when SWT will be forced to run on GTK4, thus this report. As of today against Gtk 4.10.3 compilation fails with many deprecated usages:

os.c:746:9: error: ‘gdk_display_put_event’ is deprecated [-Werror=deprecated-declarations]
os.c:3880:9: error: ‘gtk_cell_layout_clear’ is deprecated [-Werror=deprecated-declarations]
os.c:3891:9: error: ‘gtk_cell_layout_get_cells’ is deprecated [-Werror=deprecated-declarations]
os.c:3902:9: error: ‘gtk_cell_layout_pack_start’ is deprecated [-Werror=deprecated-declarations]
os.c:3914:9: error: ‘gtk_cell_layout_set_attributes’ is deprecated [-Werror=deprecated-declarations]
os.c:3930:9: error: ‘gtk_cell_renderer_get_fixed_size’ is deprecated [-Werror=deprecated-declarations]
os.c:3947:9: error: ‘gtk_cell_renderer_get_padding’ is deprecated [-Werror=deprecated-declarations]
os.c:3964:9: error: ‘gtk_cell_renderer_get_preferred_height_for_width’ is deprecated [-Werror=deprecated-declarations]
os.c:3981:9: error: ‘gtk_cell_renderer_get_preferred_size’ is deprecated [-Werror=deprecated-declarations]
os.c:3995:9: error: ‘gtk_cell_renderer_pixbuf_new’ is deprecated [-Werror=deprecated-declarations]
os.c:4006:9: error: ‘gtk_cell_renderer_set_fixed_size’ is deprecated [-Werror=deprecated-declarations]
os.c:4017:9: error: ‘gtk_cell_renderer_text_new’ is deprecated [-Werror=deprecated-declarations]
os.c:4029:9: error: ‘gtk_cell_renderer_toggle_new’ is deprecated [-Werror=deprecated-declarations]
os.c:4040:9: error: ‘gtk_cell_view_set_fit_model’ is deprecated [-Werror=deprecated-declarations]
os.c:4074:9: error: ‘gtk_color_chooser_add_palette’ is deprecated [-Werror=deprecated-declarations]
os.c:4087:9: error: ‘gtk_color_chooser_dialog_new’ is deprecated [-Werror=deprecated-declarations]
os.c:4102:9: error: ‘gtk_color_chooser_get_rgba’ is deprecated [-Werror=deprecated-declarations]
os.c:4115:9: error: ‘gtk_color_chooser_get_use_alpha’ is deprecated [-Werror=deprecated-declarations]
os.c:4128:9: error: ‘gtk_color_chooser_set_rgba’ is deprecated [-Werror=deprecated-declarations]
os.c:4140:9: error: ‘gtk_color_chooser_set_use_alpha’ is deprecated [-Werror=deprecated-declarations]
os.c:4151:9: error: ‘gtk_combo_box_get_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
os.c:4163:9: error: ‘gtk_combo_box_get_model’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
os.c:4174:9: error: ‘gtk_combo_box_popdown’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
os.c:4184:9: error: ‘gtk_combo_box_popup’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
os.c:4194:9: error: ‘gtk_combo_box_set_active’ is deprecated: Use 'GtkDropDown' instead [-Werror=deprecated-declarations]
os.c:4208:9: error: ‘gtk_combo_box_text_insert’ is deprecated: Use 'GtkDropDown and GtkStringList' instead 
os.c:4222:9: error: ‘gtk_combo_box_text_new’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
os.c:4234:9: error: ‘gtk_combo_box_text_new_with_entry’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
os.c:4245:9: error: ‘gtk_combo_box_text_remove’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
os.c:4255:9: error: ‘gtk_combo_box_text_remove_all’ is deprecated: Use 'GtkDropDown and GtkStringList' instead [-Werror=deprecated-declarations]
os.c:4292:9: error: ‘gtk_dialog_add_button’ is deprecated [-Werror=deprecated-declarations]
os.c:4725:9: error: ‘gtk_file_chooser_add_filter’ is deprecated [-Werror=deprecated-declarations]
os.c:4736:9: error: ‘gtk_file_chooser_get_filter’ is deprecated [-Werror=deprecated-declarations]
os.c:4779:9: error: ‘gtk_file_chooser_set_current_name’ is deprecated [-Werror=deprecated-declarations]
os.c:4791:9: error: ‘gtk_file_chooser_set_filter’ is deprecated [-Werror=deprecated-declarations]
os.c:4801:9: error: ‘gtk_file_chooser_set_select_multiple’ is deprecated [-Werror=deprecated-declarations]
os.c:4866:9: error: ‘gtk_font_chooser_dialog_new’ is deprecated [-Werror=deprecated-declarations]
os.c:4880:9: error: ‘gtk_font_chooser_get_font’ is deprecated [-Werror=deprecated-declarations]
os.c:4893:9: error: ‘gtk_font_chooser_set_font’ is deprecated [-Werror=deprecated-declarations]
os.c:5532:9: error: ‘gtk_list_store_append’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5542:9: error: ‘gtk_list_store_clear’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5552:9: error: ‘gtk_list_store_insert’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5565:9: error: ‘gtk_list_store_newv’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5578:9: error: ‘gtk_list_store_remove’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5588:9: error: ‘gtk_list_store_set’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5598:9: error: ‘gtk_list_store_set’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5610:9: error: ‘gtk_list_store_set’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5621:9: error: ‘gtk_list_store_set’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5633:9: error: ‘gtk_list_store_set’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5645:9: error: ‘gtk_list_store_set_value’ is deprecated: Use 'GListStore' instead [-Werror=deprecated-declarations]
os.c:5671:9: error: ‘gtk_message_dialog_format_secondary_text’ is deprecated [-Werror=deprecated-declarations]
os.c:5689:9: error: ‘gtk_message_dialog_new’ is deprecated [-Werror=deprecated-declarations]
os.c:6799:9: error: ‘gtk_render_background’ is deprecated [-Werror=deprecated-declarations]
os.c:6809:9: error: ‘gtk_render_focus’ is deprecated [-Werror=deprecated-declarations]
os.c:6819:9: error: ‘gtk_render_frame’ is deprecated [-Werror=deprecated-declarations]
os.c:6829:9: error: ‘gtk_render_handle’ is deprecated [-Werror=deprecated-declarations]
os.c:7170:9: error: ‘gtk_style_context_add_class’ is deprecated [-Werror=deprecated-declarations]
os.c:7182:9: error: ‘gtk_style_context_add_provider’ is deprecated [-Werror=deprecated-declarations]
os.c:7194:9: error: ‘gtk_style_context_remove_class’ is deprecated [-Werror=deprecated-declarations]
os.c:7206:9: error: ‘gtk_style_context_restore’ is deprecated [-Werror=deprecated-declarations]
os.c:7216:9: error: ‘gtk_style_context_save’ is deprecated [-Werror=deprecated-declarations]
os.c:7226:9: error: ‘gtk_style_context_set_state’ is deprecated [-Werror=deprecated-declarations]
os.c:7844:9: error: ‘gtk_tree_model_get’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7858:9: error: ‘gtk_tree_model_get’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7871:9: error: ‘gtk_tree_model_get_iter’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7883:9: error: ‘gtk_tree_model_get_iter_first’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7895:9: error: ‘gtk_tree_model_get_n_columns’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7907:9: error: ‘gtk_tree_model_get_path’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7930:9: error: ‘gtk_tree_model_get_value’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7941:9: error: ‘gtk_tree_model_iter_children’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7953:9: error: ‘gtk_tree_model_iter_n_children’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7965:9: error: ‘gtk_tree_model_iter_next’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7977:9: error: ‘gtk_tree_model_iter_nth_child’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7988:9: error: ‘gtk_tree_path_append_index’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:7999:9: error: ‘gtk_tree_path_compare’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8010:9: error: ‘gtk_tree_path_free’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8021:9: error: ‘gtk_tree_path_get_depth’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8033:9: error: ‘gtk_tree_path_get_indices’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8045:9: error: ‘gtk_tree_path_new’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8057:9: error: ‘gtk_tree_path_new_from_string’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8071:9: error: ‘gtk_tree_path_new_from_string’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8084:9: error: ‘gtk_tree_path_next’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8095:9: error: ‘gtk_tree_path_prev’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8107:9: error: ‘gtk_tree_path_up’ is deprecated: Use 'GListModel' instead [-Werror=deprecated-declarations]
os.c:8119:9: error: ‘gtk_tree_selection_count_selected_rows’ is deprecated [-Werror=deprecated-declarations]
os.c:8133:9: error: ‘gtk_tree_selection_get_selected_rows’ is deprecated [-Werror=deprecated-declarations]
os.c:8147:9: error: ‘gtk_tree_selection_path_is_selected’ is deprecated [-Werror=deprecated-declarations]
os.c:8158:9: error: ‘gtk_tree_selection_select_all’ is deprecated [-Werror=deprecated-declarations]
os.c:8168:9: error: ‘gtk_tree_selection_select_iter’ is deprecated [-Werror=deprecated-declarations]
os.c:8178:9: error: ‘gtk_tree_selection_set_mode’ is deprecated [-Werror=deprecated-declarations]
os.c:8188:9: error: ‘gtk_tree_selection_set_select_function’ is deprecated [-Werror=deprecated-declarations]
os.c:8198:9: error: ‘gtk_tree_selection_unselect_all’ is deprecated [-Werror=deprecated-declarations]
os.c:8208:9: error: ‘gtk_tree_selection_unselect_iter’ is deprecated [-Werror=deprecated-declarations]
os.c:8218:9: error: ‘gtk_tree_selection_unselect_path’ is deprecated [-Werror=deprecated-declarations]
os.c:8228:9: error: ‘gtk_tree_store_append’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8238:9: error: ‘gtk_tree_store_clear’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8248:9: error: ‘gtk_tree_store_insert’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8258:9: error: ‘gtk_tree_store_insert_after’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8271:9: error: ‘gtk_tree_store_newv’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8284:9: error: ‘gtk_tree_store_prepend’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8294:9: error: ‘gtk_tree_store_remove’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8304:9: error: ‘gtk_tree_store_set’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8314:9: error: ‘gtk_tree_store_set’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8326:9: error: ‘gtk_tree_store_set’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8337:9: error: ‘gtk_tree_store_set’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8349:9: error: ‘gtk_tree_store_set’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8361:9: error: ‘gtk_tree_store_set_value’ is deprecated: Use 'GtkTreeListModel' instead [-Werror=deprecated-declarations]
os.c:8372:9: error: ‘gtk_tree_view_collapse_row’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8385:9: error: ‘gtk_tree_view_column_add_attribute’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8402:9: error: ‘gtk_tree_view_column_cell_get_position’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8416:9: error: ‘gtk_tree_view_column_cell_set_cell_data’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8426:9: error: ‘gtk_tree_view_column_clear’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8437:9: error: ‘gtk_tree_view_column_get_button’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8449:9: error: ‘gtk_tree_view_column_get_fixed_width’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8461:9: error: ‘gtk_tree_view_column_get_reorderable’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8473:9: error: ‘gtk_tree_view_column_get_resizable’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8485:9: error: ‘gtk_tree_view_column_get_visible’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8497:9: error: ‘gtk_tree_view_column_get_width’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8509:9: error: ‘gtk_tree_view_column_new’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8520:9: error: ‘gtk_tree_view_column_pack_end’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8530:9: error: ‘gtk_tree_view_column_pack_start’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8540:9: error: ‘gtk_tree_view_column_set_alignment’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8550:9: error: ‘gtk_tree_view_column_set_cell_data_func’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8560:9: error: ‘gtk_tree_view_column_set_clickable’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8570:9: error: ‘gtk_tree_view_column_set_fixed_width’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8580:9: error: ‘gtk_tree_view_column_set_min_width’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8590:9: error: ‘gtk_tree_view_column_set_reorderable’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8600:9: error: ‘gtk_tree_view_column_set_resizable’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8610:9: error: ‘gtk_tree_view_column_set_sizing’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8620:9: error: ‘gtk_tree_view_column_set_sort_indicator’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8630:9: error: ‘gtk_tree_view_column_set_sort_order’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' os.c:8640:9: error: ‘gtk_tree_view_column_set_visible’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8650:9: error: ‘gtk_tree_view_column_set_widget’ is deprecated: Use 'GtkColumnView and GtkColumnViewColumn' instead os.c:8664:9: error: ‘gtk_tree_view_convert_bin_window_to_tree_coords’ is deprecated: Use 'GtkListView' instead 
os.c:8681:9: error: ‘gtk_tree_view_convert_bin_window_to_widget_coords’ is deprecated: Use 'GtkListView' instead 
os.c:8695:9: error: ‘gtk_tree_view_create_row_drag_icon’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8707:9: error: ‘gtk_tree_view_expand_row’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8720:9: error: ‘gtk_tree_view_get_background_area’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-os.c:8734:9: error: ‘gtk_tree_view_get_cell_area’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8747:9: error: ‘gtk_tree_view_get_column’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8759:9: error: ‘gtk_tree_view_get_columns’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8774:9: error: ‘gtk_tree_view_get_cursor’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8788:9: error: ‘gtk_tree_view_get_expander_column’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-os.c:8800:9: error: ‘gtk_tree_view_get_grid_lines’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8812:9: error: ‘gtk_tree_view_get_headers_visible’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-
os.c:8832:9: error: ‘gtk_tree_view_get_path_at_pos’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8849:9: error: ‘gtk_tree_view_get_selection’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8862:9: error: ‘gtk_tree_view_get_visible_rect’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8875:9: error: ‘gtk_tree_view_insert_column’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8886:9: error: ‘gtk_tree_view_move_column_after’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-
os.c:8897:9: error: ‘gtk_tree_view_new_with_model’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8908:9: error: ‘gtk_tree_view_remove_column’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8919:9: error: ‘gtk_tree_view_row_expanded’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8930:9: error: ‘gtk_tree_view_scroll_to_cell’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8940:9: error: ‘gtk_tree_view_scroll_to_point’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8950:9: error: ‘gtk_tree_view_set_cursor’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8960:9: error: ‘gtk_tree_view_set_drag_dest_row’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8970:9: error: ‘gtk_tree_view_set_grid_lines’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8980:9: error: ‘gtk_tree_view_set_headers_visible’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:8990:9: error: ‘gtk_tree_view_set_model’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:9000:9: error: ‘gtk_tree_view_set_search_column’ is deprecated: Use 'GtkListView' instead [-Werror=deprecated-declarations]
os.c:9401:9: error: ‘gtk_widget_get_style_context’ is deprecated [-Werror=deprecated-declarations]
os.c:9470:9: error: ‘gtk_widget_hide’ is deprecated: Use 'gtk_widget_set_visible' instead [-Werror=deprecated-declarations]
os.c:9798:9: error: ‘gtk_widget_show’ is deprecated: Use 'gtk_widget_set_visible or gtk_window_present' instead 

akurtakov avatar Apr 28 '23 08:04 akurtakov

@akurtakov do we maybe want a github action to verify GTK4 compilation? Actually one needs to know what tools to setup and how to make / compile the code and then it should be possible to run this as part of the actions...

laeubi avatar May 02 '23 11:05 laeubi

That would be nice. First of all it would need gtk 4.x headers installed (gtk4-devel rpm on Fedora). After that one can pass -gtk-all parameter to build.sh call and both gtk3 and gtk4 bindings will be built.

akurtakov avatar May 02 '23 11:05 akurtakov

If you like to experiment with that I think you can copy the current gh action, strip windows + mac from the matrix and configure additional things here:

https://github.com/eclipse-platform/eclipse.platform.swt/blob/ae4fb6b74e7cb67e683ac50c5d1ae54c93252891/.github/workflows/maven.yml#L47

then you can execute any command that seems good for validation... (even though its a debian/ubuntu).

laeubi avatar May 02 '23 13:05 laeubi

@akurtakov As a newcomer to SWT, I would like to contribute to the porting of GTK4. I have been reviewing deprecated APIs (functions) for replacement. I noticed that below new API is already present in GTK.java and has been adopted partially in some widgets.

Is there a known reason why the new API is not used everywhere instead of the deprecated ones? If I make changes, how can I ensure that they do not affect other components?

os.c:9470:9: error: ‘gtk_widget_hide’ is deprecated: Use 'gtk_widget_set_visible' instead [-Werror=deprecated-declarations] os.c:9798:9: error: ‘gtk_widget_show’ is deprecated: Use 'gtk_widget_set_visible or gtk_window_present' instead

If there are no alternative solutions provided in the GTK documentation for the deprecated APIs, how will the new APIs be adopted?"

lathapatil avatar Mar 07 '24 05:03 lathapatil

As of today against Gtk 4.10.3 compilation fails with many deprecated usages:

How do we get these errors now ? I do not get these when I run build.sh with -gtk-all parameter

lathapatil avatar Mar 08 '24 06:03 lathapatil

I can confirm that executing the binaries build (via Maven) against GTK 4 (i.e., with -Dgtk_version=4.0) succeeds without deprecation warnings.

Using Ubuntu 22.04.2 LTS with latest GTK libraries provided via apt.

HeikoKlare avatar Mar 08 '24 10:03 HeikoKlare

I can confirm that executing the binaries build (via Maven) against GTK 4 (i.e., with -Dgtk_version=4.0) succeeds without deprecation warnings.

I assume there might be an alternative method to display these warnings/errors concerning the use of deprecated APIs. Perhaps they are disabled somewhere, preventing them from appearing.

lathapatil avatar Mar 08 '24 10:03 lathapatil

The deprecation messages seen depend on the version of gtk 4.x headers one is compiling against. Naturally, newer Gtk headers has more deprecations than older ones and that's why this happens. I can't compile too on Fedora 40 due to deprecations.

akurtakov avatar Mar 11 '24 14:03 akurtakov

For the record - I compile against gtk4-4.13.8-2.fc40 while ubuntu has gtk 4.6.x if I found the info correctly.

akurtakov avatar Mar 11 '24 14:03 akurtakov

For the record - I compile against gtk4-4.13.8-2.fc40 while ubuntu has gtk 4.6.x if I found the info correctly.

Yes. In Ubuntu I have gtk 4.6.9 installed .

lathapatil avatar Mar 12 '24 04:03 lathapatil

@akurtakov I am unable to build SWT with the -gtk-all parameter using the build.sh script due to compilation errors related to the following three GTK APIs. I have to modify OS.java for these APIs to build either GTK3 or GTK4 individually, but not both simultaneously.

2024-07-10_18h07_19

Additionally, once I build SWT with only GTK4, I am unable to launch Eclipse. You can find the error log here: hs_err_pid181700.log.

Although I can launch Eclipse with errors in the console, which are logged here: Console_error_GTK4_linux_Eclipse_launch.txt this is only possible if I use the -noSplash option in the program arguments.

Is this the expected behavior? How are such scenarios typically handled, for example, when native APIs differ only in parameters between GTK3 and GTK4?

lathapatil avatar Jul 10 '24 12:07 lathapatil

@lathapatil In the case when only params change best way forward is to remove it from OS.java and have proper definitions in GTK3.java for the 3.x binding and GTK4.java for the 4.x binding.

akurtakov avatar Jul 10 '24 13:07 akurtakov

GTK3.java for the 3.x binding and GTK4.java for the 4.x binding.

This resolves build issue and I can use -gtk-all to build both . However Launching Eclipse with SWT_GTK4=1 is having issues as mentioned before . Can I raise a PR to resolve compilation issues w.r.t these 3 APIs?

lathapatil avatar Jul 10 '24 13:07 lathapatil

Sure, open a PR. Small, incremental steps are easier to review and verify.

akurtakov avatar Jul 10 '24 13:07 akurtakov