summaryrefslogtreecommitdiff
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2025-07-02kconfig: gconf: remove GtkHandleBox from gladeMasahiro Yamada1-9/+0
GtkHandleBox is deprecated with GTK 3.4. [1] [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.4.0/gtk/deprecated/gtkhandlebox.c#L426 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: use gtk_dialog_get_content_area() accessorMasahiro Yamada1-2/+3
GTK 3 removes many implementation details and struct members from its public headers. Use the gtk_check_menu_item_get_active() accessor. [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/compiling.sgml#L85 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: use gtk_check_menu_item_get_active() accessorMasahiro Yamada1-3/+3
GTK 3 removes many implementation details and struct members from its public headers. Use the gtk_check_menu_item_get_active() accessor. [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/compiling.sgml#L85 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: remove unnecessary default message in text viewMasahiro Yamada1-1/+0
This message looks odd because it is displayed when nothing is selected. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: replace "tooltip" property with "tooltip-text"Masahiro Yamada1-17/+17
This is no longer available in GTK 3. Use "tooltip-text" instead. Also reword "Goes up of one level" to "Goes up one level" while I am here. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: remove "tooltips" property from gladeMasahiro Yamada1-1/+0
The tips are still displayed without this. This property does not exist in GtkBuilder with GTK 3. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: replace GTK_STOCK_{OK,NO,CANCEL}Masahiro Yamada1-3/+3
These are deprecated with GTK 3.10. [1] Use "_OK", "_no", "_Cancel". [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/3.10.0/gtk/deprecated/gtkstock.h#L827 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: replace GDK_space with GDK_KEY_spaceMasahiro Yamada1-1/+1
In GTK3, keysyms changed to have a KEY_ prefix. [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gdk/gdkkeysyms-compat.h#L24 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: remove dead code in display_tree_part()Masahiro Yamada1-4/+1
This function is no longer called in the FULL_VIEW mode, so remove the dead code. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: inline display_list() into set_view_mode()Masahiro Yamada1-11/+3
This function is now only called by set_view_mode(), so inline it for simplicity. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: do not reconstruct tree store when a symbol is changedMasahiro Yamada1-18/+11
There is no need to reconstruct the entire tree store when a symbol's value changes. Simply call gtk_tree_store_set() to update the row data. Introduce update_trees() to factor out the common update logic. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: inline fill_row() into set_node()Masahiro Yamada1-166/+106
The row[] array is used to prepare data passed to set_node(), but this indirection is unnecessary. Squash fill_row() into set_node() and call gtk_tree_store_set() directly. Also, calling gdk_pixbuf_new_from_xpm_data() for every row is inefficient. Call it once and store the resulting pixbuf in a global variable. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: remove init_tree_model()Masahiro Yamada1-20/+16
Move the relevant code into init_left_tree() or init_right_tree(). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: remove global 'model1' and 'model2' variablesMasahiro Yamada1-5/+2
These variables are unnecessary because the current model can be retrieved using gtk_tree_view_get_model(). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org>
2025-07-02kconfig: gconf: use GtkTreeModelFilter to control row visibilityMasahiro Yamada1-137/+80
Currently, update_tree() adds/removes entries to show/hide rows. This approach is extremely complicated. Use the tree model filter to control row visibility instead. Do not toggle the MENU_CHANGED flag, as it is hard to control this correctly. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: preserve menu selection when switching view modeMasahiro Yamada1-8/+79
Preserve the current menu selection when switching to a different view mode, as it improves usability. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: merge 'current' and 'browsed' global variablesMasahiro Yamada1-19/+13
The 'current' (SINGLE view) and 'browsed' (SPLIT_VIEW) variables serve similar purposes and are not needed at the same time. Merge them. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: remove global 'tree' variableMasahiro Yamada1-21/+21
Pass the tree store as a function parameter to make it clearer which tree is being updated. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: make introduction, about, license dialogs modalMasahiro Yamada1-12/+6
These are modal dialogs in xconfig. Make them modal in gconfig as well. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
2025-07-02kconfig: gconf: refactor replace_button_icon()Masahiro Yamada1-15/+5
The "window" and "style" arguments for replace_button_icon() are now unused. Remove them and refactor the function accordingly. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: use GdkPixbuf in replace_button_icon()Masahiro Yamada1-7/+6
gdk_pixmap_create_from_xpm_d has been deprecated since version 2.22. Use a GdkPixbuf instead. You can use gdk_pixbuf_new_from_xpm_data() to create it. [1] [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gdk/gdkpixmap.c#L742 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: use GtkFileChooser in on_save_as1_activate()Masahiro Yamada1-27/+25
gtk_file_selection_new() is deprecated, and gtk_file_chooser_dialog_new() should be used instead. [1] [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/tmpl/gtkfilesel.sgml?ref_type=tags#L156 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
2025-07-02kconfig: gconf: use GtkFileChooser in on_load1_activate()Masahiro Yamada1-27/+27
gtk_file_selection_new() is deprecated, and gtk_file_chooser_dialog_new() should be used instead. [1] [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/docs/reference/gtk/tmpl/gtkfilesel.sgml?ref_type=tags#L156 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
2025-07-02kconfig: gconf: add on_save_clicked() event handlerMasahiro Yamada1-1/+6
The "clicked" event handler for GtkToolButton takes the GtkToolButton* as the first parameter. This is different from the existing on_save_activate() handler. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: avoid hardcoding model* in on_treeview*_button_press_event()Masahiro Yamada1-4/+6
It is better not to hardcode model1 or model2 for consistency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: avoid hardcoding model2 in renderer_edited()Masahiro Yamada1-4/+6
Although this is only used in the right tree view, it is better not to hardcode model2 for consistency. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: avoid hardcoding model2 in on_treeview2_cursor_changed()Masahiro Yamada1-2/+3
The on_treeview2_cursor_changed() handler is connected to both the left and right tree views, but it hardcodes model2 (the GtkTreeModel of the right tree view). This is incorrect. Get the associated model from the view. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: make key_press_event work in left pane tooMasahiro Yamada1-4/+3
Currently, on_treeview2_key_press_event() returns early for the tree1 widget. We can make it work on the left pane as well by avoiding the hardcoded use of model2. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: remove glade_xml_signal_autoconnect() callMasahiro Yamada1-1/+0
Now that all signals are connected manually, this is no longer necessary. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: add static qualifiers to event handlersMasahiro Yamada2-83/+125
This fixes several -Wmissing-prototypes warnings. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org>
2025-07-02kconfig: gconf: move button1 and save1 initialization codeMasahiro Yamada1-4/+8
Move the relevant initialization code closer together. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: move the main window event handlers belowMasahiro Yamada1-85/+78
This allows removal of the forward delcaration of on_save_activate(). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-02kconfig: gconf: grey out button for current viewMasahiro Yamada1-2/+13
This clarifies which view is currently selected. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org>
2025-07-02kconfig: gconf: refactor view setting codeMasahiro Yamada1-36/+38
Factor out common code for setting the view into a new function, set_view_mode(). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org>
2025-07-02docs: kdoc: pretty up dump_enum()Jonathan Corbet1-14/+25
Add some comments to dump_enum to help the next person who has to figure out what it is actually doing. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-07-01docs: kdoc: some tweaks to process_proto_function()Jonathan Corbet1-19/+24
Add a set of comments to process_proto_function and reorganize the logic slightly; no functional change. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-07-01docs: kdoc: rework type prototype parsingJonathan Corbet1-18/+25
process_proto_type() is using a complex regex and a "while True" loop to split a declaration into chunks and, in the end, count brackets. Switch to using a simpler regex to just do the split directly, and handle each chunk as it comes. The result is, IMO, easier to understand and reason about. The old algorithm would occasionally elide the space between function parameters; see struct rng_alg->generate(), foe example. The only output difference is to not elide that space, which is more correct. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
2025-07-01docs: kdoc: split the processing of the two remaining inline statesJonathan Corbet1-19/+18
Now that "inline_*" are just ordinary parser states, split them into two separate functions, getting rid of some nested conditional logic. The original process_inline() would simply ignore lines that didn't match any of the regexes (those lacking the initial " * " marker). I have preserved that behavior, but we should perhaps emit a warning instead. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-9-corbet@lwn.net
2025-07-01docs: kdoc: remove the inline states-within-a-stateJonathan Corbet1-30/+13
The processing of inline kerneldoc comments is a state like the rest, but it was implemented as a set of separate substates. Just remove the substate logic and make the inline states normal ones like the rest. INLINE_ERROR was never actually used for anything, so just take it out. No changes to the generated output. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-8-corbet@lwn.net
2025-07-01docs: kdoc: remove the INLINE_END stateJonathan Corbet1-3/+1
It is never used, so just get rid of it. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-7-corbet@lwn.net
2025-07-01docs: kdoc: rework process_export() slightlyJonathan Corbet1-16/+14
Reorganize process_export() to eliminate duplicated code, don't look for exports in states where we don't expect them, and don't bother with normal state-machine processing if an export declaration has been found. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-6-corbet@lwn.net
2025-07-01docs: kdoc: remove KernelEntry::functionJonathan Corbet1-1/+0
This member is unused, to take it out. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-5-corbet@lwn.net
2025-07-01docs: kdoc: remove a bit of dead codeJonathan Corbet1-7/+0
The type_param regex matches "@..." just fine, so the special-case branch for that in dump_section() is never executed. Just remove it. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-4-corbet@lwn.net
2025-07-01docs: kdoc: Move content handling into KernelEntryJonathan Corbet1-32/+30
Rather than having other code mucking around with this bit of internal state, encapsulate it internally. Accumulate the description as a list of strings, joining them at the end, which is a more efficient way of building the text. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-3-corbet@lwn.net
2025-07-01docs: kdoc: remove KernelEntry::in_doc_sectJonathan Corbet1-4/+0
This field is not used for anything, just get rid of it. Reviewed-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/20250627184000.132291-2-corbet@lwn.net
2025-07-01kconfig: gconf: move init_*() functions belowMasahiro Yamada1-228/+222
This allows removal of the forward declaration of renderer_edited(). Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-01kconfig: gconf: add static qualifiers to variablesMasahiro Yamada1-14/+14
I also removed unnecessary initializers. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-01kconfig: gconf: remove unused 'color' variableMasahiro Yamada1-1/+0
This is not used at all. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-01kconfig: gconf: remove unneeded variables in on_treeview*_button_press_event()Masahiro Yamada1-11/+3
Not all position parameters are used here. Passing NULL to gtk_tree_view_get_cursor() or gtk_tree_view_get_path_at_pos() is allowed. [1] [2] [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12638 [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtktreeview.c#L12795 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
2025-07-01kconfig: gconf: remove unneeded variable in on_split_clicked()Masahiro Yamada1-2/+2
The height of the window is not used here. Passing NULL to gtk_window_get_default_size() is allowed. [1] [1]: https://gitlab.gnome.org/GNOME/gtk/-/blob/2.24.33/gtk/gtkwindow.c#L3974 Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>