Skip to content

Commit

Permalink
Merge branch 'topic/obsolescent_stock' into 'master'
Browse files Browse the repository at this point in the history
Mark Gtk.Stock constants as obsolescent

See merge request eng/ide/gtkada!20
  • Loading branch information
AnthonyLeonardoGracio committed Jun 27, 2024
2 parents 502097c + 9986ed6 commit 7cfccda
Show file tree
Hide file tree
Showing 7 changed files with 576 additions and 30 deletions.
22 changes: 19 additions & 3 deletions contrib/binding.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def __init__(self, files):
for cl in root.findall(k):
self.constants[cl.get(ctype_qname)] = cl


# Some <record> are defined with methods. They are bound the same
# way in GtkAda, except that they do not derive from GObject

Expand Down Expand Up @@ -2564,10 +2565,25 @@ def constants_binding(self, section, regexp, prefix):
type = node.findall(ntype)
ctype = type[0].get(ctype_qname)
ftype = naming.type(name="", cname=ctype)
deprecated = node.get("deprecated")
deprecated_version = node.get("deprecated-version")

constant_str = '%s : constant %s := "%s";' % (
name,
ftype.ada,
node.get("value"),
)

if deprecated:
if deprecated_version:
constant_str += (
'\npragma Obsolescent (%s, Message => "Deprecated since %s");\n'
% (name, node.get("deprecated-version"))
)
else:
constant_str += '\npragma Obsolescent (%s);\n' % (name)

constants.append(
'%s : constant %s := "%s";' %
(name, ftype.ada, node.get("value")))
constants.append(constant_str)

constants.sort()
section.add("\n".join(constants))
Expand Down
209 changes: 209 additions & 0 deletions src/generated/gtk-stock.ads
Original file line number Diff line number Diff line change
Expand Up @@ -29,110 +29,319 @@ with Gtkada.Types; use Gtkada.Types;
package Gtk.Stock is

Stock_About : constant UTF8_String := "gtk-about";
pragma Obsolescent (Stock_About, Message => "Deprecated since 3.10");

Stock_Add : constant UTF8_String := "gtk-add";
pragma Obsolescent (Stock_Add, Message => "Deprecated since 3.10");

Stock_Apply : constant UTF8_String := "gtk-apply";
pragma Obsolescent (Stock_Apply, Message => "Deprecated since 3.10");

Stock_Bold : constant UTF8_String := "gtk-bold";
pragma Obsolescent (Stock_Bold, Message => "Deprecated since 3.10");

Stock_Cancel : constant UTF8_String := "gtk-cancel";
pragma Obsolescent (Stock_Cancel, Message => "Deprecated since 3.10");

Stock_Caps_Lock_Warning : constant UTF8_String := "gtk-caps-lock-warning";
pragma Obsolescent (Stock_Caps_Lock_Warning, Message => "Deprecated since 3.10");

Stock_Cdrom : constant UTF8_String := "gtk-cdrom";
pragma Obsolescent (Stock_Cdrom, Message => "Deprecated since 3.10");

Stock_Clear : constant UTF8_String := "gtk-clear";
pragma Obsolescent (Stock_Clear, Message => "Deprecated since 3.10");

Stock_Close : constant UTF8_String := "gtk-close";
pragma Obsolescent (Stock_Close, Message => "Deprecated since 3.10");

Stock_Color_Picker : constant UTF8_String := "gtk-color-picker";
pragma Obsolescent (Stock_Color_Picker, Message => "Deprecated since 3.10");

Stock_Connect : constant UTF8_String := "gtk-connect";
pragma Obsolescent (Stock_Connect, Message => "Deprecated since 3.10");

Stock_Convert : constant UTF8_String := "gtk-convert";
pragma Obsolescent (Stock_Convert, Message => "Deprecated since 3.10");

Stock_Copy : constant UTF8_String := "gtk-copy";
pragma Obsolescent (Stock_Copy, Message => "Deprecated since 3.10");

Stock_Cut : constant UTF8_String := "gtk-cut";
pragma Obsolescent (Stock_Cut, Message => "Deprecated since 3.10");

Stock_Delete : constant UTF8_String := "gtk-delete";
pragma Obsolescent (Stock_Delete, Message => "Deprecated since 3.10");

Stock_Dialog_Authentication : constant UTF8_String := "gtk-dialog-authentication";
pragma Obsolescent (Stock_Dialog_Authentication, Message => "Deprecated since 3.10");

Stock_Dialog_Error : constant UTF8_String := "gtk-dialog-error";
pragma Obsolescent (Stock_Dialog_Error, Message => "Deprecated since 3.10");

Stock_Dialog_Info : constant UTF8_String := "gtk-dialog-info";
pragma Obsolescent (Stock_Dialog_Info, Message => "Deprecated since 3.10");

Stock_Dialog_Question : constant UTF8_String := "gtk-dialog-question";
pragma Obsolescent (Stock_Dialog_Question, Message => "Deprecated since 3.10");

Stock_Dialog_Warning : constant UTF8_String := "gtk-dialog-warning";
pragma Obsolescent (Stock_Dialog_Warning, Message => "Deprecated since 3.10");

Stock_Directory : constant UTF8_String := "gtk-directory";
pragma Obsolescent (Stock_Directory, Message => "Deprecated since 3.10");

Stock_Discard : constant UTF8_String := "gtk-discard";
pragma Obsolescent (Stock_Discard, Message => "Deprecated since 3.10");

Stock_Disconnect : constant UTF8_String := "gtk-disconnect";
pragma Obsolescent (Stock_Disconnect, Message => "Deprecated since 3.10");

Stock_Dnd : constant UTF8_String := "gtk-dnd";
pragma Obsolescent (Stock_Dnd, Message => "Deprecated since 3.10");

Stock_Dnd_Multiple : constant UTF8_String := "gtk-dnd-multiple";
pragma Obsolescent (Stock_Dnd_Multiple, Message => "Deprecated since 3.10");

Stock_Edit : constant UTF8_String := "gtk-edit";
pragma Obsolescent (Stock_Edit, Message => "Deprecated since 3.10");

Stock_Execute : constant UTF8_String := "gtk-execute";
pragma Obsolescent (Stock_Execute, Message => "Deprecated since 3.10");

Stock_File : constant UTF8_String := "gtk-file";
pragma Obsolescent (Stock_File, Message => "Deprecated since 3.10");

Stock_Find : constant UTF8_String := "gtk-find";
pragma Obsolescent (Stock_Find, Message => "Deprecated since 3.10");

Stock_Find_And_Replace : constant UTF8_String := "gtk-find-and-replace";
pragma Obsolescent (Stock_Find_And_Replace, Message => "Deprecated since 3.10");

Stock_Floppy : constant UTF8_String := "gtk-floppy";
pragma Obsolescent (Stock_Floppy, Message => "Deprecated since 3.10");

Stock_Fullscreen : constant UTF8_String := "gtk-fullscreen";
pragma Obsolescent (Stock_Fullscreen, Message => "Deprecated since 3.10");

Stock_Go_Back : constant UTF8_String := "gtk-go-back";
pragma Obsolescent (Stock_Go_Back, Message => "Deprecated since 3.10");

Stock_Go_Down : constant UTF8_String := "gtk-go-down";
pragma Obsolescent (Stock_Go_Down, Message => "Deprecated since 3.10");

Stock_Go_Forward : constant UTF8_String := "gtk-go-forward";
pragma Obsolescent (Stock_Go_Forward, Message => "Deprecated since 3.10");

Stock_Go_Up : constant UTF8_String := "gtk-go-up";
pragma Obsolescent (Stock_Go_Up, Message => "Deprecated since 3.10");

Stock_Goto_Bottom : constant UTF8_String := "gtk-goto-bottom";
pragma Obsolescent (Stock_Goto_Bottom, Message => "Deprecated since 3.10");

Stock_Goto_First : constant UTF8_String := "gtk-goto-first";
pragma Obsolescent (Stock_Goto_First, Message => "Deprecated since 3.10");

Stock_Goto_Last : constant UTF8_String := "gtk-goto-last";
pragma Obsolescent (Stock_Goto_Last, Message => "Deprecated since 3.10");

Stock_Goto_Top : constant UTF8_String := "gtk-goto-top";
pragma Obsolescent (Stock_Goto_Top, Message => "Deprecated since 3.10");

Stock_Harddisk : constant UTF8_String := "gtk-harddisk";
pragma Obsolescent (Stock_Harddisk, Message => "Deprecated since 3.10");

Stock_Help : constant UTF8_String := "gtk-help";
pragma Obsolescent (Stock_Help, Message => "Deprecated since 3.10");

Stock_Home : constant UTF8_String := "gtk-home";
pragma Obsolescent (Stock_Home, Message => "Deprecated since 3.10");

Stock_Indent : constant UTF8_String := "gtk-indent";
pragma Obsolescent (Stock_Indent, Message => "Deprecated since 3.10");

Stock_Index : constant UTF8_String := "gtk-index";
pragma Obsolescent (Stock_Index, Message => "Deprecated since 3.10");

Stock_Info : constant UTF8_String := "gtk-info";
pragma Obsolescent (Stock_Info, Message => "Deprecated since 3.10");

Stock_Italic : constant UTF8_String := "gtk-italic";
pragma Obsolescent (Stock_Italic, Message => "Deprecated since 3.10");

Stock_Jump_To : constant UTF8_String := "gtk-jump-to";
pragma Obsolescent (Stock_Jump_To, Message => "Deprecated since 3.10");

Stock_Justify_Center : constant UTF8_String := "gtk-justify-center";
pragma Obsolescent (Stock_Justify_Center, Message => "Deprecated since 3.10");

Stock_Justify_Fill : constant UTF8_String := "gtk-justify-fill";
pragma Obsolescent (Stock_Justify_Fill, Message => "Deprecated since 3.10");

Stock_Justify_Left : constant UTF8_String := "gtk-justify-left";
pragma Obsolescent (Stock_Justify_Left, Message => "Deprecated since 3.10");

Stock_Justify_Right : constant UTF8_String := "gtk-justify-right";
pragma Obsolescent (Stock_Justify_Right, Message => "Deprecated since 3.10");

Stock_Leave_Fullscreen : constant UTF8_String := "gtk-leave-fullscreen";
pragma Obsolescent (Stock_Leave_Fullscreen, Message => "Deprecated since 3.10");

Stock_Media_Forward : constant UTF8_String := "gtk-media-forward";
pragma Obsolescent (Stock_Media_Forward, Message => "Deprecated since 3.10");

Stock_Media_Next : constant UTF8_String := "gtk-media-next";
pragma Obsolescent (Stock_Media_Next, Message => "Deprecated since 3.10");

Stock_Media_Pause : constant UTF8_String := "gtk-media-pause";
pragma Obsolescent (Stock_Media_Pause, Message => "Deprecated since 3.10");

Stock_Media_Play : constant UTF8_String := "gtk-media-play";
pragma Obsolescent (Stock_Media_Play, Message => "Deprecated since 3.10");

Stock_Media_Previous : constant UTF8_String := "gtk-media-previous";
pragma Obsolescent (Stock_Media_Previous, Message => "Deprecated since 3.10");

Stock_Media_Record : constant UTF8_String := "gtk-media-record";
pragma Obsolescent (Stock_Media_Record, Message => "Deprecated since 3.10");

Stock_Media_Rewind : constant UTF8_String := "gtk-media-rewind";
pragma Obsolescent (Stock_Media_Rewind, Message => "Deprecated since 3.10");

Stock_Media_Stop : constant UTF8_String := "gtk-media-stop";
pragma Obsolescent (Stock_Media_Stop, Message => "Deprecated since 3.10");

Stock_Missing_Image : constant UTF8_String := "gtk-missing-image";
pragma Obsolescent (Stock_Missing_Image, Message => "Deprecated since 3.10");

Stock_Network : constant UTF8_String := "gtk-network";
pragma Obsolescent (Stock_Network, Message => "Deprecated since 3.10");

Stock_New : constant UTF8_String := "gtk-new";
pragma Obsolescent (Stock_New, Message => "Deprecated since 3.10");

Stock_No : constant UTF8_String := "gtk-no";
pragma Obsolescent (Stock_No, Message => "Deprecated since 3.10");

Stock_Ok : constant UTF8_String := "gtk-ok";
pragma Obsolescent (Stock_Ok, Message => "Deprecated since 3.10");

Stock_Open : constant UTF8_String := "gtk-open";
pragma Obsolescent (Stock_Open, Message => "Deprecated since 3.10");

Stock_Orientation_Landscape : constant UTF8_String := "gtk-orientation-landscape";
pragma Obsolescent (Stock_Orientation_Landscape, Message => "Deprecated since 3.10");

Stock_Orientation_Portrait : constant UTF8_String := "gtk-orientation-portrait";
pragma Obsolescent (Stock_Orientation_Portrait, Message => "Deprecated since 3.10");

Stock_Orientation_Reverse_Landscape : constant UTF8_String := "gtk-orientation-reverse-landscape";
pragma Obsolescent (Stock_Orientation_Reverse_Landscape, Message => "Deprecated since 3.10");

Stock_Orientation_Reverse_Portrait : constant UTF8_String := "gtk-orientation-reverse-portrait";
pragma Obsolescent (Stock_Orientation_Reverse_Portrait, Message => "Deprecated since 3.10");

Stock_Page_Setup : constant UTF8_String := "gtk-page-setup";
pragma Obsolescent (Stock_Page_Setup, Message => "Deprecated since 3.10");

Stock_Paste : constant UTF8_String := "gtk-paste";
pragma Obsolescent (Stock_Paste, Message => "Deprecated since 3.10");

Stock_Preferences : constant UTF8_String := "gtk-preferences";
pragma Obsolescent (Stock_Preferences, Message => "Deprecated since 3.10");

Stock_Print : constant UTF8_String := "gtk-print";
pragma Obsolescent (Stock_Print, Message => "Deprecated since 3.10");

Stock_Print_Error : constant UTF8_String := "gtk-print-error";
pragma Obsolescent (Stock_Print_Error, Message => "Deprecated since 3.10");

Stock_Print_Paused : constant UTF8_String := "gtk-print-paused";
pragma Obsolescent (Stock_Print_Paused, Message => "Deprecated since 3.10");

Stock_Print_Preview : constant UTF8_String := "gtk-print-preview";
pragma Obsolescent (Stock_Print_Preview, Message => "Deprecated since 3.10");

Stock_Print_Report : constant UTF8_String := "gtk-print-report";
pragma Obsolescent (Stock_Print_Report, Message => "Deprecated since 3.10");

Stock_Print_Warning : constant UTF8_String := "gtk-print-warning";
pragma Obsolescent (Stock_Print_Warning, Message => "Deprecated since 3.10");

Stock_Properties : constant UTF8_String := "gtk-properties";
pragma Obsolescent (Stock_Properties, Message => "Deprecated since 3.10");

Stock_Quit : constant UTF8_String := "gtk-quit";
pragma Obsolescent (Stock_Quit, Message => "Deprecated since 3.10");

Stock_Redo : constant UTF8_String := "gtk-redo";
pragma Obsolescent (Stock_Redo, Message => "Deprecated since 3.10");

Stock_Refresh : constant UTF8_String := "gtk-refresh";
pragma Obsolescent (Stock_Refresh, Message => "Deprecated since 3.10");

Stock_Remove : constant UTF8_String := "gtk-remove";
pragma Obsolescent (Stock_Remove, Message => "Deprecated since 3.10");

Stock_Revert_To_Saved : constant UTF8_String := "gtk-revert-to-saved";
pragma Obsolescent (Stock_Revert_To_Saved, Message => "Deprecated since 3.10");

Stock_Save : constant UTF8_String := "gtk-save";
pragma Obsolescent (Stock_Save, Message => "Deprecated since 3.10");

Stock_Save_As : constant UTF8_String := "gtk-save-as";
pragma Obsolescent (Stock_Save_As, Message => "Deprecated since 3.10");

Stock_Select_All : constant UTF8_String := "gtk-select-all";
pragma Obsolescent (Stock_Select_All, Message => "Deprecated since 3.10");

Stock_Select_Color : constant UTF8_String := "gtk-select-color";
pragma Obsolescent (Stock_Select_Color, Message => "Deprecated since 3.10");

Stock_Select_Font : constant UTF8_String := "gtk-select-font";
pragma Obsolescent (Stock_Select_Font, Message => "Deprecated since 3.10");

Stock_Sort_Ascending : constant UTF8_String := "gtk-sort-ascending";
pragma Obsolescent (Stock_Sort_Ascending, Message => "Deprecated since 3.10");

Stock_Sort_Descending : constant UTF8_String := "gtk-sort-descending";
pragma Obsolescent (Stock_Sort_Descending, Message => "Deprecated since 3.10");

Stock_Spell_Check : constant UTF8_String := "gtk-spell-check";
pragma Obsolescent (Stock_Spell_Check, Message => "Deprecated since 3.10");

Stock_Stop : constant UTF8_String := "gtk-stop";
pragma Obsolescent (Stock_Stop, Message => "Deprecated since 3.10");

Stock_Strikethrough : constant UTF8_String := "gtk-strikethrough";
pragma Obsolescent (Stock_Strikethrough, Message => "Deprecated since 3.10");

Stock_Undelete : constant UTF8_String := "gtk-undelete";
pragma Obsolescent (Stock_Undelete, Message => "Deprecated since 3.10");

Stock_Underline : constant UTF8_String := "gtk-underline";
pragma Obsolescent (Stock_Underline, Message => "Deprecated since 3.10");

Stock_Undo : constant UTF8_String := "gtk-undo";
pragma Obsolescent (Stock_Undo, Message => "Deprecated since 3.10");

Stock_Unindent : constant UTF8_String := "gtk-unindent";
pragma Obsolescent (Stock_Unindent, Message => "Deprecated since 3.10");

Stock_Yes : constant UTF8_String := "gtk-yes";
pragma Obsolescent (Stock_Yes, Message => "Deprecated since 3.10");

Stock_Zoom_100 : constant UTF8_String := "gtk-zoom-100";
pragma Obsolescent (Stock_Zoom_100, Message => "Deprecated since 3.10");

Stock_Zoom_Fit : constant UTF8_String := "gtk-zoom-fit";
pragma Obsolescent (Stock_Zoom_Fit, Message => "Deprecated since 3.10");

Stock_Zoom_In : constant UTF8_String := "gtk-zoom-in";
pragma Obsolescent (Stock_Zoom_In, Message => "Deprecated since 3.10");

Stock_Zoom_Out : constant UTF8_String := "gtk-zoom-out";
pragma Obsolescent (Stock_Zoom_Out, Message => "Deprecated since 3.10");

type Gtk_Stock_Item is private;
function From_Object_Free (B : access Gtk_Stock_Item) return Gtk_Stock_Item;
Expand Down
Loading

0 comments on commit 7cfccda

Please sign in to comment.