├── .github ├── CODEOWNERS ├── FUNDING.yml ├── ISSUE_TEMPLATE │ ├── asking-for-help.md │ ├── blank-issue.md │ ├── bug_report.md │ └── feature-request-or-missing-binding.md ├── dependabot.yml └── workflows │ ├── CI.yml │ ├── auto-update.yml │ ├── book-deploy.yml │ ├── book-lint.yml │ ├── docs.yml │ ├── image.yml │ ├── listings.yml │ ├── macos.yml │ ├── typos.yml │ └── windows-msvc.yml ├── .gitignore ├── .gitmodules ├── .typos.toml ├── CHANGELOG.md ├── COPYRIGHT ├── Cargo.lock ├── Cargo.toml ├── Dockerfile ├── LICENSE ├── README.md ├── book ├── .gitignore ├── README.md ├── book.toml ├── listings │ ├── .cargo │ │ └── config.toml │ ├── .gitignore │ ├── Cargo.lock │ ├── Cargo.toml │ ├── README.md │ ├── actions │ │ ├── 1 │ │ │ └── main.rs │ │ ├── 2 │ │ │ └── main.rs │ │ ├── 3 │ │ │ └── main.rs │ │ ├── 4 │ │ │ └── main.rs │ │ ├── 5 │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ └── window.ui │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 6 │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ └── window.ui │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ └── 7 │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Actions7.gschema.xml │ │ │ ├── resources │ │ │ ├── resources.gresource.xml │ │ │ └── window.ui │ │ │ └── window │ │ │ ├── imp.rs │ │ │ └── mod.rs │ ├── build.rs │ ├── composite_templates │ │ ├── 1 │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ └── window.ui │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 2 │ │ │ ├── custom_button │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ └── window.ui │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 3 │ │ │ ├── custom_button │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ └── window.ui │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 4 │ │ │ ├── custom_button │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ └── window.ui │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 5 │ │ │ ├── custom_button │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ └── window.ui │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ └── 6 │ │ │ ├── custom_button │ │ │ ├── imp.rs │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ ├── resources.gresource.xml │ │ │ └── window.ui │ │ │ └── window │ │ │ ├── imp.rs │ │ │ └── mod.rs │ ├── css │ │ ├── 1 │ │ │ ├── main.rs │ │ │ └── style.css │ │ ├── 2 │ │ │ ├── main.rs │ │ │ └── style.css │ │ ├── 3 │ │ │ ├── main.rs │ │ │ └── style.css │ │ ├── 4 │ │ │ ├── main.rs │ │ │ └── style.css │ │ ├── 5 │ │ │ └── main.rs │ │ ├── 6 │ │ │ ├── main.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ ├── mod.rs │ │ │ │ └── window.ui │ │ ├── 7 │ │ │ ├── main.rs │ │ │ ├── style.css │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ ├── mod.rs │ │ │ │ └── window.ui │ │ ├── 8 │ │ │ ├── main.rs │ │ │ ├── style.css │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ ├── mod.rs │ │ │ │ └── window.ui │ │ └── 9 │ │ │ ├── main.rs │ │ │ ├── style.css │ │ │ └── window │ │ │ ├── imp.rs │ │ │ ├── mod.rs │ │ │ └── window.ui │ ├── g_object_memory_management │ │ ├── 1 │ │ │ └── main.rs │ │ ├── 2 │ │ │ └── main.rs │ │ ├── 3 │ │ │ └── main.rs │ │ ├── 4 │ │ │ └── main.rs │ │ └── 5 │ │ │ └── main.rs │ ├── g_object_properties │ │ ├── 1 │ │ │ └── main.rs │ │ ├── 2 │ │ │ └── main.rs │ │ └── 3 │ │ │ ├── custom_button │ │ │ ├── imp.rs │ │ │ └── mod.rs │ │ │ └── main.rs │ ├── g_object_signals │ │ ├── 1 │ │ │ └── main.rs │ │ └── 2 │ │ │ ├── custom_button │ │ │ ├── imp.rs │ │ │ └── mod.rs │ │ │ └── main.rs │ ├── g_object_subclassing │ │ ├── 1 │ │ │ ├── custom_button │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ └── main.rs │ │ └── 2 │ │ │ ├── custom_button │ │ │ ├── imp.rs │ │ │ └── mod.rs │ │ │ └── main.rs │ ├── g_object_values │ │ ├── 1 │ │ │ └── main.rs │ │ └── 2 │ │ │ └── main.rs │ ├── hello_world │ │ ├── 1 │ │ │ └── main.rs │ │ ├── 2 │ │ │ └── main.rs │ │ └── 3 │ │ │ └── main.rs │ ├── list_widgets │ │ ├── 1 │ │ │ └── main.rs │ │ ├── 2 │ │ │ ├── integer_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ └── main.rs │ │ ├── 3 │ │ │ ├── integer_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ └── main.rs │ │ ├── 4 │ │ │ ├── integer_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ └── main.rs │ │ ├── 5 │ │ │ ├── integer_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ └── main.rs │ │ └── 6 │ │ │ └── main.rs │ ├── main_event_loop │ │ ├── 1 │ │ │ └── main.rs │ │ ├── 2 │ │ │ └── main.rs │ │ ├── 3 │ │ │ └── main.rs │ │ ├── 4 │ │ │ └── main.rs │ │ ├── 5 │ │ │ └── main.rs │ │ ├── 6 │ │ │ └── main.rs │ │ ├── 7 │ │ │ └── main.rs │ │ ├── 8 │ │ │ └── main.rs │ │ └── 9 │ │ │ └── main.rs │ ├── rustfmt.toml │ ├── saving_window_state │ │ └── 1 │ │ │ ├── custom_window │ │ │ ├── imp.rs │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ └── org.gtk_rs.SavingWindowState1.gschema.xml │ ├── settings │ │ ├── 1 │ │ │ ├── main.rs │ │ │ └── org.gtk_rs.Settings1.gschema.xml │ │ └── 2 │ │ │ ├── main.rs │ │ │ └── org.gtk_rs.Settings2.gschema.xml │ ├── todo │ │ ├── 1 │ │ │ ├── main.rs │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ ├── task_row.ui │ │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── task_row │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 2 │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Todo2.gschema.xml │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ ├── shortcuts.ui │ │ │ │ ├── task_row.ui │ │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── task_row │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── utils.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 3 │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Todo3.gschema.xml │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ ├── shortcuts.ui │ │ │ │ ├── style.css │ │ │ │ ├── task_row.ui │ │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── task_row │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── utils.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 4 │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Todo4.gschema.xml │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ ├── shortcuts.ui │ │ │ │ ├── task_row.ui │ │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── task_row │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── utils.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 5 │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Todo5.gschema.xml │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ ├── shortcuts.ui │ │ │ │ ├── task_row.ui │ │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── task_row │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── utils.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 6 │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Todo6.gschema.xml │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ ├── shortcuts.ui │ │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── utils.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ ├── 7 │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Todo7.gschema.xml │ │ │ ├── resources │ │ │ │ ├── resources.gresource.xml │ │ │ │ ├── shortcuts.ui │ │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ │ ├── utils.rs │ │ │ └── window │ │ │ │ ├── imp.rs │ │ │ │ └── mod.rs │ │ └── 8 │ │ │ ├── collection_object │ │ │ ├── imp.rs │ │ │ └── mod.rs │ │ │ ├── main.rs │ │ │ ├── org.gtk_rs.Todo8.gschema.xml │ │ │ ├── resources │ │ │ ├── resources.gresource.xml │ │ │ ├── shortcuts.ui │ │ │ └── window.ui │ │ │ ├── task_object │ │ │ ├── imp.rs │ │ │ └── mod.rs │ │ │ ├── utils.rs │ │ │ └── window │ │ │ ├── imp.rs │ │ │ └── mod.rs │ └── xtask │ │ └── main.rs ├── src │ ├── SUMMARY.md │ ├── actions.md │ ├── composite_templates.md │ ├── css.md │ ├── g_object_concepts.md │ ├── g_object_memory_management.md │ ├── g_object_properties.md │ ├── g_object_signals.md │ ├── g_object_subclassing.md │ ├── g_object_values.md │ ├── hello_world.md │ ├── img │ │ ├── css_1.png │ │ ├── css_2.png │ │ ├── css_3.png │ │ ├── css_4.png │ │ ├── css_5.png │ │ ├── css_7.png │ │ ├── css_8.png │ │ ├── css_9.png │ │ ├── hello_world_empty.png │ │ ├── lists_list_box.png │ │ ├── lists_list_view_1.png │ │ ├── lists_list_view_2.png │ │ ├── main_event_loop.png │ │ ├── main_event_loop_ashpd.png │ │ ├── scalable_lists_concept.png │ │ ├── src │ │ │ ├── main_event_loop.svg │ │ │ ├── scalable_lists_concept.svg │ │ │ └── todo_change_4_5.svg │ │ ├── task_row.png │ │ ├── todo_1_empty.png │ │ ├── todo_1_mockup.png │ │ ├── todo_2_shortcuts.png │ │ ├── todo_3.png │ │ ├── todo_4.png │ │ ├── todo_6.png │ │ ├── todo_7_sidebar.png │ │ ├── todo_8_placeholder_page.png │ │ ├── todo_change_4_5.png │ │ ├── vs-install.png │ │ └── widgets_button.png │ ├── installation.md │ ├── installation_linux.md │ ├── installation_macos.md │ ├── installation_windows.md │ ├── introduction.md │ ├── libadwaita.md │ ├── list_widgets.md │ ├── main_event_loop.md │ ├── project_setup.md │ ├── saving_window_state.md │ ├── settings.md │ ├── todo_1.md │ ├── todo_2.md │ ├── todo_3.md │ ├── todo_4.md │ ├── vid │ │ ├── actions_counter.webm │ │ ├── actions_menu.webm │ │ ├── css_6.webm │ │ ├── g_object_properties_buttons.webm │ │ ├── g_object_properties_switches.webm │ │ ├── g_object_subclassing.webm │ │ ├── hello_world_button.webm │ │ ├── main_event_loop_1.webm │ │ ├── main_event_loop_2.webm │ │ ├── main_event_loop_3.webm │ │ ├── settings_1.webm │ │ ├── todo_1_animation.webm │ │ ├── todo_2_animation.webm │ │ ├── todo_7_navigation_sidebar.webm │ │ ├── todo_8_adaptive_sidebar.webm │ │ ├── todo_8_dialog.webm │ │ └── todo_dark.webm │ └── widgets.md └── theme │ └── style.css ├── deny.toml ├── examples ├── Cargo.toml ├── README.md ├── about_dialog │ ├── README.md │ ├── gtk-rs.svg │ ├── main.rs │ └── screenshot.png ├── accessible_text │ ├── README.md │ ├── main.rs │ └── text_view.rs ├── basics │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── builder_pattern │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── clipboard │ ├── README.md │ ├── asset.png │ ├── main.rs │ └── screenshot.png ├── clock │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── column_view_datagrid │ ├── README.md │ ├── grid_cell │ │ ├── grid_cell.ui │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── composite_dialog │ ├── README.md │ ├── main.rs │ ├── my_app_window │ │ ├── imp.rs │ │ ├── mod.rs │ │ └── window.ui │ └── screenshot.png ├── composite_template │ ├── README.md │ ├── ex_application_window │ │ ├── ex_application_window.ui │ │ ├── imp.rs │ │ └── mod.rs │ ├── ex_menu_button │ │ ├── ex_menu_button.ui │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── confetti_snapshot_animation │ ├── README.md │ ├── animated_explosion │ │ ├── imp.rs │ │ └── mod.rs │ ├── confetti_widget │ │ ├── imp.rs │ │ └── mod.rs │ ├── explosion.rs │ ├── main.rs │ └── screenshot.png ├── content_provider │ ├── README.md │ ├── content_provider │ │ ├── imp.rs │ │ └── mod.rs │ └── main.rs ├── css │ ├── README.md │ ├── main.rs │ ├── screenshot.png │ └── style.css ├── custom_application │ ├── README.md │ ├── ex_application │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── custom_buildable │ ├── README.md │ ├── custom_buildable │ │ ├── custom_buildable.ui │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ ├── screenshot.png │ └── window.ui ├── custom_editable │ ├── README.md │ ├── custom_editable │ │ ├── imp.rs │ │ └── mod.rs │ ├── custom_tag │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ ├── screenshot.png │ └── style.css ├── custom_layout_manager │ ├── README.md │ ├── custom_layout │ │ ├── imp.rs │ │ └── mod.rs │ ├── custom_layout_child │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ ├── screenshot.png │ └── simple_widget │ │ ├── imp.rs │ │ └── mod.rs ├── custom_orientable │ ├── README.md │ ├── custom_orientable │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── custom_paintable │ ├── README.md │ ├── custom_paintable │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── custom_widget │ ├── README.md │ ├── ex_button │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── dialog │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── entry_completion │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── entry_undo │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── expressions │ ├── README.md │ ├── main.rs │ ├── metadata │ │ ├── imp.rs │ │ └── mod.rs │ ├── note │ │ ├── imp.rs │ │ └── mod.rs │ └── screenshot.png ├── femtovg_area │ ├── README.md │ ├── femtovg_area │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── fill_and_stroke │ ├── README.md │ ├── main.rs │ ├── paintable │ │ ├── imp.rs │ │ └── mod.rs │ └── screenshot.png ├── flow_box │ ├── README.md │ ├── data_set.rs │ ├── main.rs │ └── screenshot.png ├── gif_paintable │ ├── README.md │ ├── gif_paintable │ │ ├── frame.rs │ │ ├── imp.rs │ │ └── mod.rs │ ├── gif_paintable_window │ │ ├── gif_paintable_window.ui │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── glium_gl_area │ ├── README.md │ ├── glium_gl_area │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── grid_packing │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── gtk_builder │ ├── README.md │ ├── gtk_builder.ui │ ├── main.rs │ └── screenshot.png ├── list_box_model │ ├── README.md │ ├── list_box_row │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ ├── model │ │ ├── imp.rs │ │ └── mod.rs │ └── row_data │ │ ├── imp.rs │ │ └── mod.rs ├── list_box_sort_stringlist │ ├── README.md │ └── main.rs ├── list_view_apps_launcher │ ├── README.md │ ├── application_row │ │ ├── application_row.ui │ │ ├── imp.rs │ │ └── mod.rs │ ├── main.rs │ └── screenshot.png ├── menubar │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── rotation_bin │ ├── README.md │ ├── main.rs │ ├── rotation_bin │ │ ├── imp.rs │ │ └── mod.rs │ └── screenshot.png ├── scale │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── scale_bin │ ├── README.md │ ├── main.rs │ ├── scale_bin │ │ ├── imp.rs │ │ └── mod.rs │ └── screenshot.png ├── search_bar │ ├── README.md │ ├── main.rs │ └── screenshot.png ├── squares │ ├── README.md │ ├── main.rs │ ├── screenshot.png │ └── squares_widget │ │ ├── imp.rs │ │ └── mod.rs ├── squeezer_bin │ ├── README.md │ ├── main.rs │ ├── screenshot1.png │ ├── screenshot2.png │ └── squeezer_bin │ │ ├── imp.rs │ │ └── mod.rs ├── text_viewer │ ├── README.md │ ├── main.rs │ ├── screenshot.png │ └── text_viewer.ui ├── tokio_async_request │ ├── README.md │ ├── main.rs │ └── screenshot.gif ├── video_player │ ├── README.md │ ├── main.rs │ ├── screenshot.png │ └── video_player_window │ │ ├── imp.rs │ │ ├── mod.rs │ │ └── video_player_window.ui └── virtual_methods │ ├── README.md │ ├── base_button │ ├── imp.rs │ └── mod.rs │ ├── derived_button │ ├── imp.rs │ └── mod.rs │ └── main.rs ├── gdk4-macos ├── COPYRIGHT ├── Cargo.toml ├── Gir.toml ├── LICENSE ├── README.md ├── src │ ├── auto │ │ ├── macos_device.rs │ │ ├── macos_display.rs │ │ ├── macos_gl_context.rs │ │ ├── macos_keymap.rs │ │ ├── macos_monitor.rs │ │ ├── macos_seat.rs │ │ ├── macos_surface.rs │ │ ├── mod.rs │ │ └── versions.txt │ ├── lib.rs │ ├── macos_surface.rs │ ├── prelude.rs │ └── rt.rs ├── sys │ ├── Cargo.toml │ ├── Gir.toml │ ├── LICENSE │ ├── build.rs │ ├── src │ │ └── lib.rs │ └── versions.txt └── tests │ └── check_gir.rs ├── gdk4-wayland ├── COPYRIGHT ├── Cargo.toml ├── Gir.toml ├── LICENSE ├── README.md ├── src │ ├── auto │ │ ├── mod.rs │ │ ├── versions.txt │ │ ├── wayland_device.rs │ │ ├── wayland_display.rs │ │ ├── wayland_gl_context.rs │ │ ├── wayland_monitor.rs │ │ ├── wayland_popup.rs │ │ ├── wayland_seat.rs │ │ ├── wayland_surface.rs │ │ └── wayland_toplevel.rs │ ├── lib.rs │ ├── prelude.rs │ ├── wayland_device.rs │ ├── wayland_display.rs │ ├── wayland_monitor.rs │ ├── wayland_seat.rs │ ├── wayland_surface.rs │ └── wayland_toplevel.rs ├── sys │ ├── Cargo.toml │ ├── Gir.toml │ ├── LICENSE │ ├── build.rs │ ├── src │ │ └── lib.rs │ └── versions.txt └── tests │ └── check_gir.rs ├── gdk4-win32 ├── COPYRIGHT ├── Cargo.toml ├── Gir.toml ├── LICENSE ├── README.md ├── src │ ├── auto │ │ ├── enums.rs │ │ ├── mod.rs │ │ ├── versions.txt │ │ ├── win32_display.rs │ │ ├── win32_display_manager.rs │ │ ├── win32_drag.rs │ │ ├── win32_gl_context.rs │ │ ├── win32_hcursor.rs │ │ ├── win32_monitor.rs │ │ ├── win32_screen.rs │ │ └── win32_surface.rs │ ├── lib.rs │ ├── prelude.rs │ ├── rt.rs │ ├── win32_display.rs │ ├── win32_hcursor.rs │ └── win32_surface.rs ├── sys │ ├── Cargo.toml │ ├── Gir.toml │ ├── LICENSE │ ├── build.rs │ ├── src │ │ └── lib.rs │ ├── tests │ │ ├── abi.rs │ │ ├── constant.c │ │ ├── layout.c │ │ └── manual.h │ └── versions.txt └── tests │ └── check_gir.rs ├── gdk4-x11 ├── COPYRIGHT ├── Cargo.toml ├── Gir.toml ├── LICENSE ├── README.md ├── src │ ├── auto │ │ ├── enums.rs │ │ ├── functions.rs │ │ ├── mod.rs │ │ ├── versions.txt │ │ ├── x11_app_launch_context.rs │ │ ├── x11_device_manager_xi2.rs │ │ ├── x11_device_xi2.rs │ │ ├── x11_display.rs │ │ ├── x11_drag.rs │ │ ├── x11_monitor.rs │ │ ├── x11_screen.rs │ │ ├── x11_surface.rs │ │ └── x11gl_context.rs │ ├── builders.rs │ ├── functions.rs │ ├── lib.rs │ ├── prelude.rs │ ├── rt.rs │ ├── x11_display.rs │ ├── x11_monitor.rs │ ├── x11_screen.rs │ └── x11_surface.rs ├── sys │ ├── Cargo.toml │ ├── Gir.toml │ ├── LICENSE │ ├── build.rs │ ├── src │ │ └── lib.rs │ ├── tests │ │ ├── abi.rs │ │ ├── constant.c │ │ ├── layout.c │ │ └── manual.h │ └── versions.txt └── tests │ └── check_gir.rs ├── gdk4 ├── COPYRIGHT ├── Cargo.toml ├── Gir.toml ├── LICENSE ├── README.md ├── src │ ├── auto │ │ ├── app_launch_context.rs │ │ ├── button_event.rs │ │ ├── cairo_context.rs │ │ ├── cicp_params.rs │ │ ├── clipboard.rs │ │ ├── color_state.rs │ │ ├── content_deserializer.rs │ │ ├── content_formats.rs │ │ ├── content_formats_builder.rs │ │ ├── content_provider.rs │ │ ├── content_serializer.rs │ │ ├── crossing_event.rs │ │ ├── cursor.rs │ │ ├── delete_event.rs │ │ ├── device.rs │ │ ├── device_pad.rs │ │ ├── device_tool.rs │ │ ├── display.rs │ │ ├── display_manager.rs │ │ ├── dmabuf_formats.rs │ │ ├── dmabuf_texture.rs │ │ ├── dmabuf_texture_builder.rs │ │ ├── dnd_event.rs │ │ ├── drag.rs │ │ ├── drag_surface.rs │ │ ├── draw_context.rs │ │ ├── drop.rs │ │ ├── enums.rs │ │ ├── event.rs │ │ ├── event_sequence.rs │ │ ├── file_list.rs │ │ ├── flags.rs │ │ ├── focus_event.rs │ │ ├── frame_clock.rs │ │ ├── frame_timings.rs │ │ ├── functions.rs │ │ ├── gl_context.rs │ │ ├── gl_texture.rs │ │ ├── gl_texture_builder.rs │ │ ├── grab_broken_event.rs │ │ ├── key_event.rs │ │ ├── memory_texture.rs │ │ ├── memory_texture_builder.rs │ │ ├── mod.rs │ │ ├── monitor.rs │ │ ├── motion_event.rs │ │ ├── pad_event.rs │ │ ├── paintable.rs │ │ ├── popup.rs │ │ ├── popup_layout.rs │ │ ├── proximity_event.rs │ │ ├── rectangle.rs │ │ ├── rgba.rs │ │ ├── scroll_event.rs │ │ ├── seat.rs │ │ ├── snapshot.rs │ │ ├── surface.rs │ │ ├── texture.rs │ │ ├── texture_downloader.rs │ │ ├── toplevel.rs │ │ ├── toplevel_layout.rs │ │ ├── touch_event.rs │ │ ├── touchpad_event.rs │ │ ├── versions.txt │ │ └── vulkan_context.rs │ ├── builders.rs │ ├── button_event.rs │ ├── cairo_interaction.rs │ ├── clipboard.rs │ ├── content_deserializer.rs │ ├── content_formats.rs │ ├── content_formats_builder.rs │ ├── content_provider.rs │ ├── content_serializer.rs │ ├── crossing_event.rs │ ├── cursor.rs │ ├── delete_event.rs │ ├── display.rs │ ├── dmabuf_texture_builder.rs │ ├── dnd_event.rs │ ├── drag_surface.rs │ ├── drag_surface_size.rs │ ├── draw_context.rs │ ├── drop.rs │ ├── event.rs │ ├── focus_event.rs │ ├── functions.rs │ ├── gl_texture.rs │ ├── gl_texture_builder.rs │ ├── grab_broken_event.rs │ ├── key_event.rs │ ├── keymap_key.rs │ ├── keys.rs │ ├── lib.rs │ ├── memory_texture_builder.rs │ ├── motion_event.rs │ ├── pad_event.rs │ ├── popup_layout.rs │ ├── prelude.rs │ ├── proximity_event.rs │ ├── rectangle.rs │ ├── rgba.rs │ ├── scroll_event.rs │ ├── subclass │ │ ├── content_provider.rs │ │ ├── mod.rs │ │ └── paintable.rs │ ├── surface.rs │ ├── texture.rs │ ├── time_coord.rs │ ├── toplevel.rs │ ├── toplevel_size.rs │ ├── touch_event.rs │ └── touchpad_event.rs ├── sys │ ├── Cargo.toml │ ├── Gir.toml │ ├── LICENSE │ ├── build.rs │ ├── build_version.rs │ ├── src │ │ └── lib.rs │ ├── tests │ │ ├── abi.rs │ │ ├── constant.c │ │ ├── layout.c │ │ └── manual.h │ └── versions.txt └── tests │ └── check_gir.rs ├── generator.py ├── gsk4 ├── COPYRIGHT ├── Cargo.toml ├── Gir.toml ├── LICENSE ├── README.md ├── src │ ├── auto │ │ ├── blend_node.rs │ │ ├── blur_node.rs │ │ ├── border_node.rs │ │ ├── broadway_renderer.rs │ │ ├── cairo_node.rs │ │ ├── cairo_renderer.rs │ │ ├── clip_node.rs │ │ ├── color_matrix_node.rs │ │ ├── color_node.rs │ │ ├── conic_gradient_node.rs │ │ ├── container_node.rs │ │ ├── cross_fade_node.rs │ │ ├── debug_node.rs │ │ ├── enums.rs │ │ ├── fill_node.rs │ │ ├── flags.rs │ │ ├── gl_renderer.rs │ │ ├── gl_shader.rs │ │ ├── gl_shader_node.rs │ │ ├── inset_shadow_node.rs │ │ ├── linear_gradient_node.rs │ │ ├── mask_node.rs │ │ ├── mod.rs │ │ ├── opacity_node.rs │ │ ├── outset_shadow_node.rs │ │ ├── path.rs │ │ ├── path_builder.rs │ │ ├── path_measure.rs │ │ ├── path_point.rs │ │ ├── radial_gradient_node.rs │ │ ├── render_node.rs │ │ ├── renderer.rs │ │ ├── repeat_node.rs │ │ ├── repeating_linear_gradient_node.rs │ │ ├── repeating_radial_gradient_node.rs │ │ ├── rounded_clip_node.rs │ │ ├── shader_args_builder.rs │ │ ├── shadow_node.rs │ │ ├── stroke.rs │ │ ├── stroke_node.rs │ │ ├── text_node.rs │ │ ├── texture_node.rs │ │ ├── texture_scale_node.rs │ │ ├── transform.rs │ │ ├── transform_node.rs │ │ ├── versions.txt │ │ └── vulkan_renderer.rs │ ├── blend_node.rs │ ├── blur_node.rs │ ├── border_node.rs │ ├── builders.rs │ ├── cairo_node.rs │ ├── clip_node.rs │ ├── color_matrix_node.rs │ ├── color_node.rs │ ├── color_stop.rs │ ├── conic_gradient_node.rs │ ├── container_node.rs │ ├── cross_fade_node.rs │ ├── debug_node.rs │ ├── fill_node.rs │ ├── gl_shader.rs │ ├── gl_shader_node.rs │ ├── inset_shadow_node.rs │ ├── lib.rs │ ├── linear_gradient_node.rs │ ├── mask_node.rs │ ├── ngl_renderer.rs │ ├── opacity_node.rs │ ├── outset_shadow_node.rs │ ├── parse_location.rs │ ├── path.rs │ ├── path_builder.rs │ ├── path_point.rs │ ├── prelude.rs │ ├── radial_gradient_node.rs │ ├── render_node.rs │ ├── repeat_node.rs │ ├── repeating_linear_gradient_node.rs │ ├── repeating_radial_gradient_node.rs │ ├── rounded_clip_node.rs │ ├── rounded_rect.rs │ ├── shadow.rs │ ├── shadow_node.rs │ ├── stroke.rs │ ├── stroke_node.rs │ ├── text_node.rs │ ├── texture_node.rs │ ├── texture_scale_node.rs │ ├── transform.rs │ └── transform_node.rs ├── sys │ ├── Cargo.toml │ ├── Gir.toml │ ├── LICENSE │ ├── build.rs │ ├── src │ │ └── lib.rs │ ├── tests │ │ ├── abi.rs │ │ ├── constant.c │ │ ├── layout.c │ │ └── manual.h │ └── versions.txt └── tests │ └── check_gir.rs ├── gtk4-macros ├── COPYRIGHT ├── Cargo.toml ├── LICENSE ├── README.md ├── src │ ├── attribute_parser.rs │ ├── blueprint.rs │ ├── composite_template_derive.rs │ ├── lib.rs │ ├── template_callbacks_attribute.rs │ ├── test │ │ ├── template.ui │ │ └── template_callbacks.ui │ └── util.rs └── tests │ ├── compile-fail │ ├── composite-template-bad-xml.rs │ ├── composite-template-duplicate-id-attr.rs │ ├── composite-template-missing-child-attr.rs │ ├── composite-template-missing-fq-child-attr.rs │ ├── composite-template-missing-id.rs │ ├── template-callback-arg-after-rest.rs │ ├── template-callback-async-ret-value.rs │ ├── template-callback-duplicate-rest.rs │ ├── template-callback-duplicate.rs │ └── template-callback-mut-self.rs │ ├── compile.rs │ ├── my_widget.blp │ └── templates.rs ├── gtk4 ├── COPYRIGHT ├── Cargo.toml ├── Gir.toml ├── LICENSE ├── README.md ├── src │ ├── accessible.rs │ ├── accessible_text_range.rs │ ├── actionable.rs │ ├── application.rs │ ├── assistant.rs │ ├── auto │ │ ├── about_dialog.rs │ │ ├── accessible.rs │ │ ├── accessible_list.rs │ │ ├── accessible_range.rs │ │ ├── accessible_text.rs │ │ ├── action_bar.rs │ │ ├── actionable.rs │ │ ├── activate_action.rs │ │ ├── adjustment.rs │ │ ├── alert_dialog.rs │ │ ├── alias.rs │ │ ├── alternative_trigger.rs │ │ ├── any_filter.rs │ │ ├── app_chooser.rs │ │ ├── app_chooser_button.rs │ │ ├── app_chooser_dialog.rs │ │ ├── app_chooser_widget.rs │ │ ├── application.rs │ │ ├── application_window.rs │ │ ├── aspect_frame.rs │ │ ├── assistant.rs │ │ ├── assistant_page.rs │ │ ├── at_context.rs │ │ ├── bin_layout.rs │ │ ├── bitset.rs │ │ ├── bookmark_list.rs │ │ ├── bool_filter.rs │ │ ├── box_.rs │ │ ├── box_layout.rs │ │ ├── buildable.rs │ │ ├── builder.rs │ │ ├── builder_list_item_factory.rs │ │ ├── builder_scope.rs │ │ ├── button.rs │ │ ├── calendar.rs │ │ ├── callback_action.rs │ │ ├── cell_area.rs │ │ ├── cell_area_box.rs │ │ ├── cell_area_context.rs │ │ ├── cell_editable.rs │ │ ├── cell_layout.rs │ │ ├── cell_renderer.rs │ │ ├── cell_renderer_accel.rs │ │ ├── cell_renderer_combo.rs │ │ ├── cell_renderer_pixbuf.rs │ │ ├── cell_renderer_progress.rs │ │ ├── cell_renderer_spin.rs │ │ ├── cell_renderer_spinner.rs │ │ ├── cell_renderer_text.rs │ │ ├── cell_renderer_toggle.rs │ │ ├── cell_view.rs │ │ ├── center_box.rs │ │ ├── center_layout.rs │ │ ├── check_button.rs │ │ ├── closure_expression.rs │ │ ├── color_button.rs │ │ ├── color_chooser.rs │ │ ├── color_chooser_dialog.rs │ │ ├── color_chooser_widget.rs │ │ ├── color_dialog.rs │ │ ├── color_dialog_button.rs │ │ ├── column_view.rs │ │ ├── column_view_cell.rs │ │ ├── column_view_column.rs │ │ ├── column_view_row.rs │ │ ├── column_view_sorter.rs │ │ ├── combo_box.rs │ │ ├── combo_box_text.rs │ │ ├── constant_expression.rs │ │ ├── constants.rs │ │ ├── constraint.rs │ │ ├── constraint_guide.rs │ │ ├── constraint_layout.rs │ │ ├── constraint_layout_child.rs │ │ ├── constraint_target.rs │ │ ├── css_provider.rs │ │ ├── css_section.rs │ │ ├── custom_filter.rs │ │ ├── custom_sorter.rs │ │ ├── dialog.rs │ │ ├── directory_list.rs │ │ ├── drag_icon.rs │ │ ├── drag_source.rs │ │ ├── drawing_area.rs │ │ ├── drop_controller_motion.rs │ │ ├── drop_down.rs │ │ ├── drop_target.rs │ │ ├── drop_target_async.rs │ │ ├── editable.rs │ │ ├── editable_label.rs │ │ ├── emoji_chooser.rs │ │ ├── entry.rs │ │ ├── entry_buffer.rs │ │ ├── entry_completion.rs │ │ ├── enums.rs │ │ ├── event_controller.rs │ │ ├── event_controller_focus.rs │ │ ├── event_controller_key.rs │ │ ├── event_controller_legacy.rs │ │ ├── event_controller_motion.rs │ │ ├── event_controller_scroll.rs │ │ ├── every_filter.rs │ │ ├── expander.rs │ │ ├── expression.rs │ │ ├── file_chooser.rs │ │ ├── file_chooser_dialog.rs │ │ ├── file_chooser_native.rs │ │ ├── file_chooser_widget.rs │ │ ├── file_dialog.rs │ │ ├── file_filter.rs │ │ ├── file_launcher.rs │ │ ├── filter.rs │ │ ├── filter_list_model.rs │ │ ├── fixed.rs │ │ ├── fixed_layout.rs │ │ ├── fixed_layout_child.rs │ │ ├── flags.rs │ │ ├── flatten_list_model.rs │ │ ├── flow_box.rs │ │ ├── flow_box_child.rs │ │ ├── font_button.rs │ │ ├── font_chooser.rs │ │ ├── font_chooser_dialog.rs │ │ ├── font_chooser_widget.rs │ │ ├── font_dialog.rs │ │ ├── font_dialog_button.rs │ │ ├── frame.rs │ │ ├── functions.rs │ │ ├── gesture.rs │ │ ├── gesture_click.rs │ │ ├── gesture_drag.rs │ │ ├── gesture_long_press.rs │ │ ├── gesture_pan.rs │ │ ├── gesture_rotate.rs │ │ ├── gesture_single.rs │ │ ├── gesture_stylus.rs │ │ ├── gesture_swipe.rs │ │ ├── gesture_zoom.rs │ │ ├── gl_area.rs │ │ ├── graphics_offload.rs │ │ ├── grid.rs │ │ ├── grid_layout.rs │ │ ├── grid_layout_child.rs │ │ ├── grid_view.rs │ │ ├── header_bar.rs │ │ ├── icon_paintable.rs │ │ ├── icon_theme.rs │ │ ├── icon_view.rs │ │ ├── im_context.rs │ │ ├── im_context_simple.rs │ │ ├── im_multicontext.rs │ │ ├── image.rs │ │ ├── info_bar.rs │ │ ├── inscription.rs │ │ ├── label.rs │ │ ├── layout_child.rs │ │ ├── layout_manager.rs │ │ ├── level_bar.rs │ │ ├── link_button.rs │ │ ├── list_base.rs │ │ ├── list_box.rs │ │ ├── list_box_row.rs │ │ ├── list_header.rs │ │ ├── list_item.rs │ │ ├── list_item_factory.rs │ │ ├── list_store.rs │ │ ├── list_view.rs │ │ ├── lock_button.rs │ │ ├── map_list_model.rs │ │ ├── media_controls.rs │ │ ├── media_file.rs │ │ ├── media_stream.rs │ │ ├── menu_button.rs │ │ ├── message_dialog.rs │ │ ├── mnemonic_action.rs │ │ ├── mod.rs │ │ ├── mount_operation.rs │ │ ├── multi_filter.rs │ │ ├── multi_selection.rs │ │ ├── multi_sorter.rs │ │ ├── named_action.rs │ │ ├── native.rs │ │ ├── native_dialog.rs │ │ ├── never_trigger.rs │ │ ├── no_selection.rs │ │ ├── notebook.rs │ │ ├── notebook_page.rs │ │ ├── nothing_action.rs │ │ ├── numeric_sorter.rs │ │ ├── object_expression.rs │ │ ├── orientable.rs │ │ ├── overlay.rs │ │ ├── overlay_layout.rs │ │ ├── overlay_layout_child.rs │ │ ├── pad_controller.rs │ │ ├── page_setup.rs │ │ ├── page_setup_unix_dialog.rs │ │ ├── paned.rs │ │ ├── paper_size.rs │ │ ├── param_spec_expression.rs │ │ ├── password_entry.rs │ │ ├── password_entry_buffer.rs │ │ ├── picture.rs │ │ ├── popover.rs │ │ ├── popover_menu.rs │ │ ├── popover_menu_bar.rs │ │ ├── print_context.rs │ │ ├── print_dialog.rs │ │ ├── print_job.rs │ │ ├── print_operation.rs │ │ ├── print_operation_preview.rs │ │ ├── print_settings.rs │ │ ├── print_setup.rs │ │ ├── print_unix_dialog.rs │ │ ├── printer.rs │ │ ├── progress_bar.rs │ │ ├── property_expression.rs │ │ ├── range.rs │ │ ├── recent_info.rs │ │ ├── recent_manager.rs │ │ ├── requisition.rs │ │ ├── revealer.rs │ │ ├── root.rs │ │ ├── scale.rs │ │ ├── scale_button.rs │ │ ├── scroll_info.rs │ │ ├── scrollable.rs │ │ ├── scrollbar.rs │ │ ├── scrolled_window.rs │ │ ├── search_bar.rs │ │ ├── search_entry.rs │ │ ├── section_model.rs │ │ ├── selection_filter_model.rs │ │ ├── selection_model.rs │ │ ├── separator.rs │ │ ├── settings.rs │ │ ├── shortcut.rs │ │ ├── shortcut_action.rs │ │ ├── shortcut_controller.rs │ │ ├── shortcut_label.rs │ │ ├── shortcut_manager.rs │ │ ├── shortcut_trigger.rs │ │ ├── shortcuts_group.rs │ │ ├── shortcuts_section.rs │ │ ├── shortcuts_shortcut.rs │ │ ├── shortcuts_window.rs │ │ ├── signal_action.rs │ │ ├── signal_list_item_factory.rs │ │ ├── single_selection.rs │ │ ├── size_group.rs │ │ ├── slice_list_model.rs │ │ ├── snapshot.rs │ │ ├── sort_list_model.rs │ │ ├── sorter.rs │ │ ├── spin_button.rs │ │ ├── spinner.rs │ │ ├── stack.rs │ │ ├── stack_page.rs │ │ ├── stack_sidebar.rs │ │ ├── stack_switcher.rs │ │ ├── statusbar.rs │ │ ├── string_filter.rs │ │ ├── string_list.rs │ │ ├── string_object.rs │ │ ├── string_sorter.rs │ │ ├── style_context.rs │ │ ├── style_provider.rs │ │ ├── switch.rs │ │ ├── symbolic_paintable.rs │ │ ├── text.rs │ │ ├── text_buffer.rs │ │ ├── text_child_anchor.rs │ │ ├── text_iter.rs │ │ ├── text_mark.rs │ │ ├── text_tag.rs │ │ ├── text_tag_table.rs │ │ ├── text_view.rs │ │ ├── toggle_button.rs │ │ ├── tooltip.rs │ │ ├── tree_drag_dest.rs │ │ ├── tree_drag_source.rs │ │ ├── tree_expander.rs │ │ ├── tree_iter.rs │ │ ├── tree_list_model.rs │ │ ├── tree_list_row.rs │ │ ├── tree_list_row_sorter.rs │ │ ├── tree_model.rs │ │ ├── tree_model_filter.rs │ │ ├── tree_model_sort.rs │ │ ├── tree_path.rs │ │ ├── tree_row_reference.rs │ │ ├── tree_selection.rs │ │ ├── tree_sortable.rs │ │ ├── tree_store.rs │ │ ├── tree_view.rs │ │ ├── tree_view_column.rs │ │ ├── uri_launcher.rs │ │ ├── versions.txt │ │ ├── video.rs │ │ ├── viewport.rs │ │ ├── volume_button.rs │ │ ├── widget.rs │ │ ├── widget_paintable.rs │ │ ├── window.rs │ │ ├── window_controls.rs │ │ ├── window_group.rs │ │ └── window_handle.rs │ ├── bitset_iter.rs │ ├── bookmark_list.rs │ ├── border.rs │ ├── builder.rs │ ├── builder_cscope.rs │ ├── builder_rust_scope.rs │ ├── builders.rs │ ├── calendar.rs │ ├── callback_action.rs │ ├── cell_area.rs │ ├── cell_layout.rs │ ├── closure_expression.rs │ ├── color_chooser.rs │ ├── combo_box.rs │ ├── constant_expression.rs │ ├── constraint_guide.rs │ ├── constraint_layout.rs │ ├── css_location.rs │ ├── custom_filter.rs │ ├── custom_sorter.rs │ ├── dialog.rs │ ├── directory_list.rs │ ├── drawing_area.rs │ ├── drop_target.rs │ ├── editable.rs │ ├── editable_label.rs │ ├── entry.rs │ ├── entry_buffer.rs │ ├── entry_completion.rs │ ├── enums.rs │ ├── event_controller.rs │ ├── event_controller_key.rs │ ├── expression.rs │ ├── expression_watch.rs │ ├── file_chooser.rs │ ├── file_chooser_dialog.rs │ ├── flow_box.rs │ ├── font_chooser.rs │ ├── font_dialog.rs │ ├── functions.rs │ ├── gesture_stylus.rs │ ├── icon_theme.rs │ ├── im_context_simple.rs │ ├── info_bar.rs │ ├── keyval_trigger.rs │ ├── label.rs │ ├── lib.rs │ ├── list_box.rs │ ├── list_store.rs │ ├── map_list_model.rs │ ├── media_stream.rs │ ├── menu_button.rs │ ├── message_dialog.rs │ ├── mnemonic_trigger.rs │ ├── native_dialog.rs │ ├── notebook.rs │ ├── object_expression.rs │ ├── overlay.rs │ ├── pad_action_entry.rs │ ├── page_range.rs │ ├── param_spec_expression.rs │ ├── prelude.rs │ ├── print_job.rs │ ├── print_operation.rs │ ├── print_settings.rs │ ├── property_expression.rs │ ├── recent_data.rs │ ├── requisition.rs │ ├── response_type.rs │ ├── rt.rs │ ├── scale.rs │ ├── shortcut.rs │ ├── shortcut_trigger.rs │ ├── shortcuts_section.rs │ ├── signal_list_item_factory.rs │ ├── snapshot.rs │ ├── spin_button.rs │ ├── string_list.rs │ ├── string_object.rs │ ├── style_context.rs │ ├── subclass │ │ ├── accessible.rs │ │ ├── accessible_range.rs │ │ ├── accessible_text.rs │ │ ├── actionable.rs │ │ ├── adjustment.rs │ │ ├── application.rs │ │ ├── application_window.rs │ │ ├── box_.rs │ │ ├── buildable.rs │ │ ├── builder_scope.rs │ │ ├── button.rs │ │ ├── cell_area.rs │ │ ├── cell_area_context.rs │ │ ├── cell_editable.rs │ │ ├── cell_layout.rs │ │ ├── cell_renderer.rs │ │ ├── cell_renderer_text.rs │ │ ├── check_button.rs │ │ ├── color_chooser.rs │ │ ├── combo_box.rs │ │ ├── dialog.rs │ │ ├── drawing_area.rs │ │ ├── editable.rs │ │ ├── entry.rs │ │ ├── entry_buffer.rs │ │ ├── filter.rs │ │ ├── fixed.rs │ │ ├── flow_box_child.rs │ │ ├── font_chooser.rs │ │ ├── frame.rs │ │ ├── gl_area.rs │ │ ├── grid.rs │ │ ├── im_context.rs │ │ ├── layout_child.rs │ │ ├── layout_manager.rs │ │ ├── list_box_row.rs │ │ ├── media_file.rs │ │ ├── media_stream.rs │ │ ├── mod.rs │ │ ├── native_dialog.rs │ │ ├── orientable.rs │ │ ├── popover.rs │ │ ├── print_operation.rs │ │ ├── print_operation_preview.rs │ │ ├── range.rs │ │ ├── recent_manager.rs │ │ ├── scale.rs │ │ ├── scale_button.rs │ │ ├── scrollable.rs │ │ ├── section_model.rs │ │ ├── selection_model.rs │ │ ├── shortcut_manager.rs │ │ ├── sorter.rs │ │ ├── style_context.rs │ │ ├── symbolic_paintable.rs │ │ ├── text_buffer.rs │ │ ├── text_view.rs │ │ ├── toggle_button.rs │ │ ├── tree_drag_dest.rs │ │ ├── tree_drag_source.rs │ │ ├── tree_model_filter.rs │ │ ├── tree_view.rs │ │ ├── widget.rs │ │ ├── window.rs │ │ └── window_group.rs │ ├── text.rs │ ├── text_buffer.rs │ ├── tree_model.rs │ ├── tree_model_filter.rs │ ├── tree_path.rs │ ├── tree_row_reference.rs │ ├── tree_selection.rs │ ├── tree_sortable.rs │ ├── tree_store.rs │ ├── tree_view.rs │ ├── tree_view_column.rs │ └── widget.rs ├── sys │ ├── Cargo.toml │ ├── Gir.toml │ ├── LICENSE │ ├── build.rs │ ├── src │ │ └── lib.rs │ ├── tests │ │ ├── abi.rs │ │ ├── constant.c │ │ ├── layout.c │ │ └── manual.h │ └── versions.txt └── tests │ └── check_gir.rs └── rustfmt.toml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @bilelmoussaoui 2 | /book/ @Hofer-Julian 3 | /.github/workflows/book.yml @Hofer-Julian 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | open_collective: gtk-rs 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/asking-for-help.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Asking for help 3 | about: You have a question on how to use one of gtk4-rs crates 4 | title: "[HELP]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | If you need help to use the libraries and not the Rust API specifically, better go to instead. 11 | 12 | In case you need help with the Rust API, please provide as much information as possible and a sample of code as small as possible which reproduces your issue so we can help you better. 13 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/blank-issue.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Blank issue 3 | about: None of the above templates match your issue 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Bug description** 11 | 12 | Please provide a code sample as small as possible which reproduces the bug. 13 | 14 | **Backtrace** 15 | 16 | You can get the backtrace running your program with the environment variable `RUST_BACKTRACE=full`. 17 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request-or-missing-binding.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request or missing binding 3 | about: A missing binding or something that could be improved 4 | title: "" 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 2 | version: 2 3 | updates: 4 | - package-ecosystem: "github-actions" 5 | directory: "/" 6 | schedule: 7 | interval: "weekly" 8 | - package-ecosystem: "cargo" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /.github/workflows/book-lint.yml: -------------------------------------------------------------------------------- 1 | name: book 2 | 3 | on: 4 | pull_request: 5 | paths: 6 | - "book/**" 7 | 8 | jobs: 9 | check: 10 | runs-on: ubuntu-latest 11 | name: build 12 | steps: 13 | - uses: actions/checkout@v4 14 | - uses: actions-rs/toolchain@v1 15 | with: 16 | profile: minimal 17 | toolchain: stable 18 | override: true 19 | 20 | - name: Setup mdBook 21 | uses: peaceiris/actions-mdbook@v2 22 | 23 | - run: mdbook build -d public 24 | working-directory: book 25 | 26 | - name: Link Checker 27 | uses: lycheeverse/lychee-action@v2.4.1 28 | with: 29 | args: book/public 30 | fail: true 31 | -------------------------------------------------------------------------------- /.github/workflows/typos.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: 3 | pull_request: 4 | push: 5 | branches: 6 | - "main" 7 | jobs: 8 | typos: 9 | name: Spell Check with Typos 10 | runs-on: ubuntu-latest 11 | steps: 12 | - name: Checkout Actions Repository 13 | uses: actions/checkout@v4 14 | - name: Check spelling 15 | uses: crate-ci/typos@master 16 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | test/bin/ 2 | target/ 3 | doc/ 4 | configure.in 5 | config.log 6 | config.status 7 | *.dylib 8 | .rust 9 | *.so 10 | *.o 11 | *.swp 12 | book/book 13 | .vscode 14 | *.log 15 | **/**/docs.md 16 | **~ 17 | .idea 18 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "gir"] 2 | path = gir 3 | url = https://github.com/gtk-rs/gir 4 | update = none 5 | [submodule "gir-files"] 6 | path = gir-files 7 | url = https://github.com/gtk-rs/gir-files 8 | update = none 9 | -------------------------------------------------------------------------------- /.typos.toml: -------------------------------------------------------------------------------- 1 | [files] 2 | extend-exclude = [ 3 | "auto", 4 | "gdk4/src/keys.rs", 5 | "gdk4/sys/src/lib.rs", 6 | "gdk4/sys/tests/abi.rs", 7 | "gdk4/sys/tests/constant.c", 8 | "**/**/versions.txt", 9 | "*.svg", 10 | ] 11 | 12 | [default.extend-words] 13 | # Ignore false-positives 14 | gir = "gir" 15 | mak = "mak" 16 | anid = "anid" 17 | lamda = "lamda" 18 | inout = "inout" 19 | relm = "relm" 20 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | The gtk-rs Project is licensed under the MIT license, see the LICENSE file or 2 | . 3 | 4 | Copyrights in the gtk-rs Project project are retained by their contributors. 5 | No copyright assignment is required to contribute to the gtk-rs Project 6 | project. 7 | 8 | For full authorship information, see the version control history. 9 | 10 | This project provides interoperability with various GNOME libraries but 11 | doesn't distribute any parts of them. Distributing compiled libraries and 12 | executables that link to those libraries may be subject to terms of the GNU 13 | LGPL or other licenses. For more information check the license of each GNOME 14 | library. 15 | -------------------------------------------------------------------------------- /book/.gitignore: -------------------------------------------------------------------------------- 1 | book/ 2 | listings/target 3 | -------------------------------------------------------------------------------- /book/book.toml: -------------------------------------------------------------------------------- 1 | [book] 2 | authors = ["Julian Hofer"] 3 | language = "en" 4 | multilingual = false 5 | src = "src" 6 | title = "GUI development with Rust and GTK 4" 7 | 8 | 9 | [output.html] 10 | default-theme = "Rust" 11 | git-repository-url = "https://github.com/gtk-rs/gtk4-rs/tree/main/book" 12 | git-repository-icon = "fa-github" 13 | additional-css = ["theme/style.css"] 14 | playground.runnable = false 15 | -------------------------------------------------------------------------------- /book/listings/.cargo/config.toml: -------------------------------------------------------------------------------- 1 | [alias] 2 | xtask = "run --bin xtask" 3 | -------------------------------------------------------------------------------- /book/listings/.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | -------------------------------------------------------------------------------- /book/listings/README.md: -------------------------------------------------------------------------------- 1 | # Listings 2 | 3 | Here you can find the listings used by the code snippets of the book. 4 | 5 | In order to run the listings change the current working directory to this folder and then execute the following in order to install application data. 6 | 7 | ``` 8 | cargo xtask install 9 | ``` 10 | 11 | Then execute the following to run one of the listings. 12 | 13 | ``` 14 | cargo run --bin [example_name]_[number] 15 | ``` 16 | 17 | For example, if you want to run the listing in subfolder "hello_world/3", execute: 18 | 19 | ``` 20 | cargo run --bin hello_world_3 21 | ``` 22 | -------------------------------------------------------------------------------- /book/listings/actions/5/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/actions/6/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/actions/7/org.gtk_rs.Actions7.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | Whether the button has a frame 7 | 8 | 9 | 10 | 11 | 12 | 13 | 'Vertical' 14 | Orientation of GtkBox 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /book/listings/actions/7/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/composite_templates/1/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/composite_templates/1/resources/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | -------------------------------------------------------------------------------- /book/listings/composite_templates/1/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/composite_templates/2/custom_button/imp.rs: -------------------------------------------------------------------------------- 1 | use gtk::glib; 2 | use gtk::subclass::prelude::*; 3 | 4 | // ANCHOR: imp 5 | // Object holding the state 6 | #[derive(Default)] 7 | pub struct CustomButton; 8 | 9 | // The central trait for subclassing a GObject 10 | #[glib::object_subclass] 11 | impl ObjectSubclass for CustomButton { 12 | const NAME: &'static str = "MyGtkAppCustomButton"; 13 | type Type = super::CustomButton; 14 | type ParentType = gtk::Button; 15 | } 16 | // ANCHOR_END: imp 17 | 18 | // Trait shared by all GObjects 19 | impl ObjectImpl for CustomButton {} 20 | 21 | // Trait shared by all widgets 22 | impl WidgetImpl for CustomButton {} 23 | 24 | // Trait shared by all buttons 25 | impl ButtonImpl for CustomButton {} 26 | -------------------------------------------------------------------------------- /book/listings/composite_templates/2/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | use glib::Object; 2 | use gtk::glib; 3 | 4 | // ANCHOR: mod 5 | mod imp; 6 | 7 | glib::wrapper! { 8 | pub struct CustomButton(ObjectSubclass) 9 | @extends gtk::Button, gtk::Widget, 10 | @implements gtk::Accessible, gtk::Actionable, 11 | gtk::Buildable, gtk::ConstraintTarget; 12 | } 13 | // ANCHOR_END: mod 14 | 15 | impl CustomButton { 16 | pub fn new() -> Self { 17 | Object::builder().build() 18 | } 19 | } 20 | 21 | impl Default for CustomButton { 22 | fn default() -> Self { 23 | Self::new() 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /book/listings/composite_templates/2/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/composite_templates/2/resources/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | -------------------------------------------------------------------------------- /book/listings/composite_templates/2/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/composite_templates/3/custom_button/imp.rs: -------------------------------------------------------------------------------- 1 | use gtk::glib; 2 | use gtk::subclass::prelude::*; 3 | 4 | // Object holding the state 5 | #[derive(Default)] 6 | pub struct CustomButton; 7 | 8 | // The central trait for subclassing a GObject 9 | #[glib::object_subclass] 10 | impl ObjectSubclass for CustomButton { 11 | const NAME: &'static str = "MyGtkAppCustomButton"; 12 | type Type = super::CustomButton; 13 | type ParentType = gtk::Button; 14 | } 15 | 16 | // Trait shared by all GObjects 17 | impl ObjectImpl for CustomButton {} 18 | 19 | // Trait shared by all widgets 20 | impl WidgetImpl for CustomButton {} 21 | 22 | // Trait shared by all buttons 23 | impl ButtonImpl for CustomButton {} 24 | -------------------------------------------------------------------------------- /book/listings/composite_templates/3/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct CustomButton(ObjectSubclass) 8 | @extends gtk::Button, gtk::Widget, 9 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 10 | } 11 | 12 | impl CustomButton { 13 | pub fn new() -> Self { 14 | Object::builder().build() 15 | } 16 | } 17 | 18 | impl Default for CustomButton { 19 | fn default() -> Self { 20 | Self::new() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /book/listings/composite_templates/3/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/composite_templates/3/resources/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /book/listings/composite_templates/3/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/composite_templates/4/custom_button/imp.rs: -------------------------------------------------------------------------------- 1 | use gtk::glib; 2 | use gtk::subclass::prelude::*; 3 | 4 | // Object holding the state 5 | #[derive(Default)] 6 | pub struct CustomButton; 7 | 8 | // The central trait for subclassing a GObject 9 | #[glib::object_subclass] 10 | impl ObjectSubclass for CustomButton { 11 | const NAME: &'static str = "MyGtkAppCustomButton"; 12 | type Type = super::CustomButton; 13 | type ParentType = gtk::Button; 14 | } 15 | 16 | // Trait shared by all GObjects 17 | impl ObjectImpl for CustomButton {} 18 | 19 | // Trait shared by all widgets 20 | impl WidgetImpl for CustomButton {} 21 | 22 | // Trait shared by all buttons 23 | impl ButtonImpl for CustomButton {} 24 | -------------------------------------------------------------------------------- /book/listings/composite_templates/4/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct CustomButton(ObjectSubclass) 8 | @extends gtk::Button, gtk::Widget, 9 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 10 | } 11 | 12 | impl CustomButton { 13 | pub fn new() -> Self { 14 | Object::builder().build() 15 | } 16 | } 17 | 18 | impl Default for CustomButton { 19 | fn default() -> Self { 20 | Self::new() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /book/listings/composite_templates/4/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/composite_templates/4/resources/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /book/listings/composite_templates/4/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/composite_templates/5/custom_button/imp.rs: -------------------------------------------------------------------------------- 1 | use gtk::glib; 2 | use gtk::subclass::prelude::*; 3 | 4 | // Object holding the state 5 | #[derive(Default)] 6 | pub struct CustomButton; 7 | 8 | // The central trait for subclassing a GObject 9 | #[glib::object_subclass] 10 | impl ObjectSubclass for CustomButton { 11 | const NAME: &'static str = "MyGtkAppCustomButton"; 12 | type Type = super::CustomButton; 13 | type ParentType = gtk::Button; 14 | } 15 | 16 | // Trait shared by all GObjects 17 | impl ObjectImpl for CustomButton {} 18 | 19 | // Trait shared by all widgets 20 | impl WidgetImpl for CustomButton {} 21 | 22 | // Trait shared by all buttons 23 | impl ButtonImpl for CustomButton {} 24 | -------------------------------------------------------------------------------- /book/listings/composite_templates/5/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct CustomButton(ObjectSubclass) 8 | @extends gtk::Button, gtk::Widget, 9 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 10 | } 11 | 12 | impl CustomButton { 13 | pub fn new() -> Self { 14 | Object::builder().build() 15 | } 16 | } 17 | 18 | impl Default for CustomButton { 19 | fn default() -> Self { 20 | Self::new() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /book/listings/composite_templates/5/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/composite_templates/5/resources/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /book/listings/composite_templates/5/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/composite_templates/6/custom_button/imp.rs: -------------------------------------------------------------------------------- 1 | use gtk::glib; 2 | use gtk::subclass::prelude::*; 3 | 4 | // Object holding the state 5 | #[derive(Default)] 6 | pub struct CustomButton; 7 | 8 | // The central trait for subclassing a GObject 9 | #[glib::object_subclass] 10 | impl ObjectSubclass for CustomButton { 11 | const NAME: &'static str = "MyGtkAppCustomButton"; 12 | type Type = super::CustomButton; 13 | type ParentType = gtk::Button; 14 | } 15 | 16 | // Trait shared by all GObjects 17 | impl ObjectImpl for CustomButton {} 18 | 19 | // Trait shared by all widgets 20 | impl WidgetImpl for CustomButton {} 21 | 22 | // Trait shared by all buttons 23 | impl ButtonImpl for CustomButton {} 24 | -------------------------------------------------------------------------------- /book/listings/composite_templates/6/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct CustomButton(ObjectSubclass) 8 | @extends gtk::Button, gtk::Widget, 9 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 10 | } 11 | 12 | impl CustomButton { 13 | pub fn new() -> Self { 14 | Object::builder().build() 15 | } 16 | } 17 | 18 | impl Default for CustomButton { 19 | fn default() -> Self { 20 | Self::new() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /book/listings/composite_templates/6/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | window.ui 5 | 6 | 7 | -------------------------------------------------------------------------------- /book/listings/composite_templates/6/resources/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /book/listings/composite_templates/6/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/css/1/style.css: -------------------------------------------------------------------------------- 1 | button { 2 | color: magenta; 3 | } 4 | -------------------------------------------------------------------------------- /book/listings/css/2/style.css: -------------------------------------------------------------------------------- 1 | button.text-button { 2 | color: magenta; 3 | } 4 | -------------------------------------------------------------------------------- /book/listings/css/3/style.css: -------------------------------------------------------------------------------- 1 | button.button-1 { 2 | color: magenta; 3 | } 4 | -------------------------------------------------------------------------------- /book/listings/css/4/style.css: -------------------------------------------------------------------------------- 1 | button#button-1 { 2 | color: magenta; 3 | } 4 | -------------------------------------------------------------------------------- /book/listings/css/6/main.rs: -------------------------------------------------------------------------------- 1 | mod window; 2 | 3 | use gtk::prelude::*; 4 | use gtk::{glib, Application}; 5 | 6 | use crate::window::Window; 7 | 8 | const APP_ID: &str = "org.gtk_rs.Css6"; 9 | 10 | fn main() -> glib::ExitCode { 11 | // Create a new application 12 | let app = Application::builder().application_id(APP_ID).build(); 13 | 14 | // Connect to signals 15 | app.connect_activate(build_ui); 16 | 17 | // Run the application 18 | app.run() 19 | } 20 | 21 | fn build_ui(app: &Application) { 22 | // Create a new window and present it 23 | let window = Window::new(app); 24 | window.present(); 25 | } 26 | -------------------------------------------------------------------------------- /book/listings/css/6/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/css/7/style.css: -------------------------------------------------------------------------------- 1 | button#button-1:hover { 2 | color: magenta; 3 | background: yellow; 4 | } 5 | -------------------------------------------------------------------------------- /book/listings/css/7/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/css/7/window/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /book/listings/css/8/style.css: -------------------------------------------------------------------------------- 1 | menubutton arrow { 2 | color: magenta; 3 | } 4 | -------------------------------------------------------------------------------- /book/listings/css/8/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/css/8/window/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/css/9/style.css: -------------------------------------------------------------------------------- 1 | menubutton arrow { 2 | color: magenta; 3 | -gtk-icon-source: -gtk-icontheme('format-justify-fill-symbolic'); 4 | } 5 | -------------------------------------------------------------------------------- /book/listings/css/9/window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::{gio, glib, Application}; 5 | 6 | glib::wrapper! { 7 | pub struct Window(ObjectSubclass) 8 | @extends gtk::ApplicationWindow, gtk::Window, gtk::Widget, 9 | @implements gio::ActionGroup, gio::ActionMap, gtk::Accessible, gtk::Buildable, 10 | gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager; 11 | } 12 | 13 | impl Window { 14 | pub fn new(app: &Application) -> Self { 15 | // Create new window 16 | Object::builder().property("application", app).build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/css/9/window/window.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/g_object_properties/3/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct CustomButton(ObjectSubclass) 8 | @extends gtk::Button, gtk::Widget, 9 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 10 | } 11 | 12 | impl CustomButton { 13 | pub fn new() -> Self { 14 | Object::builder().build() 15 | } 16 | } 17 | 18 | impl Default for CustomButton { 19 | fn default() -> Self { 20 | Self::new() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /book/listings/g_object_signals/2/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct CustomButton(ObjectSubclass) 8 | @extends gtk::Button, gtk::Widget, 9 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 10 | } 11 | 12 | impl CustomButton { 13 | pub fn new() -> Self { 14 | Object::builder().build() 15 | } 16 | } 17 | 18 | impl Default for CustomButton { 19 | fn default() -> Self { 20 | Self::new() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /book/listings/g_object_subclassing/1/custom_button/imp.rs: -------------------------------------------------------------------------------- 1 | use gtk::glib; 2 | use gtk::subclass::prelude::*; 3 | 4 | // Object holding the state 5 | #[derive(Default)] 6 | pub struct CustomButton; 7 | 8 | // The central trait for subclassing a GObject 9 | #[glib::object_subclass] 10 | impl ObjectSubclass for CustomButton { 11 | const NAME: &'static str = "MyGtkAppCustomButton"; 12 | type Type = super::CustomButton; 13 | type ParentType = gtk::Button; 14 | } 15 | 16 | // Trait shared by all GObjects 17 | impl ObjectImpl for CustomButton {} 18 | 19 | // Trait shared by all widgets 20 | impl WidgetImpl for CustomButton {} 21 | 22 | // Trait shared by all buttons 23 | impl ButtonImpl for CustomButton {} 24 | -------------------------------------------------------------------------------- /book/listings/g_object_subclassing/1/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | // ANCHOR: mod 2 | mod imp; 3 | 4 | use glib::Object; 5 | use gtk::glib; 6 | 7 | glib::wrapper! { 8 | pub struct CustomButton(ObjectSubclass) 9 | @extends gtk::Button, gtk::Widget, 10 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 11 | } 12 | 13 | impl CustomButton { 14 | pub fn new() -> Self { 15 | Object::builder().build() 16 | } 17 | 18 | pub fn with_label(label: &str) -> Self { 19 | Object::builder().property("label", label).build() 20 | } 21 | } 22 | // ANCHOR_END: mod 23 | 24 | impl Default for CustomButton { 25 | fn default() -> Self { 26 | Self::new() 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /book/listings/g_object_subclassing/2/custom_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct CustomButton(ObjectSubclass) 8 | @extends gtk::Button, gtk::Widget, 9 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 10 | } 11 | 12 | impl CustomButton { 13 | pub fn new() -> Self { 14 | Object::builder().build() 15 | } 16 | } 17 | 18 | impl Default for CustomButton { 19 | fn default() -> Self { 20 | Self::new() 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /book/listings/hello_world/1/main.rs: -------------------------------------------------------------------------------- 1 | use gtk::prelude::*; 2 | use gtk::{glib, Application}; 3 | 4 | const APP_ID: &str = "org.gtk_rs.HelloWorld1"; 5 | 6 | fn main() -> glib::ExitCode { 7 | // Create a new application 8 | let app = Application::builder().application_id(APP_ID).build(); 9 | 10 | // Run the application 11 | app.run() 12 | } 13 | -------------------------------------------------------------------------------- /book/listings/hello_world/2/main.rs: -------------------------------------------------------------------------------- 1 | use gtk::prelude::*; 2 | use gtk::{glib, Application, ApplicationWindow}; 3 | 4 | const APP_ID: &str = "org.gtk_rs.HelloWorld2"; 5 | 6 | fn main() -> glib::ExitCode { 7 | // Create a new application 8 | let app = Application::builder().application_id(APP_ID).build(); 9 | 10 | // Connect to "activate" signal of `app` 11 | app.connect_activate(build_ui); 12 | 13 | // Run the application 14 | app.run() 15 | } 16 | 17 | fn build_ui(app: &Application) { 18 | // Create a window and set the title 19 | let window = ApplicationWindow::builder() 20 | .application(app) 21 | .title("My GTK App") 22 | .build(); 23 | 24 | // Present window 25 | window.present(); 26 | } 27 | -------------------------------------------------------------------------------- /book/listings/list_widgets/2/integer_object/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | // ANCHOR: integer_object 7 | glib::wrapper! { 8 | pub struct IntegerObject(ObjectSubclass); 9 | } 10 | 11 | impl IntegerObject { 12 | pub fn new(number: i32) -> Self { 13 | Object::builder().property("number", number).build() 14 | } 15 | } 16 | // ANCHOR_END: integer_object 17 | -------------------------------------------------------------------------------- /book/listings/list_widgets/3/integer_object/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct IntegerObject(ObjectSubclass); 8 | } 9 | 10 | // ANCHOR: integer_object 11 | impl IntegerObject { 12 | pub fn new(number: i32) -> Self { 13 | Object::builder().property("number", number).build() 14 | } 15 | 16 | pub fn increase_number(self) { 17 | self.set_number(self.number() + 1); 18 | } 19 | } 20 | // ANCHOR_END: integer_object 21 | -------------------------------------------------------------------------------- /book/listings/list_widgets/4/integer_object/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct IntegerObject(ObjectSubclass); 8 | } 9 | 10 | impl IntegerObject { 11 | pub fn new(number: i32) -> Self { 12 | Object::builder().property("number", number).build() 13 | } 14 | 15 | pub fn increase_number(self) { 16 | self.set_number(self.number() + 1); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/list_widgets/5/integer_object/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | glib::wrapper! { 7 | pub struct IntegerObject(ObjectSubclass); 8 | } 9 | 10 | impl IntegerObject { 11 | pub fn new(number: i32) -> Self { 12 | Object::builder().property("number", number).build() 13 | } 14 | 15 | pub fn increase_number(self) { 16 | self.set_number(self.number() + 1); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /book/listings/rustfmt.toml: -------------------------------------------------------------------------------- 1 | max_width = 88 2 | -------------------------------------------------------------------------------- /book/listings/saving_window_state/1/org.gtk_rs.SavingWindowState1.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -1 6 | Default window width 7 | 8 | 9 | -1 10 | Default window height 11 | 12 | 13 | false 14 | Default window maximized behaviour 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /book/listings/settings/1/org.gtk_rs.Settings1.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | Default switch state 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /book/listings/settings/2/org.gtk_rs.Settings2.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | false 6 | Default switch state 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /book/listings/todo/1/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | task_row.ui 5 | window.ui 6 | 7 | 8 | -------------------------------------------------------------------------------- /book/listings/todo/1/task_object/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use glib::Object; 4 | use gtk::glib; 5 | 6 | // ANCHOR: glib_wrapper_and_new 7 | glib::wrapper! { 8 | pub struct TaskObject(ObjectSubclass); 9 | } 10 | 11 | impl TaskObject { 12 | pub fn new(completed: bool, content: String) -> Self { 13 | Object::builder() 14 | .property("completed", completed) 15 | .property("content", content) 16 | .build() 17 | } 18 | } 19 | // ANCHOR_END: glib_wrapper_and_new 20 | 21 | // ANCHOR: task_data 22 | #[derive(Default)] 23 | pub struct TaskData { 24 | pub completed: bool, 25 | pub content: String, 26 | } 27 | // ANCHOR: task_data 28 | -------------------------------------------------------------------------------- /book/listings/todo/2/org.gtk_rs.Todo2.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'All' 11 | Filter of the tasks 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/todo/2/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shortcuts.ui 5 | task_row.ui 6 | window.ui 7 | 8 | 9 | -------------------------------------------------------------------------------- /book/listings/todo/2/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use gtk::glib; 4 | 5 | use crate::APP_ID; 6 | 7 | // ANCHOR: data_path 8 | pub fn data_path() -> PathBuf { 9 | let mut path = glib::user_data_dir(); 10 | path.push(APP_ID); 11 | std::fs::create_dir_all(&path).expect("Could not create directory."); 12 | path.push("data.json"); 13 | path 14 | } 15 | // ANCHOR_END: data_path 16 | -------------------------------------------------------------------------------- /book/listings/todo/3/org.gtk_rs.Todo3.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'All' 11 | Filter of the tasks 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/todo/3/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shortcuts.ui 5 | task_row.ui 6 | window.ui 7 | style.css 8 | 9 | 10 | -------------------------------------------------------------------------------- /book/listings/todo/3/resources/style.css: -------------------------------------------------------------------------------- 1 | task-row { 2 | background-color: @success_color; 3 | } 4 | -------------------------------------------------------------------------------- /book/listings/todo/3/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use gtk::glib; 4 | 5 | use crate::APP_ID; 6 | 7 | // ANCHOR: data_path 8 | pub fn data_path() -> PathBuf { 9 | let mut path = glib::user_data_dir(); 10 | path.push(APP_ID); 11 | std::fs::create_dir_all(&path).expect("Could not create directory."); 12 | path.push("data.json"); 13 | path 14 | } 15 | // ANCHOR_END: data_path 16 | -------------------------------------------------------------------------------- /book/listings/todo/4/org.gtk_rs.Todo4.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'All' 11 | Filter of the tasks 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/todo/4/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shortcuts.ui 5 | task_row.ui 6 | window.ui 7 | 8 | 9 | -------------------------------------------------------------------------------- /book/listings/todo/4/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use gtk::glib; 4 | 5 | use crate::APP_ID; 6 | 7 | // ANCHOR: data_path 8 | pub fn data_path() -> PathBuf { 9 | let mut path = glib::user_data_dir(); 10 | path.push(APP_ID); 11 | std::fs::create_dir_all(&path).expect("Could not create directory."); 12 | path.push("data.json"); 13 | path 14 | } 15 | // ANCHOR_END: data_path 16 | -------------------------------------------------------------------------------- /book/listings/todo/5/org.gtk_rs.Todo5.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'All' 11 | Filter of the tasks 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/todo/5/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shortcuts.ui 5 | task_row.ui 6 | window.ui 7 | 8 | 9 | -------------------------------------------------------------------------------- /book/listings/todo/5/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use gtk::glib; 4 | 5 | use crate::APP_ID; 6 | 7 | // ANCHOR: data_path 8 | pub fn data_path() -> PathBuf { 9 | let mut path = glib::user_data_dir(); 10 | path.push(APP_ID); 11 | std::fs::create_dir_all(&path).expect("Could not create directory."); 12 | path.push("data.json"); 13 | path 14 | } 15 | // ANCHOR_END: data_path 16 | -------------------------------------------------------------------------------- /book/listings/todo/6/org.gtk_rs.Todo6.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'All' 11 | Filter of the tasks 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/todo/6/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shortcuts.ui 5 | window.ui 6 | 7 | 8 | -------------------------------------------------------------------------------- /book/listings/todo/6/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use gtk::glib; 4 | 5 | use crate::APP_ID; 6 | 7 | // ANCHOR: data_path 8 | pub fn data_path() -> PathBuf { 9 | let mut path = glib::user_data_dir(); 10 | path.push(APP_ID); 11 | std::fs::create_dir_all(&path).expect("Could not create directory."); 12 | path.push("data.json"); 13 | path 14 | } 15 | // ANCHOR_END: data_path 16 | -------------------------------------------------------------------------------- /book/listings/todo/7/org.gtk_rs.Todo7.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'All' 11 | Filter of the tasks 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/todo/7/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shortcuts.ui 5 | window.ui 6 | 7 | 8 | -------------------------------------------------------------------------------- /book/listings/todo/7/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use gtk::glib; 4 | 5 | use crate::APP_ID; 6 | 7 | // ANCHOR: data_path 8 | pub fn data_path() -> PathBuf { 9 | let mut path = glib::user_data_dir(); 10 | path.push(APP_ID); 11 | std::fs::create_dir_all(&path).expect("Could not create directory."); 12 | path.push("data.json"); 13 | path 14 | } 15 | // ANCHOR_END: data_path 16 | -------------------------------------------------------------------------------- /book/listings/todo/8/org.gtk_rs.Todo8.gschema.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 'All' 11 | Filter of the tasks 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /book/listings/todo/8/resources/resources.gresource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | shortcuts.ui 5 | window.ui 6 | 7 | 8 | -------------------------------------------------------------------------------- /book/listings/todo/8/utils.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | 3 | use gtk::glib; 4 | 5 | use crate::APP_ID; 6 | 7 | // ANCHOR: data_path 8 | pub fn data_path() -> PathBuf { 9 | let mut path = glib::user_data_dir(); 10 | path.push(APP_ID); 11 | std::fs::create_dir_all(&path).expect("Could not create directory."); 12 | path.push("data.json"); 13 | path 14 | } 15 | // ANCHOR_END: data_path 16 | -------------------------------------------------------------------------------- /book/src/g_object_concepts.md: -------------------------------------------------------------------------------- 1 | # GObject Concepts 2 | 3 | GTK is an object-oriented framework. 4 | It is written in C, which does not support object-orientation out of the box. 5 | That is why GTK relies on the GObject library to provide the object system. 6 | 7 | We have already learned that `gtk-rs` maps GObject concepts, like inheritance and interfaces, to Rust traits. 8 | In this chapter we will learn: 9 | - How memory of GObjects is managed 10 | - How to create our own GObjects via subclassing 11 | - How to deal with generic values 12 | - How to use properties 13 | - How to emit and receive signals 14 | -------------------------------------------------------------------------------- /book/src/img/css_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_1.png -------------------------------------------------------------------------------- /book/src/img/css_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_2.png -------------------------------------------------------------------------------- /book/src/img/css_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_3.png -------------------------------------------------------------------------------- /book/src/img/css_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_4.png -------------------------------------------------------------------------------- /book/src/img/css_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_5.png -------------------------------------------------------------------------------- /book/src/img/css_7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_7.png -------------------------------------------------------------------------------- /book/src/img/css_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_8.png -------------------------------------------------------------------------------- /book/src/img/css_9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/css_9.png -------------------------------------------------------------------------------- /book/src/img/hello_world_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/hello_world_empty.png -------------------------------------------------------------------------------- /book/src/img/lists_list_box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/lists_list_box.png -------------------------------------------------------------------------------- /book/src/img/lists_list_view_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/lists_list_view_1.png -------------------------------------------------------------------------------- /book/src/img/lists_list_view_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/lists_list_view_2.png -------------------------------------------------------------------------------- /book/src/img/main_event_loop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/main_event_loop.png -------------------------------------------------------------------------------- /book/src/img/main_event_loop_ashpd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/main_event_loop_ashpd.png -------------------------------------------------------------------------------- /book/src/img/scalable_lists_concept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/scalable_lists_concept.png -------------------------------------------------------------------------------- /book/src/img/task_row.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/task_row.png -------------------------------------------------------------------------------- /book/src/img/todo_1_empty.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_1_empty.png -------------------------------------------------------------------------------- /book/src/img/todo_1_mockup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_1_mockup.png -------------------------------------------------------------------------------- /book/src/img/todo_2_shortcuts.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_2_shortcuts.png -------------------------------------------------------------------------------- /book/src/img/todo_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_3.png -------------------------------------------------------------------------------- /book/src/img/todo_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_4.png -------------------------------------------------------------------------------- /book/src/img/todo_6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_6.png -------------------------------------------------------------------------------- /book/src/img/todo_7_sidebar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_7_sidebar.png -------------------------------------------------------------------------------- /book/src/img/todo_8_placeholder_page.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_8_placeholder_page.png -------------------------------------------------------------------------------- /book/src/img/todo_change_4_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/todo_change_4_5.png -------------------------------------------------------------------------------- /book/src/img/vs-install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/vs-install.png -------------------------------------------------------------------------------- /book/src/img/widgets_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/img/widgets_button.png -------------------------------------------------------------------------------- /book/src/installation.md: -------------------------------------------------------------------------------- 1 | # Installation 2 | 3 | In order to develop a `gtk-rs` app, you basically need two things on your workstation: 4 | 5 | - the Rust toolchain, and 6 | - the GTK 4 library. 7 | 8 | As so often the devil hides in the details, which is why we will list the installation instructions for each operating system in the following chapters. 9 | -------------------------------------------------------------------------------- /book/src/installation_linux.md: -------------------------------------------------------------------------------- 1 | # Linux 2 | 3 | You first have to install rustup. 4 | You can find the up-to-date instructions on [rustup.rs](https://rustup.rs). 5 | 6 | Then install GTK 4 and the build essentials. 7 | To do this, execute the command belonging to the distribution you are using. 8 | 9 | Fedora and derivatives: 10 | 11 | ``` 12 | sudo dnf install gtk4-devel gcc 13 | ``` 14 | 15 | Debian and derivatives: 16 | 17 | ``` 18 | sudo apt install libgtk-4-dev build-essential 19 | ``` 20 | 21 | Arch and derivatives: 22 | 23 | ``` 24 | sudo pacman -S gtk4 base-devel 25 | ``` 26 | -------------------------------------------------------------------------------- /book/src/installation_macos.md: -------------------------------------------------------------------------------- 1 | # macOS 2 | 3 | First install rustup. 4 | You can find the up-to-date instructions on [rustup.rs](https://rustup.rs). 5 | 6 | Then install [homebrew](https://brew.sh/). 7 | 8 | Finally, install GTK 4 by executing the following in your terminal: 9 | 10 | ```bash 11 | brew install gtk4 12 | ``` 13 | -------------------------------------------------------------------------------- /book/src/vid/actions_counter.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/actions_counter.webm -------------------------------------------------------------------------------- /book/src/vid/actions_menu.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/actions_menu.webm -------------------------------------------------------------------------------- /book/src/vid/css_6.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/css_6.webm -------------------------------------------------------------------------------- /book/src/vid/g_object_properties_buttons.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/g_object_properties_buttons.webm -------------------------------------------------------------------------------- /book/src/vid/g_object_properties_switches.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/g_object_properties_switches.webm -------------------------------------------------------------------------------- /book/src/vid/g_object_subclassing.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/g_object_subclassing.webm -------------------------------------------------------------------------------- /book/src/vid/hello_world_button.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/hello_world_button.webm -------------------------------------------------------------------------------- /book/src/vid/main_event_loop_1.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/main_event_loop_1.webm -------------------------------------------------------------------------------- /book/src/vid/main_event_loop_2.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/main_event_loop_2.webm -------------------------------------------------------------------------------- /book/src/vid/main_event_loop_3.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/main_event_loop_3.webm -------------------------------------------------------------------------------- /book/src/vid/settings_1.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/settings_1.webm -------------------------------------------------------------------------------- /book/src/vid/todo_1_animation.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/todo_1_animation.webm -------------------------------------------------------------------------------- /book/src/vid/todo_2_animation.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/todo_2_animation.webm -------------------------------------------------------------------------------- /book/src/vid/todo_7_navigation_sidebar.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/todo_7_navigation_sidebar.webm -------------------------------------------------------------------------------- /book/src/vid/todo_8_adaptive_sidebar.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/todo_8_adaptive_sidebar.webm -------------------------------------------------------------------------------- /book/src/vid/todo_8_dialog.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/todo_8_dialog.webm -------------------------------------------------------------------------------- /book/src/vid/todo_dark.webm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/book/src/vid/todo_dark.webm -------------------------------------------------------------------------------- /book/theme/style.css: -------------------------------------------------------------------------------- 1 | a.file-link { 2 | color: inherit !important; 3 | } 4 | -------------------------------------------------------------------------------- /examples/about_dialog/README.md: -------------------------------------------------------------------------------- 1 | # Basics 2 | 3 | This example demonstrates the usage of `AboutDialog`. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/about_dialog/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/about_dialog/screenshot.png -------------------------------------------------------------------------------- /examples/accessible_text/README.md: -------------------------------------------------------------------------------- 1 | # Implementing the Accessible Text Interface 2 | 3 | This example creates a custom text editing widget that implements the Accessible Text Interface. This interface is used for providing screen reader accessibility to custom widgets. 4 | 5 | To test this implementation, enable the screen reader (Orca is enabled via Super+Alt+S) and edit / navigate the text. 6 | 7 | The widget mostly just delegates its implementation to the parent `TextView`. 8 | -------------------------------------------------------------------------------- /examples/accessible_text/main.rs: -------------------------------------------------------------------------------- 1 | mod text_view; 2 | 3 | use gtk::{glib, prelude::*}; 4 | use text_view::AccessibleTextView; 5 | 6 | fn main() -> glib::ExitCode { 7 | let application = gtk::Application::builder() 8 | .application_id("com.github.gtk-rs.examples.accessible_text") 9 | .build(); 10 | application.connect_activate(build_ui); 11 | application.run() 12 | } 13 | 14 | fn build_ui(application: >k::Application) { 15 | let window = gtk::ApplicationWindow::new(application); 16 | 17 | window.set_title(Some("Accessible Text Example")); 18 | window.set_default_size(260, 140); 19 | 20 | let text_view = glib::Object::new::(); 21 | window.set_child(Some(&text_view)); 22 | 23 | window.present(); 24 | } 25 | -------------------------------------------------------------------------------- /examples/basics/README.md: -------------------------------------------------------------------------------- 1 | # Basics 2 | 3 | This example demonstrates how to create a top-level `window`, set its title, size and 4 | position, how to add a `button` to this `window` and how to connect signals with 5 | actions. 6 | 7 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/basics/main.rs: -------------------------------------------------------------------------------- 1 | use gtk::{glib, prelude::*}; 2 | 3 | fn main() -> glib::ExitCode { 4 | let application = gtk::Application::builder() 5 | .application_id("com.github.gtk-rs.examples.basic") 6 | .build(); 7 | application.connect_activate(build_ui); 8 | application.run() 9 | } 10 | 11 | fn build_ui(application: >k::Application) { 12 | let window = gtk::ApplicationWindow::new(application); 13 | 14 | window.set_title(Some("First GTK Program")); 15 | window.set_default_size(350, 70); 16 | 17 | let button = gtk::Button::with_label("Click me!"); 18 | 19 | window.set_child(Some(&button)); 20 | 21 | window.present(); 22 | } 23 | -------------------------------------------------------------------------------- /examples/basics/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/basics/screenshot.png -------------------------------------------------------------------------------- /examples/builder_pattern/README.md: -------------------------------------------------------------------------------- 1 | # Builder Pattern 2 | 3 | This example shows how to use the [builder pattern](https://doc.rust-lang.org/1.0.0/style/ownership/builders.html) with GObjects. 4 | These allow to set construct-only properties and other construct properties. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/builder_pattern/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/builder_pattern/screenshot.png -------------------------------------------------------------------------------- /examples/clipboard/README.md: -------------------------------------------------------------------------------- 1 | # Clipboard 2 | 3 | The example shows how to use `gdk::Clipboard` to store/retrieve a text or a `gdk::Texture` from/into the clipboard. 4 | 5 | ![Screenshot](screenshot.png) 6 | 7 | ## License 8 | 9 | The ferris [asset](./asset.png) was copied from [https://rustacean.net/](https://rustacean.net/) and is published under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/) 10 | -------------------------------------------------------------------------------- /examples/clipboard/asset.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/clipboard/asset.png -------------------------------------------------------------------------------- /examples/clipboard/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/clipboard/screenshot.png -------------------------------------------------------------------------------- /examples/clock/README.md: -------------------------------------------------------------------------------- 1 | # Clock 2 | 3 | A simple clock that displays the current system time. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/clock/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/clock/screenshot.png -------------------------------------------------------------------------------- /examples/column_view_datagrid/README.md: -------------------------------------------------------------------------------- 1 | # ColumnView: Data Grid Example 2 | 3 | This example shows how to create a `gtk::ColumnView` and fill it with some 4 | miscellaneous hard-coded data. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/column_view_datagrid/grid_cell/grid_cell.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | -------------------------------------------------------------------------------- /examples/column_view_datagrid/grid_cell/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | use gtk::{glib, subclass::prelude::*}; 3 | 4 | pub struct Entry { 5 | pub name: String, 6 | } 7 | 8 | glib::wrapper! { 9 | pub struct GridCell(ObjectSubclass) 10 | @extends gtk::Widget, 11 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 12 | } 13 | 14 | impl Default for GridCell { 15 | fn default() -> Self { 16 | glib::Object::new() 17 | } 18 | } 19 | 20 | impl GridCell { 21 | pub fn set_entry(&self, entry: &Entry) { 22 | self.imp().name.set_text(Some(&entry.name)); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/column_view_datagrid/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/column_view_datagrid/screenshot.png -------------------------------------------------------------------------------- /examples/composite_dialog/README.md: -------------------------------------------------------------------------------- 1 | # Composite Template Dialog 2 | 3 | This example shows the use of callbacks, custom and bind property, notify and response signal in a composite 4 | template situation. 5 | 6 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/composite_dialog/main.rs: -------------------------------------------------------------------------------- 1 | mod my_app_window; 2 | 3 | use gtk::{glib, prelude::*}; 4 | use my_app_window::MyAppWindow; 5 | 6 | fn main() -> glib::ExitCode { 7 | let application = gtk::Application::builder() 8 | .application_id("com.github.gtk-rs.examples.composite_dialog") 9 | .build(); 10 | 11 | application.connect_activate(|app| { 12 | let win = MyAppWindow::new(app); 13 | win.present(); 14 | }); 15 | application.run() 16 | } 17 | -------------------------------------------------------------------------------- /examples/composite_dialog/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/composite_dialog/screenshot.png -------------------------------------------------------------------------------- /examples/composite_template/README.md: -------------------------------------------------------------------------------- 1 | # Composite Template 2 | 3 | This example demonstrates how to create a widget using GTK's composite templates. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/composite_template/ex_menu_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct ExMenuButton(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | -------------------------------------------------------------------------------- /examples/composite_template/main.rs: -------------------------------------------------------------------------------- 1 | mod ex_application_window; 2 | pub mod ex_menu_button; 3 | 4 | use ex_application_window::ExApplicationWindow; 5 | use gtk::{glib, prelude::*}; 6 | 7 | fn main() -> glib::ExitCode { 8 | let application = gtk::Application::builder() 9 | .application_id("com.github.gtk-rs.examples.composite_template") 10 | .build(); 11 | 12 | application.connect_activate(|app| { 13 | let win = ExApplicationWindow::new(app); 14 | win.present(); 15 | }); 16 | application.run() 17 | } 18 | -------------------------------------------------------------------------------- /examples/composite_template/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/composite_template/screenshot.png -------------------------------------------------------------------------------- /examples/confetti_snapshot_animation/README.md: -------------------------------------------------------------------------------- 1 | # Confetti 2 | 3 | This example demonstrates how to create a custom widget and animate a custom drawing in it. 4 | This also uses the `graphene` crate to work with vectors, to create a simple physics simulation. 5 | 6 | Clicking on the custom widget will trigger a confetti explosion for X seconds. After X seconds, 7 | the animation will stop and the related resources will be disposed. Multiple animations can be run at the 8 | same time. 9 | 10 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/confetti_snapshot_animation/animated_explosion/imp.rs: -------------------------------------------------------------------------------- 1 | use std::cell::{Cell, RefCell}; 2 | 3 | use gtk::{glib, subclass::prelude::*}; 4 | 5 | use crate::Explosion; 6 | 7 | #[derive(Default)] 8 | pub struct AnimatedExplosion { 9 | pub(super) explosion: RefCell>, 10 | pub(super) start: Cell, 11 | pub(super) lastupdate: Cell, 12 | pub(super) duration: Cell, 13 | pub(super) finished: Cell, 14 | } 15 | 16 | #[glib::object_subclass] 17 | impl ObjectSubclass for AnimatedExplosion { 18 | const NAME: &'static str = "AnimatedExplosion"; 19 | type Type = super::AnimatedExplosion; 20 | } 21 | 22 | impl ObjectImpl for AnimatedExplosion {} 23 | -------------------------------------------------------------------------------- /examples/confetti_snapshot_animation/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/confetti_snapshot_animation/screenshot.png -------------------------------------------------------------------------------- /examples/content_provider/README.md: -------------------------------------------------------------------------------- 1 | # Content provider 2 | 3 | This example demonstrates how to subclass GdkContentProvider to provide custom 4 | clipboard data via an asynchronous handler. 5 | -------------------------------------------------------------------------------- /examples/content_provider/content_provider/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{gdk, glib}; 4 | 5 | glib::wrapper! { 6 | pub struct ContentProvider(ObjectSubclass) 7 | @extends gdk::ContentProvider; 8 | } 9 | 10 | impl Default for ContentProvider { 11 | fn default() -> Self { 12 | glib::Object::new() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/css/README.md: -------------------------------------------------------------------------------- 1 | # CSS 2 | 3 | This example demonstrates how to use CSS. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/css/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/css/screenshot.png -------------------------------------------------------------------------------- /examples/css/style.css: -------------------------------------------------------------------------------- 1 | entry.entry1 { 2 | background: linear-gradient(to right, #f00, #0f0); 3 | color: blue; 4 | font-weight: bold; 5 | } 6 | 7 | button { 8 | /* If we don't put it, the yellow background won't be visible */ 9 | background-image: none; 10 | } 11 | 12 | button.button1:hover { 13 | transition: 500ms; 14 | color: red; 15 | background-color: yellow; 16 | } 17 | 18 | combobox button.combo box { 19 | padding: 5px; 20 | } 21 | combobox box arrow { 22 | -gtk-icon-source: -gtk-icontheme('pan-down-symbolic'); 23 | border-left: 5px solid transparent; 24 | border-right: 5px solid transparent; 25 | border-top: 5px solid black; 26 | } -------------------------------------------------------------------------------- /examples/custom_application/README.md: -------------------------------------------------------------------------------- 1 | # Custom GtkApplication 2 | 3 | This example shows how to create a custom GtkApplication by subclassing it. 4 | 5 | Note that you don't need to init gtk manually in this case as it's done automatically 6 | after the application has been activated. 7 | 8 | ![screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/custom_application/ex_application/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{gio, glib}; 4 | 5 | glib::wrapper! { 6 | pub struct ExApplication(ObjectSubclass) 7 | @extends gio::Application, gtk::Application, 8 | @implements gio::ActionGroup, gio::ActionMap; 9 | } 10 | 11 | impl Default for ExApplication { 12 | fn default() -> Self { 13 | glib::Object::builder() 14 | .property("application-id", "org.gtk_rs.application-subclass") 15 | .build() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /examples/custom_application/main.rs: -------------------------------------------------------------------------------- 1 | mod ex_application; 2 | 3 | use ex_application::ExApplication; 4 | use gtk::{glib, prelude::*}; 5 | 6 | fn main() -> glib::ExitCode { 7 | let app = ExApplication::default(); 8 | app.run() 9 | } 10 | -------------------------------------------------------------------------------- /examples/custom_application/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/custom_application/screenshot.png -------------------------------------------------------------------------------- /examples/custom_buildable/README.md: -------------------------------------------------------------------------------- 1 | # Custom Buildable 2 | 3 | This example shows how to create a custom widget implementing the GtkBuildable interface. This allows to specify how children are added when the widget is used in a UI declaration. 4 | 5 | ![screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/custom_buildable/custom_buildable/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{glib, prelude::*, subclass::prelude::*}; 4 | 5 | glib::wrapper! { 6 | pub struct CustomBuildable(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl CustomBuildable { 12 | pub fn add_suffix>(&self, widget: &T) { 13 | let imp = self.imp(); 14 | imp.suffixes.append(widget); 15 | imp.suffixes.set_visible(true); 16 | } 17 | 18 | pub fn add_prefix>(&self, widget: &T) { 19 | let imp = self.imp(); 20 | imp.prefixes.append(widget); 21 | imp.prefixes.set_visible(true); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/custom_buildable/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/custom_buildable/screenshot.png -------------------------------------------------------------------------------- /examples/custom_editable/README.md: -------------------------------------------------------------------------------- 1 | # Custom Editable 2 | 3 | This example shows how to create a custom `gtk::Editable` which is the equivalent 4 | of creating a custom text entry that can have tags shown on it. 5 | It's a copy of the tagged entry demo from gtk4-demo. 6 | The entry point is in `main.rs`, the custom editable in `custom_editable.rs` and the custom tag in `custom_tag.rs`. 7 | 8 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/custom_editable/custom_editable/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{glib, prelude::*}; 4 | 5 | use crate::custom_tag::CustomTag; 6 | 7 | glib::wrapper! { 8 | pub struct CustomEditable(ObjectSubclass) 9 | @extends gtk::Widget, 10 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Editable; 11 | } 12 | 13 | impl Default for CustomEditable { 14 | fn default() -> Self { 15 | glib::Object::new() 16 | } 17 | } 18 | 19 | impl CustomEditable { 20 | pub fn add_tag(&self, tag: &CustomTag) { 21 | tag.set_parent(self); 22 | } 23 | 24 | pub fn remove_tag(&self, tag: &CustomTag) { 25 | tag.unparent(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /examples/custom_editable/custom_tag/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct CustomTag(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl CustomTag { 12 | pub fn new(label: &str) -> Self { 13 | glib::Object::builder() 14 | .property("label", label) 15 | .property("has-close-button", true) 16 | .build() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /examples/custom_editable/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/custom_editable/screenshot.png -------------------------------------------------------------------------------- /examples/custom_editable/style.css: -------------------------------------------------------------------------------- 1 | tag { 2 | margin: 4px 0px; 3 | padding: 4px; 4 | border-radius: 4px; 5 | background: lightskyblue; 6 | } 7 | tag box { 8 | border-spacing: 4px; 9 | } 10 | tag label, 11 | tag image { 12 | color: white; 13 | } 14 | tag button { 15 | min-height: 0; 16 | min-width: 0; 17 | padding: 0; 18 | border: 1px solid white; 19 | } 20 | 21 | entry.tagged { 22 | border-spacing: 4px; 23 | } 24 | -------------------------------------------------------------------------------- /examples/custom_layout_manager/README.md: -------------------------------------------------------------------------------- 1 | # Custom Layout Manager 2 | 3 | This example shows how to create a custom `gtk::LayoutManager` and transition from two different layout states. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/custom_layout_manager/custom_layout_child/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{gdk, glib}; 4 | 5 | glib::wrapper! { 6 | pub struct CustomLayoutChild(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl CustomLayoutChild { 12 | pub fn new(color: gdk::RGBA) -> Self { 13 | glib::Object::builder().property("color", color).build() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/custom_layout_manager/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/custom_layout_manager/screenshot.png -------------------------------------------------------------------------------- /examples/custom_orientable/README.md: -------------------------------------------------------------------------------- 1 | # Custom Orientable 2 | 3 | This example demonstrates how to create a custom orientable. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/custom_orientable/custom_orientable/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct CustomOrientable(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Orientable; 9 | } 10 | 11 | impl Default for CustomOrientable { 12 | fn default() -> Self { 13 | glib::Object::new() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/custom_orientable/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/custom_orientable/screenshot.png -------------------------------------------------------------------------------- /examples/custom_paintable/README.md: -------------------------------------------------------------------------------- 1 | # Custom Paintable 2 | 3 | This example shows how to create a custom `gdk::Paintable` 4 | that renders a square with a linear color gradient 5 | 6 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/custom_paintable/custom_paintable/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{gdk, glib}; 4 | 5 | glib::wrapper! { 6 | pub struct CustomPaintable(ObjectSubclass) @implements gdk::Paintable; 7 | } 8 | 9 | impl Default for CustomPaintable { 10 | fn default() -> Self { 11 | glib::Object::new() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/custom_paintable/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/custom_paintable/screenshot.png -------------------------------------------------------------------------------- /examples/custom_widget/README.md: -------------------------------------------------------------------------------- 1 | # Custom Widget 2 | 3 | This example shows how to create a custom widget that behaves like `gtk::Button`. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/custom_widget/ex_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct ExButton(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl Default for ExButton { 12 | fn default() -> Self { 13 | glib::Object::new() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/custom_widget/main.rs: -------------------------------------------------------------------------------- 1 | mod ex_button; 2 | 3 | use ex_button::ExButton; 4 | use gtk::{glib, prelude::*}; 5 | 6 | fn main() -> glib::ExitCode { 7 | let application = gtk::Application::builder() 8 | .application_id("com.github.gtk-rs.examples.widget_subclass") 9 | .build(); 10 | application.connect_activate(|app| { 11 | let window = gtk::ApplicationWindow::new(app); 12 | let button = ExButton::default(); 13 | button.set_margin_top(18); 14 | button.set_margin_bottom(18); 15 | button.set_margin_start(18); 16 | button.set_margin_end(18); 17 | window.set_child(Some(&button)); 18 | window.present(); 19 | }); 20 | 21 | application.run() 22 | } 23 | -------------------------------------------------------------------------------- /examples/custom_widget/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/custom_widget/screenshot.png -------------------------------------------------------------------------------- /examples/dialog/README.md: -------------------------------------------------------------------------------- 1 | # Dialog 2 | 3 | Example of how to obtain the response to a dialog as a future. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/dialog/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/dialog/screenshot.png -------------------------------------------------------------------------------- /examples/entry_completion/README.md: -------------------------------------------------------------------------------- 1 | # Entry Completion 2 | 3 | This example demonstrates how to build a list of items and use them 4 | to autocomplete a field as the user types in something. 5 | 6 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/entry_completion/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/entry_completion/screenshot.png -------------------------------------------------------------------------------- /examples/entry_undo/README.md: -------------------------------------------------------------------------------- 1 | # Entry Undo 2 | 3 | This example shows how to add an `Entry` with enabled undo support. 4 | 5 | 6 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/entry_undo/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/entry_undo/screenshot.png -------------------------------------------------------------------------------- /examples/expressions/README.md: -------------------------------------------------------------------------------- 1 | # Expressions 2 | 3 | This example demonstrates a usage of GtkExpressions. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/expressions/metadata/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct Metadata(ObjectSubclass); 7 | } 8 | 9 | impl Default for Metadata { 10 | fn default() -> Self { 11 | glib::Object::new() 12 | } 13 | } 14 | 15 | impl Metadata { 16 | pub fn new(title: &str) -> Self { 17 | glib::Object::builder().property("title", title).build() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/expressions/note/imp.rs: -------------------------------------------------------------------------------- 1 | use gtk::{glib, prelude::*, subclass::prelude::*}; 2 | use std::cell::OnceCell; 3 | 4 | use super::Metadata; 5 | 6 | #[derive(Debug, glib::Properties, Default)] 7 | #[properties(wrapper_type = super::Note)] 8 | pub struct Note { 9 | #[property(get, set, construct_only)] 10 | pub metadata: OnceCell, 11 | } 12 | 13 | #[glib::object_subclass] 14 | impl ObjectSubclass for Note { 15 | const NAME: &'static str = "Note"; 16 | type Type = super::Note; 17 | } 18 | 19 | #[glib::derived_properties] 20 | impl ObjectImpl for Note {} 21 | -------------------------------------------------------------------------------- /examples/expressions/note/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | use super::Metadata; 6 | 7 | glib::wrapper! { 8 | pub struct Note(ObjectSubclass); 9 | } 10 | 11 | impl Default for Note { 12 | fn default() -> Self { 13 | Self::new(&Metadata::default()) 14 | } 15 | } 16 | 17 | impl Note { 18 | pub fn new(metadata: &Metadata) -> Self { 19 | glib::Object::builder() 20 | .property("metadata", metadata) 21 | .build() 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /examples/expressions/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/expressions/screenshot.png -------------------------------------------------------------------------------- /examples/femtovg_area/README.md: -------------------------------------------------------------------------------- 1 | # FemtoVG in GL Area 2 | 3 | This example shows how to use [FemtoVG](https://github.com/femtovg/femtovg), an 4 | OpenGL-accelerated Rust canvas, to draw in a `gtk::GLArea`. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/femtovg_area/femtovg_area/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct FemtoVGArea(ObjectSubclass) 7 | @extends gtk::Widget, gtk::GLArea, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl Default for FemtoVGArea { 12 | fn default() -> Self { 13 | glib::Object::new() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/femtovg_area/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/femtovg_area/screenshot.png -------------------------------------------------------------------------------- /examples/fill_and_stroke/README.md: -------------------------------------------------------------------------------- 1 | # Fill and Stroke 2 | 3 | This example shows how to create a custom `gdk::Paintable` that uses the new Path APIs 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/fill_and_stroke/paintable/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{gdk, glib}; 4 | 5 | glib::wrapper! { 6 | pub struct CustomPaintable(ObjectSubclass) @implements gdk::Paintable; 7 | } 8 | 9 | impl Default for CustomPaintable { 10 | fn default() -> Self { 11 | glib::Object::new() 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /examples/fill_and_stroke/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/fill_and_stroke/screenshot.png -------------------------------------------------------------------------------- /examples/flow_box/README.md: -------------------------------------------------------------------------------- 1 | # FlowBox 2 | 3 | In this example we discover how to make use of `gtk::FlowBox` which allows flexible and responsive grids which reflow as needed. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/flow_box/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/flow_box/screenshot.png -------------------------------------------------------------------------------- /examples/gif_paintable/README.md: -------------------------------------------------------------------------------- 1 | # GIF Paintable 2 | 3 | This example shows how to create a custom `gdk::Paintable` that renders an 4 | animated GIF image. 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/gif_paintable/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/gif_paintable/screenshot.png -------------------------------------------------------------------------------- /examples/glium_gl_area/README.md: -------------------------------------------------------------------------------- 1 | # Glium in GL Area 2 | 3 | This example shows how to use [Glium](https://github.com/glium/glium), a high-level Rust OpenGL wrapper, to draw in a `gtk::GLArea`. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/glium_gl_area/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/glium_gl_area/screenshot.png -------------------------------------------------------------------------------- /examples/grid_packing/README.md: -------------------------------------------------------------------------------- 1 | # Grid Packing 2 | 3 | This example demonstrates how to attach widgets to a `gtk::Grid`. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/grid_packing/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/grid_packing/screenshot.png -------------------------------------------------------------------------------- /examples/gtk_builder/README.md: -------------------------------------------------------------------------------- 1 | # GTK Builder 2 | 3 | This example demonstrates how to use the builder with an imported UI file 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/gtk_builder/gtk_builder.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Builder Basics 5 | 320 6 | 240 7 | 8 | 9 | Big Useless Button 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/gtk_builder/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/gtk_builder/screenshot.png -------------------------------------------------------------------------------- /examples/list_box_model/README.md: -------------------------------------------------------------------------------- 1 | # ListBox and ListModel example 2 | 3 | This example demonstrates how to use `gtk::ListBox` in combination with 4 | a custom model and a custom row type. 5 | The custom model resides in `model.rs` and the custom row type in `row_data.rs`. 6 | 7 | It sets up a `gtk::ListBox` containing, per row, a label, spinbutton and 8 | an edit button. The edit button allows to edit the underlying data structure 9 | and changes are taking place immediately in the listbox by making use of GObject 10 | property bindings. 11 | 12 | In addition, it is possible to add new rows and delete old ones. 13 | 14 | Run it by executing: 15 | 16 | ```bash 17 | cargo run --bin list_box_model 18 | ``` 19 | -------------------------------------------------------------------------------- /examples/list_box_model/list_box_row/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | use crate::row_data::RowData; 6 | 7 | glib::wrapper! { 8 | pub struct ListBoxRow(ObjectSubclass) 9 | @extends gtk::Widget, gtk::ListBoxRow, 10 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 11 | } 12 | 13 | impl ListBoxRow { 14 | pub fn new(row_data: &RowData) -> Self { 15 | glib::Object::builder() 16 | .property("row-data", &row_data) 17 | .build() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /examples/list_box_sort_stringlist/README.md: -------------------------------------------------------------------------------- 1 | # ListBox and StringListModel with Sorter example 2 | 3 | This example demonstrates how to use `gtk::ListBox` in combination with 4 | a StringList model and StringSorter with a PropertyExpression. 5 | 6 | It sets up a `gtk::ListBox` containing an Inscription on each row. 7 | The rows are sorted alphabetically. 8 | 9 | Run it by executing: 10 | 11 | ```bash 12 | cargo run --bin list_box_sort_stringlist --features v4_14 13 | `` 14 | -------------------------------------------------------------------------------- /examples/list_view_apps_launcher/README.md: -------------------------------------------------------------------------------- 1 | # ListView: Applications Launcher 2 | 3 | This example shows how to create a `gtk::ListView` and fill it with applications data from `gio::AppInfo` with the possibility to open an application when an item of the list is activated. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/list_view_apps_launcher/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/list_view_apps_launcher/screenshot.png -------------------------------------------------------------------------------- /examples/menubar/README.md: -------------------------------------------------------------------------------- 1 | # Menubar 2 | 3 | This example demonstrates how to create a menubar in the top-level `ApplicationWindow`, add 4 | menu items to it, and connect signals to those items. 5 | 6 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/menubar/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/menubar/screenshot.png -------------------------------------------------------------------------------- /examples/rotation_bin/README.md: -------------------------------------------------------------------------------- 1 | # RotationBin 2 | 3 | A Widget that rotate its child widget by 90 degrees. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/rotation_bin/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/rotation_bin/screenshot.png -------------------------------------------------------------------------------- /examples/scale/README.md: -------------------------------------------------------------------------------- 1 | # Scale 2 | 3 | This example demonstrates how to create `gtk::Scale` and place them in the `gtk::Window` using a grid. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/scale/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/scale/screenshot.png -------------------------------------------------------------------------------- /examples/scale_bin/README.md: -------------------------------------------------------------------------------- 1 | # Scale Widget 2 | 3 | This example shows a basic widget that scales its child by a given factor. 4 | 5 | Note that is implementation only supports one child. 6 | 7 | ![Screenshot](screenshot.png) 8 | -------------------------------------------------------------------------------- /examples/scale_bin/main.rs: -------------------------------------------------------------------------------- 1 | mod scale_bin; 2 | 3 | use gtk::{glib, prelude::*}; 4 | use scale_bin::ScaleBin; 5 | 6 | fn main() -> glib::ExitCode { 7 | let application = gtk::Application::builder() 8 | .application_id("com.github.gtk-rs.examples.scale_bin") 9 | .build(); 10 | 11 | application.connect_activate(|app| { 12 | let window = gtk::ApplicationWindow::new(app); 13 | let scale_bin = ScaleBin::default(); 14 | window.set_child(Some(&scale_bin)); 15 | window.present(); 16 | }); 17 | 18 | application.run() 19 | } 20 | -------------------------------------------------------------------------------- /examples/scale_bin/scale_bin/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct ScaleBin(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl Default for ScaleBin { 12 | fn default() -> Self { 13 | glib::Object::new() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/scale_bin/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/scale_bin/screenshot.png -------------------------------------------------------------------------------- /examples/search_bar/README.md: -------------------------------------------------------------------------------- 1 | # Search Bar 2 | 3 | This example demonstrates how to use the `gtk::SearchBar` & `gtk::SearchEntry`. 4 | 5 | ![Screenshot](screenshot.png) 6 | -------------------------------------------------------------------------------- /examples/search_bar/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/search_bar/screenshot.png -------------------------------------------------------------------------------- /examples/squares/README.md: -------------------------------------------------------------------------------- 1 | # Squares 2 | 3 | This example demonstrates how to do custom drawing in a widget. This is a 4 | translation to rust of [squares.py](https://gitlab.gnome.org/GNOME/gtk/-/blob/e1606ce8eb190fd9e71b9ff517339eb3de1c9209/examples/squares.py). 5 | 6 | ![Screenshot](screenshot.png) 7 | -------------------------------------------------------------------------------- /examples/squares/main.rs: -------------------------------------------------------------------------------- 1 | mod squares_widget; 2 | 3 | use gtk::{glib, prelude::*}; 4 | use squares_widget::SquaresWidget; 5 | 6 | fn main() -> glib::ExitCode { 7 | let application = gtk::Application::builder() 8 | .application_id("com.github.gtk-rs.examples.squares") 9 | .build(); 10 | application.connect_activate(build_ui); 11 | application.run() 12 | } 13 | 14 | fn build_ui(application: >k::Application) { 15 | let win = gtk::ApplicationWindow::new(application); 16 | win.set_title(Some("Squares")); 17 | 18 | let widget = SquaresWidget::default(); 19 | win.set_child(Some(&widget)); 20 | win.present(); 21 | } 22 | -------------------------------------------------------------------------------- /examples/squares/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/squares/screenshot.png -------------------------------------------------------------------------------- /examples/squares/squares_widget/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct SquaresWidget(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl Default for SquaresWidget { 12 | fn default() -> Self { 13 | glib::Object::new() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/squeezer_bin/README.md: -------------------------------------------------------------------------------- 1 | # Squeeze Widget 2 | 3 | This example shows a basic widget that squeezes its child to fit in the parent. The widget has a property which allows the child to keep its aspect ratio. 4 | 5 | Note that is implementation only supports one child. 6 | 7 | #### Screenshot with `keep_aspect_ratio` set to `true` 8 | 9 | ![Screenshot](screenshot1.png) 10 | 11 | #### Screenshot with `keep_aspect_ratio` set to `false` 12 | 13 | ![Screenshot](screenshot2.png) 14 | -------------------------------------------------------------------------------- /examples/squeezer_bin/screenshot1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/squeezer_bin/screenshot1.png -------------------------------------------------------------------------------- /examples/squeezer_bin/screenshot2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/squeezer_bin/screenshot2.png -------------------------------------------------------------------------------- /examples/squeezer_bin/squeezer_bin/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct SqueezerBin(ObjectSubclass) 7 | @extends gtk::Widget, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl Default for SqueezerBin { 12 | fn default() -> Self { 13 | glib::Object::new() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/text_viewer/README.md: -------------------------------------------------------------------------------- 1 | # Text Viewer 2 | 3 | A simple text file viewer using GtkBox, Scrollable Text View and File Chooser. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/text_viewer/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/text_viewer/screenshot.png -------------------------------------------------------------------------------- /examples/tokio_async_request/README.md: -------------------------------------------------------------------------------- 1 | # Tokio async request 2 | 3 | This example shows an infinite list of pokemon names, whenever it reaches the end, it searches for new names and fills the list without blocking the main thread of the program. 4 | 5 | ![Screenshot](screenshot.gif) -------------------------------------------------------------------------------- /examples/tokio_async_request/screenshot.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/tokio_async_request/screenshot.gif -------------------------------------------------------------------------------- /examples/video_player/README.md: -------------------------------------------------------------------------------- 1 | # Video Player 2 | 3 | This example demonstrates how to use `gtk::Video` to play videos. 4 | 5 | ![Screenshot](screenshot.png) -------------------------------------------------------------------------------- /examples/video_player/main.rs: -------------------------------------------------------------------------------- 1 | mod video_player_window; 2 | 3 | use gtk::{glib, prelude::*}; 4 | use video_player_window::VideoPlayerWindow; 5 | 6 | fn main() -> glib::ExitCode { 7 | let application = gtk::Application::builder() 8 | .application_id("com.github.gtk-rs.examples.video_player") 9 | .build(); 10 | 11 | application.connect_activate(|app| { 12 | let win = VideoPlayerWindow::new(app); 13 | win.present(); 14 | }); 15 | 16 | application.run() 17 | } 18 | -------------------------------------------------------------------------------- /examples/video_player/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gtk-rs/gtk4-rs/a0ef06c5160b9ad8b7a0d1bf3dd86cefad2c0b2a/examples/video_player/screenshot.png -------------------------------------------------------------------------------- /examples/video_player/video_player_window/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::{gio, glib, prelude::*, subclass::prelude::*}; 4 | 5 | glib::wrapper! { 6 | pub struct VideoPlayerWindow(ObjectSubclass) 7 | @extends gtk::Widget, gtk::Window, gtk::ApplicationWindow, 8 | @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, 9 | gtk::Native, gtk::Root, gtk::ShortcutManager, gio::ActionMap, gio::ActionGroup; 10 | } 11 | 12 | impl VideoPlayerWindow { 13 | pub fn new>(app: &P) -> Self { 14 | glib::Object::builder().property("application", app).build() 15 | } 16 | 17 | fn set_video(&self, video: gio::File) { 18 | self.imp().video.set_file(Some(&video)); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/virtual_methods/derived_button/mod.rs: -------------------------------------------------------------------------------- 1 | mod imp; 2 | 3 | use gtk::glib; 4 | 5 | glib::wrapper! { 6 | pub struct DerivedButton(ObjectSubclass) 7 | @extends gtk::Widget, gtk::Button, crate::base_button::BaseButton, 8 | @implements gtk::Accessible, gtk::Actionable, gtk::Buildable, gtk::ConstraintTarget; 9 | } 10 | 11 | impl Default for DerivedButton { 12 | fn default() -> Self { 13 | glib::Object::new() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gdk4-macos/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gdk4-macos/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gdk4-macos/src/auto/macos_device.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkMacosDevice")] 9 | pub struct MacosDevice(Object) @extends gdk::Device; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_macos_device_get_type(), 13 | } 14 | } 15 | 16 | impl MacosDevice {} 17 | -------------------------------------------------------------------------------- /gdk4-macos/src/auto/macos_display.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkMacosDisplay")] 9 | pub struct MacosDisplay(Object) @extends gdk::Display; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_macos_display_get_type(), 13 | } 14 | } 15 | 16 | impl MacosDisplay {} 17 | -------------------------------------------------------------------------------- /gdk4-macos/src/auto/macos_gl_context.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkMacosGLContext")] 9 | pub struct MacosGLContext(Object) @extends gdk::GLContext, gdk::DrawContext; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_macos_gl_context_get_type(), 13 | } 14 | } 15 | 16 | impl MacosGLContext {} 17 | -------------------------------------------------------------------------------- /gdk4-macos/src/auto/macos_keymap.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkMacosKeymap")] 9 | pub struct MacosKeymap(Object); 10 | 11 | match fn { 12 | type_ => || ffi::gdk_macos_keymap_get_type(), 13 | } 14 | } 15 | 16 | impl MacosKeymap {} 17 | -------------------------------------------------------------------------------- /gdk4-macos/src/auto/macos_seat.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkMacosSeat")] 9 | pub struct MacosSeat(Object) @extends gdk::Seat; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_macos_seat_get_type(), 13 | } 14 | } 15 | 16 | impl MacosSeat {} 17 | -------------------------------------------------------------------------------- /gdk4-macos/src/auto/mod.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | mod macos_device; 6 | pub use self::macos_device::MacosDevice; 7 | 8 | mod macos_display; 9 | pub use self::macos_display::MacosDisplay; 10 | 11 | mod macos_gl_context; 12 | pub use self::macos_gl_context::MacosGLContext; 13 | 14 | mod macos_keymap; 15 | pub use self::macos_keymap::MacosKeymap; 16 | 17 | mod macos_monitor; 18 | pub use self::macos_monitor::MacosMonitor; 19 | 20 | mod macos_seat; 21 | pub use self::macos_seat::MacosSeat; 22 | 23 | mod macos_surface; 24 | pub use self::macos_surface::MacosSurface; 25 | -------------------------------------------------------------------------------- /gdk4-macos/src/auto/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-macos/src/lib.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #![doc = include_str!("../README.md")] 4 | #![allow(deprecated)] 5 | #![cfg_attr(docsrs, feature(doc_cfg))] 6 | 7 | #[cfg(not(feature = "cocoa"))] 8 | use std::ffi::c_void; 9 | 10 | pub use gdk; 11 | pub use gdk4_macos_sys as ffi; 12 | pub use gio; 13 | pub use glib; 14 | #[macro_use] 15 | mod rt; 16 | 17 | mod auto; 18 | 19 | pub mod prelude; 20 | 21 | pub use auto::*; 22 | 23 | mod macos_surface; 24 | 25 | #[cfg(not(feature = "cocoa"))] 26 | #[allow(non_camel_case_types)] 27 | pub type id = *mut c_void; 28 | 29 | #[cfg(feature = "cocoa")] 30 | pub use cocoa::base::id; 31 | -------------------------------------------------------------------------------- /gdk4-macos/src/prelude.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for blanket imports. 5 | 6 | #[doc(hidden)] 7 | pub use gdk::prelude::*; 8 | -------------------------------------------------------------------------------- /gdk4-macos/src/rt.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | macro_rules! assert_initialized_main_thread { 4 | () => {}; 5 | } 6 | 7 | /// No-op. 8 | macro_rules! skip_assert_initialized { 9 | () => {}; 10 | } 11 | -------------------------------------------------------------------------------- /gdk4-macos/sys/Gir.toml: -------------------------------------------------------------------------------- 1 | [options] 2 | work_mode = "sys" 3 | library = "GdkMacos" 4 | version = "4.0" 5 | min_cfg_version = "4.0.0" 6 | single_version_file = "." 7 | girs_directories = ["../../gir-files"] 8 | 9 | external_libraries = [ 10 | "GLib", 11 | ] 12 | 13 | [external_libraries] 14 | gdk4 = "Gdk" 15 | 16 | 17 | [[object]] 18 | name = "GdkMacos.MacosMonitor" 19 | status = "generate" 20 | [[object.function]] 21 | name = "get_geometry" 22 | ignore = true # The function does not exists -------------------------------------------------------------------------------- /gdk4-macos/sys/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /gdk4-macos/sys/build.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #[cfg(not(docsrs))] 6 | use std::process; 7 | 8 | #[cfg(docsrs)] 9 | fn main() {} // prevent linking libraries to avoid documentation failure 10 | 11 | #[cfg(not(docsrs))] 12 | fn main() { 13 | if let Err(s) = system_deps::Config::new().probe() { 14 | println!("cargo:warning={s}"); 15 | process::exit(1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gdk4-macos/sys/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-macos/tests/check_gir.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #[test] 4 | fn check_gir_file() { 5 | let res = gir_format_check::check_gir_file("Gir.toml"); 6 | println!("{res}"); 7 | assert_eq!(res.nb_errors, 0); 8 | } 9 | -------------------------------------------------------------------------------- /gdk4-wayland/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gdk4-wayland/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gdk4-wayland/src/auto/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-wayland/src/auto/wayland_gl_context.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkWaylandGLContext")] 9 | pub struct WaylandGLContext(Object) @extends gdk::GLContext, gdk::DrawContext; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_wayland_gl_context_get_type(), 13 | } 14 | } 15 | 16 | impl WaylandGLContext {} 17 | -------------------------------------------------------------------------------- /gdk4-wayland/src/auto/wayland_monitor.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkWaylandMonitor")] 9 | pub struct WaylandMonitor(Object) @extends gdk::Monitor; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_wayland_monitor_get_type(), 13 | } 14 | } 15 | 16 | impl WaylandMonitor {} 17 | -------------------------------------------------------------------------------- /gdk4-wayland/src/auto/wayland_popup.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, WaylandSurface}; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkWaylandPopup")] 9 | pub struct WaylandPopup(Object) @extends WaylandSurface, gdk::Surface, @implements gdk::Popup; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_wayland_popup_get_type(), 13 | } 14 | } 15 | 16 | impl WaylandPopup {} 17 | -------------------------------------------------------------------------------- /gdk4-wayland/src/auto/wayland_seat.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkWaylandSeat")] 9 | pub struct WaylandSeat(Object) @extends gdk::Seat; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_wayland_seat_get_type(), 13 | } 14 | } 15 | 16 | impl WaylandSeat {} 17 | -------------------------------------------------------------------------------- /gdk4-wayland/src/prelude.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for blanket imports. 5 | 6 | #[doc(hidden)] 7 | pub use gdk::prelude::*; 8 | 9 | pub use crate::auto::traits::*; 10 | pub use crate::wayland_surface::WaylandSurfaceExtManual; 11 | -------------------------------------------------------------------------------- /gdk4-wayland/sys/Gir.toml: -------------------------------------------------------------------------------- 1 | [options] 2 | work_mode = "sys" 3 | library = "GdkWayland" 4 | version = "4.0" 5 | min_cfg_version = "4.0.0" 6 | single_version_file = "." 7 | girs_directories = ["../../gir-files"] 8 | 9 | external_libraries = [ 10 | "GLib", 11 | ] 12 | -------------------------------------------------------------------------------- /gdk4-wayland/sys/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /gdk4-wayland/sys/build.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #[cfg(not(docsrs))] 6 | use std::process; 7 | 8 | #[cfg(docsrs)] 9 | fn main() {} // prevent linking libraries to avoid documentation failure 10 | 11 | #[cfg(not(docsrs))] 12 | fn main() { 13 | if let Err(s) = system_deps::Config::new().probe() { 14 | println!("cargo:warning={s}"); 15 | process::exit(1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gdk4-wayland/sys/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-wayland/tests/check_gir.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #[test] 4 | fn check_gir_file() { 5 | let res = gir_format_check::check_gir_file("Gir.toml"); 6 | println!("{res}"); 7 | assert_eq!(res.nb_errors, 0); 8 | } 9 | -------------------------------------------------------------------------------- /gdk4-win32/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gdk4-win32/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gdk4-win32/src/auto/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-win32/src/auto/win32_display_manager.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkWin32DisplayManager")] 9 | pub struct Win32DisplayManager(Object) @extends gdk::DisplayManager; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_win32_display_manager_get_type(), 13 | } 14 | } 15 | 16 | impl Win32DisplayManager {} 17 | -------------------------------------------------------------------------------- /gdk4-win32/src/auto/win32_drag.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkWin32Drag")] 9 | pub struct Win32Drag(Object) @extends gdk::Drag; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_win32_drag_get_type(), 13 | } 14 | } 15 | 16 | impl Win32Drag {} 17 | -------------------------------------------------------------------------------- /gdk4-win32/src/auto/win32_gl_context.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkWin32GLContext")] 9 | pub struct Win32GLContext(Object) @extends gdk::GLContext, gdk::DrawContext; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_win32_gl_context_get_type(), 13 | } 14 | } 15 | 16 | impl Win32GLContext {} 17 | -------------------------------------------------------------------------------- /gdk4-win32/src/auto/win32_hcursor.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::{prelude::*, translate::*}; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GdkWin32HCursor")] 10 | pub struct Win32HCursor(Object); 11 | 12 | match fn { 13 | type_ => || ffi::gdk_win32_hcursor_get_type(), 14 | } 15 | } 16 | 17 | impl Win32HCursor { 18 | pub fn is_destroyable(&self) -> bool { 19 | ObjectExt::property(self, "destroyable") 20 | } 21 | 22 | pub fn display(&self) -> Option { 23 | ObjectExt::property(self, "display") 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /gdk4-win32/src/prelude.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for blanket imports. 5 | 6 | #[doc(hidden)] 7 | pub use gdk::prelude::*; 8 | -------------------------------------------------------------------------------- /gdk4-win32/src/rt.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | macro_rules! assert_initialized_main_thread { 4 | () => {}; 5 | } 6 | 7 | /// No-op. 8 | macro_rules! skip_assert_initialized { 9 | () => {}; 10 | } 11 | -------------------------------------------------------------------------------- /gdk4-win32/sys/Gir.toml: -------------------------------------------------------------------------------- 1 | [options] 2 | work_mode = "sys" 3 | library = "GdkWin32" 4 | version = "4.0" 5 | min_cfg_version = "4.0.0" 6 | single_version_file = "." 7 | girs_directories = ["../../gir-files"] 8 | 9 | external_libraries = [ 10 | "GLib", 11 | ] 12 | 13 | [external_libraries] 14 | gdk4 = "Gdk" 15 | -------------------------------------------------------------------------------- /gdk4-win32/sys/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /gdk4-win32/sys/build.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #[cfg(not(docsrs))] 6 | use std::process; 7 | 8 | #[cfg(docsrs)] 9 | fn main() {} // prevent linking libraries to avoid documentation failure 10 | 11 | #[cfg(not(docsrs))] 12 | fn main() { 13 | if let Err(s) = system_deps::Config::new().probe() { 14 | println!("cargo:warning={s}"); 15 | process::exit(1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gdk4-win32/sys/tests/layout.c: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #include "manual.h" 6 | #include 7 | #include 8 | 9 | int main() { 10 | printf("%s;%zu;%zu\n", "GdkWin32MessageFilterReturn", sizeof(GdkWin32MessageFilterReturn), alignof(GdkWin32MessageFilterReturn)); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /gdk4-win32/sys/tests/manual.h: -------------------------------------------------------------------------------- 1 | // Feel free to edit this file, it won't be regenerated by gir generator unless removed. 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /gdk4-win32/sys/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-win32/tests/check_gir.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #[test] 4 | fn check_gir_file() { 5 | let res = gir_format_check::check_gir_file("Gir.toml"); 6 | println!("{res}"); 7 | assert_eq!(res.nb_errors, 0); 8 | } 9 | -------------------------------------------------------------------------------- /gdk4-x11/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gdk4-x11/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gdk4-x11/src/auto/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-x11/src/auto/x11_app_launch_context.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkX11AppLaunchContext")] 9 | pub struct X11AppLaunchContext(Object) @extends gdk::AppLaunchContext, gio::AppLaunchContext; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_x11_app_launch_context_get_type(), 13 | } 14 | } 15 | 16 | impl X11AppLaunchContext {} 17 | -------------------------------------------------------------------------------- /gdk4-x11/src/auto/x11_drag.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkX11Drag")] 9 | pub struct X11Drag(Object) @extends gdk::Drag; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_x11_drag_get_type(), 13 | } 14 | } 15 | 16 | impl X11Drag {} 17 | -------------------------------------------------------------------------------- /gdk4-x11/src/auto/x11gl_context.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkX11GLContext")] 9 | pub struct X11GLContext(Object) @extends gdk::GLContext, gdk::DrawContext; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_x11_gl_context_get_type(), 13 | } 14 | } 15 | 16 | impl X11GLContext {} 17 | -------------------------------------------------------------------------------- /gdk4-x11/src/builders.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Builder pattern types. 5 | 6 | pub use crate::auto::builders::*; 7 | -------------------------------------------------------------------------------- /gdk4-x11/src/prelude.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for blanket imports. 5 | 6 | #[doc(hidden)] 7 | pub use gdk::prelude::*; 8 | -------------------------------------------------------------------------------- /gdk4-x11/src/rt.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | macro_rules! assert_initialized_main_thread { 4 | () => {}; 5 | } 6 | 7 | /// No-op. 8 | macro_rules! skip_assert_initialized { 9 | () => {}; 10 | } 11 | -------------------------------------------------------------------------------- /gdk4-x11/src/x11_monitor.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | #[cfg(feature = "xlib")] 5 | #[cfg_attr(docsrs, doc(cfg(feature = "xlib")))] 6 | use x11::xlib::XID; 7 | 8 | #[cfg(not(feature = "xlib"))] 9 | use crate::XID; 10 | use crate::{ffi, X11Monitor}; 11 | 12 | impl X11Monitor { 13 | #[doc(alias = "gdk_x11_monitor_get_output")] 14 | #[doc(alias = "get_output")] 15 | pub fn output(&self) -> XID { 16 | unsafe { ffi::gdk_x11_monitor_get_output(self.to_glib_none().0) } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gdk4-x11/sys/Gir.toml: -------------------------------------------------------------------------------- 1 | [options] 2 | work_mode = "sys" 3 | library = "GdkX11" 4 | version = "4.0" 5 | min_cfg_version = "4.0.0" 6 | single_version_file = "." 7 | girs_directories = ["../../gir-files"] 8 | 9 | external_libraries = [ 10 | "GLib", 11 | ] 12 | 13 | [external_libraries] 14 | gdk4 = "Gdk" 15 | -------------------------------------------------------------------------------- /gdk4-x11/sys/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /gdk4-x11/sys/build.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #[cfg(not(docsrs))] 6 | use std::process; 7 | 8 | #[cfg(docsrs)] 9 | fn main() {} // prevent linking libraries to avoid documentation failure 10 | 11 | #[cfg(not(docsrs))] 12 | fn main() { 13 | if let Err(s) = system_deps::Config::new().probe() { 14 | println!("cargo:warning={s}"); 15 | process::exit(1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gdk4-x11/sys/tests/layout.c: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #include "manual.h" 6 | #include 7 | #include 8 | 9 | int main() { 10 | printf("%s;%zu;%zu\n", "GdkX11DeviceType", sizeof(GdkX11DeviceType), alignof(GdkX11DeviceType)); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /gdk4-x11/sys/tests/manual.h: -------------------------------------------------------------------------------- 1 | // Feel free to edit this file, it won't be regenerated by gir generator unless removed. 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /gdk4-x11/sys/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4-x11/tests/check_gir.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #[test] 4 | fn check_gir_file() { 5 | let res = gir_format_check::check_gir_file("Gir.toml"); 6 | println!("{res}"); 7 | assert_eq!(res.nb_errors, 0); 8 | } 9 | -------------------------------------------------------------------------------- /gdk4/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gdk4/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gdk4/src/auto/delete_event.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::{prelude::*, translate::*}; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GdkDeleteEvent")] 10 | pub struct DeleteEvent(Shared); 11 | 12 | match fn { 13 | ref => |ptr| ffi::gdk_event_ref(ptr as *mut ffi::GdkEvent), 14 | unref => |ptr| ffi::gdk_event_unref(ptr as *mut ffi::GdkEvent), 15 | } 16 | } 17 | 18 | impl StaticType for DeleteEvent { 19 | fn static_type() -> glib::Type { 20 | unsafe { from_glib(ffi::gdk_delete_event_get_type()) } 21 | } 22 | } 23 | 24 | impl DeleteEvent {} 25 | -------------------------------------------------------------------------------- /gdk4/src/auto/dmabuf_texture.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, Paintable, Texture}; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkDmabufTexture")] 9 | pub struct DmabufTexture(Object) @extends Texture, @implements Paintable, gio::Icon, gio::LoadableIcon; 10 | 11 | match fn { 12 | type_ => || ffi::gdk_dmabuf_texture_get_type(), 13 | } 14 | } 15 | 16 | impl DmabufTexture {} 17 | -------------------------------------------------------------------------------- /gdk4/src/auto/event_sequence.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] 9 | pub struct EventSequence(Boxed); 10 | 11 | match fn { 12 | copy => |ptr| glib::gobject_ffi::g_boxed_copy(ffi::gdk_event_sequence_get_type(), ptr as *mut _) as *mut ffi::GdkEventSequence, 13 | free => |ptr| glib::gobject_ffi::g_boxed_free(ffi::gdk_event_sequence_get_type(), ptr as *mut _), 14 | type_ => || ffi::gdk_event_sequence_get_type(), 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /gdk4/src/auto/motion_event.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::{prelude::*, translate::*}; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GdkMotionEvent")] 10 | pub struct MotionEvent(Shared); 11 | 12 | match fn { 13 | ref => |ptr| ffi::gdk_event_ref(ptr as *mut ffi::GdkEvent), 14 | unref => |ptr| ffi::gdk_event_unref(ptr as *mut ffi::GdkEvent), 15 | } 16 | } 17 | 18 | impl StaticType for MotionEvent { 19 | fn static_type() -> glib::Type { 20 | unsafe { from_glib(ffi::gdk_motion_event_get_type()) } 21 | } 22 | } 23 | 24 | impl MotionEvent {} 25 | -------------------------------------------------------------------------------- /gdk4/src/auto/proximity_event.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::{prelude::*, translate::*}; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GdkProximityEvent")] 10 | pub struct ProximityEvent(Shared); 11 | 12 | match fn { 13 | ref => |ptr| ffi::gdk_event_ref(ptr as *mut ffi::GdkEvent), 14 | unref => |ptr| ffi::gdk_event_unref(ptr as *mut ffi::GdkEvent), 15 | } 16 | } 17 | 18 | impl StaticType for ProximityEvent { 19 | fn static_type() -> glib::Type { 20 | unsafe { from_glib(ffi::gdk_proximity_event_get_type()) } 21 | } 22 | } 23 | 24 | impl ProximityEvent {} 25 | -------------------------------------------------------------------------------- /gdk4/src/auto/snapshot.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GdkSnapshot")] 9 | pub struct Snapshot(Object); 10 | 11 | match fn { 12 | type_ => || ffi::gdk_snapshot_get_type(), 13 | } 14 | } 15 | 16 | impl Snapshot { 17 | pub const NONE: Option<&'static Snapshot> = None; 18 | } 19 | -------------------------------------------------------------------------------- /gdk4/src/auto/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4/src/builders.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Builder pattern types. 5 | 6 | #[cfg(feature = "v4_12")] 7 | #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))] 8 | pub use crate::GLTextureBuilder; 9 | pub use crate::{auto::builders::*, rgba::RGBABuilder, ContentFormatsBuilder}; 10 | -------------------------------------------------------------------------------- /gdk4/src/button_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{ButtonEvent, EventType}; 6 | 7 | define_event! { 8 | ButtonEvent, 9 | crate::ffi::GdkButtonEvent, 10 | &[EventType::ButtonPress, EventType::ButtonRelease] 11 | } 12 | 13 | impl fmt::Debug for ButtonEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("ButtonEvent") 16 | .field("button", &self.button()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gdk4/src/crossing_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{CrossingEvent, EventType}; 6 | 7 | define_event! { 8 | CrossingEvent, 9 | crate::ffi::GdkCrossingEvent, 10 | &[EventType::EnterNotify, EventType::LeaveNotify] 11 | } 12 | 13 | impl fmt::Debug for CrossingEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("PadEvent") 16 | .field("detail", &self.detail()) 17 | .field("focus", &self.gets_focus()) 18 | .field("mode", &self.mode()) 19 | .finish() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gdk4/src/delete_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{DeleteEvent, EventType}; 6 | 7 | define_event! { 8 | DeleteEvent, 9 | crate::ffi::GdkDeleteEvent, 10 | &[EventType::Delete] 11 | } 12 | 13 | impl fmt::Debug for DeleteEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.write_str("DeleteEvent") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gdk4/src/dnd_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{DNDEvent, EventType}; 6 | 7 | define_event! { 8 | DNDEvent, 9 | crate::ffi::GdkDNDEvent, 10 | &[EventType::DragEnter, EventType::DragLeave, EventType::DragMotion, EventType::DropStart] 11 | } 12 | 13 | impl fmt::Debug for DNDEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("DNDEvent") 16 | .field("drop", &self.drop()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gdk4/src/drag_surface_size.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{ffi, prelude::*}; 4 | use glib::translate::*; 5 | 6 | #[repr(transparent)] 7 | #[doc(alias = "GdkDragSurfaceSize")] 8 | pub struct DragSurfaceSize(std::ptr::NonNull); 9 | 10 | impl StaticType for DragSurfaceSize { 11 | fn static_type() -> glib::Type { 12 | unsafe { from_glib(ffi::gdk_drag_surface_size_get_type()) } 13 | } 14 | } 15 | 16 | impl DragSurfaceSize { 17 | #[doc(alias = "gdk_drag_surface_size_set_size")] 18 | pub fn set_size(&self, width: i32, height: i32) { 19 | unsafe { ffi::gdk_drag_surface_size_set_size(self.0.as_ptr(), width, height) } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gdk4/src/focus_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{EventType, FocusEvent}; 6 | 7 | define_event! { 8 | FocusEvent, 9 | crate::ffi::GdkFocusEvent, 10 | &[EventType::FocusChange] 11 | } 12 | 13 | impl fmt::Debug for FocusEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("FocusEvent") 16 | .field("in", &self.is_in()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gdk4/src/grab_broken_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{EventType, GrabBrokenEvent}; 6 | 7 | define_event! { 8 | GrabBrokenEvent, 9 | crate::ffi::GdkGrabBrokenEvent, 10 | &[EventType::GrabBroken] 11 | } 12 | 13 | impl fmt::Debug for GrabBrokenEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("GrabBrokenEvent") 16 | .field("grab_surface", &self.grab_surface()) 17 | .field("implicit", &self.is_implicit()) 18 | .finish() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /gdk4/src/motion_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{EventType, MotionEvent}; 6 | 7 | define_event! { 8 | MotionEvent, 9 | crate::ffi::GdkMotionEvent, 10 | &[EventType::MotionNotify] 11 | } 12 | 13 | impl fmt::Debug for MotionEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.write_str("MotionEvent") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gdk4/src/pad_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{EventType, PadEvent}; 6 | 7 | define_event! { 8 | PadEvent, 9 | crate::ffi::GdkPadEvent, 10 | &[EventType::PadButtonPress, EventType::PadButtonRelease, EventType::PadRing, EventType::PadStrip, EventType::PadGroupMode] 11 | } 12 | 13 | impl fmt::Debug for PadEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("PadEvent") 16 | .field("axis_value", &self.axis_value()) 17 | .field("button", &self.button()) 18 | .field("group_mode", &self.group_mode()) 19 | .finish() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gdk4/src/popup_layout.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::PopupLayout; 6 | 7 | impl PopupLayout { 8 | #[doc(alias = "gdk_popup_layout_get_offset")] 9 | #[doc(alias = "get_offset")] 10 | pub fn offset(&self) -> (i32, i32) { 11 | let mut dx = 0; 12 | let mut dy = 0; 13 | unsafe { 14 | crate::ffi::gdk_popup_layout_get_offset(self.to_glib_none().0, &mut dx, &mut dy); 15 | } 16 | (dx, dy) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gdk4/src/proximity_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{EventType, ProximityEvent}; 6 | 7 | define_event! { 8 | ProximityEvent, 9 | crate::ffi::GdkProximityEvent, 10 | &[EventType::ProximityIn, EventType::ProximityOut] 11 | } 12 | 13 | impl fmt::Debug for ProximityEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.write_str("ProximityEvent") 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gdk4/src/scroll_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{EventType, ScrollEvent}; 6 | 7 | define_event! { 8 | ScrollEvent, 9 | crate::ffi::GdkScrollEvent, 10 | &[EventType::Scroll] 11 | } 12 | 13 | impl fmt::Debug for ScrollEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("ScrollEvent") 16 | .field("deltas", &self.deltas()) 17 | .field("direction", &self.direction()) 18 | .field("is_stop", &self.is_stop()) 19 | .finish() 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gdk4/src/subclass/mod.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for creating custom types. 5 | 6 | pub mod content_provider; 7 | pub mod paintable; 8 | 9 | // rustdoc-stripper-ignore-next 10 | /// Traits intended for blanket imports. 11 | pub mod prelude { 12 | #[doc(hidden)] 13 | pub use gio::subclass::prelude::*; 14 | 15 | pub use super::{ 16 | content_provider::{ContentProviderImpl, ContentProviderImplExt}, 17 | paintable::{PaintableImpl, PaintableImplExt}, 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /gdk4/src/touch_event.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::{EventType, TouchEvent}; 6 | 7 | define_event! { 8 | TouchEvent, 9 | crate::ffi::GdkTouchEvent, 10 | &[EventType::TouchBegin, EventType::TouchUpdate, EventType::TouchEnd, EventType::TouchCancel] 11 | } 12 | 13 | impl fmt::Debug for TouchEvent { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | f.debug_struct("TouchEvent") 16 | .field("is_emulating_pointer", &self.is_emulating_pointer()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gdk4/sys/Gir.toml: -------------------------------------------------------------------------------- 1 | [options] 2 | work_mode = "sys" 3 | library = "Gdk" 4 | version = "4.0" 5 | min_cfg_version = "4.0.0" 6 | single_version_file = "." 7 | split_build_rs = true 8 | girs_directories = ["../../gir-files"] 9 | 10 | external_libraries = [ 11 | "GLib", 12 | "GObject", 13 | "Gio", 14 | "GdkPixbuf", 15 | "Pango", 16 | "Cairo", 17 | ] 18 | -------------------------------------------------------------------------------- /gdk4/sys/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /gdk4/sys/tests/manual.h: -------------------------------------------------------------------------------- 1 | // Feel free to edit this file, it won't be regenerated by gir generator unless removed. 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /gdk4/sys/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gdk4/tests/check_gir.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #[test] 4 | fn check_gir_file() { 5 | let res = gir_format_check::check_gir_file("Gir.toml"); 6 | println!("{res}"); 7 | assert_eq!(res.nb_errors, 0); 8 | } 9 | -------------------------------------------------------------------------------- /generator.py: -------------------------------------------------------------------------------- 1 | ./gir/generator.py -------------------------------------------------------------------------------- /gsk4/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gsk4/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gsk4/src/auto/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gsk4/src/blend_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{BlendNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | BlendNode, 7 | crate::ffi::GskBlendNode, 8 | RenderNodeType::BlendNode 9 | ); 10 | 11 | impl std::fmt::Debug for BlendNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("BlendNode") 14 | .field("blend_mode", &self.blend_mode()) 15 | .field("bottom_child", &self.bottom_child()) 16 | .field("top_child", &self.top_child()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gsk4/src/blur_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{BlurNode, RenderNodeType}; 4 | 5 | define_render_node!(BlurNode, crate::ffi::GskBlurNode, RenderNodeType::BlurNode); 6 | 7 | impl std::fmt::Debug for BlurNode { 8 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 9 | f.debug_struct("BlurNode") 10 | .field("child", &self.child()) 11 | .field("radius", &self.radius()) 12 | .finish() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /gsk4/src/builders.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Builder pattern types. 5 | 6 | #[cfg(feature = "v4_14")] 7 | #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))] 8 | pub use crate::stroke::StrokeBuilder; 9 | pub use crate::{auto::builders::*, color_stop::ColorStopBuilder, ShaderArgsBuilder}; 10 | -------------------------------------------------------------------------------- /gsk4/src/cairo_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{CairoNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | CairoNode, 7 | crate::ffi::GskCairoNode, 8 | RenderNodeType::CairoNode 9 | ); 10 | 11 | impl std::fmt::Debug for CairoNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("CairoNode") 14 | .field("draw_context", &self.draw_context()) 15 | .field("surface", &self.surface()) 16 | .finish() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gsk4/src/clip_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{ClipNode, RenderNodeType}; 4 | 5 | define_render_node!(ClipNode, crate::ffi::GskClipNode, RenderNodeType::ClipNode); 6 | 7 | impl std::fmt::Debug for ClipNode { 8 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 9 | f.debug_struct("ClipNode") 10 | .field("child", &self.child()) 11 | .field("clip", &self.clip()) 12 | .finish() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /gsk4/src/color_matrix_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{ColorMatrixNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | ColorMatrixNode, 7 | crate::ffi::GskColorMatrixNode, 8 | RenderNodeType::ColorMatrixNode 9 | ); 10 | 11 | impl std::fmt::Debug for ColorMatrixNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("ColorMatrixNode") 14 | .field("color_offset", &self.color_offset()) 15 | .field("color_matrix", &self.color_matrix()) 16 | .field("child", &self.child()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gsk4/src/color_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{ColorNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | ColorNode, 7 | crate::ffi::GskColorNode, 8 | RenderNodeType::ColorNode 9 | ); 10 | 11 | impl std::fmt::Debug for ColorNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("ColorNode") 14 | .field("color", &self.color()) 15 | .finish() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gsk4/src/cross_fade_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{CrossFadeNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | CrossFadeNode, 7 | crate::ffi::GskCrossFadeNode, 8 | RenderNodeType::CrossFadeNode 9 | ); 10 | 11 | impl std::fmt::Debug for CrossFadeNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("CrossFadeNode") 14 | .field("start_child", &self.start_child()) 15 | .field("end_child", &self.end_child()) 16 | .field("progress", &self.progress()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gsk4/src/debug_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{DebugNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | DebugNode, 7 | crate::ffi::GskDebugNode, 8 | RenderNodeType::DebugNode 9 | ); 10 | 11 | impl std::fmt::Debug for DebugNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("DebugNode") 14 | .field("child", &self.child()) 15 | .field("message", &self.message()) 16 | .finish() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gsk4/src/fill_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{FillNode, RenderNodeType}; 4 | 5 | define_render_node!(FillNode, crate::ffi::GskFillNode, RenderNodeType::FillNode); 6 | 7 | impl std::fmt::Debug for FillNode { 8 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 9 | f.debug_struct("FillNode") 10 | .field("child", &self.child()) 11 | .field("fill_rule", &self.fill_rule()) 12 | .field("path", &self.path()) 13 | .finish() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gsk4/src/linear_gradient_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{LinearGradientNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | LinearGradientNode, 7 | crate::ffi::GskLinearGradientNode, 8 | RenderNodeType::LinearGradientNode 9 | ); 10 | 11 | impl std::fmt::Debug for LinearGradientNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("LinearGradientNode") 14 | .field("color_stops", &self.color_stops()) 15 | .field("end", &self.end()) 16 | .field("n_color_stops", &self.n_color_stops()) 17 | .field("start", &self.start()) 18 | .finish() 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /gsk4/src/mask_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{MaskNode, RenderNodeType}; 4 | 5 | define_render_node!(MaskNode, crate::ffi::GskMaskNode, RenderNodeType::MaskNode); 6 | 7 | impl std::fmt::Debug for MaskNode { 8 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 9 | f.debug_struct("MaskNode") 10 | .field("mask", &self.mask()) 11 | .field("mask_mode", &self.mask_mode()) 12 | .field("source", &self.source()) 13 | .finish() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gsk4/src/opacity_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{OpacityNode, RenderNodeType}; 4 | 5 | define_render_node!( 6 | OpacityNode, 7 | crate::ffi::GskOpacityNode, 8 | RenderNodeType::OpacityNode 9 | ); 10 | 11 | impl std::fmt::Debug for OpacityNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("OpacityNode") 14 | .field("child", &self.child()) 15 | .field("opacity", &self.opacity()) 16 | .finish() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gsk4/src/path_builder.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::PathBuilder; 6 | 7 | impl PathBuilder { 8 | #[doc(alias = "gsk_path_builder_add_cairo_path")] 9 | pub fn add_cairo_path(&self, path: &cairo::Path) { 10 | unsafe { 11 | crate::ffi::gsk_path_builder_add_cairo_path(self.to_glib_none().0, path.as_ptr()); 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /gsk4/src/prelude.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for blanket imports. 5 | 6 | #[doc(hidden)] 7 | pub use gdk::prelude::*; 8 | 9 | pub use crate::{auto::traits::*, render_node::IsRenderNode}; 10 | -------------------------------------------------------------------------------- /gsk4/src/repeat_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, RepeatNode}; 4 | 5 | define_render_node!( 6 | RepeatNode, 7 | crate::ffi::GskRepeatNode, 8 | RenderNodeType::RepeatNode 9 | ); 10 | 11 | impl std::fmt::Debug for RepeatNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("RepeatNode") 14 | .field("child_bounds", &self.child_bounds()) 15 | .field("child", &self.child()) 16 | .finish() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gsk4/src/repeating_linear_gradient_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, RepeatingLinearGradientNode}; 4 | 5 | define_render_node!( 6 | RepeatingLinearGradientNode, 7 | crate::ffi::GskRepeatingLinearGradientNode, 8 | RenderNodeType::RepeatingLinearGradientNode 9 | ); 10 | 11 | impl std::fmt::Debug for RepeatingLinearGradientNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("RepeatingLinearGradientNode").finish() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gsk4/src/repeating_radial_gradient_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, RepeatingRadialGradientNode}; 4 | 5 | define_render_node!( 6 | RepeatingRadialGradientNode, 7 | crate::ffi::GskRepeatingRadialGradientNode, 8 | RenderNodeType::RepeatingRadialGradientNode 9 | ); 10 | 11 | impl std::fmt::Debug for RepeatingRadialGradientNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("RepeatingRadialGradientNode").finish() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gsk4/src/rounded_clip_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, RoundedClipNode}; 4 | 5 | define_render_node!( 6 | RoundedClipNode, 7 | crate::ffi::GskRoundedClipNode, 8 | RenderNodeType::RoundedClipNode 9 | ); 10 | 11 | impl std::fmt::Debug for RoundedClipNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("RoundedClipNode") 14 | .field("clip", &self.clip()) 15 | .field("child", &self.child()) 16 | .finish() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gsk4/src/stroke_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, StrokeNode}; 4 | 5 | define_render_node!( 6 | StrokeNode, 7 | crate::ffi::GskStrokeNode, 8 | RenderNodeType::StrokeNode 9 | ); 10 | 11 | impl std::fmt::Debug for StrokeNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("StrokeNode") 14 | .field("child", &self.child()) 15 | .field("stroke", &self.stroke()) 16 | .field("path", &self.path()) 17 | .finish() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gsk4/src/texture_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, TextureNode}; 4 | 5 | define_render_node!( 6 | TextureNode, 7 | crate::ffi::GskTextureNode, 8 | RenderNodeType::TextureNode 9 | ); 10 | 11 | impl std::fmt::Debug for TextureNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("TextureNode") 14 | .field("texture", &self.texture()) 15 | .finish() 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gsk4/src/texture_scale_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, TextureScaleNode}; 4 | 5 | define_render_node!( 6 | TextureScaleNode, 7 | crate::ffi::GskTextureScaleNode, 8 | RenderNodeType::TextureScaleNode 9 | ); 10 | 11 | impl std::fmt::Debug for TextureScaleNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("TextureScaleNode") 14 | .field("texture", &self.texture()) 15 | .field("filter", &self.filter()) 16 | .finish() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gsk4/src/transform_node.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{RenderNodeType, TransformNode}; 4 | 5 | define_render_node!( 6 | TransformNode, 7 | crate::ffi::GskTransformNode, 8 | RenderNodeType::TransformNode 9 | ); 10 | 11 | impl std::fmt::Debug for TransformNode { 12 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 13 | f.debug_struct("TransformNode") 14 | .field("child", &self.child()) 15 | .field("transform", &self.transform()) 16 | .finish() 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gsk4/sys/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /gsk4/sys/build.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #[cfg(not(docsrs))] 6 | use std::process; 7 | 8 | #[cfg(docsrs)] 9 | fn main() {} // prevent linking libraries to avoid documentation failure 10 | 11 | #[cfg(not(docsrs))] 12 | fn main() { 13 | if let Err(s) = system_deps::Config::new().probe() { 14 | println!("cargo:warning={s}"); 15 | process::exit(1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gsk4/sys/tests/manual.h: -------------------------------------------------------------------------------- 1 | // Feel free to edit this file, it won't be regenerated by gir generator unless removed. 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /gsk4/sys/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gsk4/tests/check_gir.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #[test] 4 | fn check_gir_file() { 5 | let res = gir_format_check::check_gir_file("Gir.toml"); 6 | println!("{res}"); 7 | assert_eq!(res.nb_errors, 0); 8 | } 9 | -------------------------------------------------------------------------------- /gtk4-macros/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gtk4-macros/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gtk4-macros/src/test/template.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 15 | 16 | -------------------------------------------------------------------------------- /gtk4-macros/src/test/template_callbacks.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16 | 17 | -------------------------------------------------------------------------------- /gtk4-macros/src/util.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use proc_macro2::{Ident, Span}; 4 | use proc_macro_crate::crate_name; 5 | 6 | pub fn crate_ident_new() -> Ident { 7 | use proc_macro_crate::FoundCrate; 8 | 9 | // Use crate name detected from Cargo.toml or "gtk" for use in re-exports 10 | let crate_name = match crate_name("gtk4") { 11 | Ok(FoundCrate::Name(name)) => name, 12 | Ok(FoundCrate::Itself) => "gtk4".to_owned(), 13 | Err(_) => "gtk".to_owned(), 14 | }; 15 | 16 | Ident::new(&crate_name, Span::call_site()) 17 | } 18 | -------------------------------------------------------------------------------- /gtk4-macros/tests/compile-fail/template-callback-arg-after-rest.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use gtk::glib; 4 | use gtk::subclass::prelude::*; 5 | 6 | struct Functions {} 7 | 8 | #[gtk::template_callbacks] 9 | impl Functions { 10 | #[template_callback(function)] 11 | fn after_rest(#[rest] _values: &[glib::Value], bad: i32) {} 12 | } 13 | 14 | fn main() { 15 | gtk::init().unwrap(); 16 | let scope = gtk::BuilderRustScope::new(); 17 | Functions::add_callbacks_to_scope(&scope); 18 | } 19 | -------------------------------------------------------------------------------- /gtk4-macros/tests/compile-fail/template-callback-async-ret-value.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | struct Callbacks; 4 | 5 | #[gtk::template_callbacks] 6 | impl Callbacks { 7 | #[template_callback] 8 | async fn on_clicked(_widget: gtk::Widget) -> String { 9 | "Hello".into() 10 | } 11 | } 12 | 13 | fn main() {} 14 | 15 | -------------------------------------------------------------------------------- /gtk4-macros/tests/compile-fail/template-callback-duplicate-rest.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use gtk::glib; 4 | use gtk::subclass::prelude::*; 5 | 6 | struct Functions {} 7 | 8 | #[gtk::template_callbacks] 9 | impl Functions { 10 | #[template_callback(function)] 11 | fn after_rest(#[rest] #[rest] _values: &[glib::Value]) {} 12 | } 13 | 14 | fn main() { 15 | gtk::init().unwrap(); 16 | let scope = gtk::BuilderRustScope::new(); 17 | Functions::add_callbacks_to_scope(&scope); 18 | } 19 | -------------------------------------------------------------------------------- /gtk4-macros/tests/compile-fail/template-callback-duplicate.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | // 3 | use gtk::subclass::prelude::*; 4 | 5 | struct Functions {} 6 | 7 | #[gtk::template_callbacks] 8 | impl Functions { 9 | #[template_callback] 10 | #[template_callback] 11 | fn the_duplicate() {} 12 | } 13 | 14 | fn main() { 15 | gtk::init().unwrap(); 16 | let scope = gtk::BuilderRustScope::new(); 17 | Functions::add_callbacks_to_scope(&scope); 18 | } 19 | -------------------------------------------------------------------------------- /gtk4-macros/tests/my_widget.blp: -------------------------------------------------------------------------------- 1 | using Gtk 4.0; 2 | template $MyWidget5 { 3 | Label label { 4 | label: 'foobar'; 5 | } 6 | 7 | Label my_label2 { 8 | label: 'foobaz'; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /gtk4/COPYRIGHT: -------------------------------------------------------------------------------- 1 | ../COPYRIGHT -------------------------------------------------------------------------------- /gtk4/LICENSE: -------------------------------------------------------------------------------- 1 | ../LICENSE -------------------------------------------------------------------------------- /gtk4/src/assistant.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::Assistant; 6 | 7 | impl Assistant { 8 | #[doc(alias = "gtk_assistant_set_forward_page_func")] 9 | #[doc(alias = "set_forward_page_func")] 10 | pub fn unset_forward_page_func(&self) { 11 | unsafe { 12 | crate::ffi::gtk_assistant_set_forward_page_func( 13 | self.to_glib_none().0, 14 | None, 15 | std::ptr::null_mut(), 16 | None, 17 | ); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /gtk4/src/auto/alias.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #[allow(unused_imports)] 6 | use crate::auto::*; 7 | 8 | #[doc(alias = "GtkAllocation")] 9 | pub type Allocation = gdk::Rectangle; 10 | -------------------------------------------------------------------------------- /gtk4/src/auto/builder_scope.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::prelude::*; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GtkBuilderScope")] 10 | pub struct BuilderScope(Interface); 11 | 12 | match fn { 13 | type_ => || ffi::gtk_builder_scope_get_type(), 14 | } 15 | } 16 | 17 | impl BuilderScope { 18 | pub const NONE: Option<&'static BuilderScope> = None; 19 | } 20 | 21 | pub trait BuilderScopeExt: IsA + 'static {} 22 | 23 | impl> BuilderScopeExt for O {} 24 | -------------------------------------------------------------------------------- /gtk4/src/auto/callback_action.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, ShortcutAction}; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GtkCallbackAction")] 9 | pub struct CallbackAction(Object) @extends ShortcutAction; 10 | 11 | match fn { 12 | type_ => || ffi::gtk_callback_action_get_type(), 13 | } 14 | } 15 | 16 | impl CallbackAction {} 17 | -------------------------------------------------------------------------------- /gtk4/src/auto/constraint_layout_child.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, LayoutChild}; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GtkConstraintLayoutChild")] 9 | pub struct ConstraintLayoutChild(Object) @extends LayoutChild; 10 | 11 | match fn { 12 | type_ => || ffi::gtk_constraint_layout_child_get_type(), 13 | } 14 | } 15 | 16 | impl ConstraintLayoutChild {} 17 | -------------------------------------------------------------------------------- /gtk4/src/auto/constraint_target.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::prelude::*; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GtkConstraintTarget")] 10 | pub struct ConstraintTarget(Interface); 11 | 12 | match fn { 13 | type_ => || ffi::gtk_constraint_target_get_type(), 14 | } 15 | } 16 | 17 | impl ConstraintTarget { 18 | pub const NONE: Option<&'static ConstraintTarget> = None; 19 | } 20 | 21 | pub trait ConstraintTargetExt: IsA + 'static {} 22 | 23 | impl> ConstraintTargetExt for O {} 24 | -------------------------------------------------------------------------------- /gtk4/src/auto/custom_filter.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, Filter}; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GtkCustomFilter")] 9 | pub struct CustomFilter(Object) @extends Filter; 10 | 11 | match fn { 12 | type_ => || ffi::gtk_custom_filter_get_type(), 13 | } 14 | } 15 | 16 | impl CustomFilter {} 17 | -------------------------------------------------------------------------------- /gtk4/src/auto/custom_sorter.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, Sorter}; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GtkCustomSorter")] 9 | pub struct CustomSorter(Object) @extends Sorter; 10 | 11 | match fn { 12 | type_ => || ffi::gtk_custom_sorter_get_type(), 13 | } 14 | } 15 | 16 | impl CustomSorter {} 17 | -------------------------------------------------------------------------------- /gtk4/src/auto/list_base.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, Accessible, Buildable, ConstraintTarget, Orientable, Scrollable, Widget}; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GtkListBase")] 9 | pub struct ListBase(Object) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, Orientable, Scrollable; 10 | 11 | match fn { 12 | type_ => || ffi::gtk_list_base_get_type(), 13 | } 14 | } 15 | 16 | impl ListBase { 17 | pub const NONE: Option<&'static ListBase> = None; 18 | } 19 | -------------------------------------------------------------------------------- /gtk4/src/auto/list_item_factory.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | 7 | glib::wrapper! { 8 | #[doc(alias = "GtkListItemFactory")] 9 | pub struct ListItemFactory(Object); 10 | 11 | match fn { 12 | type_ => || ffi::gtk_list_item_factory_get_type(), 13 | } 14 | } 15 | 16 | impl ListItemFactory { 17 | pub const NONE: Option<&'static ListItemFactory> = None; 18 | } 19 | -------------------------------------------------------------------------------- /gtk4/src/auto/never_trigger.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::{ffi, ShortcutTrigger}; 6 | use glib::translate::*; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GtkNeverTrigger")] 10 | pub struct NeverTrigger(Object) @extends ShortcutTrigger; 11 | 12 | match fn { 13 | type_ => || ffi::gtk_never_trigger_get_type(), 14 | } 15 | } 16 | 17 | impl NeverTrigger { 18 | #[doc(alias = "gtk_never_trigger_get")] 19 | pub fn get() -> NeverTrigger { 20 | assert_initialized_main_thread!(); 21 | unsafe { from_glib_none(ffi::gtk_never_trigger_get()) } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /gtk4/src/auto/shortcut_manager.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::prelude::*; 7 | 8 | glib::wrapper! { 9 | #[doc(alias = "GtkShortcutManager")] 10 | pub struct ShortcutManager(Interface); 11 | 12 | match fn { 13 | type_ => || ffi::gtk_shortcut_manager_get_type(), 14 | } 15 | } 16 | 17 | impl ShortcutManager { 18 | pub const NONE: Option<&'static ShortcutManager> = None; 19 | } 20 | 21 | pub trait ShortcutManagerExt: IsA + 'static {} 22 | 23 | impl> ShortcutManagerExt for O {} 24 | -------------------------------------------------------------------------------- /gtk4/src/auto/tree_iter.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | use crate::ffi; 6 | use glib::translate::*; 7 | 8 | glib::wrapper! { 9 | #[derive(Debug)] 10 | pub struct TreeIter(BoxedInline); 11 | 12 | match fn { 13 | copy => |ptr| ffi::gtk_tree_iter_copy(mut_override(ptr)), 14 | free => |ptr| ffi::gtk_tree_iter_free(ptr), 15 | type_ => || ffi::gtk_tree_iter_get_type(), 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gtk4/src/auto/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gtk4/src/builder_cscope.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{ffi, BuilderScope}; 4 | 5 | glib::wrapper! { 6 | #[doc(alias = "GtkBuilderCScope")] 7 | pub struct BuilderCScope(Object) @implements BuilderScope; 8 | 9 | match fn { 10 | type_ => || ffi::gtk_builder_cscope_get_type(), 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /gtk4/src/builders.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Builder pattern types. 5 | 6 | pub use crate::{ 7 | auto::builders::*, bookmark_list::BookmarkListBuilder, border::BorderBuilder, 8 | directory_list::DirectoryListBuilder, param_spec_expression::ParamSpecExpressionBuilder, 9 | }; 10 | -------------------------------------------------------------------------------- /gtk4/src/im_context_simple.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::path::Path; 4 | 5 | use glib::translate::*; 6 | 7 | use crate::IMContextSimple; 8 | 9 | impl IMContextSimple { 10 | #[doc(alias = "gtk_im_context_simple_add_compose_file")] 11 | pub fn add_compose_file(&self, compose_file: impl AsRef) { 12 | unsafe { 13 | let compose_file = compose_file.as_ref(); 14 | crate::ffi::gtk_im_context_simple_add_compose_file( 15 | self.to_glib_none().0, 16 | compose_file.to_glib_none().0, 17 | ); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /gtk4/src/label.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::Label; 6 | 7 | impl Label { 8 | #[doc(alias = "gtk_label_get_mnemonic_keyval")] 9 | #[doc(alias = "get_mnemonic_keyval")] 10 | pub fn mnemonic_keyval(&self) -> gdk::Key { 11 | unsafe { 12 | from_glib(crate::ffi::gtk_label_get_mnemonic_keyval( 13 | self.to_glib_none().0, 14 | )) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gtk4/src/media_stream.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::{prelude::*, MediaStream}; 6 | 7 | pub trait MediaStreamExtManual: IsA + 'static { 8 | #[doc(alias = "gtk_media_stream_gerror")] 9 | #[doc(alias = "gtk_media_stream_error")] 10 | #[doc(alias = "gerror")] 11 | fn set_error(&self, error: glib::Error) { 12 | unsafe { 13 | crate::ffi::gtk_media_stream_gerror( 14 | self.as_ref().to_glib_none().0, 15 | mut_override(error.into_glib_ptr()), 16 | ); 17 | } 18 | } 19 | } 20 | 21 | impl> MediaStreamExtManual for O {} 22 | -------------------------------------------------------------------------------- /gtk4/src/menu_button.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::MenuButton; 6 | 7 | impl MenuButton { 8 | #[doc(alias = "gtk_menu_button_set_create_popup_func")] 9 | #[doc(alias = "set_create_popup_func")] 10 | pub fn unset_create_popup_func(&self) { 11 | unsafe { 12 | crate::ffi::gtk_menu_button_set_create_popup_func( 13 | self.to_glib_none().0, 14 | None, 15 | std::ptr::null_mut(), 16 | None, 17 | ); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /gtk4/src/print_operation.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::PrintOperation; 6 | 7 | impl PrintOperation { 8 | #[doc(alias = "gtk_print_operation_get_error")] 9 | #[doc(alias = "get_error")] 10 | pub fn error(&self) -> Option { 11 | unsafe { 12 | let mut error = std::ptr::null_mut(); 13 | crate::ffi::gtk_print_operation_get_error(self.to_glib_none().0, &mut error); 14 | if error.is_null() { 15 | None 16 | } else { 17 | Some(from_glib_full(error)) 18 | } 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /gtk4/src/print_settings.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::{PageRange, PrintSettings}; 6 | 7 | impl PrintSettings { 8 | #[doc(alias = "gtk_print_settings_set_page_ranges")] 9 | pub fn set_page_ranges(&self, page_ranges: &[PageRange]) { 10 | let num_ranges = page_ranges.len() as i32; 11 | unsafe { 12 | crate::ffi::gtk_print_settings_set_page_ranges( 13 | self.to_glib_none().0, 14 | mut_override(page_ranges.to_glib_none().0), 15 | num_ranges, 16 | ); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gtk4/src/requisition.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use std::fmt; 4 | 5 | use crate::Requisition; 6 | 7 | impl Requisition { 8 | #[inline] 9 | pub fn width(&self) -> i32 { 10 | self.inner.width 11 | } 12 | 13 | #[inline] 14 | pub fn height(&self) -> i32 { 15 | self.inner.height 16 | } 17 | } 18 | 19 | impl fmt::Debug for Requisition { 20 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 21 | f.debug_struct("Requisition") 22 | .field("width", &self.width()) 23 | .field("height", &self.height()) 24 | .finish() 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /gtk4/src/shortcut.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use crate::{prelude::*, Shortcut, ShortcutAction, ShortcutTrigger}; 4 | 5 | impl Shortcut { 6 | #[doc(alias = "gtk_shortcut_new_with_arguments")] 7 | #[doc(alias = "new_with_arguments")] 8 | pub fn with_arguments( 9 | trigger: Option>, 10 | action: Option>, 11 | args: &glib::Variant, 12 | ) -> Self { 13 | assert_initialized_main_thread!(); 14 | let shortcut = Shortcut::new(trigger, action); 15 | shortcut.set_arguments(Some(args)); 16 | shortcut 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gtk4/src/subclass/application_window.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for subclassing [`ApplicationWindow`]. 5 | 6 | use crate::{prelude::*, subclass::prelude::*, ApplicationWindow}; 7 | 8 | pub trait ApplicationWindowImpl: 9 | WindowImpl 10 | + ObjectSubclass + IsA + IsA> 11 | + 'static 12 | { 13 | } 14 | 15 | unsafe impl IsSubclassable for ApplicationWindow {} 16 | -------------------------------------------------------------------------------- /gtk4/src/subclass/box_.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for subclassing [`Box`]. 5 | 6 | use crate::{prelude::*, subclass::prelude::*, Box}; 7 | 8 | pub trait BoxImpl: WidgetImpl + ObjectSubclass> {} 9 | 10 | unsafe impl IsSubclassable for Box {} 11 | -------------------------------------------------------------------------------- /gtk4/src/subclass/fixed.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for subclassing [`Fixed`]. 5 | 6 | use crate::{prelude::*, subclass::prelude::*, Fixed}; 7 | 8 | pub trait FixedImpl: WidgetImpl + ObjectSubclass> {} 9 | 10 | unsafe impl IsSubclassable for Fixed {} 11 | -------------------------------------------------------------------------------- /gtk4/src/subclass/grid.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for subclassing [`Grid`]. 5 | 6 | use crate::{prelude::*, subclass::prelude::*, Grid, Orientable}; 7 | 8 | pub trait GridImpl: WidgetImpl + ObjectSubclass + IsA> {} 9 | 10 | unsafe impl IsSubclassable for Grid {} 11 | -------------------------------------------------------------------------------- /gtk4/src/subclass/layout_child.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for subclassing [`LayoutChild`]. 5 | 6 | use crate::{prelude::*, subclass::prelude::*, LayoutChild}; 7 | 8 | pub trait LayoutChildImpl: ObjectImpl + ObjectSubclass> {} 9 | 10 | unsafe impl IsSubclassable for LayoutChild { 11 | fn class_init(class: &mut glib::Class) { 12 | Self::parent_class_init::(class); 13 | 14 | assert_initialized_main_thread!(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /gtk4/src/subclass/orientable.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for implementing the [`Orientable`] interface. 5 | 6 | use crate::{prelude::*, subclass::prelude::*, Orientable}; 7 | 8 | pub trait OrientableImpl: ObjectImpl + ObjectSubclass> {} 9 | 10 | unsafe impl IsImplementable for Orientable {} 11 | -------------------------------------------------------------------------------- /gtk4/src/subclass/window_group.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | // rustdoc-stripper-ignore-next 4 | //! Traits intended for subclassing [`WindowGroup`]. 5 | 6 | use crate::{prelude::*, subclass::prelude::*, WindowGroup}; 7 | 8 | pub trait WindowGroupImpl: ObjectImpl + ObjectSubclass> {} 9 | 10 | unsafe impl IsSubclassable for WindowGroup {} 11 | -------------------------------------------------------------------------------- /gtk4/src/tree_path.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::{translate::*, Slice}; 4 | 5 | use crate::TreePath; 6 | 7 | impl TreePath { 8 | #[doc(alias = "gtk_tree_path_get_indices_with_depth")] 9 | #[doc(alias = "get_indices")] 10 | #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] 11 | #[allow(deprecated)] 12 | pub fn indices(&self) -> Slice { 13 | unsafe { 14 | let mut count = 0; 15 | let ptr = crate::ffi::gtk_tree_path_get_indices_with_depth( 16 | mut_override(self.to_glib_none().0), 17 | &mut count, 18 | ); 19 | Slice::from_glib_none_num(ptr, count as usize) 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /gtk4/src/tree_selection.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | use glib::translate::*; 4 | 5 | use crate::TreeSelection; 6 | 7 | impl TreeSelection { 8 | #[doc(alias = "gtk_tree_selection_set_select_function")] 9 | #[doc(alias = "set_select_function")] 10 | #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")] 11 | #[allow(deprecated)] 12 | pub fn unset_select_function(&self) { 13 | unsafe { 14 | crate::ffi::gtk_tree_selection_set_select_function( 15 | self.to_glib_none().0, 16 | None, 17 | std::ptr::null_mut(), 18 | None, 19 | ); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /gtk4/sys/Gir.toml: -------------------------------------------------------------------------------- 1 | [options] 2 | work_mode = "sys" 3 | library = "Gtk" 4 | version = "4.0" 5 | min_cfg_version = "4.0.0" 6 | single_version_file = "." 7 | girs_directories = ["../../gir-files"] 8 | 9 | external_libraries = [ 10 | "GLib", 11 | "GObject", 12 | "Gio", 13 | "GdkPixbuf", 14 | "Pango", 15 | "Cairo", 16 | "Graphene", 17 | ] 18 | 19 | ignore = [ 20 | "Gtk.BINARY_AGE", 21 | "Gtk.INTERFACE_AGE", 22 | "Gtk.MAJOR_VERSION", 23 | "Gtk.MICRO_VERSION", 24 | "Gtk.MINOR_VERSION", 25 | ] 26 | 27 | [external_libraries] 28 | gdk4 = "Gdk" 29 | gsk4 = "Gsk" 30 | 31 | [[object]] 32 | name = "Gtk.ExpressionWatch" 33 | status = "generate" 34 | [[object.function]] 35 | name = "get_type" 36 | version = "4.2" 37 | 38 | -------------------------------------------------------------------------------- /gtk4/sys/LICENSE: -------------------------------------------------------------------------------- 1 | ../../LICENSE -------------------------------------------------------------------------------- /gtk4/sys/build.rs: -------------------------------------------------------------------------------- 1 | // This file was generated by gir (https://github.com/gtk-rs/gir) 2 | // from gir-files (https://github.com/gtk-rs/gir-files) 3 | // DO NOT EDIT 4 | 5 | #[cfg(not(docsrs))] 6 | use std::process; 7 | 8 | #[cfg(docsrs)] 9 | fn main() {} // prevent linking libraries to avoid documentation failure 10 | 11 | #[cfg(not(docsrs))] 12 | fn main() { 13 | if let Err(s) = system_deps::Config::new().probe() { 14 | println!("cargo:warning={s}"); 15 | process::exit(1); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /gtk4/sys/tests/manual.h: -------------------------------------------------------------------------------- 1 | // Feel free to edit this file, it won't be regenerated by gir generator unless removed. 2 | 3 | #include 4 | #include 5 | -------------------------------------------------------------------------------- /gtk4/sys/versions.txt: -------------------------------------------------------------------------------- 1 | Generated by gir (https://github.com/gtk-rs/gir @ b2a1c6f9b362) 2 | from gir-files (https://github.com/gtk-rs/gir-files @ f5f1ab94657c) 3 | -------------------------------------------------------------------------------- /gtk4/tests/check_gir.rs: -------------------------------------------------------------------------------- 1 | // Take a look at the license at the top of the repository in the LICENSE file. 2 | 3 | #[test] 4 | fn check_gir_file() { 5 | let res = gir_format_check::check_gir_file("Gir.toml"); 6 | println!("{res}"); 7 | assert_eq!(res.nb_errors, 0); 8 | } 9 | -------------------------------------------------------------------------------- /rustfmt.toml: -------------------------------------------------------------------------------- 1 | edition = "2021" 2 | --------------------------------------------------------------------------------