Gen: Re-run script
- commit
- 99ae9148bc678df2424e1572d28c7e539d250bac
- author
- Jeroen Wijenbergh · · 2025-10-16 14:31 UTC
- parent
- 730f526
- signature
- SSH Unverified
SHA256:8N5EoON8reSTMm461SyWlzRhib6IymBjUHb1p62kwywThe key is unknown
662 files · +68476 -17191
M v4/adw/adw-about-dialog.go +180 -11
| @@ -175,6 +175,11 @@ func ShowAboutDialogFromAppdata(ParentVar *gtk.Widget, ResourcePathVar string, R | |||
| 175 | 175 | // To add information about other modules, such as application dependencies or | |
| 176 | 176 | // data, use [method@AboutDialog.add_legal_section]. | |
| 177 | 177 | // | |
| 178 | + | // ## Other applications | |
| 179 | + | // | |
| 180 | + | // `AdwAboutDialog` can show links to your other apps at the end of the main | |
| 181 | + | // page. To add them, use [method@AboutDialog.add_other_app]. | |
| 182 | + | // | |
| 178 | 183 | // ## Constructing | |
| 179 | 184 | // | |
| 180 | 185 | // To make constructing an `AdwAboutDialog` as convenient as possible, you can | |
| @@ -401,6 +406,33 @@ func (x *AboutDialog) AddLink(TitleVar string, UrlVar string) { | |||
| 401 | 406 | ||
| 402 | 407 | } | |
| 403 | 408 | ||
| 409 | + | var xAboutDialogAddOtherApp func(uintptr, string, string, string) | |
| 410 | + | ||
| 411 | + | // Adds another application to @self. | |
| 412 | + | // | |
| 413 | + | // The application will be displayed at the bottom of the main page, in a | |
| 414 | + | // separate section. Each added application will be presented as a row with | |
| 415 | + | // @title and @summary, as well as an icon with the name @appid. Clicking the | |
| 416 | + | // row will show @appid in the software center app. | |
| 417 | + | // | |
| 418 | + | // This can be used to link to your other applications if you have multiple. | |
| 419 | + | // | |
| 420 | + | // Example: | |
| 421 | + | // | |
| 422 | + | // ```c | |
| 423 | + | // adw_about_dialog_add_other_app (ADW_ABOUT_DIALOG (about), | |
| 424 | + | // | |
| 425 | + | // "org.gnome.Boxes", | |
| 426 | + | // _("Boxes"), | |
| 427 | + | // _("Virtualization made simple")); | |
| 428 | + | // | |
| 429 | + | // ``` | |
| 430 | + | func (x *AboutDialog) AddOtherApp(AppidVar string, NameVar string, SummaryVar string) { | |
| 431 | + | ||
| 432 | + | xAboutDialogAddOtherApp(x.GoPointer(), AppidVar, NameVar, SummaryVar) | |
| 433 | + | ||
| 434 | + | } | |
| 435 | + | ||
| 404 | 436 | var xAboutDialogGetApplicationIcon func(uintptr) string | |
| 405 | 437 | ||
| 406 | 438 | // Gets the name of the application icon for @self. | |
| @@ -907,7 +939,8 @@ var xAboutDialogSetTranslatorCredits func(uintptr, string) | |||
| 907 | 939 | // should be marked as translatable. | |
| 908 | 940 | // | |
| 909 | 941 | // The string may contain email addresses and URLs, see the introduction for | |
| 910 | - | // more details. | |
| 942 | + | // more details. When there is more than one translator, they must be | |
| 943 | + | // separated by a newline in the same string. | |
| 911 | 944 | // | |
| 912 | 945 | // See also: | |
| 913 | 946 | // | |
| @@ -985,34 +1018,165 @@ func (x *AboutDialog) ConnectActivateLink(cb *func(AboutDialog, string) bool) ui | |||
| 985 | 1018 | return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr) | |
| 986 | 1019 | } | |
| 987 | 1020 | ||
| 988 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 1021 | + | // Requests the user's screen reader to announce the given message. | |
| 1022 | + | // | |
| 1023 | + | // This kind of notification is useful for messages that | |
| 1024 | + | // either have only a visual representation or that are not | |
| 1025 | + | // exposed visually at all, e.g. a notification about a | |
| 1026 | + | // successful operation. | |
| 1027 | + | // | |
| 1028 | + | // Also, by using this API, you can ensure that the message | |
| 1029 | + | // does not interrupts the user's current screen reader output. | |
| 1030 | + | func (x *AboutDialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 1031 | + | ||
| 1032 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 1033 | + | ||
| 1034 | + | } | |
| 1035 | + | ||
| 1036 | + | // Retrieves the accessible parent for an accessible object. | |
| 1037 | + | // | |
| 1038 | + | // This function returns `NULL` for top level widgets. | |
| 1039 | + | func (x *AboutDialog) GetAccessibleParent() *gtk.AccessibleBase { | |
| 1040 | + | var cls *gtk.AccessibleBase | |
| 1041 | + | ||
| 1042 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 1043 | + | ||
| 1044 | + | if cret == 0 { | |
| 1045 | + | return nil | |
| 1046 | + | } | |
| 1047 | + | cls = >k.AccessibleBase{} | |
| 1048 | + | cls.Ptr = cret | |
| 1049 | + | return cls | |
| 1050 | + | } | |
| 1051 | + | ||
| 1052 | + | // Retrieves the accessible role of an accessible object. | |
| 989 | 1053 | func (x *AboutDialog) GetAccessibleRole() gtk.AccessibleRole { | |
| 990 | 1054 | ||
| 991 | 1055 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 992 | 1056 | return cret | |
| 993 | 1057 | } | |
| 994 | 1058 | ||
| 995 | - | // Resets the accessible @property to its default value. | |
| 1059 | + | // Retrieves the implementation for the given accessible object. | |
| 1060 | + | func (x *AboutDialog) GetAtContext() *gtk.ATContext { | |
| 1061 | + | var cls *gtk.ATContext | |
| 1062 | + | ||
| 1063 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 1064 | + | ||
| 1065 | + | if cret == 0 { | |
| 1066 | + | return nil | |
| 1067 | + | } | |
| 1068 | + | cls = >k.ATContext{} | |
| 1069 | + | cls.Ptr = cret | |
| 1070 | + | return cls | |
| 1071 | + | } | |
| 1072 | + | ||
| 1073 | + | // Queries the coordinates and dimensions of this accessible | |
| 1074 | + | // | |
| 1075 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1076 | + | // implementations, e.g. to get the bounds from an ignored | |
| 1077 | + | // child widget. | |
| 1078 | + | func (x *AboutDialog) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 1079 | + | ||
| 1080 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 1081 | + | return cret | |
| 1082 | + | } | |
| 1083 | + | ||
| 1084 | + | // Retrieves the first accessible child of an accessible object. | |
| 1085 | + | func (x *AboutDialog) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 1086 | + | var cls *gtk.AccessibleBase | |
| 1087 | + | ||
| 1088 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 1089 | + | ||
| 1090 | + | if cret == 0 { | |
| 1091 | + | return nil | |
| 1092 | + | } | |
| 1093 | + | cls = >k.AccessibleBase{} | |
| 1094 | + | cls.Ptr = cret | |
| 1095 | + | return cls | |
| 1096 | + | } | |
| 1097 | + | ||
| 1098 | + | // Retrieves the next accessible sibling of an accessible object | |
| 1099 | + | func (x *AboutDialog) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 1100 | + | var cls *gtk.AccessibleBase | |
| 1101 | + | ||
| 1102 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 1103 | + | ||
| 1104 | + | if cret == 0 { | |
| 1105 | + | return nil | |
| 1106 | + | } | |
| 1107 | + | cls = >k.AccessibleBase{} | |
| 1108 | + | cls.Ptr = cret | |
| 1109 | + | return cls | |
| 1110 | + | } | |
| 1111 | + | ||
| 1112 | + | // Queries a platform state, such as focus. | |
| 1113 | + | // | |
| 1114 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1115 | + | // implementations, e.g. to get platform state from an ignored | |
| 1116 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 1117 | + | func (x *AboutDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 1118 | + | ||
| 1119 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 1120 | + | return cret | |
| 1121 | + | } | |
| 1122 | + | ||
| 1123 | + | // Resets the accessible property to its default value. | |
| 996 | 1124 | func (x *AboutDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 997 | 1125 | ||
| 998 | 1126 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 999 | 1127 | ||
| 1000 | 1128 | } | |
| 1001 | 1129 | ||
| 1002 | - | // Resets the accessible @relation to its default value. | |
| 1130 | + | // Resets the accessible relation to its default value. | |
| 1003 | 1131 | func (x *AboutDialog) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 1004 | 1132 | ||
| 1005 | 1133 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 1006 | 1134 | ||
| 1007 | 1135 | } | |
| 1008 | 1136 | ||
| 1009 | - | // Resets the accessible @state to its default value. | |
| 1137 | + | // Resets the accessible state to its default value. | |
| 1010 | 1138 | func (x *AboutDialog) ResetState(StateVar gtk.AccessibleState) { | |
| 1011 | 1139 | ||
| 1012 | 1140 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 1013 | 1141 | ||
| 1014 | 1142 | } | |
| 1015 | 1143 | ||
| 1144 | + | // Sets the parent and sibling of an accessible object. | |
| 1145 | + | // | |
| 1146 | + | // This function is meant to be used by accessible implementations that are | |
| 1147 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 1148 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 1149 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 1150 | + | // interface, you will use this function to ensure that the parent of each | |
| 1151 | + | // child widget is the metadata object, and the parent of each metadata | |
| 1152 | + | // object is the container widget. | |
| 1153 | + | func (x *AboutDialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 1154 | + | ||
| 1155 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 1156 | + | ||
| 1157 | + | } | |
| 1158 | + | ||
| 1159 | + | // Updates the next accessible sibling. | |
| 1160 | + | // | |
| 1161 | + | // That might be useful when a new child of a custom accessible | |
| 1162 | + | // is created, and it needs to be linked to a previous child. | |
| 1163 | + | func (x *AboutDialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 1164 | + | ||
| 1165 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 1166 | + | ||
| 1167 | + | } | |
| 1168 | + | ||
| 1169 | + | // Informs ATs that the platform state has changed. | |
| 1170 | + | // | |
| 1171 | + | // This function should be used by `GtkAccessible` implementations that | |
| 1172 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 1173 | + | // states automatically. | |
| 1174 | + | func (x *AboutDialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 1175 | + | ||
| 1176 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 1177 | + | ||
| 1178 | + | } | |
| 1179 | + | ||
| 1016 | 1180 | // Updates a list of accessible properties. | |
| 1017 | 1181 | // | |
| 1018 | 1182 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -1055,7 +1219,7 @@ func (x *AboutDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 1055 | 1219 | // relation change must be communicated to assistive technologies. | |
| 1056 | 1220 | // | |
| 1057 | 1221 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 1058 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 1222 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 1059 | 1223 | // | |
| 1060 | 1224 | // ```c | |
| 1061 | 1225 | // gtk_accessible_update_relation (accessible, | |
| @@ -1085,13 +1249,17 @@ func (x *AboutDialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 1085 | 1249 | ||
| 1086 | 1250 | } | |
| 1087 | 1251 | ||
| 1088 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 1089 | - | // documentation for the value types of accessible states. | |
| 1252 | + | // Updates a list of accessible states. | |
| 1090 | 1253 | // | |
| 1091 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 1092 | - | // state change must be communicated to assistive technologies. | |
| 1254 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 1255 | + | // value types of accessible states. | |
| 1256 | + | // | |
| 1257 | + | // This function should be called by `GtkWidget` types whenever | |
| 1258 | + | // an accessible state change must be communicated to assistive | |
| 1259 | + | // technologies. | |
| 1093 | 1260 | // | |
| 1094 | 1261 | // Example: | |
| 1262 | + | // | |
| 1095 | 1263 | // ```c | |
| 1096 | 1264 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 1097 | 1265 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -1121,7 +1289,7 @@ func (x *AboutDialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessibl | |||
| 1121 | 1289 | // Gets the ID of the @buildable object. | |
| 1122 | 1290 | // | |
| 1123 | 1291 | // `GtkBuilder` sets the name based on the ID attribute | |
| 1124 | - | // of the <object> tag used to construct the @buildable. | |
| 1292 | + | // of the `<object>` tag used to construct the @buildable. | |
| 1125 | 1293 | func (x *AboutDialog) GetBuildableId() string { | |
| 1126 | 1294 | ||
| 1127 | 1295 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -1148,6 +1316,7 @@ func init() { | |||
| 1148 | 1316 | core.PuregoSafeRegister(&xAboutDialogAddCreditSection, lib, "adw_about_dialog_add_credit_section") | |
| 1149 | 1317 | core.PuregoSafeRegister(&xAboutDialogAddLegalSection, lib, "adw_about_dialog_add_legal_section") | |
| 1150 | 1318 | core.PuregoSafeRegister(&xAboutDialogAddLink, lib, "adw_about_dialog_add_link") | |
| 1319 | + | core.PuregoSafeRegister(&xAboutDialogAddOtherApp, lib, "adw_about_dialog_add_other_app") | |
| 1151 | 1320 | core.PuregoSafeRegister(&xAboutDialogGetApplicationIcon, lib, "adw_about_dialog_get_application_icon") | |
| 1152 | 1321 | core.PuregoSafeRegister(&xAboutDialogGetApplicationName, lib, "adw_about_dialog_get_application_name") | |
| 1153 | 1322 | core.PuregoSafeRegister(&xAboutDialogGetArtists, lib, "adw_about_dialog_get_artists") | |
M v4/adw/adw-about-window.go +147 -11
| @@ -909,7 +909,8 @@ var xAboutWindowSetTranslatorCredits func(uintptr, string) | |||
| 909 | 909 | // should be marked as translatable. | |
| 910 | 910 | // | |
| 911 | 911 | // The string may contain email addresses and URLs, see the introduction for | |
| 912 | - | // more details. | |
| 912 | + | // more details. When there is more than one translator, they must be | |
| 913 | + | // separated by a newline in the same string. | |
| 913 | 914 | // | |
| 914 | 915 | // See also: | |
| 915 | 916 | // | |
| @@ -987,34 +988,165 @@ func (x *AboutWindow) ConnectActivateLink(cb *func(AboutWindow, string) bool) ui | |||
| 987 | 988 | return gobject.SignalConnect(x.GoPointer(), "activate-link", cbRefPtr) | |
| 988 | 989 | } | |
| 989 | 990 | ||
| 990 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 991 | + | // Requests the user's screen reader to announce the given message. | |
| 992 | + | // | |
| 993 | + | // This kind of notification is useful for messages that | |
| 994 | + | // either have only a visual representation or that are not | |
| 995 | + | // exposed visually at all, e.g. a notification about a | |
| 996 | + | // successful operation. | |
| 997 | + | // | |
| 998 | + | // Also, by using this API, you can ensure that the message | |
| 999 | + | // does not interrupts the user's current screen reader output. | |
| 1000 | + | func (x *AboutWindow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 1001 | + | ||
| 1002 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 1003 | + | ||
| 1004 | + | } | |
| 1005 | + | ||
| 1006 | + | // Retrieves the accessible parent for an accessible object. | |
| 1007 | + | // | |
| 1008 | + | // This function returns `NULL` for top level widgets. | |
| 1009 | + | func (x *AboutWindow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 1010 | + | var cls *gtk.AccessibleBase | |
| 1011 | + | ||
| 1012 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 1013 | + | ||
| 1014 | + | if cret == 0 { | |
| 1015 | + | return nil | |
| 1016 | + | } | |
| 1017 | + | cls = >k.AccessibleBase{} | |
| 1018 | + | cls.Ptr = cret | |
| 1019 | + | return cls | |
| 1020 | + | } | |
| 1021 | + | ||
| 1022 | + | // Retrieves the accessible role of an accessible object. | |
| 991 | 1023 | func (x *AboutWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 992 | 1024 | ||
| 993 | 1025 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 994 | 1026 | return cret | |
| 995 | 1027 | } | |
| 996 | 1028 | ||
| 997 | - | // Resets the accessible @property to its default value. | |
| 1029 | + | // Retrieves the implementation for the given accessible object. | |
| 1030 | + | func (x *AboutWindow) GetAtContext() *gtk.ATContext { | |
| 1031 | + | var cls *gtk.ATContext | |
| 1032 | + | ||
| 1033 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 1034 | + | ||
| 1035 | + | if cret == 0 { | |
| 1036 | + | return nil | |
| 1037 | + | } | |
| 1038 | + | cls = >k.ATContext{} | |
| 1039 | + | cls.Ptr = cret | |
| 1040 | + | return cls | |
| 1041 | + | } | |
| 1042 | + | ||
| 1043 | + | // Queries the coordinates and dimensions of this accessible | |
| 1044 | + | // | |
| 1045 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1046 | + | // implementations, e.g. to get the bounds from an ignored | |
| 1047 | + | // child widget. | |
| 1048 | + | func (x *AboutWindow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 1049 | + | ||
| 1050 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 1051 | + | return cret | |
| 1052 | + | } | |
| 1053 | + | ||
| 1054 | + | // Retrieves the first accessible child of an accessible object. | |
| 1055 | + | func (x *AboutWindow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 1056 | + | var cls *gtk.AccessibleBase | |
| 1057 | + | ||
| 1058 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 1059 | + | ||
| 1060 | + | if cret == 0 { | |
| 1061 | + | return nil | |
| 1062 | + | } | |
| 1063 | + | cls = >k.AccessibleBase{} | |
| 1064 | + | cls.Ptr = cret | |
| 1065 | + | return cls | |
| 1066 | + | } | |
| 1067 | + | ||
| 1068 | + | // Retrieves the next accessible sibling of an accessible object | |
| 1069 | + | func (x *AboutWindow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 1070 | + | var cls *gtk.AccessibleBase | |
| 1071 | + | ||
| 1072 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 1073 | + | ||
| 1074 | + | if cret == 0 { | |
| 1075 | + | return nil | |
| 1076 | + | } | |
| 1077 | + | cls = >k.AccessibleBase{} | |
| 1078 | + | cls.Ptr = cret | |
| 1079 | + | return cls | |
| 1080 | + | } | |
| 1081 | + | ||
| 1082 | + | // Queries a platform state, such as focus. | |
| 1083 | + | // | |
| 1084 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1085 | + | // implementations, e.g. to get platform state from an ignored | |
| 1086 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 1087 | + | func (x *AboutWindow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 1088 | + | ||
| 1089 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 1090 | + | return cret | |
| 1091 | + | } | |
| 1092 | + | ||
| 1093 | + | // Resets the accessible property to its default value. | |
| 998 | 1094 | func (x *AboutWindow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 999 | 1095 | ||
| 1000 | 1096 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 1001 | 1097 | ||
| 1002 | 1098 | } | |
| 1003 | 1099 | ||
| 1004 | - | // Resets the accessible @relation to its default value. | |
| 1100 | + | // Resets the accessible relation to its default value. | |
| 1005 | 1101 | func (x *AboutWindow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 1006 | 1102 | ||
| 1007 | 1103 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 1008 | 1104 | ||
| 1009 | 1105 | } | |
| 1010 | 1106 | ||
| 1011 | - | // Resets the accessible @state to its default value. | |
| 1107 | + | // Resets the accessible state to its default value. | |
| 1012 | 1108 | func (x *AboutWindow) ResetState(StateVar gtk.AccessibleState) { | |
| 1013 | 1109 | ||
| 1014 | 1110 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 1015 | 1111 | ||
| 1016 | 1112 | } | |
| 1017 | 1113 | ||
| 1114 | + | // Sets the parent and sibling of an accessible object. | |
| 1115 | + | // | |
| 1116 | + | // This function is meant to be used by accessible implementations that are | |
| 1117 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 1118 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 1119 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 1120 | + | // interface, you will use this function to ensure that the parent of each | |
| 1121 | + | // child widget is the metadata object, and the parent of each metadata | |
| 1122 | + | // object is the container widget. | |
| 1123 | + | func (x *AboutWindow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 1124 | + | ||
| 1125 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 1126 | + | ||
| 1127 | + | } | |
| 1128 | + | ||
| 1129 | + | // Updates the next accessible sibling. | |
| 1130 | + | // | |
| 1131 | + | // That might be useful when a new child of a custom accessible | |
| 1132 | + | // is created, and it needs to be linked to a previous child. | |
| 1133 | + | func (x *AboutWindow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 1134 | + | ||
| 1135 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 1136 | + | ||
| 1137 | + | } | |
| 1138 | + | ||
| 1139 | + | // Informs ATs that the platform state has changed. | |
| 1140 | + | // | |
| 1141 | + | // This function should be used by `GtkAccessible` implementations that | |
| 1142 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 1143 | + | // states automatically. | |
| 1144 | + | func (x *AboutWindow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 1145 | + | ||
| 1146 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 1147 | + | ||
| 1148 | + | } | |
| 1149 | + | ||
| 1018 | 1150 | // Updates a list of accessible properties. | |
| 1019 | 1151 | // | |
| 1020 | 1152 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -1057,7 +1189,7 @@ func (x *AboutWindow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 1057 | 1189 | // relation change must be communicated to assistive technologies. | |
| 1058 | 1190 | // | |
| 1059 | 1191 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 1060 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 1192 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 1061 | 1193 | // | |
| 1062 | 1194 | // ```c | |
| 1063 | 1195 | // gtk_accessible_update_relation (accessible, | |
| @@ -1087,13 +1219,17 @@ func (x *AboutWindow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 1087 | 1219 | ||
| 1088 | 1220 | } | |
| 1089 | 1221 | ||
| 1090 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 1091 | - | // documentation for the value types of accessible states. | |
| 1222 | + | // Updates a list of accessible states. | |
| 1092 | 1223 | // | |
| 1093 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 1094 | - | // state change must be communicated to assistive technologies. | |
| 1224 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 1225 | + | // value types of accessible states. | |
| 1226 | + | // | |
| 1227 | + | // This function should be called by `GtkWidget` types whenever | |
| 1228 | + | // an accessible state change must be communicated to assistive | |
| 1229 | + | // technologies. | |
| 1095 | 1230 | // | |
| 1096 | 1231 | // Example: | |
| 1232 | + | // | |
| 1097 | 1233 | // ```c | |
| 1098 | 1234 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 1099 | 1235 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -1123,7 +1259,7 @@ func (x *AboutWindow) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessibl | |||
| 1123 | 1259 | // Gets the ID of the @buildable object. | |
| 1124 | 1260 | // | |
| 1125 | 1261 | // `GtkBuilder` sets the name based on the ID attribute | |
| 1126 | - | // of the <object> tag used to construct the @buildable. | |
| 1262 | + | // of the `<object>` tag used to construct the @buildable. | |
| 1127 | 1263 | func (x *AboutWindow) GetBuildableId() string { | |
| 1128 | 1264 | ||
| 1129 | 1265 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-action-row.go +145 -10
| @@ -340,34 +340,165 @@ func (x *ActionRow) ConnectActivated(cb *func(ActionRow)) uint32 { | |||
| 340 | 340 | return gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr) | |
| 341 | 341 | } | |
| 342 | 342 | ||
| 343 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 343 | + | // Requests the user's screen reader to announce the given message. | |
| 344 | + | // | |
| 345 | + | // This kind of notification is useful for messages that | |
| 346 | + | // either have only a visual representation or that are not | |
| 347 | + | // exposed visually at all, e.g. a notification about a | |
| 348 | + | // successful operation. | |
| 349 | + | // | |
| 350 | + | // Also, by using this API, you can ensure that the message | |
| 351 | + | // does not interrupts the user's current screen reader output. | |
| 352 | + | func (x *ActionRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 353 | + | ||
| 354 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 355 | + | ||
| 356 | + | } | |
| 357 | + | ||
| 358 | + | // Retrieves the accessible parent for an accessible object. | |
| 359 | + | // | |
| 360 | + | // This function returns `NULL` for top level widgets. | |
| 361 | + | func (x *ActionRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 362 | + | var cls *gtk.AccessibleBase | |
| 363 | + | ||
| 364 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 365 | + | ||
| 366 | + | if cret == 0 { | |
| 367 | + | return nil | |
| 368 | + | } | |
| 369 | + | cls = >k.AccessibleBase{} | |
| 370 | + | cls.Ptr = cret | |
| 371 | + | return cls | |
| 372 | + | } | |
| 373 | + | ||
| 374 | + | // Retrieves the accessible role of an accessible object. | |
| 344 | 375 | func (x *ActionRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 345 | 376 | ||
| 346 | 377 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 347 | 378 | return cret | |
| 348 | 379 | } | |
| 349 | 380 | ||
| 350 | - | // Resets the accessible @property to its default value. | |
| 381 | + | // Retrieves the implementation for the given accessible object. | |
| 382 | + | func (x *ActionRow) GetAtContext() *gtk.ATContext { | |
| 383 | + | var cls *gtk.ATContext | |
| 384 | + | ||
| 385 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 386 | + | ||
| 387 | + | if cret == 0 { | |
| 388 | + | return nil | |
| 389 | + | } | |
| 390 | + | cls = >k.ATContext{} | |
| 391 | + | cls.Ptr = cret | |
| 392 | + | return cls | |
| 393 | + | } | |
| 394 | + | ||
| 395 | + | // Queries the coordinates and dimensions of this accessible | |
| 396 | + | // | |
| 397 | + | // This functionality can be overridden by `GtkAccessible` | |
| 398 | + | // implementations, e.g. to get the bounds from an ignored | |
| 399 | + | // child widget. | |
| 400 | + | func (x *ActionRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 401 | + | ||
| 402 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 403 | + | return cret | |
| 404 | + | } | |
| 405 | + | ||
| 406 | + | // Retrieves the first accessible child of an accessible object. | |
| 407 | + | func (x *ActionRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 408 | + | var cls *gtk.AccessibleBase | |
| 409 | + | ||
| 410 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 411 | + | ||
| 412 | + | if cret == 0 { | |
| 413 | + | return nil | |
| 414 | + | } | |
| 415 | + | cls = >k.AccessibleBase{} | |
| 416 | + | cls.Ptr = cret | |
| 417 | + | return cls | |
| 418 | + | } | |
| 419 | + | ||
| 420 | + | // Retrieves the next accessible sibling of an accessible object | |
| 421 | + | func (x *ActionRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 422 | + | var cls *gtk.AccessibleBase | |
| 423 | + | ||
| 424 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 425 | + | ||
| 426 | + | if cret == 0 { | |
| 427 | + | return nil | |
| 428 | + | } | |
| 429 | + | cls = >k.AccessibleBase{} | |
| 430 | + | cls.Ptr = cret | |
| 431 | + | return cls | |
| 432 | + | } | |
| 433 | + | ||
| 434 | + | // Queries a platform state, such as focus. | |
| 435 | + | // | |
| 436 | + | // This functionality can be overridden by `GtkAccessible` | |
| 437 | + | // implementations, e.g. to get platform state from an ignored | |
| 438 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 439 | + | func (x *ActionRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 440 | + | ||
| 441 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 442 | + | return cret | |
| 443 | + | } | |
| 444 | + | ||
| 445 | + | // Resets the accessible property to its default value. | |
| 351 | 446 | func (x *ActionRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 352 | 447 | ||
| 353 | 448 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 354 | 449 | ||
| 355 | 450 | } | |
| 356 | 451 | ||
| 357 | - | // Resets the accessible @relation to its default value. | |
| 452 | + | // Resets the accessible relation to its default value. | |
| 358 | 453 | func (x *ActionRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 359 | 454 | ||
| 360 | 455 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 361 | 456 | ||
| 362 | 457 | } | |
| 363 | 458 | ||
| 364 | - | // Resets the accessible @state to its default value. | |
| 459 | + | // Resets the accessible state to its default value. | |
| 365 | 460 | func (x *ActionRow) ResetState(StateVar gtk.AccessibleState) { | |
| 366 | 461 | ||
| 367 | 462 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 368 | 463 | ||
| 369 | 464 | } | |
| 370 | 465 | ||
| 466 | + | // Sets the parent and sibling of an accessible object. | |
| 467 | + | // | |
| 468 | + | // This function is meant to be used by accessible implementations that are | |
| 469 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 470 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 471 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 472 | + | // interface, you will use this function to ensure that the parent of each | |
| 473 | + | // child widget is the metadata object, and the parent of each metadata | |
| 474 | + | // object is the container widget. | |
| 475 | + | func (x *ActionRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 476 | + | ||
| 477 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 478 | + | ||
| 479 | + | } | |
| 480 | + | ||
| 481 | + | // Updates the next accessible sibling. | |
| 482 | + | // | |
| 483 | + | // That might be useful when a new child of a custom accessible | |
| 484 | + | // is created, and it needs to be linked to a previous child. | |
| 485 | + | func (x *ActionRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 486 | + | ||
| 487 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 488 | + | ||
| 489 | + | } | |
| 490 | + | ||
| 491 | + | // Informs ATs that the platform state has changed. | |
| 492 | + | // | |
| 493 | + | // This function should be used by `GtkAccessible` implementations that | |
| 494 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 495 | + | // states automatically. | |
| 496 | + | func (x *ActionRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 497 | + | ||
| 498 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 499 | + | ||
| 500 | + | } | |
| 501 | + | ||
| 371 | 502 | // Updates a list of accessible properties. | |
| 372 | 503 | // | |
| 373 | 504 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -410,7 +541,7 @@ func (x *ActionRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk. | |||
| 410 | 541 | // relation change must be communicated to assistive technologies. | |
| 411 | 542 | // | |
| 412 | 543 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 413 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 544 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 414 | 545 | // | |
| 415 | 546 | // ```c | |
| 416 | 547 | // gtk_accessible_update_relation (accessible, | |
| @@ -440,13 +571,17 @@ func (x *ActionRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Ac | |||
| 440 | 571 | ||
| 441 | 572 | } | |
| 442 | 573 | ||
| 443 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 444 | - | // documentation for the value types of accessible states. | |
| 574 | + | // Updates a list of accessible states. | |
| 445 | 575 | // | |
| 446 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 447 | - | // state change must be communicated to assistive technologies. | |
| 576 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 577 | + | // value types of accessible states. | |
| 578 | + | // | |
| 579 | + | // This function should be called by `GtkWidget` types whenever | |
| 580 | + | // an accessible state change must be communicated to assistive | |
| 581 | + | // technologies. | |
| 448 | 582 | // | |
| 449 | 583 | // Example: | |
| 584 | + | // | |
| 450 | 585 | // ```c | |
| 451 | 586 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 452 | 587 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -559,7 +694,7 @@ func (x *ActionRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 559 | 694 | // Gets the ID of the @buildable object. | |
| 560 | 695 | // | |
| 561 | 696 | // `GtkBuilder` sets the name based on the ID attribute | |
| 562 | - | // of the <object> tag used to construct the @buildable. | |
| 697 | + | // of the `<object>` tag used to construct the @buildable. | |
| 563 | 698 | func (x *ActionRow) GetBuildableId() string { | |
| 564 | 699 | ||
| 565 | 700 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-alert-dialog.go +151 -13
| @@ -561,10 +561,13 @@ var xAlertDialogSetDefaultResponse func(uintptr, string) | |||
| 561 | 561 | ||
| 562 | 562 | // Sets the ID of the default response of @self. | |
| 563 | 563 | // | |
| 564 | - | // If set, pressing <kbd>Enter</kbd> will activate the corresponding button. | |
| 564 | + | // The button corresponding to this response will be set as the default widget | |
| 565 | + | // of @self. | |
| 565 | 566 | // | |
| 566 | - | // If set to `NULL` or to a non-existent response ID, pressing <kbd>Enter</kbd> | |
| 567 | - | // will do nothing. | |
| 567 | + | // If not set, the default widget will not be set, and the last added response | |
| 568 | + | // will be focused by default. | |
| 569 | + | // | |
| 570 | + | // See [property@Dialog:default-widget]. | |
| 568 | 571 | func (x *AlertDialog) SetDefaultResponse(ResponseVar string) { | |
| 569 | 572 | ||
| 570 | 573 | xAlertDialogSetDefaultResponse(x.GoPointer(), ResponseVar) | |
| @@ -709,34 +712,165 @@ func (x *AlertDialog) ConnectResponse(cb *func(AlertDialog, string)) uint32 { | |||
| 709 | 712 | return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr) | |
| 710 | 713 | } | |
| 711 | 714 | ||
| 712 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 715 | + | // Requests the user's screen reader to announce the given message. | |
| 716 | + | // | |
| 717 | + | // This kind of notification is useful for messages that | |
| 718 | + | // either have only a visual representation or that are not | |
| 719 | + | // exposed visually at all, e.g. a notification about a | |
| 720 | + | // successful operation. | |
| 721 | + | // | |
| 722 | + | // Also, by using this API, you can ensure that the message | |
| 723 | + | // does not interrupts the user's current screen reader output. | |
| 724 | + | func (x *AlertDialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 725 | + | ||
| 726 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 727 | + | ||
| 728 | + | } | |
| 729 | + | ||
| 730 | + | // Retrieves the accessible parent for an accessible object. | |
| 731 | + | // | |
| 732 | + | // This function returns `NULL` for top level widgets. | |
| 733 | + | func (x *AlertDialog) GetAccessibleParent() *gtk.AccessibleBase { | |
| 734 | + | var cls *gtk.AccessibleBase | |
| 735 | + | ||
| 736 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 737 | + | ||
| 738 | + | if cret == 0 { | |
| 739 | + | return nil | |
| 740 | + | } | |
| 741 | + | cls = >k.AccessibleBase{} | |
| 742 | + | cls.Ptr = cret | |
| 743 | + | return cls | |
| 744 | + | } | |
| 745 | + | ||
| 746 | + | // Retrieves the accessible role of an accessible object. | |
| 713 | 747 | func (x *AlertDialog) GetAccessibleRole() gtk.AccessibleRole { | |
| 714 | 748 | ||
| 715 | 749 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 716 | 750 | return cret | |
| 717 | 751 | } | |
| 718 | 752 | ||
| 719 | - | // Resets the accessible @property to its default value. | |
| 753 | + | // Retrieves the implementation for the given accessible object. | |
| 754 | + | func (x *AlertDialog) GetAtContext() *gtk.ATContext { | |
| 755 | + | var cls *gtk.ATContext | |
| 756 | + | ||
| 757 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 758 | + | ||
| 759 | + | if cret == 0 { | |
| 760 | + | return nil | |
| 761 | + | } | |
| 762 | + | cls = >k.ATContext{} | |
| 763 | + | cls.Ptr = cret | |
| 764 | + | return cls | |
| 765 | + | } | |
| 766 | + | ||
| 767 | + | // Queries the coordinates and dimensions of this accessible | |
| 768 | + | // | |
| 769 | + | // This functionality can be overridden by `GtkAccessible` | |
| 770 | + | // implementations, e.g. to get the bounds from an ignored | |
| 771 | + | // child widget. | |
| 772 | + | func (x *AlertDialog) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 773 | + | ||
| 774 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 775 | + | return cret | |
| 776 | + | } | |
| 777 | + | ||
| 778 | + | // Retrieves the first accessible child of an accessible object. | |
| 779 | + | func (x *AlertDialog) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 780 | + | var cls *gtk.AccessibleBase | |
| 781 | + | ||
| 782 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 783 | + | ||
| 784 | + | if cret == 0 { | |
| 785 | + | return nil | |
| 786 | + | } | |
| 787 | + | cls = >k.AccessibleBase{} | |
| 788 | + | cls.Ptr = cret | |
| 789 | + | return cls | |
| 790 | + | } | |
| 791 | + | ||
| 792 | + | // Retrieves the next accessible sibling of an accessible object | |
| 793 | + | func (x *AlertDialog) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 794 | + | var cls *gtk.AccessibleBase | |
| 795 | + | ||
| 796 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 797 | + | ||
| 798 | + | if cret == 0 { | |
| 799 | + | return nil | |
| 800 | + | } | |
| 801 | + | cls = >k.AccessibleBase{} | |
| 802 | + | cls.Ptr = cret | |
| 803 | + | return cls | |
| 804 | + | } | |
| 805 | + | ||
| 806 | + | // Queries a platform state, such as focus. | |
| 807 | + | // | |
| 808 | + | // This functionality can be overridden by `GtkAccessible` | |
| 809 | + | // implementations, e.g. to get platform state from an ignored | |
| 810 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 811 | + | func (x *AlertDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 812 | + | ||
| 813 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 814 | + | return cret | |
| 815 | + | } | |
| 816 | + | ||
| 817 | + | // Resets the accessible property to its default value. | |
| 720 | 818 | func (x *AlertDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 721 | 819 | ||
| 722 | 820 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 723 | 821 | ||
| 724 | 822 | } | |
| 725 | 823 | ||
| 726 | - | // Resets the accessible @relation to its default value. | |
| 824 | + | // Resets the accessible relation to its default value. | |
| 727 | 825 | func (x *AlertDialog) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 728 | 826 | ||
| 729 | 827 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 730 | 828 | ||
| 731 | 829 | } | |
| 732 | 830 | ||
| 733 | - | // Resets the accessible @state to its default value. | |
| 831 | + | // Resets the accessible state to its default value. | |
| 734 | 832 | func (x *AlertDialog) ResetState(StateVar gtk.AccessibleState) { | |
| 735 | 833 | ||
| 736 | 834 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 737 | 835 | ||
| 738 | 836 | } | |
| 739 | 837 | ||
| 838 | + | // Sets the parent and sibling of an accessible object. | |
| 839 | + | // | |
| 840 | + | // This function is meant to be used by accessible implementations that are | |
| 841 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 842 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 843 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 844 | + | // interface, you will use this function to ensure that the parent of each | |
| 845 | + | // child widget is the metadata object, and the parent of each metadata | |
| 846 | + | // object is the container widget. | |
| 847 | + | func (x *AlertDialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 848 | + | ||
| 849 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 850 | + | ||
| 851 | + | } | |
| 852 | + | ||
| 853 | + | // Updates the next accessible sibling. | |
| 854 | + | // | |
| 855 | + | // That might be useful when a new child of a custom accessible | |
| 856 | + | // is created, and it needs to be linked to a previous child. | |
| 857 | + | func (x *AlertDialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 858 | + | ||
| 859 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 860 | + | ||
| 861 | + | } | |
| 862 | + | ||
| 863 | + | // Informs ATs that the platform state has changed. | |
| 864 | + | // | |
| 865 | + | // This function should be used by `GtkAccessible` implementations that | |
| 866 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 867 | + | // states automatically. | |
| 868 | + | func (x *AlertDialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 869 | + | ||
| 870 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 871 | + | ||
| 872 | + | } | |
| 873 | + | ||
| 740 | 874 | // Updates a list of accessible properties. | |
| 741 | 875 | // | |
| 742 | 876 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -779,7 +913,7 @@ func (x *AlertDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 779 | 913 | // relation change must be communicated to assistive technologies. | |
| 780 | 914 | // | |
| 781 | 915 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 782 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 916 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 783 | 917 | // | |
| 784 | 918 | // ```c | |
| 785 | 919 | // gtk_accessible_update_relation (accessible, | |
| @@ -809,13 +943,17 @@ func (x *AlertDialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 809 | 943 | ||
| 810 | 944 | } | |
| 811 | 945 | ||
| 812 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 813 | - | // documentation for the value types of accessible states. | |
| 946 | + | // Updates a list of accessible states. | |
| 814 | 947 | // | |
| 815 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 816 | - | // state change must be communicated to assistive technologies. | |
| 948 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 949 | + | // value types of accessible states. | |
| 950 | + | // | |
| 951 | + | // This function should be called by `GtkWidget` types whenever | |
| 952 | + | // an accessible state change must be communicated to assistive | |
| 953 | + | // technologies. | |
| 817 | 954 | // | |
| 818 | 955 | // Example: | |
| 956 | + | // | |
| 819 | 957 | // ```c | |
| 820 | 958 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 821 | 959 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -845,7 +983,7 @@ func (x *AlertDialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessibl | |||
| 845 | 983 | // Gets the ID of the @buildable object. | |
| 846 | 984 | // | |
| 847 | 985 | // `GtkBuilder` sets the name based on the ID attribute | |
| 848 | - | // of the <object> tag used to construct the @buildable. | |
| 986 | + | // of the `<object>` tag used to construct the @buildable. | |
| 849 | 987 | func (x *AlertDialog) GetBuildableId() string { | |
| 850 | 988 | ||
| 851 | 989 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-application-window.go +261 -67
| @@ -105,6 +105,15 @@ func (x *ApplicationWindow) AddBreakpoint(BreakpointVar *Breakpoint) { | |||
| 105 | 105 | ||
| 106 | 106 | } | |
| 107 | 107 | ||
| 108 | + | var xApplicationWindowGetAdaptivePreview func(uintptr) bool | |
| 109 | + | ||
| 110 | + | // Gets whether adaptive preview for @self is currently open. | |
| 111 | + | func (x *ApplicationWindow) GetAdaptivePreview() bool { | |
| 112 | + | ||
| 113 | + | cret := xApplicationWindowGetAdaptivePreview(x.GoPointer()) | |
| 114 | + | return cret | |
| 115 | + | } | |
| 116 | + | ||
| 108 | 117 | var xApplicationWindowGetContent func(uintptr) uintptr | |
| 109 | 118 | ||
| 110 | 119 | // Gets the content widget of @self. | |
| @@ -176,6 +185,23 @@ func (x *ApplicationWindow) GetVisibleDialog() *Dialog { | |||
| 176 | 185 | return cls | |
| 177 | 186 | } | |
| 178 | 187 | ||
| 188 | + | var xApplicationWindowSetAdaptivePreview func(uintptr, bool) | |
| 189 | + | ||
| 190 | + | // Sets whether adaptive preview for @self is currently open. | |
| 191 | + | // | |
| 192 | + | // Adaptive preview is a debugging tool used for testing the window | |
| 193 | + | // contents at specific screen sizes, simulating mobile environment. | |
| 194 | + | // | |
| 195 | + | // Adaptive preview can always be accessed from inspector. This function | |
| 196 | + | // allows applications to open it manually. | |
| 197 | + | // | |
| 198 | + | // Most applications should not use this function. | |
| 199 | + | func (x *ApplicationWindow) SetAdaptivePreview(AdaptivePreviewVar bool) { | |
| 200 | + | ||
| 201 | + | xApplicationWindowSetAdaptivePreview(x.GoPointer(), AdaptivePreviewVar) | |
| 202 | + | ||
| 203 | + | } | |
| 204 | + | ||
| 179 | 205 | var xApplicationWindowSetContent func(uintptr, uintptr) | |
| 180 | 206 | ||
| 181 | 207 | // Sets the content widget of @self. | |
| @@ -198,36 +224,36 @@ func (c *ApplicationWindow) SetGoPointer(ptr uintptr) { | |||
| 198 | 224 | c.Ptr = ptr | |
| 199 | 225 | } | |
| 200 | 226 | ||
| 201 | - | // Emits the #GActionGroup::action-added signal on @action_group. | |
| 227 | + | // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group. | |
| 202 | 228 | // | |
| 203 | - | // This function should only be called by #GActionGroup implementations. | |
| 229 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 204 | 230 | func (x *ApplicationWindow) ActionAdded(ActionNameVar string) { | |
| 205 | 231 | ||
| 206 | 232 | gio.XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) | |
| 207 | 233 | ||
| 208 | 234 | } | |
| 209 | 235 | ||
| 210 | - | // Emits the #GActionGroup::action-enabled-changed signal on @action_group. | |
| 236 | + | // Emits the [signal@Gio.ActionGroup::action-enabled-changed] signal on @action_group. | |
| 211 | 237 | // | |
| 212 | - | // This function should only be called by #GActionGroup implementations. | |
| 238 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 213 | 239 | func (x *ApplicationWindow) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { | |
| 214 | 240 | ||
| 215 | 241 | gio.XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) | |
| 216 | 242 | ||
| 217 | 243 | } | |
| 218 | 244 | ||
| 219 | - | // Emits the #GActionGroup::action-removed signal on @action_group. | |
| 245 | + | // Emits the [signal@Gio.ActionGroup::action-removed] signal on @action_group. | |
| 220 | 246 | // | |
| 221 | - | // This function should only be called by #GActionGroup implementations. | |
| 247 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 222 | 248 | func (x *ApplicationWindow) ActionRemoved(ActionNameVar string) { | |
| 223 | 249 | ||
| 224 | 250 | gio.XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) | |
| 225 | 251 | ||
| 226 | 252 | } | |
| 227 | 253 | ||
| 228 | - | // Emits the #GActionGroup::action-state-changed signal on @action_group. | |
| 254 | + | // Emits the [signal@Gio.ActionGroup::action-state-changed] signal on @action_group. | |
| 229 | 255 | // | |
| 230 | - | // This function should only be called by #GActionGroup implementations. | |
| 256 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 231 | 257 | func (x *ApplicationWindow) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { | |
| 232 | 258 | ||
| 233 | 259 | gio.XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) | |
| @@ -238,35 +264,35 @@ func (x *ApplicationWindow) ActionStateChanged(ActionNameVar string, StateVar *g | |||
| 238 | 264 | // | |
| 239 | 265 | // If the action is expecting a parameter, then the correct type of | |
| 240 | 266 | // parameter must be given as @parameter. If the action is expecting no | |
| 241 | - | // parameters then @parameter must be %NULL. See | |
| 242 | - | // g_action_group_get_action_parameter_type(). | |
| 267 | + | // parameters then @parameter must be `NULL`. See | |
| 268 | + | // [method@Gio.ActionGroup.get_action_parameter_type]. | |
| 243 | 269 | // | |
| 244 | - | // If the #GActionGroup implementation supports asynchronous remote | |
| 270 | + | // If the [type@Gio.ActionGroup] implementation supports asynchronous remote | |
| 245 | 271 | // activation over D-Bus, this call may return before the relevant | |
| 246 | 272 | // D-Bus traffic has been sent, or any replies have been received. In | |
| 247 | 273 | // order to block on such asynchronous activation calls, | |
| 248 | - | // g_dbus_connection_flush() should be called prior to the code, which | |
| 274 | + | // [method@Gio.DBusConnection.flush] should be called prior to the code, which | |
| 249 | 275 | // depends on the result of the action activation. Without flushing | |
| 250 | 276 | // the D-Bus connection, there is no guarantee that the action would | |
| 251 | 277 | // have been activated. | |
| 252 | 278 | // | |
| 253 | 279 | // The following code which runs in a remote app instance, shows an | |
| 254 | - | // example of a "quit" action being activated on the primary app | |
| 255 | - | // instance over D-Bus. Here g_dbus_connection_flush() is called | |
| 256 | - | // before `exit()`. Without g_dbus_connection_flush(), the "quit" action | |
| 280 | + | // example of a ‘quit’ action being activated on the primary app | |
| 281 | + | // instance over D-Bus. Here [method@Gio.DBusConnection.flush] is called | |
| 282 | + | // before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action | |
| 257 | 283 | // may fail to be activated on the primary instance. | |
| 258 | 284 | // | |
| 259 | - | // |[<!-- language="C" --> | |
| 260 | - | // // call "quit" action on primary instance | |
| 285 | + | // ```c | |
| 286 | + | // // call ‘quit’ action on primary instance | |
| 261 | 287 | // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); | |
| 262 | 288 | // | |
| 263 | 289 | // // make sure the action is activated now | |
| 264 | - | // g_dbus_connection_flush (...); | |
| 290 | + | // g_dbus_connection_flush (…); | |
| 265 | 291 | // | |
| 266 | - | // g_debug ("application has been terminated. exiting."); | |
| 292 | + | // g_debug ("Application has been terminated. Exiting."); | |
| 267 | 293 | // | |
| 268 | 294 | // exit (0); | |
| 269 | - | // ]| | |
| 295 | + | // ``` | |
| 270 | 296 | func (x *ApplicationWindow) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { | |
| 271 | 297 | ||
| 272 | 298 | gio.XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) | |
| @@ -277,11 +303,11 @@ func (x *ApplicationWindow) ActivateAction(ActionNameVar string, ParameterVar *g | |||
| 277 | 303 | // changed to @value. | |
| 278 | 304 | // | |
| 279 | 305 | // The action must be stateful and @value must be of the correct type. | |
| 280 | - | // See g_action_group_get_action_state_type(). | |
| 306 | + | // See [method@Gio.ActionGroup.get_action_state_type]. | |
| 281 | 307 | // | |
| 282 | 308 | // This call merely requests a change. The action may refuse to change | |
| 283 | 309 | // its state or may change its state to something other than @value. | |
| 284 | - | // See g_action_group_get_action_state_hint(). | |
| 310 | + | // See [method@Gio.ActionGroup.get_action_state_hint]. | |
| 285 | 311 | // | |
| 286 | 312 | // If the @value GVariant is floating, it is consumed. | |
| 287 | 313 | func (x *ApplicationWindow) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { | |
| @@ -303,12 +329,12 @@ func (x *ApplicationWindow) GetActionEnabled(ActionNameVar string) bool { | |||
| 303 | 329 | // Queries the type of the parameter that must be given when activating | |
| 304 | 330 | // the named action within @action_group. | |
| 305 | 331 | // | |
| 306 | - | // When activating the action using g_action_group_activate_action(), | |
| 307 | - | // the #GVariant given to that function must be of the type returned | |
| 332 | + | // When activating the action using [method@Gio.ActionGroup.activate_action], | |
| 333 | + | // the [type@GLib.Variant] given to that function must be of the type returned | |
| 308 | 334 | // by this function. | |
| 309 | 335 | // | |
| 310 | - | // In the case that this function returns %NULL, you must not give any | |
| 311 | - | // #GVariant, but %NULL instead. | |
| 336 | + | // In the case that this function returns `NULL`, you must not give any | |
| 337 | + | // [type@GLib.Variant], but `NULL` instead. | |
| 312 | 338 | // | |
| 313 | 339 | // The parameter type of a particular action will never change but it is | |
| 314 | 340 | // possible for an action to be removed and for a new action to be added | |
| @@ -321,12 +347,12 @@ func (x *ApplicationWindow) GetActionParameterType(ActionNameVar string) *glib.V | |||
| 321 | 347 | ||
| 322 | 348 | // Queries the current state of the named action within @action_group. | |
| 323 | 349 | // | |
| 324 | - | // If the action is not stateful then %NULL will be returned. If the | |
| 350 | + | // If the action is not stateful then `NULL` will be returned. If the | |
| 325 | 351 | // action is stateful then the type of the return value is the type | |
| 326 | - | // given by g_action_group_get_action_state_type(). | |
| 352 | + | // given by [method@Gio.ActionGroup.get_action_state_type]. | |
| 327 | 353 | // | |
| 328 | - | // The return value (if non-%NULL) should be freed with | |
| 329 | - | // g_variant_unref() when it is no longer required. | |
| 354 | + | // The return value (if non-`NULL`) should be freed with | |
| 355 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 330 | 356 | func (x *ApplicationWindow) GetActionState(ActionNameVar string) *glib.Variant { | |
| 331 | 357 | ||
| 332 | 358 | cret := gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| @@ -336,12 +362,12 @@ func (x *ApplicationWindow) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 336 | 362 | // Requests a hint about the valid range of values for the state of the | |
| 337 | 363 | // named action within @action_group. | |
| 338 | 364 | // | |
| 339 | - | // If %NULL is returned it either means that the action is not stateful | |
| 365 | + | // If `NULL` is returned it either means that the action is not stateful | |
| 340 | 366 | // or that there is no hint about the valid range of values for the | |
| 341 | 367 | // state of the action. | |
| 342 | 368 | // | |
| 343 | - | // If a #GVariant array is returned then each item in the array is a | |
| 344 | - | // possible value for the state. If a #GVariant pair (ie: two-tuple) is | |
| 369 | + | // If a [type@GLib.Variant] array is returned then each item in the array is a | |
| 370 | + | // possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is | |
| 345 | 371 | // returned then the tuple specifies the inclusive lower and upper bound | |
| 346 | 372 | // of valid values for the state. | |
| 347 | 373 | // | |
| @@ -349,8 +375,8 @@ func (x *ApplicationWindow) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 349 | 375 | // have a state value outside of the hinted range and setting a value | |
| 350 | 376 | // within the range may fail. | |
| 351 | 377 | // | |
| 352 | - | // The return value (if non-%NULL) should be freed with | |
| 353 | - | // g_variant_unref() when it is no longer required. | |
| 378 | + | // The return value (if non-`NULL`) should be freed with | |
| 379 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 354 | 380 | func (x *ApplicationWindow) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 355 | 381 | ||
| 356 | 382 | cret := gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| @@ -361,14 +387,14 @@ func (x *ApplicationWindow) GetActionStateHint(ActionNameVar string) *glib.Varia | |||
| 361 | 387 | // @action_group. | |
| 362 | 388 | // | |
| 363 | 389 | // If the action is stateful then this function returns the | |
| 364 | - | // #GVariantType of the state. All calls to | |
| 365 | - | // g_action_group_change_action_state() must give a #GVariant of this | |
| 366 | - | // type and g_action_group_get_action_state() will return a #GVariant | |
| 390 | + | // [type@GLib.VariantType] of the state. All calls to | |
| 391 | + | // [method@Gio.ActionGroup.change_action_state] must give a [type@GLib.Variant] of this | |
| 392 | + | // type and [method@Gio.ActionGroup.get_action_state] will return a [type@GLib.Variant] | |
| 367 | 393 | // of the same type. | |
| 368 | 394 | // | |
| 369 | - | // If the action is not stateful then this function will return %NULL. | |
| 370 | - | // In that case, g_action_group_get_action_state() will return %NULL | |
| 371 | - | // and you must not call g_action_group_change_action_state(). | |
| 395 | + | // If the action is not stateful then this function will return `NULL`. | |
| 396 | + | // In that case, [method@Gio.ActionGroup.get_action_state] will return `NULL` | |
| 397 | + | // and you must not call [method@Gio.ActionGroup.change_action_state]. | |
| 372 | 398 | // | |
| 373 | 399 | // The state type of a particular action will never change but it is | |
| 374 | 400 | // possible for an action to be removed and for a new action to be added | |
| @@ -388,7 +414,7 @@ func (x *ApplicationWindow) HasAction(ActionNameVar string) bool { | |||
| 388 | 414 | ||
| 389 | 415 | // Lists the actions contained within @action_group. | |
| 390 | 416 | // | |
| 391 | - | // The caller is responsible for freeing the list with g_strfreev() when | |
| 417 | + | // The caller is responsible for freeing the list with [func@GLib.strfreev] when | |
| 392 | 418 | // it is no longer required. | |
| 393 | 419 | func (x *ApplicationWindow) ListActions() []string { | |
| 394 | 420 | ||
| @@ -399,18 +425,18 @@ func (x *ApplicationWindow) ListActions() []string { | |||
| 399 | 425 | // Queries all aspects of the named action within an @action_group. | |
| 400 | 426 | // | |
| 401 | 427 | // This function acquires the information available from | |
| 402 | - | // g_action_group_has_action(), g_action_group_get_action_enabled(), | |
| 403 | - | // g_action_group_get_action_parameter_type(), | |
| 404 | - | // g_action_group_get_action_state_type(), | |
| 405 | - | // g_action_group_get_action_state_hint() and | |
| 406 | - | // g_action_group_get_action_state() with a single function call. | |
| 428 | + | // [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled], | |
| 429 | + | // [method@Gio.ActionGroup.get_action_parameter_type], | |
| 430 | + | // [method@Gio.ActionGroup.get_action_state_type], | |
| 431 | + | // [method@Gio.ActionGroup.get_action_state_hint] and | |
| 432 | + | // [method@Gio.ActionGroup.get_action_state] with a single function call. | |
| 407 | 433 | // | |
| 408 | 434 | // This provides two main benefits. | |
| 409 | 435 | // | |
| 410 | 436 | // The first is the improvement in efficiency that comes with not having | |
| 411 | 437 | // to perform repeated lookups of the action in order to discover | |
| 412 | 438 | // different things about it. The second is that implementing | |
| 413 | - | // #GActionGroup can now be done by only overriding this one virtual | |
| 439 | + | // [type@Gio.ActionGroup] can now be done by only overriding this one virtual | |
| 414 | 440 | // function. | |
| 415 | 441 | // | |
| 416 | 442 | // The interface provides a default implementation of this function that | |
| @@ -419,9 +445,9 @@ func (x *ApplicationWindow) ListActions() []string { | |||
| 419 | 445 | // those functions that call this function. All implementations, | |
| 420 | 446 | // therefore, must override either this function or all of the others. | |
| 421 | 447 | // | |
| 422 | - | // If the action exists, %TRUE is returned and any of the requested | |
| 423 | - | // fields (as indicated by having a non-%NULL reference passed in) are | |
| 424 | - | // filled. If the action doesn't exist, %FALSE is returned and the | |
| 448 | + | // If the action exists, `TRUE` is returned and any of the requested | |
| 449 | + | // fields (as indicated by having a non-`NULL` reference passed in) are | |
| 450 | + | // filled. If the action doesn’t exist, `FALSE` is returned and the | |
| 425 | 451 | // fields may or may not have been modified. | |
| 426 | 452 | func (x *ApplicationWindow) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 427 | 453 | ||
| @@ -441,12 +467,12 @@ func (x *ApplicationWindow) AddAction(ActionVar gio.Action) { | |||
| 441 | 467 | ||
| 442 | 468 | } | |
| 443 | 469 | ||
| 444 | - | // A convenience function for creating multiple #GSimpleAction instances | |
| 445 | - | // and adding them to a #GActionMap. | |
| 470 | + | // A convenience function for creating multiple [class@Gio.SimpleAction] | |
| 471 | + | // instances and adding them to a [iface@Gio.ActionMap]. | |
| 446 | 472 | // | |
| 447 | - | // Each action is constructed as per one #GActionEntry. | |
| 473 | + | // Each action is constructed as per one [struct@Gio.ActionEntry]. | |
| 448 | 474 | // | |
| 449 | - | // |[<!-- language="C" --> | |
| 475 | + | // ```c | |
| 450 | 476 | // static void | |
| 451 | 477 | // activate_quit (GSimpleAction *simple, | |
| 452 | 478 | // | |
| @@ -483,7 +509,7 @@ func (x *ApplicationWindow) AddAction(ActionVar gio.Action) { | |||
| 483 | 509 | // return G_ACTION_GROUP (group); | |
| 484 | 510 | // } | |
| 485 | 511 | // | |
| 486 | - | // ]| | |
| 512 | + | // ``` | |
| 487 | 513 | func (x *ApplicationWindow) AddActionEntries(EntriesVar []gio.ActionEntry, NEntriesVar int, UserDataVar uintptr) { | |
| 488 | 514 | ||
| 489 | 515 | gio.XGActionMapAddActionEntries(x.GoPointer(), EntriesVar, NEntriesVar, UserDataVar) | |
| @@ -492,7 +518,7 @@ func (x *ApplicationWindow) AddActionEntries(EntriesVar []gio.ActionEntry, NEntr | |||
| 492 | 518 | ||
| 493 | 519 | // Looks up the action with the name @action_name in @action_map. | |
| 494 | 520 | // | |
| 495 | - | // If no such action exists, returns %NULL. | |
| 521 | + | // If no such action exists, returns `NULL`. | |
| 496 | 522 | func (x *ApplicationWindow) LookupAction(ActionNameVar string) *gio.ActionBase { | |
| 497 | 523 | var cls *gio.ActionBase | |
| 498 | 524 | ||
| @@ -516,34 +542,196 @@ func (x *ApplicationWindow) RemoveAction(ActionNameVar string) { | |||
| 516 | 542 | ||
| 517 | 543 | } | |
| 518 | 544 | ||
| 519 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 545 | + | // Remove actions from a [iface@Gio.ActionMap]. This is meant as the reverse of | |
| 546 | + | // [method@Gio.ActionMap.add_action_entries]. | |
| 547 | + | // | |
| 548 | + | // ```c | |
| 549 | + | // | |
| 550 | + | // static const GActionEntry entries[] = { | |
| 551 | + | // { "quit", activate_quit }, | |
| 552 | + | // { "print-string", activate_print_string, "s" } | |
| 553 | + | // }; | |
| 554 | + | // | |
| 555 | + | // void | |
| 556 | + | // add_actions (GActionMap *map) | |
| 557 | + | // | |
| 558 | + | // { | |
| 559 | + | // g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL); | |
| 560 | + | // } | |
| 561 | + | // | |
| 562 | + | // void | |
| 563 | + | // remove_actions (GActionMap *map) | |
| 564 | + | // | |
| 565 | + | // { | |
| 566 | + | // g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries)); | |
| 567 | + | // } | |
| 568 | + | // | |
| 569 | + | // ``` | |
| 570 | + | func (x *ApplicationWindow) RemoveActionEntries(EntriesVar []gio.ActionEntry, NEntriesVar int) { | |
| 571 | + | ||
| 572 | + | gio.XGActionMapRemoveActionEntries(x.GoPointer(), EntriesVar, NEntriesVar) | |
| 573 | + | ||
| 574 | + | } | |
| 575 | + | ||
| 576 | + | // Requests the user's screen reader to announce the given message. | |
| 577 | + | // | |
| 578 | + | // This kind of notification is useful for messages that | |
| 579 | + | // either have only a visual representation or that are not | |
| 580 | + | // exposed visually at all, e.g. a notification about a | |
| 581 | + | // successful operation. | |
| 582 | + | // | |
| 583 | + | // Also, by using this API, you can ensure that the message | |
| 584 | + | // does not interrupts the user's current screen reader output. | |
| 585 | + | func (x *ApplicationWindow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 586 | + | ||
| 587 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 588 | + | ||
| 589 | + | } | |
| 590 | + | ||
| 591 | + | // Retrieves the accessible parent for an accessible object. | |
| 592 | + | // | |
| 593 | + | // This function returns `NULL` for top level widgets. | |
| 594 | + | func (x *ApplicationWindow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 595 | + | var cls *gtk.AccessibleBase | |
| 596 | + | ||
| 597 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 598 | + | ||
| 599 | + | if cret == 0 { | |
| 600 | + | return nil | |
| 601 | + | } | |
| 602 | + | cls = >k.AccessibleBase{} | |
| 603 | + | cls.Ptr = cret | |
| 604 | + | return cls | |
| 605 | + | } | |
| 606 | + | ||
| 607 | + | // Retrieves the accessible role of an accessible object. | |
| 520 | 608 | func (x *ApplicationWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 521 | 609 | ||
| 522 | 610 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 523 | 611 | return cret | |
| 524 | 612 | } | |
| 525 | 613 | ||
| 526 | - | // Resets the accessible @property to its default value. | |
| 614 | + | // Retrieves the implementation for the given accessible object. | |
| 615 | + | func (x *ApplicationWindow) GetAtContext() *gtk.ATContext { | |
| 616 | + | var cls *gtk.ATContext | |
| 617 | + | ||
| 618 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 619 | + | ||
| 620 | + | if cret == 0 { | |
| 621 | + | return nil | |
| 622 | + | } | |
| 623 | + | cls = >k.ATContext{} | |
| 624 | + | cls.Ptr = cret | |
| 625 | + | return cls | |
| 626 | + | } | |
| 627 | + | ||
| 628 | + | // Queries the coordinates and dimensions of this accessible | |
| 629 | + | // | |
| 630 | + | // This functionality can be overridden by `GtkAccessible` | |
| 631 | + | // implementations, e.g. to get the bounds from an ignored | |
| 632 | + | // child widget. | |
| 633 | + | func (x *ApplicationWindow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 634 | + | ||
| 635 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 636 | + | return cret | |
| 637 | + | } | |
| 638 | + | ||
| 639 | + | // Retrieves the first accessible child of an accessible object. | |
| 640 | + | func (x *ApplicationWindow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 641 | + | var cls *gtk.AccessibleBase | |
| 642 | + | ||
| 643 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 644 | + | ||
| 645 | + | if cret == 0 { | |
| 646 | + | return nil | |
| 647 | + | } | |
| 648 | + | cls = >k.AccessibleBase{} | |
| 649 | + | cls.Ptr = cret | |
| 650 | + | return cls | |
| 651 | + | } | |
| 652 | + | ||
| 653 | + | // Retrieves the next accessible sibling of an accessible object | |
| 654 | + | func (x *ApplicationWindow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 655 | + | var cls *gtk.AccessibleBase | |
| 656 | + | ||
| 657 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 658 | + | ||
| 659 | + | if cret == 0 { | |
| 660 | + | return nil | |
| 661 | + | } | |
| 662 | + | cls = >k.AccessibleBase{} | |
| 663 | + | cls.Ptr = cret | |
| 664 | + | return cls | |
| 665 | + | } | |
| 666 | + | ||
| 667 | + | // Queries a platform state, such as focus. | |
| 668 | + | // | |
| 669 | + | // This functionality can be overridden by `GtkAccessible` | |
| 670 | + | // implementations, e.g. to get platform state from an ignored | |
| 671 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 672 | + | func (x *ApplicationWindow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 673 | + | ||
| 674 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 675 | + | return cret | |
| 676 | + | } | |
| 677 | + | ||
| 678 | + | // Resets the accessible property to its default value. | |
| 527 | 679 | func (x *ApplicationWindow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 528 | 680 | ||
| 529 | 681 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 530 | 682 | ||
| 531 | 683 | } | |
| 532 | 684 | ||
| 533 | - | // Resets the accessible @relation to its default value. | |
| 685 | + | // Resets the accessible relation to its default value. | |
| 534 | 686 | func (x *ApplicationWindow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 535 | 687 | ||
| 536 | 688 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 537 | 689 | ||
| 538 | 690 | } | |
| 539 | 691 | ||
| 540 | - | // Resets the accessible @state to its default value. | |
| 692 | + | // Resets the accessible state to its default value. | |
| 541 | 693 | func (x *ApplicationWindow) ResetState(StateVar gtk.AccessibleState) { | |
| 542 | 694 | ||
| 543 | 695 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 544 | 696 | ||
| 545 | 697 | } | |
| 546 | 698 | ||
| 699 | + | // Sets the parent and sibling of an accessible object. | |
| 700 | + | // | |
| 701 | + | // This function is meant to be used by accessible implementations that are | |
| 702 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 703 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 704 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 705 | + | // interface, you will use this function to ensure that the parent of each | |
| 706 | + | // child widget is the metadata object, and the parent of each metadata | |
| 707 | + | // object is the container widget. | |
| 708 | + | func (x *ApplicationWindow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 709 | + | ||
| 710 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 711 | + | ||
| 712 | + | } | |
| 713 | + | ||
| 714 | + | // Updates the next accessible sibling. | |
| 715 | + | // | |
| 716 | + | // That might be useful when a new child of a custom accessible | |
| 717 | + | // is created, and it needs to be linked to a previous child. | |
| 718 | + | func (x *ApplicationWindow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 719 | + | ||
| 720 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 721 | + | ||
| 722 | + | } | |
| 723 | + | ||
| 724 | + | // Informs ATs that the platform state has changed. | |
| 725 | + | // | |
| 726 | + | // This function should be used by `GtkAccessible` implementations that | |
| 727 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 728 | + | // states automatically. | |
| 729 | + | func (x *ApplicationWindow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 730 | + | ||
| 731 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 732 | + | ||
| 733 | + | } | |
| 734 | + | ||
| 547 | 735 | // Updates a list of accessible properties. | |
| 548 | 736 | // | |
| 549 | 737 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -586,7 +774,7 @@ func (x *ApplicationWindow) UpdatePropertyValue(NPropertiesVar int, PropertiesVa | |||
| 586 | 774 | // relation change must be communicated to assistive technologies. | |
| 587 | 775 | // | |
| 588 | 776 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 589 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 777 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 590 | 778 | // | |
| 591 | 779 | // ```c | |
| 592 | 780 | // gtk_accessible_update_relation (accessible, | |
| @@ -616,13 +804,17 @@ func (x *ApplicationWindow) UpdateRelationValue(NRelationsVar int, RelationsVar | |||
| 616 | 804 | ||
| 617 | 805 | } | |
| 618 | 806 | ||
| 619 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 620 | - | // documentation for the value types of accessible states. | |
| 807 | + | // Updates a list of accessible states. | |
| 621 | 808 | // | |
| 622 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 623 | - | // state change must be communicated to assistive technologies. | |
| 809 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 810 | + | // value types of accessible states. | |
| 811 | + | // | |
| 812 | + | // This function should be called by `GtkWidget` types whenever | |
| 813 | + | // an accessible state change must be communicated to assistive | |
| 814 | + | // technologies. | |
| 624 | 815 | // | |
| 625 | 816 | // Example: | |
| 817 | + | // | |
| 626 | 818 | // ```c | |
| 627 | 819 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 628 | 820 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -652,7 +844,7 @@ func (x *ApplicationWindow) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acc | |||
| 652 | 844 | // Gets the ID of the @buildable object. | |
| 653 | 845 | // | |
| 654 | 846 | // `GtkBuilder` sets the name based on the ID attribute | |
| 655 | - | // of the <object> tag used to construct the @buildable. | |
| 847 | + | // of the `<object>` tag used to construct the @buildable. | |
| 656 | 848 | func (x *ApplicationWindow) GetBuildableId() string { | |
| 657 | 849 | ||
| 658 | 850 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -779,10 +971,12 @@ func init() { | |||
| 779 | 971 | core.PuregoSafeRegister(&xNewApplicationWindow, lib, "adw_application_window_new") | |
| 780 | 972 | ||
| 781 | 973 | core.PuregoSafeRegister(&xApplicationWindowAddBreakpoint, lib, "adw_application_window_add_breakpoint") | |
| 974 | + | core.PuregoSafeRegister(&xApplicationWindowGetAdaptivePreview, lib, "adw_application_window_get_adaptive_preview") | |
| 782 | 975 | core.PuregoSafeRegister(&xApplicationWindowGetContent, lib, "adw_application_window_get_content") | |
| 783 | 976 | core.PuregoSafeRegister(&xApplicationWindowGetCurrentBreakpoint, lib, "adw_application_window_get_current_breakpoint") | |
| 784 | 977 | core.PuregoSafeRegister(&xApplicationWindowGetDialogs, lib, "adw_application_window_get_dialogs") | |
| 785 | 978 | core.PuregoSafeRegister(&xApplicationWindowGetVisibleDialog, lib, "adw_application_window_get_visible_dialog") | |
| 979 | + | core.PuregoSafeRegister(&xApplicationWindowSetAdaptivePreview, lib, "adw_application_window_set_adaptive_preview") | |
| 786 | 980 | core.PuregoSafeRegister(&xApplicationWindowSetContent, lib, "adw_application_window_set_content") | |
| 787 | 981 | ||
| 788 | 982 | } | |
M v4/adw/adw-application.go +88 -57
| @@ -121,36 +121,36 @@ func (c *Application) SetGoPointer(ptr uintptr) { | |||
| 121 | 121 | c.Ptr = ptr | |
| 122 | 122 | } | |
| 123 | 123 | ||
| 124 | - | // Emits the #GActionGroup::action-added signal on @action_group. | |
| 124 | + | // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group. | |
| 125 | 125 | // | |
| 126 | - | // This function should only be called by #GActionGroup implementations. | |
| 126 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 127 | 127 | func (x *Application) ActionAdded(ActionNameVar string) { | |
| 128 | 128 | ||
| 129 | 129 | gio.XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) | |
| 130 | 130 | ||
| 131 | 131 | } | |
| 132 | 132 | ||
| 133 | - | // Emits the #GActionGroup::action-enabled-changed signal on @action_group. | |
| 133 | + | // Emits the [signal@Gio.ActionGroup::action-enabled-changed] signal on @action_group. | |
| 134 | 134 | // | |
| 135 | - | // This function should only be called by #GActionGroup implementations. | |
| 135 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 136 | 136 | func (x *Application) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { | |
| 137 | 137 | ||
| 138 | 138 | gio.XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) | |
| 139 | 139 | ||
| 140 | 140 | } | |
| 141 | 141 | ||
| 142 | - | // Emits the #GActionGroup::action-removed signal on @action_group. | |
| 142 | + | // Emits the [signal@Gio.ActionGroup::action-removed] signal on @action_group. | |
| 143 | 143 | // | |
| 144 | - | // This function should only be called by #GActionGroup implementations. | |
| 144 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 145 | 145 | func (x *Application) ActionRemoved(ActionNameVar string) { | |
| 146 | 146 | ||
| 147 | 147 | gio.XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) | |
| 148 | 148 | ||
| 149 | 149 | } | |
| 150 | 150 | ||
| 151 | - | // Emits the #GActionGroup::action-state-changed signal on @action_group. | |
| 151 | + | // Emits the [signal@Gio.ActionGroup::action-state-changed] signal on @action_group. | |
| 152 | 152 | // | |
| 153 | - | // This function should only be called by #GActionGroup implementations. | |
| 153 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 154 | 154 | func (x *Application) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { | |
| 155 | 155 | ||
| 156 | 156 | gio.XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) | |
| @@ -161,35 +161,35 @@ func (x *Application) ActionStateChanged(ActionNameVar string, StateVar *glib.Va | |||
| 161 | 161 | // | |
| 162 | 162 | // If the action is expecting a parameter, then the correct type of | |
| 163 | 163 | // parameter must be given as @parameter. If the action is expecting no | |
| 164 | - | // parameters then @parameter must be %NULL. See | |
| 165 | - | // g_action_group_get_action_parameter_type(). | |
| 164 | + | // parameters then @parameter must be `NULL`. See | |
| 165 | + | // [method@Gio.ActionGroup.get_action_parameter_type]. | |
| 166 | 166 | // | |
| 167 | - | // If the #GActionGroup implementation supports asynchronous remote | |
| 167 | + | // If the [type@Gio.ActionGroup] implementation supports asynchronous remote | |
| 168 | 168 | // activation over D-Bus, this call may return before the relevant | |
| 169 | 169 | // D-Bus traffic has been sent, or any replies have been received. In | |
| 170 | 170 | // order to block on such asynchronous activation calls, | |
| 171 | - | // g_dbus_connection_flush() should be called prior to the code, which | |
| 171 | + | // [method@Gio.DBusConnection.flush] should be called prior to the code, which | |
| 172 | 172 | // depends on the result of the action activation. Without flushing | |
| 173 | 173 | // the D-Bus connection, there is no guarantee that the action would | |
| 174 | 174 | // have been activated. | |
| 175 | 175 | // | |
| 176 | 176 | // The following code which runs in a remote app instance, shows an | |
| 177 | - | // example of a "quit" action being activated on the primary app | |
| 178 | - | // instance over D-Bus. Here g_dbus_connection_flush() is called | |
| 179 | - | // before `exit()`. Without g_dbus_connection_flush(), the "quit" action | |
| 177 | + | // example of a ‘quit’ action being activated on the primary app | |
| 178 | + | // instance over D-Bus. Here [method@Gio.DBusConnection.flush] is called | |
| 179 | + | // before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action | |
| 180 | 180 | // may fail to be activated on the primary instance. | |
| 181 | 181 | // | |
| 182 | - | // |[<!-- language="C" --> | |
| 183 | - | // // call "quit" action on primary instance | |
| 182 | + | // ```c | |
| 183 | + | // // call ‘quit’ action on primary instance | |
| 184 | 184 | // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); | |
| 185 | 185 | // | |
| 186 | 186 | // // make sure the action is activated now | |
| 187 | - | // g_dbus_connection_flush (...); | |
| 187 | + | // g_dbus_connection_flush (…); | |
| 188 | 188 | // | |
| 189 | - | // g_debug ("application has been terminated. exiting."); | |
| 189 | + | // g_debug ("Application has been terminated. Exiting."); | |
| 190 | 190 | // | |
| 191 | 191 | // exit (0); | |
| 192 | - | // ]| | |
| 192 | + | // ``` | |
| 193 | 193 | func (x *Application) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { | |
| 194 | 194 | ||
| 195 | 195 | gio.XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) | |
| @@ -200,11 +200,11 @@ func (x *Application) ActivateAction(ActionNameVar string, ParameterVar *glib.Va | |||
| 200 | 200 | // changed to @value. | |
| 201 | 201 | // | |
| 202 | 202 | // The action must be stateful and @value must be of the correct type. | |
| 203 | - | // See g_action_group_get_action_state_type(). | |
| 203 | + | // See [method@Gio.ActionGroup.get_action_state_type]. | |
| 204 | 204 | // | |
| 205 | 205 | // This call merely requests a change. The action may refuse to change | |
| 206 | 206 | // its state or may change its state to something other than @value. | |
| 207 | - | // See g_action_group_get_action_state_hint(). | |
| 207 | + | // See [method@Gio.ActionGroup.get_action_state_hint]. | |
| 208 | 208 | // | |
| 209 | 209 | // If the @value GVariant is floating, it is consumed. | |
| 210 | 210 | func (x *Application) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { | |
| @@ -226,12 +226,12 @@ func (x *Application) GetActionEnabled(ActionNameVar string) bool { | |||
| 226 | 226 | // Queries the type of the parameter that must be given when activating | |
| 227 | 227 | // the named action within @action_group. | |
| 228 | 228 | // | |
| 229 | - | // When activating the action using g_action_group_activate_action(), | |
| 230 | - | // the #GVariant given to that function must be of the type returned | |
| 229 | + | // When activating the action using [method@Gio.ActionGroup.activate_action], | |
| 230 | + | // the [type@GLib.Variant] given to that function must be of the type returned | |
| 231 | 231 | // by this function. | |
| 232 | 232 | // | |
| 233 | - | // In the case that this function returns %NULL, you must not give any | |
| 234 | - | // #GVariant, but %NULL instead. | |
| 233 | + | // In the case that this function returns `NULL`, you must not give any | |
| 234 | + | // [type@GLib.Variant], but `NULL` instead. | |
| 235 | 235 | // | |
| 236 | 236 | // The parameter type of a particular action will never change but it is | |
| 237 | 237 | // possible for an action to be removed and for a new action to be added | |
| @@ -244,12 +244,12 @@ func (x *Application) GetActionParameterType(ActionNameVar string) *glib.Variant | |||
| 244 | 244 | ||
| 245 | 245 | // Queries the current state of the named action within @action_group. | |
| 246 | 246 | // | |
| 247 | - | // If the action is not stateful then %NULL will be returned. If the | |
| 247 | + | // If the action is not stateful then `NULL` will be returned. If the | |
| 248 | 248 | // action is stateful then the type of the return value is the type | |
| 249 | - | // given by g_action_group_get_action_state_type(). | |
| 249 | + | // given by [method@Gio.ActionGroup.get_action_state_type]. | |
| 250 | 250 | // | |
| 251 | - | // The return value (if non-%NULL) should be freed with | |
| 252 | - | // g_variant_unref() when it is no longer required. | |
| 251 | + | // The return value (if non-`NULL`) should be freed with | |
| 252 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 253 | 253 | func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |
| 254 | 254 | ||
| 255 | 255 | cret := gio.XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| @@ -259,12 +259,12 @@ func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 259 | 259 | // Requests a hint about the valid range of values for the state of the | |
| 260 | 260 | // named action within @action_group. | |
| 261 | 261 | // | |
| 262 | - | // If %NULL is returned it either means that the action is not stateful | |
| 262 | + | // If `NULL` is returned it either means that the action is not stateful | |
| 263 | 263 | // or that there is no hint about the valid range of values for the | |
| 264 | 264 | // state of the action. | |
| 265 | 265 | // | |
| 266 | - | // If a #GVariant array is returned then each item in the array is a | |
| 267 | - | // possible value for the state. If a #GVariant pair (ie: two-tuple) is | |
| 266 | + | // If a [type@GLib.Variant] array is returned then each item in the array is a | |
| 267 | + | // possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is | |
| 268 | 268 | // returned then the tuple specifies the inclusive lower and upper bound | |
| 269 | 269 | // of valid values for the state. | |
| 270 | 270 | // | |
| @@ -272,8 +272,8 @@ func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 272 | 272 | // have a state value outside of the hinted range and setting a value | |
| 273 | 273 | // within the range may fail. | |
| 274 | 274 | // | |
| 275 | - | // The return value (if non-%NULL) should be freed with | |
| 276 | - | // g_variant_unref() when it is no longer required. | |
| 275 | + | // The return value (if non-`NULL`) should be freed with | |
| 276 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 277 | 277 | func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 278 | 278 | ||
| 279 | 279 | cret := gio.XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| @@ -284,14 +284,14 @@ func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |||
| 284 | 284 | // @action_group. | |
| 285 | 285 | // | |
| 286 | 286 | // If the action is stateful then this function returns the | |
| 287 | - | // #GVariantType of the state. All calls to | |
| 288 | - | // g_action_group_change_action_state() must give a #GVariant of this | |
| 289 | - | // type and g_action_group_get_action_state() will return a #GVariant | |
| 287 | + | // [type@GLib.VariantType] of the state. All calls to | |
| 288 | + | // [method@Gio.ActionGroup.change_action_state] must give a [type@GLib.Variant] of this | |
| 289 | + | // type and [method@Gio.ActionGroup.get_action_state] will return a [type@GLib.Variant] | |
| 290 | 290 | // of the same type. | |
| 291 | 291 | // | |
| 292 | - | // If the action is not stateful then this function will return %NULL. | |
| 293 | - | // In that case, g_action_group_get_action_state() will return %NULL | |
| 294 | - | // and you must not call g_action_group_change_action_state(). | |
| 292 | + | // If the action is not stateful then this function will return `NULL`. | |
| 293 | + | // In that case, [method@Gio.ActionGroup.get_action_state] will return `NULL` | |
| 294 | + | // and you must not call [method@Gio.ActionGroup.change_action_state]. | |
| 295 | 295 | // | |
| 296 | 296 | // The state type of a particular action will never change but it is | |
| 297 | 297 | // possible for an action to be removed and for a new action to be added | |
| @@ -311,7 +311,7 @@ func (x *Application) HasAction(ActionNameVar string) bool { | |||
| 311 | 311 | ||
| 312 | 312 | // Lists the actions contained within @action_group. | |
| 313 | 313 | // | |
| 314 | - | // The caller is responsible for freeing the list with g_strfreev() when | |
| 314 | + | // The caller is responsible for freeing the list with [func@GLib.strfreev] when | |
| 315 | 315 | // it is no longer required. | |
| 316 | 316 | func (x *Application) ListActions() []string { | |
| 317 | 317 | ||
| @@ -322,18 +322,18 @@ func (x *Application) ListActions() []string { | |||
| 322 | 322 | // Queries all aspects of the named action within an @action_group. | |
| 323 | 323 | // | |
| 324 | 324 | // This function acquires the information available from | |
| 325 | - | // g_action_group_has_action(), g_action_group_get_action_enabled(), | |
| 326 | - | // g_action_group_get_action_parameter_type(), | |
| 327 | - | // g_action_group_get_action_state_type(), | |
| 328 | - | // g_action_group_get_action_state_hint() and | |
| 329 | - | // g_action_group_get_action_state() with a single function call. | |
| 325 | + | // [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled], | |
| 326 | + | // [method@Gio.ActionGroup.get_action_parameter_type], | |
| 327 | + | // [method@Gio.ActionGroup.get_action_state_type], | |
| 328 | + | // [method@Gio.ActionGroup.get_action_state_hint] and | |
| 329 | + | // [method@Gio.ActionGroup.get_action_state] with a single function call. | |
| 330 | 330 | // | |
| 331 | 331 | // This provides two main benefits. | |
| 332 | 332 | // | |
| 333 | 333 | // The first is the improvement in efficiency that comes with not having | |
| 334 | 334 | // to perform repeated lookups of the action in order to discover | |
| 335 | 335 | // different things about it. The second is that implementing | |
| 336 | - | // #GActionGroup can now be done by only overriding this one virtual | |
| 336 | + | // [type@Gio.ActionGroup] can now be done by only overriding this one virtual | |
| 337 | 337 | // function. | |
| 338 | 338 | // | |
| 339 | 339 | // The interface provides a default implementation of this function that | |
| @@ -342,9 +342,9 @@ func (x *Application) ListActions() []string { | |||
| 342 | 342 | // those functions that call this function. All implementations, | |
| 343 | 343 | // therefore, must override either this function or all of the others. | |
| 344 | 344 | // | |
| 345 | - | // If the action exists, %TRUE is returned and any of the requested | |
| 346 | - | // fields (as indicated by having a non-%NULL reference passed in) are | |
| 347 | - | // filled. If the action doesn't exist, %FALSE is returned and the | |
| 345 | + | // If the action exists, `TRUE` is returned and any of the requested | |
| 346 | + | // fields (as indicated by having a non-`NULL` reference passed in) are | |
| 347 | + | // filled. If the action doesn’t exist, `FALSE` is returned and the | |
| 348 | 348 | // fields may or may not have been modified. | |
| 349 | 349 | func (x *Application) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 350 | 350 | ||
| @@ -364,12 +364,12 @@ func (x *Application) AddAction(ActionVar gio.Action) { | |||
| 364 | 364 | ||
| 365 | 365 | } | |
| 366 | 366 | ||
| 367 | - | // A convenience function for creating multiple #GSimpleAction instances | |
| 368 | - | // and adding them to a #GActionMap. | |
| 367 | + | // A convenience function for creating multiple [class@Gio.SimpleAction] | |
| 368 | + | // instances and adding them to a [iface@Gio.ActionMap]. | |
| 369 | 369 | // | |
| 370 | - | // Each action is constructed as per one #GActionEntry. | |
| 370 | + | // Each action is constructed as per one [struct@Gio.ActionEntry]. | |
| 371 | 371 | // | |
| 372 | - | // |[<!-- language="C" --> | |
| 372 | + | // ```c | |
| 373 | 373 | // static void | |
| 374 | 374 | // activate_quit (GSimpleAction *simple, | |
| 375 | 375 | // | |
| @@ -406,7 +406,7 @@ func (x *Application) AddAction(ActionVar gio.Action) { | |||
| 406 | 406 | // return G_ACTION_GROUP (group); | |
| 407 | 407 | // } | |
| 408 | 408 | // | |
| 409 | - | // ]| | |
| 409 | + | // ``` | |
| 410 | 410 | func (x *Application) AddActionEntries(EntriesVar []gio.ActionEntry, NEntriesVar int, UserDataVar uintptr) { | |
| 411 | 411 | ||
| 412 | 412 | gio.XGActionMapAddActionEntries(x.GoPointer(), EntriesVar, NEntriesVar, UserDataVar) | |
| @@ -415,7 +415,7 @@ func (x *Application) AddActionEntries(EntriesVar []gio.ActionEntry, NEntriesVar | |||
| 415 | 415 | ||
| 416 | 416 | // Looks up the action with the name @action_name in @action_map. | |
| 417 | 417 | // | |
| 418 | - | // If no such action exists, returns %NULL. | |
| 418 | + | // If no such action exists, returns `NULL`. | |
| 419 | 419 | func (x *Application) LookupAction(ActionNameVar string) *gio.ActionBase { | |
| 420 | 420 | var cls *gio.ActionBase | |
| 421 | 421 | ||
| @@ -439,6 +439,37 @@ func (x *Application) RemoveAction(ActionNameVar string) { | |||
| 439 | 439 | ||
| 440 | 440 | } | |
| 441 | 441 | ||
| 442 | + | // Remove actions from a [iface@Gio.ActionMap]. This is meant as the reverse of | |
| 443 | + | // [method@Gio.ActionMap.add_action_entries]. | |
| 444 | + | // | |
| 445 | + | // ```c | |
| 446 | + | // | |
| 447 | + | // static const GActionEntry entries[] = { | |
| 448 | + | // { "quit", activate_quit }, | |
| 449 | + | // { "print-string", activate_print_string, "s" } | |
| 450 | + | // }; | |
| 451 | + | // | |
| 452 | + | // void | |
| 453 | + | // add_actions (GActionMap *map) | |
| 454 | + | // | |
| 455 | + | // { | |
| 456 | + | // g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL); | |
| 457 | + | // } | |
| 458 | + | // | |
| 459 | + | // void | |
| 460 | + | // remove_actions (GActionMap *map) | |
| 461 | + | // | |
| 462 | + | // { | |
| 463 | + | // g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries)); | |
| 464 | + | // } | |
| 465 | + | // | |
| 466 | + | // ``` | |
| 467 | + | func (x *Application) RemoveActionEntries(EntriesVar []gio.ActionEntry, NEntriesVar int) { | |
| 468 | + | ||
| 469 | + | gio.XGActionMapRemoveActionEntries(x.GoPointer(), EntriesVar, NEntriesVar) | |
| 470 | + | ||
| 471 | + | } | |
| 472 | + | ||
| 442 | 473 | func init() { | |
| 443 | 474 | core.SetPackageName("ADW", "libadwaita-1") | |
| 444 | 475 | core.SetSharedLibrary("ADW", "libadwaita-1.so.0") | |
M v4/adw/adw-avatar.go +149 -10
| @@ -48,6 +48,10 @@ func (x *AvatarClass) GoPointer() uintptr { | |||
| 48 | 48 | // ## CSS nodes | |
| 49 | 49 | // | |
| 50 | 50 | // `AdwAvatar` has a single CSS node with name `avatar`. | |
| 51 | + | // | |
| 52 | + | // ## Accessibility | |
| 53 | + | // | |
| 54 | + | // `AdwAvatar` uses the `GTK_ACCESSIBLE_ROLE_IMG` role. | |
| 51 | 55 | type Avatar struct { | |
| 52 | 56 | gtk.Widget | |
| 53 | 57 | } | |
| @@ -217,34 +221,165 @@ func (c *Avatar) SetGoPointer(ptr uintptr) { | |||
| 217 | 221 | c.Ptr = ptr | |
| 218 | 222 | } | |
| 219 | 223 | ||
| 220 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 224 | + | // Requests the user's screen reader to announce the given message. | |
| 225 | + | // | |
| 226 | + | // This kind of notification is useful for messages that | |
| 227 | + | // either have only a visual representation or that are not | |
| 228 | + | // exposed visually at all, e.g. a notification about a | |
| 229 | + | // successful operation. | |
| 230 | + | // | |
| 231 | + | // Also, by using this API, you can ensure that the message | |
| 232 | + | // does not interrupts the user's current screen reader output. | |
| 233 | + | func (x *Avatar) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 234 | + | ||
| 235 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 236 | + | ||
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // Retrieves the accessible parent for an accessible object. | |
| 240 | + | // | |
| 241 | + | // This function returns `NULL` for top level widgets. | |
| 242 | + | func (x *Avatar) GetAccessibleParent() *gtk.AccessibleBase { | |
| 243 | + | var cls *gtk.AccessibleBase | |
| 244 | + | ||
| 245 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 246 | + | ||
| 247 | + | if cret == 0 { | |
| 248 | + | return nil | |
| 249 | + | } | |
| 250 | + | cls = >k.AccessibleBase{} | |
| 251 | + | cls.Ptr = cret | |
| 252 | + | return cls | |
| 253 | + | } | |
| 254 | + | ||
| 255 | + | // Retrieves the accessible role of an accessible object. | |
| 221 | 256 | func (x *Avatar) GetAccessibleRole() gtk.AccessibleRole { | |
| 222 | 257 | ||
| 223 | 258 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 224 | 259 | return cret | |
| 225 | 260 | } | |
| 226 | 261 | ||
| 227 | - | // Resets the accessible @property to its default value. | |
| 262 | + | // Retrieves the implementation for the given accessible object. | |
| 263 | + | func (x *Avatar) GetAtContext() *gtk.ATContext { | |
| 264 | + | var cls *gtk.ATContext | |
| 265 | + | ||
| 266 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 267 | + | ||
| 268 | + | if cret == 0 { | |
| 269 | + | return nil | |
| 270 | + | } | |
| 271 | + | cls = >k.ATContext{} | |
| 272 | + | cls.Ptr = cret | |
| 273 | + | return cls | |
| 274 | + | } | |
| 275 | + | ||
| 276 | + | // Queries the coordinates and dimensions of this accessible | |
| 277 | + | // | |
| 278 | + | // This functionality can be overridden by `GtkAccessible` | |
| 279 | + | // implementations, e.g. to get the bounds from an ignored | |
| 280 | + | // child widget. | |
| 281 | + | func (x *Avatar) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 282 | + | ||
| 283 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 284 | + | return cret | |
| 285 | + | } | |
| 286 | + | ||
| 287 | + | // Retrieves the first accessible child of an accessible object. | |
| 288 | + | func (x *Avatar) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 289 | + | var cls *gtk.AccessibleBase | |
| 290 | + | ||
| 291 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 292 | + | ||
| 293 | + | if cret == 0 { | |
| 294 | + | return nil | |
| 295 | + | } | |
| 296 | + | cls = >k.AccessibleBase{} | |
| 297 | + | cls.Ptr = cret | |
| 298 | + | return cls | |
| 299 | + | } | |
| 300 | + | ||
| 301 | + | // Retrieves the next accessible sibling of an accessible object | |
| 302 | + | func (x *Avatar) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 303 | + | var cls *gtk.AccessibleBase | |
| 304 | + | ||
| 305 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 306 | + | ||
| 307 | + | if cret == 0 { | |
| 308 | + | return nil | |
| 309 | + | } | |
| 310 | + | cls = >k.AccessibleBase{} | |
| 311 | + | cls.Ptr = cret | |
| 312 | + | return cls | |
| 313 | + | } | |
| 314 | + | ||
| 315 | + | // Queries a platform state, such as focus. | |
| 316 | + | // | |
| 317 | + | // This functionality can be overridden by `GtkAccessible` | |
| 318 | + | // implementations, e.g. to get platform state from an ignored | |
| 319 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 320 | + | func (x *Avatar) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 321 | + | ||
| 322 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 323 | + | return cret | |
| 324 | + | } | |
| 325 | + | ||
| 326 | + | // Resets the accessible property to its default value. | |
| 228 | 327 | func (x *Avatar) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 229 | 328 | ||
| 230 | 329 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 231 | 330 | ||
| 232 | 331 | } | |
| 233 | 332 | ||
| 234 | - | // Resets the accessible @relation to its default value. | |
| 333 | + | // Resets the accessible relation to its default value. | |
| 235 | 334 | func (x *Avatar) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 236 | 335 | ||
| 237 | 336 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 238 | 337 | ||
| 239 | 338 | } | |
| 240 | 339 | ||
| 241 | - | // Resets the accessible @state to its default value. | |
| 340 | + | // Resets the accessible state to its default value. | |
| 242 | 341 | func (x *Avatar) ResetState(StateVar gtk.AccessibleState) { | |
| 243 | 342 | ||
| 244 | 343 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 245 | 344 | ||
| 246 | 345 | } | |
| 247 | 346 | ||
| 347 | + | // Sets the parent and sibling of an accessible object. | |
| 348 | + | // | |
| 349 | + | // This function is meant to be used by accessible implementations that are | |
| 350 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 351 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 352 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 353 | + | // interface, you will use this function to ensure that the parent of each | |
| 354 | + | // child widget is the metadata object, and the parent of each metadata | |
| 355 | + | // object is the container widget. | |
| 356 | + | func (x *Avatar) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 357 | + | ||
| 358 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 359 | + | ||
| 360 | + | } | |
| 361 | + | ||
| 362 | + | // Updates the next accessible sibling. | |
| 363 | + | // | |
| 364 | + | // That might be useful when a new child of a custom accessible | |
| 365 | + | // is created, and it needs to be linked to a previous child. | |
| 366 | + | func (x *Avatar) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 367 | + | ||
| 368 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 369 | + | ||
| 370 | + | } | |
| 371 | + | ||
| 372 | + | // Informs ATs that the platform state has changed. | |
| 373 | + | // | |
| 374 | + | // This function should be used by `GtkAccessible` implementations that | |
| 375 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 376 | + | // states automatically. | |
| 377 | + | func (x *Avatar) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 378 | + | ||
| 379 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 380 | + | ||
| 381 | + | } | |
| 382 | + | ||
| 248 | 383 | // Updates a list of accessible properties. | |
| 249 | 384 | // | |
| 250 | 385 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -287,7 +422,7 @@ func (x *Avatar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Acc | |||
| 287 | 422 | // relation change must be communicated to assistive technologies. | |
| 288 | 423 | // | |
| 289 | 424 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 290 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 425 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 291 | 426 | // | |
| 292 | 427 | // ```c | |
| 293 | 428 | // gtk_accessible_update_relation (accessible, | |
| @@ -317,13 +452,17 @@ func (x *Avatar) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acces | |||
| 317 | 452 | ||
| 318 | 453 | } | |
| 319 | 454 | ||
| 320 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 321 | - | // documentation for the value types of accessible states. | |
| 455 | + | // Updates a list of accessible states. | |
| 322 | 456 | // | |
| 323 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 324 | - | // state change must be communicated to assistive technologies. | |
| 457 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 458 | + | // value types of accessible states. | |
| 459 | + | // | |
| 460 | + | // This function should be called by `GtkWidget` types whenever | |
| 461 | + | // an accessible state change must be communicated to assistive | |
| 462 | + | // technologies. | |
| 325 | 463 | // | |
| 326 | 464 | // Example: | |
| 465 | + | // | |
| 327 | 466 | // ```c | |
| 328 | 467 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 329 | 468 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -353,7 +492,7 @@ func (x *Avatar) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleStat | |||
| 353 | 492 | // Gets the ID of the @buildable object. | |
| 354 | 493 | // | |
| 355 | 494 | // `GtkBuilder` sets the name based on the ID attribute | |
| 356 | - | // of the <object> tag used to construct the @buildable. | |
| 495 | + | // of the `<object>` tag used to construct the @buildable. | |
| 357 | 496 | func (x *Avatar) GetBuildableId() string { | |
| 358 | 497 | ||
| 359 | 498 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-banner.go +207 -11
| @@ -23,6 +23,27 @@ func (x *BannerClass) GoPointer() uintptr { | |||
| 23 | 23 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 24 | } | |
| 25 | 25 | ||
| 26 | + | // Describes the available button styles for [class@Banner]. | |
| 27 | + | // | |
| 28 | + | // New values may be added to this enumeration over time. | |
| 29 | + | // | |
| 30 | + | // See [property@Banner:button-style]. | |
| 31 | + | type BannerButtonStyle int | |
| 32 | + | ||
| 33 | + | var xBannerButtonStyleGLibType func() types.GType | |
| 34 | + | ||
| 35 | + | func BannerButtonStyleGLibType() types.GType { | |
| 36 | + | return xBannerButtonStyleGLibType() | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | const ( | |
| 40 | + | ||
| 41 | + | // The default button style. | |
| 42 | + | BannerButtonDefaultValue BannerButtonStyle = 0 | |
| 43 | + | // A button in the suggested action style. | |
| 44 | + | BannerButtonSuggestedValue BannerButtonStyle = 1 | |
| 45 | + | ) | |
| 46 | + | ||
| 26 | 47 | // A bar with contextual information. | |
| 27 | 48 | // | |
| 28 | 49 | // <picture> | |
| @@ -42,7 +63,15 @@ func (x *BannerClass) GoPointer() uintptr { | |||
| 42 | 63 | // | |
| 43 | 64 | // Banners can optionally have a button with text on it, set through | |
| 44 | 65 | // [property@Banner:button-label]. The button can be used with a `GAction`, | |
| 45 | - | // or with the [signal@Banner::button-clicked] signal. | |
| 66 | + | // or with the [signal@Banner::button-clicked] signal. The button can have | |
| 67 | + | // different styles, a gray style and a suggested style. | |
| 68 | + | // | |
| 69 | + | // <picture> | |
| 70 | + | // | |
| 71 | + | // <source srcset="banner-suggested-dark.png" media="(prefers-color-scheme: dark)"> | |
| 72 | + | // <img src="banner-suggested.png" alt="banner with suggested button style"> | |
| 73 | + | // | |
| 74 | + | // </picture> | |
| 46 | 75 | // | |
| 47 | 76 | // ## CSS nodes | |
| 48 | 77 | // | |
| @@ -89,6 +118,15 @@ func (x *Banner) GetButtonLabel() string { | |||
| 89 | 118 | return cret | |
| 90 | 119 | } | |
| 91 | 120 | ||
| 121 | + | var xBannerGetButtonStyle func(uintptr) BannerButtonStyle | |
| 122 | + | ||
| 123 | + | // Gets the style class in use for the banner button. | |
| 124 | + | func (x *Banner) GetButtonStyle() BannerButtonStyle { | |
| 125 | + | ||
| 126 | + | cret := xBannerGetButtonStyle(x.GoPointer()) | |
| 127 | + | return cret | |
| 128 | + | } | |
| 129 | + | ||
| 92 | 130 | var xBannerGetRevealed func(uintptr) bool | |
| 93 | 131 | ||
| 94 | 132 | // Gets if a banner is revealed | |
| @@ -130,6 +168,25 @@ func (x *Banner) SetButtonLabel(LabelVar string) { | |||
| 130 | 168 | ||
| 131 | 169 | } | |
| 132 | 170 | ||
| 171 | + | var xBannerSetButtonStyle func(uintptr, BannerButtonStyle) | |
| 172 | + | ||
| 173 | + | // Sets the style class to use for the banner button. | |
| 174 | + | // | |
| 175 | + | // When set to `ADW_BANNER_BUTTON_DEFAULT`, the button stays grey. | |
| 176 | + | // When set to `ADW_BANNER_BUTTON_SUGGESTED`, the button follows the [`.suggested-action`](style-classes.html#suggested-action) style | |
| 177 | + | // | |
| 178 | + | // <picture> | |
| 179 | + | // | |
| 180 | + | // <source srcset="banner-suggested-dark.png" media="(prefers-color-scheme: dark)"> | |
| 181 | + | // <img src="banner-suggested.png" alt="banner with suggested button style"> | |
| 182 | + | // | |
| 183 | + | // </picture> | |
| 184 | + | func (x *Banner) SetButtonStyle(StyleVar BannerButtonStyle) { | |
| 185 | + | ||
| 186 | + | xBannerSetButtonStyle(x.GoPointer(), StyleVar) | |
| 187 | + | ||
| 188 | + | } | |
| 189 | + | ||
| 133 | 190 | var xBannerSetRevealed func(uintptr, bool) | |
| 134 | 191 | ||
| 135 | 192 | // Sets whether a banner should be revealed | |
| @@ -194,34 +251,165 @@ func (x *Banner) ConnectButtonClicked(cb *func(Banner)) uint32 { | |||
| 194 | 251 | return gobject.SignalConnect(x.GoPointer(), "button-clicked", cbRefPtr) | |
| 195 | 252 | } | |
| 196 | 253 | ||
| 197 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 254 | + | // Requests the user's screen reader to announce the given message. | |
| 255 | + | // | |
| 256 | + | // This kind of notification is useful for messages that | |
| 257 | + | // either have only a visual representation or that are not | |
| 258 | + | // exposed visually at all, e.g. a notification about a | |
| 259 | + | // successful operation. | |
| 260 | + | // | |
| 261 | + | // Also, by using this API, you can ensure that the message | |
| 262 | + | // does not interrupts the user's current screen reader output. | |
| 263 | + | func (x *Banner) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 264 | + | ||
| 265 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 266 | + | ||
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // Retrieves the accessible parent for an accessible object. | |
| 270 | + | // | |
| 271 | + | // This function returns `NULL` for top level widgets. | |
| 272 | + | func (x *Banner) GetAccessibleParent() *gtk.AccessibleBase { | |
| 273 | + | var cls *gtk.AccessibleBase | |
| 274 | + | ||
| 275 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 276 | + | ||
| 277 | + | if cret == 0 { | |
| 278 | + | return nil | |
| 279 | + | } | |
| 280 | + | cls = >k.AccessibleBase{} | |
| 281 | + | cls.Ptr = cret | |
| 282 | + | return cls | |
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // Retrieves the accessible role of an accessible object. | |
| 198 | 286 | func (x *Banner) GetAccessibleRole() gtk.AccessibleRole { | |
| 199 | 287 | ||
| 200 | 288 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 201 | 289 | return cret | |
| 202 | 290 | } | |
| 203 | 291 | ||
| 204 | - | // Resets the accessible @property to its default value. | |
| 292 | + | // Retrieves the implementation for the given accessible object. | |
| 293 | + | func (x *Banner) GetAtContext() *gtk.ATContext { | |
| 294 | + | var cls *gtk.ATContext | |
| 295 | + | ||
| 296 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 297 | + | ||
| 298 | + | if cret == 0 { | |
| 299 | + | return nil | |
| 300 | + | } | |
| 301 | + | cls = >k.ATContext{} | |
| 302 | + | cls.Ptr = cret | |
| 303 | + | return cls | |
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // Queries the coordinates and dimensions of this accessible | |
| 307 | + | // | |
| 308 | + | // This functionality can be overridden by `GtkAccessible` | |
| 309 | + | // implementations, e.g. to get the bounds from an ignored | |
| 310 | + | // child widget. | |
| 311 | + | func (x *Banner) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 312 | + | ||
| 313 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 314 | + | return cret | |
| 315 | + | } | |
| 316 | + | ||
| 317 | + | // Retrieves the first accessible child of an accessible object. | |
| 318 | + | func (x *Banner) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 319 | + | var cls *gtk.AccessibleBase | |
| 320 | + | ||
| 321 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 322 | + | ||
| 323 | + | if cret == 0 { | |
| 324 | + | return nil | |
| 325 | + | } | |
| 326 | + | cls = >k.AccessibleBase{} | |
| 327 | + | cls.Ptr = cret | |
| 328 | + | return cls | |
| 329 | + | } | |
| 330 | + | ||
| 331 | + | // Retrieves the next accessible sibling of an accessible object | |
| 332 | + | func (x *Banner) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 333 | + | var cls *gtk.AccessibleBase | |
| 334 | + | ||
| 335 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 336 | + | ||
| 337 | + | if cret == 0 { | |
| 338 | + | return nil | |
| 339 | + | } | |
| 340 | + | cls = >k.AccessibleBase{} | |
| 341 | + | cls.Ptr = cret | |
| 342 | + | return cls | |
| 343 | + | } | |
| 344 | + | ||
| 345 | + | // Queries a platform state, such as focus. | |
| 346 | + | // | |
| 347 | + | // This functionality can be overridden by `GtkAccessible` | |
| 348 | + | // implementations, e.g. to get platform state from an ignored | |
| 349 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 350 | + | func (x *Banner) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 351 | + | ||
| 352 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 353 | + | return cret | |
| 354 | + | } | |
| 355 | + | ||
| 356 | + | // Resets the accessible property to its default value. | |
| 205 | 357 | func (x *Banner) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 206 | 358 | ||
| 207 | 359 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 208 | 360 | ||
| 209 | 361 | } | |
| 210 | 362 | ||
| 211 | - | // Resets the accessible @relation to its default value. | |
| 363 | + | // Resets the accessible relation to its default value. | |
| 212 | 364 | func (x *Banner) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 213 | 365 | ||
| 214 | 366 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 215 | 367 | ||
| 216 | 368 | } | |
| 217 | 369 | ||
| 218 | - | // Resets the accessible @state to its default value. | |
| 370 | + | // Resets the accessible state to its default value. | |
| 219 | 371 | func (x *Banner) ResetState(StateVar gtk.AccessibleState) { | |
| 220 | 372 | ||
| 221 | 373 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 222 | 374 | ||
| 223 | 375 | } | |
| 224 | 376 | ||
| 377 | + | // Sets the parent and sibling of an accessible object. | |
| 378 | + | // | |
| 379 | + | // This function is meant to be used by accessible implementations that are | |
| 380 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 381 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 382 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 383 | + | // interface, you will use this function to ensure that the parent of each | |
| 384 | + | // child widget is the metadata object, and the parent of each metadata | |
| 385 | + | // object is the container widget. | |
| 386 | + | func (x *Banner) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 387 | + | ||
| 388 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 389 | + | ||
| 390 | + | } | |
| 391 | + | ||
| 392 | + | // Updates the next accessible sibling. | |
| 393 | + | // | |
| 394 | + | // That might be useful when a new child of a custom accessible | |
| 395 | + | // is created, and it needs to be linked to a previous child. | |
| 396 | + | func (x *Banner) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 397 | + | ||
| 398 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 399 | + | ||
| 400 | + | } | |
| 401 | + | ||
| 402 | + | // Informs ATs that the platform state has changed. | |
| 403 | + | // | |
| 404 | + | // This function should be used by `GtkAccessible` implementations that | |
| 405 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 406 | + | // states automatically. | |
| 407 | + | func (x *Banner) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 408 | + | ||
| 409 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 410 | + | ||
| 411 | + | } | |
| 412 | + | ||
| 225 | 413 | // Updates a list of accessible properties. | |
| 226 | 414 | // | |
| 227 | 415 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -264,7 +452,7 @@ func (x *Banner) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Acc | |||
| 264 | 452 | // relation change must be communicated to assistive technologies. | |
| 265 | 453 | // | |
| 266 | 454 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 267 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 455 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 268 | 456 | // | |
| 269 | 457 | // ```c | |
| 270 | 458 | // gtk_accessible_update_relation (accessible, | |
| @@ -294,13 +482,17 @@ func (x *Banner) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acces | |||
| 294 | 482 | ||
| 295 | 483 | } | |
| 296 | 484 | ||
| 297 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 298 | - | // documentation for the value types of accessible states. | |
| 485 | + | // Updates a list of accessible states. | |
| 299 | 486 | // | |
| 300 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 301 | - | // state change must be communicated to assistive technologies. | |
| 487 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 488 | + | // value types of accessible states. | |
| 489 | + | // | |
| 490 | + | // This function should be called by `GtkWidget` types whenever | |
| 491 | + | // an accessible state change must be communicated to assistive | |
| 492 | + | // technologies. | |
| 302 | 493 | // | |
| 303 | 494 | // Example: | |
| 495 | + | // | |
| 304 | 496 | // ```c | |
| 305 | 497 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 306 | 498 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -413,7 +605,7 @@ func (x *Banner) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 413 | 605 | // Gets the ID of the @buildable object. | |
| 414 | 606 | // | |
| 415 | 607 | // `GtkBuilder` sets the name based on the ID attribute | |
| 416 | - | // of the <object> tag used to construct the @buildable. | |
| 608 | + | // of the `<object>` tag used to construct the @buildable. | |
| 417 | 609 | func (x *Banner) GetBuildableId() string { | |
| 418 | 610 | ||
| 419 | 611 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -428,15 +620,19 @@ func init() { | |||
| 428 | 620 | panic(err) | |
| 429 | 621 | } | |
| 430 | 622 | ||
| 623 | + | core.PuregoSafeRegister(&xBannerButtonStyleGLibType, lib, "adw_banner_button_style_get_type") | |
| 624 | + | ||
| 431 | 625 | core.PuregoSafeRegister(&xBannerGLibType, lib, "adw_banner_get_type") | |
| 432 | 626 | ||
| 433 | 627 | core.PuregoSafeRegister(&xNewBanner, lib, "adw_banner_new") | |
| 434 | 628 | ||
| 435 | 629 | core.PuregoSafeRegister(&xBannerGetButtonLabel, lib, "adw_banner_get_button_label") | |
| 630 | + | core.PuregoSafeRegister(&xBannerGetButtonStyle, lib, "adw_banner_get_button_style") | |
| 436 | 631 | core.PuregoSafeRegister(&xBannerGetRevealed, lib, "adw_banner_get_revealed") | |
| 437 | 632 | core.PuregoSafeRegister(&xBannerGetTitle, lib, "adw_banner_get_title") | |
| 438 | 633 | core.PuregoSafeRegister(&xBannerGetUseMarkup, lib, "adw_banner_get_use_markup") | |
| 439 | 634 | core.PuregoSafeRegister(&xBannerSetButtonLabel, lib, "adw_banner_set_button_label") | |
| 635 | + | core.PuregoSafeRegister(&xBannerSetButtonStyle, lib, "adw_banner_set_button_style") | |
| 440 | 636 | core.PuregoSafeRegister(&xBannerSetRevealed, lib, "adw_banner_set_revealed") | |
| 441 | 637 | core.PuregoSafeRegister(&xBannerSetTitle, lib, "adw_banner_set_title") | |
| 442 | 638 | core.PuregoSafeRegister(&xBannerSetUseMarkup, lib, "adw_banner_set_use_markup") | |
M v4/adw/adw-bin.go +145 -10
| @@ -106,34 +106,165 @@ func (c *Bin) SetGoPointer(ptr uintptr) { | |||
| 106 | 106 | c.Ptr = ptr | |
| 107 | 107 | } | |
| 108 | 108 | ||
| 109 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 109 | + | // Requests the user's screen reader to announce the given message. | |
| 110 | + | // | |
| 111 | + | // This kind of notification is useful for messages that | |
| 112 | + | // either have only a visual representation or that are not | |
| 113 | + | // exposed visually at all, e.g. a notification about a | |
| 114 | + | // successful operation. | |
| 115 | + | // | |
| 116 | + | // Also, by using this API, you can ensure that the message | |
| 117 | + | // does not interrupts the user's current screen reader output. | |
| 118 | + | func (x *Bin) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 119 | + | ||
| 120 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 121 | + | ||
| 122 | + | } | |
| 123 | + | ||
| 124 | + | // Retrieves the accessible parent for an accessible object. | |
| 125 | + | // | |
| 126 | + | // This function returns `NULL` for top level widgets. | |
| 127 | + | func (x *Bin) GetAccessibleParent() *gtk.AccessibleBase { | |
| 128 | + | var cls *gtk.AccessibleBase | |
| 129 | + | ||
| 130 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 131 | + | ||
| 132 | + | if cret == 0 { | |
| 133 | + | return nil | |
| 134 | + | } | |
| 135 | + | cls = >k.AccessibleBase{} | |
| 136 | + | cls.Ptr = cret | |
| 137 | + | return cls | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // Retrieves the accessible role of an accessible object. | |
| 110 | 141 | func (x *Bin) GetAccessibleRole() gtk.AccessibleRole { | |
| 111 | 142 | ||
| 112 | 143 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 113 | 144 | return cret | |
| 114 | 145 | } | |
| 115 | 146 | ||
| 116 | - | // Resets the accessible @property to its default value. | |
| 147 | + | // Retrieves the implementation for the given accessible object. | |
| 148 | + | func (x *Bin) GetAtContext() *gtk.ATContext { | |
| 149 | + | var cls *gtk.ATContext | |
| 150 | + | ||
| 151 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 152 | + | ||
| 153 | + | if cret == 0 { | |
| 154 | + | return nil | |
| 155 | + | } | |
| 156 | + | cls = >k.ATContext{} | |
| 157 | + | cls.Ptr = cret | |
| 158 | + | return cls | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | // Queries the coordinates and dimensions of this accessible | |
| 162 | + | // | |
| 163 | + | // This functionality can be overridden by `GtkAccessible` | |
| 164 | + | // implementations, e.g. to get the bounds from an ignored | |
| 165 | + | // child widget. | |
| 166 | + | func (x *Bin) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 167 | + | ||
| 168 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 169 | + | return cret | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | // Retrieves the first accessible child of an accessible object. | |
| 173 | + | func (x *Bin) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 174 | + | var cls *gtk.AccessibleBase | |
| 175 | + | ||
| 176 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 177 | + | ||
| 178 | + | if cret == 0 { | |
| 179 | + | return nil | |
| 180 | + | } | |
| 181 | + | cls = >k.AccessibleBase{} | |
| 182 | + | cls.Ptr = cret | |
| 183 | + | return cls | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // Retrieves the next accessible sibling of an accessible object | |
| 187 | + | func (x *Bin) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 188 | + | var cls *gtk.AccessibleBase | |
| 189 | + | ||
| 190 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 191 | + | ||
| 192 | + | if cret == 0 { | |
| 193 | + | return nil | |
| 194 | + | } | |
| 195 | + | cls = >k.AccessibleBase{} | |
| 196 | + | cls.Ptr = cret | |
| 197 | + | return cls | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | // Queries a platform state, such as focus. | |
| 201 | + | // | |
| 202 | + | // This functionality can be overridden by `GtkAccessible` | |
| 203 | + | // implementations, e.g. to get platform state from an ignored | |
| 204 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 205 | + | func (x *Bin) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 206 | + | ||
| 207 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 208 | + | return cret | |
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // Resets the accessible property to its default value. | |
| 117 | 212 | func (x *Bin) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 118 | 213 | ||
| 119 | 214 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 120 | 215 | ||
| 121 | 216 | } | |
| 122 | 217 | ||
| 123 | - | // Resets the accessible @relation to its default value. | |
| 218 | + | // Resets the accessible relation to its default value. | |
| 124 | 219 | func (x *Bin) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 125 | 220 | ||
| 126 | 221 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 127 | 222 | ||
| 128 | 223 | } | |
| 129 | 224 | ||
| 130 | - | // Resets the accessible @state to its default value. | |
| 225 | + | // Resets the accessible state to its default value. | |
| 131 | 226 | func (x *Bin) ResetState(StateVar gtk.AccessibleState) { | |
| 132 | 227 | ||
| 133 | 228 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 134 | 229 | ||
| 135 | 230 | } | |
| 136 | 231 | ||
| 232 | + | // Sets the parent and sibling of an accessible object. | |
| 233 | + | // | |
| 234 | + | // This function is meant to be used by accessible implementations that are | |
| 235 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 236 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 237 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 238 | + | // interface, you will use this function to ensure that the parent of each | |
| 239 | + | // child widget is the metadata object, and the parent of each metadata | |
| 240 | + | // object is the container widget. | |
| 241 | + | func (x *Bin) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 242 | + | ||
| 243 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 244 | + | ||
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // Updates the next accessible sibling. | |
| 248 | + | // | |
| 249 | + | // That might be useful when a new child of a custom accessible | |
| 250 | + | // is created, and it needs to be linked to a previous child. | |
| 251 | + | func (x *Bin) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 252 | + | ||
| 253 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // Informs ATs that the platform state has changed. | |
| 258 | + | // | |
| 259 | + | // This function should be used by `GtkAccessible` implementations that | |
| 260 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 261 | + | // states automatically. | |
| 262 | + | func (x *Bin) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 263 | + | ||
| 264 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 265 | + | ||
| 266 | + | } | |
| 267 | + | ||
| 137 | 268 | // Updates a list of accessible properties. | |
| 138 | 269 | // | |
| 139 | 270 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -176,7 +307,7 @@ func (x *Bin) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Access | |||
| 176 | 307 | // relation change must be communicated to assistive technologies. | |
| 177 | 308 | // | |
| 178 | 309 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 179 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 310 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 180 | 311 | // | |
| 181 | 312 | // ```c | |
| 182 | 313 | // gtk_accessible_update_relation (accessible, | |
| @@ -206,13 +337,17 @@ func (x *Bin) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Accessib | |||
| 206 | 337 | ||
| 207 | 338 | } | |
| 208 | 339 | ||
| 209 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 210 | - | // documentation for the value types of accessible states. | |
| 340 | + | // Updates a list of accessible states. | |
| 211 | 341 | // | |
| 212 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 213 | - | // state change must be communicated to assistive technologies. | |
| 342 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 343 | + | // value types of accessible states. | |
| 344 | + | // | |
| 345 | + | // This function should be called by `GtkWidget` types whenever | |
| 346 | + | // an accessible state change must be communicated to assistive | |
| 347 | + | // technologies. | |
| 214 | 348 | // | |
| 215 | 349 | // Example: | |
| 350 | + | // | |
| 216 | 351 | // ```c | |
| 217 | 352 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 218 | 353 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -242,7 +377,7 @@ func (x *Bin) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, | |||
| 242 | 377 | // Gets the ID of the @buildable object. | |
| 243 | 378 | // | |
| 244 | 379 | // `GtkBuilder` sets the name based on the ID attribute | |
| 245 | - | // of the <object> tag used to construct the @buildable. | |
| 380 | + | // of the `<object>` tag used to construct the @buildable. | |
| 246 | 381 | func (x *Bin) GetBuildableId() string { | |
| 247 | 382 | ||
| 248 | 383 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-bottom-sheet.go +176 -10
| @@ -43,6 +43,9 @@ func (x *BottomSheetClass) GoPointer() uintptr { | |||
| 43 | 43 | // [property@BottomSheet:align] determines where along the bottom edge they are | |
| 44 | 44 | // placed. | |
| 45 | 45 | // | |
| 46 | + | // Bottom bar can be hidden using the [property@BottomSheet:reveal-bottom-bar] | |
| 47 | + | // property. | |
| 48 | + | // | |
| 46 | 49 | // `AdwBottomSheet` can be useful for applications such as music players, that | |
| 47 | 50 | // want to have a persistent bottom bar that expands into a bottom sheet when | |
| 48 | 51 | // clicked. It's meant for cases where a bottom sheet is tightly integrated into | |
| @@ -228,6 +231,15 @@ func (x *BottomSheet) GetOpen() bool { | |||
| 228 | 231 | return cret | |
| 229 | 232 | } | |
| 230 | 233 | ||
| 234 | + | var xBottomSheetGetRevealBottomBar func(uintptr) bool | |
| 235 | + | ||
| 236 | + | // Gets whether the bottom bar is revealed. | |
| 237 | + | func (x *BottomSheet) GetRevealBottomBar() bool { | |
| 238 | + | ||
| 239 | + | cret := xBottomSheetGetRevealBottomBar(x.GoPointer()) | |
| 240 | + | return cret | |
| 241 | + | } | |
| 242 | + | ||
| 231 | 243 | var xBottomSheetGetSheet func(uintptr) uintptr | |
| 232 | 244 | ||
| 233 | 245 | // Gets the bottom sheet widget for @self. | |
| @@ -285,6 +297,9 @@ var xBottomSheetSetBottomBar func(uintptr, uintptr) | |||
| 285 | 297 | // | |
| 286 | 298 | // Shown when [property@BottomSheet:open] is `FALSE`. When open, morphs into | |
| 287 | 299 | // the [property@BottomSheet:sheet]. | |
| 300 | + | // | |
| 301 | + | // Bottom bar can be temporarily hidden using the | |
| 302 | + | // [property@BottomSheet:reveal-bottom-bar] property. | |
| 288 | 303 | func (x *BottomSheet) SetBottomBar(BottomBarVar *gtk.Widget) { | |
| 289 | 304 | ||
| 290 | 305 | xBottomSheetSetBottomBar(x.GoPointer(), BottomBarVar.GoPointer()) | |
| @@ -366,6 +381,20 @@ func (x *BottomSheet) SetOpen(OpenVar bool) { | |||
| 366 | 381 | ||
| 367 | 382 | } | |
| 368 | 383 | ||
| 384 | + | var xBottomSheetSetRevealBottomBar func(uintptr, bool) | |
| 385 | + | ||
| 386 | + | // Sets whether to reveal the bottom bar. | |
| 387 | + | // | |
| 388 | + | // The transition will be animated. | |
| 389 | + | // | |
| 390 | + | // See [property@BottomSheet:bottom-bar] and | |
| 391 | + | // [property@BottomSheet:bottom-bar-height]. | |
| 392 | + | func (x *BottomSheet) SetRevealBottomBar(RevealVar bool) { | |
| 393 | + | ||
| 394 | + | xBottomSheetSetRevealBottomBar(x.GoPointer(), RevealVar) | |
| 395 | + | ||
| 396 | + | } | |
| 397 | + | ||
| 369 | 398 | var xBottomSheetSetSheet func(uintptr, uintptr) | |
| 370 | 399 | ||
| 371 | 400 | // Sets the bottom sheet widget for @self. | |
| @@ -474,34 +503,165 @@ func (x *BottomSheet) GetSwipeArea(NavigationDirectionVar NavigationDirection, I | |||
| 474 | 503 | ||
| 475 | 504 | } | |
| 476 | 505 | ||
| 477 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 506 | + | // Requests the user's screen reader to announce the given message. | |
| 507 | + | // | |
| 508 | + | // This kind of notification is useful for messages that | |
| 509 | + | // either have only a visual representation or that are not | |
| 510 | + | // exposed visually at all, e.g. a notification about a | |
| 511 | + | // successful operation. | |
| 512 | + | // | |
| 513 | + | // Also, by using this API, you can ensure that the message | |
| 514 | + | // does not interrupts the user's current screen reader output. | |
| 515 | + | func (x *BottomSheet) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 516 | + | ||
| 517 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 518 | + | ||
| 519 | + | } | |
| 520 | + | ||
| 521 | + | // Retrieves the accessible parent for an accessible object. | |
| 522 | + | // | |
| 523 | + | // This function returns `NULL` for top level widgets. | |
| 524 | + | func (x *BottomSheet) GetAccessibleParent() *gtk.AccessibleBase { | |
| 525 | + | var cls *gtk.AccessibleBase | |
| 526 | + | ||
| 527 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 528 | + | ||
| 529 | + | if cret == 0 { | |
| 530 | + | return nil | |
| 531 | + | } | |
| 532 | + | cls = >k.AccessibleBase{} | |
| 533 | + | cls.Ptr = cret | |
| 534 | + | return cls | |
| 535 | + | } | |
| 536 | + | ||
| 537 | + | // Retrieves the accessible role of an accessible object. | |
| 478 | 538 | func (x *BottomSheet) GetAccessibleRole() gtk.AccessibleRole { | |
| 479 | 539 | ||
| 480 | 540 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 481 | 541 | return cret | |
| 482 | 542 | } | |
| 483 | 543 | ||
| 484 | - | // Resets the accessible @property to its default value. | |
| 544 | + | // Retrieves the implementation for the given accessible object. | |
| 545 | + | func (x *BottomSheet) GetAtContext() *gtk.ATContext { | |
| 546 | + | var cls *gtk.ATContext | |
| 547 | + | ||
| 548 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 549 | + | ||
| 550 | + | if cret == 0 { | |
| 551 | + | return nil | |
| 552 | + | } | |
| 553 | + | cls = >k.ATContext{} | |
| 554 | + | cls.Ptr = cret | |
| 555 | + | return cls | |
| 556 | + | } | |
| 557 | + | ||
| 558 | + | // Queries the coordinates and dimensions of this accessible | |
| 559 | + | // | |
| 560 | + | // This functionality can be overridden by `GtkAccessible` | |
| 561 | + | // implementations, e.g. to get the bounds from an ignored | |
| 562 | + | // child widget. | |
| 563 | + | func (x *BottomSheet) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 564 | + | ||
| 565 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 566 | + | return cret | |
| 567 | + | } | |
| 568 | + | ||
| 569 | + | // Retrieves the first accessible child of an accessible object. | |
| 570 | + | func (x *BottomSheet) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 571 | + | var cls *gtk.AccessibleBase | |
| 572 | + | ||
| 573 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 574 | + | ||
| 575 | + | if cret == 0 { | |
| 576 | + | return nil | |
| 577 | + | } | |
| 578 | + | cls = >k.AccessibleBase{} | |
| 579 | + | cls.Ptr = cret | |
| 580 | + | return cls | |
| 581 | + | } | |
| 582 | + | ||
| 583 | + | // Retrieves the next accessible sibling of an accessible object | |
| 584 | + | func (x *BottomSheet) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 585 | + | var cls *gtk.AccessibleBase | |
| 586 | + | ||
| 587 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 588 | + | ||
| 589 | + | if cret == 0 { | |
| 590 | + | return nil | |
| 591 | + | } | |
| 592 | + | cls = >k.AccessibleBase{} | |
| 593 | + | cls.Ptr = cret | |
| 594 | + | return cls | |
| 595 | + | } | |
| 596 | + | ||
| 597 | + | // Queries a platform state, such as focus. | |
| 598 | + | // | |
| 599 | + | // This functionality can be overridden by `GtkAccessible` | |
| 600 | + | // implementations, e.g. to get platform state from an ignored | |
| 601 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 602 | + | func (x *BottomSheet) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 603 | + | ||
| 604 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 605 | + | return cret | |
| 606 | + | } | |
| 607 | + | ||
| 608 | + | // Resets the accessible property to its default value. | |
| 485 | 609 | func (x *BottomSheet) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 486 | 610 | ||
| 487 | 611 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 488 | 612 | ||
| 489 | 613 | } | |
| 490 | 614 | ||
| 491 | - | // Resets the accessible @relation to its default value. | |
| 615 | + | // Resets the accessible relation to its default value. | |
| 492 | 616 | func (x *BottomSheet) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 493 | 617 | ||
| 494 | 618 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 495 | 619 | ||
| 496 | 620 | } | |
| 497 | 621 | ||
| 498 | - | // Resets the accessible @state to its default value. | |
| 622 | + | // Resets the accessible state to its default value. | |
| 499 | 623 | func (x *BottomSheet) ResetState(StateVar gtk.AccessibleState) { | |
| 500 | 624 | ||
| 501 | 625 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 502 | 626 | ||
| 503 | 627 | } | |
| 504 | 628 | ||
| 629 | + | // Sets the parent and sibling of an accessible object. | |
| 630 | + | // | |
| 631 | + | // This function is meant to be used by accessible implementations that are | |
| 632 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 633 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 634 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 635 | + | // interface, you will use this function to ensure that the parent of each | |
| 636 | + | // child widget is the metadata object, and the parent of each metadata | |
| 637 | + | // object is the container widget. | |
| 638 | + | func (x *BottomSheet) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 639 | + | ||
| 640 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 641 | + | ||
| 642 | + | } | |
| 643 | + | ||
| 644 | + | // Updates the next accessible sibling. | |
| 645 | + | // | |
| 646 | + | // That might be useful when a new child of a custom accessible | |
| 647 | + | // is created, and it needs to be linked to a previous child. | |
| 648 | + | func (x *BottomSheet) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 649 | + | ||
| 650 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 651 | + | ||
| 652 | + | } | |
| 653 | + | ||
| 654 | + | // Informs ATs that the platform state has changed. | |
| 655 | + | // | |
| 656 | + | // This function should be used by `GtkAccessible` implementations that | |
| 657 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 658 | + | // states automatically. | |
| 659 | + | func (x *BottomSheet) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 660 | + | ||
| 661 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 662 | + | ||
| 663 | + | } | |
| 664 | + | ||
| 505 | 665 | // Updates a list of accessible properties. | |
| 506 | 666 | // | |
| 507 | 667 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -544,7 +704,7 @@ func (x *BottomSheet) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 544 | 704 | // relation change must be communicated to assistive technologies. | |
| 545 | 705 | // | |
| 546 | 706 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 547 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 707 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 548 | 708 | // | |
| 549 | 709 | // ```c | |
| 550 | 710 | // gtk_accessible_update_relation (accessible, | |
| @@ -574,13 +734,17 @@ func (x *BottomSheet) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 574 | 734 | ||
| 575 | 735 | } | |
| 576 | 736 | ||
| 577 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 578 | - | // documentation for the value types of accessible states. | |
| 737 | + | // Updates a list of accessible states. | |
| 579 | 738 | // | |
| 580 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 581 | - | // state change must be communicated to assistive technologies. | |
| 739 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 740 | + | // value types of accessible states. | |
| 741 | + | // | |
| 742 | + | // This function should be called by `GtkWidget` types whenever | |
| 743 | + | // an accessible state change must be communicated to assistive | |
| 744 | + | // technologies. | |
| 582 | 745 | // | |
| 583 | 746 | // Example: | |
| 747 | + | // | |
| 584 | 748 | // ```c | |
| 585 | 749 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 586 | 750 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -610,7 +774,7 @@ func (x *BottomSheet) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessibl | |||
| 610 | 774 | // Gets the ID of the @buildable object. | |
| 611 | 775 | // | |
| 612 | 776 | // `GtkBuilder` sets the name based on the ID attribute | |
| 613 | - | // of the <object> tag used to construct the @buildable. | |
| 777 | + | // of the `<object>` tag used to construct the @buildable. | |
| 614 | 778 | func (x *BottomSheet) GetBuildableId() string { | |
| 615 | 779 | ||
| 616 | 780 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -638,6 +802,7 @@ func init() { | |||
| 638 | 802 | core.PuregoSafeRegister(&xBottomSheetGetFullWidth, lib, "adw_bottom_sheet_get_full_width") | |
| 639 | 803 | core.PuregoSafeRegister(&xBottomSheetGetModal, lib, "adw_bottom_sheet_get_modal") | |
| 640 | 804 | core.PuregoSafeRegister(&xBottomSheetGetOpen, lib, "adw_bottom_sheet_get_open") | |
| 805 | + | core.PuregoSafeRegister(&xBottomSheetGetRevealBottomBar, lib, "adw_bottom_sheet_get_reveal_bottom_bar") | |
| 641 | 806 | core.PuregoSafeRegister(&xBottomSheetGetSheet, lib, "adw_bottom_sheet_get_sheet") | |
| 642 | 807 | core.PuregoSafeRegister(&xBottomSheetGetSheetHeight, lib, "adw_bottom_sheet_get_sheet_height") | |
| 643 | 808 | core.PuregoSafeRegister(&xBottomSheetGetShowDragHandle, lib, "adw_bottom_sheet_get_show_drag_handle") | |
| @@ -649,6 +814,7 @@ func init() { | |||
| 649 | 814 | core.PuregoSafeRegister(&xBottomSheetSetFullWidth, lib, "adw_bottom_sheet_set_full_width") | |
| 650 | 815 | core.PuregoSafeRegister(&xBottomSheetSetModal, lib, "adw_bottom_sheet_set_modal") | |
| 651 | 816 | core.PuregoSafeRegister(&xBottomSheetSetOpen, lib, "adw_bottom_sheet_set_open") | |
| 817 | + | core.PuregoSafeRegister(&xBottomSheetSetRevealBottomBar, lib, "adw_bottom_sheet_set_reveal_bottom_bar") | |
| 652 | 818 | core.PuregoSafeRegister(&xBottomSheetSetSheet, lib, "adw_bottom_sheet_set_sheet") | |
| 653 | 819 | core.PuregoSafeRegister(&xBottomSheetSetShowDragHandle, lib, "adw_bottom_sheet_set_show_drag_handle") | |
| 654 | 820 | ||
M v4/adw/adw-breakpoint-bin.go +145 -10
| @@ -246,34 +246,165 @@ func (c *BreakpointBin) SetGoPointer(ptr uintptr) { | |||
| 246 | 246 | c.Ptr = ptr | |
| 247 | 247 | } | |
| 248 | 248 | ||
| 249 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 249 | + | // Requests the user's screen reader to announce the given message. | |
| 250 | + | // | |
| 251 | + | // This kind of notification is useful for messages that | |
| 252 | + | // either have only a visual representation or that are not | |
| 253 | + | // exposed visually at all, e.g. a notification about a | |
| 254 | + | // successful operation. | |
| 255 | + | // | |
| 256 | + | // Also, by using this API, you can ensure that the message | |
| 257 | + | // does not interrupts the user's current screen reader output. | |
| 258 | + | func (x *BreakpointBin) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 259 | + | ||
| 260 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 261 | + | ||
| 262 | + | } | |
| 263 | + | ||
| 264 | + | // Retrieves the accessible parent for an accessible object. | |
| 265 | + | // | |
| 266 | + | // This function returns `NULL` for top level widgets. | |
| 267 | + | func (x *BreakpointBin) GetAccessibleParent() *gtk.AccessibleBase { | |
| 268 | + | var cls *gtk.AccessibleBase | |
| 269 | + | ||
| 270 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 271 | + | ||
| 272 | + | if cret == 0 { | |
| 273 | + | return nil | |
| 274 | + | } | |
| 275 | + | cls = >k.AccessibleBase{} | |
| 276 | + | cls.Ptr = cret | |
| 277 | + | return cls | |
| 278 | + | } | |
| 279 | + | ||
| 280 | + | // Retrieves the accessible role of an accessible object. | |
| 250 | 281 | func (x *BreakpointBin) GetAccessibleRole() gtk.AccessibleRole { | |
| 251 | 282 | ||
| 252 | 283 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 253 | 284 | return cret | |
| 254 | 285 | } | |
| 255 | 286 | ||
| 256 | - | // Resets the accessible @property to its default value. | |
| 287 | + | // Retrieves the implementation for the given accessible object. | |
| 288 | + | func (x *BreakpointBin) GetAtContext() *gtk.ATContext { | |
| 289 | + | var cls *gtk.ATContext | |
| 290 | + | ||
| 291 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 292 | + | ||
| 293 | + | if cret == 0 { | |
| 294 | + | return nil | |
| 295 | + | } | |
| 296 | + | cls = >k.ATContext{} | |
| 297 | + | cls.Ptr = cret | |
| 298 | + | return cls | |
| 299 | + | } | |
| 300 | + | ||
| 301 | + | // Queries the coordinates and dimensions of this accessible | |
| 302 | + | // | |
| 303 | + | // This functionality can be overridden by `GtkAccessible` | |
| 304 | + | // implementations, e.g. to get the bounds from an ignored | |
| 305 | + | // child widget. | |
| 306 | + | func (x *BreakpointBin) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 307 | + | ||
| 308 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 309 | + | return cret | |
| 310 | + | } | |
| 311 | + | ||
| 312 | + | // Retrieves the first accessible child of an accessible object. | |
| 313 | + | func (x *BreakpointBin) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 314 | + | var cls *gtk.AccessibleBase | |
| 315 | + | ||
| 316 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 317 | + | ||
| 318 | + | if cret == 0 { | |
| 319 | + | return nil | |
| 320 | + | } | |
| 321 | + | cls = >k.AccessibleBase{} | |
| 322 | + | cls.Ptr = cret | |
| 323 | + | return cls | |
| 324 | + | } | |
| 325 | + | ||
| 326 | + | // Retrieves the next accessible sibling of an accessible object | |
| 327 | + | func (x *BreakpointBin) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 328 | + | var cls *gtk.AccessibleBase | |
| 329 | + | ||
| 330 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 331 | + | ||
| 332 | + | if cret == 0 { | |
| 333 | + | return nil | |
| 334 | + | } | |
| 335 | + | cls = >k.AccessibleBase{} | |
| 336 | + | cls.Ptr = cret | |
| 337 | + | return cls | |
| 338 | + | } | |
| 339 | + | ||
| 340 | + | // Queries a platform state, such as focus. | |
| 341 | + | // | |
| 342 | + | // This functionality can be overridden by `GtkAccessible` | |
| 343 | + | // implementations, e.g. to get platform state from an ignored | |
| 344 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 345 | + | func (x *BreakpointBin) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 346 | + | ||
| 347 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 348 | + | return cret | |
| 349 | + | } | |
| 350 | + | ||
| 351 | + | // Resets the accessible property to its default value. | |
| 257 | 352 | func (x *BreakpointBin) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 258 | 353 | ||
| 259 | 354 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 260 | 355 | ||
| 261 | 356 | } | |
| 262 | 357 | ||
| 263 | - | // Resets the accessible @relation to its default value. | |
| 358 | + | // Resets the accessible relation to its default value. | |
| 264 | 359 | func (x *BreakpointBin) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 265 | 360 | ||
| 266 | 361 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 267 | 362 | ||
| 268 | 363 | } | |
| 269 | 364 | ||
| 270 | - | // Resets the accessible @state to its default value. | |
| 365 | + | // Resets the accessible state to its default value. | |
| 271 | 366 | func (x *BreakpointBin) ResetState(StateVar gtk.AccessibleState) { | |
| 272 | 367 | ||
| 273 | 368 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 274 | 369 | ||
| 275 | 370 | } | |
| 276 | 371 | ||
| 372 | + | // Sets the parent and sibling of an accessible object. | |
| 373 | + | // | |
| 374 | + | // This function is meant to be used by accessible implementations that are | |
| 375 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 376 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 377 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 378 | + | // interface, you will use this function to ensure that the parent of each | |
| 379 | + | // child widget is the metadata object, and the parent of each metadata | |
| 380 | + | // object is the container widget. | |
| 381 | + | func (x *BreakpointBin) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 382 | + | ||
| 383 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 384 | + | ||
| 385 | + | } | |
| 386 | + | ||
| 387 | + | // Updates the next accessible sibling. | |
| 388 | + | // | |
| 389 | + | // That might be useful when a new child of a custom accessible | |
| 390 | + | // is created, and it needs to be linked to a previous child. | |
| 391 | + | func (x *BreakpointBin) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 392 | + | ||
| 393 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 394 | + | ||
| 395 | + | } | |
| 396 | + | ||
| 397 | + | // Informs ATs that the platform state has changed. | |
| 398 | + | // | |
| 399 | + | // This function should be used by `GtkAccessible` implementations that | |
| 400 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 401 | + | // states automatically. | |
| 402 | + | func (x *BreakpointBin) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 403 | + | ||
| 404 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 405 | + | ||
| 406 | + | } | |
| 407 | + | ||
| 277 | 408 | // Updates a list of accessible properties. | |
| 278 | 409 | // | |
| 279 | 410 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -316,7 +447,7 @@ func (x *BreakpointBin) UpdatePropertyValue(NPropertiesVar int, PropertiesVar [] | |||
| 316 | 447 | // relation change must be communicated to assistive technologies. | |
| 317 | 448 | // | |
| 318 | 449 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 319 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 450 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 320 | 451 | // | |
| 321 | 452 | // ```c | |
| 322 | 453 | // gtk_accessible_update_relation (accessible, | |
| @@ -346,13 +477,17 @@ func (x *BreakpointBin) UpdateRelationValue(NRelationsVar int, RelationsVar []gt | |||
| 346 | 477 | ||
| 347 | 478 | } | |
| 348 | 479 | ||
| 349 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 350 | - | // documentation for the value types of accessible states. | |
| 480 | + | // Updates a list of accessible states. | |
| 351 | 481 | // | |
| 352 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 353 | - | // state change must be communicated to assistive technologies. | |
| 482 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 483 | + | // value types of accessible states. | |
| 484 | + | // | |
| 485 | + | // This function should be called by `GtkWidget` types whenever | |
| 486 | + | // an accessible state change must be communicated to assistive | |
| 487 | + | // technologies. | |
| 354 | 488 | // | |
| 355 | 489 | // Example: | |
| 490 | + | // | |
| 356 | 491 | // ```c | |
| 357 | 492 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 358 | 493 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -382,7 +517,7 @@ func (x *BreakpointBin) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessi | |||
| 382 | 517 | // Gets the ID of the @buildable object. | |
| 383 | 518 | // | |
| 384 | 519 | // `GtkBuilder` sets the name based on the ID attribute | |
| 385 | - | // of the <object> tag used to construct the @buildable. | |
| 520 | + | // of the `<object>` tag used to construct the @buildable. | |
| 386 | 521 | func (x *BreakpointBin) GetBuildableId() string { | |
| 387 | 522 | ||
| 388 | 523 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-breakpoint.go +1 -1
| @@ -478,7 +478,7 @@ func (x *Breakpoint) ConnectUnapply(cb *func(Breakpoint)) uint32 { | |||
| 478 | 478 | // Gets the ID of the @buildable object. | |
| 479 | 479 | // | |
| 480 | 480 | // `GtkBuilder` sets the name based on the ID attribute | |
| 481 | - | // of the <object> tag used to construct the @buildable. | |
| 481 | + | // of the `<object>` tag used to construct the @buildable. | |
| 482 | 482 | func (x *Breakpoint) GetBuildableId() string { | |
| 483 | 483 | ||
| 484 | 484 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-button-content.go +145 -10
| @@ -201,34 +201,165 @@ func (c *ButtonContent) SetGoPointer(ptr uintptr) { | |||
| 201 | 201 | c.Ptr = ptr | |
| 202 | 202 | } | |
| 203 | 203 | ||
| 204 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 204 | + | // Requests the user's screen reader to announce the given message. | |
| 205 | + | // | |
| 206 | + | // This kind of notification is useful for messages that | |
| 207 | + | // either have only a visual representation or that are not | |
| 208 | + | // exposed visually at all, e.g. a notification about a | |
| 209 | + | // successful operation. | |
| 210 | + | // | |
| 211 | + | // Also, by using this API, you can ensure that the message | |
| 212 | + | // does not interrupts the user's current screen reader output. | |
| 213 | + | func (x *ButtonContent) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 214 | + | ||
| 215 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 216 | + | ||
| 217 | + | } | |
| 218 | + | ||
| 219 | + | // Retrieves the accessible parent for an accessible object. | |
| 220 | + | // | |
| 221 | + | // This function returns `NULL` for top level widgets. | |
| 222 | + | func (x *ButtonContent) GetAccessibleParent() *gtk.AccessibleBase { | |
| 223 | + | var cls *gtk.AccessibleBase | |
| 224 | + | ||
| 225 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 226 | + | ||
| 227 | + | if cret == 0 { | |
| 228 | + | return nil | |
| 229 | + | } | |
| 230 | + | cls = >k.AccessibleBase{} | |
| 231 | + | cls.Ptr = cret | |
| 232 | + | return cls | |
| 233 | + | } | |
| 234 | + | ||
| 235 | + | // Retrieves the accessible role of an accessible object. | |
| 205 | 236 | func (x *ButtonContent) GetAccessibleRole() gtk.AccessibleRole { | |
| 206 | 237 | ||
| 207 | 238 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 208 | 239 | return cret | |
| 209 | 240 | } | |
| 210 | 241 | ||
| 211 | - | // Resets the accessible @property to its default value. | |
| 242 | + | // Retrieves the implementation for the given accessible object. | |
| 243 | + | func (x *ButtonContent) GetAtContext() *gtk.ATContext { | |
| 244 | + | var cls *gtk.ATContext | |
| 245 | + | ||
| 246 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 247 | + | ||
| 248 | + | if cret == 0 { | |
| 249 | + | return nil | |
| 250 | + | } | |
| 251 | + | cls = >k.ATContext{} | |
| 252 | + | cls.Ptr = cret | |
| 253 | + | return cls | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | // Queries the coordinates and dimensions of this accessible | |
| 257 | + | // | |
| 258 | + | // This functionality can be overridden by `GtkAccessible` | |
| 259 | + | // implementations, e.g. to get the bounds from an ignored | |
| 260 | + | // child widget. | |
| 261 | + | func (x *ButtonContent) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 262 | + | ||
| 263 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 264 | + | return cret | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // Retrieves the first accessible child of an accessible object. | |
| 268 | + | func (x *ButtonContent) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 269 | + | var cls *gtk.AccessibleBase | |
| 270 | + | ||
| 271 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 272 | + | ||
| 273 | + | if cret == 0 { | |
| 274 | + | return nil | |
| 275 | + | } | |
| 276 | + | cls = >k.AccessibleBase{} | |
| 277 | + | cls.Ptr = cret | |
| 278 | + | return cls | |
| 279 | + | } | |
| 280 | + | ||
| 281 | + | // Retrieves the next accessible sibling of an accessible object | |
| 282 | + | func (x *ButtonContent) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 283 | + | var cls *gtk.AccessibleBase | |
| 284 | + | ||
| 285 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 286 | + | ||
| 287 | + | if cret == 0 { | |
| 288 | + | return nil | |
| 289 | + | } | |
| 290 | + | cls = >k.AccessibleBase{} | |
| 291 | + | cls.Ptr = cret | |
| 292 | + | return cls | |
| 293 | + | } | |
| 294 | + | ||
| 295 | + | // Queries a platform state, such as focus. | |
| 296 | + | // | |
| 297 | + | // This functionality can be overridden by `GtkAccessible` | |
| 298 | + | // implementations, e.g. to get platform state from an ignored | |
| 299 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 300 | + | func (x *ButtonContent) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 301 | + | ||
| 302 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 303 | + | return cret | |
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // Resets the accessible property to its default value. | |
| 212 | 307 | func (x *ButtonContent) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 213 | 308 | ||
| 214 | 309 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 215 | 310 | ||
| 216 | 311 | } | |
| 217 | 312 | ||
| 218 | - | // Resets the accessible @relation to its default value. | |
| 313 | + | // Resets the accessible relation to its default value. | |
| 219 | 314 | func (x *ButtonContent) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 220 | 315 | ||
| 221 | 316 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 222 | 317 | ||
| 223 | 318 | } | |
| 224 | 319 | ||
| 225 | - | // Resets the accessible @state to its default value. | |
| 320 | + | // Resets the accessible state to its default value. | |
| 226 | 321 | func (x *ButtonContent) ResetState(StateVar gtk.AccessibleState) { | |
| 227 | 322 | ||
| 228 | 323 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 229 | 324 | ||
| 230 | 325 | } | |
| 231 | 326 | ||
| 327 | + | // Sets the parent and sibling of an accessible object. | |
| 328 | + | // | |
| 329 | + | // This function is meant to be used by accessible implementations that are | |
| 330 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 331 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 332 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 333 | + | // interface, you will use this function to ensure that the parent of each | |
| 334 | + | // child widget is the metadata object, and the parent of each metadata | |
| 335 | + | // object is the container widget. | |
| 336 | + | func (x *ButtonContent) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 337 | + | ||
| 338 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 339 | + | ||
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // Updates the next accessible sibling. | |
| 343 | + | // | |
| 344 | + | // That might be useful when a new child of a custom accessible | |
| 345 | + | // is created, and it needs to be linked to a previous child. | |
| 346 | + | func (x *ButtonContent) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 347 | + | ||
| 348 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 349 | + | ||
| 350 | + | } | |
| 351 | + | ||
| 352 | + | // Informs ATs that the platform state has changed. | |
| 353 | + | // | |
| 354 | + | // This function should be used by `GtkAccessible` implementations that | |
| 355 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 356 | + | // states automatically. | |
| 357 | + | func (x *ButtonContent) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 358 | + | ||
| 359 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 360 | + | ||
| 361 | + | } | |
| 362 | + | ||
| 232 | 363 | // Updates a list of accessible properties. | |
| 233 | 364 | // | |
| 234 | 365 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -271,7 +402,7 @@ func (x *ButtonContent) UpdatePropertyValue(NPropertiesVar int, PropertiesVar [] | |||
| 271 | 402 | // relation change must be communicated to assistive technologies. | |
| 272 | 403 | // | |
| 273 | 404 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 274 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 405 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 275 | 406 | // | |
| 276 | 407 | // ```c | |
| 277 | 408 | // gtk_accessible_update_relation (accessible, | |
| @@ -301,13 +432,17 @@ func (x *ButtonContent) UpdateRelationValue(NRelationsVar int, RelationsVar []gt | |||
| 301 | 432 | ||
| 302 | 433 | } | |
| 303 | 434 | ||
| 304 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 305 | - | // documentation for the value types of accessible states. | |
| 435 | + | // Updates a list of accessible states. | |
| 306 | 436 | // | |
| 307 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 308 | - | // state change must be communicated to assistive technologies. | |
| 437 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 438 | + | // value types of accessible states. | |
| 439 | + | // | |
| 440 | + | // This function should be called by `GtkWidget` types whenever | |
| 441 | + | // an accessible state change must be communicated to assistive | |
| 442 | + | // technologies. | |
| 309 | 443 | // | |
| 310 | 444 | // Example: | |
| 445 | + | // | |
| 311 | 446 | // ```c | |
| 312 | 447 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 313 | 448 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -337,7 +472,7 @@ func (x *ButtonContent) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessi | |||
| 337 | 472 | // Gets the ID of the @buildable object. | |
| 338 | 473 | // | |
| 339 | 474 | // `GtkBuilder` sets the name based on the ID attribute | |
| 340 | - | // of the <object> tag used to construct the @buildable. | |
| 475 | + | // of the `<object>` tag used to construct the @buildable. | |
| 341 | 476 | func (x *ButtonContent) GetBuildableId() string { | |
| 342 | 477 | ||
| 343 | 478 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-button-row.go +145 -10
| @@ -173,34 +173,165 @@ func (x *ButtonRow) ConnectActivated(cb *func(ButtonRow)) uint32 { | |||
| 173 | 173 | return gobject.SignalConnect(x.GoPointer(), "activated", cbRefPtr) | |
| 174 | 174 | } | |
| 175 | 175 | ||
| 176 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 176 | + | // Requests the user's screen reader to announce the given message. | |
| 177 | + | // | |
| 178 | + | // This kind of notification is useful for messages that | |
| 179 | + | // either have only a visual representation or that are not | |
| 180 | + | // exposed visually at all, e.g. a notification about a | |
| 181 | + | // successful operation. | |
| 182 | + | // | |
| 183 | + | // Also, by using this API, you can ensure that the message | |
| 184 | + | // does not interrupts the user's current screen reader output. | |
| 185 | + | func (x *ButtonRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 186 | + | ||
| 187 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 188 | + | ||
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // Retrieves the accessible parent for an accessible object. | |
| 192 | + | // | |
| 193 | + | // This function returns `NULL` for top level widgets. | |
| 194 | + | func (x *ButtonRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 195 | + | var cls *gtk.AccessibleBase | |
| 196 | + | ||
| 197 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 198 | + | ||
| 199 | + | if cret == 0 { | |
| 200 | + | return nil | |
| 201 | + | } | |
| 202 | + | cls = >k.AccessibleBase{} | |
| 203 | + | cls.Ptr = cret | |
| 204 | + | return cls | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | // Retrieves the accessible role of an accessible object. | |
| 177 | 208 | func (x *ButtonRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 178 | 209 | ||
| 179 | 210 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 180 | 211 | return cret | |
| 181 | 212 | } | |
| 182 | 213 | ||
| 183 | - | // Resets the accessible @property to its default value. | |
| 214 | + | // Retrieves the implementation for the given accessible object. | |
| 215 | + | func (x *ButtonRow) GetAtContext() *gtk.ATContext { | |
| 216 | + | var cls *gtk.ATContext | |
| 217 | + | ||
| 218 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 219 | + | ||
| 220 | + | if cret == 0 { | |
| 221 | + | return nil | |
| 222 | + | } | |
| 223 | + | cls = >k.ATContext{} | |
| 224 | + | cls.Ptr = cret | |
| 225 | + | return cls | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // Queries the coordinates and dimensions of this accessible | |
| 229 | + | // | |
| 230 | + | // This functionality can be overridden by `GtkAccessible` | |
| 231 | + | // implementations, e.g. to get the bounds from an ignored | |
| 232 | + | // child widget. | |
| 233 | + | func (x *ButtonRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 234 | + | ||
| 235 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 236 | + | return cret | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // Retrieves the first accessible child of an accessible object. | |
| 240 | + | func (x *ButtonRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 241 | + | var cls *gtk.AccessibleBase | |
| 242 | + | ||
| 243 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 244 | + | ||
| 245 | + | if cret == 0 { | |
| 246 | + | return nil | |
| 247 | + | } | |
| 248 | + | cls = >k.AccessibleBase{} | |
| 249 | + | cls.Ptr = cret | |
| 250 | + | return cls | |
| 251 | + | } | |
| 252 | + | ||
| 253 | + | // Retrieves the next accessible sibling of an accessible object | |
| 254 | + | func (x *ButtonRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 255 | + | var cls *gtk.AccessibleBase | |
| 256 | + | ||
| 257 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 258 | + | ||
| 259 | + | if cret == 0 { | |
| 260 | + | return nil | |
| 261 | + | } | |
| 262 | + | cls = >k.AccessibleBase{} | |
| 263 | + | cls.Ptr = cret | |
| 264 | + | return cls | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // Queries a platform state, such as focus. | |
| 268 | + | // | |
| 269 | + | // This functionality can be overridden by `GtkAccessible` | |
| 270 | + | // implementations, e.g. to get platform state from an ignored | |
| 271 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 272 | + | func (x *ButtonRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 273 | + | ||
| 274 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 275 | + | return cret | |
| 276 | + | } | |
| 277 | + | ||
| 278 | + | // Resets the accessible property to its default value. | |
| 184 | 279 | func (x *ButtonRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 185 | 280 | ||
| 186 | 281 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 187 | 282 | ||
| 188 | 283 | } | |
| 189 | 284 | ||
| 190 | - | // Resets the accessible @relation to its default value. | |
| 285 | + | // Resets the accessible relation to its default value. | |
| 191 | 286 | func (x *ButtonRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 192 | 287 | ||
| 193 | 288 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 194 | 289 | ||
| 195 | 290 | } | |
| 196 | 291 | ||
| 197 | - | // Resets the accessible @state to its default value. | |
| 292 | + | // Resets the accessible state to its default value. | |
| 198 | 293 | func (x *ButtonRow) ResetState(StateVar gtk.AccessibleState) { | |
| 199 | 294 | ||
| 200 | 295 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 201 | 296 | ||
| 202 | 297 | } | |
| 203 | 298 | ||
| 299 | + | // Sets the parent and sibling of an accessible object. | |
| 300 | + | // | |
| 301 | + | // This function is meant to be used by accessible implementations that are | |
| 302 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 303 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 304 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 305 | + | // interface, you will use this function to ensure that the parent of each | |
| 306 | + | // child widget is the metadata object, and the parent of each metadata | |
| 307 | + | // object is the container widget. | |
| 308 | + | func (x *ButtonRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 309 | + | ||
| 310 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 311 | + | ||
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // Updates the next accessible sibling. | |
| 315 | + | // | |
| 316 | + | // That might be useful when a new child of a custom accessible | |
| 317 | + | // is created, and it needs to be linked to a previous child. | |
| 318 | + | func (x *ButtonRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 319 | + | ||
| 320 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 321 | + | ||
| 322 | + | } | |
| 323 | + | ||
| 324 | + | // Informs ATs that the platform state has changed. | |
| 325 | + | // | |
| 326 | + | // This function should be used by `GtkAccessible` implementations that | |
| 327 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 328 | + | // states automatically. | |
| 329 | + | func (x *ButtonRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 330 | + | ||
| 331 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 204 | 335 | // Updates a list of accessible properties. | |
| 205 | 336 | // | |
| 206 | 337 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -243,7 +374,7 @@ func (x *ButtonRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk. | |||
| 243 | 374 | // relation change must be communicated to assistive technologies. | |
| 244 | 375 | // | |
| 245 | 376 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 246 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 377 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 247 | 378 | // | |
| 248 | 379 | // ```c | |
| 249 | 380 | // gtk_accessible_update_relation (accessible, | |
| @@ -273,13 +404,17 @@ func (x *ButtonRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Ac | |||
| 273 | 404 | ||
| 274 | 405 | } | |
| 275 | 406 | ||
| 276 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 277 | - | // documentation for the value types of accessible states. | |
| 407 | + | // Updates a list of accessible states. | |
| 278 | 408 | // | |
| 279 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 280 | - | // state change must be communicated to assistive technologies. | |
| 409 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 410 | + | // value types of accessible states. | |
| 411 | + | // | |
| 412 | + | // This function should be called by `GtkWidget` types whenever | |
| 413 | + | // an accessible state change must be communicated to assistive | |
| 414 | + | // technologies. | |
| 281 | 415 | // | |
| 282 | 416 | // Example: | |
| 417 | + | // | |
| 283 | 418 | // ```c | |
| 284 | 419 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 285 | 420 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -392,7 +527,7 @@ func (x *ButtonRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 392 | 527 | // Gets the ID of the @buildable object. | |
| 393 | 528 | // | |
| 394 | 529 | // `GtkBuilder` sets the name based on the ID attribute | |
| 395 | - | // of the <object> tag used to construct the @buildable. | |
| 530 | + | // of the `<object>` tag used to construct the @buildable. | |
| 396 | 531 | func (x *ButtonRow) GetBuildableId() string { | |
| 397 | 532 | ||
| 398 | 533 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-carousel-indicator-dots.go +145 -10
| @@ -112,34 +112,165 @@ func (c *CarouselIndicatorDots) SetGoPointer(ptr uintptr) { | |||
| 112 | 112 | c.Ptr = ptr | |
| 113 | 113 | } | |
| 114 | 114 | ||
| 115 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 115 | + | // Requests the user's screen reader to announce the given message. | |
| 116 | + | // | |
| 117 | + | // This kind of notification is useful for messages that | |
| 118 | + | // either have only a visual representation or that are not | |
| 119 | + | // exposed visually at all, e.g. a notification about a | |
| 120 | + | // successful operation. | |
| 121 | + | // | |
| 122 | + | // Also, by using this API, you can ensure that the message | |
| 123 | + | // does not interrupts the user's current screen reader output. | |
| 124 | + | func (x *CarouselIndicatorDots) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 125 | + | ||
| 126 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 127 | + | ||
| 128 | + | } | |
| 129 | + | ||
| 130 | + | // Retrieves the accessible parent for an accessible object. | |
| 131 | + | // | |
| 132 | + | // This function returns `NULL` for top level widgets. | |
| 133 | + | func (x *CarouselIndicatorDots) GetAccessibleParent() *gtk.AccessibleBase { | |
| 134 | + | var cls *gtk.AccessibleBase | |
| 135 | + | ||
| 136 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 137 | + | ||
| 138 | + | if cret == 0 { | |
| 139 | + | return nil | |
| 140 | + | } | |
| 141 | + | cls = >k.AccessibleBase{} | |
| 142 | + | cls.Ptr = cret | |
| 143 | + | return cls | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | // Retrieves the accessible role of an accessible object. | |
| 116 | 147 | func (x *CarouselIndicatorDots) GetAccessibleRole() gtk.AccessibleRole { | |
| 117 | 148 | ||
| 118 | 149 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 119 | 150 | return cret | |
| 120 | 151 | } | |
| 121 | 152 | ||
| 122 | - | // Resets the accessible @property to its default value. | |
| 153 | + | // Retrieves the implementation for the given accessible object. | |
| 154 | + | func (x *CarouselIndicatorDots) GetAtContext() *gtk.ATContext { | |
| 155 | + | var cls *gtk.ATContext | |
| 156 | + | ||
| 157 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 158 | + | ||
| 159 | + | if cret == 0 { | |
| 160 | + | return nil | |
| 161 | + | } | |
| 162 | + | cls = >k.ATContext{} | |
| 163 | + | cls.Ptr = cret | |
| 164 | + | return cls | |
| 165 | + | } | |
| 166 | + | ||
| 167 | + | // Queries the coordinates and dimensions of this accessible | |
| 168 | + | // | |
| 169 | + | // This functionality can be overridden by `GtkAccessible` | |
| 170 | + | // implementations, e.g. to get the bounds from an ignored | |
| 171 | + | // child widget. | |
| 172 | + | func (x *CarouselIndicatorDots) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 173 | + | ||
| 174 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 175 | + | return cret | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | // Retrieves the first accessible child of an accessible object. | |
| 179 | + | func (x *CarouselIndicatorDots) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 180 | + | var cls *gtk.AccessibleBase | |
| 181 | + | ||
| 182 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 183 | + | ||
| 184 | + | if cret == 0 { | |
| 185 | + | return nil | |
| 186 | + | } | |
| 187 | + | cls = >k.AccessibleBase{} | |
| 188 | + | cls.Ptr = cret | |
| 189 | + | return cls | |
| 190 | + | } | |
| 191 | + | ||
| 192 | + | // Retrieves the next accessible sibling of an accessible object | |
| 193 | + | func (x *CarouselIndicatorDots) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 194 | + | var cls *gtk.AccessibleBase | |
| 195 | + | ||
| 196 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 197 | + | ||
| 198 | + | if cret == 0 { | |
| 199 | + | return nil | |
| 200 | + | } | |
| 201 | + | cls = >k.AccessibleBase{} | |
| 202 | + | cls.Ptr = cret | |
| 203 | + | return cls | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // Queries a platform state, such as focus. | |
| 207 | + | // | |
| 208 | + | // This functionality can be overridden by `GtkAccessible` | |
| 209 | + | // implementations, e.g. to get platform state from an ignored | |
| 210 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 211 | + | func (x *CarouselIndicatorDots) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 212 | + | ||
| 213 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 214 | + | return cret | |
| 215 | + | } | |
| 216 | + | ||
| 217 | + | // Resets the accessible property to its default value. | |
| 123 | 218 | func (x *CarouselIndicatorDots) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 124 | 219 | ||
| 125 | 220 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 126 | 221 | ||
| 127 | 222 | } | |
| 128 | 223 | ||
| 129 | - | // Resets the accessible @relation to its default value. | |
| 224 | + | // Resets the accessible relation to its default value. | |
| 130 | 225 | func (x *CarouselIndicatorDots) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 131 | 226 | ||
| 132 | 227 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 133 | 228 | ||
| 134 | 229 | } | |
| 135 | 230 | ||
| 136 | - | // Resets the accessible @state to its default value. | |
| 231 | + | // Resets the accessible state to its default value. | |
| 137 | 232 | func (x *CarouselIndicatorDots) ResetState(StateVar gtk.AccessibleState) { | |
| 138 | 233 | ||
| 139 | 234 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 140 | 235 | ||
| 141 | 236 | } | |
| 142 | 237 | ||
| 238 | + | // Sets the parent and sibling of an accessible object. | |
| 239 | + | // | |
| 240 | + | // This function is meant to be used by accessible implementations that are | |
| 241 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 242 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 243 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 244 | + | // interface, you will use this function to ensure that the parent of each | |
| 245 | + | // child widget is the metadata object, and the parent of each metadata | |
| 246 | + | // object is the container widget. | |
| 247 | + | func (x *CarouselIndicatorDots) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 248 | + | ||
| 249 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 250 | + | ||
| 251 | + | } | |
| 252 | + | ||
| 253 | + | // Updates the next accessible sibling. | |
| 254 | + | // | |
| 255 | + | // That might be useful when a new child of a custom accessible | |
| 256 | + | // is created, and it needs to be linked to a previous child. | |
| 257 | + | func (x *CarouselIndicatorDots) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 258 | + | ||
| 259 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 260 | + | ||
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // Informs ATs that the platform state has changed. | |
| 264 | + | // | |
| 265 | + | // This function should be used by `GtkAccessible` implementations that | |
| 266 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 267 | + | // states automatically. | |
| 268 | + | func (x *CarouselIndicatorDots) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 269 | + | ||
| 270 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 271 | + | ||
| 272 | + | } | |
| 273 | + | ||
| 143 | 274 | // Updates a list of accessible properties. | |
| 144 | 275 | // | |
| 145 | 276 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -182,7 +313,7 @@ func (x *CarouselIndicatorDots) UpdatePropertyValue(NPropertiesVar int, Properti | |||
| 182 | 313 | // relation change must be communicated to assistive technologies. | |
| 183 | 314 | // | |
| 184 | 315 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 185 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 316 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 186 | 317 | // | |
| 187 | 318 | // ```c | |
| 188 | 319 | // gtk_accessible_update_relation (accessible, | |
| @@ -212,13 +343,17 @@ func (x *CarouselIndicatorDots) UpdateRelationValue(NRelationsVar int, Relations | |||
| 212 | 343 | ||
| 213 | 344 | } | |
| 214 | 345 | ||
| 215 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 216 | - | // documentation for the value types of accessible states. | |
| 346 | + | // Updates a list of accessible states. | |
| 217 | 347 | // | |
| 218 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 219 | - | // state change must be communicated to assistive technologies. | |
| 348 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 349 | + | // value types of accessible states. | |
| 350 | + | // | |
| 351 | + | // This function should be called by `GtkWidget` types whenever | |
| 352 | + | // an accessible state change must be communicated to assistive | |
| 353 | + | // technologies. | |
| 220 | 354 | // | |
| 221 | 355 | // Example: | |
| 356 | + | // | |
| 222 | 357 | // ```c | |
| 223 | 358 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 224 | 359 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -248,7 +383,7 @@ func (x *CarouselIndicatorDots) UpdateStateValue(NStatesVar int, StatesVar []gtk | |||
| 248 | 383 | // Gets the ID of the @buildable object. | |
| 249 | 384 | // | |
| 250 | 385 | // `GtkBuilder` sets the name based on the ID attribute | |
| 251 | - | // of the <object> tag used to construct the @buildable. | |
| 386 | + | // of the `<object>` tag used to construct the @buildable. | |
| 252 | 387 | func (x *CarouselIndicatorDots) GetBuildableId() string { | |
| 253 | 388 | ||
| 254 | 389 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-carousel-indicator-lines.go +146 -11
| @@ -26,7 +26,7 @@ func (x *CarouselIndicatorLinesClass) GoPointer() uintptr { | |||
| 26 | 26 | // | |
| 27 | 27 | // <picture> | |
| 28 | 28 | // | |
| 29 | - | // <source srcset="carousel-indicator-dots-lines.png" media="(prefers-color-scheme: dark)"> | |
| 29 | + | // <source srcset="carousel-indicator-lines-dark.png" media="(prefers-color-scheme: dark)"> | |
| 30 | 30 | // <img src="carousel-indicator-lines.png" alt="carousel-indicator-lines"> | |
| 31 | 31 | // | |
| 32 | 32 | // </picture> | |
| @@ -111,34 +111,165 @@ func (c *CarouselIndicatorLines) SetGoPointer(ptr uintptr) { | |||
| 111 | 111 | c.Ptr = ptr | |
| 112 | 112 | } | |
| 113 | 113 | ||
| 114 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 114 | + | // Requests the user's screen reader to announce the given message. | |
| 115 | + | // | |
| 116 | + | // This kind of notification is useful for messages that | |
| 117 | + | // either have only a visual representation or that are not | |
| 118 | + | // exposed visually at all, e.g. a notification about a | |
| 119 | + | // successful operation. | |
| 120 | + | // | |
| 121 | + | // Also, by using this API, you can ensure that the message | |
| 122 | + | // does not interrupts the user's current screen reader output. | |
| 123 | + | func (x *CarouselIndicatorLines) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 124 | + | ||
| 125 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 126 | + | ||
| 127 | + | } | |
| 128 | + | ||
| 129 | + | // Retrieves the accessible parent for an accessible object. | |
| 130 | + | // | |
| 131 | + | // This function returns `NULL` for top level widgets. | |
| 132 | + | func (x *CarouselIndicatorLines) GetAccessibleParent() *gtk.AccessibleBase { | |
| 133 | + | var cls *gtk.AccessibleBase | |
| 134 | + | ||
| 135 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 136 | + | ||
| 137 | + | if cret == 0 { | |
| 138 | + | return nil | |
| 139 | + | } | |
| 140 | + | cls = >k.AccessibleBase{} | |
| 141 | + | cls.Ptr = cret | |
| 142 | + | return cls | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | // Retrieves the accessible role of an accessible object. | |
| 115 | 146 | func (x *CarouselIndicatorLines) GetAccessibleRole() gtk.AccessibleRole { | |
| 116 | 147 | ||
| 117 | 148 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 118 | 149 | return cret | |
| 119 | 150 | } | |
| 120 | 151 | ||
| 121 | - | // Resets the accessible @property to its default value. | |
| 152 | + | // Retrieves the implementation for the given accessible object. | |
| 153 | + | func (x *CarouselIndicatorLines) GetAtContext() *gtk.ATContext { | |
| 154 | + | var cls *gtk.ATContext | |
| 155 | + | ||
| 156 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 157 | + | ||
| 158 | + | if cret == 0 { | |
| 159 | + | return nil | |
| 160 | + | } | |
| 161 | + | cls = >k.ATContext{} | |
| 162 | + | cls.Ptr = cret | |
| 163 | + | return cls | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // Queries the coordinates and dimensions of this accessible | |
| 167 | + | // | |
| 168 | + | // This functionality can be overridden by `GtkAccessible` | |
| 169 | + | // implementations, e.g. to get the bounds from an ignored | |
| 170 | + | // child widget. | |
| 171 | + | func (x *CarouselIndicatorLines) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 172 | + | ||
| 173 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 174 | + | return cret | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | // Retrieves the first accessible child of an accessible object. | |
| 178 | + | func (x *CarouselIndicatorLines) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 179 | + | var cls *gtk.AccessibleBase | |
| 180 | + | ||
| 181 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 182 | + | ||
| 183 | + | if cret == 0 { | |
| 184 | + | return nil | |
| 185 | + | } | |
| 186 | + | cls = >k.AccessibleBase{} | |
| 187 | + | cls.Ptr = cret | |
| 188 | + | return cls | |
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // Retrieves the next accessible sibling of an accessible object | |
| 192 | + | func (x *CarouselIndicatorLines) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 193 | + | var cls *gtk.AccessibleBase | |
| 194 | + | ||
| 195 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 196 | + | ||
| 197 | + | if cret == 0 { | |
| 198 | + | return nil | |
| 199 | + | } | |
| 200 | + | cls = >k.AccessibleBase{} | |
| 201 | + | cls.Ptr = cret | |
| 202 | + | return cls | |
| 203 | + | } | |
| 204 | + | ||
| 205 | + | // Queries a platform state, such as focus. | |
| 206 | + | // | |
| 207 | + | // This functionality can be overridden by `GtkAccessible` | |
| 208 | + | // implementations, e.g. to get platform state from an ignored | |
| 209 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 210 | + | func (x *CarouselIndicatorLines) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 211 | + | ||
| 212 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 213 | + | return cret | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | // Resets the accessible property to its default value. | |
| 122 | 217 | func (x *CarouselIndicatorLines) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 123 | 218 | ||
| 124 | 219 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 125 | 220 | ||
| 126 | 221 | } | |
| 127 | 222 | ||
| 128 | - | // Resets the accessible @relation to its default value. | |
| 223 | + | // Resets the accessible relation to its default value. | |
| 129 | 224 | func (x *CarouselIndicatorLines) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 130 | 225 | ||
| 131 | 226 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 132 | 227 | ||
| 133 | 228 | } | |
| 134 | 229 | ||
| 135 | - | // Resets the accessible @state to its default value. | |
| 230 | + | // Resets the accessible state to its default value. | |
| 136 | 231 | func (x *CarouselIndicatorLines) ResetState(StateVar gtk.AccessibleState) { | |
| 137 | 232 | ||
| 138 | 233 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 139 | 234 | ||
| 140 | 235 | } | |
| 141 | 236 | ||
| 237 | + | // Sets the parent and sibling of an accessible object. | |
| 238 | + | // | |
| 239 | + | // This function is meant to be used by accessible implementations that are | |
| 240 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 241 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 242 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 243 | + | // interface, you will use this function to ensure that the parent of each | |
| 244 | + | // child widget is the metadata object, and the parent of each metadata | |
| 245 | + | // object is the container widget. | |
| 246 | + | func (x *CarouselIndicatorLines) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 247 | + | ||
| 248 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 249 | + | ||
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // Updates the next accessible sibling. | |
| 253 | + | // | |
| 254 | + | // That might be useful when a new child of a custom accessible | |
| 255 | + | // is created, and it needs to be linked to a previous child. | |
| 256 | + | func (x *CarouselIndicatorLines) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 257 | + | ||
| 258 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 259 | + | ||
| 260 | + | } | |
| 261 | + | ||
| 262 | + | // Informs ATs that the platform state has changed. | |
| 263 | + | // | |
| 264 | + | // This function should be used by `GtkAccessible` implementations that | |
| 265 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 266 | + | // states automatically. | |
| 267 | + | func (x *CarouselIndicatorLines) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 268 | + | ||
| 269 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 270 | + | ||
| 271 | + | } | |
| 272 | + | ||
| 142 | 273 | // Updates a list of accessible properties. | |
| 143 | 274 | // | |
| 144 | 275 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -181,7 +312,7 @@ func (x *CarouselIndicatorLines) UpdatePropertyValue(NPropertiesVar int, Propert | |||
| 181 | 312 | // relation change must be communicated to assistive technologies. | |
| 182 | 313 | // | |
| 183 | 314 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 184 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 315 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 185 | 316 | // | |
| 186 | 317 | // ```c | |
| 187 | 318 | // gtk_accessible_update_relation (accessible, | |
| @@ -211,13 +342,17 @@ func (x *CarouselIndicatorLines) UpdateRelationValue(NRelationsVar int, Relation | |||
| 211 | 342 | ||
| 212 | 343 | } | |
| 213 | 344 | ||
| 214 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 215 | - | // documentation for the value types of accessible states. | |
| 345 | + | // Updates a list of accessible states. | |
| 216 | 346 | // | |
| 217 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 218 | - | // state change must be communicated to assistive technologies. | |
| 347 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 348 | + | // value types of accessible states. | |
| 349 | + | // | |
| 350 | + | // This function should be called by `GtkWidget` types whenever | |
| 351 | + | // an accessible state change must be communicated to assistive | |
| 352 | + | // technologies. | |
| 219 | 353 | // | |
| 220 | 354 | // Example: | |
| 355 | + | // | |
| 221 | 356 | // ```c | |
| 222 | 357 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 223 | 358 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -247,7 +382,7 @@ func (x *CarouselIndicatorLines) UpdateStateValue(NStatesVar int, StatesVar []gt | |||
| 247 | 382 | // Gets the ID of the @buildable object. | |
| 248 | 383 | // | |
| 249 | 384 | // `GtkBuilder` sets the name based on the ID attribute | |
| 250 | - | // of the <object> tag used to construct the @buildable. | |
| 385 | + | // of the `<object>` tag used to construct the @buildable. | |
| 251 | 386 | func (x *CarouselIndicatorLines) GetBuildableId() string { | |
| 252 | 387 | ||
| 253 | 388 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-carousel.go +145 -10
| @@ -404,34 +404,165 @@ func (x *Carousel) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDr | |||
| 404 | 404 | ||
| 405 | 405 | } | |
| 406 | 406 | ||
| 407 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 407 | + | // Requests the user's screen reader to announce the given message. | |
| 408 | + | // | |
| 409 | + | // This kind of notification is useful for messages that | |
| 410 | + | // either have only a visual representation or that are not | |
| 411 | + | // exposed visually at all, e.g. a notification about a | |
| 412 | + | // successful operation. | |
| 413 | + | // | |
| 414 | + | // Also, by using this API, you can ensure that the message | |
| 415 | + | // does not interrupts the user's current screen reader output. | |
| 416 | + | func (x *Carousel) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 417 | + | ||
| 418 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 419 | + | ||
| 420 | + | } | |
| 421 | + | ||
| 422 | + | // Retrieves the accessible parent for an accessible object. | |
| 423 | + | // | |
| 424 | + | // This function returns `NULL` for top level widgets. | |
| 425 | + | func (x *Carousel) GetAccessibleParent() *gtk.AccessibleBase { | |
| 426 | + | var cls *gtk.AccessibleBase | |
| 427 | + | ||
| 428 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 429 | + | ||
| 430 | + | if cret == 0 { | |
| 431 | + | return nil | |
| 432 | + | } | |
| 433 | + | cls = >k.AccessibleBase{} | |
| 434 | + | cls.Ptr = cret | |
| 435 | + | return cls | |
| 436 | + | } | |
| 437 | + | ||
| 438 | + | // Retrieves the accessible role of an accessible object. | |
| 408 | 439 | func (x *Carousel) GetAccessibleRole() gtk.AccessibleRole { | |
| 409 | 440 | ||
| 410 | 441 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 411 | 442 | return cret | |
| 412 | 443 | } | |
| 413 | 444 | ||
| 414 | - | // Resets the accessible @property to its default value. | |
| 445 | + | // Retrieves the implementation for the given accessible object. | |
| 446 | + | func (x *Carousel) GetAtContext() *gtk.ATContext { | |
| 447 | + | var cls *gtk.ATContext | |
| 448 | + | ||
| 449 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 450 | + | ||
| 451 | + | if cret == 0 { | |
| 452 | + | return nil | |
| 453 | + | } | |
| 454 | + | cls = >k.ATContext{} | |
| 455 | + | cls.Ptr = cret | |
| 456 | + | return cls | |
| 457 | + | } | |
| 458 | + | ||
| 459 | + | // Queries the coordinates and dimensions of this accessible | |
| 460 | + | // | |
| 461 | + | // This functionality can be overridden by `GtkAccessible` | |
| 462 | + | // implementations, e.g. to get the bounds from an ignored | |
| 463 | + | // child widget. | |
| 464 | + | func (x *Carousel) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 465 | + | ||
| 466 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 467 | + | return cret | |
| 468 | + | } | |
| 469 | + | ||
| 470 | + | // Retrieves the first accessible child of an accessible object. | |
| 471 | + | func (x *Carousel) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 472 | + | var cls *gtk.AccessibleBase | |
| 473 | + | ||
| 474 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 475 | + | ||
| 476 | + | if cret == 0 { | |
| 477 | + | return nil | |
| 478 | + | } | |
| 479 | + | cls = >k.AccessibleBase{} | |
| 480 | + | cls.Ptr = cret | |
| 481 | + | return cls | |
| 482 | + | } | |
| 483 | + | ||
| 484 | + | // Retrieves the next accessible sibling of an accessible object | |
| 485 | + | func (x *Carousel) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 486 | + | var cls *gtk.AccessibleBase | |
| 487 | + | ||
| 488 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 489 | + | ||
| 490 | + | if cret == 0 { | |
| 491 | + | return nil | |
| 492 | + | } | |
| 493 | + | cls = >k.AccessibleBase{} | |
| 494 | + | cls.Ptr = cret | |
| 495 | + | return cls | |
| 496 | + | } | |
| 497 | + | ||
| 498 | + | // Queries a platform state, such as focus. | |
| 499 | + | // | |
| 500 | + | // This functionality can be overridden by `GtkAccessible` | |
| 501 | + | // implementations, e.g. to get platform state from an ignored | |
| 502 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 503 | + | func (x *Carousel) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 504 | + | ||
| 505 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 506 | + | return cret | |
| 507 | + | } | |
| 508 | + | ||
| 509 | + | // Resets the accessible property to its default value. | |
| 415 | 510 | func (x *Carousel) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 416 | 511 | ||
| 417 | 512 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 418 | 513 | ||
| 419 | 514 | } | |
| 420 | 515 | ||
| 421 | - | // Resets the accessible @relation to its default value. | |
| 516 | + | // Resets the accessible relation to its default value. | |
| 422 | 517 | func (x *Carousel) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 423 | 518 | ||
| 424 | 519 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 425 | 520 | ||
| 426 | 521 | } | |
| 427 | 522 | ||
| 428 | - | // Resets the accessible @state to its default value. | |
| 523 | + | // Resets the accessible state to its default value. | |
| 429 | 524 | func (x *Carousel) ResetState(StateVar gtk.AccessibleState) { | |
| 430 | 525 | ||
| 431 | 526 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 432 | 527 | ||
| 433 | 528 | } | |
| 434 | 529 | ||
| 530 | + | // Sets the parent and sibling of an accessible object. | |
| 531 | + | // | |
| 532 | + | // This function is meant to be used by accessible implementations that are | |
| 533 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 534 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 535 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 536 | + | // interface, you will use this function to ensure that the parent of each | |
| 537 | + | // child widget is the metadata object, and the parent of each metadata | |
| 538 | + | // object is the container widget. | |
| 539 | + | func (x *Carousel) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 540 | + | ||
| 541 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 542 | + | ||
| 543 | + | } | |
| 544 | + | ||
| 545 | + | // Updates the next accessible sibling. | |
| 546 | + | // | |
| 547 | + | // That might be useful when a new child of a custom accessible | |
| 548 | + | // is created, and it needs to be linked to a previous child. | |
| 549 | + | func (x *Carousel) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 550 | + | ||
| 551 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 552 | + | ||
| 553 | + | } | |
| 554 | + | ||
| 555 | + | // Informs ATs that the platform state has changed. | |
| 556 | + | // | |
| 557 | + | // This function should be used by `GtkAccessible` implementations that | |
| 558 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 559 | + | // states automatically. | |
| 560 | + | func (x *Carousel) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 561 | + | ||
| 562 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 563 | + | ||
| 564 | + | } | |
| 565 | + | ||
| 435 | 566 | // Updates a list of accessible properties. | |
| 436 | 567 | // | |
| 437 | 568 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -474,7 +605,7 @@ func (x *Carousel) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.A | |||
| 474 | 605 | // relation change must be communicated to assistive technologies. | |
| 475 | 606 | // | |
| 476 | 607 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 477 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 608 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 478 | 609 | // | |
| 479 | 610 | // ```c | |
| 480 | 611 | // gtk_accessible_update_relation (accessible, | |
| @@ -504,13 +635,17 @@ func (x *Carousel) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acc | |||
| 504 | 635 | ||
| 505 | 636 | } | |
| 506 | 637 | ||
| 507 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 508 | - | // documentation for the value types of accessible states. | |
| 638 | + | // Updates a list of accessible states. | |
| 509 | 639 | // | |
| 510 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 511 | - | // state change must be communicated to assistive technologies. | |
| 640 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 641 | + | // value types of accessible states. | |
| 642 | + | // | |
| 643 | + | // This function should be called by `GtkWidget` types whenever | |
| 644 | + | // an accessible state change must be communicated to assistive | |
| 645 | + | // technologies. | |
| 512 | 646 | // | |
| 513 | 647 | // Example: | |
| 648 | + | // | |
| 514 | 649 | // ```c | |
| 515 | 650 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 516 | 651 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -540,7 +675,7 @@ func (x *Carousel) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleSt | |||
| 540 | 675 | // Gets the ID of the @buildable object. | |
| 541 | 676 | // | |
| 542 | 677 | // `GtkBuilder` sets the name based on the ID attribute | |
| 543 | - | // of the <object> tag used to construct the @buildable. | |
| 678 | + | // of the `<object>` tag used to construct the @buildable. | |
| 544 | 679 | func (x *Carousel) GetBuildableId() string { | |
| 545 | 680 | ||
| 546 | 681 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-clamp-scrollable.go +145 -10
| @@ -172,34 +172,165 @@ func (c *ClampScrollable) SetGoPointer(ptr uintptr) { | |||
| 172 | 172 | c.Ptr = ptr | |
| 173 | 173 | } | |
| 174 | 174 | ||
| 175 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 175 | + | // Requests the user's screen reader to announce the given message. | |
| 176 | + | // | |
| 177 | + | // This kind of notification is useful for messages that | |
| 178 | + | // either have only a visual representation or that are not | |
| 179 | + | // exposed visually at all, e.g. a notification about a | |
| 180 | + | // successful operation. | |
| 181 | + | // | |
| 182 | + | // Also, by using this API, you can ensure that the message | |
| 183 | + | // does not interrupts the user's current screen reader output. | |
| 184 | + | func (x *ClampScrollable) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 185 | + | ||
| 186 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 187 | + | ||
| 188 | + | } | |
| 189 | + | ||
| 190 | + | // Retrieves the accessible parent for an accessible object. | |
| 191 | + | // | |
| 192 | + | // This function returns `NULL` for top level widgets. | |
| 193 | + | func (x *ClampScrollable) GetAccessibleParent() *gtk.AccessibleBase { | |
| 194 | + | var cls *gtk.AccessibleBase | |
| 195 | + | ||
| 196 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 197 | + | ||
| 198 | + | if cret == 0 { | |
| 199 | + | return nil | |
| 200 | + | } | |
| 201 | + | cls = >k.AccessibleBase{} | |
| 202 | + | cls.Ptr = cret | |
| 203 | + | return cls | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | // Retrieves the accessible role of an accessible object. | |
| 176 | 207 | func (x *ClampScrollable) GetAccessibleRole() gtk.AccessibleRole { | |
| 177 | 208 | ||
| 178 | 209 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 179 | 210 | return cret | |
| 180 | 211 | } | |
| 181 | 212 | ||
| 182 | - | // Resets the accessible @property to its default value. | |
| 213 | + | // Retrieves the implementation for the given accessible object. | |
| 214 | + | func (x *ClampScrollable) GetAtContext() *gtk.ATContext { | |
| 215 | + | var cls *gtk.ATContext | |
| 216 | + | ||
| 217 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 218 | + | ||
| 219 | + | if cret == 0 { | |
| 220 | + | return nil | |
| 221 | + | } | |
| 222 | + | cls = >k.ATContext{} | |
| 223 | + | cls.Ptr = cret | |
| 224 | + | return cls | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | // Queries the coordinates and dimensions of this accessible | |
| 228 | + | // | |
| 229 | + | // This functionality can be overridden by `GtkAccessible` | |
| 230 | + | // implementations, e.g. to get the bounds from an ignored | |
| 231 | + | // child widget. | |
| 232 | + | func (x *ClampScrollable) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 233 | + | ||
| 234 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 235 | + | return cret | |
| 236 | + | } | |
| 237 | + | ||
| 238 | + | // Retrieves the first accessible child of an accessible object. | |
| 239 | + | func (x *ClampScrollable) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 240 | + | var cls *gtk.AccessibleBase | |
| 241 | + | ||
| 242 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 243 | + | ||
| 244 | + | if cret == 0 { | |
| 245 | + | return nil | |
| 246 | + | } | |
| 247 | + | cls = >k.AccessibleBase{} | |
| 248 | + | cls.Ptr = cret | |
| 249 | + | return cls | |
| 250 | + | } | |
| 251 | + | ||
| 252 | + | // Retrieves the next accessible sibling of an accessible object | |
| 253 | + | func (x *ClampScrollable) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 254 | + | var cls *gtk.AccessibleBase | |
| 255 | + | ||
| 256 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 257 | + | ||
| 258 | + | if cret == 0 { | |
| 259 | + | return nil | |
| 260 | + | } | |
| 261 | + | cls = >k.AccessibleBase{} | |
| 262 | + | cls.Ptr = cret | |
| 263 | + | return cls | |
| 264 | + | } | |
| 265 | + | ||
| 266 | + | // Queries a platform state, such as focus. | |
| 267 | + | // | |
| 268 | + | // This functionality can be overridden by `GtkAccessible` | |
| 269 | + | // implementations, e.g. to get platform state from an ignored | |
| 270 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 271 | + | func (x *ClampScrollable) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 272 | + | ||
| 273 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 274 | + | return cret | |
| 275 | + | } | |
| 276 | + | ||
| 277 | + | // Resets the accessible property to its default value. | |
| 183 | 278 | func (x *ClampScrollable) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 184 | 279 | ||
| 185 | 280 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 186 | 281 | ||
| 187 | 282 | } | |
| 188 | 283 | ||
| 189 | - | // Resets the accessible @relation to its default value. | |
| 284 | + | // Resets the accessible relation to its default value. | |
| 190 | 285 | func (x *ClampScrollable) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 191 | 286 | ||
| 192 | 287 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 193 | 288 | ||
| 194 | 289 | } | |
| 195 | 290 | ||
| 196 | - | // Resets the accessible @state to its default value. | |
| 291 | + | // Resets the accessible state to its default value. | |
| 197 | 292 | func (x *ClampScrollable) ResetState(StateVar gtk.AccessibleState) { | |
| 198 | 293 | ||
| 199 | 294 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 200 | 295 | ||
| 201 | 296 | } | |
| 202 | 297 | ||
| 298 | + | // Sets the parent and sibling of an accessible object. | |
| 299 | + | // | |
| 300 | + | // This function is meant to be used by accessible implementations that are | |
| 301 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 302 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 303 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 304 | + | // interface, you will use this function to ensure that the parent of each | |
| 305 | + | // child widget is the metadata object, and the parent of each metadata | |
| 306 | + | // object is the container widget. | |
| 307 | + | func (x *ClampScrollable) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 308 | + | ||
| 309 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 310 | + | ||
| 311 | + | } | |
| 312 | + | ||
| 313 | + | // Updates the next accessible sibling. | |
| 314 | + | // | |
| 315 | + | // That might be useful when a new child of a custom accessible | |
| 316 | + | // is created, and it needs to be linked to a previous child. | |
| 317 | + | func (x *ClampScrollable) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 318 | + | ||
| 319 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 320 | + | ||
| 321 | + | } | |
| 322 | + | ||
| 323 | + | // Informs ATs that the platform state has changed. | |
| 324 | + | // | |
| 325 | + | // This function should be used by `GtkAccessible` implementations that | |
| 326 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 327 | + | // states automatically. | |
| 328 | + | func (x *ClampScrollable) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 329 | + | ||
| 330 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 331 | + | ||
| 332 | + | } | |
| 333 | + | ||
| 203 | 334 | // Updates a list of accessible properties. | |
| 204 | 335 | // | |
| 205 | 336 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -242,7 +373,7 @@ func (x *ClampScrollable) UpdatePropertyValue(NPropertiesVar int, PropertiesVar | |||
| 242 | 373 | // relation change must be communicated to assistive technologies. | |
| 243 | 374 | // | |
| 244 | 375 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 245 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 376 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 246 | 377 | // | |
| 247 | 378 | // ```c | |
| 248 | 379 | // gtk_accessible_update_relation (accessible, | |
| @@ -272,13 +403,17 @@ func (x *ClampScrollable) UpdateRelationValue(NRelationsVar int, RelationsVar [] | |||
| 272 | 403 | ||
| 273 | 404 | } | |
| 274 | 405 | ||
| 275 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 276 | - | // documentation for the value types of accessible states. | |
| 406 | + | // Updates a list of accessible states. | |
| 277 | 407 | // | |
| 278 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 279 | - | // state change must be communicated to assistive technologies. | |
| 408 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 409 | + | // value types of accessible states. | |
| 410 | + | // | |
| 411 | + | // This function should be called by `GtkWidget` types whenever | |
| 412 | + | // an accessible state change must be communicated to assistive | |
| 413 | + | // technologies. | |
| 280 | 414 | // | |
| 281 | 415 | // Example: | |
| 416 | + | // | |
| 282 | 417 | // ```c | |
| 283 | 418 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 284 | 419 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -308,7 +443,7 @@ func (x *ClampScrollable) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acces | |||
| 308 | 443 | // Gets the ID of the @buildable object. | |
| 309 | 444 | // | |
| 310 | 445 | // `GtkBuilder` sets the name based on the ID attribute | |
| 311 | - | // of the <object> tag used to construct the @buildable. | |
| 446 | + | // of the `<object>` tag used to construct the @buildable. | |
| 312 | 447 | func (x *ClampScrollable) GetBuildableId() string { | |
| 313 | 448 | ||
| 314 | 449 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-clamp.go +145 -10
| @@ -194,34 +194,165 @@ func (c *Clamp) SetGoPointer(ptr uintptr) { | |||
| 194 | 194 | c.Ptr = ptr | |
| 195 | 195 | } | |
| 196 | 196 | ||
| 197 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 197 | + | // Requests the user's screen reader to announce the given message. | |
| 198 | + | // | |
| 199 | + | // This kind of notification is useful for messages that | |
| 200 | + | // either have only a visual representation or that are not | |
| 201 | + | // exposed visually at all, e.g. a notification about a | |
| 202 | + | // successful operation. | |
| 203 | + | // | |
| 204 | + | // Also, by using this API, you can ensure that the message | |
| 205 | + | // does not interrupts the user's current screen reader output. | |
| 206 | + | func (x *Clamp) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 207 | + | ||
| 208 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 209 | + | ||
| 210 | + | } | |
| 211 | + | ||
| 212 | + | // Retrieves the accessible parent for an accessible object. | |
| 213 | + | // | |
| 214 | + | // This function returns `NULL` for top level widgets. | |
| 215 | + | func (x *Clamp) GetAccessibleParent() *gtk.AccessibleBase { | |
| 216 | + | var cls *gtk.AccessibleBase | |
| 217 | + | ||
| 218 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 219 | + | ||
| 220 | + | if cret == 0 { | |
| 221 | + | return nil | |
| 222 | + | } | |
| 223 | + | cls = >k.AccessibleBase{} | |
| 224 | + | cls.Ptr = cret | |
| 225 | + | return cls | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // Retrieves the accessible role of an accessible object. | |
| 198 | 229 | func (x *Clamp) GetAccessibleRole() gtk.AccessibleRole { | |
| 199 | 230 | ||
| 200 | 231 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 201 | 232 | return cret | |
| 202 | 233 | } | |
| 203 | 234 | ||
| 204 | - | // Resets the accessible @property to its default value. | |
| 235 | + | // Retrieves the implementation for the given accessible object. | |
| 236 | + | func (x *Clamp) GetAtContext() *gtk.ATContext { | |
| 237 | + | var cls *gtk.ATContext | |
| 238 | + | ||
| 239 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 240 | + | ||
| 241 | + | if cret == 0 { | |
| 242 | + | return nil | |
| 243 | + | } | |
| 244 | + | cls = >k.ATContext{} | |
| 245 | + | cls.Ptr = cret | |
| 246 | + | return cls | |
| 247 | + | } | |
| 248 | + | ||
| 249 | + | // Queries the coordinates and dimensions of this accessible | |
| 250 | + | // | |
| 251 | + | // This functionality can be overridden by `GtkAccessible` | |
| 252 | + | // implementations, e.g. to get the bounds from an ignored | |
| 253 | + | // child widget. | |
| 254 | + | func (x *Clamp) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 255 | + | ||
| 256 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 257 | + | return cret | |
| 258 | + | } | |
| 259 | + | ||
| 260 | + | // Retrieves the first accessible child of an accessible object. | |
| 261 | + | func (x *Clamp) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 262 | + | var cls *gtk.AccessibleBase | |
| 263 | + | ||
| 264 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 265 | + | ||
| 266 | + | if cret == 0 { | |
| 267 | + | return nil | |
| 268 | + | } | |
| 269 | + | cls = >k.AccessibleBase{} | |
| 270 | + | cls.Ptr = cret | |
| 271 | + | return cls | |
| 272 | + | } | |
| 273 | + | ||
| 274 | + | // Retrieves the next accessible sibling of an accessible object | |
| 275 | + | func (x *Clamp) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 276 | + | var cls *gtk.AccessibleBase | |
| 277 | + | ||
| 278 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 279 | + | ||
| 280 | + | if cret == 0 { | |
| 281 | + | return nil | |
| 282 | + | } | |
| 283 | + | cls = >k.AccessibleBase{} | |
| 284 | + | cls.Ptr = cret | |
| 285 | + | return cls | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | // Queries a platform state, such as focus. | |
| 289 | + | // | |
| 290 | + | // This functionality can be overridden by `GtkAccessible` | |
| 291 | + | // implementations, e.g. to get platform state from an ignored | |
| 292 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 293 | + | func (x *Clamp) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 294 | + | ||
| 295 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 296 | + | return cret | |
| 297 | + | } | |
| 298 | + | ||
| 299 | + | // Resets the accessible property to its default value. | |
| 205 | 300 | func (x *Clamp) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 206 | 301 | ||
| 207 | 302 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 208 | 303 | ||
| 209 | 304 | } | |
| 210 | 305 | ||
| 211 | - | // Resets the accessible @relation to its default value. | |
| 306 | + | // Resets the accessible relation to its default value. | |
| 212 | 307 | func (x *Clamp) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 213 | 308 | ||
| 214 | 309 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 215 | 310 | ||
| 216 | 311 | } | |
| 217 | 312 | ||
| 218 | - | // Resets the accessible @state to its default value. | |
| 313 | + | // Resets the accessible state to its default value. | |
| 219 | 314 | func (x *Clamp) ResetState(StateVar gtk.AccessibleState) { | |
| 220 | 315 | ||
| 221 | 316 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 222 | 317 | ||
| 223 | 318 | } | |
| 224 | 319 | ||
| 320 | + | // Sets the parent and sibling of an accessible object. | |
| 321 | + | // | |
| 322 | + | // This function is meant to be used by accessible implementations that are | |
| 323 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 324 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 325 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 326 | + | // interface, you will use this function to ensure that the parent of each | |
| 327 | + | // child widget is the metadata object, and the parent of each metadata | |
| 328 | + | // object is the container widget. | |
| 329 | + | func (x *Clamp) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 330 | + | ||
| 331 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 335 | + | // Updates the next accessible sibling. | |
| 336 | + | // | |
| 337 | + | // That might be useful when a new child of a custom accessible | |
| 338 | + | // is created, and it needs to be linked to a previous child. | |
| 339 | + | func (x *Clamp) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 340 | + | ||
| 341 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 342 | + | ||
| 343 | + | } | |
| 344 | + | ||
| 345 | + | // Informs ATs that the platform state has changed. | |
| 346 | + | // | |
| 347 | + | // This function should be used by `GtkAccessible` implementations that | |
| 348 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 349 | + | // states automatically. | |
| 350 | + | func (x *Clamp) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 351 | + | ||
| 352 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 353 | + | ||
| 354 | + | } | |
| 355 | + | ||
| 225 | 356 | // Updates a list of accessible properties. | |
| 226 | 357 | // | |
| 227 | 358 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -264,7 +395,7 @@ func (x *Clamp) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Acce | |||
| 264 | 395 | // relation change must be communicated to assistive technologies. | |
| 265 | 396 | // | |
| 266 | 397 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 267 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 398 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 268 | 399 | // | |
| 269 | 400 | // ```c | |
| 270 | 401 | // gtk_accessible_update_relation (accessible, | |
| @@ -294,13 +425,17 @@ func (x *Clamp) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Access | |||
| 294 | 425 | ||
| 295 | 426 | } | |
| 296 | 427 | ||
| 297 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 298 | - | // documentation for the value types of accessible states. | |
| 428 | + | // Updates a list of accessible states. | |
| 299 | 429 | // | |
| 300 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 301 | - | // state change must be communicated to assistive technologies. | |
| 430 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 431 | + | // value types of accessible states. | |
| 432 | + | // | |
| 433 | + | // This function should be called by `GtkWidget` types whenever | |
| 434 | + | // an accessible state change must be communicated to assistive | |
| 435 | + | // technologies. | |
| 302 | 436 | // | |
| 303 | 437 | // Example: | |
| 438 | + | // | |
| 304 | 439 | // ```c | |
| 305 | 440 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 306 | 441 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -330,7 +465,7 @@ func (x *Clamp) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState | |||
| 330 | 465 | // Gets the ID of the @buildable object. | |
| 331 | 466 | // | |
| 332 | 467 | // `GtkBuilder` sets the name based on the ID attribute | |
| 333 | - | // of the <object> tag used to construct the @buildable. | |
| 468 | + | // of the `<object>` tag used to construct the @buildable. | |
| 334 | 469 | func (x *Clamp) GetBuildableId() string { | |
| 335 | 470 | ||
| 336 | 471 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-combo-row.go +145 -10
| @@ -369,34 +369,165 @@ func (c *ComboRow) SetGoPointer(ptr uintptr) { | |||
| 369 | 369 | c.Ptr = ptr | |
| 370 | 370 | } | |
| 371 | 371 | ||
| 372 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 372 | + | // Requests the user's screen reader to announce the given message. | |
| 373 | + | // | |
| 374 | + | // This kind of notification is useful for messages that | |
| 375 | + | // either have only a visual representation or that are not | |
| 376 | + | // exposed visually at all, e.g. a notification about a | |
| 377 | + | // successful operation. | |
| 378 | + | // | |
| 379 | + | // Also, by using this API, you can ensure that the message | |
| 380 | + | // does not interrupts the user's current screen reader output. | |
| 381 | + | func (x *ComboRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 382 | + | ||
| 383 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 384 | + | ||
| 385 | + | } | |
| 386 | + | ||
| 387 | + | // Retrieves the accessible parent for an accessible object. | |
| 388 | + | // | |
| 389 | + | // This function returns `NULL` for top level widgets. | |
| 390 | + | func (x *ComboRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 391 | + | var cls *gtk.AccessibleBase | |
| 392 | + | ||
| 393 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 394 | + | ||
| 395 | + | if cret == 0 { | |
| 396 | + | return nil | |
| 397 | + | } | |
| 398 | + | cls = >k.AccessibleBase{} | |
| 399 | + | cls.Ptr = cret | |
| 400 | + | return cls | |
| 401 | + | } | |
| 402 | + | ||
| 403 | + | // Retrieves the accessible role of an accessible object. | |
| 373 | 404 | func (x *ComboRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 374 | 405 | ||
| 375 | 406 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 376 | 407 | return cret | |
| 377 | 408 | } | |
| 378 | 409 | ||
| 379 | - | // Resets the accessible @property to its default value. | |
| 410 | + | // Retrieves the implementation for the given accessible object. | |
| 411 | + | func (x *ComboRow) GetAtContext() *gtk.ATContext { | |
| 412 | + | var cls *gtk.ATContext | |
| 413 | + | ||
| 414 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 415 | + | ||
| 416 | + | if cret == 0 { | |
| 417 | + | return nil | |
| 418 | + | } | |
| 419 | + | cls = >k.ATContext{} | |
| 420 | + | cls.Ptr = cret | |
| 421 | + | return cls | |
| 422 | + | } | |
| 423 | + | ||
| 424 | + | // Queries the coordinates and dimensions of this accessible | |
| 425 | + | // | |
| 426 | + | // This functionality can be overridden by `GtkAccessible` | |
| 427 | + | // implementations, e.g. to get the bounds from an ignored | |
| 428 | + | // child widget. | |
| 429 | + | func (x *ComboRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 430 | + | ||
| 431 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 432 | + | return cret | |
| 433 | + | } | |
| 434 | + | ||
| 435 | + | // Retrieves the first accessible child of an accessible object. | |
| 436 | + | func (x *ComboRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 437 | + | var cls *gtk.AccessibleBase | |
| 438 | + | ||
| 439 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 440 | + | ||
| 441 | + | if cret == 0 { | |
| 442 | + | return nil | |
| 443 | + | } | |
| 444 | + | cls = >k.AccessibleBase{} | |
| 445 | + | cls.Ptr = cret | |
| 446 | + | return cls | |
| 447 | + | } | |
| 448 | + | ||
| 449 | + | // Retrieves the next accessible sibling of an accessible object | |
| 450 | + | func (x *ComboRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 451 | + | var cls *gtk.AccessibleBase | |
| 452 | + | ||
| 453 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 454 | + | ||
| 455 | + | if cret == 0 { | |
| 456 | + | return nil | |
| 457 | + | } | |
| 458 | + | cls = >k.AccessibleBase{} | |
| 459 | + | cls.Ptr = cret | |
| 460 | + | return cls | |
| 461 | + | } | |
| 462 | + | ||
| 463 | + | // Queries a platform state, such as focus. | |
| 464 | + | // | |
| 465 | + | // This functionality can be overridden by `GtkAccessible` | |
| 466 | + | // implementations, e.g. to get platform state from an ignored | |
| 467 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 468 | + | func (x *ComboRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 469 | + | ||
| 470 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 471 | + | return cret | |
| 472 | + | } | |
| 473 | + | ||
| 474 | + | // Resets the accessible property to its default value. | |
| 380 | 475 | func (x *ComboRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 381 | 476 | ||
| 382 | 477 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 383 | 478 | ||
| 384 | 479 | } | |
| 385 | 480 | ||
| 386 | - | // Resets the accessible @relation to its default value. | |
| 481 | + | // Resets the accessible relation to its default value. | |
| 387 | 482 | func (x *ComboRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 388 | 483 | ||
| 389 | 484 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 390 | 485 | ||
| 391 | 486 | } | |
| 392 | 487 | ||
| 393 | - | // Resets the accessible @state to its default value. | |
| 488 | + | // Resets the accessible state to its default value. | |
| 394 | 489 | func (x *ComboRow) ResetState(StateVar gtk.AccessibleState) { | |
| 395 | 490 | ||
| 396 | 491 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 397 | 492 | ||
| 398 | 493 | } | |
| 399 | 494 | ||
| 495 | + | // Sets the parent and sibling of an accessible object. | |
| 496 | + | // | |
| 497 | + | // This function is meant to be used by accessible implementations that are | |
| 498 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 499 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 500 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 501 | + | // interface, you will use this function to ensure that the parent of each | |
| 502 | + | // child widget is the metadata object, and the parent of each metadata | |
| 503 | + | // object is the container widget. | |
| 504 | + | func (x *ComboRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 505 | + | ||
| 506 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 507 | + | ||
| 508 | + | } | |
| 509 | + | ||
| 510 | + | // Updates the next accessible sibling. | |
| 511 | + | // | |
| 512 | + | // That might be useful when a new child of a custom accessible | |
| 513 | + | // is created, and it needs to be linked to a previous child. | |
| 514 | + | func (x *ComboRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 515 | + | ||
| 516 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 517 | + | ||
| 518 | + | } | |
| 519 | + | ||
| 520 | + | // Informs ATs that the platform state has changed. | |
| 521 | + | // | |
| 522 | + | // This function should be used by `GtkAccessible` implementations that | |
| 523 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 524 | + | // states automatically. | |
| 525 | + | func (x *ComboRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 526 | + | ||
| 527 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 528 | + | ||
| 529 | + | } | |
| 530 | + | ||
| 400 | 531 | // Updates a list of accessible properties. | |
| 401 | 532 | // | |
| 402 | 533 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -439,7 +570,7 @@ func (x *ComboRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.A | |||
| 439 | 570 | // relation change must be communicated to assistive technologies. | |
| 440 | 571 | // | |
| 441 | 572 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 442 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 573 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 443 | 574 | // | |
| 444 | 575 | // ```c | |
| 445 | 576 | // gtk_accessible_update_relation (accessible, | |
| @@ -469,13 +600,17 @@ func (x *ComboRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acc | |||
| 469 | 600 | ||
| 470 | 601 | } | |
| 471 | 602 | ||
| 472 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 473 | - | // documentation for the value types of accessible states. | |
| 603 | + | // Updates a list of accessible states. | |
| 474 | 604 | // | |
| 475 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 476 | - | // state change must be communicated to assistive technologies. | |
| 605 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 606 | + | // value types of accessible states. | |
| 607 | + | // | |
| 608 | + | // This function should be called by `GtkWidget` types whenever | |
| 609 | + | // an accessible state change must be communicated to assistive | |
| 610 | + | // technologies. | |
| 477 | 611 | // | |
| 478 | 612 | // Example: | |
| 613 | + | // | |
| 479 | 614 | // ```c | |
| 480 | 615 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 481 | 616 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -588,7 +723,7 @@ func (x *ComboRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 588 | 723 | // Gets the ID of the @buildable object. | |
| 589 | 724 | // | |
| 590 | 725 | // `GtkBuilder` sets the name based on the ID attribute | |
| 591 | - | // of the <object> tag used to construct the @buildable. | |
| 726 | + | // of the `<object>` tag used to construct the @buildable. | |
| 592 | 727 | func (x *ComboRow) GetBuildableId() string { | |
| 593 | 728 | ||
| 594 | 729 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-dialog.go +145 -10
| @@ -536,34 +536,165 @@ func (x *Dialog) ConnectClosed(cb *func(Dialog)) uint32 { | |||
| 536 | 536 | return gobject.SignalConnect(x.GoPointer(), "closed", cbRefPtr) | |
| 537 | 537 | } | |
| 538 | 538 | ||
| 539 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 539 | + | // Requests the user's screen reader to announce the given message. | |
| 540 | + | // | |
| 541 | + | // This kind of notification is useful for messages that | |
| 542 | + | // either have only a visual representation or that are not | |
| 543 | + | // exposed visually at all, e.g. a notification about a | |
| 544 | + | // successful operation. | |
| 545 | + | // | |
| 546 | + | // Also, by using this API, you can ensure that the message | |
| 547 | + | // does not interrupts the user's current screen reader output. | |
| 548 | + | func (x *Dialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 549 | + | ||
| 550 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 551 | + | ||
| 552 | + | } | |
| 553 | + | ||
| 554 | + | // Retrieves the accessible parent for an accessible object. | |
| 555 | + | // | |
| 556 | + | // This function returns `NULL` for top level widgets. | |
| 557 | + | func (x *Dialog) GetAccessibleParent() *gtk.AccessibleBase { | |
| 558 | + | var cls *gtk.AccessibleBase | |
| 559 | + | ||
| 560 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 561 | + | ||
| 562 | + | if cret == 0 { | |
| 563 | + | return nil | |
| 564 | + | } | |
| 565 | + | cls = >k.AccessibleBase{} | |
| 566 | + | cls.Ptr = cret | |
| 567 | + | return cls | |
| 568 | + | } | |
| 569 | + | ||
| 570 | + | // Retrieves the accessible role of an accessible object. | |
| 540 | 571 | func (x *Dialog) GetAccessibleRole() gtk.AccessibleRole { | |
| 541 | 572 | ||
| 542 | 573 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 543 | 574 | return cret | |
| 544 | 575 | } | |
| 545 | 576 | ||
| 546 | - | // Resets the accessible @property to its default value. | |
| 577 | + | // Retrieves the implementation for the given accessible object. | |
| 578 | + | func (x *Dialog) GetAtContext() *gtk.ATContext { | |
| 579 | + | var cls *gtk.ATContext | |
| 580 | + | ||
| 581 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 582 | + | ||
| 583 | + | if cret == 0 { | |
| 584 | + | return nil | |
| 585 | + | } | |
| 586 | + | cls = >k.ATContext{} | |
| 587 | + | cls.Ptr = cret | |
| 588 | + | return cls | |
| 589 | + | } | |
| 590 | + | ||
| 591 | + | // Queries the coordinates and dimensions of this accessible | |
| 592 | + | // | |
| 593 | + | // This functionality can be overridden by `GtkAccessible` | |
| 594 | + | // implementations, e.g. to get the bounds from an ignored | |
| 595 | + | // child widget. | |
| 596 | + | func (x *Dialog) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 597 | + | ||
| 598 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 599 | + | return cret | |
| 600 | + | } | |
| 601 | + | ||
| 602 | + | // Retrieves the first accessible child of an accessible object. | |
| 603 | + | func (x *Dialog) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 604 | + | var cls *gtk.AccessibleBase | |
| 605 | + | ||
| 606 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 607 | + | ||
| 608 | + | if cret == 0 { | |
| 609 | + | return nil | |
| 610 | + | } | |
| 611 | + | cls = >k.AccessibleBase{} | |
| 612 | + | cls.Ptr = cret | |
| 613 | + | return cls | |
| 614 | + | } | |
| 615 | + | ||
| 616 | + | // Retrieves the next accessible sibling of an accessible object | |
| 617 | + | func (x *Dialog) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 618 | + | var cls *gtk.AccessibleBase | |
| 619 | + | ||
| 620 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 621 | + | ||
| 622 | + | if cret == 0 { | |
| 623 | + | return nil | |
| 624 | + | } | |
| 625 | + | cls = >k.AccessibleBase{} | |
| 626 | + | cls.Ptr = cret | |
| 627 | + | return cls | |
| 628 | + | } | |
| 629 | + | ||
| 630 | + | // Queries a platform state, such as focus. | |
| 631 | + | // | |
| 632 | + | // This functionality can be overridden by `GtkAccessible` | |
| 633 | + | // implementations, e.g. to get platform state from an ignored | |
| 634 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 635 | + | func (x *Dialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 636 | + | ||
| 637 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 638 | + | return cret | |
| 639 | + | } | |
| 640 | + | ||
| 641 | + | // Resets the accessible property to its default value. | |
| 547 | 642 | func (x *Dialog) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 548 | 643 | ||
| 549 | 644 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 550 | 645 | ||
| 551 | 646 | } | |
| 552 | 647 | ||
| 553 | - | // Resets the accessible @relation to its default value. | |
| 648 | + | // Resets the accessible relation to its default value. | |
| 554 | 649 | func (x *Dialog) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 555 | 650 | ||
| 556 | 651 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 557 | 652 | ||
| 558 | 653 | } | |
| 559 | 654 | ||
| 560 | - | // Resets the accessible @state to its default value. | |
| 655 | + | // Resets the accessible state to its default value. | |
| 561 | 656 | func (x *Dialog) ResetState(StateVar gtk.AccessibleState) { | |
| 562 | 657 | ||
| 563 | 658 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 564 | 659 | ||
| 565 | 660 | } | |
| 566 | 661 | ||
| 662 | + | // Sets the parent and sibling of an accessible object. | |
| 663 | + | // | |
| 664 | + | // This function is meant to be used by accessible implementations that are | |
| 665 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 666 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 667 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 668 | + | // interface, you will use this function to ensure that the parent of each | |
| 669 | + | // child widget is the metadata object, and the parent of each metadata | |
| 670 | + | // object is the container widget. | |
| 671 | + | func (x *Dialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 672 | + | ||
| 673 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 674 | + | ||
| 675 | + | } | |
| 676 | + | ||
| 677 | + | // Updates the next accessible sibling. | |
| 678 | + | // | |
| 679 | + | // That might be useful when a new child of a custom accessible | |
| 680 | + | // is created, and it needs to be linked to a previous child. | |
| 681 | + | func (x *Dialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 682 | + | ||
| 683 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 684 | + | ||
| 685 | + | } | |
| 686 | + | ||
| 687 | + | // Informs ATs that the platform state has changed. | |
| 688 | + | // | |
| 689 | + | // This function should be used by `GtkAccessible` implementations that | |
| 690 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 691 | + | // states automatically. | |
| 692 | + | func (x *Dialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 693 | + | ||
| 694 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 695 | + | ||
| 696 | + | } | |
| 697 | + | ||
| 567 | 698 | // Updates a list of accessible properties. | |
| 568 | 699 | // | |
| 569 | 700 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -606,7 +737,7 @@ func (x *Dialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Acc | |||
| 606 | 737 | // relation change must be communicated to assistive technologies. | |
| 607 | 738 | // | |
| 608 | 739 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 609 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 740 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 610 | 741 | // | |
| 611 | 742 | // ```c | |
| 612 | 743 | // gtk_accessible_update_relation (accessible, | |
| @@ -636,13 +767,17 @@ func (x *Dialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acces | |||
| 636 | 767 | ||
| 637 | 768 | } | |
| 638 | 769 | ||
| 639 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 640 | - | // documentation for the value types of accessible states. | |
| 770 | + | // Updates a list of accessible states. | |
| 641 | 771 | // | |
| 642 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 643 | - | // state change must be communicated to assistive technologies. | |
| 772 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 773 | + | // value types of accessible states. | |
| 774 | + | // | |
| 775 | + | // This function should be called by `GtkWidget` types whenever | |
| 776 | + | // an accessible state change must be communicated to assistive | |
| 777 | + | // technologies. | |
| 644 | 778 | // | |
| 645 | 779 | // Example: | |
| 780 | + | // | |
| 646 | 781 | // ```c | |
| 647 | 782 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 648 | 783 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -672,7 +807,7 @@ func (x *Dialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleStat | |||
| 672 | 807 | // Gets the ID of the @buildable object. | |
| 673 | 808 | // | |
| 674 | 809 | // `GtkBuilder` sets the name based on the ID attribute | |
| 675 | - | // of the <object> tag used to construct the @buildable. | |
| 810 | + | // of the `<object>` tag used to construct the @buildable. | |
| 676 | 811 | func (x *Dialog) GetBuildableId() string { | |
| 677 | 812 | ||
| 678 | 813 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-easing.go +17 -0
| @@ -98,6 +98,23 @@ const ( | |||
| 98 | 98 | // with bounce on both ends, combining `ADW_EASE_IN_BOUNCE` and | |
| 99 | 99 | // `ADW_EASE_OUT_BOUNCE`. | |
| 100 | 100 | EaseInOutBounceValue Easing = 30 | |
| 101 | + | // Cubic bezier tweening, with control points in (0.25, 0.1) and (0.25, 1.0). | |
| 102 | + | // | |
| 103 | + | // Increases in velocity towards the middle of the animation, slowing back down | |
| 104 | + | // at the end. | |
| 105 | + | EaseValue Easing = 31 | |
| 106 | + | // Cubic bezier tweening, with control points in (0.42, 0.0) and (1.0, 1.0). | |
| 107 | + | // | |
| 108 | + | // Starts off slowly, with the speed of the animation increasing until complete. | |
| 109 | + | EaseInValue Easing = 32 | |
| 110 | + | // Cubic bezier tweening, with control points in (0.0, 0.0) and (0.58, 1.0). | |
| 111 | + | // | |
| 112 | + | // Starts quickly, slowing down the animation until complete. | |
| 113 | + | EaseOutValue Easing = 33 | |
| 114 | + | // Cubic bezier tweening, with control points in (0.42, 0.0) and (0.58, 1.0). | |
| 115 | + | // | |
| 116 | + | // Starts off slowly, speeds up in the middle, and then slows down again. | |
| 117 | + | EaseInOutValue Easing = 34 | |
| 101 | 118 | ) | |
| 102 | 119 | ||
| 103 | 120 | var xEasingEase func(Easing, float64) float64 | |
M v4/adw/adw-entry-row.go +187 -10
| @@ -338,34 +338,165 @@ func (x *EntryRow) ConnectEntryActivated(cb *func(EntryRow)) uint32 { | |||
| 338 | 338 | return gobject.SignalConnect(x.GoPointer(), "entry-activated", cbRefPtr) | |
| 339 | 339 | } | |
| 340 | 340 | ||
| 341 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 341 | + | // Requests the user's screen reader to announce the given message. | |
| 342 | + | // | |
| 343 | + | // This kind of notification is useful for messages that | |
| 344 | + | // either have only a visual representation or that are not | |
| 345 | + | // exposed visually at all, e.g. a notification about a | |
| 346 | + | // successful operation. | |
| 347 | + | // | |
| 348 | + | // Also, by using this API, you can ensure that the message | |
| 349 | + | // does not interrupts the user's current screen reader output. | |
| 350 | + | func (x *EntryRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 351 | + | ||
| 352 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 353 | + | ||
| 354 | + | } | |
| 355 | + | ||
| 356 | + | // Retrieves the accessible parent for an accessible object. | |
| 357 | + | // | |
| 358 | + | // This function returns `NULL` for top level widgets. | |
| 359 | + | func (x *EntryRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 360 | + | var cls *gtk.AccessibleBase | |
| 361 | + | ||
| 362 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 363 | + | ||
| 364 | + | if cret == 0 { | |
| 365 | + | return nil | |
| 366 | + | } | |
| 367 | + | cls = >k.AccessibleBase{} | |
| 368 | + | cls.Ptr = cret | |
| 369 | + | return cls | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | // Retrieves the accessible role of an accessible object. | |
| 342 | 373 | func (x *EntryRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 343 | 374 | ||
| 344 | 375 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 345 | 376 | return cret | |
| 346 | 377 | } | |
| 347 | 378 | ||
| 348 | - | // Resets the accessible @property to its default value. | |
| 379 | + | // Retrieves the implementation for the given accessible object. | |
| 380 | + | func (x *EntryRow) GetAtContext() *gtk.ATContext { | |
| 381 | + | var cls *gtk.ATContext | |
| 382 | + | ||
| 383 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 384 | + | ||
| 385 | + | if cret == 0 { | |
| 386 | + | return nil | |
| 387 | + | } | |
| 388 | + | cls = >k.ATContext{} | |
| 389 | + | cls.Ptr = cret | |
| 390 | + | return cls | |
| 391 | + | } | |
| 392 | + | ||
| 393 | + | // Queries the coordinates and dimensions of this accessible | |
| 394 | + | // | |
| 395 | + | // This functionality can be overridden by `GtkAccessible` | |
| 396 | + | // implementations, e.g. to get the bounds from an ignored | |
| 397 | + | // child widget. | |
| 398 | + | func (x *EntryRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 399 | + | ||
| 400 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 401 | + | return cret | |
| 402 | + | } | |
| 403 | + | ||
| 404 | + | // Retrieves the first accessible child of an accessible object. | |
| 405 | + | func (x *EntryRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 406 | + | var cls *gtk.AccessibleBase | |
| 407 | + | ||
| 408 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 409 | + | ||
| 410 | + | if cret == 0 { | |
| 411 | + | return nil | |
| 412 | + | } | |
| 413 | + | cls = >k.AccessibleBase{} | |
| 414 | + | cls.Ptr = cret | |
| 415 | + | return cls | |
| 416 | + | } | |
| 417 | + | ||
| 418 | + | // Retrieves the next accessible sibling of an accessible object | |
| 419 | + | func (x *EntryRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 420 | + | var cls *gtk.AccessibleBase | |
| 421 | + | ||
| 422 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 423 | + | ||
| 424 | + | if cret == 0 { | |
| 425 | + | return nil | |
| 426 | + | } | |
| 427 | + | cls = >k.AccessibleBase{} | |
| 428 | + | cls.Ptr = cret | |
| 429 | + | return cls | |
| 430 | + | } | |
| 431 | + | ||
| 432 | + | // Queries a platform state, such as focus. | |
| 433 | + | // | |
| 434 | + | // This functionality can be overridden by `GtkAccessible` | |
| 435 | + | // implementations, e.g. to get platform state from an ignored | |
| 436 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 437 | + | func (x *EntryRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 438 | + | ||
| 439 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 440 | + | return cret | |
| 441 | + | } | |
| 442 | + | ||
| 443 | + | // Resets the accessible property to its default value. | |
| 349 | 444 | func (x *EntryRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 350 | 445 | ||
| 351 | 446 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 352 | 447 | ||
| 353 | 448 | } | |
| 354 | 449 | ||
| 355 | - | // Resets the accessible @relation to its default value. | |
| 450 | + | // Resets the accessible relation to its default value. | |
| 356 | 451 | func (x *EntryRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 357 | 452 | ||
| 358 | 453 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 359 | 454 | ||
| 360 | 455 | } | |
| 361 | 456 | ||
| 362 | - | // Resets the accessible @state to its default value. | |
| 457 | + | // Resets the accessible state to its default value. | |
| 363 | 458 | func (x *EntryRow) ResetState(StateVar gtk.AccessibleState) { | |
| 364 | 459 | ||
| 365 | 460 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 366 | 461 | ||
| 367 | 462 | } | |
| 368 | 463 | ||
| 464 | + | // Sets the parent and sibling of an accessible object. | |
| 465 | + | // | |
| 466 | + | // This function is meant to be used by accessible implementations that are | |
| 467 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 468 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 469 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 470 | + | // interface, you will use this function to ensure that the parent of each | |
| 471 | + | // child widget is the metadata object, and the parent of each metadata | |
| 472 | + | // object is the container widget. | |
| 473 | + | func (x *EntryRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 474 | + | ||
| 475 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 476 | + | ||
| 477 | + | } | |
| 478 | + | ||
| 479 | + | // Updates the next accessible sibling. | |
| 480 | + | // | |
| 481 | + | // That might be useful when a new child of a custom accessible | |
| 482 | + | // is created, and it needs to be linked to a previous child. | |
| 483 | + | func (x *EntryRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 484 | + | ||
| 485 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 486 | + | ||
| 487 | + | } | |
| 488 | + | ||
| 489 | + | // Informs ATs that the platform state has changed. | |
| 490 | + | // | |
| 491 | + | // This function should be used by `GtkAccessible` implementations that | |
| 492 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 493 | + | // states automatically. | |
| 494 | + | func (x *EntryRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 495 | + | ||
| 496 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 497 | + | ||
| 498 | + | } | |
| 499 | + | ||
| 369 | 500 | // Updates a list of accessible properties. | |
| 370 | 501 | // | |
| 371 | 502 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -408,7 +539,7 @@ func (x *EntryRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.A | |||
| 408 | 539 | // relation change must be communicated to assistive technologies. | |
| 409 | 540 | // | |
| 410 | 541 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 411 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 542 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 412 | 543 | // | |
| 413 | 544 | // ```c | |
| 414 | 545 | // gtk_accessible_update_relation (accessible, | |
| @@ -438,13 +569,17 @@ func (x *EntryRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acc | |||
| 438 | 569 | ||
| 439 | 570 | } | |
| 440 | 571 | ||
| 441 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 442 | - | // documentation for the value types of accessible states. | |
| 572 | + | // Updates a list of accessible states. | |
| 443 | 573 | // | |
| 444 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 445 | - | // state change must be communicated to assistive technologies. | |
| 574 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 575 | + | // value types of accessible states. | |
| 576 | + | // | |
| 577 | + | // This function should be called by `GtkWidget` types whenever | |
| 578 | + | // an accessible state change must be communicated to assistive | |
| 579 | + | // technologies. | |
| 446 | 580 | // | |
| 447 | 581 | // Example: | |
| 582 | + | // | |
| 448 | 583 | // ```c | |
| 449 | 584 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 450 | 585 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -557,13 +692,55 @@ func (x *EntryRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 557 | 692 | // Gets the ID of the @buildable object. | |
| 558 | 693 | // | |
| 559 | 694 | // `GtkBuilder` sets the name based on the ID attribute | |
| 560 | - | // of the <object> tag used to construct the @buildable. | |
| 695 | + | // of the `<object>` tag used to construct the @buildable. | |
| 561 | 696 | func (x *EntryRow) GetBuildableId() string { | |
| 562 | 697 | ||
| 563 | 698 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 564 | 699 | return cret | |
| 565 | 700 | } | |
| 566 | 701 | ||
| 702 | + | // Retrieves the accessible platform state from the editable delegate. | |
| 703 | + | // | |
| 704 | + | // This is an helper function to retrieve the accessible state for | |
| 705 | + | // `GtkEditable` interface implementations using a delegate pattern. | |
| 706 | + | // | |
| 707 | + | // You should call this function in your editable widget implementation | |
| 708 | + | // of the [vfunc@Gtk.Accessible.get_platform_state] virtual function, for | |
| 709 | + | // instance: | |
| 710 | + | // | |
| 711 | + | // ```c | |
| 712 | + | // static void | |
| 713 | + | // accessible_interface_init (GtkAccessibleInterface *iface) | |
| 714 | + | // | |
| 715 | + | // { | |
| 716 | + | // iface->get_platform_state = your_editable_get_accessible_platform_state; | |
| 717 | + | // } | |
| 718 | + | // | |
| 719 | + | // static gboolean | |
| 720 | + | // your_editable_get_accessible_platform_state (GtkAccessible *accessible, | |
| 721 | + | // | |
| 722 | + | // GtkAccessiblePlatformState state) | |
| 723 | + | // | |
| 724 | + | // { | |
| 725 | + | // return gtk_editable_delegate_get_accessible_platform_state (GTK_EDITABLE (accessible), state); | |
| 726 | + | // } | |
| 727 | + | // | |
| 728 | + | // ``` | |
| 729 | + | // | |
| 730 | + | // Note that the widget which is the delegate *must* be a direct child of | |
| 731 | + | // this widget, otherwise your implementation of [vfunc@Gtk.Accessible.get_platform_state] | |
| 732 | + | // might not even be called, as the platform change will originate from | |
| 733 | + | // the parent of the delegate, and, as a result, will not work properly. | |
| 734 | + | // | |
| 735 | + | // So, if you can't ensure the direct child condition, you should give the | |
| 736 | + | // delegate the %GTK_ACCESSIBLE_ROLE_TEXT_BOX role, or you can | |
| 737 | + | // change your tree to allow this function to work. | |
| 738 | + | func (x *EntryRow) DelegateGetAccessiblePlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 739 | + | ||
| 740 | + | cret := gtk.XGtkEditableDelegateGetAccessiblePlatformState(x.GoPointer(), StateVar) | |
| 741 | + | return cret | |
| 742 | + | } | |
| 743 | + | ||
| 567 | 744 | // Deletes the currently selected text of the editable. | |
| 568 | 745 | // | |
| 569 | 746 | // This call doesn’t do anything if there is no selected text. | |
M v4/adw/adw-expander-row.go +145 -10
| @@ -292,34 +292,165 @@ func (c *ExpanderRow) SetGoPointer(ptr uintptr) { | |||
| 292 | 292 | c.Ptr = ptr | |
| 293 | 293 | } | |
| 294 | 294 | ||
| 295 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 295 | + | // Requests the user's screen reader to announce the given message. | |
| 296 | + | // | |
| 297 | + | // This kind of notification is useful for messages that | |
| 298 | + | // either have only a visual representation or that are not | |
| 299 | + | // exposed visually at all, e.g. a notification about a | |
| 300 | + | // successful operation. | |
| 301 | + | // | |
| 302 | + | // Also, by using this API, you can ensure that the message | |
| 303 | + | // does not interrupts the user's current screen reader output. | |
| 304 | + | func (x *ExpanderRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 305 | + | ||
| 306 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 307 | + | ||
| 308 | + | } | |
| 309 | + | ||
| 310 | + | // Retrieves the accessible parent for an accessible object. | |
| 311 | + | // | |
| 312 | + | // This function returns `NULL` for top level widgets. | |
| 313 | + | func (x *ExpanderRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 314 | + | var cls *gtk.AccessibleBase | |
| 315 | + | ||
| 316 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 317 | + | ||
| 318 | + | if cret == 0 { | |
| 319 | + | return nil | |
| 320 | + | } | |
| 321 | + | cls = >k.AccessibleBase{} | |
| 322 | + | cls.Ptr = cret | |
| 323 | + | return cls | |
| 324 | + | } | |
| 325 | + | ||
| 326 | + | // Retrieves the accessible role of an accessible object. | |
| 296 | 327 | func (x *ExpanderRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 297 | 328 | ||
| 298 | 329 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 299 | 330 | return cret | |
| 300 | 331 | } | |
| 301 | 332 | ||
| 302 | - | // Resets the accessible @property to its default value. | |
| 333 | + | // Retrieves the implementation for the given accessible object. | |
| 334 | + | func (x *ExpanderRow) GetAtContext() *gtk.ATContext { | |
| 335 | + | var cls *gtk.ATContext | |
| 336 | + | ||
| 337 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 338 | + | ||
| 339 | + | if cret == 0 { | |
| 340 | + | return nil | |
| 341 | + | } | |
| 342 | + | cls = >k.ATContext{} | |
| 343 | + | cls.Ptr = cret | |
| 344 | + | return cls | |
| 345 | + | } | |
| 346 | + | ||
| 347 | + | // Queries the coordinates and dimensions of this accessible | |
| 348 | + | // | |
| 349 | + | // This functionality can be overridden by `GtkAccessible` | |
| 350 | + | // implementations, e.g. to get the bounds from an ignored | |
| 351 | + | // child widget. | |
| 352 | + | func (x *ExpanderRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 353 | + | ||
| 354 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 355 | + | return cret | |
| 356 | + | } | |
| 357 | + | ||
| 358 | + | // Retrieves the first accessible child of an accessible object. | |
| 359 | + | func (x *ExpanderRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 360 | + | var cls *gtk.AccessibleBase | |
| 361 | + | ||
| 362 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 363 | + | ||
| 364 | + | if cret == 0 { | |
| 365 | + | return nil | |
| 366 | + | } | |
| 367 | + | cls = >k.AccessibleBase{} | |
| 368 | + | cls.Ptr = cret | |
| 369 | + | return cls | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | // Retrieves the next accessible sibling of an accessible object | |
| 373 | + | func (x *ExpanderRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 374 | + | var cls *gtk.AccessibleBase | |
| 375 | + | ||
| 376 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 377 | + | ||
| 378 | + | if cret == 0 { | |
| 379 | + | return nil | |
| 380 | + | } | |
| 381 | + | cls = >k.AccessibleBase{} | |
| 382 | + | cls.Ptr = cret | |
| 383 | + | return cls | |
| 384 | + | } | |
| 385 | + | ||
| 386 | + | // Queries a platform state, such as focus. | |
| 387 | + | // | |
| 388 | + | // This functionality can be overridden by `GtkAccessible` | |
| 389 | + | // implementations, e.g. to get platform state from an ignored | |
| 390 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 391 | + | func (x *ExpanderRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 392 | + | ||
| 393 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 394 | + | return cret | |
| 395 | + | } | |
| 396 | + | ||
| 397 | + | // Resets the accessible property to its default value. | |
| 303 | 398 | func (x *ExpanderRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 304 | 399 | ||
| 305 | 400 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 306 | 401 | ||
| 307 | 402 | } | |
| 308 | 403 | ||
| 309 | - | // Resets the accessible @relation to its default value. | |
| 404 | + | // Resets the accessible relation to its default value. | |
| 310 | 405 | func (x *ExpanderRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 311 | 406 | ||
| 312 | 407 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 313 | 408 | ||
| 314 | 409 | } | |
| 315 | 410 | ||
| 316 | - | // Resets the accessible @state to its default value. | |
| 411 | + | // Resets the accessible state to its default value. | |
| 317 | 412 | func (x *ExpanderRow) ResetState(StateVar gtk.AccessibleState) { | |
| 318 | 413 | ||
| 319 | 414 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 320 | 415 | ||
| 321 | 416 | } | |
| 322 | 417 | ||
| 418 | + | // Sets the parent and sibling of an accessible object. | |
| 419 | + | // | |
| 420 | + | // This function is meant to be used by accessible implementations that are | |
| 421 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 422 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 423 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 424 | + | // interface, you will use this function to ensure that the parent of each | |
| 425 | + | // child widget is the metadata object, and the parent of each metadata | |
| 426 | + | // object is the container widget. | |
| 427 | + | func (x *ExpanderRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 428 | + | ||
| 429 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 430 | + | ||
| 431 | + | } | |
| 432 | + | ||
| 433 | + | // Updates the next accessible sibling. | |
| 434 | + | // | |
| 435 | + | // That might be useful when a new child of a custom accessible | |
| 436 | + | // is created, and it needs to be linked to a previous child. | |
| 437 | + | func (x *ExpanderRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 438 | + | ||
| 439 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 440 | + | ||
| 441 | + | } | |
| 442 | + | ||
| 443 | + | // Informs ATs that the platform state has changed. | |
| 444 | + | // | |
| 445 | + | // This function should be used by `GtkAccessible` implementations that | |
| 446 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 447 | + | // states automatically. | |
| 448 | + | func (x *ExpanderRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 449 | + | ||
| 450 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 451 | + | ||
| 452 | + | } | |
| 453 | + | ||
| 323 | 454 | // Updates a list of accessible properties. | |
| 324 | 455 | // | |
| 325 | 456 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -362,7 +493,7 @@ func (x *ExpanderRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 362 | 493 | // relation change must be communicated to assistive technologies. | |
| 363 | 494 | // | |
| 364 | 495 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 365 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 496 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 366 | 497 | // | |
| 367 | 498 | // ```c | |
| 368 | 499 | // gtk_accessible_update_relation (accessible, | |
| @@ -392,13 +523,17 @@ func (x *ExpanderRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 392 | 523 | ||
| 393 | 524 | } | |
| 394 | 525 | ||
| 395 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 396 | - | // documentation for the value types of accessible states. | |
| 526 | + | // Updates a list of accessible states. | |
| 397 | 527 | // | |
| 398 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 399 | - | // state change must be communicated to assistive technologies. | |
| 528 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 529 | + | // value types of accessible states. | |
| 530 | + | // | |
| 531 | + | // This function should be called by `GtkWidget` types whenever | |
| 532 | + | // an accessible state change must be communicated to assistive | |
| 533 | + | // technologies. | |
| 400 | 534 | // | |
| 401 | 535 | // Example: | |
| 536 | + | // | |
| 402 | 537 | // ```c | |
| 403 | 538 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 404 | 539 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -511,7 +646,7 @@ func (x *ExpanderRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 511 | 646 | // Gets the ID of the @buildable object. | |
| 512 | 647 | // | |
| 513 | 648 | // `GtkBuilder` sets the name based on the ID attribute | |
| 514 | - | // of the <object> tag used to construct the @buildable. | |
| 649 | + | // of the `<object>` tag used to construct the @buildable. | |
| 515 | 650 | func (x *ExpanderRow) GetBuildableId() string { | |
| 516 | 651 | ||
| 517 | 652 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-flap.go +145 -10
| @@ -567,34 +567,165 @@ func (x *Flap) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDragVa | |||
| 567 | 567 | ||
| 568 | 568 | } | |
| 569 | 569 | ||
| 570 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 570 | + | // Requests the user's screen reader to announce the given message. | |
| 571 | + | // | |
| 572 | + | // This kind of notification is useful for messages that | |
| 573 | + | // either have only a visual representation or that are not | |
| 574 | + | // exposed visually at all, e.g. a notification about a | |
| 575 | + | // successful operation. | |
| 576 | + | // | |
| 577 | + | // Also, by using this API, you can ensure that the message | |
| 578 | + | // does not interrupts the user's current screen reader output. | |
| 579 | + | func (x *Flap) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 580 | + | ||
| 581 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 582 | + | ||
| 583 | + | } | |
| 584 | + | ||
| 585 | + | // Retrieves the accessible parent for an accessible object. | |
| 586 | + | // | |
| 587 | + | // This function returns `NULL` for top level widgets. | |
| 588 | + | func (x *Flap) GetAccessibleParent() *gtk.AccessibleBase { | |
| 589 | + | var cls *gtk.AccessibleBase | |
| 590 | + | ||
| 591 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 592 | + | ||
| 593 | + | if cret == 0 { | |
| 594 | + | return nil | |
| 595 | + | } | |
| 596 | + | cls = >k.AccessibleBase{} | |
| 597 | + | cls.Ptr = cret | |
| 598 | + | return cls | |
| 599 | + | } | |
| 600 | + | ||
| 601 | + | // Retrieves the accessible role of an accessible object. | |
| 571 | 602 | func (x *Flap) GetAccessibleRole() gtk.AccessibleRole { | |
| 572 | 603 | ||
| 573 | 604 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 574 | 605 | return cret | |
| 575 | 606 | } | |
| 576 | 607 | ||
| 577 | - | // Resets the accessible @property to its default value. | |
| 608 | + | // Retrieves the implementation for the given accessible object. | |
| 609 | + | func (x *Flap) GetAtContext() *gtk.ATContext { | |
| 610 | + | var cls *gtk.ATContext | |
| 611 | + | ||
| 612 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 613 | + | ||
| 614 | + | if cret == 0 { | |
| 615 | + | return nil | |
| 616 | + | } | |
| 617 | + | cls = >k.ATContext{} | |
| 618 | + | cls.Ptr = cret | |
| 619 | + | return cls | |
| 620 | + | } | |
| 621 | + | ||
| 622 | + | // Queries the coordinates and dimensions of this accessible | |
| 623 | + | // | |
| 624 | + | // This functionality can be overridden by `GtkAccessible` | |
| 625 | + | // implementations, e.g. to get the bounds from an ignored | |
| 626 | + | // child widget. | |
| 627 | + | func (x *Flap) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 628 | + | ||
| 629 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 630 | + | return cret | |
| 631 | + | } | |
| 632 | + | ||
| 633 | + | // Retrieves the first accessible child of an accessible object. | |
| 634 | + | func (x *Flap) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 635 | + | var cls *gtk.AccessibleBase | |
| 636 | + | ||
| 637 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 638 | + | ||
| 639 | + | if cret == 0 { | |
| 640 | + | return nil | |
| 641 | + | } | |
| 642 | + | cls = >k.AccessibleBase{} | |
| 643 | + | cls.Ptr = cret | |
| 644 | + | return cls | |
| 645 | + | } | |
| 646 | + | ||
| 647 | + | // Retrieves the next accessible sibling of an accessible object | |
| 648 | + | func (x *Flap) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 649 | + | var cls *gtk.AccessibleBase | |
| 650 | + | ||
| 651 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 652 | + | ||
| 653 | + | if cret == 0 { | |
| 654 | + | return nil | |
| 655 | + | } | |
| 656 | + | cls = >k.AccessibleBase{} | |
| 657 | + | cls.Ptr = cret | |
| 658 | + | return cls | |
| 659 | + | } | |
| 660 | + | ||
| 661 | + | // Queries a platform state, such as focus. | |
| 662 | + | // | |
| 663 | + | // This functionality can be overridden by `GtkAccessible` | |
| 664 | + | // implementations, e.g. to get platform state from an ignored | |
| 665 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 666 | + | func (x *Flap) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 667 | + | ||
| 668 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 669 | + | return cret | |
| 670 | + | } | |
| 671 | + | ||
| 672 | + | // Resets the accessible property to its default value. | |
| 578 | 673 | func (x *Flap) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 579 | 674 | ||
| 580 | 675 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 581 | 676 | ||
| 582 | 677 | } | |
| 583 | 678 | ||
| 584 | - | // Resets the accessible @relation to its default value. | |
| 679 | + | // Resets the accessible relation to its default value. | |
| 585 | 680 | func (x *Flap) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 586 | 681 | ||
| 587 | 682 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 588 | 683 | ||
| 589 | 684 | } | |
| 590 | 685 | ||
| 591 | - | // Resets the accessible @state to its default value. | |
| 686 | + | // Resets the accessible state to its default value. | |
| 592 | 687 | func (x *Flap) ResetState(StateVar gtk.AccessibleState) { | |
| 593 | 688 | ||
| 594 | 689 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 595 | 690 | ||
| 596 | 691 | } | |
| 597 | 692 | ||
| 693 | + | // Sets the parent and sibling of an accessible object. | |
| 694 | + | // | |
| 695 | + | // This function is meant to be used by accessible implementations that are | |
| 696 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 697 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 698 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 699 | + | // interface, you will use this function to ensure that the parent of each | |
| 700 | + | // child widget is the metadata object, and the parent of each metadata | |
| 701 | + | // object is the container widget. | |
| 702 | + | func (x *Flap) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 703 | + | ||
| 704 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 705 | + | ||
| 706 | + | } | |
| 707 | + | ||
| 708 | + | // Updates the next accessible sibling. | |
| 709 | + | // | |
| 710 | + | // That might be useful when a new child of a custom accessible | |
| 711 | + | // is created, and it needs to be linked to a previous child. | |
| 712 | + | func (x *Flap) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 713 | + | ||
| 714 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 715 | + | ||
| 716 | + | } | |
| 717 | + | ||
| 718 | + | // Informs ATs that the platform state has changed. | |
| 719 | + | // | |
| 720 | + | // This function should be used by `GtkAccessible` implementations that | |
| 721 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 722 | + | // states automatically. | |
| 723 | + | func (x *Flap) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 724 | + | ||
| 725 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 726 | + | ||
| 727 | + | } | |
| 728 | + | ||
| 598 | 729 | // Updates a list of accessible properties. | |
| 599 | 730 | // | |
| 600 | 731 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -637,7 +768,7 @@ func (x *Flap) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Acces | |||
| 637 | 768 | // relation change must be communicated to assistive technologies. | |
| 638 | 769 | // | |
| 639 | 770 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 640 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 771 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 641 | 772 | // | |
| 642 | 773 | // ```c | |
| 643 | 774 | // gtk_accessible_update_relation (accessible, | |
| @@ -667,13 +798,17 @@ func (x *Flap) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Accessi | |||
| 667 | 798 | ||
| 668 | 799 | } | |
| 669 | 800 | ||
| 670 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 671 | - | // documentation for the value types of accessible states. | |
| 801 | + | // Updates a list of accessible states. | |
| 672 | 802 | // | |
| 673 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 674 | - | // state change must be communicated to assistive technologies. | |
| 803 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 804 | + | // value types of accessible states. | |
| 805 | + | // | |
| 806 | + | // This function should be called by `GtkWidget` types whenever | |
| 807 | + | // an accessible state change must be communicated to assistive | |
| 808 | + | // technologies. | |
| 675 | 809 | // | |
| 676 | 810 | // Example: | |
| 811 | + | // | |
| 677 | 812 | // ```c | |
| 678 | 813 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 679 | 814 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -703,7 +838,7 @@ func (x *Flap) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, | |||
| 703 | 838 | // Gets the ID of the @buildable object. | |
| 704 | 839 | // | |
| 705 | 840 | // `GtkBuilder` sets the name based on the ID attribute | |
| 706 | - | // of the <object> tag used to construct the @buildable. | |
| 841 | + | // of the `<object>` tag used to construct the @buildable. | |
| 707 | 842 | func (x *Flap) GetBuildableId() string { | |
| 708 | 843 | ||
| 709 | 844 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-header-bar.go +145 -10
| @@ -388,34 +388,165 @@ func (c *HeaderBar) SetGoPointer(ptr uintptr) { | |||
| 388 | 388 | c.Ptr = ptr | |
| 389 | 389 | } | |
| 390 | 390 | ||
| 391 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 391 | + | // Requests the user's screen reader to announce the given message. | |
| 392 | + | // | |
| 393 | + | // This kind of notification is useful for messages that | |
| 394 | + | // either have only a visual representation or that are not | |
| 395 | + | // exposed visually at all, e.g. a notification about a | |
| 396 | + | // successful operation. | |
| 397 | + | // | |
| 398 | + | // Also, by using this API, you can ensure that the message | |
| 399 | + | // does not interrupts the user's current screen reader output. | |
| 400 | + | func (x *HeaderBar) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 401 | + | ||
| 402 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 403 | + | ||
| 404 | + | } | |
| 405 | + | ||
| 406 | + | // Retrieves the accessible parent for an accessible object. | |
| 407 | + | // | |
| 408 | + | // This function returns `NULL` for top level widgets. | |
| 409 | + | func (x *HeaderBar) GetAccessibleParent() *gtk.AccessibleBase { | |
| 410 | + | var cls *gtk.AccessibleBase | |
| 411 | + | ||
| 412 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 413 | + | ||
| 414 | + | if cret == 0 { | |
| 415 | + | return nil | |
| 416 | + | } | |
| 417 | + | cls = >k.AccessibleBase{} | |
| 418 | + | cls.Ptr = cret | |
| 419 | + | return cls | |
| 420 | + | } | |
| 421 | + | ||
| 422 | + | // Retrieves the accessible role of an accessible object. | |
| 392 | 423 | func (x *HeaderBar) GetAccessibleRole() gtk.AccessibleRole { | |
| 393 | 424 | ||
| 394 | 425 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 395 | 426 | return cret | |
| 396 | 427 | } | |
| 397 | 428 | ||
| 398 | - | // Resets the accessible @property to its default value. | |
| 429 | + | // Retrieves the implementation for the given accessible object. | |
| 430 | + | func (x *HeaderBar) GetAtContext() *gtk.ATContext { | |
| 431 | + | var cls *gtk.ATContext | |
| 432 | + | ||
| 433 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 434 | + | ||
| 435 | + | if cret == 0 { | |
| 436 | + | return nil | |
| 437 | + | } | |
| 438 | + | cls = >k.ATContext{} | |
| 439 | + | cls.Ptr = cret | |
| 440 | + | return cls | |
| 441 | + | } | |
| 442 | + | ||
| 443 | + | // Queries the coordinates and dimensions of this accessible | |
| 444 | + | // | |
| 445 | + | // This functionality can be overridden by `GtkAccessible` | |
| 446 | + | // implementations, e.g. to get the bounds from an ignored | |
| 447 | + | // child widget. | |
| 448 | + | func (x *HeaderBar) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 449 | + | ||
| 450 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 451 | + | return cret | |
| 452 | + | } | |
| 453 | + | ||
| 454 | + | // Retrieves the first accessible child of an accessible object. | |
| 455 | + | func (x *HeaderBar) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 456 | + | var cls *gtk.AccessibleBase | |
| 457 | + | ||
| 458 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 459 | + | ||
| 460 | + | if cret == 0 { | |
| 461 | + | return nil | |
| 462 | + | } | |
| 463 | + | cls = >k.AccessibleBase{} | |
| 464 | + | cls.Ptr = cret | |
| 465 | + | return cls | |
| 466 | + | } | |
| 467 | + | ||
| 468 | + | // Retrieves the next accessible sibling of an accessible object | |
| 469 | + | func (x *HeaderBar) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 470 | + | var cls *gtk.AccessibleBase | |
| 471 | + | ||
| 472 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 473 | + | ||
| 474 | + | if cret == 0 { | |
| 475 | + | return nil | |
| 476 | + | } | |
| 477 | + | cls = >k.AccessibleBase{} | |
| 478 | + | cls.Ptr = cret | |
| 479 | + | return cls | |
| 480 | + | } | |
| 481 | + | ||
| 482 | + | // Queries a platform state, such as focus. | |
| 483 | + | // | |
| 484 | + | // This functionality can be overridden by `GtkAccessible` | |
| 485 | + | // implementations, e.g. to get platform state from an ignored | |
| 486 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 487 | + | func (x *HeaderBar) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 488 | + | ||
| 489 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 490 | + | return cret | |
| 491 | + | } | |
| 492 | + | ||
| 493 | + | // Resets the accessible property to its default value. | |
| 399 | 494 | func (x *HeaderBar) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 400 | 495 | ||
| 401 | 496 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 402 | 497 | ||
| 403 | 498 | } | |
| 404 | 499 | ||
| 405 | - | // Resets the accessible @relation to its default value. | |
| 500 | + | // Resets the accessible relation to its default value. | |
| 406 | 501 | func (x *HeaderBar) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 407 | 502 | ||
| 408 | 503 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 409 | 504 | ||
| 410 | 505 | } | |
| 411 | 506 | ||
| 412 | - | // Resets the accessible @state to its default value. | |
| 507 | + | // Resets the accessible state to its default value. | |
| 413 | 508 | func (x *HeaderBar) ResetState(StateVar gtk.AccessibleState) { | |
| 414 | 509 | ||
| 415 | 510 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 416 | 511 | ||
| 417 | 512 | } | |
| 418 | 513 | ||
| 514 | + | // Sets the parent and sibling of an accessible object. | |
| 515 | + | // | |
| 516 | + | // This function is meant to be used by accessible implementations that are | |
| 517 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 518 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 519 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 520 | + | // interface, you will use this function to ensure that the parent of each | |
| 521 | + | // child widget is the metadata object, and the parent of each metadata | |
| 522 | + | // object is the container widget. | |
| 523 | + | func (x *HeaderBar) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 524 | + | ||
| 525 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 526 | + | ||
| 527 | + | } | |
| 528 | + | ||
| 529 | + | // Updates the next accessible sibling. | |
| 530 | + | // | |
| 531 | + | // That might be useful when a new child of a custom accessible | |
| 532 | + | // is created, and it needs to be linked to a previous child. | |
| 533 | + | func (x *HeaderBar) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 534 | + | ||
| 535 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 536 | + | ||
| 537 | + | } | |
| 538 | + | ||
| 539 | + | // Informs ATs that the platform state has changed. | |
| 540 | + | // | |
| 541 | + | // This function should be used by `GtkAccessible` implementations that | |
| 542 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 543 | + | // states automatically. | |
| 544 | + | func (x *HeaderBar) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 545 | + | ||
| 546 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 547 | + | ||
| 548 | + | } | |
| 549 | + | ||
| 419 | 550 | // Updates a list of accessible properties. | |
| 420 | 551 | // | |
| 421 | 552 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -458,7 +589,7 @@ func (x *HeaderBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk. | |||
| 458 | 589 | // relation change must be communicated to assistive technologies. | |
| 459 | 590 | // | |
| 460 | 591 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 461 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 592 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 462 | 593 | // | |
| 463 | 594 | // ```c | |
| 464 | 595 | // gtk_accessible_update_relation (accessible, | |
| @@ -488,13 +619,17 @@ func (x *HeaderBar) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Ac | |||
| 488 | 619 | ||
| 489 | 620 | } | |
| 490 | 621 | ||
| 491 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 492 | - | // documentation for the value types of accessible states. | |
| 622 | + | // Updates a list of accessible states. | |
| 493 | 623 | // | |
| 494 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 495 | - | // state change must be communicated to assistive technologies. | |
| 624 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 625 | + | // value types of accessible states. | |
| 626 | + | // | |
| 627 | + | // This function should be called by `GtkWidget` types whenever | |
| 628 | + | // an accessible state change must be communicated to assistive | |
| 629 | + | // technologies. | |
| 496 | 630 | // | |
| 497 | 631 | // Example: | |
| 632 | + | // | |
| 498 | 633 | // ```c | |
| 499 | 634 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 500 | 635 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -524,7 +659,7 @@ func (x *HeaderBar) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleS | |||
| 524 | 659 | // Gets the ID of the @buildable object. | |
| 525 | 660 | // | |
| 526 | 661 | // `GtkBuilder` sets the name based on the ID attribute | |
| 527 | - | // of the <object> tag used to construct the @buildable. | |
| 662 | + | // of the `<object>` tag used to construct the @buildable. | |
| 528 | 663 | func (x *HeaderBar) GetBuildableId() string { | |
| 529 | 664 | ||
| 530 | 665 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
A v4/adw/adw-inline-view-switcher.go +548 -0
| @@ -0,0 +1,548 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 13 | + | ) | |
| 14 | + | ||
| 15 | + | type InlineViewSwitcherClass struct { | |
| 16 | + | _ structs.HostLayout | |
| 17 | + | ||
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | func (x *InlineViewSwitcherClass) GoPointer() uintptr { | |
| 22 | + | return uintptr(unsafe.Pointer(x)) | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | // Describes what [class@InlineViewSwitcher] toggles display. | |
| 26 | + | // | |
| 27 | + | // <picture> | |
| 28 | + | // | |
| 29 | + | // <source srcset="inline-view-switcher-display-modes-dark.png" media="(prefers-color-scheme: dark)"> | |
| 30 | + | // <img src="inline-view-switcher-display-modes.png" alt="inline-view-switcher-display-modes"> | |
| 31 | + | // | |
| 32 | + | // </picture> | |
| 33 | + | type InlineViewSwitcherDisplayMode int | |
| 34 | + | ||
| 35 | + | var xInlineViewSwitcherDisplayModeGLibType func() types.GType | |
| 36 | + | ||
| 37 | + | func InlineViewSwitcherDisplayModeGLibType() types.GType { | |
| 38 | + | return xInlineViewSwitcherDisplayModeGLibType() | |
| 39 | + | } | |
| 40 | + | ||
| 41 | + | const ( | |
| 42 | + | ||
| 43 | + | // Toggles only display labels. | |
| 44 | + | InlineViewSwitcherLabelsValue InlineViewSwitcherDisplayMode = 0 | |
| 45 | + | // Toggles only display icons. | |
| 46 | + | InlineViewSwitcherIconsValue InlineViewSwitcherDisplayMode = 1 | |
| 47 | + | // Toggles display both icons and labels. | |
| 48 | + | InlineViewSwitcherBothValue InlineViewSwitcherDisplayMode = 2 | |
| 49 | + | ) | |
| 50 | + | ||
| 51 | + | // A view switcher that uses a toggle group. | |
| 52 | + | // | |
| 53 | + | // <picture> | |
| 54 | + | // | |
| 55 | + | // <source srcset="inline-view-switcher-dark.png" media="(prefers-color-scheme: dark)"> | |
| 56 | + | // <img src="inline-view-switcher.png" alt="inline-view-switcher"> | |
| 57 | + | // | |
| 58 | + | // </picture> | |
| 59 | + | // | |
| 60 | + | // A view switcher showing pages of an [class@ViewStack] within an | |
| 61 | + | // [class@ToggleGroup], similar to [class@ViewSwitcher]. | |
| 62 | + | // | |
| 63 | + | // The toggles can display either an icon, a label or both. Use the | |
| 64 | + | // [property@InlineViewSwitcher:display-mode] to control this. | |
| 65 | + | // | |
| 66 | + | // <picture> | |
| 67 | + | // | |
| 68 | + | // <source srcset="inline-view-switcher-display-modes-dark.png" media="(prefers-color-scheme: dark)"> | |
| 69 | + | // <img src="inline-view-switcher-display-modes.png" alt="inline-view-switcher-display-modes"> | |
| 70 | + | // | |
| 71 | + | // </picture> | |
| 72 | + | // | |
| 73 | + | // ## CSS nodes | |
| 74 | + | // | |
| 75 | + | // `AdwInlineViewSwitcher` has a single CSS node with the name | |
| 76 | + | // `inline-view-switcher`. | |
| 77 | + | // | |
| 78 | + | // ## Style classes | |
| 79 | + | // | |
| 80 | + | // Like `AdwToggleGroup`, it can accept the [`.flat`](style-classes.html#flat_1) | |
| 81 | + | // and [`.round`](style-classes.html#round) style classes. | |
| 82 | + | // | |
| 83 | + | // <picture> | |
| 84 | + | // | |
| 85 | + | // <source srcset="inline-view-switcher-style-classes-dark.png" media="(prefers-color-scheme: dark)"> | |
| 86 | + | // <img src="inline-view-switcher-style-classes.png" alt="inline-view-switcher-style-classes"> | |
| 87 | + | // | |
| 88 | + | // </picture> | |
| 89 | + | // | |
| 90 | + | // ## Accessibility | |
| 91 | + | // | |
| 92 | + | // The internal toggle group uses the `GTK_ACCESSIBLE_ROLE_TAB_LIST` role. Its | |
| 93 | + | // toggles use the `GTK_ACCESSIBLE_ROLE_TAB` role. | |
| 94 | + | type InlineViewSwitcher struct { | |
| 95 | + | gtk.Widget | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | var xInlineViewSwitcherGLibType func() types.GType | |
| 99 | + | ||
| 100 | + | func InlineViewSwitcherGLibType() types.GType { | |
| 101 | + | return xInlineViewSwitcherGLibType() | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | func InlineViewSwitcherNewFromInternalPtr(ptr uintptr) *InlineViewSwitcher { | |
| 105 | + | cls := &InlineViewSwitcher{} | |
| 106 | + | cls.Ptr = ptr | |
| 107 | + | return cls | |
| 108 | + | } | |
| 109 | + | ||
| 110 | + | var xNewInlineViewSwitcher func() uintptr | |
| 111 | + | ||
| 112 | + | // Creates a new `AdwInlineViewSwitcher`. | |
| 113 | + | func NewInlineViewSwitcher() *InlineViewSwitcher { | |
| 114 | + | var cls *InlineViewSwitcher | |
| 115 | + | ||
| 116 | + | cret := xNewInlineViewSwitcher() | |
| 117 | + | ||
| 118 | + | if cret == 0 { | |
| 119 | + | return nil | |
| 120 | + | } | |
| 121 | + | gobject.IncreaseRef(cret) | |
| 122 | + | cls = &InlineViewSwitcher{} | |
| 123 | + | cls.Ptr = cret | |
| 124 | + | return cls | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | var xInlineViewSwitcherGetCanShrink func(uintptr) bool | |
| 128 | + | ||
| 129 | + | // Gets whether the toggles can be smaller than the natural size of their | |
| 130 | + | // contents. | |
| 131 | + | func (x *InlineViewSwitcher) GetCanShrink() bool { | |
| 132 | + | ||
| 133 | + | cret := xInlineViewSwitcherGetCanShrink(x.GoPointer()) | |
| 134 | + | return cret | |
| 135 | + | } | |
| 136 | + | ||
| 137 | + | var xInlineViewSwitcherGetDisplayMode func(uintptr) InlineViewSwitcherDisplayMode | |
| 138 | + | ||
| 139 | + | // Gets the display mode of @self. | |
| 140 | + | func (x *InlineViewSwitcher) GetDisplayMode() InlineViewSwitcherDisplayMode { | |
| 141 | + | ||
| 142 | + | cret := xInlineViewSwitcherGetDisplayMode(x.GoPointer()) | |
| 143 | + | return cret | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | var xInlineViewSwitcherGetHomogeneous func(uintptr) bool | |
| 147 | + | ||
| 148 | + | // Gets whether all toggles within @self take the same size. | |
| 149 | + | func (x *InlineViewSwitcher) GetHomogeneous() bool { | |
| 150 | + | ||
| 151 | + | cret := xInlineViewSwitcherGetHomogeneous(x.GoPointer()) | |
| 152 | + | return cret | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | var xInlineViewSwitcherGetStack func(uintptr) uintptr | |
| 156 | + | ||
| 157 | + | // Gets the stack @self controls. | |
| 158 | + | func (x *InlineViewSwitcher) GetStack() *ViewStack { | |
| 159 | + | var cls *ViewStack | |
| 160 | + | ||
| 161 | + | cret := xInlineViewSwitcherGetStack(x.GoPointer()) | |
| 162 | + | ||
| 163 | + | if cret == 0 { | |
| 164 | + | return nil | |
| 165 | + | } | |
| 166 | + | gobject.IncreaseRef(cret) | |
| 167 | + | cls = &ViewStack{} | |
| 168 | + | cls.Ptr = cret | |
| 169 | + | return cls | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | var xInlineViewSwitcherSetCanShrink func(uintptr, bool) | |
| 173 | + | ||
| 174 | + | // Sets whether the toggles can be smaller than the natural size of their | |
| 175 | + | // contents. | |
| 176 | + | // | |
| 177 | + | // If @can_shrink is `TRUE`, the toggle labels will ellipsize. | |
| 178 | + | // | |
| 179 | + | // See [property@ToggleGroup:can-shrink]. | |
| 180 | + | func (x *InlineViewSwitcher) SetCanShrink(CanShrinkVar bool) { | |
| 181 | + | ||
| 182 | + | xInlineViewSwitcherSetCanShrink(x.GoPointer(), CanShrinkVar) | |
| 183 | + | ||
| 184 | + | } | |
| 185 | + | ||
| 186 | + | var xInlineViewSwitcherSetDisplayMode func(uintptr, InlineViewSwitcherDisplayMode) | |
| 187 | + | ||
| 188 | + | // Sets the display mode of @self. | |
| 189 | + | // | |
| 190 | + | // Determines what the toggles display: a label, an icon or both. | |
| 191 | + | // | |
| 192 | + | // <picture> | |
| 193 | + | // | |
| 194 | + | // <source srcset="inline-view-switcher-display-modes-dark.png" media="(prefers-color-scheme: dark)"> | |
| 195 | + | // <img src="inline-view-switcher-display-modes.png" alt="inline-view-switcher-display-modes"> | |
| 196 | + | // | |
| 197 | + | // </picture> | |
| 198 | + | func (x *InlineViewSwitcher) SetDisplayMode(ModeVar InlineViewSwitcherDisplayMode) { | |
| 199 | + | ||
| 200 | + | xInlineViewSwitcherSetDisplayMode(x.GoPointer(), ModeVar) | |
| 201 | + | ||
| 202 | + | } | |
| 203 | + | ||
| 204 | + | var xInlineViewSwitcherSetHomogeneous func(uintptr, bool) | |
| 205 | + | ||
| 206 | + | // Sets whether all toggles within @self take the same size. | |
| 207 | + | func (x *InlineViewSwitcher) SetHomogeneous(HomogeneousVar bool) { | |
| 208 | + | ||
| 209 | + | xInlineViewSwitcherSetHomogeneous(x.GoPointer(), HomogeneousVar) | |
| 210 | + | ||
| 211 | + | } | |
| 212 | + | ||
| 213 | + | var xInlineViewSwitcherSetStack func(uintptr, uintptr) | |
| 214 | + | ||
| 215 | + | // Sets the stack to control. | |
| 216 | + | func (x *InlineViewSwitcher) SetStack(StackVar *ViewStack) { | |
| 217 | + | ||
| 218 | + | xInlineViewSwitcherSetStack(x.GoPointer(), StackVar.GoPointer()) | |
| 219 | + | ||
| 220 | + | } | |
| 221 | + | ||
| 222 | + | func (c *InlineViewSwitcher) GoPointer() uintptr { | |
| 223 | + | if c == nil { | |
| 224 | + | return 0 | |
| 225 | + | } | |
| 226 | + | return c.Ptr | |
| 227 | + | } | |
| 228 | + | ||
| 229 | + | func (c *InlineViewSwitcher) SetGoPointer(ptr uintptr) { | |
| 230 | + | c.Ptr = ptr | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // Requests the user's screen reader to announce the given message. | |
| 234 | + | // | |
| 235 | + | // This kind of notification is useful for messages that | |
| 236 | + | // either have only a visual representation or that are not | |
| 237 | + | // exposed visually at all, e.g. a notification about a | |
| 238 | + | // successful operation. | |
| 239 | + | // | |
| 240 | + | // Also, by using this API, you can ensure that the message | |
| 241 | + | // does not interrupts the user's current screen reader output. | |
| 242 | + | func (x *InlineViewSwitcher) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 243 | + | ||
| 244 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 245 | + | ||
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // Retrieves the accessible parent for an accessible object. | |
| 249 | + | // | |
| 250 | + | // This function returns `NULL` for top level widgets. | |
| 251 | + | func (x *InlineViewSwitcher) GetAccessibleParent() *gtk.AccessibleBase { | |
| 252 | + | var cls *gtk.AccessibleBase | |
| 253 | + | ||
| 254 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 255 | + | ||
| 256 | + | if cret == 0 { | |
| 257 | + | return nil | |
| 258 | + | } | |
| 259 | + | cls = >k.AccessibleBase{} | |
| 260 | + | cls.Ptr = cret | |
| 261 | + | return cls | |
| 262 | + | } | |
| 263 | + | ||
| 264 | + | // Retrieves the accessible role of an accessible object. | |
| 265 | + | func (x *InlineViewSwitcher) GetAccessibleRole() gtk.AccessibleRole { | |
| 266 | + | ||
| 267 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 268 | + | return cret | |
| 269 | + | } | |
| 270 | + | ||
| 271 | + | // Retrieves the implementation for the given accessible object. | |
| 272 | + | func (x *InlineViewSwitcher) GetAtContext() *gtk.ATContext { | |
| 273 | + | var cls *gtk.ATContext | |
| 274 | + | ||
| 275 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 276 | + | ||
| 277 | + | if cret == 0 { | |
| 278 | + | return nil | |
| 279 | + | } | |
| 280 | + | cls = >k.ATContext{} | |
| 281 | + | cls.Ptr = cret | |
| 282 | + | return cls | |
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // Queries the coordinates and dimensions of this accessible | |
| 286 | + | // | |
| 287 | + | // This functionality can be overridden by `GtkAccessible` | |
| 288 | + | // implementations, e.g. to get the bounds from an ignored | |
| 289 | + | // child widget. | |
| 290 | + | func (x *InlineViewSwitcher) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 291 | + | ||
| 292 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 293 | + | return cret | |
| 294 | + | } | |
| 295 | + | ||
| 296 | + | // Retrieves the first accessible child of an accessible object. | |
| 297 | + | func (x *InlineViewSwitcher) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 298 | + | var cls *gtk.AccessibleBase | |
| 299 | + | ||
| 300 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 301 | + | ||
| 302 | + | if cret == 0 { | |
| 303 | + | return nil | |
| 304 | + | } | |
| 305 | + | cls = >k.AccessibleBase{} | |
| 306 | + | cls.Ptr = cret | |
| 307 | + | return cls | |
| 308 | + | } | |
| 309 | + | ||
| 310 | + | // Retrieves the next accessible sibling of an accessible object | |
| 311 | + | func (x *InlineViewSwitcher) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 312 | + | var cls *gtk.AccessibleBase | |
| 313 | + | ||
| 314 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 315 | + | ||
| 316 | + | if cret == 0 { | |
| 317 | + | return nil | |
| 318 | + | } | |
| 319 | + | cls = >k.AccessibleBase{} | |
| 320 | + | cls.Ptr = cret | |
| 321 | + | return cls | |
| 322 | + | } | |
| 323 | + | ||
| 324 | + | // Queries a platform state, such as focus. | |
| 325 | + | // | |
| 326 | + | // This functionality can be overridden by `GtkAccessible` | |
| 327 | + | // implementations, e.g. to get platform state from an ignored | |
| 328 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 329 | + | func (x *InlineViewSwitcher) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 330 | + | ||
| 331 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 332 | + | return cret | |
| 333 | + | } | |
| 334 | + | ||
| 335 | + | // Resets the accessible property to its default value. | |
| 336 | + | func (x *InlineViewSwitcher) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 337 | + | ||
| 338 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 339 | + | ||
| 340 | + | } | |
| 341 | + | ||
| 342 | + | // Resets the accessible relation to its default value. | |
| 343 | + | func (x *InlineViewSwitcher) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 344 | + | ||
| 345 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 346 | + | ||
| 347 | + | } | |
| 348 | + | ||
| 349 | + | // Resets the accessible state to its default value. | |
| 350 | + | func (x *InlineViewSwitcher) ResetState(StateVar gtk.AccessibleState) { | |
| 351 | + | ||
| 352 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 353 | + | ||
| 354 | + | } | |
| 355 | + | ||
| 356 | + | // Sets the parent and sibling of an accessible object. | |
| 357 | + | // | |
| 358 | + | // This function is meant to be used by accessible implementations that are | |
| 359 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 360 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 361 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 362 | + | // interface, you will use this function to ensure that the parent of each | |
| 363 | + | // child widget is the metadata object, and the parent of each metadata | |
| 364 | + | // object is the container widget. | |
| 365 | + | func (x *InlineViewSwitcher) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 366 | + | ||
| 367 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 368 | + | ||
| 369 | + | } | |
| 370 | + | ||
| 371 | + | // Updates the next accessible sibling. | |
| 372 | + | // | |
| 373 | + | // That might be useful when a new child of a custom accessible | |
| 374 | + | // is created, and it needs to be linked to a previous child. | |
| 375 | + | func (x *InlineViewSwitcher) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 376 | + | ||
| 377 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 378 | + | ||
| 379 | + | } | |
| 380 | + | ||
| 381 | + | // Informs ATs that the platform state has changed. | |
| 382 | + | // | |
| 383 | + | // This function should be used by `GtkAccessible` implementations that | |
| 384 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 385 | + | // states automatically. | |
| 386 | + | func (x *InlineViewSwitcher) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 387 | + | ||
| 388 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 389 | + | ||
| 390 | + | } | |
| 391 | + | ||
| 392 | + | // Updates a list of accessible properties. | |
| 393 | + | // | |
| 394 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 395 | + | // value types of accessible properties. | |
| 396 | + | // | |
| 397 | + | // This function should be called by `GtkWidget` types whenever | |
| 398 | + | // an accessible property change must be communicated to assistive | |
| 399 | + | // technologies. | |
| 400 | + | // | |
| 401 | + | // Example: | |
| 402 | + | // ```c | |
| 403 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 404 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 405 | + | // | |
| 406 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 407 | + | // -1); | |
| 408 | + | // | |
| 409 | + | // ``` | |
| 410 | + | func (x *InlineViewSwitcher) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 411 | + | ||
| 412 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 413 | + | ||
| 414 | + | } | |
| 415 | + | ||
| 416 | + | // Updates an array of accessible properties. | |
| 417 | + | // | |
| 418 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 419 | + | // property change must be communicated to assistive technologies. | |
| 420 | + | // | |
| 421 | + | // This function is meant to be used by language bindings. | |
| 422 | + | func (x *InlineViewSwitcher) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) { | |
| 423 | + | ||
| 424 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 425 | + | ||
| 426 | + | } | |
| 427 | + | ||
| 428 | + | // Updates a list of accessible relations. | |
| 429 | + | // | |
| 430 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 431 | + | // relation change must be communicated to assistive technologies. | |
| 432 | + | // | |
| 433 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 434 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 435 | + | // | |
| 436 | + | // ```c | |
| 437 | + | // gtk_accessible_update_relation (accessible, | |
| 438 | + | // | |
| 439 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 440 | + | // ref1, NULL, | |
| 441 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 442 | + | // ref1, ref2, ref3, NULL, | |
| 443 | + | // -1); | |
| 444 | + | // | |
| 445 | + | // ``` | |
| 446 | + | func (x *InlineViewSwitcher) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 447 | + | ||
| 448 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 449 | + | ||
| 450 | + | } | |
| 451 | + | ||
| 452 | + | // Updates an array of accessible relations. | |
| 453 | + | // | |
| 454 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 455 | + | // relation change must be communicated to assistive technologies. | |
| 456 | + | // | |
| 457 | + | // This function is meant to be used by language bindings. | |
| 458 | + | func (x *InlineViewSwitcher) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) { | |
| 459 | + | ||
| 460 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 461 | + | ||
| 462 | + | } | |
| 463 | + | ||
| 464 | + | // Updates a list of accessible states. | |
| 465 | + | // | |
| 466 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 467 | + | // value types of accessible states. | |
| 468 | + | // | |
| 469 | + | // This function should be called by `GtkWidget` types whenever | |
| 470 | + | // an accessible state change must be communicated to assistive | |
| 471 | + | // technologies. | |
| 472 | + | // | |
| 473 | + | // Example: | |
| 474 | + | // | |
| 475 | + | // ```c | |
| 476 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 477 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 478 | + | // | |
| 479 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 480 | + | // -1); | |
| 481 | + | // | |
| 482 | + | // ``` | |
| 483 | + | func (x *InlineViewSwitcher) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 484 | + | ||
| 485 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 486 | + | ||
| 487 | + | } | |
| 488 | + | ||
| 489 | + | // Updates an array of accessible states. | |
| 490 | + | // | |
| 491 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 492 | + | // state change must be communicated to assistive technologies. | |
| 493 | + | // | |
| 494 | + | // This function is meant to be used by language bindings. | |
| 495 | + | func (x *InlineViewSwitcher) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) { | |
| 496 | + | ||
| 497 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 498 | + | ||
| 499 | + | } | |
| 500 | + | ||
| 501 | + | // Gets the ID of the @buildable object. | |
| 502 | + | // | |
| 503 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 504 | + | // of the `<object>` tag used to construct the @buildable. | |
| 505 | + | func (x *InlineViewSwitcher) GetBuildableId() string { | |
| 506 | + | ||
| 507 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 508 | + | return cret | |
| 509 | + | } | |
| 510 | + | ||
| 511 | + | // Retrieves the orientation of the @orientable. | |
| 512 | + | func (x *InlineViewSwitcher) GetOrientation() gtk.Orientation { | |
| 513 | + | ||
| 514 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 515 | + | return cret | |
| 516 | + | } | |
| 517 | + | ||
| 518 | + | // Sets the orientation of the @orientable. | |
| 519 | + | func (x *InlineViewSwitcher) SetOrientation(OrientationVar gtk.Orientation) { | |
| 520 | + | ||
| 521 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 522 | + | ||
| 523 | + | } | |
| 524 | + | ||
| 525 | + | func init() { | |
| 526 | + | core.SetPackageName("ADW", "libadwaita-1") | |
| 527 | + | core.SetSharedLibrary("ADW", "libadwaita-1.so.0") | |
| 528 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 529 | + | if err != nil { | |
| 530 | + | panic(err) | |
| 531 | + | } | |
| 532 | + | ||
| 533 | + | core.PuregoSafeRegister(&xInlineViewSwitcherDisplayModeGLibType, lib, "adw_inline_view_switcher_display_mode_get_type") | |
| 534 | + | ||
| 535 | + | core.PuregoSafeRegister(&xInlineViewSwitcherGLibType, lib, "adw_inline_view_switcher_get_type") | |
| 536 | + | ||
| 537 | + | core.PuregoSafeRegister(&xNewInlineViewSwitcher, lib, "adw_inline_view_switcher_new") | |
| 538 | + | ||
| 539 | + | core.PuregoSafeRegister(&xInlineViewSwitcherGetCanShrink, lib, "adw_inline_view_switcher_get_can_shrink") | |
| 540 | + | core.PuregoSafeRegister(&xInlineViewSwitcherGetDisplayMode, lib, "adw_inline_view_switcher_get_display_mode") | |
| 541 | + | core.PuregoSafeRegister(&xInlineViewSwitcherGetHomogeneous, lib, "adw_inline_view_switcher_get_homogeneous") | |
| 542 | + | core.PuregoSafeRegister(&xInlineViewSwitcherGetStack, lib, "adw_inline_view_switcher_get_stack") | |
| 543 | + | core.PuregoSafeRegister(&xInlineViewSwitcherSetCanShrink, lib, "adw_inline_view_switcher_set_can_shrink") | |
| 544 | + | core.PuregoSafeRegister(&xInlineViewSwitcherSetDisplayMode, lib, "adw_inline_view_switcher_set_display_mode") | |
| 545 | + | core.PuregoSafeRegister(&xInlineViewSwitcherSetHomogeneous, lib, "adw_inline_view_switcher_set_homogeneous") | |
| 546 | + | core.PuregoSafeRegister(&xInlineViewSwitcherSetStack, lib, "adw_inline_view_switcher_set_stack") | |
| 547 | + | ||
| 548 | + | } | |
M v4/adw/adw-layout-slot.go +145 -10
| @@ -81,34 +81,165 @@ func (c *LayoutSlot) SetGoPointer(ptr uintptr) { | |||
| 81 | 81 | c.Ptr = ptr | |
| 82 | 82 | } | |
| 83 | 83 | ||
| 84 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 84 | + | // Requests the user's screen reader to announce the given message. | |
| 85 | + | // | |
| 86 | + | // This kind of notification is useful for messages that | |
| 87 | + | // either have only a visual representation or that are not | |
| 88 | + | // exposed visually at all, e.g. a notification about a | |
| 89 | + | // successful operation. | |
| 90 | + | // | |
| 91 | + | // Also, by using this API, you can ensure that the message | |
| 92 | + | // does not interrupts the user's current screen reader output. | |
| 93 | + | func (x *LayoutSlot) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 94 | + | ||
| 95 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 96 | + | ||
| 97 | + | } | |
| 98 | + | ||
| 99 | + | // Retrieves the accessible parent for an accessible object. | |
| 100 | + | // | |
| 101 | + | // This function returns `NULL` for top level widgets. | |
| 102 | + | func (x *LayoutSlot) GetAccessibleParent() *gtk.AccessibleBase { | |
| 103 | + | var cls *gtk.AccessibleBase | |
| 104 | + | ||
| 105 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 106 | + | ||
| 107 | + | if cret == 0 { | |
| 108 | + | return nil | |
| 109 | + | } | |
| 110 | + | cls = >k.AccessibleBase{} | |
| 111 | + | cls.Ptr = cret | |
| 112 | + | return cls | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | // Retrieves the accessible role of an accessible object. | |
| 85 | 116 | func (x *LayoutSlot) GetAccessibleRole() gtk.AccessibleRole { | |
| 86 | 117 | ||
| 87 | 118 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 88 | 119 | return cret | |
| 89 | 120 | } | |
| 90 | 121 | ||
| 91 | - | // Resets the accessible @property to its default value. | |
| 122 | + | // Retrieves the implementation for the given accessible object. | |
| 123 | + | func (x *LayoutSlot) GetAtContext() *gtk.ATContext { | |
| 124 | + | var cls *gtk.ATContext | |
| 125 | + | ||
| 126 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 127 | + | ||
| 128 | + | if cret == 0 { | |
| 129 | + | return nil | |
| 130 | + | } | |
| 131 | + | cls = >k.ATContext{} | |
| 132 | + | cls.Ptr = cret | |
| 133 | + | return cls | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | // Queries the coordinates and dimensions of this accessible | |
| 137 | + | // | |
| 138 | + | // This functionality can be overridden by `GtkAccessible` | |
| 139 | + | // implementations, e.g. to get the bounds from an ignored | |
| 140 | + | // child widget. | |
| 141 | + | func (x *LayoutSlot) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 142 | + | ||
| 143 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 144 | + | return cret | |
| 145 | + | } | |
| 146 | + | ||
| 147 | + | // Retrieves the first accessible child of an accessible object. | |
| 148 | + | func (x *LayoutSlot) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 149 | + | var cls *gtk.AccessibleBase | |
| 150 | + | ||
| 151 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 152 | + | ||
| 153 | + | if cret == 0 { | |
| 154 | + | return nil | |
| 155 | + | } | |
| 156 | + | cls = >k.AccessibleBase{} | |
| 157 | + | cls.Ptr = cret | |
| 158 | + | return cls | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | // Retrieves the next accessible sibling of an accessible object | |
| 162 | + | func (x *LayoutSlot) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 163 | + | var cls *gtk.AccessibleBase | |
| 164 | + | ||
| 165 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 166 | + | ||
| 167 | + | if cret == 0 { | |
| 168 | + | return nil | |
| 169 | + | } | |
| 170 | + | cls = >k.AccessibleBase{} | |
| 171 | + | cls.Ptr = cret | |
| 172 | + | return cls | |
| 173 | + | } | |
| 174 | + | ||
| 175 | + | // Queries a platform state, such as focus. | |
| 176 | + | // | |
| 177 | + | // This functionality can be overridden by `GtkAccessible` | |
| 178 | + | // implementations, e.g. to get platform state from an ignored | |
| 179 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 180 | + | func (x *LayoutSlot) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 181 | + | ||
| 182 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 183 | + | return cret | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // Resets the accessible property to its default value. | |
| 92 | 187 | func (x *LayoutSlot) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 93 | 188 | ||
| 94 | 189 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 95 | 190 | ||
| 96 | 191 | } | |
| 97 | 192 | ||
| 98 | - | // Resets the accessible @relation to its default value. | |
| 193 | + | // Resets the accessible relation to its default value. | |
| 99 | 194 | func (x *LayoutSlot) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 100 | 195 | ||
| 101 | 196 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 102 | 197 | ||
| 103 | 198 | } | |
| 104 | 199 | ||
| 105 | - | // Resets the accessible @state to its default value. | |
| 200 | + | // Resets the accessible state to its default value. | |
| 106 | 201 | func (x *LayoutSlot) ResetState(StateVar gtk.AccessibleState) { | |
| 107 | 202 | ||
| 108 | 203 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 109 | 204 | ||
| 110 | 205 | } | |
| 111 | 206 | ||
| 207 | + | // Sets the parent and sibling of an accessible object. | |
| 208 | + | // | |
| 209 | + | // This function is meant to be used by accessible implementations that are | |
| 210 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 211 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 212 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 213 | + | // interface, you will use this function to ensure that the parent of each | |
| 214 | + | // child widget is the metadata object, and the parent of each metadata | |
| 215 | + | // object is the container widget. | |
| 216 | + | func (x *LayoutSlot) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 217 | + | ||
| 218 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 219 | + | ||
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // Updates the next accessible sibling. | |
| 223 | + | // | |
| 224 | + | // That might be useful when a new child of a custom accessible | |
| 225 | + | // is created, and it needs to be linked to a previous child. | |
| 226 | + | func (x *LayoutSlot) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 227 | + | ||
| 228 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 229 | + | ||
| 230 | + | } | |
| 231 | + | ||
| 232 | + | // Informs ATs that the platform state has changed. | |
| 233 | + | // | |
| 234 | + | // This function should be used by `GtkAccessible` implementations that | |
| 235 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 236 | + | // states automatically. | |
| 237 | + | func (x *LayoutSlot) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 238 | + | ||
| 239 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 240 | + | ||
| 241 | + | } | |
| 242 | + | ||
| 112 | 243 | // Updates a list of accessible properties. | |
| 113 | 244 | // | |
| 114 | 245 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -151,7 +282,7 @@ func (x *LayoutSlot) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk | |||
| 151 | 282 | // relation change must be communicated to assistive technologies. | |
| 152 | 283 | // | |
| 153 | 284 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 154 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 285 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 155 | 286 | // | |
| 156 | 287 | // ```c | |
| 157 | 288 | // gtk_accessible_update_relation (accessible, | |
| @@ -181,13 +312,17 @@ func (x *LayoutSlot) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.A | |||
| 181 | 312 | ||
| 182 | 313 | } | |
| 183 | 314 | ||
| 184 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 185 | - | // documentation for the value types of accessible states. | |
| 315 | + | // Updates a list of accessible states. | |
| 186 | 316 | // | |
| 187 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 188 | - | // state change must be communicated to assistive technologies. | |
| 317 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 318 | + | // value types of accessible states. | |
| 319 | + | // | |
| 320 | + | // This function should be called by `GtkWidget` types whenever | |
| 321 | + | // an accessible state change must be communicated to assistive | |
| 322 | + | // technologies. | |
| 189 | 323 | // | |
| 190 | 324 | // Example: | |
| 325 | + | // | |
| 191 | 326 | // ```c | |
| 192 | 327 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 193 | 328 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -217,7 +352,7 @@ func (x *LayoutSlot) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessible | |||
| 217 | 352 | // Gets the ID of the @buildable object. | |
| 218 | 353 | // | |
| 219 | 354 | // `GtkBuilder` sets the name based on the ID attribute | |
| 220 | - | // of the <object> tag used to construct the @buildable. | |
| 355 | + | // of the `<object>` tag used to construct the @buildable. | |
| 221 | 356 | func (x *LayoutSlot) GetBuildableId() string { | |
| 222 | 357 | ||
| 223 | 358 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-layout.go +1 -1
| @@ -104,7 +104,7 @@ func (c *Layout) SetGoPointer(ptr uintptr) { | |||
| 104 | 104 | // Gets the ID of the @buildable object. | |
| 105 | 105 | // | |
| 106 | 106 | // `GtkBuilder` sets the name based on the ID attribute | |
| 107 | - | // of the <object> tag used to construct the @buildable. | |
| 107 | + | // of the `<object>` tag used to construct the @buildable. | |
| 108 | 108 | func (x *Layout) GetBuildableId() string { | |
| 109 | 109 | ||
| 110 | 110 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-leaflet.go +145 -10
| @@ -620,34 +620,165 @@ func (x *Leaflet) GetSwipeArea(NavigationDirectionVar NavigationDirection, IsDra | |||
| 620 | 620 | ||
| 621 | 621 | } | |
| 622 | 622 | ||
| 623 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 623 | + | // Requests the user's screen reader to announce the given message. | |
| 624 | + | // | |
| 625 | + | // This kind of notification is useful for messages that | |
| 626 | + | // either have only a visual representation or that are not | |
| 627 | + | // exposed visually at all, e.g. a notification about a | |
| 628 | + | // successful operation. | |
| 629 | + | // | |
| 630 | + | // Also, by using this API, you can ensure that the message | |
| 631 | + | // does not interrupts the user's current screen reader output. | |
| 632 | + | func (x *Leaflet) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 633 | + | ||
| 634 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 635 | + | ||
| 636 | + | } | |
| 637 | + | ||
| 638 | + | // Retrieves the accessible parent for an accessible object. | |
| 639 | + | // | |
| 640 | + | // This function returns `NULL` for top level widgets. | |
| 641 | + | func (x *Leaflet) GetAccessibleParent() *gtk.AccessibleBase { | |
| 642 | + | var cls *gtk.AccessibleBase | |
| 643 | + | ||
| 644 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 645 | + | ||
| 646 | + | if cret == 0 { | |
| 647 | + | return nil | |
| 648 | + | } | |
| 649 | + | cls = >k.AccessibleBase{} | |
| 650 | + | cls.Ptr = cret | |
| 651 | + | return cls | |
| 652 | + | } | |
| 653 | + | ||
| 654 | + | // Retrieves the accessible role of an accessible object. | |
| 624 | 655 | func (x *Leaflet) GetAccessibleRole() gtk.AccessibleRole { | |
| 625 | 656 | ||
| 626 | 657 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 627 | 658 | return cret | |
| 628 | 659 | } | |
| 629 | 660 | ||
| 630 | - | // Resets the accessible @property to its default value. | |
| 661 | + | // Retrieves the implementation for the given accessible object. | |
| 662 | + | func (x *Leaflet) GetAtContext() *gtk.ATContext { | |
| 663 | + | var cls *gtk.ATContext | |
| 664 | + | ||
| 665 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 666 | + | ||
| 667 | + | if cret == 0 { | |
| 668 | + | return nil | |
| 669 | + | } | |
| 670 | + | cls = >k.ATContext{} | |
| 671 | + | cls.Ptr = cret | |
| 672 | + | return cls | |
| 673 | + | } | |
| 674 | + | ||
| 675 | + | // Queries the coordinates and dimensions of this accessible | |
| 676 | + | // | |
| 677 | + | // This functionality can be overridden by `GtkAccessible` | |
| 678 | + | // implementations, e.g. to get the bounds from an ignored | |
| 679 | + | // child widget. | |
| 680 | + | func (x *Leaflet) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 681 | + | ||
| 682 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 683 | + | return cret | |
| 684 | + | } | |
| 685 | + | ||
| 686 | + | // Retrieves the first accessible child of an accessible object. | |
| 687 | + | func (x *Leaflet) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 688 | + | var cls *gtk.AccessibleBase | |
| 689 | + | ||
| 690 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 691 | + | ||
| 692 | + | if cret == 0 { | |
| 693 | + | return nil | |
| 694 | + | } | |
| 695 | + | cls = >k.AccessibleBase{} | |
| 696 | + | cls.Ptr = cret | |
| 697 | + | return cls | |
| 698 | + | } | |
| 699 | + | ||
| 700 | + | // Retrieves the next accessible sibling of an accessible object | |
| 701 | + | func (x *Leaflet) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 702 | + | var cls *gtk.AccessibleBase | |
| 703 | + | ||
| 704 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 705 | + | ||
| 706 | + | if cret == 0 { | |
| 707 | + | return nil | |
| 708 | + | } | |
| 709 | + | cls = >k.AccessibleBase{} | |
| 710 | + | cls.Ptr = cret | |
| 711 | + | return cls | |
| 712 | + | } | |
| 713 | + | ||
| 714 | + | // Queries a platform state, such as focus. | |
| 715 | + | // | |
| 716 | + | // This functionality can be overridden by `GtkAccessible` | |
| 717 | + | // implementations, e.g. to get platform state from an ignored | |
| 718 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 719 | + | func (x *Leaflet) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 720 | + | ||
| 721 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 722 | + | return cret | |
| 723 | + | } | |
| 724 | + | ||
| 725 | + | // Resets the accessible property to its default value. | |
| 631 | 726 | func (x *Leaflet) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 632 | 727 | ||
| 633 | 728 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 634 | 729 | ||
| 635 | 730 | } | |
| 636 | 731 | ||
| 637 | - | // Resets the accessible @relation to its default value. | |
| 732 | + | // Resets the accessible relation to its default value. | |
| 638 | 733 | func (x *Leaflet) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 639 | 734 | ||
| 640 | 735 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 641 | 736 | ||
| 642 | 737 | } | |
| 643 | 738 | ||
| 644 | - | // Resets the accessible @state to its default value. | |
| 739 | + | // Resets the accessible state to its default value. | |
| 645 | 740 | func (x *Leaflet) ResetState(StateVar gtk.AccessibleState) { | |
| 646 | 741 | ||
| 647 | 742 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 648 | 743 | ||
| 649 | 744 | } | |
| 650 | 745 | ||
| 746 | + | // Sets the parent and sibling of an accessible object. | |
| 747 | + | // | |
| 748 | + | // This function is meant to be used by accessible implementations that are | |
| 749 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 750 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 751 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 752 | + | // interface, you will use this function to ensure that the parent of each | |
| 753 | + | // child widget is the metadata object, and the parent of each metadata | |
| 754 | + | // object is the container widget. | |
| 755 | + | func (x *Leaflet) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 756 | + | ||
| 757 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 758 | + | ||
| 759 | + | } | |
| 760 | + | ||
| 761 | + | // Updates the next accessible sibling. | |
| 762 | + | // | |
| 763 | + | // That might be useful when a new child of a custom accessible | |
| 764 | + | // is created, and it needs to be linked to a previous child. | |
| 765 | + | func (x *Leaflet) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 766 | + | ||
| 767 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 768 | + | ||
| 769 | + | } | |
| 770 | + | ||
| 771 | + | // Informs ATs that the platform state has changed. | |
| 772 | + | // | |
| 773 | + | // This function should be used by `GtkAccessible` implementations that | |
| 774 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 775 | + | // states automatically. | |
| 776 | + | func (x *Leaflet) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 777 | + | ||
| 778 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 779 | + | ||
| 780 | + | } | |
| 781 | + | ||
| 651 | 782 | // Updates a list of accessible properties. | |
| 652 | 783 | // | |
| 653 | 784 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -690,7 +821,7 @@ func (x *Leaflet) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Ac | |||
| 690 | 821 | // relation change must be communicated to assistive technologies. | |
| 691 | 822 | // | |
| 692 | 823 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 693 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 824 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 694 | 825 | // | |
| 695 | 826 | // ```c | |
| 696 | 827 | // gtk_accessible_update_relation (accessible, | |
| @@ -720,13 +851,17 @@ func (x *Leaflet) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acce | |||
| 720 | 851 | ||
| 721 | 852 | } | |
| 722 | 853 | ||
| 723 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 724 | - | // documentation for the value types of accessible states. | |
| 854 | + | // Updates a list of accessible states. | |
| 725 | 855 | // | |
| 726 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 727 | - | // state change must be communicated to assistive technologies. | |
| 856 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 857 | + | // value types of accessible states. | |
| 858 | + | // | |
| 859 | + | // This function should be called by `GtkWidget` types whenever | |
| 860 | + | // an accessible state change must be communicated to assistive | |
| 861 | + | // technologies. | |
| 728 | 862 | // | |
| 729 | 863 | // Example: | |
| 864 | + | // | |
| 730 | 865 | // ```c | |
| 731 | 866 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 732 | 867 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -756,7 +891,7 @@ func (x *Leaflet) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleSta | |||
| 756 | 891 | // Gets the ID of the @buildable object. | |
| 757 | 892 | // | |
| 758 | 893 | // `GtkBuilder` sets the name based on the ID attribute | |
| 759 | - | // of the <object> tag used to construct the @buildable. | |
| 894 | + | // of the `<object>` tag used to construct the @buildable. | |
| 760 | 895 | func (x *Leaflet) GetBuildableId() string { | |
| 761 | 896 | ||
| 762 | 897 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-message-dialog.go +151 -13
| @@ -536,10 +536,13 @@ var xMessageDialogSetDefaultResponse func(uintptr, string) | |||
| 536 | 536 | ||
| 537 | 537 | // Sets the ID of the default response of @self. | |
| 538 | 538 | // | |
| 539 | - | // If set, pressing <kbd>Enter</kbd> will activate the corresponding button. | |
| 539 | + | // The button corresponding to this response will be set as the default widget | |
| 540 | + | // of @self. | |
| 540 | 541 | // | |
| 541 | - | // If set to `NULL` or to a non-existent response ID, pressing <kbd>Enter</kbd> | |
| 542 | - | // will do nothing. | |
| 542 | + | // If not set, the default widget will not be set, and the last added response | |
| 543 | + | // will be focused by default. | |
| 544 | + | // | |
| 545 | + | // See [property@Gtk.Window:default-widget]. | |
| 543 | 546 | func (x *MessageDialog) SetDefaultResponse(ResponseVar string) { | |
| 544 | 547 | ||
| 545 | 548 | xMessageDialogSetDefaultResponse(x.GoPointer(), ResponseVar) | |
| @@ -672,34 +675,165 @@ func (x *MessageDialog) ConnectResponse(cb *func(MessageDialog, string)) uint32 | |||
| 672 | 675 | return gobject.SignalConnect(x.GoPointer(), "response", cbRefPtr) | |
| 673 | 676 | } | |
| 674 | 677 | ||
| 675 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 678 | + | // Requests the user's screen reader to announce the given message. | |
| 679 | + | // | |
| 680 | + | // This kind of notification is useful for messages that | |
| 681 | + | // either have only a visual representation or that are not | |
| 682 | + | // exposed visually at all, e.g. a notification about a | |
| 683 | + | // successful operation. | |
| 684 | + | // | |
| 685 | + | // Also, by using this API, you can ensure that the message | |
| 686 | + | // does not interrupts the user's current screen reader output. | |
| 687 | + | func (x *MessageDialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 688 | + | ||
| 689 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 690 | + | ||
| 691 | + | } | |
| 692 | + | ||
| 693 | + | // Retrieves the accessible parent for an accessible object. | |
| 694 | + | // | |
| 695 | + | // This function returns `NULL` for top level widgets. | |
| 696 | + | func (x *MessageDialog) GetAccessibleParent() *gtk.AccessibleBase { | |
| 697 | + | var cls *gtk.AccessibleBase | |
| 698 | + | ||
| 699 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 700 | + | ||
| 701 | + | if cret == 0 { | |
| 702 | + | return nil | |
| 703 | + | } | |
| 704 | + | cls = >k.AccessibleBase{} | |
| 705 | + | cls.Ptr = cret | |
| 706 | + | return cls | |
| 707 | + | } | |
| 708 | + | ||
| 709 | + | // Retrieves the accessible role of an accessible object. | |
| 676 | 710 | func (x *MessageDialog) GetAccessibleRole() gtk.AccessibleRole { | |
| 677 | 711 | ||
| 678 | 712 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 679 | 713 | return cret | |
| 680 | 714 | } | |
| 681 | 715 | ||
| 682 | - | // Resets the accessible @property to its default value. | |
| 716 | + | // Retrieves the implementation for the given accessible object. | |
| 717 | + | func (x *MessageDialog) GetAtContext() *gtk.ATContext { | |
| 718 | + | var cls *gtk.ATContext | |
| 719 | + | ||
| 720 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 721 | + | ||
| 722 | + | if cret == 0 { | |
| 723 | + | return nil | |
| 724 | + | } | |
| 725 | + | cls = >k.ATContext{} | |
| 726 | + | cls.Ptr = cret | |
| 727 | + | return cls | |
| 728 | + | } | |
| 729 | + | ||
| 730 | + | // Queries the coordinates and dimensions of this accessible | |
| 731 | + | // | |
| 732 | + | // This functionality can be overridden by `GtkAccessible` | |
| 733 | + | // implementations, e.g. to get the bounds from an ignored | |
| 734 | + | // child widget. | |
| 735 | + | func (x *MessageDialog) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 736 | + | ||
| 737 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 738 | + | return cret | |
| 739 | + | } | |
| 740 | + | ||
| 741 | + | // Retrieves the first accessible child of an accessible object. | |
| 742 | + | func (x *MessageDialog) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 743 | + | var cls *gtk.AccessibleBase | |
| 744 | + | ||
| 745 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 746 | + | ||
| 747 | + | if cret == 0 { | |
| 748 | + | return nil | |
| 749 | + | } | |
| 750 | + | cls = >k.AccessibleBase{} | |
| 751 | + | cls.Ptr = cret | |
| 752 | + | return cls | |
| 753 | + | } | |
| 754 | + | ||
| 755 | + | // Retrieves the next accessible sibling of an accessible object | |
| 756 | + | func (x *MessageDialog) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 757 | + | var cls *gtk.AccessibleBase | |
| 758 | + | ||
| 759 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 760 | + | ||
| 761 | + | if cret == 0 { | |
| 762 | + | return nil | |
| 763 | + | } | |
| 764 | + | cls = >k.AccessibleBase{} | |
| 765 | + | cls.Ptr = cret | |
| 766 | + | return cls | |
| 767 | + | } | |
| 768 | + | ||
| 769 | + | // Queries a platform state, such as focus. | |
| 770 | + | // | |
| 771 | + | // This functionality can be overridden by `GtkAccessible` | |
| 772 | + | // implementations, e.g. to get platform state from an ignored | |
| 773 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 774 | + | func (x *MessageDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 775 | + | ||
| 776 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 777 | + | return cret | |
| 778 | + | } | |
| 779 | + | ||
| 780 | + | // Resets the accessible property to its default value. | |
| 683 | 781 | func (x *MessageDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 684 | 782 | ||
| 685 | 783 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 686 | 784 | ||
| 687 | 785 | } | |
| 688 | 786 | ||
| 689 | - | // Resets the accessible @relation to its default value. | |
| 787 | + | // Resets the accessible relation to its default value. | |
| 690 | 788 | func (x *MessageDialog) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 691 | 789 | ||
| 692 | 790 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 693 | 791 | ||
| 694 | 792 | } | |
| 695 | 793 | ||
| 696 | - | // Resets the accessible @state to its default value. | |
| 794 | + | // Resets the accessible state to its default value. | |
| 697 | 795 | func (x *MessageDialog) ResetState(StateVar gtk.AccessibleState) { | |
| 698 | 796 | ||
| 699 | 797 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 700 | 798 | ||
| 701 | 799 | } | |
| 702 | 800 | ||
| 801 | + | // Sets the parent and sibling of an accessible object. | |
| 802 | + | // | |
| 803 | + | // This function is meant to be used by accessible implementations that are | |
| 804 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 805 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 806 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 807 | + | // interface, you will use this function to ensure that the parent of each | |
| 808 | + | // child widget is the metadata object, and the parent of each metadata | |
| 809 | + | // object is the container widget. | |
| 810 | + | func (x *MessageDialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 811 | + | ||
| 812 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 813 | + | ||
| 814 | + | } | |
| 815 | + | ||
| 816 | + | // Updates the next accessible sibling. | |
| 817 | + | // | |
| 818 | + | // That might be useful when a new child of a custom accessible | |
| 819 | + | // is created, and it needs to be linked to a previous child. | |
| 820 | + | func (x *MessageDialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 821 | + | ||
| 822 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 823 | + | ||
| 824 | + | } | |
| 825 | + | ||
| 826 | + | // Informs ATs that the platform state has changed. | |
| 827 | + | // | |
| 828 | + | // This function should be used by `GtkAccessible` implementations that | |
| 829 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 830 | + | // states automatically. | |
| 831 | + | func (x *MessageDialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 832 | + | ||
| 833 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 834 | + | ||
| 835 | + | } | |
| 836 | + | ||
| 703 | 837 | // Updates a list of accessible properties. | |
| 704 | 838 | // | |
| 705 | 839 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -742,7 +876,7 @@ func (x *MessageDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVar [] | |||
| 742 | 876 | // relation change must be communicated to assistive technologies. | |
| 743 | 877 | // | |
| 744 | 878 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 745 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 879 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 746 | 880 | // | |
| 747 | 881 | // ```c | |
| 748 | 882 | // gtk_accessible_update_relation (accessible, | |
| @@ -772,13 +906,17 @@ func (x *MessageDialog) UpdateRelationValue(NRelationsVar int, RelationsVar []gt | |||
| 772 | 906 | ||
| 773 | 907 | } | |
| 774 | 908 | ||
| 775 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 776 | - | // documentation for the value types of accessible states. | |
| 909 | + | // Updates a list of accessible states. | |
| 777 | 910 | // | |
| 778 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 779 | - | // state change must be communicated to assistive technologies. | |
| 911 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 912 | + | // value types of accessible states. | |
| 913 | + | // | |
| 914 | + | // This function should be called by `GtkWidget` types whenever | |
| 915 | + | // an accessible state change must be communicated to assistive | |
| 916 | + | // technologies. | |
| 780 | 917 | // | |
| 781 | 918 | // Example: | |
| 919 | + | // | |
| 782 | 920 | // ```c | |
| 783 | 921 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 784 | 922 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -808,7 +946,7 @@ func (x *MessageDialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessi | |||
| 808 | 946 | // Gets the ID of the @buildable object. | |
| 809 | 947 | // | |
| 810 | 948 | // `GtkBuilder` sets the name based on the ID attribute | |
| 811 | - | // of the <object> tag used to construct the @buildable. | |
| 949 | + | // of the `<object>` tag used to construct the @buildable. | |
| 812 | 950 | func (x *MessageDialog) GetBuildableId() string { | |
| 813 | 951 | ||
| 814 | 952 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-multi-layout-view.go +145 -10
| @@ -259,34 +259,165 @@ func (c *MultiLayoutView) SetGoPointer(ptr uintptr) { | |||
| 259 | 259 | c.Ptr = ptr | |
| 260 | 260 | } | |
| 261 | 261 | ||
| 262 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 262 | + | // Requests the user's screen reader to announce the given message. | |
| 263 | + | // | |
| 264 | + | // This kind of notification is useful for messages that | |
| 265 | + | // either have only a visual representation or that are not | |
| 266 | + | // exposed visually at all, e.g. a notification about a | |
| 267 | + | // successful operation. | |
| 268 | + | // | |
| 269 | + | // Also, by using this API, you can ensure that the message | |
| 270 | + | // does not interrupts the user's current screen reader output. | |
| 271 | + | func (x *MultiLayoutView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 272 | + | ||
| 273 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 274 | + | ||
| 275 | + | } | |
| 276 | + | ||
| 277 | + | // Retrieves the accessible parent for an accessible object. | |
| 278 | + | // | |
| 279 | + | // This function returns `NULL` for top level widgets. | |
| 280 | + | func (x *MultiLayoutView) GetAccessibleParent() *gtk.AccessibleBase { | |
| 281 | + | var cls *gtk.AccessibleBase | |
| 282 | + | ||
| 283 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 284 | + | ||
| 285 | + | if cret == 0 { | |
| 286 | + | return nil | |
| 287 | + | } | |
| 288 | + | cls = >k.AccessibleBase{} | |
| 289 | + | cls.Ptr = cret | |
| 290 | + | return cls | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | // Retrieves the accessible role of an accessible object. | |
| 263 | 294 | func (x *MultiLayoutView) GetAccessibleRole() gtk.AccessibleRole { | |
| 264 | 295 | ||
| 265 | 296 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 266 | 297 | return cret | |
| 267 | 298 | } | |
| 268 | 299 | ||
| 269 | - | // Resets the accessible @property to its default value. | |
| 300 | + | // Retrieves the implementation for the given accessible object. | |
| 301 | + | func (x *MultiLayoutView) GetAtContext() *gtk.ATContext { | |
| 302 | + | var cls *gtk.ATContext | |
| 303 | + | ||
| 304 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 305 | + | ||
| 306 | + | if cret == 0 { | |
| 307 | + | return nil | |
| 308 | + | } | |
| 309 | + | cls = >k.ATContext{} | |
| 310 | + | cls.Ptr = cret | |
| 311 | + | return cls | |
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // Queries the coordinates and dimensions of this accessible | |
| 315 | + | // | |
| 316 | + | // This functionality can be overridden by `GtkAccessible` | |
| 317 | + | // implementations, e.g. to get the bounds from an ignored | |
| 318 | + | // child widget. | |
| 319 | + | func (x *MultiLayoutView) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 320 | + | ||
| 321 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 322 | + | return cret | |
| 323 | + | } | |
| 324 | + | ||
| 325 | + | // Retrieves the first accessible child of an accessible object. | |
| 326 | + | func (x *MultiLayoutView) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 327 | + | var cls *gtk.AccessibleBase | |
| 328 | + | ||
| 329 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 330 | + | ||
| 331 | + | if cret == 0 { | |
| 332 | + | return nil | |
| 333 | + | } | |
| 334 | + | cls = >k.AccessibleBase{} | |
| 335 | + | cls.Ptr = cret | |
| 336 | + | return cls | |
| 337 | + | } | |
| 338 | + | ||
| 339 | + | // Retrieves the next accessible sibling of an accessible object | |
| 340 | + | func (x *MultiLayoutView) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 341 | + | var cls *gtk.AccessibleBase | |
| 342 | + | ||
| 343 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 344 | + | ||
| 345 | + | if cret == 0 { | |
| 346 | + | return nil | |
| 347 | + | } | |
| 348 | + | cls = >k.AccessibleBase{} | |
| 349 | + | cls.Ptr = cret | |
| 350 | + | return cls | |
| 351 | + | } | |
| 352 | + | ||
| 353 | + | // Queries a platform state, such as focus. | |
| 354 | + | // | |
| 355 | + | // This functionality can be overridden by `GtkAccessible` | |
| 356 | + | // implementations, e.g. to get platform state from an ignored | |
| 357 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 358 | + | func (x *MultiLayoutView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 359 | + | ||
| 360 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 361 | + | return cret | |
| 362 | + | } | |
| 363 | + | ||
| 364 | + | // Resets the accessible property to its default value. | |
| 270 | 365 | func (x *MultiLayoutView) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 271 | 366 | ||
| 272 | 367 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 273 | 368 | ||
| 274 | 369 | } | |
| 275 | 370 | ||
| 276 | - | // Resets the accessible @relation to its default value. | |
| 371 | + | // Resets the accessible relation to its default value. | |
| 277 | 372 | func (x *MultiLayoutView) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 278 | 373 | ||
| 279 | 374 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 280 | 375 | ||
| 281 | 376 | } | |
| 282 | 377 | ||
| 283 | - | // Resets the accessible @state to its default value. | |
| 378 | + | // Resets the accessible state to its default value. | |
| 284 | 379 | func (x *MultiLayoutView) ResetState(StateVar gtk.AccessibleState) { | |
| 285 | 380 | ||
| 286 | 381 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 287 | 382 | ||
| 288 | 383 | } | |
| 289 | 384 | ||
| 385 | + | // Sets the parent and sibling of an accessible object. | |
| 386 | + | // | |
| 387 | + | // This function is meant to be used by accessible implementations that are | |
| 388 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 389 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 390 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 391 | + | // interface, you will use this function to ensure that the parent of each | |
| 392 | + | // child widget is the metadata object, and the parent of each metadata | |
| 393 | + | // object is the container widget. | |
| 394 | + | func (x *MultiLayoutView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 395 | + | ||
| 396 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 397 | + | ||
| 398 | + | } | |
| 399 | + | ||
| 400 | + | // Updates the next accessible sibling. | |
| 401 | + | // | |
| 402 | + | // That might be useful when a new child of a custom accessible | |
| 403 | + | // is created, and it needs to be linked to a previous child. | |
| 404 | + | func (x *MultiLayoutView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 405 | + | ||
| 406 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 407 | + | ||
| 408 | + | } | |
| 409 | + | ||
| 410 | + | // Informs ATs that the platform state has changed. | |
| 411 | + | // | |
| 412 | + | // This function should be used by `GtkAccessible` implementations that | |
| 413 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 414 | + | // states automatically. | |
| 415 | + | func (x *MultiLayoutView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 416 | + | ||
| 417 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 418 | + | ||
| 419 | + | } | |
| 420 | + | ||
| 290 | 421 | // Updates a list of accessible properties. | |
| 291 | 422 | // | |
| 292 | 423 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -329,7 +460,7 @@ func (x *MultiLayoutView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar | |||
| 329 | 460 | // relation change must be communicated to assistive technologies. | |
| 330 | 461 | // | |
| 331 | 462 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 332 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 463 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 333 | 464 | // | |
| 334 | 465 | // ```c | |
| 335 | 466 | // gtk_accessible_update_relation (accessible, | |
| @@ -359,13 +490,17 @@ func (x *MultiLayoutView) UpdateRelationValue(NRelationsVar int, RelationsVar [] | |||
| 359 | 490 | ||
| 360 | 491 | } | |
| 361 | 492 | ||
| 362 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 363 | - | // documentation for the value types of accessible states. | |
| 493 | + | // Updates a list of accessible states. | |
| 364 | 494 | // | |
| 365 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 366 | - | // state change must be communicated to assistive technologies. | |
| 495 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 496 | + | // value types of accessible states. | |
| 497 | + | // | |
| 498 | + | // This function should be called by `GtkWidget` types whenever | |
| 499 | + | // an accessible state change must be communicated to assistive | |
| 500 | + | // technologies. | |
| 367 | 501 | // | |
| 368 | 502 | // Example: | |
| 503 | + | // | |
| 369 | 504 | // ```c | |
| 370 | 505 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 371 | 506 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -395,7 +530,7 @@ func (x *MultiLayoutView) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acces | |||
| 395 | 530 | // Gets the ID of the @buildable object. | |
| 396 | 531 | // | |
| 397 | 532 | // `GtkBuilder` sets the name based on the ID attribute | |
| 398 | - | // of the <object> tag used to construct the @buildable. | |
| 533 | + | // of the `<object>` tag used to construct the @buildable. | |
| 399 | 534 | func (x *MultiLayoutView) GetBuildableId() string { | |
| 400 | 535 | ||
| 401 | 536 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-navigation-split-view.go +171 -10
| @@ -269,6 +269,15 @@ func (x *NavigationSplitView) GetSidebar() *NavigationPage { | |||
| 269 | 269 | return cls | |
| 270 | 270 | } | |
| 271 | 271 | ||
| 272 | + | var xNavigationSplitViewGetSidebarPosition func(uintptr) gtk.PackType | |
| 273 | + | ||
| 274 | + | // Gets the sidebar position for @self. | |
| 275 | + | func (x *NavigationSplitView) GetSidebarPosition() gtk.PackType { | |
| 276 | + | ||
| 277 | + | cret := xNavigationSplitViewGetSidebarPosition(x.GoPointer()) | |
| 278 | + | return cret | |
| 279 | + | } | |
| 280 | + | ||
| 272 | 281 | var xNavigationSplitViewGetSidebarWidthFraction func(uintptr) float64 | |
| 273 | 282 | ||
| 274 | 283 | // Gets the preferred sidebar width fraction for @self. | |
| @@ -365,6 +374,21 @@ func (x *NavigationSplitView) SetSidebar(SidebarVar *NavigationPage) { | |||
| 365 | 374 | ||
| 366 | 375 | } | |
| 367 | 376 | ||
| 377 | + | var xNavigationSplitViewSetSidebarPosition func(uintptr, gtk.PackType) | |
| 378 | + | ||
| 379 | + | // Sets the sidebar position for @self. | |
| 380 | + | // | |
| 381 | + | // If set to `GTK_PACK_START`, the sidebar is displayed before the content, | |
| 382 | + | // and the sidebar will be the root page when collapsed. | |
| 383 | + | // | |
| 384 | + | // If set to `GTK_PACK_END`, the sidebar is displayed after the content, | |
| 385 | + | // and the content will be the root page. | |
| 386 | + | func (x *NavigationSplitView) SetSidebarPosition(PositionVar gtk.PackType) { | |
| 387 | + | ||
| 388 | + | xNavigationSplitViewSetSidebarPosition(x.GoPointer(), PositionVar) | |
| 389 | + | ||
| 390 | + | } | |
| 391 | + | ||
| 368 | 392 | var xNavigationSplitViewSetSidebarWidthFraction func(uintptr, float64) | |
| 369 | 393 | ||
| 370 | 394 | // Sets the preferred sidebar width as a fraction of the total width of @self. | |
| @@ -404,34 +428,165 @@ func (c *NavigationSplitView) SetGoPointer(ptr uintptr) { | |||
| 404 | 428 | c.Ptr = ptr | |
| 405 | 429 | } | |
| 406 | 430 | ||
| 407 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 431 | + | // Requests the user's screen reader to announce the given message. | |
| 432 | + | // | |
| 433 | + | // This kind of notification is useful for messages that | |
| 434 | + | // either have only a visual representation or that are not | |
| 435 | + | // exposed visually at all, e.g. a notification about a | |
| 436 | + | // successful operation. | |
| 437 | + | // | |
| 438 | + | // Also, by using this API, you can ensure that the message | |
| 439 | + | // does not interrupts the user's current screen reader output. | |
| 440 | + | func (x *NavigationSplitView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 441 | + | ||
| 442 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 443 | + | ||
| 444 | + | } | |
| 445 | + | ||
| 446 | + | // Retrieves the accessible parent for an accessible object. | |
| 447 | + | // | |
| 448 | + | // This function returns `NULL` for top level widgets. | |
| 449 | + | func (x *NavigationSplitView) GetAccessibleParent() *gtk.AccessibleBase { | |
| 450 | + | var cls *gtk.AccessibleBase | |
| 451 | + | ||
| 452 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 453 | + | ||
| 454 | + | if cret == 0 { | |
| 455 | + | return nil | |
| 456 | + | } | |
| 457 | + | cls = >k.AccessibleBase{} | |
| 458 | + | cls.Ptr = cret | |
| 459 | + | return cls | |
| 460 | + | } | |
| 461 | + | ||
| 462 | + | // Retrieves the accessible role of an accessible object. | |
| 408 | 463 | func (x *NavigationSplitView) GetAccessibleRole() gtk.AccessibleRole { | |
| 409 | 464 | ||
| 410 | 465 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 411 | 466 | return cret | |
| 412 | 467 | } | |
| 413 | 468 | ||
| 414 | - | // Resets the accessible @property to its default value. | |
| 469 | + | // Retrieves the implementation for the given accessible object. | |
| 470 | + | func (x *NavigationSplitView) GetAtContext() *gtk.ATContext { | |
| 471 | + | var cls *gtk.ATContext | |
| 472 | + | ||
| 473 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 474 | + | ||
| 475 | + | if cret == 0 { | |
| 476 | + | return nil | |
| 477 | + | } | |
| 478 | + | cls = >k.ATContext{} | |
| 479 | + | cls.Ptr = cret | |
| 480 | + | return cls | |
| 481 | + | } | |
| 482 | + | ||
| 483 | + | // Queries the coordinates and dimensions of this accessible | |
| 484 | + | // | |
| 485 | + | // This functionality can be overridden by `GtkAccessible` | |
| 486 | + | // implementations, e.g. to get the bounds from an ignored | |
| 487 | + | // child widget. | |
| 488 | + | func (x *NavigationSplitView) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 489 | + | ||
| 490 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 491 | + | return cret | |
| 492 | + | } | |
| 493 | + | ||
| 494 | + | // Retrieves the first accessible child of an accessible object. | |
| 495 | + | func (x *NavigationSplitView) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 496 | + | var cls *gtk.AccessibleBase | |
| 497 | + | ||
| 498 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 499 | + | ||
| 500 | + | if cret == 0 { | |
| 501 | + | return nil | |
| 502 | + | } | |
| 503 | + | cls = >k.AccessibleBase{} | |
| 504 | + | cls.Ptr = cret | |
| 505 | + | return cls | |
| 506 | + | } | |
| 507 | + | ||
| 508 | + | // Retrieves the next accessible sibling of an accessible object | |
| 509 | + | func (x *NavigationSplitView) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 510 | + | var cls *gtk.AccessibleBase | |
| 511 | + | ||
| 512 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 513 | + | ||
| 514 | + | if cret == 0 { | |
| 515 | + | return nil | |
| 516 | + | } | |
| 517 | + | cls = >k.AccessibleBase{} | |
| 518 | + | cls.Ptr = cret | |
| 519 | + | return cls | |
| 520 | + | } | |
| 521 | + | ||
| 522 | + | // Queries a platform state, such as focus. | |
| 523 | + | // | |
| 524 | + | // This functionality can be overridden by `GtkAccessible` | |
| 525 | + | // implementations, e.g. to get platform state from an ignored | |
| 526 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 527 | + | func (x *NavigationSplitView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 528 | + | ||
| 529 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 530 | + | return cret | |
| 531 | + | } | |
| 532 | + | ||
| 533 | + | // Resets the accessible property to its default value. | |
| 415 | 534 | func (x *NavigationSplitView) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 416 | 535 | ||
| 417 | 536 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 418 | 537 | ||
| 419 | 538 | } | |
| 420 | 539 | ||
| 421 | - | // Resets the accessible @relation to its default value. | |
| 540 | + | // Resets the accessible relation to its default value. | |
| 422 | 541 | func (x *NavigationSplitView) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 423 | 542 | ||
| 424 | 543 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 425 | 544 | ||
| 426 | 545 | } | |
| 427 | 546 | ||
| 428 | - | // Resets the accessible @state to its default value. | |
| 547 | + | // Resets the accessible state to its default value. | |
| 429 | 548 | func (x *NavigationSplitView) ResetState(StateVar gtk.AccessibleState) { | |
| 430 | 549 | ||
| 431 | 550 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 432 | 551 | ||
| 433 | 552 | } | |
| 434 | 553 | ||
| 554 | + | // Sets the parent and sibling of an accessible object. | |
| 555 | + | // | |
| 556 | + | // This function is meant to be used by accessible implementations that are | |
| 557 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 558 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 559 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 560 | + | // interface, you will use this function to ensure that the parent of each | |
| 561 | + | // child widget is the metadata object, and the parent of each metadata | |
| 562 | + | // object is the container widget. | |
| 563 | + | func (x *NavigationSplitView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 564 | + | ||
| 565 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 566 | + | ||
| 567 | + | } | |
| 568 | + | ||
| 569 | + | // Updates the next accessible sibling. | |
| 570 | + | // | |
| 571 | + | // That might be useful when a new child of a custom accessible | |
| 572 | + | // is created, and it needs to be linked to a previous child. | |
| 573 | + | func (x *NavigationSplitView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 574 | + | ||
| 575 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 576 | + | ||
| 577 | + | } | |
| 578 | + | ||
| 579 | + | // Informs ATs that the platform state has changed. | |
| 580 | + | // | |
| 581 | + | // This function should be used by `GtkAccessible` implementations that | |
| 582 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 583 | + | // states automatically. | |
| 584 | + | func (x *NavigationSplitView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 585 | + | ||
| 586 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 587 | + | ||
| 588 | + | } | |
| 589 | + | ||
| 435 | 590 | // Updates a list of accessible properties. | |
| 436 | 591 | // | |
| 437 | 592 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -474,7 +629,7 @@ func (x *NavigationSplitView) UpdatePropertyValue(NPropertiesVar int, Properties | |||
| 474 | 629 | // relation change must be communicated to assistive technologies. | |
| 475 | 630 | // | |
| 476 | 631 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 477 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 632 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 478 | 633 | // | |
| 479 | 634 | // ```c | |
| 480 | 635 | // gtk_accessible_update_relation (accessible, | |
| @@ -504,13 +659,17 @@ func (x *NavigationSplitView) UpdateRelationValue(NRelationsVar int, RelationsVa | |||
| 504 | 659 | ||
| 505 | 660 | } | |
| 506 | 661 | ||
| 507 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 508 | - | // documentation for the value types of accessible states. | |
| 662 | + | // Updates a list of accessible states. | |
| 509 | 663 | // | |
| 510 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 511 | - | // state change must be communicated to assistive technologies. | |
| 664 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 665 | + | // value types of accessible states. | |
| 666 | + | // | |
| 667 | + | // This function should be called by `GtkWidget` types whenever | |
| 668 | + | // an accessible state change must be communicated to assistive | |
| 669 | + | // technologies. | |
| 512 | 670 | // | |
| 513 | 671 | // Example: | |
| 672 | + | // | |
| 514 | 673 | // ```c | |
| 515 | 674 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 516 | 675 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -540,7 +699,7 @@ func (x *NavigationSplitView) UpdateStateValue(NStatesVar int, StatesVar []gtk.A | |||
| 540 | 699 | // Gets the ID of the @buildable object. | |
| 541 | 700 | // | |
| 542 | 701 | // `GtkBuilder` sets the name based on the ID attribute | |
| 543 | - | // of the <object> tag used to construct the @buildable. | |
| 702 | + | // of the `<object>` tag used to construct the @buildable. | |
| 544 | 703 | func (x *NavigationSplitView) GetBuildableId() string { | |
| 545 | 704 | ||
| 546 | 705 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -565,6 +724,7 @@ func init() { | |||
| 565 | 724 | core.PuregoSafeRegister(&xNavigationSplitViewGetMinSidebarWidth, lib, "adw_navigation_split_view_get_min_sidebar_width") | |
| 566 | 725 | core.PuregoSafeRegister(&xNavigationSplitViewGetShowContent, lib, "adw_navigation_split_view_get_show_content") | |
| 567 | 726 | core.PuregoSafeRegister(&xNavigationSplitViewGetSidebar, lib, "adw_navigation_split_view_get_sidebar") | |
| 727 | + | core.PuregoSafeRegister(&xNavigationSplitViewGetSidebarPosition, lib, "adw_navigation_split_view_get_sidebar_position") | |
| 568 | 728 | core.PuregoSafeRegister(&xNavigationSplitViewGetSidebarWidthFraction, lib, "adw_navigation_split_view_get_sidebar_width_fraction") | |
| 569 | 729 | core.PuregoSafeRegister(&xNavigationSplitViewGetSidebarWidthUnit, lib, "adw_navigation_split_view_get_sidebar_width_unit") | |
| 570 | 730 | core.PuregoSafeRegister(&xNavigationSplitViewSetCollapsed, lib, "adw_navigation_split_view_set_collapsed") | |
| @@ -573,6 +733,7 @@ func init() { | |||
| 573 | 733 | core.PuregoSafeRegister(&xNavigationSplitViewSetMinSidebarWidth, lib, "adw_navigation_split_view_set_min_sidebar_width") | |
| 574 | 734 | core.PuregoSafeRegister(&xNavigationSplitViewSetShowContent, lib, "adw_navigation_split_view_set_show_content") | |
| 575 | 735 | core.PuregoSafeRegister(&xNavigationSplitViewSetSidebar, lib, "adw_navigation_split_view_set_sidebar") | |
| 736 | + | core.PuregoSafeRegister(&xNavigationSplitViewSetSidebarPosition, lib, "adw_navigation_split_view_set_sidebar_position") | |
| 576 | 737 | core.PuregoSafeRegister(&xNavigationSplitViewSetSidebarWidthFraction, lib, "adw_navigation_split_view_set_sidebar_width_fraction") | |
| 577 | 738 | core.PuregoSafeRegister(&xNavigationSplitViewSetSidebarWidthUnit, lib, "adw_navigation_split_view_set_sidebar_width_unit") | |
| 578 | 739 | ||
M v4/adw/adw-navigation-view.go +351 -20
| @@ -421,34 +421,165 @@ func (x *NavigationPage) ConnectShown(cb *func(NavigationPage)) uint32 { | |||
| 421 | 421 | return gobject.SignalConnect(x.GoPointer(), "shown", cbRefPtr) | |
| 422 | 422 | } | |
| 423 | 423 | ||
| 424 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 424 | + | // Requests the user's screen reader to announce the given message. | |
| 425 | + | // | |
| 426 | + | // This kind of notification is useful for messages that | |
| 427 | + | // either have only a visual representation or that are not | |
| 428 | + | // exposed visually at all, e.g. a notification about a | |
| 429 | + | // successful operation. | |
| 430 | + | // | |
| 431 | + | // Also, by using this API, you can ensure that the message | |
| 432 | + | // does not interrupts the user's current screen reader output. | |
| 433 | + | func (x *NavigationPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 434 | + | ||
| 435 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 436 | + | ||
| 437 | + | } | |
| 438 | + | ||
| 439 | + | // Retrieves the accessible parent for an accessible object. | |
| 440 | + | // | |
| 441 | + | // This function returns `NULL` for top level widgets. | |
| 442 | + | func (x *NavigationPage) GetAccessibleParent() *gtk.AccessibleBase { | |
| 443 | + | var cls *gtk.AccessibleBase | |
| 444 | + | ||
| 445 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 446 | + | ||
| 447 | + | if cret == 0 { | |
| 448 | + | return nil | |
| 449 | + | } | |
| 450 | + | cls = >k.AccessibleBase{} | |
| 451 | + | cls.Ptr = cret | |
| 452 | + | return cls | |
| 453 | + | } | |
| 454 | + | ||
| 455 | + | // Retrieves the accessible role of an accessible object. | |
| 425 | 456 | func (x *NavigationPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 426 | 457 | ||
| 427 | 458 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 428 | 459 | return cret | |
| 429 | 460 | } | |
| 430 | 461 | ||
| 431 | - | // Resets the accessible @property to its default value. | |
| 462 | + | // Retrieves the implementation for the given accessible object. | |
| 463 | + | func (x *NavigationPage) GetAtContext() *gtk.ATContext { | |
| 464 | + | var cls *gtk.ATContext | |
| 465 | + | ||
| 466 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 467 | + | ||
| 468 | + | if cret == 0 { | |
| 469 | + | return nil | |
| 470 | + | } | |
| 471 | + | cls = >k.ATContext{} | |
| 472 | + | cls.Ptr = cret | |
| 473 | + | return cls | |
| 474 | + | } | |
| 475 | + | ||
| 476 | + | // Queries the coordinates and dimensions of this accessible | |
| 477 | + | // | |
| 478 | + | // This functionality can be overridden by `GtkAccessible` | |
| 479 | + | // implementations, e.g. to get the bounds from an ignored | |
| 480 | + | // child widget. | |
| 481 | + | func (x *NavigationPage) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 482 | + | ||
| 483 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 484 | + | return cret | |
| 485 | + | } | |
| 486 | + | ||
| 487 | + | // Retrieves the first accessible child of an accessible object. | |
| 488 | + | func (x *NavigationPage) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 489 | + | var cls *gtk.AccessibleBase | |
| 490 | + | ||
| 491 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 492 | + | ||
| 493 | + | if cret == 0 { | |
| 494 | + | return nil | |
| 495 | + | } | |
| 496 | + | cls = >k.AccessibleBase{} | |
| 497 | + | cls.Ptr = cret | |
| 498 | + | return cls | |
| 499 | + | } | |
| 500 | + | ||
| 501 | + | // Retrieves the next accessible sibling of an accessible object | |
| 502 | + | func (x *NavigationPage) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 503 | + | var cls *gtk.AccessibleBase | |
| 504 | + | ||
| 505 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 506 | + | ||
| 507 | + | if cret == 0 { | |
| 508 | + | return nil | |
| 509 | + | } | |
| 510 | + | cls = >k.AccessibleBase{} | |
| 511 | + | cls.Ptr = cret | |
| 512 | + | return cls | |
| 513 | + | } | |
| 514 | + | ||
| 515 | + | // Queries a platform state, such as focus. | |
| 516 | + | // | |
| 517 | + | // This functionality can be overridden by `GtkAccessible` | |
| 518 | + | // implementations, e.g. to get platform state from an ignored | |
| 519 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 520 | + | func (x *NavigationPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 521 | + | ||
| 522 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 523 | + | return cret | |
| 524 | + | } | |
| 525 | + | ||
| 526 | + | // Resets the accessible property to its default value. | |
| 432 | 527 | func (x *NavigationPage) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 433 | 528 | ||
| 434 | 529 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 435 | 530 | ||
| 436 | 531 | } | |
| 437 | 532 | ||
| 438 | - | // Resets the accessible @relation to its default value. | |
| 533 | + | // Resets the accessible relation to its default value. | |
| 439 | 534 | func (x *NavigationPage) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 440 | 535 | ||
| 441 | 536 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 442 | 537 | ||
| 443 | 538 | } | |
| 444 | 539 | ||
| 445 | - | // Resets the accessible @state to its default value. | |
| 540 | + | // Resets the accessible state to its default value. | |
| 446 | 541 | func (x *NavigationPage) ResetState(StateVar gtk.AccessibleState) { | |
| 447 | 542 | ||
| 448 | 543 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 449 | 544 | ||
| 450 | 545 | } | |
| 451 | 546 | ||
| 547 | + | // Sets the parent and sibling of an accessible object. | |
| 548 | + | // | |
| 549 | + | // This function is meant to be used by accessible implementations that are | |
| 550 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 551 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 552 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 553 | + | // interface, you will use this function to ensure that the parent of each | |
| 554 | + | // child widget is the metadata object, and the parent of each metadata | |
| 555 | + | // object is the container widget. | |
| 556 | + | func (x *NavigationPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 557 | + | ||
| 558 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 559 | + | ||
| 560 | + | } | |
| 561 | + | ||
| 562 | + | // Updates the next accessible sibling. | |
| 563 | + | // | |
| 564 | + | // That might be useful when a new child of a custom accessible | |
| 565 | + | // is created, and it needs to be linked to a previous child. | |
| 566 | + | func (x *NavigationPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 567 | + | ||
| 568 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 569 | + | ||
| 570 | + | } | |
| 571 | + | ||
| 572 | + | // Informs ATs that the platform state has changed. | |
| 573 | + | // | |
| 574 | + | // This function should be used by `GtkAccessible` implementations that | |
| 575 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 576 | + | // states automatically. | |
| 577 | + | func (x *NavigationPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 578 | + | ||
| 579 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 580 | + | ||
| 581 | + | } | |
| 582 | + | ||
| 452 | 583 | // Updates a list of accessible properties. | |
| 453 | 584 | // | |
| 454 | 585 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -491,7 +622,7 @@ func (x *NavigationPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar [ | |||
| 491 | 622 | // relation change must be communicated to assistive technologies. | |
| 492 | 623 | // | |
| 493 | 624 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 494 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 625 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 495 | 626 | // | |
| 496 | 627 | // ```c | |
| 497 | 628 | // gtk_accessible_update_relation (accessible, | |
| @@ -521,13 +652,17 @@ func (x *NavigationPage) UpdateRelationValue(NRelationsVar int, RelationsVar []g | |||
| 521 | 652 | ||
| 522 | 653 | } | |
| 523 | 654 | ||
| 524 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 525 | - | // documentation for the value types of accessible states. | |
| 655 | + | // Updates a list of accessible states. | |
| 526 | 656 | // | |
| 527 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 528 | - | // state change must be communicated to assistive technologies. | |
| 657 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 658 | + | // value types of accessible states. | |
| 659 | + | // | |
| 660 | + | // This function should be called by `GtkWidget` types whenever | |
| 661 | + | // an accessible state change must be communicated to assistive | |
| 662 | + | // technologies. | |
| 529 | 663 | // | |
| 530 | 664 | // Example: | |
| 665 | + | // | |
| 531 | 666 | // ```c | |
| 532 | 667 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 533 | 668 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -557,7 +692,7 @@ func (x *NavigationPage) UpdateStateValue(NStatesVar int, StatesVar []gtk.Access | |||
| 557 | 692 | // Gets the ID of the @buildable object. | |
| 558 | 693 | // | |
| 559 | 694 | // `GtkBuilder` sets the name based on the ID attribute | |
| 560 | - | // of the <object> tag used to construct the @buildable. | |
| 695 | + | // of the `<object>` tag used to construct the @buildable. | |
| 561 | 696 | func (x *NavigationPage) GetBuildableId() string { | |
| 562 | 697 | ||
| 563 | 698 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -805,6 +940,15 @@ func (x *NavigationView) GetAnimateTransitions() bool { | |||
| 805 | 940 | return cret | |
| 806 | 941 | } | |
| 807 | 942 | ||
| 943 | + | var xNavigationViewGetHhomogeneous func(uintptr) bool | |
| 944 | + | ||
| 945 | + | // Gets whether @self is horizontally homogeneous. | |
| 946 | + | func (x *NavigationView) GetHhomogeneous() bool { | |
| 947 | + | ||
| 948 | + | cret := xNavigationViewGetHhomogeneous(x.GoPointer()) | |
| 949 | + | return cret | |
| 950 | + | } | |
| 951 | + | ||
| 808 | 952 | var xNavigationViewGetNavigationStack func(uintptr) uintptr | |
| 809 | 953 | ||
| 810 | 954 | // Returns a [iface@Gio.ListModel] that contains the pages in navigation stack. | |
| @@ -856,6 +1000,15 @@ func (x *NavigationView) GetPreviousPage(PageVar *NavigationPage) *NavigationPag | |||
| 856 | 1000 | return cls | |
| 857 | 1001 | } | |
| 858 | 1002 | ||
| 1003 | + | var xNavigationViewGetVhomogeneous func(uintptr) bool | |
| 1004 | + | ||
| 1005 | + | // Gets whether @self is vertically homogeneous. | |
| 1006 | + | func (x *NavigationView) GetVhomogeneous() bool { | |
| 1007 | + | ||
| 1008 | + | cret := xNavigationViewGetVhomogeneous(x.GoPointer()) | |
| 1009 | + | return cret | |
| 1010 | + | } | |
| 1011 | + | ||
| 859 | 1012 | var xNavigationViewGetVisiblePage func(uintptr) uintptr | |
| 860 | 1013 | ||
| 861 | 1014 | // Gets the currently visible page in @self. | |
| @@ -873,6 +1026,15 @@ func (x *NavigationView) GetVisiblePage() *NavigationPage { | |||
| 873 | 1026 | return cls | |
| 874 | 1027 | } | |
| 875 | 1028 | ||
| 1029 | + | var xNavigationViewGetVisiblePageTag func(uintptr) string | |
| 1030 | + | ||
| 1031 | + | // Gets the tag of the currently visible page in @self. | |
| 1032 | + | func (x *NavigationView) GetVisiblePageTag() string { | |
| 1033 | + | ||
| 1034 | + | cret := xNavigationViewGetVisiblePageTag(x.GoPointer()) | |
| 1035 | + | return cret | |
| 1036 | + | } | |
| 1037 | + | ||
| 876 | 1038 | var xNavigationViewPop func(uintptr) bool | |
| 877 | 1039 | ||
| 878 | 1040 | // Pops the visible page from the navigation stack. | |
| @@ -1032,6 +1194,20 @@ func (x *NavigationView) SetAnimateTransitions(AnimateTransitionsVar bool) { | |||
| 1032 | 1194 | ||
| 1033 | 1195 | } | |
| 1034 | 1196 | ||
| 1197 | + | var xNavigationViewSetHhomogeneous func(uintptr, bool) | |
| 1198 | + | ||
| 1199 | + | // Sets @self to be horizontally homogeneous or not. | |
| 1200 | + | // | |
| 1201 | + | // If the view is horizontally homogeneous, it allocates the same width for | |
| 1202 | + | // all pages. | |
| 1203 | + | // | |
| 1204 | + | // If it's not, the view may change width when a different page becomes visible. | |
| 1205 | + | func (x *NavigationView) SetHhomogeneous(HhomogeneousVar bool) { | |
| 1206 | + | ||
| 1207 | + | xNavigationViewSetHhomogeneous(x.GoPointer(), HhomogeneousVar) | |
| 1208 | + | ||
| 1209 | + | } | |
| 1210 | + | ||
| 1035 | 1211 | var xNavigationViewSetPopOnEscape func(uintptr, bool) | |
| 1036 | 1212 | ||
| 1037 | 1213 | // Sets whether pressing Escape pops the current page on @self. | |
| @@ -1044,6 +1220,21 @@ func (x *NavigationView) SetPopOnEscape(PopOnEscapeVar bool) { | |||
| 1044 | 1220 | ||
| 1045 | 1221 | } | |
| 1046 | 1222 | ||
| 1223 | + | var xNavigationViewSetVhomogeneous func(uintptr, bool) | |
| 1224 | + | ||
| 1225 | + | // Sets @self to be vertically homogeneous or not. | |
| 1226 | + | // | |
| 1227 | + | // If the view is vertically homogeneous, it allocates the same height for | |
| 1228 | + | // all pages. | |
| 1229 | + | // | |
| 1230 | + | // If it's not, the view may change height when a different page becomes | |
| 1231 | + | // visible. | |
| 1232 | + | func (x *NavigationView) SetVhomogeneous(VhomogeneousVar bool) { | |
| 1233 | + | ||
| 1234 | + | xNavigationViewSetVhomogeneous(x.GoPointer(), VhomogeneousVar) | |
| 1235 | + | ||
| 1236 | + | } | |
| 1237 | + | ||
| 1047 | 1238 | func (c *NavigationView) GoPointer() uintptr { | |
| 1048 | 1239 | if c == nil { | |
| 1049 | 1240 | return 0 | |
| @@ -1204,34 +1395,165 @@ func (x *NavigationView) GetSwipeArea(NavigationDirectionVar NavigationDirection | |||
| 1204 | 1395 | ||
| 1205 | 1396 | } | |
| 1206 | 1397 | ||
| 1207 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 1398 | + | // Requests the user's screen reader to announce the given message. | |
| 1399 | + | // | |
| 1400 | + | // This kind of notification is useful for messages that | |
| 1401 | + | // either have only a visual representation or that are not | |
| 1402 | + | // exposed visually at all, e.g. a notification about a | |
| 1403 | + | // successful operation. | |
| 1404 | + | // | |
| 1405 | + | // Also, by using this API, you can ensure that the message | |
| 1406 | + | // does not interrupts the user's current screen reader output. | |
| 1407 | + | func (x *NavigationView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 1408 | + | ||
| 1409 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 1410 | + | ||
| 1411 | + | } | |
| 1412 | + | ||
| 1413 | + | // Retrieves the accessible parent for an accessible object. | |
| 1414 | + | // | |
| 1415 | + | // This function returns `NULL` for top level widgets. | |
| 1416 | + | func (x *NavigationView) GetAccessibleParent() *gtk.AccessibleBase { | |
| 1417 | + | var cls *gtk.AccessibleBase | |
| 1418 | + | ||
| 1419 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 1420 | + | ||
| 1421 | + | if cret == 0 { | |
| 1422 | + | return nil | |
| 1423 | + | } | |
| 1424 | + | cls = >k.AccessibleBase{} | |
| 1425 | + | cls.Ptr = cret | |
| 1426 | + | return cls | |
| 1427 | + | } | |
| 1428 | + | ||
| 1429 | + | // Retrieves the accessible role of an accessible object. | |
| 1208 | 1430 | func (x *NavigationView) GetAccessibleRole() gtk.AccessibleRole { | |
| 1209 | 1431 | ||
| 1210 | 1432 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 1211 | 1433 | return cret | |
| 1212 | 1434 | } | |
| 1213 | 1435 | ||
| 1214 | - | // Resets the accessible @property to its default value. | |
| 1436 | + | // Retrieves the implementation for the given accessible object. | |
| 1437 | + | func (x *NavigationView) GetAtContext() *gtk.ATContext { | |
| 1438 | + | var cls *gtk.ATContext | |
| 1439 | + | ||
| 1440 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 1441 | + | ||
| 1442 | + | if cret == 0 { | |
| 1443 | + | return nil | |
| 1444 | + | } | |
| 1445 | + | cls = >k.ATContext{} | |
| 1446 | + | cls.Ptr = cret | |
| 1447 | + | return cls | |
| 1448 | + | } | |
| 1449 | + | ||
| 1450 | + | // Queries the coordinates and dimensions of this accessible | |
| 1451 | + | // | |
| 1452 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1453 | + | // implementations, e.g. to get the bounds from an ignored | |
| 1454 | + | // child widget. | |
| 1455 | + | func (x *NavigationView) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 1456 | + | ||
| 1457 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 1458 | + | return cret | |
| 1459 | + | } | |
| 1460 | + | ||
| 1461 | + | // Retrieves the first accessible child of an accessible object. | |
| 1462 | + | func (x *NavigationView) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 1463 | + | var cls *gtk.AccessibleBase | |
| 1464 | + | ||
| 1465 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 1466 | + | ||
| 1467 | + | if cret == 0 { | |
| 1468 | + | return nil | |
| 1469 | + | } | |
| 1470 | + | cls = >k.AccessibleBase{} | |
| 1471 | + | cls.Ptr = cret | |
| 1472 | + | return cls | |
| 1473 | + | } | |
| 1474 | + | ||
| 1475 | + | // Retrieves the next accessible sibling of an accessible object | |
| 1476 | + | func (x *NavigationView) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 1477 | + | var cls *gtk.AccessibleBase | |
| 1478 | + | ||
| 1479 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 1480 | + | ||
| 1481 | + | if cret == 0 { | |
| 1482 | + | return nil | |
| 1483 | + | } | |
| 1484 | + | cls = >k.AccessibleBase{} | |
| 1485 | + | cls.Ptr = cret | |
| 1486 | + | return cls | |
| 1487 | + | } | |
| 1488 | + | ||
| 1489 | + | // Queries a platform state, such as focus. | |
| 1490 | + | // | |
| 1491 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1492 | + | // implementations, e.g. to get platform state from an ignored | |
| 1493 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 1494 | + | func (x *NavigationView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 1495 | + | ||
| 1496 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 1497 | + | return cret | |
| 1498 | + | } | |
| 1499 | + | ||
| 1500 | + | // Resets the accessible property to its default value. | |
| 1215 | 1501 | func (x *NavigationView) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 1216 | 1502 | ||
| 1217 | 1503 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 1218 | 1504 | ||
| 1219 | 1505 | } | |
| 1220 | 1506 | ||
| 1221 | - | // Resets the accessible @relation to its default value. | |
| 1507 | + | // Resets the accessible relation to its default value. | |
| 1222 | 1508 | func (x *NavigationView) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 1223 | 1509 | ||
| 1224 | 1510 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 1225 | 1511 | ||
| 1226 | 1512 | } | |
| 1227 | 1513 | ||
| 1228 | - | // Resets the accessible @state to its default value. | |
| 1514 | + | // Resets the accessible state to its default value. | |
| 1229 | 1515 | func (x *NavigationView) ResetState(StateVar gtk.AccessibleState) { | |
| 1230 | 1516 | ||
| 1231 | 1517 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 1232 | 1518 | ||
| 1233 | 1519 | } | |
| 1234 | 1520 | ||
| 1521 | + | // Sets the parent and sibling of an accessible object. | |
| 1522 | + | // | |
| 1523 | + | // This function is meant to be used by accessible implementations that are | |
| 1524 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 1525 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 1526 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 1527 | + | // interface, you will use this function to ensure that the parent of each | |
| 1528 | + | // child widget is the metadata object, and the parent of each metadata | |
| 1529 | + | // object is the container widget. | |
| 1530 | + | func (x *NavigationView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 1531 | + | ||
| 1532 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 1533 | + | ||
| 1534 | + | } | |
| 1535 | + | ||
| 1536 | + | // Updates the next accessible sibling. | |
| 1537 | + | // | |
| 1538 | + | // That might be useful when a new child of a custom accessible | |
| 1539 | + | // is created, and it needs to be linked to a previous child. | |
| 1540 | + | func (x *NavigationView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 1541 | + | ||
| 1542 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 1543 | + | ||
| 1544 | + | } | |
| 1545 | + | ||
| 1546 | + | // Informs ATs that the platform state has changed. | |
| 1547 | + | // | |
| 1548 | + | // This function should be used by `GtkAccessible` implementations that | |
| 1549 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 1550 | + | // states automatically. | |
| 1551 | + | func (x *NavigationView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 1552 | + | ||
| 1553 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 1554 | + | ||
| 1555 | + | } | |
| 1556 | + | ||
| 1235 | 1557 | // Updates a list of accessible properties. | |
| 1236 | 1558 | // | |
| 1237 | 1559 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -1274,7 +1596,7 @@ func (x *NavigationView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar [ | |||
| 1274 | 1596 | // relation change must be communicated to assistive technologies. | |
| 1275 | 1597 | // | |
| 1276 | 1598 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 1277 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 1599 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 1278 | 1600 | // | |
| 1279 | 1601 | // ```c | |
| 1280 | 1602 | // gtk_accessible_update_relation (accessible, | |
| @@ -1304,13 +1626,17 @@ func (x *NavigationView) UpdateRelationValue(NRelationsVar int, RelationsVar []g | |||
| 1304 | 1626 | ||
| 1305 | 1627 | } | |
| 1306 | 1628 | ||
| 1307 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 1308 | - | // documentation for the value types of accessible states. | |
| 1629 | + | // Updates a list of accessible states. | |
| 1309 | 1630 | // | |
| 1310 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 1311 | - | // state change must be communicated to assistive technologies. | |
| 1631 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 1632 | + | // value types of accessible states. | |
| 1633 | + | // | |
| 1634 | + | // This function should be called by `GtkWidget` types whenever | |
| 1635 | + | // an accessible state change must be communicated to assistive | |
| 1636 | + | // technologies. | |
| 1312 | 1637 | // | |
| 1313 | 1638 | // Example: | |
| 1639 | + | // | |
| 1314 | 1640 | // ```c | |
| 1315 | 1641 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 1316 | 1642 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -1340,7 +1666,7 @@ func (x *NavigationView) UpdateStateValue(NStatesVar int, StatesVar []gtk.Access | |||
| 1340 | 1666 | // Gets the ID of the @buildable object. | |
| 1341 | 1667 | // | |
| 1342 | 1668 | // `GtkBuilder` sets the name based on the ID attribute | |
| 1343 | - | // of the <object> tag used to construct the @buildable. | |
| 1669 | + | // of the `<object>` tag used to construct the @buildable. | |
| 1344 | 1670 | func (x *NavigationView) GetBuildableId() string { | |
| 1345 | 1671 | ||
| 1346 | 1672 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -1376,10 +1702,13 @@ func init() { | |||
| 1376 | 1702 | core.PuregoSafeRegister(&xNavigationViewAdd, lib, "adw_navigation_view_add") | |
| 1377 | 1703 | core.PuregoSafeRegister(&xNavigationViewFindPage, lib, "adw_navigation_view_find_page") | |
| 1378 | 1704 | core.PuregoSafeRegister(&xNavigationViewGetAnimateTransitions, lib, "adw_navigation_view_get_animate_transitions") | |
| 1705 | + | core.PuregoSafeRegister(&xNavigationViewGetHhomogeneous, lib, "adw_navigation_view_get_hhomogeneous") | |
| 1379 | 1706 | core.PuregoSafeRegister(&xNavigationViewGetNavigationStack, lib, "adw_navigation_view_get_navigation_stack") | |
| 1380 | 1707 | core.PuregoSafeRegister(&xNavigationViewGetPopOnEscape, lib, "adw_navigation_view_get_pop_on_escape") | |
| 1381 | 1708 | core.PuregoSafeRegister(&xNavigationViewGetPreviousPage, lib, "adw_navigation_view_get_previous_page") | |
| 1709 | + | core.PuregoSafeRegister(&xNavigationViewGetVhomogeneous, lib, "adw_navigation_view_get_vhomogeneous") | |
| 1382 | 1710 | core.PuregoSafeRegister(&xNavigationViewGetVisiblePage, lib, "adw_navigation_view_get_visible_page") | |
| 1711 | + | core.PuregoSafeRegister(&xNavigationViewGetVisiblePageTag, lib, "adw_navigation_view_get_visible_page_tag") | |
| 1383 | 1712 | core.PuregoSafeRegister(&xNavigationViewPop, lib, "adw_navigation_view_pop") | |
| 1384 | 1713 | core.PuregoSafeRegister(&xNavigationViewPopToPage, lib, "adw_navigation_view_pop_to_page") | |
| 1385 | 1714 | core.PuregoSafeRegister(&xNavigationViewPopToTag, lib, "adw_navigation_view_pop_to_tag") | |
| @@ -1389,6 +1718,8 @@ func init() { | |||
| 1389 | 1718 | core.PuregoSafeRegister(&xNavigationViewReplace, lib, "adw_navigation_view_replace") | |
| 1390 | 1719 | core.PuregoSafeRegister(&xNavigationViewReplaceWithTags, lib, "adw_navigation_view_replace_with_tags") | |
| 1391 | 1720 | core.PuregoSafeRegister(&xNavigationViewSetAnimateTransitions, lib, "adw_navigation_view_set_animate_transitions") | |
| 1721 | + | core.PuregoSafeRegister(&xNavigationViewSetHhomogeneous, lib, "adw_navigation_view_set_hhomogeneous") | |
| 1392 | 1722 | core.PuregoSafeRegister(&xNavigationViewSetPopOnEscape, lib, "adw_navigation_view_set_pop_on_escape") | |
| 1723 | + | core.PuregoSafeRegister(&xNavigationViewSetVhomogeneous, lib, "adw_navigation_view_set_vhomogeneous") | |
| 1393 | 1724 | ||
| 1394 | 1725 | } | |
M v4/adw/adw-overlay-split-view.go +145 -10
| @@ -522,34 +522,165 @@ func (x *OverlaySplitView) GetSwipeArea(NavigationDirectionVar NavigationDirecti | |||
| 522 | 522 | ||
| 523 | 523 | } | |
| 524 | 524 | ||
| 525 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 525 | + | // Requests the user's screen reader to announce the given message. | |
| 526 | + | // | |
| 527 | + | // This kind of notification is useful for messages that | |
| 528 | + | // either have only a visual representation or that are not | |
| 529 | + | // exposed visually at all, e.g. a notification about a | |
| 530 | + | // successful operation. | |
| 531 | + | // | |
| 532 | + | // Also, by using this API, you can ensure that the message | |
| 533 | + | // does not interrupts the user's current screen reader output. | |
| 534 | + | func (x *OverlaySplitView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 535 | + | ||
| 536 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 537 | + | ||
| 538 | + | } | |
| 539 | + | ||
| 540 | + | // Retrieves the accessible parent for an accessible object. | |
| 541 | + | // | |
| 542 | + | // This function returns `NULL` for top level widgets. | |
| 543 | + | func (x *OverlaySplitView) GetAccessibleParent() *gtk.AccessibleBase { | |
| 544 | + | var cls *gtk.AccessibleBase | |
| 545 | + | ||
| 546 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 547 | + | ||
| 548 | + | if cret == 0 { | |
| 549 | + | return nil | |
| 550 | + | } | |
| 551 | + | cls = >k.AccessibleBase{} | |
| 552 | + | cls.Ptr = cret | |
| 553 | + | return cls | |
| 554 | + | } | |
| 555 | + | ||
| 556 | + | // Retrieves the accessible role of an accessible object. | |
| 526 | 557 | func (x *OverlaySplitView) GetAccessibleRole() gtk.AccessibleRole { | |
| 527 | 558 | ||
| 528 | 559 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 529 | 560 | return cret | |
| 530 | 561 | } | |
| 531 | 562 | ||
| 532 | - | // Resets the accessible @property to its default value. | |
| 563 | + | // Retrieves the implementation for the given accessible object. | |
| 564 | + | func (x *OverlaySplitView) GetAtContext() *gtk.ATContext { | |
| 565 | + | var cls *gtk.ATContext | |
| 566 | + | ||
| 567 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 568 | + | ||
| 569 | + | if cret == 0 { | |
| 570 | + | return nil | |
| 571 | + | } | |
| 572 | + | cls = >k.ATContext{} | |
| 573 | + | cls.Ptr = cret | |
| 574 | + | return cls | |
| 575 | + | } | |
| 576 | + | ||
| 577 | + | // Queries the coordinates and dimensions of this accessible | |
| 578 | + | // | |
| 579 | + | // This functionality can be overridden by `GtkAccessible` | |
| 580 | + | // implementations, e.g. to get the bounds from an ignored | |
| 581 | + | // child widget. | |
| 582 | + | func (x *OverlaySplitView) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 583 | + | ||
| 584 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 585 | + | return cret | |
| 586 | + | } | |
| 587 | + | ||
| 588 | + | // Retrieves the first accessible child of an accessible object. | |
| 589 | + | func (x *OverlaySplitView) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 590 | + | var cls *gtk.AccessibleBase | |
| 591 | + | ||
| 592 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 593 | + | ||
| 594 | + | if cret == 0 { | |
| 595 | + | return nil | |
| 596 | + | } | |
| 597 | + | cls = >k.AccessibleBase{} | |
| 598 | + | cls.Ptr = cret | |
| 599 | + | return cls | |
| 600 | + | } | |
| 601 | + | ||
| 602 | + | // Retrieves the next accessible sibling of an accessible object | |
| 603 | + | func (x *OverlaySplitView) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 604 | + | var cls *gtk.AccessibleBase | |
| 605 | + | ||
| 606 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 607 | + | ||
| 608 | + | if cret == 0 { | |
| 609 | + | return nil | |
| 610 | + | } | |
| 611 | + | cls = >k.AccessibleBase{} | |
| 612 | + | cls.Ptr = cret | |
| 613 | + | return cls | |
| 614 | + | } | |
| 615 | + | ||
| 616 | + | // Queries a platform state, such as focus. | |
| 617 | + | // | |
| 618 | + | // This functionality can be overridden by `GtkAccessible` | |
| 619 | + | // implementations, e.g. to get platform state from an ignored | |
| 620 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 621 | + | func (x *OverlaySplitView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 622 | + | ||
| 623 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 624 | + | return cret | |
| 625 | + | } | |
| 626 | + | ||
| 627 | + | // Resets the accessible property to its default value. | |
| 533 | 628 | func (x *OverlaySplitView) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 534 | 629 | ||
| 535 | 630 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 536 | 631 | ||
| 537 | 632 | } | |
| 538 | 633 | ||
| 539 | - | // Resets the accessible @relation to its default value. | |
| 634 | + | // Resets the accessible relation to its default value. | |
| 540 | 635 | func (x *OverlaySplitView) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 541 | 636 | ||
| 542 | 637 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 543 | 638 | ||
| 544 | 639 | } | |
| 545 | 640 | ||
| 546 | - | // Resets the accessible @state to its default value. | |
| 641 | + | // Resets the accessible state to its default value. | |
| 547 | 642 | func (x *OverlaySplitView) ResetState(StateVar gtk.AccessibleState) { | |
| 548 | 643 | ||
| 549 | 644 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 550 | 645 | ||
| 551 | 646 | } | |
| 552 | 647 | ||
| 648 | + | // Sets the parent and sibling of an accessible object. | |
| 649 | + | // | |
| 650 | + | // This function is meant to be used by accessible implementations that are | |
| 651 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 652 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 653 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 654 | + | // interface, you will use this function to ensure that the parent of each | |
| 655 | + | // child widget is the metadata object, and the parent of each metadata | |
| 656 | + | // object is the container widget. | |
| 657 | + | func (x *OverlaySplitView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 658 | + | ||
| 659 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 660 | + | ||
| 661 | + | } | |
| 662 | + | ||
| 663 | + | // Updates the next accessible sibling. | |
| 664 | + | // | |
| 665 | + | // That might be useful when a new child of a custom accessible | |
| 666 | + | // is created, and it needs to be linked to a previous child. | |
| 667 | + | func (x *OverlaySplitView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 668 | + | ||
| 669 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 670 | + | ||
| 671 | + | } | |
| 672 | + | ||
| 673 | + | // Informs ATs that the platform state has changed. | |
| 674 | + | // | |
| 675 | + | // This function should be used by `GtkAccessible` implementations that | |
| 676 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 677 | + | // states automatically. | |
| 678 | + | func (x *OverlaySplitView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 679 | + | ||
| 680 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 681 | + | ||
| 682 | + | } | |
| 683 | + | ||
| 553 | 684 | // Updates a list of accessible properties. | |
| 554 | 685 | // | |
| 555 | 686 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -592,7 +723,7 @@ func (x *OverlaySplitView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar | |||
| 592 | 723 | // relation change must be communicated to assistive technologies. | |
| 593 | 724 | // | |
| 594 | 725 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 595 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 726 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 596 | 727 | // | |
| 597 | 728 | // ```c | |
| 598 | 729 | // gtk_accessible_update_relation (accessible, | |
| @@ -622,13 +753,17 @@ func (x *OverlaySplitView) UpdateRelationValue(NRelationsVar int, RelationsVar [ | |||
| 622 | 753 | ||
| 623 | 754 | } | |
| 624 | 755 | ||
| 625 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 626 | - | // documentation for the value types of accessible states. | |
| 756 | + | // Updates a list of accessible states. | |
| 627 | 757 | // | |
| 628 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 629 | - | // state change must be communicated to assistive technologies. | |
| 758 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 759 | + | // value types of accessible states. | |
| 760 | + | // | |
| 761 | + | // This function should be called by `GtkWidget` types whenever | |
| 762 | + | // an accessible state change must be communicated to assistive | |
| 763 | + | // technologies. | |
| 630 | 764 | // | |
| 631 | 765 | // Example: | |
| 766 | + | // | |
| 632 | 767 | // ```c | |
| 633 | 768 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 634 | 769 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -658,7 +793,7 @@ func (x *OverlaySplitView) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acce | |||
| 658 | 793 | // Gets the ID of the @buildable object. | |
| 659 | 794 | // | |
| 660 | 795 | // `GtkBuilder` sets the name based on the ID attribute | |
| 661 | - | // of the <object> tag used to construct the @buildable. | |
| 796 | + | // of the `<object>` tag used to construct the @buildable. | |
| 662 | 797 | func (x *OverlaySplitView) GetBuildableId() string { | |
| 663 | 798 | ||
| 664 | 799 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-password-entry-row.go +187 -10
| @@ -88,34 +88,165 @@ func (c *PasswordEntryRow) SetGoPointer(ptr uintptr) { | |||
| 88 | 88 | c.Ptr = ptr | |
| 89 | 89 | } | |
| 90 | 90 | ||
| 91 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 91 | + | // Requests the user's screen reader to announce the given message. | |
| 92 | + | // | |
| 93 | + | // This kind of notification is useful for messages that | |
| 94 | + | // either have only a visual representation or that are not | |
| 95 | + | // exposed visually at all, e.g. a notification about a | |
| 96 | + | // successful operation. | |
| 97 | + | // | |
| 98 | + | // Also, by using this API, you can ensure that the message | |
| 99 | + | // does not interrupts the user's current screen reader output. | |
| 100 | + | func (x *PasswordEntryRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 101 | + | ||
| 102 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 103 | + | ||
| 104 | + | } | |
| 105 | + | ||
| 106 | + | // Retrieves the accessible parent for an accessible object. | |
| 107 | + | // | |
| 108 | + | // This function returns `NULL` for top level widgets. | |
| 109 | + | func (x *PasswordEntryRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 110 | + | var cls *gtk.AccessibleBase | |
| 111 | + | ||
| 112 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 113 | + | ||
| 114 | + | if cret == 0 { | |
| 115 | + | return nil | |
| 116 | + | } | |
| 117 | + | cls = >k.AccessibleBase{} | |
| 118 | + | cls.Ptr = cret | |
| 119 | + | return cls | |
| 120 | + | } | |
| 121 | + | ||
| 122 | + | // Retrieves the accessible role of an accessible object. | |
| 92 | 123 | func (x *PasswordEntryRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 93 | 124 | ||
| 94 | 125 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 95 | 126 | return cret | |
| 96 | 127 | } | |
| 97 | 128 | ||
| 98 | - | // Resets the accessible @property to its default value. | |
| 129 | + | // Retrieves the implementation for the given accessible object. | |
| 130 | + | func (x *PasswordEntryRow) GetAtContext() *gtk.ATContext { | |
| 131 | + | var cls *gtk.ATContext | |
| 132 | + | ||
| 133 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 134 | + | ||
| 135 | + | if cret == 0 { | |
| 136 | + | return nil | |
| 137 | + | } | |
| 138 | + | cls = >k.ATContext{} | |
| 139 | + | cls.Ptr = cret | |
| 140 | + | return cls | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | // Queries the coordinates and dimensions of this accessible | |
| 144 | + | // | |
| 145 | + | // This functionality can be overridden by `GtkAccessible` | |
| 146 | + | // implementations, e.g. to get the bounds from an ignored | |
| 147 | + | // child widget. | |
| 148 | + | func (x *PasswordEntryRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 149 | + | ||
| 150 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 151 | + | return cret | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | // Retrieves the first accessible child of an accessible object. | |
| 155 | + | func (x *PasswordEntryRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 156 | + | var cls *gtk.AccessibleBase | |
| 157 | + | ||
| 158 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 159 | + | ||
| 160 | + | if cret == 0 { | |
| 161 | + | return nil | |
| 162 | + | } | |
| 163 | + | cls = >k.AccessibleBase{} | |
| 164 | + | cls.Ptr = cret | |
| 165 | + | return cls | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | // Retrieves the next accessible sibling of an accessible object | |
| 169 | + | func (x *PasswordEntryRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 170 | + | var cls *gtk.AccessibleBase | |
| 171 | + | ||
| 172 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 173 | + | ||
| 174 | + | if cret == 0 { | |
| 175 | + | return nil | |
| 176 | + | } | |
| 177 | + | cls = >k.AccessibleBase{} | |
| 178 | + | cls.Ptr = cret | |
| 179 | + | return cls | |
| 180 | + | } | |
| 181 | + | ||
| 182 | + | // Queries a platform state, such as focus. | |
| 183 | + | // | |
| 184 | + | // This functionality can be overridden by `GtkAccessible` | |
| 185 | + | // implementations, e.g. to get platform state from an ignored | |
| 186 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 187 | + | func (x *PasswordEntryRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 188 | + | ||
| 189 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 190 | + | return cret | |
| 191 | + | } | |
| 192 | + | ||
| 193 | + | // Resets the accessible property to its default value. | |
| 99 | 194 | func (x *PasswordEntryRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 100 | 195 | ||
| 101 | 196 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 102 | 197 | ||
| 103 | 198 | } | |
| 104 | 199 | ||
| 105 | - | // Resets the accessible @relation to its default value. | |
| 200 | + | // Resets the accessible relation to its default value. | |
| 106 | 201 | func (x *PasswordEntryRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 107 | 202 | ||
| 108 | 203 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 109 | 204 | ||
| 110 | 205 | } | |
| 111 | 206 | ||
| 112 | - | // Resets the accessible @state to its default value. | |
| 207 | + | // Resets the accessible state to its default value. | |
| 113 | 208 | func (x *PasswordEntryRow) ResetState(StateVar gtk.AccessibleState) { | |
| 114 | 209 | ||
| 115 | 210 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 116 | 211 | ||
| 117 | 212 | } | |
| 118 | 213 | ||
| 214 | + | // Sets the parent and sibling of an accessible object. | |
| 215 | + | // | |
| 216 | + | // This function is meant to be used by accessible implementations that are | |
| 217 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 218 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 219 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 220 | + | // interface, you will use this function to ensure that the parent of each | |
| 221 | + | // child widget is the metadata object, and the parent of each metadata | |
| 222 | + | // object is the container widget. | |
| 223 | + | func (x *PasswordEntryRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 224 | + | ||
| 225 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 226 | + | ||
| 227 | + | } | |
| 228 | + | ||
| 229 | + | // Updates the next accessible sibling. | |
| 230 | + | // | |
| 231 | + | // That might be useful when a new child of a custom accessible | |
| 232 | + | // is created, and it needs to be linked to a previous child. | |
| 233 | + | func (x *PasswordEntryRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 234 | + | ||
| 235 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 236 | + | ||
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // Informs ATs that the platform state has changed. | |
| 240 | + | // | |
| 241 | + | // This function should be used by `GtkAccessible` implementations that | |
| 242 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 243 | + | // states automatically. | |
| 244 | + | func (x *PasswordEntryRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 245 | + | ||
| 246 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 247 | + | ||
| 248 | + | } | |
| 249 | + | ||
| 119 | 250 | // Updates a list of accessible properties. | |
| 120 | 251 | // | |
| 121 | 252 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -158,7 +289,7 @@ func (x *PasswordEntryRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar | |||
| 158 | 289 | // relation change must be communicated to assistive technologies. | |
| 159 | 290 | // | |
| 160 | 291 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 161 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 292 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 162 | 293 | // | |
| 163 | 294 | // ```c | |
| 164 | 295 | // gtk_accessible_update_relation (accessible, | |
| @@ -188,13 +319,17 @@ func (x *PasswordEntryRow) UpdateRelationValue(NRelationsVar int, RelationsVar [ | |||
| 188 | 319 | ||
| 189 | 320 | } | |
| 190 | 321 | ||
| 191 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 192 | - | // documentation for the value types of accessible states. | |
| 322 | + | // Updates a list of accessible states. | |
| 193 | 323 | // | |
| 194 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 195 | - | // state change must be communicated to assistive technologies. | |
| 324 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 325 | + | // value types of accessible states. | |
| 326 | + | // | |
| 327 | + | // This function should be called by `GtkWidget` types whenever | |
| 328 | + | // an accessible state change must be communicated to assistive | |
| 329 | + | // technologies. | |
| 196 | 330 | // | |
| 197 | 331 | // Example: | |
| 332 | + | // | |
| 198 | 333 | // ```c | |
| 199 | 334 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 200 | 335 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -307,13 +442,55 @@ func (x *PasswordEntryRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 307 | 442 | // Gets the ID of the @buildable object. | |
| 308 | 443 | // | |
| 309 | 444 | // `GtkBuilder` sets the name based on the ID attribute | |
| 310 | - | // of the <object> tag used to construct the @buildable. | |
| 445 | + | // of the `<object>` tag used to construct the @buildable. | |
| 311 | 446 | func (x *PasswordEntryRow) GetBuildableId() string { | |
| 312 | 447 | ||
| 313 | 448 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 314 | 449 | return cret | |
| 315 | 450 | } | |
| 316 | 451 | ||
| 452 | + | // Retrieves the accessible platform state from the editable delegate. | |
| 453 | + | // | |
| 454 | + | // This is an helper function to retrieve the accessible state for | |
| 455 | + | // `GtkEditable` interface implementations using a delegate pattern. | |
| 456 | + | // | |
| 457 | + | // You should call this function in your editable widget implementation | |
| 458 | + | // of the [vfunc@Gtk.Accessible.get_platform_state] virtual function, for | |
| 459 | + | // instance: | |
| 460 | + | // | |
| 461 | + | // ```c | |
| 462 | + | // static void | |
| 463 | + | // accessible_interface_init (GtkAccessibleInterface *iface) | |
| 464 | + | // | |
| 465 | + | // { | |
| 466 | + | // iface->get_platform_state = your_editable_get_accessible_platform_state; | |
| 467 | + | // } | |
| 468 | + | // | |
| 469 | + | // static gboolean | |
| 470 | + | // your_editable_get_accessible_platform_state (GtkAccessible *accessible, | |
| 471 | + | // | |
| 472 | + | // GtkAccessiblePlatformState state) | |
| 473 | + | // | |
| 474 | + | // { | |
| 475 | + | // return gtk_editable_delegate_get_accessible_platform_state (GTK_EDITABLE (accessible), state); | |
| 476 | + | // } | |
| 477 | + | // | |
| 478 | + | // ``` | |
| 479 | + | // | |
| 480 | + | // Note that the widget which is the delegate *must* be a direct child of | |
| 481 | + | // this widget, otherwise your implementation of [vfunc@Gtk.Accessible.get_platform_state] | |
| 482 | + | // might not even be called, as the platform change will originate from | |
| 483 | + | // the parent of the delegate, and, as a result, will not work properly. | |
| 484 | + | // | |
| 485 | + | // So, if you can't ensure the direct child condition, you should give the | |
| 486 | + | // delegate the %GTK_ACCESSIBLE_ROLE_TEXT_BOX role, or you can | |
| 487 | + | // change your tree to allow this function to work. | |
| 488 | + | func (x *PasswordEntryRow) DelegateGetAccessiblePlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 489 | + | ||
| 490 | + | cret := gtk.XGtkEditableDelegateGetAccessiblePlatformState(x.GoPointer(), StateVar) | |
| 491 | + | return cret | |
| 492 | + | } | |
| 493 | + | ||
| 317 | 494 | // Deletes the currently selected text of the editable. | |
| 318 | 495 | // | |
| 319 | 496 | // This call doesn’t do anything if there is no selected text. | |
M v4/adw/adw-preferences-dialog.go +145 -10
| @@ -203,34 +203,165 @@ func (c *PreferencesDialog) SetGoPointer(ptr uintptr) { | |||
| 203 | 203 | c.Ptr = ptr | |
| 204 | 204 | } | |
| 205 | 205 | ||
| 206 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 206 | + | // Requests the user's screen reader to announce the given message. | |
| 207 | + | // | |
| 208 | + | // This kind of notification is useful for messages that | |
| 209 | + | // either have only a visual representation or that are not | |
| 210 | + | // exposed visually at all, e.g. a notification about a | |
| 211 | + | // successful operation. | |
| 212 | + | // | |
| 213 | + | // Also, by using this API, you can ensure that the message | |
| 214 | + | // does not interrupts the user's current screen reader output. | |
| 215 | + | func (x *PreferencesDialog) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 216 | + | ||
| 217 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 218 | + | ||
| 219 | + | } | |
| 220 | + | ||
| 221 | + | // Retrieves the accessible parent for an accessible object. | |
| 222 | + | // | |
| 223 | + | // This function returns `NULL` for top level widgets. | |
| 224 | + | func (x *PreferencesDialog) GetAccessibleParent() *gtk.AccessibleBase { | |
| 225 | + | var cls *gtk.AccessibleBase | |
| 226 | + | ||
| 227 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 228 | + | ||
| 229 | + | if cret == 0 { | |
| 230 | + | return nil | |
| 231 | + | } | |
| 232 | + | cls = >k.AccessibleBase{} | |
| 233 | + | cls.Ptr = cret | |
| 234 | + | return cls | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | // Retrieves the accessible role of an accessible object. | |
| 207 | 238 | func (x *PreferencesDialog) GetAccessibleRole() gtk.AccessibleRole { | |
| 208 | 239 | ||
| 209 | 240 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 210 | 241 | return cret | |
| 211 | 242 | } | |
| 212 | 243 | ||
| 213 | - | // Resets the accessible @property to its default value. | |
| 244 | + | // Retrieves the implementation for the given accessible object. | |
| 245 | + | func (x *PreferencesDialog) GetAtContext() *gtk.ATContext { | |
| 246 | + | var cls *gtk.ATContext | |
| 247 | + | ||
| 248 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 249 | + | ||
| 250 | + | if cret == 0 { | |
| 251 | + | return nil | |
| 252 | + | } | |
| 253 | + | cls = >k.ATContext{} | |
| 254 | + | cls.Ptr = cret | |
| 255 | + | return cls | |
| 256 | + | } | |
| 257 | + | ||
| 258 | + | // Queries the coordinates and dimensions of this accessible | |
| 259 | + | // | |
| 260 | + | // This functionality can be overridden by `GtkAccessible` | |
| 261 | + | // implementations, e.g. to get the bounds from an ignored | |
| 262 | + | // child widget. | |
| 263 | + | func (x *PreferencesDialog) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 264 | + | ||
| 265 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 266 | + | return cret | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // Retrieves the first accessible child of an accessible object. | |
| 270 | + | func (x *PreferencesDialog) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 271 | + | var cls *gtk.AccessibleBase | |
| 272 | + | ||
| 273 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 274 | + | ||
| 275 | + | if cret == 0 { | |
| 276 | + | return nil | |
| 277 | + | } | |
| 278 | + | cls = >k.AccessibleBase{} | |
| 279 | + | cls.Ptr = cret | |
| 280 | + | return cls | |
| 281 | + | } | |
| 282 | + | ||
| 283 | + | // Retrieves the next accessible sibling of an accessible object | |
| 284 | + | func (x *PreferencesDialog) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 285 | + | var cls *gtk.AccessibleBase | |
| 286 | + | ||
| 287 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 288 | + | ||
| 289 | + | if cret == 0 { | |
| 290 | + | return nil | |
| 291 | + | } | |
| 292 | + | cls = >k.AccessibleBase{} | |
| 293 | + | cls.Ptr = cret | |
| 294 | + | return cls | |
| 295 | + | } | |
| 296 | + | ||
| 297 | + | // Queries a platform state, such as focus. | |
| 298 | + | // | |
| 299 | + | // This functionality can be overridden by `GtkAccessible` | |
| 300 | + | // implementations, e.g. to get platform state from an ignored | |
| 301 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 302 | + | func (x *PreferencesDialog) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 303 | + | ||
| 304 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 305 | + | return cret | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // Resets the accessible property to its default value. | |
| 214 | 309 | func (x *PreferencesDialog) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 215 | 310 | ||
| 216 | 311 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 217 | 312 | ||
| 218 | 313 | } | |
| 219 | 314 | ||
| 220 | - | // Resets the accessible @relation to its default value. | |
| 315 | + | // Resets the accessible relation to its default value. | |
| 221 | 316 | func (x *PreferencesDialog) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 222 | 317 | ||
| 223 | 318 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 224 | 319 | ||
| 225 | 320 | } | |
| 226 | 321 | ||
| 227 | - | // Resets the accessible @state to its default value. | |
| 322 | + | // Resets the accessible state to its default value. | |
| 228 | 323 | func (x *PreferencesDialog) ResetState(StateVar gtk.AccessibleState) { | |
| 229 | 324 | ||
| 230 | 325 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 231 | 326 | ||
| 232 | 327 | } | |
| 233 | 328 | ||
| 329 | + | // Sets the parent and sibling of an accessible object. | |
| 330 | + | // | |
| 331 | + | // This function is meant to be used by accessible implementations that are | |
| 332 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 333 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 334 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 335 | + | // interface, you will use this function to ensure that the parent of each | |
| 336 | + | // child widget is the metadata object, and the parent of each metadata | |
| 337 | + | // object is the container widget. | |
| 338 | + | func (x *PreferencesDialog) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 339 | + | ||
| 340 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 341 | + | ||
| 342 | + | } | |
| 343 | + | ||
| 344 | + | // Updates the next accessible sibling. | |
| 345 | + | // | |
| 346 | + | // That might be useful when a new child of a custom accessible | |
| 347 | + | // is created, and it needs to be linked to a previous child. | |
| 348 | + | func (x *PreferencesDialog) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 349 | + | ||
| 350 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 351 | + | ||
| 352 | + | } | |
| 353 | + | ||
| 354 | + | // Informs ATs that the platform state has changed. | |
| 355 | + | // | |
| 356 | + | // This function should be used by `GtkAccessible` implementations that | |
| 357 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 358 | + | // states automatically. | |
| 359 | + | func (x *PreferencesDialog) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 360 | + | ||
| 361 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 362 | + | ||
| 363 | + | } | |
| 364 | + | ||
| 234 | 365 | // Updates a list of accessible properties. | |
| 235 | 366 | // | |
| 236 | 367 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -273,7 +404,7 @@ func (x *PreferencesDialog) UpdatePropertyValue(NPropertiesVar int, PropertiesVa | |||
| 273 | 404 | // relation change must be communicated to assistive technologies. | |
| 274 | 405 | // | |
| 275 | 406 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 276 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 407 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 277 | 408 | // | |
| 278 | 409 | // ```c | |
| 279 | 410 | // gtk_accessible_update_relation (accessible, | |
| @@ -303,13 +434,17 @@ func (x *PreferencesDialog) UpdateRelationValue(NRelationsVar int, RelationsVar | |||
| 303 | 434 | ||
| 304 | 435 | } | |
| 305 | 436 | ||
| 306 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 307 | - | // documentation for the value types of accessible states. | |
| 437 | + | // Updates a list of accessible states. | |
| 308 | 438 | // | |
| 309 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 310 | - | // state change must be communicated to assistive technologies. | |
| 439 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 440 | + | // value types of accessible states. | |
| 441 | + | // | |
| 442 | + | // This function should be called by `GtkWidget` types whenever | |
| 443 | + | // an accessible state change must be communicated to assistive | |
| 444 | + | // technologies. | |
| 311 | 445 | // | |
| 312 | 446 | // Example: | |
| 447 | + | // | |
| 313 | 448 | // ```c | |
| 314 | 449 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 315 | 450 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -339,7 +474,7 @@ func (x *PreferencesDialog) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acc | |||
| 339 | 474 | // Gets the ID of the @buildable object. | |
| 340 | 475 | // | |
| 341 | 476 | // `GtkBuilder` sets the name based on the ID attribute | |
| 342 | - | // of the <object> tag used to construct the @buildable. | |
| 477 | + | // of the `<object>` tag used to construct the @buildable. | |
| 343 | 478 | func (x *PreferencesDialog) GetBuildableId() string { | |
| 344 | 479 | ||
| 345 | 480 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-preferences-group.go +145 -10
| @@ -212,34 +212,165 @@ func (c *PreferencesGroup) SetGoPointer(ptr uintptr) { | |||
| 212 | 212 | c.Ptr = ptr | |
| 213 | 213 | } | |
| 214 | 214 | ||
| 215 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 215 | + | // Requests the user's screen reader to announce the given message. | |
| 216 | + | // | |
| 217 | + | // This kind of notification is useful for messages that | |
| 218 | + | // either have only a visual representation or that are not | |
| 219 | + | // exposed visually at all, e.g. a notification about a | |
| 220 | + | // successful operation. | |
| 221 | + | // | |
| 222 | + | // Also, by using this API, you can ensure that the message | |
| 223 | + | // does not interrupts the user's current screen reader output. | |
| 224 | + | func (x *PreferencesGroup) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 225 | + | ||
| 226 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 227 | + | ||
| 228 | + | } | |
| 229 | + | ||
| 230 | + | // Retrieves the accessible parent for an accessible object. | |
| 231 | + | // | |
| 232 | + | // This function returns `NULL` for top level widgets. | |
| 233 | + | func (x *PreferencesGroup) GetAccessibleParent() *gtk.AccessibleBase { | |
| 234 | + | var cls *gtk.AccessibleBase | |
| 235 | + | ||
| 236 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 237 | + | ||
| 238 | + | if cret == 0 { | |
| 239 | + | return nil | |
| 240 | + | } | |
| 241 | + | cls = >k.AccessibleBase{} | |
| 242 | + | cls.Ptr = cret | |
| 243 | + | return cls | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | // Retrieves the accessible role of an accessible object. | |
| 216 | 247 | func (x *PreferencesGroup) GetAccessibleRole() gtk.AccessibleRole { | |
| 217 | 248 | ||
| 218 | 249 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 219 | 250 | return cret | |
| 220 | 251 | } | |
| 221 | 252 | ||
| 222 | - | // Resets the accessible @property to its default value. | |
| 253 | + | // Retrieves the implementation for the given accessible object. | |
| 254 | + | func (x *PreferencesGroup) GetAtContext() *gtk.ATContext { | |
| 255 | + | var cls *gtk.ATContext | |
| 256 | + | ||
| 257 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 258 | + | ||
| 259 | + | if cret == 0 { | |
| 260 | + | return nil | |
| 261 | + | } | |
| 262 | + | cls = >k.ATContext{} | |
| 263 | + | cls.Ptr = cret | |
| 264 | + | return cls | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // Queries the coordinates and dimensions of this accessible | |
| 268 | + | // | |
| 269 | + | // This functionality can be overridden by `GtkAccessible` | |
| 270 | + | // implementations, e.g. to get the bounds from an ignored | |
| 271 | + | // child widget. | |
| 272 | + | func (x *PreferencesGroup) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 273 | + | ||
| 274 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 275 | + | return cret | |
| 276 | + | } | |
| 277 | + | ||
| 278 | + | // Retrieves the first accessible child of an accessible object. | |
| 279 | + | func (x *PreferencesGroup) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 280 | + | var cls *gtk.AccessibleBase | |
| 281 | + | ||
| 282 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 283 | + | ||
| 284 | + | if cret == 0 { | |
| 285 | + | return nil | |
| 286 | + | } | |
| 287 | + | cls = >k.AccessibleBase{} | |
| 288 | + | cls.Ptr = cret | |
| 289 | + | return cls | |
| 290 | + | } | |
| 291 | + | ||
| 292 | + | // Retrieves the next accessible sibling of an accessible object | |
| 293 | + | func (x *PreferencesGroup) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 294 | + | var cls *gtk.AccessibleBase | |
| 295 | + | ||
| 296 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 297 | + | ||
| 298 | + | if cret == 0 { | |
| 299 | + | return nil | |
| 300 | + | } | |
| 301 | + | cls = >k.AccessibleBase{} | |
| 302 | + | cls.Ptr = cret | |
| 303 | + | return cls | |
| 304 | + | } | |
| 305 | + | ||
| 306 | + | // Queries a platform state, such as focus. | |
| 307 | + | // | |
| 308 | + | // This functionality can be overridden by `GtkAccessible` | |
| 309 | + | // implementations, e.g. to get platform state from an ignored | |
| 310 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 311 | + | func (x *PreferencesGroup) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 312 | + | ||
| 313 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 314 | + | return cret | |
| 315 | + | } | |
| 316 | + | ||
| 317 | + | // Resets the accessible property to its default value. | |
| 223 | 318 | func (x *PreferencesGroup) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 224 | 319 | ||
| 225 | 320 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 226 | 321 | ||
| 227 | 322 | } | |
| 228 | 323 | ||
| 229 | - | // Resets the accessible @relation to its default value. | |
| 324 | + | // Resets the accessible relation to its default value. | |
| 230 | 325 | func (x *PreferencesGroup) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 231 | 326 | ||
| 232 | 327 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 233 | 328 | ||
| 234 | 329 | } | |
| 235 | 330 | ||
| 236 | - | // Resets the accessible @state to its default value. | |
| 331 | + | // Resets the accessible state to its default value. | |
| 237 | 332 | func (x *PreferencesGroup) ResetState(StateVar gtk.AccessibleState) { | |
| 238 | 333 | ||
| 239 | 334 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 240 | 335 | ||
| 241 | 336 | } | |
| 242 | 337 | ||
| 338 | + | // Sets the parent and sibling of an accessible object. | |
| 339 | + | // | |
| 340 | + | // This function is meant to be used by accessible implementations that are | |
| 341 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 342 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 343 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 344 | + | // interface, you will use this function to ensure that the parent of each | |
| 345 | + | // child widget is the metadata object, and the parent of each metadata | |
| 346 | + | // object is the container widget. | |
| 347 | + | func (x *PreferencesGroup) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 348 | + | ||
| 349 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 350 | + | ||
| 351 | + | } | |
| 352 | + | ||
| 353 | + | // Updates the next accessible sibling. | |
| 354 | + | // | |
| 355 | + | // That might be useful when a new child of a custom accessible | |
| 356 | + | // is created, and it needs to be linked to a previous child. | |
| 357 | + | func (x *PreferencesGroup) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 358 | + | ||
| 359 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 360 | + | ||
| 361 | + | } | |
| 362 | + | ||
| 363 | + | // Informs ATs that the platform state has changed. | |
| 364 | + | // | |
| 365 | + | // This function should be used by `GtkAccessible` implementations that | |
| 366 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 367 | + | // states automatically. | |
| 368 | + | func (x *PreferencesGroup) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 369 | + | ||
| 370 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 371 | + | ||
| 372 | + | } | |
| 373 | + | ||
| 243 | 374 | // Updates a list of accessible properties. | |
| 244 | 375 | // | |
| 245 | 376 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -282,7 +413,7 @@ func (x *PreferencesGroup) UpdatePropertyValue(NPropertiesVar int, PropertiesVar | |||
| 282 | 413 | // relation change must be communicated to assistive technologies. | |
| 283 | 414 | // | |
| 284 | 415 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 285 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 416 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 286 | 417 | // | |
| 287 | 418 | // ```c | |
| 288 | 419 | // gtk_accessible_update_relation (accessible, | |
| @@ -312,13 +443,17 @@ func (x *PreferencesGroup) UpdateRelationValue(NRelationsVar int, RelationsVar [ | |||
| 312 | 443 | ||
| 313 | 444 | } | |
| 314 | 445 | ||
| 315 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 316 | - | // documentation for the value types of accessible states. | |
| 446 | + | // Updates a list of accessible states. | |
| 317 | 447 | // | |
| 318 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 319 | - | // state change must be communicated to assistive technologies. | |
| 448 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 449 | + | // value types of accessible states. | |
| 450 | + | // | |
| 451 | + | // This function should be called by `GtkWidget` types whenever | |
| 452 | + | // an accessible state change must be communicated to assistive | |
| 453 | + | // technologies. | |
| 320 | 454 | // | |
| 321 | 455 | // Example: | |
| 456 | + | // | |
| 322 | 457 | // ```c | |
| 323 | 458 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 324 | 459 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -348,7 +483,7 @@ func (x *PreferencesGroup) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acce | |||
| 348 | 483 | // Gets the ID of the @buildable object. | |
| 349 | 484 | // | |
| 350 | 485 | // `GtkBuilder` sets the name based on the ID attribute | |
| 351 | - | // of the <object> tag used to construct the @buildable. | |
| 486 | + | // of the `<object>` tag used to construct the @buildable. | |
| 352 | 487 | func (x *PreferencesGroup) GetBuildableId() string { | |
| 353 | 488 | ||
| 354 | 489 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-preferences-page.go +173 -10
| @@ -85,6 +85,23 @@ func (x *PreferencesPage) Add(GroupVar *PreferencesGroup) { | |||
| 85 | 85 | ||
| 86 | 86 | } | |
| 87 | 87 | ||
| 88 | + | var xPreferencesPageGetBanner func(uintptr) uintptr | |
| 89 | + | ||
| 90 | + | // Gets the banner displayed at the top of the page. | |
| 91 | + | func (x *PreferencesPage) GetBanner() *Banner { | |
| 92 | + | var cls *Banner | |
| 93 | + | ||
| 94 | + | cret := xPreferencesPageGetBanner(x.GoPointer()) | |
| 95 | + | ||
| 96 | + | if cret == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | gobject.IncreaseRef(cret) | |
| 100 | + | cls = &Banner{} | |
| 101 | + | cls.Ptr = cret | |
| 102 | + | return cls | |
| 103 | + | } | |
| 104 | + | ||
| 88 | 105 | var xPreferencesPageGetDescription func(uintptr) string | |
| 89 | 106 | ||
| 90 | 107 | // Gets the description of @self. | |
| @@ -157,6 +174,15 @@ func (x *PreferencesPage) ScrollToTop() { | |||
| 157 | 174 | ||
| 158 | 175 | } | |
| 159 | 176 | ||
| 177 | + | var xPreferencesPageSetBanner func(uintptr, uintptr) | |
| 178 | + | ||
| 179 | + | // Sets the banner displayed at the top of the page. | |
| 180 | + | func (x *PreferencesPage) SetBanner(BannerVar *Banner) { | |
| 181 | + | ||
| 182 | + | xPreferencesPageSetBanner(x.GoPointer(), BannerVar.GoPointer()) | |
| 183 | + | ||
| 184 | + | } | |
| 185 | + | ||
| 160 | 186 | var xPreferencesPageSetDescription func(uintptr, string) | |
| 161 | 187 | ||
| 162 | 188 | // Sets the description of @self. | |
| @@ -224,34 +250,165 @@ func (c *PreferencesPage) SetGoPointer(ptr uintptr) { | |||
| 224 | 250 | c.Ptr = ptr | |
| 225 | 251 | } | |
| 226 | 252 | ||
| 227 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 253 | + | // Requests the user's screen reader to announce the given message. | |
| 254 | + | // | |
| 255 | + | // This kind of notification is useful for messages that | |
| 256 | + | // either have only a visual representation or that are not | |
| 257 | + | // exposed visually at all, e.g. a notification about a | |
| 258 | + | // successful operation. | |
| 259 | + | // | |
| 260 | + | // Also, by using this API, you can ensure that the message | |
| 261 | + | // does not interrupts the user's current screen reader output. | |
| 262 | + | func (x *PreferencesPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 263 | + | ||
| 264 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 265 | + | ||
| 266 | + | } | |
| 267 | + | ||
| 268 | + | // Retrieves the accessible parent for an accessible object. | |
| 269 | + | // | |
| 270 | + | // This function returns `NULL` for top level widgets. | |
| 271 | + | func (x *PreferencesPage) GetAccessibleParent() *gtk.AccessibleBase { | |
| 272 | + | var cls *gtk.AccessibleBase | |
| 273 | + | ||
| 274 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 275 | + | ||
| 276 | + | if cret == 0 { | |
| 277 | + | return nil | |
| 278 | + | } | |
| 279 | + | cls = >k.AccessibleBase{} | |
| 280 | + | cls.Ptr = cret | |
| 281 | + | return cls | |
| 282 | + | } | |
| 283 | + | ||
| 284 | + | // Retrieves the accessible role of an accessible object. | |
| 228 | 285 | func (x *PreferencesPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 229 | 286 | ||
| 230 | 287 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 231 | 288 | return cret | |
| 232 | 289 | } | |
| 233 | 290 | ||
| 234 | - | // Resets the accessible @property to its default value. | |
| 291 | + | // Retrieves the implementation for the given accessible object. | |
| 292 | + | func (x *PreferencesPage) GetAtContext() *gtk.ATContext { | |
| 293 | + | var cls *gtk.ATContext | |
| 294 | + | ||
| 295 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 296 | + | ||
| 297 | + | if cret == 0 { | |
| 298 | + | return nil | |
| 299 | + | } | |
| 300 | + | cls = >k.ATContext{} | |
| 301 | + | cls.Ptr = cret | |
| 302 | + | return cls | |
| 303 | + | } | |
| 304 | + | ||
| 305 | + | // Queries the coordinates and dimensions of this accessible | |
| 306 | + | // | |
| 307 | + | // This functionality can be overridden by `GtkAccessible` | |
| 308 | + | // implementations, e.g. to get the bounds from an ignored | |
| 309 | + | // child widget. | |
| 310 | + | func (x *PreferencesPage) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 311 | + | ||
| 312 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 313 | + | return cret | |
| 314 | + | } | |
| 315 | + | ||
| 316 | + | // Retrieves the first accessible child of an accessible object. | |
| 317 | + | func (x *PreferencesPage) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 318 | + | var cls *gtk.AccessibleBase | |
| 319 | + | ||
| 320 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 321 | + | ||
| 322 | + | if cret == 0 { | |
| 323 | + | return nil | |
| 324 | + | } | |
| 325 | + | cls = >k.AccessibleBase{} | |
| 326 | + | cls.Ptr = cret | |
| 327 | + | return cls | |
| 328 | + | } | |
| 329 | + | ||
| 330 | + | // Retrieves the next accessible sibling of an accessible object | |
| 331 | + | func (x *PreferencesPage) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 332 | + | var cls *gtk.AccessibleBase | |
| 333 | + | ||
| 334 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 335 | + | ||
| 336 | + | if cret == 0 { | |
| 337 | + | return nil | |
| 338 | + | } | |
| 339 | + | cls = >k.AccessibleBase{} | |
| 340 | + | cls.Ptr = cret | |
| 341 | + | return cls | |
| 342 | + | } | |
| 343 | + | ||
| 344 | + | // Queries a platform state, such as focus. | |
| 345 | + | // | |
| 346 | + | // This functionality can be overridden by `GtkAccessible` | |
| 347 | + | // implementations, e.g. to get platform state from an ignored | |
| 348 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 349 | + | func (x *PreferencesPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 350 | + | ||
| 351 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 352 | + | return cret | |
| 353 | + | } | |
| 354 | + | ||
| 355 | + | // Resets the accessible property to its default value. | |
| 235 | 356 | func (x *PreferencesPage) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 236 | 357 | ||
| 237 | 358 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 238 | 359 | ||
| 239 | 360 | } | |
| 240 | 361 | ||
| 241 | - | // Resets the accessible @relation to its default value. | |
| 362 | + | // Resets the accessible relation to its default value. | |
| 242 | 363 | func (x *PreferencesPage) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 243 | 364 | ||
| 244 | 365 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 245 | 366 | ||
| 246 | 367 | } | |
| 247 | 368 | ||
| 248 | - | // Resets the accessible @state to its default value. | |
| 369 | + | // Resets the accessible state to its default value. | |
| 249 | 370 | func (x *PreferencesPage) ResetState(StateVar gtk.AccessibleState) { | |
| 250 | 371 | ||
| 251 | 372 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 252 | 373 | ||
| 253 | 374 | } | |
| 254 | 375 | ||
| 376 | + | // Sets the parent and sibling of an accessible object. | |
| 377 | + | // | |
| 378 | + | // This function is meant to be used by accessible implementations that are | |
| 379 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 380 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 381 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 382 | + | // interface, you will use this function to ensure that the parent of each | |
| 383 | + | // child widget is the metadata object, and the parent of each metadata | |
| 384 | + | // object is the container widget. | |
| 385 | + | func (x *PreferencesPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 386 | + | ||
| 387 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 388 | + | ||
| 389 | + | } | |
| 390 | + | ||
| 391 | + | // Updates the next accessible sibling. | |
| 392 | + | // | |
| 393 | + | // That might be useful when a new child of a custom accessible | |
| 394 | + | // is created, and it needs to be linked to a previous child. | |
| 395 | + | func (x *PreferencesPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 396 | + | ||
| 397 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 398 | + | ||
| 399 | + | } | |
| 400 | + | ||
| 401 | + | // Informs ATs that the platform state has changed. | |
| 402 | + | // | |
| 403 | + | // This function should be used by `GtkAccessible` implementations that | |
| 404 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 405 | + | // states automatically. | |
| 406 | + | func (x *PreferencesPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 407 | + | ||
| 408 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 409 | + | ||
| 410 | + | } | |
| 411 | + | ||
| 255 | 412 | // Updates a list of accessible properties. | |
| 256 | 413 | // | |
| 257 | 414 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -294,7 +451,7 @@ func (x *PreferencesPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar | |||
| 294 | 451 | // relation change must be communicated to assistive technologies. | |
| 295 | 452 | // | |
| 296 | 453 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 297 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 454 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 298 | 455 | // | |
| 299 | 456 | // ```c | |
| 300 | 457 | // gtk_accessible_update_relation (accessible, | |
| @@ -324,13 +481,17 @@ func (x *PreferencesPage) UpdateRelationValue(NRelationsVar int, RelationsVar [] | |||
| 324 | 481 | ||
| 325 | 482 | } | |
| 326 | 483 | ||
| 327 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 328 | - | // documentation for the value types of accessible states. | |
| 484 | + | // Updates a list of accessible states. | |
| 329 | 485 | // | |
| 330 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 331 | - | // state change must be communicated to assistive technologies. | |
| 486 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 487 | + | // value types of accessible states. | |
| 488 | + | // | |
| 489 | + | // This function should be called by `GtkWidget` types whenever | |
| 490 | + | // an accessible state change must be communicated to assistive | |
| 491 | + | // technologies. | |
| 332 | 492 | // | |
| 333 | 493 | // Example: | |
| 494 | + | // | |
| 334 | 495 | // ```c | |
| 335 | 496 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 336 | 497 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -360,7 +521,7 @@ func (x *PreferencesPage) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acces | |||
| 360 | 521 | // Gets the ID of the @buildable object. | |
| 361 | 522 | // | |
| 362 | 523 | // `GtkBuilder` sets the name based on the ID attribute | |
| 363 | - | // of the <object> tag used to construct the @buildable. | |
| 524 | + | // of the `<object>` tag used to construct the @buildable. | |
| 364 | 525 | func (x *PreferencesPage) GetBuildableId() string { | |
| 365 | 526 | ||
| 366 | 527 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -380,6 +541,7 @@ func init() { | |||
| 380 | 541 | core.PuregoSafeRegister(&xNewPreferencesPage, lib, "adw_preferences_page_new") | |
| 381 | 542 | ||
| 382 | 543 | core.PuregoSafeRegister(&xPreferencesPageAdd, lib, "adw_preferences_page_add") | |
| 544 | + | core.PuregoSafeRegister(&xPreferencesPageGetBanner, lib, "adw_preferences_page_get_banner") | |
| 383 | 545 | core.PuregoSafeRegister(&xPreferencesPageGetDescription, lib, "adw_preferences_page_get_description") | |
| 384 | 546 | core.PuregoSafeRegister(&xPreferencesPageGetDescriptionCentered, lib, "adw_preferences_page_get_description_centered") | |
| 385 | 547 | core.PuregoSafeRegister(&xPreferencesPageGetIconName, lib, "adw_preferences_page_get_icon_name") | |
| @@ -388,6 +550,7 @@ func init() { | |||
| 388 | 550 | core.PuregoSafeRegister(&xPreferencesPageGetUseUnderline, lib, "adw_preferences_page_get_use_underline") | |
| 389 | 551 | core.PuregoSafeRegister(&xPreferencesPageRemove, lib, "adw_preferences_page_remove") | |
| 390 | 552 | core.PuregoSafeRegister(&xPreferencesPageScrollToTop, lib, "adw_preferences_page_scroll_to_top") | |
| 553 | + | core.PuregoSafeRegister(&xPreferencesPageSetBanner, lib, "adw_preferences_page_set_banner") | |
| 391 | 554 | core.PuregoSafeRegister(&xPreferencesPageSetDescription, lib, "adw_preferences_page_set_description") | |
| 392 | 555 | core.PuregoSafeRegister(&xPreferencesPageSetDescriptionCentered, lib, "adw_preferences_page_set_description_centered") | |
| 393 | 556 | core.PuregoSafeRegister(&xPreferencesPageSetIconName, lib, "adw_preferences_page_set_icon_name") | |
M v4/adw/adw-preferences-row.go +145 -10
| @@ -159,34 +159,165 @@ func (c *PreferencesRow) SetGoPointer(ptr uintptr) { | |||
| 159 | 159 | c.Ptr = ptr | |
| 160 | 160 | } | |
| 161 | 161 | ||
| 162 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 162 | + | // Requests the user's screen reader to announce the given message. | |
| 163 | + | // | |
| 164 | + | // This kind of notification is useful for messages that | |
| 165 | + | // either have only a visual representation or that are not | |
| 166 | + | // exposed visually at all, e.g. a notification about a | |
| 167 | + | // successful operation. | |
| 168 | + | // | |
| 169 | + | // Also, by using this API, you can ensure that the message | |
| 170 | + | // does not interrupts the user's current screen reader output. | |
| 171 | + | func (x *PreferencesRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 172 | + | ||
| 173 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 174 | + | ||
| 175 | + | } | |
| 176 | + | ||
| 177 | + | // Retrieves the accessible parent for an accessible object. | |
| 178 | + | // | |
| 179 | + | // This function returns `NULL` for top level widgets. | |
| 180 | + | func (x *PreferencesRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 181 | + | var cls *gtk.AccessibleBase | |
| 182 | + | ||
| 183 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 184 | + | ||
| 185 | + | if cret == 0 { | |
| 186 | + | return nil | |
| 187 | + | } | |
| 188 | + | cls = >k.AccessibleBase{} | |
| 189 | + | cls.Ptr = cret | |
| 190 | + | return cls | |
| 191 | + | } | |
| 192 | + | ||
| 193 | + | // Retrieves the accessible role of an accessible object. | |
| 163 | 194 | func (x *PreferencesRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 164 | 195 | ||
| 165 | 196 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 166 | 197 | return cret | |
| 167 | 198 | } | |
| 168 | 199 | ||
| 169 | - | // Resets the accessible @property to its default value. | |
| 200 | + | // Retrieves the implementation for the given accessible object. | |
| 201 | + | func (x *PreferencesRow) GetAtContext() *gtk.ATContext { | |
| 202 | + | var cls *gtk.ATContext | |
| 203 | + | ||
| 204 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 205 | + | ||
| 206 | + | if cret == 0 { | |
| 207 | + | return nil | |
| 208 | + | } | |
| 209 | + | cls = >k.ATContext{} | |
| 210 | + | cls.Ptr = cret | |
| 211 | + | return cls | |
| 212 | + | } | |
| 213 | + | ||
| 214 | + | // Queries the coordinates and dimensions of this accessible | |
| 215 | + | // | |
| 216 | + | // This functionality can be overridden by `GtkAccessible` | |
| 217 | + | // implementations, e.g. to get the bounds from an ignored | |
| 218 | + | // child widget. | |
| 219 | + | func (x *PreferencesRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 220 | + | ||
| 221 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 222 | + | return cret | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // Retrieves the first accessible child of an accessible object. | |
| 226 | + | func (x *PreferencesRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 227 | + | var cls *gtk.AccessibleBase | |
| 228 | + | ||
| 229 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 230 | + | ||
| 231 | + | if cret == 0 { | |
| 232 | + | return nil | |
| 233 | + | } | |
| 234 | + | cls = >k.AccessibleBase{} | |
| 235 | + | cls.Ptr = cret | |
| 236 | + | return cls | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // Retrieves the next accessible sibling of an accessible object | |
| 240 | + | func (x *PreferencesRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 241 | + | var cls *gtk.AccessibleBase | |
| 242 | + | ||
| 243 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 244 | + | ||
| 245 | + | if cret == 0 { | |
| 246 | + | return nil | |
| 247 | + | } | |
| 248 | + | cls = >k.AccessibleBase{} | |
| 249 | + | cls.Ptr = cret | |
| 250 | + | return cls | |
| 251 | + | } | |
| 252 | + | ||
| 253 | + | // Queries a platform state, such as focus. | |
| 254 | + | // | |
| 255 | + | // This functionality can be overridden by `GtkAccessible` | |
| 256 | + | // implementations, e.g. to get platform state from an ignored | |
| 257 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 258 | + | func (x *PreferencesRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 259 | + | ||
| 260 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 261 | + | return cret | |
| 262 | + | } | |
| 263 | + | ||
| 264 | + | // Resets the accessible property to its default value. | |
| 170 | 265 | func (x *PreferencesRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 171 | 266 | ||
| 172 | 267 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 173 | 268 | ||
| 174 | 269 | } | |
| 175 | 270 | ||
| 176 | - | // Resets the accessible @relation to its default value. | |
| 271 | + | // Resets the accessible relation to its default value. | |
| 177 | 272 | func (x *PreferencesRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 178 | 273 | ||
| 179 | 274 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 180 | 275 | ||
| 181 | 276 | } | |
| 182 | 277 | ||
| 183 | - | // Resets the accessible @state to its default value. | |
| 278 | + | // Resets the accessible state to its default value. | |
| 184 | 279 | func (x *PreferencesRow) ResetState(StateVar gtk.AccessibleState) { | |
| 185 | 280 | ||
| 186 | 281 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 187 | 282 | ||
| 188 | 283 | } | |
| 189 | 284 | ||
| 285 | + | // Sets the parent and sibling of an accessible object. | |
| 286 | + | // | |
| 287 | + | // This function is meant to be used by accessible implementations that are | |
| 288 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 289 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 290 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 291 | + | // interface, you will use this function to ensure that the parent of each | |
| 292 | + | // child widget is the metadata object, and the parent of each metadata | |
| 293 | + | // object is the container widget. | |
| 294 | + | func (x *PreferencesRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 295 | + | ||
| 296 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 297 | + | ||
| 298 | + | } | |
| 299 | + | ||
| 300 | + | // Updates the next accessible sibling. | |
| 301 | + | // | |
| 302 | + | // That might be useful when a new child of a custom accessible | |
| 303 | + | // is created, and it needs to be linked to a previous child. | |
| 304 | + | func (x *PreferencesRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 305 | + | ||
| 306 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 307 | + | ||
| 308 | + | } | |
| 309 | + | ||
| 310 | + | // Informs ATs that the platform state has changed. | |
| 311 | + | // | |
| 312 | + | // This function should be used by `GtkAccessible` implementations that | |
| 313 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 314 | + | // states automatically. | |
| 315 | + | func (x *PreferencesRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 316 | + | ||
| 317 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 318 | + | ||
| 319 | + | } | |
| 320 | + | ||
| 190 | 321 | // Updates a list of accessible properties. | |
| 191 | 322 | // | |
| 192 | 323 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -229,7 +360,7 @@ func (x *PreferencesRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar [ | |||
| 229 | 360 | // relation change must be communicated to assistive technologies. | |
| 230 | 361 | // | |
| 231 | 362 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 232 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 363 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 233 | 364 | // | |
| 234 | 365 | // ```c | |
| 235 | 366 | // gtk_accessible_update_relation (accessible, | |
| @@ -259,13 +390,17 @@ func (x *PreferencesRow) UpdateRelationValue(NRelationsVar int, RelationsVar []g | |||
| 259 | 390 | ||
| 260 | 391 | } | |
| 261 | 392 | ||
| 262 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 263 | - | // documentation for the value types of accessible states. | |
| 393 | + | // Updates a list of accessible states. | |
| 264 | 394 | // | |
| 265 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 266 | - | // state change must be communicated to assistive technologies. | |
| 395 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 396 | + | // value types of accessible states. | |
| 397 | + | // | |
| 398 | + | // This function should be called by `GtkWidget` types whenever | |
| 399 | + | // an accessible state change must be communicated to assistive | |
| 400 | + | // technologies. | |
| 267 | 401 | // | |
| 268 | 402 | // Example: | |
| 403 | + | // | |
| 269 | 404 | // ```c | |
| 270 | 405 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 271 | 406 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -378,7 +513,7 @@ func (x *PreferencesRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 378 | 513 | // Gets the ID of the @buildable object. | |
| 379 | 514 | // | |
| 380 | 515 | // `GtkBuilder` sets the name based on the ID attribute | |
| 381 | - | // of the <object> tag used to construct the @buildable. | |
| 516 | + | // of the `<object>` tag used to construct the @buildable. | |
| 382 | 517 | func (x *PreferencesRow) GetBuildableId() string { | |
| 383 | 518 | ||
| 384 | 519 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-preferences-window.go +145 -10
| @@ -253,34 +253,165 @@ func (c *PreferencesWindow) SetGoPointer(ptr uintptr) { | |||
| 253 | 253 | c.Ptr = ptr | |
| 254 | 254 | } | |
| 255 | 255 | ||
| 256 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 256 | + | // Requests the user's screen reader to announce the given message. | |
| 257 | + | // | |
| 258 | + | // This kind of notification is useful for messages that | |
| 259 | + | // either have only a visual representation or that are not | |
| 260 | + | // exposed visually at all, e.g. a notification about a | |
| 261 | + | // successful operation. | |
| 262 | + | // | |
| 263 | + | // Also, by using this API, you can ensure that the message | |
| 264 | + | // does not interrupts the user's current screen reader output. | |
| 265 | + | func (x *PreferencesWindow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 266 | + | ||
| 267 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 268 | + | ||
| 269 | + | } | |
| 270 | + | ||
| 271 | + | // Retrieves the accessible parent for an accessible object. | |
| 272 | + | // | |
| 273 | + | // This function returns `NULL` for top level widgets. | |
| 274 | + | func (x *PreferencesWindow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 275 | + | var cls *gtk.AccessibleBase | |
| 276 | + | ||
| 277 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 278 | + | ||
| 279 | + | if cret == 0 { | |
| 280 | + | return nil | |
| 281 | + | } | |
| 282 | + | cls = >k.AccessibleBase{} | |
| 283 | + | cls.Ptr = cret | |
| 284 | + | return cls | |
| 285 | + | } | |
| 286 | + | ||
| 287 | + | // Retrieves the accessible role of an accessible object. | |
| 257 | 288 | func (x *PreferencesWindow) GetAccessibleRole() gtk.AccessibleRole { | |
| 258 | 289 | ||
| 259 | 290 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 260 | 291 | return cret | |
| 261 | 292 | } | |
| 262 | 293 | ||
| 263 | - | // Resets the accessible @property to its default value. | |
| 294 | + | // Retrieves the implementation for the given accessible object. | |
| 295 | + | func (x *PreferencesWindow) GetAtContext() *gtk.ATContext { | |
| 296 | + | var cls *gtk.ATContext | |
| 297 | + | ||
| 298 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 299 | + | ||
| 300 | + | if cret == 0 { | |
| 301 | + | return nil | |
| 302 | + | } | |
| 303 | + | cls = >k.ATContext{} | |
| 304 | + | cls.Ptr = cret | |
| 305 | + | return cls | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // Queries the coordinates and dimensions of this accessible | |
| 309 | + | // | |
| 310 | + | // This functionality can be overridden by `GtkAccessible` | |
| 311 | + | // implementations, e.g. to get the bounds from an ignored | |
| 312 | + | // child widget. | |
| 313 | + | func (x *PreferencesWindow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 314 | + | ||
| 315 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 316 | + | return cret | |
| 317 | + | } | |
| 318 | + | ||
| 319 | + | // Retrieves the first accessible child of an accessible object. | |
| 320 | + | func (x *PreferencesWindow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 321 | + | var cls *gtk.AccessibleBase | |
| 322 | + | ||
| 323 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 324 | + | ||
| 325 | + | if cret == 0 { | |
| 326 | + | return nil | |
| 327 | + | } | |
| 328 | + | cls = >k.AccessibleBase{} | |
| 329 | + | cls.Ptr = cret | |
| 330 | + | return cls | |
| 331 | + | } | |
| 332 | + | ||
| 333 | + | // Retrieves the next accessible sibling of an accessible object | |
| 334 | + | func (x *PreferencesWindow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 335 | + | var cls *gtk.AccessibleBase | |
| 336 | + | ||
| 337 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 338 | + | ||
| 339 | + | if cret == 0 { | |
| 340 | + | return nil | |
| 341 | + | } | |
| 342 | + | cls = >k.AccessibleBase{} | |
| 343 | + | cls.Ptr = cret | |
| 344 | + | return cls | |
| 345 | + | } | |
| 346 | + | ||
| 347 | + | // Queries a platform state, such as focus. | |
| 348 | + | // | |
| 349 | + | // This functionality can be overridden by `GtkAccessible` | |
| 350 | + | // implementations, e.g. to get platform state from an ignored | |
| 351 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 352 | + | func (x *PreferencesWindow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 353 | + | ||
| 354 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 355 | + | return cret | |
| 356 | + | } | |
| 357 | + | ||
| 358 | + | // Resets the accessible property to its default value. | |
| 264 | 359 | func (x *PreferencesWindow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 265 | 360 | ||
| 266 | 361 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 267 | 362 | ||
| 268 | 363 | } | |
| 269 | 364 | ||
| 270 | - | // Resets the accessible @relation to its default value. | |
| 365 | + | // Resets the accessible relation to its default value. | |
| 271 | 366 | func (x *PreferencesWindow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 272 | 367 | ||
| 273 | 368 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 274 | 369 | ||
| 275 | 370 | } | |
| 276 | 371 | ||
| 277 | - | // Resets the accessible @state to its default value. | |
| 372 | + | // Resets the accessible state to its default value. | |
| 278 | 373 | func (x *PreferencesWindow) ResetState(StateVar gtk.AccessibleState) { | |
| 279 | 374 | ||
| 280 | 375 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 281 | 376 | ||
| 282 | 377 | } | |
| 283 | 378 | ||
| 379 | + | // Sets the parent and sibling of an accessible object. | |
| 380 | + | // | |
| 381 | + | // This function is meant to be used by accessible implementations that are | |
| 382 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 383 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 384 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 385 | + | // interface, you will use this function to ensure that the parent of each | |
| 386 | + | // child widget is the metadata object, and the parent of each metadata | |
| 387 | + | // object is the container widget. | |
| 388 | + | func (x *PreferencesWindow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 389 | + | ||
| 390 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 391 | + | ||
| 392 | + | } | |
| 393 | + | ||
| 394 | + | // Updates the next accessible sibling. | |
| 395 | + | // | |
| 396 | + | // That might be useful when a new child of a custom accessible | |
| 397 | + | // is created, and it needs to be linked to a previous child. | |
| 398 | + | func (x *PreferencesWindow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 399 | + | ||
| 400 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 401 | + | ||
| 402 | + | } | |
| 403 | + | ||
| 404 | + | // Informs ATs that the platform state has changed. | |
| 405 | + | // | |
| 406 | + | // This function should be used by `GtkAccessible` implementations that | |
| 407 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 408 | + | // states automatically. | |
| 409 | + | func (x *PreferencesWindow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 410 | + | ||
| 411 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 412 | + | ||
| 413 | + | } | |
| 414 | + | ||
| 284 | 415 | // Updates a list of accessible properties. | |
| 285 | 416 | // | |
| 286 | 417 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -323,7 +454,7 @@ func (x *PreferencesWindow) UpdatePropertyValue(NPropertiesVar int, PropertiesVa | |||
| 323 | 454 | // relation change must be communicated to assistive technologies. | |
| 324 | 455 | // | |
| 325 | 456 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 326 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 457 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 327 | 458 | // | |
| 328 | 459 | // ```c | |
| 329 | 460 | // gtk_accessible_update_relation (accessible, | |
| @@ -353,13 +484,17 @@ func (x *PreferencesWindow) UpdateRelationValue(NRelationsVar int, RelationsVar | |||
| 353 | 484 | ||
| 354 | 485 | } | |
| 355 | 486 | ||
| 356 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 357 | - | // documentation for the value types of accessible states. | |
| 487 | + | // Updates a list of accessible states. | |
| 358 | 488 | // | |
| 359 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 360 | - | // state change must be communicated to assistive technologies. | |
| 489 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 490 | + | // value types of accessible states. | |
| 491 | + | // | |
| 492 | + | // This function should be called by `GtkWidget` types whenever | |
| 493 | + | // an accessible state change must be communicated to assistive | |
| 494 | + | // technologies. | |
| 361 | 495 | // | |
| 362 | 496 | // Example: | |
| 497 | + | // | |
| 363 | 498 | // ```c | |
| 364 | 499 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 365 | 500 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -389,7 +524,7 @@ func (x *PreferencesWindow) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acc | |||
| 389 | 524 | // Gets the ID of the @buildable object. | |
| 390 | 525 | // | |
| 391 | 526 | // `GtkBuilder` sets the name based on the ID attribute | |
| 392 | - | // of the <object> tag used to construct the @buildable. | |
| 527 | + | // of the `<object>` tag used to construct the @buildable. | |
| 393 | 528 | func (x *PreferencesWindow) GetBuildableId() string { | |
| 394 | 529 | ||
| 395 | 530 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-spin-row.go +187 -10
| @@ -392,34 +392,165 @@ func (x *SpinRow) ConnectWrapped(cb *func(SpinRow)) uint32 { | |||
| 392 | 392 | return gobject.SignalConnect(x.GoPointer(), "wrapped", cbRefPtr) | |
| 393 | 393 | } | |
| 394 | 394 | ||
| 395 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 395 | + | // Requests the user's screen reader to announce the given message. | |
| 396 | + | // | |
| 397 | + | // This kind of notification is useful for messages that | |
| 398 | + | // either have only a visual representation or that are not | |
| 399 | + | // exposed visually at all, e.g. a notification about a | |
| 400 | + | // successful operation. | |
| 401 | + | // | |
| 402 | + | // Also, by using this API, you can ensure that the message | |
| 403 | + | // does not interrupts the user's current screen reader output. | |
| 404 | + | func (x *SpinRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 405 | + | ||
| 406 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 407 | + | ||
| 408 | + | } | |
| 409 | + | ||
| 410 | + | // Retrieves the accessible parent for an accessible object. | |
| 411 | + | // | |
| 412 | + | // This function returns `NULL` for top level widgets. | |
| 413 | + | func (x *SpinRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 414 | + | var cls *gtk.AccessibleBase | |
| 415 | + | ||
| 416 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 417 | + | ||
| 418 | + | if cret == 0 { | |
| 419 | + | return nil | |
| 420 | + | } | |
| 421 | + | cls = >k.AccessibleBase{} | |
| 422 | + | cls.Ptr = cret | |
| 423 | + | return cls | |
| 424 | + | } | |
| 425 | + | ||
| 426 | + | // Retrieves the accessible role of an accessible object. | |
| 396 | 427 | func (x *SpinRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 397 | 428 | ||
| 398 | 429 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 399 | 430 | return cret | |
| 400 | 431 | } | |
| 401 | 432 | ||
| 402 | - | // Resets the accessible @property to its default value. | |
| 433 | + | // Retrieves the implementation for the given accessible object. | |
| 434 | + | func (x *SpinRow) GetAtContext() *gtk.ATContext { | |
| 435 | + | var cls *gtk.ATContext | |
| 436 | + | ||
| 437 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 438 | + | ||
| 439 | + | if cret == 0 { | |
| 440 | + | return nil | |
| 441 | + | } | |
| 442 | + | cls = >k.ATContext{} | |
| 443 | + | cls.Ptr = cret | |
| 444 | + | return cls | |
| 445 | + | } | |
| 446 | + | ||
| 447 | + | // Queries the coordinates and dimensions of this accessible | |
| 448 | + | // | |
| 449 | + | // This functionality can be overridden by `GtkAccessible` | |
| 450 | + | // implementations, e.g. to get the bounds from an ignored | |
| 451 | + | // child widget. | |
| 452 | + | func (x *SpinRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 453 | + | ||
| 454 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 455 | + | return cret | |
| 456 | + | } | |
| 457 | + | ||
| 458 | + | // Retrieves the first accessible child of an accessible object. | |
| 459 | + | func (x *SpinRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 460 | + | var cls *gtk.AccessibleBase | |
| 461 | + | ||
| 462 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 463 | + | ||
| 464 | + | if cret == 0 { | |
| 465 | + | return nil | |
| 466 | + | } | |
| 467 | + | cls = >k.AccessibleBase{} | |
| 468 | + | cls.Ptr = cret | |
| 469 | + | return cls | |
| 470 | + | } | |
| 471 | + | ||
| 472 | + | // Retrieves the next accessible sibling of an accessible object | |
| 473 | + | func (x *SpinRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 474 | + | var cls *gtk.AccessibleBase | |
| 475 | + | ||
| 476 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 477 | + | ||
| 478 | + | if cret == 0 { | |
| 479 | + | return nil | |
| 480 | + | } | |
| 481 | + | cls = >k.AccessibleBase{} | |
| 482 | + | cls.Ptr = cret | |
| 483 | + | return cls | |
| 484 | + | } | |
| 485 | + | ||
| 486 | + | // Queries a platform state, such as focus. | |
| 487 | + | // | |
| 488 | + | // This functionality can be overridden by `GtkAccessible` | |
| 489 | + | // implementations, e.g. to get platform state from an ignored | |
| 490 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 491 | + | func (x *SpinRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 492 | + | ||
| 493 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 494 | + | return cret | |
| 495 | + | } | |
| 496 | + | ||
| 497 | + | // Resets the accessible property to its default value. | |
| 403 | 498 | func (x *SpinRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 404 | 499 | ||
| 405 | 500 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 406 | 501 | ||
| 407 | 502 | } | |
| 408 | 503 | ||
| 409 | - | // Resets the accessible @relation to its default value. | |
| 504 | + | // Resets the accessible relation to its default value. | |
| 410 | 505 | func (x *SpinRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 411 | 506 | ||
| 412 | 507 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 413 | 508 | ||
| 414 | 509 | } | |
| 415 | 510 | ||
| 416 | - | // Resets the accessible @state to its default value. | |
| 511 | + | // Resets the accessible state to its default value. | |
| 417 | 512 | func (x *SpinRow) ResetState(StateVar gtk.AccessibleState) { | |
| 418 | 513 | ||
| 419 | 514 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 420 | 515 | ||
| 421 | 516 | } | |
| 422 | 517 | ||
| 518 | + | // Sets the parent and sibling of an accessible object. | |
| 519 | + | // | |
| 520 | + | // This function is meant to be used by accessible implementations that are | |
| 521 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 522 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 523 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 524 | + | // interface, you will use this function to ensure that the parent of each | |
| 525 | + | // child widget is the metadata object, and the parent of each metadata | |
| 526 | + | // object is the container widget. | |
| 527 | + | func (x *SpinRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 528 | + | ||
| 529 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 530 | + | ||
| 531 | + | } | |
| 532 | + | ||
| 533 | + | // Updates the next accessible sibling. | |
| 534 | + | // | |
| 535 | + | // That might be useful when a new child of a custom accessible | |
| 536 | + | // is created, and it needs to be linked to a previous child. | |
| 537 | + | func (x *SpinRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 538 | + | ||
| 539 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 540 | + | ||
| 541 | + | } | |
| 542 | + | ||
| 543 | + | // Informs ATs that the platform state has changed. | |
| 544 | + | // | |
| 545 | + | // This function should be used by `GtkAccessible` implementations that | |
| 546 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 547 | + | // states automatically. | |
| 548 | + | func (x *SpinRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 549 | + | ||
| 550 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 551 | + | ||
| 552 | + | } | |
| 553 | + | ||
| 423 | 554 | // Updates a list of accessible properties. | |
| 424 | 555 | // | |
| 425 | 556 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -462,7 +593,7 @@ func (x *SpinRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Ac | |||
| 462 | 593 | // relation change must be communicated to assistive technologies. | |
| 463 | 594 | // | |
| 464 | 595 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 465 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 596 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 466 | 597 | // | |
| 467 | 598 | // ```c | |
| 468 | 599 | // gtk_accessible_update_relation (accessible, | |
| @@ -492,13 +623,17 @@ func (x *SpinRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acce | |||
| 492 | 623 | ||
| 493 | 624 | } | |
| 494 | 625 | ||
| 495 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 496 | - | // documentation for the value types of accessible states. | |
| 626 | + | // Updates a list of accessible states. | |
| 497 | 627 | // | |
| 498 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 499 | - | // state change must be communicated to assistive technologies. | |
| 628 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 629 | + | // value types of accessible states. | |
| 630 | + | // | |
| 631 | + | // This function should be called by `GtkWidget` types whenever | |
| 632 | + | // an accessible state change must be communicated to assistive | |
| 633 | + | // technologies. | |
| 500 | 634 | // | |
| 501 | 635 | // Example: | |
| 636 | + | // | |
| 502 | 637 | // ```c | |
| 503 | 638 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 504 | 639 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -611,13 +746,55 @@ func (x *SpinRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 611 | 746 | // Gets the ID of the @buildable object. | |
| 612 | 747 | // | |
| 613 | 748 | // `GtkBuilder` sets the name based on the ID attribute | |
| 614 | - | // of the <object> tag used to construct the @buildable. | |
| 749 | + | // of the `<object>` tag used to construct the @buildable. | |
| 615 | 750 | func (x *SpinRow) GetBuildableId() string { | |
| 616 | 751 | ||
| 617 | 752 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 618 | 753 | return cret | |
| 619 | 754 | } | |
| 620 | 755 | ||
| 756 | + | // Retrieves the accessible platform state from the editable delegate. | |
| 757 | + | // | |
| 758 | + | // This is an helper function to retrieve the accessible state for | |
| 759 | + | // `GtkEditable` interface implementations using a delegate pattern. | |
| 760 | + | // | |
| 761 | + | // You should call this function in your editable widget implementation | |
| 762 | + | // of the [vfunc@Gtk.Accessible.get_platform_state] virtual function, for | |
| 763 | + | // instance: | |
| 764 | + | // | |
| 765 | + | // ```c | |
| 766 | + | // static void | |
| 767 | + | // accessible_interface_init (GtkAccessibleInterface *iface) | |
| 768 | + | // | |
| 769 | + | // { | |
| 770 | + | // iface->get_platform_state = your_editable_get_accessible_platform_state; | |
| 771 | + | // } | |
| 772 | + | // | |
| 773 | + | // static gboolean | |
| 774 | + | // your_editable_get_accessible_platform_state (GtkAccessible *accessible, | |
| 775 | + | // | |
| 776 | + | // GtkAccessiblePlatformState state) | |
| 777 | + | // | |
| 778 | + | // { | |
| 779 | + | // return gtk_editable_delegate_get_accessible_platform_state (GTK_EDITABLE (accessible), state); | |
| 780 | + | // } | |
| 781 | + | // | |
| 782 | + | // ``` | |
| 783 | + | // | |
| 784 | + | // Note that the widget which is the delegate *must* be a direct child of | |
| 785 | + | // this widget, otherwise your implementation of [vfunc@Gtk.Accessible.get_platform_state] | |
| 786 | + | // might not even be called, as the platform change will originate from | |
| 787 | + | // the parent of the delegate, and, as a result, will not work properly. | |
| 788 | + | // | |
| 789 | + | // So, if you can't ensure the direct child condition, you should give the | |
| 790 | + | // delegate the %GTK_ACCESSIBLE_ROLE_TEXT_BOX role, or you can | |
| 791 | + | // change your tree to allow this function to work. | |
| 792 | + | func (x *SpinRow) DelegateGetAccessiblePlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 793 | + | ||
| 794 | + | cret := gtk.XGtkEditableDelegateGetAccessiblePlatformState(x.GoPointer(), StateVar) | |
| 795 | + | return cret | |
| 796 | + | } | |
| 797 | + | ||
| 621 | 798 | // Deletes the currently selected text of the editable. | |
| 622 | 799 | // | |
| 623 | 800 | // This call doesn’t do anything if there is no selected text. | |
M v4/adw/adw-spinner.go +149 -10
| @@ -58,6 +58,10 @@ func (x *SpinnerClass) GoPointer() uintptr { | |||
| 58 | 58 | // | |
| 59 | 59 | // `AdwSpinner` has a single node with the name `image` and the style class | |
| 60 | 60 | // `.spinner`. | |
| 61 | + | // | |
| 62 | + | // ## Accessibility | |
| 63 | + | // | |
| 64 | + | // `AdwSpinner` uses the [enum@Gtk.AccessibleRole.progress-bar] role. | |
| 61 | 65 | type Spinner struct { | |
| 62 | 66 | gtk.Widget | |
| 63 | 67 | } | |
| @@ -102,34 +106,165 @@ func (c *Spinner) SetGoPointer(ptr uintptr) { | |||
| 102 | 106 | c.Ptr = ptr | |
| 103 | 107 | } | |
| 104 | 108 | ||
| 105 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 109 | + | // Requests the user's screen reader to announce the given message. | |
| 110 | + | // | |
| 111 | + | // This kind of notification is useful for messages that | |
| 112 | + | // either have only a visual representation or that are not | |
| 113 | + | // exposed visually at all, e.g. a notification about a | |
| 114 | + | // successful operation. | |
| 115 | + | // | |
| 116 | + | // Also, by using this API, you can ensure that the message | |
| 117 | + | // does not interrupts the user's current screen reader output. | |
| 118 | + | func (x *Spinner) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 119 | + | ||
| 120 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 121 | + | ||
| 122 | + | } | |
| 123 | + | ||
| 124 | + | // Retrieves the accessible parent for an accessible object. | |
| 125 | + | // | |
| 126 | + | // This function returns `NULL` for top level widgets. | |
| 127 | + | func (x *Spinner) GetAccessibleParent() *gtk.AccessibleBase { | |
| 128 | + | var cls *gtk.AccessibleBase | |
| 129 | + | ||
| 130 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 131 | + | ||
| 132 | + | if cret == 0 { | |
| 133 | + | return nil | |
| 134 | + | } | |
| 135 | + | cls = >k.AccessibleBase{} | |
| 136 | + | cls.Ptr = cret | |
| 137 | + | return cls | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // Retrieves the accessible role of an accessible object. | |
| 106 | 141 | func (x *Spinner) GetAccessibleRole() gtk.AccessibleRole { | |
| 107 | 142 | ||
| 108 | 143 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 109 | 144 | return cret | |
| 110 | 145 | } | |
| 111 | 146 | ||
| 112 | - | // Resets the accessible @property to its default value. | |
| 147 | + | // Retrieves the implementation for the given accessible object. | |
| 148 | + | func (x *Spinner) GetAtContext() *gtk.ATContext { | |
| 149 | + | var cls *gtk.ATContext | |
| 150 | + | ||
| 151 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 152 | + | ||
| 153 | + | if cret == 0 { | |
| 154 | + | return nil | |
| 155 | + | } | |
| 156 | + | cls = >k.ATContext{} | |
| 157 | + | cls.Ptr = cret | |
| 158 | + | return cls | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | // Queries the coordinates and dimensions of this accessible | |
| 162 | + | // | |
| 163 | + | // This functionality can be overridden by `GtkAccessible` | |
| 164 | + | // implementations, e.g. to get the bounds from an ignored | |
| 165 | + | // child widget. | |
| 166 | + | func (x *Spinner) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 167 | + | ||
| 168 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 169 | + | return cret | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | // Retrieves the first accessible child of an accessible object. | |
| 173 | + | func (x *Spinner) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 174 | + | var cls *gtk.AccessibleBase | |
| 175 | + | ||
| 176 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 177 | + | ||
| 178 | + | if cret == 0 { | |
| 179 | + | return nil | |
| 180 | + | } | |
| 181 | + | cls = >k.AccessibleBase{} | |
| 182 | + | cls.Ptr = cret | |
| 183 | + | return cls | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // Retrieves the next accessible sibling of an accessible object | |
| 187 | + | func (x *Spinner) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 188 | + | var cls *gtk.AccessibleBase | |
| 189 | + | ||
| 190 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 191 | + | ||
| 192 | + | if cret == 0 { | |
| 193 | + | return nil | |
| 194 | + | } | |
| 195 | + | cls = >k.AccessibleBase{} | |
| 196 | + | cls.Ptr = cret | |
| 197 | + | return cls | |
| 198 | + | } | |
| 199 | + | ||
| 200 | + | // Queries a platform state, such as focus. | |
| 201 | + | // | |
| 202 | + | // This functionality can be overridden by `GtkAccessible` | |
| 203 | + | // implementations, e.g. to get platform state from an ignored | |
| 204 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 205 | + | func (x *Spinner) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 206 | + | ||
| 207 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 208 | + | return cret | |
| 209 | + | } | |
| 210 | + | ||
| 211 | + | // Resets the accessible property to its default value. | |
| 113 | 212 | func (x *Spinner) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 114 | 213 | ||
| 115 | 214 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 116 | 215 | ||
| 117 | 216 | } | |
| 118 | 217 | ||
| 119 | - | // Resets the accessible @relation to its default value. | |
| 218 | + | // Resets the accessible relation to its default value. | |
| 120 | 219 | func (x *Spinner) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 121 | 220 | ||
| 122 | 221 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 123 | 222 | ||
| 124 | 223 | } | |
| 125 | 224 | ||
| 126 | - | // Resets the accessible @state to its default value. | |
| 225 | + | // Resets the accessible state to its default value. | |
| 127 | 226 | func (x *Spinner) ResetState(StateVar gtk.AccessibleState) { | |
| 128 | 227 | ||
| 129 | 228 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 130 | 229 | ||
| 131 | 230 | } | |
| 132 | 231 | ||
| 232 | + | // Sets the parent and sibling of an accessible object. | |
| 233 | + | // | |
| 234 | + | // This function is meant to be used by accessible implementations that are | |
| 235 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 236 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 237 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 238 | + | // interface, you will use this function to ensure that the parent of each | |
| 239 | + | // child widget is the metadata object, and the parent of each metadata | |
| 240 | + | // object is the container widget. | |
| 241 | + | func (x *Spinner) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 242 | + | ||
| 243 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 244 | + | ||
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // Updates the next accessible sibling. | |
| 248 | + | // | |
| 249 | + | // That might be useful when a new child of a custom accessible | |
| 250 | + | // is created, and it needs to be linked to a previous child. | |
| 251 | + | func (x *Spinner) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 252 | + | ||
| 253 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | // Informs ATs that the platform state has changed. | |
| 258 | + | // | |
| 259 | + | // This function should be used by `GtkAccessible` implementations that | |
| 260 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 261 | + | // states automatically. | |
| 262 | + | func (x *Spinner) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 263 | + | ||
| 264 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 265 | + | ||
| 266 | + | } | |
| 267 | + | ||
| 133 | 268 | // Updates a list of accessible properties. | |
| 134 | 269 | // | |
| 135 | 270 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -172,7 +307,7 @@ func (x *Spinner) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Ac | |||
| 172 | 307 | // relation change must be communicated to assistive technologies. | |
| 173 | 308 | // | |
| 174 | 309 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 175 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 310 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 176 | 311 | // | |
| 177 | 312 | // ```c | |
| 178 | 313 | // gtk_accessible_update_relation (accessible, | |
| @@ -202,13 +337,17 @@ func (x *Spinner) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acce | |||
| 202 | 337 | ||
| 203 | 338 | } | |
| 204 | 339 | ||
| 205 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 206 | - | // documentation for the value types of accessible states. | |
| 340 | + | // Updates a list of accessible states. | |
| 207 | 341 | // | |
| 208 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 209 | - | // state change must be communicated to assistive technologies. | |
| 342 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 343 | + | // value types of accessible states. | |
| 344 | + | // | |
| 345 | + | // This function should be called by `GtkWidget` types whenever | |
| 346 | + | // an accessible state change must be communicated to assistive | |
| 347 | + | // technologies. | |
| 210 | 348 | // | |
| 211 | 349 | // Example: | |
| 350 | + | // | |
| 212 | 351 | // ```c | |
| 213 | 352 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 214 | 353 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -238,7 +377,7 @@ func (x *Spinner) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleSta | |||
| 238 | 377 | // Gets the ID of the @buildable object. | |
| 239 | 378 | // | |
| 240 | 379 | // `GtkBuilder` sets the name based on the ID attribute | |
| 241 | - | // of the <object> tag used to construct the @buildable. | |
| 380 | + | // of the `<object>` tag used to construct the @buildable. | |
| 242 | 381 | func (x *Spinner) GetBuildableId() string { | |
| 243 | 382 | ||
| 244 | 383 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-split-button.go +145 -10
| @@ -405,34 +405,165 @@ func (x *SplitButton) ConnectClicked(cb *func(SplitButton)) uint32 { | |||
| 405 | 405 | return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr) | |
| 406 | 406 | } | |
| 407 | 407 | ||
| 408 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 408 | + | // Requests the user's screen reader to announce the given message. | |
| 409 | + | // | |
| 410 | + | // This kind of notification is useful for messages that | |
| 411 | + | // either have only a visual representation or that are not | |
| 412 | + | // exposed visually at all, e.g. a notification about a | |
| 413 | + | // successful operation. | |
| 414 | + | // | |
| 415 | + | // Also, by using this API, you can ensure that the message | |
| 416 | + | // does not interrupts the user's current screen reader output. | |
| 417 | + | func (x *SplitButton) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 418 | + | ||
| 419 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 420 | + | ||
| 421 | + | } | |
| 422 | + | ||
| 423 | + | // Retrieves the accessible parent for an accessible object. | |
| 424 | + | // | |
| 425 | + | // This function returns `NULL` for top level widgets. | |
| 426 | + | func (x *SplitButton) GetAccessibleParent() *gtk.AccessibleBase { | |
| 427 | + | var cls *gtk.AccessibleBase | |
| 428 | + | ||
| 429 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 430 | + | ||
| 431 | + | if cret == 0 { | |
| 432 | + | return nil | |
| 433 | + | } | |
| 434 | + | cls = >k.AccessibleBase{} | |
| 435 | + | cls.Ptr = cret | |
| 436 | + | return cls | |
| 437 | + | } | |
| 438 | + | ||
| 439 | + | // Retrieves the accessible role of an accessible object. | |
| 409 | 440 | func (x *SplitButton) GetAccessibleRole() gtk.AccessibleRole { | |
| 410 | 441 | ||
| 411 | 442 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 412 | 443 | return cret | |
| 413 | 444 | } | |
| 414 | 445 | ||
| 415 | - | // Resets the accessible @property to its default value. | |
| 446 | + | // Retrieves the implementation for the given accessible object. | |
| 447 | + | func (x *SplitButton) GetAtContext() *gtk.ATContext { | |
| 448 | + | var cls *gtk.ATContext | |
| 449 | + | ||
| 450 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 451 | + | ||
| 452 | + | if cret == 0 { | |
| 453 | + | return nil | |
| 454 | + | } | |
| 455 | + | cls = >k.ATContext{} | |
| 456 | + | cls.Ptr = cret | |
| 457 | + | return cls | |
| 458 | + | } | |
| 459 | + | ||
| 460 | + | // Queries the coordinates and dimensions of this accessible | |
| 461 | + | // | |
| 462 | + | // This functionality can be overridden by `GtkAccessible` | |
| 463 | + | // implementations, e.g. to get the bounds from an ignored | |
| 464 | + | // child widget. | |
| 465 | + | func (x *SplitButton) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 466 | + | ||
| 467 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 468 | + | return cret | |
| 469 | + | } | |
| 470 | + | ||
| 471 | + | // Retrieves the first accessible child of an accessible object. | |
| 472 | + | func (x *SplitButton) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 473 | + | var cls *gtk.AccessibleBase | |
| 474 | + | ||
| 475 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 476 | + | ||
| 477 | + | if cret == 0 { | |
| 478 | + | return nil | |
| 479 | + | } | |
| 480 | + | cls = >k.AccessibleBase{} | |
| 481 | + | cls.Ptr = cret | |
| 482 | + | return cls | |
| 483 | + | } | |
| 484 | + | ||
| 485 | + | // Retrieves the next accessible sibling of an accessible object | |
| 486 | + | func (x *SplitButton) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 487 | + | var cls *gtk.AccessibleBase | |
| 488 | + | ||
| 489 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 490 | + | ||
| 491 | + | if cret == 0 { | |
| 492 | + | return nil | |
| 493 | + | } | |
| 494 | + | cls = >k.AccessibleBase{} | |
| 495 | + | cls.Ptr = cret | |
| 496 | + | return cls | |
| 497 | + | } | |
| 498 | + | ||
| 499 | + | // Queries a platform state, such as focus. | |
| 500 | + | // | |
| 501 | + | // This functionality can be overridden by `GtkAccessible` | |
| 502 | + | // implementations, e.g. to get platform state from an ignored | |
| 503 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 504 | + | func (x *SplitButton) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 505 | + | ||
| 506 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 507 | + | return cret | |
| 508 | + | } | |
| 509 | + | ||
| 510 | + | // Resets the accessible property to its default value. | |
| 416 | 511 | func (x *SplitButton) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 417 | 512 | ||
| 418 | 513 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 419 | 514 | ||
| 420 | 515 | } | |
| 421 | 516 | ||
| 422 | - | // Resets the accessible @relation to its default value. | |
| 517 | + | // Resets the accessible relation to its default value. | |
| 423 | 518 | func (x *SplitButton) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 424 | 519 | ||
| 425 | 520 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 426 | 521 | ||
| 427 | 522 | } | |
| 428 | 523 | ||
| 429 | - | // Resets the accessible @state to its default value. | |
| 524 | + | // Resets the accessible state to its default value. | |
| 430 | 525 | func (x *SplitButton) ResetState(StateVar gtk.AccessibleState) { | |
| 431 | 526 | ||
| 432 | 527 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 433 | 528 | ||
| 434 | 529 | } | |
| 435 | 530 | ||
| 531 | + | // Sets the parent and sibling of an accessible object. | |
| 532 | + | // | |
| 533 | + | // This function is meant to be used by accessible implementations that are | |
| 534 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 535 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 536 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 537 | + | // interface, you will use this function to ensure that the parent of each | |
| 538 | + | // child widget is the metadata object, and the parent of each metadata | |
| 539 | + | // object is the container widget. | |
| 540 | + | func (x *SplitButton) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 541 | + | ||
| 542 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 543 | + | ||
| 544 | + | } | |
| 545 | + | ||
| 546 | + | // Updates the next accessible sibling. | |
| 547 | + | // | |
| 548 | + | // That might be useful when a new child of a custom accessible | |
| 549 | + | // is created, and it needs to be linked to a previous child. | |
| 550 | + | func (x *SplitButton) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 551 | + | ||
| 552 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 553 | + | ||
| 554 | + | } | |
| 555 | + | ||
| 556 | + | // Informs ATs that the platform state has changed. | |
| 557 | + | // | |
| 558 | + | // This function should be used by `GtkAccessible` implementations that | |
| 559 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 560 | + | // states automatically. | |
| 561 | + | func (x *SplitButton) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 562 | + | ||
| 563 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 564 | + | ||
| 565 | + | } | |
| 566 | + | ||
| 436 | 567 | // Updates a list of accessible properties. | |
| 437 | 568 | // | |
| 438 | 569 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -475,7 +606,7 @@ func (x *SplitButton) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 475 | 606 | // relation change must be communicated to assistive technologies. | |
| 476 | 607 | // | |
| 477 | 608 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 478 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 609 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 479 | 610 | // | |
| 480 | 611 | // ```c | |
| 481 | 612 | // gtk_accessible_update_relation (accessible, | |
| @@ -505,13 +636,17 @@ func (x *SplitButton) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 505 | 636 | ||
| 506 | 637 | } | |
| 507 | 638 | ||
| 508 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 509 | - | // documentation for the value types of accessible states. | |
| 639 | + | // Updates a list of accessible states. | |
| 510 | 640 | // | |
| 511 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 512 | - | // state change must be communicated to assistive technologies. | |
| 641 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 642 | + | // value types of accessible states. | |
| 643 | + | // | |
| 644 | + | // This function should be called by `GtkWidget` types whenever | |
| 645 | + | // an accessible state change must be communicated to assistive | |
| 646 | + | // technologies. | |
| 513 | 647 | // | |
| 514 | 648 | // Example: | |
| 649 | + | // | |
| 515 | 650 | // ```c | |
| 516 | 651 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 517 | 652 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -624,7 +759,7 @@ func (x *SplitButton) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 624 | 759 | // Gets the ID of the @buildable object. | |
| 625 | 760 | // | |
| 626 | 761 | // `GtkBuilder` sets the name based on the ID attribute | |
| 627 | - | // of the <object> tag used to construct the @buildable. | |
| 762 | + | // of the `<object>` tag used to construct the @buildable. | |
| 628 | 763 | func (x *SplitButton) GetBuildableId() string { | |
| 629 | 764 | ||
| 630 | 765 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-squeezer.go +145 -10
| @@ -389,34 +389,165 @@ func (c *Squeezer) SetGoPointer(ptr uintptr) { | |||
| 389 | 389 | c.Ptr = ptr | |
| 390 | 390 | } | |
| 391 | 391 | ||
| 392 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 392 | + | // Requests the user's screen reader to announce the given message. | |
| 393 | + | // | |
| 394 | + | // This kind of notification is useful for messages that | |
| 395 | + | // either have only a visual representation or that are not | |
| 396 | + | // exposed visually at all, e.g. a notification about a | |
| 397 | + | // successful operation. | |
| 398 | + | // | |
| 399 | + | // Also, by using this API, you can ensure that the message | |
| 400 | + | // does not interrupts the user's current screen reader output. | |
| 401 | + | func (x *Squeezer) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 402 | + | ||
| 403 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 404 | + | ||
| 405 | + | } | |
| 406 | + | ||
| 407 | + | // Retrieves the accessible parent for an accessible object. | |
| 408 | + | // | |
| 409 | + | // This function returns `NULL` for top level widgets. | |
| 410 | + | func (x *Squeezer) GetAccessibleParent() *gtk.AccessibleBase { | |
| 411 | + | var cls *gtk.AccessibleBase | |
| 412 | + | ||
| 413 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 414 | + | ||
| 415 | + | if cret == 0 { | |
| 416 | + | return nil | |
| 417 | + | } | |
| 418 | + | cls = >k.AccessibleBase{} | |
| 419 | + | cls.Ptr = cret | |
| 420 | + | return cls | |
| 421 | + | } | |
| 422 | + | ||
| 423 | + | // Retrieves the accessible role of an accessible object. | |
| 393 | 424 | func (x *Squeezer) GetAccessibleRole() gtk.AccessibleRole { | |
| 394 | 425 | ||
| 395 | 426 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 396 | 427 | return cret | |
| 397 | 428 | } | |
| 398 | 429 | ||
| 399 | - | // Resets the accessible @property to its default value. | |
| 430 | + | // Retrieves the implementation for the given accessible object. | |
| 431 | + | func (x *Squeezer) GetAtContext() *gtk.ATContext { | |
| 432 | + | var cls *gtk.ATContext | |
| 433 | + | ||
| 434 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 435 | + | ||
| 436 | + | if cret == 0 { | |
| 437 | + | return nil | |
| 438 | + | } | |
| 439 | + | cls = >k.ATContext{} | |
| 440 | + | cls.Ptr = cret | |
| 441 | + | return cls | |
| 442 | + | } | |
| 443 | + | ||
| 444 | + | // Queries the coordinates and dimensions of this accessible | |
| 445 | + | // | |
| 446 | + | // This functionality can be overridden by `GtkAccessible` | |
| 447 | + | // implementations, e.g. to get the bounds from an ignored | |
| 448 | + | // child widget. | |
| 449 | + | func (x *Squeezer) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 450 | + | ||
| 451 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 452 | + | return cret | |
| 453 | + | } | |
| 454 | + | ||
| 455 | + | // Retrieves the first accessible child of an accessible object. | |
| 456 | + | func (x *Squeezer) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 457 | + | var cls *gtk.AccessibleBase | |
| 458 | + | ||
| 459 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 460 | + | ||
| 461 | + | if cret == 0 { | |
| 462 | + | return nil | |
| 463 | + | } | |
| 464 | + | cls = >k.AccessibleBase{} | |
| 465 | + | cls.Ptr = cret | |
| 466 | + | return cls | |
| 467 | + | } | |
| 468 | + | ||
| 469 | + | // Retrieves the next accessible sibling of an accessible object | |
| 470 | + | func (x *Squeezer) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 471 | + | var cls *gtk.AccessibleBase | |
| 472 | + | ||
| 473 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 474 | + | ||
| 475 | + | if cret == 0 { | |
| 476 | + | return nil | |
| 477 | + | } | |
| 478 | + | cls = >k.AccessibleBase{} | |
| 479 | + | cls.Ptr = cret | |
| 480 | + | return cls | |
| 481 | + | } | |
| 482 | + | ||
| 483 | + | // Queries a platform state, such as focus. | |
| 484 | + | // | |
| 485 | + | // This functionality can be overridden by `GtkAccessible` | |
| 486 | + | // implementations, e.g. to get platform state from an ignored | |
| 487 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 488 | + | func (x *Squeezer) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 489 | + | ||
| 490 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 491 | + | return cret | |
| 492 | + | } | |
| 493 | + | ||
| 494 | + | // Resets the accessible property to its default value. | |
| 400 | 495 | func (x *Squeezer) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 401 | 496 | ||
| 402 | 497 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 403 | 498 | ||
| 404 | 499 | } | |
| 405 | 500 | ||
| 406 | - | // Resets the accessible @relation to its default value. | |
| 501 | + | // Resets the accessible relation to its default value. | |
| 407 | 502 | func (x *Squeezer) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 408 | 503 | ||
| 409 | 504 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 410 | 505 | ||
| 411 | 506 | } | |
| 412 | 507 | ||
| 413 | - | // Resets the accessible @state to its default value. | |
| 508 | + | // Resets the accessible state to its default value. | |
| 414 | 509 | func (x *Squeezer) ResetState(StateVar gtk.AccessibleState) { | |
| 415 | 510 | ||
| 416 | 511 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 417 | 512 | ||
| 418 | 513 | } | |
| 419 | 514 | ||
| 515 | + | // Sets the parent and sibling of an accessible object. | |
| 516 | + | // | |
| 517 | + | // This function is meant to be used by accessible implementations that are | |
| 518 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 519 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 520 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 521 | + | // interface, you will use this function to ensure that the parent of each | |
| 522 | + | // child widget is the metadata object, and the parent of each metadata | |
| 523 | + | // object is the container widget. | |
| 524 | + | func (x *Squeezer) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 525 | + | ||
| 526 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 527 | + | ||
| 528 | + | } | |
| 529 | + | ||
| 530 | + | // Updates the next accessible sibling. | |
| 531 | + | // | |
| 532 | + | // That might be useful when a new child of a custom accessible | |
| 533 | + | // is created, and it needs to be linked to a previous child. | |
| 534 | + | func (x *Squeezer) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 535 | + | ||
| 536 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 537 | + | ||
| 538 | + | } | |
| 539 | + | ||
| 540 | + | // Informs ATs that the platform state has changed. | |
| 541 | + | // | |
| 542 | + | // This function should be used by `GtkAccessible` implementations that | |
| 543 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 544 | + | // states automatically. | |
| 545 | + | func (x *Squeezer) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 546 | + | ||
| 547 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 548 | + | ||
| 549 | + | } | |
| 550 | + | ||
| 420 | 551 | // Updates a list of accessible properties. | |
| 421 | 552 | // | |
| 422 | 553 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -459,7 +590,7 @@ func (x *Squeezer) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.A | |||
| 459 | 590 | // relation change must be communicated to assistive technologies. | |
| 460 | 591 | // | |
| 461 | 592 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 462 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 593 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 463 | 594 | // | |
| 464 | 595 | // ```c | |
| 465 | 596 | // gtk_accessible_update_relation (accessible, | |
| @@ -489,13 +620,17 @@ func (x *Squeezer) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acc | |||
| 489 | 620 | ||
| 490 | 621 | } | |
| 491 | 622 | ||
| 492 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 493 | - | // documentation for the value types of accessible states. | |
| 623 | + | // Updates a list of accessible states. | |
| 494 | 624 | // | |
| 495 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 496 | - | // state change must be communicated to assistive technologies. | |
| 625 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 626 | + | // value types of accessible states. | |
| 627 | + | // | |
| 628 | + | // This function should be called by `GtkWidget` types whenever | |
| 629 | + | // an accessible state change must be communicated to assistive | |
| 630 | + | // technologies. | |
| 497 | 631 | // | |
| 498 | 632 | // Example: | |
| 633 | + | // | |
| 499 | 634 | // ```c | |
| 500 | 635 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 501 | 636 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -525,7 +660,7 @@ func (x *Squeezer) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleSt | |||
| 525 | 660 | // Gets the ID of the @buildable object. | |
| 526 | 661 | // | |
| 527 | 662 | // `GtkBuilder` sets the name based on the ID attribute | |
| 528 | - | // of the <object> tag used to construct the @buildable. | |
| 663 | + | // of the `<object>` tag used to construct the @buildable. | |
| 529 | 664 | func (x *Squeezer) GetBuildableId() string { | |
| 530 | 665 | ||
| 531 | 666 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-status-page.go +145 -10
| @@ -214,34 +214,165 @@ func (c *StatusPage) SetGoPointer(ptr uintptr) { | |||
| 214 | 214 | c.Ptr = ptr | |
| 215 | 215 | } | |
| 216 | 216 | ||
| 217 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 217 | + | // Requests the user's screen reader to announce the given message. | |
| 218 | + | // | |
| 219 | + | // This kind of notification is useful for messages that | |
| 220 | + | // either have only a visual representation or that are not | |
| 221 | + | // exposed visually at all, e.g. a notification about a | |
| 222 | + | // successful operation. | |
| 223 | + | // | |
| 224 | + | // Also, by using this API, you can ensure that the message | |
| 225 | + | // does not interrupts the user's current screen reader output. | |
| 226 | + | func (x *StatusPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 227 | + | ||
| 228 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 229 | + | ||
| 230 | + | } | |
| 231 | + | ||
| 232 | + | // Retrieves the accessible parent for an accessible object. | |
| 233 | + | // | |
| 234 | + | // This function returns `NULL` for top level widgets. | |
| 235 | + | func (x *StatusPage) GetAccessibleParent() *gtk.AccessibleBase { | |
| 236 | + | var cls *gtk.AccessibleBase | |
| 237 | + | ||
| 238 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 239 | + | ||
| 240 | + | if cret == 0 { | |
| 241 | + | return nil | |
| 242 | + | } | |
| 243 | + | cls = >k.AccessibleBase{} | |
| 244 | + | cls.Ptr = cret | |
| 245 | + | return cls | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // Retrieves the accessible role of an accessible object. | |
| 218 | 249 | func (x *StatusPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 219 | 250 | ||
| 220 | 251 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 221 | 252 | return cret | |
| 222 | 253 | } | |
| 223 | 254 | ||
| 224 | - | // Resets the accessible @property to its default value. | |
| 255 | + | // Retrieves the implementation for the given accessible object. | |
| 256 | + | func (x *StatusPage) GetAtContext() *gtk.ATContext { | |
| 257 | + | var cls *gtk.ATContext | |
| 258 | + | ||
| 259 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 260 | + | ||
| 261 | + | if cret == 0 { | |
| 262 | + | return nil | |
| 263 | + | } | |
| 264 | + | cls = >k.ATContext{} | |
| 265 | + | cls.Ptr = cret | |
| 266 | + | return cls | |
| 267 | + | } | |
| 268 | + | ||
| 269 | + | // Queries the coordinates and dimensions of this accessible | |
| 270 | + | // | |
| 271 | + | // This functionality can be overridden by `GtkAccessible` | |
| 272 | + | // implementations, e.g. to get the bounds from an ignored | |
| 273 | + | // child widget. | |
| 274 | + | func (x *StatusPage) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 275 | + | ||
| 276 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 277 | + | return cret | |
| 278 | + | } | |
| 279 | + | ||
| 280 | + | // Retrieves the first accessible child of an accessible object. | |
| 281 | + | func (x *StatusPage) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 282 | + | var cls *gtk.AccessibleBase | |
| 283 | + | ||
| 284 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 285 | + | ||
| 286 | + | if cret == 0 { | |
| 287 | + | return nil | |
| 288 | + | } | |
| 289 | + | cls = >k.AccessibleBase{} | |
| 290 | + | cls.Ptr = cret | |
| 291 | + | return cls | |
| 292 | + | } | |
| 293 | + | ||
| 294 | + | // Retrieves the next accessible sibling of an accessible object | |
| 295 | + | func (x *StatusPage) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 296 | + | var cls *gtk.AccessibleBase | |
| 297 | + | ||
| 298 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 299 | + | ||
| 300 | + | if cret == 0 { | |
| 301 | + | return nil | |
| 302 | + | } | |
| 303 | + | cls = >k.AccessibleBase{} | |
| 304 | + | cls.Ptr = cret | |
| 305 | + | return cls | |
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // Queries a platform state, such as focus. | |
| 309 | + | // | |
| 310 | + | // This functionality can be overridden by `GtkAccessible` | |
| 311 | + | // implementations, e.g. to get platform state from an ignored | |
| 312 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 313 | + | func (x *StatusPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 314 | + | ||
| 315 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 316 | + | return cret | |
| 317 | + | } | |
| 318 | + | ||
| 319 | + | // Resets the accessible property to its default value. | |
| 225 | 320 | func (x *StatusPage) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 226 | 321 | ||
| 227 | 322 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 228 | 323 | ||
| 229 | 324 | } | |
| 230 | 325 | ||
| 231 | - | // Resets the accessible @relation to its default value. | |
| 326 | + | // Resets the accessible relation to its default value. | |
| 232 | 327 | func (x *StatusPage) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 233 | 328 | ||
| 234 | 329 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 235 | 330 | ||
| 236 | 331 | } | |
| 237 | 332 | ||
| 238 | - | // Resets the accessible @state to its default value. | |
| 333 | + | // Resets the accessible state to its default value. | |
| 239 | 334 | func (x *StatusPage) ResetState(StateVar gtk.AccessibleState) { | |
| 240 | 335 | ||
| 241 | 336 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 242 | 337 | ||
| 243 | 338 | } | |
| 244 | 339 | ||
| 340 | + | // Sets the parent and sibling of an accessible object. | |
| 341 | + | // | |
| 342 | + | // This function is meant to be used by accessible implementations that are | |
| 343 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 344 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 345 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 346 | + | // interface, you will use this function to ensure that the parent of each | |
| 347 | + | // child widget is the metadata object, and the parent of each metadata | |
| 348 | + | // object is the container widget. | |
| 349 | + | func (x *StatusPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 350 | + | ||
| 351 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 352 | + | ||
| 353 | + | } | |
| 354 | + | ||
| 355 | + | // Updates the next accessible sibling. | |
| 356 | + | // | |
| 357 | + | // That might be useful when a new child of a custom accessible | |
| 358 | + | // is created, and it needs to be linked to a previous child. | |
| 359 | + | func (x *StatusPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 360 | + | ||
| 361 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 362 | + | ||
| 363 | + | } | |
| 364 | + | ||
| 365 | + | // Informs ATs that the platform state has changed. | |
| 366 | + | // | |
| 367 | + | // This function should be used by `GtkAccessible` implementations that | |
| 368 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 369 | + | // states automatically. | |
| 370 | + | func (x *StatusPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 371 | + | ||
| 372 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 373 | + | ||
| 374 | + | } | |
| 375 | + | ||
| 245 | 376 | // Updates a list of accessible properties. | |
| 246 | 377 | // | |
| 247 | 378 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -284,7 +415,7 @@ func (x *StatusPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk | |||
| 284 | 415 | // relation change must be communicated to assistive technologies. | |
| 285 | 416 | // | |
| 286 | 417 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 287 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 418 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 288 | 419 | // | |
| 289 | 420 | // ```c | |
| 290 | 421 | // gtk_accessible_update_relation (accessible, | |
| @@ -314,13 +445,17 @@ func (x *StatusPage) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.A | |||
| 314 | 445 | ||
| 315 | 446 | } | |
| 316 | 447 | ||
| 317 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 318 | - | // documentation for the value types of accessible states. | |
| 448 | + | // Updates a list of accessible states. | |
| 319 | 449 | // | |
| 320 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 321 | - | // state change must be communicated to assistive technologies. | |
| 450 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 451 | + | // value types of accessible states. | |
| 452 | + | // | |
| 453 | + | // This function should be called by `GtkWidget` types whenever | |
| 454 | + | // an accessible state change must be communicated to assistive | |
| 455 | + | // technologies. | |
| 322 | 456 | // | |
| 323 | 457 | // Example: | |
| 458 | + | // | |
| 324 | 459 | // ```c | |
| 325 | 460 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 326 | 461 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -350,7 +485,7 @@ func (x *StatusPage) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessible | |||
| 350 | 485 | // Gets the ID of the @buildable object. | |
| 351 | 486 | // | |
| 352 | 487 | // `GtkBuilder` sets the name based on the ID attribute | |
| 353 | - | // of the <object> tag used to construct the @buildable. | |
| 488 | + | // of the `<object>` tag used to construct the @buildable. | |
| 354 | 489 | func (x *StatusPage) GetBuildableId() string { | |
| 355 | 490 | ||
| 356 | 491 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-style-manager.go +30 -0
| @@ -141,6 +141,20 @@ func (x *StyleManager) GetDisplay() *gdk.Display { | |||
| 141 | 141 | return cls | |
| 142 | 142 | } | |
| 143 | 143 | ||
| 144 | + | var xStyleManagerGetDocumentFontName func(uintptr) string | |
| 145 | + | ||
| 146 | + | // Gets the system document font. | |
| 147 | + | // | |
| 148 | + | // The font is in the same format as [property@Gtk.Settings:gtk-font-name], | |
| 149 | + | // e.g. "Adwaita Sans 11". | |
| 150 | + | // | |
| 151 | + | // Use [func@Pango.FontDescription.from_string] to parse it. | |
| 152 | + | func (x *StyleManager) GetDocumentFontName() string { | |
| 153 | + | ||
| 154 | + | cret := xStyleManagerGetDocumentFontName(x.GoPointer()) | |
| 155 | + | return cret | |
| 156 | + | } | |
| 157 | + | ||
| 144 | 158 | var xStyleManagerGetHighContrast func(uintptr) bool | |
| 145 | 159 | ||
| 146 | 160 | // Gets whether the application is using high contrast appearance. | |
| @@ -152,6 +166,20 @@ func (x *StyleManager) GetHighContrast() bool { | |||
| 152 | 166 | return cret | |
| 153 | 167 | } | |
| 154 | 168 | ||
| 169 | + | var xStyleManagerGetMonospaceFontName func(uintptr) string | |
| 170 | + | ||
| 171 | + | // Gets the system monospace font. | |
| 172 | + | // | |
| 173 | + | // The font is in the same format as [property@Gtk.Settings:gtk-font-name], | |
| 174 | + | // e.g. "Adwaita Mono 11". | |
| 175 | + | // | |
| 176 | + | // Use [func@Pango.FontDescription.from_string] to parse it. | |
| 177 | + | func (x *StyleManager) GetMonospaceFontName() string { | |
| 178 | + | ||
| 179 | + | cret := xStyleManagerGetMonospaceFontName(x.GoPointer()) | |
| 180 | + | return cret | |
| 181 | + | } | |
| 182 | + | ||
| 155 | 183 | var xStyleManagerGetSystemSupportsAccentColors func(uintptr) bool | |
| 156 | 184 | ||
| 157 | 185 | // Gets whether the system supports accent colors. | |
| @@ -291,7 +319,9 @@ func init() { | |||
| 291 | 319 | core.PuregoSafeRegister(&xStyleManagerGetColorScheme, lib, "adw_style_manager_get_color_scheme") | |
| 292 | 320 | core.PuregoSafeRegister(&xStyleManagerGetDark, lib, "adw_style_manager_get_dark") | |
| 293 | 321 | core.PuregoSafeRegister(&xStyleManagerGetDisplay, lib, "adw_style_manager_get_display") | |
| 322 | + | core.PuregoSafeRegister(&xStyleManagerGetDocumentFontName, lib, "adw_style_manager_get_document_font_name") | |
| 294 | 323 | core.PuregoSafeRegister(&xStyleManagerGetHighContrast, lib, "adw_style_manager_get_high_contrast") | |
| 324 | + | core.PuregoSafeRegister(&xStyleManagerGetMonospaceFontName, lib, "adw_style_manager_get_monospace_font_name") | |
| 295 | 325 | core.PuregoSafeRegister(&xStyleManagerGetSystemSupportsAccentColors, lib, "adw_style_manager_get_system_supports_accent_colors") | |
| 296 | 326 | core.PuregoSafeRegister(&xStyleManagerGetSystemSupportsColorSchemes, lib, "adw_style_manager_get_system_supports_color_schemes") | |
| 297 | 327 | core.PuregoSafeRegister(&xStyleManagerSetColorScheme, lib, "adw_style_manager_set_color_scheme") | |
M v4/adw/adw-switch-row.go +145 -10
| @@ -119,34 +119,165 @@ func (c *SwitchRow) SetGoPointer(ptr uintptr) { | |||
| 119 | 119 | c.Ptr = ptr | |
| 120 | 120 | } | |
| 121 | 121 | ||
| 122 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 122 | + | // Requests the user's screen reader to announce the given message. | |
| 123 | + | // | |
| 124 | + | // This kind of notification is useful for messages that | |
| 125 | + | // either have only a visual representation or that are not | |
| 126 | + | // exposed visually at all, e.g. a notification about a | |
| 127 | + | // successful operation. | |
| 128 | + | // | |
| 129 | + | // Also, by using this API, you can ensure that the message | |
| 130 | + | // does not interrupts the user's current screen reader output. | |
| 131 | + | func (x *SwitchRow) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 132 | + | ||
| 133 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 134 | + | ||
| 135 | + | } | |
| 136 | + | ||
| 137 | + | // Retrieves the accessible parent for an accessible object. | |
| 138 | + | // | |
| 139 | + | // This function returns `NULL` for top level widgets. | |
| 140 | + | func (x *SwitchRow) GetAccessibleParent() *gtk.AccessibleBase { | |
| 141 | + | var cls *gtk.AccessibleBase | |
| 142 | + | ||
| 143 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 144 | + | ||
| 145 | + | if cret == 0 { | |
| 146 | + | return nil | |
| 147 | + | } | |
| 148 | + | cls = >k.AccessibleBase{} | |
| 149 | + | cls.Ptr = cret | |
| 150 | + | return cls | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | // Retrieves the accessible role of an accessible object. | |
| 123 | 154 | func (x *SwitchRow) GetAccessibleRole() gtk.AccessibleRole { | |
| 124 | 155 | ||
| 125 | 156 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 126 | 157 | return cret | |
| 127 | 158 | } | |
| 128 | 159 | ||
| 129 | - | // Resets the accessible @property to its default value. | |
| 160 | + | // Retrieves the implementation for the given accessible object. | |
| 161 | + | func (x *SwitchRow) GetAtContext() *gtk.ATContext { | |
| 162 | + | var cls *gtk.ATContext | |
| 163 | + | ||
| 164 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 165 | + | ||
| 166 | + | if cret == 0 { | |
| 167 | + | return nil | |
| 168 | + | } | |
| 169 | + | cls = >k.ATContext{} | |
| 170 | + | cls.Ptr = cret | |
| 171 | + | return cls | |
| 172 | + | } | |
| 173 | + | ||
| 174 | + | // Queries the coordinates and dimensions of this accessible | |
| 175 | + | // | |
| 176 | + | // This functionality can be overridden by `GtkAccessible` | |
| 177 | + | // implementations, e.g. to get the bounds from an ignored | |
| 178 | + | // child widget. | |
| 179 | + | func (x *SwitchRow) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 180 | + | ||
| 181 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 182 | + | return cret | |
| 183 | + | } | |
| 184 | + | ||
| 185 | + | // Retrieves the first accessible child of an accessible object. | |
| 186 | + | func (x *SwitchRow) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 187 | + | var cls *gtk.AccessibleBase | |
| 188 | + | ||
| 189 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 190 | + | ||
| 191 | + | if cret == 0 { | |
| 192 | + | return nil | |
| 193 | + | } | |
| 194 | + | cls = >k.AccessibleBase{} | |
| 195 | + | cls.Ptr = cret | |
| 196 | + | return cls | |
| 197 | + | } | |
| 198 | + | ||
| 199 | + | // Retrieves the next accessible sibling of an accessible object | |
| 200 | + | func (x *SwitchRow) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 201 | + | var cls *gtk.AccessibleBase | |
| 202 | + | ||
| 203 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 204 | + | ||
| 205 | + | if cret == 0 { | |
| 206 | + | return nil | |
| 207 | + | } | |
| 208 | + | cls = >k.AccessibleBase{} | |
| 209 | + | cls.Ptr = cret | |
| 210 | + | return cls | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | // Queries a platform state, such as focus. | |
| 214 | + | // | |
| 215 | + | // This functionality can be overridden by `GtkAccessible` | |
| 216 | + | // implementations, e.g. to get platform state from an ignored | |
| 217 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 218 | + | func (x *SwitchRow) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 219 | + | ||
| 220 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 221 | + | return cret | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | // Resets the accessible property to its default value. | |
| 130 | 225 | func (x *SwitchRow) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 131 | 226 | ||
| 132 | 227 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 133 | 228 | ||
| 134 | 229 | } | |
| 135 | 230 | ||
| 136 | - | // Resets the accessible @relation to its default value. | |
| 231 | + | // Resets the accessible relation to its default value. | |
| 137 | 232 | func (x *SwitchRow) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 138 | 233 | ||
| 139 | 234 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 140 | 235 | ||
| 141 | 236 | } | |
| 142 | 237 | ||
| 143 | - | // Resets the accessible @state to its default value. | |
| 238 | + | // Resets the accessible state to its default value. | |
| 144 | 239 | func (x *SwitchRow) ResetState(StateVar gtk.AccessibleState) { | |
| 145 | 240 | ||
| 146 | 241 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 147 | 242 | ||
| 148 | 243 | } | |
| 149 | 244 | ||
| 245 | + | // Sets the parent and sibling of an accessible object. | |
| 246 | + | // | |
| 247 | + | // This function is meant to be used by accessible implementations that are | |
| 248 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 249 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 250 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 251 | + | // interface, you will use this function to ensure that the parent of each | |
| 252 | + | // child widget is the metadata object, and the parent of each metadata | |
| 253 | + | // object is the container widget. | |
| 254 | + | func (x *SwitchRow) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 255 | + | ||
| 256 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 257 | + | ||
| 258 | + | } | |
| 259 | + | ||
| 260 | + | // Updates the next accessible sibling. | |
| 261 | + | // | |
| 262 | + | // That might be useful when a new child of a custom accessible | |
| 263 | + | // is created, and it needs to be linked to a previous child. | |
| 264 | + | func (x *SwitchRow) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 265 | + | ||
| 266 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 267 | + | ||
| 268 | + | } | |
| 269 | + | ||
| 270 | + | // Informs ATs that the platform state has changed. | |
| 271 | + | // | |
| 272 | + | // This function should be used by `GtkAccessible` implementations that | |
| 273 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 274 | + | // states automatically. | |
| 275 | + | func (x *SwitchRow) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 276 | + | ||
| 277 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 278 | + | ||
| 279 | + | } | |
| 280 | + | ||
| 150 | 281 | // Updates a list of accessible properties. | |
| 151 | 282 | // | |
| 152 | 283 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -189,7 +320,7 @@ func (x *SwitchRow) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk. | |||
| 189 | 320 | // relation change must be communicated to assistive technologies. | |
| 190 | 321 | // | |
| 191 | 322 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 192 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 323 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 193 | 324 | // | |
| 194 | 325 | // ```c | |
| 195 | 326 | // gtk_accessible_update_relation (accessible, | |
| @@ -219,13 +350,17 @@ func (x *SwitchRow) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Ac | |||
| 219 | 350 | ||
| 220 | 351 | } | |
| 221 | 352 | ||
| 222 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 223 | - | // documentation for the value types of accessible states. | |
| 353 | + | // Updates a list of accessible states. | |
| 224 | 354 | // | |
| 225 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 226 | - | // state change must be communicated to assistive technologies. | |
| 355 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 356 | + | // value types of accessible states. | |
| 357 | + | // | |
| 358 | + | // This function should be called by `GtkWidget` types whenever | |
| 359 | + | // an accessible state change must be communicated to assistive | |
| 360 | + | // technologies. | |
| 227 | 361 | // | |
| 228 | 362 | // Example: | |
| 363 | + | // | |
| 229 | 364 | // ```c | |
| 230 | 365 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 231 | 366 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -338,7 +473,7 @@ func (x *SwitchRow) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 338 | 473 | // Gets the ID of the @buildable object. | |
| 339 | 474 | // | |
| 340 | 475 | // `GtkBuilder` sets the name based on the ID attribute | |
| 341 | - | // of the <object> tag used to construct the @buildable. | |
| 476 | + | // of the `<object>` tag used to construct the @buildable. | |
| 342 | 477 | func (x *SwitchRow) GetBuildableId() string { | |
| 343 | 478 | ||
| 344 | 479 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-tab-bar.go +145 -10
| @@ -370,34 +370,165 @@ func (x *TabBar) ConnectExtraDragValue(cb *func(TabBar, uintptr, uintptr) gdk.Dr | |||
| 370 | 370 | return gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr) | |
| 371 | 371 | } | |
| 372 | 372 | ||
| 373 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 373 | + | // Requests the user's screen reader to announce the given message. | |
| 374 | + | // | |
| 375 | + | // This kind of notification is useful for messages that | |
| 376 | + | // either have only a visual representation or that are not | |
| 377 | + | // exposed visually at all, e.g. a notification about a | |
| 378 | + | // successful operation. | |
| 379 | + | // | |
| 380 | + | // Also, by using this API, you can ensure that the message | |
| 381 | + | // does not interrupts the user's current screen reader output. | |
| 382 | + | func (x *TabBar) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 383 | + | ||
| 384 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 385 | + | ||
| 386 | + | } | |
| 387 | + | ||
| 388 | + | // Retrieves the accessible parent for an accessible object. | |
| 389 | + | // | |
| 390 | + | // This function returns `NULL` for top level widgets. | |
| 391 | + | func (x *TabBar) GetAccessibleParent() *gtk.AccessibleBase { | |
| 392 | + | var cls *gtk.AccessibleBase | |
| 393 | + | ||
| 394 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 395 | + | ||
| 396 | + | if cret == 0 { | |
| 397 | + | return nil | |
| 398 | + | } | |
| 399 | + | cls = >k.AccessibleBase{} | |
| 400 | + | cls.Ptr = cret | |
| 401 | + | return cls | |
| 402 | + | } | |
| 403 | + | ||
| 404 | + | // Retrieves the accessible role of an accessible object. | |
| 374 | 405 | func (x *TabBar) GetAccessibleRole() gtk.AccessibleRole { | |
| 375 | 406 | ||
| 376 | 407 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 377 | 408 | return cret | |
| 378 | 409 | } | |
| 379 | 410 | ||
| 380 | - | // Resets the accessible @property to its default value. | |
| 411 | + | // Retrieves the implementation for the given accessible object. | |
| 412 | + | func (x *TabBar) GetAtContext() *gtk.ATContext { | |
| 413 | + | var cls *gtk.ATContext | |
| 414 | + | ||
| 415 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 416 | + | ||
| 417 | + | if cret == 0 { | |
| 418 | + | return nil | |
| 419 | + | } | |
| 420 | + | cls = >k.ATContext{} | |
| 421 | + | cls.Ptr = cret | |
| 422 | + | return cls | |
| 423 | + | } | |
| 424 | + | ||
| 425 | + | // Queries the coordinates and dimensions of this accessible | |
| 426 | + | // | |
| 427 | + | // This functionality can be overridden by `GtkAccessible` | |
| 428 | + | // implementations, e.g. to get the bounds from an ignored | |
| 429 | + | // child widget. | |
| 430 | + | func (x *TabBar) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 431 | + | ||
| 432 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 433 | + | return cret | |
| 434 | + | } | |
| 435 | + | ||
| 436 | + | // Retrieves the first accessible child of an accessible object. | |
| 437 | + | func (x *TabBar) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 438 | + | var cls *gtk.AccessibleBase | |
| 439 | + | ||
| 440 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 441 | + | ||
| 442 | + | if cret == 0 { | |
| 443 | + | return nil | |
| 444 | + | } | |
| 445 | + | cls = >k.AccessibleBase{} | |
| 446 | + | cls.Ptr = cret | |
| 447 | + | return cls | |
| 448 | + | } | |
| 449 | + | ||
| 450 | + | // Retrieves the next accessible sibling of an accessible object | |
| 451 | + | func (x *TabBar) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 452 | + | var cls *gtk.AccessibleBase | |
| 453 | + | ||
| 454 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 455 | + | ||
| 456 | + | if cret == 0 { | |
| 457 | + | return nil | |
| 458 | + | } | |
| 459 | + | cls = >k.AccessibleBase{} | |
| 460 | + | cls.Ptr = cret | |
| 461 | + | return cls | |
| 462 | + | } | |
| 463 | + | ||
| 464 | + | // Queries a platform state, such as focus. | |
| 465 | + | // | |
| 466 | + | // This functionality can be overridden by `GtkAccessible` | |
| 467 | + | // implementations, e.g. to get platform state from an ignored | |
| 468 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 469 | + | func (x *TabBar) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 470 | + | ||
| 471 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 472 | + | return cret | |
| 473 | + | } | |
| 474 | + | ||
| 475 | + | // Resets the accessible property to its default value. | |
| 381 | 476 | func (x *TabBar) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 382 | 477 | ||
| 383 | 478 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 384 | 479 | ||
| 385 | 480 | } | |
| 386 | 481 | ||
| 387 | - | // Resets the accessible @relation to its default value. | |
| 482 | + | // Resets the accessible relation to its default value. | |
| 388 | 483 | func (x *TabBar) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 389 | 484 | ||
| 390 | 485 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 391 | 486 | ||
| 392 | 487 | } | |
| 393 | 488 | ||
| 394 | - | // Resets the accessible @state to its default value. | |
| 489 | + | // Resets the accessible state to its default value. | |
| 395 | 490 | func (x *TabBar) ResetState(StateVar gtk.AccessibleState) { | |
| 396 | 491 | ||
| 397 | 492 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 398 | 493 | ||
| 399 | 494 | } | |
| 400 | 495 | ||
| 496 | + | // Sets the parent and sibling of an accessible object. | |
| 497 | + | // | |
| 498 | + | // This function is meant to be used by accessible implementations that are | |
| 499 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 500 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 501 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 502 | + | // interface, you will use this function to ensure that the parent of each | |
| 503 | + | // child widget is the metadata object, and the parent of each metadata | |
| 504 | + | // object is the container widget. | |
| 505 | + | func (x *TabBar) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 506 | + | ||
| 507 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 508 | + | ||
| 509 | + | } | |
| 510 | + | ||
| 511 | + | // Updates the next accessible sibling. | |
| 512 | + | // | |
| 513 | + | // That might be useful when a new child of a custom accessible | |
| 514 | + | // is created, and it needs to be linked to a previous child. | |
| 515 | + | func (x *TabBar) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 516 | + | ||
| 517 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 518 | + | ||
| 519 | + | } | |
| 520 | + | ||
| 521 | + | // Informs ATs that the platform state has changed. | |
| 522 | + | // | |
| 523 | + | // This function should be used by `GtkAccessible` implementations that | |
| 524 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 525 | + | // states automatically. | |
| 526 | + | func (x *TabBar) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 527 | + | ||
| 528 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 529 | + | ||
| 530 | + | } | |
| 531 | + | ||
| 401 | 532 | // Updates a list of accessible properties. | |
| 402 | 533 | // | |
| 403 | 534 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -440,7 +571,7 @@ func (x *TabBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Acc | |||
| 440 | 571 | // relation change must be communicated to assistive technologies. | |
| 441 | 572 | // | |
| 442 | 573 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 443 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 574 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 444 | 575 | // | |
| 445 | 576 | // ```c | |
| 446 | 577 | // gtk_accessible_update_relation (accessible, | |
| @@ -470,13 +601,17 @@ func (x *TabBar) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acces | |||
| 470 | 601 | ||
| 471 | 602 | } | |
| 472 | 603 | ||
| 473 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 474 | - | // documentation for the value types of accessible states. | |
| 604 | + | // Updates a list of accessible states. | |
| 475 | 605 | // | |
| 476 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 477 | - | // state change must be communicated to assistive technologies. | |
| 606 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 607 | + | // value types of accessible states. | |
| 608 | + | // | |
| 609 | + | // This function should be called by `GtkWidget` types whenever | |
| 610 | + | // an accessible state change must be communicated to assistive | |
| 611 | + | // technologies. | |
| 478 | 612 | // | |
| 479 | 613 | // Example: | |
| 614 | + | // | |
| 480 | 615 | // ```c | |
| 481 | 616 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 482 | 617 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -506,7 +641,7 @@ func (x *TabBar) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleStat | |||
| 506 | 641 | // Gets the ID of the @buildable object. | |
| 507 | 642 | // | |
| 508 | 643 | // `GtkBuilder` sets the name based on the ID attribute | |
| 509 | - | // of the <object> tag used to construct the @buildable. | |
| 644 | + | // of the `<object>` tag used to construct the @buildable. | |
| 510 | 645 | func (x *TabBar) GetBuildableId() string { | |
| 511 | 646 | ||
| 512 | 647 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-tab-button.go +145 -10
| @@ -168,34 +168,165 @@ func (x *TabButton) ConnectClicked(cb *func(TabButton)) uint32 { | |||
| 168 | 168 | return gobject.SignalConnect(x.GoPointer(), "clicked", cbRefPtr) | |
| 169 | 169 | } | |
| 170 | 170 | ||
| 171 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 171 | + | // Requests the user's screen reader to announce the given message. | |
| 172 | + | // | |
| 173 | + | // This kind of notification is useful for messages that | |
| 174 | + | // either have only a visual representation or that are not | |
| 175 | + | // exposed visually at all, e.g. a notification about a | |
| 176 | + | // successful operation. | |
| 177 | + | // | |
| 178 | + | // Also, by using this API, you can ensure that the message | |
| 179 | + | // does not interrupts the user's current screen reader output. | |
| 180 | + | func (x *TabButton) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 181 | + | ||
| 182 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 183 | + | ||
| 184 | + | } | |
| 185 | + | ||
| 186 | + | // Retrieves the accessible parent for an accessible object. | |
| 187 | + | // | |
| 188 | + | // This function returns `NULL` for top level widgets. | |
| 189 | + | func (x *TabButton) GetAccessibleParent() *gtk.AccessibleBase { | |
| 190 | + | var cls *gtk.AccessibleBase | |
| 191 | + | ||
| 192 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 193 | + | ||
| 194 | + | if cret == 0 { | |
| 195 | + | return nil | |
| 196 | + | } | |
| 197 | + | cls = >k.AccessibleBase{} | |
| 198 | + | cls.Ptr = cret | |
| 199 | + | return cls | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | // Retrieves the accessible role of an accessible object. | |
| 172 | 203 | func (x *TabButton) GetAccessibleRole() gtk.AccessibleRole { | |
| 173 | 204 | ||
| 174 | 205 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 175 | 206 | return cret | |
| 176 | 207 | } | |
| 177 | 208 | ||
| 178 | - | // Resets the accessible @property to its default value. | |
| 209 | + | // Retrieves the implementation for the given accessible object. | |
| 210 | + | func (x *TabButton) GetAtContext() *gtk.ATContext { | |
| 211 | + | var cls *gtk.ATContext | |
| 212 | + | ||
| 213 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 214 | + | ||
| 215 | + | if cret == 0 { | |
| 216 | + | return nil | |
| 217 | + | } | |
| 218 | + | cls = >k.ATContext{} | |
| 219 | + | cls.Ptr = cret | |
| 220 | + | return cls | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // Queries the coordinates and dimensions of this accessible | |
| 224 | + | // | |
| 225 | + | // This functionality can be overridden by `GtkAccessible` | |
| 226 | + | // implementations, e.g. to get the bounds from an ignored | |
| 227 | + | // child widget. | |
| 228 | + | func (x *TabButton) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 229 | + | ||
| 230 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 231 | + | return cret | |
| 232 | + | } | |
| 233 | + | ||
| 234 | + | // Retrieves the first accessible child of an accessible object. | |
| 235 | + | func (x *TabButton) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 236 | + | var cls *gtk.AccessibleBase | |
| 237 | + | ||
| 238 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 239 | + | ||
| 240 | + | if cret == 0 { | |
| 241 | + | return nil | |
| 242 | + | } | |
| 243 | + | cls = >k.AccessibleBase{} | |
| 244 | + | cls.Ptr = cret | |
| 245 | + | return cls | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | // Retrieves the next accessible sibling of an accessible object | |
| 249 | + | func (x *TabButton) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 250 | + | var cls *gtk.AccessibleBase | |
| 251 | + | ||
| 252 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 253 | + | ||
| 254 | + | if cret == 0 { | |
| 255 | + | return nil | |
| 256 | + | } | |
| 257 | + | cls = >k.AccessibleBase{} | |
| 258 | + | cls.Ptr = cret | |
| 259 | + | return cls | |
| 260 | + | } | |
| 261 | + | ||
| 262 | + | // Queries a platform state, such as focus. | |
| 263 | + | // | |
| 264 | + | // This functionality can be overridden by `GtkAccessible` | |
| 265 | + | // implementations, e.g. to get platform state from an ignored | |
| 266 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 267 | + | func (x *TabButton) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 268 | + | ||
| 269 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 270 | + | return cret | |
| 271 | + | } | |
| 272 | + | ||
| 273 | + | // Resets the accessible property to its default value. | |
| 179 | 274 | func (x *TabButton) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 180 | 275 | ||
| 181 | 276 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 182 | 277 | ||
| 183 | 278 | } | |
| 184 | 279 | ||
| 185 | - | // Resets the accessible @relation to its default value. | |
| 280 | + | // Resets the accessible relation to its default value. | |
| 186 | 281 | func (x *TabButton) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 187 | 282 | ||
| 188 | 283 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 189 | 284 | ||
| 190 | 285 | } | |
| 191 | 286 | ||
| 192 | - | // Resets the accessible @state to its default value. | |
| 287 | + | // Resets the accessible state to its default value. | |
| 193 | 288 | func (x *TabButton) ResetState(StateVar gtk.AccessibleState) { | |
| 194 | 289 | ||
| 195 | 290 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 196 | 291 | ||
| 197 | 292 | } | |
| 198 | 293 | ||
| 294 | + | // Sets the parent and sibling of an accessible object. | |
| 295 | + | // | |
| 296 | + | // This function is meant to be used by accessible implementations that are | |
| 297 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 298 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 299 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 300 | + | // interface, you will use this function to ensure that the parent of each | |
| 301 | + | // child widget is the metadata object, and the parent of each metadata | |
| 302 | + | // object is the container widget. | |
| 303 | + | func (x *TabButton) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 304 | + | ||
| 305 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 306 | + | ||
| 307 | + | } | |
| 308 | + | ||
| 309 | + | // Updates the next accessible sibling. | |
| 310 | + | // | |
| 311 | + | // That might be useful when a new child of a custom accessible | |
| 312 | + | // is created, and it needs to be linked to a previous child. | |
| 313 | + | func (x *TabButton) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 314 | + | ||
| 315 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 316 | + | ||
| 317 | + | } | |
| 318 | + | ||
| 319 | + | // Informs ATs that the platform state has changed. | |
| 320 | + | // | |
| 321 | + | // This function should be used by `GtkAccessible` implementations that | |
| 322 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 323 | + | // states automatically. | |
| 324 | + | func (x *TabButton) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 325 | + | ||
| 326 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 327 | + | ||
| 328 | + | } | |
| 329 | + | ||
| 199 | 330 | // Updates a list of accessible properties. | |
| 200 | 331 | // | |
| 201 | 332 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -238,7 +369,7 @@ func (x *TabButton) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk. | |||
| 238 | 369 | // relation change must be communicated to assistive technologies. | |
| 239 | 370 | // | |
| 240 | 371 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 241 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 372 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 242 | 373 | // | |
| 243 | 374 | // ```c | |
| 244 | 375 | // gtk_accessible_update_relation (accessible, | |
| @@ -268,13 +399,17 @@ func (x *TabButton) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Ac | |||
| 268 | 399 | ||
| 269 | 400 | } | |
| 270 | 401 | ||
| 271 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 272 | - | // documentation for the value types of accessible states. | |
| 402 | + | // Updates a list of accessible states. | |
| 273 | 403 | // | |
| 274 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 275 | - | // state change must be communicated to assistive technologies. | |
| 404 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 405 | + | // value types of accessible states. | |
| 406 | + | // | |
| 407 | + | // This function should be called by `GtkWidget` types whenever | |
| 408 | + | // an accessible state change must be communicated to assistive | |
| 409 | + | // technologies. | |
| 276 | 410 | // | |
| 277 | 411 | // Example: | |
| 412 | + | // | |
| 278 | 413 | // ```c | |
| 279 | 414 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 280 | 415 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -387,7 +522,7 @@ func (x *TabButton) SetDetailedActionName(DetailedActionNameVar string) { | |||
| 387 | 522 | // Gets the ID of the @buildable object. | |
| 388 | 523 | // | |
| 389 | 524 | // `GtkBuilder` sets the name based on the ID attribute | |
| 390 | - | // of the <object> tag used to construct the @buildable. | |
| 525 | + | // of the `<object>` tag used to construct the @buildable. | |
| 391 | 526 | func (x *TabButton) GetBuildableId() string { | |
| 392 | 527 | ||
| 393 | 528 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-tab-overview.go +145 -10
| @@ -475,34 +475,165 @@ func (x *TabOverview) ConnectExtraDragValue(cb *func(TabOverview, uintptr, uintp | |||
| 475 | 475 | return gobject.SignalConnect(x.GoPointer(), "extra-drag-value", cbRefPtr) | |
| 476 | 476 | } | |
| 477 | 477 | ||
| 478 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 478 | + | // Requests the user's screen reader to announce the given message. | |
| 479 | + | // | |
| 480 | + | // This kind of notification is useful for messages that | |
| 481 | + | // either have only a visual representation or that are not | |
| 482 | + | // exposed visually at all, e.g. a notification about a | |
| 483 | + | // successful operation. | |
| 484 | + | // | |
| 485 | + | // Also, by using this API, you can ensure that the message | |
| 486 | + | // does not interrupts the user's current screen reader output. | |
| 487 | + | func (x *TabOverview) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 488 | + | ||
| 489 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 490 | + | ||
| 491 | + | } | |
| 492 | + | ||
| 493 | + | // Retrieves the accessible parent for an accessible object. | |
| 494 | + | // | |
| 495 | + | // This function returns `NULL` for top level widgets. | |
| 496 | + | func (x *TabOverview) GetAccessibleParent() *gtk.AccessibleBase { | |
| 497 | + | var cls *gtk.AccessibleBase | |
| 498 | + | ||
| 499 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 500 | + | ||
| 501 | + | if cret == 0 { | |
| 502 | + | return nil | |
| 503 | + | } | |
| 504 | + | cls = >k.AccessibleBase{} | |
| 505 | + | cls.Ptr = cret | |
| 506 | + | return cls | |
| 507 | + | } | |
| 508 | + | ||
| 509 | + | // Retrieves the accessible role of an accessible object. | |
| 479 | 510 | func (x *TabOverview) GetAccessibleRole() gtk.AccessibleRole { | |
| 480 | 511 | ||
| 481 | 512 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 482 | 513 | return cret | |
| 483 | 514 | } | |
| 484 | 515 | ||
| 485 | - | // Resets the accessible @property to its default value. | |
| 516 | + | // Retrieves the implementation for the given accessible object. | |
| 517 | + | func (x *TabOverview) GetAtContext() *gtk.ATContext { | |
| 518 | + | var cls *gtk.ATContext | |
| 519 | + | ||
| 520 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 521 | + | ||
| 522 | + | if cret == 0 { | |
| 523 | + | return nil | |
| 524 | + | } | |
| 525 | + | cls = >k.ATContext{} | |
| 526 | + | cls.Ptr = cret | |
| 527 | + | return cls | |
| 528 | + | } | |
| 529 | + | ||
| 530 | + | // Queries the coordinates and dimensions of this accessible | |
| 531 | + | // | |
| 532 | + | // This functionality can be overridden by `GtkAccessible` | |
| 533 | + | // implementations, e.g. to get the bounds from an ignored | |
| 534 | + | // child widget. | |
| 535 | + | func (x *TabOverview) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 536 | + | ||
| 537 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 538 | + | return cret | |
| 539 | + | } | |
| 540 | + | ||
| 541 | + | // Retrieves the first accessible child of an accessible object. | |
| 542 | + | func (x *TabOverview) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 543 | + | var cls *gtk.AccessibleBase | |
| 544 | + | ||
| 545 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 546 | + | ||
| 547 | + | if cret == 0 { | |
| 548 | + | return nil | |
| 549 | + | } | |
| 550 | + | cls = >k.AccessibleBase{} | |
| 551 | + | cls.Ptr = cret | |
| 552 | + | return cls | |
| 553 | + | } | |
| 554 | + | ||
| 555 | + | // Retrieves the next accessible sibling of an accessible object | |
| 556 | + | func (x *TabOverview) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 557 | + | var cls *gtk.AccessibleBase | |
| 558 | + | ||
| 559 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 560 | + | ||
| 561 | + | if cret == 0 { | |
| 562 | + | return nil | |
| 563 | + | } | |
| 564 | + | cls = >k.AccessibleBase{} | |
| 565 | + | cls.Ptr = cret | |
| 566 | + | return cls | |
| 567 | + | } | |
| 568 | + | ||
| 569 | + | // Queries a platform state, such as focus. | |
| 570 | + | // | |
| 571 | + | // This functionality can be overridden by `GtkAccessible` | |
| 572 | + | // implementations, e.g. to get platform state from an ignored | |
| 573 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 574 | + | func (x *TabOverview) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 575 | + | ||
| 576 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 577 | + | return cret | |
| 578 | + | } | |
| 579 | + | ||
| 580 | + | // Resets the accessible property to its default value. | |
| 486 | 581 | func (x *TabOverview) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 487 | 582 | ||
| 488 | 583 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 489 | 584 | ||
| 490 | 585 | } | |
| 491 | 586 | ||
| 492 | - | // Resets the accessible @relation to its default value. | |
| 587 | + | // Resets the accessible relation to its default value. | |
| 493 | 588 | func (x *TabOverview) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 494 | 589 | ||
| 495 | 590 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 496 | 591 | ||
| 497 | 592 | } | |
| 498 | 593 | ||
| 499 | - | // Resets the accessible @state to its default value. | |
| 594 | + | // Resets the accessible state to its default value. | |
| 500 | 595 | func (x *TabOverview) ResetState(StateVar gtk.AccessibleState) { | |
| 501 | 596 | ||
| 502 | 597 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 503 | 598 | ||
| 504 | 599 | } | |
| 505 | 600 | ||
| 601 | + | // Sets the parent and sibling of an accessible object. | |
| 602 | + | // | |
| 603 | + | // This function is meant to be used by accessible implementations that are | |
| 604 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 605 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 606 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 607 | + | // interface, you will use this function to ensure that the parent of each | |
| 608 | + | // child widget is the metadata object, and the parent of each metadata | |
| 609 | + | // object is the container widget. | |
| 610 | + | func (x *TabOverview) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 611 | + | ||
| 612 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 613 | + | ||
| 614 | + | } | |
| 615 | + | ||
| 616 | + | // Updates the next accessible sibling. | |
| 617 | + | // | |
| 618 | + | // That might be useful when a new child of a custom accessible | |
| 619 | + | // is created, and it needs to be linked to a previous child. | |
| 620 | + | func (x *TabOverview) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 621 | + | ||
| 622 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 623 | + | ||
| 624 | + | } | |
| 625 | + | ||
| 626 | + | // Informs ATs that the platform state has changed. | |
| 627 | + | // | |
| 628 | + | // This function should be used by `GtkAccessible` implementations that | |
| 629 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 630 | + | // states automatically. | |
| 631 | + | func (x *TabOverview) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 632 | + | ||
| 633 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 634 | + | ||
| 635 | + | } | |
| 636 | + | ||
| 506 | 637 | // Updates a list of accessible properties. | |
| 507 | 638 | // | |
| 508 | 639 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -545,7 +676,7 @@ func (x *TabOverview) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 545 | 676 | // relation change must be communicated to assistive technologies. | |
| 546 | 677 | // | |
| 547 | 678 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 548 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 679 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 549 | 680 | // | |
| 550 | 681 | // ```c | |
| 551 | 682 | // gtk_accessible_update_relation (accessible, | |
| @@ -575,13 +706,17 @@ func (x *TabOverview) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 575 | 706 | ||
| 576 | 707 | } | |
| 577 | 708 | ||
| 578 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 579 | - | // documentation for the value types of accessible states. | |
| 709 | + | // Updates a list of accessible states. | |
| 580 | 710 | // | |
| 581 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 582 | - | // state change must be communicated to assistive technologies. | |
| 711 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 712 | + | // value types of accessible states. | |
| 713 | + | // | |
| 714 | + | // This function should be called by `GtkWidget` types whenever | |
| 715 | + | // an accessible state change must be communicated to assistive | |
| 716 | + | // technologies. | |
| 583 | 717 | // | |
| 584 | 718 | // Example: | |
| 719 | + | // | |
| 585 | 720 | // ```c | |
| 586 | 721 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 587 | 722 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -611,7 +746,7 @@ func (x *TabOverview) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessibl | |||
| 611 | 746 | // Gets the ID of the @buildable object. | |
| 612 | 747 | // | |
| 613 | 748 | // `GtkBuilder` sets the name based on the ID attribute | |
| 614 | - | // of the <object> tag used to construct the @buildable. | |
| 749 | + | // of the `<object>` tag used to construct the @buildable. | |
| 615 | 750 | func (x *TabOverview) GetBuildableId() string { | |
| 616 | 751 | ||
| 617 | 752 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-tab-view.go +289 -19
| @@ -508,34 +508,165 @@ func (c *TabPage) SetGoPointer(ptr uintptr) { | |||
| 508 | 508 | c.Ptr = ptr | |
| 509 | 509 | } | |
| 510 | 510 | ||
| 511 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 511 | + | // Requests the user's screen reader to announce the given message. | |
| 512 | + | // | |
| 513 | + | // This kind of notification is useful for messages that | |
| 514 | + | // either have only a visual representation or that are not | |
| 515 | + | // exposed visually at all, e.g. a notification about a | |
| 516 | + | // successful operation. | |
| 517 | + | // | |
| 518 | + | // Also, by using this API, you can ensure that the message | |
| 519 | + | // does not interrupts the user's current screen reader output. | |
| 520 | + | func (x *TabPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 521 | + | ||
| 522 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 523 | + | ||
| 524 | + | } | |
| 525 | + | ||
| 526 | + | // Retrieves the accessible parent for an accessible object. | |
| 527 | + | // | |
| 528 | + | // This function returns `NULL` for top level widgets. | |
| 529 | + | func (x *TabPage) GetAccessibleParent() *gtk.AccessibleBase { | |
| 530 | + | var cls *gtk.AccessibleBase | |
| 531 | + | ||
| 532 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 533 | + | ||
| 534 | + | if cret == 0 { | |
| 535 | + | return nil | |
| 536 | + | } | |
| 537 | + | cls = >k.AccessibleBase{} | |
| 538 | + | cls.Ptr = cret | |
| 539 | + | return cls | |
| 540 | + | } | |
| 541 | + | ||
| 542 | + | // Retrieves the accessible role of an accessible object. | |
| 512 | 543 | func (x *TabPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 513 | 544 | ||
| 514 | 545 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 515 | 546 | return cret | |
| 516 | 547 | } | |
| 517 | 548 | ||
| 518 | - | // Resets the accessible @property to its default value. | |
| 549 | + | // Retrieves the implementation for the given accessible object. | |
| 550 | + | func (x *TabPage) GetAtContext() *gtk.ATContext { | |
| 551 | + | var cls *gtk.ATContext | |
| 552 | + | ||
| 553 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 554 | + | ||
| 555 | + | if cret == 0 { | |
| 556 | + | return nil | |
| 557 | + | } | |
| 558 | + | cls = >k.ATContext{} | |
| 559 | + | cls.Ptr = cret | |
| 560 | + | return cls | |
| 561 | + | } | |
| 562 | + | ||
| 563 | + | // Queries the coordinates and dimensions of this accessible | |
| 564 | + | // | |
| 565 | + | // This functionality can be overridden by `GtkAccessible` | |
| 566 | + | // implementations, e.g. to get the bounds from an ignored | |
| 567 | + | // child widget. | |
| 568 | + | func (x *TabPage) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 569 | + | ||
| 570 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 571 | + | return cret | |
| 572 | + | } | |
| 573 | + | ||
| 574 | + | // Retrieves the first accessible child of an accessible object. | |
| 575 | + | func (x *TabPage) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 576 | + | var cls *gtk.AccessibleBase | |
| 577 | + | ||
| 578 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 579 | + | ||
| 580 | + | if cret == 0 { | |
| 581 | + | return nil | |
| 582 | + | } | |
| 583 | + | cls = >k.AccessibleBase{} | |
| 584 | + | cls.Ptr = cret | |
| 585 | + | return cls | |
| 586 | + | } | |
| 587 | + | ||
| 588 | + | // Retrieves the next accessible sibling of an accessible object | |
| 589 | + | func (x *TabPage) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 590 | + | var cls *gtk.AccessibleBase | |
| 591 | + | ||
| 592 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 593 | + | ||
| 594 | + | if cret == 0 { | |
| 595 | + | return nil | |
| 596 | + | } | |
| 597 | + | cls = >k.AccessibleBase{} | |
| 598 | + | cls.Ptr = cret | |
| 599 | + | return cls | |
| 600 | + | } | |
| 601 | + | ||
| 602 | + | // Queries a platform state, such as focus. | |
| 603 | + | // | |
| 604 | + | // This functionality can be overridden by `GtkAccessible` | |
| 605 | + | // implementations, e.g. to get platform state from an ignored | |
| 606 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 607 | + | func (x *TabPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 608 | + | ||
| 609 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 610 | + | return cret | |
| 611 | + | } | |
| 612 | + | ||
| 613 | + | // Resets the accessible property to its default value. | |
| 519 | 614 | func (x *TabPage) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 520 | 615 | ||
| 521 | 616 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 522 | 617 | ||
| 523 | 618 | } | |
| 524 | 619 | ||
| 525 | - | // Resets the accessible @relation to its default value. | |
| 620 | + | // Resets the accessible relation to its default value. | |
| 526 | 621 | func (x *TabPage) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 527 | 622 | ||
| 528 | 623 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 529 | 624 | ||
| 530 | 625 | } | |
| 531 | 626 | ||
| 532 | - | // Resets the accessible @state to its default value. | |
| 627 | + | // Resets the accessible state to its default value. | |
| 533 | 628 | func (x *TabPage) ResetState(StateVar gtk.AccessibleState) { | |
| 534 | 629 | ||
| 535 | 630 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 536 | 631 | ||
| 537 | 632 | } | |
| 538 | 633 | ||
| 634 | + | // Sets the parent and sibling of an accessible object. | |
| 635 | + | // | |
| 636 | + | // This function is meant to be used by accessible implementations that are | |
| 637 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 638 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 639 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 640 | + | // interface, you will use this function to ensure that the parent of each | |
| 641 | + | // child widget is the metadata object, and the parent of each metadata | |
| 642 | + | // object is the container widget. | |
| 643 | + | func (x *TabPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 644 | + | ||
| 645 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 646 | + | ||
| 647 | + | } | |
| 648 | + | ||
| 649 | + | // Updates the next accessible sibling. | |
| 650 | + | // | |
| 651 | + | // That might be useful when a new child of a custom accessible | |
| 652 | + | // is created, and it needs to be linked to a previous child. | |
| 653 | + | func (x *TabPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 654 | + | ||
| 655 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 656 | + | ||
| 657 | + | } | |
| 658 | + | ||
| 659 | + | // Informs ATs that the platform state has changed. | |
| 660 | + | // | |
| 661 | + | // This function should be used by `GtkAccessible` implementations that | |
| 662 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 663 | + | // states automatically. | |
| 664 | + | func (x *TabPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 665 | + | ||
| 666 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 667 | + | ||
| 668 | + | } | |
| 669 | + | ||
| 539 | 670 | // Updates a list of accessible properties. | |
| 540 | 671 | // | |
| 541 | 672 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -578,7 +709,7 @@ func (x *TabPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Ac | |||
| 578 | 709 | // relation change must be communicated to assistive technologies. | |
| 579 | 710 | // | |
| 580 | 711 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 581 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 712 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 582 | 713 | // | |
| 583 | 714 | // ```c | |
| 584 | 715 | // gtk_accessible_update_relation (accessible, | |
| @@ -608,13 +739,17 @@ func (x *TabPage) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acce | |||
| 608 | 739 | ||
| 609 | 740 | } | |
| 610 | 741 | ||
| 611 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 612 | - | // documentation for the value types of accessible states. | |
| 742 | + | // Updates a list of accessible states. | |
| 613 | 743 | // | |
| 614 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 615 | - | // state change must be communicated to assistive technologies. | |
| 744 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 745 | + | // value types of accessible states. | |
| 746 | + | // | |
| 747 | + | // This function should be called by `GtkWidget` types whenever | |
| 748 | + | // an accessible state change must be communicated to assistive | |
| 749 | + | // technologies. | |
| 616 | 750 | // | |
| 617 | 751 | // Example: | |
| 752 | + | // | |
| 618 | 753 | // ```c | |
| 619 | 754 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 620 | 755 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -1498,34 +1633,165 @@ func (x *TabView) ConnectSetupMenu(cb *func(TabView, uintptr)) uint32 { | |||
| 1498 | 1633 | return gobject.SignalConnect(x.GoPointer(), "setup-menu", cbRefPtr) | |
| 1499 | 1634 | } | |
| 1500 | 1635 | ||
| 1501 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 1636 | + | // Requests the user's screen reader to announce the given message. | |
| 1637 | + | // | |
| 1638 | + | // This kind of notification is useful for messages that | |
| 1639 | + | // either have only a visual representation or that are not | |
| 1640 | + | // exposed visually at all, e.g. a notification about a | |
| 1641 | + | // successful operation. | |
| 1642 | + | // | |
| 1643 | + | // Also, by using this API, you can ensure that the message | |
| 1644 | + | // does not interrupts the user's current screen reader output. | |
| 1645 | + | func (x *TabView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 1646 | + | ||
| 1647 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 1648 | + | ||
| 1649 | + | } | |
| 1650 | + | ||
| 1651 | + | // Retrieves the accessible parent for an accessible object. | |
| 1652 | + | // | |
| 1653 | + | // This function returns `NULL` for top level widgets. | |
| 1654 | + | func (x *TabView) GetAccessibleParent() *gtk.AccessibleBase { | |
| 1655 | + | var cls *gtk.AccessibleBase | |
| 1656 | + | ||
| 1657 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 1658 | + | ||
| 1659 | + | if cret == 0 { | |
| 1660 | + | return nil | |
| 1661 | + | } | |
| 1662 | + | cls = >k.AccessibleBase{} | |
| 1663 | + | cls.Ptr = cret | |
| 1664 | + | return cls | |
| 1665 | + | } | |
| 1666 | + | ||
| 1667 | + | // Retrieves the accessible role of an accessible object. | |
| 1502 | 1668 | func (x *TabView) GetAccessibleRole() gtk.AccessibleRole { | |
| 1503 | 1669 | ||
| 1504 | 1670 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 1505 | 1671 | return cret | |
| 1506 | 1672 | } | |
| 1507 | 1673 | ||
| 1508 | - | // Resets the accessible @property to its default value. | |
| 1674 | + | // Retrieves the implementation for the given accessible object. | |
| 1675 | + | func (x *TabView) GetAtContext() *gtk.ATContext { | |
| 1676 | + | var cls *gtk.ATContext | |
| 1677 | + | ||
| 1678 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 1679 | + | ||
| 1680 | + | if cret == 0 { | |
| 1681 | + | return nil | |
| 1682 | + | } | |
| 1683 | + | cls = >k.ATContext{} | |
| 1684 | + | cls.Ptr = cret | |
| 1685 | + | return cls | |
| 1686 | + | } | |
| 1687 | + | ||
| 1688 | + | // Queries the coordinates and dimensions of this accessible | |
| 1689 | + | // | |
| 1690 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1691 | + | // implementations, e.g. to get the bounds from an ignored | |
| 1692 | + | // child widget. | |
| 1693 | + | func (x *TabView) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 1694 | + | ||
| 1695 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 1696 | + | return cret | |
| 1697 | + | } | |
| 1698 | + | ||
| 1699 | + | // Retrieves the first accessible child of an accessible object. | |
| 1700 | + | func (x *TabView) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 1701 | + | var cls *gtk.AccessibleBase | |
| 1702 | + | ||
| 1703 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 1704 | + | ||
| 1705 | + | if cret == 0 { | |
| 1706 | + | return nil | |
| 1707 | + | } | |
| 1708 | + | cls = >k.AccessibleBase{} | |
| 1709 | + | cls.Ptr = cret | |
| 1710 | + | return cls | |
| 1711 | + | } | |
| 1712 | + | ||
| 1713 | + | // Retrieves the next accessible sibling of an accessible object | |
| 1714 | + | func (x *TabView) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 1715 | + | var cls *gtk.AccessibleBase | |
| 1716 | + | ||
| 1717 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 1718 | + | ||
| 1719 | + | if cret == 0 { | |
| 1720 | + | return nil | |
| 1721 | + | } | |
| 1722 | + | cls = >k.AccessibleBase{} | |
| 1723 | + | cls.Ptr = cret | |
| 1724 | + | return cls | |
| 1725 | + | } | |
| 1726 | + | ||
| 1727 | + | // Queries a platform state, such as focus. | |
| 1728 | + | // | |
| 1729 | + | // This functionality can be overridden by `GtkAccessible` | |
| 1730 | + | // implementations, e.g. to get platform state from an ignored | |
| 1731 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 1732 | + | func (x *TabView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 1733 | + | ||
| 1734 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 1735 | + | return cret | |
| 1736 | + | } | |
| 1737 | + | ||
| 1738 | + | // Resets the accessible property to its default value. | |
| 1509 | 1739 | func (x *TabView) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 1510 | 1740 | ||
| 1511 | 1741 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 1512 | 1742 | ||
| 1513 | 1743 | } | |
| 1514 | 1744 | ||
| 1515 | - | // Resets the accessible @relation to its default value. | |
| 1745 | + | // Resets the accessible relation to its default value. | |
| 1516 | 1746 | func (x *TabView) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 1517 | 1747 | ||
| 1518 | 1748 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 1519 | 1749 | ||
| 1520 | 1750 | } | |
| 1521 | 1751 | ||
| 1522 | - | // Resets the accessible @state to its default value. | |
| 1752 | + | // Resets the accessible state to its default value. | |
| 1523 | 1753 | func (x *TabView) ResetState(StateVar gtk.AccessibleState) { | |
| 1524 | 1754 | ||
| 1525 | 1755 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 1526 | 1756 | ||
| 1527 | 1757 | } | |
| 1528 | 1758 | ||
| 1759 | + | // Sets the parent and sibling of an accessible object. | |
| 1760 | + | // | |
| 1761 | + | // This function is meant to be used by accessible implementations that are | |
| 1762 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 1763 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 1764 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 1765 | + | // interface, you will use this function to ensure that the parent of each | |
| 1766 | + | // child widget is the metadata object, and the parent of each metadata | |
| 1767 | + | // object is the container widget. | |
| 1768 | + | func (x *TabView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 1769 | + | ||
| 1770 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 1771 | + | ||
| 1772 | + | } | |
| 1773 | + | ||
| 1774 | + | // Updates the next accessible sibling. | |
| 1775 | + | // | |
| 1776 | + | // That might be useful when a new child of a custom accessible | |
| 1777 | + | // is created, and it needs to be linked to a previous child. | |
| 1778 | + | func (x *TabView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 1779 | + | ||
| 1780 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 1781 | + | ||
| 1782 | + | } | |
| 1783 | + | ||
| 1784 | + | // Informs ATs that the platform state has changed. | |
| 1785 | + | // | |
| 1786 | + | // This function should be used by `GtkAccessible` implementations that | |
| 1787 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 1788 | + | // states automatically. | |
| 1789 | + | func (x *TabView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 1790 | + | ||
| 1791 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 1792 | + | ||
| 1793 | + | } | |
| 1794 | + | ||
| 1529 | 1795 | // Updates a list of accessible properties. | |
| 1530 | 1796 | // | |
| 1531 | 1797 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -1568,7 +1834,7 @@ func (x *TabView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Ac | |||
| 1568 | 1834 | // relation change must be communicated to assistive technologies. | |
| 1569 | 1835 | // | |
| 1570 | 1836 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 1571 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 1837 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 1572 | 1838 | // | |
| 1573 | 1839 | // ```c | |
| 1574 | 1840 | // gtk_accessible_update_relation (accessible, | |
| @@ -1598,13 +1864,17 @@ func (x *TabView) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acce | |||
| 1598 | 1864 | ||
| 1599 | 1865 | } | |
| 1600 | 1866 | ||
| 1601 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 1602 | - | // documentation for the value types of accessible states. | |
| 1867 | + | // Updates a list of accessible states. | |
| 1603 | 1868 | // | |
| 1604 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 1605 | - | // state change must be communicated to assistive technologies. | |
| 1869 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 1870 | + | // value types of accessible states. | |
| 1871 | + | // | |
| 1872 | + | // This function should be called by `GtkWidget` types whenever | |
| 1873 | + | // an accessible state change must be communicated to assistive | |
| 1874 | + | // technologies. | |
| 1606 | 1875 | // | |
| 1607 | 1876 | // Example: | |
| 1877 | + | // | |
| 1608 | 1878 | // ```c | |
| 1609 | 1879 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 1610 | 1880 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -1634,7 +1904,7 @@ func (x *TabView) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleSta | |||
| 1634 | 1904 | // Gets the ID of the @buildable object. | |
| 1635 | 1905 | // | |
| 1636 | 1906 | // `GtkBuilder` sets the name based on the ID attribute | |
| 1637 | - | // of the <object> tag used to construct the @buildable. | |
| 1907 | + | // of the `<object>` tag used to construct the @buildable. | |
| 1638 | 1908 | func (x *TabView) GetBuildableId() string { | |
| 1639 | 1909 | ||
| 1640 | 1910 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-toast-overlay.go +161 -11
| @@ -35,6 +35,9 @@ func (x *ToastOverlayClass) GoPointer() uintptr { | |||
| 35 | 35 | // main child, on top of which it can display a [class@Toast], overlaid. | |
| 36 | 36 | // Toasts can be shown with [method@ToastOverlay.add_toast]. | |
| 37 | 37 | // | |
| 38 | + | // Use [method@ToastOverlay.dismiss_all] to dismiss all toasts at once, or | |
| 39 | + | // [method@Toast.dismiss] to dismiss a single toast. | |
| 40 | + | // | |
| 38 | 41 | // See [class@Toast] for details. | |
| 39 | 42 | // | |
| 40 | 43 | // ## CSS nodes | |
| @@ -64,7 +67,7 @@ func (x *ToastOverlayClass) GoPointer() uintptr { | |||
| 64 | 67 | // | |
| 65 | 68 | // ## Accessibility | |
| 66 | 69 | // | |
| 67 | - | // `AdwToastOverlay` uses the `GTK_ACCESSIBLE_ROLE_TAB_GROUP` role. | |
| 70 | + | // `AdwToastOverlay` uses the [enum@Gtk.AccessibleRole.GROUP] role. | |
| 68 | 71 | type ToastOverlay struct { | |
| 69 | 72 | gtk.Widget | |
| 70 | 73 | } | |
| @@ -116,6 +119,17 @@ func (x *ToastOverlay) AddToast(ToastVar *Toast) { | |||
| 116 | 119 | ||
| 117 | 120 | } | |
| 118 | 121 | ||
| 122 | + | var xToastOverlayDismissAll func(uintptr) | |
| 123 | + | ||
| 124 | + | // Dismisses all displayed toasts. | |
| 125 | + | // | |
| 126 | + | // Use [method@Toast.dismiss] to dismiss a single toast. | |
| 127 | + | func (x *ToastOverlay) DismissAll() { | |
| 128 | + | ||
| 129 | + | xToastOverlayDismissAll(x.GoPointer()) | |
| 130 | + | ||
| 131 | + | } | |
| 132 | + | ||
| 119 | 133 | var xToastOverlayGetChild func(uintptr) uintptr | |
| 120 | 134 | ||
| 121 | 135 | // Gets the child widget of @self. | |
| @@ -153,34 +167,165 @@ func (c *ToastOverlay) SetGoPointer(ptr uintptr) { | |||
| 153 | 167 | c.Ptr = ptr | |
| 154 | 168 | } | |
| 155 | 169 | ||
| 156 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 170 | + | // Requests the user's screen reader to announce the given message. | |
| 171 | + | // | |
| 172 | + | // This kind of notification is useful for messages that | |
| 173 | + | // either have only a visual representation or that are not | |
| 174 | + | // exposed visually at all, e.g. a notification about a | |
| 175 | + | // successful operation. | |
| 176 | + | // | |
| 177 | + | // Also, by using this API, you can ensure that the message | |
| 178 | + | // does not interrupts the user's current screen reader output. | |
| 179 | + | func (x *ToastOverlay) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 180 | + | ||
| 181 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 182 | + | ||
| 183 | + | } | |
| 184 | + | ||
| 185 | + | // Retrieves the accessible parent for an accessible object. | |
| 186 | + | // | |
| 187 | + | // This function returns `NULL` for top level widgets. | |
| 188 | + | func (x *ToastOverlay) GetAccessibleParent() *gtk.AccessibleBase { | |
| 189 | + | var cls *gtk.AccessibleBase | |
| 190 | + | ||
| 191 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 192 | + | ||
| 193 | + | if cret == 0 { | |
| 194 | + | return nil | |
| 195 | + | } | |
| 196 | + | cls = >k.AccessibleBase{} | |
| 197 | + | cls.Ptr = cret | |
| 198 | + | return cls | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | // Retrieves the accessible role of an accessible object. | |
| 157 | 202 | func (x *ToastOverlay) GetAccessibleRole() gtk.AccessibleRole { | |
| 158 | 203 | ||
| 159 | 204 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 160 | 205 | return cret | |
| 161 | 206 | } | |
| 162 | 207 | ||
| 163 | - | // Resets the accessible @property to its default value. | |
| 208 | + | // Retrieves the implementation for the given accessible object. | |
| 209 | + | func (x *ToastOverlay) GetAtContext() *gtk.ATContext { | |
| 210 | + | var cls *gtk.ATContext | |
| 211 | + | ||
| 212 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 213 | + | ||
| 214 | + | if cret == 0 { | |
| 215 | + | return nil | |
| 216 | + | } | |
| 217 | + | cls = >k.ATContext{} | |
| 218 | + | cls.Ptr = cret | |
| 219 | + | return cls | |
| 220 | + | } | |
| 221 | + | ||
| 222 | + | // Queries the coordinates and dimensions of this accessible | |
| 223 | + | // | |
| 224 | + | // This functionality can be overridden by `GtkAccessible` | |
| 225 | + | // implementations, e.g. to get the bounds from an ignored | |
| 226 | + | // child widget. | |
| 227 | + | func (x *ToastOverlay) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 228 | + | ||
| 229 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 230 | + | return cret | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // Retrieves the first accessible child of an accessible object. | |
| 234 | + | func (x *ToastOverlay) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 235 | + | var cls *gtk.AccessibleBase | |
| 236 | + | ||
| 237 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 238 | + | ||
| 239 | + | if cret == 0 { | |
| 240 | + | return nil | |
| 241 | + | } | |
| 242 | + | cls = >k.AccessibleBase{} | |
| 243 | + | cls.Ptr = cret | |
| 244 | + | return cls | |
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // Retrieves the next accessible sibling of an accessible object | |
| 248 | + | func (x *ToastOverlay) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 249 | + | var cls *gtk.AccessibleBase | |
| 250 | + | ||
| 251 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 252 | + | ||
| 253 | + | if cret == 0 { | |
| 254 | + | return nil | |
| 255 | + | } | |
| 256 | + | cls = >k.AccessibleBase{} | |
| 257 | + | cls.Ptr = cret | |
| 258 | + | return cls | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | // Queries a platform state, such as focus. | |
| 262 | + | // | |
| 263 | + | // This functionality can be overridden by `GtkAccessible` | |
| 264 | + | // implementations, e.g. to get platform state from an ignored | |
| 265 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 266 | + | func (x *ToastOverlay) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 267 | + | ||
| 268 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 269 | + | return cret | |
| 270 | + | } | |
| 271 | + | ||
| 272 | + | // Resets the accessible property to its default value. | |
| 164 | 273 | func (x *ToastOverlay) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 165 | 274 | ||
| 166 | 275 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 167 | 276 | ||
| 168 | 277 | } | |
| 169 | 278 | ||
| 170 | - | // Resets the accessible @relation to its default value. | |
| 279 | + | // Resets the accessible relation to its default value. | |
| 171 | 280 | func (x *ToastOverlay) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 172 | 281 | ||
| 173 | 282 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 174 | 283 | ||
| 175 | 284 | } | |
| 176 | 285 | ||
| 177 | - | // Resets the accessible @state to its default value. | |
| 286 | + | // Resets the accessible state to its default value. | |
| 178 | 287 | func (x *ToastOverlay) ResetState(StateVar gtk.AccessibleState) { | |
| 179 | 288 | ||
| 180 | 289 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 181 | 290 | ||
| 182 | 291 | } | |
| 183 | 292 | ||
| 293 | + | // Sets the parent and sibling of an accessible object. | |
| 294 | + | // | |
| 295 | + | // This function is meant to be used by accessible implementations that are | |
| 296 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 297 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 298 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 299 | + | // interface, you will use this function to ensure that the parent of each | |
| 300 | + | // child widget is the metadata object, and the parent of each metadata | |
| 301 | + | // object is the container widget. | |
| 302 | + | func (x *ToastOverlay) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 303 | + | ||
| 304 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 305 | + | ||
| 306 | + | } | |
| 307 | + | ||
| 308 | + | // Updates the next accessible sibling. | |
| 309 | + | // | |
| 310 | + | // That might be useful when a new child of a custom accessible | |
| 311 | + | // is created, and it needs to be linked to a previous child. | |
| 312 | + | func (x *ToastOverlay) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 313 | + | ||
| 314 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 315 | + | ||
| 316 | + | } | |
| 317 | + | ||
| 318 | + | // Informs ATs that the platform state has changed. | |
| 319 | + | // | |
| 320 | + | // This function should be used by `GtkAccessible` implementations that | |
| 321 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 322 | + | // states automatically. | |
| 323 | + | func (x *ToastOverlay) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 324 | + | ||
| 325 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 326 | + | ||
| 327 | + | } | |
| 328 | + | ||
| 184 | 329 | // Updates a list of accessible properties. | |
| 185 | 330 | // | |
| 186 | 331 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -223,7 +368,7 @@ func (x *ToastOverlay) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []g | |||
| 223 | 368 | // relation change must be communicated to assistive technologies. | |
| 224 | 369 | // | |
| 225 | 370 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 226 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 371 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 227 | 372 | // | |
| 228 | 373 | // ```c | |
| 229 | 374 | // gtk_accessible_update_relation (accessible, | |
| @@ -253,13 +398,17 @@ func (x *ToastOverlay) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk | |||
| 253 | 398 | ||
| 254 | 399 | } | |
| 255 | 400 | ||
| 256 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 257 | - | // documentation for the value types of accessible states. | |
| 401 | + | // Updates a list of accessible states. | |
| 258 | 402 | // | |
| 259 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 260 | - | // state change must be communicated to assistive technologies. | |
| 403 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 404 | + | // value types of accessible states. | |
| 405 | + | // | |
| 406 | + | // This function should be called by `GtkWidget` types whenever | |
| 407 | + | // an accessible state change must be communicated to assistive | |
| 408 | + | // technologies. | |
| 261 | 409 | // | |
| 262 | 410 | // Example: | |
| 411 | + | // | |
| 263 | 412 | // ```c | |
| 264 | 413 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 265 | 414 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -289,7 +438,7 @@ func (x *ToastOverlay) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessib | |||
| 289 | 438 | // Gets the ID of the @buildable object. | |
| 290 | 439 | // | |
| 291 | 440 | // `GtkBuilder` sets the name based on the ID attribute | |
| 292 | - | // of the <object> tag used to construct the @buildable. | |
| 441 | + | // of the `<object>` tag used to construct the @buildable. | |
| 293 | 442 | func (x *ToastOverlay) GetBuildableId() string { | |
| 294 | 443 | ||
| 295 | 444 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -309,6 +458,7 @@ func init() { | |||
| 309 | 458 | core.PuregoSafeRegister(&xNewToastOverlay, lib, "adw_toast_overlay_new") | |
| 310 | 459 | ||
| 311 | 460 | core.PuregoSafeRegister(&xToastOverlayAddToast, lib, "adw_toast_overlay_add_toast") | |
| 461 | + | core.PuregoSafeRegister(&xToastOverlayDismissAll, lib, "adw_toast_overlay_dismiss_all") | |
| 312 | 462 | core.PuregoSafeRegister(&xToastOverlayGetChild, lib, "adw_toast_overlay_get_child") | |
| 313 | 463 | core.PuregoSafeRegister(&xToastOverlaySetChild, lib, "adw_toast_overlay_set_child") | |
| 314 | 464 | ||
A v4/adw/adw-toggle-group.go +917 -0
| @@ -0,0 +1,917 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 13 | + | ) | |
| 14 | + | ||
| 15 | + | type ToggleClass struct { | |
| 16 | + | _ structs.HostLayout | |
| 17 | + | ||
| 18 | + | ParentClass gobject.ObjectClass | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | func (x *ToggleClass) GoPointer() uintptr { | |
| 22 | + | return uintptr(unsafe.Pointer(x)) | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | type ToggleGroupClass struct { | |
| 26 | + | _ structs.HostLayout | |
| 27 | + | ||
| 28 | + | ParentClass gtk.WidgetClass | |
| 29 | + | } | |
| 30 | + | ||
| 31 | + | func (x *ToggleGroupClass) GoPointer() uintptr { | |
| 32 | + | return uintptr(unsafe.Pointer(x)) | |
| 33 | + | } | |
| 34 | + | ||
| 35 | + | // A toggle within [class@ToggleGroup]. | |
| 36 | + | // | |
| 37 | + | // `AdwToggle` can optionally have a name, set with [property@Toggle:name]. | |
| 38 | + | // If the name is set, [property@ToggleGroup:active-name] can be used to access | |
| 39 | + | // toggles instead of index. | |
| 40 | + | type Toggle struct { | |
| 41 | + | gobject.Object | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | var xToggleGLibType func() types.GType | |
| 45 | + | ||
| 46 | + | func ToggleGLibType() types.GType { | |
| 47 | + | return xToggleGLibType() | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | func ToggleNewFromInternalPtr(ptr uintptr) *Toggle { | |
| 51 | + | cls := &Toggle{} | |
| 52 | + | cls.Ptr = ptr | |
| 53 | + | return cls | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | var xNewToggle func() uintptr | |
| 57 | + | ||
| 58 | + | // Creates a new `AdwToggle`. | |
| 59 | + | func NewToggle() *Toggle { | |
| 60 | + | var cls *Toggle | |
| 61 | + | ||
| 62 | + | cret := xNewToggle() | |
| 63 | + | ||
| 64 | + | if cret == 0 { | |
| 65 | + | return nil | |
| 66 | + | } | |
| 67 | + | cls = &Toggle{} | |
| 68 | + | cls.Ptr = cret | |
| 69 | + | return cls | |
| 70 | + | } | |
| 71 | + | ||
| 72 | + | var xToggleGetChild func(uintptr) uintptr | |
| 73 | + | ||
| 74 | + | // Gets the child widget of @self. | |
| 75 | + | func (x *Toggle) GetChild() *gtk.Widget { | |
| 76 | + | var cls *gtk.Widget | |
| 77 | + | ||
| 78 | + | cret := xToggleGetChild(x.GoPointer()) | |
| 79 | + | ||
| 80 | + | if cret == 0 { | |
| 81 | + | return nil | |
| 82 | + | } | |
| 83 | + | gobject.IncreaseRef(cret) | |
| 84 | + | cls = >k.Widget{} | |
| 85 | + | cls.Ptr = cret | |
| 86 | + | return cls | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xToggleGetEnabled func(uintptr) bool | |
| 90 | + | ||
| 91 | + | // Gets whether @self is enabled. | |
| 92 | + | func (x *Toggle) GetEnabled() bool { | |
| 93 | + | ||
| 94 | + | cret := xToggleGetEnabled(x.GoPointer()) | |
| 95 | + | return cret | |
| 96 | + | } | |
| 97 | + | ||
| 98 | + | var xToggleGetIconName func(uintptr) string | |
| 99 | + | ||
| 100 | + | // Gets the icon name of @self. | |
| 101 | + | func (x *Toggle) GetIconName() string { | |
| 102 | + | ||
| 103 | + | cret := xToggleGetIconName(x.GoPointer()) | |
| 104 | + | return cret | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | var xToggleGetIndex func(uintptr) uint | |
| 108 | + | ||
| 109 | + | // Gets the index of @self within its toggle group. | |
| 110 | + | func (x *Toggle) GetIndex() uint { | |
| 111 | + | ||
| 112 | + | cret := xToggleGetIndex(x.GoPointer()) | |
| 113 | + | return cret | |
| 114 | + | } | |
| 115 | + | ||
| 116 | + | var xToggleGetLabel func(uintptr) string | |
| 117 | + | ||
| 118 | + | // Gets the label of @self. | |
| 119 | + | func (x *Toggle) GetLabel() string { | |
| 120 | + | ||
| 121 | + | cret := xToggleGetLabel(x.GoPointer()) | |
| 122 | + | return cret | |
| 123 | + | } | |
| 124 | + | ||
| 125 | + | var xToggleGetName func(uintptr) string | |
| 126 | + | ||
| 127 | + | // Gets the name of @self. | |
| 128 | + | func (x *Toggle) GetName() string { | |
| 129 | + | ||
| 130 | + | cret := xToggleGetName(x.GoPointer()) | |
| 131 | + | return cret | |
| 132 | + | } | |
| 133 | + | ||
| 134 | + | var xToggleGetTooltip func(uintptr) string | |
| 135 | + | ||
| 136 | + | // Gets the tooltip of @self. | |
| 137 | + | func (x *Toggle) GetTooltip() string { | |
| 138 | + | ||
| 139 | + | cret := xToggleGetTooltip(x.GoPointer()) | |
| 140 | + | return cret | |
| 141 | + | } | |
| 142 | + | ||
| 143 | + | var xToggleGetUseUnderline func(uintptr) bool | |
| 144 | + | ||
| 145 | + | // Gets whether @self uses underlines. | |
| 146 | + | func (x *Toggle) GetUseUnderline() bool { | |
| 147 | + | ||
| 148 | + | cret := xToggleGetUseUnderline(x.GoPointer()) | |
| 149 | + | return cret | |
| 150 | + | } | |
| 151 | + | ||
| 152 | + | var xToggleSetChild func(uintptr, uintptr) | |
| 153 | + | ||
| 154 | + | // Sets the child of @self to @child. | |
| 155 | + | // | |
| 156 | + | // When the child is set, icon and label are not displayed. | |
| 157 | + | // | |
| 158 | + | // It's recommended to still set the label, as it can still be used by the | |
| 159 | + | // screen reader. | |
| 160 | + | func (x *Toggle) SetChild(ChildVar *gtk.Widget) { | |
| 161 | + | ||
| 162 | + | xToggleSetChild(x.GoPointer(), ChildVar.GoPointer()) | |
| 163 | + | ||
| 164 | + | } | |
| 165 | + | ||
| 166 | + | var xToggleSetEnabled func(uintptr, bool) | |
| 167 | + | ||
| 168 | + | // Sets whether @self is enabled. | |
| 169 | + | func (x *Toggle) SetEnabled(EnabledVar bool) { | |
| 170 | + | ||
| 171 | + | xToggleSetEnabled(x.GoPointer(), EnabledVar) | |
| 172 | + | ||
| 173 | + | } | |
| 174 | + | ||
| 175 | + | var xToggleSetIconName func(uintptr, string) | |
| 176 | + | ||
| 177 | + | // Sets the icon name of @self to @icon_name. | |
| 178 | + | // | |
| 179 | + | // The icon will be displayed alone or next to the label, unless | |
| 180 | + | // [property@Toggle:child] is set. | |
| 181 | + | func (x *Toggle) SetIconName(IconNameVar string) { | |
| 182 | + | ||
| 183 | + | xToggleSetIconName(x.GoPointer(), IconNameVar) | |
| 184 | + | ||
| 185 | + | } | |
| 186 | + | ||
| 187 | + | var xToggleSetLabel func(uintptr, string) | |
| 188 | + | ||
| 189 | + | // Sets the label of @self to @label. | |
| 190 | + | // | |
| 191 | + | // The label will be displayed alone or next to the icon, unless | |
| 192 | + | // [property@Toggle:child] is set, but will still be read out by the screen | |
| 193 | + | // reader. | |
| 194 | + | func (x *Toggle) SetLabel(LabelVar string) { | |
| 195 | + | ||
| 196 | + | xToggleSetLabel(x.GoPointer(), LabelVar) | |
| 197 | + | ||
| 198 | + | } | |
| 199 | + | ||
| 200 | + | var xToggleSetName func(uintptr, string) | |
| 201 | + | ||
| 202 | + | // Sets the name of @self to @name. | |
| 203 | + | // | |
| 204 | + | // Allows accessing @self by its name instead of index. | |
| 205 | + | // | |
| 206 | + | // See [property@ToggleGroup:active-name]. | |
| 207 | + | func (x *Toggle) SetName(NameVar string) { | |
| 208 | + | ||
| 209 | + | xToggleSetName(x.GoPointer(), NameVar) | |
| 210 | + | ||
| 211 | + | } | |
| 212 | + | ||
| 213 | + | var xToggleSetTooltip func(uintptr, string) | |
| 214 | + | ||
| 215 | + | // Sets the tooltip of @self to @tooltip. | |
| 216 | + | // | |
| 217 | + | // @tooltip can be marked up with the Pango text markup language. | |
| 218 | + | func (x *Toggle) SetTooltip(TooltipVar string) { | |
| 219 | + | ||
| 220 | + | xToggleSetTooltip(x.GoPointer(), TooltipVar) | |
| 221 | + | ||
| 222 | + | } | |
| 223 | + | ||
| 224 | + | var xToggleSetUseUnderline func(uintptr, bool) | |
| 225 | + | ||
| 226 | + | // Sets whether an embedded underline in the label indicates a mnemonic. | |
| 227 | + | // | |
| 228 | + | // See [property@Toggle:label]. | |
| 229 | + | func (x *Toggle) SetUseUnderline(UseUnderlineVar bool) { | |
| 230 | + | ||
| 231 | + | xToggleSetUseUnderline(x.GoPointer(), UseUnderlineVar) | |
| 232 | + | ||
| 233 | + | } | |
| 234 | + | ||
| 235 | + | func (c *Toggle) GoPointer() uintptr { | |
| 236 | + | if c == nil { | |
| 237 | + | return 0 | |
| 238 | + | } | |
| 239 | + | return c.Ptr | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | func (c *Toggle) SetGoPointer(ptr uintptr) { | |
| 243 | + | c.Ptr = ptr | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | // A group of exclusive toggles. | |
| 247 | + | // | |
| 248 | + | // <picture> | |
| 249 | + | // | |
| 250 | + | // <source srcset="toggle-group-dark.png" media="(prefers-color-scheme: dark)"> | |
| 251 | + | // <img src="toggle-group.png" alt="toggle-group"> | |
| 252 | + | // | |
| 253 | + | // </picture> | |
| 254 | + | // | |
| 255 | + | // `AdwToggleGroup` presents a set of exclusive toggles, represented as | |
| 256 | + | // [class@Toggle] objects. Each toggle can display an icon, a label, an icon | |
| 257 | + | // and a label, or a custom child. | |
| 258 | + | // | |
| 259 | + | // Toggles are indexed by their position, with the first toggle being equivalent | |
| 260 | + | // to 0, and so on. Use the [property@ToggleGroup:active] to get that position. | |
| 261 | + | // | |
| 262 | + | // Toggles can also have optional names, set via the [property@Toggle:name] | |
| 263 | + | // property. The name of the active toggle can be accessed via the | |
| 264 | + | // [property@ToggleGroup:active-name] property. | |
| 265 | + | // | |
| 266 | + | // `AdwToggle` objects can be retrieved via their index or name, using | |
| 267 | + | // [method@ToggleGroup.get_toggle] or [method@ToggleGroup.get_toggle_by_name] | |
| 268 | + | // respectively. `AdwToggleGroup` also provides a [iface@Gtk.SelectionModel] of | |
| 269 | + | // its toggles via the [property@ToggleGroup:toggles] property. | |
| 270 | + | // | |
| 271 | + | // `AdwToggleGroup` is orientable, and the toggles can be displayed horizontally | |
| 272 | + | // or vertically. This is mostly useful for icon-only toggles. | |
| 273 | + | // | |
| 274 | + | // Use the [property@ToggleGroup:homogeneous] property to make the toggles take | |
| 275 | + | // the same size, and the [property@ToggleGroup:can-shrink] to control whether | |
| 276 | + | // the toggles can ellipsize. | |
| 277 | + | // | |
| 278 | + | // Example of an `AdwToggleGroup` UI definition: | |
| 279 | + | // | |
| 280 | + | // ```xml | |
| 281 | + | // | |
| 282 | + | // <object class="AdwToggleGroup"> | |
| 283 | + | // <property name="active-name">picture</property> | |
| 284 | + | // <child> | |
| 285 | + | // <object class="AdwToggle"> | |
| 286 | + | // <property name="icon-name">camera-photo-symbolic</property> | |
| 287 | + | // <property name="tooltip" translatable="yes">Picture Mode</property> | |
| 288 | + | // <property name="name">picture</property> | |
| 289 | + | // </object> | |
| 290 | + | // </child> | |
| 291 | + | // <child> | |
| 292 | + | // <object class="AdwToggle"> | |
| 293 | + | // <property name="icon-name">camera-video-symbolic</property> | |
| 294 | + | // <property name="tooltip" translatable="yes">Recording Mode</property> | |
| 295 | + | // <property name="name">recording</property> | |
| 296 | + | // </object> | |
| 297 | + | // </child> | |
| 298 | + | // </object> | |
| 299 | + | // | |
| 300 | + | // ``` | |
| 301 | + | // | |
| 302 | + | // See also: [class@InlineViewSwitcher]. | |
| 303 | + | // | |
| 304 | + | // ## CSS nodes | |
| 305 | + | // | |
| 306 | + | // `AdwToggleGroup` has a main CSS node with the name `toggle-group`. | |
| 307 | + | // | |
| 308 | + | // Its toggles have CSS nodes with the name `toggle`, and its separators have nodes | |
| 309 | + | // with the name `separator`. | |
| 310 | + | // | |
| 311 | + | // Toggle nodes will have a different style classes depending on their content: | |
| 312 | + | // `.text-button` for labels, `.image-button` for icons, `.image-text-button` | |
| 313 | + | // for both or no style class for custom children. | |
| 314 | + | // | |
| 315 | + | // The hidden separators use the `.hidden` style class. | |
| 316 | + | // | |
| 317 | + | // ## Style classes | |
| 318 | + | // | |
| 319 | + | // `AdwToggleGroup` can use the [`.flat`](style-classes.html#flat_1) style class | |
| 320 | + | // to remove its background and make it look like a group of buttons. | |
| 321 | + | // | |
| 322 | + | // <picture> | |
| 323 | + | // | |
| 324 | + | // <source srcset="toggle-group-flat-dark.png" media="(prefers-color-scheme: dark)"> | |
| 325 | + | // <img src="toggle-group-flat.png" alt="toggle-group-flat"> | |
| 326 | + | // | |
| 327 | + | // </picture> | |
| 328 | + | // | |
| 329 | + | // It can also use the [`.round`](style-classes.html#round) style class to make | |
| 330 | + | // its toggles and the group itself rounded. | |
| 331 | + | // | |
| 332 | + | // <picture> | |
| 333 | + | // | |
| 334 | + | // <source srcset="toggle-group-round-dark.png" media="(prefers-color-scheme: dark)"> | |
| 335 | + | // <img src="toggle-group-round.png" alt="toggle-group-round"> | |
| 336 | + | // | |
| 337 | + | // </picture> | |
| 338 | + | // | |
| 339 | + | // They can also be combined with each other. | |
| 340 | + | // | |
| 341 | + | // <picture> | |
| 342 | + | // | |
| 343 | + | // <source srcset="toggle-group-flat-round-dark.png" media="(prefers-color-scheme: dark)"> | |
| 344 | + | // <img src="toggle-group-flat-round.png" alt="toggle-group-flat-round"> | |
| 345 | + | // | |
| 346 | + | // </picture> | |
| 347 | + | // | |
| 348 | + | // ## Accessibility | |
| 349 | + | // | |
| 350 | + | // `AdwToggleGroup` uses the `GTK_ACCESSIBLE_ROLE_RADIO_GROUP` role. Its toggles | |
| 351 | + | // use the `GTK_ACCESSIBLE_ROLE_RADIO` role. | |
| 352 | + | type ToggleGroup struct { | |
| 353 | + | gtk.Widget | |
| 354 | + | } | |
| 355 | + | ||
| 356 | + | var xToggleGroupGLibType func() types.GType | |
| 357 | + | ||
| 358 | + | func ToggleGroupGLibType() types.GType { | |
| 359 | + | return xToggleGroupGLibType() | |
| 360 | + | } | |
| 361 | + | ||
| 362 | + | func ToggleGroupNewFromInternalPtr(ptr uintptr) *ToggleGroup { | |
| 363 | + | cls := &ToggleGroup{} | |
| 364 | + | cls.Ptr = ptr | |
| 365 | + | return cls | |
| 366 | + | } | |
| 367 | + | ||
| 368 | + | var xNewToggleGroup func() uintptr | |
| 369 | + | ||
| 370 | + | // Creates a new `AdwToggleGroup`. | |
| 371 | + | func NewToggleGroup() *ToggleGroup { | |
| 372 | + | var cls *ToggleGroup | |
| 373 | + | ||
| 374 | + | cret := xNewToggleGroup() | |
| 375 | + | ||
| 376 | + | if cret == 0 { | |
| 377 | + | return nil | |
| 378 | + | } | |
| 379 | + | gobject.IncreaseRef(cret) | |
| 380 | + | cls = &ToggleGroup{} | |
| 381 | + | cls.Ptr = cret | |
| 382 | + | return cls | |
| 383 | + | } | |
| 384 | + | ||
| 385 | + | var xToggleGroupAdd func(uintptr, uintptr) | |
| 386 | + | ||
| 387 | + | // Adds a toggle to @self. | |
| 388 | + | func (x *ToggleGroup) Add(ToggleVar *Toggle) { | |
| 389 | + | ||
| 390 | + | xToggleGroupAdd(x.GoPointer(), ToggleVar.GoPointer()) | |
| 391 | + | ||
| 392 | + | } | |
| 393 | + | ||
| 394 | + | var xToggleGroupGetActive func(uintptr) uint | |
| 395 | + | ||
| 396 | + | // Gets the index of the active toggle in @self. | |
| 397 | + | // | |
| 398 | + | // Returns `GTK_INVALID_LIST_POSITION` if no toggle is active. | |
| 399 | + | func (x *ToggleGroup) GetActive() uint { | |
| 400 | + | ||
| 401 | + | cret := xToggleGroupGetActive(x.GoPointer()) | |
| 402 | + | return cret | |
| 403 | + | } | |
| 404 | + | ||
| 405 | + | var xToggleGroupGetActiveName func(uintptr) string | |
| 406 | + | ||
| 407 | + | // Gets the name of the active toggle in @self. | |
| 408 | + | // | |
| 409 | + | // Can be `NULL` if the currently active toggle doesn't have a name. | |
| 410 | + | // | |
| 411 | + | // See [property@Toggle:name]. | |
| 412 | + | func (x *ToggleGroup) GetActiveName() string { | |
| 413 | + | ||
| 414 | + | cret := xToggleGroupGetActiveName(x.GoPointer()) | |
| 415 | + | return cret | |
| 416 | + | } | |
| 417 | + | ||
| 418 | + | var xToggleGroupGetCanShrink func(uintptr) bool | |
| 419 | + | ||
| 420 | + | // Gets whether the toggles can be smaller than the natural size of their | |
| 421 | + | // contents. | |
| 422 | + | func (x *ToggleGroup) GetCanShrink() bool { | |
| 423 | + | ||
| 424 | + | cret := xToggleGroupGetCanShrink(x.GoPointer()) | |
| 425 | + | return cret | |
| 426 | + | } | |
| 427 | + | ||
| 428 | + | var xToggleGroupGetHomogeneous func(uintptr) bool | |
| 429 | + | ||
| 430 | + | // Gets whether all toggles take the same size. | |
| 431 | + | func (x *ToggleGroup) GetHomogeneous() bool { | |
| 432 | + | ||
| 433 | + | cret := xToggleGroupGetHomogeneous(x.GoPointer()) | |
| 434 | + | return cret | |
| 435 | + | } | |
| 436 | + | ||
| 437 | + | var xToggleGroupGetNToggles func(uintptr) uint | |
| 438 | + | ||
| 439 | + | // Gets the number of toggles within @self. | |
| 440 | + | func (x *ToggleGroup) GetNToggles() uint { | |
| 441 | + | ||
| 442 | + | cret := xToggleGroupGetNToggles(x.GoPointer()) | |
| 443 | + | return cret | |
| 444 | + | } | |
| 445 | + | ||
| 446 | + | var xToggleGroupGetToggle func(uintptr, uint) uintptr | |
| 447 | + | ||
| 448 | + | // Gets the toggle with @index from @self. | |
| 449 | + | func (x *ToggleGroup) GetToggle(IndexVar uint) *Toggle { | |
| 450 | + | var cls *Toggle | |
| 451 | + | ||
| 452 | + | cret := xToggleGroupGetToggle(x.GoPointer(), IndexVar) | |
| 453 | + | ||
| 454 | + | if cret == 0 { | |
| 455 | + | return nil | |
| 456 | + | } | |
| 457 | + | gobject.IncreaseRef(cret) | |
| 458 | + | cls = &Toggle{} | |
| 459 | + | cls.Ptr = cret | |
| 460 | + | return cls | |
| 461 | + | } | |
| 462 | + | ||
| 463 | + | var xToggleGroupGetToggleByName func(uintptr, string) uintptr | |
| 464 | + | ||
| 465 | + | // Gets the toggle with the name @name from @self. | |
| 466 | + | func (x *ToggleGroup) GetToggleByName(NameVar string) *Toggle { | |
| 467 | + | var cls *Toggle | |
| 468 | + | ||
| 469 | + | cret := xToggleGroupGetToggleByName(x.GoPointer(), NameVar) | |
| 470 | + | ||
| 471 | + | if cret == 0 { | |
| 472 | + | return nil | |
| 473 | + | } | |
| 474 | + | gobject.IncreaseRef(cret) | |
| 475 | + | cls = &Toggle{} | |
| 476 | + | cls.Ptr = cret | |
| 477 | + | return cls | |
| 478 | + | } | |
| 479 | + | ||
| 480 | + | var xToggleGroupGetToggles func(uintptr) uintptr | |
| 481 | + | ||
| 482 | + | // Returns a [iface@Gio.ListModel] that contains the toggles of the group. | |
| 483 | + | // | |
| 484 | + | // This can be used to keep an up-to-date view. The model also implements | |
| 485 | + | // [iface@Gtk.SelectionModel] and can be used to track and change the active | |
| 486 | + | // toggle. | |
| 487 | + | func (x *ToggleGroup) GetToggles() *gtk.SelectionModelBase { | |
| 488 | + | var cls *gtk.SelectionModelBase | |
| 489 | + | ||
| 490 | + | cret := xToggleGroupGetToggles(x.GoPointer()) | |
| 491 | + | ||
| 492 | + | if cret == 0 { | |
| 493 | + | return nil | |
| 494 | + | } | |
| 495 | + | cls = >k.SelectionModelBase{} | |
| 496 | + | cls.Ptr = cret | |
| 497 | + | return cls | |
| 498 | + | } | |
| 499 | + | ||
| 500 | + | var xToggleGroupRemove func(uintptr, uintptr) | |
| 501 | + | ||
| 502 | + | // Removes @toggle from @self. | |
| 503 | + | func (x *ToggleGroup) Remove(ToggleVar *Toggle) { | |
| 504 | + | ||
| 505 | + | xToggleGroupRemove(x.GoPointer(), ToggleVar.GoPointer()) | |
| 506 | + | ||
| 507 | + | } | |
| 508 | + | ||
| 509 | + | var xToggleGroupRemoveAll func(uintptr) | |
| 510 | + | ||
| 511 | + | // Removes all toggles from @self. | |
| 512 | + | func (x *ToggleGroup) RemoveAll() { | |
| 513 | + | ||
| 514 | + | xToggleGroupRemoveAll(x.GoPointer()) | |
| 515 | + | ||
| 516 | + | } | |
| 517 | + | ||
| 518 | + | var xToggleGroupSetActive func(uintptr, uint) | |
| 519 | + | ||
| 520 | + | // Sets the active toggle for @self. | |
| 521 | + | // | |
| 522 | + | // If the index is larger than the number of toggles in @self, unsets the | |
| 523 | + | // current active toggle. | |
| 524 | + | func (x *ToggleGroup) SetActive(ActiveVar uint) { | |
| 525 | + | ||
| 526 | + | xToggleGroupSetActive(x.GoPointer(), ActiveVar) | |
| 527 | + | ||
| 528 | + | } | |
| 529 | + | ||
| 530 | + | var xToggleGroupSetActiveName func(uintptr, string) | |
| 531 | + | ||
| 532 | + | // Sets the active toggle for @self. | |
| 533 | + | // | |
| 534 | + | // The name can be set via [property@Toggle:name]. | |
| 535 | + | // | |
| 536 | + | // If @name is `NULL`, unset the current active toggle instead. | |
| 537 | + | func (x *ToggleGroup) SetActiveName(NameVar string) { | |
| 538 | + | ||
| 539 | + | xToggleGroupSetActiveName(x.GoPointer(), NameVar) | |
| 540 | + | ||
| 541 | + | } | |
| 542 | + | ||
| 543 | + | var xToggleGroupSetCanShrink func(uintptr, bool) | |
| 544 | + | ||
| 545 | + | // Sets whether the toggles can be smaller than the natural size of their | |
| 546 | + | // contents. | |
| 547 | + | // | |
| 548 | + | // If @can_shrink is `TRUE`, the toggle labels will ellipsize. | |
| 549 | + | // | |
| 550 | + | // See [property@Gtk.Button:can-shrink]. | |
| 551 | + | func (x *ToggleGroup) SetCanShrink(CanShrinkVar bool) { | |
| 552 | + | ||
| 553 | + | xToggleGroupSetCanShrink(x.GoPointer(), CanShrinkVar) | |
| 554 | + | ||
| 555 | + | } | |
| 556 | + | ||
| 557 | + | var xToggleGroupSetHomogeneous func(uintptr, bool) | |
| 558 | + | ||
| 559 | + | // Sets whether all toggles take the same size. | |
| 560 | + | func (x *ToggleGroup) SetHomogeneous(HomogeneousVar bool) { | |
| 561 | + | ||
| 562 | + | xToggleGroupSetHomogeneous(x.GoPointer(), HomogeneousVar) | |
| 563 | + | ||
| 564 | + | } | |
| 565 | + | ||
| 566 | + | func (c *ToggleGroup) GoPointer() uintptr { | |
| 567 | + | if c == nil { | |
| 568 | + | return 0 | |
| 569 | + | } | |
| 570 | + | return c.Ptr | |
| 571 | + | } | |
| 572 | + | ||
| 573 | + | func (c *ToggleGroup) SetGoPointer(ptr uintptr) { | |
| 574 | + | c.Ptr = ptr | |
| 575 | + | } | |
| 576 | + | ||
| 577 | + | // Requests the user's screen reader to announce the given message. | |
| 578 | + | // | |
| 579 | + | // This kind of notification is useful for messages that | |
| 580 | + | // either have only a visual representation or that are not | |
| 581 | + | // exposed visually at all, e.g. a notification about a | |
| 582 | + | // successful operation. | |
| 583 | + | // | |
| 584 | + | // Also, by using this API, you can ensure that the message | |
| 585 | + | // does not interrupts the user's current screen reader output. | |
| 586 | + | func (x *ToggleGroup) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 587 | + | ||
| 588 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 589 | + | ||
| 590 | + | } | |
| 591 | + | ||
| 592 | + | // Retrieves the accessible parent for an accessible object. | |
| 593 | + | // | |
| 594 | + | // This function returns `NULL` for top level widgets. | |
| 595 | + | func (x *ToggleGroup) GetAccessibleParent() *gtk.AccessibleBase { | |
| 596 | + | var cls *gtk.AccessibleBase | |
| 597 | + | ||
| 598 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 599 | + | ||
| 600 | + | if cret == 0 { | |
| 601 | + | return nil | |
| 602 | + | } | |
| 603 | + | cls = >k.AccessibleBase{} | |
| 604 | + | cls.Ptr = cret | |
| 605 | + | return cls | |
| 606 | + | } | |
| 607 | + | ||
| 608 | + | // Retrieves the accessible role of an accessible object. | |
| 609 | + | func (x *ToggleGroup) GetAccessibleRole() gtk.AccessibleRole { | |
| 610 | + | ||
| 611 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 612 | + | return cret | |
| 613 | + | } | |
| 614 | + | ||
| 615 | + | // Retrieves the implementation for the given accessible object. | |
| 616 | + | func (x *ToggleGroup) GetAtContext() *gtk.ATContext { | |
| 617 | + | var cls *gtk.ATContext | |
| 618 | + | ||
| 619 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 620 | + | ||
| 621 | + | if cret == 0 { | |
| 622 | + | return nil | |
| 623 | + | } | |
| 624 | + | cls = >k.ATContext{} | |
| 625 | + | cls.Ptr = cret | |
| 626 | + | return cls | |
| 627 | + | } | |
| 628 | + | ||
| 629 | + | // Queries the coordinates and dimensions of this accessible | |
| 630 | + | // | |
| 631 | + | // This functionality can be overridden by `GtkAccessible` | |
| 632 | + | // implementations, e.g. to get the bounds from an ignored | |
| 633 | + | // child widget. | |
| 634 | + | func (x *ToggleGroup) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 635 | + | ||
| 636 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 637 | + | return cret | |
| 638 | + | } | |
| 639 | + | ||
| 640 | + | // Retrieves the first accessible child of an accessible object. | |
| 641 | + | func (x *ToggleGroup) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 642 | + | var cls *gtk.AccessibleBase | |
| 643 | + | ||
| 644 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 645 | + | ||
| 646 | + | if cret == 0 { | |
| 647 | + | return nil | |
| 648 | + | } | |
| 649 | + | cls = >k.AccessibleBase{} | |
| 650 | + | cls.Ptr = cret | |
| 651 | + | return cls | |
| 652 | + | } | |
| 653 | + | ||
| 654 | + | // Retrieves the next accessible sibling of an accessible object | |
| 655 | + | func (x *ToggleGroup) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 656 | + | var cls *gtk.AccessibleBase | |
| 657 | + | ||
| 658 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 659 | + | ||
| 660 | + | if cret == 0 { | |
| 661 | + | return nil | |
| 662 | + | } | |
| 663 | + | cls = >k.AccessibleBase{} | |
| 664 | + | cls.Ptr = cret | |
| 665 | + | return cls | |
| 666 | + | } | |
| 667 | + | ||
| 668 | + | // Queries a platform state, such as focus. | |
| 669 | + | // | |
| 670 | + | // This functionality can be overridden by `GtkAccessible` | |
| 671 | + | // implementations, e.g. to get platform state from an ignored | |
| 672 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 673 | + | func (x *ToggleGroup) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 674 | + | ||
| 675 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 676 | + | return cret | |
| 677 | + | } | |
| 678 | + | ||
| 679 | + | // Resets the accessible property to its default value. | |
| 680 | + | func (x *ToggleGroup) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 681 | + | ||
| 682 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 683 | + | ||
| 684 | + | } | |
| 685 | + | ||
| 686 | + | // Resets the accessible relation to its default value. | |
| 687 | + | func (x *ToggleGroup) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 688 | + | ||
| 689 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 690 | + | ||
| 691 | + | } | |
| 692 | + | ||
| 693 | + | // Resets the accessible state to its default value. | |
| 694 | + | func (x *ToggleGroup) ResetState(StateVar gtk.AccessibleState) { | |
| 695 | + | ||
| 696 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 697 | + | ||
| 698 | + | } | |
| 699 | + | ||
| 700 | + | // Sets the parent and sibling of an accessible object. | |
| 701 | + | // | |
| 702 | + | // This function is meant to be used by accessible implementations that are | |
| 703 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 704 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 705 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 706 | + | // interface, you will use this function to ensure that the parent of each | |
| 707 | + | // child widget is the metadata object, and the parent of each metadata | |
| 708 | + | // object is the container widget. | |
| 709 | + | func (x *ToggleGroup) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 710 | + | ||
| 711 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 712 | + | ||
| 713 | + | } | |
| 714 | + | ||
| 715 | + | // Updates the next accessible sibling. | |
| 716 | + | // | |
| 717 | + | // That might be useful when a new child of a custom accessible | |
| 718 | + | // is created, and it needs to be linked to a previous child. | |
| 719 | + | func (x *ToggleGroup) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 720 | + | ||
| 721 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 722 | + | ||
| 723 | + | } | |
| 724 | + | ||
| 725 | + | // Informs ATs that the platform state has changed. | |
| 726 | + | // | |
| 727 | + | // This function should be used by `GtkAccessible` implementations that | |
| 728 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 729 | + | // states automatically. | |
| 730 | + | func (x *ToggleGroup) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 731 | + | ||
| 732 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 733 | + | ||
| 734 | + | } | |
| 735 | + | ||
| 736 | + | // Updates a list of accessible properties. | |
| 737 | + | // | |
| 738 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 739 | + | // value types of accessible properties. | |
| 740 | + | // | |
| 741 | + | // This function should be called by `GtkWidget` types whenever | |
| 742 | + | // an accessible property change must be communicated to assistive | |
| 743 | + | // technologies. | |
| 744 | + | // | |
| 745 | + | // Example: | |
| 746 | + | // ```c | |
| 747 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 748 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 749 | + | // | |
| 750 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 751 | + | // -1); | |
| 752 | + | // | |
| 753 | + | // ``` | |
| 754 | + | func (x *ToggleGroup) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 755 | + | ||
| 756 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 757 | + | ||
| 758 | + | } | |
| 759 | + | ||
| 760 | + | // Updates an array of accessible properties. | |
| 761 | + | // | |
| 762 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 763 | + | // property change must be communicated to assistive technologies. | |
| 764 | + | // | |
| 765 | + | // This function is meant to be used by language bindings. | |
| 766 | + | func (x *ToggleGroup) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) { | |
| 767 | + | ||
| 768 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 769 | + | ||
| 770 | + | } | |
| 771 | + | ||
| 772 | + | // Updates a list of accessible relations. | |
| 773 | + | // | |
| 774 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 775 | + | // relation change must be communicated to assistive technologies. | |
| 776 | + | // | |
| 777 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 778 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 779 | + | // | |
| 780 | + | // ```c | |
| 781 | + | // gtk_accessible_update_relation (accessible, | |
| 782 | + | // | |
| 783 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 784 | + | // ref1, NULL, | |
| 785 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 786 | + | // ref1, ref2, ref3, NULL, | |
| 787 | + | // -1); | |
| 788 | + | // | |
| 789 | + | // ``` | |
| 790 | + | func (x *ToggleGroup) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 791 | + | ||
| 792 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 793 | + | ||
| 794 | + | } | |
| 795 | + | ||
| 796 | + | // Updates an array of accessible relations. | |
| 797 | + | // | |
| 798 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 799 | + | // relation change must be communicated to assistive technologies. | |
| 800 | + | // | |
| 801 | + | // This function is meant to be used by language bindings. | |
| 802 | + | func (x *ToggleGroup) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) { | |
| 803 | + | ||
| 804 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 805 | + | ||
| 806 | + | } | |
| 807 | + | ||
| 808 | + | // Updates a list of accessible states. | |
| 809 | + | // | |
| 810 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 811 | + | // value types of accessible states. | |
| 812 | + | // | |
| 813 | + | // This function should be called by `GtkWidget` types whenever | |
| 814 | + | // an accessible state change must be communicated to assistive | |
| 815 | + | // technologies. | |
| 816 | + | // | |
| 817 | + | // Example: | |
| 818 | + | // | |
| 819 | + | // ```c | |
| 820 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 821 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 822 | + | // | |
| 823 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 824 | + | // -1); | |
| 825 | + | // | |
| 826 | + | // ``` | |
| 827 | + | func (x *ToggleGroup) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 828 | + | ||
| 829 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 830 | + | ||
| 831 | + | } | |
| 832 | + | ||
| 833 | + | // Updates an array of accessible states. | |
| 834 | + | // | |
| 835 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 836 | + | // state change must be communicated to assistive technologies. | |
| 837 | + | // | |
| 838 | + | // This function is meant to be used by language bindings. | |
| 839 | + | func (x *ToggleGroup) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) { | |
| 840 | + | ||
| 841 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 842 | + | ||
| 843 | + | } | |
| 844 | + | ||
| 845 | + | // Gets the ID of the @buildable object. | |
| 846 | + | // | |
| 847 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 848 | + | // of the `<object>` tag used to construct the @buildable. | |
| 849 | + | func (x *ToggleGroup) GetBuildableId() string { | |
| 850 | + | ||
| 851 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 852 | + | return cret | |
| 853 | + | } | |
| 854 | + | ||
| 855 | + | // Retrieves the orientation of the @orientable. | |
| 856 | + | func (x *ToggleGroup) GetOrientation() gtk.Orientation { | |
| 857 | + | ||
| 858 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 859 | + | return cret | |
| 860 | + | } | |
| 861 | + | ||
| 862 | + | // Sets the orientation of the @orientable. | |
| 863 | + | func (x *ToggleGroup) SetOrientation(OrientationVar gtk.Orientation) { | |
| 864 | + | ||
| 865 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 866 | + | ||
| 867 | + | } | |
| 868 | + | ||
| 869 | + | func init() { | |
| 870 | + | core.SetPackageName("ADW", "libadwaita-1") | |
| 871 | + | core.SetSharedLibrary("ADW", "libadwaita-1.so.0") | |
| 872 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 873 | + | if err != nil { | |
| 874 | + | panic(err) | |
| 875 | + | } | |
| 876 | + | ||
| 877 | + | core.PuregoSafeRegister(&xToggleGLibType, lib, "adw_toggle_get_type") | |
| 878 | + | ||
| 879 | + | core.PuregoSafeRegister(&xNewToggle, lib, "adw_toggle_new") | |
| 880 | + | ||
| 881 | + | core.PuregoSafeRegister(&xToggleGetChild, lib, "adw_toggle_get_child") | |
| 882 | + | core.PuregoSafeRegister(&xToggleGetEnabled, lib, "adw_toggle_get_enabled") | |
| 883 | + | core.PuregoSafeRegister(&xToggleGetIconName, lib, "adw_toggle_get_icon_name") | |
| 884 | + | core.PuregoSafeRegister(&xToggleGetIndex, lib, "adw_toggle_get_index") | |
| 885 | + | core.PuregoSafeRegister(&xToggleGetLabel, lib, "adw_toggle_get_label") | |
| 886 | + | core.PuregoSafeRegister(&xToggleGetName, lib, "adw_toggle_get_name") | |
| 887 | + | core.PuregoSafeRegister(&xToggleGetTooltip, lib, "adw_toggle_get_tooltip") | |
| 888 | + | core.PuregoSafeRegister(&xToggleGetUseUnderline, lib, "adw_toggle_get_use_underline") | |
| 889 | + | core.PuregoSafeRegister(&xToggleSetChild, lib, "adw_toggle_set_child") | |
| 890 | + | core.PuregoSafeRegister(&xToggleSetEnabled, lib, "adw_toggle_set_enabled") | |
| 891 | + | core.PuregoSafeRegister(&xToggleSetIconName, lib, "adw_toggle_set_icon_name") | |
| 892 | + | core.PuregoSafeRegister(&xToggleSetLabel, lib, "adw_toggle_set_label") | |
| 893 | + | core.PuregoSafeRegister(&xToggleSetName, lib, "adw_toggle_set_name") | |
| 894 | + | core.PuregoSafeRegister(&xToggleSetTooltip, lib, "adw_toggle_set_tooltip") | |
| 895 | + | core.PuregoSafeRegister(&xToggleSetUseUnderline, lib, "adw_toggle_set_use_underline") | |
| 896 | + | ||
| 897 | + | core.PuregoSafeRegister(&xToggleGroupGLibType, lib, "adw_toggle_group_get_type") | |
| 898 | + | ||
| 899 | + | core.PuregoSafeRegister(&xNewToggleGroup, lib, "adw_toggle_group_new") | |
| 900 | + | ||
| 901 | + | core.PuregoSafeRegister(&xToggleGroupAdd, lib, "adw_toggle_group_add") | |
| 902 | + | core.PuregoSafeRegister(&xToggleGroupGetActive, lib, "adw_toggle_group_get_active") | |
| 903 | + | core.PuregoSafeRegister(&xToggleGroupGetActiveName, lib, "adw_toggle_group_get_active_name") | |
| 904 | + | core.PuregoSafeRegister(&xToggleGroupGetCanShrink, lib, "adw_toggle_group_get_can_shrink") | |
| 905 | + | core.PuregoSafeRegister(&xToggleGroupGetHomogeneous, lib, "adw_toggle_group_get_homogeneous") | |
| 906 | + | core.PuregoSafeRegister(&xToggleGroupGetNToggles, lib, "adw_toggle_group_get_n_toggles") | |
| 907 | + | core.PuregoSafeRegister(&xToggleGroupGetToggle, lib, "adw_toggle_group_get_toggle") | |
| 908 | + | core.PuregoSafeRegister(&xToggleGroupGetToggleByName, lib, "adw_toggle_group_get_toggle_by_name") | |
| 909 | + | core.PuregoSafeRegister(&xToggleGroupGetToggles, lib, "adw_toggle_group_get_toggles") | |
| 910 | + | core.PuregoSafeRegister(&xToggleGroupRemove, lib, "adw_toggle_group_remove") | |
| 911 | + | core.PuregoSafeRegister(&xToggleGroupRemoveAll, lib, "adw_toggle_group_remove_all") | |
| 912 | + | core.PuregoSafeRegister(&xToggleGroupSetActive, lib, "adw_toggle_group_set_active") | |
| 913 | + | core.PuregoSafeRegister(&xToggleGroupSetActiveName, lib, "adw_toggle_group_set_active_name") | |
| 914 | + | core.PuregoSafeRegister(&xToggleGroupSetCanShrink, lib, "adw_toggle_group_set_can_shrink") | |
| 915 | + | core.PuregoSafeRegister(&xToggleGroupSetHomogeneous, lib, "adw_toggle_group_set_homogeneous") | |
| 916 | + | ||
| 917 | + | } | |
M v4/adw/adw-toolbar-view.go +145 -10
| @@ -505,34 +505,165 @@ func (c *ToolbarView) SetGoPointer(ptr uintptr) { | |||
| 505 | 505 | c.Ptr = ptr | |
| 506 | 506 | } | |
| 507 | 507 | ||
| 508 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 508 | + | // Requests the user's screen reader to announce the given message. | |
| 509 | + | // | |
| 510 | + | // This kind of notification is useful for messages that | |
| 511 | + | // either have only a visual representation or that are not | |
| 512 | + | // exposed visually at all, e.g. a notification about a | |
| 513 | + | // successful operation. | |
| 514 | + | // | |
| 515 | + | // Also, by using this API, you can ensure that the message | |
| 516 | + | // does not interrupts the user's current screen reader output. | |
| 517 | + | func (x *ToolbarView) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 518 | + | ||
| 519 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 520 | + | ||
| 521 | + | } | |
| 522 | + | ||
| 523 | + | // Retrieves the accessible parent for an accessible object. | |
| 524 | + | // | |
| 525 | + | // This function returns `NULL` for top level widgets. | |
| 526 | + | func (x *ToolbarView) GetAccessibleParent() *gtk.AccessibleBase { | |
| 527 | + | var cls *gtk.AccessibleBase | |
| 528 | + | ||
| 529 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 530 | + | ||
| 531 | + | if cret == 0 { | |
| 532 | + | return nil | |
| 533 | + | } | |
| 534 | + | cls = >k.AccessibleBase{} | |
| 535 | + | cls.Ptr = cret | |
| 536 | + | return cls | |
| 537 | + | } | |
| 538 | + | ||
| 539 | + | // Retrieves the accessible role of an accessible object. | |
| 509 | 540 | func (x *ToolbarView) GetAccessibleRole() gtk.AccessibleRole { | |
| 510 | 541 | ||
| 511 | 542 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 512 | 543 | return cret | |
| 513 | 544 | } | |
| 514 | 545 | ||
| 515 | - | // Resets the accessible @property to its default value. | |
| 546 | + | // Retrieves the implementation for the given accessible object. | |
| 547 | + | func (x *ToolbarView) GetAtContext() *gtk.ATContext { | |
| 548 | + | var cls *gtk.ATContext | |
| 549 | + | ||
| 550 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 551 | + | ||
| 552 | + | if cret == 0 { | |
| 553 | + | return nil | |
| 554 | + | } | |
| 555 | + | cls = >k.ATContext{} | |
| 556 | + | cls.Ptr = cret | |
| 557 | + | return cls | |
| 558 | + | } | |
| 559 | + | ||
| 560 | + | // Queries the coordinates and dimensions of this accessible | |
| 561 | + | // | |
| 562 | + | // This functionality can be overridden by `GtkAccessible` | |
| 563 | + | // implementations, e.g. to get the bounds from an ignored | |
| 564 | + | // child widget. | |
| 565 | + | func (x *ToolbarView) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 566 | + | ||
| 567 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 568 | + | return cret | |
| 569 | + | } | |
| 570 | + | ||
| 571 | + | // Retrieves the first accessible child of an accessible object. | |
| 572 | + | func (x *ToolbarView) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 573 | + | var cls *gtk.AccessibleBase | |
| 574 | + | ||
| 575 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 576 | + | ||
| 577 | + | if cret == 0 { | |
| 578 | + | return nil | |
| 579 | + | } | |
| 580 | + | cls = >k.AccessibleBase{} | |
| 581 | + | cls.Ptr = cret | |
| 582 | + | return cls | |
| 583 | + | } | |
| 584 | + | ||
| 585 | + | // Retrieves the next accessible sibling of an accessible object | |
| 586 | + | func (x *ToolbarView) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 587 | + | var cls *gtk.AccessibleBase | |
| 588 | + | ||
| 589 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 590 | + | ||
| 591 | + | if cret == 0 { | |
| 592 | + | return nil | |
| 593 | + | } | |
| 594 | + | cls = >k.AccessibleBase{} | |
| 595 | + | cls.Ptr = cret | |
| 596 | + | return cls | |
| 597 | + | } | |
| 598 | + | ||
| 599 | + | // Queries a platform state, such as focus. | |
| 600 | + | // | |
| 601 | + | // This functionality can be overridden by `GtkAccessible` | |
| 602 | + | // implementations, e.g. to get platform state from an ignored | |
| 603 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 604 | + | func (x *ToolbarView) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 605 | + | ||
| 606 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 607 | + | return cret | |
| 608 | + | } | |
| 609 | + | ||
| 610 | + | // Resets the accessible property to its default value. | |
| 516 | 611 | func (x *ToolbarView) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 517 | 612 | ||
| 518 | 613 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 519 | 614 | ||
| 520 | 615 | } | |
| 521 | 616 | ||
| 522 | - | // Resets the accessible @relation to its default value. | |
| 617 | + | // Resets the accessible relation to its default value. | |
| 523 | 618 | func (x *ToolbarView) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 524 | 619 | ||
| 525 | 620 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 526 | 621 | ||
| 527 | 622 | } | |
| 528 | 623 | ||
| 529 | - | // Resets the accessible @state to its default value. | |
| 624 | + | // Resets the accessible state to its default value. | |
| 530 | 625 | func (x *ToolbarView) ResetState(StateVar gtk.AccessibleState) { | |
| 531 | 626 | ||
| 532 | 627 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 533 | 628 | ||
| 534 | 629 | } | |
| 535 | 630 | ||
| 631 | + | // Sets the parent and sibling of an accessible object. | |
| 632 | + | // | |
| 633 | + | // This function is meant to be used by accessible implementations that are | |
| 634 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 635 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 636 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 637 | + | // interface, you will use this function to ensure that the parent of each | |
| 638 | + | // child widget is the metadata object, and the parent of each metadata | |
| 639 | + | // object is the container widget. | |
| 640 | + | func (x *ToolbarView) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 641 | + | ||
| 642 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 643 | + | ||
| 644 | + | } | |
| 645 | + | ||
| 646 | + | // Updates the next accessible sibling. | |
| 647 | + | // | |
| 648 | + | // That might be useful when a new child of a custom accessible | |
| 649 | + | // is created, and it needs to be linked to a previous child. | |
| 650 | + | func (x *ToolbarView) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 651 | + | ||
| 652 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 653 | + | ||
| 654 | + | } | |
| 655 | + | ||
| 656 | + | // Informs ATs that the platform state has changed. | |
| 657 | + | // | |
| 658 | + | // This function should be used by `GtkAccessible` implementations that | |
| 659 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 660 | + | // states automatically. | |
| 661 | + | func (x *ToolbarView) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 662 | + | ||
| 663 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 664 | + | ||
| 665 | + | } | |
| 666 | + | ||
| 536 | 667 | // Updates a list of accessible properties. | |
| 537 | 668 | // | |
| 538 | 669 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -575,7 +706,7 @@ func (x *ToolbarView) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 575 | 706 | // relation change must be communicated to assistive technologies. | |
| 576 | 707 | // | |
| 577 | 708 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 578 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 709 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 579 | 710 | // | |
| 580 | 711 | // ```c | |
| 581 | 712 | // gtk_accessible_update_relation (accessible, | |
| @@ -605,13 +736,17 @@ func (x *ToolbarView) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 605 | 736 | ||
| 606 | 737 | } | |
| 607 | 738 | ||
| 608 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 609 | - | // documentation for the value types of accessible states. | |
| 739 | + | // Updates a list of accessible states. | |
| 610 | 740 | // | |
| 611 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 612 | - | // state change must be communicated to assistive technologies. | |
| 741 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 742 | + | // value types of accessible states. | |
| 743 | + | // | |
| 744 | + | // This function should be called by `GtkWidget` types whenever | |
| 745 | + | // an accessible state change must be communicated to assistive | |
| 746 | + | // technologies. | |
| 613 | 747 | // | |
| 614 | 748 | // Example: | |
| 749 | + | // | |
| 615 | 750 | // ```c | |
| 616 | 751 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 617 | 752 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -641,7 +776,7 @@ func (x *ToolbarView) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessibl | |||
| 641 | 776 | // Gets the ID of the @buildable object. | |
| 642 | 777 | // | |
| 643 | 778 | // `GtkBuilder` sets the name based on the ID attribute | |
| 644 | - | // of the <object> tag used to construct the @buildable. | |
| 779 | + | // of the `<object>` tag used to construct the @buildable. | |
| 645 | 780 | func (x *ToolbarView) GetBuildableId() string { | |
| 646 | 781 | ||
| 647 | 782 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-version.go +3 -3
| @@ -10,12 +10,12 @@ const ( | |||
| 10 | 10 | // Adwaita major version component (e.g. 1 if the version is 1.2.3). | |
| 11 | 11 | MAJOR_VERSION int = 1 | |
| 12 | 12 | // Adwaita micro version component (e.g. 3 if the version is 1.2.3). | |
| 13 | - | MICRO_VERSION int = 4 | |
| 13 | + | MICRO_VERSION int = 7 | |
| 14 | 14 | // Adwaita minor version component (e.g. 2 if the version is 1.2.3). | |
| 15 | - | MINOR_VERSION int = 6 | |
| 15 | + | MINOR_VERSION int = 7 | |
| 16 | 16 | // Adwaita version, encoded as a string, useful for printing and | |
| 17 | 17 | // concatenation. | |
| 18 | - | VERSION_S string = "1.6.4" | |
| 18 | + | VERSION_S string = "1.7.7" | |
| 19 | 19 | ) | |
| 20 | 20 | ||
| 21 | 21 | var xGetMajorVersion func() uint | |
M v4/adw/adw-view-stack.go +353 -21
| @@ -59,7 +59,9 @@ func (x *ViewStackPagesClass) GoPointer() uintptr { | |||
| 59 | 59 | // [property@ViewStackPage:needs-attention], and | |
| 60 | 60 | // [property@ViewStackPage:badge-number] properties. | |
| 61 | 61 | // | |
| 62 | - | // Unlike [class@Gtk.Stack], transitions between views are not animated. | |
| 62 | + | // Unlike [class@Gtk.Stack], transitions between views can only be animated via | |
| 63 | + | // a crossfade and size changes are always interpolated. Animations are disabled | |
| 64 | + | // by default. Use [property@ViewStack:enable-transitions] to enable them. | |
| 63 | 65 | // | |
| 64 | 66 | // `AdwViewStack` maintains a [class@ViewStackPage] object for each added child, | |
| 65 | 67 | // which holds additional per-child properties. You obtain the | |
| @@ -225,6 +227,19 @@ func (x *ViewStack) GetChildByName(NameVar string) *gtk.Widget { | |||
| 225 | 227 | return cls | |
| 226 | 228 | } | |
| 227 | 229 | ||
| 230 | + | var xViewStackGetEnableTransitions func(uintptr) bool | |
| 231 | + | ||
| 232 | + | // Gets whether @self uses a crossfade transition between pages. | |
| 233 | + | // | |
| 234 | + | // Use [property@ViewStack:transition-duration] to control the duration, and | |
| 235 | + | // [property@ViewStack:transition-running] to know when the transition is | |
| 236 | + | // running. | |
| 237 | + | func (x *ViewStack) GetEnableTransitions() bool { | |
| 238 | + | ||
| 239 | + | cret := xViewStackGetEnableTransitions(x.GoPointer()) | |
| 240 | + | return cret | |
| 241 | + | } | |
| 242 | + | ||
| 228 | 243 | var xViewStackGetHhomogeneous func(uintptr) bool | |
| 229 | 244 | ||
| 230 | 245 | // Gets whether @self is horizontally homogeneous. | |
| @@ -271,6 +286,28 @@ func (x *ViewStack) GetPages() *gtk.SelectionModelBase { | |||
| 271 | 286 | return cls | |
| 272 | 287 | } | |
| 273 | 288 | ||
| 289 | + | var xViewStackGetTransitionDuration func(uintptr) uint | |
| 290 | + | ||
| 291 | + | // Gets the transition animation duration for @self. | |
| 292 | + | func (x *ViewStack) GetTransitionDuration() uint { | |
| 293 | + | ||
| 294 | + | cret := xViewStackGetTransitionDuration(x.GoPointer()) | |
| 295 | + | return cret | |
| 296 | + | } | |
| 297 | + | ||
| 298 | + | var xViewStackGetTransitionRunning func(uintptr) bool | |
| 299 | + | ||
| 300 | + | // Gets whether a transition is currently running for @self. | |
| 301 | + | // | |
| 302 | + | // If a transition is impossible, the property value will be set to `TRUE` and | |
| 303 | + | // then immediately to `FALSE`, so it's possible to rely on its notifications | |
| 304 | + | // to know that a transition has happened. | |
| 305 | + | func (x *ViewStack) GetTransitionRunning() bool { | |
| 306 | + | ||
| 307 | + | cret := xViewStackGetTransitionRunning(x.GoPointer()) | |
| 308 | + | return cret | |
| 309 | + | } | |
| 310 | + | ||
| 274 | 311 | var xViewStackGetVhomogeneous func(uintptr) bool | |
| 275 | 312 | ||
| 276 | 313 | // Gets whether @self is vertically homogeneous. | |
| @@ -315,6 +352,15 @@ func (x *ViewStack) Remove(ChildVar *gtk.Widget) { | |||
| 315 | 352 | ||
| 316 | 353 | } | |
| 317 | 354 | ||
| 355 | + | var xViewStackSetEnableTransitions func(uintptr, bool) | |
| 356 | + | ||
| 357 | + | // Sets whether @self uses a crossfade transition between pages. | |
| 358 | + | func (x *ViewStack) SetEnableTransitions(EnableTransitionsVar bool) { | |
| 359 | + | ||
| 360 | + | xViewStackSetEnableTransitions(x.GoPointer(), EnableTransitionsVar) | |
| 361 | + | ||
| 362 | + | } | |
| 363 | + | ||
| 318 | 364 | var xViewStackSetHhomogeneous func(uintptr, bool) | |
| 319 | 365 | ||
| 320 | 366 | // Sets @self to be horizontally homogeneous or not. | |
| @@ -330,6 +376,17 @@ func (x *ViewStack) SetHhomogeneous(HhomogeneousVar bool) { | |||
| 330 | 376 | ||
| 331 | 377 | } | |
| 332 | 378 | ||
| 379 | + | var xViewStackSetTransitionDuration func(uintptr, uint) | |
| 380 | + | ||
| 381 | + | // Sets the transition animation duration for @self. | |
| 382 | + | // | |
| 383 | + | // Only used when [property@ViewStack:enable-transitions] is set to `TRUE`. | |
| 384 | + | func (x *ViewStack) SetTransitionDuration(DurationVar uint) { | |
| 385 | + | ||
| 386 | + | xViewStackSetTransitionDuration(x.GoPointer(), DurationVar) | |
| 387 | + | ||
| 388 | + | } | |
| 389 | + | ||
| 333 | 390 | var xViewStackSetVhomogeneous func(uintptr, bool) | |
| 334 | 391 | ||
| 335 | 392 | // Sets @self to be vertically homogeneous or not. | |
| @@ -376,34 +433,165 @@ func (c *ViewStack) SetGoPointer(ptr uintptr) { | |||
| 376 | 433 | c.Ptr = ptr | |
| 377 | 434 | } | |
| 378 | 435 | ||
| 379 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 436 | + | // Requests the user's screen reader to announce the given message. | |
| 437 | + | // | |
| 438 | + | // This kind of notification is useful for messages that | |
| 439 | + | // either have only a visual representation or that are not | |
| 440 | + | // exposed visually at all, e.g. a notification about a | |
| 441 | + | // successful operation. | |
| 442 | + | // | |
| 443 | + | // Also, by using this API, you can ensure that the message | |
| 444 | + | // does not interrupts the user's current screen reader output. | |
| 445 | + | func (x *ViewStack) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 446 | + | ||
| 447 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 448 | + | ||
| 449 | + | } | |
| 450 | + | ||
| 451 | + | // Retrieves the accessible parent for an accessible object. | |
| 452 | + | // | |
| 453 | + | // This function returns `NULL` for top level widgets. | |
| 454 | + | func (x *ViewStack) GetAccessibleParent() *gtk.AccessibleBase { | |
| 455 | + | var cls *gtk.AccessibleBase | |
| 456 | + | ||
| 457 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 458 | + | ||
| 459 | + | if cret == 0 { | |
| 460 | + | return nil | |
| 461 | + | } | |
| 462 | + | cls = >k.AccessibleBase{} | |
| 463 | + | cls.Ptr = cret | |
| 464 | + | return cls | |
| 465 | + | } | |
| 466 | + | ||
| 467 | + | // Retrieves the accessible role of an accessible object. | |
| 380 | 468 | func (x *ViewStack) GetAccessibleRole() gtk.AccessibleRole { | |
| 381 | 469 | ||
| 382 | 470 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 383 | 471 | return cret | |
| 384 | 472 | } | |
| 385 | 473 | ||
| 386 | - | // Resets the accessible @property to its default value. | |
| 474 | + | // Retrieves the implementation for the given accessible object. | |
| 475 | + | func (x *ViewStack) GetAtContext() *gtk.ATContext { | |
| 476 | + | var cls *gtk.ATContext | |
| 477 | + | ||
| 478 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 479 | + | ||
| 480 | + | if cret == 0 { | |
| 481 | + | return nil | |
| 482 | + | } | |
| 483 | + | cls = >k.ATContext{} | |
| 484 | + | cls.Ptr = cret | |
| 485 | + | return cls | |
| 486 | + | } | |
| 487 | + | ||
| 488 | + | // Queries the coordinates and dimensions of this accessible | |
| 489 | + | // | |
| 490 | + | // This functionality can be overridden by `GtkAccessible` | |
| 491 | + | // implementations, e.g. to get the bounds from an ignored | |
| 492 | + | // child widget. | |
| 493 | + | func (x *ViewStack) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 494 | + | ||
| 495 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 496 | + | return cret | |
| 497 | + | } | |
| 498 | + | ||
| 499 | + | // Retrieves the first accessible child of an accessible object. | |
| 500 | + | func (x *ViewStack) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 501 | + | var cls *gtk.AccessibleBase | |
| 502 | + | ||
| 503 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 504 | + | ||
| 505 | + | if cret == 0 { | |
| 506 | + | return nil | |
| 507 | + | } | |
| 508 | + | cls = >k.AccessibleBase{} | |
| 509 | + | cls.Ptr = cret | |
| 510 | + | return cls | |
| 511 | + | } | |
| 512 | + | ||
| 513 | + | // Retrieves the next accessible sibling of an accessible object | |
| 514 | + | func (x *ViewStack) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 515 | + | var cls *gtk.AccessibleBase | |
| 516 | + | ||
| 517 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 518 | + | ||
| 519 | + | if cret == 0 { | |
| 520 | + | return nil | |
| 521 | + | } | |
| 522 | + | cls = >k.AccessibleBase{} | |
| 523 | + | cls.Ptr = cret | |
| 524 | + | return cls | |
| 525 | + | } | |
| 526 | + | ||
| 527 | + | // Queries a platform state, such as focus. | |
| 528 | + | // | |
| 529 | + | // This functionality can be overridden by `GtkAccessible` | |
| 530 | + | // implementations, e.g. to get platform state from an ignored | |
| 531 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 532 | + | func (x *ViewStack) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 533 | + | ||
| 534 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 535 | + | return cret | |
| 536 | + | } | |
| 537 | + | ||
| 538 | + | // Resets the accessible property to its default value. | |
| 387 | 539 | func (x *ViewStack) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 388 | 540 | ||
| 389 | 541 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 390 | 542 | ||
| 391 | 543 | } | |
| 392 | 544 | ||
| 393 | - | // Resets the accessible @relation to its default value. | |
| 545 | + | // Resets the accessible relation to its default value. | |
| 394 | 546 | func (x *ViewStack) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 395 | 547 | ||
| 396 | 548 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 397 | 549 | ||
| 398 | 550 | } | |
| 399 | 551 | ||
| 400 | - | // Resets the accessible @state to its default value. | |
| 552 | + | // Resets the accessible state to its default value. | |
| 401 | 553 | func (x *ViewStack) ResetState(StateVar gtk.AccessibleState) { | |
| 402 | 554 | ||
| 403 | 555 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 404 | 556 | ||
| 405 | 557 | } | |
| 406 | 558 | ||
| 559 | + | // Sets the parent and sibling of an accessible object. | |
| 560 | + | // | |
| 561 | + | // This function is meant to be used by accessible implementations that are | |
| 562 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 563 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 564 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 565 | + | // interface, you will use this function to ensure that the parent of each | |
| 566 | + | // child widget is the metadata object, and the parent of each metadata | |
| 567 | + | // object is the container widget. | |
| 568 | + | func (x *ViewStack) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 569 | + | ||
| 570 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 571 | + | ||
| 572 | + | } | |
| 573 | + | ||
| 574 | + | // Updates the next accessible sibling. | |
| 575 | + | // | |
| 576 | + | // That might be useful when a new child of a custom accessible | |
| 577 | + | // is created, and it needs to be linked to a previous child. | |
| 578 | + | func (x *ViewStack) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 579 | + | ||
| 580 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 581 | + | ||
| 582 | + | } | |
| 583 | + | ||
| 584 | + | // Informs ATs that the platform state has changed. | |
| 585 | + | // | |
| 586 | + | // This function should be used by `GtkAccessible` implementations that | |
| 587 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 588 | + | // states automatically. | |
| 589 | + | func (x *ViewStack) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 590 | + | ||
| 591 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 592 | + | ||
| 593 | + | } | |
| 594 | + | ||
| 407 | 595 | // Updates a list of accessible properties. | |
| 408 | 596 | // | |
| 409 | 597 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -446,7 +634,7 @@ func (x *ViewStack) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk. | |||
| 446 | 634 | // relation change must be communicated to assistive technologies. | |
| 447 | 635 | // | |
| 448 | 636 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 449 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 637 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 450 | 638 | // | |
| 451 | 639 | // ```c | |
| 452 | 640 | // gtk_accessible_update_relation (accessible, | |
| @@ -476,13 +664,17 @@ func (x *ViewStack) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Ac | |||
| 476 | 664 | ||
| 477 | 665 | } | |
| 478 | 666 | ||
| 479 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 480 | - | // documentation for the value types of accessible states. | |
| 667 | + | // Updates a list of accessible states. | |
| 481 | 668 | // | |
| 482 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 483 | - | // state change must be communicated to assistive technologies. | |
| 669 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 670 | + | // value types of accessible states. | |
| 671 | + | // | |
| 672 | + | // This function should be called by `GtkWidget` types whenever | |
| 673 | + | // an accessible state change must be communicated to assistive | |
| 674 | + | // technologies. | |
| 484 | 675 | // | |
| 485 | 676 | // Example: | |
| 677 | + | // | |
| 486 | 678 | // ```c | |
| 487 | 679 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 488 | 680 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -512,7 +704,7 @@ func (x *ViewStack) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleS | |||
| 512 | 704 | // Gets the ID of the @buildable object. | |
| 513 | 705 | // | |
| 514 | 706 | // `GtkBuilder` sets the name based on the ID attribute | |
| 515 | - | // of the <object> tag used to construct the @buildable. | |
| 707 | + | // of the `<object>` tag used to construct the @buildable. | |
| 516 | 708 | func (x *ViewStack) GetBuildableId() string { | |
| 517 | 709 | ||
| 518 | 710 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -703,34 +895,165 @@ func (c *ViewStackPage) SetGoPointer(ptr uintptr) { | |||
| 703 | 895 | c.Ptr = ptr | |
| 704 | 896 | } | |
| 705 | 897 | ||
| 706 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 898 | + | // Requests the user's screen reader to announce the given message. | |
| 899 | + | // | |
| 900 | + | // This kind of notification is useful for messages that | |
| 901 | + | // either have only a visual representation or that are not | |
| 902 | + | // exposed visually at all, e.g. a notification about a | |
| 903 | + | // successful operation. | |
| 904 | + | // | |
| 905 | + | // Also, by using this API, you can ensure that the message | |
| 906 | + | // does not interrupts the user's current screen reader output. | |
| 907 | + | func (x *ViewStackPage) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 908 | + | ||
| 909 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 910 | + | ||
| 911 | + | } | |
| 912 | + | ||
| 913 | + | // Retrieves the accessible parent for an accessible object. | |
| 914 | + | // | |
| 915 | + | // This function returns `NULL` for top level widgets. | |
| 916 | + | func (x *ViewStackPage) GetAccessibleParent() *gtk.AccessibleBase { | |
| 917 | + | var cls *gtk.AccessibleBase | |
| 918 | + | ||
| 919 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 920 | + | ||
| 921 | + | if cret == 0 { | |
| 922 | + | return nil | |
| 923 | + | } | |
| 924 | + | cls = >k.AccessibleBase{} | |
| 925 | + | cls.Ptr = cret | |
| 926 | + | return cls | |
| 927 | + | } | |
| 928 | + | ||
| 929 | + | // Retrieves the accessible role of an accessible object. | |
| 707 | 930 | func (x *ViewStackPage) GetAccessibleRole() gtk.AccessibleRole { | |
| 708 | 931 | ||
| 709 | 932 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 710 | 933 | return cret | |
| 711 | 934 | } | |
| 712 | 935 | ||
| 713 | - | // Resets the accessible @property to its default value. | |
| 936 | + | // Retrieves the implementation for the given accessible object. | |
| 937 | + | func (x *ViewStackPage) GetAtContext() *gtk.ATContext { | |
| 938 | + | var cls *gtk.ATContext | |
| 939 | + | ||
| 940 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 941 | + | ||
| 942 | + | if cret == 0 { | |
| 943 | + | return nil | |
| 944 | + | } | |
| 945 | + | cls = >k.ATContext{} | |
| 946 | + | cls.Ptr = cret | |
| 947 | + | return cls | |
| 948 | + | } | |
| 949 | + | ||
| 950 | + | // Queries the coordinates and dimensions of this accessible | |
| 951 | + | // | |
| 952 | + | // This functionality can be overridden by `GtkAccessible` | |
| 953 | + | // implementations, e.g. to get the bounds from an ignored | |
| 954 | + | // child widget. | |
| 955 | + | func (x *ViewStackPage) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 956 | + | ||
| 957 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 958 | + | return cret | |
| 959 | + | } | |
| 960 | + | ||
| 961 | + | // Retrieves the first accessible child of an accessible object. | |
| 962 | + | func (x *ViewStackPage) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 963 | + | var cls *gtk.AccessibleBase | |
| 964 | + | ||
| 965 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 966 | + | ||
| 967 | + | if cret == 0 { | |
| 968 | + | return nil | |
| 969 | + | } | |
| 970 | + | cls = >k.AccessibleBase{} | |
| 971 | + | cls.Ptr = cret | |
| 972 | + | return cls | |
| 973 | + | } | |
| 974 | + | ||
| 975 | + | // Retrieves the next accessible sibling of an accessible object | |
| 976 | + | func (x *ViewStackPage) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 977 | + | var cls *gtk.AccessibleBase | |
| 978 | + | ||
| 979 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 980 | + | ||
| 981 | + | if cret == 0 { | |
| 982 | + | return nil | |
| 983 | + | } | |
| 984 | + | cls = >k.AccessibleBase{} | |
| 985 | + | cls.Ptr = cret | |
| 986 | + | return cls | |
| 987 | + | } | |
| 988 | + | ||
| 989 | + | // Queries a platform state, such as focus. | |
| 990 | + | // | |
| 991 | + | // This functionality can be overridden by `GtkAccessible` | |
| 992 | + | // implementations, e.g. to get platform state from an ignored | |
| 993 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 994 | + | func (x *ViewStackPage) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 995 | + | ||
| 996 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 997 | + | return cret | |
| 998 | + | } | |
| 999 | + | ||
| 1000 | + | // Resets the accessible property to its default value. | |
| 714 | 1001 | func (x *ViewStackPage) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 715 | 1002 | ||
| 716 | 1003 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 717 | 1004 | ||
| 718 | 1005 | } | |
| 719 | 1006 | ||
| 720 | - | // Resets the accessible @relation to its default value. | |
| 1007 | + | // Resets the accessible relation to its default value. | |
| 721 | 1008 | func (x *ViewStackPage) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 722 | 1009 | ||
| 723 | 1010 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 724 | 1011 | ||
| 725 | 1012 | } | |
| 726 | 1013 | ||
| 727 | - | // Resets the accessible @state to its default value. | |
| 1014 | + | // Resets the accessible state to its default value. | |
| 728 | 1015 | func (x *ViewStackPage) ResetState(StateVar gtk.AccessibleState) { | |
| 729 | 1016 | ||
| 730 | 1017 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 731 | 1018 | ||
| 732 | 1019 | } | |
| 733 | 1020 | ||
| 1021 | + | // Sets the parent and sibling of an accessible object. | |
| 1022 | + | // | |
| 1023 | + | // This function is meant to be used by accessible implementations that are | |
| 1024 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 1025 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 1026 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 1027 | + | // interface, you will use this function to ensure that the parent of each | |
| 1028 | + | // child widget is the metadata object, and the parent of each metadata | |
| 1029 | + | // object is the container widget. | |
| 1030 | + | func (x *ViewStackPage) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 1031 | + | ||
| 1032 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 1033 | + | ||
| 1034 | + | } | |
| 1035 | + | ||
| 1036 | + | // Updates the next accessible sibling. | |
| 1037 | + | // | |
| 1038 | + | // That might be useful when a new child of a custom accessible | |
| 1039 | + | // is created, and it needs to be linked to a previous child. | |
| 1040 | + | func (x *ViewStackPage) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 1041 | + | ||
| 1042 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 1043 | + | ||
| 1044 | + | } | |
| 1045 | + | ||
| 1046 | + | // Informs ATs that the platform state has changed. | |
| 1047 | + | // | |
| 1048 | + | // This function should be used by `GtkAccessible` implementations that | |
| 1049 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 1050 | + | // states automatically. | |
| 1051 | + | func (x *ViewStackPage) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 1052 | + | ||
| 1053 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 1054 | + | ||
| 1055 | + | } | |
| 1056 | + | ||
| 734 | 1057 | // Updates a list of accessible properties. | |
| 735 | 1058 | // | |
| 736 | 1059 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -773,7 +1096,7 @@ func (x *ViewStackPage) UpdatePropertyValue(NPropertiesVar int, PropertiesVar [] | |||
| 773 | 1096 | // relation change must be communicated to assistive technologies. | |
| 774 | 1097 | // | |
| 775 | 1098 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 776 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 1099 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 777 | 1100 | // | |
| 778 | 1101 | // ```c | |
| 779 | 1102 | // gtk_accessible_update_relation (accessible, | |
| @@ -803,13 +1126,17 @@ func (x *ViewStackPage) UpdateRelationValue(NRelationsVar int, RelationsVar []gt | |||
| 803 | 1126 | ||
| 804 | 1127 | } | |
| 805 | 1128 | ||
| 806 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 807 | - | // documentation for the value types of accessible states. | |
| 1129 | + | // Updates a list of accessible states. | |
| 808 | 1130 | // | |
| 809 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 810 | - | // state change must be communicated to assistive technologies. | |
| 1131 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 1132 | + | // value types of accessible states. | |
| 1133 | + | // | |
| 1134 | + | // This function should be called by `GtkWidget` types whenever | |
| 1135 | + | // an accessible state change must be communicated to assistive | |
| 1136 | + | // technologies. | |
| 811 | 1137 | // | |
| 812 | 1138 | // Example: | |
| 1139 | + | // | |
| 813 | 1140 | // ```c | |
| 814 | 1141 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 815 | 1142 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -1043,7 +1370,7 @@ func (x *ViewStackPages) SelectRange(PositionVar uint, NItemsVar uint, UnselectR | |||
| 1043 | 1370 | ||
| 1044 | 1371 | // Helper function for implementations of `GtkSelectionModel`. | |
| 1045 | 1372 | // | |
| 1046 | - | // Call this when a the selection changes to emit the | |
| 1373 | + | // Call this when the selection changes to emit the | |
| 1047 | 1374 | // [signal@Gtk.SelectionModel::selection-changed] signal. | |
| 1048 | 1375 | func (x *ViewStackPages) SelectionChanged(PositionVar uint, NItemsVar uint) { | |
| 1049 | 1376 | ||
| @@ -1131,14 +1458,19 @@ func init() { | |||
| 1131 | 1458 | core.PuregoSafeRegister(&xViewStackAddTitled, lib, "adw_view_stack_add_titled") | |
| 1132 | 1459 | core.PuregoSafeRegister(&xViewStackAddTitledWithIcon, lib, "adw_view_stack_add_titled_with_icon") | |
| 1133 | 1460 | core.PuregoSafeRegister(&xViewStackGetChildByName, lib, "adw_view_stack_get_child_by_name") | |
| 1461 | + | core.PuregoSafeRegister(&xViewStackGetEnableTransitions, lib, "adw_view_stack_get_enable_transitions") | |
| 1134 | 1462 | core.PuregoSafeRegister(&xViewStackGetHhomogeneous, lib, "adw_view_stack_get_hhomogeneous") | |
| 1135 | 1463 | core.PuregoSafeRegister(&xViewStackGetPage, lib, "adw_view_stack_get_page") | |
| 1136 | 1464 | core.PuregoSafeRegister(&xViewStackGetPages, lib, "adw_view_stack_get_pages") | |
| 1465 | + | core.PuregoSafeRegister(&xViewStackGetTransitionDuration, lib, "adw_view_stack_get_transition_duration") | |
| 1466 | + | core.PuregoSafeRegister(&xViewStackGetTransitionRunning, lib, "adw_view_stack_get_transition_running") | |
| 1137 | 1467 | core.PuregoSafeRegister(&xViewStackGetVhomogeneous, lib, "adw_view_stack_get_vhomogeneous") | |
| 1138 | 1468 | core.PuregoSafeRegister(&xViewStackGetVisibleChild, lib, "adw_view_stack_get_visible_child") | |
| 1139 | 1469 | core.PuregoSafeRegister(&xViewStackGetVisibleChildName, lib, "adw_view_stack_get_visible_child_name") | |
| 1140 | 1470 | core.PuregoSafeRegister(&xViewStackRemove, lib, "adw_view_stack_remove") | |
| 1471 | + | core.PuregoSafeRegister(&xViewStackSetEnableTransitions, lib, "adw_view_stack_set_enable_transitions") | |
| 1141 | 1472 | core.PuregoSafeRegister(&xViewStackSetHhomogeneous, lib, "adw_view_stack_set_hhomogeneous") | |
| 1473 | + | core.PuregoSafeRegister(&xViewStackSetTransitionDuration, lib, "adw_view_stack_set_transition_duration") | |
| 1142 | 1474 | core.PuregoSafeRegister(&xViewStackSetVhomogeneous, lib, "adw_view_stack_set_vhomogeneous") | |
| 1143 | 1475 | core.PuregoSafeRegister(&xViewStackSetVisibleChild, lib, "adw_view_stack_set_visible_child") | |
| 1144 | 1476 | core.PuregoSafeRegister(&xViewStackSetVisibleChildName, lib, "adw_view_stack_set_visible_child_name") | |
M v4/adw/adw-view-switcher-bar.go +145 -10
| @@ -173,34 +173,165 @@ func (c *ViewSwitcherBar) SetGoPointer(ptr uintptr) { | |||
| 173 | 173 | c.Ptr = ptr | |
| 174 | 174 | } | |
| 175 | 175 | ||
| 176 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 176 | + | // Requests the user's screen reader to announce the given message. | |
| 177 | + | // | |
| 178 | + | // This kind of notification is useful for messages that | |
| 179 | + | // either have only a visual representation or that are not | |
| 180 | + | // exposed visually at all, e.g. a notification about a | |
| 181 | + | // successful operation. | |
| 182 | + | // | |
| 183 | + | // Also, by using this API, you can ensure that the message | |
| 184 | + | // does not interrupts the user's current screen reader output. | |
| 185 | + | func (x *ViewSwitcherBar) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 186 | + | ||
| 187 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 188 | + | ||
| 189 | + | } | |
| 190 | + | ||
| 191 | + | // Retrieves the accessible parent for an accessible object. | |
| 192 | + | // | |
| 193 | + | // This function returns `NULL` for top level widgets. | |
| 194 | + | func (x *ViewSwitcherBar) GetAccessibleParent() *gtk.AccessibleBase { | |
| 195 | + | var cls *gtk.AccessibleBase | |
| 196 | + | ||
| 197 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 198 | + | ||
| 199 | + | if cret == 0 { | |
| 200 | + | return nil | |
| 201 | + | } | |
| 202 | + | cls = >k.AccessibleBase{} | |
| 203 | + | cls.Ptr = cret | |
| 204 | + | return cls | |
| 205 | + | } | |
| 206 | + | ||
| 207 | + | // Retrieves the accessible role of an accessible object. | |
| 177 | 208 | func (x *ViewSwitcherBar) GetAccessibleRole() gtk.AccessibleRole { | |
| 178 | 209 | ||
| 179 | 210 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 180 | 211 | return cret | |
| 181 | 212 | } | |
| 182 | 213 | ||
| 183 | - | // Resets the accessible @property to its default value. | |
| 214 | + | // Retrieves the implementation for the given accessible object. | |
| 215 | + | func (x *ViewSwitcherBar) GetAtContext() *gtk.ATContext { | |
| 216 | + | var cls *gtk.ATContext | |
| 217 | + | ||
| 218 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 219 | + | ||
| 220 | + | if cret == 0 { | |
| 221 | + | return nil | |
| 222 | + | } | |
| 223 | + | cls = >k.ATContext{} | |
| 224 | + | cls.Ptr = cret | |
| 225 | + | return cls | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | // Queries the coordinates and dimensions of this accessible | |
| 229 | + | // | |
| 230 | + | // This functionality can be overridden by `GtkAccessible` | |
| 231 | + | // implementations, e.g. to get the bounds from an ignored | |
| 232 | + | // child widget. | |
| 233 | + | func (x *ViewSwitcherBar) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 234 | + | ||
| 235 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 236 | + | return cret | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | // Retrieves the first accessible child of an accessible object. | |
| 240 | + | func (x *ViewSwitcherBar) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 241 | + | var cls *gtk.AccessibleBase | |
| 242 | + | ||
| 243 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 244 | + | ||
| 245 | + | if cret == 0 { | |
| 246 | + | return nil | |
| 247 | + | } | |
| 248 | + | cls = >k.AccessibleBase{} | |
| 249 | + | cls.Ptr = cret | |
| 250 | + | return cls | |
| 251 | + | } | |
| 252 | + | ||
| 253 | + | // Retrieves the next accessible sibling of an accessible object | |
| 254 | + | func (x *ViewSwitcherBar) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 255 | + | var cls *gtk.AccessibleBase | |
| 256 | + | ||
| 257 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 258 | + | ||
| 259 | + | if cret == 0 { | |
| 260 | + | return nil | |
| 261 | + | } | |
| 262 | + | cls = >k.AccessibleBase{} | |
| 263 | + | cls.Ptr = cret | |
| 264 | + | return cls | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // Queries a platform state, such as focus. | |
| 268 | + | // | |
| 269 | + | // This functionality can be overridden by `GtkAccessible` | |
| 270 | + | // implementations, e.g. to get platform state from an ignored | |
| 271 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 272 | + | func (x *ViewSwitcherBar) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 273 | + | ||
| 274 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 275 | + | return cret | |
| 276 | + | } | |
| 277 | + | ||
| 278 | + | // Resets the accessible property to its default value. | |
| 184 | 279 | func (x *ViewSwitcherBar) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 185 | 280 | ||
| 186 | 281 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 187 | 282 | ||
| 188 | 283 | } | |
| 189 | 284 | ||
| 190 | - | // Resets the accessible @relation to its default value. | |
| 285 | + | // Resets the accessible relation to its default value. | |
| 191 | 286 | func (x *ViewSwitcherBar) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 192 | 287 | ||
| 193 | 288 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 194 | 289 | ||
| 195 | 290 | } | |
| 196 | 291 | ||
| 197 | - | // Resets the accessible @state to its default value. | |
| 292 | + | // Resets the accessible state to its default value. | |
| 198 | 293 | func (x *ViewSwitcherBar) ResetState(StateVar gtk.AccessibleState) { | |
| 199 | 294 | ||
| 200 | 295 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 201 | 296 | ||
| 202 | 297 | } | |
| 203 | 298 | ||
| 299 | + | // Sets the parent and sibling of an accessible object. | |
| 300 | + | // | |
| 301 | + | // This function is meant to be used by accessible implementations that are | |
| 302 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 303 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 304 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 305 | + | // interface, you will use this function to ensure that the parent of each | |
| 306 | + | // child widget is the metadata object, and the parent of each metadata | |
| 307 | + | // object is the container widget. | |
| 308 | + | func (x *ViewSwitcherBar) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 309 | + | ||
| 310 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 311 | + | ||
| 312 | + | } | |
| 313 | + | ||
| 314 | + | // Updates the next accessible sibling. | |
| 315 | + | // | |
| 316 | + | // That might be useful when a new child of a custom accessible | |
| 317 | + | // is created, and it needs to be linked to a previous child. | |
| 318 | + | func (x *ViewSwitcherBar) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 319 | + | ||
| 320 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 321 | + | ||
| 322 | + | } | |
| 323 | + | ||
| 324 | + | // Informs ATs that the platform state has changed. | |
| 325 | + | // | |
| 326 | + | // This function should be used by `GtkAccessible` implementations that | |
| 327 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 328 | + | // states automatically. | |
| 329 | + | func (x *ViewSwitcherBar) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 330 | + | ||
| 331 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 204 | 335 | // Updates a list of accessible properties. | |
| 205 | 336 | // | |
| 206 | 337 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -243,7 +374,7 @@ func (x *ViewSwitcherBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar | |||
| 243 | 374 | // relation change must be communicated to assistive technologies. | |
| 244 | 375 | // | |
| 245 | 376 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 246 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 377 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 247 | 378 | // | |
| 248 | 379 | // ```c | |
| 249 | 380 | // gtk_accessible_update_relation (accessible, | |
| @@ -273,13 +404,17 @@ func (x *ViewSwitcherBar) UpdateRelationValue(NRelationsVar int, RelationsVar [] | |||
| 273 | 404 | ||
| 274 | 405 | } | |
| 275 | 406 | ||
| 276 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 277 | - | // documentation for the value types of accessible states. | |
| 407 | + | // Updates a list of accessible states. | |
| 278 | 408 | // | |
| 279 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 280 | - | // state change must be communicated to assistive technologies. | |
| 409 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 410 | + | // value types of accessible states. | |
| 411 | + | // | |
| 412 | + | // This function should be called by `GtkWidget` types whenever | |
| 413 | + | // an accessible state change must be communicated to assistive | |
| 414 | + | // technologies. | |
| 281 | 415 | // | |
| 282 | 416 | // Example: | |
| 417 | + | // | |
| 283 | 418 | // ```c | |
| 284 | 419 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 285 | 420 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -309,7 +444,7 @@ func (x *ViewSwitcherBar) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acces | |||
| 309 | 444 | // Gets the ID of the @buildable object. | |
| 310 | 445 | // | |
| 311 | 446 | // `GtkBuilder` sets the name based on the ID attribute | |
| 312 | - | // of the <object> tag used to construct the @buildable. | |
| 447 | + | // of the `<object>` tag used to construct the @buildable. | |
| 313 | 448 | func (x *ViewSwitcherBar) GetBuildableId() string { | |
| 314 | 449 | ||
| 315 | 450 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-view-switcher-title.go +145 -10
| @@ -233,34 +233,165 @@ func (c *ViewSwitcherTitle) SetGoPointer(ptr uintptr) { | |||
| 233 | 233 | c.Ptr = ptr | |
| 234 | 234 | } | |
| 235 | 235 | ||
| 236 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 236 | + | // Requests the user's screen reader to announce the given message. | |
| 237 | + | // | |
| 238 | + | // This kind of notification is useful for messages that | |
| 239 | + | // either have only a visual representation or that are not | |
| 240 | + | // exposed visually at all, e.g. a notification about a | |
| 241 | + | // successful operation. | |
| 242 | + | // | |
| 243 | + | // Also, by using this API, you can ensure that the message | |
| 244 | + | // does not interrupts the user's current screen reader output. | |
| 245 | + | func (x *ViewSwitcherTitle) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 246 | + | ||
| 247 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 248 | + | ||
| 249 | + | } | |
| 250 | + | ||
| 251 | + | // Retrieves the accessible parent for an accessible object. | |
| 252 | + | // | |
| 253 | + | // This function returns `NULL` for top level widgets. | |
| 254 | + | func (x *ViewSwitcherTitle) GetAccessibleParent() *gtk.AccessibleBase { | |
| 255 | + | var cls *gtk.AccessibleBase | |
| 256 | + | ||
| 257 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 258 | + | ||
| 259 | + | if cret == 0 { | |
| 260 | + | return nil | |
| 261 | + | } | |
| 262 | + | cls = >k.AccessibleBase{} | |
| 263 | + | cls.Ptr = cret | |
| 264 | + | return cls | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | // Retrieves the accessible role of an accessible object. | |
| 237 | 268 | func (x *ViewSwitcherTitle) GetAccessibleRole() gtk.AccessibleRole { | |
| 238 | 269 | ||
| 239 | 270 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 240 | 271 | return cret | |
| 241 | 272 | } | |
| 242 | 273 | ||
| 243 | - | // Resets the accessible @property to its default value. | |
| 274 | + | // Retrieves the implementation for the given accessible object. | |
| 275 | + | func (x *ViewSwitcherTitle) GetAtContext() *gtk.ATContext { | |
| 276 | + | var cls *gtk.ATContext | |
| 277 | + | ||
| 278 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 279 | + | ||
| 280 | + | if cret == 0 { | |
| 281 | + | return nil | |
| 282 | + | } | |
| 283 | + | cls = >k.ATContext{} | |
| 284 | + | cls.Ptr = cret | |
| 285 | + | return cls | |
| 286 | + | } | |
| 287 | + | ||
| 288 | + | // Queries the coordinates and dimensions of this accessible | |
| 289 | + | // | |
| 290 | + | // This functionality can be overridden by `GtkAccessible` | |
| 291 | + | // implementations, e.g. to get the bounds from an ignored | |
| 292 | + | // child widget. | |
| 293 | + | func (x *ViewSwitcherTitle) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 294 | + | ||
| 295 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 296 | + | return cret | |
| 297 | + | } | |
| 298 | + | ||
| 299 | + | // Retrieves the first accessible child of an accessible object. | |
| 300 | + | func (x *ViewSwitcherTitle) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 301 | + | var cls *gtk.AccessibleBase | |
| 302 | + | ||
| 303 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 304 | + | ||
| 305 | + | if cret == 0 { | |
| 306 | + | return nil | |
| 307 | + | } | |
| 308 | + | cls = >k.AccessibleBase{} | |
| 309 | + | cls.Ptr = cret | |
| 310 | + | return cls | |
| 311 | + | } | |
| 312 | + | ||
| 313 | + | // Retrieves the next accessible sibling of an accessible object | |
| 314 | + | func (x *ViewSwitcherTitle) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 315 | + | var cls *gtk.AccessibleBase | |
| 316 | + | ||
| 317 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 318 | + | ||
| 319 | + | if cret == 0 { | |
| 320 | + | return nil | |
| 321 | + | } | |
| 322 | + | cls = >k.AccessibleBase{} | |
| 323 | + | cls.Ptr = cret | |
| 324 | + | return cls | |
| 325 | + | } | |
| 326 | + | ||
| 327 | + | // Queries a platform state, such as focus. | |
| 328 | + | // | |
| 329 | + | // This functionality can be overridden by `GtkAccessible` | |
| 330 | + | // implementations, e.g. to get platform state from an ignored | |
| 331 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 332 | + | func (x *ViewSwitcherTitle) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 333 | + | ||
| 334 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 335 | + | return cret | |
| 336 | + | } | |
| 337 | + | ||
| 338 | + | // Resets the accessible property to its default value. | |
| 244 | 339 | func (x *ViewSwitcherTitle) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 245 | 340 | ||
| 246 | 341 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 247 | 342 | ||
| 248 | 343 | } | |
| 249 | 344 | ||
| 250 | - | // Resets the accessible @relation to its default value. | |
| 345 | + | // Resets the accessible relation to its default value. | |
| 251 | 346 | func (x *ViewSwitcherTitle) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 252 | 347 | ||
| 253 | 348 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 254 | 349 | ||
| 255 | 350 | } | |
| 256 | 351 | ||
| 257 | - | // Resets the accessible @state to its default value. | |
| 352 | + | // Resets the accessible state to its default value. | |
| 258 | 353 | func (x *ViewSwitcherTitle) ResetState(StateVar gtk.AccessibleState) { | |
| 259 | 354 | ||
| 260 | 355 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 261 | 356 | ||
| 262 | 357 | } | |
| 263 | 358 | ||
| 359 | + | // Sets the parent and sibling of an accessible object. | |
| 360 | + | // | |
| 361 | + | // This function is meant to be used by accessible implementations that are | |
| 362 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 363 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 364 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 365 | + | // interface, you will use this function to ensure that the parent of each | |
| 366 | + | // child widget is the metadata object, and the parent of each metadata | |
| 367 | + | // object is the container widget. | |
| 368 | + | func (x *ViewSwitcherTitle) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 369 | + | ||
| 370 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 371 | + | ||
| 372 | + | } | |
| 373 | + | ||
| 374 | + | // Updates the next accessible sibling. | |
| 375 | + | // | |
| 376 | + | // That might be useful when a new child of a custom accessible | |
| 377 | + | // is created, and it needs to be linked to a previous child. | |
| 378 | + | func (x *ViewSwitcherTitle) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 379 | + | ||
| 380 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 381 | + | ||
| 382 | + | } | |
| 383 | + | ||
| 384 | + | // Informs ATs that the platform state has changed. | |
| 385 | + | // | |
| 386 | + | // This function should be used by `GtkAccessible` implementations that | |
| 387 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 388 | + | // states automatically. | |
| 389 | + | func (x *ViewSwitcherTitle) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 390 | + | ||
| 391 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 392 | + | ||
| 393 | + | } | |
| 394 | + | ||
| 264 | 395 | // Updates a list of accessible properties. | |
| 265 | 396 | // | |
| 266 | 397 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -303,7 +434,7 @@ func (x *ViewSwitcherTitle) UpdatePropertyValue(NPropertiesVar int, PropertiesVa | |||
| 303 | 434 | // relation change must be communicated to assistive technologies. | |
| 304 | 435 | // | |
| 305 | 436 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 306 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 437 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 307 | 438 | // | |
| 308 | 439 | // ```c | |
| 309 | 440 | // gtk_accessible_update_relation (accessible, | |
| @@ -333,13 +464,17 @@ func (x *ViewSwitcherTitle) UpdateRelationValue(NRelationsVar int, RelationsVar | |||
| 333 | 464 | ||
| 334 | 465 | } | |
| 335 | 466 | ||
| 336 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 337 | - | // documentation for the value types of accessible states. | |
| 467 | + | // Updates a list of accessible states. | |
| 338 | 468 | // | |
| 339 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 340 | - | // state change must be communicated to assistive technologies. | |
| 469 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 470 | + | // value types of accessible states. | |
| 471 | + | // | |
| 472 | + | // This function should be called by `GtkWidget` types whenever | |
| 473 | + | // an accessible state change must be communicated to assistive | |
| 474 | + | // technologies. | |
| 341 | 475 | // | |
| 342 | 476 | // Example: | |
| 477 | + | // | |
| 343 | 478 | // ```c | |
| 344 | 479 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 345 | 480 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -369,7 +504,7 @@ func (x *ViewSwitcherTitle) UpdateStateValue(NStatesVar int, StatesVar []gtk.Acc | |||
| 369 | 504 | // Gets the ID of the @buildable object. | |
| 370 | 505 | // | |
| 371 | 506 | // `GtkBuilder` sets the name based on the ID attribute | |
| 372 | - | // of the <object> tag used to construct the @buildable. | |
| 507 | + | // of the `<object>` tag used to construct the @buildable. | |
| 373 | 508 | func (x *ViewSwitcherTitle) GetBuildableId() string { | |
| 374 | 509 | ||
| 375 | 510 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-view-switcher.go +145 -10
| @@ -199,34 +199,165 @@ func (c *ViewSwitcher) SetGoPointer(ptr uintptr) { | |||
| 199 | 199 | c.Ptr = ptr | |
| 200 | 200 | } | |
| 201 | 201 | ||
| 202 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 202 | + | // Requests the user's screen reader to announce the given message. | |
| 203 | + | // | |
| 204 | + | // This kind of notification is useful for messages that | |
| 205 | + | // either have only a visual representation or that are not | |
| 206 | + | // exposed visually at all, e.g. a notification about a | |
| 207 | + | // successful operation. | |
| 208 | + | // | |
| 209 | + | // Also, by using this API, you can ensure that the message | |
| 210 | + | // does not interrupts the user's current screen reader output. | |
| 211 | + | func (x *ViewSwitcher) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 212 | + | ||
| 213 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 214 | + | ||
| 215 | + | } | |
| 216 | + | ||
| 217 | + | // Retrieves the accessible parent for an accessible object. | |
| 218 | + | // | |
| 219 | + | // This function returns `NULL` for top level widgets. | |
| 220 | + | func (x *ViewSwitcher) GetAccessibleParent() *gtk.AccessibleBase { | |
| 221 | + | var cls *gtk.AccessibleBase | |
| 222 | + | ||
| 223 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 224 | + | ||
| 225 | + | if cret == 0 { | |
| 226 | + | return nil | |
| 227 | + | } | |
| 228 | + | cls = >k.AccessibleBase{} | |
| 229 | + | cls.Ptr = cret | |
| 230 | + | return cls | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | // Retrieves the accessible role of an accessible object. | |
| 203 | 234 | func (x *ViewSwitcher) GetAccessibleRole() gtk.AccessibleRole { | |
| 204 | 235 | ||
| 205 | 236 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 206 | 237 | return cret | |
| 207 | 238 | } | |
| 208 | 239 | ||
| 209 | - | // Resets the accessible @property to its default value. | |
| 240 | + | // Retrieves the implementation for the given accessible object. | |
| 241 | + | func (x *ViewSwitcher) GetAtContext() *gtk.ATContext { | |
| 242 | + | var cls *gtk.ATContext | |
| 243 | + | ||
| 244 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 245 | + | ||
| 246 | + | if cret == 0 { | |
| 247 | + | return nil | |
| 248 | + | } | |
| 249 | + | cls = >k.ATContext{} | |
| 250 | + | cls.Ptr = cret | |
| 251 | + | return cls | |
| 252 | + | } | |
| 253 | + | ||
| 254 | + | // Queries the coordinates and dimensions of this accessible | |
| 255 | + | // | |
| 256 | + | // This functionality can be overridden by `GtkAccessible` | |
| 257 | + | // implementations, e.g. to get the bounds from an ignored | |
| 258 | + | // child widget. | |
| 259 | + | func (x *ViewSwitcher) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 260 | + | ||
| 261 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 262 | + | return cret | |
| 263 | + | } | |
| 264 | + | ||
| 265 | + | // Retrieves the first accessible child of an accessible object. | |
| 266 | + | func (x *ViewSwitcher) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 267 | + | var cls *gtk.AccessibleBase | |
| 268 | + | ||
| 269 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 270 | + | ||
| 271 | + | if cret == 0 { | |
| 272 | + | return nil | |
| 273 | + | } | |
| 274 | + | cls = >k.AccessibleBase{} | |
| 275 | + | cls.Ptr = cret | |
| 276 | + | return cls | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | // Retrieves the next accessible sibling of an accessible object | |
| 280 | + | func (x *ViewSwitcher) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 281 | + | var cls *gtk.AccessibleBase | |
| 282 | + | ||
| 283 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 284 | + | ||
| 285 | + | if cret == 0 { | |
| 286 | + | return nil | |
| 287 | + | } | |
| 288 | + | cls = >k.AccessibleBase{} | |
| 289 | + | cls.Ptr = cret | |
| 290 | + | return cls | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | // Queries a platform state, such as focus. | |
| 294 | + | // | |
| 295 | + | // This functionality can be overridden by `GtkAccessible` | |
| 296 | + | // implementations, e.g. to get platform state from an ignored | |
| 297 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 298 | + | func (x *ViewSwitcher) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 299 | + | ||
| 300 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 301 | + | return cret | |
| 302 | + | } | |
| 303 | + | ||
| 304 | + | // Resets the accessible property to its default value. | |
| 210 | 305 | func (x *ViewSwitcher) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 211 | 306 | ||
| 212 | 307 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 213 | 308 | ||
| 214 | 309 | } | |
| 215 | 310 | ||
| 216 | - | // Resets the accessible @relation to its default value. | |
| 311 | + | // Resets the accessible relation to its default value. | |
| 217 | 312 | func (x *ViewSwitcher) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 218 | 313 | ||
| 219 | 314 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 220 | 315 | ||
| 221 | 316 | } | |
| 222 | 317 | ||
| 223 | - | // Resets the accessible @state to its default value. | |
| 318 | + | // Resets the accessible state to its default value. | |
| 224 | 319 | func (x *ViewSwitcher) ResetState(StateVar gtk.AccessibleState) { | |
| 225 | 320 | ||
| 226 | 321 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 227 | 322 | ||
| 228 | 323 | } | |
| 229 | 324 | ||
| 325 | + | // Sets the parent and sibling of an accessible object. | |
| 326 | + | // | |
| 327 | + | // This function is meant to be used by accessible implementations that are | |
| 328 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 329 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 330 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 331 | + | // interface, you will use this function to ensure that the parent of each | |
| 332 | + | // child widget is the metadata object, and the parent of each metadata | |
| 333 | + | // object is the container widget. | |
| 334 | + | func (x *ViewSwitcher) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 335 | + | ||
| 336 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 337 | + | ||
| 338 | + | } | |
| 339 | + | ||
| 340 | + | // Updates the next accessible sibling. | |
| 341 | + | // | |
| 342 | + | // That might be useful when a new child of a custom accessible | |
| 343 | + | // is created, and it needs to be linked to a previous child. | |
| 344 | + | func (x *ViewSwitcher) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 345 | + | ||
| 346 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 347 | + | ||
| 348 | + | } | |
| 349 | + | ||
| 350 | + | // Informs ATs that the platform state has changed. | |
| 351 | + | // | |
| 352 | + | // This function should be used by `GtkAccessible` implementations that | |
| 353 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 354 | + | // states automatically. | |
| 355 | + | func (x *ViewSwitcher) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 356 | + | ||
| 357 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 358 | + | ||
| 359 | + | } | |
| 360 | + | ||
| 230 | 361 | // Updates a list of accessible properties. | |
| 231 | 362 | // | |
| 232 | 363 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -269,7 +400,7 @@ func (x *ViewSwitcher) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []g | |||
| 269 | 400 | // relation change must be communicated to assistive technologies. | |
| 270 | 401 | // | |
| 271 | 402 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 272 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 403 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 273 | 404 | // | |
| 274 | 405 | // ```c | |
| 275 | 406 | // gtk_accessible_update_relation (accessible, | |
| @@ -299,13 +430,17 @@ func (x *ViewSwitcher) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk | |||
| 299 | 430 | ||
| 300 | 431 | } | |
| 301 | 432 | ||
| 302 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 303 | - | // documentation for the value types of accessible states. | |
| 433 | + | // Updates a list of accessible states. | |
| 304 | 434 | // | |
| 305 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 306 | - | // state change must be communicated to assistive technologies. | |
| 435 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 436 | + | // value types of accessible states. | |
| 437 | + | // | |
| 438 | + | // This function should be called by `GtkWidget` types whenever | |
| 439 | + | // an accessible state change must be communicated to assistive | |
| 440 | + | // technologies. | |
| 307 | 441 | // | |
| 308 | 442 | // Example: | |
| 443 | + | // | |
| 309 | 444 | // ```c | |
| 310 | 445 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 311 | 446 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -335,7 +470,7 @@ func (x *ViewSwitcher) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessib | |||
| 335 | 470 | // Gets the ID of the @buildable object. | |
| 336 | 471 | // | |
| 337 | 472 | // `GtkBuilder` sets the name based on the ID attribute | |
| 338 | - | // of the <object> tag used to construct the @buildable. | |
| 473 | + | // of the `<object>` tag used to construct the @buildable. | |
| 339 | 474 | func (x *ViewSwitcher) GetBuildableId() string { | |
| 340 | 475 | ||
| 341 | 476 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-window-title.go +145 -10
| @@ -122,34 +122,165 @@ func (c *WindowTitle) SetGoPointer(ptr uintptr) { | |||
| 122 | 122 | c.Ptr = ptr | |
| 123 | 123 | } | |
| 124 | 124 | ||
| 125 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 125 | + | // Requests the user's screen reader to announce the given message. | |
| 126 | + | // | |
| 127 | + | // This kind of notification is useful for messages that | |
| 128 | + | // either have only a visual representation or that are not | |
| 129 | + | // exposed visually at all, e.g. a notification about a | |
| 130 | + | // successful operation. | |
| 131 | + | // | |
| 132 | + | // Also, by using this API, you can ensure that the message | |
| 133 | + | // does not interrupts the user's current screen reader output. | |
| 134 | + | func (x *WindowTitle) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 135 | + | ||
| 136 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 137 | + | ||
| 138 | + | } | |
| 139 | + | ||
| 140 | + | // Retrieves the accessible parent for an accessible object. | |
| 141 | + | // | |
| 142 | + | // This function returns `NULL` for top level widgets. | |
| 143 | + | func (x *WindowTitle) GetAccessibleParent() *gtk.AccessibleBase { | |
| 144 | + | var cls *gtk.AccessibleBase | |
| 145 | + | ||
| 146 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 147 | + | ||
| 148 | + | if cret == 0 { | |
| 149 | + | return nil | |
| 150 | + | } | |
| 151 | + | cls = >k.AccessibleBase{} | |
| 152 | + | cls.Ptr = cret | |
| 153 | + | return cls | |
| 154 | + | } | |
| 155 | + | ||
| 156 | + | // Retrieves the accessible role of an accessible object. | |
| 126 | 157 | func (x *WindowTitle) GetAccessibleRole() gtk.AccessibleRole { | |
| 127 | 158 | ||
| 128 | 159 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 129 | 160 | return cret | |
| 130 | 161 | } | |
| 131 | 162 | ||
| 132 | - | // Resets the accessible @property to its default value. | |
| 163 | + | // Retrieves the implementation for the given accessible object. | |
| 164 | + | func (x *WindowTitle) GetAtContext() *gtk.ATContext { | |
| 165 | + | var cls *gtk.ATContext | |
| 166 | + | ||
| 167 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 168 | + | ||
| 169 | + | if cret == 0 { | |
| 170 | + | return nil | |
| 171 | + | } | |
| 172 | + | cls = >k.ATContext{} | |
| 173 | + | cls.Ptr = cret | |
| 174 | + | return cls | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | // Queries the coordinates and dimensions of this accessible | |
| 178 | + | // | |
| 179 | + | // This functionality can be overridden by `GtkAccessible` | |
| 180 | + | // implementations, e.g. to get the bounds from an ignored | |
| 181 | + | // child widget. | |
| 182 | + | func (x *WindowTitle) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 183 | + | ||
| 184 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 185 | + | return cret | |
| 186 | + | } | |
| 187 | + | ||
| 188 | + | // Retrieves the first accessible child of an accessible object. | |
| 189 | + | func (x *WindowTitle) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 190 | + | var cls *gtk.AccessibleBase | |
| 191 | + | ||
| 192 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 193 | + | ||
| 194 | + | if cret == 0 { | |
| 195 | + | return nil | |
| 196 | + | } | |
| 197 | + | cls = >k.AccessibleBase{} | |
| 198 | + | cls.Ptr = cret | |
| 199 | + | return cls | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | // Retrieves the next accessible sibling of an accessible object | |
| 203 | + | func (x *WindowTitle) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 204 | + | var cls *gtk.AccessibleBase | |
| 205 | + | ||
| 206 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 207 | + | ||
| 208 | + | if cret == 0 { | |
| 209 | + | return nil | |
| 210 | + | } | |
| 211 | + | cls = >k.AccessibleBase{} | |
| 212 | + | cls.Ptr = cret | |
| 213 | + | return cls | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | // Queries a platform state, such as focus. | |
| 217 | + | // | |
| 218 | + | // This functionality can be overridden by `GtkAccessible` | |
| 219 | + | // implementations, e.g. to get platform state from an ignored | |
| 220 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 221 | + | func (x *WindowTitle) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 222 | + | ||
| 223 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 224 | + | return cret | |
| 225 | + | } | |
| 226 | + | ||
| 227 | + | // Resets the accessible property to its default value. | |
| 133 | 228 | func (x *WindowTitle) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 134 | 229 | ||
| 135 | 230 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 136 | 231 | ||
| 137 | 232 | } | |
| 138 | 233 | ||
| 139 | - | // Resets the accessible @relation to its default value. | |
| 234 | + | // Resets the accessible relation to its default value. | |
| 140 | 235 | func (x *WindowTitle) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 141 | 236 | ||
| 142 | 237 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 143 | 238 | ||
| 144 | 239 | } | |
| 145 | 240 | ||
| 146 | - | // Resets the accessible @state to its default value. | |
| 241 | + | // Resets the accessible state to its default value. | |
| 147 | 242 | func (x *WindowTitle) ResetState(StateVar gtk.AccessibleState) { | |
| 148 | 243 | ||
| 149 | 244 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 150 | 245 | ||
| 151 | 246 | } | |
| 152 | 247 | ||
| 248 | + | // Sets the parent and sibling of an accessible object. | |
| 249 | + | // | |
| 250 | + | // This function is meant to be used by accessible implementations that are | |
| 251 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 252 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 253 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 254 | + | // interface, you will use this function to ensure that the parent of each | |
| 255 | + | // child widget is the metadata object, and the parent of each metadata | |
| 256 | + | // object is the container widget. | |
| 257 | + | func (x *WindowTitle) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 258 | + | ||
| 259 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 260 | + | ||
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // Updates the next accessible sibling. | |
| 264 | + | // | |
| 265 | + | // That might be useful when a new child of a custom accessible | |
| 266 | + | // is created, and it needs to be linked to a previous child. | |
| 267 | + | func (x *WindowTitle) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 268 | + | ||
| 269 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 270 | + | ||
| 271 | + | } | |
| 272 | + | ||
| 273 | + | // Informs ATs that the platform state has changed. | |
| 274 | + | // | |
| 275 | + | // This function should be used by `GtkAccessible` implementations that | |
| 276 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 277 | + | // states automatically. | |
| 278 | + | func (x *WindowTitle) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 279 | + | ||
| 280 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 281 | + | ||
| 282 | + | } | |
| 283 | + | ||
| 153 | 284 | // Updates a list of accessible properties. | |
| 154 | 285 | // | |
| 155 | 286 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -192,7 +323,7 @@ func (x *WindowTitle) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gt | |||
| 192 | 323 | // relation change must be communicated to assistive technologies. | |
| 193 | 324 | // | |
| 194 | 325 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 195 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 326 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 196 | 327 | // | |
| 197 | 328 | // ```c | |
| 198 | 329 | // gtk_accessible_update_relation (accessible, | |
| @@ -222,13 +353,17 @@ func (x *WindowTitle) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk. | |||
| 222 | 353 | ||
| 223 | 354 | } | |
| 224 | 355 | ||
| 225 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 226 | - | // documentation for the value types of accessible states. | |
| 356 | + | // Updates a list of accessible states. | |
| 227 | 357 | // | |
| 228 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 229 | - | // state change must be communicated to assistive technologies. | |
| 358 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 359 | + | // value types of accessible states. | |
| 360 | + | // | |
| 361 | + | // This function should be called by `GtkWidget` types whenever | |
| 362 | + | // an accessible state change must be communicated to assistive | |
| 363 | + | // technologies. | |
| 230 | 364 | // | |
| 231 | 365 | // Example: | |
| 366 | + | // | |
| 232 | 367 | // ```c | |
| 233 | 368 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 234 | 369 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -258,7 +393,7 @@ func (x *WindowTitle) UpdateStateValue(NStatesVar int, StatesVar []gtk.Accessibl | |||
| 258 | 393 | // Gets the ID of the @buildable object. | |
| 259 | 394 | // | |
| 260 | 395 | // `GtkBuilder` sets the name based on the ID attribute | |
| 261 | - | // of the <object> tag used to construct the @buildable. | |
| 396 | + | // of the `<object>` tag used to construct the @buildable. | |
| 262 | 397 | func (x *WindowTitle) GetBuildableId() string { | |
| 263 | 398 | ||
| 264 | 399 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
M v4/adw/adw-window.go +179 -10
| @@ -106,6 +106,12 @@ func (x *WindowClass) GoPointer() uintptr { | |||
| 106 | 106 | // UI state. `AdwWindow` defaults to the minimum size of 360×200 px. If that's | |
| 107 | 107 | // too small, set the [property@Gtk.Widget:width-request] and | |
| 108 | 108 | // [property@Gtk.Widget:height-request] properties manually. | |
| 109 | + | // | |
| 110 | + | // ## Adaptive Preview | |
| 111 | + | // | |
| 112 | + | // `AdwWindow` has a debug tool called adaptive preview. It can be opened from | |
| 113 | + | // GTK Inspector or by pressing <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>M</kbd>, | |
| 114 | + | // and controlled via the [property@Window:adaptive-preview] property. | |
| 109 | 115 | type Window struct { | |
| 110 | 116 | gtk.Window | |
| 111 | 117 | } | |
| @@ -148,6 +154,15 @@ func (x *Window) AddBreakpoint(BreakpointVar *Breakpoint) { | |||
| 148 | 154 | ||
| 149 | 155 | } | |
| 150 | 156 | ||
| 157 | + | var xWindowGetAdaptivePreview func(uintptr) bool | |
| 158 | + | ||
| 159 | + | // Gets whether adaptive preview for @self is currently open. | |
| 160 | + | func (x *Window) GetAdaptivePreview() bool { | |
| 161 | + | ||
| 162 | + | cret := xWindowGetAdaptivePreview(x.GoPointer()) | |
| 163 | + | return cret | |
| 164 | + | } | |
| 165 | + | ||
| 151 | 166 | var xWindowGetContent func(uintptr) uintptr | |
| 152 | 167 | ||
| 153 | 168 | // Gets the content widget of @self. | |
| @@ -219,6 +234,23 @@ func (x *Window) GetVisibleDialog() *Dialog { | |||
| 219 | 234 | return cls | |
| 220 | 235 | } | |
| 221 | 236 | ||
| 237 | + | var xWindowSetAdaptivePreview func(uintptr, bool) | |
| 238 | + | ||
| 239 | + | // Sets whether adaptive preview for @self is currently open. | |
| 240 | + | // | |
| 241 | + | // Adaptive preview is a debugging tool used for testing the window | |
| 242 | + | // contents at specific screen sizes, simulating mobile environment. | |
| 243 | + | // | |
| 244 | + | // Adaptive preview can always be accessed from inspector. This function | |
| 245 | + | // allows applications to open it manually. | |
| 246 | + | // | |
| 247 | + | // Most applications should not use this function. | |
| 248 | + | func (x *Window) SetAdaptivePreview(AdaptivePreviewVar bool) { | |
| 249 | + | ||
| 250 | + | xWindowSetAdaptivePreview(x.GoPointer(), AdaptivePreviewVar) | |
| 251 | + | ||
| 252 | + | } | |
| 253 | + | ||
| 222 | 254 | var xWindowSetContent func(uintptr, uintptr) | |
| 223 | 255 | ||
| 224 | 256 | // Sets the content widget of @self. | |
| @@ -241,34 +273,165 @@ func (c *Window) SetGoPointer(ptr uintptr) { | |||
| 241 | 273 | c.Ptr = ptr | |
| 242 | 274 | } | |
| 243 | 275 | ||
| 244 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 276 | + | // Requests the user's screen reader to announce the given message. | |
| 277 | + | // | |
| 278 | + | // This kind of notification is useful for messages that | |
| 279 | + | // either have only a visual representation or that are not | |
| 280 | + | // exposed visually at all, e.g. a notification about a | |
| 281 | + | // successful operation. | |
| 282 | + | // | |
| 283 | + | // Also, by using this API, you can ensure that the message | |
| 284 | + | // does not interrupts the user's current screen reader output. | |
| 285 | + | func (x *Window) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 286 | + | ||
| 287 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 288 | + | ||
| 289 | + | } | |
| 290 | + | ||
| 291 | + | // Retrieves the accessible parent for an accessible object. | |
| 292 | + | // | |
| 293 | + | // This function returns `NULL` for top level widgets. | |
| 294 | + | func (x *Window) GetAccessibleParent() *gtk.AccessibleBase { | |
| 295 | + | var cls *gtk.AccessibleBase | |
| 296 | + | ||
| 297 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 298 | + | ||
| 299 | + | if cret == 0 { | |
| 300 | + | return nil | |
| 301 | + | } | |
| 302 | + | cls = >k.AccessibleBase{} | |
| 303 | + | cls.Ptr = cret | |
| 304 | + | return cls | |
| 305 | + | } | |
| 306 | + | ||
| 307 | + | // Retrieves the accessible role of an accessible object. | |
| 245 | 308 | func (x *Window) GetAccessibleRole() gtk.AccessibleRole { | |
| 246 | 309 | ||
| 247 | 310 | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 248 | 311 | return cret | |
| 249 | 312 | } | |
| 250 | 313 | ||
| 251 | - | // Resets the accessible @property to its default value. | |
| 314 | + | // Retrieves the implementation for the given accessible object. | |
| 315 | + | func (x *Window) GetAtContext() *gtk.ATContext { | |
| 316 | + | var cls *gtk.ATContext | |
| 317 | + | ||
| 318 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 319 | + | ||
| 320 | + | if cret == 0 { | |
| 321 | + | return nil | |
| 322 | + | } | |
| 323 | + | cls = >k.ATContext{} | |
| 324 | + | cls.Ptr = cret | |
| 325 | + | return cls | |
| 326 | + | } | |
| 327 | + | ||
| 328 | + | // Queries the coordinates and dimensions of this accessible | |
| 329 | + | // | |
| 330 | + | // This functionality can be overridden by `GtkAccessible` | |
| 331 | + | // implementations, e.g. to get the bounds from an ignored | |
| 332 | + | // child widget. | |
| 333 | + | func (x *Window) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 334 | + | ||
| 335 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 336 | + | return cret | |
| 337 | + | } | |
| 338 | + | ||
| 339 | + | // Retrieves the first accessible child of an accessible object. | |
| 340 | + | func (x *Window) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 341 | + | var cls *gtk.AccessibleBase | |
| 342 | + | ||
| 343 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 344 | + | ||
| 345 | + | if cret == 0 { | |
| 346 | + | return nil | |
| 347 | + | } | |
| 348 | + | cls = >k.AccessibleBase{} | |
| 349 | + | cls.Ptr = cret | |
| 350 | + | return cls | |
| 351 | + | } | |
| 352 | + | ||
| 353 | + | // Retrieves the next accessible sibling of an accessible object | |
| 354 | + | func (x *Window) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 355 | + | var cls *gtk.AccessibleBase | |
| 356 | + | ||
| 357 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 358 | + | ||
| 359 | + | if cret == 0 { | |
| 360 | + | return nil | |
| 361 | + | } | |
| 362 | + | cls = >k.AccessibleBase{} | |
| 363 | + | cls.Ptr = cret | |
| 364 | + | return cls | |
| 365 | + | } | |
| 366 | + | ||
| 367 | + | // Queries a platform state, such as focus. | |
| 368 | + | // | |
| 369 | + | // This functionality can be overridden by `GtkAccessible` | |
| 370 | + | // implementations, e.g. to get platform state from an ignored | |
| 371 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 372 | + | func (x *Window) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 373 | + | ||
| 374 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 375 | + | return cret | |
| 376 | + | } | |
| 377 | + | ||
| 378 | + | // Resets the accessible property to its default value. | |
| 252 | 379 | func (x *Window) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 253 | 380 | ||
| 254 | 381 | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 255 | 382 | ||
| 256 | 383 | } | |
| 257 | 384 | ||
| 258 | - | // Resets the accessible @relation to its default value. | |
| 385 | + | // Resets the accessible relation to its default value. | |
| 259 | 386 | func (x *Window) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 260 | 387 | ||
| 261 | 388 | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 262 | 389 | ||
| 263 | 390 | } | |
| 264 | 391 | ||
| 265 | - | // Resets the accessible @state to its default value. | |
| 392 | + | // Resets the accessible state to its default value. | |
| 266 | 393 | func (x *Window) ResetState(StateVar gtk.AccessibleState) { | |
| 267 | 394 | ||
| 268 | 395 | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 269 | 396 | ||
| 270 | 397 | } | |
| 271 | 398 | ||
| 399 | + | // Sets the parent and sibling of an accessible object. | |
| 400 | + | // | |
| 401 | + | // This function is meant to be used by accessible implementations that are | |
| 402 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 403 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 404 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 405 | + | // interface, you will use this function to ensure that the parent of each | |
| 406 | + | // child widget is the metadata object, and the parent of each metadata | |
| 407 | + | // object is the container widget. | |
| 408 | + | func (x *Window) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 409 | + | ||
| 410 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 411 | + | ||
| 412 | + | } | |
| 413 | + | ||
| 414 | + | // Updates the next accessible sibling. | |
| 415 | + | // | |
| 416 | + | // That might be useful when a new child of a custom accessible | |
| 417 | + | // is created, and it needs to be linked to a previous child. | |
| 418 | + | func (x *Window) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 419 | + | ||
| 420 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 421 | + | ||
| 422 | + | } | |
| 423 | + | ||
| 424 | + | // Informs ATs that the platform state has changed. | |
| 425 | + | // | |
| 426 | + | // This function should be used by `GtkAccessible` implementations that | |
| 427 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 428 | + | // states automatically. | |
| 429 | + | func (x *Window) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 430 | + | ||
| 431 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 432 | + | ||
| 433 | + | } | |
| 434 | + | ||
| 272 | 435 | // Updates a list of accessible properties. | |
| 273 | 436 | // | |
| 274 | 437 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -311,7 +474,7 @@ func (x *Window) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.Acc | |||
| 311 | 474 | // relation change must be communicated to assistive technologies. | |
| 312 | 475 | // | |
| 313 | 476 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 314 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 477 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 315 | 478 | // | |
| 316 | 479 | // ```c | |
| 317 | 480 | // gtk_accessible_update_relation (accessible, | |
| @@ -341,13 +504,17 @@ func (x *Window) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.Acces | |||
| 341 | 504 | ||
| 342 | 505 | } | |
| 343 | 506 | ||
| 344 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 345 | - | // documentation for the value types of accessible states. | |
| 507 | + | // Updates a list of accessible states. | |
| 346 | 508 | // | |
| 347 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 348 | - | // state change must be communicated to assistive technologies. | |
| 509 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 510 | + | // value types of accessible states. | |
| 511 | + | // | |
| 512 | + | // This function should be called by `GtkWidget` types whenever | |
| 513 | + | // an accessible state change must be communicated to assistive | |
| 514 | + | // technologies. | |
| 349 | 515 | // | |
| 350 | 516 | // Example: | |
| 517 | + | // | |
| 351 | 518 | // ```c | |
| 352 | 519 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 353 | 520 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -377,7 +544,7 @@ func (x *Window) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleStat | |||
| 377 | 544 | // Gets the ID of the @buildable object. | |
| 378 | 545 | // | |
| 379 | 546 | // `GtkBuilder` sets the name based on the ID attribute | |
| 380 | - | // of the <object> tag used to construct the @buildable. | |
| 547 | + | // of the `<object>` tag used to construct the @buildable. | |
| 381 | 548 | func (x *Window) GetBuildableId() string { | |
| 382 | 549 | ||
| 383 | 550 | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| @@ -504,10 +671,12 @@ func init() { | |||
| 504 | 671 | core.PuregoSafeRegister(&xNewWindow, lib, "adw_window_new") | |
| 505 | 672 | ||
| 506 | 673 | core.PuregoSafeRegister(&xWindowAddBreakpoint, lib, "adw_window_add_breakpoint") | |
| 674 | + | core.PuregoSafeRegister(&xWindowGetAdaptivePreview, lib, "adw_window_get_adaptive_preview") | |
| 507 | 675 | core.PuregoSafeRegister(&xWindowGetContent, lib, "adw_window_get_content") | |
| 508 | 676 | core.PuregoSafeRegister(&xWindowGetCurrentBreakpoint, lib, "adw_window_get_current_breakpoint") | |
| 509 | 677 | core.PuregoSafeRegister(&xWindowGetDialogs, lib, "adw_window_get_dialogs") | |
| 510 | 678 | core.PuregoSafeRegister(&xWindowGetVisibleDialog, lib, "adw_window_get_visible_dialog") | |
| 679 | + | core.PuregoSafeRegister(&xWindowSetAdaptivePreview, lib, "adw_window_set_adaptive_preview") | |
| 511 | 680 | core.PuregoSafeRegister(&xWindowSetContent, lib, "adw_window_set_content") | |
| 512 | 681 | ||
| 513 | 682 | } | |
A v4/adw/adw-wrap-box.go +810 -0
| @@ -0,0 +1,810 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 13 | + | ) | |
| 14 | + | ||
| 15 | + | type WrapBoxClass struct { | |
| 16 | + | _ structs.HostLayout | |
| 17 | + | ||
| 18 | + | ParentClass gtk.WidgetClass | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | func (x *WrapBoxClass) GoPointer() uintptr { | |
| 22 | + | return uintptr(unsafe.Pointer(x)) | |
| 23 | + | } | |
| 24 | + | ||
| 25 | + | // A box-like widget that can wrap into multiple lines. | |
| 26 | + | // | |
| 27 | + | // <picture> | |
| 28 | + | // | |
| 29 | + | // <source srcset="wrap-box-dark.png" media="(prefers-color-scheme: dark)"> | |
| 30 | + | // <img src="wrap-box.png" alt="wrap-box"> | |
| 31 | + | // | |
| 32 | + | // </picture> | |
| 33 | + | // | |
| 34 | + | // `AdwWrapBox` is similar to [class@Gtk.Box], but can wrap lines when the | |
| 35 | + | // widgets cannot fit otherwise. Unlike [class@Gtk.FlowBox], the children aren't | |
| 36 | + | // arranged into a grid and behave more like words in a wrapping label. | |
| 37 | + | // | |
| 38 | + | // Like `GtkBox`, `AdwWrapBox` is orientable and has spacing: | |
| 39 | + | // | |
| 40 | + | // - [property@WrapBox:child-spacing] between children in the same line; | |
| 41 | + | // - [property@WrapBox:line-spacing] between lines. | |
| 42 | + | // | |
| 43 | + | // ::: note | |
| 44 | + | // | |
| 45 | + | // Unlike `GtkBox`, `AdwWrapBox` cannot follow the CSS `border-spacing` | |
| 46 | + | // property. | |
| 47 | + | // | |
| 48 | + | // Use the [property@WrapBox:natural-line-length] property to determine the | |
| 49 | + | // layout's natural size, e.g. when using it in a [class@Gtk.Popover]. | |
| 50 | + | // | |
| 51 | + | // Normally, a horizontal `AdwWrapBox` wraps left to right and top to bottom | |
| 52 | + | // for left-to-right languages. Both of these directions can be reversed, using | |
| 53 | + | // the [property@WrapBox:pack-direction] and [property@WrapBox:wrap-reverse] | |
| 54 | + | // properties. Additionally, the alignment of each line can be controlled with | |
| 55 | + | // the [property@WrapBox:align] property. | |
| 56 | + | // | |
| 57 | + | // Lines can be justified using the [property@WrapBox:justify] property, filling | |
| 58 | + | // the entire line by either increasing child size or spacing depending on the | |
| 59 | + | // value. Set [property@WrapBox:justify-last-line] to justify the last line as | |
| 60 | + | // well. | |
| 61 | + | // | |
| 62 | + | // By default, `AdwWrapBox` wraps as soon as the previous line cannot fit any | |
| 63 | + | // more children without shrinking them past their natural size. Set | |
| 64 | + | // [property@WrapBox:wrap-policy] to [enum@Adw.WrapPolicy.MINIMUM] to only wrap | |
| 65 | + | // once all the children in the previous line have been shrunk to their minimum | |
| 66 | + | // size. | |
| 67 | + | // | |
| 68 | + | // To make each line take the same amount of space, set | |
| 69 | + | // [property@WrapBox:line-homogeneous] to `TRUE`. | |
| 70 | + | // | |
| 71 | + | // Spacing and natural line length can scale with the text scale factor, use the | |
| 72 | + | // [property@WrapBox:child-spacing-unit], [property@WrapBox:line-spacing-unit] | |
| 73 | + | // and/or [property@WrapBox:natural-line-length-unit] properties to enable that | |
| 74 | + | // behavior. | |
| 75 | + | // | |
| 76 | + | // See [class@WrapLayout]. | |
| 77 | + | // | |
| 78 | + | // ## CSS nodes | |
| 79 | + | // | |
| 80 | + | // `AdwWrapBox` uses a single CSS node with name `wrap-box`. | |
| 81 | + | // | |
| 82 | + | // ## Accessibility | |
| 83 | + | // | |
| 84 | + | // `AdwWrapBox` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role. | |
| 85 | + | type WrapBox struct { | |
| 86 | + | gtk.Widget | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xWrapBoxGLibType func() types.GType | |
| 90 | + | ||
| 91 | + | func WrapBoxGLibType() types.GType { | |
| 92 | + | return xWrapBoxGLibType() | |
| 93 | + | } | |
| 94 | + | ||
| 95 | + | func WrapBoxNewFromInternalPtr(ptr uintptr) *WrapBox { | |
| 96 | + | cls := &WrapBox{} | |
| 97 | + | cls.Ptr = ptr | |
| 98 | + | return cls | |
| 99 | + | } | |
| 100 | + | ||
| 101 | + | var xNewWrapBox func() uintptr | |
| 102 | + | ||
| 103 | + | // Creates a new `AdwWrapBox`. | |
| 104 | + | func NewWrapBox() *WrapBox { | |
| 105 | + | var cls *WrapBox | |
| 106 | + | ||
| 107 | + | cret := xNewWrapBox() | |
| 108 | + | ||
| 109 | + | if cret == 0 { | |
| 110 | + | return nil | |
| 111 | + | } | |
| 112 | + | gobject.IncreaseRef(cret) | |
| 113 | + | cls = &WrapBox{} | |
| 114 | + | cls.Ptr = cret | |
| 115 | + | return cls | |
| 116 | + | } | |
| 117 | + | ||
| 118 | + | var xWrapBoxAppend func(uintptr, uintptr) | |
| 119 | + | ||
| 120 | + | // Adds @child as the last child to @self. | |
| 121 | + | func (x *WrapBox) Append(ChildVar *gtk.Widget) { | |
| 122 | + | ||
| 123 | + | xWrapBoxAppend(x.GoPointer(), ChildVar.GoPointer()) | |
| 124 | + | ||
| 125 | + | } | |
| 126 | + | ||
| 127 | + | var xWrapBoxGetAlign func(uintptr) float32 | |
| 128 | + | ||
| 129 | + | // Gets the alignment of the children within each line. | |
| 130 | + | func (x *WrapBox) GetAlign() float32 { | |
| 131 | + | ||
| 132 | + | cret := xWrapBoxGetAlign(x.GoPointer()) | |
| 133 | + | return cret | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | var xWrapBoxGetChildSpacing func(uintptr) int | |
| 137 | + | ||
| 138 | + | // Gets spacing between widgets on the same line. | |
| 139 | + | func (x *WrapBox) GetChildSpacing() int { | |
| 140 | + | ||
| 141 | + | cret := xWrapBoxGetChildSpacing(x.GoPointer()) | |
| 142 | + | return cret | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | var xWrapBoxGetChildSpacingUnit func(uintptr) LengthUnit | |
| 146 | + | ||
| 147 | + | // Gets the length unit for child spacing. | |
| 148 | + | func (x *WrapBox) GetChildSpacingUnit() LengthUnit { | |
| 149 | + | ||
| 150 | + | cret := xWrapBoxGetChildSpacingUnit(x.GoPointer()) | |
| 151 | + | return cret | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | var xWrapBoxGetJustify func(uintptr) JustifyMode | |
| 155 | + | ||
| 156 | + | // Gets whether and how each complete line is stretched to fill the entire widget. | |
| 157 | + | func (x *WrapBox) GetJustify() JustifyMode { | |
| 158 | + | ||
| 159 | + | cret := xWrapBoxGetJustify(x.GoPointer()) | |
| 160 | + | return cret | |
| 161 | + | } | |
| 162 | + | ||
| 163 | + | var xWrapBoxGetJustifyLastLine func(uintptr) bool | |
| 164 | + | ||
| 165 | + | // Gets whether the last line should be stretched to fill the entire widget. | |
| 166 | + | func (x *WrapBox) GetJustifyLastLine() bool { | |
| 167 | + | ||
| 168 | + | cret := xWrapBoxGetJustifyLastLine(x.GoPointer()) | |
| 169 | + | return cret | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | var xWrapBoxGetLineHomogeneous func(uintptr) bool | |
| 173 | + | ||
| 174 | + | // Gets whether all lines should take the same amount of space. | |
| 175 | + | func (x *WrapBox) GetLineHomogeneous() bool { | |
| 176 | + | ||
| 177 | + | cret := xWrapBoxGetLineHomogeneous(x.GoPointer()) | |
| 178 | + | return cret | |
| 179 | + | } | |
| 180 | + | ||
| 181 | + | var xWrapBoxGetLineSpacing func(uintptr) int | |
| 182 | + | ||
| 183 | + | // Gets the spacing between lines. | |
| 184 | + | // | |
| 185 | + | // See [property@WrapBox:line-spacing-unit]. | |
| 186 | + | func (x *WrapBox) GetLineSpacing() int { | |
| 187 | + | ||
| 188 | + | cret := xWrapBoxGetLineSpacing(x.GoPointer()) | |
| 189 | + | return cret | |
| 190 | + | } | |
| 191 | + | ||
| 192 | + | var xWrapBoxGetLineSpacingUnit func(uintptr) LengthUnit | |
| 193 | + | ||
| 194 | + | // Gets the length unit for line spacing. | |
| 195 | + | func (x *WrapBox) GetLineSpacingUnit() LengthUnit { | |
| 196 | + | ||
| 197 | + | cret := xWrapBoxGetLineSpacingUnit(x.GoPointer()) | |
| 198 | + | return cret | |
| 199 | + | } | |
| 200 | + | ||
| 201 | + | var xWrapBoxGetNaturalLineLength func(uintptr) int | |
| 202 | + | ||
| 203 | + | // Gets the natural size for each line. | |
| 204 | + | func (x *WrapBox) GetNaturalLineLength() int { | |
| 205 | + | ||
| 206 | + | cret := xWrapBoxGetNaturalLineLength(x.GoPointer()) | |
| 207 | + | return cret | |
| 208 | + | } | |
| 209 | + | ||
| 210 | + | var xWrapBoxGetNaturalLineLengthUnit func(uintptr) LengthUnit | |
| 211 | + | ||
| 212 | + | // Gets the length unit for line spacing. | |
| 213 | + | func (x *WrapBox) GetNaturalLineLengthUnit() LengthUnit { | |
| 214 | + | ||
| 215 | + | cret := xWrapBoxGetNaturalLineLengthUnit(x.GoPointer()) | |
| 216 | + | return cret | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | var xWrapBoxGetPackDirection func(uintptr) PackDirection | |
| 220 | + | ||
| 221 | + | // Gets the direction children are packed in each line. | |
| 222 | + | func (x *WrapBox) GetPackDirection() PackDirection { | |
| 223 | + | ||
| 224 | + | cret := xWrapBoxGetPackDirection(x.GoPointer()) | |
| 225 | + | return cret | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | var xWrapBoxGetWrapPolicy func(uintptr) WrapPolicy | |
| 229 | + | ||
| 230 | + | // Gets the policy for line wrapping. | |
| 231 | + | func (x *WrapBox) GetWrapPolicy() WrapPolicy { | |
| 232 | + | ||
| 233 | + | cret := xWrapBoxGetWrapPolicy(x.GoPointer()) | |
| 234 | + | return cret | |
| 235 | + | } | |
| 236 | + | ||
| 237 | + | var xWrapBoxGetWrapReverse func(uintptr) bool | |
| 238 | + | ||
| 239 | + | // Gets whether wrap direction is reversed. | |
| 240 | + | func (x *WrapBox) GetWrapReverse() bool { | |
| 241 | + | ||
| 242 | + | cret := xWrapBoxGetWrapReverse(x.GoPointer()) | |
| 243 | + | return cret | |
| 244 | + | } | |
| 245 | + | ||
| 246 | + | var xWrapBoxInsertChildAfter func(uintptr, uintptr, uintptr) | |
| 247 | + | ||
| 248 | + | // Inserts @child in the position after @sibling in the list of @self children. | |
| 249 | + | // | |
| 250 | + | // If @sibling is `NULL`, inserts @child at the first position. | |
| 251 | + | func (x *WrapBox) InsertChildAfter(ChildVar *gtk.Widget, SiblingVar *gtk.Widget) { | |
| 252 | + | ||
| 253 | + | xWrapBoxInsertChildAfter(x.GoPointer(), ChildVar.GoPointer(), SiblingVar.GoPointer()) | |
| 254 | + | ||
| 255 | + | } | |
| 256 | + | ||
| 257 | + | var xWrapBoxPrepend func(uintptr, uintptr) | |
| 258 | + | ||
| 259 | + | // Adds @child as the first child to @self. | |
| 260 | + | func (x *WrapBox) Prepend(ChildVar *gtk.Widget) { | |
| 261 | + | ||
| 262 | + | xWrapBoxPrepend(x.GoPointer(), ChildVar.GoPointer()) | |
| 263 | + | ||
| 264 | + | } | |
| 265 | + | ||
| 266 | + | var xWrapBoxRemove func(uintptr, uintptr) | |
| 267 | + | ||
| 268 | + | // Removes a child widget from @self. | |
| 269 | + | // | |
| 270 | + | // The child must have been added before with [method@Adw.WrapBox.append], | |
| 271 | + | // [method@Adw.WrapBox.prepend], or [method@Adw.WrapBox.insert_child_after]. | |
| 272 | + | func (x *WrapBox) Remove(ChildVar *gtk.Widget) { | |
| 273 | + | ||
| 274 | + | xWrapBoxRemove(x.GoPointer(), ChildVar.GoPointer()) | |
| 275 | + | ||
| 276 | + | } | |
| 277 | + | ||
| 278 | + | var xWrapBoxReorderChildAfter func(uintptr, uintptr, uintptr) | |
| 279 | + | ||
| 280 | + | // Moves @child to the position after @sibling in the list of @self children. | |
| 281 | + | // | |
| 282 | + | // If @sibling is `NULL`, moves @child to the first position. | |
| 283 | + | func (x *WrapBox) ReorderChildAfter(ChildVar *gtk.Widget, SiblingVar *gtk.Widget) { | |
| 284 | + | ||
| 285 | + | xWrapBoxReorderChildAfter(x.GoPointer(), ChildVar.GoPointer(), SiblingVar.GoPointer()) | |
| 286 | + | ||
| 287 | + | } | |
| 288 | + | ||
| 289 | + | var xWrapBoxSetAlign func(uintptr, float32) | |
| 290 | + | ||
| 291 | + | // Sets the alignment of the children within each line. | |
| 292 | + | // | |
| 293 | + | // 0 means the children are placed at the start of the line, 1 means they are | |
| 294 | + | // placed at the end of the line. 0.5 means they are placed in the middle of the | |
| 295 | + | // line. | |
| 296 | + | // | |
| 297 | + | // Alignment is only used when [property@WrapBox:justify] is set to | |
| 298 | + | // `ADW_JUSTIFY_NONE`, or on the last line when the | |
| 299 | + | // [property@WrapBox:justify-last-line] is `FALSE`. | |
| 300 | + | func (x *WrapBox) SetAlign(AlignVar float32) { | |
| 301 | + | ||
| 302 | + | xWrapBoxSetAlign(x.GoPointer(), AlignVar) | |
| 303 | + | ||
| 304 | + | } | |
| 305 | + | ||
| 306 | + | var xWrapBoxSetChildSpacing func(uintptr, int) | |
| 307 | + | ||
| 308 | + | // Sets the spacing between widgets on the same line. | |
| 309 | + | // | |
| 310 | + | // See [property@WrapBox:child-spacing-unit]. | |
| 311 | + | func (x *WrapBox) SetChildSpacing(ChildSpacingVar int) { | |
| 312 | + | ||
| 313 | + | xWrapBoxSetChildSpacing(x.GoPointer(), ChildSpacingVar) | |
| 314 | + | ||
| 315 | + | } | |
| 316 | + | ||
| 317 | + | var xWrapBoxSetChildSpacingUnit func(uintptr, LengthUnit) | |
| 318 | + | ||
| 319 | + | // Sets the length unit for child spacing. | |
| 320 | + | // | |
| 321 | + | // Allows the spacing to vary depending on the text scale factor. | |
| 322 | + | // | |
| 323 | + | // See [property@WrapBox:child-spacing]. | |
| 324 | + | func (x *WrapBox) SetChildSpacingUnit(UnitVar LengthUnit) { | |
| 325 | + | ||
| 326 | + | xWrapBoxSetChildSpacingUnit(x.GoPointer(), UnitVar) | |
| 327 | + | ||
| 328 | + | } | |
| 329 | + | ||
| 330 | + | var xWrapBoxSetJustify func(uintptr, JustifyMode) | |
| 331 | + | ||
| 332 | + | // Determines whether and how each complete line should be stretched to fill | |
| 333 | + | // the entire widget. | |
| 334 | + | // | |
| 335 | + | // If set to `ADW_JUSTIFY_FILL`, each widget in the line will be stretched, | |
| 336 | + | // keeping consistent spacing, so that the line fills the entire widget. | |
| 337 | + | // | |
| 338 | + | // If set to `ADW_JUSTIFY_SPREAD`, the spacing between widgets will be | |
| 339 | + | // increased, keeping widget sizes intact. The first and last widget will be | |
| 340 | + | // aligned with the beginning and end of the line. If the line only contains a | |
| 341 | + | // single widget, it will be stretched regardless. | |
| 342 | + | // | |
| 343 | + | // If set to `ADW_JUSTIFY_NONE`, the line will not be stretched and the children | |
| 344 | + | // will be placed together within the line, according to | |
| 345 | + | // [property@WrapBox:align]. | |
| 346 | + | // | |
| 347 | + | // By default this doesn't affect the last line, as it will be incomplete. Use | |
| 348 | + | // [property@WrapBox:justify-last-line] to justify it as well. | |
| 349 | + | func (x *WrapBox) SetJustify(JustifyVar JustifyMode) { | |
| 350 | + | ||
| 351 | + | xWrapBoxSetJustify(x.GoPointer(), JustifyVar) | |
| 352 | + | ||
| 353 | + | } | |
| 354 | + | ||
| 355 | + | var xWrapBoxSetJustifyLastLine func(uintptr, bool) | |
| 356 | + | ||
| 357 | + | // Sets whether the last line should be stretched to fill the entire widget. | |
| 358 | + | // | |
| 359 | + | // See [property@WrapBox:justify]. | |
| 360 | + | func (x *WrapBox) SetJustifyLastLine(JustifyLastLineVar bool) { | |
| 361 | + | ||
| 362 | + | xWrapBoxSetJustifyLastLine(x.GoPointer(), JustifyLastLineVar) | |
| 363 | + | ||
| 364 | + | } | |
| 365 | + | ||
| 366 | + | var xWrapBoxSetLineHomogeneous func(uintptr, bool) | |
| 367 | + | ||
| 368 | + | // Sets whether all lines should take the same amount of space. | |
| 369 | + | func (x *WrapBox) SetLineHomogeneous(HomogeneousVar bool) { | |
| 370 | + | ||
| 371 | + | xWrapBoxSetLineHomogeneous(x.GoPointer(), HomogeneousVar) | |
| 372 | + | ||
| 373 | + | } | |
| 374 | + | ||
| 375 | + | var xWrapBoxSetLineSpacing func(uintptr, int) | |
| 376 | + | ||
| 377 | + | // Sets the spacing between lines. | |
| 378 | + | func (x *WrapBox) SetLineSpacing(LineSpacingVar int) { | |
| 379 | + | ||
| 380 | + | xWrapBoxSetLineSpacing(x.GoPointer(), LineSpacingVar) | |
| 381 | + | ||
| 382 | + | } | |
| 383 | + | ||
| 384 | + | var xWrapBoxSetLineSpacingUnit func(uintptr, LengthUnit) | |
| 385 | + | ||
| 386 | + | // Sets the length unit for line spacing. | |
| 387 | + | // | |
| 388 | + | // Allows the spacing to vary depending on the text scale factor. | |
| 389 | + | // | |
| 390 | + | // See [property@WrapBox:line-spacing]. | |
| 391 | + | func (x *WrapBox) SetLineSpacingUnit(UnitVar LengthUnit) { | |
| 392 | + | ||
| 393 | + | xWrapBoxSetLineSpacingUnit(x.GoPointer(), UnitVar) | |
| 394 | + | ||
| 395 | + | } | |
| 396 | + | ||
| 397 | + | var xWrapBoxSetNaturalLineLength func(uintptr, int) | |
| 398 | + | ||
| 399 | + | // Sets the natural size for each line. | |
| 400 | + | // | |
| 401 | + | // It should be used to limit the line lengths, for example when used in | |
| 402 | + | // popovers. | |
| 403 | + | // | |
| 404 | + | // See [property@WrapBox:natural-line-length-unit]. | |
| 405 | + | func (x *WrapBox) SetNaturalLineLength(NaturalLineLengthVar int) { | |
| 406 | + | ||
| 407 | + | xWrapBoxSetNaturalLineLength(x.GoPointer(), NaturalLineLengthVar) | |
| 408 | + | ||
| 409 | + | } | |
| 410 | + | ||
| 411 | + | var xWrapBoxSetNaturalLineLengthUnit func(uintptr, LengthUnit) | |
| 412 | + | ||
| 413 | + | // Sets the length unit for natural line length. | |
| 414 | + | // | |
| 415 | + | // Allows the length to vary depending on the text scale factor. | |
| 416 | + | // | |
| 417 | + | // See [property@WrapBox:natural-line-length]. | |
| 418 | + | func (x *WrapBox) SetNaturalLineLengthUnit(UnitVar LengthUnit) { | |
| 419 | + | ||
| 420 | + | xWrapBoxSetNaturalLineLengthUnit(x.GoPointer(), UnitVar) | |
| 421 | + | ||
| 422 | + | } | |
| 423 | + | ||
| 424 | + | var xWrapBoxSetPackDirection func(uintptr, PackDirection) | |
| 425 | + | ||
| 426 | + | // Sets the direction children are packed in each line. | |
| 427 | + | func (x *WrapBox) SetPackDirection(PackDirectionVar PackDirection) { | |
| 428 | + | ||
| 429 | + | xWrapBoxSetPackDirection(x.GoPointer(), PackDirectionVar) | |
| 430 | + | ||
| 431 | + | } | |
| 432 | + | ||
| 433 | + | var xWrapBoxSetWrapPolicy func(uintptr, WrapPolicy) | |
| 434 | + | ||
| 435 | + | // Sets the policy for line wrapping. | |
| 436 | + | // | |
| 437 | + | // If set to `ADW_WRAP_NATURAL`, the box will wrap to the next line as soon as | |
| 438 | + | // the previous line cannot fit any more children without shrinking them past | |
| 439 | + | // their natural size. | |
| 440 | + | // | |
| 441 | + | // If set to `ADW_WRAP_MINIMUM`, the box will try to fit as many children into | |
| 442 | + | // each line as possible, shrinking them down to their minimum size before | |
| 443 | + | // wrapping to the next line. | |
| 444 | + | func (x *WrapBox) SetWrapPolicy(WrapPolicyVar WrapPolicy) { | |
| 445 | + | ||
| 446 | + | xWrapBoxSetWrapPolicy(x.GoPointer(), WrapPolicyVar) | |
| 447 | + | ||
| 448 | + | } | |
| 449 | + | ||
| 450 | + | var xWrapBoxSetWrapReverse func(uintptr, bool) | |
| 451 | + | ||
| 452 | + | // Sets whether wrap direction should be reversed. | |
| 453 | + | // | |
| 454 | + | // By default, lines wrap downwards in a horizontal box, and towards the end | |
| 455 | + | // in a vertical box. If set to `TRUE`, they wrap upwards or towards the start | |
| 456 | + | // respectively. | |
| 457 | + | func (x *WrapBox) SetWrapReverse(WrapReverseVar bool) { | |
| 458 | + | ||
| 459 | + | xWrapBoxSetWrapReverse(x.GoPointer(), WrapReverseVar) | |
| 460 | + | ||
| 461 | + | } | |
| 462 | + | ||
| 463 | + | func (c *WrapBox) GoPointer() uintptr { | |
| 464 | + | if c == nil { | |
| 465 | + | return 0 | |
| 466 | + | } | |
| 467 | + | return c.Ptr | |
| 468 | + | } | |
| 469 | + | ||
| 470 | + | func (c *WrapBox) SetGoPointer(ptr uintptr) { | |
| 471 | + | c.Ptr = ptr | |
| 472 | + | } | |
| 473 | + | ||
| 474 | + | // Requests the user's screen reader to announce the given message. | |
| 475 | + | // | |
| 476 | + | // This kind of notification is useful for messages that | |
| 477 | + | // either have only a visual representation or that are not | |
| 478 | + | // exposed visually at all, e.g. a notification about a | |
| 479 | + | // successful operation. | |
| 480 | + | // | |
| 481 | + | // Also, by using this API, you can ensure that the message | |
| 482 | + | // does not interrupts the user's current screen reader output. | |
| 483 | + | func (x *WrapBox) Announce(MessageVar string, PriorityVar gtk.AccessibleAnnouncementPriority) { | |
| 484 | + | ||
| 485 | + | gtk.XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 486 | + | ||
| 487 | + | } | |
| 488 | + | ||
| 489 | + | // Retrieves the accessible parent for an accessible object. | |
| 490 | + | // | |
| 491 | + | // This function returns `NULL` for top level widgets. | |
| 492 | + | func (x *WrapBox) GetAccessibleParent() *gtk.AccessibleBase { | |
| 493 | + | var cls *gtk.AccessibleBase | |
| 494 | + | ||
| 495 | + | cret := gtk.XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 496 | + | ||
| 497 | + | if cret == 0 { | |
| 498 | + | return nil | |
| 499 | + | } | |
| 500 | + | cls = >k.AccessibleBase{} | |
| 501 | + | cls.Ptr = cret | |
| 502 | + | return cls | |
| 503 | + | } | |
| 504 | + | ||
| 505 | + | // Retrieves the accessible role of an accessible object. | |
| 506 | + | func (x *WrapBox) GetAccessibleRole() gtk.AccessibleRole { | |
| 507 | + | ||
| 508 | + | cret := gtk.XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 509 | + | return cret | |
| 510 | + | } | |
| 511 | + | ||
| 512 | + | // Retrieves the implementation for the given accessible object. | |
| 513 | + | func (x *WrapBox) GetAtContext() *gtk.ATContext { | |
| 514 | + | var cls *gtk.ATContext | |
| 515 | + | ||
| 516 | + | cret := gtk.XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 517 | + | ||
| 518 | + | if cret == 0 { | |
| 519 | + | return nil | |
| 520 | + | } | |
| 521 | + | cls = >k.ATContext{} | |
| 522 | + | cls.Ptr = cret | |
| 523 | + | return cls | |
| 524 | + | } | |
| 525 | + | ||
| 526 | + | // Queries the coordinates and dimensions of this accessible | |
| 527 | + | // | |
| 528 | + | // This functionality can be overridden by `GtkAccessible` | |
| 529 | + | // implementations, e.g. to get the bounds from an ignored | |
| 530 | + | // child widget. | |
| 531 | + | func (x *WrapBox) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 532 | + | ||
| 533 | + | cret := gtk.XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 534 | + | return cret | |
| 535 | + | } | |
| 536 | + | ||
| 537 | + | // Retrieves the first accessible child of an accessible object. | |
| 538 | + | func (x *WrapBox) GetFirstAccessibleChild() *gtk.AccessibleBase { | |
| 539 | + | var cls *gtk.AccessibleBase | |
| 540 | + | ||
| 541 | + | cret := gtk.XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 542 | + | ||
| 543 | + | if cret == 0 { | |
| 544 | + | return nil | |
| 545 | + | } | |
| 546 | + | cls = >k.AccessibleBase{} | |
| 547 | + | cls.Ptr = cret | |
| 548 | + | return cls | |
| 549 | + | } | |
| 550 | + | ||
| 551 | + | // Retrieves the next accessible sibling of an accessible object | |
| 552 | + | func (x *WrapBox) GetNextAccessibleSibling() *gtk.AccessibleBase { | |
| 553 | + | var cls *gtk.AccessibleBase | |
| 554 | + | ||
| 555 | + | cret := gtk.XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 556 | + | ||
| 557 | + | if cret == 0 { | |
| 558 | + | return nil | |
| 559 | + | } | |
| 560 | + | cls = >k.AccessibleBase{} | |
| 561 | + | cls.Ptr = cret | |
| 562 | + | return cls | |
| 563 | + | } | |
| 564 | + | ||
| 565 | + | // Queries a platform state, such as focus. | |
| 566 | + | // | |
| 567 | + | // This functionality can be overridden by `GtkAccessible` | |
| 568 | + | // implementations, e.g. to get platform state from an ignored | |
| 569 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 570 | + | func (x *WrapBox) GetPlatformState(StateVar gtk.AccessiblePlatformState) bool { | |
| 571 | + | ||
| 572 | + | cret := gtk.XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 573 | + | return cret | |
| 574 | + | } | |
| 575 | + | ||
| 576 | + | // Resets the accessible property to its default value. | |
| 577 | + | func (x *WrapBox) ResetProperty(PropertyVar gtk.AccessibleProperty) { | |
| 578 | + | ||
| 579 | + | gtk.XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 580 | + | ||
| 581 | + | } | |
| 582 | + | ||
| 583 | + | // Resets the accessible relation to its default value. | |
| 584 | + | func (x *WrapBox) ResetRelation(RelationVar gtk.AccessibleRelation) { | |
| 585 | + | ||
| 586 | + | gtk.XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 587 | + | ||
| 588 | + | } | |
| 589 | + | ||
| 590 | + | // Resets the accessible state to its default value. | |
| 591 | + | func (x *WrapBox) ResetState(StateVar gtk.AccessibleState) { | |
| 592 | + | ||
| 593 | + | gtk.XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 594 | + | ||
| 595 | + | } | |
| 596 | + | ||
| 597 | + | // Sets the parent and sibling of an accessible object. | |
| 598 | + | // | |
| 599 | + | // This function is meant to be used by accessible implementations that are | |
| 600 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 601 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 602 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 603 | + | // interface, you will use this function to ensure that the parent of each | |
| 604 | + | // child widget is the metadata object, and the parent of each metadata | |
| 605 | + | // object is the container widget. | |
| 606 | + | func (x *WrapBox) SetAccessibleParent(ParentVar gtk.Accessible, NextSiblingVar gtk.Accessible) { | |
| 607 | + | ||
| 608 | + | gtk.XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 609 | + | ||
| 610 | + | } | |
| 611 | + | ||
| 612 | + | // Updates the next accessible sibling. | |
| 613 | + | // | |
| 614 | + | // That might be useful when a new child of a custom accessible | |
| 615 | + | // is created, and it needs to be linked to a previous child. | |
| 616 | + | func (x *WrapBox) UpdateNextAccessibleSibling(NewSiblingVar gtk.Accessible) { | |
| 617 | + | ||
| 618 | + | gtk.XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 619 | + | ||
| 620 | + | } | |
| 621 | + | ||
| 622 | + | // Informs ATs that the platform state has changed. | |
| 623 | + | // | |
| 624 | + | // This function should be used by `GtkAccessible` implementations that | |
| 625 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 626 | + | // states automatically. | |
| 627 | + | func (x *WrapBox) UpdatePlatformState(StateVar gtk.AccessiblePlatformState) { | |
| 628 | + | ||
| 629 | + | gtk.XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 630 | + | ||
| 631 | + | } | |
| 632 | + | ||
| 633 | + | // Updates a list of accessible properties. | |
| 634 | + | // | |
| 635 | + | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| 636 | + | // value types of accessible properties. | |
| 637 | + | // | |
| 638 | + | // This function should be called by `GtkWidget` types whenever | |
| 639 | + | // an accessible property change must be communicated to assistive | |
| 640 | + | // technologies. | |
| 641 | + | // | |
| 642 | + | // Example: | |
| 643 | + | // ```c | |
| 644 | + | // value = gtk_adjustment_get_value (adjustment); | |
| 645 | + | // gtk_accessible_update_property (GTK_ACCESSIBLE (spin_button), | |
| 646 | + | // | |
| 647 | + | // GTK_ACCESSIBLE_PROPERTY_VALUE_NOW, value, | |
| 648 | + | // -1); | |
| 649 | + | // | |
| 650 | + | // ``` | |
| 651 | + | func (x *WrapBox) UpdateProperty(FirstPropertyVar gtk.AccessibleProperty, varArgs ...interface{}) { | |
| 652 | + | ||
| 653 | + | gtk.XGtkAccessibleUpdateProperty(x.GoPointer(), FirstPropertyVar, varArgs...) | |
| 654 | + | ||
| 655 | + | } | |
| 656 | + | ||
| 657 | + | // Updates an array of accessible properties. | |
| 658 | + | // | |
| 659 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 660 | + | // property change must be communicated to assistive technologies. | |
| 661 | + | // | |
| 662 | + | // This function is meant to be used by language bindings. | |
| 663 | + | func (x *WrapBox) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []gtk.AccessibleProperty, ValuesVar []gobject.Value) { | |
| 664 | + | ||
| 665 | + | gtk.XGtkAccessibleUpdatePropertyValue(x.GoPointer(), NPropertiesVar, PropertiesVar, ValuesVar) | |
| 666 | + | ||
| 667 | + | } | |
| 668 | + | ||
| 669 | + | // Updates a list of accessible relations. | |
| 670 | + | // | |
| 671 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 672 | + | // relation change must be communicated to assistive technologies. | |
| 673 | + | // | |
| 674 | + | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 675 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 676 | + | // | |
| 677 | + | // ```c | |
| 678 | + | // gtk_accessible_update_relation (accessible, | |
| 679 | + | // | |
| 680 | + | // GTK_ACCESSIBLE_RELATION_CONTROLS, | |
| 681 | + | // ref1, NULL, | |
| 682 | + | // GTK_ACCESSIBLE_RELATION_LABELLED_BY, | |
| 683 | + | // ref1, ref2, ref3, NULL, | |
| 684 | + | // -1); | |
| 685 | + | // | |
| 686 | + | // ``` | |
| 687 | + | func (x *WrapBox) UpdateRelation(FirstRelationVar gtk.AccessibleRelation, varArgs ...interface{}) { | |
| 688 | + | ||
| 689 | + | gtk.XGtkAccessibleUpdateRelation(x.GoPointer(), FirstRelationVar, varArgs...) | |
| 690 | + | ||
| 691 | + | } | |
| 692 | + | ||
| 693 | + | // Updates an array of accessible relations. | |
| 694 | + | // | |
| 695 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 696 | + | // relation change must be communicated to assistive technologies. | |
| 697 | + | // | |
| 698 | + | // This function is meant to be used by language bindings. | |
| 699 | + | func (x *WrapBox) UpdateRelationValue(NRelationsVar int, RelationsVar []gtk.AccessibleRelation, ValuesVar []gobject.Value) { | |
| 700 | + | ||
| 701 | + | gtk.XGtkAccessibleUpdateRelationValue(x.GoPointer(), NRelationsVar, RelationsVar, ValuesVar) | |
| 702 | + | ||
| 703 | + | } | |
| 704 | + | ||
| 705 | + | // Updates a list of accessible states. | |
| 706 | + | // | |
| 707 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 708 | + | // value types of accessible states. | |
| 709 | + | // | |
| 710 | + | // This function should be called by `GtkWidget` types whenever | |
| 711 | + | // an accessible state change must be communicated to assistive | |
| 712 | + | // technologies. | |
| 713 | + | // | |
| 714 | + | // Example: | |
| 715 | + | // | |
| 716 | + | // ```c | |
| 717 | + | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 718 | + | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| 719 | + | // | |
| 720 | + | // GTK_ACCESSIBLE_STATE_CHECKED, value, | |
| 721 | + | // -1); | |
| 722 | + | // | |
| 723 | + | // ``` | |
| 724 | + | func (x *WrapBox) UpdateState(FirstStateVar gtk.AccessibleState, varArgs ...interface{}) { | |
| 725 | + | ||
| 726 | + | gtk.XGtkAccessibleUpdateState(x.GoPointer(), FirstStateVar, varArgs...) | |
| 727 | + | ||
| 728 | + | } | |
| 729 | + | ||
| 730 | + | // Updates an array of accessible states. | |
| 731 | + | // | |
| 732 | + | // This function should be called by `GtkWidget` types whenever an accessible | |
| 733 | + | // state change must be communicated to assistive technologies. | |
| 734 | + | // | |
| 735 | + | // This function is meant to be used by language bindings. | |
| 736 | + | func (x *WrapBox) UpdateStateValue(NStatesVar int, StatesVar []gtk.AccessibleState, ValuesVar []gobject.Value) { | |
| 737 | + | ||
| 738 | + | gtk.XGtkAccessibleUpdateStateValue(x.GoPointer(), NStatesVar, StatesVar, ValuesVar) | |
| 739 | + | ||
| 740 | + | } | |
| 741 | + | ||
| 742 | + | // Gets the ID of the @buildable object. | |
| 743 | + | // | |
| 744 | + | // `GtkBuilder` sets the name based on the ID attribute | |
| 745 | + | // of the `<object>` tag used to construct the @buildable. | |
| 746 | + | func (x *WrapBox) GetBuildableId() string { | |
| 747 | + | ||
| 748 | + | cret := gtk.XGtkBuildableGetBuildableId(x.GoPointer()) | |
| 749 | + | return cret | |
| 750 | + | } | |
| 751 | + | ||
| 752 | + | // Retrieves the orientation of the @orientable. | |
| 753 | + | func (x *WrapBox) GetOrientation() gtk.Orientation { | |
| 754 | + | ||
| 755 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 756 | + | return cret | |
| 757 | + | } | |
| 758 | + | ||
| 759 | + | // Sets the orientation of the @orientable. | |
| 760 | + | func (x *WrapBox) SetOrientation(OrientationVar gtk.Orientation) { | |
| 761 | + | ||
| 762 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 763 | + | ||
| 764 | + | } | |
| 765 | + | ||
| 766 | + | func init() { | |
| 767 | + | core.SetPackageName("ADW", "libadwaita-1") | |
| 768 | + | core.SetSharedLibrary("ADW", "libadwaita-1.so.0") | |
| 769 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 770 | + | if err != nil { | |
| 771 | + | panic(err) | |
| 772 | + | } | |
| 773 | + | ||
| 774 | + | core.PuregoSafeRegister(&xWrapBoxGLibType, lib, "adw_wrap_box_get_type") | |
| 775 | + | ||
| 776 | + | core.PuregoSafeRegister(&xNewWrapBox, lib, "adw_wrap_box_new") | |
| 777 | + | ||
| 778 | + | core.PuregoSafeRegister(&xWrapBoxAppend, lib, "adw_wrap_box_append") | |
| 779 | + | core.PuregoSafeRegister(&xWrapBoxGetAlign, lib, "adw_wrap_box_get_align") | |
| 780 | + | core.PuregoSafeRegister(&xWrapBoxGetChildSpacing, lib, "adw_wrap_box_get_child_spacing") | |
| 781 | + | core.PuregoSafeRegister(&xWrapBoxGetChildSpacingUnit, lib, "adw_wrap_box_get_child_spacing_unit") | |
| 782 | + | core.PuregoSafeRegister(&xWrapBoxGetJustify, lib, "adw_wrap_box_get_justify") | |
| 783 | + | core.PuregoSafeRegister(&xWrapBoxGetJustifyLastLine, lib, "adw_wrap_box_get_justify_last_line") | |
| 784 | + | core.PuregoSafeRegister(&xWrapBoxGetLineHomogeneous, lib, "adw_wrap_box_get_line_homogeneous") | |
| 785 | + | core.PuregoSafeRegister(&xWrapBoxGetLineSpacing, lib, "adw_wrap_box_get_line_spacing") | |
| 786 | + | core.PuregoSafeRegister(&xWrapBoxGetLineSpacingUnit, lib, "adw_wrap_box_get_line_spacing_unit") | |
| 787 | + | core.PuregoSafeRegister(&xWrapBoxGetNaturalLineLength, lib, "adw_wrap_box_get_natural_line_length") | |
| 788 | + | core.PuregoSafeRegister(&xWrapBoxGetNaturalLineLengthUnit, lib, "adw_wrap_box_get_natural_line_length_unit") | |
| 789 | + | core.PuregoSafeRegister(&xWrapBoxGetPackDirection, lib, "adw_wrap_box_get_pack_direction") | |
| 790 | + | core.PuregoSafeRegister(&xWrapBoxGetWrapPolicy, lib, "adw_wrap_box_get_wrap_policy") | |
| 791 | + | core.PuregoSafeRegister(&xWrapBoxGetWrapReverse, lib, "adw_wrap_box_get_wrap_reverse") | |
| 792 | + | core.PuregoSafeRegister(&xWrapBoxInsertChildAfter, lib, "adw_wrap_box_insert_child_after") | |
| 793 | + | core.PuregoSafeRegister(&xWrapBoxPrepend, lib, "adw_wrap_box_prepend") | |
| 794 | + | core.PuregoSafeRegister(&xWrapBoxRemove, lib, "adw_wrap_box_remove") | |
| 795 | + | core.PuregoSafeRegister(&xWrapBoxReorderChildAfter, lib, "adw_wrap_box_reorder_child_after") | |
| 796 | + | core.PuregoSafeRegister(&xWrapBoxSetAlign, lib, "adw_wrap_box_set_align") | |
| 797 | + | core.PuregoSafeRegister(&xWrapBoxSetChildSpacing, lib, "adw_wrap_box_set_child_spacing") | |
| 798 | + | core.PuregoSafeRegister(&xWrapBoxSetChildSpacingUnit, lib, "adw_wrap_box_set_child_spacing_unit") | |
| 799 | + | core.PuregoSafeRegister(&xWrapBoxSetJustify, lib, "adw_wrap_box_set_justify") | |
| 800 | + | core.PuregoSafeRegister(&xWrapBoxSetJustifyLastLine, lib, "adw_wrap_box_set_justify_last_line") | |
| 801 | + | core.PuregoSafeRegister(&xWrapBoxSetLineHomogeneous, lib, "adw_wrap_box_set_line_homogeneous") | |
| 802 | + | core.PuregoSafeRegister(&xWrapBoxSetLineSpacing, lib, "adw_wrap_box_set_line_spacing") | |
| 803 | + | core.PuregoSafeRegister(&xWrapBoxSetLineSpacingUnit, lib, "adw_wrap_box_set_line_spacing_unit") | |
| 804 | + | core.PuregoSafeRegister(&xWrapBoxSetNaturalLineLength, lib, "adw_wrap_box_set_natural_line_length") | |
| 805 | + | core.PuregoSafeRegister(&xWrapBoxSetNaturalLineLengthUnit, lib, "adw_wrap_box_set_natural_line_length_unit") | |
| 806 | + | core.PuregoSafeRegister(&xWrapBoxSetPackDirection, lib, "adw_wrap_box_set_pack_direction") | |
| 807 | + | core.PuregoSafeRegister(&xWrapBoxSetWrapPolicy, lib, "adw_wrap_box_set_wrap_policy") | |
| 808 | + | core.PuregoSafeRegister(&xWrapBoxSetWrapReverse, lib, "adw_wrap_box_set_wrap_reverse") | |
| 809 | + | ||
| 810 | + | } | |
A v4/adw/adw-wrap-layout.go +540 -0
| @@ -0,0 +1,540 @@ | |||
| 1 | + | // Package adw was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package adw | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gtk" | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | type WrapLayoutClass struct { | |
| 15 | + | _ structs.HostLayout | |
| 16 | + | ||
| 17 | + | ParentClass gtk.LayoutManagerClass | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | func (x *WrapLayoutClass) GoPointer() uintptr { | |
| 21 | + | return uintptr(unsafe.Pointer(x)) | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | // Describes line justify behaviors in a [class@WrapLayout] or [class@WrapBox]. | |
| 25 | + | // | |
| 26 | + | // See [property@WrapLayout:justify] and [property@WrapBox:justify]. | |
| 27 | + | type JustifyMode int | |
| 28 | + | ||
| 29 | + | var xJustifyModeGLibType func() types.GType | |
| 30 | + | ||
| 31 | + | func JustifyModeGLibType() types.GType { | |
| 32 | + | return xJustifyModeGLibType() | |
| 33 | + | } | |
| 34 | + | ||
| 35 | + | const ( | |
| 36 | + | ||
| 37 | + | // Don't justify children within a line. | |
| 38 | + | JustifyNoneValue JustifyMode = 0 | |
| 39 | + | // Stretch each child within the line, keeping consistent | |
| 40 | + | // spacing, so that the line fills the entire length. | |
| 41 | + | JustifyFillValue JustifyMode = 1 | |
| 42 | + | // Increase spacing between children, moving the children | |
| 43 | + | // so that the first and last child are aligned with the beginning and end | |
| 44 | + | // of the line. If the line only contains a single widget, it will be | |
| 45 | + | // stretched regardless. | |
| 46 | + | JustifySpreadValue JustifyMode = 2 | |
| 47 | + | ) | |
| 48 | + | ||
| 49 | + | // Describes child packing behavior in a [class@WrapLayout] or [class@WrapBox]. | |
| 50 | + | // | |
| 51 | + | // See [property@WrapLayout:pack-direction] and | |
| 52 | + | // [property@WrapBox:pack-direction]. | |
| 53 | + | type PackDirection int | |
| 54 | + | ||
| 55 | + | var xPackDirectionGLibType func() types.GType | |
| 56 | + | ||
| 57 | + | func PackDirectionGLibType() types.GType { | |
| 58 | + | return xPackDirectionGLibType() | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | const ( | |
| 62 | + | ||
| 63 | + | // Pack children from left to right for LTR languages, | |
| 64 | + | // or top to bottom vertically. | |
| 65 | + | PackStartToEndValue PackDirection = 0 | |
| 66 | + | // Pack children from right to left for LTR languages, | |
| 67 | + | // or bottom to top vertically. | |
| 68 | + | PackEndToStartValue PackDirection = 1 | |
| 69 | + | ) | |
| 70 | + | ||
| 71 | + | // Describes line wrapping behavior in a [class@WrapLayout] or [class@WrapBox]. | |
| 72 | + | // | |
| 73 | + | // See [property@WrapLayout:wrap-policy] and [property@WrapBox:wrap-policy]. | |
| 74 | + | type WrapPolicy int | |
| 75 | + | ||
| 76 | + | var xWrapPolicyGLibType func() types.GType | |
| 77 | + | ||
| 78 | + | func WrapPolicyGLibType() types.GType { | |
| 79 | + | return xWrapPolicyGLibType() | |
| 80 | + | } | |
| 81 | + | ||
| 82 | + | const ( | |
| 83 | + | ||
| 84 | + | // Fit as many children into each line as possible, shrinking | |
| 85 | + | // them down to their minimum size before wrapping to the next line. | |
| 86 | + | WrapMinimumValue WrapPolicy = 0 | |
| 87 | + | // Wrap to the next line as soon as the previous line cannot | |
| 88 | + | // fit any more children without shrinking them past their natural size. | |
| 89 | + | WrapNaturalValue WrapPolicy = 1 | |
| 90 | + | ) | |
| 91 | + | ||
| 92 | + | // A box-like layout that can wrap into multiple lines. | |
| 93 | + | // | |
| 94 | + | // <picture> | |
| 95 | + | // | |
| 96 | + | // <source srcset="wrap-box-dark.png" media="(prefers-color-scheme: dark)"> | |
| 97 | + | // <img src="wrap-box.png" alt="wrap-box"> | |
| 98 | + | // | |
| 99 | + | // </picture> | |
| 100 | + | // | |
| 101 | + | // `AdwWrapLayout` is similar to [class@Gtk.BoxLayout], but can wrap lines when | |
| 102 | + | // the widgets cannot fit otherwise. Unlike [class@Gtk.FlowBox], the children | |
| 103 | + | // aren't arranged into a grid and behave more like words in a wrapping label. | |
| 104 | + | // | |
| 105 | + | // Like `GtkBoxLayout`, `AdwWrapLayout` is orientable and has spacing: | |
| 106 | + | // | |
| 107 | + | // - [property@WrapLayout:child-spacing] between children in the same line; | |
| 108 | + | // - [property@WrapLayout:line-spacing] between lines. | |
| 109 | + | // | |
| 110 | + | // ::: note | |
| 111 | + | // | |
| 112 | + | // Unlike `GtkBoxLayout`, `AdwWrapLayout` cannot follow the CSS | |
| 113 | + | // `border-spacing` property. | |
| 114 | + | // | |
| 115 | + | // Use the [property@WrapLayout:natural-line-length] property to determine the | |
| 116 | + | // layout's natural size, e.g. when using it in a [class@Gtk.Popover]. | |
| 117 | + | // | |
| 118 | + | // Normally, a horizontal `AdwWrapLayout` wraps left to right and top to bottom | |
| 119 | + | // for left-to-right languages. Both of these directions can be reversed, using | |
| 120 | + | // the [property@WrapLayout:pack-direction] and | |
| 121 | + | // [property@WrapLayout:wrap-reverse] properties. Additionally, the alignment | |
| 122 | + | // of each line can be controlled with the [property@WrapLayout:align] property. | |
| 123 | + | // | |
| 124 | + | // Lines can be justified using the [property@WrapLayout:justify] property, | |
| 125 | + | // filling the entire line by either increasing child size or spacing depending | |
| 126 | + | // on the value. Set [property@WrapLayout:justify-last-line] to justify the last | |
| 127 | + | // line as well. | |
| 128 | + | // | |
| 129 | + | // By default, `AdwWrapLayout` wraps as soon as the previous line cannot fit | |
| 130 | + | // any more children without shrinking them past their natural size. Set | |
| 131 | + | // [property@WrapLayout:wrap-policy] to [enum@Adw.WrapPolicy.MINIMUM] to only | |
| 132 | + | // wrap once all the children in the previous line have been shrunk to their | |
| 133 | + | // minimum size. | |
| 134 | + | // | |
| 135 | + | // To make each line take the same amount of space, set | |
| 136 | + | // [property@WrapLayout:line-homogeneous] to `TRUE`. | |
| 137 | + | // | |
| 138 | + | // Spacing and natural line length can scale with the text scale factor, use the | |
| 139 | + | // [property@WrapLayout:child-spacing-unit], | |
| 140 | + | // [property@WrapLayout:line-spacing-unit] and/or | |
| 141 | + | // [property@WrapLayout:natural-line-length-unit] properties to enable that | |
| 142 | + | // behavior. | |
| 143 | + | // | |
| 144 | + | // See [class@WrapBox]. | |
| 145 | + | type WrapLayout struct { | |
| 146 | + | gtk.LayoutManager | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | var xWrapLayoutGLibType func() types.GType | |
| 150 | + | ||
| 151 | + | func WrapLayoutGLibType() types.GType { | |
| 152 | + | return xWrapLayoutGLibType() | |
| 153 | + | } | |
| 154 | + | ||
| 155 | + | func WrapLayoutNewFromInternalPtr(ptr uintptr) *WrapLayout { | |
| 156 | + | cls := &WrapLayout{} | |
| 157 | + | cls.Ptr = ptr | |
| 158 | + | return cls | |
| 159 | + | } | |
| 160 | + | ||
| 161 | + | var xNewWrapLayout func() uintptr | |
| 162 | + | ||
| 163 | + | // Creates a new `AdwWrapLayout`. | |
| 164 | + | func NewWrapLayout() *WrapLayout { | |
| 165 | + | var cls *WrapLayout | |
| 166 | + | ||
| 167 | + | cret := xNewWrapLayout() | |
| 168 | + | ||
| 169 | + | if cret == 0 { | |
| 170 | + | return nil | |
| 171 | + | } | |
| 172 | + | cls = &WrapLayout{} | |
| 173 | + | cls.Ptr = cret | |
| 174 | + | return cls | |
| 175 | + | } | |
| 176 | + | ||
| 177 | + | var xWrapLayoutGetAlign func(uintptr) float32 | |
| 178 | + | ||
| 179 | + | // Gets the alignment of the children within each line. | |
| 180 | + | func (x *WrapLayout) GetAlign() float32 { | |
| 181 | + | ||
| 182 | + | cret := xWrapLayoutGetAlign(x.GoPointer()) | |
| 183 | + | return cret | |
| 184 | + | } | |
| 185 | + | ||
| 186 | + | var xWrapLayoutGetChildSpacing func(uintptr) int | |
| 187 | + | ||
| 188 | + | // Gets spacing between widgets on the same line. | |
| 189 | + | func (x *WrapLayout) GetChildSpacing() int { | |
| 190 | + | ||
| 191 | + | cret := xWrapLayoutGetChildSpacing(x.GoPointer()) | |
| 192 | + | return cret | |
| 193 | + | } | |
| 194 | + | ||
| 195 | + | var xWrapLayoutGetChildSpacingUnit func(uintptr) LengthUnit | |
| 196 | + | ||
| 197 | + | // Gets the length unit for child spacing. | |
| 198 | + | func (x *WrapLayout) GetChildSpacingUnit() LengthUnit { | |
| 199 | + | ||
| 200 | + | cret := xWrapLayoutGetChildSpacingUnit(x.GoPointer()) | |
| 201 | + | return cret | |
| 202 | + | } | |
| 203 | + | ||
| 204 | + | var xWrapLayoutGetJustify func(uintptr) JustifyMode | |
| 205 | + | ||
| 206 | + | // Gets whether and how each complete line is stretched to fill the entire widget. | |
| 207 | + | func (x *WrapLayout) GetJustify() JustifyMode { | |
| 208 | + | ||
| 209 | + | cret := xWrapLayoutGetJustify(x.GoPointer()) | |
| 210 | + | return cret | |
| 211 | + | } | |
| 212 | + | ||
| 213 | + | var xWrapLayoutGetJustifyLastLine func(uintptr) bool | |
| 214 | + | ||
| 215 | + | // Gets whether the last line should be stretched to fill the entire widget. | |
| 216 | + | func (x *WrapLayout) GetJustifyLastLine() bool { | |
| 217 | + | ||
| 218 | + | cret := xWrapLayoutGetJustifyLastLine(x.GoPointer()) | |
| 219 | + | return cret | |
| 220 | + | } | |
| 221 | + | ||
| 222 | + | var xWrapLayoutGetLineHomogeneous func(uintptr) bool | |
| 223 | + | ||
| 224 | + | // Gets whether all lines should take the same amount of space. | |
| 225 | + | func (x *WrapLayout) GetLineHomogeneous() bool { | |
| 226 | + | ||
| 227 | + | cret := xWrapLayoutGetLineHomogeneous(x.GoPointer()) | |
| 228 | + | return cret | |
| 229 | + | } | |
| 230 | + | ||
| 231 | + | var xWrapLayoutGetLineSpacing func(uintptr) int | |
| 232 | + | ||
| 233 | + | // Gets the spacing between lines. | |
| 234 | + | func (x *WrapLayout) GetLineSpacing() int { | |
| 235 | + | ||
| 236 | + | cret := xWrapLayoutGetLineSpacing(x.GoPointer()) | |
| 237 | + | return cret | |
| 238 | + | } | |
| 239 | + | ||
| 240 | + | var xWrapLayoutGetLineSpacingUnit func(uintptr) LengthUnit | |
| 241 | + | ||
| 242 | + | // Gets the length unit for line spacing. | |
| 243 | + | func (x *WrapLayout) GetLineSpacingUnit() LengthUnit { | |
| 244 | + | ||
| 245 | + | cret := xWrapLayoutGetLineSpacingUnit(x.GoPointer()) | |
| 246 | + | return cret | |
| 247 | + | } | |
| 248 | + | ||
| 249 | + | var xWrapLayoutGetNaturalLineLength func(uintptr) int | |
| 250 | + | ||
| 251 | + | // Gets the natural size for each line. | |
| 252 | + | func (x *WrapLayout) GetNaturalLineLength() int { | |
| 253 | + | ||
| 254 | + | cret := xWrapLayoutGetNaturalLineLength(x.GoPointer()) | |
| 255 | + | return cret | |
| 256 | + | } | |
| 257 | + | ||
| 258 | + | var xWrapLayoutGetNaturalLineLengthUnit func(uintptr) LengthUnit | |
| 259 | + | ||
| 260 | + | // Gets the length unit for line spacing. | |
| 261 | + | func (x *WrapLayout) GetNaturalLineLengthUnit() LengthUnit { | |
| 262 | + | ||
| 263 | + | cret := xWrapLayoutGetNaturalLineLengthUnit(x.GoPointer()) | |
| 264 | + | return cret | |
| 265 | + | } | |
| 266 | + | ||
| 267 | + | var xWrapLayoutGetPackDirection func(uintptr) PackDirection | |
| 268 | + | ||
| 269 | + | // Gets the direction children are packed in each line. | |
| 270 | + | func (x *WrapLayout) GetPackDirection() PackDirection { | |
| 271 | + | ||
| 272 | + | cret := xWrapLayoutGetPackDirection(x.GoPointer()) | |
| 273 | + | return cret | |
| 274 | + | } | |
| 275 | + | ||
| 276 | + | var xWrapLayoutGetWrapPolicy func(uintptr) WrapPolicy | |
| 277 | + | ||
| 278 | + | // Gets the policy for line wrapping. | |
| 279 | + | func (x *WrapLayout) GetWrapPolicy() WrapPolicy { | |
| 280 | + | ||
| 281 | + | cret := xWrapLayoutGetWrapPolicy(x.GoPointer()) | |
| 282 | + | return cret | |
| 283 | + | } | |
| 284 | + | ||
| 285 | + | var xWrapLayoutGetWrapReverse func(uintptr) bool | |
| 286 | + | ||
| 287 | + | // Gets whether wrap direction is reversed. | |
| 288 | + | func (x *WrapLayout) GetWrapReverse() bool { | |
| 289 | + | ||
| 290 | + | cret := xWrapLayoutGetWrapReverse(x.GoPointer()) | |
| 291 | + | return cret | |
| 292 | + | } | |
| 293 | + | ||
| 294 | + | var xWrapLayoutSetAlign func(uintptr, float32) | |
| 295 | + | ||
| 296 | + | // Sets the alignment of the children within each line. | |
| 297 | + | // | |
| 298 | + | // 0 means the children are placed at the start of the line, 1 means they are | |
| 299 | + | // placed at the end of the line. 0.5 means they are placed in the middle of the | |
| 300 | + | // line. | |
| 301 | + | // | |
| 302 | + | // Alignment is only used when [property@WrapLayout:justify] is set to | |
| 303 | + | // `ADW_JUSTIFY_NONE`, or on the last line when the | |
| 304 | + | // [property@WrapLayout:justify-last-line] is `FALSE`. | |
| 305 | + | func (x *WrapLayout) SetAlign(AlignVar float32) { | |
| 306 | + | ||
| 307 | + | xWrapLayoutSetAlign(x.GoPointer(), AlignVar) | |
| 308 | + | ||
| 309 | + | } | |
| 310 | + | ||
| 311 | + | var xWrapLayoutSetChildSpacing func(uintptr, int) | |
| 312 | + | ||
| 313 | + | // Sets the spacing between widgets on the same line. | |
| 314 | + | // | |
| 315 | + | // See [property@WrapLayout:child-spacing-unit]. | |
| 316 | + | func (x *WrapLayout) SetChildSpacing(ChildSpacingVar int) { | |
| 317 | + | ||
| 318 | + | xWrapLayoutSetChildSpacing(x.GoPointer(), ChildSpacingVar) | |
| 319 | + | ||
| 320 | + | } | |
| 321 | + | ||
| 322 | + | var xWrapLayoutSetChildSpacingUnit func(uintptr, LengthUnit) | |
| 323 | + | ||
| 324 | + | // Sets the length unit for child spacing. | |
| 325 | + | // | |
| 326 | + | // Allows the spacing to vary depending on the text scale factor. | |
| 327 | + | // | |
| 328 | + | // See [property@WrapLayout:child-spacing]. | |
| 329 | + | func (x *WrapLayout) SetChildSpacingUnit(UnitVar LengthUnit) { | |
| 330 | + | ||
| 331 | + | xWrapLayoutSetChildSpacingUnit(x.GoPointer(), UnitVar) | |
| 332 | + | ||
| 333 | + | } | |
| 334 | + | ||
| 335 | + | var xWrapLayoutSetJustify func(uintptr, JustifyMode) | |
| 336 | + | ||
| 337 | + | // Sets whether and how each complete line should be stretched to fill the | |
| 338 | + | // entire widget. | |
| 339 | + | // | |
| 340 | + | // If set to `ADW_JUSTIFY_FILL`, each widget in the line will be stretched, | |
| 341 | + | // keeping consistent spacing, so that the line fills the entire widget. | |
| 342 | + | // | |
| 343 | + | // If set to `ADW_JUSTIFY_SPREAD`, the spacing between widgets will be | |
| 344 | + | // increased, keeping widget sizes intact. The first and last widget will be | |
| 345 | + | // aligned with the beginning and end of the line. If the line only contains a | |
| 346 | + | // single widget, it will be stretched regardless. | |
| 347 | + | // | |
| 348 | + | // If set to `ADW_JUSTIFY_NONE`, the line will not be stretched and the children | |
| 349 | + | // will be placed together within the line, according to | |
| 350 | + | // [property@WrapLayout:align]. | |
| 351 | + | // | |
| 352 | + | // By default this doesn't affect the last line, as it will be incomplete. Use | |
| 353 | + | // [property@WrapLayout:justify-last-line] to justify it as well. | |
| 354 | + | func (x *WrapLayout) SetJustify(JustifyVar JustifyMode) { | |
| 355 | + | ||
| 356 | + | xWrapLayoutSetJustify(x.GoPointer(), JustifyVar) | |
| 357 | + | ||
| 358 | + | } | |
| 359 | + | ||
| 360 | + | var xWrapLayoutSetJustifyLastLine func(uintptr, bool) | |
| 361 | + | ||
| 362 | + | // Sets whether the last line should be stretched to fill the entire widget. | |
| 363 | + | // | |
| 364 | + | // See [property@WrapLayout:justify]. | |
| 365 | + | func (x *WrapLayout) SetJustifyLastLine(JustifyLastLineVar bool) { | |
| 366 | + | ||
| 367 | + | xWrapLayoutSetJustifyLastLine(x.GoPointer(), JustifyLastLineVar) | |
| 368 | + | ||
| 369 | + | } | |
| 370 | + | ||
| 371 | + | var xWrapLayoutSetLineHomogeneous func(uintptr, bool) | |
| 372 | + | ||
| 373 | + | // Sets whether all lines should take the same amount of space. | |
| 374 | + | func (x *WrapLayout) SetLineHomogeneous(HomogeneousVar bool) { | |
| 375 | + | ||
| 376 | + | xWrapLayoutSetLineHomogeneous(x.GoPointer(), HomogeneousVar) | |
| 377 | + | ||
| 378 | + | } | |
| 379 | + | ||
| 380 | + | var xWrapLayoutSetLineSpacing func(uintptr, int) | |
| 381 | + | ||
| 382 | + | // Sets the spacing between lines. | |
| 383 | + | // | |
| 384 | + | // See [property@WrapLayout:line-spacing-unit]. | |
| 385 | + | func (x *WrapLayout) SetLineSpacing(LineSpacingVar int) { | |
| 386 | + | ||
| 387 | + | xWrapLayoutSetLineSpacing(x.GoPointer(), LineSpacingVar) | |
| 388 | + | ||
| 389 | + | } | |
| 390 | + | ||
| 391 | + | var xWrapLayoutSetLineSpacingUnit func(uintptr, LengthUnit) | |
| 392 | + | ||
| 393 | + | // Sets the length unit for line spacing. | |
| 394 | + | // | |
| 395 | + | // Allows the spacing to vary depending on the text scale factor. | |
| 396 | + | // | |
| 397 | + | // See [property@WrapLayout:line-spacing]. | |
| 398 | + | func (x *WrapLayout) SetLineSpacingUnit(UnitVar LengthUnit) { | |
| 399 | + | ||
| 400 | + | xWrapLayoutSetLineSpacingUnit(x.GoPointer(), UnitVar) | |
| 401 | + | ||
| 402 | + | } | |
| 403 | + | ||
| 404 | + | var xWrapLayoutSetNaturalLineLength func(uintptr, int) | |
| 405 | + | ||
| 406 | + | // Sets the natural size for each line. | |
| 407 | + | // | |
| 408 | + | // It should be used to limit the line lengths, for example when used in | |
| 409 | + | // popovers. | |
| 410 | + | // | |
| 411 | + | // See [property@WrapLayout:natural-line-length-unit]. | |
| 412 | + | func (x *WrapLayout) SetNaturalLineLength(NaturalLineLengthVar int) { | |
| 413 | + | ||
| 414 | + | xWrapLayoutSetNaturalLineLength(x.GoPointer(), NaturalLineLengthVar) | |
| 415 | + | ||
| 416 | + | } | |
| 417 | + | ||
| 418 | + | var xWrapLayoutSetNaturalLineLengthUnit func(uintptr, LengthUnit) | |
| 419 | + | ||
| 420 | + | // Sets the length unit for natural line length. | |
| 421 | + | // | |
| 422 | + | // Allows the length to vary depending on the text scale factor. | |
| 423 | + | // | |
| 424 | + | // See [property@WrapLayout:natural-line-length]. | |
| 425 | + | func (x *WrapLayout) SetNaturalLineLengthUnit(UnitVar LengthUnit) { | |
| 426 | + | ||
| 427 | + | xWrapLayoutSetNaturalLineLengthUnit(x.GoPointer(), UnitVar) | |
| 428 | + | ||
| 429 | + | } | |
| 430 | + | ||
| 431 | + | var xWrapLayoutSetPackDirection func(uintptr, PackDirection) | |
| 432 | + | ||
| 433 | + | // Sets the direction children are packed in each line. | |
| 434 | + | func (x *WrapLayout) SetPackDirection(PackDirectionVar PackDirection) { | |
| 435 | + | ||
| 436 | + | xWrapLayoutSetPackDirection(x.GoPointer(), PackDirectionVar) | |
| 437 | + | ||
| 438 | + | } | |
| 439 | + | ||
| 440 | + | var xWrapLayoutSetWrapPolicy func(uintptr, WrapPolicy) | |
| 441 | + | ||
| 442 | + | // Sets the policy for line wrapping. | |
| 443 | + | // | |
| 444 | + | // If set to `ADW_WRAP_NATURAL`, the box will wrap to the next line as soon as | |
| 445 | + | // the previous line cannot fit any more children without shrinking them past | |
| 446 | + | // their natural size. | |
| 447 | + | // | |
| 448 | + | // If set to `ADW_WRAP_MINIMUM`, the box will try to fit as many children into | |
| 449 | + | // each line as possible, shrinking them down to their minimum size before | |
| 450 | + | // wrapping to the next line. | |
| 451 | + | func (x *WrapLayout) SetWrapPolicy(WrapPolicyVar WrapPolicy) { | |
| 452 | + | ||
| 453 | + | xWrapLayoutSetWrapPolicy(x.GoPointer(), WrapPolicyVar) | |
| 454 | + | ||
| 455 | + | } | |
| 456 | + | ||
| 457 | + | var xWrapLayoutSetWrapReverse func(uintptr, bool) | |
| 458 | + | ||
| 459 | + | // Sets whether wrap direction should be reversed. | |
| 460 | + | // | |
| 461 | + | // By default, lines wrap downwards in a horizontal box, and towards the end | |
| 462 | + | // in a vertical box. If set to `TRUE`, they wrap upwards or towards the start | |
| 463 | + | // respectively. | |
| 464 | + | func (x *WrapLayout) SetWrapReverse(WrapReverseVar bool) { | |
| 465 | + | ||
| 466 | + | xWrapLayoutSetWrapReverse(x.GoPointer(), WrapReverseVar) | |
| 467 | + | ||
| 468 | + | } | |
| 469 | + | ||
| 470 | + | func (c *WrapLayout) GoPointer() uintptr { | |
| 471 | + | if c == nil { | |
| 472 | + | return 0 | |
| 473 | + | } | |
| 474 | + | return c.Ptr | |
| 475 | + | } | |
| 476 | + | ||
| 477 | + | func (c *WrapLayout) SetGoPointer(ptr uintptr) { | |
| 478 | + | c.Ptr = ptr | |
| 479 | + | } | |
| 480 | + | ||
| 481 | + | // Retrieves the orientation of the @orientable. | |
| 482 | + | func (x *WrapLayout) GetOrientation() gtk.Orientation { | |
| 483 | + | ||
| 484 | + | cret := gtk.XGtkOrientableGetOrientation(x.GoPointer()) | |
| 485 | + | return cret | |
| 486 | + | } | |
| 487 | + | ||
| 488 | + | // Sets the orientation of the @orientable. | |
| 489 | + | func (x *WrapLayout) SetOrientation(OrientationVar gtk.Orientation) { | |
| 490 | + | ||
| 491 | + | gtk.XGtkOrientableSetOrientation(x.GoPointer(), OrientationVar) | |
| 492 | + | ||
| 493 | + | } | |
| 494 | + | ||
| 495 | + | func init() { | |
| 496 | + | core.SetPackageName("ADW", "libadwaita-1") | |
| 497 | + | core.SetSharedLibrary("ADW", "libadwaita-1.so.0") | |
| 498 | + | lib, err := purego.Dlopen(core.GetPath("ADW"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 499 | + | if err != nil { | |
| 500 | + | panic(err) | |
| 501 | + | } | |
| 502 | + | ||
| 503 | + | core.PuregoSafeRegister(&xJustifyModeGLibType, lib, "adw_justify_mode_get_type") | |
| 504 | + | ||
| 505 | + | core.PuregoSafeRegister(&xPackDirectionGLibType, lib, "adw_pack_direction_get_type") | |
| 506 | + | ||
| 507 | + | core.PuregoSafeRegister(&xWrapPolicyGLibType, lib, "adw_wrap_policy_get_type") | |
| 508 | + | ||
| 509 | + | core.PuregoSafeRegister(&xWrapLayoutGLibType, lib, "adw_wrap_layout_get_type") | |
| 510 | + | ||
| 511 | + | core.PuregoSafeRegister(&xNewWrapLayout, lib, "adw_wrap_layout_new") | |
| 512 | + | ||
| 513 | + | core.PuregoSafeRegister(&xWrapLayoutGetAlign, lib, "adw_wrap_layout_get_align") | |
| 514 | + | core.PuregoSafeRegister(&xWrapLayoutGetChildSpacing, lib, "adw_wrap_layout_get_child_spacing") | |
| 515 | + | core.PuregoSafeRegister(&xWrapLayoutGetChildSpacingUnit, lib, "adw_wrap_layout_get_child_spacing_unit") | |
| 516 | + | core.PuregoSafeRegister(&xWrapLayoutGetJustify, lib, "adw_wrap_layout_get_justify") | |
| 517 | + | core.PuregoSafeRegister(&xWrapLayoutGetJustifyLastLine, lib, "adw_wrap_layout_get_justify_last_line") | |
| 518 | + | core.PuregoSafeRegister(&xWrapLayoutGetLineHomogeneous, lib, "adw_wrap_layout_get_line_homogeneous") | |
| 519 | + | core.PuregoSafeRegister(&xWrapLayoutGetLineSpacing, lib, "adw_wrap_layout_get_line_spacing") | |
| 520 | + | core.PuregoSafeRegister(&xWrapLayoutGetLineSpacingUnit, lib, "adw_wrap_layout_get_line_spacing_unit") | |
| 521 | + | core.PuregoSafeRegister(&xWrapLayoutGetNaturalLineLength, lib, "adw_wrap_layout_get_natural_line_length") | |
| 522 | + | core.PuregoSafeRegister(&xWrapLayoutGetNaturalLineLengthUnit, lib, "adw_wrap_layout_get_natural_line_length_unit") | |
| 523 | + | core.PuregoSafeRegister(&xWrapLayoutGetPackDirection, lib, "adw_wrap_layout_get_pack_direction") | |
| 524 | + | core.PuregoSafeRegister(&xWrapLayoutGetWrapPolicy, lib, "adw_wrap_layout_get_wrap_policy") | |
| 525 | + | core.PuregoSafeRegister(&xWrapLayoutGetWrapReverse, lib, "adw_wrap_layout_get_wrap_reverse") | |
| 526 | + | core.PuregoSafeRegister(&xWrapLayoutSetAlign, lib, "adw_wrap_layout_set_align") | |
| 527 | + | core.PuregoSafeRegister(&xWrapLayoutSetChildSpacing, lib, "adw_wrap_layout_set_child_spacing") | |
| 528 | + | core.PuregoSafeRegister(&xWrapLayoutSetChildSpacingUnit, lib, "adw_wrap_layout_set_child_spacing_unit") | |
| 529 | + | core.PuregoSafeRegister(&xWrapLayoutSetJustify, lib, "adw_wrap_layout_set_justify") | |
| 530 | + | core.PuregoSafeRegister(&xWrapLayoutSetJustifyLastLine, lib, "adw_wrap_layout_set_justify_last_line") | |
| 531 | + | core.PuregoSafeRegister(&xWrapLayoutSetLineHomogeneous, lib, "adw_wrap_layout_set_line_homogeneous") | |
| 532 | + | core.PuregoSafeRegister(&xWrapLayoutSetLineSpacing, lib, "adw_wrap_layout_set_line_spacing") | |
| 533 | + | core.PuregoSafeRegister(&xWrapLayoutSetLineSpacingUnit, lib, "adw_wrap_layout_set_line_spacing_unit") | |
| 534 | + | core.PuregoSafeRegister(&xWrapLayoutSetNaturalLineLength, lib, "adw_wrap_layout_set_natural_line_length") | |
| 535 | + | core.PuregoSafeRegister(&xWrapLayoutSetNaturalLineLengthUnit, lib, "adw_wrap_layout_set_natural_line_length_unit") | |
| 536 | + | core.PuregoSafeRegister(&xWrapLayoutSetPackDirection, lib, "adw_wrap_layout_set_pack_direction") | |
| 537 | + | core.PuregoSafeRegister(&xWrapLayoutSetWrapPolicy, lib, "adw_wrap_layout_set_wrap_policy") | |
| 538 | + | core.PuregoSafeRegister(&xWrapLayoutSetWrapReverse, lib, "adw_wrap_layout_set_wrap_reverse") | |
| 539 | + | ||
| 540 | + | } | |
M v4/gdk/gdkapplaunchcontext.go +1 -1
| @@ -9,7 +9,7 @@ import ( | |||
| 9 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 10 | 10 | ) | |
| 11 | 11 | ||
| 12 | - | // `GdkAppLaunchContext` handles launching an application in a graphical context. | |
| 12 | + | // Handles launching an application in a graphical context. | |
| 13 | 13 | // | |
| 14 | 14 | // It is an implementation of `GAppLaunchContext` that provides startup | |
| 15 | 15 | // notification and allows to launch applications on a specific workspace. | |
M v4/gdk/gdkcairo.go +1 -1
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | ||
| 11 | 11 | var xCairoDrawFromGl func(*cairo.Context, uintptr, int, int, int, int, int, int, int) | |
| 12 | 12 | ||
| 13 | - | // The main way to not draw GL content in GTK. | |
| 13 | + | // Draws GL content onto a cairo context. | |
| 14 | 14 | // | |
| 15 | 15 | // It takes a render buffer ID (@source_type == GL_RENDERBUFFER) or a texture | |
| 16 | 16 | // id (@source_type == GL_TEXTURE) and draws it onto @cr with an OVER operation, | |
M v4/gdk/gdkcairocontext.go +1 -2
| @@ -8,8 +8,7 @@ import ( | |||
| 8 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | - | // `GdkCairoContext` is an object representing the platform-specific | |
| 12 | - | // draw context. | |
| 11 | + | // Represents the platform-specific draw context. | |
| 13 | 12 | // | |
| 14 | 13 | // `GdkCairoContext`s are created for a surface using | |
| 15 | 14 | // [method@Gdk.Surface.create_cairo_context], and the context | |
A v4/gdk/gdkcicpparams.go +226 -0
| @@ -0,0 +1,226 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 13 | + | ) | |
| 14 | + | ||
| 15 | + | type CicpParamsClass struct { | |
| 16 | + | _ structs.HostLayout | |
| 17 | + | } | |
| 18 | + | ||
| 19 | + | func (x *CicpParamsClass) GoPointer() uintptr { | |
| 20 | + | return uintptr(unsafe.Pointer(x)) | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | // The values of this enumeration describe whether image data uses | |
| 24 | + | // the full range of 8-bit values. | |
| 25 | + | // | |
| 26 | + | // In digital broadcasting, it is common to reserve the lowest and | |
| 27 | + | // highest values. Typically the allowed values for the narrow range | |
| 28 | + | // are 16-235 for Y and 16-240 for u,v (when dealing with YUV data). | |
| 29 | + | type CicpRange int | |
| 30 | + | ||
| 31 | + | var xCicpRangeGLibType func() types.GType | |
| 32 | + | ||
| 33 | + | func CicpRangeGLibType() types.GType { | |
| 34 | + | return xCicpRangeGLibType() | |
| 35 | + | } | |
| 36 | + | ||
| 37 | + | const ( | |
| 38 | + | ||
| 39 | + | // The values use the range of 16-235 (for Y) and 16-240 for u and v. | |
| 40 | + | CicpRangeNarrowValue CicpRange = 0 | |
| 41 | + | // The values use the full range. | |
| 42 | + | CicpRangeFullValue CicpRange = 1 | |
| 43 | + | ) | |
| 44 | + | ||
| 45 | + | // Contains the parameters that define a colorstate with cicp parameters. | |
| 46 | + | // | |
| 47 | + | // Cicp parameters are specified in the ITU-T H.273 | |
| 48 | + | // [specification](https://www.itu.int/rec/T-REC-H.273/en). | |
| 49 | + | // | |
| 50 | + | // See the documentation of individual properties for supported values. | |
| 51 | + | // | |
| 52 | + | // The 'unspecified' value (2) is not treated in any special way, and | |
| 53 | + | // must be replaced by a different value before creating a color state. | |
| 54 | + | // | |
| 55 | + | // `GdkCicpParams` can be used as a builder object to construct a color | |
| 56 | + | // state from Cicp data with [method@Gdk.CicpParams.build_color_state]. | |
| 57 | + | // The function will return an error if the given parameters are not | |
| 58 | + | // supported. | |
| 59 | + | // | |
| 60 | + | // You can obtain a `GdkCicpParams` object from a color state with | |
| 61 | + | // [method@Gdk.ColorState.create_cicp_params]. This can be used to | |
| 62 | + | // create a variant of a color state, by changing just one of the cicp | |
| 63 | + | // parameters, or just to obtain information about the color state. | |
| 64 | + | type CicpParams struct { | |
| 65 | + | gobject.Object | |
| 66 | + | } | |
| 67 | + | ||
| 68 | + | var xCicpParamsGLibType func() types.GType | |
| 69 | + | ||
| 70 | + | func CicpParamsGLibType() types.GType { | |
| 71 | + | return xCicpParamsGLibType() | |
| 72 | + | } | |
| 73 | + | ||
| 74 | + | func CicpParamsNewFromInternalPtr(ptr uintptr) *CicpParams { | |
| 75 | + | cls := &CicpParams{} | |
| 76 | + | cls.Ptr = ptr | |
| 77 | + | return cls | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var xNewCicpParams func() uintptr | |
| 81 | + | ||
| 82 | + | // Creates a new `GdkCicpParams` object. | |
| 83 | + | // | |
| 84 | + | // The initial values of the properties are the values for "undefined" | |
| 85 | + | // and need to be set before a color state object can be built. | |
| 86 | + | func NewCicpParams() *CicpParams { | |
| 87 | + | var cls *CicpParams | |
| 88 | + | ||
| 89 | + | cret := xNewCicpParams() | |
| 90 | + | ||
| 91 | + | if cret == 0 { | |
| 92 | + | return nil | |
| 93 | + | } | |
| 94 | + | cls = &CicpParams{} | |
| 95 | + | cls.Ptr = cret | |
| 96 | + | return cls | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | var xCicpParamsBuildColorState func(uintptr) *ColorState | |
| 100 | + | ||
| 101 | + | // Creates a new `GdkColorState` object for the cicp parameters in @self. | |
| 102 | + | // | |
| 103 | + | // Note that this may fail if the cicp parameters in @self are not | |
| 104 | + | // supported by GTK. In that case, `NULL` is returned, and @error is set | |
| 105 | + | // with an error message that can be presented to the user. | |
| 106 | + | func (x *CicpParams) BuildColorState() (*ColorState, error) { | |
| 107 | + | var cerr *glib.Error | |
| 108 | + | ||
| 109 | + | cret := xCicpParamsBuildColorState(x.GoPointer()) | |
| 110 | + | if cerr == nil { | |
| 111 | + | return cret, nil | |
| 112 | + | } | |
| 113 | + | return cret, cerr | |
| 114 | + | ||
| 115 | + | } | |
| 116 | + | ||
| 117 | + | var xCicpParamsGetColorPrimaries func(uintptr) uint | |
| 118 | + | ||
| 119 | + | // Returns the value of the color-primaries property | |
| 120 | + | // of @self. | |
| 121 | + | func (x *CicpParams) GetColorPrimaries() uint { | |
| 122 | + | ||
| 123 | + | cret := xCicpParamsGetColorPrimaries(x.GoPointer()) | |
| 124 | + | return cret | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | var xCicpParamsGetMatrixCoefficients func(uintptr) uint | |
| 128 | + | ||
| 129 | + | // Gets the matrix-coefficients property of @self. | |
| 130 | + | func (x *CicpParams) GetMatrixCoefficients() uint { | |
| 131 | + | ||
| 132 | + | cret := xCicpParamsGetMatrixCoefficients(x.GoPointer()) | |
| 133 | + | return cret | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | var xCicpParamsGetRange func(uintptr) CicpRange | |
| 137 | + | ||
| 138 | + | // Gets the range property of @self. | |
| 139 | + | func (x *CicpParams) GetRange() CicpRange { | |
| 140 | + | ||
| 141 | + | cret := xCicpParamsGetRange(x.GoPointer()) | |
| 142 | + | return cret | |
| 143 | + | } | |
| 144 | + | ||
| 145 | + | var xCicpParamsGetTransferFunction func(uintptr) uint | |
| 146 | + | ||
| 147 | + | // Gets the transfer-function property of @self. | |
| 148 | + | func (x *CicpParams) GetTransferFunction() uint { | |
| 149 | + | ||
| 150 | + | cret := xCicpParamsGetTransferFunction(x.GoPointer()) | |
| 151 | + | return cret | |
| 152 | + | } | |
| 153 | + | ||
| 154 | + | var xCicpParamsSetColorPrimaries func(uintptr, uint) | |
| 155 | + | ||
| 156 | + | // Sets the color-primaries property of @self. | |
| 157 | + | func (x *CicpParams) SetColorPrimaries(ColorPrimariesVar uint) { | |
| 158 | + | ||
| 159 | + | xCicpParamsSetColorPrimaries(x.GoPointer(), ColorPrimariesVar) | |
| 160 | + | ||
| 161 | + | } | |
| 162 | + | ||
| 163 | + | var xCicpParamsSetMatrixCoefficients func(uintptr, uint) | |
| 164 | + | ||
| 165 | + | // @self a `GdkCicpParams` | |
| 166 | + | // Sets the matrix-coefficients property of @self. | |
| 167 | + | func (x *CicpParams) SetMatrixCoefficients(MatrixCoefficientsVar uint) { | |
| 168 | + | ||
| 169 | + | xCicpParamsSetMatrixCoefficients(x.GoPointer(), MatrixCoefficientsVar) | |
| 170 | + | ||
| 171 | + | } | |
| 172 | + | ||
| 173 | + | var xCicpParamsSetRange func(uintptr, CicpRange) | |
| 174 | + | ||
| 175 | + | // Sets the range property of @self | |
| 176 | + | func (x *CicpParams) SetRange(RangeVar CicpRange) { | |
| 177 | + | ||
| 178 | + | xCicpParamsSetRange(x.GoPointer(), RangeVar) | |
| 179 | + | ||
| 180 | + | } | |
| 181 | + | ||
| 182 | + | var xCicpParamsSetTransferFunction func(uintptr, uint) | |
| 183 | + | ||
| 184 | + | // Sets the transfer-function property of @self. | |
| 185 | + | func (x *CicpParams) SetTransferFunction(TransferFunctionVar uint) { | |
| 186 | + | ||
| 187 | + | xCicpParamsSetTransferFunction(x.GoPointer(), TransferFunctionVar) | |
| 188 | + | ||
| 189 | + | } | |
| 190 | + | ||
| 191 | + | func (c *CicpParams) GoPointer() uintptr { | |
| 192 | + | if c == nil { | |
| 193 | + | return 0 | |
| 194 | + | } | |
| 195 | + | return c.Ptr | |
| 196 | + | } | |
| 197 | + | ||
| 198 | + | func (c *CicpParams) SetGoPointer(ptr uintptr) { | |
| 199 | + | c.Ptr = ptr | |
| 200 | + | } | |
| 201 | + | ||
| 202 | + | func init() { | |
| 203 | + | core.SetPackageName("GDK", "gtk4") | |
| 204 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 205 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 206 | + | if err != nil { | |
| 207 | + | panic(err) | |
| 208 | + | } | |
| 209 | + | ||
| 210 | + | core.PuregoSafeRegister(&xCicpRangeGLibType, lib, "gdk_cicp_range_get_type") | |
| 211 | + | ||
| 212 | + | core.PuregoSafeRegister(&xCicpParamsGLibType, lib, "gdk_cicp_params_get_type") | |
| 213 | + | ||
| 214 | + | core.PuregoSafeRegister(&xNewCicpParams, lib, "gdk_cicp_params_new") | |
| 215 | + | ||
| 216 | + | core.PuregoSafeRegister(&xCicpParamsBuildColorState, lib, "gdk_cicp_params_build_color_state") | |
| 217 | + | core.PuregoSafeRegister(&xCicpParamsGetColorPrimaries, lib, "gdk_cicp_params_get_color_primaries") | |
| 218 | + | core.PuregoSafeRegister(&xCicpParamsGetMatrixCoefficients, lib, "gdk_cicp_params_get_matrix_coefficients") | |
| 219 | + | core.PuregoSafeRegister(&xCicpParamsGetRange, lib, "gdk_cicp_params_get_range") | |
| 220 | + | core.PuregoSafeRegister(&xCicpParamsGetTransferFunction, lib, "gdk_cicp_params_get_transfer_function") | |
| 221 | + | core.PuregoSafeRegister(&xCicpParamsSetColorPrimaries, lib, "gdk_cicp_params_set_color_primaries") | |
| 222 | + | core.PuregoSafeRegister(&xCicpParamsSetMatrixCoefficients, lib, "gdk_cicp_params_set_matrix_coefficients") | |
| 223 | + | core.PuregoSafeRegister(&xCicpParamsSetRange, lib, "gdk_cicp_params_set_range") | |
| 224 | + | core.PuregoSafeRegister(&xCicpParamsSetTransferFunction, lib, "gdk_cicp_params_set_transfer_function") | |
| 225 | + | ||
| 226 | + | } | |
M v4/gdk/gdkclipboard.go +6 -20
| @@ -12,8 +12,7 @@ import ( | |||
| 12 | 12 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 13 | 13 | ) | |
| 14 | 14 | ||
| 15 | - | // The `GdkClipboard` object represents data shared between applications or | |
| 16 | - | // inside an application. | |
| 15 | + | // Represents data shared between applications or inside an application. | |
| 17 | 16 | // | |
| 18 | 17 | // To get a `GdkClipboard` object, use [method@Gdk.Display.get_clipboard] or | |
| 19 | 18 | // [method@Gdk.Display.get_primary_clipboard]. You can find out about the data | |
| @@ -111,9 +110,6 @@ var xClipboardReadAsync func(uintptr, []string, int, uintptr, uintptr, uintptr) | |||
| 111 | 110 | // Asynchronously requests an input stream to read the @clipboard's | |
| 112 | 111 | // contents from. | |
| 113 | 112 | // | |
| 114 | - | // When the operation is finished @callback will be called. You must then | |
| 115 | - | // call [method@Gdk.Clipboard.read_finish] to get the result of the operation. | |
| 116 | - | // | |
| 117 | 113 | // The clipboard will choose the most suitable mime type from the given list | |
| 118 | 114 | // to fulfill the request, preferring the ones listed first. | |
| 119 | 115 | func (x *Clipboard) ReadAsync(MimeTypesVar []string, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| @@ -149,9 +145,6 @@ var xClipboardReadTextAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 149 | 145 | ||
| 150 | 146 | // Asynchronously request the @clipboard contents converted to a string. | |
| 151 | 147 | // | |
| 152 | - | // When the operation is finished @callback will be called. You must then | |
| 153 | - | // call [method@Gdk.Clipboard.read_text_finish] to get the result. | |
| 154 | - | // | |
| 155 | 148 | // This is a simple wrapper around [method@Gdk.Clipboard.read_value_async]. | |
| 156 | 149 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | |
| 157 | 150 | // need more control over the operation. | |
| @@ -181,9 +174,6 @@ var xClipboardReadTextureAsync func(uintptr, uintptr, uintptr, uintptr) | |||
| 181 | 174 | ||
| 182 | 175 | // Asynchronously request the @clipboard contents converted to a `GdkPixbuf`. | |
| 183 | 176 | // | |
| 184 | - | // When the operation is finished @callback will be called. You must then | |
| 185 | - | // call [method@Gdk.Clipboard.read_texture_finish] to get the result. | |
| 186 | - | // | |
| 187 | 177 | // This is a simple wrapper around [method@Gdk.Clipboard.read_value_async]. | |
| 188 | 178 | // Use that function or [method@Gdk.Clipboard.read_async] directly if you | |
| 189 | 179 | // need more control over the operation. | |
| @@ -221,9 +211,6 @@ var xClipboardReadValueAsync func(uintptr, types.GType, int, uintptr, uintptr, u | |||
| 221 | 211 | // Asynchronously request the @clipboard contents converted to the given | |
| 222 | 212 | // @type. | |
| 223 | 213 | // | |
| 224 | - | // When the operation is finished @callback will be called. You must then call | |
| 225 | - | // [method@Gdk.Clipboard.read_value_finish] to get the resulting `GValue`. | |
| 226 | - | // | |
| 227 | 214 | // For local clipboard contents that are available in the given `GType`, | |
| 228 | 215 | // the value will be copied directly. Otherwise, GDK will try to use | |
| 229 | 216 | // [func@content_deserialize_async] to convert the clipboard's data. | |
| @@ -254,8 +241,8 @@ var xClipboardSet func(uintptr, types.GType, ...interface{}) | |||
| 254 | 241 | // Sets the clipboard to contain the value collected from the given varargs. | |
| 255 | 242 | // | |
| 256 | 243 | // Values should be passed the same way they are passed to other value | |
| 257 | - | // collecting APIs, such as [`method@GObject.Object.set`] or | |
| 258 | - | // [`func@GObject.signal_emit`]. | |
| 244 | + | // collecting APIs, such as [method@GObject.Object.set] or | |
| 245 | + | // [func@GObject.signal_emit]. | |
| 259 | 246 | // | |
| 260 | 247 | // ```c | |
| 261 | 248 | // gdk_clipboard_set (clipboard, GTK_TYPE_STRING, "Hello World"); | |
| @@ -330,15 +317,14 @@ var xClipboardStoreAsync func(uintptr, int, uintptr, uintptr, uintptr) | |||
| 330 | 317 | // | |
| 331 | 318 | // If the clipboard is not local, this function does nothing but report success. | |
| 332 | 319 | // | |
| 333 | - | // The @callback must call [method@Gdk.Clipboard.store_finish]. | |
| 334 | - | // | |
| 335 | 320 | // The purpose of this call is to preserve clipboard contents beyond the | |
| 336 | 321 | // lifetime of an application, so this function is typically called on | |
| 337 | 322 | // exit. Depending on the platform, the functionality may not be available | |
| 338 | 323 | // unless a "clipboard manager" is running. | |
| 339 | 324 | // | |
| 340 | - | // This function is called automatically when a [class@Gtk.Application] is | |
| 341 | - | // shut down, so you likely don't need to call it. | |
| 325 | + | // This function is called automatically when a | |
| 326 | + | // [GtkApplication](../gtk4/class.Application.html) | |
| 327 | + | // is shut down, so you likely don't need to call it. | |
| 342 | 328 | func (x *Clipboard) StoreAsync(IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 343 | 329 | ||
| 344 | 330 | xClipboardStoreAsync(x.GoPointer(), IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
A v4/gdk/gdkcolorstate.go +114 -0
| @@ -0,0 +1,114 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | + | ) | |
| 8 | + | ||
| 9 | + | var xColorStateGetOklab func() *ColorState | |
| 10 | + | ||
| 11 | + | // Returns the color state object representing the oklab color space. | |
| 12 | + | // | |
| 13 | + | // This is a perceptually uniform color state. | |
| 14 | + | func ColorStateGetOklab() *ColorState { | |
| 15 | + | ||
| 16 | + | cret := xColorStateGetOklab() | |
| 17 | + | return cret | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | var xColorStateGetOklch func() *ColorState | |
| 21 | + | ||
| 22 | + | // Returns the color state object representing the oklch color space. | |
| 23 | + | // | |
| 24 | + | // This is the polar variant of oklab, in which the hue is encoded as | |
| 25 | + | // a polar coordinate. | |
| 26 | + | func ColorStateGetOklch() *ColorState { | |
| 27 | + | ||
| 28 | + | cret := xColorStateGetOklch() | |
| 29 | + | return cret | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | var xColorStateGetRec2100Linear func() *ColorState | |
| 33 | + | ||
| 34 | + | // Returns the color state object representing the linear rec2100 color space. | |
| 35 | + | // | |
| 36 | + | // This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and a linear | |
| 37 | + | // transfer function. | |
| 38 | + | // | |
| 39 | + | // It is equivalent to the [Cicp](class.CicpParams.html) tuple 9/8/0/1. | |
| 40 | + | // | |
| 41 | + | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-linear) | |
| 42 | + | // for details about this colorstate. | |
| 43 | + | func ColorStateGetRec2100Linear() *ColorState { | |
| 44 | + | ||
| 45 | + | cret := xColorStateGetRec2100Linear() | |
| 46 | + | return cret | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | var xColorStateGetRec2100Pq func() *ColorState | |
| 50 | + | ||
| 51 | + | // Returns the color state object representing the rec2100-pq color space. | |
| 52 | + | // | |
| 53 | + | // This color state uses the primaries defined by BT.2020-2 and BT.2100-0 and the transfer | |
| 54 | + | // function defined by SMPTE ST 2084 and BT.2100-2. | |
| 55 | + | // | |
| 56 | + | // It is equivalent to the [Cicp](class.CicpParams.html) tuple 9/16/0/1. | |
| 57 | + | // | |
| 58 | + | // See e.g. [the CSS HDR Module](https://drafts.csswg.org/css-color-hdr/#valdef-color-rec2100-pq) | |
| 59 | + | // for details about this colorstate. | |
| 60 | + | func ColorStateGetRec2100Pq() *ColorState { | |
| 61 | + | ||
| 62 | + | cret := xColorStateGetRec2100Pq() | |
| 63 | + | return cret | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | var xColorStateGetSrgb func() *ColorState | |
| 67 | + | ||
| 68 | + | // Returns the color state object representing the sRGB color space. | |
| 69 | + | // | |
| 70 | + | // This color state uses the primaries defined by BT.709-6 and the transfer function | |
| 71 | + | // defined by IEC 61966-2-1. | |
| 72 | + | // | |
| 73 | + | // It is equivalent to the [Cicp](class.CicpParams.html) tuple 1/13/0/1. | |
| 74 | + | // | |
| 75 | + | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB) | |
| 76 | + | // for details about this colorstate. | |
| 77 | + | func ColorStateGetSrgb() *ColorState { | |
| 78 | + | ||
| 79 | + | cret := xColorStateGetSrgb() | |
| 80 | + | return cret | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | var xColorStateGetSrgbLinear func() *ColorState | |
| 84 | + | ||
| 85 | + | // Returns the color state object representing the linearized sRGB color space. | |
| 86 | + | // | |
| 87 | + | // This color state uses the primaries defined by BT.709-6 and a linear transfer function. | |
| 88 | + | // | |
| 89 | + | // It is equivalent to the [Cicp](class.CicpParams.html) tuple 1/8/0/1. | |
| 90 | + | // | |
| 91 | + | // See e.g. [the CSS Color Module](https://www.w3.org/TR/css-color-4/#predefined-sRGB-linear) | |
| 92 | + | // for details about this colorstate. | |
| 93 | + | func ColorStateGetSrgbLinear() *ColorState { | |
| 94 | + | ||
| 95 | + | cret := xColorStateGetSrgbLinear() | |
| 96 | + | return cret | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | func init() { | |
| 100 | + | core.SetPackageName("GDK", "gtk4") | |
| 101 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 102 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 103 | + | if err != nil { | |
| 104 | + | panic(err) | |
| 105 | + | } | |
| 106 | + | ||
| 107 | + | core.PuregoSafeRegister(&xColorStateGetOklab, lib, "gdk_color_state_get_oklab") | |
| 108 | + | core.PuregoSafeRegister(&xColorStateGetOklch, lib, "gdk_color_state_get_oklch") | |
| 109 | + | core.PuregoSafeRegister(&xColorStateGetRec2100Linear, lib, "gdk_color_state_get_rec2100_linear") | |
| 110 | + | core.PuregoSafeRegister(&xColorStateGetRec2100Pq, lib, "gdk_color_state_get_rec2100_pq") | |
| 111 | + | core.PuregoSafeRegister(&xColorStateGetSrgb, lib, "gdk_color_state_get_srgb") | |
| 112 | + | core.PuregoSafeRegister(&xColorStateGetSrgbLinear, lib, "gdk_color_state_get_srgb_linear") | |
| 113 | + | ||
| 114 | + | } | |
M v4/gdk/gdkcontentdeserializer.go +10 -14
| @@ -19,13 +19,10 @@ type ContentDeserializeFunc func(uintptr) | |||
| 19 | 19 | ||
| 20 | 20 | var xContentDeserializeAsync func(uintptr, string, types.GType, int, uintptr, uintptr, uintptr) | |
| 21 | 21 | ||
| 22 | - | // Read content from the given input stream and deserialize it, asynchronously. | |
| 22 | + | // Reads content from the given input stream and deserialize it, asynchronously. | |
| 23 | 23 | // | |
| 24 | - | // The default I/O priority is %G_PRIORITY_DEFAULT (i.e. 0), and lower numbers | |
| 24 | + | // The default I/O priority is `G_PRIORITY_DEFAULT` (i.e. 0), and lower numbers | |
| 25 | 25 | // indicate a higher priority. | |
| 26 | - | // | |
| 27 | - | // When the operation is finished, @callback will be called. You must then | |
| 28 | - | // call [func@Gdk.content_deserialize_finish] to get the result of the operation. | |
| 29 | 26 | func ContentDeserializeAsync(StreamVar *gio.InputStream, MimeTypeVar string, TypeVar types.GType, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 30 | 27 | ||
| 31 | 28 | xContentDeserializeAsync(StreamVar.GoPointer(), MimeTypeVar, TypeVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| @@ -55,8 +52,7 @@ func ContentRegisterDeserializer(MimeTypeVar string, TypeVar types.GType, Deseri | |||
| 55 | 52 | ||
| 56 | 53 | } | |
| 57 | 54 | ||
| 58 | - | // A `GdkContentDeserializer` is used to deserialize content received via | |
| 59 | - | // inter-application data transfers. | |
| 55 | + | // Deserializes content received via inter-application data transfers. | |
| 60 | 56 | // | |
| 61 | 57 | // The `GdkContentDeserializer` transforms serialized content that is | |
| 62 | 58 | // identified by a mime type into an object identified by a GType. | |
| @@ -218,7 +214,7 @@ func (c *ContentDeserializer) SetGoPointer(ptr uintptr) { | |||
| 218 | 214 | c.Ptr = ptr | |
| 219 | 215 | } | |
| 220 | 216 | ||
| 221 | - | // Gets the source object from a #GAsyncResult. | |
| 217 | + | // Gets the source object from a [iface@Gio.AsyncResult]. | |
| 222 | 218 | func (x *ContentDeserializer) GetSourceObject() *gobject.Object { | |
| 223 | 219 | var cls *gobject.Object | |
| 224 | 220 | ||
| @@ -240,14 +236,14 @@ func (x *ContentDeserializer) IsTagged(SourceTagVar uintptr) bool { | |||
| 240 | 236 | return cret | |
| 241 | 237 | } | |
| 242 | 238 | ||
| 243 | - | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| 244 | - | // g_simple_async_result_propagate_error(). Otherwise it returns | |
| 245 | - | // %FALSE. | |
| 239 | + | // If @res is a [class@Gio.SimpleAsyncResult], this is equivalent to | |
| 240 | + | // [method@Gio.SimpleAsyncResult.propagate_error]. Otherwise it returns | |
| 241 | + | // `FALSE`. | |
| 246 | 242 | // | |
| 247 | - | // This can be used for legacy error handling in async *_finish() | |
| 248 | - | // wrapper functions that traditionally handled #GSimpleAsyncResult | |
| 243 | + | // This can be used for legacy error handling in async `*_finish()` | |
| 244 | + | // wrapper functions that traditionally handled [class@Gio.SimpleAsyncResult] | |
| 249 | 245 | // error returns themselves rather than calling into the virtual method. | |
| 250 | - | // This should not be used in new code; #GAsyncResult errors that are | |
| 246 | + | // This should not be used in new code; [iface@Gio.AsyncResult] errors that are | |
| 251 | 247 | // set by virtual methods should also be extracted by virtual methods, | |
| 252 | 248 | // to enable subclasses to chain up correctly. | |
| 253 | 249 | func (x *ContentDeserializer) LegacyPropagateError() (bool, error) { | |
M v4/gdk/gdkcontentformats.go +1 -2
| @@ -11,8 +11,7 @@ import ( | |||
| 11 | 11 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | - | // A `GdkContentFormatsBuilder` is an auxiliary struct used to create | |
| 15 | - | // new `GdkContentFormats`, and should not be kept around. | |
| 14 | + | // Creates `GdkContentFormats` objects. | |
| 16 | 15 | type ContentFormatsBuilder struct { | |
| 17 | 16 | _ structs.HostLayout | |
| 18 | 17 | } | |
M v4/gdk/gdkcontentprovider.go +5 -7
| @@ -43,6 +43,7 @@ func (x *ContentProviderClass) GoPointer() uintptr { | |||
| 43 | 43 | } | |
| 44 | 44 | ||
| 45 | 45 | // OverrideContentChanged sets the callback function. | |
| 46 | + | // Signal class closure for `GdkContentProvider::content-changed` | |
| 46 | 47 | func (x *ContentProviderClass) OverrideContentChanged(cb func(*ContentProvider)) { | |
| 47 | 48 | if cb == nil { | |
| 48 | 49 | x.xContentChanged = 0 | |
| @@ -54,6 +55,7 @@ func (x *ContentProviderClass) OverrideContentChanged(cb func(*ContentProvider)) | |||
| 54 | 55 | } | |
| 55 | 56 | ||
| 56 | 57 | // GetContentChanged gets the callback function. | |
| 58 | + | // Signal class closure for `GdkContentProvider::content-changed` | |
| 57 | 59 | func (x *ContentProviderClass) GetContentChanged() func(*ContentProvider) { | |
| 58 | 60 | if x.xContentChanged == 0 { | |
| 59 | 61 | return nil | |
| @@ -226,8 +228,8 @@ func (x *ContentProviderClass) GetGetValue() func(*ContentProvider, *gobject.Val | |||
| 226 | 228 | } | |
| 227 | 229 | } | |
| 228 | 230 | ||
| 229 | - | // A `GdkContentProvider` is used to provide content for the clipboard or | |
| 230 | - | // for drag-and-drop operations in a number of formats. | |
| 231 | + | // Provides content for the clipboard or for drag-and-drop operations | |
| 232 | + | // in a number of formats. | |
| 231 | 233 | // | |
| 232 | 234 | // To create a `GdkContentProvider`, use [ctor@Gdk.ContentProvider.new_for_value] | |
| 233 | 235 | // or [ctor@Gdk.ContentProvider.new_for_bytes]. | |
| @@ -319,7 +321,7 @@ var xNewContentProviderUnion func(uintptr, uint) uintptr | |||
| 319 | 321 | // | |
| 320 | 322 | // gdk_content_provider_new_union ((GdkContentProvider *[2]) { | |
| 321 | 323 | // gdk_content_provider_new_typed (G_TYPE_FILE, file), | |
| 322 | - | // gdk_content_provider_new_typed (G_TYPE_TEXTURE, texture) | |
| 324 | + | // gdk_content_provider_new_typed (GDK_TYPE_TEXTURE, texture) | |
| 323 | 325 | // }, 2); | |
| 324 | 326 | // | |
| 325 | 327 | // ``` | |
| @@ -393,10 +395,6 @@ var xContentProviderWriteMimeTypeAsync func(uintptr, string, uintptr, int, uintp | |||
| 393 | 395 | // Asynchronously writes the contents of @provider to @stream in the given | |
| 394 | 396 | // @mime_type. | |
| 395 | 397 | // | |
| 396 | - | // When the operation is finished @callback will be called. You must then call | |
| 397 | - | // [method@Gdk.ContentProvider.write_mime_type_finish] to get the result | |
| 398 | - | // of the operation. | |
| 399 | - | // | |
| 400 | 398 | // The given mime type does not need to be listed in the formats returned by | |
| 401 | 399 | // [method@Gdk.ContentProvider.ref_formats]. However, if the given `GType` is | |
| 402 | 400 | // not supported, `G_IO_ERROR_NOT_SUPPORTED` will be reported. | |
M v4/gdk/gdkcontentserializer.go +8 -12
| @@ -32,9 +32,6 @@ var xContentSerializeAsync func(uintptr, string, *gobject.Value, int, uintptr, u | |||
| 32 | 32 | // | |
| 33 | 33 | // The default I/O priority is %G_PRIORITY_DEFAULT (i.e. 0), and lower numbers | |
| 34 | 34 | // indicate a higher priority. | |
| 35 | - | // | |
| 36 | - | // When the operation is finished, @callback will be called. You must then | |
| 37 | - | // call [func@Gdk.content_serialize_finish] to get the result of the operation. | |
| 38 | 35 | func ContentSerializeAsync(StreamVar *gio.OutputStream, MimeTypeVar string, ValueVar *gobject.Value, IoPriorityVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 39 | 36 | ||
| 40 | 37 | xContentSerializeAsync(StreamVar.GoPointer(), MimeTypeVar, ValueVar, IoPriorityVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| @@ -55,8 +52,7 @@ func ContentSerializeFinish(ResultVar gio.AsyncResult) (bool, error) { | |||
| 55 | 52 | ||
| 56 | 53 | } | |
| 57 | 54 | ||
| 58 | - | // A `GdkContentSerializer` is used to serialize content for | |
| 59 | - | // inter-application data transfers. | |
| 55 | + | // Serializes content for inter-application data transfers. | |
| 60 | 56 | // | |
| 61 | 57 | // The `GdkContentSerializer` transforms an object that is identified | |
| 62 | 58 | // by a GType into a serialized form (i.e. a byte stream) that is | |
| @@ -219,7 +215,7 @@ func (c *ContentSerializer) SetGoPointer(ptr uintptr) { | |||
| 219 | 215 | c.Ptr = ptr | |
| 220 | 216 | } | |
| 221 | 217 | ||
| 222 | - | // Gets the source object from a #GAsyncResult. | |
| 218 | + | // Gets the source object from a [iface@Gio.AsyncResult]. | |
| 223 | 219 | func (x *ContentSerializer) GetSourceObject() *gobject.Object { | |
| 224 | 220 | var cls *gobject.Object | |
| 225 | 221 | ||
| @@ -241,14 +237,14 @@ func (x *ContentSerializer) IsTagged(SourceTagVar uintptr) bool { | |||
| 241 | 237 | return cret | |
| 242 | 238 | } | |
| 243 | 239 | ||
| 244 | - | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| 245 | - | // g_simple_async_result_propagate_error(). Otherwise it returns | |
| 246 | - | // %FALSE. | |
| 240 | + | // If @res is a [class@Gio.SimpleAsyncResult], this is equivalent to | |
| 241 | + | // [method@Gio.SimpleAsyncResult.propagate_error]. Otherwise it returns | |
| 242 | + | // `FALSE`. | |
| 247 | 243 | // | |
| 248 | - | // This can be used for legacy error handling in async *_finish() | |
| 249 | - | // wrapper functions that traditionally handled #GSimpleAsyncResult | |
| 244 | + | // This can be used for legacy error handling in async `*_finish()` | |
| 245 | + | // wrapper functions that traditionally handled [class@Gio.SimpleAsyncResult] | |
| 250 | 246 | // error returns themselves rather than calling into the virtual method. | |
| 251 | - | // This should not be used in new code; #GAsyncResult errors that are | |
| 247 | + | // This should not be used in new code; [iface@Gio.AsyncResult] errors that are | |
| 252 | 248 | // set by virtual methods should also be extracted by virtual methods, | |
| 253 | 249 | // to enable subclasses to chain up correctly. | |
| 254 | 250 | func (x *ContentSerializer) LegacyPropagateError() (bool, error) { | |
M v4/gdk/gdkcursor.go +77 -13
| @@ -4,11 +4,26 @@ package gdk | |||
| 4 | 4 | import ( | |
| 5 | 5 | "github.com/jwijenbergh/purego" | |
| 6 | 6 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 7 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 8 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 9 | 10 | ) | |
| 10 | 11 | ||
| 11 | - | // `GdkCursor` is used to create and destroy cursors. | |
| 12 | + | // The type of callback used by a dynamic `GdkCursor` to generate | |
| 13 | + | // a texture for the cursor image at the given @cursor_size | |
| 14 | + | // and @scale. | |
| 15 | + | // | |
| 16 | + | // The actual cursor size in application pixels may be different | |
| 17 | + | // from @cursor_size x @cursor_size, and will be returned in | |
| 18 | + | // @width, @height. The returned texture should have a size that | |
| 19 | + | // corresponds to the actual cursor size, in device pixels (i.e. | |
| 20 | + | // application pixels, multiplied by @scale). | |
| 21 | + | // | |
| 22 | + | // This function may fail and return `NULL`, in which case | |
| 23 | + | // the fallback cursor will be used. | |
| 24 | + | type CursorGetTextureCallback func(uintptr, int, float64, int, int, int, int, uintptr) uintptr | |
| 25 | + | ||
| 26 | + | // Used to create and destroy cursors. | |
| 12 | 27 | // | |
| 13 | 28 | // Cursors are immutable objects, so once you created them, there is no way | |
| 14 | 29 | // to modify them later. You should create a new cursor when you want to change | |
| @@ -17,7 +32,8 @@ import ( | |||
| 17 | 32 | // Cursors by themselves are not very interesting: they must be bound to a | |
| 18 | 33 | // window for users to see them. This is done with [method@Gdk.Surface.set_cursor] | |
| 19 | 34 | // or [method@Gdk.Surface.set_device_cursor]. Applications will typically | |
| 20 | - | // use higher-level GTK functions such as [method@Gtk.Widget.set_cursor] instead. | |
| 35 | + | // use higher-level GTK functions such as [gtk_widget_set_cursor()](../gtk4/method.Widget.set_cursor.html) | |
| 36 | + | // instead. | |
| 21 | 37 | // | |
| 22 | 38 | // Cursors are not bound to a given [class@Gdk.Display], so they can be shared. | |
| 23 | 39 | // However, the appearance of cursors may vary when used on different | |
| @@ -57,6 +73,25 @@ func CursorNewFromInternalPtr(ptr uintptr) *Cursor { | |||
| 57 | 73 | return cls | |
| 58 | 74 | } | |
| 59 | 75 | ||
| 76 | + | var xNewCursorFromCallback func(uintptr, uintptr, uintptr, uintptr) uintptr | |
| 77 | + | ||
| 78 | + | // Creates a new callback-based cursor object. | |
| 79 | + | // | |
| 80 | + | // Cursors of this kind produce textures for the cursor | |
| 81 | + | // image on demand, when the @callback is called. | |
| 82 | + | func NewCursorFromCallback(CallbackVar *CursorGetTextureCallback, DataVar uintptr, DestroyVar *glib.DestroyNotify, FallbackVar *Cursor) *Cursor { | |
| 83 | + | var cls *Cursor | |
| 84 | + | ||
| 85 | + | cret := xNewCursorFromCallback(glib.NewCallback(CallbackVar), DataVar, glib.NewCallback(DestroyVar), FallbackVar.GoPointer()) | |
| 86 | + | ||
| 87 | + | if cret == 0 { | |
| 88 | + | return nil | |
| 89 | + | } | |
| 90 | + | cls = &Cursor{} | |
| 91 | + | cls.Ptr = cret | |
| 92 | + | return cls | |
| 93 | + | } | |
| 94 | + | ||
| 60 | 95 | var xNewCursorFromName func(string, uintptr) uintptr | |
| 61 | 96 | ||
| 62 | 97 | // Creates a new cursor by looking up @name in the current cursor | |
| @@ -65,17 +100,45 @@ var xNewCursorFromName func(string, uintptr) uintptr | |||
| 65 | 100 | // A recommended set of cursor names that will work across different | |
| 66 | 101 | // platforms can be found in the CSS specification: | |
| 67 | 102 | // | |
| 68 | - | // | | | | | | |
| 69 | - | // | --- | --- | ---- | --- | | |
| 70 | - | // | "none" |  "default" |  "help" |  "pointer" | | |
| 71 | - | // |  "context-menu" |  "progress" |  "wait" |  "cell" | | |
| 72 | - | // |  "crosshair" |  "text" |  "vertical-text" |  "alias" | | |
| 73 | - | // |  "copy" |  "no-drop" |  "move" |  "not-allowed" | | |
| 74 | - | // |  "grab" |  "grabbing" |  "all-scroll" |  "col-resize" | | |
| 75 | - | // |  "row-resize" |  "n-resize" |  "e-resize" |  "s-resize" | | |
| 76 | - | // |  "w-resize" |  "ne-resize" |  "nw-resize" |  "sw-resize" | | |
| 77 | - | // |  "se-resize" |  "ew-resize" |  "ns-resize" |  "nesw-resize" | | |
| 78 | - | // |  "nwse-resize" |  "zoom-in" |  "zoom-out" | | | |
| 103 | + | // | | | | | |
| 104 | + | // | --- | --- | --- | | |
| 105 | + | // | | "none" | No cursor | | |
| 106 | + | // |  | "default" | The default cursor | | |
| 107 | + | // |  | "help" | Help is available | | |
| 108 | + | // |  | "pointer" | Indicates a link or interactive element | | |
| 109 | + | // |  |"context-menu" | A context menu is available | | |
| 110 | + | // |  | "progress" | Progress indicator | | |
| 111 | + | // |  | "wait" | Busy cursor | | |
| 112 | + | // |  | "cell" | Cell(s) may be selected | | |
| 113 | + | // |  | "crosshair" | Simple crosshair | | |
| 114 | + | // |  | "text" | Text may be selected | | |
| 115 | + | // |  | "vertical-text" | Vertical text may be selected | | |
| 116 | + | // |  | "alias" | DND: Something will be linked | | |
| 117 | + | // |  | "copy" | DND: Something will be copied | | |
| 118 | + | // |  | "move" | DND: Something will be moved | | |
| 119 | + | // |  | "dnd-ask" | DND: User can choose action to be carried out | | |
| 120 | + | // |  | "no-drop" | DND: Can't drop here | | |
| 121 | + | // |  | "not-allowed" | DND: Action will not be carried out | | |
| 122 | + | // |  | "grab" | DND: Something can be grabbed | | |
| 123 | + | // |  | "grabbing" | DND: Something is being grabbed | | |
| 124 | + | // |  | "n-resize" | Resizing: Move north border | | |
| 125 | + | // |  | "e-resize" | Resizing: Move east border | | |
| 126 | + | // |  | "s-resize" | Resizing: Move south border | | |
| 127 | + | // |  | "w-resize" | Resizing: Move west border | | |
| 128 | + | // |  | "ne-resize" | Resizing: Move north-east corner | | |
| 129 | + | // |  | "nw-resize" | Resizing: Move north-west corner | | |
| 130 | + | // |  | "sw-resize" | Resizing: Move south-west corner | | |
| 131 | + | // |  | "se-resize" | Resizing: Move south-east corner | | |
| 132 | + | // |  | "col-resize" | Resizing: Move an item or border horizontally | | |
| 133 | + | // |  | "row-resize" | Resizing: Move an item or border vertically | | |
| 134 | + | // |  | "ew-resize" | Moving: Something can be moved horizontally | | |
| 135 | + | // |  | "ns-resize" | Moving: Something can be moved vertically | | |
| 136 | + | // |  | "nesw-resize" | Moving: Something can be moved diagonally, north-east to south-west | | |
| 137 | + | // |  | "nwse-resize" | Moving: something can be moved diagonally, north-west to south-east | | |
| 138 | + | // |  | "all-resize" | Moving: Something can be moved in any direction | | |
| 139 | + | // |  | "all-scroll" | Can scroll in any direction | | |
| 140 | + | // |  | "zoom-in" | Zoom in | | |
| 141 | + | // |  | "zoom-out" | Zoom out | | |
| 79 | 142 | func NewCursorFromName(NameVar string, FallbackVar *Cursor) *Cursor { | |
| 80 | 143 | var cls *Cursor | |
| 81 | 144 | ||
| @@ -209,6 +272,7 @@ func init() { | |||
| 209 | 272 | ||
| 210 | 273 | core.PuregoSafeRegister(&xCursorGLibType, lib, "gdk_cursor_get_type") | |
| 211 | 274 | ||
| 275 | + | core.PuregoSafeRegister(&xNewCursorFromCallback, lib, "gdk_cursor_new_from_callback") | |
| 212 | 276 | core.PuregoSafeRegister(&xNewCursorFromName, lib, "gdk_cursor_new_from_name") | |
| 213 | 277 | core.PuregoSafeRegister(&xNewCursorFromTexture, lib, "gdk_cursor_new_from_texture") | |
| 214 | 278 | ||
M v4/gdk/gdkdevice.go +29 -3
| @@ -13,7 +13,7 @@ import ( | |||
| 13 | 13 | "github.com/jwijenbergh/puregotk/v4/pango" | |
| 14 | 14 | ) | |
| 15 | 15 | ||
| 16 | - | // A `GdkTimeCoord` stores a single event in a motion history. | |
| 16 | + | // Stores a single event in a motion history. | |
| 17 | 17 | // | |
| 18 | 18 | // To check whether an axis is present, check whether the corresponding | |
| 19 | 19 | // flag from the [flags@Gdk.AxisFlags] enumeration is set in the @flags | |
| @@ -64,8 +64,7 @@ const ( | |||
| 64 | 64 | SourceTabletPadValue InputSource = 6 | |
| 65 | 65 | ) | |
| 66 | 66 | ||
| 67 | - | // The `GdkDevice` object represents an input device, such | |
| 68 | - | // as a keyboard, a mouse, or a touchpad. | |
| 67 | + | // Represents an input device, such as a keyboard, mouse or touchpad. | |
| 69 | 68 | // | |
| 70 | 69 | // See the [class@Gdk.Seat] documentation for more information | |
| 71 | 70 | // about the various kinds of devices, and their relationships. | |
| @@ -85,6 +84,20 @@ func DeviceNewFromInternalPtr(ptr uintptr) *Device { | |||
| 85 | 84 | return cls | |
| 86 | 85 | } | |
| 87 | 86 | ||
| 87 | + | var xDeviceGetActiveLayoutIndex func(uintptr) int | |
| 88 | + | ||
| 89 | + | // Retrieves the index of the active layout of the keyboard. | |
| 90 | + | // | |
| 91 | + | // If there is no valid active layout for the `GdkDevice`, this function will | |
| 92 | + | // return -1; | |
| 93 | + | // | |
| 94 | + | // This is only relevant for keyboard devices. | |
| 95 | + | func (x *Device) GetActiveLayoutIndex() int { | |
| 96 | + | ||
| 97 | + | cret := xDeviceGetActiveLayoutIndex(x.GoPointer()) | |
| 98 | + | return cret | |
| 99 | + | } | |
| 100 | + | ||
| 88 | 101 | var xDeviceGetCapsLockState func(uintptr) bool | |
| 89 | 102 | ||
| 90 | 103 | // Retrieves whether the Caps Lock modifier of the keyboard is locked. | |
| @@ -156,6 +169,17 @@ func (x *Device) GetHasCursor() bool { | |||
| 156 | 169 | return cret | |
| 157 | 170 | } | |
| 158 | 171 | ||
| 172 | + | var xDeviceGetLayoutNames func(uintptr) []string | |
| 173 | + | ||
| 174 | + | // Retrieves the names of the layouts of the keyboard. | |
| 175 | + | // | |
| 176 | + | // This is only relevant for keyboard devices. | |
| 177 | + | func (x *Device) GetLayoutNames() []string { | |
| 178 | + | ||
| 179 | + | cret := xDeviceGetLayoutNames(x.GoPointer()) | |
| 180 | + | return cret | |
| 181 | + | } | |
| 182 | + | ||
| 159 | 183 | var xDeviceGetModifierState func(uintptr) ModifierType | |
| 160 | 184 | ||
| 161 | 185 | // Retrieves the current modifier state of the keyboard. | |
| @@ -398,11 +422,13 @@ func init() { | |||
| 398 | 422 | ||
| 399 | 423 | core.PuregoSafeRegister(&xDeviceGLibType, lib, "gdk_device_get_type") | |
| 400 | 424 | ||
| 425 | + | core.PuregoSafeRegister(&xDeviceGetActiveLayoutIndex, lib, "gdk_device_get_active_layout_index") | |
| 401 | 426 | core.PuregoSafeRegister(&xDeviceGetCapsLockState, lib, "gdk_device_get_caps_lock_state") | |
| 402 | 427 | core.PuregoSafeRegister(&xDeviceGetDeviceTool, lib, "gdk_device_get_device_tool") | |
| 403 | 428 | core.PuregoSafeRegister(&xDeviceGetDirection, lib, "gdk_device_get_direction") | |
| 404 | 429 | core.PuregoSafeRegister(&xDeviceGetDisplay, lib, "gdk_device_get_display") | |
| 405 | 430 | core.PuregoSafeRegister(&xDeviceGetHasCursor, lib, "gdk_device_get_has_cursor") | |
| 431 | + | core.PuregoSafeRegister(&xDeviceGetLayoutNames, lib, "gdk_device_get_layout_names") | |
| 406 | 432 | core.PuregoSafeRegister(&xDeviceGetModifierState, lib, "gdk_device_get_modifier_state") | |
| 407 | 433 | core.PuregoSafeRegister(&xDeviceGetName, lib, "gdk_device_get_name") | |
| 408 | 434 | core.PuregoSafeRegister(&xDeviceGetNumLockState, lib, "gdk_device_get_num_lock_state") | |
M v4/gdk/gdkdevicepad.go +1 -2
| @@ -18,8 +18,7 @@ func (x *DevicePadInterface) GoPointer() uintptr { | |||
| 18 | 18 | return uintptr(unsafe.Pointer(x)) | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | - | // `GdkDevicePad` is an interface implemented by devices of type | |
| 22 | - | // %GDK_SOURCE_TABLET_PAD | |
| 21 | + | // An interface for tablet pad devices. | |
| 23 | 22 | // | |
| 24 | 23 | // It allows querying the features provided by the pad device. | |
| 25 | 24 | // | |
M v4/gdk/gdkdevicetool.go +2 -2
| @@ -68,7 +68,7 @@ var xDeviceToolGetHardwareId func(uintptr) uint64 | |||
| 68 | 68 | ||
| 69 | 69 | // Gets the hardware ID of this tool, or 0 if it's not known. | |
| 70 | 70 | // | |
| 71 | - | // When non-zero, the identificator is unique for the given tool model, | |
| 71 | + | // When non-zero, the identifier is unique for the given tool model, | |
| 72 | 72 | // meaning that two identical tools will share the same @hardware_id, | |
| 73 | 73 | // but will have different serial numbers (see | |
| 74 | 74 | // [method@Gdk.DeviceTool.get_serial]). | |
| @@ -76,7 +76,7 @@ var xDeviceToolGetHardwareId func(uintptr) uint64 | |||
| 76 | 76 | // This is a more concrete (and device specific) method to identify | |
| 77 | 77 | // a `GdkDeviceTool` than [method@Gdk.DeviceTool.get_tool_type], | |
| 78 | 78 | // as a tablet may support multiple devices with the same | |
| 79 | - | // `GdkDeviceToolType`, but different hardware identificators. | |
| 79 | + | // `GdkDeviceToolType`, but different hardware identifiers. | |
| 80 | 80 | func (x *DeviceTool) GetHardwareId() uint64 { | |
| 81 | 81 | ||
| 82 | 82 | cret := xDeviceToolGetHardwareId(x.GoPointer()) | |
M v4/gdk/gdkdisplay.go +35 -11
| @@ -12,7 +12,7 @@ import ( | |||
| 12 | 12 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 13 | 13 | ) | |
| 14 | 14 | ||
| 15 | - | // `GdkDisplay` objects are the GDK representation of a workstation. | |
| 15 | + | // A representation of a workstation. | |
| 16 | 16 | // | |
| 17 | 17 | // Their purpose are two-fold: | |
| 18 | 18 | // | |
| @@ -172,13 +172,27 @@ func (x *Display) GetDefaultSeat() *Seat { | |||
| 172 | 172 | return cls | |
| 173 | 173 | } | |
| 174 | 174 | ||
| 175 | + | var xDisplayGetDmabufFormats func(uintptr) *DmabufFormats | |
| 176 | + | ||
| 177 | + | // Returns the dma-buf formats that are supported on this display. | |
| 178 | + | // | |
| 179 | + | // GTK may use OpenGL or Vulkan to support some formats. | |
| 180 | + | // Calling this function will then initialize them if they aren't yet. | |
| 181 | + | // | |
| 182 | + | // The formats returned by this function can be used for negotiating | |
| 183 | + | // buffer formats with producers such as v4l, pipewire or GStreamer. | |
| 184 | + | // | |
| 185 | + | // To learn more about dma-bufs, see [class@Gdk.DmabufTextureBuilder]. | |
| 186 | + | func (x *Display) GetDmabufFormats() *DmabufFormats { | |
| 187 | + | ||
| 188 | + | cret := xDisplayGetDmabufFormats(x.GoPointer()) | |
| 189 | + | return cret | |
| 190 | + | } | |
| 191 | + | ||
| 175 | 192 | var xDisplayGetMonitorAtSurface func(uintptr, uintptr) uintptr | |
| 176 | 193 | ||
| 177 | 194 | // Gets the monitor in which the largest area of @surface | |
| 178 | 195 | // resides. | |
| 179 | - | // | |
| 180 | - | // Returns a monitor close to @surface if it is outside | |
| 181 | - | // of all monitors. | |
| 182 | 196 | func (x *Display) GetMonitorAtSurface(SurfaceVar *Surface) *Monitor { | |
| 183 | 197 | var cls *Monitor | |
| 184 | 198 | ||
| @@ -365,9 +379,9 @@ var xDisplayNotifyStartupComplete func(uintptr, string) | |||
| 365 | 379 | // Indicates to the GUI environment that the application has | |
| 366 | 380 | // finished loading, using a given identifier. | |
| 367 | 381 | // | |
| 368 | - | // GTK will call this function automatically for [class@Gtk.Window] | |
| 382 | + | // GTK will call this function automatically for [GtkWindow](../gtk4/class.Window.html) | |
| 369 | 383 | // with custom startup-notification identifier unless | |
| 370 | - | // [method@Gtk.Window.set_auto_startup_notification] | |
| 384 | + | // [gtk_window_set_auto_startup_notification()](../gtk4/method.Window.set_auto_startup_notification.html) | |
| 371 | 385 | // is called to disable that feature. | |
| 372 | 386 | func (x *Display) NotifyStartupComplete(StartupIdVar string) { | |
| 373 | 387 | ||
| @@ -404,11 +418,7 @@ func (x *Display) PrepareGl() (bool, error) { | |||
| 404 | 418 | ||
| 405 | 419 | var xDisplayPutEvent func(uintptr, uintptr) | |
| 406 | 420 | ||
| 407 | - | // Appends the given event onto the front of the event | |
| 408 | - | // queue for @display. | |
| 409 | - | // | |
| 410 | - | // This function is only useful in very special situations | |
| 411 | - | // and should not be used by applications. | |
| 421 | + | // Adds the given event to the event queue for @display. | |
| 412 | 422 | func (x *Display) PutEvent(EventVar *Event) { | |
| 413 | 423 | ||
| 414 | 424 | xDisplayPutEvent(x.GoPointer(), EventVar.GoPointer()) | |
| @@ -429,6 +439,18 @@ func (x *Display) SupportsInputShapes() bool { | |||
| 429 | 439 | return cret | |
| 430 | 440 | } | |
| 431 | 441 | ||
| 442 | + | var xDisplaySupportsShadowWidth func(uintptr) bool | |
| 443 | + | ||
| 444 | + | // Returns whether it's possible for a surface to draw outside of the window area. | |
| 445 | + | // | |
| 446 | + | // If %TRUE is returned the application decides if it wants to draw shadows. | |
| 447 | + | // If %FALSE is returned, the compositor decides if it wants to draw shadows. | |
| 448 | + | func (x *Display) SupportsShadowWidth() bool { | |
| 449 | + | ||
| 450 | + | cret := xDisplaySupportsShadowWidth(x.GoPointer()) | |
| 451 | + | return cret | |
| 452 | + | } | |
| 453 | + | ||
| 432 | 454 | var xDisplaySync func(uintptr) | |
| 433 | 455 | ||
| 434 | 456 | // Flushes any requests queued for the windowing system and waits until all | |
| @@ -643,6 +665,7 @@ func init() { | |||
| 643 | 665 | core.PuregoSafeRegister(&xDisplayGetAppLaunchContext, lib, "gdk_display_get_app_launch_context") | |
| 644 | 666 | core.PuregoSafeRegister(&xDisplayGetClipboard, lib, "gdk_display_get_clipboard") | |
| 645 | 667 | core.PuregoSafeRegister(&xDisplayGetDefaultSeat, lib, "gdk_display_get_default_seat") | |
| 668 | + | core.PuregoSafeRegister(&xDisplayGetDmabufFormats, lib, "gdk_display_get_dmabuf_formats") | |
| 646 | 669 | core.PuregoSafeRegister(&xDisplayGetMonitorAtSurface, lib, "gdk_display_get_monitor_at_surface") | |
| 647 | 670 | core.PuregoSafeRegister(&xDisplayGetMonitors, lib, "gdk_display_get_monitors") | |
| 648 | 671 | core.PuregoSafeRegister(&xDisplayGetName, lib, "gdk_display_get_name") | |
| @@ -659,6 +682,7 @@ func init() { | |||
| 659 | 682 | core.PuregoSafeRegister(&xDisplayPrepareGl, lib, "gdk_display_prepare_gl") | |
| 660 | 683 | core.PuregoSafeRegister(&xDisplayPutEvent, lib, "gdk_display_put_event") | |
| 661 | 684 | core.PuregoSafeRegister(&xDisplaySupportsInputShapes, lib, "gdk_display_supports_input_shapes") | |
| 685 | + | core.PuregoSafeRegister(&xDisplaySupportsShadowWidth, lib, "gdk_display_supports_shadow_width") | |
| 662 | 686 | core.PuregoSafeRegister(&xDisplaySync, lib, "gdk_display_sync") | |
| 663 | 687 | core.PuregoSafeRegister(&xDisplayTranslateKey, lib, "gdk_display_translate_key") | |
| 664 | 688 | ||
M v4/gdk/gdkdisplaymanager.go +4 -3
| @@ -52,8 +52,9 @@ func SetAllowedBackends(BackendsVar string) { | |||
| 52 | 52 | ||
| 53 | 53 | } | |
| 54 | 54 | ||
| 55 | - | // A singleton object that offers notification when displays appear or | |
| 56 | - | // disappear. | |
| 55 | + | // Offers notification when displays appear or disappear. | |
| 56 | + | // | |
| 57 | + | // `GdkDisplayManager` is a singleton object. | |
| 57 | 58 | // | |
| 58 | 59 | // You can use [func@Gdk.DisplayManager.get] to obtain the `GdkDisplayManager` | |
| 59 | 60 | // singleton, but that should be rarely necessary. Typically, initializing | |
| @@ -209,7 +210,7 @@ var xDisplayManagerGet func() uintptr | |||
| 209 | 210 | // with multiple backends). | |
| 210 | 211 | // | |
| 211 | 212 | // Applications can use [func@set_allowed_backends] to limit what | |
| 212 | - | // backends wil be used. | |
| 213 | + | // backends will be used. | |
| 213 | 214 | func DisplayManagerGet() *DisplayManager { | |
| 214 | 215 | var cls *DisplayManager | |
| 215 | 216 | ||
A v4/gdk/gdkdmabuftexture.go +316 -0
| @@ -0,0 +1,316 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 13 | + | ) | |
| 14 | + | ||
| 15 | + | type DmabufTextureClass struct { | |
| 16 | + | _ structs.HostLayout | |
| 17 | + | } | |
| 18 | + | ||
| 19 | + | func (x *DmabufTextureClass) GoPointer() uintptr { | |
| 20 | + | return uintptr(unsafe.Pointer(x)) | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | var xDmabufErrorQuark func() glib.Quark | |
| 24 | + | ||
| 25 | + | // Registers an error quark for [class@Gdk.DmabufTexture] errors. | |
| 26 | + | func DmabufErrorQuark() glib.Quark { | |
| 27 | + | ||
| 28 | + | cret := xDmabufErrorQuark() | |
| 29 | + | return cret | |
| 30 | + | } | |
| 31 | + | ||
| 32 | + | // A `GdkTexture` representing a DMA buffer. | |
| 33 | + | // | |
| 34 | + | // To create a `GdkDmabufTexture`, use the auxiliary | |
| 35 | + | // [class@Gdk.DmabufTextureBuilder] object. | |
| 36 | + | // | |
| 37 | + | // Dma-buf textures can only be created on Linux. | |
| 38 | + | type DmabufTexture struct { | |
| 39 | + | Texture | |
| 40 | + | } | |
| 41 | + | ||
| 42 | + | var xDmabufTextureGLibType func() types.GType | |
| 43 | + | ||
| 44 | + | func DmabufTextureGLibType() types.GType { | |
| 45 | + | return xDmabufTextureGLibType() | |
| 46 | + | } | |
| 47 | + | ||
| 48 | + | func DmabufTextureNewFromInternalPtr(ptr uintptr) *DmabufTexture { | |
| 49 | + | cls := &DmabufTexture{} | |
| 50 | + | cls.Ptr = ptr | |
| 51 | + | return cls | |
| 52 | + | } | |
| 53 | + | ||
| 54 | + | func (c *DmabufTexture) GoPointer() uintptr { | |
| 55 | + | if c == nil { | |
| 56 | + | return 0 | |
| 57 | + | } | |
| 58 | + | return c.Ptr | |
| 59 | + | } | |
| 60 | + | ||
| 61 | + | func (c *DmabufTexture) SetGoPointer(ptr uintptr) { | |
| 62 | + | c.Ptr = ptr | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | // Compute a concrete size for the `GdkPaintable`. | |
| 66 | + | // | |
| 67 | + | // Applies the sizing algorithm outlined in the | |
| 68 | + | // [CSS Image spec](https://drafts.csswg.org/css-images-3/#default-sizing) | |
| 69 | + | // to the given @paintable. See that link for more details. | |
| 70 | + | // | |
| 71 | + | // It is not necessary to call this function when both @specified_width | |
| 72 | + | // and @specified_height are known, but it is useful to call this | |
| 73 | + | // function in GtkWidget:measure implementations to compute the | |
| 74 | + | // other dimension when only one dimension is given. | |
| 75 | + | func (x *DmabufTexture) ComputeConcreteSize(SpecifiedWidthVar float64, SpecifiedHeightVar float64, DefaultWidthVar float64, DefaultHeightVar float64, ConcreteWidthVar float64, ConcreteHeightVar float64) { | |
| 76 | + | ||
| 77 | + | XGdkPaintableComputeConcreteSize(x.GoPointer(), SpecifiedWidthVar, SpecifiedHeightVar, DefaultWidthVar, DefaultHeightVar, ConcreteWidthVar, ConcreteHeightVar) | |
| 78 | + | ||
| 79 | + | } | |
| 80 | + | ||
| 81 | + | // Gets an immutable paintable for the current contents displayed by @paintable. | |
| 82 | + | // | |
| 83 | + | // This is useful when you want to retain the current state of an animation, | |
| 84 | + | // for example to take a screenshot of a running animation. | |
| 85 | + | // | |
| 86 | + | // If the @paintable is already immutable, it will return itself. | |
| 87 | + | func (x *DmabufTexture) GetCurrentImage() *PaintableBase { | |
| 88 | + | var cls *PaintableBase | |
| 89 | + | ||
| 90 | + | cret := XGdkPaintableGetCurrentImage(x.GoPointer()) | |
| 91 | + | ||
| 92 | + | if cret == 0 { | |
| 93 | + | return nil | |
| 94 | + | } | |
| 95 | + | cls = &PaintableBase{} | |
| 96 | + | cls.Ptr = cret | |
| 97 | + | return cls | |
| 98 | + | } | |
| 99 | + | ||
| 100 | + | // Get flags for the paintable. | |
| 101 | + | // | |
| 102 | + | // This is oftentimes useful for optimizations. | |
| 103 | + | // | |
| 104 | + | // See [flags@Gdk.PaintableFlags] for the flags and what they mean. | |
| 105 | + | func (x *DmabufTexture) GetFlags() PaintableFlags { | |
| 106 | + | ||
| 107 | + | cret := XGdkPaintableGetFlags(x.GoPointer()) | |
| 108 | + | return cret | |
| 109 | + | } | |
| 110 | + | ||
| 111 | + | // Gets the preferred aspect ratio the @paintable would like to be displayed at. | |
| 112 | + | // | |
| 113 | + | // The aspect ratio is the width divided by the height, so a value of 0.5 | |
| 114 | + | // means that the @paintable prefers to be displayed twice as high as it | |
| 115 | + | // is wide. Consumers of this interface can use this to preserve aspect | |
| 116 | + | // ratio when displaying the paintable. | |
| 117 | + | // | |
| 118 | + | // This is a purely informational value and does not in any way limit the | |
| 119 | + | // values that may be passed to [method@Gdk.Paintable.snapshot]. | |
| 120 | + | // | |
| 121 | + | // Usually when a @paintable returns nonzero values from | |
| 122 | + | // [method@Gdk.Paintable.get_intrinsic_width] and | |
| 123 | + | // [method@Gdk.Paintable.get_intrinsic_height] the aspect ratio | |
| 124 | + | // should conform to those values, though that is not required. | |
| 125 | + | // | |
| 126 | + | // If the @paintable does not have a preferred aspect ratio, | |
| 127 | + | // it returns 0. Negative values are never returned. | |
| 128 | + | func (x *DmabufTexture) GetIntrinsicAspectRatio() float64 { | |
| 129 | + | ||
| 130 | + | cret := XGdkPaintableGetIntrinsicAspectRatio(x.GoPointer()) | |
| 131 | + | return cret | |
| 132 | + | } | |
| 133 | + | ||
| 134 | + | // Gets the preferred height the @paintable would like to be displayed at. | |
| 135 | + | // | |
| 136 | + | // Consumers of this interface can use this to reserve enough space to draw | |
| 137 | + | // the paintable. | |
| 138 | + | // | |
| 139 | + | // This is a purely informational value and does not in any way limit the | |
| 140 | + | // values that may be passed to [method@Gdk.Paintable.snapshot]. | |
| 141 | + | // | |
| 142 | + | // If the @paintable does not have a preferred height, it returns 0. | |
| 143 | + | // Negative values are never returned. | |
| 144 | + | func (x *DmabufTexture) GetIntrinsicHeight() int { | |
| 145 | + | ||
| 146 | + | cret := XGdkPaintableGetIntrinsicHeight(x.GoPointer()) | |
| 147 | + | return cret | |
| 148 | + | } | |
| 149 | + | ||
| 150 | + | // Gets the preferred width the @paintable would like to be displayed at. | |
| 151 | + | // | |
| 152 | + | // Consumers of this interface can use this to reserve enough space to draw | |
| 153 | + | // the paintable. | |
| 154 | + | // | |
| 155 | + | // This is a purely informational value and does not in any way limit the | |
| 156 | + | // values that may be passed to [method@Gdk.Paintable.snapshot]. | |
| 157 | + | // | |
| 158 | + | // If the @paintable does not have a preferred width, it returns 0. | |
| 159 | + | // Negative values are never returned. | |
| 160 | + | func (x *DmabufTexture) GetIntrinsicWidth() int { | |
| 161 | + | ||
| 162 | + | cret := XGdkPaintableGetIntrinsicWidth(x.GoPointer()) | |
| 163 | + | return cret | |
| 164 | + | } | |
| 165 | + | ||
| 166 | + | // Called by implementations of `GdkPaintable` to invalidate their contents. | |
| 167 | + | // | |
| 168 | + | // Unless the contents are invalidated, implementations must guarantee that | |
| 169 | + | // multiple calls of [method@Gdk.Paintable.snapshot] produce the same output. | |
| 170 | + | // | |
| 171 | + | // This function will emit the [signal@Gdk.Paintable::invalidate-contents] | |
| 172 | + | // signal. | |
| 173 | + | // | |
| 174 | + | // If a @paintable reports the %GDK_PAINTABLE_STATIC_CONTENTS flag, | |
| 175 | + | // it must not call this function. | |
| 176 | + | func (x *DmabufTexture) InvalidateContents() { | |
| 177 | + | ||
| 178 | + | XGdkPaintableInvalidateContents(x.GoPointer()) | |
| 179 | + | ||
| 180 | + | } | |
| 181 | + | ||
| 182 | + | // Called by implementations of `GdkPaintable` to invalidate their size. | |
| 183 | + | // | |
| 184 | + | // As long as the size is not invalidated, @paintable must return the same | |
| 185 | + | // values for its intrinsic width, height and aspect ratio. | |
| 186 | + | // | |
| 187 | + | // This function will emit the [signal@Gdk.Paintable::invalidate-size] | |
| 188 | + | // signal. | |
| 189 | + | // | |
| 190 | + | // If a @paintable reports the %GDK_PAINTABLE_STATIC_SIZE flag, | |
| 191 | + | // it must not call this function. | |
| 192 | + | func (x *DmabufTexture) InvalidateSize() { | |
| 193 | + | ||
| 194 | + | XGdkPaintableInvalidateSize(x.GoPointer()) | |
| 195 | + | ||
| 196 | + | } | |
| 197 | + | ||
| 198 | + | // Snapshots the given paintable with the given @width and @height. | |
| 199 | + | // | |
| 200 | + | // The paintable is drawn at the current (0,0) offset of the @snapshot. | |
| 201 | + | // If @width and @height are not larger than zero, this function will | |
| 202 | + | // do nothing. | |
| 203 | + | func (x *DmabufTexture) Snapshot(SnapshotVar *Snapshot, WidthVar float64, HeightVar float64) { | |
| 204 | + | ||
| 205 | + | XGdkPaintableSnapshot(x.GoPointer(), SnapshotVar.GoPointer(), WidthVar, HeightVar) | |
| 206 | + | ||
| 207 | + | } | |
| 208 | + | ||
| 209 | + | // Checks if two icons are equal. | |
| 210 | + | func (x *DmabufTexture) Equal(Icon2Var gio.Icon) bool { | |
| 211 | + | ||
| 212 | + | cret := gio.XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 213 | + | return cret | |
| 214 | + | } | |
| 215 | + | ||
| 216 | + | // Gets a hash for an icon. | |
| 217 | + | func (x *DmabufTexture) Hash() uint { | |
| 218 | + | ||
| 219 | + | cret := gio.XGIconHash(x.GoPointer()) | |
| 220 | + | return cret | |
| 221 | + | } | |
| 222 | + | ||
| 223 | + | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| 224 | + | // back by calling g_icon_deserialize() on the returned value. | |
| 225 | + | // As serialization will avoid using raw icon data when possible, it only | |
| 226 | + | // makes sense to transfer the #GVariant between processes on the same machine, | |
| 227 | + | // (as opposed to over the network), and within the same file system namespace. | |
| 228 | + | func (x *DmabufTexture) Serialize() *glib.Variant { | |
| 229 | + | ||
| 230 | + | cret := gio.XGIconSerialize(x.GoPointer()) | |
| 231 | + | return cret | |
| 232 | + | } | |
| 233 | + | ||
| 234 | + | // Generates a textual representation of @icon that can be used for | |
| 235 | + | // serialization such as when passing @icon to a different process or | |
| 236 | + | // saving it to persistent storage. Use g_icon_new_for_string() to | |
| 237 | + | // get @icon back from the returned string. | |
| 238 | + | // | |
| 239 | + | // The encoding of the returned string is proprietary to #GIcon except | |
| 240 | + | // in the following two cases | |
| 241 | + | // | |
| 242 | + | // - If @icon is a #GFileIcon, the returned string is a native path | |
| 243 | + | // (such as `/path/to/my icon.png`) without escaping | |
| 244 | + | // if the #GFile for @icon is a native file. If the file is not | |
| 245 | + | // native, the returned string is the result of g_file_get_uri() | |
| 246 | + | // (such as `sftp://path/to/my%20icon.png`). | |
| 247 | + | // | |
| 248 | + | // - If @icon is a #GThemedIcon with exactly one name and no fallbacks, | |
| 249 | + | // the encoding is simply the name (such as `network-server`). | |
| 250 | + | func (x *DmabufTexture) ToString() string { | |
| 251 | + | ||
| 252 | + | cret := gio.XGIconToString(x.GoPointer()) | |
| 253 | + | return cret | |
| 254 | + | } | |
| 255 | + | ||
| 256 | + | // Loads a loadable icon. For the asynchronous version of this function, | |
| 257 | + | // see g_loadable_icon_load_async(). | |
| 258 | + | func (x *DmabufTexture) Load(SizeVar int, TypeVar string, CancellableVar *gio.Cancellable) (*gio.InputStream, error) { | |
| 259 | + | var cls *gio.InputStream | |
| 260 | + | var cerr *glib.Error | |
| 261 | + | ||
| 262 | + | cret := gio.XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 263 | + | ||
| 264 | + | if cret == 0 { | |
| 265 | + | return nil, cerr | |
| 266 | + | } | |
| 267 | + | cls = &gio.InputStream{} | |
| 268 | + | cls.Ptr = cret | |
| 269 | + | if cerr == nil { | |
| 270 | + | return cls, nil | |
| 271 | + | } | |
| 272 | + | return cls, cerr | |
| 273 | + | ||
| 274 | + | } | |
| 275 | + | ||
| 276 | + | // Loads an icon asynchronously. To finish this function, see | |
| 277 | + | // g_loadable_icon_load_finish(). For the synchronous, blocking | |
| 278 | + | // version of this function, see g_loadable_icon_load(). | |
| 279 | + | func (x *DmabufTexture) LoadAsync(SizeVar int, CancellableVar *gio.Cancellable, CallbackVar *gio.AsyncReadyCallback, UserDataVar uintptr) { | |
| 280 | + | ||
| 281 | + | gio.XGLoadableIconLoadAsync(x.GoPointer(), SizeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 282 | + | ||
| 283 | + | } | |
| 284 | + | ||
| 285 | + | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 286 | + | func (x *DmabufTexture) LoadFinish(ResVar gio.AsyncResult, TypeVar string) (*gio.InputStream, error) { | |
| 287 | + | var cls *gio.InputStream | |
| 288 | + | var cerr *glib.Error | |
| 289 | + | ||
| 290 | + | cret := gio.XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 291 | + | ||
| 292 | + | if cret == 0 { | |
| 293 | + | return nil, cerr | |
| 294 | + | } | |
| 295 | + | cls = &gio.InputStream{} | |
| 296 | + | cls.Ptr = cret | |
| 297 | + | if cerr == nil { | |
| 298 | + | return cls, nil | |
| 299 | + | } | |
| 300 | + | return cls, cerr | |
| 301 | + | ||
| 302 | + | } | |
| 303 | + | ||
| 304 | + | func init() { | |
| 305 | + | core.SetPackageName("GDK", "gtk4") | |
| 306 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 307 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 308 | + | if err != nil { | |
| 309 | + | panic(err) | |
| 310 | + | } | |
| 311 | + | ||
| 312 | + | core.PuregoSafeRegister(&xDmabufErrorQuark, lib, "gdk_dmabuf_error_quark") | |
| 313 | + | ||
| 314 | + | core.PuregoSafeRegister(&xDmabufTextureGLibType, lib, "gdk_dmabuf_texture_get_type") | |
| 315 | + | ||
| 316 | + | } | |
A v4/gdk/gdkdmabuftexturebuilder.go +488 -0
| @@ -0,0 +1,488 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/cairo" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 13 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 14 | + | ) | |
| 15 | + | ||
| 16 | + | type DmabufTextureBuilderClass struct { | |
| 17 | + | _ structs.HostLayout | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | func (x *DmabufTextureBuilderClass) GoPointer() uintptr { | |
| 21 | + | return uintptr(unsafe.Pointer(x)) | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | // Constructs [class@Gdk.Texture] objects from DMA buffers. | |
| 25 | + | // | |
| 26 | + | // DMA buffers are commonly called **_dma-bufs_**. | |
| 27 | + | // | |
| 28 | + | // DMA buffers are a feature of the Linux kernel to enable efficient buffer and | |
| 29 | + | // memory sharing between hardware such as codecs, GPUs, displays, cameras and the | |
| 30 | + | // kernel drivers controlling them. For example, a decoder may want its output to | |
| 31 | + | // be directly shared with the display server for rendering without a copy. | |
| 32 | + | // | |
| 33 | + | // Any device driver which participates in DMA buffer sharing, can do so as either | |
| 34 | + | // the exporter or importer of buffers (or both). | |
| 35 | + | // | |
| 36 | + | // The memory that is shared via DMA buffers is usually stored in non-system memory | |
| 37 | + | // (maybe in device's local memory or something else not directly accessible by the | |
| 38 | + | // CPU), and accessing this memory from the CPU may have higher-than-usual overhead. | |
| 39 | + | // | |
| 40 | + | // In particular for graphics data, it is not uncommon that data consists of multiple | |
| 41 | + | // separate blocks of memory, for example one block for each of the red, green and | |
| 42 | + | // blue channels. These blocks are called **_planes_**. DMA buffers can have up to | |
| 43 | + | // four planes. Even if the memory is a single block, the data can be organized in | |
| 44 | + | // multiple planes, by specifying offsets from the beginning of the data. | |
| 45 | + | // | |
| 46 | + | // DMA buffers are exposed to user-space as file descriptors allowing to pass them | |
| 47 | + | // between processes. If a DMA buffer has multiple planes, there is one file | |
| 48 | + | // descriptor per plane. | |
| 49 | + | // | |
| 50 | + | // The format of the data (for graphics data, essentially its colorspace) is described | |
| 51 | + | // by a 32-bit integer. These format identifiers are defined in the header file `drm_fourcc.h` | |
| 52 | + | // and commonly referred to as **_fourcc_** values, since they are identified by 4 ASCII | |
| 53 | + | // characters. Additionally, each DMA buffer has a **_modifier_**, which is a 64-bit integer | |
| 54 | + | // that describes driver-specific details of the memory layout, such as tiling or compression. | |
| 55 | + | // | |
| 56 | + | // For historical reasons, some producers of dma-bufs don't provide an explicit modifier, but | |
| 57 | + | // instead return `DMA_FORMAT_MOD_INVALID` to indicate that their modifier is **_implicit_**. | |
| 58 | + | // GTK tries to accommodate this situation by accepting `DMA_FORMAT_MOD_INVALID` as modifier. | |
| 59 | + | // | |
| 60 | + | // The operation of `GdkDmabufTextureBuilder` is quite simple: Create a texture builder, | |
| 61 | + | // set all the necessary properties, and then call [method@Gdk.DmabufTextureBuilder.build] | |
| 62 | + | // to create the new texture. | |
| 63 | + | // | |
| 64 | + | // The required properties for a dma-buf texture are | |
| 65 | + | // | |
| 66 | + | // - The width and height in pixels | |
| 67 | + | // | |
| 68 | + | // - The `fourcc` code and `modifier` which identify the format and memory layout of the dma-buf | |
| 69 | + | // | |
| 70 | + | // - The file descriptor, offset and stride for each of the planes | |
| 71 | + | // | |
| 72 | + | // `GdkDmabufTextureBuilder` can be used for quick one-shot construction of | |
| 73 | + | // textures as well as kept around and reused to construct multiple textures. | |
| 74 | + | // | |
| 75 | + | // # For further information, see | |
| 76 | + | // | |
| 77 | + | // * The Linux kernel [documentation](https://docs.kernel.org/driver-api/dma-buf.html) | |
| 78 | + | // | |
| 79 | + | // * The header file [drm_fourcc.h](https://gitlab.freedesktop.org/mesa/drm/-/blob/main/include/drm/drm_fourcc.h) | |
| 80 | + | type DmabufTextureBuilder struct { | |
| 81 | + | gobject.Object | |
| 82 | + | } | |
| 83 | + | ||
| 84 | + | var xDmabufTextureBuilderGLibType func() types.GType | |
| 85 | + | ||
| 86 | + | func DmabufTextureBuilderGLibType() types.GType { | |
| 87 | + | return xDmabufTextureBuilderGLibType() | |
| 88 | + | } | |
| 89 | + | ||
| 90 | + | func DmabufTextureBuilderNewFromInternalPtr(ptr uintptr) *DmabufTextureBuilder { | |
| 91 | + | cls := &DmabufTextureBuilder{} | |
| 92 | + | cls.Ptr = ptr | |
| 93 | + | return cls | |
| 94 | + | } | |
| 95 | + | ||
| 96 | + | var xNewDmabufTextureBuilder func() uintptr | |
| 97 | + | ||
| 98 | + | // Creates a new texture builder. | |
| 99 | + | func NewDmabufTextureBuilder() *DmabufTextureBuilder { | |
| 100 | + | var cls *DmabufTextureBuilder | |
| 101 | + | ||
| 102 | + | cret := xNewDmabufTextureBuilder() | |
| 103 | + | ||
| 104 | + | if cret == 0 { | |
| 105 | + | return nil | |
| 106 | + | } | |
| 107 | + | cls = &DmabufTextureBuilder{} | |
| 108 | + | cls.Ptr = cret | |
| 109 | + | return cls | |
| 110 | + | } | |
| 111 | + | ||
| 112 | + | var xDmabufTextureBuilderBuild func(uintptr, uintptr, uintptr, **glib.Error) uintptr | |
| 113 | + | ||
| 114 | + | // Builds a new `GdkTexture` with the values set up in the builder. | |
| 115 | + | // | |
| 116 | + | // It is a programming error to call this function if any mandatory property has not been set. | |
| 117 | + | // | |
| 118 | + | // Not all formats defined in the `drm_fourcc.h` header are supported. You can use | |
| 119 | + | // [method@Gdk.Display.get_dmabuf_formats] to get a list of supported formats. If the | |
| 120 | + | // format is not supported by GTK, %NULL will be returned and @error will be set. | |
| 121 | + | // | |
| 122 | + | // The `destroy` function gets called when the returned texture gets released. | |
| 123 | + | // | |
| 124 | + | // It is the responsibility of the caller to keep the file descriptors for the planes | |
| 125 | + | // open until the created texture is no longer used, and close them afterwards (possibly | |
| 126 | + | // using the @destroy notify). | |
| 127 | + | // | |
| 128 | + | // It is possible to call this function multiple times to create multiple textures, | |
| 129 | + | // possibly with changing properties in between. | |
| 130 | + | func (x *DmabufTextureBuilder) Build(DestroyVar *glib.DestroyNotify, DataVar uintptr) (*Texture, error) { | |
| 131 | + | var cls *Texture | |
| 132 | + | var cerr *glib.Error | |
| 133 | + | ||
| 134 | + | cret := xDmabufTextureBuilderBuild(x.GoPointer(), glib.NewCallbackNullable(DestroyVar), DataVar, &cerr) | |
| 135 | + | ||
| 136 | + | if cret == 0 { | |
| 137 | + | return nil, cerr | |
| 138 | + | } | |
| 139 | + | cls = &Texture{} | |
| 140 | + | cls.Ptr = cret | |
| 141 | + | if cerr == nil { | |
| 142 | + | return cls, nil | |
| 143 | + | } | |
| 144 | + | return cls, cerr | |
| 145 | + | ||
| 146 | + | } | |
| 147 | + | ||
| 148 | + | var xDmabufTextureBuilderGetColorState func(uintptr) *ColorState | |
| 149 | + | ||
| 150 | + | // Gets the color state previously set via gdk_dmabuf_texture_builder_set_color_state(). | |
| 151 | + | func (x *DmabufTextureBuilder) GetColorState() *ColorState { | |
| 152 | + | ||
| 153 | + | cret := xDmabufTextureBuilderGetColorState(x.GoPointer()) | |
| 154 | + | return cret | |
| 155 | + | } | |
| 156 | + | ||
| 157 | + | var xDmabufTextureBuilderGetDisplay func(uintptr) uintptr | |
| 158 | + | ||
| 159 | + | // Returns the display that this texture builder is | |
| 160 | + | // associated with. | |
| 161 | + | func (x *DmabufTextureBuilder) GetDisplay() *Display { | |
| 162 | + | var cls *Display | |
| 163 | + | ||
| 164 | + | cret := xDmabufTextureBuilderGetDisplay(x.GoPointer()) | |
| 165 | + | ||
| 166 | + | if cret == 0 { | |
| 167 | + | return nil | |
| 168 | + | } | |
| 169 | + | gobject.IncreaseRef(cret) | |
| 170 | + | cls = &Display{} | |
| 171 | + | cls.Ptr = cret | |
| 172 | + | return cls | |
| 173 | + | } | |
| 174 | + | ||
| 175 | + | var xDmabufTextureBuilderGetFd func(uintptr, uint) int | |
| 176 | + | ||
| 177 | + | // Gets the file descriptor for a plane. | |
| 178 | + | func (x *DmabufTextureBuilder) GetFd(PlaneVar uint) int { | |
| 179 | + | ||
| 180 | + | cret := xDmabufTextureBuilderGetFd(x.GoPointer(), PlaneVar) | |
| 181 | + | return cret | |
| 182 | + | } | |
| 183 | + | ||
| 184 | + | var xDmabufTextureBuilderGetFourcc func(uintptr) uint32 | |
| 185 | + | ||
| 186 | + | // Gets the format previously set via gdk_dmabuf_texture_builder_set_fourcc() | |
| 187 | + | // or 0 if the format wasn't set. | |
| 188 | + | // | |
| 189 | + | // The format is specified as a fourcc code. | |
| 190 | + | func (x *DmabufTextureBuilder) GetFourcc() uint32 { | |
| 191 | + | ||
| 192 | + | cret := xDmabufTextureBuilderGetFourcc(x.GoPointer()) | |
| 193 | + | return cret | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | var xDmabufTextureBuilderGetHeight func(uintptr) uint | |
| 197 | + | ||
| 198 | + | // Gets the height previously set via gdk_dmabuf_texture_builder_set_height() or | |
| 199 | + | // 0 if the height wasn't set. | |
| 200 | + | func (x *DmabufTextureBuilder) GetHeight() uint { | |
| 201 | + | ||
| 202 | + | cret := xDmabufTextureBuilderGetHeight(x.GoPointer()) | |
| 203 | + | return cret | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | var xDmabufTextureBuilderGetModifier func(uintptr) uint64 | |
| 207 | + | ||
| 208 | + | // Gets the modifier value. | |
| 209 | + | func (x *DmabufTextureBuilder) GetModifier() uint64 { | |
| 210 | + | ||
| 211 | + | cret := xDmabufTextureBuilderGetModifier(x.GoPointer()) | |
| 212 | + | return cret | |
| 213 | + | } | |
| 214 | + | ||
| 215 | + | var xDmabufTextureBuilderGetNPlanes func(uintptr) uint | |
| 216 | + | ||
| 217 | + | // Gets the number of planes. | |
| 218 | + | func (x *DmabufTextureBuilder) GetNPlanes() uint { | |
| 219 | + | ||
| 220 | + | cret := xDmabufTextureBuilderGetNPlanes(x.GoPointer()) | |
| 221 | + | return cret | |
| 222 | + | } | |
| 223 | + | ||
| 224 | + | var xDmabufTextureBuilderGetOffset func(uintptr, uint) uint | |
| 225 | + | ||
| 226 | + | // Gets the offset value for a plane. | |
| 227 | + | func (x *DmabufTextureBuilder) GetOffset(PlaneVar uint) uint { | |
| 228 | + | ||
| 229 | + | cret := xDmabufTextureBuilderGetOffset(x.GoPointer(), PlaneVar) | |
| 230 | + | return cret | |
| 231 | + | } | |
| 232 | + | ||
| 233 | + | var xDmabufTextureBuilderGetPremultiplied func(uintptr) bool | |
| 234 | + | ||
| 235 | + | // Whether the data is premultiplied. | |
| 236 | + | func (x *DmabufTextureBuilder) GetPremultiplied() bool { | |
| 237 | + | ||
| 238 | + | cret := xDmabufTextureBuilderGetPremultiplied(x.GoPointer()) | |
| 239 | + | return cret | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | var xDmabufTextureBuilderGetStride func(uintptr, uint) uint | |
| 243 | + | ||
| 244 | + | // Gets the stride value for a plane. | |
| 245 | + | func (x *DmabufTextureBuilder) GetStride(PlaneVar uint) uint { | |
| 246 | + | ||
| 247 | + | cret := xDmabufTextureBuilderGetStride(x.GoPointer(), PlaneVar) | |
| 248 | + | return cret | |
| 249 | + | } | |
| 250 | + | ||
| 251 | + | var xDmabufTextureBuilderGetUpdateRegion func(uintptr) *cairo.Region | |
| 252 | + | ||
| 253 | + | // Gets the region previously set via gdk_dmabuf_texture_builder_set_update_region() or | |
| 254 | + | // %NULL if none was set. | |
| 255 | + | func (x *DmabufTextureBuilder) GetUpdateRegion() *cairo.Region { | |
| 256 | + | ||
| 257 | + | cret := xDmabufTextureBuilderGetUpdateRegion(x.GoPointer()) | |
| 258 | + | return cret | |
| 259 | + | } | |
| 260 | + | ||
| 261 | + | var xDmabufTextureBuilderGetUpdateTexture func(uintptr) uintptr | |
| 262 | + | ||
| 263 | + | // Gets the texture previously set via gdk_dmabuf_texture_builder_set_update_texture() or | |
| 264 | + | // %NULL if none was set. | |
| 265 | + | func (x *DmabufTextureBuilder) GetUpdateTexture() *Texture { | |
| 266 | + | var cls *Texture | |
| 267 | + | ||
| 268 | + | cret := xDmabufTextureBuilderGetUpdateTexture(x.GoPointer()) | |
| 269 | + | ||
| 270 | + | if cret == 0 { | |
| 271 | + | return nil | |
| 272 | + | } | |
| 273 | + | gobject.IncreaseRef(cret) | |
| 274 | + | cls = &Texture{} | |
| 275 | + | cls.Ptr = cret | |
| 276 | + | return cls | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | var xDmabufTextureBuilderGetWidth func(uintptr) uint | |
| 280 | + | ||
| 281 | + | // Gets the width previously set via gdk_dmabuf_texture_builder_set_width() or | |
| 282 | + | // 0 if the width wasn't set. | |
| 283 | + | func (x *DmabufTextureBuilder) GetWidth() uint { | |
| 284 | + | ||
| 285 | + | cret := xDmabufTextureBuilderGetWidth(x.GoPointer()) | |
| 286 | + | return cret | |
| 287 | + | } | |
| 288 | + | ||
| 289 | + | var xDmabufTextureBuilderSetColorState func(uintptr, *ColorState) | |
| 290 | + | ||
| 291 | + | // Sets the color state for the texture. | |
| 292 | + | // | |
| 293 | + | // By default, the colorstate is `NULL`. In that case, GTK will choose the | |
| 294 | + | // correct colorstate based on the format. | |
| 295 | + | // If you don't know what colorstates are, this is probably the right thing. | |
| 296 | + | func (x *DmabufTextureBuilder) SetColorState(ColorStateVar *ColorState) { | |
| 297 | + | ||
| 298 | + | xDmabufTextureBuilderSetColorState(x.GoPointer(), ColorStateVar) | |
| 299 | + | ||
| 300 | + | } | |
| 301 | + | ||
| 302 | + | var xDmabufTextureBuilderSetDisplay func(uintptr, uintptr) | |
| 303 | + | ||
| 304 | + | // Sets the display that this texture builder is | |
| 305 | + | // associated with. | |
| 306 | + | // | |
| 307 | + | // The display is used to determine the supported | |
| 308 | + | // dma-buf formats. | |
| 309 | + | func (x *DmabufTextureBuilder) SetDisplay(DisplayVar *Display) { | |
| 310 | + | ||
| 311 | + | xDmabufTextureBuilderSetDisplay(x.GoPointer(), DisplayVar.GoPointer()) | |
| 312 | + | ||
| 313 | + | } | |
| 314 | + | ||
| 315 | + | var xDmabufTextureBuilderSetFd func(uintptr, uint, int) | |
| 316 | + | ||
| 317 | + | // Sets the file descriptor for a plane. | |
| 318 | + | func (x *DmabufTextureBuilder) SetFd(PlaneVar uint, FdVar int) { | |
| 319 | + | ||
| 320 | + | xDmabufTextureBuilderSetFd(x.GoPointer(), PlaneVar, FdVar) | |
| 321 | + | ||
| 322 | + | } | |
| 323 | + | ||
| 324 | + | var xDmabufTextureBuilderSetFourcc func(uintptr, uint32) | |
| 325 | + | ||
| 326 | + | // Sets the format of the texture. | |
| 327 | + | // | |
| 328 | + | // The format is specified as a fourcc code. | |
| 329 | + | // | |
| 330 | + | // The format must be set before calling [method@Gdk.DmabufTextureBuilder.build]. | |
| 331 | + | func (x *DmabufTextureBuilder) SetFourcc(FourccVar uint32) { | |
| 332 | + | ||
| 333 | + | xDmabufTextureBuilderSetFourcc(x.GoPointer(), FourccVar) | |
| 334 | + | ||
| 335 | + | } | |
| 336 | + | ||
| 337 | + | var xDmabufTextureBuilderSetHeight func(uintptr, uint) | |
| 338 | + | ||
| 339 | + | // Sets the height of the texture. | |
| 340 | + | // | |
| 341 | + | // The height must be set before calling [method@Gdk.DmabufTextureBuilder.build]. | |
| 342 | + | func (x *DmabufTextureBuilder) SetHeight(HeightVar uint) { | |
| 343 | + | ||
| 344 | + | xDmabufTextureBuilderSetHeight(x.GoPointer(), HeightVar) | |
| 345 | + | ||
| 346 | + | } | |
| 347 | + | ||
| 348 | + | var xDmabufTextureBuilderSetModifier func(uintptr, uint64) | |
| 349 | + | ||
| 350 | + | // Sets the modifier. | |
| 351 | + | func (x *DmabufTextureBuilder) SetModifier(ModifierVar uint64) { | |
| 352 | + | ||
| 353 | + | xDmabufTextureBuilderSetModifier(x.GoPointer(), ModifierVar) | |
| 354 | + | ||
| 355 | + | } | |
| 356 | + | ||
| 357 | + | var xDmabufTextureBuilderSetNPlanes func(uintptr, uint) | |
| 358 | + | ||
| 359 | + | // Sets the number of planes of the texture. | |
| 360 | + | func (x *DmabufTextureBuilder) SetNPlanes(NPlanesVar uint) { | |
| 361 | + | ||
| 362 | + | xDmabufTextureBuilderSetNPlanes(x.GoPointer(), NPlanesVar) | |
| 363 | + | ||
| 364 | + | } | |
| 365 | + | ||
| 366 | + | var xDmabufTextureBuilderSetOffset func(uintptr, uint, uint) | |
| 367 | + | ||
| 368 | + | // Sets the offset for a plane. | |
| 369 | + | func (x *DmabufTextureBuilder) SetOffset(PlaneVar uint, OffsetVar uint) { | |
| 370 | + | ||
| 371 | + | xDmabufTextureBuilderSetOffset(x.GoPointer(), PlaneVar, OffsetVar) | |
| 372 | + | ||
| 373 | + | } | |
| 374 | + | ||
| 375 | + | var xDmabufTextureBuilderSetPremultiplied func(uintptr, bool) | |
| 376 | + | ||
| 377 | + | // Sets whether the data is premultiplied. | |
| 378 | + | // | |
| 379 | + | // Unless otherwise specified, all formats including alpha channels are assumed | |
| 380 | + | // to be premultiplied. | |
| 381 | + | func (x *DmabufTextureBuilder) SetPremultiplied(PremultipliedVar bool) { | |
| 382 | + | ||
| 383 | + | xDmabufTextureBuilderSetPremultiplied(x.GoPointer(), PremultipliedVar) | |
| 384 | + | ||
| 385 | + | } | |
| 386 | + | ||
| 387 | + | var xDmabufTextureBuilderSetStride func(uintptr, uint, uint) | |
| 388 | + | ||
| 389 | + | // Sets the stride for a plane. | |
| 390 | + | // | |
| 391 | + | // The stride must be set for all planes before calling [method@Gdk.DmabufTextureBuilder.build]. | |
| 392 | + | func (x *DmabufTextureBuilder) SetStride(PlaneVar uint, StrideVar uint) { | |
| 393 | + | ||
| 394 | + | xDmabufTextureBuilderSetStride(x.GoPointer(), PlaneVar, StrideVar) | |
| 395 | + | ||
| 396 | + | } | |
| 397 | + | ||
| 398 | + | var xDmabufTextureBuilderSetUpdateRegion func(uintptr, *cairo.Region) | |
| 399 | + | ||
| 400 | + | // Sets the region to be updated by this texture. Together with | |
| 401 | + | // [property@Gdk.DmabufTextureBuilder:update-texture] this describes an | |
| 402 | + | // update of a previous texture. | |
| 403 | + | // | |
| 404 | + | // When rendering animations of large textures, it is possible that | |
| 405 | + | // consecutive textures are only updating contents in parts of the texture. | |
| 406 | + | // It is then possible to describe this update via these two properties, | |
| 407 | + | // so that GTK can avoid rerendering parts that did not change. | |
| 408 | + | // | |
| 409 | + | // An example would be a screen recording where only the mouse pointer moves. | |
| 410 | + | func (x *DmabufTextureBuilder) SetUpdateRegion(RegionVar *cairo.Region) { | |
| 411 | + | ||
| 412 | + | xDmabufTextureBuilderSetUpdateRegion(x.GoPointer(), RegionVar) | |
| 413 | + | ||
| 414 | + | } | |
| 415 | + | ||
| 416 | + | var xDmabufTextureBuilderSetUpdateTexture func(uintptr, uintptr) | |
| 417 | + | ||
| 418 | + | // Sets the texture to be updated by this texture. See | |
| 419 | + | // [method@Gdk.DmabufTextureBuilder.set_update_region] for an explanation. | |
| 420 | + | func (x *DmabufTextureBuilder) SetUpdateTexture(TextureVar *Texture) { | |
| 421 | + | ||
| 422 | + | xDmabufTextureBuilderSetUpdateTexture(x.GoPointer(), TextureVar.GoPointer()) | |
| 423 | + | ||
| 424 | + | } | |
| 425 | + | ||
| 426 | + | var xDmabufTextureBuilderSetWidth func(uintptr, uint) | |
| 427 | + | ||
| 428 | + | // Sets the width of the texture. | |
| 429 | + | // | |
| 430 | + | // The width must be set before calling [method@Gdk.DmabufTextureBuilder.build]. | |
| 431 | + | func (x *DmabufTextureBuilder) SetWidth(WidthVar uint) { | |
| 432 | + | ||
| 433 | + | xDmabufTextureBuilderSetWidth(x.GoPointer(), WidthVar) | |
| 434 | + | ||
| 435 | + | } | |
| 436 | + | ||
| 437 | + | func (c *DmabufTextureBuilder) GoPointer() uintptr { | |
| 438 | + | if c == nil { | |
| 439 | + | return 0 | |
| 440 | + | } | |
| 441 | + | return c.Ptr | |
| 442 | + | } | |
| 443 | + | ||
| 444 | + | func (c *DmabufTextureBuilder) SetGoPointer(ptr uintptr) { | |
| 445 | + | c.Ptr = ptr | |
| 446 | + | } | |
| 447 | + | ||
| 448 | + | func init() { | |
| 449 | + | core.SetPackageName("GDK", "gtk4") | |
| 450 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 451 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 452 | + | if err != nil { | |
| 453 | + | panic(err) | |
| 454 | + | } | |
| 455 | + | ||
| 456 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGLibType, lib, "gdk_dmabuf_texture_builder_get_type") | |
| 457 | + | ||
| 458 | + | core.PuregoSafeRegister(&xNewDmabufTextureBuilder, lib, "gdk_dmabuf_texture_builder_new") | |
| 459 | + | ||
| 460 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderBuild, lib, "gdk_dmabuf_texture_builder_build") | |
| 461 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetColorState, lib, "gdk_dmabuf_texture_builder_get_color_state") | |
| 462 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetDisplay, lib, "gdk_dmabuf_texture_builder_get_display") | |
| 463 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetFd, lib, "gdk_dmabuf_texture_builder_get_fd") | |
| 464 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetFourcc, lib, "gdk_dmabuf_texture_builder_get_fourcc") | |
| 465 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetHeight, lib, "gdk_dmabuf_texture_builder_get_height") | |
| 466 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetModifier, lib, "gdk_dmabuf_texture_builder_get_modifier") | |
| 467 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetNPlanes, lib, "gdk_dmabuf_texture_builder_get_n_planes") | |
| 468 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetOffset, lib, "gdk_dmabuf_texture_builder_get_offset") | |
| 469 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetPremultiplied, lib, "gdk_dmabuf_texture_builder_get_premultiplied") | |
| 470 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetStride, lib, "gdk_dmabuf_texture_builder_get_stride") | |
| 471 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetUpdateRegion, lib, "gdk_dmabuf_texture_builder_get_update_region") | |
| 472 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetUpdateTexture, lib, "gdk_dmabuf_texture_builder_get_update_texture") | |
| 473 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderGetWidth, lib, "gdk_dmabuf_texture_builder_get_width") | |
| 474 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetColorState, lib, "gdk_dmabuf_texture_builder_set_color_state") | |
| 475 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetDisplay, lib, "gdk_dmabuf_texture_builder_set_display") | |
| 476 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetFd, lib, "gdk_dmabuf_texture_builder_set_fd") | |
| 477 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetFourcc, lib, "gdk_dmabuf_texture_builder_set_fourcc") | |
| 478 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetHeight, lib, "gdk_dmabuf_texture_builder_set_height") | |
| 479 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetModifier, lib, "gdk_dmabuf_texture_builder_set_modifier") | |
| 480 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetNPlanes, lib, "gdk_dmabuf_texture_builder_set_n_planes") | |
| 481 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetOffset, lib, "gdk_dmabuf_texture_builder_set_offset") | |
| 482 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetPremultiplied, lib, "gdk_dmabuf_texture_builder_set_premultiplied") | |
| 483 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetStride, lib, "gdk_dmabuf_texture_builder_set_stride") | |
| 484 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetUpdateRegion, lib, "gdk_dmabuf_texture_builder_set_update_region") | |
| 485 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetUpdateTexture, lib, "gdk_dmabuf_texture_builder_set_update_texture") | |
| 486 | + | core.PuregoSafeRegister(&xDmabufTextureBuilderSetWidth, lib, "gdk_dmabuf_texture_builder_set_width") | |
| 487 | + | ||
| 488 | + | } | |
M v4/gdk/gdkdrag.go +1 -1
| @@ -43,7 +43,7 @@ func DragActionIsUnique(ActionVar DragAction) bool { | |||
| 43 | 43 | return cret | |
| 44 | 44 | } | |
| 45 | 45 | ||
| 46 | - | // The `GdkDrag` object represents the source of an ongoing DND operation. | |
| 46 | + | // Represents the source of an ongoing DND operation. | |
| 47 | 47 | // | |
| 48 | 48 | // A `GdkDrag` is created when a drag is started, and stays alive for duration of | |
| 49 | 49 | // the DND operation. After a drag has been started with [func@Gdk.Drag.begin], | |
M v4/gdk/gdkdragsurface.go +1 -1
| @@ -19,7 +19,7 @@ func (x *DragSurfaceInterface) GoPointer() uintptr { | |||
| 19 | 19 | return uintptr(unsafe.Pointer(x)) | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | - | // A `GdkDragSurface` is an interface for surfaces used during DND. | |
| 22 | + | // A surface that is used during DND. | |
| 23 | 23 | type DragSurface interface { | |
| 24 | 24 | GoPointer() uintptr | |
| 25 | 25 | SetGoPointer(uintptr) | |
A v4/gdk/gdkdragsurfacesize.go +49 -0
| @@ -0,0 +1,49 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 11 | + | ) | |
| 12 | + | ||
| 13 | + | // Contains information that is useful to compute the size of a drag surface. | |
| 14 | + | type DragSurfaceSize struct { | |
| 15 | + | _ structs.HostLayout | |
| 16 | + | } | |
| 17 | + | ||
| 18 | + | var xDragSurfaceSizeGLibType func() types.GType | |
| 19 | + | ||
| 20 | + | func DragSurfaceSizeGLibType() types.GType { | |
| 21 | + | return xDragSurfaceSizeGLibType() | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | func (x *DragSurfaceSize) GoPointer() uintptr { | |
| 25 | + | return uintptr(unsafe.Pointer(x)) | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | var xDragSurfaceSizeSetSize func(uintptr, int, int) | |
| 29 | + | ||
| 30 | + | // Sets the size the drag surface prefers to be resized to. | |
| 31 | + | func (x *DragSurfaceSize) SetSize(WidthVar int, HeightVar int) { | |
| 32 | + | ||
| 33 | + | xDragSurfaceSizeSetSize(x.GoPointer(), WidthVar, HeightVar) | |
| 34 | + | ||
| 35 | + | } | |
| 36 | + | ||
| 37 | + | func init() { | |
| 38 | + | core.SetPackageName("GDK", "gtk4") | |
| 39 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 40 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 41 | + | if err != nil { | |
| 42 | + | panic(err) | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | core.PuregoSafeRegister(&xDragSurfaceSizeGLibType, lib, "gdk_drag_surface_size_get_type") | |
| 46 | + | ||
| 47 | + | core.PuregoSafeRegister(&xDragSurfaceSizeSetSize, lib, "gdk_drag_surface_size_set_size") | |
| 48 | + | ||
| 49 | + | } | |
M v4/gdk/gdkdrawcontext.go +2 -2
| @@ -58,8 +58,8 @@ var xDrawContextBeginFrame func(uintptr, *cairo.Region) | |||
| 58 | 58 | // | |
| 59 | 59 | // When using GTK, the widget system automatically places calls to | |
| 60 | 60 | // gdk_draw_context_begin_frame() and gdk_draw_context_end_frame() via the | |
| 61 | - | // use of [class@Gsk.Renderer]s, so application code does not need to call | |
| 62 | - | // these functions explicitly. | |
| 61 | + | // use of [GskRenderer](../gsk4/class.Renderer.html)s, so application code | |
| 62 | + | // does not need to call these functions explicitly. | |
| 63 | 63 | func (x *DrawContext) BeginFrame(RegionVar *cairo.Region) { | |
| 64 | 64 | ||
| 65 | 65 | xDrawContextBeginFrame(x.GoPointer(), RegionVar) | |
M v4/gdk/gdkdrop.go +1 -5
| @@ -10,7 +10,7 @@ import ( | |||
| 10 | 10 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 11 | 11 | ) | |
| 12 | 12 | ||
| 13 | - | // The `GdkDrop` object represents the target of an ongoing DND operation. | |
| 13 | + | // Represents the target of an ongoing DND operation. | |
| 14 | 14 | // | |
| 15 | 15 | // Possible drop sites get informed about the status of the ongoing drag | |
| 16 | 16 | // operation with events of type %GDK_DRAG_ENTER, %GDK_DRAG_LEAVE, | |
| @@ -198,10 +198,6 @@ var xDropReadValueAsync func(uintptr, types.GType, int, uintptr, uintptr, uintpt | |||
| 198 | 198 | // Asynchronously request the drag operation's contents converted | |
| 199 | 199 | // to the given @type. | |
| 200 | 200 | // | |
| 201 | - | // When the operation is finished @callback will be called. You must | |
| 202 | - | // then call [method@Gdk.Drop.read_value_finish] to get the resulting | |
| 203 | - | // `GValue`. | |
| 204 | - | // | |
| 205 | 201 | // For local drag-and-drop operations that are available in the given | |
| 206 | 202 | // `GType`, the value will be copied directly. Otherwise, GDK will | |
| 207 | 203 | // try to use [func@Gdk.content_deserialize_async] to convert the data. | |
M v4/gdk/gdkenums.go +97 -31
| @@ -73,6 +73,23 @@ const ( | |||
| 73 | 73 | ActionAskValue DragAction = 8 | |
| 74 | 74 | ) | |
| 75 | 75 | ||
| 76 | + | // The list of the different APIs that GdkGLContext can potentially support. | |
| 77 | + | type GLAPI int | |
| 78 | + | ||
| 79 | + | var xGLAPIGLibType func() types.GType | |
| 80 | + | ||
| 81 | + | func GLAPIGLibType() types.GType { | |
| 82 | + | return xGLAPIGLibType() | |
| 83 | + | } | |
| 84 | + | ||
| 85 | + | const ( | |
| 86 | + | ||
| 87 | + | // The OpenGL API | |
| 88 | + | GlApiGlValue GLAPI = 1 | |
| 89 | + | // The OpenGL ES API | |
| 90 | + | GlApiGlesValue GLAPI = 2 | |
| 91 | + | ) | |
| 92 | + | ||
| 76 | 93 | // Flags to indicate the state of modifier keys and mouse buttons | |
| 77 | 94 | // in events. | |
| 78 | 95 | // | |
| @@ -80,7 +97,7 @@ const ( | |||
| 80 | 97 | // Apple, CapsLock or ShiftLock. | |
| 81 | 98 | // | |
| 82 | 99 | // Note that GDK may add internal values to events which include values outside | |
| 83 | - | // of this enumeration. Your code should preserve and ignore them. You can use | |
| 100 | + | // of this enumeration. Your code should preserve and ignore them. You can use | |
| 84 | 101 | // %GDK_MODIFIER_MASK to remove all private values. | |
| 85 | 102 | type ModifierType int | |
| 86 | 103 | ||
| @@ -92,16 +109,18 @@ func ModifierTypeGLibType() types.GType { | |||
| 92 | 109 | ||
| 93 | 110 | const ( | |
| 94 | 111 | ||
| 112 | + | // No modifier. | |
| 113 | + | NoModifierMaskValue ModifierType = 0 | |
| 95 | 114 | // the Shift key. | |
| 96 | 115 | ShiftMaskValue ModifierType = 1 | |
| 97 | - | // a Lock key (depending on the modifier mapping of the | |
| 98 | - | // X server this may either be CapsLock or ShiftLock). | |
| 116 | + | // a Lock key (depending on the Windowing System configuration, | |
| 117 | + | // this may either be <kbd>CapsLock</kbd> or <kbd>ShiftLock</kbd>). | |
| 99 | 118 | LockMaskValue ModifierType = 2 | |
| 100 | 119 | // the Control key. | |
| 101 | 120 | ControlMaskValue ModifierType = 4 | |
| 102 | - | // the fourth modifier key (it depends on the modifier | |
| 103 | - | // mapping of the X server which key is interpreted as this modifier, but | |
| 104 | - | // normally it is the Alt key). | |
| 121 | + | // the fourth modifier key (it depends on the Windowing System | |
| 122 | + | // configuration which key is interpreted as this modifier, but normally it | |
| 123 | + | // is the <kbd>Alt</kbd> key). | |
| 105 | 124 | AltMaskValue ModifierType = 8 | |
| 106 | 125 | // the first mouse button. | |
| 107 | 126 | Button1MaskValue ModifierType = 256 | |
| @@ -113,11 +132,11 @@ const ( | |||
| 113 | 132 | Button4MaskValue ModifierType = 2048 | |
| 114 | 133 | // the fifth mouse button. | |
| 115 | 134 | Button5MaskValue ModifierType = 4096 | |
| 116 | - | // the Super modifier | |
| 135 | + | // the Super modifier. | |
| 117 | 136 | SuperMaskValue ModifierType = 67108864 | |
| 118 | - | // the Hyper modifier | |
| 137 | + | // the Hyper modifier. | |
| 119 | 138 | HyperMaskValue ModifierType = 134217728 | |
| 120 | - | // the Meta modifier | |
| 139 | + | // the Meta modifier. Maps to Command on macOS. | |
| 121 | 140 | MetaMaskValue ModifierType = 268435456 | |
| 122 | 141 | ) | |
| 123 | 142 | ||
| @@ -164,6 +183,27 @@ const ( | |||
| 164 | 183 | AxisLastValue AxisUse = 12 | |
| 165 | 184 | ) | |
| 166 | 185 | ||
| 186 | + | // Error enumeration for `GdkDmabufTexture`. | |
| 187 | + | type DmabufError int | |
| 188 | + | ||
| 189 | + | var xDmabufErrorGLibType func() types.GType | |
| 190 | + | ||
| 191 | + | func DmabufErrorGLibType() types.GType { | |
| 192 | + | return xDmabufErrorGLibType() | |
| 193 | + | } | |
| 194 | + | ||
| 195 | + | const ( | |
| 196 | + | ||
| 197 | + | // Dmabuf support is not available, because the OS | |
| 198 | + | // is not Linux, or it was explicitly disabled at compile- or runtime | |
| 199 | + | DmabufErrorNotAvailableValue DmabufError = 0 | |
| 200 | + | // The requested format is not supported | |
| 201 | + | DmabufErrorUnsupportedFormatValue DmabufError = 1 | |
| 202 | + | // GTK failed to create the resource for other | |
| 203 | + | // reasons | |
| 204 | + | DmabufErrorCreationFailedValue DmabufError = 2 | |
| 205 | + | ) | |
| 206 | + | ||
| 167 | 207 | // Error enumeration for `GdkGLContext`. | |
| 168 | 208 | type GLError int | |
| 169 | 209 | ||
| @@ -221,12 +261,12 @@ const ( | |||
| 221 | 261 | GravityStaticValue Gravity = 10 | |
| 222 | 262 | ) | |
| 223 | 263 | ||
| 224 | - | // `GdkMemoryFormat` describes formats that image data can have in memory. | |
| 264 | + | // Describes formats that image data can have in memory. | |
| 225 | 265 | // | |
| 226 | 266 | // It describes formats by listing the contents of the memory passed to it. | |
| 227 | - | // So GDK_MEMORY_A8R8G8B8 will be 1 byte (8 bits) of alpha, followed by a | |
| 267 | + | // So `GDK_MEMORY_A8R8G8B8` will be 1 byte (8 bits) of alpha, followed by a | |
| 228 | 268 | // byte each of red, green and blue. It is not endian-dependent, so | |
| 229 | - | // CAIRO_FORMAT_ARGB32 is represented by different `GdkMemoryFormats` | |
| 269 | + | // `CAIRO_FORMAT_ARGB32` is represented by different `GdkMemoryFormats` | |
| 230 | 270 | // on architectures with different endiannesses. | |
| 231 | 271 | // | |
| 232 | 272 | // Its naming is modelled after | |
| @@ -263,37 +303,63 @@ const ( | |||
| 263 | 303 | MemoryR8g8b8Value MemoryFormat = 7 | |
| 264 | 304 | // 3 bytes; for blue, green, red. The data is opaque. | |
| 265 | 305 | MemoryB8g8r8Value MemoryFormat = 8 | |
| 266 | - | // 3 guint16 values; for red, green, blue. Since: 4.6 | |
| 306 | + | // 3 guint16 values; for red, green, blue. | |
| 267 | 307 | MemoryR16g16b16Value MemoryFormat = 9 | |
| 268 | - | // 4 guint16 values; for red, green, | |
| 269 | - | // blue, alpha. The color values are premultiplied with the alpha value. | |
| 270 | - | // Since: 4.6 | |
| 308 | + | // 4 guint16 values; for red, green, blue, alpha. The color values are | |
| 309 | + | // premultiplied with the alpha value. | |
| 271 | 310 | MemoryR16g16b16a16PremultipliedValue MemoryFormat = 10 | |
| 272 | 311 | // 4 guint16 values; for red, green, blue, alpha. | |
| 273 | - | // Since: 4.6 | |
| 274 | 312 | MemoryR16g16b16a16Value MemoryFormat = 11 | |
| 275 | - | // 3 half-float values; for red, green, blue. | |
| 276 | - | // The data is opaque. Since: 4.6 | |
| 313 | + | // 3 half-float values; for red, green, blue. The data is opaque. | |
| 277 | 314 | MemoryR16g16b16FloatValue MemoryFormat = 12 | |
| 278 | - | // 4 half-float values; for | |
| 279 | - | // red, green, blue and alpha. The color values are premultiplied with | |
| 280 | - | // the alpha value. Since: 4.6 | |
| 315 | + | // 4 half-float values; for red, green, blue and alpha. The color values are | |
| 316 | + | // premultiplied with the alpha value. | |
| 281 | 317 | MemoryR16g16b16a16FloatPremultipliedValue MemoryFormat = 13 | |
| 282 | - | // 4 half-float values; for red, green, | |
| 283 | - | // blue and alpha. Since: 4.6 | |
| 318 | + | // 4 half-float values; for red, green, blue and alpha. | |
| 284 | 319 | MemoryR16g16b16a16FloatValue MemoryFormat = 14 | |
| 285 | - | ||
| 320 | + | // 3 float values; for red, green, blue. | |
| 286 | 321 | MemoryR32g32b32FloatValue MemoryFormat = 15 | |
| 287 | - | // 4 float values; for | |
| 288 | - | // red, green, blue and alpha. The color values are premultiplied with | |
| 289 | - | // the alpha value. Since: 4.6 | |
| 322 | + | // 4 float values; for red, green, blue and alpha. The color values are | |
| 323 | + | // premultiplied with the alpha value. | |
| 290 | 324 | MemoryR32g32b32a32FloatPremultipliedValue MemoryFormat = 16 | |
| 291 | - | // 4 float values; for red, green, blue and | |
| 292 | - | // alpha. Since: 4.6 | |
| 325 | + | // 4 float values; for red, green, blue and alpha. | |
| 293 | 326 | MemoryR32g32b32a32FloatValue MemoryFormat = 17 | |
| 327 | + | // 2 bytes; for grayscale, alpha. The color values are premultiplied with the | |
| 328 | + | // alpha value. | |
| 329 | + | MemoryG8a8PremultipliedValue MemoryFormat = 18 | |
| 330 | + | // 2 bytes; for grayscale, alpha. | |
| 331 | + | MemoryG8a8Value MemoryFormat = 19 | |
| 332 | + | // One byte; for grayscale. The data is opaque. | |
| 333 | + | MemoryG8Value MemoryFormat = 20 | |
| 334 | + | // 2 guint16 values; for grayscale, alpha. The color values are premultiplied | |
| 335 | + | // with the alpha value. | |
| 336 | + | MemoryG16a16PremultipliedValue MemoryFormat = 21 | |
| 337 | + | // 2 guint16 values; for grayscale, alpha. | |
| 338 | + | MemoryG16a16Value MemoryFormat = 22 | |
| 339 | + | // One guint16 value; for grayscale. The data is opaque. | |
| 340 | + | MemoryG16Value MemoryFormat = 23 | |
| 341 | + | // One byte; for alpha. | |
| 342 | + | MemoryA8Value MemoryFormat = 24 | |
| 343 | + | // One guint16 value; for alpha. | |
| 344 | + | MemoryA16Value MemoryFormat = 25 | |
| 345 | + | // One half-float value; for alpha. | |
| 346 | + | MemoryA16FloatValue MemoryFormat = 26 | |
| 347 | + | // One float value; for alpha. | |
| 348 | + | MemoryA32FloatValue MemoryFormat = 27 | |
| 349 | + | // 4 bytes; for alpha, blue, green, red, The color values are premultiplied with | |
| 350 | + | // the alpha value. | |
| 351 | + | MemoryA8b8g8r8PremultipliedValue MemoryFormat = 28 | |
| 352 | + | // 4 bytes; for blue, green, red, unused. | |
| 353 | + | MemoryB8g8r8x8Value MemoryFormat = 29 | |
| 354 | + | // 4 bytes; for unused, red, green, blue. | |
| 355 | + | MemoryX8r8g8b8Value MemoryFormat = 30 | |
| 356 | + | // 4 bytes; for red, green, blue, unused. | |
| 357 | + | MemoryR8g8b8x8Value MemoryFormat = 31 | |
| 358 | + | // 4 bytes; for unused, blue, green, red. | |
| 359 | + | MemoryX8b8g8r8Value MemoryFormat = 32 | |
| 294 | 360 | // The number of formats. This value will change as | |
| 295 | 361 | // more formats get added, so do not rely on its concrete integer. | |
| 296 | - | MemoryNFormatsValue MemoryFormat = 18 | |
| 362 | + | MemoryNFormatsValue MemoryFormat = 33 | |
| 297 | 363 | ) | |
| 298 | 364 | ||
| 299 | 365 | // Error enumeration for `GdkVulkanContext`. | |
M v4/gdk/gdkevents.go +15 -9
| @@ -11,8 +11,7 @@ import ( | |||
| 11 | 11 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | - | // `GdkEventSequence` is an opaque type representing a sequence | |
| 15 | - | // of related touch events. | |
| 14 | + | // An opaque type representing a sequence of related events. | |
| 16 | 15 | type EventSequence struct { | |
| 17 | 16 | _ structs.HostLayout | |
| 18 | 17 | } | |
| @@ -157,8 +156,8 @@ const ( | |||
| 157 | 156 | PadStripValue EventType = 26 | |
| 158 | 157 | // A tablet pad group mode change. | |
| 159 | 158 | PadGroupModeValue EventType = 27 | |
| 160 | - | // A touchpad hold gesture event, the current state | |
| 161 | - | // is determined by its phase field. Since: 4.6 | |
| 159 | + | // A touchpad hold gesture event, the current state is determined by its phase | |
| 160 | + | // field. | |
| 162 | 161 | TouchpadHoldValue EventType = 28 | |
| 163 | 162 | // marks the end of the GdkEventType enumeration. | |
| 164 | 163 | EventLastValue EventType = 29 | |
| @@ -523,12 +522,13 @@ func (c *DeleteEvent) SetGoPointer(ptr uintptr) { | |||
| 523 | 522 | c.Ptr = ptr | |
| 524 | 523 | } | |
| 525 | 524 | ||
| 526 | - | // `GdkEvent`s are immutable data structures, created by GDK to | |
| 527 | - | // represent windowing system events. | |
| 525 | + | // Represents windowing system events. | |
| 528 | 526 | // | |
| 529 | 527 | // In GTK applications the events are handled automatically by toplevel | |
| 530 | 528 | // widgets and passed on to the event controllers of appropriate widgets, | |
| 531 | 529 | // so using `GdkEvent` and its related API is rarely needed. | |
| 530 | + | // | |
| 531 | + | // `GdkEvent` structs are immutable. | |
| 532 | 532 | type Event struct { | |
| 533 | 533 | Ptr uintptr | |
| 534 | 534 | } | |
| @@ -672,7 +672,7 @@ func (x *Event) GetDisplay() *Display { | |||
| 672 | 672 | ||
| 673 | 673 | var xEventGetEventSequence func(uintptr) *EventSequence | |
| 674 | 674 | ||
| 675 | - | // Retuns the event sequence to which the event belongs. | |
| 675 | + | // Returns the event sequence to which the event belongs. | |
| 676 | 676 | // | |
| 677 | 677 | // Related touch events are connected in a sequence. Other | |
| 678 | 678 | // events typically don't have event sequence information. | |
| @@ -731,6 +731,8 @@ func (x *Event) GetPointerEmulated() bool { | |||
| 731 | 731 | var xEventGetPosition func(uintptr, float64, float64) bool | |
| 732 | 732 | ||
| 733 | 733 | // Extract the event surface relative x/y coordinates from an event. | |
| 734 | + | // | |
| 735 | + | // This position is in [surface coordinates](coordinates.html). | |
| 734 | 736 | func (x *Event) GetPosition(XVar float64, YVar float64) bool { | |
| 735 | 737 | ||
| 736 | 738 | cret := xEventGetPosition(x.GoPointer(), XVar, YVar) | |
| @@ -805,9 +807,13 @@ var xEventTriggersContextMenu func(uintptr) bool | |||
| 805 | 807 | // according to platform conventions. | |
| 806 | 808 | // | |
| 807 | 809 | // The right mouse button typically triggers context menus. | |
| 810 | + | // On macOS, Control+left mouse button also triggers. | |
| 811 | + | // | |
| 812 | + | // # This function should always be used instead of simply checking for | |
| 808 | 813 | // | |
| 809 | - | // This function should always be used instead of simply checking for | |
| 810 | - | // event->button == %GDK_BUTTON_SECONDARY. | |
| 814 | + | // ```c | |
| 815 | + | // event->button == GDK_BUTTON_SECONDARY | |
| 816 | + | // ``` | |
| 811 | 817 | func (x *Event) TriggersContextMenu() bool { | |
| 812 | 818 | ||
| 813 | 819 | cret := xEventTriggersContextMenu(x.GoPointer()) | |
M v4/gdk/gdkframeclock.go +7 -6
| @@ -59,8 +59,7 @@ const ( | |||
| 59 | 59 | FrameClockPhaseAfterPaintValue FrameClockPhase = 64 | |
| 60 | 60 | ) | |
| 61 | 61 | ||
| 62 | - | // A `GdkFrameClock` tells the application when to update and repaint | |
| 63 | - | // a surface. | |
| 62 | + | // Tells the application when to update and repaint a surface. | |
| 64 | 63 | // | |
| 65 | 64 | // This may be synced to the vertical refresh rate of the monitor, for example. | |
| 66 | 65 | // Even when the frame clock uses a simple timer rather than a hardware-based | |
| @@ -78,7 +77,7 @@ const ( | |||
| 78 | 77 | // for the synchronization being implemented, the clock will process a frame and | |
| 79 | 78 | // emit signals for each phase that has been requested. (See the signals of the | |
| 80 | 79 | // `GdkFrameClock` class for documentation of the phases. | |
| 81 | - | // %GDK_FRAME_CLOCK_PHASE_UPDATE and the [signal@GdkFrameClock::update] signal | |
| 80 | + | // %GDK_FRAME_CLOCK_PHASE_UPDATE and the [signal@Gdk.FrameClock::update] signal | |
| 82 | 81 | // are most interesting for application writers, and are used to update the | |
| 83 | 82 | // animations, using the frame time given by [method@Gdk.FrameClock.get_frame_time]. | |
| 84 | 83 | // | |
| @@ -90,7 +89,7 @@ const ( | |||
| 90 | 89 | // are called at a “similar” time get the same value. This means that | |
| 91 | 90 | // if different animations are timed by looking at the difference in | |
| 92 | 91 | // time between an initial value from [method@Gdk.FrameClock.get_frame_time] | |
| 93 | - | // and the value inside the [signal@GdkFrameClock::update] signal of the clock, | |
| 92 | + | // and the value inside the [signal@Gdk.FrameClock::update] signal of the clock, | |
| 94 | 93 | // they will stay exactly synchronized. | |
| 95 | 94 | type FrameClock struct { | |
| 96 | 95 | gobject.Object | |
| @@ -349,7 +348,8 @@ func (x *FrameClock) ConnectLayout(cb *func(FrameClock)) uint32 { | |||
| 349 | 348 | // | |
| 350 | 349 | // The frame is repainted. GDK normally handles this internally and | |
| 351 | 350 | // emits [signal@Gdk.Surface::render] signals which are turned into | |
| 352 | - | // [signal@Gtk.Widget::snapshot] signals by GTK. | |
| 351 | + | // [GtkWidget::snapshot](../gtk4/signal.Widget.snapshot.html) signals | |
| 352 | + | // by GTK. | |
| 353 | 353 | func (x *FrameClock) ConnectPaint(cb *func(FrameClock)) uint32 { | |
| 354 | 354 | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 355 | 355 | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| @@ -397,7 +397,8 @@ func (x *FrameClock) ConnectResumeEvents(cb *func(FrameClock)) uint32 { | |||
| 397 | 397 | // | |
| 398 | 398 | // Animations should be updated using [method@Gdk.FrameClock.get_frame_time]. | |
| 399 | 399 | // Applications can connect directly to this signal, or use | |
| 400 | - | // [method@Gtk.Widget.add_tick_callback] as a more convenient interface. | |
| 400 | + | // [gtk_widget_add_tick_callback()](../gtk4/method.Widget.add_tick_callback.html) | |
| 401 | + | // as a more convenient interface. | |
| 401 | 402 | func (x *FrameClock) ConnectUpdate(cb *func(FrameClock)) uint32 { | |
| 402 | 403 | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 403 | 404 | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
M v4/gdk/gdkframetimings.go +1 -2
| @@ -10,8 +10,7 @@ import ( | |||
| 10 | 10 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 11 | 11 | ) | |
| 12 | 12 | ||
| 13 | - | // A `GdkFrameTimings` object holds timing information for a single frame | |
| 14 | - | // of the application’s displays. | |
| 13 | + | // Holds timing information for a single frame of the application’s displays. | |
| 15 | 14 | // | |
| 16 | 15 | // To retrieve `GdkFrameTimings` objects, use [method@Gdk.FrameClock.get_timings] | |
| 17 | 16 | // or [method@Gdk.FrameClock.get_current_timings]. The information in | |
M v4/gdk/gdkglcontext.go +7 -19
| @@ -9,25 +9,16 @@ import ( | |||
| 9 | 9 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 10 | 10 | ) | |
| 11 | 11 | ||
| 12 | - | // The list of the different APIs that GdkGLContext can potentially support. | |
| 13 | - | type GLAPI int | |
| 12 | + | var xGlErrorQuark func() glib.Quark | |
| 14 | 13 | ||
| 15 | - | var xGLAPIGLibType func() types.GType | |
| 14 | + | // Registers an error quark for [class@Gdk.GLContext] errors. | |
| 15 | + | func GlErrorQuark() glib.Quark { | |
| 16 | 16 | ||
| 17 | - | func GLAPIGLibType() types.GType { | |
| 18 | - | return xGLAPIGLibType() | |
| 17 | + | cret := xGlErrorQuark() | |
| 18 | + | return cret | |
| 19 | 19 | } | |
| 20 | 20 | ||
| 21 | - | const ( | |
| 22 | - | ||
| 23 | - | // The OpenGL API | |
| 24 | - | GlApiGlValue GLAPI = 1 | |
| 25 | - | // The OpenGL ES API | |
| 26 | - | GlApiGlesValue GLAPI = 2 | |
| 27 | - | ) | |
| 28 | - | ||
| 29 | - | // `GdkGLContext` is an object representing a platform-specific | |
| 30 | - | // OpenGL draw context. | |
| 21 | + | // Represents a platform-specific OpenGL draw context. | |
| 31 | 22 | // | |
| 32 | 23 | // `GdkGLContext`s are created for a surface using | |
| 33 | 24 | // [method@Gdk.Surface.create_gl_context], and the context will match | |
| @@ -215,9 +206,6 @@ var xGLContextGetVersion func(uintptr, int, int) | |||
| 215 | 206 | // Retrieves the OpenGL version of the @context. | |
| 216 | 207 | // | |
| 217 | 208 | // The @context must be realized prior to calling this function. | |
| 218 | - | // | |
| 219 | - | // If the @context has never been made current, the version cannot | |
| 220 | - | // be known and it will return 0 for both @major and @minor. | |
| 221 | 209 | func (x *GLContext) GetVersion(MajorVar int, MinorVar int) { | |
| 222 | 210 | ||
| 223 | 211 | xGLContextGetVersion(x.GoPointer(), MajorVar, MinorVar) | |
| @@ -426,7 +414,7 @@ func init() { | |||
| 426 | 414 | panic(err) | |
| 427 | 415 | } | |
| 428 | 416 | ||
| 429 | - | core.PuregoSafeRegister(&xGLAPIGLibType, lib, "gdk_gl_api_get_type") | |
| 417 | + | core.PuregoSafeRegister(&xGlErrorQuark, lib, "gdk_gl_error_quark") | |
| 430 | 418 | ||
| 431 | 419 | core.PuregoSafeRegister(&xGLContextGLibType, lib, "gdk_gl_context_get_type") | |
| 432 | 420 | ||
M v4/gdk/gdkgltexture.go +8 -1
| @@ -20,7 +20,7 @@ func (x *GLTextureClass) GoPointer() uintptr { | |||
| 20 | 20 | return uintptr(unsafe.Pointer(x)) | |
| 21 | 21 | } | |
| 22 | 22 | ||
| 23 | - | // A GdkTexture representing a GL texture object. | |
| 23 | + | // A `GdkTexture` representing a GL texture object. | |
| 24 | 24 | type GLTexture struct { | |
| 25 | 25 | Texture | |
| 26 | 26 | } | |
| @@ -232,6 +232,13 @@ func (x *GLTexture) Equal(Icon2Var gio.Icon) bool { | |||
| 232 | 232 | return cret | |
| 233 | 233 | } | |
| 234 | 234 | ||
| 235 | + | // Gets a hash for an icon. | |
| 236 | + | func (x *GLTexture) Hash() uint { | |
| 237 | + | ||
| 238 | + | cret := gio.XGIconHash(x.GoPointer()) | |
| 239 | + | return cret | |
| 240 | + | } | |
| 241 | + | ||
| 235 | 242 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| 236 | 243 | // back by calling g_icon_deserialize() on the returned value. | |
| 237 | 244 | // As serialization will avoid using raw icon data when possible, it only | |
A v4/gdk/gdkgltexturebuilder.go +390 -0
| @@ -0,0 +1,390 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/cairo" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 13 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 14 | + | ) | |
| 15 | + | ||
| 16 | + | type GLTextureBuilderClass struct { | |
| 17 | + | _ structs.HostLayout | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | func (x *GLTextureBuilderClass) GoPointer() uintptr { | |
| 21 | + | return uintptr(unsafe.Pointer(x)) | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | // Constructs [class@Gdk.Texture] objects from GL textures. | |
| 25 | + | // | |
| 26 | + | // The operation is quite simple: Create a texture builder, set all the necessary | |
| 27 | + | // properties - keep in mind that the properties [property@Gdk.GLTextureBuilder:context], | |
| 28 | + | // [property@Gdk.GLTextureBuilder:id], [property@Gdk.GLTextureBuilder:width], and | |
| 29 | + | // [property@Gdk.GLTextureBuilder:height] are mandatory - and then call | |
| 30 | + | // [method@Gdk.GLTextureBuilder.build] to create the new texture. | |
| 31 | + | // | |
| 32 | + | // `GdkGLTextureBuilder` can be used for quick one-shot construction of | |
| 33 | + | // textures as well as kept around and reused to construct multiple textures. | |
| 34 | + | type GLTextureBuilder struct { | |
| 35 | + | gobject.Object | |
| 36 | + | } | |
| 37 | + | ||
| 38 | + | var xGLTextureBuilderGLibType func() types.GType | |
| 39 | + | ||
| 40 | + | func GLTextureBuilderGLibType() types.GType { | |
| 41 | + | return xGLTextureBuilderGLibType() | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | func GLTextureBuilderNewFromInternalPtr(ptr uintptr) *GLTextureBuilder { | |
| 45 | + | cls := &GLTextureBuilder{} | |
| 46 | + | cls.Ptr = ptr | |
| 47 | + | return cls | |
| 48 | + | } | |
| 49 | + | ||
| 50 | + | var xNewGLTextureBuilder func() uintptr | |
| 51 | + | ||
| 52 | + | // Creates a new texture builder. | |
| 53 | + | func NewGLTextureBuilder() *GLTextureBuilder { | |
| 54 | + | var cls *GLTextureBuilder | |
| 55 | + | ||
| 56 | + | cret := xNewGLTextureBuilder() | |
| 57 | + | ||
| 58 | + | if cret == 0 { | |
| 59 | + | return nil | |
| 60 | + | } | |
| 61 | + | cls = &GLTextureBuilder{} | |
| 62 | + | cls.Ptr = cret | |
| 63 | + | return cls | |
| 64 | + | } | |
| 65 | + | ||
| 66 | + | var xGLTextureBuilderBuild func(uintptr, uintptr, uintptr) uintptr | |
| 67 | + | ||
| 68 | + | // Builds a new `GdkTexture` with the values set up in the builder. | |
| 69 | + | // | |
| 70 | + | // The `destroy` function gets called when the returned texture gets released; | |
| 71 | + | // either when the texture is finalized or by an explicit call to | |
| 72 | + | // [method@Gdk.GLTexture.release]. It should release all GL resources associated | |
| 73 | + | // with the texture, such as the [property@Gdk.GLTextureBuilder:id] and the | |
| 74 | + | // [property@Gdk.GLTextureBuilder:sync]. | |
| 75 | + | // | |
| 76 | + | // Note that it is a programming error to call this function if any mandatory | |
| 77 | + | // property has not been set. | |
| 78 | + | // | |
| 79 | + | // It is possible to call this function multiple times to create multiple textures, | |
| 80 | + | // possibly with changing properties in between. | |
| 81 | + | func (x *GLTextureBuilder) Build(DestroyVar *glib.DestroyNotify, DataVar uintptr) *Texture { | |
| 82 | + | var cls *Texture | |
| 83 | + | ||
| 84 | + | cret := xGLTextureBuilderBuild(x.GoPointer(), glib.NewCallbackNullable(DestroyVar), DataVar) | |
| 85 | + | ||
| 86 | + | if cret == 0 { | |
| 87 | + | return nil | |
| 88 | + | } | |
| 89 | + | cls = &Texture{} | |
| 90 | + | cls.Ptr = cret | |
| 91 | + | return cls | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | var xGLTextureBuilderGetColorState func(uintptr) *ColorState | |
| 95 | + | ||
| 96 | + | // Gets the color state previously set via gdk_gl_texture_builder_set_color_state(). | |
| 97 | + | func (x *GLTextureBuilder) GetColorState() *ColorState { | |
| 98 | + | ||
| 99 | + | cret := xGLTextureBuilderGetColorState(x.GoPointer()) | |
| 100 | + | return cret | |
| 101 | + | } | |
| 102 | + | ||
| 103 | + | var xGLTextureBuilderGetContext func(uintptr) uintptr | |
| 104 | + | ||
| 105 | + | // Gets the context previously set via gdk_gl_texture_builder_set_context() or | |
| 106 | + | // %NULL if none was set. | |
| 107 | + | func (x *GLTextureBuilder) GetContext() *GLContext { | |
| 108 | + | var cls *GLContext | |
| 109 | + | ||
| 110 | + | cret := xGLTextureBuilderGetContext(x.GoPointer()) | |
| 111 | + | ||
| 112 | + | if cret == 0 { | |
| 113 | + | return nil | |
| 114 | + | } | |
| 115 | + | gobject.IncreaseRef(cret) | |
| 116 | + | cls = &GLContext{} | |
| 117 | + | cls.Ptr = cret | |
| 118 | + | return cls | |
| 119 | + | } | |
| 120 | + | ||
| 121 | + | var xGLTextureBuilderGetFormat func(uintptr) MemoryFormat | |
| 122 | + | ||
| 123 | + | // Gets the format previously set via gdk_gl_texture_builder_set_format(). | |
| 124 | + | func (x *GLTextureBuilder) GetFormat() MemoryFormat { | |
| 125 | + | ||
| 126 | + | cret := xGLTextureBuilderGetFormat(x.GoPointer()) | |
| 127 | + | return cret | |
| 128 | + | } | |
| 129 | + | ||
| 130 | + | var xGLTextureBuilderGetHasMipmap func(uintptr) bool | |
| 131 | + | ||
| 132 | + | // Gets whether the texture has a mipmap. | |
| 133 | + | func (x *GLTextureBuilder) GetHasMipmap() bool { | |
| 134 | + | ||
| 135 | + | cret := xGLTextureBuilderGetHasMipmap(x.GoPointer()) | |
| 136 | + | return cret | |
| 137 | + | } | |
| 138 | + | ||
| 139 | + | var xGLTextureBuilderGetHeight func(uintptr) int | |
| 140 | + | ||
| 141 | + | // Gets the height previously set via gdk_gl_texture_builder_set_height() or | |
| 142 | + | // 0 if the height wasn't set. | |
| 143 | + | func (x *GLTextureBuilder) GetHeight() int { | |
| 144 | + | ||
| 145 | + | cret := xGLTextureBuilderGetHeight(x.GoPointer()) | |
| 146 | + | return cret | |
| 147 | + | } | |
| 148 | + | ||
| 149 | + | var xGLTextureBuilderGetId func(uintptr) uint | |
| 150 | + | ||
| 151 | + | // Gets the texture id previously set via gdk_gl_texture_builder_set_id() or | |
| 152 | + | // 0 if the id wasn't set. | |
| 153 | + | func (x *GLTextureBuilder) GetId() uint { | |
| 154 | + | ||
| 155 | + | cret := xGLTextureBuilderGetId(x.GoPointer()) | |
| 156 | + | return cret | |
| 157 | + | } | |
| 158 | + | ||
| 159 | + | var xGLTextureBuilderGetSync func(uintptr) uintptr | |
| 160 | + | ||
| 161 | + | // Gets the `GLsync` previously set via gdk_gl_texture_builder_set_sync(). | |
| 162 | + | func (x *GLTextureBuilder) GetSync() uintptr { | |
| 163 | + | ||
| 164 | + | cret := xGLTextureBuilderGetSync(x.GoPointer()) | |
| 165 | + | return cret | |
| 166 | + | } | |
| 167 | + | ||
| 168 | + | var xGLTextureBuilderGetUpdateRegion func(uintptr) *cairo.Region | |
| 169 | + | ||
| 170 | + | // Gets the region previously set via gdk_gl_texture_builder_set_update_region() or | |
| 171 | + | // %NULL if none was set. | |
| 172 | + | func (x *GLTextureBuilder) GetUpdateRegion() *cairo.Region { | |
| 173 | + | ||
| 174 | + | cret := xGLTextureBuilderGetUpdateRegion(x.GoPointer()) | |
| 175 | + | return cret | |
| 176 | + | } | |
| 177 | + | ||
| 178 | + | var xGLTextureBuilderGetUpdateTexture func(uintptr) uintptr | |
| 179 | + | ||
| 180 | + | // Gets the texture previously set via gdk_gl_texture_builder_set_update_texture() or | |
| 181 | + | // %NULL if none was set. | |
| 182 | + | func (x *GLTextureBuilder) GetUpdateTexture() *Texture { | |
| 183 | + | var cls *Texture | |
| 184 | + | ||
| 185 | + | cret := xGLTextureBuilderGetUpdateTexture(x.GoPointer()) | |
| 186 | + | ||
| 187 | + | if cret == 0 { | |
| 188 | + | return nil | |
| 189 | + | } | |
| 190 | + | gobject.IncreaseRef(cret) | |
| 191 | + | cls = &Texture{} | |
| 192 | + | cls.Ptr = cret | |
| 193 | + | return cls | |
| 194 | + | } | |
| 195 | + | ||
| 196 | + | var xGLTextureBuilderGetWidth func(uintptr) int | |
| 197 | + | ||
| 198 | + | // Gets the width previously set via gdk_gl_texture_builder_set_width() or | |
| 199 | + | // 0 if the width wasn't set. | |
| 200 | + | func (x *GLTextureBuilder) GetWidth() int { | |
| 201 | + | ||
| 202 | + | cret := xGLTextureBuilderGetWidth(x.GoPointer()) | |
| 203 | + | return cret | |
| 204 | + | } | |
| 205 | + | ||
| 206 | + | var xGLTextureBuilderSetColorState func(uintptr, *ColorState) | |
| 207 | + | ||
| 208 | + | // Sets the color state for the texture. | |
| 209 | + | // | |
| 210 | + | // By default, the sRGB colorstate is used. If you don't know what | |
| 211 | + | // colorstates are, this is probably the right thing. | |
| 212 | + | func (x *GLTextureBuilder) SetColorState(ColorStateVar *ColorState) { | |
| 213 | + | ||
| 214 | + | xGLTextureBuilderSetColorState(x.GoPointer(), ColorStateVar) | |
| 215 | + | ||
| 216 | + | } | |
| 217 | + | ||
| 218 | + | var xGLTextureBuilderSetContext func(uintptr, uintptr) | |
| 219 | + | ||
| 220 | + | // Sets the context to be used for the texture. This is the context that owns | |
| 221 | + | // the texture. | |
| 222 | + | // | |
| 223 | + | // The context must be set before calling [method@Gdk.GLTextureBuilder.build]. | |
| 224 | + | func (x *GLTextureBuilder) SetContext(ContextVar *GLContext) { | |
| 225 | + | ||
| 226 | + | xGLTextureBuilderSetContext(x.GoPointer(), ContextVar.GoPointer()) | |
| 227 | + | ||
| 228 | + | } | |
| 229 | + | ||
| 230 | + | var xGLTextureBuilderSetFormat func(uintptr, MemoryFormat) | |
| 231 | + | ||
| 232 | + | // Sets the format of the texture. The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`. | |
| 233 | + | // | |
| 234 | + | // The format is the preferred format the texture data should be downloaded to. The | |
| 235 | + | // format must be supported by the GL version of [property@Gdk.GLTextureBuilder:context]. | |
| 236 | + | // | |
| 237 | + | // GDK's texture download code assumes that the format corresponds to the storage | |
| 238 | + | // parameters of the GL texture in an obvious way. For example, a format of | |
| 239 | + | // `GDK_MEMORY_R16G16B16A16_PREMULTIPLIED` is expected to be stored as `GL_RGBA16` | |
| 240 | + | // texture, and `GDK_MEMORY_G8A8` is expected to be stored as `GL_RG8` texture. | |
| 241 | + | // | |
| 242 | + | // Setting the right format is particularly useful when using high bit depth textures | |
| 243 | + | // to preserve the bit depth, to set the correct value for unpremultiplied textures | |
| 244 | + | // and to make sure opaque textures are treated as such. | |
| 245 | + | // | |
| 246 | + | // Non-RGBA textures need to have swizzling parameters set up properly to be usable | |
| 247 | + | // in GSK's shaders. | |
| 248 | + | func (x *GLTextureBuilder) SetFormat(FormatVar MemoryFormat) { | |
| 249 | + | ||
| 250 | + | xGLTextureBuilderSetFormat(x.GoPointer(), FormatVar) | |
| 251 | + | ||
| 252 | + | } | |
| 253 | + | ||
| 254 | + | var xGLTextureBuilderSetHasMipmap func(uintptr, bool) | |
| 255 | + | ||
| 256 | + | // Sets whether the texture has a mipmap. This allows the renderer and other users of the | |
| 257 | + | // generated texture to use a higher quality downscaling. | |
| 258 | + | // | |
| 259 | + | // Typically, the `glGenerateMipmap` function is used to generate a mimap. | |
| 260 | + | func (x *GLTextureBuilder) SetHasMipmap(HasMipmapVar bool) { | |
| 261 | + | ||
| 262 | + | xGLTextureBuilderSetHasMipmap(x.GoPointer(), HasMipmapVar) | |
| 263 | + | ||
| 264 | + | } | |
| 265 | + | ||
| 266 | + | var xGLTextureBuilderSetHeight func(uintptr, int) | |
| 267 | + | ||
| 268 | + | // Sets the height of the texture. | |
| 269 | + | // | |
| 270 | + | // The height must be set before calling [method@Gdk.GLTextureBuilder.build]. | |
| 271 | + | func (x *GLTextureBuilder) SetHeight(HeightVar int) { | |
| 272 | + | ||
| 273 | + | xGLTextureBuilderSetHeight(x.GoPointer(), HeightVar) | |
| 274 | + | ||
| 275 | + | } | |
| 276 | + | ||
| 277 | + | var xGLTextureBuilderSetId func(uintptr, uint) | |
| 278 | + | ||
| 279 | + | // Sets the texture id of the texture. The texture id must remain unmodified | |
| 280 | + | // until the texture was finalized. See [method@Gdk.GLTextureBuilder.build] | |
| 281 | + | // for a longer discussion. | |
| 282 | + | // | |
| 283 | + | // The id must be set before calling [method@Gdk.GLTextureBuilder.build]. | |
| 284 | + | func (x *GLTextureBuilder) SetId(IdVar uint) { | |
| 285 | + | ||
| 286 | + | xGLTextureBuilderSetId(x.GoPointer(), IdVar) | |
| 287 | + | ||
| 288 | + | } | |
| 289 | + | ||
| 290 | + | var xGLTextureBuilderSetSync func(uintptr, uintptr) | |
| 291 | + | ||
| 292 | + | // Sets the GLSync object to use for the texture. | |
| 293 | + | // | |
| 294 | + | // GTK will wait on this object before using the created `GdkTexture`. | |
| 295 | + | // | |
| 296 | + | // The `destroy` function that is passed to [method@Gdk.GLTextureBuilder.build] | |
| 297 | + | // is responsible for freeing the sync object when it is no longer needed. | |
| 298 | + | // The texture builder does not destroy it and it is the callers | |
| 299 | + | // responsibility to make sure it doesn't leak. | |
| 300 | + | func (x *GLTextureBuilder) SetSync(SyncVar uintptr) { | |
| 301 | + | ||
| 302 | + | xGLTextureBuilderSetSync(x.GoPointer(), SyncVar) | |
| 303 | + | ||
| 304 | + | } | |
| 305 | + | ||
| 306 | + | var xGLTextureBuilderSetUpdateRegion func(uintptr, *cairo.Region) | |
| 307 | + | ||
| 308 | + | // Sets the region to be updated by this texture. Together with | |
| 309 | + | // [property@Gdk.GLTextureBuilder:update-texture] this describes an | |
| 310 | + | // update of a previous texture. | |
| 311 | + | // | |
| 312 | + | // When rendering animations of large textures, it is possible that | |
| 313 | + | // consecutive textures are only updating contents in parts of the texture. | |
| 314 | + | // It is then possible to describe this update via these two properties, | |
| 315 | + | // so that GTK can avoid rerendering parts that did not change. | |
| 316 | + | // | |
| 317 | + | // An example would be a screen recording where only the mouse pointer moves. | |
| 318 | + | func (x *GLTextureBuilder) SetUpdateRegion(RegionVar *cairo.Region) { | |
| 319 | + | ||
| 320 | + | xGLTextureBuilderSetUpdateRegion(x.GoPointer(), RegionVar) | |
| 321 | + | ||
| 322 | + | } | |
| 323 | + | ||
| 324 | + | var xGLTextureBuilderSetUpdateTexture func(uintptr, uintptr) | |
| 325 | + | ||
| 326 | + | // Sets the texture to be updated by this texture. See | |
| 327 | + | // [method@Gdk.GLTextureBuilder.set_update_region] for an explanation. | |
| 328 | + | func (x *GLTextureBuilder) SetUpdateTexture(TextureVar *Texture) { | |
| 329 | + | ||
| 330 | + | xGLTextureBuilderSetUpdateTexture(x.GoPointer(), TextureVar.GoPointer()) | |
| 331 | + | ||
| 332 | + | } | |
| 333 | + | ||
| 334 | + | var xGLTextureBuilderSetWidth func(uintptr, int) | |
| 335 | + | ||
| 336 | + | // Sets the width of the texture. | |
| 337 | + | // | |
| 338 | + | // The width must be set before calling [method@Gdk.GLTextureBuilder.build]. | |
| 339 | + | func (x *GLTextureBuilder) SetWidth(WidthVar int) { | |
| 340 | + | ||
| 341 | + | xGLTextureBuilderSetWidth(x.GoPointer(), WidthVar) | |
| 342 | + | ||
| 343 | + | } | |
| 344 | + | ||
| 345 | + | func (c *GLTextureBuilder) GoPointer() uintptr { | |
| 346 | + | if c == nil { | |
| 347 | + | return 0 | |
| 348 | + | } | |
| 349 | + | return c.Ptr | |
| 350 | + | } | |
| 351 | + | ||
| 352 | + | func (c *GLTextureBuilder) SetGoPointer(ptr uintptr) { | |
| 353 | + | c.Ptr = ptr | |
| 354 | + | } | |
| 355 | + | ||
| 356 | + | func init() { | |
| 357 | + | core.SetPackageName("GDK", "gtk4") | |
| 358 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 359 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 360 | + | if err != nil { | |
| 361 | + | panic(err) | |
| 362 | + | } | |
| 363 | + | ||
| 364 | + | core.PuregoSafeRegister(&xGLTextureBuilderGLibType, lib, "gdk_gl_texture_builder_get_type") | |
| 365 | + | ||
| 366 | + | core.PuregoSafeRegister(&xNewGLTextureBuilder, lib, "gdk_gl_texture_builder_new") | |
| 367 | + | ||
| 368 | + | core.PuregoSafeRegister(&xGLTextureBuilderBuild, lib, "gdk_gl_texture_builder_build") | |
| 369 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetColorState, lib, "gdk_gl_texture_builder_get_color_state") | |
| 370 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetContext, lib, "gdk_gl_texture_builder_get_context") | |
| 371 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetFormat, lib, "gdk_gl_texture_builder_get_format") | |
| 372 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetHasMipmap, lib, "gdk_gl_texture_builder_get_has_mipmap") | |
| 373 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetHeight, lib, "gdk_gl_texture_builder_get_height") | |
| 374 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetId, lib, "gdk_gl_texture_builder_get_id") | |
| 375 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetSync, lib, "gdk_gl_texture_builder_get_sync") | |
| 376 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetUpdateRegion, lib, "gdk_gl_texture_builder_get_update_region") | |
| 377 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetUpdateTexture, lib, "gdk_gl_texture_builder_get_update_texture") | |
| 378 | + | core.PuregoSafeRegister(&xGLTextureBuilderGetWidth, lib, "gdk_gl_texture_builder_get_width") | |
| 379 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetColorState, lib, "gdk_gl_texture_builder_set_color_state") | |
| 380 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetContext, lib, "gdk_gl_texture_builder_set_context") | |
| 381 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetFormat, lib, "gdk_gl_texture_builder_set_format") | |
| 382 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetHasMipmap, lib, "gdk_gl_texture_builder_set_has_mipmap") | |
| 383 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetHeight, lib, "gdk_gl_texture_builder_set_height") | |
| 384 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetId, lib, "gdk_gl_texture_builder_set_id") | |
| 385 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetSync, lib, "gdk_gl_texture_builder_set_sync") | |
| 386 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetUpdateRegion, lib, "gdk_gl_texture_builder_set_update_region") | |
| 387 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetUpdateTexture, lib, "gdk_gl_texture_builder_set_update_texture") | |
| 388 | + | core.PuregoSafeRegister(&xGLTextureBuilderSetWidth, lib, "gdk_gl_texture_builder_set_width") | |
| 389 | + | ||
| 390 | + | } | |
M v4/gdk/gdkkeys.go +5 -5
| @@ -32,7 +32,7 @@ func KeyvalFromName(KeyvalNameVar string) uint { | |||
| 32 | 32 | ||
| 33 | 33 | var xKeyvalIsLower func(uint) bool | |
| 34 | 34 | ||
| 35 | - | // Returns %TRUE if the given key value is in lower case. | |
| 35 | + | // Returns true if the given key value is in lower case. | |
| 36 | 36 | func KeyvalIsLower(KeyvalVar uint) bool { | |
| 37 | 37 | ||
| 38 | 38 | cret := xKeyvalIsLower(KeyvalVar) | |
| @@ -41,7 +41,7 @@ func KeyvalIsLower(KeyvalVar uint) bool { | |||
| 41 | 41 | ||
| 42 | 42 | var xKeyvalIsUpper func(uint) bool | |
| 43 | 43 | ||
| 44 | - | // Returns %TRUE if the given key value is in upper case. | |
| 44 | + | // Returns true if the given key value is in upper case. | |
| 45 | 45 | func KeyvalIsUpper(KeyvalVar uint) bool { | |
| 46 | 46 | ||
| 47 | 47 | cret := xKeyvalIsUpper(KeyvalVar) | |
| @@ -72,12 +72,12 @@ func KeyvalToLower(KeyvalVar uint) uint { | |||
| 72 | 72 | ||
| 73 | 73 | var xKeyvalToUnicode func(uint) uint32 | |
| 74 | 74 | ||
| 75 | - | // Convert from a GDK key symbol to the corresponding Unicode | |
| 75 | + | // Converts from a GDK key symbol to the corresponding Unicode | |
| 76 | 76 | // character. | |
| 77 | 77 | // | |
| 78 | 78 | // Note that the conversion does not take the current locale | |
| 79 | 79 | // into consideration, which might be expected for particular | |
| 80 | - | // keyvals, such as %GDK_KEY_KP_Decimal. | |
| 80 | + | // keyvals, such as `GDK_KEY_KP_Decimal`. | |
| 81 | 81 | func KeyvalToUnicode(KeyvalVar uint) uint32 { | |
| 82 | 82 | ||
| 83 | 83 | cret := xKeyvalToUnicode(KeyvalVar) | |
| @@ -95,7 +95,7 @@ func KeyvalToUpper(KeyvalVar uint) uint { | |||
| 95 | 95 | ||
| 96 | 96 | var xUnicodeToKeyval func(uint32) uint | |
| 97 | 97 | ||
| 98 | - | // Convert from a Unicode character to a key symbol. | |
| 98 | + | // Converts from a Unicode character to a key symbol. | |
| 99 | 99 | func UnicodeToKeyval(WcVar uint32) uint { | |
| 100 | 100 | ||
| 101 | 101 | cret := xUnicodeToKeyval(WcVar) | |
M v4/gdk/gdkkeysyms.go +344 -0
| @@ -6,6 +6,10 @@ const ( | |||
| 6 | 6 | ||
| 7 | 7 | KEY_1 int = 49 | |
| 8 | 8 | ||
| 9 | + | KEY_10ChannelsDown int = 268964281 | |
| 10 | + | ||
| 11 | + | KEY_10ChannelsUp int = 268964280 | |
| 12 | + | ||
| 9 | 13 | KEY_2 int = 50 | |
| 10 | 14 | ||
| 11 | 15 | KEY_3 int = 51 | |
| @@ -70,6 +74,8 @@ const ( | |||
| 70 | 74 | ||
| 71 | 75 | KEY_3270_Test int = 64781 | |
| 72 | 76 | ||
| 77 | + | KEY_3DMode int = 268964463 | |
| 78 | + | ||
| 73 | 79 | KEY_4 int = 52 | |
| 74 | 80 | ||
| 75 | 81 | KEY_5 int = 53 | |
| @@ -86,6 +92,8 @@ const ( | |||
| 86 | 92 | ||
| 87 | 93 | KEY_AE int = 198 | |
| 88 | 94 | ||
| 95 | + | KEY_ALSToggle int = 268964400 | |
| 96 | + | ||
| 89 | 97 | KEY_Aacute int = 193 | |
| 90 | 98 | ||
| 91 | 99 | KEY_Abelowdot int = 16785056 | |
| @@ -106,6 +114,8 @@ const ( | |||
| 106 | 114 | ||
| 107 | 115 | KEY_AccessX_Feedback_Enable int = 65137 | |
| 108 | 116 | ||
| 117 | + | KEY_Accessibility int = 268964430 | |
| 118 | + | ||
| 109 | 119 | KEY_Acircumflex int = 194 | |
| 110 | 120 | ||
| 111 | 121 | KEY_Acircumflexacute int = 16785060 | |
| @@ -120,6 +130,8 @@ const ( | |||
| 120 | 130 | ||
| 121 | 131 | KEY_AddFavorite int = 269025081 | |
| 122 | 132 | ||
| 133 | + | KEY_Addressbook int = 268964269 | |
| 134 | + | ||
| 123 | 135 | KEY_Adiaeresis int = 196 | |
| 124 | 136 | ||
| 125 | 137 | KEY_Agrave int = 192 | |
| @@ -134,6 +146,8 @@ const ( | |||
| 134 | 146 | ||
| 135 | 147 | KEY_Aogonek int = 417 | |
| 136 | 148 | ||
| 149 | + | KEY_AppSelect int = 268964420 | |
| 150 | + | ||
| 137 | 151 | KEY_ApplicationLeft int = 269025104 | |
| 138 | 152 | ||
| 139 | 153 | KEY_ApplicationRight int = 269025105 | |
| @@ -480,12 +494,26 @@ const ( | |||
| 480 | 494 | ||
| 481 | 495 | KEY_Armenian_zhe int = 16778602 | |
| 482 | 496 | ||
| 497 | + | KEY_AspectRatio int = 268964215 | |
| 498 | + | ||
| 499 | + | KEY_Assistant int = 268964423 | |
| 500 | + | ||
| 483 | 501 | KEY_Atilde int = 195 | |
| 484 | 502 | ||
| 503 | + | KEY_AttendantOff int = 268964380 | |
| 504 | + | ||
| 505 | + | KEY_AttendantOn int = 268964379 | |
| 506 | + | ||
| 507 | + | KEY_AttendantToggle int = 268964381 | |
| 508 | + | ||
| 485 | 509 | KEY_AudibleBell_Enable int = 65146 | |
| 486 | 510 | ||
| 511 | + | KEY_Audio int = 268964232 | |
| 512 | + | ||
| 487 | 513 | KEY_AudioCycleTrack int = 269025179 | |
| 488 | 514 | ||
| 515 | + | KEY_AudioDesc int = 268964462 | |
| 516 | + | ||
| 489 | 517 | KEY_AudioForward int = 269025175 | |
| 490 | 518 | ||
| 491 | 519 | KEY_AudioLowerVolume int = 269025041 | |
| @@ -518,6 +546,8 @@ const ( | |||
| 518 | 546 | ||
| 519 | 547 | KEY_AudioStop int = 269025045 | |
| 520 | 548 | ||
| 549 | + | KEY_AutopilotEngageToggle int = 268964477 | |
| 550 | + | ||
| 521 | 551 | KEY_Away int = 269025165 | |
| 522 | 552 | ||
| 523 | 553 | KEY_B int = 66 | |
| @@ -546,6 +576,14 @@ const ( | |||
| 546 | 576 | ||
| 547 | 577 | KEY_BrightnessAdjust int = 269025083 | |
| 548 | 578 | ||
| 579 | + | KEY_BrightnessAuto int = 268964084 | |
| 580 | + | ||
| 581 | + | KEY_BrightnessMax int = 268964433 | |
| 582 | + | ||
| 583 | + | KEY_BrightnessMin int = 268964432 | |
| 584 | + | ||
| 585 | + | KEY_Buttonconfig int = 268964416 | |
| 586 | + | ||
| 549 | 587 | KEY_Byelorussian_SHORTU int = 1726 | |
| 550 | 588 | ||
| 551 | 589 | KEY_Byelorussian_shortu int = 1710 | |
| @@ -568,6 +606,26 @@ const ( | |||
| 568 | 606 | ||
| 569 | 607 | KEY_Calendar int = 269025056 | |
| 570 | 608 | ||
| 609 | + | KEY_CameraAccessDisable int = 268964428 | |
| 610 | + | ||
| 611 | + | KEY_CameraAccessEnable int = 268964427 | |
| 612 | + | ||
| 613 | + | KEY_CameraAccessToggle int = 268964429 | |
| 614 | + | ||
| 615 | + | KEY_CameraDown int = 268964376 | |
| 616 | + | ||
| 617 | + | KEY_CameraFocus int = 268964368 | |
| 618 | + | ||
| 619 | + | KEY_CameraLeft int = 268964377 | |
| 620 | + | ||
| 621 | + | KEY_CameraRight int = 268964378 | |
| 622 | + | ||
| 623 | + | KEY_CameraUp int = 268964375 | |
| 624 | + | ||
| 625 | + | KEY_CameraZoomIn int = 268964373 | |
| 626 | + | ||
| 627 | + | KEY_CameraZoomOut int = 268964374 | |
| 628 | + | ||
| 571 | 629 | KEY_Cancel int = 65385 | |
| 572 | 630 | ||
| 573 | 631 | KEY_Caps_Lock int = 65509 | |
| @@ -580,10 +638,16 @@ const ( | |||
| 580 | 638 | ||
| 581 | 639 | KEY_Ch int = 65185 | |
| 582 | 640 | ||
| 641 | + | KEY_ChannelDown int = 268964243 | |
| 642 | + | ||
| 643 | + | KEY_ChannelUp int = 268964242 | |
| 644 | + | ||
| 583 | 645 | KEY_Clear int = 65291 | |
| 584 | 646 | ||
| 585 | 647 | KEY_ClearGrab int = 269024801 | |
| 586 | 648 | ||
| 649 | + | KEY_ClearvuSonar int = 268964486 | |
| 650 | + | ||
| 587 | 651 | KEY_Close int = 269025110 | |
| 588 | 652 | ||
| 589 | 653 | KEY_Codeinput int = 65335 | |
| @@ -592,8 +656,12 @@ const ( | |||
| 592 | 656 | ||
| 593 | 657 | KEY_Community int = 269025085 | |
| 594 | 658 | ||
| 659 | + | KEY_ContextMenu int = 268964278 | |
| 660 | + | ||
| 595 | 661 | KEY_ContrastAdjust int = 269025058 | |
| 596 | 662 | ||
| 663 | + | KEY_ControlPanel int = 268964419 | |
| 664 | + | ||
| 597 | 665 | KEY_Control_L int = 65507 | |
| 598 | 666 | ||
| 599 | 667 | KEY_Control_R int = 65508 | |
| @@ -818,14 +886,28 @@ const ( | |||
| 818 | 886 | ||
| 819 | 887 | KEY_DOS int = 269025114 | |
| 820 | 888 | ||
| 889 | + | KEY_DVD int = 268964229 | |
| 890 | + | ||
| 821 | 891 | KEY_Dabovedot int = 16784906 | |
| 822 | 892 | ||
| 893 | + | KEY_Data int = 268964471 | |
| 894 | + | ||
| 895 | + | KEY_Database int = 268964266 | |
| 896 | + | ||
| 823 | 897 | KEY_Dcaron int = 463 | |
| 824 | 898 | ||
| 825 | 899 | KEY_Delete int = 65535 | |
| 826 | 900 | ||
| 901 | + | KEY_Dictate int = 268964426 | |
| 902 | + | ||
| 827 | 903 | KEY_Display int = 269025113 | |
| 828 | 904 | ||
| 905 | + | KEY_DisplayOff int = 268964085 | |
| 906 | + | ||
| 907 | + | KEY_DisplayToggle int = 268964271 | |
| 908 | + | ||
| 909 | + | KEY_DoNotDisturb int = 268964431 | |
| 910 | + | ||
| 829 | 911 | KEY_Documents int = 269025115 | |
| 830 | 912 | ||
| 831 | 913 | KEY_DongSign int = 16785579 | |
| @@ -834,6 +916,8 @@ const ( | |||
| 834 | 916 | ||
| 835 | 917 | KEY_Dstroke int = 464 | |
| 836 | 918 | ||
| 919 | + | KEY_DualRangeRadar int = 268964483 | |
| 920 | + | ||
| 837 | 921 | KEY_E int = 69 | |
| 838 | 922 | ||
| 839 | 923 | KEY_ENG int = 957 | |
| @@ -866,6 +950,8 @@ const ( | |||
| 866 | 950 | ||
| 867 | 951 | KEY_Ediaeresis int = 203 | |
| 868 | 952 | ||
| 953 | + | KEY_Editor int = 268964262 | |
| 954 | + | ||
| 869 | 955 | KEY_Egrave int = 200 | |
| 870 | 956 | ||
| 871 | 957 | KEY_Ehook int = 16785082 | |
| @@ -878,6 +964,8 @@ const ( | |||
| 878 | 964 | ||
| 879 | 965 | KEY_Emacron int = 938 | |
| 880 | 966 | ||
| 967 | + | KEY_EmojiPicker int = 268964425 | |
| 968 | + | ||
| 881 | 969 | KEY_End int = 65367 | |
| 882 | 970 | ||
| 883 | 971 | KEY_Eogonek int = 458 | |
| @@ -994,6 +1082,8 @@ const ( | |||
| 994 | 1082 | ||
| 995 | 1083 | KEY_Farsi_yeh int = 16778956 | |
| 996 | 1084 | ||
| 1085 | + | KEY_FastReverse int = 268964469 | |
| 1086 | + | ||
| 997 | 1087 | KEY_Favorites int = 269025072 | |
| 998 | 1088 | ||
| 999 | 1089 | KEY_Finance int = 269025084 | |
| @@ -1002,12 +1092,22 @@ const ( | |||
| 1002 | 1092 | ||
| 1003 | 1093 | KEY_First_Virtual_Screen int = 65232 | |
| 1004 | 1094 | ||
| 1095 | + | KEY_FishingChart int = 268964481 | |
| 1096 | + | ||
| 1097 | + | KEY_Fn int = 268964304 | |
| 1098 | + | ||
| 1099 | + | KEY_FnRightShift int = 268964325 | |
| 1100 | + | ||
| 1101 | + | KEY_Fn_Esc int = 268964305 | |
| 1102 | + | ||
| 1005 | 1103 | KEY_Forward int = 269025063 | |
| 1006 | 1104 | ||
| 1007 | 1105 | KEY_FrameBack int = 269025181 | |
| 1008 | 1106 | ||
| 1009 | 1107 | KEY_FrameForward int = 269025182 | |
| 1010 | 1108 | ||
| 1109 | + | KEY_FullScreen int = 269025208 | |
| 1110 | + | ||
| 1011 | 1111 | KEY_G int = 71 | |
| 1012 | 1112 | ||
| 1013 | 1113 | KEY_Gabovedot int = 725 | |
| @@ -1102,6 +1202,8 @@ const ( | |||
| 1102 | 1202 | ||
| 1103 | 1203 | KEY_Go int = 269025119 | |
| 1104 | 1204 | ||
| 1205 | + | KEY_GraphicsEditor int = 268964264 | |
| 1206 | + | ||
| 1105 | 1207 | KEY_Greek_ALPHA int = 1985 | |
| 1106 | 1208 | ||
| 1107 | 1209 | KEY_Greek_ALPHAaccent int = 1953 | |
| @@ -1468,6 +1570,8 @@ const ( | |||
| 1468 | 1570 | ||
| 1469 | 1571 | KEY_Hangul_switch int = 65406 | |
| 1470 | 1572 | ||
| 1573 | + | KEY_HangupPhone int = 268964286 | |
| 1574 | + | ||
| 1471 | 1575 | KEY_Hankaku int = 65321 | |
| 1472 | 1576 | ||
| 1473 | 1577 | KEY_Hcircumflex int = 678 | |
| @@ -1600,6 +1704,10 @@ const ( | |||
| 1600 | 1704 | ||
| 1601 | 1705 | KEY_Imacron int = 975 | |
| 1602 | 1706 | ||
| 1707 | + | KEY_Images int = 268964282 | |
| 1708 | + | ||
| 1709 | + | KEY_Info int = 268964198 | |
| 1710 | + | ||
| 1603 | 1711 | KEY_Insert int = 65379 | |
| 1604 | 1712 | ||
| 1605 | 1713 | KEY_Iogonek int = 967 | |
| @@ -1610,6 +1718,8 @@ const ( | |||
| 1610 | 1718 | ||
| 1611 | 1719 | KEY_Jcircumflex int = 684 | |
| 1612 | 1720 | ||
| 1721 | + | KEY_Journal int = 268964418 | |
| 1722 | + | ||
| 1613 | 1723 | KEY_K int = 75 | |
| 1614 | 1724 | ||
| 1615 | 1725 | KEY_KP_0 int = 65456 | |
| @@ -1700,6 +1810,28 @@ const ( | |||
| 1700 | 1810 | ||
| 1701 | 1811 | KEY_KbdBrightnessUp int = 269025029 | |
| 1702 | 1812 | ||
| 1813 | + | KEY_KbdInputAssistAccept int = 268964452 | |
| 1814 | + | ||
| 1815 | + | KEY_KbdInputAssistCancel int = 268964453 | |
| 1816 | + | ||
| 1817 | + | KEY_KbdInputAssistNext int = 268964449 | |
| 1818 | + | ||
| 1819 | + | KEY_KbdInputAssistNextgroup int = 268964451 | |
| 1820 | + | ||
| 1821 | + | KEY_KbdInputAssistPrev int = 268964448 | |
| 1822 | + | ||
| 1823 | + | KEY_KbdInputAssistPrevgroup int = 268964450 | |
| 1824 | + | ||
| 1825 | + | KEY_KbdLcdMenu1 int = 268964536 | |
| 1826 | + | ||
| 1827 | + | KEY_KbdLcdMenu2 int = 268964537 | |
| 1828 | + | ||
| 1829 | + | KEY_KbdLcdMenu3 int = 268964538 | |
| 1830 | + | ||
| 1831 | + | KEY_KbdLcdMenu4 int = 268964539 | |
| 1832 | + | ||
| 1833 | + | KEY_KbdLcdMenu5 int = 268964540 | |
| 1834 | + | ||
| 1703 | 1835 | KEY_KbdLightOnOff int = 269025028 | |
| 1704 | 1836 | ||
| 1705 | 1837 | KEY_Kcedilla int = 979 | |
| @@ -1774,8 +1906,14 @@ const ( | |||
| 1774 | 1906 | ||
| 1775 | 1907 | KEY_Left int = 65361 | |
| 1776 | 1908 | ||
| 1909 | + | KEY_LeftDown int = 268964457 | |
| 1910 | + | ||
| 1911 | + | KEY_LeftUp int = 268964456 | |
| 1912 | + | ||
| 1777 | 1913 | KEY_LightBulb int = 269025077 | |
| 1778 | 1914 | ||
| 1915 | + | KEY_LightsToggle int = 268964382 | |
| 1916 | + | ||
| 1779 | 1917 | KEY_Linefeed int = 65290 | |
| 1780 | 1918 | ||
| 1781 | 1919 | KEY_LiraSign int = 16785572 | |
| @@ -1804,16 +1942,94 @@ const ( | |||
| 1804 | 1942 | ||
| 1805 | 1943 | KEY_Macedonia_kje int = 1708 | |
| 1806 | 1944 | ||
| 1945 | + | KEY_Macro1 int = 268964496 | |
| 1946 | + | ||
| 1947 | + | KEY_Macro10 int = 268964505 | |
| 1948 | + | ||
| 1949 | + | KEY_Macro11 int = 268964506 | |
| 1950 | + | ||
| 1951 | + | KEY_Macro12 int = 268964507 | |
| 1952 | + | ||
| 1953 | + | KEY_Macro13 int = 268964508 | |
| 1954 | + | ||
| 1955 | + | KEY_Macro14 int = 268964509 | |
| 1956 | + | ||
| 1957 | + | KEY_Macro15 int = 268964510 | |
| 1958 | + | ||
| 1959 | + | KEY_Macro16 int = 268964511 | |
| 1960 | + | ||
| 1961 | + | KEY_Macro17 int = 268964512 | |
| 1962 | + | ||
| 1963 | + | KEY_Macro18 int = 268964513 | |
| 1964 | + | ||
| 1965 | + | KEY_Macro19 int = 268964514 | |
| 1966 | + | ||
| 1967 | + | KEY_Macro2 int = 268964497 | |
| 1968 | + | ||
| 1969 | + | KEY_Macro20 int = 268964515 | |
| 1970 | + | ||
| 1971 | + | KEY_Macro21 int = 268964516 | |
| 1972 | + | ||
| 1973 | + | KEY_Macro22 int = 268964517 | |
| 1974 | + | ||
| 1975 | + | KEY_Macro23 int = 268964518 | |
| 1976 | + | ||
| 1977 | + | KEY_Macro24 int = 268964519 | |
| 1978 | + | ||
| 1979 | + | KEY_Macro25 int = 268964520 | |
| 1980 | + | ||
| 1981 | + | KEY_Macro26 int = 268964521 | |
| 1982 | + | ||
| 1983 | + | KEY_Macro27 int = 268964522 | |
| 1984 | + | ||
| 1985 | + | KEY_Macro28 int = 268964523 | |
| 1986 | + | ||
| 1987 | + | KEY_Macro29 int = 268964524 | |
| 1988 | + | ||
| 1989 | + | KEY_Macro3 int = 268964498 | |
| 1990 | + | ||
| 1991 | + | KEY_Macro30 int = 268964525 | |
| 1992 | + | ||
| 1993 | + | KEY_Macro4 int = 268964499 | |
| 1994 | + | ||
| 1995 | + | KEY_Macro5 int = 268964500 | |
| 1996 | + | ||
| 1997 | + | KEY_Macro6 int = 268964501 | |
| 1998 | + | ||
| 1999 | + | KEY_Macro7 int = 268964502 | |
| 2000 | + | ||
| 2001 | + | KEY_Macro8 int = 268964503 | |
| 2002 | + | ||
| 2003 | + | KEY_Macro9 int = 268964504 | |
| 2004 | + | ||
| 2005 | + | KEY_MacroPreset1 int = 268964531 | |
| 2006 | + | ||
| 2007 | + | KEY_MacroPreset2 int = 268964532 | |
| 2008 | + | ||
| 2009 | + | KEY_MacroPreset3 int = 268964533 | |
| 2010 | + | ||
| 2011 | + | KEY_MacroPresetCycle int = 268964530 | |
| 2012 | + | ||
| 2013 | + | KEY_MacroRecordStart int = 268964528 | |
| 2014 | + | ||
| 2015 | + | KEY_MacroRecordStop int = 268964529 | |
| 2016 | + | ||
| 1807 | 2017 | KEY_Mae_Koho int = 65342 | |
| 1808 | 2018 | ||
| 1809 | 2019 | KEY_Mail int = 269025049 | |
| 1810 | 2020 | ||
| 1811 | 2021 | KEY_MailForward int = 269025168 | |
| 1812 | 2022 | ||
| 2023 | + | KEY_MarkWaypoint int = 268964478 | |
| 2024 | + | ||
| 1813 | 2025 | KEY_Market int = 269025122 | |
| 1814 | 2026 | ||
| 1815 | 2027 | KEY_Massyo int = 65324 | |
| 1816 | 2028 | ||
| 2029 | + | KEY_MediaRepeat int = 268964279 | |
| 2030 | + | ||
| 2031 | + | KEY_MediaTopMenu int = 268964459 | |
| 2032 | + | ||
| 1817 | 2033 | KEY_Meeting int = 269025123 | |
| 1818 | 2034 | ||
| 1819 | 2035 | KEY_Memo int = 269025054 | |
| @@ -1836,6 +2052,8 @@ const ( | |||
| 1836 | 2052 | ||
| 1837 | 2053 | KEY_Mode_switch int = 65406 | |
| 1838 | 2054 | ||
| 2055 | + | KEY_MonBrightnessCycle int = 269025031 | |
| 2056 | + | ||
| 1839 | 2057 | KEY_MonBrightnessDown int = 269025027 | |
| 1840 | 2058 | ||
| 1841 | 2059 | KEY_MonBrightnessUp int = 269025026 | |
| @@ -1862,6 +2080,10 @@ const ( | |||
| 1862 | 2080 | ||
| 1863 | 2081 | KEY_NairaSign int = 16785574 | |
| 1864 | 2082 | ||
| 2083 | + | KEY_NavChart int = 268964480 | |
| 2084 | + | ||
| 2085 | + | KEY_NavInfo int = 268964488 | |
| 2086 | + | ||
| 1865 | 2087 | KEY_Ncaron int = 466 | |
| 1866 | 2088 | ||
| 1867 | 2089 | KEY_Ncedilla int = 977 | |
| @@ -1874,14 +2096,56 @@ const ( | |||
| 1874 | 2096 | ||
| 1875 | 2097 | KEY_Next int = 65366 | |
| 1876 | 2098 | ||
| 2099 | + | KEY_NextElement int = 268964475 | |
| 2100 | + | ||
| 2101 | + | KEY_NextFavorite int = 268964464 | |
| 2102 | + | ||
| 1877 | 2103 | KEY_Next_VMode int = 269024802 | |
| 1878 | 2104 | ||
| 1879 | 2105 | KEY_Next_Virtual_Screen int = 65234 | |
| 1880 | 2106 | ||
| 2107 | + | KEY_NotificationCenter int = 268964284 | |
| 2108 | + | ||
| 1881 | 2109 | KEY_Ntilde int = 209 | |
| 1882 | 2110 | ||
| 1883 | 2111 | KEY_Num_Lock int = 65407 | |
| 1884 | 2112 | ||
| 2113 | + | KEY_Numeric0 int = 268964352 | |
| 2114 | + | ||
| 2115 | + | KEY_Numeric1 int = 268964353 | |
| 2116 | + | ||
| 2117 | + | KEY_Numeric11 int = 268964460 | |
| 2118 | + | ||
| 2119 | + | KEY_Numeric12 int = 268964461 | |
| 2120 | + | ||
| 2121 | + | KEY_Numeric2 int = 268964354 | |
| 2122 | + | ||
| 2123 | + | KEY_Numeric3 int = 268964355 | |
| 2124 | + | ||
| 2125 | + | KEY_Numeric4 int = 268964356 | |
| 2126 | + | ||
| 2127 | + | KEY_Numeric5 int = 268964357 | |
| 2128 | + | ||
| 2129 | + | KEY_Numeric6 int = 268964358 | |
| 2130 | + | ||
| 2131 | + | KEY_Numeric7 int = 268964359 | |
| 2132 | + | ||
| 2133 | + | KEY_Numeric8 int = 268964360 | |
| 2134 | + | ||
| 2135 | + | KEY_Numeric9 int = 268964361 | |
| 2136 | + | ||
| 2137 | + | KEY_NumericA int = 268964364 | |
| 2138 | + | ||
| 2139 | + | KEY_NumericB int = 268964365 | |
| 2140 | + | ||
| 2141 | + | KEY_NumericC int = 268964366 | |
| 2142 | + | ||
| 2143 | + | KEY_NumericD int = 268964367 | |
| 2144 | + | ||
| 2145 | + | KEY_NumericPound int = 268964363 | |
| 2146 | + | ||
| 2147 | + | KEY_NumericStar int = 268964362 | |
| 2148 | + | ||
| 1885 | 2149 | KEY_O int = 79 | |
| 1886 | 2150 | ||
| 1887 | 2151 | KEY_OE int = 5052 | |
| @@ -1930,6 +2194,8 @@ const ( | |||
| 1930 | 2194 | ||
| 1931 | 2195 | KEY_Omacron int = 978 | |
| 1932 | 2196 | ||
| 2197 | + | KEY_OnScreenKeyboard int = 268964472 | |
| 2198 | + | ||
| 1933 | 2199 | KEY_Ooblique int = 216 | |
| 1934 | 2200 | ||
| 1935 | 2201 | KEY_Open int = 269025131 | |
| @@ -1958,10 +2224,14 @@ const ( | |||
| 1958 | 2224 | ||
| 1959 | 2225 | KEY_Pause int = 65299 | |
| 1960 | 2226 | ||
| 2227 | + | KEY_PauseRecord int = 268964466 | |
| 2228 | + | ||
| 1961 | 2229 | KEY_PesetaSign int = 16785575 | |
| 1962 | 2230 | ||
| 1963 | 2231 | KEY_Phone int = 269025134 | |
| 1964 | 2232 | ||
| 2233 | + | KEY_PickupPhone int = 268964285 | |
| 2234 | + | ||
| 1965 | 2235 | KEY_Pictures int = 269025169 | |
| 1966 | 2236 | ||
| 1967 | 2237 | KEY_Pointer_Accelerate int = 65274 | |
| @@ -2028,16 +2298,22 @@ const ( | |||
| 2028 | 2298 | ||
| 2029 | 2299 | KEY_PowerOff int = 269025066 | |
| 2030 | 2300 | ||
| 2301 | + | KEY_Presentation int = 268964265 | |
| 2302 | + | ||
| 2031 | 2303 | KEY_Prev_VMode int = 269024803 | |
| 2032 | 2304 | ||
| 2033 | 2305 | KEY_Prev_Virtual_Screen int = 65233 | |
| 2034 | 2306 | ||
| 2035 | 2307 | KEY_PreviousCandidate int = 65342 | |
| 2036 | 2308 | ||
| 2309 | + | KEY_PreviousElement int = 268964476 | |
| 2310 | + | ||
| 2037 | 2311 | KEY_Print int = 65377 | |
| 2038 | 2312 | ||
| 2039 | 2313 | KEY_Prior int = 65365 | |
| 2040 | 2314 | ||
| 2315 | + | KEY_PrivacyScreenToggle int = 268964473 | |
| 2316 | + | ||
| 2041 | 2317 | KEY_Q int = 81 | |
| 2042 | 2318 | ||
| 2043 | 2319 | KEY_R int = 82 | |
| @@ -2076,6 +2352,8 @@ const ( | |||
| 2076 | 2352 | ||
| 2077 | 2353 | KEY_Racute int = 448 | |
| 2078 | 2354 | ||
| 2355 | + | KEY_RadarOverlay int = 268964484 | |
| 2356 | + | ||
| 2079 | 2357 | KEY_Rcaron int = 472 | |
| 2080 | 2358 | ||
| 2081 | 2359 | KEY_Rcedilla int = 931 | |
| @@ -2086,6 +2364,8 @@ const ( | |||
| 2086 | 2364 | ||
| 2087 | 2365 | KEY_Refresh int = 269025065 | |
| 2088 | 2366 | ||
| 2367 | + | KEY_RefreshRateToggle int = 268964402 | |
| 2368 | + | ||
| 2089 | 2369 | KEY_Reload int = 269025139 | |
| 2090 | 2370 | ||
| 2091 | 2371 | KEY_RepeatKeys_Enable int = 65138 | |
| @@ -2096,6 +2376,10 @@ const ( | |||
| 2096 | 2376 | ||
| 2097 | 2377 | KEY_Right int = 65363 | |
| 2098 | 2378 | ||
| 2379 | + | KEY_RightDown int = 268964455 | |
| 2380 | + | ||
| 2381 | + | KEY_RightUp int = 268964454 | |
| 2382 | + | ||
| 2099 | 2383 | KEY_RockerDown int = 269025060 | |
| 2100 | 2384 | ||
| 2101 | 2385 | KEY_RockerEnter int = 269025061 | |
| @@ -2104,10 +2388,14 @@ const ( | |||
| 2104 | 2388 | ||
| 2105 | 2389 | KEY_Romaji int = 65316 | |
| 2106 | 2390 | ||
| 2391 | + | KEY_RootMenu int = 268964458 | |
| 2392 | + | ||
| 2107 | 2393 | KEY_RotateWindows int = 269025140 | |
| 2108 | 2394 | ||
| 2109 | 2395 | KEY_RotationKB int = 269025142 | |
| 2110 | 2396 | ||
| 2397 | + | KEY_RotationLockToggle int = 269025207 | |
| 2398 | + | ||
| 2111 | 2399 | KEY_RotationPB int = 269025141 | |
| 2112 | 2400 | ||
| 2113 | 2401 | KEY_RupeeSign int = 16785576 | |
| @@ -2130,6 +2418,8 @@ const ( | |||
| 2130 | 2418 | ||
| 2131 | 2419 | KEY_ScreenSaver int = 269025069 | |
| 2132 | 2420 | ||
| 2421 | + | KEY_Screensaver int = 268964421 | |
| 2422 | + | ||
| 2133 | 2423 | KEY_ScrollClick int = 269025146 | |
| 2134 | 2424 | ||
| 2135 | 2425 | KEY_ScrollDown int = 269025145 | |
| @@ -2144,6 +2434,8 @@ const ( | |||
| 2144 | 2434 | ||
| 2145 | 2435 | KEY_SelectButton int = 269025184 | |
| 2146 | 2436 | ||
| 2437 | + | KEY_SelectiveScreenshot int = 268964474 | |
| 2438 | + | ||
| 2147 | 2439 | KEY_Send int = 269025147 | |
| 2148 | 2440 | ||
| 2149 | 2441 | KEY_Serbian_DJE int = 1713 | |
| @@ -2178,8 +2470,12 @@ const ( | |||
| 2178 | 2470 | ||
| 2179 | 2471 | KEY_Shop int = 269025078 | |
| 2180 | 2472 | ||
| 2473 | + | KEY_SidevuSonar int = 268964487 | |
| 2474 | + | ||
| 2181 | 2475 | KEY_SingleCandidate int = 65340 | |
| 2182 | 2476 | ||
| 2477 | + | KEY_SingleRangeRadar int = 268964482 | |
| 2478 | + | ||
| 2183 | 2479 | KEY_Sinh_a int = 16780677 | |
| 2184 | 2480 | ||
| 2185 | 2481 | KEY_Sinh_aa int = 16780678 | |
| @@ -2344,8 +2640,14 @@ const ( | |||
| 2344 | 2640 | ||
| 2345 | 2641 | KEY_SlowKeys_Enable int = 65139 | |
| 2346 | 2642 | ||
| 2643 | + | KEY_SlowReverse int = 268964470 | |
| 2644 | + | ||
| 2645 | + | KEY_Sos int = 268964479 | |
| 2646 | + | ||
| 2347 | 2647 | KEY_Spell int = 269025148 | |
| 2348 | 2648 | ||
| 2649 | + | KEY_SpellCheck int = 268964272 | |
| 2650 | + | ||
| 2349 | 2651 | KEY_SplitScreen int = 269025149 | |
| 2350 | 2652 | ||
| 2351 | 2653 | KEY_Standby int = 269025040 | |
| @@ -2356,6 +2658,8 @@ const ( | |||
| 2356 | 2658 | ||
| 2357 | 2659 | KEY_Stop int = 269025064 | |
| 2358 | 2660 | ||
| 2661 | + | KEY_StopRecord int = 268964465 | |
| 2662 | + | ||
| 2359 | 2663 | KEY_Subtitle int = 269025178 | |
| 2360 | 2664 | ||
| 2361 | 2665 | KEY_Super_L int = 65515 | |
| @@ -2402,6 +2706,8 @@ const ( | |||
| 2402 | 2706 | ||
| 2403 | 2707 | KEY_TaskPane int = 269025151 | |
| 2404 | 2708 | ||
| 2709 | + | KEY_Taskmanager int = 268964417 | |
| 2710 | + | ||
| 2405 | 2711 | KEY_Tcaron int = 427 | |
| 2406 | 2712 | ||
| 2407 | 2713 | KEY_Tcedilla int = 478 | |
| @@ -2596,6 +2902,8 @@ const ( | |||
| 2596 | 2902 | ||
| 2597 | 2903 | KEY_Touroku int = 65323 | |
| 2598 | 2904 | ||
| 2905 | + | KEY_TraditionalSonar int = 268964485 | |
| 2906 | + | ||
| 2599 | 2907 | KEY_Travel int = 269025154 | |
| 2600 | 2908 | ||
| 2601 | 2909 | KEY_Tslash int = 940 | |
| @@ -2666,6 +2974,8 @@ const ( | |||
| 2666 | 2974 | ||
| 2667 | 2975 | KEY_Ungrab int = 269024800 | |
| 2668 | 2976 | ||
| 2977 | + | KEY_Unmute int = 268964468 | |
| 2978 | + | ||
| 2669 | 2979 | KEY_Uogonek int = 985 | |
| 2670 | 2980 | ||
| 2671 | 2981 | KEY_Up int = 65362 | |
| @@ -2682,18 +2992,28 @@ const ( | |||
| 2682 | 2992 | ||
| 2683 | 2993 | KEY_V int = 86 | |
| 2684 | 2994 | ||
| 2995 | + | KEY_VOD int = 268964467 | |
| 2996 | + | ||
| 2685 | 2997 | KEY_VendorHome int = 269025076 | |
| 2686 | 2998 | ||
| 2687 | 2999 | KEY_Video int = 269025159 | |
| 2688 | 3000 | ||
| 3001 | + | KEY_VideoPhone int = 268964256 | |
| 3002 | + | ||
| 2689 | 3003 | KEY_View int = 269025185 | |
| 2690 | 3004 | ||
| 3005 | + | KEY_VoiceCommand int = 268964422 | |
| 3006 | + | ||
| 3007 | + | KEY_Voicemail int = 268964268 | |
| 3008 | + | ||
| 2691 | 3009 | KEY_VoidSymbol int = 16777215 | |
| 2692 | 3010 | ||
| 2693 | 3011 | KEY_W int = 87 | |
| 2694 | 3012 | ||
| 2695 | 3013 | KEY_WLAN int = 269025173 | |
| 2696 | 3014 | ||
| 3015 | + | KEY_WPSButton int = 268964369 | |
| 3016 | + | ||
| 2697 | 3017 | KEY_WWAN int = 269025204 | |
| 2698 | 3018 | ||
| 2699 | 3019 | KEY_WWW int = 269025070 | |
| @@ -2760,6 +3080,8 @@ const ( | |||
| 2760 | 3080 | ||
| 2761 | 3081 | KEY_ZoomOut int = 269025164 | |
| 2762 | 3082 | ||
| 3083 | + | KEY_ZoomReset int = 268964260 | |
| 3084 | + | ||
| 2763 | 3085 | KEY_Zstroke int = 16777653 | |
| 2764 | 3086 | ||
| 2765 | 3087 | KEY_a int = 97 | |
| @@ -3440,6 +3762,16 @@ const ( | |||
| 3440 | 3762 | ||
| 3441 | 3763 | KEY_colon int = 58 | |
| 3442 | 3764 | ||
| 3765 | + | KEY_combining_acute int = 16777985 | |
| 3766 | + | ||
| 3767 | + | KEY_combining_belowdot int = 16778019 | |
| 3768 | + | ||
| 3769 | + | KEY_combining_grave int = 16777984 | |
| 3770 | + | ||
| 3771 | + | KEY_combining_hook int = 16777993 | |
| 3772 | + | ||
| 3773 | + | KEY_combining_tilde int = 16777987 | |
| 3774 | + | ||
| 3443 | 3775 | KEY_comma int = 44 | |
| 3444 | 3776 | ||
| 3445 | 3777 | KEY_containsas int = 16785931 | |
| @@ -3472,6 +3804,8 @@ const ( | |||
| 3472 | 3804 | ||
| 3473 | 3805 | KEY_dead_O int = 65159 | |
| 3474 | 3806 | ||
| 3807 | + | KEY_dead_SCHWA int = 65163 | |
| 3808 | + | ||
| 3475 | 3809 | KEY_dead_U int = 65161 | |
| 3476 | 3810 | ||
| 3477 | 3811 | KEY_dead_a int = 65152 | |
| @@ -3532,6 +3866,8 @@ const ( | |||
| 3532 | 3866 | ||
| 3533 | 3867 | KEY_dead_greek int = 65164 | |
| 3534 | 3868 | ||
| 3869 | + | KEY_dead_hamza int = 65165 | |
| 3870 | + | ||
| 3535 | 3871 | KEY_dead_hook int = 65121 | |
| 3536 | 3872 | ||
| 3537 | 3873 | KEY_dead_horn int = 65122 | |
| @@ -3556,6 +3892,8 @@ const ( | |||
| 3556 | 3892 | ||
| 3557 | 3893 | KEY_dead_psili int = 65124 | |
| 3558 | 3894 | ||
| 3895 | + | KEY_dead_schwa int = 65162 | |
| 3896 | + | ||
| 3559 | 3897 | KEY_dead_semivoiced_sound int = 65119 | |
| 3560 | 3898 | ||
| 3561 | 3899 | KEY_dead_small_schwa int = 65162 | |
| @@ -3744,6 +4082,10 @@ const ( | |||
| 3744 | 4082 | ||
| 3745 | 4083 | KEY_greaterthanequal int = 2238 | |
| 3746 | 4084 | ||
| 4085 | + | KEY_guillemetleft int = 171 | |
| 4086 | + | ||
| 4087 | + | KEY_guillemetright int = 187 | |
| 4088 | + | ||
| 3747 | 4089 | KEY_guillemotleft int = 171 | |
| 3748 | 4090 | ||
| 3749 | 4091 | KEY_guillemotright int = 187 | |
| @@ -4230,6 +4572,8 @@ const ( | |||
| 4230 | 4572 | ||
| 4231 | 4573 | KEY_ordfeminine int = 170 | |
| 4232 | 4574 | ||
| 4575 | + | KEY_ordmasculine int = 186 | |
| 4576 | + | ||
| 4233 | 4577 | KEY_oslash int = 248 | |
| 4234 | 4578 | ||
| 4235 | 4579 | KEY_otilde int = 245 | |
M v4/gdk/gdkmemorytexture.go +7 -0
| @@ -218,6 +218,13 @@ func (x *MemoryTexture) Equal(Icon2Var gio.Icon) bool { | |||
| 218 | 218 | return cret | |
| 219 | 219 | } | |
| 220 | 220 | ||
| 221 | + | // Gets a hash for an icon. | |
| 222 | + | func (x *MemoryTexture) Hash() uint { | |
| 223 | + | ||
| 224 | + | cret := gio.XGIconHash(x.GoPointer()) | |
| 225 | + | return cret | |
| 226 | + | } | |
| 227 | + | ||
| 221 | 228 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| 222 | 229 | // back by calling g_icon_deserialize() on the returned value. | |
| 223 | 230 | // As serialization will avoid using raw icon data when possible, it only | |
A v4/gdk/gdkmemorytexturebuilder.go +312 -0
| @@ -0,0 +1,312 @@ | |||
| 1 | + | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gdk | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "structs" | |
| 6 | + | "unsafe" | |
| 7 | + | ||
| 8 | + | "github.com/jwijenbergh/purego" | |
| 9 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/cairo" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 12 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 13 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 14 | + | ) | |
| 15 | + | ||
| 16 | + | type MemoryTextureBuilderClass struct { | |
| 17 | + | _ structs.HostLayout | |
| 18 | + | } | |
| 19 | + | ||
| 20 | + | func (x *MemoryTextureBuilderClass) GoPointer() uintptr { | |
| 21 | + | return uintptr(unsafe.Pointer(x)) | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | // Constructs [class@Gdk.Texture] objects from system memory provided | |
| 25 | + | // via [struct@GLib.Bytes]. | |
| 26 | + | // | |
| 27 | + | // The operation is quite simple: Create a texture builder, set all the necessary | |
| 28 | + | // properties - keep in mind that the properties [property@Gdk.MemoryTextureBuilder:bytes], | |
| 29 | + | // [property@Gdk.MemoryTextureBuilder:stride], [property@Gdk.MemoryTextureBuilder:width], | |
| 30 | + | // and [property@Gdk.MemoryTextureBuilder:height] are mandatory - and then call | |
| 31 | + | // [method@Gdk.MemoryTextureBuilder.build] to create the new texture. | |
| 32 | + | // | |
| 33 | + | // `GdkMemoryTextureBuilder` can be used for quick one-shot construction of | |
| 34 | + | // textures as well as kept around and reused to construct multiple textures. | |
| 35 | + | type MemoryTextureBuilder struct { | |
| 36 | + | gobject.Object | |
| 37 | + | } | |
| 38 | + | ||
| 39 | + | var xMemoryTextureBuilderGLibType func() types.GType | |
| 40 | + | ||
| 41 | + | func MemoryTextureBuilderGLibType() types.GType { | |
| 42 | + | return xMemoryTextureBuilderGLibType() | |
| 43 | + | } | |
| 44 | + | ||
| 45 | + | func MemoryTextureBuilderNewFromInternalPtr(ptr uintptr) *MemoryTextureBuilder { | |
| 46 | + | cls := &MemoryTextureBuilder{} | |
| 47 | + | cls.Ptr = ptr | |
| 48 | + | return cls | |
| 49 | + | } | |
| 50 | + | ||
| 51 | + | var xNewMemoryTextureBuilder func() uintptr | |
| 52 | + | ||
| 53 | + | // Creates a new texture builder. | |
| 54 | + | func NewMemoryTextureBuilder() *MemoryTextureBuilder { | |
| 55 | + | var cls *MemoryTextureBuilder | |
| 56 | + | ||
| 57 | + | cret := xNewMemoryTextureBuilder() | |
| 58 | + | ||
| 59 | + | if cret == 0 { | |
| 60 | + | return nil | |
| 61 | + | } | |
| 62 | + | cls = &MemoryTextureBuilder{} | |
| 63 | + | cls.Ptr = cret | |
| 64 | + | return cls | |
| 65 | + | } | |
| 66 | + | ||
| 67 | + | var xMemoryTextureBuilderBuild func(uintptr) uintptr | |
| 68 | + | ||
| 69 | + | // Builds a new `GdkTexture` with the values set up in the builder. | |
| 70 | + | // | |
| 71 | + | // Note that it is a programming error to call this function if any mandatory | |
| 72 | + | // property has not been set. | |
| 73 | + | // | |
| 74 | + | // It is possible to call this function multiple times to create multiple textures, | |
| 75 | + | // possibly with changing properties in between. | |
| 76 | + | func (x *MemoryTextureBuilder) Build() *Texture { | |
| 77 | + | var cls *Texture | |
| 78 | + | ||
| 79 | + | cret := xMemoryTextureBuilderBuild(x.GoPointer()) | |
| 80 | + | ||
| 81 | + | if cret == 0 { | |
| 82 | + | return nil | |
| 83 | + | } | |
| 84 | + | cls = &Texture{} | |
| 85 | + | cls.Ptr = cret | |
| 86 | + | return cls | |
| 87 | + | } | |
| 88 | + | ||
| 89 | + | var xMemoryTextureBuilderGetBytes func(uintptr) *glib.Bytes | |
| 90 | + | ||
| 91 | + | // Gets the bytes previously set via gdk_memory_texture_builder_set_bytes() | |
| 92 | + | // or %NULL if none was set. | |
| 93 | + | func (x *MemoryTextureBuilder) GetBytes() *glib.Bytes { | |
| 94 | + | ||
| 95 | + | cret := xMemoryTextureBuilderGetBytes(x.GoPointer()) | |
| 96 | + | return cret | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | var xMemoryTextureBuilderGetColorState func(uintptr) *ColorState | |
| 100 | + | ||
| 101 | + | // Gets the colorstate previously set via gdk_memory_texture_builder_set_color_state(). | |
| 102 | + | func (x *MemoryTextureBuilder) GetColorState() *ColorState { | |
| 103 | + | ||
| 104 | + | cret := xMemoryTextureBuilderGetColorState(x.GoPointer()) | |
| 105 | + | return cret | |
| 106 | + | } | |
| 107 | + | ||
| 108 | + | var xMemoryTextureBuilderGetFormat func(uintptr) MemoryFormat | |
| 109 | + | ||
| 110 | + | // Gets the format previously set via gdk_memory_texture_builder_set_format(). | |
| 111 | + | func (x *MemoryTextureBuilder) GetFormat() MemoryFormat { | |
| 112 | + | ||
| 113 | + | cret := xMemoryTextureBuilderGetFormat(x.GoPointer()) | |
| 114 | + | return cret | |
| 115 | + | } | |
| 116 | + | ||
| 117 | + | var xMemoryTextureBuilderGetHeight func(uintptr) int | |
| 118 | + | ||
| 119 | + | // Gets the height previously set via gdk_memory_texture_builder_set_height() | |
| 120 | + | // or 0 if the height wasn't set. | |
| 121 | + | func (x *MemoryTextureBuilder) GetHeight() int { | |
| 122 | + | ||
| 123 | + | cret := xMemoryTextureBuilderGetHeight(x.GoPointer()) | |
| 124 | + | return cret | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | var xMemoryTextureBuilderGetStride func(uintptr) uint | |
| 128 | + | ||
| 129 | + | // Gets the stride previously set via gdk_memory_texture_builder_set_stride(). | |
| 130 | + | func (x *MemoryTextureBuilder) GetStride() uint { | |
| 131 | + | ||
| 132 | + | cret := xMemoryTextureBuilderGetStride(x.GoPointer()) | |
| 133 | + | return cret | |
| 134 | + | } | |
| 135 | + | ||
| 136 | + | var xMemoryTextureBuilderGetUpdateRegion func(uintptr) *cairo.Region | |
| 137 | + | ||
| 138 | + | // Gets the region previously set via gdk_memory_texture_builder_set_update_region() | |
| 139 | + | // or %NULL if none was set. | |
| 140 | + | func (x *MemoryTextureBuilder) GetUpdateRegion() *cairo.Region { | |
| 141 | + | ||
| 142 | + | cret := xMemoryTextureBuilderGetUpdateRegion(x.GoPointer()) | |
| 143 | + | return cret | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | var xMemoryTextureBuilderGetUpdateTexture func(uintptr) uintptr | |
| 147 | + | ||
| 148 | + | // Gets the texture previously set via gdk_memory_texture_builder_set_update_texture() | |
| 149 | + | // or %NULL if none was set. | |
| 150 | + | func (x *MemoryTextureBuilder) GetUpdateTexture() *Texture { | |
| 151 | + | var cls *Texture | |
| 152 | + | ||
| 153 | + | cret := xMemoryTextureBuilderGetUpdateTexture(x.GoPointer()) | |
| 154 | + | ||
| 155 | + | if cret == 0 { | |
| 156 | + | return nil | |
| 157 | + | } | |
| 158 | + | gobject.IncreaseRef(cret) | |
| 159 | + | cls = &Texture{} | |
| 160 | + | cls.Ptr = cret | |
| 161 | + | return cls | |
| 162 | + | } | |
| 163 | + | ||
| 164 | + | var xMemoryTextureBuilderGetWidth func(uintptr) int | |
| 165 | + | ||
| 166 | + | // Gets the width previously set via gdk_memory_texture_builder_set_width() | |
| 167 | + | // or 0 if the width wasn't set. | |
| 168 | + | func (x *MemoryTextureBuilder) GetWidth() int { | |
| 169 | + | ||
| 170 | + | cret := xMemoryTextureBuilderGetWidth(x.GoPointer()) | |
| 171 | + | return cret | |
| 172 | + | } | |
| 173 | + | ||
| 174 | + | var xMemoryTextureBuilderSetBytes func(uintptr, *glib.Bytes) | |
| 175 | + | ||
| 176 | + | // Sets the data to be shown but the texture. | |
| 177 | + | // | |
| 178 | + | // The bytes must be set before calling [method@Gdk.MemoryTextureBuilder.build]. | |
| 179 | + | func (x *MemoryTextureBuilder) SetBytes(BytesVar *glib.Bytes) { | |
| 180 | + | ||
| 181 | + | xMemoryTextureBuilderSetBytes(x.GoPointer(), BytesVar) | |
| 182 | + | ||
| 183 | + | } | |
| 184 | + | ||
| 185 | + | var xMemoryTextureBuilderSetColorState func(uintptr, *ColorState) | |
| 186 | + | ||
| 187 | + | // Sets the colorstate describing the data. | |
| 188 | + | // | |
| 189 | + | // By default, the sRGB colorstate is used. If you don't know | |
| 190 | + | // what colorstates are, this is probably the right thing. | |
| 191 | + | func (x *MemoryTextureBuilder) SetColorState(ColorStateVar *ColorState) { | |
| 192 | + | ||
| 193 | + | xMemoryTextureBuilderSetColorState(x.GoPointer(), ColorStateVar) | |
| 194 | + | ||
| 195 | + | } | |
| 196 | + | ||
| 197 | + | var xMemoryTextureBuilderSetFormat func(uintptr, MemoryFormat) | |
| 198 | + | ||
| 199 | + | // Sets the format of the bytes. | |
| 200 | + | // | |
| 201 | + | // The default is `GDK_MEMORY_R8G8B8A8_PREMULTIPLIED`. | |
| 202 | + | func (x *MemoryTextureBuilder) SetFormat(FormatVar MemoryFormat) { | |
| 203 | + | ||
| 204 | + | xMemoryTextureBuilderSetFormat(x.GoPointer(), FormatVar) | |
| 205 | + | ||
| 206 | + | } | |
| 207 | + | ||
| 208 | + | var xMemoryTextureBuilderSetHeight func(uintptr, int) | |
| 209 | + | ||
| 210 | + | // Sets the height of the texture. | |
| 211 | + | // | |
| 212 | + | // The height must be set before calling [method@Gdk.MemoryTextureBuilder.build]. | |
| 213 | + | func (x *MemoryTextureBuilder) SetHeight(HeightVar int) { | |
| 214 | + | ||
| 215 | + | xMemoryTextureBuilderSetHeight(x.GoPointer(), HeightVar) | |
| 216 | + | ||
| 217 | + | } | |
| 218 | + | ||
| 219 | + | var xMemoryTextureBuilderSetStride func(uintptr, uint) | |
| 220 | + | ||
| 221 | + | // Sets the rowstride of the bytes used. | |
| 222 | + | // | |
| 223 | + | // The rowstride must be set before calling [method@Gdk.MemoryTextureBuilder.build]. | |
| 224 | + | func (x *MemoryTextureBuilder) SetStride(StrideVar uint) { | |
| 225 | + | ||
| 226 | + | xMemoryTextureBuilderSetStride(x.GoPointer(), StrideVar) | |
| 227 | + | ||
| 228 | + | } | |
| 229 | + | ||
| 230 | + | var xMemoryTextureBuilderSetUpdateRegion func(uintptr, *cairo.Region) | |
| 231 | + | ||
| 232 | + | // Sets the region to be updated by this texture. | |
| 233 | + | // | |
| 234 | + | // Together with [property@Gdk.MemoryTextureBuilder:update-texture], | |
| 235 | + | // this describes an update of a previous texture. | |
| 236 | + | // | |
| 237 | + | // When rendering animations of large textures, it is possible that | |
| 238 | + | // consecutive textures are only updating contents in parts of the texture. | |
| 239 | + | // It is then possible to describe this update via these two properties, | |
| 240 | + | // so that GTK can avoid rerendering parts that did not change. | |
| 241 | + | // | |
| 242 | + | // An example would be a screen recording where only the mouse pointer moves. | |
| 243 | + | func (x *MemoryTextureBuilder) SetUpdateRegion(RegionVar *cairo.Region) { | |
| 244 | + | ||
| 245 | + | xMemoryTextureBuilderSetUpdateRegion(x.GoPointer(), RegionVar) | |
| 246 | + | ||
| 247 | + | } | |
| 248 | + | ||
| 249 | + | var xMemoryTextureBuilderSetUpdateTexture func(uintptr, uintptr) | |
| 250 | + | ||
| 251 | + | // Sets the texture to be updated by this texture. | |
| 252 | + | // | |
| 253 | + | // See [method@Gdk.MemoryTextureBuilder.set_update_region] for an explanation. | |
| 254 | + | func (x *MemoryTextureBuilder) SetUpdateTexture(TextureVar *Texture) { | |
| 255 | + | ||
| 256 | + | xMemoryTextureBuilderSetUpdateTexture(x.GoPointer(), TextureVar.GoPointer()) | |
| 257 | + | ||
| 258 | + | } | |
| 259 | + | ||
| 260 | + | var xMemoryTextureBuilderSetWidth func(uintptr, int) | |
| 261 | + | ||
| 262 | + | // Sets the width of the texture. | |
| 263 | + | // | |
| 264 | + | // The width must be set before calling [method@Gdk.MemoryTextureBuilder.build]. | |
| 265 | + | func (x *MemoryTextureBuilder) SetWidth(WidthVar int) { | |
| 266 | + | ||
| 267 | + | xMemoryTextureBuilderSetWidth(x.GoPointer(), WidthVar) | |
| 268 | + | ||
| 269 | + | } | |
| 270 | + | ||
| 271 | + | func (c *MemoryTextureBuilder) GoPointer() uintptr { | |
| 272 | + | if c == nil { | |
| 273 | + | return 0 | |
| 274 | + | } | |
| 275 | + | return c.Ptr | |
| 276 | + | } | |
| 277 | + | ||
| 278 | + | func (c *MemoryTextureBuilder) SetGoPointer(ptr uintptr) { | |
| 279 | + | c.Ptr = ptr | |
| 280 | + | } | |
| 281 | + | ||
| 282 | + | func init() { | |
| 283 | + | core.SetPackageName("GDK", "gtk4") | |
| 284 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 285 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 286 | + | if err != nil { | |
| 287 | + | panic(err) | |
| 288 | + | } | |
| 289 | + | ||
| 290 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGLibType, lib, "gdk_memory_texture_builder_get_type") | |
| 291 | + | ||
| 292 | + | core.PuregoSafeRegister(&xNewMemoryTextureBuilder, lib, "gdk_memory_texture_builder_new") | |
| 293 | + | ||
| 294 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderBuild, lib, "gdk_memory_texture_builder_build") | |
| 295 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetBytes, lib, "gdk_memory_texture_builder_get_bytes") | |
| 296 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetColorState, lib, "gdk_memory_texture_builder_get_color_state") | |
| 297 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetFormat, lib, "gdk_memory_texture_builder_get_format") | |
| 298 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetHeight, lib, "gdk_memory_texture_builder_get_height") | |
| 299 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetStride, lib, "gdk_memory_texture_builder_get_stride") | |
| 300 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetUpdateRegion, lib, "gdk_memory_texture_builder_get_update_region") | |
| 301 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetUpdateTexture, lib, "gdk_memory_texture_builder_get_update_texture") | |
| 302 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderGetWidth, lib, "gdk_memory_texture_builder_get_width") | |
| 303 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetBytes, lib, "gdk_memory_texture_builder_set_bytes") | |
| 304 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetColorState, lib, "gdk_memory_texture_builder_set_color_state") | |
| 305 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetFormat, lib, "gdk_memory_texture_builder_set_format") | |
| 306 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetHeight, lib, "gdk_memory_texture_builder_set_height") | |
| 307 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetStride, lib, "gdk_memory_texture_builder_set_stride") | |
| 308 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetUpdateRegion, lib, "gdk_memory_texture_builder_set_update_region") | |
| 309 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetUpdateTexture, lib, "gdk_memory_texture_builder_set_update_texture") | |
| 310 | + | core.PuregoSafeRegister(&xMemoryTextureBuilderSetWidth, lib, "gdk_memory_texture_builder_set_width") | |
| 311 | + | ||
| 312 | + | } | |
M v4/gdk/gdkmonitor.go +33 -3
| @@ -46,8 +46,7 @@ const ( | |||
| 46 | 46 | SubpixelLayoutVerticalBgrValue SubpixelLayout = 5 | |
| 47 | 47 | ) | |
| 48 | 48 | ||
| 49 | - | // `GdkMonitor` objects represent the individual outputs that are | |
| 50 | - | // associated with a `GdkDisplay`. | |
| 49 | + | // Represents the individual outputs that are associated with a `GdkDisplay`. | |
| 51 | 50 | // | |
| 52 | 51 | // `GdkDisplay` keeps a `GListModel` to enumerate and monitor | |
| 53 | 52 | // monitors with [method@Gdk.Display.get_monitors]. You can use | |
| @@ -72,12 +71,27 @@ func MonitorNewFromInternalPtr(ptr uintptr) *Monitor { | |||
| 72 | 71 | var xMonitorGetConnector func(uintptr) string | |
| 73 | 72 | ||
| 74 | 73 | // Gets the name of the monitor's connector, if available. | |
| 74 | + | // | |
| 75 | + | // These are strings such as "eDP-1", or "HDMI-2". They depend | |
| 76 | + | // on software and hardware configuration, and should not be | |
| 77 | + | // relied on as stable identifiers of a specific monitor. | |
| 75 | 78 | func (x *Monitor) GetConnector() string { | |
| 76 | 79 | ||
| 77 | 80 | cret := xMonitorGetConnector(x.GoPointer()) | |
| 78 | 81 | return cret | |
| 79 | 82 | } | |
| 80 | 83 | ||
| 84 | + | var xMonitorGetDescription func(uintptr) string | |
| 85 | + | ||
| 86 | + | // Gets a string describing the monitor, if available. | |
| 87 | + | // | |
| 88 | + | // This can be used to identify a monitor in the UI. | |
| 89 | + | func (x *Monitor) GetDescription() string { | |
| 90 | + | ||
| 91 | + | cret := xMonitorGetDescription(x.GoPointer()) | |
| 92 | + | return cret | |
| 93 | + | } | |
| 94 | + | ||
| 81 | 95 | var xMonitorGetDisplay func(uintptr) uintptr | |
| 82 | 96 | ||
| 83 | 97 | // Gets the display that this monitor belongs to. | |
| @@ -101,7 +115,7 @@ var xMonitorGetGeometry func(uintptr, *Rectangle) | |||
| 101 | 115 | // display coordinate space. | |
| 102 | 116 | // | |
| 103 | 117 | // The returned geometry is in ”application pixels”, not in | |
| 104 | - | // ”device pixels” (see [method@Gdk.Monitor.get_scale_factor]). | |
| 118 | + | // ”device pixels” (see [method@Gdk.Monitor.get_scale]). | |
| 105 | 119 | func (x *Monitor) GetGeometry(GeometryVar *Rectangle) { | |
| 106 | 120 | ||
| 107 | 121 | xMonitorGetGeometry(x.GoPointer(), GeometryVar) | |
| @@ -153,6 +167,20 @@ func (x *Monitor) GetRefreshRate() int { | |||
| 153 | 167 | return cret | |
| 154 | 168 | } | |
| 155 | 169 | ||
| 170 | + | var xMonitorGetScale func(uintptr) float64 | |
| 171 | + | ||
| 172 | + | // Gets the internal scale factor that maps from monitor coordinates | |
| 173 | + | // to device pixels. | |
| 174 | + | // | |
| 175 | + | // This can be used if you want to create pixel based data for a | |
| 176 | + | // particular monitor, but most of the time you’re drawing to a surface | |
| 177 | + | // where it is better to use [method@Gdk.Surface.get_scale] instead. | |
| 178 | + | func (x *Monitor) GetScale() float64 { | |
| 179 | + | ||
| 180 | + | cret := xMonitorGetScale(x.GoPointer()) | |
| 181 | + | return cret | |
| 182 | + | } | |
| 183 | + | ||
| 156 | 184 | var xMonitorGetScaleFactor func(uintptr) int | |
| 157 | 185 | ||
| 158 | 186 | // Gets the internal scale factor that maps from monitor coordinates | |
| @@ -246,12 +274,14 @@ func init() { | |||
| 246 | 274 | core.PuregoSafeRegister(&xMonitorGLibType, lib, "gdk_monitor_get_type") | |
| 247 | 275 | ||
| 248 | 276 | core.PuregoSafeRegister(&xMonitorGetConnector, lib, "gdk_monitor_get_connector") | |
| 277 | + | core.PuregoSafeRegister(&xMonitorGetDescription, lib, "gdk_monitor_get_description") | |
| 249 | 278 | core.PuregoSafeRegister(&xMonitorGetDisplay, lib, "gdk_monitor_get_display") | |
| 250 | 279 | core.PuregoSafeRegister(&xMonitorGetGeometry, lib, "gdk_monitor_get_geometry") | |
| 251 | 280 | core.PuregoSafeRegister(&xMonitorGetHeightMm, lib, "gdk_monitor_get_height_mm") | |
| 252 | 281 | core.PuregoSafeRegister(&xMonitorGetManufacturer, lib, "gdk_monitor_get_manufacturer") | |
| 253 | 282 | core.PuregoSafeRegister(&xMonitorGetModel, lib, "gdk_monitor_get_model") | |
| 254 | 283 | core.PuregoSafeRegister(&xMonitorGetRefreshRate, lib, "gdk_monitor_get_refresh_rate") | |
| 284 | + | core.PuregoSafeRegister(&xMonitorGetScale, lib, "gdk_monitor_get_scale") | |
| 255 | 285 | core.PuregoSafeRegister(&xMonitorGetScaleFactor, lib, "gdk_monitor_get_scale_factor") | |
| 256 | 286 | core.PuregoSafeRegister(&xMonitorGetSubpixelLayout, lib, "gdk_monitor_get_subpixel_layout") | |
| 257 | 287 | core.PuregoSafeRegister(&xMonitorGetWidthMm, lib, "gdk_monitor_get_width_mm") | |
M v4/gdk/gdkpaintable.go +58 -8
| @@ -42,6 +42,11 @@ func (x *PaintableInterface) GoPointer() uintptr { | |||
| 42 | 42 | } | |
| 43 | 43 | ||
| 44 | 44 | // OverrideSnapshot sets the callback function. | |
| 45 | + | // Snapshot the paintable. The given @width and @height are | |
| 46 | + | // | |
| 47 | + | // guaranteed to be larger than 0.0. The resulting snapshot must modify | |
| 48 | + | // only the area in the rectangle from (0,0) to (width, height). | |
| 49 | + | // This is the only function that must be implemented for this interface. | |
| 45 | 50 | func (x *PaintableInterface) OverrideSnapshot(cb func(Paintable, *Snapshot, float64, float64)) { | |
| 46 | 51 | if cb == nil { | |
| 47 | 52 | x.xSnapshot = 0 | |
| @@ -53,6 +58,11 @@ func (x *PaintableInterface) OverrideSnapshot(cb func(Paintable, *Snapshot, floa | |||
| 53 | 58 | } | |
| 54 | 59 | ||
| 55 | 60 | // GetSnapshot gets the callback function. | |
| 61 | + | // Snapshot the paintable. The given @width and @height are | |
| 62 | + | // | |
| 63 | + | // guaranteed to be larger than 0.0. The resulting snapshot must modify | |
| 64 | + | // only the area in the rectangle from (0,0) to (width, height). | |
| 65 | + | // This is the only function that must be implemented for this interface. | |
| 56 | 66 | func (x *PaintableInterface) GetSnapshot() func(Paintable, *Snapshot, float64, float64) { | |
| 57 | 67 | if x.xSnapshot == 0 { | |
| 58 | 68 | return nil | |
| @@ -65,6 +75,10 @@ func (x *PaintableInterface) GetSnapshot() func(Paintable, *Snapshot, float64, f | |||
| 65 | 75 | } | |
| 66 | 76 | ||
| 67 | 77 | // OverrideGetCurrentImage sets the callback function. | |
| 78 | + | // return a `GdkPaintable` that does not change over | |
| 79 | + | // | |
| 80 | + | // time. This means the `GDK_PAINTABLE_STATIC_SIZE` and | |
| 81 | + | // `GDK_PAINTABLE_STATIC_CONTENTS` flag are set. | |
| 68 | 82 | func (x *PaintableInterface) OverrideGetCurrentImage(cb func(Paintable) *PaintableBase) { | |
| 69 | 83 | if cb == nil { | |
| 70 | 84 | x.xGetCurrentImage = 0 | |
| @@ -80,6 +94,10 @@ func (x *PaintableInterface) OverrideGetCurrentImage(cb func(Paintable) *Paintab | |||
| 80 | 94 | } | |
| 81 | 95 | ||
| 82 | 96 | // GetGetCurrentImage gets the callback function. | |
| 97 | + | // return a `GdkPaintable` that does not change over | |
| 98 | + | // | |
| 99 | + | // time. This means the `GDK_PAINTABLE_STATIC_SIZE` and | |
| 100 | + | // `GDK_PAINTABLE_STATIC_CONTENTS` flag are set. | |
| 83 | 101 | func (x *PaintableInterface) GetGetCurrentImage() func(Paintable) *PaintableBase { | |
| 84 | 102 | if x.xGetCurrentImage == 0 { | |
| 85 | 103 | return nil | |
| @@ -98,6 +116,9 @@ func (x *PaintableInterface) GetGetCurrentImage() func(Paintable) *PaintableBase | |||
| 98 | 116 | } | |
| 99 | 117 | ||
| 100 | 118 | // OverrideGetFlags sets the callback function. | |
| 119 | + | // Get the flags for this instance. See [flags@Gdk.PaintableFlags] | |
| 120 | + | // | |
| 121 | + | // for details. | |
| 101 | 122 | func (x *PaintableInterface) OverrideGetFlags(cb func(Paintable) PaintableFlags) { | |
| 102 | 123 | if cb == nil { | |
| 103 | 124 | x.xGetFlags = 0 | |
| @@ -109,6 +130,9 @@ func (x *PaintableInterface) OverrideGetFlags(cb func(Paintable) PaintableFlags) | |||
| 109 | 130 | } | |
| 110 | 131 | ||
| 111 | 132 | // GetGetFlags gets the callback function. | |
| 133 | + | // Get the flags for this instance. See [flags@Gdk.PaintableFlags] | |
| 134 | + | // | |
| 135 | + | // for details. | |
| 112 | 136 | func (x *PaintableInterface) GetGetFlags() func(Paintable) PaintableFlags { | |
| 113 | 137 | if x.xGetFlags == 0 { | |
| 114 | 138 | return nil | |
| @@ -121,6 +145,10 @@ func (x *PaintableInterface) GetGetFlags() func(Paintable) PaintableFlags { | |||
| 121 | 145 | } | |
| 122 | 146 | ||
| 123 | 147 | // OverrideGetIntrinsicWidth sets the callback function. | |
| 148 | + | // The preferred width for this object to be | |
| 149 | + | // | |
| 150 | + | // snapshot at or 0 if none. This is purely a hint. The object must still | |
| 151 | + | // be able to render at any size. | |
| 124 | 152 | func (x *PaintableInterface) OverrideGetIntrinsicWidth(cb func(Paintable) int) { | |
| 125 | 153 | if cb == nil { | |
| 126 | 154 | x.xGetIntrinsicWidth = 0 | |
| @@ -132,6 +160,10 @@ func (x *PaintableInterface) OverrideGetIntrinsicWidth(cb func(Paintable) int) { | |||
| 132 | 160 | } | |
| 133 | 161 | ||
| 134 | 162 | // GetGetIntrinsicWidth gets the callback function. | |
| 163 | + | // The preferred width for this object to be | |
| 164 | + | // | |
| 165 | + | // snapshot at or 0 if none. This is purely a hint. The object must still | |
| 166 | + | // be able to render at any size. | |
| 135 | 167 | func (x *PaintableInterface) GetGetIntrinsicWidth() func(Paintable) int { | |
| 136 | 168 | if x.xGetIntrinsicWidth == 0 { | |
| 137 | 169 | return nil | |
| @@ -144,6 +176,10 @@ func (x *PaintableInterface) GetGetIntrinsicWidth() func(Paintable) int { | |||
| 144 | 176 | } | |
| 145 | 177 | ||
| 146 | 178 | // OverrideGetIntrinsicHeight sets the callback function. | |
| 179 | + | // The preferred height for this object to be | |
| 180 | + | // | |
| 181 | + | // snapshot at or 0 if none. This is purely a hint. The object must still | |
| 182 | + | // be able to render at any size. | |
| 147 | 183 | func (x *PaintableInterface) OverrideGetIntrinsicHeight(cb func(Paintable) int) { | |
| 148 | 184 | if cb == nil { | |
| 149 | 185 | x.xGetIntrinsicHeight = 0 | |
| @@ -155,6 +191,10 @@ func (x *PaintableInterface) OverrideGetIntrinsicHeight(cb func(Paintable) int) | |||
| 155 | 191 | } | |
| 156 | 192 | ||
| 157 | 193 | // GetGetIntrinsicHeight gets the callback function. | |
| 194 | + | // The preferred height for this object to be | |
| 195 | + | // | |
| 196 | + | // snapshot at or 0 if none. This is purely a hint. The object must still | |
| 197 | + | // be able to render at any size. | |
| 158 | 198 | func (x *PaintableInterface) GetGetIntrinsicHeight() func(Paintable) int { | |
| 159 | 199 | if x.xGetIntrinsicHeight == 0 { | |
| 160 | 200 | return nil | |
| @@ -167,6 +207,11 @@ func (x *PaintableInterface) GetGetIntrinsicHeight() func(Paintable) int { | |||
| 167 | 207 | } | |
| 168 | 208 | ||
| 169 | 209 | // OverrideGetIntrinsicAspectRatio sets the callback function. | |
| 210 | + | // The preferred aspect ratio for this object | |
| 211 | + | // | |
| 212 | + | // or 0 if none. If both [vfunc@Gdk.Paintable.get_intrinsic_width] | |
| 213 | + | // and [vfunc@Gdk.Paintable.get_intrinsic_height] return non-zero | |
| 214 | + | // values, this function should return the aspect ratio computed from those. | |
| 170 | 215 | func (x *PaintableInterface) OverrideGetIntrinsicAspectRatio(cb func(Paintable) float64) { | |
| 171 | 216 | if cb == nil { | |
| 172 | 217 | x.xGetIntrinsicAspectRatio = 0 | |
| @@ -178,6 +223,11 @@ func (x *PaintableInterface) OverrideGetIntrinsicAspectRatio(cb func(Paintable) | |||
| 178 | 223 | } | |
| 179 | 224 | ||
| 180 | 225 | // GetGetIntrinsicAspectRatio gets the callback function. | |
| 226 | + | // The preferred aspect ratio for this object | |
| 227 | + | // | |
| 228 | + | // or 0 if none. If both [vfunc@Gdk.Paintable.get_intrinsic_width] | |
| 229 | + | // and [vfunc@Gdk.Paintable.get_intrinsic_height] return non-zero | |
| 230 | + | // values, this function should return the aspect ratio computed from those. | |
| 181 | 231 | func (x *PaintableInterface) GetGetIntrinsicAspectRatio() func(Paintable) float64 { | |
| 182 | 232 | if x.xGetIntrinsicAspectRatio == 0 { | |
| 183 | 233 | return nil | |
| @@ -189,8 +239,7 @@ func (x *PaintableInterface) GetGetIntrinsicAspectRatio() func(Paintable) float6 | |||
| 189 | 239 | } | |
| 190 | 240 | } | |
| 191 | 241 | ||
| 192 | - | // `GdkPaintable` is a simple interface used by GTK to represent content that | |
| 193 | - | // can be painted. | |
| 242 | + | // An interface for content that can be painted. | |
| 194 | 243 | // | |
| 195 | 244 | // The content of a `GdkPaintable` can be painted anywhere at any size | |
| 196 | 245 | // without requiring any sort of layout. The interface is inspired by | |
| @@ -206,7 +255,7 @@ func (x *PaintableInterface) GetGetIntrinsicAspectRatio() func(Paintable) float6 | |||
| 206 | 255 | // to do, it is suggested that you scale your paintable ignoring any potential | |
| 207 | 256 | // aspect ratio. | |
| 208 | 257 | // | |
| 209 | - | // The contents that a `GdkPaintable` produces may depend on the [class@GdkSnapshot] | |
| 258 | + | // The contents that a `GdkPaintable` produces may depend on the [class@Gdk.Snapshot] | |
| 210 | 259 | // passed to it. For example, paintables may decide to use more detailed images | |
| 211 | 260 | // on higher resolution screens or when OpenGL is available. A `GdkPaintable` | |
| 212 | 261 | // will however always produce the same output for the same snapshot. | |
| @@ -214,7 +263,7 @@ func (x *PaintableInterface) GetGetIntrinsicAspectRatio() func(Paintable) float6 | |||
| 214 | 263 | // A `GdkPaintable` may change its contents, meaning that it will now produce | |
| 215 | 264 | // a different output with the same snapshot. Once that happens, it will call | |
| 216 | 265 | // [method@Gdk.Paintable.invalidate_contents] which will emit the | |
| 217 | - | // [signal@GdkPaintable::invalidate-contents] signal. If a paintable is known | |
| 266 | + | // [signal@Gdk.Paintable::invalidate-contents] signal. If a paintable is known | |
| 218 | 267 | // to never change its contents, it will set the %GDK_PAINTABLE_STATIC_CONTENTS | |
| 219 | 268 | // flag. If a consumer cannot deal with changing contents, it may call | |
| 220 | 269 | // [method@Gdk.Paintable.get_current_image] which will return a static | |
| @@ -225,7 +274,7 @@ func (x *PaintableInterface) GetGetIntrinsicAspectRatio() func(Paintable) float6 | |||
| 225 | 274 | // can use this information to layout thepaintable appropriately. Just like the | |
| 226 | 275 | // contents, the size of a paintable can change. A paintable will indicate this | |
| 227 | 276 | // by calling [method@Gdk.Paintable.invalidate_size] which will emit the | |
| 228 | - | // [signal@GdkPaintable::invalidate-size] signal. And just like for contents, | |
| 277 | + | // [signal@Gdk.Paintable::invalidate-size] signal. And just like for contents, | |
| 229 | 278 | // if a paintable is known to never change its size, it will set the | |
| 230 | 279 | // %GDK_PAINTABLE_STATIC_SIZE flag. | |
| 231 | 280 | // | |
| @@ -437,11 +486,11 @@ func PaintableFlagsGLibType() types.GType { | |||
| 437 | 486 | const ( | |
| 438 | 487 | ||
| 439 | 488 | // The size is immutable. | |
| 440 | - | // The [signal@GdkPaintable::invalidate-size] signal will never be | |
| 489 | + | // The [signal@Gdk.Paintable::invalidate-size] signal will never be | |
| 441 | 490 | // emitted. | |
| 442 | 491 | PaintableStaticSizeValue PaintableFlags = 1 | |
| 443 | 492 | // The content is immutable. | |
| 444 | - | // The [signal@GdkPaintable::invalidate-contents] signal will never be | |
| 493 | + | // The [signal@Gdk.Paintable::invalidate-contents] signal will never be | |
| 445 | 494 | // emitted. | |
| 446 | 495 | PaintableStaticContentsValue PaintableFlags = 2 | |
| 447 | 496 | ) | |
| @@ -453,7 +502,8 @@ var xPaintableNewEmpty func(int, int) uintptr | |||
| 453 | 502 | // This is often useful for implementing the | |
| 454 | 503 | // [vfunc@Gdk.Paintable.get_current_image] virtual function | |
| 455 | 504 | // when the paintable is in an incomplete state (like a | |
| 456 | - | // [class@Gtk.MediaStream] before receiving the first frame). | |
| 505 | + | // [GtkMediaStream](../gtk4/class.MediaStream.html) before receiving | |
| 506 | + | // the first frame). | |
| 457 | 507 | func PaintableNewEmpty(IntrinsicWidthVar int, IntrinsicHeightVar int) *PaintableBase { | |
| 458 | 508 | var cls *PaintableBase | |
| 459 | 509 | ||
M v4/gdk/gdkpopup.go +4 -4
| @@ -19,12 +19,12 @@ func (x *PopupInterface) GoPointer() uintptr { | |||
| 19 | 19 | return uintptr(unsafe.Pointer(x)) | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | - | // A `GdkPopup` is a surface that is attached to another surface. | |
| 22 | + | // A surface that is attached to another surface. | |
| 23 | 23 | // | |
| 24 | 24 | // The `GdkPopup` is positioned relative to its parent surface. | |
| 25 | 25 | // | |
| 26 | 26 | // `GdkPopup`s are typically used to implement menus and similar popups. | |
| 27 | - | // They can be modal, which is indicated by the [property@GdkPopup:autohide] | |
| 27 | + | // They can be modal, which is indicated by the [property@Gdk.Popup:autohide] | |
| 28 | 28 | // property. | |
| 29 | 29 | type Popup interface { | |
| 30 | 30 | GoPointer() uintptr | |
| @@ -117,11 +117,11 @@ func (x *PopupBase) GetSurfaceAnchor() Gravity { | |||
| 117 | 117 | ||
| 118 | 118 | // Present @popup after having processed the `GdkPopupLayout` rules. | |
| 119 | 119 | // | |
| 120 | - | // If the popup was previously now showing, it will be showed, | |
| 120 | + | // If the popup was previously not showing, it will be shown, | |
| 121 | 121 | // otherwise it will change position according to @layout. | |
| 122 | 122 | // | |
| 123 | 123 | // After calling this function, the result should be handled in response | |
| 124 | - | // to the [signal@GdkSurface::layout] signal being emitted. The resulting | |
| 124 | + | // to the [signal@Gdk.Surface::layout] signal being emitted. The resulting | |
| 125 | 125 | // popup position can be queried using [method@Gdk.Popup.get_position_x], | |
| 126 | 126 | // [method@Gdk.Popup.get_position_y], and the resulting size will be sent as | |
| 127 | 127 | // parameters in the layout signal. Use [method@Gdk.Popup.get_rect_anchor] | |
M v4/gdk/gdkpopuplayout.go +5 -5
| @@ -10,8 +10,8 @@ import ( | |||
| 10 | 10 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 11 | 11 | ) | |
| 12 | 12 | ||
| 13 | - | // The `GdkPopupLayout` struct contains information that is | |
| 14 | - | // necessary position a [iface@Gdk.Popup] relative to its parent. | |
| 13 | + | // Contains information that is necessary position a [iface@Gdk.Popup] | |
| 14 | + | // relative to its parent. | |
| 15 | 15 | // | |
| 16 | 16 | // The positioning requires a negotiation with the windowing system, | |
| 17 | 17 | // since it depends on external constraints, such as the position of | |
| @@ -40,9 +40,9 @@ import ( | |||
| 40 | 40 | // [method@Gdk.Popup.get_position_x], [method@Gdk.Popup.get_position_y], | |
| 41 | 41 | // [method@Gdk.Popup.get_rect_anchor] and [method@Gdk.Popup.get_surface_anchor] | |
| 42 | 42 | // after the popup has been presented. This can be used to adjust the rendering. | |
| 43 | - | // For example, [class@Gtk.Popover] changes its arrow position accordingly. | |
| 44 | - | // But you have to be careful avoid changing the size of the popover, or it | |
| 45 | - | // has to be presented again. | |
| 43 | + | // For example, [GtkPopover](../gtk4/class.Popover.html) changes its arrow position | |
| 44 | + | // accordingly. But you have to be careful avoid changing the size of the popover, | |
| 45 | + | // or it has to be presented again. | |
| 46 | 46 | type PopupLayout struct { | |
| 47 | 47 | _ structs.HostLayout | |
| 48 | 48 | } | |
M v4/gdk/gdkrgba.go +4 -3
| @@ -10,8 +10,7 @@ import ( | |||
| 10 | 10 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 11 | 11 | ) | |
| 12 | 12 | ||
| 13 | - | // A `GdkRGBA` is used to represent a color, in a way that is compatible | |
| 14 | - | // with cairo’s notion of color. | |
| 13 | + | // Represents a color, in a way that is compatible with cairo’s notion of color. | |
| 15 | 14 | // | |
| 16 | 15 | // `GdkRGBA` is a convenient way to pass colors around. It’s based on | |
| 17 | 16 | // cairo’s way to deal with colors and mirrors its behavior. All values | |
| @@ -109,7 +108,7 @@ var xRGBAParse func(uintptr, string) bool | |||
| 109 | 108 | // | |
| 110 | 109 | // The string can be either one of: | |
| 111 | 110 | // | |
| 112 | - | // - A standard name (Taken from the Css specification). | |
| 111 | + | // - A standard name (Taken from the CSS specification). | |
| 113 | 112 | // - A hexadecimal value in the form “\#rgb”, “\#rrggbb”, | |
| 114 | 113 | // “\#rrrgggbbb” or ”\#rrrrggggbbbb” | |
| 115 | 114 | // - A hexadecimal value in the form “\#rgba”, “\#rrggbbaa”, | |
| @@ -117,6 +116,8 @@ var xRGBAParse func(uintptr, string) bool | |||
| 117 | 116 | // - A RGB color in the form “rgb(r,g,b)” (In this case the color | |
| 118 | 117 | // will have full opacity) | |
| 119 | 118 | // - A RGBA color in the form “rgba(r,g,b,a)” | |
| 119 | + | // - A HSL color in the form "hsl(hue, saturation, lightness)" | |
| 120 | + | // - A HSLA color in the form "hsla(hue, saturation, lightness, alpha)" | |
| 120 | 121 | // | |
| 121 | 122 | // Where “r”, “g”, “b” and “a” are respectively the red, green, | |
| 122 | 123 | // blue and alpha color values. In the last two cases, “r”, “g”, | |
M v4/gdk/gdkseat.go +2 -3
| @@ -37,11 +37,10 @@ const ( | |||
| 37 | 37 | // The union of all pointing capabilities | |
| 38 | 38 | SeatCapabilityAllPointingValue SeatCapabilities = 7 | |
| 39 | 39 | // The union of all capabilities | |
| 40 | - | SeatCapabilityAllValue SeatCapabilities = 15 | |
| 40 | + | SeatCapabilityAllValue SeatCapabilities = 31 | |
| 41 | 41 | ) | |
| 42 | 42 | ||
| 43 | - | // The `GdkSeat` object represents a collection of input devices | |
| 44 | - | // that belong to a user. | |
| 43 | + | // Represents a collection of input devices that belong to a user. | |
| 45 | 44 | type Seat struct { | |
| 46 | 45 | gobject.Object | |
| 47 | 46 | } | |
M v4/gdk/gdksnapshot.go +1 -1
| @@ -19,7 +19,7 @@ func (x *SnapshotClass) GoPointer() uintptr { | |||
| 19 | 19 | ||
| 20 | 20 | // Base type for snapshot operations. | |
| 21 | 21 | // | |
| 22 | - | // The subclass of `GdkSnapshot` used by GTK is [class@Gtk.Snapshot]. | |
| 22 | + | // The subclass of `GdkSnapshot` used by GTK is [GtkSnapshot](../gtk4/class.Snapshot.html). | |
| 23 | 23 | type Snapshot struct { | |
| 24 | 24 | gobject.Object | |
| 25 | 25 | } | |
M v4/gdk/gdksurface.go +26 -8
| @@ -21,10 +21,10 @@ func (x *SurfaceClass) GoPointer() uintptr { | |||
| 21 | 21 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | - | // A `GdkSurface` is a rectangular region on the screen. | |
| 24 | + | // Represents a rectangular region on the screen. | |
| 25 | 25 | // | |
| 26 | 26 | // It’s a low-level object, used to implement high-level objects | |
| 27 | - | // such as [class@Gtk.Window] or [class@Gtk.Dialog] in GTK. | |
| 27 | + | // such as [GtkWindow](../gtk4/class.Window.html). | |
| 28 | 28 | // | |
| 29 | 29 | // The surfaces you see in practice are either [iface@Gdk.Toplevel] or | |
| 30 | 30 | // [iface@Gdk.Popup], and those interfaces provide much of the required | |
| @@ -160,9 +160,7 @@ func (x *Surface) CreateSimilarSurface(ContentVar cairo.Content, WidthVar int, H | |||
| 160 | 160 | ||
| 161 | 161 | var xSurfaceCreateVulkanContext func(uintptr) uintptr | |
| 162 | 162 | ||
| 163 | - | // Creates a new `GdkVulkanContext` for rendering on @surface. | |
| 164 | - | // | |
| 165 | - | // If the creation of the `GdkVulkanContext` failed, @error will be set. | |
| 163 | + | // Sets an error and returns %NULL. | |
| 166 | 164 | func (x *Surface) CreateVulkanContext() (*VulkanContext, error) { | |
| 167 | 165 | var cls *VulkanContext | |
| 168 | 166 | var cerr *glib.Error | |
| @@ -317,6 +315,25 @@ func (x *Surface) GetMapped() bool { | |||
| 317 | 315 | return cret | |
| 318 | 316 | } | |
| 319 | 317 | ||
| 318 | + | var xSurfaceGetScale func(uintptr) float64 | |
| 319 | + | ||
| 320 | + | // Returns the internal scale that maps from surface coordinates | |
| 321 | + | // to the actual device pixels. | |
| 322 | + | // | |
| 323 | + | // When the scale is bigger than 1, the windowing system prefers to get | |
| 324 | + | // buffers with a resolution that is bigger than the surface size (e.g. | |
| 325 | + | // to show the surface on a high-resolution display, or in a magnifier). | |
| 326 | + | // | |
| 327 | + | // Compare with [method@Gdk.Surface.get_scale_factor], which returns the | |
| 328 | + | // next larger integer. | |
| 329 | + | // | |
| 330 | + | // The scale may change during the lifetime of the surface. | |
| 331 | + | func (x *Surface) GetScale() float64 { | |
| 332 | + | ||
| 333 | + | cret := xSurfaceGetScale(x.GoPointer()) | |
| 334 | + | return cret | |
| 335 | + | } | |
| 336 | + | ||
| 320 | 337 | var xSurfaceGetScaleFactor func(uintptr) int | |
| 321 | 338 | ||
| 322 | 339 | // Returns the internal scale factor that maps from surface coordinates | |
| @@ -329,7 +346,7 @@ var xSurfaceGetScaleFactor func(uintptr) int | |||
| 329 | 346 | // pixel-based data the scale value can be used to determine whether to | |
| 330 | 347 | // use a pixel resource with higher resolution data. | |
| 331 | 348 | // | |
| 332 | - | // The scale of a surface may change during runtime. | |
| 349 | + | // The scale factor may change during the lifetime of the surface. | |
| 333 | 350 | func (x *Surface) GetScaleFactor() int { | |
| 334 | 351 | ||
| 335 | 352 | cret := xSurfaceGetScaleFactor(x.GoPointer()) | |
| @@ -355,7 +372,7 @@ var xSurfaceHide func(uintptr) | |||
| 355 | 372 | // For toplevel surfaces, withdraws them, so they will no longer be | |
| 356 | 373 | // known to the window manager; for all surfaces, unmaps them, so | |
| 357 | 374 | // they won’t be displayed. Normally done automatically as | |
| 358 | - | // part of [method@Gtk.Widget.hide]. | |
| 375 | + | // part of [gtk_widget_hide()](../gtk4/method.Widget.hide.html). | |
| 359 | 376 | func (x *Surface) Hide() { | |
| 360 | 377 | ||
| 361 | 378 | xSurfaceHide(x.GoPointer()) | |
| @@ -464,7 +481,7 @@ var xSurfaceSetOpaqueRegion func(uintptr, *cairo.Region) | |||
| 464 | 481 | // GTK will update this property automatically if the @surface background | |
| 465 | 482 | // is opaque, as we know where the opaque regions are. If your surface | |
| 466 | 483 | // background is not opaque, please update this property in your | |
| 467 | - | // [vfunc@Gtk.Widget.css_changed] handler. | |
| 484 | + | // [GtkWidgetClass.css_changed](../gtk4/vfunc.Widget.css_changed.html) handler. | |
| 468 | 485 | func (x *Surface) SetOpaqueRegion(RegionVar *cairo.Region) { | |
| 469 | 486 | ||
| 470 | 487 | xSurfaceSetOpaqueRegion(x.GoPointer(), RegionVar) | |
| @@ -624,6 +641,7 @@ func init() { | |||
| 624 | 641 | core.PuregoSafeRegister(&xSurfaceGetFrameClock, lib, "gdk_surface_get_frame_clock") | |
| 625 | 642 | core.PuregoSafeRegister(&xSurfaceGetHeight, lib, "gdk_surface_get_height") | |
| 626 | 643 | core.PuregoSafeRegister(&xSurfaceGetMapped, lib, "gdk_surface_get_mapped") | |
| 644 | + | core.PuregoSafeRegister(&xSurfaceGetScale, lib, "gdk_surface_get_scale") | |
| 627 | 645 | core.PuregoSafeRegister(&xSurfaceGetScaleFactor, lib, "gdk_surface_get_scale_factor") | |
| 628 | 646 | core.PuregoSafeRegister(&xSurfaceGetWidth, lib, "gdk_surface_get_width") | |
| 629 | 647 | core.PuregoSafeRegister(&xSurfaceHide, lib, "gdk_surface_hide") | |
M v4/gdk/gdktexture.go +67 -6
| @@ -44,20 +44,41 @@ const ( | |||
| 44 | 44 | TextureErrorUnsupportedFormatValue TextureError = 3 | |
| 45 | 45 | ) | |
| 46 | 46 | ||
| 47 | - | // `GdkTexture` is the basic element used to refer to pixel data. | |
| 47 | + | var xTextureErrorQuark func() glib.Quark | |
| 48 | + | ||
| 49 | + | // Registers an error quark for [class@Gdk.Texture] errors. | |
| 50 | + | func TextureErrorQuark() glib.Quark { | |
| 51 | + | ||
| 52 | + | cret := xTextureErrorQuark() | |
| 53 | + | return cret | |
| 54 | + | } | |
| 55 | + | ||
| 56 | + | // Refers to pixel data in various forms. | |
| 48 | 57 | // | |
| 49 | 58 | // It is primarily meant for pixel data that will not change over | |
| 50 | 59 | // multiple frames, and will be used for a long time. | |
| 51 | 60 | // | |
| 52 | 61 | // There are various ways to create `GdkTexture` objects from a | |
| 53 | - | // [class@GdkPixbuf.Pixbuf], or a Cairo surface, or other pixel data. | |
| 62 | + | // [class@GdkPixbuf.Pixbuf], or from bytes stored in memory, a file, or a | |
| 63 | + | // [struct@Gio.Resource]. | |
| 54 | 64 | // | |
| 55 | 65 | // The ownership of the pixel data is transferred to the `GdkTexture` | |
| 56 | 66 | // instance; you can only make a copy of it, via [method@Gdk.Texture.download]. | |
| 57 | 67 | // | |
| 58 | 68 | // `GdkTexture` is an immutable object: That means you cannot change | |
| 59 | 69 | // anything about it other than increasing the reference count via | |
| 60 | - | // [method@GObject.Object.ref], and consequently, it is a thread-safe object. | |
| 70 | + | // [method@GObject.Object.ref], and consequently, it is a threadsafe object. | |
| 71 | + | // | |
| 72 | + | // GDK provides a number of threadsafe texture loading functions: | |
| 73 | + | // [ctor@Gdk.Texture.new_from_resource], | |
| 74 | + | // [ctor@Gdk.Texture.new_from_bytes], | |
| 75 | + | // [ctor@Gdk.Texture.new_from_file], | |
| 76 | + | // [ctor@Gdk.Texture.new_from_filename], | |
| 77 | + | // [ctor@Gdk.Texture.new_for_pixbuf]. Note that these are meant for loading | |
| 78 | + | // icons and resources that are shipped with the toolkit or application. It | |
| 79 | + | // is recommended that you use a dedicated image loading framework such as | |
| 80 | + | // [glycin](https://lib.rs/crates/glycin), if you need to load untrusted image | |
| 81 | + | // data. | |
| 61 | 82 | type Texture struct { | |
| 62 | 83 | gobject.Object | |
| 63 | 84 | } | |
| @@ -99,7 +120,7 @@ var xNewTextureFromBytes func(*glib.Bytes, **glib.Error) uintptr | |||
| 99 | 120 | // Creates a new texture by loading an image from memory, | |
| 100 | 121 | // | |
| 101 | 122 | // The file format is detected automatically. The supported formats | |
| 102 | - | // are PNG and JPEG, though more formats might be available. | |
| 123 | + | // are PNG, JPEG and TIFF, though more formats might be available. | |
| 103 | 124 | // | |
| 104 | 125 | // If %NULL is returned, then @error will be set. | |
| 105 | 126 | // | |
| @@ -129,7 +150,7 @@ var xNewTextureFromFile func(uintptr, **glib.Error) uintptr | |||
| 129 | 150 | // Creates a new texture by loading an image from a file. | |
| 130 | 151 | // | |
| 131 | 152 | // The file format is detected automatically. The supported formats | |
| 132 | - | // are PNG and JPEG, though more formats might be available. | |
| 153 | + | // are PNG, JPEG and TIFF, though more formats might be available. | |
| 133 | 154 | // | |
| 134 | 155 | // If %NULL is returned, then @error will be set. | |
| 135 | 156 | // | |
| @@ -159,7 +180,7 @@ var xNewTextureFromFilename func(string, **glib.Error) uintptr | |||
| 159 | 180 | // Creates a new texture by loading an image from a file. | |
| 160 | 181 | // | |
| 161 | 182 | // The file format is detected automatically. The supported formats | |
| 162 | - | // are PNG and JPEG, though more formats might be available. | |
| 183 | + | // are PNG, JPEG and TIFF, though more formats might be available. | |
| 163 | 184 | // | |
| 164 | 185 | // If %NULL is returned, then @error will be set. | |
| 165 | 186 | // | |
| @@ -237,12 +258,41 @@ var xTextureDownload func(uintptr, []byte, uint) | |||
| 237 | 258 | // | |
| 238 | 259 | // cairo_surface_mark_dirty (surface); | |
| 239 | 260 | // ``` | |
| 261 | + | // | |
| 262 | + | // For more flexible download capabilities, see | |
| 263 | + | // [struct@Gdk.TextureDownloader]. | |
| 240 | 264 | func (x *Texture) Download(DataVar []byte, StrideVar uint) { | |
| 241 | 265 | ||
| 242 | 266 | xTextureDownload(x.GoPointer(), DataVar, StrideVar) | |
| 243 | 267 | ||
| 244 | 268 | } | |
| 245 | 269 | ||
| 270 | + | var xTextureGetColorState func(uintptr) *ColorState | |
| 271 | + | ||
| 272 | + | // Returns the color state associated with the texture. | |
| 273 | + | func (x *Texture) GetColorState() *ColorState { | |
| 274 | + | ||
| 275 | + | cret := xTextureGetColorState(x.GoPointer()) | |
| 276 | + | return cret | |
| 277 | + | } | |
| 278 | + | ||
| 279 | + | var xTextureGetFormat func(uintptr) MemoryFormat | |
| 280 | + | ||
| 281 | + | // Gets the memory format most closely associated with the data of | |
| 282 | + | // the texture. | |
| 283 | + | // | |
| 284 | + | // Note that it may not be an exact match for texture data | |
| 285 | + | // stored on the GPU or with compression. | |
| 286 | + | // | |
| 287 | + | // The format can give an indication about the bit depth and opacity | |
| 288 | + | // of the texture and is useful to determine the best format for | |
| 289 | + | // downloading the texture. | |
| 290 | + | func (x *Texture) GetFormat() MemoryFormat { | |
| 291 | + | ||
| 292 | + | cret := xTextureGetFormat(x.GoPointer()) | |
| 293 | + | return cret | |
| 294 | + | } | |
| 295 | + | ||
| 246 | 296 | var xTextureGetHeight func(uintptr) int | |
| 247 | 297 | ||
| 248 | 298 | // Returns the height of the @texture, in pixels. | |
| @@ -491,6 +541,13 @@ func (x *Texture) Equal(Icon2Var gio.Icon) bool { | |||
| 491 | 541 | return cret | |
| 492 | 542 | } | |
| 493 | 543 | ||
| 544 | + | // Gets a hash for an icon. | |
| 545 | + | func (x *Texture) Hash() uint { | |
| 546 | + | ||
| 547 | + | cret := gio.XGIconHash(x.GoPointer()) | |
| 548 | + | return cret | |
| 549 | + | } | |
| 550 | + | ||
| 494 | 551 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| 495 | 552 | // back by calling g_icon_deserialize() on the returned value. | |
| 496 | 553 | // As serialization will avoid using raw icon data when possible, it only | |
| @@ -582,6 +639,8 @@ func init() { | |||
| 582 | 639 | ||
| 583 | 640 | core.PuregoSafeRegister(&xTextureErrorGLibType, lib, "gdk_texture_error_get_type") | |
| 584 | 641 | ||
| 642 | + | core.PuregoSafeRegister(&xTextureErrorQuark, lib, "gdk_texture_error_quark") | |
| 643 | + | ||
| 585 | 644 | core.PuregoSafeRegister(&xTextureGLibType, lib, "gdk_texture_get_type") | |
| 586 | 645 | ||
| 587 | 646 | core.PuregoSafeRegister(&xNewTextureForPixbuf, lib, "gdk_texture_new_for_pixbuf") | |
| @@ -591,6 +650,8 @@ func init() { | |||
| 591 | 650 | core.PuregoSafeRegister(&xNewTextureFromResource, lib, "gdk_texture_new_from_resource") | |
| 592 | 651 | ||
| 593 | 652 | core.PuregoSafeRegister(&xTextureDownload, lib, "gdk_texture_download") | |
| 653 | + | core.PuregoSafeRegister(&xTextureGetColorState, lib, "gdk_texture_get_color_state") | |
| 654 | + | core.PuregoSafeRegister(&xTextureGetFormat, lib, "gdk_texture_get_format") | |
| 594 | 655 | core.PuregoSafeRegister(&xTextureGetHeight, lib, "gdk_texture_get_height") | |
| 595 | 656 | core.PuregoSafeRegister(&xTextureGetWidth, lib, "gdk_texture_get_width") | |
| 596 | 657 | core.PuregoSafeRegister(&xTextureSaveToPng, lib, "gdk_texture_save_to_png") | |
M v4/gdk/gdktoplevel.go +33 -7
| @@ -19,7 +19,7 @@ func (x *ToplevelInterface) GoPointer() uintptr { | |||
| 19 | 19 | return uintptr(unsafe.Pointer(x)) | |
| 20 | 20 | } | |
| 21 | 21 | ||
| 22 | - | // A `GdkToplevel` is a freestanding toplevel surface. | |
| 22 | + | // A freestanding toplevel surface. | |
| 23 | 23 | // | |
| 24 | 24 | // The `GdkToplevel` interface provides useful APIs for interacting with | |
| 25 | 25 | // the windowing system, such as controlling maximization and size of the | |
| @@ -89,8 +89,9 @@ func (x *ToplevelBase) BeginResize(EdgeVar SurfaceEdge, DeviceVar *Device, Butto | |||
| 89 | 89 | ||
| 90 | 90 | // Sets keyboard focus to @surface. | |
| 91 | 91 | // | |
| 92 | - | // In most cases, [method@Gtk.Window.present_with_time] should be | |
| 93 | - | // used on a [class@Gtk.Window], rather than calling this function. | |
| 92 | + | // In most cases, [gtk_window_present_with_time()](../gtk4/method.Window.present_with_time.html) | |
| 93 | + | // should be used on a [GtkWindow](../gtk4/class.Window.html), rather than | |
| 94 | + | // calling this function. | |
| 94 | 95 | func (x *ToplevelBase) Focus(TimestampVar uint32) { | |
| 95 | 96 | ||
| 96 | 97 | XGdkToplevelFocus(x.GoPointer(), TimestampVar) | |
| @@ -231,8 +232,8 @@ func (x *ToplevelBase) SetModal(ModalVar bool) { | |||
| 231 | 232 | // Sets the startup notification ID. | |
| 232 | 233 | // | |
| 233 | 234 | // When using GTK, typically you should use | |
| 234 | - | // [method@Gtk.Window.set_startup_id] instead of this | |
| 235 | - | // low-level function. | |
| 235 | + | // [gtk_window_set_startup_id()](../gtk4/method.Window.set_startup_id.html) | |
| 236 | + | // instead of this low-level function. | |
| 236 | 237 | func (x *ToplevelBase) SetStartupId(StartupIdVar string) { | |
| 237 | 238 | ||
| 238 | 239 | XGdkToplevelSetStartupId(x.GoPointer(), StartupIdVar) | |
| @@ -256,8 +257,8 @@ func (x *ToplevelBase) SetTitle(TitleVar string) { | |||
| 256 | 257 | // allows the window manager to do things like center @surface | |
| 257 | 258 | // on @parent and keep @surface above @parent. | |
| 258 | 259 | // | |
| 259 | - | // See [method@Gtk.Window.set_transient_for] if you’re using | |
| 260 | - | // [class@Gtk.Window] or [class@Gtk.Dialog]. | |
| 260 | + | // See [gtk_window_set_transient_for()](../gtk4/method.Window.set_transient_for.html) | |
| 261 | + | // if you’re using [GtkWindow](../gtk4/class.Window.html). | |
| 261 | 262 | func (x *ToplevelBase) SetTransientFor(ParentVar *Surface) { | |
| 262 | 263 | ||
| 263 | 264 | XGdkToplevelSetTransientFor(x.GoPointer(), ParentVar.GoPointer()) | |
| @@ -284,6 +285,7 @@ func (x *ToplevelBase) SupportsEdgeConstraints() bool { | |||
| 284 | 285 | return cret | |
| 285 | 286 | } | |
| 286 | 287 | ||
| 288 | + | // Performs a title bar gesture. | |
| 287 | 289 | func (x *ToplevelBase) TitlebarGesture(GestureVar TitlebarGesture) bool { | |
| 288 | 290 | ||
| 289 | 291 | cret := XGdkToplevelTitlebarGesture(x.GoPointer(), GestureVar) | |
| @@ -359,6 +361,8 @@ const ( | |||
| 359 | 361 | ToplevelStateLeftTiledValue ToplevelState = 16384 | |
| 360 | 362 | // whether the left edge is resizable | |
| 361 | 363 | ToplevelStateLeftResizableValue ToplevelState = 32768 | |
| 364 | + | // The surface is not visible to the user. | |
| 365 | + | ToplevelStateSuspendedValue ToplevelState = 65536 | |
| 362 | 366 | ) | |
| 363 | 367 | ||
| 364 | 368 | // Indicates which monitor a surface should span over when in fullscreen mode. | |
| @@ -407,6 +411,26 @@ const ( | |||
| 407 | 411 | SurfaceEdgeSouthEastValue SurfaceEdge = 7 | |
| 408 | 412 | ) | |
| 409 | 413 | ||
| 414 | + | // The kind of title bar gesture to emit with | |
| 415 | + | // [method@Gdk.Toplevel.titlebar_gesture]. | |
| 416 | + | type TitlebarGesture int | |
| 417 | + | ||
| 418 | + | var xTitlebarGestureGLibType func() types.GType | |
| 419 | + | ||
| 420 | + | func TitlebarGestureGLibType() types.GType { | |
| 421 | + | return xTitlebarGestureGLibType() | |
| 422 | + | } | |
| 423 | + | ||
| 424 | + | const ( | |
| 425 | + | ||
| 426 | + | // double click gesture | |
| 427 | + | TitlebarGestureDoubleClickValue TitlebarGesture = 1 | |
| 428 | + | // right click gesture | |
| 429 | + | TitlebarGestureRightClickValue TitlebarGesture = 2 | |
| 430 | + | // middle click gesture | |
| 431 | + | TitlebarGestureMiddleClickValue TitlebarGesture = 3 | |
| 432 | + | ) | |
| 433 | + | ||
| 410 | 434 | func init() { | |
| 411 | 435 | core.SetPackageName("GDK", "gtk4") | |
| 412 | 436 | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| @@ -421,6 +445,8 @@ func init() { | |||
| 421 | 445 | ||
| 422 | 446 | core.PuregoSafeRegister(&xSurfaceEdgeGLibType, lib, "gdk_surface_edge_get_type") | |
| 423 | 447 | ||
| 448 | + | core.PuregoSafeRegister(&xTitlebarGestureGLibType, lib, "gdk_titlebar_gesture_get_type") | |
| 449 | + | ||
| 424 | 450 | core.PuregoSafeRegister(&xToplevelGLibType, lib, "gdk_toplevel_get_type") | |
| 425 | 451 | ||
| 426 | 452 | core.PuregoSafeRegister(&XGdkToplevelBeginMove, lib, "gdk_toplevel_begin_move") | |
M v4/gdk/gdktoplevellayout.go +2 -2
| @@ -11,8 +11,8 @@ import ( | |||
| 11 | 11 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | - | // The `GdkToplevelLayout` struct contains information that | |
| 15 | - | // is necessary to present a sovereign window on screen. | |
| 14 | + | // Contains information that is necessary to present a sovereign | |
| 15 | + | // window on screen. | |
| 16 | 16 | // | |
| 17 | 17 | // The `GdkToplevelLayout` struct is necessary for using | |
| 18 | 18 | // [method@Gdk.Toplevel.present]. | |
M v4/gdk/gdktoplevelsize.go +11 -11
| @@ -10,12 +10,17 @@ import ( | |||
| 10 | 10 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 11 | 11 | ) | |
| 12 | 12 | ||
| 13 | - | // The `GdkToplevelSize` struct contains information that is useful | |
| 14 | - | // to compute the size of a toplevel. | |
| 13 | + | // Contains information that is useful to compute the size of a toplevel. | |
| 15 | 14 | type ToplevelSize struct { | |
| 16 | 15 | _ structs.HostLayout | |
| 17 | 16 | } | |
| 18 | 17 | ||
| 18 | + | var xToplevelSizeGLibType func() types.GType | |
| 19 | + | ||
| 20 | + | func ToplevelSizeGLibType() types.GType { | |
| 21 | + | return xToplevelSizeGLibType() | |
| 22 | + | } | |
| 23 | + | ||
| 19 | 24 | func (x *ToplevelSize) GoPointer() uintptr { | |
| 20 | 25 | return uintptr(unsafe.Pointer(x)) | |
| 21 | 26 | } | |
| @@ -59,6 +64,9 @@ var xToplevelSizeSetShadowWidth func(uintptr, int, int, int, int) | |||
| 59 | 64 | // The shadow width corresponds to the part of the computed surface size | |
| 60 | 65 | // that would consist of the shadow margin surrounding the window, would | |
| 61 | 66 | // there be any. | |
| 67 | + | // | |
| 68 | + | // Shadow width should only be set if | |
| 69 | + | // [method@Gtk.Display.supports_shadow_width] is %TRUE. | |
| 62 | 70 | func (x *ToplevelSize) SetShadowWidth(LeftVar int, RightVar int, TopVar int, BottomVar int) { | |
| 63 | 71 | ||
| 64 | 72 | xToplevelSizeSetShadowWidth(x.GoPointer(), LeftVar, RightVar, TopVar, BottomVar) | |
| @@ -79,14 +87,6 @@ func (x *ToplevelSize) SetSize(WidthVar int, HeightVar int) { | |||
| 79 | 87 | ||
| 80 | 88 | } | |
| 81 | 89 | ||
| 82 | - | var xToplevelSizeGetType func() types.GType | |
| 83 | - | ||
| 84 | - | func ToplevelSizeGetType() types.GType { | |
| 85 | - | ||
| 86 | - | cret := xToplevelSizeGetType() | |
| 87 | - | return cret | |
| 88 | - | } | |
| 89 | - | ||
| 90 | 90 | func init() { | |
| 91 | 91 | core.SetPackageName("GDK", "gtk4") | |
| 92 | 92 | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| @@ -95,7 +95,7 @@ func init() { | |||
| 95 | 95 | panic(err) | |
| 96 | 96 | } | |
| 97 | 97 | ||
| 98 | - | core.PuregoSafeRegister(&xToplevelSizeGetType, lib, "gdk_toplevel_size_get_type") | |
| 98 | + | core.PuregoSafeRegister(&xToplevelSizeGLibType, lib, "gdk_toplevel_size_get_type") | |
| 99 | 99 | ||
| 100 | 100 | core.PuregoSafeRegister(&xToplevelSizeGetBounds, lib, "gdk_toplevel_size_get_bounds") | |
| 101 | 101 | core.PuregoSafeRegister(&xToplevelSizeSetMinSize, lib, "gdk_toplevel_size_set_min_size") | |
M v4/gdk/gdktypes.go +365 -4
| @@ -8,11 +8,88 @@ import ( | |||
| 8 | 8 | "github.com/jwijenbergh/purego" | |
| 9 | 9 | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 10 | 10 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | 12 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 13 | ) | |
| 13 | 14 | ||
| 14 | - | // The `GdkContentFormats` structure is used to advertise and negotiate the | |
| 15 | - | // format of content. | |
| 15 | + | // Provides information to interpret colors and pixels in a variety of ways. | |
| 16 | + | // | |
| 17 | + | // They are also known as | |
| 18 | + | // [*color spaces*](https://en.wikipedia.org/wiki/Color_space). | |
| 19 | + | // | |
| 20 | + | // Crucially, GTK knows how to convert colors from one color | |
| 21 | + | // state to another. | |
| 22 | + | // | |
| 23 | + | // `GdkColorState` objects are immutable and therefore threadsafe. | |
| 24 | + | type ColorState struct { | |
| 25 | + | _ structs.HostLayout | |
| 26 | + | } | |
| 27 | + | ||
| 28 | + | var xColorStateGLibType func() types.GType | |
| 29 | + | ||
| 30 | + | func ColorStateGLibType() types.GType { | |
| 31 | + | return xColorStateGLibType() | |
| 32 | + | } | |
| 33 | + | ||
| 34 | + | func (x *ColorState) GoPointer() uintptr { | |
| 35 | + | return uintptr(unsafe.Pointer(x)) | |
| 36 | + | } | |
| 37 | + | ||
| 38 | + | var xColorStateCreateCicpParams func(uintptr) uintptr | |
| 39 | + | ||
| 40 | + | // Create a [class@Gdk.CicpParams] representing the colorstate. | |
| 41 | + | // | |
| 42 | + | // It is not guaranteed that every `GdkColorState` can be | |
| 43 | + | // represented with Cicp parameters. If that is the case, | |
| 44 | + | // this function returns `NULL`. | |
| 45 | + | func (x *ColorState) CreateCicpParams() *CicpParams { | |
| 46 | + | var cls *CicpParams | |
| 47 | + | ||
| 48 | + | cret := xColorStateCreateCicpParams(x.GoPointer()) | |
| 49 | + | ||
| 50 | + | if cret == 0 { | |
| 51 | + | return nil | |
| 52 | + | } | |
| 53 | + | cls = &CicpParams{} | |
| 54 | + | cls.Ptr = cret | |
| 55 | + | return cls | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | var xColorStateEqual func(uintptr, *ColorState) bool | |
| 59 | + | ||
| 60 | + | // Compares two `GdkColorStates` for equality. | |
| 61 | + | // | |
| 62 | + | // Note that this function is not guaranteed to be perfect and two objects | |
| 63 | + | // describing the same color state may compare not equal. However, different | |
| 64 | + | // color states will never compare equal. | |
| 65 | + | func (x *ColorState) Equal(OtherVar *ColorState) bool { | |
| 66 | + | ||
| 67 | + | cret := xColorStateEqual(x.GoPointer(), OtherVar) | |
| 68 | + | return cret | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | var xColorStateRef func(uintptr) *ColorState | |
| 72 | + | ||
| 73 | + | // Increase the reference count of @self. | |
| 74 | + | func (x *ColorState) Ref() *ColorState { | |
| 75 | + | ||
| 76 | + | cret := xColorStateRef(x.GoPointer()) | |
| 77 | + | return cret | |
| 78 | + | } | |
| 79 | + | ||
| 80 | + | var xColorStateUnref func(uintptr) | |
| 81 | + | ||
| 82 | + | // Decrease the reference count of @self. | |
| 83 | + | // | |
| 84 | + | // Unless @self is static, it will be freed | |
| 85 | + | // when the reference count reaches zero. | |
| 86 | + | func (x *ColorState) Unref() { | |
| 87 | + | ||
| 88 | + | xColorStateUnref(x.GoPointer()) | |
| 89 | + | ||
| 90 | + | } | |
| 91 | + | ||
| 92 | + | // Used to advertise and negotiate the format of content. | |
| 16 | 93 | // | |
| 17 | 94 | // You will encounter `GdkContentFormats` when interacting with objects | |
| 18 | 95 | // controlling operations that pass data between different widgets, window | |
| @@ -121,6 +198,15 @@ func (x *ContentFormats) GetMimeTypes(NMimeTypesVar uint) []string { | |||
| 121 | 198 | return cret | |
| 122 | 199 | } | |
| 123 | 200 | ||
| 201 | + | var xContentFormatsIsEmpty func(uintptr) bool | |
| 202 | + | ||
| 203 | + | // Returns whether the content formats contain any formats. | |
| 204 | + | func (x *ContentFormats) IsEmpty() bool { | |
| 205 | + | ||
| 206 | + | cret := xContentFormatsIsEmpty(x.GoPointer()) | |
| 207 | + | return cret | |
| 208 | + | } | |
| 209 | + | ||
| 124 | 210 | var xContentFormatsMatch func(uintptr, *ContentFormats) bool | |
| 125 | 211 | ||
| 126 | 212 | // Checks if @first and @second have any matching formats. | |
| @@ -250,7 +336,104 @@ func (x *ContentFormats) Unref() { | |||
| 250 | 336 | ||
| 251 | 337 | } | |
| 252 | 338 | ||
| 253 | - | // A `GdkKeymapKey` is a hardware key that can be mapped to a keyval. | |
| 339 | + | // Provides information about supported DMA buffer formats. | |
| 340 | + | // | |
| 341 | + | // You can query whether a given format is supported with | |
| 342 | + | // [method@Gdk.DmabufFormats.contains] and you can iterate | |
| 343 | + | // over the list of all supported formats with | |
| 344 | + | // [method@Gdk.DmabufFormats.get_n_formats] and | |
| 345 | + | // [method@Gdk.DmabufFormats.get_format]. | |
| 346 | + | // | |
| 347 | + | // The list of supported formats is sorted by preference, | |
| 348 | + | // with the best formats coming first. | |
| 349 | + | // | |
| 350 | + | // The list may contains (format, modifier) pairs where the modifier | |
| 351 | + | // is `DMA_FORMAT_MOD_INVALID`, indicating that **_implicit modifiers_** | |
| 352 | + | // may be used with this format. | |
| 353 | + | // | |
| 354 | + | // See [class@Gdk.DmabufTextureBuilder] for more information | |
| 355 | + | // about DMA buffers. | |
| 356 | + | // | |
| 357 | + | // Note that DMA buffers only exist on Linux. | |
| 358 | + | type DmabufFormats struct { | |
| 359 | + | _ structs.HostLayout | |
| 360 | + | } | |
| 361 | + | ||
| 362 | + | var xDmabufFormatsGLibType func() types.GType | |
| 363 | + | ||
| 364 | + | func DmabufFormatsGLibType() types.GType { | |
| 365 | + | return xDmabufFormatsGLibType() | |
| 366 | + | } | |
| 367 | + | ||
| 368 | + | func (x *DmabufFormats) GoPointer() uintptr { | |
| 369 | + | return uintptr(unsafe.Pointer(x)) | |
| 370 | + | } | |
| 371 | + | ||
| 372 | + | var xDmabufFormatsContains func(uintptr, uint32, uint64) bool | |
| 373 | + | ||
| 374 | + | // Returns whether a given format is contained in @formats. | |
| 375 | + | func (x *DmabufFormats) Contains(FourccVar uint32, ModifierVar uint64) bool { | |
| 376 | + | ||
| 377 | + | cret := xDmabufFormatsContains(x.GoPointer(), FourccVar, ModifierVar) | |
| 378 | + | return cret | |
| 379 | + | } | |
| 380 | + | ||
| 381 | + | var xDmabufFormatsEqual func(uintptr, *DmabufFormats) bool | |
| 382 | + | ||
| 383 | + | // Returns whether @formats1 and @formats2 contain the | |
| 384 | + | // same dmabuf formats, in the same order. | |
| 385 | + | func (x *DmabufFormats) Equal(Formats2Var *DmabufFormats) bool { | |
| 386 | + | ||
| 387 | + | cret := xDmabufFormatsEqual(x.GoPointer(), Formats2Var) | |
| 388 | + | return cret | |
| 389 | + | } | |
| 390 | + | ||
| 391 | + | var xDmabufFormatsGetFormat func(uintptr, uint, uint32, uint64) | |
| 392 | + | ||
| 393 | + | // Gets the fourcc code and modifier for a format | |
| 394 | + | // that is contained in @formats. | |
| 395 | + | func (x *DmabufFormats) GetFormat(IdxVar uint, FourccVar uint32, ModifierVar uint64) { | |
| 396 | + | ||
| 397 | + | xDmabufFormatsGetFormat(x.GoPointer(), IdxVar, FourccVar, ModifierVar) | |
| 398 | + | ||
| 399 | + | } | |
| 400 | + | ||
| 401 | + | var xDmabufFormatsGetNFormats func(uintptr) uint | |
| 402 | + | ||
| 403 | + | // Returns the number of formats that the @formats object | |
| 404 | + | // contains. | |
| 405 | + | // | |
| 406 | + | // Note that DMA buffers are a Linux concept, so on other | |
| 407 | + | // platforms, [method@Gdk.DmabufFormats.get_n_formats] will | |
| 408 | + | // always return zero. | |
| 409 | + | func (x *DmabufFormats) GetNFormats() uint { | |
| 410 | + | ||
| 411 | + | cret := xDmabufFormatsGetNFormats(x.GoPointer()) | |
| 412 | + | return cret | |
| 413 | + | } | |
| 414 | + | ||
| 415 | + | var xDmabufFormatsRef func(uintptr) *DmabufFormats | |
| 416 | + | ||
| 417 | + | // Increases the reference count of @formats. | |
| 418 | + | func (x *DmabufFormats) Ref() *DmabufFormats { | |
| 419 | + | ||
| 420 | + | cret := xDmabufFormatsRef(x.GoPointer()) | |
| 421 | + | return cret | |
| 422 | + | } | |
| 423 | + | ||
| 424 | + | var xDmabufFormatsUnref func(uintptr) | |
| 425 | + | ||
| 426 | + | // Decreases the reference count of @formats. | |
| 427 | + | // | |
| 428 | + | // When the reference count reaches zero, | |
| 429 | + | // the object is freed. | |
| 430 | + | func (x *DmabufFormats) Unref() { | |
| 431 | + | ||
| 432 | + | xDmabufFormatsUnref(x.GoPointer()) | |
| 433 | + | ||
| 434 | + | } | |
| 435 | + | ||
| 436 | + | // Represents a hardware key that can be mapped to a keyval. | |
| 254 | 437 | type KeymapKey struct { | |
| 255 | 438 | _ structs.HostLayout | |
| 256 | 439 | ||
| @@ -265,7 +448,7 @@ func (x *KeymapKey) GoPointer() uintptr { | |||
| 265 | 448 | return uintptr(unsafe.Pointer(x)) | |
| 266 | 449 | } | |
| 267 | 450 | ||
| 268 | - | // A `GdkRectangle` data type for representing rectangles. | |
| 451 | + | // Represents a rectangle. | |
| 269 | 452 | // | |
| 270 | 453 | // `GdkRectangle` is identical to `cairo_rectangle_t`. Together with Cairo’s | |
| 271 | 454 | // `cairo_region_t` data type, these are the central types for representing | |
| @@ -351,6 +534,152 @@ func (x *Rectangle) Union(Src2Var *Rectangle, DestVar *Rectangle) { | |||
| 351 | 534 | ||
| 352 | 535 | } | |
| 353 | 536 | ||
| 537 | + | // Used to download the contents of a [class@Gdk.Texture]. | |
| 538 | + | // | |
| 539 | + | // It is intended to be created as a short-term object for a single download, | |
| 540 | + | // but can be used for multiple downloads of different textures or with different | |
| 541 | + | // settings. | |
| 542 | + | // | |
| 543 | + | // `GdkTextureDownloader` can be used to convert data between different formats. | |
| 544 | + | // Create a `GdkTexture` for the existing format and then download it in a | |
| 545 | + | // different format. | |
| 546 | + | type TextureDownloader struct { | |
| 547 | + | _ structs.HostLayout | |
| 548 | + | } | |
| 549 | + | ||
| 550 | + | var xTextureDownloaderGLibType func() types.GType | |
| 551 | + | ||
| 552 | + | func TextureDownloaderGLibType() types.GType { | |
| 553 | + | return xTextureDownloaderGLibType() | |
| 554 | + | } | |
| 555 | + | ||
| 556 | + | func (x *TextureDownloader) GoPointer() uintptr { | |
| 557 | + | return uintptr(unsafe.Pointer(x)) | |
| 558 | + | } | |
| 559 | + | ||
| 560 | + | var xNewTextureDownloader func(uintptr) *TextureDownloader | |
| 561 | + | ||
| 562 | + | // Creates a new texture downloader for @texture. | |
| 563 | + | // | |
| 564 | + | // By default, the downloader will convert the data to | |
| 565 | + | // the default memory format, and to the sRGB color state. | |
| 566 | + | func NewTextureDownloader(TextureVar *Texture) *TextureDownloader { | |
| 567 | + | ||
| 568 | + | cret := xNewTextureDownloader(TextureVar.GoPointer()) | |
| 569 | + | return cret | |
| 570 | + | } | |
| 571 | + | ||
| 572 | + | var xTextureDownloaderCopy func(uintptr) *TextureDownloader | |
| 573 | + | ||
| 574 | + | // Creates a copy of the downloader. | |
| 575 | + | // | |
| 576 | + | // This function is meant for language bindings. | |
| 577 | + | func (x *TextureDownloader) Copy() *TextureDownloader { | |
| 578 | + | ||
| 579 | + | cret := xTextureDownloaderCopy(x.GoPointer()) | |
| 580 | + | return cret | |
| 581 | + | } | |
| 582 | + | ||
| 583 | + | var xTextureDownloaderDownloadBytes func(uintptr, uint) *glib.Bytes | |
| 584 | + | ||
| 585 | + | // Downloads the given texture pixels into a `GBytes`. The rowstride will | |
| 586 | + | // be stored in the stride value. | |
| 587 | + | // | |
| 588 | + | // This function will abort if it tries to download a large texture and | |
| 589 | + | // fails to allocate memory. If you think that may happen, you should handle | |
| 590 | + | // memory allocation yourself and use [method@Gdk.TextureDownloader.download_into] | |
| 591 | + | // once allocation succeeded. | |
| 592 | + | func (x *TextureDownloader) DownloadBytes(OutStrideVar uint) *glib.Bytes { | |
| 593 | + | ||
| 594 | + | cret := xTextureDownloaderDownloadBytes(x.GoPointer(), OutStrideVar) | |
| 595 | + | return cret | |
| 596 | + | } | |
| 597 | + | ||
| 598 | + | var xTextureDownloaderDownloadInto func(uintptr, []byte, uint) | |
| 599 | + | ||
| 600 | + | // Downloads the @texture into local memory. | |
| 601 | + | func (x *TextureDownloader) DownloadInto(DataVar []byte, StrideVar uint) { | |
| 602 | + | ||
| 603 | + | xTextureDownloaderDownloadInto(x.GoPointer(), DataVar, StrideVar) | |
| 604 | + | ||
| 605 | + | } | |
| 606 | + | ||
| 607 | + | var xTextureDownloaderFree func(uintptr) | |
| 608 | + | ||
| 609 | + | // Frees the given downloader and all its associated resources. | |
| 610 | + | func (x *TextureDownloader) Free() { | |
| 611 | + | ||
| 612 | + | xTextureDownloaderFree(x.GoPointer()) | |
| 613 | + | ||
| 614 | + | } | |
| 615 | + | ||
| 616 | + | var xTextureDownloaderGetColorState func(uintptr) *ColorState | |
| 617 | + | ||
| 618 | + | // Gets the color state that the data will be downloaded in. | |
| 619 | + | func (x *TextureDownloader) GetColorState() *ColorState { | |
| 620 | + | ||
| 621 | + | cret := xTextureDownloaderGetColorState(x.GoPointer()) | |
| 622 | + | return cret | |
| 623 | + | } | |
| 624 | + | ||
| 625 | + | var xTextureDownloaderGetFormat func(uintptr) MemoryFormat | |
| 626 | + | ||
| 627 | + | // Gets the format that the data will be downloaded in. | |
| 628 | + | func (x *TextureDownloader) GetFormat() MemoryFormat { | |
| 629 | + | ||
| 630 | + | cret := xTextureDownloaderGetFormat(x.GoPointer()) | |
| 631 | + | return cret | |
| 632 | + | } | |
| 633 | + | ||
| 634 | + | var xTextureDownloaderGetTexture func(uintptr) uintptr | |
| 635 | + | ||
| 636 | + | // Gets the texture that the downloader will download. | |
| 637 | + | func (x *TextureDownloader) GetTexture() *Texture { | |
| 638 | + | var cls *Texture | |
| 639 | + | ||
| 640 | + | cret := xTextureDownloaderGetTexture(x.GoPointer()) | |
| 641 | + | ||
| 642 | + | if cret == 0 { | |
| 643 | + | return nil | |
| 644 | + | } | |
| 645 | + | gobject.IncreaseRef(cret) | |
| 646 | + | cls = &Texture{} | |
| 647 | + | cls.Ptr = cret | |
| 648 | + | return cls | |
| 649 | + | } | |
| 650 | + | ||
| 651 | + | var xTextureDownloaderSetColorState func(uintptr, *ColorState) | |
| 652 | + | ||
| 653 | + | // Sets the color state the downloader will convert the data to. | |
| 654 | + | // | |
| 655 | + | // By default, the sRGB colorstate returned by [func@ColorState.get_srgb] | |
| 656 | + | // is used. | |
| 657 | + | func (x *TextureDownloader) SetColorState(ColorStateVar *ColorState) { | |
| 658 | + | ||
| 659 | + | xTextureDownloaderSetColorState(x.GoPointer(), ColorStateVar) | |
| 660 | + | ||
| 661 | + | } | |
| 662 | + | ||
| 663 | + | var xTextureDownloaderSetFormat func(uintptr, MemoryFormat) | |
| 664 | + | ||
| 665 | + | // Sets the format the downloader will download. | |
| 666 | + | // | |
| 667 | + | // By default, GDK_MEMORY_DEFAULT is set. | |
| 668 | + | func (x *TextureDownloader) SetFormat(FormatVar MemoryFormat) { | |
| 669 | + | ||
| 670 | + | xTextureDownloaderSetFormat(x.GoPointer(), FormatVar) | |
| 671 | + | ||
| 672 | + | } | |
| 673 | + | ||
| 674 | + | var xTextureDownloaderSetTexture func(uintptr, uintptr) | |
| 675 | + | ||
| 676 | + | // Changes the texture the downloader will download. | |
| 677 | + | func (x *TextureDownloader) SetTexture(TextureVar *Texture) { | |
| 678 | + | ||
| 679 | + | xTextureDownloaderSetTexture(x.GoPointer(), TextureVar.GoPointer()) | |
| 680 | + | ||
| 681 | + | } | |
| 682 | + | ||
| 354 | 683 | const ( | |
| 355 | 684 | // Represents the current time, and can be used anywhere a time is expected. | |
| 356 | 685 | CURRENT_TIME int = 0 | |
| @@ -364,6 +693,13 @@ func init() { | |||
| 364 | 693 | panic(err) | |
| 365 | 694 | } | |
| 366 | 695 | ||
| 696 | + | core.PuregoSafeRegister(&xColorStateGLibType, lib, "gdk_color_state_get_type") | |
| 697 | + | ||
| 698 | + | core.PuregoSafeRegister(&xColorStateCreateCicpParams, lib, "gdk_color_state_create_cicp_params") | |
| 699 | + | core.PuregoSafeRegister(&xColorStateEqual, lib, "gdk_color_state_equal") | |
| 700 | + | core.PuregoSafeRegister(&xColorStateRef, lib, "gdk_color_state_ref") | |
| 701 | + | core.PuregoSafeRegister(&xColorStateUnref, lib, "gdk_color_state_unref") | |
| 702 | + | ||
| 367 | 703 | core.PuregoSafeRegister(&xContentFormatsGLibType, lib, "gdk_content_formats_get_type") | |
| 368 | 704 | ||
| 369 | 705 | core.PuregoSafeRegister(&xNewContentFormats, lib, "gdk_content_formats_new") | |
| @@ -373,6 +709,7 @@ func init() { | |||
| 373 | 709 | core.PuregoSafeRegister(&xContentFormatsContainMimeType, lib, "gdk_content_formats_contain_mime_type") | |
| 374 | 710 | core.PuregoSafeRegister(&xContentFormatsGetGtypes, lib, "gdk_content_formats_get_gtypes") | |
| 375 | 711 | core.PuregoSafeRegister(&xContentFormatsGetMimeTypes, lib, "gdk_content_formats_get_mime_types") | |
| 712 | + | core.PuregoSafeRegister(&xContentFormatsIsEmpty, lib, "gdk_content_formats_is_empty") | |
| 376 | 713 | core.PuregoSafeRegister(&xContentFormatsMatch, lib, "gdk_content_formats_match") | |
| 377 | 714 | core.PuregoSafeRegister(&xContentFormatsMatchGtype, lib, "gdk_content_formats_match_gtype") | |
| 378 | 715 | core.PuregoSafeRegister(&xContentFormatsMatchMimeType, lib, "gdk_content_formats_match_mime_type") | |
| @@ -386,6 +723,15 @@ func init() { | |||
| 386 | 723 | core.PuregoSafeRegister(&xContentFormatsUnionSerializeMimeTypes, lib, "gdk_content_formats_union_serialize_mime_types") | |
| 387 | 724 | core.PuregoSafeRegister(&xContentFormatsUnref, lib, "gdk_content_formats_unref") | |
| 388 | 725 | ||
| 726 | + | core.PuregoSafeRegister(&xDmabufFormatsGLibType, lib, "gdk_dmabuf_formats_get_type") | |
| 727 | + | ||
| 728 | + | core.PuregoSafeRegister(&xDmabufFormatsContains, lib, "gdk_dmabuf_formats_contains") | |
| 729 | + | core.PuregoSafeRegister(&xDmabufFormatsEqual, lib, "gdk_dmabuf_formats_equal") | |
| 730 | + | core.PuregoSafeRegister(&xDmabufFormatsGetFormat, lib, "gdk_dmabuf_formats_get_format") | |
| 731 | + | core.PuregoSafeRegister(&xDmabufFormatsGetNFormats, lib, "gdk_dmabuf_formats_get_n_formats") | |
| 732 | + | core.PuregoSafeRegister(&xDmabufFormatsRef, lib, "gdk_dmabuf_formats_ref") | |
| 733 | + | core.PuregoSafeRegister(&xDmabufFormatsUnref, lib, "gdk_dmabuf_formats_unref") | |
| 734 | + | ||
| 389 | 735 | core.PuregoSafeRegister(&xRectangleGLibType, lib, "gdk_rectangle_get_type") | |
| 390 | 736 | ||
| 391 | 737 | core.PuregoSafeRegister(&xRectangleContainsPoint, lib, "gdk_rectangle_contains_point") | |
| @@ -393,4 +739,19 @@ func init() { | |||
| 393 | 739 | core.PuregoSafeRegister(&xRectangleIntersect, lib, "gdk_rectangle_intersect") | |
| 394 | 740 | core.PuregoSafeRegister(&xRectangleUnion, lib, "gdk_rectangle_union") | |
| 395 | 741 | ||
| 742 | + | core.PuregoSafeRegister(&xTextureDownloaderGLibType, lib, "gdk_texture_downloader_get_type") | |
| 743 | + | ||
| 744 | + | core.PuregoSafeRegister(&xNewTextureDownloader, lib, "gdk_texture_downloader_new") | |
| 745 | + | ||
| 746 | + | core.PuregoSafeRegister(&xTextureDownloaderCopy, lib, "gdk_texture_downloader_copy") | |
| 747 | + | core.PuregoSafeRegister(&xTextureDownloaderDownloadBytes, lib, "gdk_texture_downloader_download_bytes") | |
| 748 | + | core.PuregoSafeRegister(&xTextureDownloaderDownloadInto, lib, "gdk_texture_downloader_download_into") | |
| 749 | + | core.PuregoSafeRegister(&xTextureDownloaderFree, lib, "gdk_texture_downloader_free") | |
| 750 | + | core.PuregoSafeRegister(&xTextureDownloaderGetColorState, lib, "gdk_texture_downloader_get_color_state") | |
| 751 | + | core.PuregoSafeRegister(&xTextureDownloaderGetFormat, lib, "gdk_texture_downloader_get_format") | |
| 752 | + | core.PuregoSafeRegister(&xTextureDownloaderGetTexture, lib, "gdk_texture_downloader_get_texture") | |
| 753 | + | core.PuregoSafeRegister(&xTextureDownloaderSetColorState, lib, "gdk_texture_downloader_set_color_state") | |
| 754 | + | core.PuregoSafeRegister(&xTextureDownloaderSetFormat, lib, "gdk_texture_downloader_set_format") | |
| 755 | + | core.PuregoSafeRegister(&xTextureDownloaderSetTexture, lib, "gdk_texture_downloader_set_texture") | |
| 756 | + | ||
| 396 | 757 | } | |
M v4/gdk/gdkvulkancontext.go +26 -3
| @@ -5,14 +5,23 @@ import ( | |||
| 5 | 5 | "unsafe" | |
| 6 | 6 | ||
| 7 | 7 | "github.com/jwijenbergh/purego" | |
| 8 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 8 | 9 | "github.com/jwijenbergh/puregotk/v4/gio" | |
| 9 | 10 | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 10 | 11 | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | 12 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 13 | ) | |
| 13 | 14 | ||
| 14 | - | // `GdkVulkanContext` is an object representing the platform-specific | |
| 15 | - | // Vulkan draw context. | |
| 15 | + | var xVulkanErrorQuark func() glib.Quark | |
| 16 | + | ||
| 17 | + | // Registers an error quark for [class@Gdk.VulkanContext] errors. | |
| 18 | + | func VulkanErrorQuark() glib.Quark { | |
| 19 | + | ||
| 20 | + | cret := xVulkanErrorQuark() | |
| 21 | + | return cret | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | // Represents the platform-specific Vulkan draw context. | |
| 16 | 25 | // | |
| 17 | 26 | // `GdkVulkanContext`s are created for a surface using | |
| 18 | 27 | // [method@Gdk.Surface.create_vulkan_context], and the context will match | |
| @@ -88,7 +97,7 @@ func (x *VulkanContext) ConnectImagesUpdated(cb *func(VulkanContext)) uint32 { | |||
| 88 | 97 | // If the object is not initialized, or initialization returns with an | |
| 89 | 98 | // error, then all operations on the object except g_object_ref() and | |
| 90 | 99 | // g_object_unref() are considered to be invalid, and have undefined | |
| 91 | - | // behaviour. See the [introduction][ginitable] for more details. | |
| 100 | + | // behaviour. See the [description][iface@Gio.Initable#description] for more details. | |
| 92 | 101 | // | |
| 93 | 102 | // Callers should not assume that a class which implements #GInitable can be | |
| 94 | 103 | // initialized multiple times, unless the class explicitly documents itself as | |
| @@ -118,3 +127,17 @@ func (x *VulkanContext) Init(CancellableVar *gio.Cancellable) (bool, error) { | |||
| 118 | 127 | return cret, cerr | |
| 119 | 128 | ||
| 120 | 129 | } | |
| 130 | + | ||
| 131 | + | func init() { | |
| 132 | + | core.SetPackageName("GDK", "gtk4") | |
| 133 | + | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 134 | + | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 135 | + | if err != nil { | |
| 136 | + | panic(err) | |
| 137 | + | } | |
| 138 | + | ||
| 139 | + | core.PuregoSafeRegister(&xVulkanErrorQuark, lib, "gdk_vulkan_error_quark") | |
| 140 | + | ||
| 141 | + | core.PuregoSafeRegister(&xVulkanContextGLibType, lib, "gdk_vulkan_context_get_type") | |
| 142 | + | ||
| 143 | + | } | |
D v4/gdk/main.go +0 -65
| @@ -1,65 +0,0 @@ | |||
| 1 | - | // Package gdk was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | - | package gdk | |
| 3 | - | ||
| 4 | - | import ( | |
| 5 | - | "github.com/jwijenbergh/purego" | |
| 6 | - | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | - | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | - | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 9 | - | ) | |
| 10 | - | ||
| 11 | - | type TitlebarGesture int | |
| 12 | - | ||
| 13 | - | var xTitlebarGestureGLibType func() types.GType | |
| 14 | - | ||
| 15 | - | func TitlebarGestureGLibType() types.GType { | |
| 16 | - | return xTitlebarGestureGLibType() | |
| 17 | - | } | |
| 18 | - | ||
| 19 | - | const ( | |
| 20 | - | TitlebarGestureDoubleClickValue TitlebarGesture = 1 | |
| 21 | - | ||
| 22 | - | TitlebarGestureRightClickValue TitlebarGesture = 2 | |
| 23 | - | ||
| 24 | - | TitlebarGestureMiddleClickValue TitlebarGesture = 3 | |
| 25 | - | ) | |
| 26 | - | ||
| 27 | - | var xGlErrorQuark func() glib.Quark | |
| 28 | - | ||
| 29 | - | func GlErrorQuark() glib.Quark { | |
| 30 | - | ||
| 31 | - | cret := xGlErrorQuark() | |
| 32 | - | return cret | |
| 33 | - | } | |
| 34 | - | ||
| 35 | - | var xTextureErrorQuark func() glib.Quark | |
| 36 | - | ||
| 37 | - | func TextureErrorQuark() glib.Quark { | |
| 38 | - | ||
| 39 | - | cret := xTextureErrorQuark() | |
| 40 | - | return cret | |
| 41 | - | } | |
| 42 | - | ||
| 43 | - | var xVulkanErrorQuark func() glib.Quark | |
| 44 | - | ||
| 45 | - | func VulkanErrorQuark() glib.Quark { | |
| 46 | - | ||
| 47 | - | cret := xVulkanErrorQuark() | |
| 48 | - | return cret | |
| 49 | - | } | |
| 50 | - | ||
| 51 | - | func init() { | |
| 52 | - | core.SetPackageName("GDK", "gtk4") | |
| 53 | - | core.SetSharedLibrary("GDK", "libgtk-4.so.1") | |
| 54 | - | lib, err := purego.Dlopen(core.GetPath("GDK"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 55 | - | if err != nil { | |
| 56 | - | panic(err) | |
| 57 | - | } | |
| 58 | - | ||
| 59 | - | core.PuregoSafeRegister(&xTitlebarGestureGLibType, lib, "gdk_titlebar_gesture_get_type") | |
| 60 | - | ||
| 61 | - | core.PuregoSafeRegister(&xGlErrorQuark, lib, "gdk_gl_error_quark") | |
| 62 | - | core.PuregoSafeRegister(&xTextureErrorQuark, lib, "gdk_texture_error_quark") | |
| 63 | - | core.PuregoSafeRegister(&xVulkanErrorQuark, lib, "gdk_vulkan_error_quark") | |
| 64 | - | ||
| 65 | - | } | |
M v4/gdkpixbuf/gdk-pixbuf-animation.go +28 -0
| @@ -35,6 +35,7 @@ func (x *PixbufAnimationClass) GoPointer() uintptr { | |||
| 35 | 35 | } | |
| 36 | 36 | ||
| 37 | 37 | // OverrideIsStaticImage sets the callback function. | |
| 38 | + | // returns whether the given animation is just a static image. | |
| 38 | 39 | func (x *PixbufAnimationClass) OverrideIsStaticImage(cb func(*PixbufAnimation) bool) { | |
| 39 | 40 | if cb == nil { | |
| 40 | 41 | x.xIsStaticImage = 0 | |
| @@ -46,6 +47,7 @@ func (x *PixbufAnimationClass) OverrideIsStaticImage(cb func(*PixbufAnimation) b | |||
| 46 | 47 | } | |
| 47 | 48 | ||
| 48 | 49 | // GetIsStaticImage gets the callback function. | |
| 50 | + | // returns whether the given animation is just a static image. | |
| 49 | 51 | func (x *PixbufAnimationClass) GetIsStaticImage() func(*PixbufAnimation) bool { | |
| 50 | 52 | if x.xIsStaticImage == 0 { | |
| 51 | 53 | return nil | |
| @@ -58,6 +60,7 @@ func (x *PixbufAnimationClass) GetIsStaticImage() func(*PixbufAnimation) bool { | |||
| 58 | 60 | } | |
| 59 | 61 | ||
| 60 | 62 | // OverrideGetStaticImage sets the callback function. | |
| 63 | + | // returns a static image representing the given animation. | |
| 61 | 64 | func (x *PixbufAnimationClass) OverrideGetStaticImage(cb func(*PixbufAnimation) *Pixbuf) { | |
| 62 | 65 | if cb == nil { | |
| 63 | 66 | x.xGetStaticImage = 0 | |
| @@ -73,6 +76,7 @@ func (x *PixbufAnimationClass) OverrideGetStaticImage(cb func(*PixbufAnimation) | |||
| 73 | 76 | } | |
| 74 | 77 | ||
| 75 | 78 | // GetGetStaticImage gets the callback function. | |
| 79 | + | // returns a static image representing the given animation. | |
| 76 | 80 | func (x *PixbufAnimationClass) GetGetStaticImage() func(*PixbufAnimation) *Pixbuf { | |
| 77 | 81 | if x.xGetStaticImage == 0 { | |
| 78 | 82 | return nil | |
| @@ -91,6 +95,7 @@ func (x *PixbufAnimationClass) GetGetStaticImage() func(*PixbufAnimation) *Pixbu | |||
| 91 | 95 | } | |
| 92 | 96 | ||
| 93 | 97 | // OverrideGetSize sets the callback function. | |
| 98 | + | // fills @width and @height with the frame size of the animation. | |
| 94 | 99 | func (x *PixbufAnimationClass) OverrideGetSize(cb func(*PixbufAnimation, int, int)) { | |
| 95 | 100 | if cb == nil { | |
| 96 | 101 | x.xGetSize = 0 | |
| @@ -102,6 +107,7 @@ func (x *PixbufAnimationClass) OverrideGetSize(cb func(*PixbufAnimation, int, in | |||
| 102 | 107 | } | |
| 103 | 108 | ||
| 104 | 109 | // GetGetSize gets the callback function. | |
| 110 | + | // fills @width and @height with the frame size of the animation. | |
| 105 | 111 | func (x *PixbufAnimationClass) GetGetSize() func(*PixbufAnimation, int, int) { | |
| 106 | 112 | if x.xGetSize == 0 { | |
| 107 | 113 | return nil | |
| @@ -114,6 +120,7 @@ func (x *PixbufAnimationClass) GetGetSize() func(*PixbufAnimation, int, int) { | |||
| 114 | 120 | } | |
| 115 | 121 | ||
| 116 | 122 | // OverrideGetIter sets the callback function. | |
| 123 | + | // returns an iterator for the given animation. | |
| 117 | 124 | func (x *PixbufAnimationClass) OverrideGetIter(cb func(*PixbufAnimation, *glib.TimeVal) *PixbufAnimationIter) { | |
| 118 | 125 | if cb == nil { | |
| 119 | 126 | x.xGetIter = 0 | |
| @@ -129,6 +136,7 @@ func (x *PixbufAnimationClass) OverrideGetIter(cb func(*PixbufAnimation, *glib.T | |||
| 129 | 136 | } | |
| 130 | 137 | ||
| 131 | 138 | // GetGetIter gets the callback function. | |
| 139 | + | // returns an iterator for the given animation. | |
| 132 | 140 | func (x *PixbufAnimationClass) GetGetIter() func(*PixbufAnimation, *glib.TimeVal) *PixbufAnimationIter { | |
| 133 | 141 | if x.xGetIter == 0 { | |
| 134 | 142 | return nil | |
| @@ -168,6 +176,9 @@ func (x *PixbufAnimationIterClass) GoPointer() uintptr { | |||
| 168 | 176 | } | |
| 169 | 177 | ||
| 170 | 178 | // OverrideGetDelayTime sets the callback function. | |
| 179 | + | // returns the time in milliseconds that the current frame | |
| 180 | + | // | |
| 181 | + | // should be shown. | |
| 171 | 182 | func (x *PixbufAnimationIterClass) OverrideGetDelayTime(cb func(*PixbufAnimationIter) int) { | |
| 172 | 183 | if cb == nil { | |
| 173 | 184 | x.xGetDelayTime = 0 | |
| @@ -179,6 +190,9 @@ func (x *PixbufAnimationIterClass) OverrideGetDelayTime(cb func(*PixbufAnimation | |||
| 179 | 190 | } | |
| 180 | 191 | ||
| 181 | 192 | // GetGetDelayTime gets the callback function. | |
| 193 | + | // returns the time in milliseconds that the current frame | |
| 194 | + | // | |
| 195 | + | // should be shown. | |
| 182 | 196 | func (x *PixbufAnimationIterClass) GetGetDelayTime() func(*PixbufAnimationIter) int { | |
| 183 | 197 | if x.xGetDelayTime == 0 { | |
| 184 | 198 | return nil | |
| @@ -191,6 +205,7 @@ func (x *PixbufAnimationIterClass) GetGetDelayTime() func(*PixbufAnimationIter) | |||
| 191 | 205 | } | |
| 192 | 206 | ||
| 193 | 207 | // OverrideGetPixbuf sets the callback function. | |
| 208 | + | // returns the current frame. | |
| 194 | 209 | func (x *PixbufAnimationIterClass) OverrideGetPixbuf(cb func(*PixbufAnimationIter) *Pixbuf) { | |
| 195 | 210 | if cb == nil { | |
| 196 | 211 | x.xGetPixbuf = 0 | |
| @@ -206,6 +221,7 @@ func (x *PixbufAnimationIterClass) OverrideGetPixbuf(cb func(*PixbufAnimationIte | |||
| 206 | 221 | } | |
| 207 | 222 | ||
| 208 | 223 | // GetGetPixbuf gets the callback function. | |
| 224 | + | // returns the current frame. | |
| 209 | 225 | func (x *PixbufAnimationIterClass) GetGetPixbuf() func(*PixbufAnimationIter) *Pixbuf { | |
| 210 | 226 | if x.xGetPixbuf == 0 { | |
| 211 | 227 | return nil | |
| @@ -224,6 +240,9 @@ func (x *PixbufAnimationIterClass) GetGetPixbuf() func(*PixbufAnimationIter) *Pi | |||
| 224 | 240 | } | |
| 225 | 241 | ||
| 226 | 242 | // OverrideOnCurrentlyLoadingFrame sets the callback function. | |
| 243 | + | // returns whether the current frame of @iter is | |
| 244 | + | // | |
| 245 | + | // being loaded. | |
| 227 | 246 | func (x *PixbufAnimationIterClass) OverrideOnCurrentlyLoadingFrame(cb func(*PixbufAnimationIter) bool) { | |
| 228 | 247 | if cb == nil { | |
| 229 | 248 | x.xOnCurrentlyLoadingFrame = 0 | |
| @@ -235,6 +254,9 @@ func (x *PixbufAnimationIterClass) OverrideOnCurrentlyLoadingFrame(cb func(*Pixb | |||
| 235 | 254 | } | |
| 236 | 255 | ||
| 237 | 256 | // GetOnCurrentlyLoadingFrame gets the callback function. | |
| 257 | + | // returns whether the current frame of @iter is | |
| 258 | + | // | |
| 259 | + | // being loaded. | |
| 238 | 260 | func (x *PixbufAnimationIterClass) GetOnCurrentlyLoadingFrame() func(*PixbufAnimationIter) bool { | |
| 239 | 261 | if x.xOnCurrentlyLoadingFrame == 0 { | |
| 240 | 262 | return nil | |
| @@ -247,6 +269,9 @@ func (x *PixbufAnimationIterClass) GetOnCurrentlyLoadingFrame() func(*PixbufAnim | |||
| 247 | 269 | } | |
| 248 | 270 | ||
| 249 | 271 | // OverrideAdvance sets the callback function. | |
| 272 | + | // advances the iterator to @current_time, possibly changing the | |
| 273 | + | // | |
| 274 | + | // current frame. | |
| 250 | 275 | func (x *PixbufAnimationIterClass) OverrideAdvance(cb func(*PixbufAnimationIter, *glib.TimeVal) bool) { | |
| 251 | 276 | if cb == nil { | |
| 252 | 277 | x.xAdvance = 0 | |
| @@ -258,6 +283,9 @@ func (x *PixbufAnimationIterClass) OverrideAdvance(cb func(*PixbufAnimationIter, | |||
| 258 | 283 | } | |
| 259 | 284 | ||
| 260 | 285 | // GetAdvance gets the callback function. | |
| 286 | + | // advances the iterator to @current_time, possibly changing the | |
| 287 | + | // | |
| 288 | + | // current frame. | |
| 261 | 289 | func (x *PixbufAnimationIterClass) GetAdvance() func(*PixbufAnimationIter, *glib.TimeVal) bool { | |
| 262 | 290 | if x.xAdvance == 0 { | |
| 263 | 291 | return nil | |
M v4/gdkpixbuf/gdk-pixbuf-features.go +2 -2
| @@ -7,7 +7,7 @@ const ( | |||
| 7 | 7 | PIXBUF_MAJOR int = 2 | |
| 8 | 8 | // Micro version of gdk-pixbuf library, that is the "2" in | |
| 9 | 9 | // "0.8.2" for example. | |
| 10 | - | PIXBUF_MICRO int = 10 | |
| 10 | + | PIXBUF_MICRO int = 12 | |
| 11 | 11 | // Minor version of gdk-pixbuf library, that is the "8" in | |
| 12 | 12 | // "0.8.2" for example. | |
| 13 | 13 | PIXBUF_MINOR int = 42 | |
| @@ -15,5 +15,5 @@ const ( | |||
| 15 | 15 | // | |
| 16 | 16 | // This is the version being compiled against; contrast with | |
| 17 | 17 | // `gdk_pixbuf_version`. | |
| 18 | - | PIXBUF_VERSION string = "2.42.10" | |
| 18 | + | PIXBUF_VERSION string = "2.42.12" | |
| 19 | 19 | ) | |
M v4/gdkpixbuf/gdk-pixbuf.go +7 -0
| @@ -1357,6 +1357,13 @@ func (x *Pixbuf) Equal(Icon2Var gio.Icon) bool { | |||
| 1357 | 1357 | return cret | |
| 1358 | 1358 | } | |
| 1359 | 1359 | ||
| 1360 | + | // Gets a hash for an icon. | |
| 1361 | + | func (x *Pixbuf) Hash() uint { | |
| 1362 | + | ||
| 1363 | + | cret := gio.XGIconHash(x.GoPointer()) | |
| 1364 | + | return cret | |
| 1365 | + | } | |
| 1366 | + | ||
| 1360 | 1367 | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| 1361 | 1368 | // back by calling g_icon_deserialize() on the returned value. | |
| 1362 | 1369 | // As serialization will avoid using raw icon data when possible, it only | |
M v4/gio/gaction.go +85 -58
| @@ -11,7 +11,7 @@ import ( | |||
| 11 | 11 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | - | // The virtual function table for #GAction. | |
| 14 | + | // The virtual function table for [type@Gio.Action]. | |
| 15 | 15 | type ActionInterface struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| @@ -39,6 +39,7 @@ func (x *ActionInterface) GoPointer() uintptr { | |||
| 39 | 39 | } | |
| 40 | 40 | ||
| 41 | 41 | // OverrideGetName sets the callback function. | |
| 42 | + | // the virtual function pointer for [method@Gio.Action.get_name] | |
| 42 | 43 | func (x *ActionInterface) OverrideGetName(cb func(Action) string) { | |
| 43 | 44 | if cb == nil { | |
| 44 | 45 | x.xGetName = 0 | |
| @@ -50,6 +51,7 @@ func (x *ActionInterface) OverrideGetName(cb func(Action) string) { | |||
| 50 | 51 | } | |
| 51 | 52 | ||
| 52 | 53 | // GetGetName gets the callback function. | |
| 54 | + | // the virtual function pointer for [method@Gio.Action.get_name] | |
| 53 | 55 | func (x *ActionInterface) GetGetName() func(Action) string { | |
| 54 | 56 | if x.xGetName == 0 { | |
| 55 | 57 | return nil | |
| @@ -62,6 +64,7 @@ func (x *ActionInterface) GetGetName() func(Action) string { | |||
| 62 | 64 | } | |
| 63 | 65 | ||
| 64 | 66 | // OverrideGetParameterType sets the callback function. | |
| 67 | + | // the virtual function pointer for [method@Gio.Action.get_parameter_type] | |
| 65 | 68 | func (x *ActionInterface) OverrideGetParameterType(cb func(Action) *glib.VariantType) { | |
| 66 | 69 | if cb == nil { | |
| 67 | 70 | x.xGetParameterType = 0 | |
| @@ -73,6 +76,7 @@ func (x *ActionInterface) OverrideGetParameterType(cb func(Action) *glib.Variant | |||
| 73 | 76 | } | |
| 74 | 77 | ||
| 75 | 78 | // GetGetParameterType gets the callback function. | |
| 79 | + | // the virtual function pointer for [method@Gio.Action.get_parameter_type] | |
| 76 | 80 | func (x *ActionInterface) GetGetParameterType() func(Action) *glib.VariantType { | |
| 77 | 81 | if x.xGetParameterType == 0 { | |
| 78 | 82 | return nil | |
| @@ -85,6 +89,7 @@ func (x *ActionInterface) GetGetParameterType() func(Action) *glib.VariantType { | |||
| 85 | 89 | } | |
| 86 | 90 | ||
| 87 | 91 | // OverrideGetStateType sets the callback function. | |
| 92 | + | // the virtual function pointer for [method@Gio.Action.get_state_type] | |
| 88 | 93 | func (x *ActionInterface) OverrideGetStateType(cb func(Action) *glib.VariantType) { | |
| 89 | 94 | if cb == nil { | |
| 90 | 95 | x.xGetStateType = 0 | |
| @@ -96,6 +101,7 @@ func (x *ActionInterface) OverrideGetStateType(cb func(Action) *glib.VariantType | |||
| 96 | 101 | } | |
| 97 | 102 | ||
| 98 | 103 | // GetGetStateType gets the callback function. | |
| 104 | + | // the virtual function pointer for [method@Gio.Action.get_state_type] | |
| 99 | 105 | func (x *ActionInterface) GetGetStateType() func(Action) *glib.VariantType { | |
| 100 | 106 | if x.xGetStateType == 0 { | |
| 101 | 107 | return nil | |
| @@ -108,6 +114,7 @@ func (x *ActionInterface) GetGetStateType() func(Action) *glib.VariantType { | |||
| 108 | 114 | } | |
| 109 | 115 | ||
| 110 | 116 | // OverrideGetStateHint sets the callback function. | |
| 117 | + | // the virtual function pointer for [method@Gio.Action.get_state_hint] | |
| 111 | 118 | func (x *ActionInterface) OverrideGetStateHint(cb func(Action) *glib.Variant) { | |
| 112 | 119 | if cb == nil { | |
| 113 | 120 | x.xGetStateHint = 0 | |
| @@ -119,6 +126,7 @@ func (x *ActionInterface) OverrideGetStateHint(cb func(Action) *glib.Variant) { | |||
| 119 | 126 | } | |
| 120 | 127 | ||
| 121 | 128 | // GetGetStateHint gets the callback function. | |
| 129 | + | // the virtual function pointer for [method@Gio.Action.get_state_hint] | |
| 122 | 130 | func (x *ActionInterface) GetGetStateHint() func(Action) *glib.Variant { | |
| 123 | 131 | if x.xGetStateHint == 0 { | |
| 124 | 132 | return nil | |
| @@ -131,6 +139,7 @@ func (x *ActionInterface) GetGetStateHint() func(Action) *glib.Variant { | |||
| 131 | 139 | } | |
| 132 | 140 | ||
| 133 | 141 | // OverrideGetEnabled sets the callback function. | |
| 142 | + | // the virtual function pointer for [method@Gio.Action.get_enabled] | |
| 134 | 143 | func (x *ActionInterface) OverrideGetEnabled(cb func(Action) bool) { | |
| 135 | 144 | if cb == nil { | |
| 136 | 145 | x.xGetEnabled = 0 | |
| @@ -142,6 +151,7 @@ func (x *ActionInterface) OverrideGetEnabled(cb func(Action) bool) { | |||
| 142 | 151 | } | |
| 143 | 152 | ||
| 144 | 153 | // GetGetEnabled gets the callback function. | |
| 154 | + | // the virtual function pointer for [method@Gio.Action.get_enabled] | |
| 145 | 155 | func (x *ActionInterface) GetGetEnabled() func(Action) bool { | |
| 146 | 156 | if x.xGetEnabled == 0 { | |
| 147 | 157 | return nil | |
| @@ -154,6 +164,7 @@ func (x *ActionInterface) GetGetEnabled() func(Action) bool { | |||
| 154 | 164 | } | |
| 155 | 165 | ||
| 156 | 166 | // OverrideGetState sets the callback function. | |
| 167 | + | // the virtual function pointer for [method@Gio.Action.get_state] | |
| 157 | 168 | func (x *ActionInterface) OverrideGetState(cb func(Action) *glib.Variant) { | |
| 158 | 169 | if cb == nil { | |
| 159 | 170 | x.xGetState = 0 | |
| @@ -165,6 +176,7 @@ func (x *ActionInterface) OverrideGetState(cb func(Action) *glib.Variant) { | |||
| 165 | 176 | } | |
| 166 | 177 | ||
| 167 | 178 | // GetGetState gets the callback function. | |
| 179 | + | // the virtual function pointer for [method@Gio.Action.get_state] | |
| 168 | 180 | func (x *ActionInterface) GetGetState() func(Action) *glib.Variant { | |
| 169 | 181 | if x.xGetState == 0 { | |
| 170 | 182 | return nil | |
| @@ -177,6 +189,7 @@ func (x *ActionInterface) GetGetState() func(Action) *glib.Variant { | |||
| 177 | 189 | } | |
| 178 | 190 | ||
| 179 | 191 | // OverrideChangeState sets the callback function. | |
| 192 | + | // the virtual function pointer for [method@Gio.Action.change_state] | |
| 180 | 193 | func (x *ActionInterface) OverrideChangeState(cb func(Action, *glib.Variant)) { | |
| 181 | 194 | if cb == nil { | |
| 182 | 195 | x.xChangeState = 0 | |
| @@ -188,6 +201,7 @@ func (x *ActionInterface) OverrideChangeState(cb func(Action, *glib.Variant)) { | |||
| 188 | 201 | } | |
| 189 | 202 | ||
| 190 | 203 | // GetChangeState gets the callback function. | |
| 204 | + | // the virtual function pointer for [method@Gio.Action.change_state] | |
| 191 | 205 | func (x *ActionInterface) GetChangeState() func(Action, *glib.Variant) { | |
| 192 | 206 | if x.xChangeState == 0 { | |
| 193 | 207 | return nil | |
| @@ -200,6 +214,9 @@ func (x *ActionInterface) GetChangeState() func(Action, *glib.Variant) { | |||
| 200 | 214 | } | |
| 201 | 215 | ||
| 202 | 216 | // OverrideActivate sets the callback function. | |
| 217 | + | // the virtual function pointer for [method@Gio.Action.activate]. Note that [type@Gio.Action] does not have an | |
| 218 | + | // | |
| 219 | + | // 'activate' signal but that implementations of it may have one. | |
| 203 | 220 | func (x *ActionInterface) OverrideActivate(cb func(Action, *glib.Variant)) { | |
| 204 | 221 | if cb == nil { | |
| 205 | 222 | x.xActivate = 0 | |
| @@ -211,6 +228,9 @@ func (x *ActionInterface) OverrideActivate(cb func(Action, *glib.Variant)) { | |||
| 211 | 228 | } | |
| 212 | 229 | ||
| 213 | 230 | // GetActivate gets the callback function. | |
| 231 | + | // the virtual function pointer for [method@Gio.Action.activate]. Note that [type@Gio.Action] does not have an | |
| 232 | + | // | |
| 233 | + | // 'activate' signal but that implementations of it may have one. | |
| 214 | 234 | func (x *ActionInterface) GetActivate() func(Action, *glib.Variant) { | |
| 215 | 235 | if x.xActivate == 0 { | |
| 216 | 236 | return nil | |
| @@ -222,35 +242,35 @@ func (x *ActionInterface) GetActivate() func(Action, *glib.Variant) { | |||
| 222 | 242 | } | |
| 223 | 243 | } | |
| 224 | 244 | ||
| 225 | - | // #GAction represents a single named action. | |
| 245 | + | // `GAction` represents a single named action. | |
| 226 | 246 | // | |
| 227 | 247 | // The main interface to an action is that it can be activated with | |
| 228 | - | // g_action_activate(). This results in the 'activate' signal being | |
| 229 | - | // emitted. An activation has a #GVariant parameter (which may be | |
| 230 | - | // %NULL). The correct type for the parameter is determined by a static | |
| 248 | + | // [method@Gio.Action.activate]. This results in the 'activate' signal being | |
| 249 | + | // emitted. An activation has a `GVariant` parameter (which may be | |
| 250 | + | // `NULL`). The correct type for the parameter is determined by a static | |
| 231 | 251 | // parameter type (which is given at construction time). | |
| 232 | 252 | // | |
| 233 | 253 | // An action may optionally have a state, in which case the state may be | |
| 234 | - | // set with g_action_change_state(). This call takes a #GVariant. The | |
| 254 | + | // set with [method@Gio.Action.change_state]. This call takes a [type@GLib.Variant]. The | |
| 235 | 255 | // correct type for the state is determined by a static state type | |
| 236 | 256 | // (which is given at construction time). | |
| 237 | 257 | // | |
| 238 | 258 | // The state may have a hint associated with it, specifying its valid | |
| 239 | 259 | // range. | |
| 240 | 260 | // | |
| 241 | - | // #GAction is merely the interface to the concept of an action, as | |
| 261 | + | // `GAction` is merely the interface to the concept of an action, as | |
| 242 | 262 | // described above. Various implementations of actions exist, including | |
| 243 | - | // #GSimpleAction. | |
| 263 | + | // [class@Gio.SimpleAction]. | |
| 244 | 264 | // | |
| 245 | 265 | // In all cases, the implementing class is responsible for storing the | |
| 246 | - | // name of the action, the parameter type, the enabled state, the | |
| 247 | - | // optional state type and the state and emitting the appropriate | |
| 248 | - | // signals when these change. The implementor is responsible for filtering | |
| 249 | - | // calls to g_action_activate() and g_action_change_state() for type | |
| 250 | - | // safety and for the state being enabled. | |
| 251 | - | // | |
| 252 | - | // Probably the only useful thing to do with a #GAction is to put it | |
| 253 | - | // inside of a #GSimpleActionGroup. | |
| 266 | + | // name of the action, the parameter type, the enabled state, the optional | |
| 267 | + | // state type and the state and emitting the appropriate signals when these | |
| 268 | + | // change. The implementor is responsible for filtering calls to | |
| 269 | + | // [method@Gio.Action.activate] and [method@Gio.Action.change_state] | |
| 270 | + | // for type safety and for the state being enabled. | |
| 271 | + | // | |
| 272 | + | // Probably the only useful thing to do with a `GAction` is to put it | |
| 273 | + | // inside of a [class@Gio.SimpleActionGroup]. | |
| 254 | 274 | type Action interface { | |
| 255 | 275 | GoPointer() uintptr | |
| 256 | 276 | SetGoPointer(uintptr) | |
| @@ -289,9 +309,9 @@ func (x *ActionBase) SetGoPointer(ptr uintptr) { | |||
| 289 | 309 | // | |
| 290 | 310 | // @parameter must be the correct type of parameter for the action (ie: | |
| 291 | 311 | // the parameter type given at construction time). If the parameter | |
| 292 | - | // type was %NULL then @parameter must also be %NULL. | |
| 312 | + | // type was `NULL` then @parameter must also be `NULL`. | |
| 293 | 313 | // | |
| 294 | - | // If the @parameter GVariant is floating, it is consumed. | |
| 314 | + | // If the @parameter [type@GLib.Variant] is floating, it is consumed. | |
| 295 | 315 | func (x *ActionBase) Activate(ParameterVar *glib.Variant) { | |
| 296 | 316 | ||
| 297 | 317 | XGActionActivate(x.GoPointer(), ParameterVar) | |
| @@ -301,13 +321,13 @@ func (x *ActionBase) Activate(ParameterVar *glib.Variant) { | |||
| 301 | 321 | // Request for the state of @action to be changed to @value. | |
| 302 | 322 | // | |
| 303 | 323 | // The action must be stateful and @value must be of the correct type. | |
| 304 | - | // See g_action_get_state_type(). | |
| 324 | + | // See [method@Gio.Action.get_state_type]. | |
| 305 | 325 | // | |
| 306 | 326 | // This call merely requests a change. The action may refuse to change | |
| 307 | 327 | // its state or may change its state to something other than @value. | |
| 308 | - | // See g_action_get_state_hint(). | |
| 328 | + | // See [method@Gio.Action.get_state_hint]. | |
| 309 | 329 | // | |
| 310 | - | // If the @value GVariant is floating, it is consumed. | |
| 330 | + | // If the @value [type@GLib.Variant] is floating, it is consumed. | |
| 311 | 331 | func (x *ActionBase) ChangeState(ValueVar *glib.Variant) { | |
| 312 | 332 | ||
| 313 | 333 | XGActionChangeState(x.GoPointer(), ValueVar) | |
| @@ -334,11 +354,12 @@ func (x *ActionBase) GetName() string { | |||
| 334 | 354 | // Queries the type of the parameter that must be given when activating | |
| 335 | 355 | // @action. | |
| 336 | 356 | // | |
| 337 | - | // When activating the action using g_action_activate(), the #GVariant | |
| 338 | - | // given to that function must be of the type returned by this function. | |
| 357 | + | // When activating the action using [method@Gio.Action.activate], the | |
| 358 | + | // [type@GLib.Variant] given to that function must be of the type returned by | |
| 359 | + | // this function. | |
| 339 | 360 | // | |
| 340 | - | // In the case that this function returns %NULL, you must not give any | |
| 341 | - | // #GVariant, but %NULL instead. | |
| 361 | + | // In the case that this function returns `NULL`, you must not give any | |
| 362 | + | // [type@GLib.Variant], but `NULL` instead. | |
| 342 | 363 | func (x *ActionBase) GetParameterType() *glib.VariantType { | |
| 343 | 364 | ||
| 344 | 365 | cret := XGActionGetParameterType(x.GoPointer()) | |
| @@ -347,12 +368,12 @@ func (x *ActionBase) GetParameterType() *glib.VariantType { | |||
| 347 | 368 | ||
| 348 | 369 | // Queries the current state of @action. | |
| 349 | 370 | // | |
| 350 | - | // If the action is not stateful then %NULL will be returned. If the | |
| 371 | + | // If the action is not stateful then `NULL` will be returned. If the | |
| 351 | 372 | // action is stateful then the type of the return value is the type | |
| 352 | - | // given by g_action_get_state_type(). | |
| 373 | + | // given by [method@Gio.Action.get_state_type]. | |
| 353 | 374 | // | |
| 354 | - | // The return value (if non-%NULL) should be freed with | |
| 355 | - | // g_variant_unref() when it is no longer required. | |
| 375 | + | // The return value (if non-`NULL`) should be freed with | |
| 376 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 356 | 377 | func (x *ActionBase) GetState() *glib.Variant { | |
| 357 | 378 | ||
| 358 | 379 | cret := XGActionGetState(x.GoPointer()) | |
| @@ -362,12 +383,12 @@ func (x *ActionBase) GetState() *glib.Variant { | |||
| 362 | 383 | // Requests a hint about the valid range of values for the state of | |
| 363 | 384 | // @action. | |
| 364 | 385 | // | |
| 365 | - | // If %NULL is returned it either means that the action is not stateful | |
| 386 | + | // If `NULL` is returned it either means that the action is not stateful | |
| 366 | 387 | // or that there is no hint about the valid range of values for the | |
| 367 | 388 | // state of the action. | |
| 368 | 389 | // | |
| 369 | - | // If a #GVariant array is returned then each item in the array is a | |
| 370 | - | // possible value for the state. If a #GVariant pair (ie: two-tuple) is | |
| 390 | + | // If a [type@GLib.Variant] array is returned then each item in the array is a | |
| 391 | + | // possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is | |
| 371 | 392 | // returned then the tuple specifies the inclusive lower and upper bound | |
| 372 | 393 | // of valid values for the state. | |
| 373 | 394 | // | |
| @@ -375,8 +396,8 @@ func (x *ActionBase) GetState() *glib.Variant { | |||
| 375 | 396 | // have a state value outside of the hinted range and setting a value | |
| 376 | 397 | // within the range may fail. | |
| 377 | 398 | // | |
| 378 | - | // The return value (if non-%NULL) should be freed with | |
| 379 | - | // g_variant_unref() when it is no longer required. | |
| 399 | + | // The return value (if non-`NULL`) should be freed with | |
| 400 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 380 | 401 | func (x *ActionBase) GetStateHint() *glib.Variant { | |
| 381 | 402 | ||
| 382 | 403 | cret := XGActionGetStateHint(x.GoPointer()) | |
| @@ -386,15 +407,15 @@ func (x *ActionBase) GetStateHint() *glib.Variant { | |||
| 386 | 407 | // Queries the type of the state of @action. | |
| 387 | 408 | // | |
| 388 | 409 | // If the action is stateful (e.g. created with | |
| 389 | - | // g_simple_action_new_stateful()) then this function returns the | |
| 390 | - | // #GVariantType of the state. This is the type of the initial value | |
| 391 | - | // given as the state. All calls to g_action_change_state() must give a | |
| 392 | - | // #GVariant of this type and g_action_get_state() will return a | |
| 393 | - | // #GVariant of the same type. | |
| 394 | - | // | |
| 395 | - | // If the action is not stateful (e.g. created with g_simple_action_new()) | |
| 396 | - | // then this function will return %NULL. In that case, g_action_get_state() | |
| 397 | - | // will return %NULL and you must not call g_action_change_state(). | |
| 410 | + | // [ctor@Gio.SimpleAction.new_stateful]) then this function returns the | |
| 411 | + | // [type@GLib.VariantType] of the state. This is the type of the initial value | |
| 412 | + | // given as the state. All calls to [method@Gio.Action.change_state] must give a | |
| 413 | + | // [type@GLib.Variant] of this type and [method@Gio.Action.get_state] will return a | |
| 414 | + | // [type@GLib.Variant] of the same type. | |
| 415 | + | // | |
| 416 | + | // If the action is not stateful (e.g. created with [ctor@Gio.SimpleAction.new]) | |
| 417 | + | // then this function will return `NULL`. In that case, [method@Gio.Action.get_state] | |
| 418 | + | // will return `NULL` and you must not call [method@Gio.Action.change_state]. | |
| 398 | 419 | func (x *ActionBase) GetStateType() *glib.VariantType { | |
| 399 | 420 | ||
| 400 | 421 | cret := XGActionGetStateType(x.GoPointer()) | |
| @@ -415,10 +436,10 @@ var xActionNameIsValid func(string) bool | |||
| 415 | 436 | // Checks if @action_name is valid. | |
| 416 | 437 | // | |
| 417 | 438 | // @action_name is valid if it consists only of alphanumeric characters, | |
| 418 | - | // plus '-' and '.'. The empty string is not a valid action name. | |
| 439 | + | // plus `-` and `.`. The empty string is not a valid action name. | |
| 419 | 440 | // | |
| 420 | - | // It is an error to call this function with a non-utf8 @action_name. | |
| 421 | - | // @action_name must not be %NULL. | |
| 441 | + | // It is an error to call this function with a non-UTF-8 @action_name. | |
| 442 | + | // @action_name must not be `NULL`. | |
| 422 | 443 | func ActionNameIsValid(ActionNameVar string) bool { | |
| 423 | 444 | ||
| 424 | 445 | cret := xActionNameIsValid(ActionNameVar) | |
| @@ -434,23 +455,29 @@ var xActionParseDetailedName func(string, string, **glib.Variant, **glib.Error) | |||
| 434 | 455 | // | |
| 435 | 456 | // The first format is used to represent an action name with no target | |
| 436 | 457 | // value and consists of just an action name containing no whitespace | |
| 437 | - | // nor the characters ':', '(' or ')'. For example: "app.action". | |
| 458 | + | // nor the characters `:`, `(` or `)`. For example: `app.action`. | |
| 438 | 459 | // | |
| 439 | 460 | // The second format is used to represent an action with a target value | |
| 440 | - | // that is a non-empty string consisting only of alphanumerics, plus '-' | |
| 441 | - | // and '.'. In that case, the action name and target value are | |
| 442 | - | // separated by a double colon ("::"). For example: | |
| 443 | - | // "app.action::target". | |
| 461 | + | // that is a non-empty string consisting only of alphanumerics, plus `-` | |
| 462 | + | // and `.`. In that case, the action name and target value are | |
| 463 | + | // separated by a double colon (`::`). For example: | |
| 464 | + | // `app.action::target`. | |
| 444 | 465 | // | |
| 445 | 466 | // The third format is used to represent an action with any type of | |
| 446 | 467 | // target value, including strings. The target value follows the action | |
| 447 | - | // name, surrounded in parens. For example: "app.action(42)". The | |
| 448 | - | // target value is parsed using g_variant_parse(). If a tuple-typed | |
| 468 | + | // name, surrounded in parens. For example: `app.action(42)`. The | |
| 469 | + | // target value is parsed using [func@GLib.Variant.parse]. If a tuple-typed | |
| 449 | 470 | // value is desired, it must be specified in the same way, resulting in | |
| 450 | - | // two sets of parens, for example: "app.action((1,2,3))". A string | |
| 451 | - | // target can be specified this way as well: "app.action('target')". | |
| 452 | - | // For strings, this third format must be used if * target value is | |
| 453 | - | // empty or contains characters other than alphanumerics, '-' and '.'. | |
| 471 | + | // two sets of parens, for example: `app.action((1,2,3))`. A string | |
| 472 | + | // target can be specified this way as well: `app.action('target')`. | |
| 473 | + | // For strings, this third format must be used if target value is | |
| 474 | + | // empty or contains characters other than alphanumerics, `-` and `.`. | |
| 475 | + | // | |
| 476 | + | // If this function returns `TRUE`, a non-`NULL` value is guaranteed to be returned | |
| 477 | + | // in @action_name (if a pointer is passed in). A `NULL` value may still be | |
| 478 | + | // returned in @target_value, as the @detailed_name may not contain a target. | |
| 479 | + | // | |
| 480 | + | // If returned, the [type@GLib.Variant] in @target_value is guaranteed to not be floating. | |
| 454 | 481 | func ActionParseDetailedName(DetailedNameVar string, ActionNameVar string, TargetValueVar **glib.Variant) (bool, error) { | |
| 455 | 482 | var cerr *glib.Error | |
| 456 | 483 | ||
| @@ -468,7 +495,7 @@ var xActionPrintDetailedName func(string, *glib.Variant) string | |||
| 468 | 495 | // | |
| 469 | 496 | // It is an error to call this function with an invalid action name. | |
| 470 | 497 | // | |
| 471 | - | // This function is the opposite of g_action_parse_detailed_name(). | |
| 498 | + | // This function is the opposite of [func@Gio.Action.parse_detailed_name]. | |
| 472 | 499 | // It will produce a string that can be parsed back to the @action_name | |
| 473 | 500 | // and @target_value by that function. | |
| 474 | 501 | // | |
M v4/gio/gactiongroup.go +109 -82
| @@ -11,7 +11,7 @@ import ( | |||
| 11 | 11 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | 12 | ) | |
| 13 | 13 | ||
| 14 | - | // The virtual function table for #GActionGroup. | |
| 14 | + | // The virtual function table for [type@Gio.ActionGroup]. | |
| 15 | 15 | type ActionGroupInterface struct { | |
| 16 | 16 | _ structs.HostLayout | |
| 17 | 17 | ||
| @@ -51,6 +51,7 @@ func (x *ActionGroupInterface) GoPointer() uintptr { | |||
| 51 | 51 | } | |
| 52 | 52 | ||
| 53 | 53 | // OverrideHasAction sets the callback function. | |
| 54 | + | // the virtual function pointer for [method@Gio.ActionGroup.has_action] | |
| 54 | 55 | func (x *ActionGroupInterface) OverrideHasAction(cb func(ActionGroup, string) bool) { | |
| 55 | 56 | if cb == nil { | |
| 56 | 57 | x.xHasAction = 0 | |
| @@ -62,6 +63,7 @@ func (x *ActionGroupInterface) OverrideHasAction(cb func(ActionGroup, string) bo | |||
| 62 | 63 | } | |
| 63 | 64 | ||
| 64 | 65 | // GetHasAction gets the callback function. | |
| 66 | + | // the virtual function pointer for [method@Gio.ActionGroup.has_action] | |
| 65 | 67 | func (x *ActionGroupInterface) GetHasAction() func(ActionGroup, string) bool { | |
| 66 | 68 | if x.xHasAction == 0 { | |
| 67 | 69 | return nil | |
| @@ -74,6 +76,7 @@ func (x *ActionGroupInterface) GetHasAction() func(ActionGroup, string) bool { | |||
| 74 | 76 | } | |
| 75 | 77 | ||
| 76 | 78 | // OverrideListActions sets the callback function. | |
| 79 | + | // the virtual function pointer for [method@Gio.ActionGroup.list_actions] | |
| 77 | 80 | func (x *ActionGroupInterface) OverrideListActions(cb func(ActionGroup) []string) { | |
| 78 | 81 | if cb == nil { | |
| 79 | 82 | x.xListActions = 0 | |
| @@ -85,6 +88,7 @@ func (x *ActionGroupInterface) OverrideListActions(cb func(ActionGroup) []string | |||
| 85 | 88 | } | |
| 86 | 89 | ||
| 87 | 90 | // GetListActions gets the callback function. | |
| 91 | + | // the virtual function pointer for [method@Gio.ActionGroup.list_actions] | |
| 88 | 92 | func (x *ActionGroupInterface) GetListActions() func(ActionGroup) []string { | |
| 89 | 93 | if x.xListActions == 0 { | |
| 90 | 94 | return nil | |
| @@ -97,6 +101,7 @@ func (x *ActionGroupInterface) GetListActions() func(ActionGroup) []string { | |||
| 97 | 101 | } | |
| 98 | 102 | ||
| 99 | 103 | // OverrideGetActionEnabled sets the callback function. | |
| 104 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_enabled] | |
| 100 | 105 | func (x *ActionGroupInterface) OverrideGetActionEnabled(cb func(ActionGroup, string) bool) { | |
| 101 | 106 | if cb == nil { | |
| 102 | 107 | x.xGetActionEnabled = 0 | |
| @@ -108,6 +113,7 @@ func (x *ActionGroupInterface) OverrideGetActionEnabled(cb func(ActionGroup, str | |||
| 108 | 113 | } | |
| 109 | 114 | ||
| 110 | 115 | // GetGetActionEnabled gets the callback function. | |
| 116 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_enabled] | |
| 111 | 117 | func (x *ActionGroupInterface) GetGetActionEnabled() func(ActionGroup, string) bool { | |
| 112 | 118 | if x.xGetActionEnabled == 0 { | |
| 113 | 119 | return nil | |
| @@ -120,6 +126,7 @@ func (x *ActionGroupInterface) GetGetActionEnabled() func(ActionGroup, string) b | |||
| 120 | 126 | } | |
| 121 | 127 | ||
| 122 | 128 | // OverrideGetActionParameterType sets the callback function. | |
| 129 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_parameter_type] | |
| 123 | 130 | func (x *ActionGroupInterface) OverrideGetActionParameterType(cb func(ActionGroup, string) *glib.VariantType) { | |
| 124 | 131 | if cb == nil { | |
| 125 | 132 | x.xGetActionParameterType = 0 | |
| @@ -131,6 +138,7 @@ func (x *ActionGroupInterface) OverrideGetActionParameterType(cb func(ActionGrou | |||
| 131 | 138 | } | |
| 132 | 139 | ||
| 133 | 140 | // GetGetActionParameterType gets the callback function. | |
| 141 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_parameter_type] | |
| 134 | 142 | func (x *ActionGroupInterface) GetGetActionParameterType() func(ActionGroup, string) *glib.VariantType { | |
| 135 | 143 | if x.xGetActionParameterType == 0 { | |
| 136 | 144 | return nil | |
| @@ -143,6 +151,7 @@ func (x *ActionGroupInterface) GetGetActionParameterType() func(ActionGroup, str | |||
| 143 | 151 | } | |
| 144 | 152 | ||
| 145 | 153 | // OverrideGetActionStateType sets the callback function. | |
| 154 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_type] | |
| 146 | 155 | func (x *ActionGroupInterface) OverrideGetActionStateType(cb func(ActionGroup, string) *glib.VariantType) { | |
| 147 | 156 | if cb == nil { | |
| 148 | 157 | x.xGetActionStateType = 0 | |
| @@ -154,6 +163,7 @@ func (x *ActionGroupInterface) OverrideGetActionStateType(cb func(ActionGroup, s | |||
| 154 | 163 | } | |
| 155 | 164 | ||
| 156 | 165 | // GetGetActionStateType gets the callback function. | |
| 166 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_type] | |
| 157 | 167 | func (x *ActionGroupInterface) GetGetActionStateType() func(ActionGroup, string) *glib.VariantType { | |
| 158 | 168 | if x.xGetActionStateType == 0 { | |
| 159 | 169 | return nil | |
| @@ -166,6 +176,7 @@ func (x *ActionGroupInterface) GetGetActionStateType() func(ActionGroup, string) | |||
| 166 | 176 | } | |
| 167 | 177 | ||
| 168 | 178 | // OverrideGetActionStateHint sets the callback function. | |
| 179 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_hint] | |
| 169 | 180 | func (x *ActionGroupInterface) OverrideGetActionStateHint(cb func(ActionGroup, string) *glib.Variant) { | |
| 170 | 181 | if cb == nil { | |
| 171 | 182 | x.xGetActionStateHint = 0 | |
| @@ -177,6 +188,7 @@ func (x *ActionGroupInterface) OverrideGetActionStateHint(cb func(ActionGroup, s | |||
| 177 | 188 | } | |
| 178 | 189 | ||
| 179 | 190 | // GetGetActionStateHint gets the callback function. | |
| 191 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_state_hint] | |
| 180 | 192 | func (x *ActionGroupInterface) GetGetActionStateHint() func(ActionGroup, string) *glib.Variant { | |
| 181 | 193 | if x.xGetActionStateHint == 0 { | |
| 182 | 194 | return nil | |
| @@ -189,6 +201,7 @@ func (x *ActionGroupInterface) GetGetActionStateHint() func(ActionGroup, string) | |||
| 189 | 201 | } | |
| 190 | 202 | ||
| 191 | 203 | // OverrideGetActionState sets the callback function. | |
| 204 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_state] | |
| 192 | 205 | func (x *ActionGroupInterface) OverrideGetActionState(cb func(ActionGroup, string) *glib.Variant) { | |
| 193 | 206 | if cb == nil { | |
| 194 | 207 | x.xGetActionState = 0 | |
| @@ -200,6 +213,7 @@ func (x *ActionGroupInterface) OverrideGetActionState(cb func(ActionGroup, strin | |||
| 200 | 213 | } | |
| 201 | 214 | ||
| 202 | 215 | // GetGetActionState gets the callback function. | |
| 216 | + | // the virtual function pointer for [method@Gio.ActionGroup.get_action_state] | |
| 203 | 217 | func (x *ActionGroupInterface) GetGetActionState() func(ActionGroup, string) *glib.Variant { | |
| 204 | 218 | if x.xGetActionState == 0 { | |
| 205 | 219 | return nil | |
| @@ -212,6 +226,7 @@ func (x *ActionGroupInterface) GetGetActionState() func(ActionGroup, string) *gl | |||
| 212 | 226 | } | |
| 213 | 227 | ||
| 214 | 228 | // OverrideChangeActionState sets the callback function. | |
| 229 | + | // the virtual function pointer for [method@Gio.ActionGroup.change_action_state] | |
| 215 | 230 | func (x *ActionGroupInterface) OverrideChangeActionState(cb func(ActionGroup, string, *glib.Variant)) { | |
| 216 | 231 | if cb == nil { | |
| 217 | 232 | x.xChangeActionState = 0 | |
| @@ -223,6 +238,7 @@ func (x *ActionGroupInterface) OverrideChangeActionState(cb func(ActionGroup, st | |||
| 223 | 238 | } | |
| 224 | 239 | ||
| 225 | 240 | // GetChangeActionState gets the callback function. | |
| 241 | + | // the virtual function pointer for [method@Gio.ActionGroup.change_action_state] | |
| 226 | 242 | func (x *ActionGroupInterface) GetChangeActionState() func(ActionGroup, string, *glib.Variant) { | |
| 227 | 243 | if x.xChangeActionState == 0 { | |
| 228 | 244 | return nil | |
| @@ -235,6 +251,7 @@ func (x *ActionGroupInterface) GetChangeActionState() func(ActionGroup, string, | |||
| 235 | 251 | } | |
| 236 | 252 | ||
| 237 | 253 | // OverrideActivateAction sets the callback function. | |
| 254 | + | // the virtual function pointer for [method@Gio.ActionGroup.activate_action] | |
| 238 | 255 | func (x *ActionGroupInterface) OverrideActivateAction(cb func(ActionGroup, string, *glib.Variant)) { | |
| 239 | 256 | if cb == nil { | |
| 240 | 257 | x.xActivateAction = 0 | |
| @@ -246,6 +263,7 @@ func (x *ActionGroupInterface) OverrideActivateAction(cb func(ActionGroup, strin | |||
| 246 | 263 | } | |
| 247 | 264 | ||
| 248 | 265 | // GetActivateAction gets the callback function. | |
| 266 | + | // the virtual function pointer for [method@Gio.ActionGroup.activate_action] | |
| 249 | 267 | func (x *ActionGroupInterface) GetActivateAction() func(ActionGroup, string, *glib.Variant) { | |
| 250 | 268 | if x.xActivateAction == 0 { | |
| 251 | 269 | return nil | |
| @@ -258,6 +276,7 @@ func (x *ActionGroupInterface) GetActivateAction() func(ActionGroup, string, *gl | |||
| 258 | 276 | } | |
| 259 | 277 | ||
| 260 | 278 | // OverrideActionAdded sets the callback function. | |
| 279 | + | // the class closure for the [signal@Gio.ActionGroup::action-added] signal | |
| 261 | 280 | func (x *ActionGroupInterface) OverrideActionAdded(cb func(ActionGroup, string)) { | |
| 262 | 281 | if cb == nil { | |
| 263 | 282 | x.xActionAdded = 0 | |
| @@ -269,6 +288,7 @@ func (x *ActionGroupInterface) OverrideActionAdded(cb func(ActionGroup, string)) | |||
| 269 | 288 | } | |
| 270 | 289 | ||
| 271 | 290 | // GetActionAdded gets the callback function. | |
| 291 | + | // the class closure for the [signal@Gio.ActionGroup::action-added] signal | |
| 272 | 292 | func (x *ActionGroupInterface) GetActionAdded() func(ActionGroup, string) { | |
| 273 | 293 | if x.xActionAdded == 0 { | |
| 274 | 294 | return nil | |
| @@ -281,6 +301,7 @@ func (x *ActionGroupInterface) GetActionAdded() func(ActionGroup, string) { | |||
| 281 | 301 | } | |
| 282 | 302 | ||
| 283 | 303 | // OverrideActionRemoved sets the callback function. | |
| 304 | + | // the class closure for the [signal@Gio.ActionGroup::action-removed] signal | |
| 284 | 305 | func (x *ActionGroupInterface) OverrideActionRemoved(cb func(ActionGroup, string)) { | |
| 285 | 306 | if cb == nil { | |
| 286 | 307 | x.xActionRemoved = 0 | |
| @@ -292,6 +313,7 @@ func (x *ActionGroupInterface) OverrideActionRemoved(cb func(ActionGroup, string | |||
| 292 | 313 | } | |
| 293 | 314 | ||
| 294 | 315 | // GetActionRemoved gets the callback function. | |
| 316 | + | // the class closure for the [signal@Gio.ActionGroup::action-removed] signal | |
| 295 | 317 | func (x *ActionGroupInterface) GetActionRemoved() func(ActionGroup, string) { | |
| 296 | 318 | if x.xActionRemoved == 0 { | |
| 297 | 319 | return nil | |
| @@ -304,6 +326,7 @@ func (x *ActionGroupInterface) GetActionRemoved() func(ActionGroup, string) { | |||
| 304 | 326 | } | |
| 305 | 327 | ||
| 306 | 328 | // OverrideActionEnabledChanged sets the callback function. | |
| 329 | + | // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal | |
| 307 | 330 | func (x *ActionGroupInterface) OverrideActionEnabledChanged(cb func(ActionGroup, string, bool)) { | |
| 308 | 331 | if cb == nil { | |
| 309 | 332 | x.xActionEnabledChanged = 0 | |
| @@ -315,6 +338,7 @@ func (x *ActionGroupInterface) OverrideActionEnabledChanged(cb func(ActionGroup, | |||
| 315 | 338 | } | |
| 316 | 339 | ||
| 317 | 340 | // GetActionEnabledChanged gets the callback function. | |
| 341 | + | // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal | |
| 318 | 342 | func (x *ActionGroupInterface) GetActionEnabledChanged() func(ActionGroup, string, bool) { | |
| 319 | 343 | if x.xActionEnabledChanged == 0 { | |
| 320 | 344 | return nil | |
| @@ -327,6 +351,7 @@ func (x *ActionGroupInterface) GetActionEnabledChanged() func(ActionGroup, strin | |||
| 327 | 351 | } | |
| 328 | 352 | ||
| 329 | 353 | // OverrideActionStateChanged sets the callback function. | |
| 354 | + | // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal | |
| 330 | 355 | func (x *ActionGroupInterface) OverrideActionStateChanged(cb func(ActionGroup, string, *glib.Variant)) { | |
| 331 | 356 | if cb == nil { | |
| 332 | 357 | x.xActionStateChanged = 0 | |
| @@ -338,6 +363,7 @@ func (x *ActionGroupInterface) OverrideActionStateChanged(cb func(ActionGroup, s | |||
| 338 | 363 | } | |
| 339 | 364 | ||
| 340 | 365 | // GetActionStateChanged gets the callback function. | |
| 366 | + | // the class closure for the [signal@Gio.ActionGroup::action-enabled-changed] signal | |
| 341 | 367 | func (x *ActionGroupInterface) GetActionStateChanged() func(ActionGroup, string, *glib.Variant) { | |
| 342 | 368 | if x.xActionStateChanged == 0 { | |
| 343 | 369 | return nil | |
| @@ -350,6 +376,7 @@ func (x *ActionGroupInterface) GetActionStateChanged() func(ActionGroup, string, | |||
| 350 | 376 | } | |
| 351 | 377 | ||
| 352 | 378 | // OverrideQueryAction sets the callback function. | |
| 379 | + | // the virtual function pointer for [method@Gio.ActionGroup.query_action] | |
| 353 | 380 | func (x *ActionGroupInterface) OverrideQueryAction(cb func(ActionGroup, string, bool, **glib.VariantType, **glib.VariantType, **glib.Variant, **glib.Variant) bool) { | |
| 354 | 381 | if cb == nil { | |
| 355 | 382 | x.xQueryAction = 0 | |
| @@ -361,6 +388,7 @@ func (x *ActionGroupInterface) OverrideQueryAction(cb func(ActionGroup, string, | |||
| 361 | 388 | } | |
| 362 | 389 | ||
| 363 | 390 | // GetQueryAction gets the callback function. | |
| 391 | + | // the virtual function pointer for [method@Gio.ActionGroup.query_action] | |
| 364 | 392 | func (x *ActionGroupInterface) GetQueryAction() func(ActionGroup, string, bool, **glib.VariantType, **glib.VariantType, **glib.Variant, **glib.Variant) bool { | |
| 365 | 393 | if x.xQueryAction == 0 { | |
| 366 | 394 | return nil | |
| @@ -372,51 +400,50 @@ func (x *ActionGroupInterface) GetQueryAction() func(ActionGroup, string, bool, | |||
| 372 | 400 | } | |
| 373 | 401 | } | |
| 374 | 402 | ||
| 375 | - | // #GActionGroup represents a group of actions. Actions can be used to | |
| 376 | - | // expose functionality in a structured way, either from one part of a | |
| 377 | - | // program to another, or to the outside world. Action groups are often | |
| 378 | - | // used together with a #GMenuModel that provides additional | |
| 379 | - | // representation data for displaying the actions to the user, e.g. in | |
| 380 | - | // a menu. | |
| 403 | + | // `GActionGroup` represents a group of actions. | |
| 381 | 404 | // | |
| 382 | - | // The main way to interact with the actions in a GActionGroup is to | |
| 383 | - | // activate them with g_action_group_activate_action(). Activating an | |
| 384 | - | // action may require a #GVariant parameter. The required type of the | |
| 385 | - | // parameter can be inquired with g_action_group_get_action_parameter_type(). | |
| 386 | - | // Actions may be disabled, see g_action_group_get_action_enabled(). | |
| 405 | + | // Actions can be used to expose functionality in a structured way, either | |
| 406 | + | // from one part of a program to another, or to the outside world. Action | |
| 407 | + | // groups are often used together with a [type@Gio.MenuModel] that provides additional | |
| 408 | + | // representation data for displaying the actions to the user, e.g. in a menu. | |
| 409 | + | // | |
| 410 | + | // The main way to interact with the actions in a `GActionGroup` is to | |
| 411 | + | // activate them with [method@Gio.ActionGroup.activate_action]. Activating an | |
| 412 | + | // action may require a [type@GLib.Variant] parameter. The required type of the | |
| 413 | + | // parameter can be inquired with [method@Gio.ActionGroup.get_action_parameter_type]. | |
| 414 | + | // Actions may be disabled, see [method@Gio.ActionGroup.get_action_enabled]. | |
| 387 | 415 | // Activating a disabled action has no effect. | |
| 388 | 416 | // | |
| 389 | - | // Actions may optionally have a state in the form of a #GVariant. The | |
| 390 | - | // current state of an action can be inquired with | |
| 391 | - | // g_action_group_get_action_state(). Activating a stateful action may | |
| 392 | - | // change its state, but it is also possible to set the state by calling | |
| 393 | - | // g_action_group_change_action_state(). | |
| 417 | + | // Actions may optionally have a state in the form of a [type@GLib.Variant]. The current | |
| 418 | + | // state of an action can be inquired with [method@Gio.ActionGroup.get_action_state]. | |
| 419 | + | // Activating a stateful action may change its state, but it is also possible to | |
| 420 | + | // set the state by calling [method@Gio.ActionGroup.change_action_state]. | |
| 394 | 421 | // | |
| 395 | 422 | // As typical example, consider a text editing application which has an | |
| 396 | - | // option to change the current font to 'bold'. A good way to represent | |
| 423 | + | // option to change the current font to ‘bold’. A good way to represent | |
| 397 | 424 | // this would be a stateful action, with a boolean state. Activating the | |
| 398 | 425 | // action would toggle the state. | |
| 399 | 426 | // | |
| 400 | 427 | // Each action in the group has a unique name (which is a string). All | |
| 401 | - | // method calls, except g_action_group_list_actions() take the name of | |
| 428 | + | // method calls, except [method@Gio.ActionGroup.list_actions] take the name of | |
| 402 | 429 | // an action as an argument. | |
| 403 | 430 | // | |
| 404 | - | // The #GActionGroup API is meant to be the 'public' API to the action | |
| 405 | - | // group. The calls here are exactly the interaction that 'external | |
| 406 | - | // forces' (eg: UI, incoming D-Bus messages, etc.) are supposed to have | |
| 407 | - | // with actions. 'Internal' APIs (ie: ones meant only to be accessed by | |
| 408 | - | // the action group implementation) are found on subclasses. This is | |
| 409 | - | // why you will find - for example - g_action_group_get_action_enabled() | |
| 410 | - | // but not an equivalent set() call. | |
| 431 | + | // The `GActionGroup` API is meant to be the ‘public’ API to the action | |
| 432 | + | // group. The calls here are exactly the interaction that ‘external | |
| 433 | + | // forces’ (eg: UI, incoming D-Bus messages, etc.) are supposed to have | |
| 434 | + | // with actions. ‘Internal’ APIs (ie: ones meant only to be accessed by | |
| 435 | + | // the action group implementation) are found on subclasses. This is | |
| 436 | + | // why you will find – for example – [method@Gio.ActionGroup.get_action_enabled] | |
| 437 | + | // but not an equivalent `set_action_enabled()` method. | |
| 411 | 438 | // | |
| 412 | 439 | // Signals are emitted on the action group in response to state changes | |
| 413 | 440 | // on individual actions. | |
| 414 | 441 | // | |
| 415 | - | // Implementations of #GActionGroup should provide implementations for | |
| 416 | - | // the virtual functions g_action_group_list_actions() and | |
| 417 | - | // g_action_group_query_action(). The other virtual functions should | |
| 418 | - | // not be implemented - their "wrappers" are actually implemented with | |
| 419 | - | // calls to g_action_group_query_action(). | |
| 442 | + | // Implementations of `GActionGroup` should provide implementations for | |
| 443 | + | // the virtual functions [method@Gio.ActionGroup.list_actions] and | |
| 444 | + | // [method@Gio.ActionGroup.query_action]. The other virtual functions should | |
| 445 | + | // not be implemented — their ‘wrappers’ are actually implemented with | |
| 446 | + | // calls to [method@Gio.ActionGroup.query_action]. | |
| 420 | 447 | type ActionGroup interface { | |
| 421 | 448 | GoPointer() uintptr | |
| 422 | 449 | SetGoPointer(uintptr) | |
| @@ -457,36 +484,36 @@ func (x *ActionGroupBase) SetGoPointer(ptr uintptr) { | |||
| 457 | 484 | x.Ptr = ptr | |
| 458 | 485 | } | |
| 459 | 486 | ||
| 460 | - | // Emits the #GActionGroup::action-added signal on @action_group. | |
| 487 | + | // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group. | |
| 461 | 488 | // | |
| 462 | - | // This function should only be called by #GActionGroup implementations. | |
| 489 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 463 | 490 | func (x *ActionGroupBase) ActionAdded(ActionNameVar string) { | |
| 464 | 491 | ||
| 465 | 492 | XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) | |
| 466 | 493 | ||
| 467 | 494 | } | |
| 468 | 495 | ||
| 469 | - | // Emits the #GActionGroup::action-enabled-changed signal on @action_group. | |
| 496 | + | // Emits the [signal@Gio.ActionGroup::action-enabled-changed] signal on @action_group. | |
| 470 | 497 | // | |
| 471 | - | // This function should only be called by #GActionGroup implementations. | |
| 498 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 472 | 499 | func (x *ActionGroupBase) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { | |
| 473 | 500 | ||
| 474 | 501 | XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) | |
| 475 | 502 | ||
| 476 | 503 | } | |
| 477 | 504 | ||
| 478 | - | // Emits the #GActionGroup::action-removed signal on @action_group. | |
| 505 | + | // Emits the [signal@Gio.ActionGroup::action-removed] signal on @action_group. | |
| 479 | 506 | // | |
| 480 | - | // This function should only be called by #GActionGroup implementations. | |
| 507 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 481 | 508 | func (x *ActionGroupBase) ActionRemoved(ActionNameVar string) { | |
| 482 | 509 | ||
| 483 | 510 | XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) | |
| 484 | 511 | ||
| 485 | 512 | } | |
| 486 | 513 | ||
| 487 | - | // Emits the #GActionGroup::action-state-changed signal on @action_group. | |
| 514 | + | // Emits the [signal@Gio.ActionGroup::action-state-changed] signal on @action_group. | |
| 488 | 515 | // | |
| 489 | - | // This function should only be called by #GActionGroup implementations. | |
| 516 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 490 | 517 | func (x *ActionGroupBase) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { | |
| 491 | 518 | ||
| 492 | 519 | XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) | |
| @@ -497,35 +524,35 @@ func (x *ActionGroupBase) ActionStateChanged(ActionNameVar string, StateVar *gli | |||
| 497 | 524 | // | |
| 498 | 525 | // If the action is expecting a parameter, then the correct type of | |
| 499 | 526 | // parameter must be given as @parameter. If the action is expecting no | |
| 500 | - | // parameters then @parameter must be %NULL. See | |
| 501 | - | // g_action_group_get_action_parameter_type(). | |
| 527 | + | // parameters then @parameter must be `NULL`. See | |
| 528 | + | // [method@Gio.ActionGroup.get_action_parameter_type]. | |
| 502 | 529 | // | |
| 503 | - | // If the #GActionGroup implementation supports asynchronous remote | |
| 530 | + | // If the [type@Gio.ActionGroup] implementation supports asynchronous remote | |
| 504 | 531 | // activation over D-Bus, this call may return before the relevant | |
| 505 | 532 | // D-Bus traffic has been sent, or any replies have been received. In | |
| 506 | 533 | // order to block on such asynchronous activation calls, | |
| 507 | - | // g_dbus_connection_flush() should be called prior to the code, which | |
| 534 | + | // [method@Gio.DBusConnection.flush] should be called prior to the code, which | |
| 508 | 535 | // depends on the result of the action activation. Without flushing | |
| 509 | 536 | // the D-Bus connection, there is no guarantee that the action would | |
| 510 | 537 | // have been activated. | |
| 511 | 538 | // | |
| 512 | 539 | // The following code which runs in a remote app instance, shows an | |
| 513 | - | // example of a "quit" action being activated on the primary app | |
| 514 | - | // instance over D-Bus. Here g_dbus_connection_flush() is called | |
| 515 | - | // before `exit()`. Without g_dbus_connection_flush(), the "quit" action | |
| 540 | + | // example of a ‘quit’ action being activated on the primary app | |
| 541 | + | // instance over D-Bus. Here [method@Gio.DBusConnection.flush] is called | |
| 542 | + | // before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action | |
| 516 | 543 | // may fail to be activated on the primary instance. | |
| 517 | 544 | // | |
| 518 | - | // |[<!-- language="C" --> | |
| 519 | - | // // call "quit" action on primary instance | |
| 545 | + | // ```c | |
| 546 | + | // // call ‘quit’ action on primary instance | |
| 520 | 547 | // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); | |
| 521 | 548 | // | |
| 522 | 549 | // // make sure the action is activated now | |
| 523 | - | // g_dbus_connection_flush (...); | |
| 550 | + | // g_dbus_connection_flush (…); | |
| 524 | 551 | // | |
| 525 | - | // g_debug ("application has been terminated. exiting."); | |
| 552 | + | // g_debug ("Application has been terminated. Exiting."); | |
| 526 | 553 | // | |
| 527 | 554 | // exit (0); | |
| 528 | - | // ]| | |
| 555 | + | // ``` | |
| 529 | 556 | func (x *ActionGroupBase) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { | |
| 530 | 557 | ||
| 531 | 558 | XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) | |
| @@ -536,11 +563,11 @@ func (x *ActionGroupBase) ActivateAction(ActionNameVar string, ParameterVar *gli | |||
| 536 | 563 | // changed to @value. | |
| 537 | 564 | // | |
| 538 | 565 | // The action must be stateful and @value must be of the correct type. | |
| 539 | - | // See g_action_group_get_action_state_type(). | |
| 566 | + | // See [method@Gio.ActionGroup.get_action_state_type]. | |
| 540 | 567 | // | |
| 541 | 568 | // This call merely requests a change. The action may refuse to change | |
| 542 | 569 | // its state or may change its state to something other than @value. | |
| 543 | - | // See g_action_group_get_action_state_hint(). | |
| 570 | + | // See [method@Gio.ActionGroup.get_action_state_hint]. | |
| 544 | 571 | // | |
| 545 | 572 | // If the @value GVariant is floating, it is consumed. | |
| 546 | 573 | func (x *ActionGroupBase) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { | |
| @@ -562,12 +589,12 @@ func (x *ActionGroupBase) GetActionEnabled(ActionNameVar string) bool { | |||
| 562 | 589 | // Queries the type of the parameter that must be given when activating | |
| 563 | 590 | // the named action within @action_group. | |
| 564 | 591 | // | |
| 565 | - | // When activating the action using g_action_group_activate_action(), | |
| 566 | - | // the #GVariant given to that function must be of the type returned | |
| 592 | + | // When activating the action using [method@Gio.ActionGroup.activate_action], | |
| 593 | + | // the [type@GLib.Variant] given to that function must be of the type returned | |
| 567 | 594 | // by this function. | |
| 568 | 595 | // | |
| 569 | - | // In the case that this function returns %NULL, you must not give any | |
| 570 | - | // #GVariant, but %NULL instead. | |
| 596 | + | // In the case that this function returns `NULL`, you must not give any | |
| 597 | + | // [type@GLib.Variant], but `NULL` instead. | |
| 571 | 598 | // | |
| 572 | 599 | // The parameter type of a particular action will never change but it is | |
| 573 | 600 | // possible for an action to be removed and for a new action to be added | |
| @@ -580,12 +607,12 @@ func (x *ActionGroupBase) GetActionParameterType(ActionNameVar string) *glib.Var | |||
| 580 | 607 | ||
| 581 | 608 | // Queries the current state of the named action within @action_group. | |
| 582 | 609 | // | |
| 583 | - | // If the action is not stateful then %NULL will be returned. If the | |
| 610 | + | // If the action is not stateful then `NULL` will be returned. If the | |
| 584 | 611 | // action is stateful then the type of the return value is the type | |
| 585 | - | // given by g_action_group_get_action_state_type(). | |
| 612 | + | // given by [method@Gio.ActionGroup.get_action_state_type]. | |
| 586 | 613 | // | |
| 587 | - | // The return value (if non-%NULL) should be freed with | |
| 588 | - | // g_variant_unref() when it is no longer required. | |
| 614 | + | // The return value (if non-`NULL`) should be freed with | |
| 615 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 589 | 616 | func (x *ActionGroupBase) GetActionState(ActionNameVar string) *glib.Variant { | |
| 590 | 617 | ||
| 591 | 618 | cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| @@ -595,12 +622,12 @@ func (x *ActionGroupBase) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 595 | 622 | // Requests a hint about the valid range of values for the state of the | |
| 596 | 623 | // named action within @action_group. | |
| 597 | 624 | // | |
| 598 | - | // If %NULL is returned it either means that the action is not stateful | |
| 625 | + | // If `NULL` is returned it either means that the action is not stateful | |
| 599 | 626 | // or that there is no hint about the valid range of values for the | |
| 600 | 627 | // state of the action. | |
| 601 | 628 | // | |
| 602 | - | // If a #GVariant array is returned then each item in the array is a | |
| 603 | - | // possible value for the state. If a #GVariant pair (ie: two-tuple) is | |
| 629 | + | // If a [type@GLib.Variant] array is returned then each item in the array is a | |
| 630 | + | // possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is | |
| 604 | 631 | // returned then the tuple specifies the inclusive lower and upper bound | |
| 605 | 632 | // of valid values for the state. | |
| 606 | 633 | // | |
| @@ -608,8 +635,8 @@ func (x *ActionGroupBase) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 608 | 635 | // have a state value outside of the hinted range and setting a value | |
| 609 | 636 | // within the range may fail. | |
| 610 | 637 | // | |
| 611 | - | // The return value (if non-%NULL) should be freed with | |
| 612 | - | // g_variant_unref() when it is no longer required. | |
| 638 | + | // The return value (if non-`NULL`) should be freed with | |
| 639 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 613 | 640 | func (x *ActionGroupBase) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 614 | 641 | ||
| 615 | 642 | cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| @@ -620,14 +647,14 @@ func (x *ActionGroupBase) GetActionStateHint(ActionNameVar string) *glib.Variant | |||
| 620 | 647 | // @action_group. | |
| 621 | 648 | // | |
| 622 | 649 | // If the action is stateful then this function returns the | |
| 623 | - | // #GVariantType of the state. All calls to | |
| 624 | - | // g_action_group_change_action_state() must give a #GVariant of this | |
| 625 | - | // type and g_action_group_get_action_state() will return a #GVariant | |
| 650 | + | // [type@GLib.VariantType] of the state. All calls to | |
| 651 | + | // [method@Gio.ActionGroup.change_action_state] must give a [type@GLib.Variant] of this | |
| 652 | + | // type and [method@Gio.ActionGroup.get_action_state] will return a [type@GLib.Variant] | |
| 626 | 653 | // of the same type. | |
| 627 | 654 | // | |
| 628 | - | // If the action is not stateful then this function will return %NULL. | |
| 629 | - | // In that case, g_action_group_get_action_state() will return %NULL | |
| 630 | - | // and you must not call g_action_group_change_action_state(). | |
| 655 | + | // If the action is not stateful then this function will return `NULL`. | |
| 656 | + | // In that case, [method@Gio.ActionGroup.get_action_state] will return `NULL` | |
| 657 | + | // and you must not call [method@Gio.ActionGroup.change_action_state]. | |
| 631 | 658 | // | |
| 632 | 659 | // The state type of a particular action will never change but it is | |
| 633 | 660 | // possible for an action to be removed and for a new action to be added | |
| @@ -647,7 +674,7 @@ func (x *ActionGroupBase) HasAction(ActionNameVar string) bool { | |||
| 647 | 674 | ||
| 648 | 675 | // Lists the actions contained within @action_group. | |
| 649 | 676 | // | |
| 650 | - | // The caller is responsible for freeing the list with g_strfreev() when | |
| 677 | + | // The caller is responsible for freeing the list with [func@GLib.strfreev] when | |
| 651 | 678 | // it is no longer required. | |
| 652 | 679 | func (x *ActionGroupBase) ListActions() []string { | |
| 653 | 680 | ||
| @@ -658,18 +685,18 @@ func (x *ActionGroupBase) ListActions() []string { | |||
| 658 | 685 | // Queries all aspects of the named action within an @action_group. | |
| 659 | 686 | // | |
| 660 | 687 | // This function acquires the information available from | |
| 661 | - | // g_action_group_has_action(), g_action_group_get_action_enabled(), | |
| 662 | - | // g_action_group_get_action_parameter_type(), | |
| 663 | - | // g_action_group_get_action_state_type(), | |
| 664 | - | // g_action_group_get_action_state_hint() and | |
| 665 | - | // g_action_group_get_action_state() with a single function call. | |
| 688 | + | // [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled], | |
| 689 | + | // [method@Gio.ActionGroup.get_action_parameter_type], | |
| 690 | + | // [method@Gio.ActionGroup.get_action_state_type], | |
| 691 | + | // [method@Gio.ActionGroup.get_action_state_hint] and | |
| 692 | + | // [method@Gio.ActionGroup.get_action_state] with a single function call. | |
| 666 | 693 | // | |
| 667 | 694 | // This provides two main benefits. | |
| 668 | 695 | // | |
| 669 | 696 | // The first is the improvement in efficiency that comes with not having | |
| 670 | 697 | // to perform repeated lookups of the action in order to discover | |
| 671 | 698 | // different things about it. The second is that implementing | |
| 672 | - | // #GActionGroup can now be done by only overriding this one virtual | |
| 699 | + | // [type@Gio.ActionGroup] can now be done by only overriding this one virtual | |
| 673 | 700 | // function. | |
| 674 | 701 | // | |
| 675 | 702 | // The interface provides a default implementation of this function that | |
| @@ -678,9 +705,9 @@ func (x *ActionGroupBase) ListActions() []string { | |||
| 678 | 705 | // those functions that call this function. All implementations, | |
| 679 | 706 | // therefore, must override either this function or all of the others. | |
| 680 | 707 | // | |
| 681 | - | // If the action exists, %TRUE is returned and any of the requested | |
| 682 | - | // fields (as indicated by having a non-%NULL reference passed in) are | |
| 683 | - | // filled. If the action doesn't exist, %FALSE is returned and the | |
| 708 | + | // If the action exists, `TRUE` is returned and any of the requested | |
| 709 | + | // fields (as indicated by having a non-`NULL` reference passed in) are | |
| 710 | + | // filled. If the action doesn’t exist, `FALSE` is returned and the | |
| 684 | 711 | // fields may or may not have been modified. | |
| 685 | 712 | func (x *ActionGroupBase) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 686 | 713 | ||
M v4/gio/gactionmap.go +90 -14
| @@ -13,15 +13,15 @@ import ( | |||
| 13 | 13 | ) | |
| 14 | 14 | ||
| 15 | 15 | // This struct defines a single action. It is for use with | |
| 16 | - | // g_action_map_add_action_entries(). | |
| 16 | + | // [method@Gio.ActionMap.add_action_entries]. | |
| 17 | 17 | // | |
| 18 | 18 | // The order of the items in the structure are intended to reflect | |
| 19 | 19 | // frequency of use. It is permissible to use an incomplete initialiser | |
| 20 | - | // in order to leave some of the later values as %NULL. All values | |
| 20 | + | // in order to leave some of the later values as `NULL`. All values | |
| 21 | 21 | // after @name are optional. Additional optional fields may be added in | |
| 22 | 22 | // the future. | |
| 23 | 23 | // | |
| 24 | - | // See g_action_map_add_action_entries() for an example. | |
| 24 | + | // See [method@Gio.ActionMap.add_action_entries] for an example. | |
| 25 | 25 | type ActionEntry struct { | |
| 26 | 26 | _ structs.HostLayout | |
| 27 | 27 | ||
| @@ -43,6 +43,13 @@ func (x *ActionEntry) GoPointer() uintptr { | |||
| 43 | 43 | } | |
| 44 | 44 | ||
| 45 | 45 | // OverrideActivate sets the callback function. | |
| 46 | + | // the callback to connect to the "activate" signal of the action. | |
| 47 | + | // | |
| 48 | + | // Since GLib 2.40, this can be `NULL` for stateful actions, in which case | |
| 49 | + | // the default handler is used. For boolean-stated actions with no | |
| 50 | + | // parameter, this is a toggle. For other state types (and parameter type | |
| 51 | + | // equal to the state type) this will be a function that just calls | |
| 52 | + | // @change_state (which you should provide). | |
| 46 | 53 | func (x *ActionEntry) OverrideActivate(cb func(*SimpleAction, *glib.Variant, uintptr)) { | |
| 47 | 54 | if cb == nil { | |
| 48 | 55 | x.xActivate = 0 | |
| @@ -54,6 +61,13 @@ func (x *ActionEntry) OverrideActivate(cb func(*SimpleAction, *glib.Variant, uin | |||
| 54 | 61 | } | |
| 55 | 62 | ||
| 56 | 63 | // GetActivate gets the callback function. | |
| 64 | + | // the callback to connect to the "activate" signal of the action. | |
| 65 | + | // | |
| 66 | + | // Since GLib 2.40, this can be `NULL` for stateful actions, in which case | |
| 67 | + | // the default handler is used. For boolean-stated actions with no | |
| 68 | + | // parameter, this is a toggle. For other state types (and parameter type | |
| 69 | + | // equal to the state type) this will be a function that just calls | |
| 70 | + | // @change_state (which you should provide). | |
| 57 | 71 | func (x *ActionEntry) GetActivate() func(*SimpleAction, *glib.Variant, uintptr) { | |
| 58 | 72 | if x.xActivate == 0 { | |
| 59 | 73 | return nil | |
| @@ -66,6 +80,10 @@ func (x *ActionEntry) GetActivate() func(*SimpleAction, *glib.Variant, uintptr) | |||
| 66 | 80 | } | |
| 67 | 81 | ||
| 68 | 82 | // OverrideChangeState sets the callback function. | |
| 83 | + | // the callback to connect to the "change-state" signal of the | |
| 84 | + | // | |
| 85 | + | // action. All stateful actions should provide a handler here; stateless | |
| 86 | + | // actions should not. | |
| 69 | 87 | func (x *ActionEntry) OverrideChangeState(cb func(*SimpleAction, *glib.Variant, uintptr)) { | |
| 70 | 88 | if cb == nil { | |
| 71 | 89 | x.xChangeState = 0 | |
| @@ -77,6 +95,10 @@ func (x *ActionEntry) OverrideChangeState(cb func(*SimpleAction, *glib.Variant, | |||
| 77 | 95 | } | |
| 78 | 96 | ||
| 79 | 97 | // GetChangeState gets the callback function. | |
| 98 | + | // the callback to connect to the "change-state" signal of the | |
| 99 | + | // | |
| 100 | + | // action. All stateful actions should provide a handler here; stateless | |
| 101 | + | // actions should not. | |
| 80 | 102 | func (x *ActionEntry) GetChangeState() func(*SimpleAction, *glib.Variant, uintptr) { | |
| 81 | 103 | if x.xChangeState == 0 { | |
| 82 | 104 | return nil | |
| @@ -88,7 +110,7 @@ func (x *ActionEntry) GetChangeState() func(*SimpleAction, *glib.Variant, uintpt | |||
| 88 | 110 | } | |
| 89 | 111 | } | |
| 90 | 112 | ||
| 91 | - | // The virtual function table for #GActionMap. | |
| 113 | + | // The virtual function table for [iface@Gio.ActionMap]. | |
| 92 | 114 | type ActionMapInterface struct { | |
| 93 | 115 | _ structs.HostLayout | |
| 94 | 116 | ||
| @@ -106,6 +128,9 @@ func (x *ActionMapInterface) GoPointer() uintptr { | |||
| 106 | 128 | } | |
| 107 | 129 | ||
| 108 | 130 | // OverrideLookupAction sets the callback function. | |
| 131 | + | // the virtual function pointer for | |
| 132 | + | // | |
| 133 | + | // [method@Gio.ActionMap.lookup_action] | |
| 109 | 134 | func (x *ActionMapInterface) OverrideLookupAction(cb func(ActionMap, string) *ActionBase) { | |
| 110 | 135 | if cb == nil { | |
| 111 | 136 | x.xLookupAction = 0 | |
| @@ -121,6 +146,9 @@ func (x *ActionMapInterface) OverrideLookupAction(cb func(ActionMap, string) *Ac | |||
| 121 | 146 | } | |
| 122 | 147 | ||
| 123 | 148 | // GetLookupAction gets the callback function. | |
| 149 | + | // the virtual function pointer for | |
| 150 | + | // | |
| 151 | + | // [method@Gio.ActionMap.lookup_action] | |
| 124 | 152 | func (x *ActionMapInterface) GetLookupAction() func(ActionMap, string) *ActionBase { | |
| 125 | 153 | if x.xLookupAction == 0 { | |
| 126 | 154 | return nil | |
| @@ -139,6 +167,9 @@ func (x *ActionMapInterface) GetLookupAction() func(ActionMap, string) *ActionBa | |||
| 139 | 167 | } | |
| 140 | 168 | ||
| 141 | 169 | // OverrideAddAction sets the callback function. | |
| 170 | + | // the virtual function pointer for | |
| 171 | + | // | |
| 172 | + | // [method@Gio.ActionMap.add_action] | |
| 142 | 173 | func (x *ActionMapInterface) OverrideAddAction(cb func(ActionMap, Action)) { | |
| 143 | 174 | if cb == nil { | |
| 144 | 175 | x.xAddAction = 0 | |
| @@ -150,6 +181,9 @@ func (x *ActionMapInterface) OverrideAddAction(cb func(ActionMap, Action)) { | |||
| 150 | 181 | } | |
| 151 | 182 | ||
| 152 | 183 | // GetAddAction gets the callback function. | |
| 184 | + | // the virtual function pointer for | |
| 185 | + | // | |
| 186 | + | // [method@Gio.ActionMap.add_action] | |
| 153 | 187 | func (x *ActionMapInterface) GetAddAction() func(ActionMap, Action) { | |
| 154 | 188 | if x.xAddAction == 0 { | |
| 155 | 189 | return nil | |
| @@ -162,6 +196,9 @@ func (x *ActionMapInterface) GetAddAction() func(ActionMap, Action) { | |||
| 162 | 196 | } | |
| 163 | 197 | ||
| 164 | 198 | // OverrideRemoveAction sets the callback function. | |
| 199 | + | // the virtual function pointer for | |
| 200 | + | // | |
| 201 | + | // [method@Gio.ActionMap.remove_action] | |
| 165 | 202 | func (x *ActionMapInterface) OverrideRemoveAction(cb func(ActionMap, string)) { | |
| 166 | 203 | if cb == nil { | |
| 167 | 204 | x.xRemoveAction = 0 | |
| @@ -173,6 +210,9 @@ func (x *ActionMapInterface) OverrideRemoveAction(cb func(ActionMap, string)) { | |||
| 173 | 210 | } | |
| 174 | 211 | ||
| 175 | 212 | // GetRemoveAction gets the callback function. | |
| 213 | + | // the virtual function pointer for | |
| 214 | + | // | |
| 215 | + | // [method@Gio.ActionMap.remove_action] | |
| 176 | 216 | func (x *ActionMapInterface) GetRemoveAction() func(ActionMap, string) { | |
| 177 | 217 | if x.xRemoveAction == 0 { | |
| 178 | 218 | return nil | |
| @@ -184,14 +224,16 @@ func (x *ActionMapInterface) GetRemoveAction() func(ActionMap, string) { | |||
| 184 | 224 | } | |
| 185 | 225 | } | |
| 186 | 226 | ||
| 187 | - | // The GActionMap interface is implemented by #GActionGroup | |
| 188 | - | // implementations that operate by containing a number of | |
| 189 | - | // named #GAction instances, such as #GSimpleActionGroup. | |
| 227 | + | // `GActionMap` is an interface for action containers. | |
| 228 | + | // | |
| 229 | + | // The `GActionMap` interface is implemented by [iface@Gio.ActionGroup] | |
| 230 | + | // implementations that operate by containing a number of named | |
| 231 | + | // [iface@Gio.Action] instances, such as [class@Gio.SimpleActionGroup]. | |
| 190 | 232 | // | |
| 191 | 233 | // One useful application of this interface is to map the | |
| 192 | 234 | // names of actions from various action groups to unique, | |
| 193 | 235 | // prefixed names (e.g. by prepending "app." or "win."). | |
| 194 | - | // This is the motivation for the 'Map' part of the interface | |
| 236 | + | // This is the motivation for the ‘Map’ part of the interface | |
| 195 | 237 | // name. | |
| 196 | 238 | type ActionMap interface { | |
| 197 | 239 | GoPointer() uintptr | |
| @@ -200,6 +242,7 @@ type ActionMap interface { | |||
| 200 | 242 | AddActionEntries(EntriesVar []ActionEntry, NEntriesVar int, UserDataVar uintptr) | |
| 201 | 243 | LookupAction(ActionNameVar string) *ActionBase | |
| 202 | 244 | RemoveAction(ActionNameVar string) | |
| 245 | + | RemoveActionEntries(EntriesVar []ActionEntry, NEntriesVar int) | |
| 203 | 246 | } | |
| 204 | 247 | ||
| 205 | 248 | var xActionMapGLibType func() types.GType | |
| @@ -235,12 +278,12 @@ func (x *ActionMapBase) AddAction(ActionVar Action) { | |||
| 235 | 278 | ||
| 236 | 279 | } | |
| 237 | 280 | ||
| 238 | - | // A convenience function for creating multiple #GSimpleAction instances | |
| 239 | - | // and adding them to a #GActionMap. | |
| 281 | + | // A convenience function for creating multiple [class@Gio.SimpleAction] | |
| 282 | + | // instances and adding them to a [iface@Gio.ActionMap]. | |
| 240 | 283 | // | |
| 241 | - | // Each action is constructed as per one #GActionEntry. | |
| 284 | + | // Each action is constructed as per one [struct@Gio.ActionEntry]. | |
| 242 | 285 | // | |
| 243 | - | // |[<!-- language="C" --> | |
| 286 | + | // ```c | |
| 244 | 287 | // static void | |
| 245 | 288 | // activate_quit (GSimpleAction *simple, | |
| 246 | 289 | // | |
| @@ -277,7 +320,7 @@ func (x *ActionMapBase) AddAction(ActionVar Action) { | |||
| 277 | 320 | // return G_ACTION_GROUP (group); | |
| 278 | 321 | // } | |
| 279 | 322 | // | |
| 280 | - | // ]| | |
| 323 | + | // ``` | |
| 281 | 324 | func (x *ActionMapBase) AddActionEntries(EntriesVar []ActionEntry, NEntriesVar int, UserDataVar uintptr) { | |
| 282 | 325 | ||
| 283 | 326 | XGActionMapAddActionEntries(x.GoPointer(), EntriesVar, NEntriesVar, UserDataVar) | |
| @@ -286,7 +329,7 @@ func (x *ActionMapBase) AddActionEntries(EntriesVar []ActionEntry, NEntriesVar i | |||
| 286 | 329 | ||
| 287 | 330 | // Looks up the action with the name @action_name in @action_map. | |
| 288 | 331 | // | |
| 289 | - | // If no such action exists, returns %NULL. | |
| 332 | + | // If no such action exists, returns `NULL`. | |
| 290 | 333 | func (x *ActionMapBase) LookupAction(ActionNameVar string) *ActionBase { | |
| 291 | 334 | var cls *ActionBase | |
| 292 | 335 | ||
| @@ -310,10 +353,42 @@ func (x *ActionMapBase) RemoveAction(ActionNameVar string) { | |||
| 310 | 353 | ||
| 311 | 354 | } | |
| 312 | 355 | ||
| 356 | + | // Remove actions from a [iface@Gio.ActionMap]. This is meant as the reverse of | |
| 357 | + | // [method@Gio.ActionMap.add_action_entries]. | |
| 358 | + | // | |
| 359 | + | // ```c | |
| 360 | + | // | |
| 361 | + | // static const GActionEntry entries[] = { | |
| 362 | + | // { "quit", activate_quit }, | |
| 363 | + | // { "print-string", activate_print_string, "s" } | |
| 364 | + | // }; | |
| 365 | + | // | |
| 366 | + | // void | |
| 367 | + | // add_actions (GActionMap *map) | |
| 368 | + | // | |
| 369 | + | // { | |
| 370 | + | // g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL); | |
| 371 | + | // } | |
| 372 | + | // | |
| 373 | + | // void | |
| 374 | + | // remove_actions (GActionMap *map) | |
| 375 | + | // | |
| 376 | + | // { | |
| 377 | + | // g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries)); | |
| 378 | + | // } | |
| 379 | + | // | |
| 380 | + | // ``` | |
| 381 | + | func (x *ActionMapBase) RemoveActionEntries(EntriesVar []ActionEntry, NEntriesVar int) { | |
| 382 | + | ||
| 383 | + | XGActionMapRemoveActionEntries(x.GoPointer(), EntriesVar, NEntriesVar) | |
| 384 | + | ||
| 385 | + | } | |
| 386 | + | ||
| 313 | 387 | var XGActionMapAddAction func(uintptr, uintptr) | |
| 314 | 388 | var XGActionMapAddActionEntries func(uintptr, []ActionEntry, int, uintptr) | |
| 315 | 389 | var XGActionMapLookupAction func(uintptr, string) uintptr | |
| 316 | 390 | var XGActionMapRemoveAction func(uintptr, string) | |
| 391 | + | var XGActionMapRemoveActionEntries func(uintptr, []ActionEntry, int) | |
| 317 | 392 | ||
| 318 | 393 | func init() { | |
| 319 | 394 | core.SetPackageName("GIO", "gio-2.0") | |
| @@ -329,5 +404,6 @@ func init() { | |||
| 329 | 404 | core.PuregoSafeRegister(&XGActionMapAddActionEntries, lib, "g_action_map_add_action_entries") | |
| 330 | 405 | core.PuregoSafeRegister(&XGActionMapLookupAction, lib, "g_action_map_lookup_action") | |
| 331 | 406 | core.PuregoSafeRegister(&XGActionMapRemoveAction, lib, "g_action_map_remove_action") | |
| 407 | + | core.PuregoSafeRegister(&XGActionMapRemoveActionEntries, lib, "g_action_map_remove_action_entries") | |
| 332 | 408 | ||
| 333 | 409 | } | |
M v4/gio/gappinfo.go +478 -119
| @@ -74,6 +74,7 @@ func (x *AppInfoIface) GoPointer() uintptr { | |||
| 74 | 74 | } | |
| 75 | 75 | ||
| 76 | 76 | // OverrideDup sets the callback function. | |
| 77 | + | // Copies a [iface@Gio.AppInfo]. | |
| 77 | 78 | func (x *AppInfoIface) OverrideDup(cb func(AppInfo) *AppInfoBase) { | |
| 78 | 79 | if cb == nil { | |
| 79 | 80 | x.xDup = 0 | |
| @@ -89,6 +90,7 @@ func (x *AppInfoIface) OverrideDup(cb func(AppInfo) *AppInfoBase) { | |||
| 89 | 90 | } | |
| 90 | 91 | ||
| 91 | 92 | // GetDup gets the callback function. | |
| 93 | + | // Copies a [iface@Gio.AppInfo]. | |
| 92 | 94 | func (x *AppInfoIface) GetDup() func(AppInfo) *AppInfoBase { | |
| 93 | 95 | if x.xDup == 0 { | |
| 94 | 96 | return nil | |
| @@ -107,6 +109,7 @@ func (x *AppInfoIface) GetDup() func(AppInfo) *AppInfoBase { | |||
| 107 | 109 | } | |
| 108 | 110 | ||
| 109 | 111 | // OverrideEqual sets the callback function. | |
| 112 | + | // Checks two [iface@Gio.AppInfo]s for equality. | |
| 110 | 113 | func (x *AppInfoIface) OverrideEqual(cb func(AppInfo, AppInfo) bool) { | |
| 111 | 114 | if cb == nil { | |
| 112 | 115 | x.xEqual = 0 | |
| @@ -118,6 +121,7 @@ func (x *AppInfoIface) OverrideEqual(cb func(AppInfo, AppInfo) bool) { | |||
| 118 | 121 | } | |
| 119 | 122 | ||
| 120 | 123 | // GetEqual gets the callback function. | |
| 124 | + | // Checks two [iface@Gio.AppInfo]s for equality. | |
| 121 | 125 | func (x *AppInfoIface) GetEqual() func(AppInfo, AppInfo) bool { | |
| 122 | 126 | if x.xEqual == 0 { | |
| 123 | 127 | return nil | |
| @@ -130,6 +134,7 @@ func (x *AppInfoIface) GetEqual() func(AppInfo, AppInfo) bool { | |||
| 130 | 134 | } | |
| 131 | 135 | ||
| 132 | 136 | // OverrideGetId sets the callback function. | |
| 137 | + | // Gets a string identifier for a [iface@Gio.AppInfo]. | |
| 133 | 138 | func (x *AppInfoIface) OverrideGetId(cb func(AppInfo) string) { | |
| 134 | 139 | if cb == nil { | |
| 135 | 140 | x.xGetId = 0 | |
| @@ -141,6 +146,7 @@ func (x *AppInfoIface) OverrideGetId(cb func(AppInfo) string) { | |||
| 141 | 146 | } | |
| 142 | 147 | ||
| 143 | 148 | // GetGetId gets the callback function. | |
| 149 | + | // Gets a string identifier for a [iface@Gio.AppInfo]. | |
| 144 | 150 | func (x *AppInfoIface) GetGetId() func(AppInfo) string { | |
| 145 | 151 | if x.xGetId == 0 { | |
| 146 | 152 | return nil | |
| @@ -153,6 +159,7 @@ func (x *AppInfoIface) GetGetId() func(AppInfo) string { | |||
| 153 | 159 | } | |
| 154 | 160 | ||
| 155 | 161 | // OverrideGetName sets the callback function. | |
| 162 | + | // Gets the name of the application for a [iface@Gio.AppInfo]. | |
| 156 | 163 | func (x *AppInfoIface) OverrideGetName(cb func(AppInfo) string) { | |
| 157 | 164 | if cb == nil { | |
| 158 | 165 | x.xGetName = 0 | |
| @@ -164,6 +171,7 @@ func (x *AppInfoIface) OverrideGetName(cb func(AppInfo) string) { | |||
| 164 | 171 | } | |
| 165 | 172 | ||
| 166 | 173 | // GetGetName gets the callback function. | |
| 174 | + | // Gets the name of the application for a [iface@Gio.AppInfo]. | |
| 167 | 175 | func (x *AppInfoIface) GetGetName() func(AppInfo) string { | |
| 168 | 176 | if x.xGetName == 0 { | |
| 169 | 177 | return nil | |
| @@ -176,6 +184,9 @@ func (x *AppInfoIface) GetGetName() func(AppInfo) string { | |||
| 176 | 184 | } | |
| 177 | 185 | ||
| 178 | 186 | // OverrideGetDescription sets the callback function. | |
| 187 | + | // Gets a short description for the application described by | |
| 188 | + | // | |
| 189 | + | // the [iface@Gio.AppInfo]. | |
| 179 | 190 | func (x *AppInfoIface) OverrideGetDescription(cb func(AppInfo) string) { | |
| 180 | 191 | if cb == nil { | |
| 181 | 192 | x.xGetDescription = 0 | |
| @@ -187,6 +198,9 @@ func (x *AppInfoIface) OverrideGetDescription(cb func(AppInfo) string) { | |||
| 187 | 198 | } | |
| 188 | 199 | ||
| 189 | 200 | // GetGetDescription gets the callback function. | |
| 201 | + | // Gets a short description for the application described by | |
| 202 | + | // | |
| 203 | + | // the [iface@Gio.AppInfo]. | |
| 190 | 204 | func (x *AppInfoIface) GetGetDescription() func(AppInfo) string { | |
| 191 | 205 | if x.xGetDescription == 0 { | |
| 192 | 206 | return nil | |
| @@ -199,6 +213,7 @@ func (x *AppInfoIface) GetGetDescription() func(AppInfo) string { | |||
| 199 | 213 | } | |
| 200 | 214 | ||
| 201 | 215 | // OverrideGetExecutable sets the callback function. | |
| 216 | + | // Gets the executable name for the [iface@Gio.AppInfo]. | |
| 202 | 217 | func (x *AppInfoIface) OverrideGetExecutable(cb func(AppInfo) string) { | |
| 203 | 218 | if cb == nil { | |
| 204 | 219 | x.xGetExecutable = 0 | |
| @@ -210,6 +225,7 @@ func (x *AppInfoIface) OverrideGetExecutable(cb func(AppInfo) string) { | |||
| 210 | 225 | } | |
| 211 | 226 | ||
| 212 | 227 | // GetGetExecutable gets the callback function. | |
| 228 | + | // Gets the executable name for the [iface@Gio.AppInfo]. | |
| 213 | 229 | func (x *AppInfoIface) GetGetExecutable() func(AppInfo) string { | |
| 214 | 230 | if x.xGetExecutable == 0 { | |
| 215 | 231 | return nil | |
| @@ -222,6 +238,7 @@ func (x *AppInfoIface) GetGetExecutable() func(AppInfo) string { | |||
| 222 | 238 | } | |
| 223 | 239 | ||
| 224 | 240 | // OverrideGetIcon sets the callback function. | |
| 241 | + | // Gets the [iface@Gio.Icon] for the [iface@Gio.AppInfo]. | |
| 225 | 242 | func (x *AppInfoIface) OverrideGetIcon(cb func(AppInfo) *IconBase) { | |
| 226 | 243 | if cb == nil { | |
| 227 | 244 | x.xGetIcon = 0 | |
| @@ -237,6 +254,7 @@ func (x *AppInfoIface) OverrideGetIcon(cb func(AppInfo) *IconBase) { | |||
| 237 | 254 | } | |
| 238 | 255 | ||
| 239 | 256 | // GetGetIcon gets the callback function. | |
| 257 | + | // Gets the [iface@Gio.Icon] for the [iface@Gio.AppInfo]. | |
| 240 | 258 | func (x *AppInfoIface) GetGetIcon() func(AppInfo) *IconBase { | |
| 241 | 259 | if x.xGetIcon == 0 { | |
| 242 | 260 | return nil | |
| @@ -255,6 +273,7 @@ func (x *AppInfoIface) GetGetIcon() func(AppInfo) *IconBase { | |||
| 255 | 273 | } | |
| 256 | 274 | ||
| 257 | 275 | // OverrideLaunch sets the callback function. | |
| 276 | + | // Launches an application specified by the [iface@Gio.AppInfo]. | |
| 258 | 277 | func (x *AppInfoIface) OverrideLaunch(cb func(AppInfo, *glib.List, *AppLaunchContext) bool) { | |
| 259 | 278 | if cb == nil { | |
| 260 | 279 | x.xLaunch = 0 | |
| @@ -266,6 +285,7 @@ func (x *AppInfoIface) OverrideLaunch(cb func(AppInfo, *glib.List, *AppLaunchCon | |||
| 266 | 285 | } | |
| 267 | 286 | ||
| 268 | 287 | // GetLaunch gets the callback function. | |
| 288 | + | // Launches an application specified by the [iface@Gio.AppInfo]. | |
| 269 | 289 | func (x *AppInfoIface) GetLaunch() func(AppInfo, *glib.List, *AppLaunchContext) bool { | |
| 270 | 290 | if x.xLaunch == 0 { | |
| 271 | 291 | return nil | |
| @@ -278,6 +298,9 @@ func (x *AppInfoIface) GetLaunch() func(AppInfo, *glib.List, *AppLaunchContext) | |||
| 278 | 298 | } | |
| 279 | 299 | ||
| 280 | 300 | // OverrideSupportsUris sets the callback function. | |
| 301 | + | // Indicates whether the application specified supports | |
| 302 | + | // | |
| 303 | + | // launching URIs. | |
| 281 | 304 | func (x *AppInfoIface) OverrideSupportsUris(cb func(AppInfo) bool) { | |
| 282 | 305 | if cb == nil { | |
| 283 | 306 | x.xSupportsUris = 0 | |
| @@ -289,6 +312,9 @@ func (x *AppInfoIface) OverrideSupportsUris(cb func(AppInfo) bool) { | |||
| 289 | 312 | } | |
| 290 | 313 | ||
| 291 | 314 | // GetSupportsUris gets the callback function. | |
| 315 | + | // Indicates whether the application specified supports | |
| 316 | + | // | |
| 317 | + | // launching URIs. | |
| 292 | 318 | func (x *AppInfoIface) GetSupportsUris() func(AppInfo) bool { | |
| 293 | 319 | if x.xSupportsUris == 0 { | |
| 294 | 320 | return nil | |
| @@ -301,6 +327,9 @@ func (x *AppInfoIface) GetSupportsUris() func(AppInfo) bool { | |||
| 301 | 327 | } | |
| 302 | 328 | ||
| 303 | 329 | // OverrideSupportsFiles sets the callback function. | |
| 330 | + | // Indicates whether the application specified accepts | |
| 331 | + | // | |
| 332 | + | // filename arguments. | |
| 304 | 333 | func (x *AppInfoIface) OverrideSupportsFiles(cb func(AppInfo) bool) { | |
| 305 | 334 | if cb == nil { | |
| 306 | 335 | x.xSupportsFiles = 0 | |
| @@ -312,6 +341,9 @@ func (x *AppInfoIface) OverrideSupportsFiles(cb func(AppInfo) bool) { | |||
| 312 | 341 | } | |
| 313 | 342 | ||
| 314 | 343 | // GetSupportsFiles gets the callback function. | |
| 344 | + | // Indicates whether the application specified accepts | |
| 345 | + | // | |
| 346 | + | // filename arguments. | |
| 315 | 347 | func (x *AppInfoIface) GetSupportsFiles() func(AppInfo) bool { | |
| 316 | 348 | if x.xSupportsFiles == 0 { | |
| 317 | 349 | return nil | |
| @@ -324,6 +356,7 @@ func (x *AppInfoIface) GetSupportsFiles() func(AppInfo) bool { | |||
| 324 | 356 | } | |
| 325 | 357 | ||
| 326 | 358 | // OverrideLaunchUris sets the callback function. | |
| 359 | + | // Launches an application with a list of URIs. | |
| 327 | 360 | func (x *AppInfoIface) OverrideLaunchUris(cb func(AppInfo, *glib.List, *AppLaunchContext) bool) { | |
| 328 | 361 | if cb == nil { | |
| 329 | 362 | x.xLaunchUris = 0 | |
| @@ -335,6 +368,7 @@ func (x *AppInfoIface) OverrideLaunchUris(cb func(AppInfo, *glib.List, *AppLaunc | |||
| 335 | 368 | } | |
| 336 | 369 | ||
| 337 | 370 | // GetLaunchUris gets the callback function. | |
| 371 | + | // Launches an application with a list of URIs. | |
| 338 | 372 | func (x *AppInfoIface) GetLaunchUris() func(AppInfo, *glib.List, *AppLaunchContext) bool { | |
| 339 | 373 | if x.xLaunchUris == 0 { | |
| 340 | 374 | return nil | |
| @@ -347,6 +381,10 @@ func (x *AppInfoIface) GetLaunchUris() func(AppInfo, *glib.List, *AppLaunchConte | |||
| 347 | 381 | } | |
| 348 | 382 | ||
| 349 | 383 | // OverrideShouldShow sets the callback function. | |
| 384 | + | // Returns whether an application should be shown (e.g. when | |
| 385 | + | // | |
| 386 | + | // getting a list of installed applications). | |
| 387 | + | // [FreeDesktop.Org Startup Notification Specification](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). | |
| 350 | 388 | func (x *AppInfoIface) OverrideShouldShow(cb func(AppInfo) bool) { | |
| 351 | 389 | if cb == nil { | |
| 352 | 390 | x.xShouldShow = 0 | |
| @@ -358,6 +396,10 @@ func (x *AppInfoIface) OverrideShouldShow(cb func(AppInfo) bool) { | |||
| 358 | 396 | } | |
| 359 | 397 | ||
| 360 | 398 | // GetShouldShow gets the callback function. | |
| 399 | + | // Returns whether an application should be shown (e.g. when | |
| 400 | + | // | |
| 401 | + | // getting a list of installed applications). | |
| 402 | + | // [FreeDesktop.Org Startup Notification Specification](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). | |
| 361 | 403 | func (x *AppInfoIface) GetShouldShow() func(AppInfo) bool { | |
| 362 | 404 | if x.xShouldShow == 0 { | |
| 363 | 405 | return nil | |
| @@ -370,6 +412,9 @@ func (x *AppInfoIface) GetShouldShow() func(AppInfo) bool { | |||
| 370 | 412 | } | |
| 371 | 413 | ||
| 372 | 414 | // OverrideSetAsDefaultForType sets the callback function. | |
| 415 | + | // Sets an application as default for a given content | |
| 416 | + | // | |
| 417 | + | // type. | |
| 373 | 418 | func (x *AppInfoIface) OverrideSetAsDefaultForType(cb func(AppInfo, string) bool) { | |
| 374 | 419 | if cb == nil { | |
| 375 | 420 | x.xSetAsDefaultForType = 0 | |
| @@ -381,6 +426,9 @@ func (x *AppInfoIface) OverrideSetAsDefaultForType(cb func(AppInfo, string) bool | |||
| 381 | 426 | } | |
| 382 | 427 | ||
| 383 | 428 | // GetSetAsDefaultForType gets the callback function. | |
| 429 | + | // Sets an application as default for a given content | |
| 430 | + | // | |
| 431 | + | // type. | |
| 384 | 432 | func (x *AppInfoIface) GetSetAsDefaultForType() func(AppInfo, string) bool { | |
| 385 | 433 | if x.xSetAsDefaultForType == 0 { | |
| 386 | 434 | return nil | |
| @@ -393,6 +441,9 @@ func (x *AppInfoIface) GetSetAsDefaultForType() func(AppInfo, string) bool { | |||
| 393 | 441 | } | |
| 394 | 442 | ||
| 395 | 443 | // OverrideSetAsDefaultForExtension sets the callback function. | |
| 444 | + | // Sets an application as default for a given | |
| 445 | + | // | |
| 446 | + | // file extension. | |
| 396 | 447 | func (x *AppInfoIface) OverrideSetAsDefaultForExtension(cb func(AppInfo, string) bool) { | |
| 397 | 448 | if cb == nil { | |
| 398 | 449 | x.xSetAsDefaultForExtension = 0 | |
| @@ -404,6 +455,9 @@ func (x *AppInfoIface) OverrideSetAsDefaultForExtension(cb func(AppInfo, string) | |||
| 404 | 455 | } | |
| 405 | 456 | ||
| 406 | 457 | // GetSetAsDefaultForExtension gets the callback function. | |
| 458 | + | // Sets an application as default for a given | |
| 459 | + | // | |
| 460 | + | // file extension. | |
| 407 | 461 | func (x *AppInfoIface) GetSetAsDefaultForExtension() func(AppInfo, string) bool { | |
| 408 | 462 | if x.xSetAsDefaultForExtension == 0 { | |
| 409 | 463 | return nil | |
| @@ -416,6 +470,9 @@ func (x *AppInfoIface) GetSetAsDefaultForExtension() func(AppInfo, string) bool | |||
| 416 | 470 | } | |
| 417 | 471 | ||
| 418 | 472 | // OverrideAddSupportsType sets the callback function. | |
| 473 | + | // Adds to the [iface@Gio.AppInfo] information about | |
| 474 | + | // | |
| 475 | + | // supported file types. | |
| 419 | 476 | func (x *AppInfoIface) OverrideAddSupportsType(cb func(AppInfo, string) bool) { | |
| 420 | 477 | if cb == nil { | |
| 421 | 478 | x.xAddSupportsType = 0 | |
| @@ -427,6 +484,9 @@ func (x *AppInfoIface) OverrideAddSupportsType(cb func(AppInfo, string) bool) { | |||
| 427 | 484 | } | |
| 428 | 485 | ||
| 429 | 486 | // GetAddSupportsType gets the callback function. | |
| 487 | + | // Adds to the [iface@Gio.AppInfo] information about | |
| 488 | + | // | |
| 489 | + | // supported file types. | |
| 430 | 490 | func (x *AppInfoIface) GetAddSupportsType() func(AppInfo, string) bool { | |
| 431 | 491 | if x.xAddSupportsType == 0 { | |
| 432 | 492 | return nil | |
| @@ -439,6 +499,9 @@ func (x *AppInfoIface) GetAddSupportsType() func(AppInfo, string) bool { | |||
| 439 | 499 | } | |
| 440 | 500 | ||
| 441 | 501 | // OverrideCanRemoveSupportsType sets the callback function. | |
| 502 | + | // Checks for support for removing supported file | |
| 503 | + | // | |
| 504 | + | // types from a [iface@Gio.AppInfo]. | |
| 442 | 505 | func (x *AppInfoIface) OverrideCanRemoveSupportsType(cb func(AppInfo) bool) { | |
| 443 | 506 | if cb == nil { | |
| 444 | 507 | x.xCanRemoveSupportsType = 0 | |
| @@ -450,6 +513,9 @@ func (x *AppInfoIface) OverrideCanRemoveSupportsType(cb func(AppInfo) bool) { | |||
| 450 | 513 | } | |
| 451 | 514 | ||
| 452 | 515 | // GetCanRemoveSupportsType gets the callback function. | |
| 516 | + | // Checks for support for removing supported file | |
| 517 | + | // | |
| 518 | + | // types from a [iface@Gio.AppInfo]. | |
| 453 | 519 | func (x *AppInfoIface) GetCanRemoveSupportsType() func(AppInfo) bool { | |
| 454 | 520 | if x.xCanRemoveSupportsType == 0 { | |
| 455 | 521 | return nil | |
| @@ -462,6 +528,9 @@ func (x *AppInfoIface) GetCanRemoveSupportsType() func(AppInfo) bool { | |||
| 462 | 528 | } | |
| 463 | 529 | ||
| 464 | 530 | // OverrideRemoveSupportsType sets the callback function. | |
| 531 | + | // Removes a supported application type from a | |
| 532 | + | // | |
| 533 | + | // [iface@Gio.AppInfo]. | |
| 465 | 534 | func (x *AppInfoIface) OverrideRemoveSupportsType(cb func(AppInfo, string) bool) { | |
| 466 | 535 | if cb == nil { | |
| 467 | 536 | x.xRemoveSupportsType = 0 | |
| @@ -473,6 +542,9 @@ func (x *AppInfoIface) OverrideRemoveSupportsType(cb func(AppInfo, string) bool) | |||
| 473 | 542 | } | |
| 474 | 543 | ||
| 475 | 544 | // GetRemoveSupportsType gets the callback function. | |
| 545 | + | // Removes a supported application type from a | |
| 546 | + | // | |
| 547 | + | // [iface@Gio.AppInfo]. | |
| 476 | 548 | func (x *AppInfoIface) GetRemoveSupportsType() func(AppInfo, string) bool { | |
| 477 | 549 | if x.xRemoveSupportsType == 0 { | |
| 478 | 550 | return nil | |
| @@ -485,6 +557,7 @@ func (x *AppInfoIface) GetRemoveSupportsType() func(AppInfo, string) bool { | |||
| 485 | 557 | } | |
| 486 | 558 | ||
| 487 | 559 | // OverrideCanDelete sets the callback function. | |
| 560 | + | // Checks if a [iface@Gio.AppInfo] can be deleted. (Since 2.20) | |
| 488 | 561 | func (x *AppInfoIface) OverrideCanDelete(cb func(AppInfo) bool) { | |
| 489 | 562 | if cb == nil { | |
| 490 | 563 | x.xCanDelete = 0 | |
| @@ -496,6 +569,7 @@ func (x *AppInfoIface) OverrideCanDelete(cb func(AppInfo) bool) { | |||
| 496 | 569 | } | |
| 497 | 570 | ||
| 498 | 571 | // GetCanDelete gets the callback function. | |
| 572 | + | // Checks if a [iface@Gio.AppInfo] can be deleted. (Since 2.20) | |
| 499 | 573 | func (x *AppInfoIface) GetCanDelete() func(AppInfo) bool { | |
| 500 | 574 | if x.xCanDelete == 0 { | |
| 501 | 575 | return nil | |
| @@ -508,6 +582,7 @@ func (x *AppInfoIface) GetCanDelete() func(AppInfo) bool { | |||
| 508 | 582 | } | |
| 509 | 583 | ||
| 510 | 584 | // OverrideDoDelete sets the callback function. | |
| 585 | + | // Deletes a [iface@Gio.AppInfo]. (Since 2.20) | |
| 511 | 586 | func (x *AppInfoIface) OverrideDoDelete(cb func(AppInfo) bool) { | |
| 512 | 587 | if cb == nil { | |
| 513 | 588 | x.xDoDelete = 0 | |
| @@ -519,6 +594,7 @@ func (x *AppInfoIface) OverrideDoDelete(cb func(AppInfo) bool) { | |||
| 519 | 594 | } | |
| 520 | 595 | ||
| 521 | 596 | // GetDoDelete gets the callback function. | |
| 597 | + | // Deletes a [iface@Gio.AppInfo]. (Since 2.20) | |
| 522 | 598 | func (x *AppInfoIface) GetDoDelete() func(AppInfo) bool { | |
| 523 | 599 | if x.xDoDelete == 0 { | |
| 524 | 600 | return nil | |
| @@ -531,6 +607,9 @@ func (x *AppInfoIface) GetDoDelete() func(AppInfo) bool { | |||
| 531 | 607 | } | |
| 532 | 608 | ||
| 533 | 609 | // OverrideGetCommandline sets the callback function. | |
| 610 | + | // Gets the commandline for the [iface@Gio.AppInfo]. | |
| 611 | + | // | |
| 612 | + | // (Since 2.20) | |
| 534 | 613 | func (x *AppInfoIface) OverrideGetCommandline(cb func(AppInfo) string) { | |
| 535 | 614 | if cb == nil { | |
| 536 | 615 | x.xGetCommandline = 0 | |
| @@ -542,6 +621,9 @@ func (x *AppInfoIface) OverrideGetCommandline(cb func(AppInfo) string) { | |||
| 542 | 621 | } | |
| 543 | 622 | ||
| 544 | 623 | // GetGetCommandline gets the callback function. | |
| 624 | + | // Gets the commandline for the [iface@Gio.AppInfo]. | |
| 625 | + | // | |
| 626 | + | // (Since 2.20) | |
| 545 | 627 | func (x *AppInfoIface) GetGetCommandline() func(AppInfo) string { | |
| 546 | 628 | if x.xGetCommandline == 0 { | |
| 547 | 629 | return nil | |
| @@ -554,6 +636,9 @@ func (x *AppInfoIface) GetGetCommandline() func(AppInfo) string { | |||
| 554 | 636 | } | |
| 555 | 637 | ||
| 556 | 638 | // OverrideGetDisplayName sets the callback function. | |
| 639 | + | // Gets the display name for the [iface@Gio.AppInfo]. | |
| 640 | + | // | |
| 641 | + | // (Since 2.24) | |
| 557 | 642 | func (x *AppInfoIface) OverrideGetDisplayName(cb func(AppInfo) string) { | |
| 558 | 643 | if cb == nil { | |
| 559 | 644 | x.xGetDisplayName = 0 | |
| @@ -565,6 +650,9 @@ func (x *AppInfoIface) OverrideGetDisplayName(cb func(AppInfo) string) { | |||
| 565 | 650 | } | |
| 566 | 651 | ||
| 567 | 652 | // GetGetDisplayName gets the callback function. | |
| 653 | + | // Gets the display name for the [iface@Gio.AppInfo]. | |
| 654 | + | // | |
| 655 | + | // (Since 2.24) | |
| 568 | 656 | func (x *AppInfoIface) GetGetDisplayName() func(AppInfo) string { | |
| 569 | 657 | if x.xGetDisplayName == 0 { | |
| 570 | 658 | return nil | |
| @@ -577,6 +665,9 @@ func (x *AppInfoIface) GetGetDisplayName() func(AppInfo) string { | |||
| 577 | 665 | } | |
| 578 | 666 | ||
| 579 | 667 | // OverrideSetAsLastUsedForType sets the callback function. | |
| 668 | + | // Sets the application as the last used. See | |
| 669 | + | // | |
| 670 | + | // [method@Gio.AppInfo.set_as_last_used_for_type]. | |
| 580 | 671 | func (x *AppInfoIface) OverrideSetAsLastUsedForType(cb func(AppInfo, string) bool) { | |
| 581 | 672 | if cb == nil { | |
| 582 | 673 | x.xSetAsLastUsedForType = 0 | |
| @@ -588,6 +679,9 @@ func (x *AppInfoIface) OverrideSetAsLastUsedForType(cb func(AppInfo, string) boo | |||
| 588 | 679 | } | |
| 589 | 680 | ||
| 590 | 681 | // GetSetAsLastUsedForType gets the callback function. | |
| 682 | + | // Sets the application as the last used. See | |
| 683 | + | // | |
| 684 | + | // [method@Gio.AppInfo.set_as_last_used_for_type]. | |
| 591 | 685 | func (x *AppInfoIface) GetSetAsLastUsedForType() func(AppInfo, string) bool { | |
| 592 | 686 | if x.xSetAsLastUsedForType == 0 { | |
| 593 | 687 | return nil | |
| @@ -600,6 +694,9 @@ func (x *AppInfoIface) GetSetAsLastUsedForType() func(AppInfo, string) bool { | |||
| 600 | 694 | } | |
| 601 | 695 | ||
| 602 | 696 | // OverrideGetSupportedTypes sets the callback function. | |
| 697 | + | // Retrieves the list of content types that @app_info | |
| 698 | + | // | |
| 699 | + | // claims to support. | |
| 603 | 700 | func (x *AppInfoIface) OverrideGetSupportedTypes(cb func(AppInfo) []string) { | |
| 604 | 701 | if cb == nil { | |
| 605 | 702 | x.xGetSupportedTypes = 0 | |
| @@ -611,6 +708,9 @@ func (x *AppInfoIface) OverrideGetSupportedTypes(cb func(AppInfo) []string) { | |||
| 611 | 708 | } | |
| 612 | 709 | ||
| 613 | 710 | // GetGetSupportedTypes gets the callback function. | |
| 711 | + | // Retrieves the list of content types that @app_info | |
| 712 | + | // | |
| 713 | + | // claims to support. | |
| 614 | 714 | func (x *AppInfoIface) GetGetSupportedTypes() func(AppInfo) []string { | |
| 615 | 715 | if x.xGetSupportedTypes == 0 { | |
| 616 | 716 | return nil | |
| @@ -623,6 +723,9 @@ func (x *AppInfoIface) GetGetSupportedTypes() func(AppInfo) []string { | |||
| 623 | 723 | } | |
| 624 | 724 | ||
| 625 | 725 | // OverrideLaunchUrisAsync sets the callback function. | |
| 726 | + | // Asynchronously launches an application with a list of | |
| 727 | + | // | |
| 728 | + | // URIs. (Since: 2.60) | |
| 626 | 729 | func (x *AppInfoIface) OverrideLaunchUrisAsync(cb func(AppInfo, *glib.List, *AppLaunchContext, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 627 | 730 | if cb == nil { | |
| 628 | 731 | x.xLaunchUrisAsync = 0 | |
| @@ -634,6 +737,9 @@ func (x *AppInfoIface) OverrideLaunchUrisAsync(cb func(AppInfo, *glib.List, *App | |||
| 634 | 737 | } | |
| 635 | 738 | ||
| 636 | 739 | // GetLaunchUrisAsync gets the callback function. | |
| 740 | + | // Asynchronously launches an application with a list of | |
| 741 | + | // | |
| 742 | + | // URIs. (Since: 2.60) | |
| 637 | 743 | func (x *AppInfoIface) GetLaunchUrisAsync() func(AppInfo, *glib.List, *AppLaunchContext, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 638 | 744 | if x.xLaunchUrisAsync == 0 { | |
| 639 | 745 | return nil | |
| @@ -646,6 +752,9 @@ func (x *AppInfoIface) GetLaunchUrisAsync() func(AppInfo, *glib.List, *AppLaunch | |||
| 646 | 752 | } | |
| 647 | 753 | ||
| 648 | 754 | // OverrideLaunchUrisFinish sets the callback function. | |
| 755 | + | // Finishes an operation started with @launch_uris_async. | |
| 756 | + | // | |
| 757 | + | // (Since: 2.60) | |
| 649 | 758 | func (x *AppInfoIface) OverrideLaunchUrisFinish(cb func(AppInfo, AsyncResult) bool) { | |
| 650 | 759 | if cb == nil { | |
| 651 | 760 | x.xLaunchUrisFinish = 0 | |
| @@ -657,6 +766,9 @@ func (x *AppInfoIface) OverrideLaunchUrisFinish(cb func(AppInfo, AsyncResult) bo | |||
| 657 | 766 | } | |
| 658 | 767 | ||
| 659 | 768 | // GetLaunchUrisFinish gets the callback function. | |
| 769 | + | // Finishes an operation started with @launch_uris_async. | |
| 770 | + | // | |
| 771 | + | // (Since: 2.60) | |
| 660 | 772 | func (x *AppInfoIface) GetLaunchUrisFinish() func(AppInfo, AsyncResult) bool { | |
| 661 | 773 | if x.xLaunchUrisFinish == 0 { | |
| 662 | 774 | return nil | |
| @@ -886,32 +998,39 @@ func (x *AppLaunchContextPrivate) GoPointer() uintptr { | |||
| 886 | 998 | return uintptr(unsafe.Pointer(x)) | |
| 887 | 999 | } | |
| 888 | 1000 | ||
| 889 | - | // #GAppInfo and #GAppLaunchContext are used for describing and launching | |
| 1001 | + | // Information about an installed application and methods to launch | |
| 1002 | + | // it (with file arguments). | |
| 1003 | + | // | |
| 1004 | + | // `GAppInfo` and `GAppLaunchContext` are used for describing and launching | |
| 890 | 1005 | // applications installed on the system. | |
| 891 | 1006 | // | |
| 892 | 1007 | // As of GLib 2.20, URIs will always be converted to POSIX paths | |
| 893 | - | // (using g_file_get_path()) when using g_app_info_launch() even if | |
| 894 | - | // the application requested an URI and not a POSIX path. For example | |
| 895 | - | // for a desktop-file based application with Exec key `totem | |
| 896 | - | // %U` and a single URI, `sftp://foo/file.avi`, then | |
| 897 | - | // `/home/user/.gvfs/sftp on foo/file.avi` will be passed. This will | |
| 898 | - | // only work if a set of suitable GIO extensions (such as gvfs 2.26 | |
| 899 | - | // compiled with FUSE support), is available and operational; if this | |
| 900 | - | // is not the case, the URI will be passed unmodified to the application. | |
| 901 | - | // Some URIs, such as `mailto:`, of course cannot be mapped to a POSIX | |
| 902 | - | // path (in gvfs there's no FUSE mount for it); such URIs will be | |
| 903 | - | // passed unmodified to the application. | |
| 904 | - | // | |
| 905 | - | // Specifically for gvfs 2.26 and later, the POSIX URI will be mapped | |
| 906 | - | // back to the GIO URI in the #GFile constructors (since gvfs | |
| 907 | - | // implements the #GVfs extension point). As such, if the application | |
| 908 | - | // needs to examine the URI, it needs to use g_file_get_uri() or | |
| 909 | - | // similar on #GFile. In other words, an application cannot assume | |
| 910 | - | // that the URI passed to e.g. g_file_new_for_commandline_arg() is | |
| 911 | - | // equal to the result of g_file_get_uri(). The following snippet | |
| 1008 | + | // (using [method@Gio.File.get_path]) when using [method@Gio.AppInfo.launch] | |
| 1009 | + | // even if the application requested an URI and not a POSIX path. For example | |
| 1010 | + | // for a desktop-file based application with the following Exec key: | |
| 1011 | + | // | |
| 1012 | + | // ``` | |
| 1013 | + | // Exec=totem %U | |
| 1014 | + | // ``` | |
| 1015 | + | // | |
| 1016 | + | // and a single URI, `sftp://foo/file.avi`, then | |
| 1017 | + | // `/home/user/.gvfs/sftp on foo/file.avi` will be passed. This will only work | |
| 1018 | + | // if a set of suitable GIO extensions (such as GVfs 2.26 compiled with FUSE | |
| 1019 | + | // support), is available and operational; if this is not the case, the URI | |
| 1020 | + | // will be passed unmodified to the application. Some URIs, such as `mailto:`, | |
| 1021 | + | // of course cannot be mapped to a POSIX path (in GVfs there’s no FUSE mount | |
| 1022 | + | // for it); such URIs will be passed unmodified to the application. | |
| 1023 | + | // | |
| 1024 | + | // Specifically for GVfs 2.26 and later, the POSIX URI will be mapped | |
| 1025 | + | // back to the GIO URI in the [iface@Gio.File] constructors (since GVfs | |
| 1026 | + | // implements the GVfs extension point). As such, if the application | |
| 1027 | + | // needs to examine the URI, it needs to use [method@Gio.File.get_uri] | |
| 1028 | + | // or similar on [iface@Gio.File]. In other words, an application cannot | |
| 1029 | + | // assume that the URI passed to e.g. [func@Gio.File.new_for_commandline_arg] | |
| 1030 | + | // is equal to the result of [method@Gio.File.get_uri]. The following snippet | |
| 912 | 1031 | // illustrates this: | |
| 913 | 1032 | // | |
| 914 | - | // |[ | |
| 1033 | + | // ```c | |
| 915 | 1034 | // GFile *f; | |
| 916 | 1035 | // char *uri; | |
| 917 | 1036 | // | |
| @@ -928,11 +1047,11 @@ func (x *AppLaunchContextPrivate) GoPointer() uintptr { | |||
| 928 | 1047 | // } | |
| 929 | 1048 | // | |
| 930 | 1049 | // g_object_unref (file); | |
| 931 | - | // ]| | |
| 1050 | + | // ``` | |
| 932 | 1051 | // | |
| 933 | 1052 | // This code will work when both `cdda://sr0/Track 1.wav` and | |
| 934 | 1053 | // `/home/user/.gvfs/cdda on sr0/Track 1.wav` is passed to the | |
| 935 | - | // application. It should be noted that it's generally not safe | |
| 1054 | + | // application. It should be noted that it’s generally not safe | |
| 936 | 1055 | // for applications to rely on the format of a particular URIs. | |
| 937 | 1056 | // Different launcher applications (e.g. file managers) may have | |
| 938 | 1057 | // different ideas of what a given URI means. | |
| @@ -1000,8 +1119,8 @@ func (x *AppInfoBase) AddSupportsType(ContentTypeVar string) (bool, error) { | |||
| 1000 | 1119 | ||
| 1001 | 1120 | } | |
| 1002 | 1121 | ||
| 1003 | - | // Obtains the information whether the #GAppInfo can be deleted. | |
| 1004 | - | // See g_app_info_delete(). | |
| 1122 | + | // Obtains the information whether the [iface@Gio.AppInfo] can be deleted. | |
| 1123 | + | // See [method@Gio.AppInfo.delete]. | |
| 1005 | 1124 | func (x *AppInfoBase) CanDelete() bool { | |
| 1006 | 1125 | ||
| 1007 | 1126 | cret := XGAppInfoCanDelete(x.GoPointer()) | |
| @@ -1015,18 +1134,18 @@ func (x *AppInfoBase) CanRemoveSupportsType() bool { | |||
| 1015 | 1134 | return cret | |
| 1016 | 1135 | } | |
| 1017 | 1136 | ||
| 1018 | - | // Tries to delete a #GAppInfo. | |
| 1137 | + | // Tries to delete a [iface@Gio.AppInfo]. | |
| 1019 | 1138 | // | |
| 1020 | 1139 | // On some platforms, there may be a difference between user-defined | |
| 1021 | - | // #GAppInfos which can be deleted, and system-wide ones which cannot. | |
| 1022 | - | // See g_app_info_can_delete(). | |
| 1140 | + | // [iface@Gio.AppInfo]s which can be deleted, and system-wide ones which cannot. | |
| 1141 | + | // See [method@Gio.AppInfo.can_delete]. | |
| 1023 | 1142 | func (x *AppInfoBase) Delete() bool { | |
| 1024 | 1143 | ||
| 1025 | 1144 | cret := XGAppInfoDelete(x.GoPointer()) | |
| 1026 | 1145 | return cret | |
| 1027 | 1146 | } | |
| 1028 | 1147 | ||
| 1029 | - | // Creates a duplicate of a #GAppInfo. | |
| 1148 | + | // Creates a duplicate of a [iface@Gio.AppInfo]. | |
| 1030 | 1149 | func (x *AppInfoBase) Dup() *AppInfoBase { | |
| 1031 | 1150 | var cls *AppInfoBase | |
| 1032 | 1151 | ||
| @@ -1040,11 +1159,11 @@ func (x *AppInfoBase) Dup() *AppInfoBase { | |||
| 1040 | 1159 | return cls | |
| 1041 | 1160 | } | |
| 1042 | 1161 | ||
| 1043 | - | // Checks if two #GAppInfos are equal. | |
| 1162 | + | // Checks if two [iface@Gio.AppInfo]s are equal. | |
| 1044 | 1163 | // | |
| 1045 | - | // Note that the check *may not* compare each individual | |
| 1046 | - | // field, and only does an identity check. In case detecting changes in the | |
| 1047 | - | // contents is needed, program code must additionally compare relevant fields. | |
| 1164 | + | // Note that the check *may not* compare each individual field, and only does | |
| 1165 | + | // an identity check. In case detecting changes in the contents is needed, | |
| 1166 | + | // program code must additionally compare relevant fields. | |
| 1048 | 1167 | func (x *AppInfoBase) Equal(Appinfo2Var AppInfo) bool { | |
| 1049 | 1168 | ||
| 1050 | 1169 | cret := XGAppInfoEqual(x.GoPointer(), Appinfo2Var.GoPointer()) | |
| @@ -1074,7 +1193,11 @@ func (x *AppInfoBase) GetDisplayName() string { | |||
| 1074 | 1193 | return cret | |
| 1075 | 1194 | } | |
| 1076 | 1195 | ||
| 1077 | - | // Gets the executable's name for the installed application. | |
| 1196 | + | // Gets the executable’s name for the installed application. | |
| 1197 | + | // | |
| 1198 | + | // This is intended to be used for debugging or labelling what program is going | |
| 1199 | + | // to be run. To launch the executable, use [method@Gio.AppInfo.launch] and related | |
| 1200 | + | // functions, rather than spawning the return value from this function. | |
| 1078 | 1201 | func (x *AppInfoBase) GetExecutable() string { | |
| 1079 | 1202 | ||
| 1080 | 1203 | cret := XGAppInfoGetExecutable(x.GoPointer()) | |
| @@ -1096,13 +1219,12 @@ func (x *AppInfoBase) GetIcon() *IconBase { | |||
| 1096 | 1219 | return cls | |
| 1097 | 1220 | } | |
| 1098 | 1221 | ||
| 1099 | - | // Gets the ID of an application. An id is a string that | |
| 1100 | - | // identifies the application. The exact format of the id is | |
| 1101 | - | // platform dependent. For instance, on Unix this is the | |
| 1102 | - | // desktop file id from the xdg menu specification. | |
| 1222 | + | // Gets the ID of an application. An id is a string that identifies the | |
| 1223 | + | // application. The exact format of the id is platform dependent. For instance, | |
| 1224 | + | // on Unix this is the desktop file id from the xdg menu specification. | |
| 1103 | 1225 | // | |
| 1104 | - | // Note that the returned ID may be %NULL, depending on how | |
| 1105 | - | // the @appinfo has been constructed. | |
| 1226 | + | // Note that the returned ID may be `NULL`, depending on how the @appinfo has | |
| 1227 | + | // been constructed. | |
| 1106 | 1228 | func (x *AppInfoBase) GetId() string { | |
| 1107 | 1229 | ||
| 1108 | 1230 | cret := XGAppInfoGetId(x.GoPointer()) | |
| @@ -1118,9 +1240,10 @@ func (x *AppInfoBase) GetName() string { | |||
| 1118 | 1240 | ||
| 1119 | 1241 | // Retrieves the list of content types that @app_info claims to support. | |
| 1120 | 1242 | // If this information is not provided by the environment, this function | |
| 1121 | - | // will return %NULL. | |
| 1243 | + | // will return `NULL`. | |
| 1244 | + | // | |
| 1122 | 1245 | // This function does not take in consideration associations added with | |
| 1123 | - | // g_app_info_add_supports_type(), but only those exported directly by | |
| 1246 | + | // [method@Gio.AppInfo.add_supports_type], but only those exported directly by | |
| 1124 | 1247 | // the application. | |
| 1125 | 1248 | func (x *AppInfoBase) GetSupportedTypes() []string { | |
| 1126 | 1249 | ||
| @@ -1133,7 +1256,7 @@ func (x *AppInfoBase) GetSupportedTypes() []string { | |||
| 1133 | 1256 | // about the details of the launcher (like what screen it is on). | |
| 1134 | 1257 | // On error, @error will be set accordingly. | |
| 1135 | 1258 | // | |
| 1136 | - | // To launch the application without arguments pass a %NULL @files list. | |
| 1259 | + | // To launch the application without arguments pass a `NULL` @files list. | |
| 1137 | 1260 | // | |
| 1138 | 1261 | // Note that even if the launch is successful the application launched | |
| 1139 | 1262 | // can fail to start if it runs into problems during startup. There is | |
| @@ -1142,19 +1265,19 @@ func (x *AppInfoBase) GetSupportedTypes() []string { | |||
| 1142 | 1265 | // Some URIs can be changed when passed through a GFile (for instance | |
| 1143 | 1266 | // unsupported URIs with strange formats like mailto:), so if you have | |
| 1144 | 1267 | // a textual URI you want to pass in as argument, consider using | |
| 1145 | - | // g_app_info_launch_uris() instead. | |
| 1268 | + | // [method@Gio.AppInfo.launch_uris] instead. | |
| 1146 | 1269 | // | |
| 1147 | 1270 | // The launched application inherits the environment of the launching | |
| 1148 | - | // process, but it can be modified with g_app_launch_context_setenv() | |
| 1149 | - | // and g_app_launch_context_unsetenv(). | |
| 1271 | + | // process, but it can be modified with [method@Gio.AppLaunchContext.setenv] | |
| 1272 | + | // and [method@Gio.AppLaunchContext.unsetenv]. | |
| 1150 | 1273 | // | |
| 1151 | 1274 | // On UNIX, this function sets the `GIO_LAUNCHED_DESKTOP_FILE` | |
| 1152 | 1275 | // environment variable with the path of the launched desktop file and | |
| 1153 | 1276 | // `GIO_LAUNCHED_DESKTOP_FILE_PID` to the process id of the launched | |
| 1154 | 1277 | // process. This can be used to ignore `GIO_LAUNCHED_DESKTOP_FILE`, | |
| 1155 | - | // should it be inherited by further processes. The `DISPLAY` and | |
| 1156 | - | // `DESKTOP_STARTUP_ID` environment variables are also set, based | |
| 1157 | - | // on information provided in @context. | |
| 1278 | + | // should it be inherited by further processes. The `DISPLAY`, | |
| 1279 | + | // `XDG_ACTIVATION_TOKEN` and `DESKTOP_STARTUP_ID` environment | |
| 1280 | + | // variables are also set, based on information provided in @context. | |
| 1158 | 1281 | func (x *AppInfoBase) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) (bool, error) { | |
| 1159 | 1282 | var cerr *glib.Error | |
| 1160 | 1283 | ||
| @@ -1169,9 +1292,11 @@ func (x *AppInfoBase) Launch(FilesVar *glib.List, ContextVar *AppLaunchContext) | |||
| 1169 | 1292 | // Launches the application. This passes the @uris to the launched application | |
| 1170 | 1293 | // as arguments, using the optional @context to get information | |
| 1171 | 1294 | // about the details of the launcher (like what screen it is on). | |
| 1172 | - | // On error, @error will be set accordingly. | |
| 1295 | + | // On error, @error will be set accordingly. If the application only supports | |
| 1296 | + | // one URI per invocation as part of their command-line, multiple instances | |
| 1297 | + | // of the application will be spawned. | |
| 1173 | 1298 | // | |
| 1174 | - | // To launch the application without arguments pass a %NULL @uris list. | |
| 1299 | + | // To launch the application without arguments pass a `NULL` @uris list. | |
| 1175 | 1300 | // | |
| 1176 | 1301 | // Note that even if the launch is successful the application launched | |
| 1177 | 1302 | // can fail to start if it runs into problems during startup. There is | |
| @@ -1187,19 +1312,19 @@ func (x *AppInfoBase) LaunchUris(UrisVar *glib.List, ContextVar *AppLaunchContex | |||
| 1187 | 1312 | ||
| 1188 | 1313 | } | |
| 1189 | 1314 | ||
| 1190 | - | // Async version of g_app_info_launch_uris(). | |
| 1315 | + | // Async version of [method@Gio.AppInfo.launch_uris]. | |
| 1191 | 1316 | // | |
| 1192 | 1317 | // The @callback is invoked immediately after the application launch, but it | |
| 1193 | 1318 | // waits for activation in case of D-Bus–activated applications and also provides | |
| 1194 | 1319 | // extended error information for sandboxed applications, see notes for | |
| 1195 | - | // g_app_info_launch_default_for_uri_async(). | |
| 1320 | + | // [func@Gio.AppInfo.launch_default_for_uri_async]. | |
| 1196 | 1321 | func (x *AppInfoBase) LaunchUrisAsync(UrisVar *glib.List, ContextVar *AppLaunchContext, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1197 | 1322 | ||
| 1198 | 1323 | XGAppInfoLaunchUrisAsync(x.GoPointer(), UrisVar, ContextVar.GoPointer(), CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1199 | 1324 | ||
| 1200 | 1325 | } | |
| 1201 | 1326 | ||
| 1202 | - | // Finishes a g_app_info_launch_uris_async() operation. | |
| 1327 | + | // Finishes a [method@Gio.AppInfo.launch_uris_async] operation. | |
| 1203 | 1328 | func (x *AppInfoBase) LaunchUrisFinish(ResultVar AsyncResult) (bool, error) { | |
| 1204 | 1329 | var cerr *glib.Error | |
| 1205 | 1330 | ||
| @@ -1247,9 +1372,9 @@ func (x *AppInfoBase) SetAsDefaultForType(ContentTypeVar string) (bool, error) { | |||
| 1247 | 1372 | ||
| 1248 | 1373 | } | |
| 1249 | 1374 | ||
| 1250 | - | // Sets the application as the last used application for a given type. | |
| 1251 | - | // This will make the application appear as first in the list returned | |
| 1252 | - | // by g_app_info_get_recommended_for_type(), regardless of the default | |
| 1375 | + | // Sets the application as the last used application for a given type. This | |
| 1376 | + | // will make the application appear as first in the list returned by | |
| 1377 | + | // [func@Gio.AppInfo.get_recommended_for_type], regardless of the default | |
| 1253 | 1378 | // application for that content type. | |
| 1254 | 1379 | func (x *AppInfoBase) SetAsLastUsedForType(ContentTypeVar string) (bool, error) { | |
| 1255 | 1380 | var cerr *glib.Error | |
| @@ -1312,13 +1437,15 @@ var XGAppInfoSupportsUris func(uintptr) bool | |||
| 1312 | 1437 | ||
| 1313 | 1438 | var xAppInfoCreateFromCommandline func(string, string, AppInfoCreateFlags, **glib.Error) uintptr | |
| 1314 | 1439 | ||
| 1315 | - | // Creates a new #GAppInfo from the given information. | |
| 1440 | + | // Creates a new [iface@Gio.AppInfo] from the given information. | |
| 1316 | 1441 | // | |
| 1317 | - | // Note that for @commandline, the quoting rules of the Exec key of the | |
| 1442 | + | // Note that for @commandline, the quoting rules of the `Exec` key of the | |
| 1318 | 1443 | // [freedesktop.org Desktop Entry Specification](http://freedesktop.org/Standards/desktop-entry-spec) | |
| 1319 | 1444 | // are applied. For example, if the @commandline contains | |
| 1320 | 1445 | // percent-encoded URIs, the percent-character must be doubled in order to prevent it from | |
| 1321 | - | // being swallowed by Exec key unquoting. See the specification for exact quoting rules. | |
| 1446 | + | // being swallowed by `Exec` key unquoting. See | |
| 1447 | + | // [the specification](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html) | |
| 1448 | + | // for exact quoting rules. | |
| 1322 | 1449 | func AppInfoCreateFromCommandline(CommandlineVar string, ApplicationNameVar string, FlagsVar AppInfoCreateFlags) (*AppInfoBase, error) { | |
| 1323 | 1450 | var cls *AppInfoBase | |
| 1324 | 1451 | var cerr *glib.Error | |
| @@ -1343,10 +1470,15 @@ var xAppInfoGetAll func() *glib.List | |||
| 1343 | 1470 | // on this system. | |
| 1344 | 1471 | // | |
| 1345 | 1472 | // For desktop files, this includes applications that have | |
| 1346 | - | // `NoDisplay=true` set or are excluded from display by means | |
| 1347 | - | // of `OnlyShowIn` or `NotShowIn`. See g_app_info_should_show(). | |
| 1348 | - | // The returned list does not include applications which have | |
| 1349 | - | // the `Hidden` key set. | |
| 1473 | + | // [`NoDisplay=true`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-nodisplay) | |
| 1474 | + | // set or are excluded from display by means of | |
| 1475 | + | // [`OnlyShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-onlyshowin) | |
| 1476 | + | // or [`NotShowIn`](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-notshowin). | |
| 1477 | + | // See [method@Gio.AppInfo.should_show]. | |
| 1478 | + | // | |
| 1479 | + | // The returned list does not include applications which have the | |
| 1480 | + | // [`Hidden` key](https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s06.html#key-hidden) | |
| 1481 | + | // set. | |
| 1350 | 1482 | func AppInfoGetAll() *glib.List { | |
| 1351 | 1483 | ||
| 1352 | 1484 | cret := xAppInfoGetAll() | |
| @@ -1355,10 +1487,10 @@ func AppInfoGetAll() *glib.List { | |||
| 1355 | 1487 | ||
| 1356 | 1488 | var xAppInfoGetAllForType func(string) *glib.List | |
| 1357 | 1489 | ||
| 1358 | - | // Gets a list of all #GAppInfos for a given content type, | |
| 1359 | - | // including the recommended and fallback #GAppInfos. See | |
| 1360 | - | // g_app_info_get_recommended_for_type() and | |
| 1361 | - | // g_app_info_get_fallback_for_type(). | |
| 1490 | + | // Gets a list of all [iface@Gio.AppInfo]s for a given content type, | |
| 1491 | + | // including the recommended and fallback [iface@Gio.AppInfo]s. See | |
| 1492 | + | // [func@Gio.AppInfo.get_recommended_for_type] and | |
| 1493 | + | // [func@Gio.AppInfo.get_fallback_for_type]. | |
| 1362 | 1494 | func AppInfoGetAllForType(ContentTypeVar string) *glib.List { | |
| 1363 | 1495 | ||
| 1364 | 1496 | cret := xAppInfoGetAllForType(ContentTypeVar) | |
| @@ -1367,7 +1499,7 @@ func AppInfoGetAllForType(ContentTypeVar string) *glib.List { | |||
| 1367 | 1499 | ||
| 1368 | 1500 | var xAppInfoGetDefaultForType func(string, bool) uintptr | |
| 1369 | 1501 | ||
| 1370 | - | // Gets the default #GAppInfo for a given content type. | |
| 1502 | + | // Gets the default [iface@Gio.AppInfo] for a given content type. | |
| 1371 | 1503 | func AppInfoGetDefaultForType(ContentTypeVar string, MustSupportUrisVar bool) *AppInfoBase { | |
| 1372 | 1504 | var cls *AppInfoBase | |
| 1373 | 1505 | ||
| @@ -1381,12 +1513,47 @@ func AppInfoGetDefaultForType(ContentTypeVar string, MustSupportUrisVar bool) *A | |||
| 1381 | 1513 | return cls | |
| 1382 | 1514 | } | |
| 1383 | 1515 | ||
| 1516 | + | var xAppInfoGetDefaultForTypeAsync func(string, bool, uintptr, uintptr, uintptr) | |
| 1517 | + | ||
| 1518 | + | // Asynchronously gets the default [iface@Gio.AppInfo] for a given content | |
| 1519 | + | // type. | |
| 1520 | + | func AppInfoGetDefaultForTypeAsync(ContentTypeVar string, MustSupportUrisVar bool, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1521 | + | ||
| 1522 | + | xAppInfoGetDefaultForTypeAsync(ContentTypeVar, MustSupportUrisVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1523 | + | ||
| 1524 | + | } | |
| 1525 | + | ||
| 1526 | + | var xAppInfoGetDefaultForTypeFinish func(uintptr, **glib.Error) uintptr | |
| 1527 | + | ||
| 1528 | + | // Finishes a default [iface@Gio.AppInfo] lookup started by | |
| 1529 | + | // [func@Gio.AppInfo.get_default_for_type_async]. | |
| 1530 | + | // | |
| 1531 | + | // If no #[iface@Gio.AppInfo] is found, then @error will be set to | |
| 1532 | + | // [error@Gio.IOErrorEnum.NOT_FOUND]. | |
| 1533 | + | func AppInfoGetDefaultForTypeFinish(ResultVar AsyncResult) (*AppInfoBase, error) { | |
| 1534 | + | var cls *AppInfoBase | |
| 1535 | + | var cerr *glib.Error | |
| 1536 | + | ||
| 1537 | + | cret := xAppInfoGetDefaultForTypeFinish(ResultVar.GoPointer(), &cerr) | |
| 1538 | + | ||
| 1539 | + | if cret == 0 { | |
| 1540 | + | return nil, cerr | |
| 1541 | + | } | |
| 1542 | + | cls = &AppInfoBase{} | |
| 1543 | + | cls.Ptr = cret | |
| 1544 | + | if cerr == nil { | |
| 1545 | + | return cls, nil | |
| 1546 | + | } | |
| 1547 | + | return cls, cerr | |
| 1548 | + | ||
| 1549 | + | } | |
| 1550 | + | ||
| 1384 | 1551 | var xAppInfoGetDefaultForUriScheme func(string) uintptr | |
| 1385 | 1552 | ||
| 1386 | - | // Gets the default application for handling URIs with | |
| 1387 | - | // the given URI scheme. A URI scheme is the initial part | |
| 1388 | - | // of the URI, up to but not including the ':', e.g. "http", | |
| 1389 | - | // "ftp" or "sip". | |
| 1553 | + | // Gets the default application for handling URIs with the given URI scheme. | |
| 1554 | + | // | |
| 1555 | + | // A URI scheme is the initial part of the URI, up to but not including the `:`. | |
| 1556 | + | // For example, `http`, `ftp` or `sip`. | |
| 1390 | 1557 | func AppInfoGetDefaultForUriScheme(UriSchemeVar string) *AppInfoBase { | |
| 1391 | 1558 | var cls *AppInfoBase | |
| 1392 | 1559 | ||
| @@ -1400,11 +1567,48 @@ func AppInfoGetDefaultForUriScheme(UriSchemeVar string) *AppInfoBase { | |||
| 1400 | 1567 | return cls | |
| 1401 | 1568 | } | |
| 1402 | 1569 | ||
| 1570 | + | var xAppInfoGetDefaultForUriSchemeAsync func(string, uintptr, uintptr, uintptr) | |
| 1571 | + | ||
| 1572 | + | // Asynchronously gets the default application for handling URIs with | |
| 1573 | + | // the given URI scheme. A URI scheme is the initial part | |
| 1574 | + | // of the URI, up to but not including the `:`, e.g. `http`, | |
| 1575 | + | // `ftp` or `sip`. | |
| 1576 | + | func AppInfoGetDefaultForUriSchemeAsync(UriSchemeVar string, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 1577 | + | ||
| 1578 | + | xAppInfoGetDefaultForUriSchemeAsync(UriSchemeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 1579 | + | ||
| 1580 | + | } | |
| 1581 | + | ||
| 1582 | + | var xAppInfoGetDefaultForUriSchemeFinish func(uintptr, **glib.Error) uintptr | |
| 1583 | + | ||
| 1584 | + | // Finishes a default [iface@Gio.AppInfo] lookup started by | |
| 1585 | + | // [func@Gio.AppInfo.get_default_for_uri_scheme_async]. | |
| 1586 | + | // | |
| 1587 | + | // If no [iface@Gio.AppInfo] is found, then @error will be set to | |
| 1588 | + | // [error@Gio.IOErrorEnum.NOT_FOUND]. | |
| 1589 | + | func AppInfoGetDefaultForUriSchemeFinish(ResultVar AsyncResult) (*AppInfoBase, error) { | |
| 1590 | + | var cls *AppInfoBase | |
| 1591 | + | var cerr *glib.Error | |
| 1592 | + | ||
| 1593 | + | cret := xAppInfoGetDefaultForUriSchemeFinish(ResultVar.GoPointer(), &cerr) | |
| 1594 | + | ||
| 1595 | + | if cret == 0 { | |
| 1596 | + | return nil, cerr | |
| 1597 | + | } | |
| 1598 | + | cls = &AppInfoBase{} | |
| 1599 | + | cls.Ptr = cret | |
| 1600 | + | if cerr == nil { | |
| 1601 | + | return cls, nil | |
| 1602 | + | } | |
| 1603 | + | return cls, cerr | |
| 1604 | + | ||
| 1605 | + | } | |
| 1606 | + | ||
| 1403 | 1607 | var xAppInfoGetFallbackForType func(string) *glib.List | |
| 1404 | 1608 | ||
| 1405 | - | // Gets a list of fallback #GAppInfos for a given content type, i.e. | |
| 1406 | - | // those applications which claim to support the given content type | |
| 1407 | - | // by MIME type subclassing and not directly. | |
| 1609 | + | // Gets a list of fallback [iface@Gio.AppInfo]s for a given content type, i.e. | |
| 1610 | + | // those applications which claim to support the given content type by MIME | |
| 1611 | + | // type subclassing and not directly. | |
| 1408 | 1612 | func AppInfoGetFallbackForType(ContentTypeVar string) *glib.List { | |
| 1409 | 1613 | ||
| 1410 | 1614 | cret := xAppInfoGetFallbackForType(ContentTypeVar) | |
| @@ -1413,12 +1617,13 @@ func AppInfoGetFallbackForType(ContentTypeVar string) *glib.List { | |||
| 1413 | 1617 | ||
| 1414 | 1618 | var xAppInfoGetRecommendedForType func(string) *glib.List | |
| 1415 | 1619 | ||
| 1416 | - | // Gets a list of recommended #GAppInfos for a given content type, i.e. | |
| 1417 | - | // those applications which claim to support the given content type exactly, | |
| 1418 | - | // and not by MIME type subclassing. | |
| 1620 | + | // Gets a list of recommended [iface@Gio.AppInfo]s for a given content type, | |
| 1621 | + | // i.e. those applications which claim to support the given content type | |
| 1622 | + | // exactly, and not by MIME type subclassing. | |
| 1623 | + | // | |
| 1419 | 1624 | // Note that the first application of the list is the last used one, i.e. | |
| 1420 | - | // the last one for which g_app_info_set_as_last_used_for_type() has been | |
| 1421 | - | // called. | |
| 1625 | + | // the last one for which [method@Gio.AppInfo.set_as_last_used_for_type] has | |
| 1626 | + | // been called. | |
| 1422 | 1627 | func AppInfoGetRecommendedForType(ContentTypeVar string) *glib.List { | |
| 1423 | 1628 | ||
| 1424 | 1629 | cret := xAppInfoGetRecommendedForType(ContentTypeVar) | |
| @@ -1427,14 +1632,13 @@ func AppInfoGetRecommendedForType(ContentTypeVar string) *glib.List { | |||
| 1427 | 1632 | ||
| 1428 | 1633 | var xAppInfoLaunchDefaultForUri func(string, uintptr, **glib.Error) bool | |
| 1429 | 1634 | ||
| 1430 | - | // Utility function that launches the default application | |
| 1431 | - | // registered to handle the specified uri. Synchronous I/O | |
| 1432 | - | // is done on the uri to detect the type of the file if | |
| 1433 | - | // required. | |
| 1635 | + | // Utility function that launches the default application registered to handle | |
| 1636 | + | // the specified uri. Synchronous I/O is done on the uri to detect the type of | |
| 1637 | + | // the file if required. | |
| 1434 | 1638 | // | |
| 1435 | - | // The D-Bus–activated applications don't have to be started if your application | |
| 1639 | + | // The D-Bus–activated applications don’t have to be started if your application | |
| 1436 | 1640 | // terminates too soon after this function. To prevent this, use | |
| 1437 | - | // g_app_info_launch_default_for_uri_async() instead. | |
| 1641 | + | // [func@Gio.AppInfo.launch_default_for_uri_async] instead. | |
| 1438 | 1642 | func AppInfoLaunchDefaultForUri(UriVar string, ContextVar *AppLaunchContext) (bool, error) { | |
| 1439 | 1643 | var cerr *glib.Error | |
| 1440 | 1644 | ||
| @@ -1448,12 +1652,11 @@ func AppInfoLaunchDefaultForUri(UriVar string, ContextVar *AppLaunchContext) (bo | |||
| 1448 | 1652 | ||
| 1449 | 1653 | var xAppInfoLaunchDefaultForUriAsync func(string, uintptr, uintptr, uintptr, uintptr) | |
| 1450 | 1654 | ||
| 1451 | - | // Async version of g_app_info_launch_default_for_uri(). | |
| 1655 | + | // Async version of [func@Gio.AppInfo.launch_default_for_uri]. | |
| 1452 | 1656 | // | |
| 1453 | - | // This version is useful if you are interested in receiving | |
| 1454 | - | // error information in the case where the application is | |
| 1455 | - | // sandboxed and the portal may present an application chooser | |
| 1456 | - | // dialog to the user. | |
| 1657 | + | // This version is useful if you are interested in receiving error information | |
| 1658 | + | // in the case where the application is sandboxed and the portal may present an | |
| 1659 | + | // application chooser dialog to the user. | |
| 1457 | 1660 | // | |
| 1458 | 1661 | // This is also useful if you want to be sure that the D-Bus–activated | |
| 1459 | 1662 | // applications are really started before termination and if you are interested | |
| @@ -1481,16 +1684,131 @@ func AppInfoLaunchDefaultForUriFinish(ResultVar AsyncResult) (bool, error) { | |||
| 1481 | 1684 | var xAppInfoResetTypeAssociations func(string) | |
| 1482 | 1685 | ||
| 1483 | 1686 | // Removes all changes to the type associations done by | |
| 1484 | - | // g_app_info_set_as_default_for_type(), | |
| 1485 | - | // g_app_info_set_as_default_for_extension(), | |
| 1486 | - | // g_app_info_add_supports_type() or | |
| 1487 | - | // g_app_info_remove_supports_type(). | |
| 1687 | + | // [method@Gio.AppInfo.set_as_default_for_type], | |
| 1688 | + | // [method@Gio.AppInfo.set_as_default_for_extension], | |
| 1689 | + | // [method@Gio.AppInfo.add_supports_type] or | |
| 1690 | + | // [method@Gio.AppInfo.remove_supports_type]. | |
| 1488 | 1691 | func AppInfoResetTypeAssociations(ContentTypeVar string) { | |
| 1489 | 1692 | ||
| 1490 | 1693 | xAppInfoResetTypeAssociations(ContentTypeVar) | |
| 1491 | 1694 | ||
| 1492 | 1695 | } | |
| 1493 | 1696 | ||
| 1697 | + | // `GAppInfoMonitor` monitors application information for changes. | |
| 1698 | + | // | |
| 1699 | + | // `GAppInfoMonitor` is a very simple object used for monitoring the app | |
| 1700 | + | // info database for changes (newly installed or removed applications). | |
| 1701 | + | // | |
| 1702 | + | // Call [func@Gio.AppInfoMonitor.get] to get a `GAppInfoMonitor` and connect | |
| 1703 | + | // to the [signal@Gio.AppInfoMonitor::changed] signal. The signal will be emitted once when | |
| 1704 | + | // the app info database changes, and will not be emitted again until after the | |
| 1705 | + | // next call to [func@Gio.AppInfo.get_all] or another `g_app_info_*()` function. | |
| 1706 | + | // This is because monitoring the app info database for changes is expensive. | |
| 1707 | + | // | |
| 1708 | + | // The following functions will re-arm the [signal@Gio.AppInfoMonitor::changed] | |
| 1709 | + | // signal so it can be emitted again: | |
| 1710 | + | // | |
| 1711 | + | // - [func@Gio.AppInfo.get_all] | |
| 1712 | + | // - [func@Gio.AppInfo.get_all_for_type] | |
| 1713 | + | // - [func@Gio.AppInfo.get_default_for_type] | |
| 1714 | + | // - [func@Gio.AppInfo.get_fallback_for_type] | |
| 1715 | + | // - [func@Gio.AppInfo.get_recommended_for_type] | |
| 1716 | + | // - [`g_desktop_app_info_get_implementations()`](../gio-unix/type_func.DesktopAppInfo.get_implementation.html) | |
| 1717 | + | // - [`g_desktop_app_info_new()`](../gio-unix/ctor.DesktopAppInfo.new.html) | |
| 1718 | + | // - [`g_desktop_app_info_new_from_filename()`](../gio-unix/ctor.DesktopAppInfo.new_from_filename.html) | |
| 1719 | + | // - [`g_desktop_app_info_new_from_keyfile()`](../gio-unix/ctor.DesktopAppInfo.new_from_keyfile.html) | |
| 1720 | + | // - [`g_desktop_app_info_search()`](../gio-unix/type_func.DesktopAppInfo.search.html) | |
| 1721 | + | // | |
| 1722 | + | // The latter functions are available if using | |
| 1723 | + | // [`GDesktopAppInfo`](../gio-unix/class.DesktopAppInfo.html) from | |
| 1724 | + | // `gio-unix-2.0.pc` (GIR namespace `GioUnix-2.0`). | |
| 1725 | + | // | |
| 1726 | + | // In the usual case, applications should try to make note of the change | |
| 1727 | + | // (doing things like invalidating caches) but not act on it. In | |
| 1728 | + | // particular, applications should avoid making calls to `GAppInfo` APIs | |
| 1729 | + | // in response to the change signal, deferring these until the time that | |
| 1730 | + | // the updated data is actually required. The exception to this case is when | |
| 1731 | + | // application information is actually being displayed on the screen | |
| 1732 | + | // (for example, during a search or when the list of all applications is shown). | |
| 1733 | + | // The reason for this is that changes to the list of installed applications | |
| 1734 | + | // often come in groups (like during system updates) and rescanning the list | |
| 1735 | + | // on every change is pointless and expensive. | |
| 1736 | + | type AppInfoMonitor struct { | |
| 1737 | + | gobject.Object | |
| 1738 | + | } | |
| 1739 | + | ||
| 1740 | + | var xAppInfoMonitorGLibType func() types.GType | |
| 1741 | + | ||
| 1742 | + | func AppInfoMonitorGLibType() types.GType { | |
| 1743 | + | return xAppInfoMonitorGLibType() | |
| 1744 | + | } | |
| 1745 | + | ||
| 1746 | + | func AppInfoMonitorNewFromInternalPtr(ptr uintptr) *AppInfoMonitor { | |
| 1747 | + | cls := &AppInfoMonitor{} | |
| 1748 | + | cls.Ptr = ptr | |
| 1749 | + | return cls | |
| 1750 | + | } | |
| 1751 | + | ||
| 1752 | + | func (c *AppInfoMonitor) GoPointer() uintptr { | |
| 1753 | + | if c == nil { | |
| 1754 | + | return 0 | |
| 1755 | + | } | |
| 1756 | + | return c.Ptr | |
| 1757 | + | } | |
| 1758 | + | ||
| 1759 | + | func (c *AppInfoMonitor) SetGoPointer(ptr uintptr) { | |
| 1760 | + | c.Ptr = ptr | |
| 1761 | + | } | |
| 1762 | + | ||
| 1763 | + | // Signal emitted when the app info database changes, when applications are | |
| 1764 | + | // installed or removed. | |
| 1765 | + | func (x *AppInfoMonitor) ConnectChanged(cb *func(AppInfoMonitor)) uint32 { | |
| 1766 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 1767 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 1768 | + | return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr) | |
| 1769 | + | } | |
| 1770 | + | ||
| 1771 | + | fcb := func(clsPtr uintptr) { | |
| 1772 | + | fa := AppInfoMonitor{} | |
| 1773 | + | fa.Ptr = clsPtr | |
| 1774 | + | cbFn := *cb | |
| 1775 | + | ||
| 1776 | + | cbFn(fa) | |
| 1777 | + | ||
| 1778 | + | } | |
| 1779 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 1780 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 1781 | + | return gobject.SignalConnect(x.GoPointer(), "changed", cbRefPtr) | |
| 1782 | + | } | |
| 1783 | + | ||
| 1784 | + | var xAppInfoMonitorGet func() uintptr | |
| 1785 | + | ||
| 1786 | + | // Gets the #GAppInfoMonitor for the current thread-default main | |
| 1787 | + | // context. | |
| 1788 | + | // | |
| 1789 | + | // The #GAppInfoMonitor will emit a “changed” signal in the | |
| 1790 | + | // thread-default main context whenever the list of installed | |
| 1791 | + | // applications (as reported by g_app_info_get_all()) may have changed. | |
| 1792 | + | // | |
| 1793 | + | // The #GAppInfoMonitor::changed signal will only be emitted once until | |
| 1794 | + | // g_app_info_get_all() (or another `g_app_info_*()` function) is called. Doing | |
| 1795 | + | // so will re-arm the signal ready to notify about the next change. | |
| 1796 | + | // | |
| 1797 | + | // You must only call g_object_unref() on the return value from under | |
| 1798 | + | // the same main context as you created it. | |
| 1799 | + | func AppInfoMonitorGet() *AppInfoMonitor { | |
| 1800 | + | var cls *AppInfoMonitor | |
| 1801 | + | ||
| 1802 | + | cret := xAppInfoMonitorGet() | |
| 1803 | + | ||
| 1804 | + | if cret == 0 { | |
| 1805 | + | return nil | |
| 1806 | + | } | |
| 1807 | + | cls = &AppInfoMonitor{} | |
| 1808 | + | cls.Ptr = cret | |
| 1809 | + | return cls | |
| 1810 | + | } | |
| 1811 | + | ||
| 1494 | 1812 | // Integrating the launch with the launching application. This is used to | |
| 1495 | 1813 | // handle for instance startup notification and launching the new application | |
| 1496 | 1814 | // on the same screen as the launching window. | |
| @@ -1513,7 +1831,8 @@ func AppLaunchContextNewFromInternalPtr(ptr uintptr) *AppLaunchContext { | |||
| 1513 | 1831 | var xNewAppLaunchContext func() uintptr | |
| 1514 | 1832 | ||
| 1515 | 1833 | // Creates a new application launch context. This is not normally used, | |
| 1516 | - | // instead you instantiate a subclass of this, such as #GdkAppLaunchContext. | |
| 1834 | + | // instead you instantiate a subclass of this, such as | |
| 1835 | + | // [`GdkAppLaunchContext`](https://docs.gtk.org/gdk4/class.AppLaunchContext.html). | |
| 1517 | 1836 | func NewAppLaunchContext() *AppLaunchContext { | |
| 1518 | 1837 | var cls *AppLaunchContext | |
| 1519 | 1838 | ||
| @@ -1542,7 +1861,7 @@ var xAppLaunchContextGetEnvironment func(uintptr) []string | |||
| 1542 | 1861 | ||
| 1543 | 1862 | // Gets the complete environment variable list to be passed to | |
| 1544 | 1863 | // the child process when @context is used to launch an application. | |
| 1545 | - | // This is a %NULL-terminated array of strings, where each string has | |
| 1864 | + | // This is a `NULL`-terminated array of strings, where each string has | |
| 1546 | 1865 | // the form `KEY=VALUE`. | |
| 1547 | 1866 | func (x *AppLaunchContext) GetEnvironment() []string { | |
| 1548 | 1867 | ||
| @@ -1553,10 +1872,20 @@ func (x *AppLaunchContext) GetEnvironment() []string { | |||
| 1553 | 1872 | var xAppLaunchContextGetStartupNotifyId func(uintptr, uintptr, *glib.List) string | |
| 1554 | 1873 | ||
| 1555 | 1874 | // Initiates startup notification for the application and returns the | |
| 1556 | - | // `DESKTOP_STARTUP_ID` for the launched operation, if supported. | |
| 1875 | + | // `XDG_ACTIVATION_TOKEN` or `DESKTOP_STARTUP_ID` for the launched operation, | |
| 1876 | + | // if supported. | |
| 1557 | 1877 | // | |
| 1558 | - | // Startup notification IDs are defined in the | |
| 1559 | - | // [FreeDesktop.Org Startup Notifications standard](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). | |
| 1878 | + | // The returned token may be referred to equivalently as an ‘activation token’ | |
| 1879 | + | // (using Wayland terminology) or a ‘startup sequence ID’ (using X11 terminology). | |
| 1880 | + | // The two [are interoperable](https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/main/staging/xdg-activation/x11-interoperation.rst). | |
| 1881 | + | // | |
| 1882 | + | // Activation tokens are defined in the [XDG Activation Protocol](https://wayland.app/protocols/xdg-activation-v1), | |
| 1883 | + | // and startup notification IDs are defined in the | |
| 1884 | + | // [freedesktop.org Startup Notification Protocol](http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt). | |
| 1885 | + | // | |
| 1886 | + | // Support for the XDG Activation Protocol was added in GLib 2.76. | |
| 1887 | + | // Since GLib 2.82 @info and @files can be `NULL`. If that’s not supported by the backend, | |
| 1888 | + | // the returned token will be `NULL`. | |
| 1560 | 1889 | func (x *AppLaunchContext) GetStartupNotifyId(InfoVar AppInfo, FilesVar *glib.List) string { | |
| 1561 | 1890 | ||
| 1562 | 1891 | cret := xAppLaunchContextGetStartupNotifyId(x.GoPointer(), InfoVar.GoPointer(), FilesVar) | |
| @@ -1566,7 +1895,8 @@ func (x *AppLaunchContext) GetStartupNotifyId(InfoVar AppInfo, FilesVar *glib.Li | |||
| 1566 | 1895 | var xAppLaunchContextLaunchFailed func(uintptr, string) | |
| 1567 | 1896 | ||
| 1568 | 1897 | // Called when an application has failed to launch, so that it can cancel | |
| 1569 | - | // the application startup notification started in g_app_launch_context_get_startup_notify_id(). | |
| 1898 | + | // the application startup notification started in | |
| 1899 | + | // [method@Gio.AppLaunchContext.get_startup_notify_id]. | |
| 1570 | 1900 | func (x *AppLaunchContext) LaunchFailed(StartupNotifyIdVar string) { | |
| 1571 | 1901 | ||
| 1572 | 1902 | xAppLaunchContextLaunchFailed(x.GoPointer(), StartupNotifyIdVar) | |
| @@ -1575,8 +1905,8 @@ func (x *AppLaunchContext) LaunchFailed(StartupNotifyIdVar string) { | |||
| 1575 | 1905 | ||
| 1576 | 1906 | var xAppLaunchContextSetenv func(uintptr, string, string) | |
| 1577 | 1907 | ||
| 1578 | - | // Arranges for @variable to be set to @value in the child's | |
| 1579 | - | // environment when @context is used to launch an application. | |
| 1908 | + | // Arranges for @variable to be set to @value in the child’s environment when | |
| 1909 | + | // @context is used to launch an application. | |
| 1580 | 1910 | func (x *AppLaunchContext) Setenv(VariableVar string, ValueVar string) { | |
| 1581 | 1911 | ||
| 1582 | 1912 | xAppLaunchContextSetenv(x.GoPointer(), VariableVar, ValueVar) | |
| @@ -1585,8 +1915,8 @@ func (x *AppLaunchContext) Setenv(VariableVar string, ValueVar string) { | |||
| 1585 | 1915 | ||
| 1586 | 1916 | var xAppLaunchContextUnsetenv func(uintptr, string) | |
| 1587 | 1917 | ||
| 1588 | - | // Arranges for @variable to be unset in the child's environment | |
| 1589 | - | // when @context is used to launch an application. | |
| 1918 | + | // Arranges for @variable to be unset in the child’s environment when @context | |
| 1919 | + | // is used to launch an application. | |
| 1590 | 1920 | func (x *AppLaunchContext) Unsetenv(VariableVar string) { | |
| 1591 | 1921 | ||
| 1592 | 1922 | xAppLaunchContextUnsetenv(x.GoPointer(), VariableVar) | |
| @@ -1604,9 +1934,13 @@ func (c *AppLaunchContext) SetGoPointer(ptr uintptr) { | |||
| 1604 | 1934 | c.Ptr = ptr | |
| 1605 | 1935 | } | |
| 1606 | 1936 | ||
| 1607 | - | // The #GAppLaunchContext::launch-failed signal is emitted when a #GAppInfo launch | |
| 1608 | - | // fails. The startup notification id is provided, so that the launcher | |
| 1609 | - | // can cancel the startup notification. | |
| 1937 | + | // The [signal@Gio.AppLaunchContext::launch-failed] signal is emitted when a | |
| 1938 | + | // [iface@Gio.AppInfo] launch fails. The startup notification id is provided, | |
| 1939 | + | // so that the launcher can cancel the startup notification. | |
| 1940 | + | // | |
| 1941 | + | // Because a launch operation may involve spawning multiple instances of the | |
| 1942 | + | // target application, you should expect this signal to be emitted multiple | |
| 1943 | + | // times, one for each spawned instance. | |
| 1610 | 1944 | func (x *AppLaunchContext) ConnectLaunchFailed(cb *func(AppLaunchContext, string)) uint32 { | |
| 1611 | 1945 | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 1612 | 1946 | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| @@ -1626,11 +1960,11 @@ func (x *AppLaunchContext) ConnectLaunchFailed(cb *func(AppLaunchContext, string | |||
| 1626 | 1960 | return gobject.SignalConnect(x.GoPointer(), "launch-failed", cbRefPtr) | |
| 1627 | 1961 | } | |
| 1628 | 1962 | ||
| 1629 | - | // The #GAppLaunchContext::launch-started signal is emitted when a #GAppInfo is | |
| 1630 | - | // about to be launched. If non-null the @platform_data is an | |
| 1631 | - | // GVariant dictionary mapping strings to variants (ie `a{sv}`), which | |
| 1632 | - | // contains additional, platform-specific data about this launch. On | |
| 1633 | - | // UNIX, at least the `startup-notification-id` keys will be | |
| 1963 | + | // The [signal@Gio.AppLaunchContext::launch-started] signal is emitted when a | |
| 1964 | + | // [iface@Gio.AppInfo] is about to be launched. If non-null the | |
| 1965 | + | // @platform_data is an GVariant dictionary mapping strings to variants | |
| 1966 | + | // (ie `a{sv}`), which contains additional, platform-specific data about this | |
| 1967 | + | // launch. On UNIX, at least the `startup-notification-id` keys will be | |
| 1634 | 1968 | // present. | |
| 1635 | 1969 | // | |
| 1636 | 1970 | // The value of the `startup-notification-id` key (type `s`) is a startup | |
| @@ -1638,8 +1972,13 @@ func (x *AppLaunchContext) ConnectLaunchFailed(cb *func(AppLaunchContext, string | |||
| 1638 | 1972 | // specification](https://specifications.freedesktop.org/startup-notification-spec/startup-notification-0.1.txt). | |
| 1639 | 1973 | // It allows tracking the progress of the launchee through startup. | |
| 1640 | 1974 | // | |
| 1641 | - | // It is guaranteed that this signal is followed by either a #GAppLaunchContext::launched or | |
| 1642 | - | // #GAppLaunchContext::launch-failed signal. | |
| 1975 | + | // It is guaranteed that this signal is followed by either a | |
| 1976 | + | // [signal@Gio.AppLaunchContext::launched] or | |
| 1977 | + | // [signal@Gio.AppLaunchContext::launch-failed] signal. | |
| 1978 | + | // | |
| 1979 | + | // Because a launch operation may involve spawning multiple instances of the | |
| 1980 | + | // target application, you should expect this signal to be emitted multiple | |
| 1981 | + | // times, one for each spawned instance. | |
| 1643 | 1982 | func (x *AppLaunchContext) ConnectLaunchStarted(cb *func(AppLaunchContext, uintptr, uintptr)) uint32 { | |
| 1644 | 1983 | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 1645 | 1984 | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| @@ -1659,15 +1998,27 @@ func (x *AppLaunchContext) ConnectLaunchStarted(cb *func(AppLaunchContext, uintp | |||
| 1659 | 1998 | return gobject.SignalConnect(x.GoPointer(), "launch-started", cbRefPtr) | |
| 1660 | 1999 | } | |
| 1661 | 2000 | ||
| 1662 | - | // The #GAppLaunchContext::launched signal is emitted when a #GAppInfo is successfully | |
| 1663 | - | // launched. The @platform_data is an GVariant dictionary mapping | |
| 2001 | + | // The [signal@Gio.AppLaunchContext::launched] signal is emitted when a | |
| 2002 | + | // [iface@Gio.AppInfo] is successfully launched. | |
| 2003 | + | // | |
| 2004 | + | // Because a launch operation may involve spawning multiple instances of the | |
| 2005 | + | // target application, you should expect this signal to be emitted multiple | |
| 2006 | + | // times, one time for each spawned instance. | |
| 2007 | + | // | |
| 2008 | + | // The @platform_data is an GVariant dictionary mapping | |
| 1664 | 2009 | // strings to variants (ie `a{sv}`), which contains additional, | |
| 1665 | 2010 | // platform-specific data about this launch. On UNIX, at least the | |
| 1666 | 2011 | // `pid` and `startup-notification-id` keys will be present. | |
| 1667 | 2012 | // | |
| 1668 | - | // Since 2.72 the `pid` may be 0 if the process id wasn't known (for | |
| 2013 | + | // Since 2.72 the `pid` may be 0 if the process id wasn’t known (for | |
| 1669 | 2014 | // example if the process was launched via D-Bus). The `pid` may not be | |
| 1670 | 2015 | // set at all in subsequent releases. | |
| 2016 | + | // | |
| 2017 | + | // On Windows, `pid` is guaranteed to be valid only for the duration of the | |
| 2018 | + | // [signal@Gio.AppLaunchContext::launched] signal emission; after the signal | |
| 2019 | + | // is emitted, GLib will call [func@GLib.spawn_close_pid]. If you need to | |
| 2020 | + | // keep the [alias@GLib.Pid] after the signal has been emitted, then you can | |
| 2021 | + | // duplicate `pid` using `DuplicateHandle()`. | |
| 1671 | 2022 | func (x *AppLaunchContext) ConnectLaunched(cb *func(AppLaunchContext, uintptr, uintptr)) uint32 { | |
| 1672 | 2023 | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 1673 | 2024 | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| @@ -1699,7 +2050,11 @@ func init() { | |||
| 1699 | 2050 | core.PuregoSafeRegister(&xAppInfoGetAll, lib, "g_app_info_get_all") | |
| 1700 | 2051 | core.PuregoSafeRegister(&xAppInfoGetAllForType, lib, "g_app_info_get_all_for_type") | |
| 1701 | 2052 | core.PuregoSafeRegister(&xAppInfoGetDefaultForType, lib, "g_app_info_get_default_for_type") | |
| 2053 | + | core.PuregoSafeRegister(&xAppInfoGetDefaultForTypeAsync, lib, "g_app_info_get_default_for_type_async") | |
| 2054 | + | core.PuregoSafeRegister(&xAppInfoGetDefaultForTypeFinish, lib, "g_app_info_get_default_for_type_finish") | |
| 1702 | 2055 | core.PuregoSafeRegister(&xAppInfoGetDefaultForUriScheme, lib, "g_app_info_get_default_for_uri_scheme") | |
| 2056 | + | core.PuregoSafeRegister(&xAppInfoGetDefaultForUriSchemeAsync, lib, "g_app_info_get_default_for_uri_scheme_async") | |
| 2057 | + | core.PuregoSafeRegister(&xAppInfoGetDefaultForUriSchemeFinish, lib, "g_app_info_get_default_for_uri_scheme_finish") | |
| 1703 | 2058 | core.PuregoSafeRegister(&xAppInfoGetFallbackForType, lib, "g_app_info_get_fallback_for_type") | |
| 1704 | 2059 | core.PuregoSafeRegister(&xAppInfoGetRecommendedForType, lib, "g_app_info_get_recommended_for_type") | |
| 1705 | 2060 | core.PuregoSafeRegister(&xAppInfoLaunchDefaultForUri, lib, "g_app_info_launch_default_for_uri") | |
| @@ -1707,6 +2062,10 @@ func init() { | |||
| 1707 | 2062 | core.PuregoSafeRegister(&xAppInfoLaunchDefaultForUriFinish, lib, "g_app_info_launch_default_for_uri_finish") | |
| 1708 | 2063 | core.PuregoSafeRegister(&xAppInfoResetTypeAssociations, lib, "g_app_info_reset_type_associations") | |
| 1709 | 2064 | ||
| 2065 | + | core.PuregoSafeRegister(&xAppInfoMonitorGLibType, lib, "g_app_info_monitor_get_type") | |
| 2066 | + | ||
| 2067 | + | core.PuregoSafeRegister(&xAppInfoMonitorGet, lib, "g_app_info_monitor_get") | |
| 2068 | + | ||
| 1710 | 2069 | core.PuregoSafeRegister(&xAppLaunchContextGLibType, lib, "g_app_launch_context_get_type") | |
| 1711 | 2070 | ||
| 1712 | 2071 | core.PuregoSafeRegister(&xNewAppLaunchContext, lib, "g_app_launch_context_new") | |
M v4/gio/gapplication.go +288 -117
| @@ -56,6 +56,7 @@ func (x *ApplicationClass) GoPointer() uintptr { | |||
| 56 | 56 | } | |
| 57 | 57 | ||
| 58 | 58 | // OverrideStartup sets the callback function. | |
| 59 | + | // invoked on the primary instance immediately after registration | |
| 59 | 60 | func (x *ApplicationClass) OverrideStartup(cb func(*Application)) { | |
| 60 | 61 | if cb == nil { | |
| 61 | 62 | x.xStartup = 0 | |
| @@ -67,6 +68,7 @@ func (x *ApplicationClass) OverrideStartup(cb func(*Application)) { | |||
| 67 | 68 | } | |
| 68 | 69 | ||
| 69 | 70 | // GetStartup gets the callback function. | |
| 71 | + | // invoked on the primary instance immediately after registration | |
| 70 | 72 | func (x *ApplicationClass) GetStartup() func(*Application) { | |
| 71 | 73 | if x.xStartup == 0 { | |
| 72 | 74 | return nil | |
| @@ -79,6 +81,7 @@ func (x *ApplicationClass) GetStartup() func(*Application) { | |||
| 79 | 81 | } | |
| 80 | 82 | ||
| 81 | 83 | // OverrideActivate sets the callback function. | |
| 84 | + | // invoked on the primary instance when an activation occurs | |
| 82 | 85 | func (x *ApplicationClass) OverrideActivate(cb func(*Application)) { | |
| 83 | 86 | if cb == nil { | |
| 84 | 87 | x.xActivate = 0 | |
| @@ -90,6 +93,7 @@ func (x *ApplicationClass) OverrideActivate(cb func(*Application)) { | |||
| 90 | 93 | } | |
| 91 | 94 | ||
| 92 | 95 | // GetActivate gets the callback function. | |
| 96 | + | // invoked on the primary instance when an activation occurs | |
| 93 | 97 | func (x *ApplicationClass) GetActivate() func(*Application) { | |
| 94 | 98 | if x.xActivate == 0 { | |
| 95 | 99 | return nil | |
| @@ -102,6 +106,7 @@ func (x *ApplicationClass) GetActivate() func(*Application) { | |||
| 102 | 106 | } | |
| 103 | 107 | ||
| 104 | 108 | // OverrideOpen sets the callback function. | |
| 109 | + | // invoked on the primary instance when there are files to open | |
| 105 | 110 | func (x *ApplicationClass) OverrideOpen(cb func(*Application, uintptr, int, string)) { | |
| 106 | 111 | if cb == nil { | |
| 107 | 112 | x.xOpen = 0 | |
| @@ -113,6 +118,7 @@ func (x *ApplicationClass) OverrideOpen(cb func(*Application, uintptr, int, stri | |||
| 113 | 118 | } | |
| 114 | 119 | ||
| 115 | 120 | // GetOpen gets the callback function. | |
| 121 | + | // invoked on the primary instance when there are files to open | |
| 116 | 122 | func (x *ApplicationClass) GetOpen() func(*Application, uintptr, int, string) { | |
| 117 | 123 | if x.xOpen == 0 { | |
| 118 | 124 | return nil | |
| @@ -125,6 +131,9 @@ func (x *ApplicationClass) GetOpen() func(*Application, uintptr, int, string) { | |||
| 125 | 131 | } | |
| 126 | 132 | ||
| 127 | 133 | // OverrideCommandLine sets the callback function. | |
| 134 | + | // invoked on the primary instance when a command-line is | |
| 135 | + | // | |
| 136 | + | // not handled locally | |
| 128 | 137 | func (x *ApplicationClass) OverrideCommandLine(cb func(*Application, *ApplicationCommandLine) int) { | |
| 129 | 138 | if cb == nil { | |
| 130 | 139 | x.xCommandLine = 0 | |
| @@ -136,6 +145,9 @@ func (x *ApplicationClass) OverrideCommandLine(cb func(*Application, *Applicatio | |||
| 136 | 145 | } | |
| 137 | 146 | ||
| 138 | 147 | // GetCommandLine gets the callback function. | |
| 148 | + | // invoked on the primary instance when a command-line is | |
| 149 | + | // | |
| 150 | + | // not handled locally | |
| 139 | 151 | func (x *ApplicationClass) GetCommandLine() func(*Application, *ApplicationCommandLine) int { | |
| 140 | 152 | if x.xCommandLine == 0 { | |
| 141 | 153 | return nil | |
| @@ -148,6 +160,12 @@ func (x *ApplicationClass) GetCommandLine() func(*Application, *ApplicationComma | |||
| 148 | 160 | } | |
| 149 | 161 | ||
| 150 | 162 | // OverrideLocalCommandLine sets the callback function. | |
| 163 | + | // invoked (locally). The virtual function has the chance | |
| 164 | + | // | |
| 165 | + | // to inspect (and possibly replace) command line arguments. See | |
| 166 | + | // g_application_run() for more information. Also see the | |
| 167 | + | // #GApplication::handle-local-options signal, which is a simpler | |
| 168 | + | // alternative to handling some commandline options locally | |
| 151 | 169 | func (x *ApplicationClass) OverrideLocalCommandLine(cb func(*Application, []string, int) bool) { | |
| 152 | 170 | if cb == nil { | |
| 153 | 171 | x.xLocalCommandLine = 0 | |
| @@ -159,6 +177,12 @@ func (x *ApplicationClass) OverrideLocalCommandLine(cb func(*Application, []stri | |||
| 159 | 177 | } | |
| 160 | 178 | ||
| 161 | 179 | // GetLocalCommandLine gets the callback function. | |
| 180 | + | // invoked (locally). The virtual function has the chance | |
| 181 | + | // | |
| 182 | + | // to inspect (and possibly replace) command line arguments. See | |
| 183 | + | // g_application_run() for more information. Also see the | |
| 184 | + | // #GApplication::handle-local-options signal, which is a simpler | |
| 185 | + | // alternative to handling some commandline options locally | |
| 162 | 186 | func (x *ApplicationClass) GetLocalCommandLine() func(*Application, []string, int) bool { | |
| 163 | 187 | if x.xLocalCommandLine == 0 { | |
| 164 | 188 | return nil | |
| @@ -171,6 +195,10 @@ func (x *ApplicationClass) GetLocalCommandLine() func(*Application, []string, in | |||
| 171 | 195 | } | |
| 172 | 196 | ||
| 173 | 197 | // OverrideBeforeEmit sets the callback function. | |
| 198 | + | // invoked on the primary instance before 'activate', 'open', | |
| 199 | + | // | |
| 200 | + | // 'command-line' or any action invocation, gets the 'platform data' from | |
| 201 | + | // the calling instance | |
| 174 | 202 | func (x *ApplicationClass) OverrideBeforeEmit(cb func(*Application, *glib.Variant)) { | |
| 175 | 203 | if cb == nil { | |
| 176 | 204 | x.xBeforeEmit = 0 | |
| @@ -182,6 +210,10 @@ func (x *ApplicationClass) OverrideBeforeEmit(cb func(*Application, *glib.Varian | |||
| 182 | 210 | } | |
| 183 | 211 | ||
| 184 | 212 | // GetBeforeEmit gets the callback function. | |
| 213 | + | // invoked on the primary instance before 'activate', 'open', | |
| 214 | + | // | |
| 215 | + | // 'command-line' or any action invocation, gets the 'platform data' from | |
| 216 | + | // the calling instance | |
| 185 | 217 | func (x *ApplicationClass) GetBeforeEmit() func(*Application, *glib.Variant) { | |
| 186 | 218 | if x.xBeforeEmit == 0 { | |
| 187 | 219 | return nil | |
| @@ -194,6 +226,10 @@ func (x *ApplicationClass) GetBeforeEmit() func(*Application, *glib.Variant) { | |||
| 194 | 226 | } | |
| 195 | 227 | ||
| 196 | 228 | // OverrideAfterEmit sets the callback function. | |
| 229 | + | // invoked on the primary instance after 'activate', 'open', | |
| 230 | + | // | |
| 231 | + | // 'command-line' or any action invocation, gets the 'platform data' from | |
| 232 | + | // the calling instance | |
| 197 | 233 | func (x *ApplicationClass) OverrideAfterEmit(cb func(*Application, *glib.Variant)) { | |
| 198 | 234 | if cb == nil { | |
| 199 | 235 | x.xAfterEmit = 0 | |
| @@ -205,6 +241,10 @@ func (x *ApplicationClass) OverrideAfterEmit(cb func(*Application, *glib.Variant | |||
| 205 | 241 | } | |
| 206 | 242 | ||
| 207 | 243 | // GetAfterEmit gets the callback function. | |
| 244 | + | // invoked on the primary instance after 'activate', 'open', | |
| 245 | + | // | |
| 246 | + | // 'command-line' or any action invocation, gets the 'platform data' from | |
| 247 | + | // the calling instance | |
| 208 | 248 | func (x *ApplicationClass) GetAfterEmit() func(*Application, *glib.Variant) { | |
| 209 | 249 | if x.xAfterEmit == 0 { | |
| 210 | 250 | return nil | |
| @@ -217,6 +257,9 @@ func (x *ApplicationClass) GetAfterEmit() func(*Application, *glib.Variant) { | |||
| 217 | 257 | } | |
| 218 | 258 | ||
| 219 | 259 | // OverrideAddPlatformData sets the callback function. | |
| 260 | + | // invoked (locally) to add 'platform data' to be sent to | |
| 261 | + | // | |
| 262 | + | // the primary instance when activating, opening or invoking actions | |
| 220 | 263 | func (x *ApplicationClass) OverrideAddPlatformData(cb func(*Application, *glib.VariantBuilder)) { | |
| 221 | 264 | if cb == nil { | |
| 222 | 265 | x.xAddPlatformData = 0 | |
| @@ -228,6 +271,9 @@ func (x *ApplicationClass) OverrideAddPlatformData(cb func(*Application, *glib.V | |||
| 228 | 271 | } | |
| 229 | 272 | ||
| 230 | 273 | // GetAddPlatformData gets the callback function. | |
| 274 | + | // invoked (locally) to add 'platform data' to be sent to | |
| 275 | + | // | |
| 276 | + | // the primary instance when activating, opening or invoking actions | |
| 231 | 277 | func (x *ApplicationClass) GetAddPlatformData() func(*Application, *glib.VariantBuilder) { | |
| 232 | 278 | if x.xAddPlatformData == 0 { | |
| 233 | 279 | return nil | |
| @@ -240,6 +286,10 @@ func (x *ApplicationClass) GetAddPlatformData() func(*Application, *glib.Variant | |||
| 240 | 286 | } | |
| 241 | 287 | ||
| 242 | 288 | // OverrideQuitMainloop sets the callback function. | |
| 289 | + | // Used to be invoked on the primary instance when the use | |
| 290 | + | // | |
| 291 | + | // count of the application drops to zero (and after any inactivity | |
| 292 | + | // timeout, if requested). Not used anymore since 2.32 | |
| 243 | 293 | func (x *ApplicationClass) OverrideQuitMainloop(cb func(*Application)) { | |
| 244 | 294 | if cb == nil { | |
| 245 | 295 | x.xQuitMainloop = 0 | |
| @@ -251,6 +301,10 @@ func (x *ApplicationClass) OverrideQuitMainloop(cb func(*Application)) { | |||
| 251 | 301 | } | |
| 252 | 302 | ||
| 253 | 303 | // GetQuitMainloop gets the callback function. | |
| 304 | + | // Used to be invoked on the primary instance when the use | |
| 305 | + | // | |
| 306 | + | // count of the application drops to zero (and after any inactivity | |
| 307 | + | // timeout, if requested). Not used anymore since 2.32 | |
| 254 | 308 | func (x *ApplicationClass) GetQuitMainloop() func(*Application) { | |
| 255 | 309 | if x.xQuitMainloop == 0 { | |
| 256 | 310 | return nil | |
| @@ -263,6 +317,11 @@ func (x *ApplicationClass) GetQuitMainloop() func(*Application) { | |||
| 263 | 317 | } | |
| 264 | 318 | ||
| 265 | 319 | // OverrideRunMainloop sets the callback function. | |
| 320 | + | // Used to be invoked on the primary instance from | |
| 321 | + | // | |
| 322 | + | // g_application_run() if the use-count is non-zero. Since 2.32, | |
| 323 | + | // GApplication is iterating the main context directly and is not | |
| 324 | + | // using @run_mainloop anymore | |
| 266 | 325 | func (x *ApplicationClass) OverrideRunMainloop(cb func(*Application)) { | |
| 267 | 326 | if cb == nil { | |
| 268 | 327 | x.xRunMainloop = 0 | |
| @@ -274,6 +333,11 @@ func (x *ApplicationClass) OverrideRunMainloop(cb func(*Application)) { | |||
| 274 | 333 | } | |
| 275 | 334 | ||
| 276 | 335 | // GetRunMainloop gets the callback function. | |
| 336 | + | // Used to be invoked on the primary instance from | |
| 337 | + | // | |
| 338 | + | // g_application_run() if the use-count is non-zero. Since 2.32, | |
| 339 | + | // GApplication is iterating the main context directly and is not | |
| 340 | + | // using @run_mainloop anymore | |
| 277 | 341 | func (x *ApplicationClass) GetRunMainloop() func(*Application) { | |
| 278 | 342 | if x.xRunMainloop == 0 { | |
| 279 | 343 | return nil | |
| @@ -286,6 +350,9 @@ func (x *ApplicationClass) GetRunMainloop() func(*Application) { | |||
| 286 | 350 | } | |
| 287 | 351 | ||
| 288 | 352 | // OverrideShutdown sets the callback function. | |
| 353 | + | // invoked only on the registered primary instance immediately | |
| 354 | + | // | |
| 355 | + | // after the main loop terminates | |
| 289 | 356 | func (x *ApplicationClass) OverrideShutdown(cb func(*Application)) { | |
| 290 | 357 | if cb == nil { | |
| 291 | 358 | x.xShutdown = 0 | |
| @@ -297,6 +364,9 @@ func (x *ApplicationClass) OverrideShutdown(cb func(*Application)) { | |||
| 297 | 364 | } | |
| 298 | 365 | ||
| 299 | 366 | // GetShutdown gets the callback function. | |
| 367 | + | // invoked only on the registered primary instance immediately | |
| 368 | + | // | |
| 369 | + | // after the main loop terminates | |
| 300 | 370 | func (x *ApplicationClass) GetShutdown() func(*Application) { | |
| 301 | 371 | if x.xShutdown == 0 { | |
| 302 | 372 | return nil | |
| @@ -309,6 +379,14 @@ func (x *ApplicationClass) GetShutdown() func(*Application) { | |||
| 309 | 379 | } | |
| 310 | 380 | ||
| 311 | 381 | // OverrideDbusRegister sets the callback function. | |
| 382 | + | // invoked locally during registration, if the application is | |
| 383 | + | // | |
| 384 | + | // using its D-Bus backend. You can use this to export extra objects on the | |
| 385 | + | // bus, that need to exist before the application tries to own the bus name. | |
| 386 | + | // The function is passed the #GDBusConnection to to session bus, and the | |
| 387 | + | // object path that #GApplication will use to export its D-Bus API. | |
| 388 | + | // If this function returns %TRUE, registration will proceed; otherwise | |
| 389 | + | // registration will abort. Since: 2.34 | |
| 312 | 390 | func (x *ApplicationClass) OverrideDbusRegister(cb func(*Application, *DBusConnection, string) bool) { | |
| 313 | 391 | if cb == nil { | |
| 314 | 392 | x.xDbusRegister = 0 | |
| @@ -320,6 +398,14 @@ func (x *ApplicationClass) OverrideDbusRegister(cb func(*Application, *DBusConne | |||
| 320 | 398 | } | |
| 321 | 399 | ||
| 322 | 400 | // GetDbusRegister gets the callback function. | |
| 401 | + | // invoked locally during registration, if the application is | |
| 402 | + | // | |
| 403 | + | // using its D-Bus backend. You can use this to export extra objects on the | |
| 404 | + | // bus, that need to exist before the application tries to own the bus name. | |
| 405 | + | // The function is passed the #GDBusConnection to to session bus, and the | |
| 406 | + | // object path that #GApplication will use to export its D-Bus API. | |
| 407 | + | // If this function returns %TRUE, registration will proceed; otherwise | |
| 408 | + | // registration will abort. Since: 2.34 | |
| 323 | 409 | func (x *ApplicationClass) GetDbusRegister() func(*Application, *DBusConnection, string) bool { | |
| 324 | 410 | if x.xDbusRegister == 0 { | |
| 325 | 411 | return nil | |
| @@ -332,6 +418,10 @@ func (x *ApplicationClass) GetDbusRegister() func(*Application, *DBusConnection, | |||
| 332 | 418 | } | |
| 333 | 419 | ||
| 334 | 420 | // OverrideDbusUnregister sets the callback function. | |
| 421 | + | // invoked locally during unregistration, if the application | |
| 422 | + | // | |
| 423 | + | // is using its D-Bus backend. Use this to undo anything done by | |
| 424 | + | // the @dbus_register vfunc. Since: 2.34 | |
| 335 | 425 | func (x *ApplicationClass) OverrideDbusUnregister(cb func(*Application, *DBusConnection, string)) { | |
| 336 | 426 | if cb == nil { | |
| 337 | 427 | x.xDbusUnregister = 0 | |
| @@ -343,6 +433,10 @@ func (x *ApplicationClass) OverrideDbusUnregister(cb func(*Application, *DBusCon | |||
| 343 | 433 | } | |
| 344 | 434 | ||
| 345 | 435 | // GetDbusUnregister gets the callback function. | |
| 436 | + | // invoked locally during unregistration, if the application | |
| 437 | + | // | |
| 438 | + | // is using its D-Bus backend. Use this to undo anything done by | |
| 439 | + | // the @dbus_register vfunc. Since: 2.34 | |
| 346 | 440 | func (x *ApplicationClass) GetDbusUnregister() func(*Application, *DBusConnection, string) { | |
| 347 | 441 | if x.xDbusUnregister == 0 { | |
| 348 | 442 | return nil | |
| @@ -355,6 +449,9 @@ func (x *ApplicationClass) GetDbusUnregister() func(*Application, *DBusConnectio | |||
| 355 | 449 | } | |
| 356 | 450 | ||
| 357 | 451 | // OverrideHandleLocalOptions sets the callback function. | |
| 452 | + | // invoked locally after the parsing of the commandline | |
| 453 | + | // | |
| 454 | + | // options has occurred. Since: 2.40 | |
| 358 | 455 | func (x *ApplicationClass) OverrideHandleLocalOptions(cb func(*Application, *glib.VariantDict) int) { | |
| 359 | 456 | if cb == nil { | |
| 360 | 457 | x.xHandleLocalOptions = 0 | |
| @@ -366,6 +463,9 @@ func (x *ApplicationClass) OverrideHandleLocalOptions(cb func(*Application, *gli | |||
| 366 | 463 | } | |
| 367 | 464 | ||
| 368 | 465 | // GetHandleLocalOptions gets the callback function. | |
| 466 | + | // invoked locally after the parsing of the commandline | |
| 467 | + | // | |
| 468 | + | // options has occurred. Since: 2.40 | |
| 369 | 469 | func (x *ApplicationClass) GetHandleLocalOptions() func(*Application, *glib.VariantDict) int { | |
| 370 | 470 | if x.xHandleLocalOptions == 0 { | |
| 371 | 471 | return nil | |
| @@ -378,6 +478,7 @@ func (x *ApplicationClass) GetHandleLocalOptions() func(*Application, *glib.Vari | |||
| 378 | 478 | } | |
| 379 | 479 | ||
| 380 | 480 | // OverrideNameLost sets the callback function. | |
| 481 | + | // invoked when another instance is taking over the name. Since: 2.60 | |
| 381 | 482 | func (x *ApplicationClass) OverrideNameLost(cb func(*Application) bool) { | |
| 382 | 483 | if cb == nil { | |
| 383 | 484 | x.xNameLost = 0 | |
| @@ -389,6 +490,7 @@ func (x *ApplicationClass) OverrideNameLost(cb func(*Application) bool) { | |||
| 389 | 490 | } | |
| 390 | 491 | ||
| 391 | 492 | // GetNameLost gets the callback function. | |
| 493 | + | // invoked when another instance is taking over the name. Since: 2.60 | |
| 392 | 494 | func (x *ApplicationClass) GetNameLost() func(*Application) bool { | |
| 393 | 495 | if x.xNameLost == 0 { | |
| 394 | 496 | return nil | |
| @@ -408,20 +510,23 @@ func (x *ApplicationPrivate) GoPointer() uintptr { | |||
| 408 | 510 | return uintptr(unsafe.Pointer(x)) | |
| 409 | 511 | } | |
| 410 | 512 | ||
| 411 | - | // A #GApplication is the foundation of an application. It wraps some | |
| 513 | + | // `GApplication` is the core class for application support. | |
| 514 | + | // | |
| 515 | + | // A `GApplication` is the foundation of an application. It wraps some | |
| 412 | 516 | // low-level platform-specific services and is intended to act as the | |
| 413 | 517 | // foundation for higher-level application classes such as | |
| 414 | - | // #GtkApplication or #MxApplication. In general, you should not use | |
| 518 | + | // `GtkApplication` or `MxApplication`. In general, you should not use | |
| 415 | 519 | // this class outside of a higher level framework. | |
| 416 | 520 | // | |
| 417 | - | // GApplication provides convenient life cycle management by maintaining | |
| 521 | + | // `GApplication` provides convenient life-cycle management by maintaining | |
| 418 | 522 | // a "use count" for the primary application instance. The use count can | |
| 419 | - | // be changed using g_application_hold() and g_application_release(). If | |
| 420 | - | // it drops to zero, the application exits. Higher-level classes such as | |
| 421 | - | // #GtkApplication employ the use count to ensure that the application | |
| 422 | - | // stays alive as long as it has any opened windows. | |
| 523 | + | // be changed using [method@Gio.Application.hold] and | |
| 524 | + | // [method@Gio.Application.release]. If it drops to zero, the application | |
| 525 | + | // exits. Higher-level classes such as `GtkApplication` employ the use count | |
| 526 | + | // to ensure that the application stays alive as long as it has any opened | |
| 527 | + | // windows. | |
| 423 | 528 | // | |
| 424 | - | // Another feature that GApplication (optionally) provides is process | |
| 529 | + | // Another feature that `GApplication` (optionally) provides is process | |
| 425 | 530 | // uniqueness. Applications can make use of this functionality by | |
| 426 | 531 | // providing a unique application ID. If given, only one application | |
| 427 | 532 | // with this ID can be running at a time per session. The session | |
| @@ -433,49 +538,54 @@ func (x *ApplicationPrivate) GoPointer() uintptr { | |||
| 433 | 538 | // always the current instance. On Linux, the D-Bus session bus | |
| 434 | 539 | // is used for communication. | |
| 435 | 540 | // | |
| 436 | - | // The use of #GApplication differs from some other commonly-used | |
| 541 | + | // The use of `GApplication` differs from some other commonly-used | |
| 437 | 542 | // uniqueness libraries (such as libunique) in important ways. The | |
| 438 | 543 | // application is not expected to manually register itself and check | |
| 439 | 544 | // if it is the primary instance. Instead, the main() function of a | |
| 440 | - | // #GApplication should do very little more than instantiating the | |
| 545 | + | // `GApplication` should do very little more than instantiating the | |
| 441 | 546 | // application instance, possibly connecting signal handlers, then | |
| 442 | - | // calling g_application_run(). All checks for uniqueness are done | |
| 547 | + | // calling [method@Gio.Application.run]. All checks for uniqueness are done | |
| 443 | 548 | // internally. If the application is the primary instance then the | |
| 444 | 549 | // startup signal is emitted and the mainloop runs. If the application | |
| 445 | 550 | // is not the primary instance then a signal is sent to the primary | |
| 446 | - | // instance and g_application_run() promptly returns. See the code | |
| 551 | + | // instance and [method@Gio.Application.run] promptly returns. See the code | |
| 447 | 552 | // examples below. | |
| 448 | 553 | // | |
| 449 | - | // If used, the expected form of an application identifier is the same as | |
| 450 | - | // that of of a | |
| 554 | + | // If used, the expected form of an application identifier is the | |
| 555 | + | // same as that of a | |
| 451 | 556 | // [D-Bus well-known bus name](https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-names-bus). | |
| 452 | 557 | // Examples include: `com.example.MyApp`, `org.example.internal_apps.Calculator`, | |
| 453 | 558 | // `org._7_zip.Archiver`. | |
| 454 | - | // For details on valid application identifiers, see g_application_id_is_valid(). | |
| 559 | + | // For details on valid application identifiers, see [func@Gio.Application.id_is_valid]. | |
| 455 | 560 | // | |
| 456 | 561 | // On Linux, the application identifier is claimed as a well-known bus name | |
| 457 | - | // on the user's session bus. This means that the uniqueness of your | |
| 458 | - | // application is scoped to the current session. It also means that your | |
| 562 | + | // on the user's session bus. This means that the uniqueness of your | |
| 563 | + | // application is scoped to the current session. It also means that your | |
| 459 | 564 | // application may provide additional services (through registration of other | |
| 460 | - | // object paths) at that bus name. The registration of these object paths | |
| 461 | - | // should be done with the shared GDBus session bus. Note that due to the | |
| 565 | + | // object paths) at that bus name. The registration of these object paths | |
| 566 | + | // should be done with the shared GDBus session bus. Note that due to the | |
| 462 | 567 | // internal architecture of GDBus, method calls can be dispatched at any time | |
| 463 | - | // (even if a main loop is not running). For this reason, you must ensure that | |
| 568 | + | // (even if a main loop is not running). For this reason, you must ensure that | |
| 464 | 569 | // any object paths that you wish to register are registered before #GApplication | |
| 465 | 570 | // attempts to acquire the bus name of your application (which happens in | |
| 466 | - | // g_application_register()). Unfortunately, this means that you cannot use | |
| 467 | - | // g_application_get_is_remote() to decide if you want to register object paths. | |
| 571 | + | // [method@Gio.Application.register]). Unfortunately, this means that you cannot | |
| 572 | + | // use [property@Gio.Application:is-remote] to decide if you want to register | |
| 573 | + | // object paths. | |
| 468 | 574 | // | |
| 469 | - | // GApplication also implements the #GActionGroup and #GActionMap | |
| 575 | + | // `GApplication` also implements the [iface@Gio.ActionGroup] and [iface@Gio.ActionMap] | |
| 470 | 576 | // interfaces and lets you easily export actions by adding them with | |
| 471 | - | // g_action_map_add_action(). When invoking an action by calling | |
| 472 | - | // g_action_group_activate_action() on the application, it is always | |
| 577 | + | // [method@Gio.ActionMap.add_action]. When invoking an action by calling | |
| 578 | + | // [method@Gio.ActionGroup.activate_action] on the application, it is always | |
| 473 | 579 | // invoked in the primary instance. The actions are also exported on | |
| 474 | - | // the session bus, and GIO provides the #GDBusActionGroup wrapper to | |
| 475 | - | // conveniently access them remotely. GIO provides a #GDBusMenuModel wrapper | |
| 476 | - | // for remote access to exported #GMenuModels. | |
| 580 | + | // the session bus, and GIO provides the [class@Gio.DBusActionGroup] wrapper to | |
| 581 | + | // conveniently access them remotely. GIO provides a [class@Gio.DBusMenuModel] wrapper | |
| 582 | + | // for remote access to exported [class@Gio.MenuModel]s. | |
| 583 | + | // | |
| 584 | + | // Note: Due to the fact that actions are exported on the session bus, | |
| 585 | + | // using `maybe` parameters is not supported, since D-Bus does not support | |
| 586 | + | // `maybe` types. | |
| 477 | 587 | // | |
| 478 | - | // There is a number of different entry points into a GApplication: | |
| 588 | + | // There is a number of different entry points into a `GApplication`: | |
| 479 | 589 | // | |
| 480 | 590 | // - via 'Activate' (i.e. just starting the application) | |
| 481 | 591 | // | |
| @@ -485,42 +595,43 @@ func (x *ApplicationPrivate) GoPointer() uintptr { | |||
| 485 | 595 | // | |
| 486 | 596 | // - via activating an action | |
| 487 | 597 | // | |
| 488 | - | // The #GApplication::startup signal lets you handle the application | |
| 598 | + | // The [signal@Gio.Application::startup] signal lets you handle the application | |
| 489 | 599 | // initialization for all of these in a single place. | |
| 490 | 600 | // | |
| 491 | 601 | // Regardless of which of these entry points is used to start the | |
| 492 | - | // application, GApplication passes some ‘platform data’ from the | |
| 602 | + | // application, `GApplication` passes some ‘platform data’ from the | |
| 493 | 603 | // launching instance to the primary instance, in the form of a | |
| 494 | - | // #GVariant dictionary mapping strings to variants. To use platform | |
| 495 | - | // data, override the @before_emit or @after_emit virtual functions | |
| 496 | - | // in your #GApplication subclass. When dealing with | |
| 497 | - | // #GApplicationCommandLine objects, the platform data is | |
| 498 | - | // directly available via g_application_command_line_get_cwd(), | |
| 499 | - | // g_application_command_line_get_environ() and | |
| 500 | - | // g_application_command_line_get_platform_data(). | |
| 604 | + | // [struct@GLib.Variant] dictionary mapping strings to variants. To use platform | |
| 605 | + | // data, override the [vfunc@Gio.Application.before_emit] or | |
| 606 | + | // [vfunc@Gio.Application.after_emit] virtual functions | |
| 607 | + | // in your `GApplication` subclass. When dealing with | |
| 608 | + | // [class@Gio.ApplicationCommandLine] objects, the platform data is | |
| 609 | + | // directly available via [method@Gio.ApplicationCommandLine.get_cwd], | |
| 610 | + | // [method@Gio.ApplicationCommandLine.get_environ] and | |
| 611 | + | // [method@Gio.ApplicationCommandLine.get_platform_data]. | |
| 501 | 612 | // | |
| 502 | 613 | // As the name indicates, the platform data may vary depending on the | |
| 503 | 614 | // operating system, but it always includes the current directory (key | |
| 504 | - | // "cwd"), and optionally the environment (ie the set of environment | |
| 505 | - | // variables and their values) of the calling process (key "environ"). | |
| 615 | + | // `cwd`), and optionally the environment (ie the set of environment | |
| 616 | + | // variables and their values) of the calling process (key `environ`). | |
| 506 | 617 | // The environment is only added to the platform data if the | |
| 507 | - | // %G_APPLICATION_SEND_ENVIRONMENT flag is set. #GApplication subclasses | |
| 508 | - | // can add their own platform data by overriding the @add_platform_data | |
| 509 | - | // virtual function. For instance, #GtkApplication adds startup notification | |
| 510 | - | // data in this way. | |
| 618 | + | // `G_APPLICATION_SEND_ENVIRONMENT` flag is set. `GApplication` subclasses | |
| 619 | + | // can add their own platform data by overriding the | |
| 620 | + | // [vfunc@Gio.Application.add_platform_data] virtual function. For instance, | |
| 621 | + | // `GtkApplication` adds startup notification data in this way. | |
| 511 | 622 | // | |
| 512 | 623 | // To parse commandline arguments you may handle the | |
| 513 | - | // #GApplication::command-line signal or override the local_command_line() | |
| 514 | - | // vfunc, to parse them in either the primary instance or the local instance, | |
| 515 | - | // respectively. | |
| 624 | + | // [signal@Gio.Application::command-line] signal or override the | |
| 625 | + | // [vfunc@Gio.Application.local_command_line] virtual function, to parse them in | |
| 626 | + | // either the primary instance or the local instance, respectively. | |
| 516 | 627 | // | |
| 517 | - | // For an example of opening files with a GApplication, see | |
| 628 | + | // For an example of opening files with a `GApplication`, see | |
| 518 | 629 | // [gapplication-example-open.c](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/gio/tests/gapplication-example-open.c). | |
| 519 | 630 | // | |
| 520 | - | // For an example of using actions with GApplication, see | |
| 631 | + | // For an example of using actions with `GApplication`, see | |
| 521 | 632 | // [gapplication-example-actions.c](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/gio/tests/gapplication-example-actions.c). | |
| 522 | 633 | // | |
| 523 | - | // For an example of using extra D-Bus hooks with GApplication, see | |
| 634 | + | // For an example of using extra D-Bus hooks with `GApplication`, see | |
| 524 | 635 | // [gapplication-example-dbushooks.c](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/gio/tests/gapplication-example-dbushooks.c). | |
| 525 | 636 | type Application struct { | |
| 526 | 637 | gobject.Object | |
| @@ -613,6 +724,8 @@ var xApplicationAddMainOptionEntries func(uintptr, []glib.OptionEntry) | |||
| 613 | 724 | // inspected and modified. If %G_APPLICATION_HANDLES_COMMAND_LINE is | |
| 614 | 725 | // set, then the resulting dictionary is sent to the primary instance, | |
| 615 | 726 | // where g_application_command_line_get_options_dict() will return it. | |
| 727 | + | // As it has been passed outside the process at this point, the types of all | |
| 728 | + | // values in the options dict must be checked before being used. | |
| 616 | 729 | // This "packing" is done according to the type of the argument -- | |
| 617 | 730 | // booleans for normal flags, strings for strings, bytestrings for | |
| 618 | 731 | // filenames, etc. The packing only occurs if the flag is given (ie: we | |
| @@ -629,8 +742,8 @@ var xApplicationAddMainOptionEntries func(uintptr, []glib.OptionEntry) | |||
| 629 | 742 | // was to send all of the commandline arguments (options and all) to the | |
| 630 | 743 | // primary instance for handling. #GApplication ignored them completely | |
| 631 | 744 | // on the local side. Calling this function "opts in" to the new | |
| 632 | - | // behaviour, and in particular, means that unrecognised options will be | |
| 633 | - | // treated as errors. Unrecognised options have never been ignored when | |
| 745 | + | // behaviour, and in particular, means that unrecognized options will be | |
| 746 | + | // treated as errors. Unrecognized options have never been ignored when | |
| 634 | 747 | // %G_APPLICATION_HANDLES_COMMAND_LINE is unset. | |
| 635 | 748 | // | |
| 636 | 749 | // If #GApplication::handle-local-options needs to see the list of | |
| @@ -682,7 +795,7 @@ var xApplicationAddOptionGroup func(uintptr, *glib.OptionGroup) | |||
| 682 | 795 | // | |
| 683 | 796 | // Calling this function will cause the options in the supplied option | |
| 684 | 797 | // group to be parsed, but it does not cause you to be "opted in" to the | |
| 685 | - | // new functionality whereby unrecognised options are rejected even if | |
| 798 | + | // new functionality whereby unrecognized options are rejected even if | |
| 686 | 799 | // %G_APPLICATION_HANDLES_COMMAND_LINE was given. | |
| 687 | 800 | func (x *Application) AddOptionGroup(GroupVar *glib.OptionGroup) { | |
| 688 | 801 | ||
| @@ -838,12 +951,21 @@ func (x *Application) GetResourceBasePath() string { | |||
| 838 | 951 | return cret | |
| 839 | 952 | } | |
| 840 | 953 | ||
| 954 | + | var xApplicationGetVersion func(uintptr) string | |
| 955 | + | ||
| 956 | + | // Gets the version of @application. | |
| 957 | + | func (x *Application) GetVersion() string { | |
| 958 | + | ||
| 959 | + | cret := xApplicationGetVersion(x.GoPointer()) | |
| 960 | + | return cret | |
| 961 | + | } | |
| 962 | + | ||
| 841 | 963 | var xApplicationHold func(uintptr) | |
| 842 | 964 | ||
| 843 | 965 | // Increases the use count of @application. | |
| 844 | 966 | // | |
| 845 | 967 | // Use this function to indicate that the application has a reason to | |
| 846 | - | // continue to run. For example, g_application_hold() is called by GTK+ | |
| 968 | + | // continue to run. For example, g_application_hold() is called by GTK | |
| 847 | 969 | // when a toplevel window is on the screen. | |
| 848 | 970 | // | |
| 849 | 971 | // To cancel the hold, call g_application_release(). | |
| @@ -1079,11 +1201,14 @@ var xApplicationSendNotification func(uintptr, string, uintptr) | |||
| 1079 | 1201 | // notification. This works even for notifications sent from a previous | |
| 1080 | 1202 | // execution of the application, as long as @id is the same string. | |
| 1081 | 1203 | // | |
| 1082 | - | // @id may be %NULL, but it is impossible to replace or withdraw | |
| 1204 | + | // @id may be `NULL`, but it is impossible to replace or withdraw | |
| 1083 | 1205 | // notifications without an id. | |
| 1084 | 1206 | // | |
| 1085 | 1207 | // If @notification is no longer relevant, it can be withdrawn with | |
| 1086 | - | // g_application_withdraw_notification(). | |
| 1208 | + | // [method@Gio.Application.withdraw_notification]. | |
| 1209 | + | // | |
| 1210 | + | // It is an error to call this function if @application has no | |
| 1211 | + | // application ID. | |
| 1087 | 1212 | func (x *Application) SendNotification(IdVar string, NotificationVar *Notification) { | |
| 1088 | 1213 | ||
| 1089 | 1214 | xApplicationSendNotification(x.GoPointer(), IdVar, NotificationVar.GoPointer()) | |
| @@ -1199,10 +1324,10 @@ var xApplicationSetResourceBasePath func(uintptr, string) | |||
| 1199 | 1324 | ||
| 1200 | 1325 | // Sets (or unsets) the base resource path of @application. | |
| 1201 | 1326 | // | |
| 1202 | - | // The path is used to automatically load various [application | |
| 1203 | - | // resources][gresource] such as menu layouts and action descriptions. | |
| 1204 | - | // The various types of resources will be found at fixed names relative | |
| 1205 | - | // to the given base path. | |
| 1327 | + | // The path is used to automatically load various | |
| 1328 | + | // [application resources][struct@Gio.Resource] such as menu layouts and | |
| 1329 | + | // action descriptions. The various types of resources will be found at | |
| 1330 | + | // fixed names relative to the given base path. | |
| 1206 | 1331 | // | |
| 1207 | 1332 | // By default, the resource base path is determined from the application | |
| 1208 | 1333 | // ID by prefixing '/' and replacing each '.' with '/'. This is done at | |
| @@ -1236,6 +1361,19 @@ func (x *Application) SetResourceBasePath(ResourcePathVar string) { | |||
| 1236 | 1361 | ||
| 1237 | 1362 | } | |
| 1238 | 1363 | ||
| 1364 | + | var xApplicationSetVersion func(uintptr, string) | |
| 1365 | + | ||
| 1366 | + | // Sets the version number of @application. This will be used to implement | |
| 1367 | + | // a `--version` command line argument | |
| 1368 | + | // | |
| 1369 | + | // The application version can only be modified if @application has not yet | |
| 1370 | + | // been registered. | |
| 1371 | + | func (x *Application) SetVersion(VersionVar string) { | |
| 1372 | + | ||
| 1373 | + | xApplicationSetVersion(x.GoPointer(), VersionVar) | |
| 1374 | + | ||
| 1375 | + | } | |
| 1376 | + | ||
| 1239 | 1377 | var xApplicationUnbindBusyProperty func(uintptr, uintptr, string) | |
| 1240 | 1378 | ||
| 1241 | 1379 | // Destroys a binding between @property and the busy state of | |
| @@ -1484,36 +1622,36 @@ func (x *Application) ConnectStartup(cb *func(Application)) uint32 { | |||
| 1484 | 1622 | return gobject.SignalConnect(x.GoPointer(), "startup", cbRefPtr) | |
| 1485 | 1623 | } | |
| 1486 | 1624 | ||
| 1487 | - | // Emits the #GActionGroup::action-added signal on @action_group. | |
| 1625 | + | // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group. | |
| 1488 | 1626 | // | |
| 1489 | - | // This function should only be called by #GActionGroup implementations. | |
| 1627 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 1490 | 1628 | func (x *Application) ActionAdded(ActionNameVar string) { | |
| 1491 | 1629 | ||
| 1492 | 1630 | XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) | |
| 1493 | 1631 | ||
| 1494 | 1632 | } | |
| 1495 | 1633 | ||
| 1496 | - | // Emits the #GActionGroup::action-enabled-changed signal on @action_group. | |
| 1634 | + | // Emits the [signal@Gio.ActionGroup::action-enabled-changed] signal on @action_group. | |
| 1497 | 1635 | // | |
| 1498 | - | // This function should only be called by #GActionGroup implementations. | |
| 1636 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 1499 | 1637 | func (x *Application) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { | |
| 1500 | 1638 | ||
| 1501 | 1639 | XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) | |
| 1502 | 1640 | ||
| 1503 | 1641 | } | |
| 1504 | 1642 | ||
| 1505 | - | // Emits the #GActionGroup::action-removed signal on @action_group. | |
| 1643 | + | // Emits the [signal@Gio.ActionGroup::action-removed] signal on @action_group. | |
| 1506 | 1644 | // | |
| 1507 | - | // This function should only be called by #GActionGroup implementations. | |
| 1645 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 1508 | 1646 | func (x *Application) ActionRemoved(ActionNameVar string) { | |
| 1509 | 1647 | ||
| 1510 | 1648 | XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) | |
| 1511 | 1649 | ||
| 1512 | 1650 | } | |
| 1513 | 1651 | ||
| 1514 | - | // Emits the #GActionGroup::action-state-changed signal on @action_group. | |
| 1652 | + | // Emits the [signal@Gio.ActionGroup::action-state-changed] signal on @action_group. | |
| 1515 | 1653 | // | |
| 1516 | - | // This function should only be called by #GActionGroup implementations. | |
| 1654 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 1517 | 1655 | func (x *Application) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { | |
| 1518 | 1656 | ||
| 1519 | 1657 | XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) | |
| @@ -1524,35 +1662,35 @@ func (x *Application) ActionStateChanged(ActionNameVar string, StateVar *glib.Va | |||
| 1524 | 1662 | // | |
| 1525 | 1663 | // If the action is expecting a parameter, then the correct type of | |
| 1526 | 1664 | // parameter must be given as @parameter. If the action is expecting no | |
| 1527 | - | // parameters then @parameter must be %NULL. See | |
| 1528 | - | // g_action_group_get_action_parameter_type(). | |
| 1665 | + | // parameters then @parameter must be `NULL`. See | |
| 1666 | + | // [method@Gio.ActionGroup.get_action_parameter_type]. | |
| 1529 | 1667 | // | |
| 1530 | - | // If the #GActionGroup implementation supports asynchronous remote | |
| 1668 | + | // If the [type@Gio.ActionGroup] implementation supports asynchronous remote | |
| 1531 | 1669 | // activation over D-Bus, this call may return before the relevant | |
| 1532 | 1670 | // D-Bus traffic has been sent, or any replies have been received. In | |
| 1533 | 1671 | // order to block on such asynchronous activation calls, | |
| 1534 | - | // g_dbus_connection_flush() should be called prior to the code, which | |
| 1672 | + | // [method@Gio.DBusConnection.flush] should be called prior to the code, which | |
| 1535 | 1673 | // depends on the result of the action activation. Without flushing | |
| 1536 | 1674 | // the D-Bus connection, there is no guarantee that the action would | |
| 1537 | 1675 | // have been activated. | |
| 1538 | 1676 | // | |
| 1539 | 1677 | // The following code which runs in a remote app instance, shows an | |
| 1540 | - | // example of a "quit" action being activated on the primary app | |
| 1541 | - | // instance over D-Bus. Here g_dbus_connection_flush() is called | |
| 1542 | - | // before `exit()`. Without g_dbus_connection_flush(), the "quit" action | |
| 1678 | + | // example of a ‘quit’ action being activated on the primary app | |
| 1679 | + | // instance over D-Bus. Here [method@Gio.DBusConnection.flush] is called | |
| 1680 | + | // before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action | |
| 1543 | 1681 | // may fail to be activated on the primary instance. | |
| 1544 | 1682 | // | |
| 1545 | - | // |[<!-- language="C" --> | |
| 1546 | - | // // call "quit" action on primary instance | |
| 1683 | + | // ```c | |
| 1684 | + | // // call ‘quit’ action on primary instance | |
| 1547 | 1685 | // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); | |
| 1548 | 1686 | // | |
| 1549 | 1687 | // // make sure the action is activated now | |
| 1550 | - | // g_dbus_connection_flush (...); | |
| 1688 | + | // g_dbus_connection_flush (…); | |
| 1551 | 1689 | // | |
| 1552 | - | // g_debug ("application has been terminated. exiting."); | |
| 1690 | + | // g_debug ("Application has been terminated. Exiting."); | |
| 1553 | 1691 | // | |
| 1554 | 1692 | // exit (0); | |
| 1555 | - | // ]| | |
| 1693 | + | // ``` | |
| 1556 | 1694 | func (x *Application) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { | |
| 1557 | 1695 | ||
| 1558 | 1696 | XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) | |
| @@ -1563,11 +1701,11 @@ func (x *Application) ActivateAction(ActionNameVar string, ParameterVar *glib.Va | |||
| 1563 | 1701 | // changed to @value. | |
| 1564 | 1702 | // | |
| 1565 | 1703 | // The action must be stateful and @value must be of the correct type. | |
| 1566 | - | // See g_action_group_get_action_state_type(). | |
| 1704 | + | // See [method@Gio.ActionGroup.get_action_state_type]. | |
| 1567 | 1705 | // | |
| 1568 | 1706 | // This call merely requests a change. The action may refuse to change | |
| 1569 | 1707 | // its state or may change its state to something other than @value. | |
| 1570 | - | // See g_action_group_get_action_state_hint(). | |
| 1708 | + | // See [method@Gio.ActionGroup.get_action_state_hint]. | |
| 1571 | 1709 | // | |
| 1572 | 1710 | // If the @value GVariant is floating, it is consumed. | |
| 1573 | 1711 | func (x *Application) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { | |
| @@ -1589,12 +1727,12 @@ func (x *Application) GetActionEnabled(ActionNameVar string) bool { | |||
| 1589 | 1727 | // Queries the type of the parameter that must be given when activating | |
| 1590 | 1728 | // the named action within @action_group. | |
| 1591 | 1729 | // | |
| 1592 | - | // When activating the action using g_action_group_activate_action(), | |
| 1593 | - | // the #GVariant given to that function must be of the type returned | |
| 1730 | + | // When activating the action using [method@Gio.ActionGroup.activate_action], | |
| 1731 | + | // the [type@GLib.Variant] given to that function must be of the type returned | |
| 1594 | 1732 | // by this function. | |
| 1595 | 1733 | // | |
| 1596 | - | // In the case that this function returns %NULL, you must not give any | |
| 1597 | - | // #GVariant, but %NULL instead. | |
| 1734 | + | // In the case that this function returns `NULL`, you must not give any | |
| 1735 | + | // [type@GLib.Variant], but `NULL` instead. | |
| 1598 | 1736 | // | |
| 1599 | 1737 | // The parameter type of a particular action will never change but it is | |
| 1600 | 1738 | // possible for an action to be removed and for a new action to be added | |
| @@ -1607,12 +1745,12 @@ func (x *Application) GetActionParameterType(ActionNameVar string) *glib.Variant | |||
| 1607 | 1745 | ||
| 1608 | 1746 | // Queries the current state of the named action within @action_group. | |
| 1609 | 1747 | // | |
| 1610 | - | // If the action is not stateful then %NULL will be returned. If the | |
| 1748 | + | // If the action is not stateful then `NULL` will be returned. If the | |
| 1611 | 1749 | // action is stateful then the type of the return value is the type | |
| 1612 | - | // given by g_action_group_get_action_state_type(). | |
| 1750 | + | // given by [method@Gio.ActionGroup.get_action_state_type]. | |
| 1613 | 1751 | // | |
| 1614 | - | // The return value (if non-%NULL) should be freed with | |
| 1615 | - | // g_variant_unref() when it is no longer required. | |
| 1752 | + | // The return value (if non-`NULL`) should be freed with | |
| 1753 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 1616 | 1754 | func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |
| 1617 | 1755 | ||
| 1618 | 1756 | cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| @@ -1622,12 +1760,12 @@ func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 1622 | 1760 | // Requests a hint about the valid range of values for the state of the | |
| 1623 | 1761 | // named action within @action_group. | |
| 1624 | 1762 | // | |
| 1625 | - | // If %NULL is returned it either means that the action is not stateful | |
| 1763 | + | // If `NULL` is returned it either means that the action is not stateful | |
| 1626 | 1764 | // or that there is no hint about the valid range of values for the | |
| 1627 | 1765 | // state of the action. | |
| 1628 | 1766 | // | |
| 1629 | - | // If a #GVariant array is returned then each item in the array is a | |
| 1630 | - | // possible value for the state. If a #GVariant pair (ie: two-tuple) is | |
| 1767 | + | // If a [type@GLib.Variant] array is returned then each item in the array is a | |
| 1768 | + | // possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is | |
| 1631 | 1769 | // returned then the tuple specifies the inclusive lower and upper bound | |
| 1632 | 1770 | // of valid values for the state. | |
| 1633 | 1771 | // | |
| @@ -1635,8 +1773,8 @@ func (x *Application) GetActionState(ActionNameVar string) *glib.Variant { | |||
| 1635 | 1773 | // have a state value outside of the hinted range and setting a value | |
| 1636 | 1774 | // within the range may fail. | |
| 1637 | 1775 | // | |
| 1638 | - | // The return value (if non-%NULL) should be freed with | |
| 1639 | - | // g_variant_unref() when it is no longer required. | |
| 1776 | + | // The return value (if non-`NULL`) should be freed with | |
| 1777 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 1640 | 1778 | func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 1641 | 1779 | ||
| 1642 | 1780 | cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| @@ -1647,14 +1785,14 @@ func (x *Application) GetActionStateHint(ActionNameVar string) *glib.Variant { | |||
| 1647 | 1785 | // @action_group. | |
| 1648 | 1786 | // | |
| 1649 | 1787 | // If the action is stateful then this function returns the | |
| 1650 | - | // #GVariantType of the state. All calls to | |
| 1651 | - | // g_action_group_change_action_state() must give a #GVariant of this | |
| 1652 | - | // type and g_action_group_get_action_state() will return a #GVariant | |
| 1788 | + | // [type@GLib.VariantType] of the state. All calls to | |
| 1789 | + | // [method@Gio.ActionGroup.change_action_state] must give a [type@GLib.Variant] of this | |
| 1790 | + | // type and [method@Gio.ActionGroup.get_action_state] will return a [type@GLib.Variant] | |
| 1653 | 1791 | // of the same type. | |
| 1654 | 1792 | // | |
| 1655 | - | // If the action is not stateful then this function will return %NULL. | |
| 1656 | - | // In that case, g_action_group_get_action_state() will return %NULL | |
| 1657 | - | // and you must not call g_action_group_change_action_state(). | |
| 1793 | + | // If the action is not stateful then this function will return `NULL`. | |
| 1794 | + | // In that case, [method@Gio.ActionGroup.get_action_state] will return `NULL` | |
| 1795 | + | // and you must not call [method@Gio.ActionGroup.change_action_state]. | |
| 1658 | 1796 | // | |
| 1659 | 1797 | // The state type of a particular action will never change but it is | |
| 1660 | 1798 | // possible for an action to be removed and for a new action to be added | |
| @@ -1674,7 +1812,7 @@ func (x *Application) HasAction(ActionNameVar string) bool { | |||
| 1674 | 1812 | ||
| 1675 | 1813 | // Lists the actions contained within @action_group. | |
| 1676 | 1814 | // | |
| 1677 | - | // The caller is responsible for freeing the list with g_strfreev() when | |
| 1815 | + | // The caller is responsible for freeing the list with [func@GLib.strfreev] when | |
| 1678 | 1816 | // it is no longer required. | |
| 1679 | 1817 | func (x *Application) ListActions() []string { | |
| 1680 | 1818 | ||
| @@ -1685,18 +1823,18 @@ func (x *Application) ListActions() []string { | |||
| 1685 | 1823 | // Queries all aspects of the named action within an @action_group. | |
| 1686 | 1824 | // | |
| 1687 | 1825 | // This function acquires the information available from | |
| 1688 | - | // g_action_group_has_action(), g_action_group_get_action_enabled(), | |
| 1689 | - | // g_action_group_get_action_parameter_type(), | |
| 1690 | - | // g_action_group_get_action_state_type(), | |
| 1691 | - | // g_action_group_get_action_state_hint() and | |
| 1692 | - | // g_action_group_get_action_state() with a single function call. | |
| 1826 | + | // [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled], | |
| 1827 | + | // [method@Gio.ActionGroup.get_action_parameter_type], | |
| 1828 | + | // [method@Gio.ActionGroup.get_action_state_type], | |
| 1829 | + | // [method@Gio.ActionGroup.get_action_state_hint] and | |
| 1830 | + | // [method@Gio.ActionGroup.get_action_state] with a single function call. | |
| 1693 | 1831 | // | |
| 1694 | 1832 | // This provides two main benefits. | |
| 1695 | 1833 | // | |
| 1696 | 1834 | // The first is the improvement in efficiency that comes with not having | |
| 1697 | 1835 | // to perform repeated lookups of the action in order to discover | |
| 1698 | 1836 | // different things about it. The second is that implementing | |
| 1699 | - | // #GActionGroup can now be done by only overriding this one virtual | |
| 1837 | + | // [type@Gio.ActionGroup] can now be done by only overriding this one virtual | |
| 1700 | 1838 | // function. | |
| 1701 | 1839 | // | |
| 1702 | 1840 | // The interface provides a default implementation of this function that | |
| @@ -1705,9 +1843,9 @@ func (x *Application) ListActions() []string { | |||
| 1705 | 1843 | // those functions that call this function. All implementations, | |
| 1706 | 1844 | // therefore, must override either this function or all of the others. | |
| 1707 | 1845 | // | |
| 1708 | - | // If the action exists, %TRUE is returned and any of the requested | |
| 1709 | - | // fields (as indicated by having a non-%NULL reference passed in) are | |
| 1710 | - | // filled. If the action doesn't exist, %FALSE is returned and the | |
| 1846 | + | // If the action exists, `TRUE` is returned and any of the requested | |
| 1847 | + | // fields (as indicated by having a non-`NULL` reference passed in) are | |
| 1848 | + | // filled. If the action doesn’t exist, `FALSE` is returned and the | |
| 1711 | 1849 | // fields may or may not have been modified. | |
| 1712 | 1850 | func (x *Application) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 1713 | 1851 | ||
| @@ -1727,12 +1865,12 @@ func (x *Application) AddAction(ActionVar Action) { | |||
| 1727 | 1865 | ||
| 1728 | 1866 | } | |
| 1729 | 1867 | ||
| 1730 | - | // A convenience function for creating multiple #GSimpleAction instances | |
| 1731 | - | // and adding them to a #GActionMap. | |
| 1868 | + | // A convenience function for creating multiple [class@Gio.SimpleAction] | |
| 1869 | + | // instances and adding them to a [iface@Gio.ActionMap]. | |
| 1732 | 1870 | // | |
| 1733 | - | // Each action is constructed as per one #GActionEntry. | |
| 1871 | + | // Each action is constructed as per one [struct@Gio.ActionEntry]. | |
| 1734 | 1872 | // | |
| 1735 | - | // |[<!-- language="C" --> | |
| 1873 | + | // ```c | |
| 1736 | 1874 | // static void | |
| 1737 | 1875 | // activate_quit (GSimpleAction *simple, | |
| 1738 | 1876 | // | |
| @@ -1769,7 +1907,7 @@ func (x *Application) AddAction(ActionVar Action) { | |||
| 1769 | 1907 | // return G_ACTION_GROUP (group); | |
| 1770 | 1908 | // } | |
| 1771 | 1909 | // | |
| 1772 | - | // ]| | |
| 1910 | + | // ``` | |
| 1773 | 1911 | func (x *Application) AddActionEntries(EntriesVar []ActionEntry, NEntriesVar int, UserDataVar uintptr) { | |
| 1774 | 1912 | ||
| 1775 | 1913 | XGActionMapAddActionEntries(x.GoPointer(), EntriesVar, NEntriesVar, UserDataVar) | |
| @@ -1778,7 +1916,7 @@ func (x *Application) AddActionEntries(EntriesVar []ActionEntry, NEntriesVar int | |||
| 1778 | 1916 | ||
| 1779 | 1917 | // Looks up the action with the name @action_name in @action_map. | |
| 1780 | 1918 | // | |
| 1781 | - | // If no such action exists, returns %NULL. | |
| 1919 | + | // If no such action exists, returns `NULL`. | |
| 1782 | 1920 | func (x *Application) LookupAction(ActionNameVar string) *ActionBase { | |
| 1783 | 1921 | var cls *ActionBase | |
| 1784 | 1922 | ||
| @@ -1802,6 +1940,37 @@ func (x *Application) RemoveAction(ActionNameVar string) { | |||
| 1802 | 1940 | ||
| 1803 | 1941 | } | |
| 1804 | 1942 | ||
| 1943 | + | // Remove actions from a [iface@Gio.ActionMap]. This is meant as the reverse of | |
| 1944 | + | // [method@Gio.ActionMap.add_action_entries]. | |
| 1945 | + | // | |
| 1946 | + | // ```c | |
| 1947 | + | // | |
| 1948 | + | // static const GActionEntry entries[] = { | |
| 1949 | + | // { "quit", activate_quit }, | |
| 1950 | + | // { "print-string", activate_print_string, "s" } | |
| 1951 | + | // }; | |
| 1952 | + | // | |
| 1953 | + | // void | |
| 1954 | + | // add_actions (GActionMap *map) | |
| 1955 | + | // | |
| 1956 | + | // { | |
| 1957 | + | // g_action_map_add_action_entries (map, entries, G_N_ELEMENTS (entries), NULL); | |
| 1958 | + | // } | |
| 1959 | + | // | |
| 1960 | + | // void | |
| 1961 | + | // remove_actions (GActionMap *map) | |
| 1962 | + | // | |
| 1963 | + | // { | |
| 1964 | + | // g_action_map_remove_action_entries (map, entries, G_N_ELEMENTS (entries)); | |
| 1965 | + | // } | |
| 1966 | + | // | |
| 1967 | + | // ``` | |
| 1968 | + | func (x *Application) RemoveActionEntries(EntriesVar []ActionEntry, NEntriesVar int) { | |
| 1969 | + | ||
| 1970 | + | XGActionMapRemoveActionEntries(x.GoPointer(), EntriesVar, NEntriesVar) | |
| 1971 | + | ||
| 1972 | + | } | |
| 1973 | + | ||
| 1805 | 1974 | var xApplicationGetDefault func() uintptr | |
| 1806 | 1975 | ||
| 1807 | 1976 | // Returns the default #GApplication instance for this process. | |
| @@ -1904,6 +2073,7 @@ func init() { | |||
| 1904 | 2073 | core.PuregoSafeRegister(&xApplicationGetIsRegistered, lib, "g_application_get_is_registered") | |
| 1905 | 2074 | core.PuregoSafeRegister(&xApplicationGetIsRemote, lib, "g_application_get_is_remote") | |
| 1906 | 2075 | core.PuregoSafeRegister(&xApplicationGetResourceBasePath, lib, "g_application_get_resource_base_path") | |
| 2076 | + | core.PuregoSafeRegister(&xApplicationGetVersion, lib, "g_application_get_version") | |
| 1907 | 2077 | core.PuregoSafeRegister(&xApplicationHold, lib, "g_application_hold") | |
| 1908 | 2078 | core.PuregoSafeRegister(&xApplicationMarkBusy, lib, "g_application_mark_busy") | |
| 1909 | 2079 | core.PuregoSafeRegister(&xApplicationOpen, lib, "g_application_open") | |
| @@ -1921,6 +2091,7 @@ func init() { | |||
| 1921 | 2091 | core.PuregoSafeRegister(&xApplicationSetOptionContextParameterString, lib, "g_application_set_option_context_parameter_string") | |
| 1922 | 2092 | core.PuregoSafeRegister(&xApplicationSetOptionContextSummary, lib, "g_application_set_option_context_summary") | |
| 1923 | 2093 | core.PuregoSafeRegister(&xApplicationSetResourceBasePath, lib, "g_application_set_resource_base_path") | |
| 2094 | + | core.PuregoSafeRegister(&xApplicationSetVersion, lib, "g_application_set_version") | |
| 1924 | 2095 | core.PuregoSafeRegister(&xApplicationUnbindBusyProperty, lib, "g_application_unbind_busy_property") | |
| 1925 | 2096 | core.PuregoSafeRegister(&xApplicationUnmarkBusy, lib, "g_application_unmark_busy") | |
| 1926 | 2097 | core.PuregoSafeRegister(&xApplicationWithdrawNotification, lib, "g_application_withdraw_notification") | |
M v4/gio/gapplicationcommandline.go +122 -28
| @@ -25,7 +25,9 @@ type ApplicationCommandLineClass struct { | |||
| 25 | 25 | ||
| 26 | 26 | xGetStdin uintptr | |
| 27 | 27 | ||
| 28 | - | Padding [11]uintptr | |
| 28 | + | xDone uintptr | |
| 29 | + | ||
| 30 | + | Padding [10]uintptr | |
| 29 | 31 | } | |
| 30 | 32 | ||
| 31 | 33 | func (x *ApplicationCommandLineClass) GoPointer() uintptr { | |
| @@ -111,6 +113,29 @@ func (x *ApplicationCommandLineClass) GetGetStdin() func(*ApplicationCommandLine | |||
| 111 | 113 | } | |
| 112 | 114 | } | |
| 113 | 115 | ||
| 116 | + | // OverrideDone sets the callback function. | |
| 117 | + | func (x *ApplicationCommandLineClass) OverrideDone(cb func(*ApplicationCommandLine)) { | |
| 118 | + | if cb == nil { | |
| 119 | + | x.xDone = 0 | |
| 120 | + | } else { | |
| 121 | + | x.xDone = purego.NewCallback(func(CmdlineVarp uintptr) { | |
| 122 | + | cb(ApplicationCommandLineNewFromInternalPtr(CmdlineVarp)) | |
| 123 | + | }) | |
| 124 | + | } | |
| 125 | + | } | |
| 126 | + | ||
| 127 | + | // GetDone gets the callback function. | |
| 128 | + | func (x *ApplicationCommandLineClass) GetDone() func(*ApplicationCommandLine) { | |
| 129 | + | if x.xDone == 0 { | |
| 130 | + | return nil | |
| 131 | + | } | |
| 132 | + | var rawCallback func(CmdlineVarp uintptr) | |
| 133 | + | purego.RegisterFunc(&rawCallback, x.xDone) | |
| 134 | + | return func(CmdlineVar *ApplicationCommandLine) { | |
| 135 | + | rawCallback(CmdlineVar.GoPointer()) | |
| 136 | + | } | |
| 137 | + | } | |
| 138 | + | ||
| 114 | 139 | type ApplicationCommandLinePrivate struct { | |
| 115 | 140 | _ structs.HostLayout | |
| 116 | 141 | } | |
| @@ -119,30 +144,33 @@ func (x *ApplicationCommandLinePrivate) GoPointer() uintptr { | |||
| 119 | 144 | return uintptr(unsafe.Pointer(x)) | |
| 120 | 145 | } | |
| 121 | 146 | ||
| 122 | - | // #GApplicationCommandLine represents a command-line invocation of | |
| 123 | - | // an application. It is created by #GApplication and emitted | |
| 124 | - | // in the #GApplication::command-line signal and virtual function. | |
| 147 | + | // `GApplicationCommandLine` represents a command-line invocation of | |
| 148 | + | // an application. | |
| 149 | + | // | |
| 150 | + | // It is created by [class@Gio.Application] and emitted | |
| 151 | + | // in the [signal@Gio.Application::command-line] signal and virtual function. | |
| 125 | 152 | // | |
| 126 | 153 | // The class contains the list of arguments that the program was invoked | |
| 127 | - | // with. It is also possible to query if the commandline invocation was | |
| 154 | + | // with. It is also possible to query if the commandline invocation was | |
| 128 | 155 | // local (ie: the current process is running in direct response to the | |
| 129 | 156 | // invocation) or remote (ie: some other process forwarded the | |
| 130 | 157 | // commandline to this process). | |
| 131 | 158 | // | |
| 132 | - | // The GApplicationCommandLine object can provide the @argc and @argv | |
| 133 | - | // parameters for use with the #GOptionContext command-line parsing API, | |
| 134 | - | // with the g_application_command_line_get_arguments() function. See | |
| 135 | - | // [gapplication-example-cmdline3.c][gapplication-example-cmdline3] | |
| 159 | + | // The `GApplicationCommandLine` object can provide the @argc and @argv | |
| 160 | + | // parameters for use with the [struct@GLib.OptionContext] command-line parsing API, | |
| 161 | + | // with the [method@Gio.ApplicationCommandLine.get_arguments] function. See | |
| 162 | + | // [gapplication-example-cmdline3.c](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/gio/tests/gapplication-example-cmdline3.c) | |
| 136 | 163 | // for an example. | |
| 137 | 164 | // | |
| 138 | 165 | // The exit status of the originally-invoked process may be set and | |
| 139 | - | // messages can be printed to stdout or stderr of that process. The | |
| 140 | - | // lifecycle of the originally-invoked process is tied to the lifecycle | |
| 141 | - | // of this object (ie: the process exits when the last reference is | |
| 142 | - | // dropped). | |
| 166 | + | // messages can be printed to stdout or stderr of that process. | |
| 167 | + | // | |
| 168 | + | // For remote invocation, the originally-invoked process exits when | |
| 169 | + | // [method@Gio.ApplicationCommandLine.done] method is called. This method is | |
| 170 | + | // also automatically called when the object is disposed. | |
| 143 | 171 | // | |
| 144 | - | // The main use for #GApplicationCommandLine (and the | |
| 145 | - | // #GApplication::command-line signal) is 'Emacs server' like use cases: | |
| 172 | + | // The main use for `GApplicationCommandLine` (and the | |
| 173 | + | // [signal@Gio.Application::command-line] signal) is 'Emacs server' like use cases: | |
| 146 | 174 | // You can set the `EDITOR` environment variable to have e.g. git use | |
| 147 | 175 | // your favourite editor to edit commit messages, and if you already | |
| 148 | 176 | // have an instance of the editor running, the editing will happen | |
| @@ -151,11 +179,12 @@ func (x *ApplicationCommandLinePrivate) GoPointer() uintptr { | |||
| 151 | 179 | // does not return until the editing is done. | |
| 152 | 180 | // | |
| 153 | 181 | // Normally, the commandline is completely handled in the | |
| 154 | - | // #GApplication::command-line handler. The launching instance exits | |
| 182 | + | // [signal@Gio.Application::command-line] handler. The launching instance exits | |
| 155 | 183 | // once the signal handler in the primary instance has returned, and | |
| 156 | 184 | // the return value of the signal handler becomes the exit status | |
| 157 | 185 | // of the launching instance. | |
| 158 | - | // |[<!-- language="C" --> | |
| 186 | + | // | |
| 187 | + | // ```c | |
| 159 | 188 | // static int | |
| 160 | 189 | // command_line (GApplication *application, | |
| 161 | 190 | // | |
| @@ -180,13 +209,15 @@ func (x *ApplicationCommandLinePrivate) GoPointer() uintptr { | |||
| 180 | 209 | // return 0; | |
| 181 | 210 | // } | |
| 182 | 211 | // | |
| 183 | - | // ]| | |
| 212 | + | // ``` | |
| 213 | + | // | |
| 184 | 214 | // The complete example can be found here: | |
| 185 | 215 | // [gapplication-example-cmdline.c](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/gio/tests/gapplication-example-cmdline.c) | |
| 186 | 216 | // | |
| 187 | 217 | // In more complicated cases, the handling of the commandline can be | |
| 188 | 218 | // split between the launcher and the primary instance. | |
| 189 | - | // |[<!-- language="C" --> | |
| 219 | + | // | |
| 220 | + | // ```c | |
| 190 | 221 | // static gboolean | |
| 191 | 222 | // | |
| 192 | 223 | // test_local_cmdline (GApplication *application, | |
| @@ -236,18 +267,19 @@ func (x *ApplicationCommandLinePrivate) GoPointer() uintptr { | |||
| 236 | 267 | // ... | |
| 237 | 268 | // } | |
| 238 | 269 | // | |
| 239 | - | // ]| | |
| 270 | + | // ``` | |
| 271 | + | // | |
| 240 | 272 | // In this example of split commandline handling, options that start | |
| 241 | 273 | // with `--local-` are handled locally, all other options are passed | |
| 242 | - | // to the #GApplication::command-line handler which runs in the primary | |
| 274 | + | // to the [signal@Gio.Application::command-line] handler which runs in the primary | |
| 243 | 275 | // instance. | |
| 244 | 276 | // | |
| 245 | 277 | // The complete example can be found here: | |
| 246 | 278 | // [gapplication-example-cmdline2.c](https://gitlab.gnome.org/GNOME/glib/-/blob/HEAD/gio/tests/gapplication-example-cmdline2.c) | |
| 247 | 279 | // | |
| 248 | - | // If handling the commandline requires a lot of work, it may | |
| 249 | - | // be better to defer it. | |
| 250 | - | // |[<!-- language="C" --> | |
| 280 | + | // If handling the commandline requires a lot of work, it may be better to defer it. | |
| 281 | + | // | |
| 282 | + | // ```c | |
| 251 | 283 | // static gboolean | |
| 252 | 284 | // my_cmdline_handler (gpointer data) | |
| 253 | 285 | // | |
| @@ -281,10 +313,11 @@ func (x *ApplicationCommandLinePrivate) GoPointer() uintptr { | |||
| 281 | 313 | // return 0; | |
| 282 | 314 | // } | |
| 283 | 315 | // | |
| 284 | - | // ]| | |
| 316 | + | // ``` | |
| 317 | + | // | |
| 285 | 318 | // In this example the commandline is not completely handled before | |
| 286 | - | // the #GApplication::command-line handler returns. Instead, we keep | |
| 287 | - | // a reference to the #GApplicationCommandLine object and handle it | |
| 319 | + | // the [signal@Gio.Application::command-line] handler returns. Instead, we keep | |
| 320 | + | // a reference to the `GApplicationCommandLine` object and handle it | |
| 288 | 321 | // later (in this example, in an idle). Note that it is necessary to | |
| 289 | 322 | // hold the application until you are done with the commandline. | |
| 290 | 323 | // | |
| @@ -327,6 +360,29 @@ func (x *ApplicationCommandLine) CreateFileForArg(ArgVar string) *FileBase { | |||
| 327 | 360 | return cls | |
| 328 | 361 | } | |
| 329 | 362 | ||
| 363 | + | var xApplicationCommandLineDone func(uintptr) | |
| 364 | + | ||
| 365 | + | // Signals that command line processing is completed. | |
| 366 | + | // | |
| 367 | + | // For remote invocation, it causes the invoking process to terminate. | |
| 368 | + | // | |
| 369 | + | // For local invocation, it does nothing. | |
| 370 | + | // | |
| 371 | + | // This method should be called in the [signal@Gio.Application::command-line] | |
| 372 | + | // handler, after the exit status is set and all messages are printed. | |
| 373 | + | // | |
| 374 | + | // After this call, g_application_command_line_set_exit_status() has no effect. | |
| 375 | + | // Subsequent calls to this method are no-ops. | |
| 376 | + | // | |
| 377 | + | // This method is automatically called when the #GApplicationCommandLine | |
| 378 | + | // object is disposed — so you can omit the call in non-garbage collected | |
| 379 | + | // languages. | |
| 380 | + | func (x *ApplicationCommandLine) Done() { | |
| 381 | + | ||
| 382 | + | xApplicationCommandLineDone(x.GoPointer()) | |
| 383 | + | ||
| 384 | + | } | |
| 385 | + | ||
| 330 | 386 | var xApplicationCommandLineGetArguments func(uintptr, int) []string | |
| 331 | 387 | ||
| 332 | 388 | // Gets the list of arguments that was passed on the command line. | |
| @@ -406,7 +462,7 @@ func (x *ApplicationCommandLine) GetIsRemote() bool { | |||
| 406 | 462 | ||
| 407 | 463 | var xApplicationCommandLineGetOptionsDict func(uintptr) *glib.VariantDict | |
| 408 | 464 | ||
| 409 | - | // Gets the options there were passed to g_application_command_line(). | |
| 465 | + | // Gets the options that were passed to g_application_command_line(). | |
| 410 | 466 | // | |
| 411 | 467 | // If you did not override local_command_line() then these are the same | |
| 412 | 468 | // options that were parsed according to the #GOptionEntrys added to the | |
| @@ -415,6 +471,9 @@ var xApplicationCommandLineGetOptionsDict func(uintptr) *glib.VariantDict | |||
| 415 | 471 | // | |
| 416 | 472 | // If no options were sent then an empty dictionary is returned so that | |
| 417 | 473 | // you don't need to check for %NULL. | |
| 474 | + | // | |
| 475 | + | // The data has been passed via an untrusted external process, so the types of | |
| 476 | + | // all values must be checked before being used. | |
| 418 | 477 | func (x *ApplicationCommandLine) GetOptionsDict() *glib.VariantDict { | |
| 419 | 478 | ||
| 420 | 479 | cret := xApplicationCommandLineGetOptionsDict(x.GoPointer()) | |
| @@ -430,6 +489,9 @@ var xApplicationCommandLineGetPlatformData func(uintptr) *glib.Variant | |||
| 430 | 489 | // information like the current working directory and the startup | |
| 431 | 490 | // notification ID. | |
| 432 | 491 | // | |
| 492 | + | // It comes from an untrusted external process and hence the types of all | |
| 493 | + | // values must be validated before being used. | |
| 494 | + | // | |
| 433 | 495 | // For local invocation, it will be %NULL. | |
| 434 | 496 | func (x *ApplicationCommandLine) GetPlatformData() *glib.Variant { | |
| 435 | 497 | ||
| @@ -495,6 +557,19 @@ func (x *ApplicationCommandLine) Print(FormatVar string, varArgs ...interface{}) | |||
| 495 | 557 | ||
| 496 | 558 | } | |
| 497 | 559 | ||
| 560 | + | var xApplicationCommandLinePrintLiteral func(uintptr, string) | |
| 561 | + | ||
| 562 | + | // Prints a message using the stdout print handler in the invoking process. | |
| 563 | + | // | |
| 564 | + | // Unlike g_application_command_line_print(), @message is not a `printf()`-style | |
| 565 | + | // format string. Use this function if @message contains text you don't have | |
| 566 | + | // control over, that could include `printf()` escape sequences. | |
| 567 | + | func (x *ApplicationCommandLine) PrintLiteral(MessageVar string) { | |
| 568 | + | ||
| 569 | + | xApplicationCommandLinePrintLiteral(x.GoPointer(), MessageVar) | |
| 570 | + | ||
| 571 | + | } | |
| 572 | + | ||
| 498 | 573 | var xApplicationCommandLinePrinterr func(uintptr, string, ...interface{}) | |
| 499 | 574 | ||
| 500 | 575 | // Formats a message and prints it using the stderr print handler in the | |
| @@ -509,6 +584,19 @@ func (x *ApplicationCommandLine) Printerr(FormatVar string, varArgs ...interface | |||
| 509 | 584 | ||
| 510 | 585 | } | |
| 511 | 586 | ||
| 587 | + | var xApplicationCommandLinePrinterrLiteral func(uintptr, string) | |
| 588 | + | ||
| 589 | + | // Prints a message using the stderr print handler in the invoking process. | |
| 590 | + | // | |
| 591 | + | // Unlike g_application_command_line_printerr(), @message is not | |
| 592 | + | // a `printf()`-style format string. Use this function if @message contains text | |
| 593 | + | // you don't have control over, that could include `printf()` escape sequences. | |
| 594 | + | func (x *ApplicationCommandLine) PrinterrLiteral(MessageVar string) { | |
| 595 | + | ||
| 596 | + | xApplicationCommandLinePrinterrLiteral(x.GoPointer(), MessageVar) | |
| 597 | + | ||
| 598 | + | } | |
| 599 | + | ||
| 512 | 600 | var xApplicationCommandLineSetExitStatus func(uintptr, int) | |
| 513 | 601 | ||
| 514 | 602 | // Sets the exit status that will be used when the invoking process | |
| @@ -532,6 +620,9 @@ var xApplicationCommandLineSetExitStatus func(uintptr, int) | |||
| 532 | 620 | // have been 'successful' in a certain sense, and the exit status is | |
| 533 | 621 | // always zero. If the application use count is zero, though, the exit | |
| 534 | 622 | // status of the local #GApplicationCommandLine is used. | |
| 623 | + | // | |
| 624 | + | // This method is a no-op if g_application_command_line_done() has | |
| 625 | + | // been called. | |
| 535 | 626 | func (x *ApplicationCommandLine) SetExitStatus(ExitStatusVar int) { | |
| 536 | 627 | ||
| 537 | 628 | xApplicationCommandLineSetExitStatus(x.GoPointer(), ExitStatusVar) | |
| @@ -560,6 +651,7 @@ func init() { | |||
| 560 | 651 | core.PuregoSafeRegister(&xApplicationCommandLineGLibType, lib, "g_application_command_line_get_type") | |
| 561 | 652 | ||
| 562 | 653 | core.PuregoSafeRegister(&xApplicationCommandLineCreateFileForArg, lib, "g_application_command_line_create_file_for_arg") | |
| 654 | + | core.PuregoSafeRegister(&xApplicationCommandLineDone, lib, "g_application_command_line_done") | |
| 563 | 655 | core.PuregoSafeRegister(&xApplicationCommandLineGetArguments, lib, "g_application_command_line_get_arguments") | |
| 564 | 656 | core.PuregoSafeRegister(&xApplicationCommandLineGetCwd, lib, "g_application_command_line_get_cwd") | |
| 565 | 657 | core.PuregoSafeRegister(&xApplicationCommandLineGetEnviron, lib, "g_application_command_line_get_environ") | |
| @@ -570,7 +662,9 @@ func init() { | |||
| 570 | 662 | core.PuregoSafeRegister(&xApplicationCommandLineGetStdin, lib, "g_application_command_line_get_stdin") | |
| 571 | 663 | core.PuregoSafeRegister(&xApplicationCommandLineGetenv, lib, "g_application_command_line_getenv") | |
| 572 | 664 | core.PuregoSafeRegister(&xApplicationCommandLinePrint, lib, "g_application_command_line_print") | |
| 665 | + | core.PuregoSafeRegister(&xApplicationCommandLinePrintLiteral, lib, "g_application_command_line_print_literal") | |
| 573 | 666 | core.PuregoSafeRegister(&xApplicationCommandLinePrinterr, lib, "g_application_command_line_printerr") | |
| 667 | + | core.PuregoSafeRegister(&xApplicationCommandLinePrinterrLiteral, lib, "g_application_command_line_printerr_literal") | |
| 574 | 668 | core.PuregoSafeRegister(&xApplicationCommandLineSetExitStatus, lib, "g_application_command_line_set_exit_status") | |
| 575 | 669 | ||
| 576 | 670 | } | |
M v4/gio/gasyncinitable.go +14 -8
| @@ -29,6 +29,7 @@ func (x *AsyncInitableIface) GoPointer() uintptr { | |||
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | // OverrideInitAsync sets the callback function. | |
| 32 | + | // Starts initialization of the object. | |
| 32 | 33 | func (x *AsyncInitableIface) OverrideInitAsync(cb func(AsyncInitable, int, *Cancellable, *AsyncReadyCallback, uintptr)) { | |
| 33 | 34 | if cb == nil { | |
| 34 | 35 | x.xInitAsync = 0 | |
| @@ -40,6 +41,7 @@ func (x *AsyncInitableIface) OverrideInitAsync(cb func(AsyncInitable, int, *Canc | |||
| 40 | 41 | } | |
| 41 | 42 | ||
| 42 | 43 | // GetInitAsync gets the callback function. | |
| 44 | + | // Starts initialization of the object. | |
| 43 | 45 | func (x *AsyncInitableIface) GetInitAsync() func(AsyncInitable, int, *Cancellable, *AsyncReadyCallback, uintptr) { | |
| 44 | 46 | if x.xInitAsync == 0 { | |
| 45 | 47 | return nil | |
| @@ -52,6 +54,7 @@ func (x *AsyncInitableIface) GetInitAsync() func(AsyncInitable, int, *Cancellabl | |||
| 52 | 54 | } | |
| 53 | 55 | ||
| 54 | 56 | // OverrideInitFinish sets the callback function. | |
| 57 | + | // Finishes initialization of the object. | |
| 55 | 58 | func (x *AsyncInitableIface) OverrideInitFinish(cb func(AsyncInitable, AsyncResult) bool) { | |
| 56 | 59 | if cb == nil { | |
| 57 | 60 | x.xInitFinish = 0 | |
| @@ -63,6 +66,7 @@ func (x *AsyncInitableIface) OverrideInitFinish(cb func(AsyncInitable, AsyncResu | |||
| 63 | 66 | } | |
| 64 | 67 | ||
| 65 | 68 | // GetInitFinish gets the callback function. | |
| 69 | + | // Finishes initialization of the object. | |
| 66 | 70 | func (x *AsyncInitableIface) GetInitFinish() func(AsyncInitable, AsyncResult) bool { | |
| 67 | 71 | if x.xInitFinish == 0 { | |
| 68 | 72 | return nil | |
| @@ -74,22 +78,24 @@ func (x *AsyncInitableIface) GetInitFinish() func(AsyncInitable, AsyncResult) bo | |||
| 74 | 78 | } | |
| 75 | 79 | } | |
| 76 | 80 | ||
| 77 | - | // This is the asynchronous version of #GInitable; it behaves the same | |
| 81 | + | // `GAsyncInitable` is an interface for asynchronously initializable objects. | |
| 82 | + | // | |
| 83 | + | // This is the asynchronous version of [iface@Gio.Initable]; it behaves the same | |
| 78 | 84 | // in all ways except that initialization is asynchronous. For more details | |
| 79 | - | // see the descriptions on #GInitable. | |
| 85 | + | // see the descriptions on `GInitable`. | |
| 80 | 86 | // | |
| 81 | - | // A class may implement both the #GInitable and #GAsyncInitable interfaces. | |
| 87 | + | // A class may implement both the `GInitable` and `GAsyncInitable` interfaces. | |
| 82 | 88 | // | |
| 83 | 89 | // Users of objects implementing this are not intended to use the interface | |
| 84 | 90 | // method directly; instead it will be used automatically in various ways. | |
| 85 | - | // For C applications you generally just call g_async_initable_new_async() | |
| 91 | + | // For C applications you generally just call [func@Gio.AsyncInitable.new_async] | |
| 86 | 92 | // directly, or indirectly via a foo_thing_new_async() wrapper. This will call | |
| 87 | - | // g_async_initable_init_async() under the cover, calling back with %NULL and | |
| 88 | - | // a set %GError on failure. | |
| 93 | + | // [method@Gio.AsyncInitable.init_async] under the covers, calling back with `NULL` | |
| 94 | + | // and a set `GError` on failure. | |
| 89 | 95 | // | |
| 90 | 96 | // A typical implementation might look something like this: | |
| 91 | 97 | // | |
| 92 | - | // |[<!-- language="C" --> | |
| 98 | + | // ```c | |
| 93 | 99 | // | |
| 94 | 100 | // enum { | |
| 95 | 101 | // NOT_INITIALIZED, | |
| @@ -181,7 +187,7 @@ func (x *AsyncInitableIface) GetInitFinish() func(AsyncInitable, AsyncResult) bo | |||
| 181 | 187 | // iface->init_finish = foo_init_finish; | |
| 182 | 188 | // } | |
| 183 | 189 | // | |
| 184 | - | // ]| | |
| 190 | + | // ``` | |
| 185 | 191 | type AsyncInitable interface { | |
| 186 | 192 | GoPointer() uintptr | |
| 187 | 193 | SetGoPointer(uintptr) | |
M v4/gio/gasyncresult.go +39 -32
| @@ -12,7 +12,7 @@ import ( | |||
| 12 | 12 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 13 | 13 | ) | |
| 14 | 14 | ||
| 15 | - | // Interface definition for #GAsyncResult. | |
| 15 | + | // Interface definition for [iface@Gio.AsyncResult]. | |
| 16 | 16 | type AsyncResultIface struct { | |
| 17 | 17 | _ structs.HostLayout | |
| 18 | 18 | ||
| @@ -30,6 +30,7 @@ func (x *AsyncResultIface) GoPointer() uintptr { | |||
| 30 | 30 | } | |
| 31 | 31 | ||
| 32 | 32 | // OverrideGetUserData sets the callback function. | |
| 33 | + | // Gets the user data passed to the callback. | |
| 33 | 34 | func (x *AsyncResultIface) OverrideGetUserData(cb func(AsyncResult) uintptr) { | |
| 34 | 35 | if cb == nil { | |
| 35 | 36 | x.xGetUserData = 0 | |
| @@ -41,6 +42,7 @@ func (x *AsyncResultIface) OverrideGetUserData(cb func(AsyncResult) uintptr) { | |||
| 41 | 42 | } | |
| 42 | 43 | ||
| 43 | 44 | // GetGetUserData gets the callback function. | |
| 45 | + | // Gets the user data passed to the callback. | |
| 44 | 46 | func (x *AsyncResultIface) GetGetUserData() func(AsyncResult) uintptr { | |
| 45 | 47 | if x.xGetUserData == 0 { | |
| 46 | 48 | return nil | |
| @@ -53,6 +55,7 @@ func (x *AsyncResultIface) GetGetUserData() func(AsyncResult) uintptr { | |||
| 53 | 55 | } | |
| 54 | 56 | ||
| 55 | 57 | // OverrideGetSourceObject sets the callback function. | |
| 58 | + | // Gets the source object that issued the asynchronous operation. | |
| 56 | 59 | func (x *AsyncResultIface) OverrideGetSourceObject(cb func(AsyncResult) *gobject.Object) { | |
| 57 | 60 | if cb == nil { | |
| 58 | 61 | x.xGetSourceObject = 0 | |
| @@ -68,6 +71,7 @@ func (x *AsyncResultIface) OverrideGetSourceObject(cb func(AsyncResult) *gobject | |||
| 68 | 71 | } | |
| 69 | 72 | ||
| 70 | 73 | // GetGetSourceObject gets the callback function. | |
| 74 | + | // Gets the source object that issued the asynchronous operation. | |
| 71 | 75 | func (x *AsyncResultIface) GetGetSourceObject() func(AsyncResult) *gobject.Object { | |
| 72 | 76 | if x.xGetSourceObject == 0 { | |
| 73 | 77 | return nil | |
| @@ -86,6 +90,7 @@ func (x *AsyncResultIface) GetGetSourceObject() func(AsyncResult) *gobject.Objec | |||
| 86 | 90 | } | |
| 87 | 91 | ||
| 88 | 92 | // OverrideIsTagged sets the callback function. | |
| 93 | + | // Checks if a result is tagged with a particular source. | |
| 89 | 94 | func (x *AsyncResultIface) OverrideIsTagged(cb func(AsyncResult, uintptr) bool) { | |
| 90 | 95 | if cb == nil { | |
| 91 | 96 | x.xIsTagged = 0 | |
| @@ -97,6 +102,7 @@ func (x *AsyncResultIface) OverrideIsTagged(cb func(AsyncResult, uintptr) bool) | |||
| 97 | 102 | } | |
| 98 | 103 | ||
| 99 | 104 | // GetIsTagged gets the callback function. | |
| 105 | + | // Checks if a result is tagged with a particular source. | |
| 100 | 106 | func (x *AsyncResultIface) GetIsTagged() func(AsyncResult, uintptr) bool { | |
| 101 | 107 | if x.xIsTagged == 0 { | |
| 102 | 108 | return nil | |
| @@ -108,37 +114,38 @@ func (x *AsyncResultIface) GetIsTagged() func(AsyncResult, uintptr) bool { | |||
| 108 | 114 | } | |
| 109 | 115 | } | |
| 110 | 116 | ||
| 111 | - | // Provides a base class for implementing asynchronous function results. | |
| 117 | + | // `GAsyncResult` provides a base class for implementing asynchronous function results. | |
| 112 | 118 | // | |
| 113 | 119 | // Asynchronous operations are broken up into two separate operations | |
| 114 | - | // which are chained together by a #GAsyncReadyCallback. To begin | |
| 115 | - | // an asynchronous operation, provide a #GAsyncReadyCallback to the | |
| 120 | + | // which are chained together by a `GAsyncReadyCallback`. To begin | |
| 121 | + | // an asynchronous operation, provide a `GAsyncReadyCallback` to the | |
| 116 | 122 | // asynchronous function. This callback will be triggered when the | |
| 117 | 123 | // operation has completed, and must be run in a later iteration of | |
| 118 | - | // the [thread-default main context][g-main-context-push-thread-default] | |
| 119 | - | // from where the operation was initiated. It will be passed a | |
| 120 | - | // #GAsyncResult instance filled with the details of the operation's | |
| 121 | - | // success or failure, the object the asynchronous function was | |
| 122 | - | // started for and any error codes returned. The asynchronous callback | |
| 123 | - | // function is then expected to call the corresponding "_finish()" | |
| 124 | + | // the thread-default main context (see | |
| 125 | + | // [method@GLib.MainContext.push_thread_default]) from where the operation was | |
| 126 | + | // initiated. It will be passed a `GAsyncResult` instance filled with the | |
| 127 | + | // details of the operation's success or failure, the object the asynchronous | |
| 128 | + | // function was started for and any error codes returned. The asynchronous | |
| 129 | + | // callback function is then expected to call the corresponding `_finish()` | |
| 124 | 130 | // function, passing the object the function was called for, the | |
| 125 | - | // #GAsyncResult instance, and (optionally) an @error to grab any | |
| 131 | + | // `GAsyncResult` instance, and (optionally) an @error to grab any | |
| 126 | 132 | // error conditions that may have occurred. | |
| 127 | 133 | // | |
| 128 | - | // The "_finish()" function for an operation takes the generic result | |
| 129 | - | // (of type #GAsyncResult) and returns the specific result that the | |
| 130 | - | // operation in question yields (e.g. a #GFileEnumerator for a | |
| 134 | + | // The `_finish()` function for an operation takes the generic result | |
| 135 | + | // (of type `GAsyncResult`) and returns the specific result that the | |
| 136 | + | // operation in question yields (e.g. a [class@Gio.FileEnumerator] for a | |
| 131 | 137 | // "enumerate children" operation). If the result or error status of the | |
| 132 | - | // operation is not needed, there is no need to call the "_finish()" | |
| 138 | + | // operation is not needed, there is no need to call the `_finish()` | |
| 133 | 139 | // function; GIO will take care of cleaning up the result and error | |
| 134 | - | // information after the #GAsyncReadyCallback returns. You can pass | |
| 135 | - | // %NULL for the #GAsyncReadyCallback if you don't need to take any | |
| 140 | + | // information after the `GAsyncReadyCallback` returns. You can pass | |
| 141 | + | // `NULL` for the `GAsyncReadyCallback` if you don't need to take any | |
| 136 | 142 | // action at all after the operation completes. Applications may also | |
| 137 | - | // take a reference to the #GAsyncResult and call "_finish()" later; | |
| 138 | - | // however, the "_finish()" function may be called at most once. | |
| 143 | + | // take a reference to the `GAsyncResult` and call `_finish()` later; | |
| 144 | + | // however, the `_finish()` function may be called at most once. | |
| 139 | 145 | // | |
| 140 | 146 | // Example of a typical asynchronous operation flow: | |
| 141 | - | // |[<!-- language="C" --> | |
| 147 | + | // | |
| 148 | + | // ```c | |
| 142 | 149 | // void _theoretical_frobnitz_async (Theoretical *t, | |
| 143 | 150 | // | |
| 144 | 151 | // GCancellable *c, | |
| @@ -183,20 +190,20 @@ func (x *AsyncResultIface) GetIsTagged() func(AsyncResult, uintptr) bool { | |||
| 183 | 190 | // ... | |
| 184 | 191 | // } | |
| 185 | 192 | // | |
| 186 | - | // ]| | |
| 193 | + | // ``` | |
| 187 | 194 | // | |
| 188 | 195 | // The callback for an asynchronous operation is called only once, and is | |
| 189 | 196 | // always called, even in the case of a cancelled operation. On cancellation | |
| 190 | - | // the result is a %G_IO_ERROR_CANCELLED error. | |
| 197 | + | // the result is a `G_IO_ERROR_CANCELLED` error. | |
| 191 | 198 | // | |
| 192 | - | // ## I/O Priority # {#io-priority} | |
| 199 | + | // ## I/O Priority | |
| 193 | 200 | // | |
| 194 | 201 | // Many I/O-related asynchronous operations have a priority parameter, | |
| 195 | 202 | // which is used in certain cases to determine the order in which | |
| 196 | 203 | // operations are executed. They are not used to determine system-wide | |
| 197 | 204 | // I/O scheduling. Priorities are integers, with lower numbers indicating | |
| 198 | 205 | // higher priority. It is recommended to choose priorities between | |
| 199 | - | // %G_PRIORITY_LOW and %G_PRIORITY_HIGH, with %G_PRIORITY_DEFAULT | |
| 206 | + | // `G_PRIORITY_LOW` and `G_PRIORITY_HIGH`, with `G_PRIORITY_DEFAULT` | |
| 200 | 207 | // as a default. | |
| 201 | 208 | type AsyncResult interface { | |
| 202 | 209 | GoPointer() uintptr | |
| @@ -228,7 +235,7 @@ func (x *AsyncResultBase) SetGoPointer(ptr uintptr) { | |||
| 228 | 235 | x.Ptr = ptr | |
| 229 | 236 | } | |
| 230 | 237 | ||
| 231 | - | // Gets the source object from a #GAsyncResult. | |
| 238 | + | // Gets the source object from a [iface@Gio.AsyncResult]. | |
| 232 | 239 | func (x *AsyncResultBase) GetSourceObject() *gobject.Object { | |
| 233 | 240 | var cls *gobject.Object | |
| 234 | 241 | ||
| @@ -242,7 +249,7 @@ func (x *AsyncResultBase) GetSourceObject() *gobject.Object { | |||
| 242 | 249 | return cls | |
| 243 | 250 | } | |
| 244 | 251 | ||
| 245 | - | // Gets the user data from a #GAsyncResult. | |
| 252 | + | // Gets the user data from a [iface@Gio.AsyncResult]. | |
| 246 | 253 | func (x *AsyncResultBase) GetUserData() uintptr { | |
| 247 | 254 | ||
| 248 | 255 | cret := XGAsyncResultGetUserData(x.GoPointer()) | |
| @@ -257,14 +264,14 @@ func (x *AsyncResultBase) IsTagged(SourceTagVar uintptr) bool { | |||
| 257 | 264 | return cret | |
| 258 | 265 | } | |
| 259 | 266 | ||
| 260 | - | // If @res is a #GSimpleAsyncResult, this is equivalent to | |
| 261 | - | // g_simple_async_result_propagate_error(). Otherwise it returns | |
| 262 | - | // %FALSE. | |
| 267 | + | // If @res is a [class@Gio.SimpleAsyncResult], this is equivalent to | |
| 268 | + | // [method@Gio.SimpleAsyncResult.propagate_error]. Otherwise it returns | |
| 269 | + | // `FALSE`. | |
| 263 | 270 | // | |
| 264 | - | // This can be used for legacy error handling in async *_finish() | |
| 265 | - | // wrapper functions that traditionally handled #GSimpleAsyncResult | |
| 271 | + | // This can be used for legacy error handling in async `*_finish()` | |
| 272 | + | // wrapper functions that traditionally handled [class@Gio.SimpleAsyncResult] | |
| 266 | 273 | // error returns themselves rather than calling into the virtual method. | |
| 267 | - | // This should not be used in new code; #GAsyncResult errors that are | |
| 274 | + | // This should not be used in new code; [iface@Gio.AsyncResult] errors that are | |
| 268 | 275 | // set by virtual methods should also be extracted by virtual methods, | |
| 269 | 276 | // to enable subclasses to chain up correctly. | |
| 270 | 277 | func (x *AsyncResultBase) LegacyPropagateError() (bool, error) { | |
M v4/gio/gbufferedinputstream.go +23 -23
| @@ -229,20 +229,19 @@ func (x *BufferedInputStreamPrivate) GoPointer() uintptr { | |||
| 229 | 229 | return uintptr(unsafe.Pointer(x)) | |
| 230 | 230 | } | |
| 231 | 231 | ||
| 232 | - | // Buffered input stream implements #GFilterInputStream and provides | |
| 232 | + | // Buffered input stream implements [class@Gio.FilterInputStream] and provides | |
| 233 | 233 | // for buffered reads. | |
| 234 | 234 | // | |
| 235 | - | // By default, #GBufferedInputStream's buffer size is set at 4 kilobytes. | |
| 235 | + | // By default, `GBufferedInputStream`'s buffer size is set at 4 kilobytes. | |
| 236 | 236 | // | |
| 237 | - | // To create a buffered input stream, use g_buffered_input_stream_new(), | |
| 238 | - | // or g_buffered_input_stream_new_sized() to specify the buffer's size at | |
| 237 | + | // To create a buffered input stream, use [ctor@Gio.BufferedInputStream.new], | |
| 238 | + | // or [ctor@Gio.BufferedInputStream.new_sized] to specify the buffer's size at | |
| 239 | 239 | // construction. | |
| 240 | 240 | // | |
| 241 | 241 | // To get the size of a buffer within a buffered input stream, use | |
| 242 | - | // g_buffered_input_stream_get_buffer_size(). To change the size of a | |
| 243 | - | // buffered input stream's buffer, use | |
| 244 | - | // g_buffered_input_stream_set_buffer_size(). Note that the buffer's size | |
| 245 | - | // cannot be reduced below the size of the data within the buffer. | |
| 242 | + | // [method@Gio.BufferedInputStream.get_buffer_size]. To change the size of a | |
| 243 | + | // buffered input stream's buffer, use [method@Gio.BufferedInputStream.set_buffer_size]. | |
| 244 | + | // Note that the buffer's size cannot be reduced below the size of the data within the buffer. | |
| 246 | 245 | type BufferedInputStream struct { | |
| 247 | 246 | FilterInputStream | |
| 248 | 247 | } | |
| @@ -261,7 +260,7 @@ func BufferedInputStreamNewFromInternalPtr(ptr uintptr) *BufferedInputStream { | |||
| 261 | 260 | ||
| 262 | 261 | var xNewBufferedInputStream func(uintptr) uintptr | |
| 263 | 262 | ||
| 264 | - | // Creates a new #GInputStream from the given @base_stream, with | |
| 263 | + | // Creates a new [class@Gio.InputStream] from the given @base_stream, with | |
| 265 | 264 | // a buffer set to the default size (4 kilobytes). | |
| 266 | 265 | func NewBufferedInputStream(BaseStreamVar *InputStream) *BufferedInputStream { | |
| 267 | 266 | var cls *BufferedInputStream | |
| @@ -278,7 +277,7 @@ func NewBufferedInputStream(BaseStreamVar *InputStream) *BufferedInputStream { | |||
| 278 | 277 | ||
| 279 | 278 | var xNewBufferedInputStreamSized func(uintptr, uint) uintptr | |
| 280 | 279 | ||
| 281 | - | // Creates a new #GBufferedInputStream from the given @base_stream, | |
| 280 | + | // Creates a new [class@Gio.BufferedInputStream] from the given @base_stream, | |
| 282 | 281 | // with a buffer set to @size. | |
| 283 | 282 | func NewBufferedInputStreamSized(BaseStreamVar *InputStream, SizeVar uint) *BufferedInputStream { | |
| 284 | 283 | var cls *BufferedInputStream | |
| @@ -299,7 +298,8 @@ var xBufferedInputStreamFill func(uintptr, int, uintptr, **glib.Error) int | |||
| 299 | 298 | // Will block during this read. | |
| 300 | 299 | // | |
| 301 | 300 | // If @count is zero, returns zero and does nothing. A value of @count | |
| 302 | - | // larger than %G_MAXSSIZE will cause a %G_IO_ERROR_INVALID_ARGUMENT error. | |
| 301 | + | // larger than `G_MAXSSIZE` will cause a | |
| 302 | + | // [error@Gio.IOErrorEnum.INVALID_ARGUMENT] error. | |
| 303 | 303 | // | |
| 304 | 304 | // On success, the number of bytes read into the buffer is returned. | |
| 305 | 305 | // It is not an error if this is not the same as the requested size, as it | |
| @@ -309,16 +309,16 @@ var xBufferedInputStreamFill func(uintptr, int, uintptr, **glib.Error) int | |||
| 309 | 309 | // If @count is -1 then the attempted read size is equal to the number of | |
| 310 | 310 | // bytes that are required to fill the buffer. | |
| 311 | 311 | // | |
| 312 | - | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 312 | + | // If @cancellable is not `NULL`, then the operation can be cancelled by | |
| 313 | 313 | // triggering the cancellable object from another thread. If the operation | |
| 314 | - | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 315 | - | // operation was partially finished when the operation was cancelled the | |
| 314 | + | // was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned. | |
| 315 | + | // If an operation was partially finished when the operation was cancelled the | |
| 316 | 316 | // partial result will be returned, without an error. | |
| 317 | 317 | // | |
| 318 | - | // On error -1 is returned and @error is set accordingly. | |
| 318 | + | // On error `-1` is returned and @error is set accordingly. | |
| 319 | 319 | // | |
| 320 | 320 | // For the asynchronous, non-blocking, version of this function, see | |
| 321 | - | // g_buffered_input_stream_fill_async(). | |
| 321 | + | // [method@Gio.BufferedInputStream.fill_async]. | |
| 322 | 322 | func (x *BufferedInputStream) Fill(CountVar int, CancellableVar *Cancellable) (int, error) { | |
| 323 | 323 | var cerr *glib.Error | |
| 324 | 324 | ||
| @@ -334,9 +334,9 @@ var xBufferedInputStreamFillAsync func(uintptr, int, int, uintptr, uintptr, uint | |||
| 334 | 334 | ||
| 335 | 335 | // Reads data into @stream's buffer asynchronously, up to @count size. | |
| 336 | 336 | // @io_priority can be used to prioritize reads. For the synchronous | |
| 337 | - | // version of this function, see g_buffered_input_stream_fill(). | |
| 337 | + | // version of this function, see [method@Gio.BufferedInputStream.fill]. | |
| 338 | 338 | // | |
| 339 | - | // If @count is -1 then the attempted read size is equal to the number | |
| 339 | + | // If @count is `-1` then the attempted read size is equal to the number | |
| 340 | 340 | // of bytes that are required to fill the buffer. | |
| 341 | 341 | func (x *BufferedInputStream) FillAsync(CountVar int, IoPriorityVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 342 | 342 | ||
| @@ -403,15 +403,15 @@ var xBufferedInputStreamReadByte func(uintptr, uintptr, **glib.Error) int | |||
| 403 | 403 | // during this read. | |
| 404 | 404 | // | |
| 405 | 405 | // On success, the byte read from the stream is returned. On end of stream | |
| 406 | - | // -1 is returned but it's not an exceptional error and @error is not set. | |
| 406 | + | // `-1` is returned but it's not an exceptional error and @error is not set. | |
| 407 | 407 | // | |
| 408 | - | // If @cancellable is not %NULL, then the operation can be cancelled by | |
| 408 | + | // If @cancellable is not `NULL`, then the operation can be cancelled by | |
| 409 | 409 | // triggering the cancellable object from another thread. If the operation | |
| 410 | - | // was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. If an | |
| 411 | - | // operation was partially finished when the operation was cancelled the | |
| 410 | + | // was cancelled, the error [error@Gio.IOErrorEnum.CANCELLED] will be returned. | |
| 411 | + | // If an operation was partially finished when the operation was cancelled the | |
| 412 | 412 | // partial result will be returned, without an error. | |
| 413 | 413 | // | |
| 414 | - | // On error -1 is returned and @error is set accordingly. | |
| 414 | + | // On error `-1` is returned and @error is set accordingly. | |
| 415 | 415 | func (x *BufferedInputStream) ReadByte(CancellableVar *Cancellable) (int, error) { | |
| 416 | 416 | var cerr *glib.Error | |
| 417 | 417 | ||
M v4/gio/gbufferedoutputstream.go +7 -8
| @@ -79,20 +79,19 @@ func (x *BufferedOutputStreamPrivate) GoPointer() uintptr { | |||
| 79 | 79 | return uintptr(unsafe.Pointer(x)) | |
| 80 | 80 | } | |
| 81 | 81 | ||
| 82 | - | // Buffered output stream implements #GFilterOutputStream and provides | |
| 82 | + | // Buffered output stream implements [class@Gio.FilterOutputStream] and provides | |
| 83 | 83 | // for buffered writes. | |
| 84 | 84 | // | |
| 85 | - | // By default, #GBufferedOutputStream's buffer size is set at 4 kilobytes. | |
| 85 | + | // By default, `GBufferedOutputStream`'s buffer size is set at 4 kilobytes. | |
| 86 | 86 | // | |
| 87 | - | // To create a buffered output stream, use g_buffered_output_stream_new(), | |
| 88 | - | // or g_buffered_output_stream_new_sized() to specify the buffer's size | |
| 87 | + | // To create a buffered output stream, use [ctor@Gio.BufferedOutputStream.new], | |
| 88 | + | // or [ctor@Gio.BufferedOutputStream.new_sized] to specify the buffer's size | |
| 89 | 89 | // at construction. | |
| 90 | 90 | // | |
| 91 | 91 | // To get the size of a buffer within a buffered input stream, use | |
| 92 | - | // g_buffered_output_stream_get_buffer_size(). To change the size of a | |
| 93 | - | // buffered output stream's buffer, use | |
| 94 | - | // g_buffered_output_stream_set_buffer_size(). Note that the buffer's | |
| 95 | - | // size cannot be reduced below the size of the data within the buffer. | |
| 92 | + | // [method@Gio.BufferedOutputStream.get_buffer_size]. To change the size of a | |
| 93 | + | // buffered output stream's buffer, use [method@Gio.BufferedOutputStream.set_buffer_size]. | |
| 94 | + | // Note that the buffer's size cannot be reduced below the size of the data within the buffer. | |
| 96 | 95 | type BufferedOutputStream struct { | |
| 97 | 96 | FilterOutputStream | |
| 98 | 97 | } | |
A v4/gio/gbytesicon.go +178 -0
| @@ -0,0 +1,178 @@ | |||
| 1 | + | // Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gio | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | // `GBytesIcon` specifies an image held in memory in a common format (usually | |
| 13 | + | // PNG) to be used as icon. | |
| 14 | + | type BytesIcon struct { | |
| 15 | + | gobject.Object | |
| 16 | + | } | |
| 17 | + | ||
| 18 | + | var xBytesIconGLibType func() types.GType | |
| 19 | + | ||
| 20 | + | func BytesIconGLibType() types.GType { | |
| 21 | + | return xBytesIconGLibType() | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | func BytesIconNewFromInternalPtr(ptr uintptr) *BytesIcon { | |
| 25 | + | cls := &BytesIcon{} | |
| 26 | + | cls.Ptr = ptr | |
| 27 | + | return cls | |
| 28 | + | } | |
| 29 | + | ||
| 30 | + | var xNewBytesIcon func(*glib.Bytes) uintptr | |
| 31 | + | ||
| 32 | + | // Creates a new icon for a bytes. | |
| 33 | + | // | |
| 34 | + | // This cannot fail, but loading and interpreting the bytes may fail later on | |
| 35 | + | // (for example, if g_loadable_icon_load() is called) if the image is invalid. | |
| 36 | + | func NewBytesIcon(BytesVar *glib.Bytes) *BytesIcon { | |
| 37 | + | var cls *BytesIcon | |
| 38 | + | ||
| 39 | + | cret := xNewBytesIcon(BytesVar) | |
| 40 | + | ||
| 41 | + | if cret == 0 { | |
| 42 | + | return nil | |
| 43 | + | } | |
| 44 | + | cls = &BytesIcon{} | |
| 45 | + | cls.Ptr = cret | |
| 46 | + | return cls | |
| 47 | + | } | |
| 48 | + | ||
| 49 | + | var xBytesIconGetBytes func(uintptr) *glib.Bytes | |
| 50 | + | ||
| 51 | + | // Gets the #GBytes associated with the given @icon. | |
| 52 | + | func (x *BytesIcon) GetBytes() *glib.Bytes { | |
| 53 | + | ||
| 54 | + | cret := xBytesIconGetBytes(x.GoPointer()) | |
| 55 | + | return cret | |
| 56 | + | } | |
| 57 | + | ||
| 58 | + | func (c *BytesIcon) GoPointer() uintptr { | |
| 59 | + | if c == nil { | |
| 60 | + | return 0 | |
| 61 | + | } | |
| 62 | + | return c.Ptr | |
| 63 | + | } | |
| 64 | + | ||
| 65 | + | func (c *BytesIcon) SetGoPointer(ptr uintptr) { | |
| 66 | + | c.Ptr = ptr | |
| 67 | + | } | |
| 68 | + | ||
| 69 | + | // Checks if two icons are equal. | |
| 70 | + | func (x *BytesIcon) Equal(Icon2Var Icon) bool { | |
| 71 | + | ||
| 72 | + | cret := XGIconEqual(x.GoPointer(), Icon2Var.GoPointer()) | |
| 73 | + | return cret | |
| 74 | + | } | |
| 75 | + | ||
| 76 | + | // Gets a hash for an icon. | |
| 77 | + | func (x *BytesIcon) Hash() uint { | |
| 78 | + | ||
| 79 | + | cret := XGIconHash(x.GoPointer()) | |
| 80 | + | return cret | |
| 81 | + | } | |
| 82 | + | ||
| 83 | + | // Serializes a #GIcon into a #GVariant. An equivalent #GIcon can be retrieved | |
| 84 | + | // back by calling g_icon_deserialize() on the returned value. | |
| 85 | + | // As serialization will avoid using raw icon data when possible, it only | |
| 86 | + | // makes sense to transfer the #GVariant between processes on the same machine, | |
| 87 | + | // (as opposed to over the network), and within the same file system namespace. | |
| 88 | + | func (x *BytesIcon) Serialize() *glib.Variant { | |
| 89 | + | ||
| 90 | + | cret := XGIconSerialize(x.GoPointer()) | |
| 91 | + | return cret | |
| 92 | + | } | |
| 93 | + | ||
| 94 | + | // Generates a textual representation of @icon that can be used for | |
| 95 | + | // serialization such as when passing @icon to a different process or | |
| 96 | + | // saving it to persistent storage. Use g_icon_new_for_string() to | |
| 97 | + | // get @icon back from the returned string. | |
| 98 | + | // | |
| 99 | + | // The encoding of the returned string is proprietary to #GIcon except | |
| 100 | + | // in the following two cases | |
| 101 | + | // | |
| 102 | + | // - If @icon is a #GFileIcon, the returned string is a native path | |
| 103 | + | // (such as `/path/to/my icon.png`) without escaping | |
| 104 | + | // if the #GFile for @icon is a native file. If the file is not | |
| 105 | + | // native, the returned string is the result of g_file_get_uri() | |
| 106 | + | // (such as `sftp://path/to/my%20icon.png`). | |
| 107 | + | // | |
| 108 | + | // - If @icon is a #GThemedIcon with exactly one name and no fallbacks, | |
| 109 | + | // the encoding is simply the name (such as `network-server`). | |
| 110 | + | func (x *BytesIcon) ToString() string { | |
| 111 | + | ||
| 112 | + | cret := XGIconToString(x.GoPointer()) | |
| 113 | + | return cret | |
| 114 | + | } | |
| 115 | + | ||
| 116 | + | // Loads a loadable icon. For the asynchronous version of this function, | |
| 117 | + | // see g_loadable_icon_load_async(). | |
| 118 | + | func (x *BytesIcon) Load(SizeVar int, TypeVar string, CancellableVar *Cancellable) (*InputStream, error) { | |
| 119 | + | var cls *InputStream | |
| 120 | + | var cerr *glib.Error | |
| 121 | + | ||
| 122 | + | cret := XGLoadableIconLoad(x.GoPointer(), SizeVar, TypeVar, CancellableVar.GoPointer(), &cerr) | |
| 123 | + | ||
| 124 | + | if cret == 0 { | |
| 125 | + | return nil, cerr | |
| 126 | + | } | |
| 127 | + | cls = &InputStream{} | |
| 128 | + | cls.Ptr = cret | |
| 129 | + | if cerr == nil { | |
| 130 | + | return cls, nil | |
| 131 | + | } | |
| 132 | + | return cls, cerr | |
| 133 | + | ||
| 134 | + | } | |
| 135 | + | ||
| 136 | + | // Loads an icon asynchronously. To finish this function, see | |
| 137 | + | // g_loadable_icon_load_finish(). For the synchronous, blocking | |
| 138 | + | // version of this function, see g_loadable_icon_load(). | |
| 139 | + | func (x *BytesIcon) LoadAsync(SizeVar int, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 140 | + | ||
| 141 | + | XGLoadableIconLoadAsync(x.GoPointer(), SizeVar, CancellableVar.GoPointer(), glib.NewCallbackNullable(CallbackVar), UserDataVar) | |
| 142 | + | ||
| 143 | + | } | |
| 144 | + | ||
| 145 | + | // Finishes an asynchronous icon load started in g_loadable_icon_load_async(). | |
| 146 | + | func (x *BytesIcon) LoadFinish(ResVar AsyncResult, TypeVar string) (*InputStream, error) { | |
| 147 | + | var cls *InputStream | |
| 148 | + | var cerr *glib.Error | |
| 149 | + | ||
| 150 | + | cret := XGLoadableIconLoadFinish(x.GoPointer(), ResVar.GoPointer(), TypeVar, &cerr) | |
| 151 | + | ||
| 152 | + | if cret == 0 { | |
| 153 | + | return nil, cerr | |
| 154 | + | } | |
| 155 | + | cls = &InputStream{} | |
| 156 | + | cls.Ptr = cret | |
| 157 | + | if cerr == nil { | |
| 158 | + | return cls, nil | |
| 159 | + | } | |
| 160 | + | return cls, cerr | |
| 161 | + | ||
| 162 | + | } | |
| 163 | + | ||
| 164 | + | func init() { | |
| 165 | + | core.SetPackageName("GIO", "gio-2.0") | |
| 166 | + | core.SetSharedLibrary("GIO", "libgio-2.0.so.0") | |
| 167 | + | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 168 | + | if err != nil { | |
| 169 | + | panic(err) | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | core.PuregoSafeRegister(&xBytesIconGLibType, lib, "g_bytes_icon_get_type") | |
| 173 | + | ||
| 174 | + | core.PuregoSafeRegister(&xNewBytesIcon, lib, "g_bytes_icon_new") | |
| 175 | + | ||
| 176 | + | core.PuregoSafeRegister(&xBytesIconGetBytes, lib, "g_bytes_icon_get_bytes") | |
| 177 | + | ||
| 178 | + | } | |
M v4/gio/gcancellable.go +43 -6
| @@ -180,7 +180,9 @@ func (x *CancellablePrivate) GoPointer() uintptr { | |||
| 180 | 180 | return uintptr(unsafe.Pointer(x)) | |
| 181 | 181 | } | |
| 182 | 182 | ||
| 183 | - | // GCancellable is a thread-safe operation cancellation stack used | |
| 183 | + | // `GCancellable` allows operations to be cancelled. | |
| 184 | + | // | |
| 185 | + | // `GCancellable` is a thread-safe operation cancellation stack used | |
| 184 | 186 | // throughout GIO to allow for cancellation of synchronous and | |
| 185 | 187 | // asynchronous operations. | |
| 186 | 188 | type Cancellable struct { | |
| @@ -240,6 +242,9 @@ var xCancellableCancel func(uintptr) | |||
| 240 | 242 | // cancel the operation from the same thread in which it is running, | |
| 241 | 243 | // then the operation's #GAsyncReadyCallback will not be invoked until | |
| 242 | 244 | // the application returns to the main loop. | |
| 245 | + | // | |
| 246 | + | // It is safe (although useless, since it will be a no-op) to call | |
| 247 | + | // this function from a [signal@Gio.Cancellable::cancelled] signal handler. | |
| 243 | 248 | func (x *Cancellable) Cancel() { | |
| 244 | 249 | ||
| 245 | 250 | xCancellableCancel(x.GoPointer()) | |
| @@ -252,9 +257,14 @@ var xCancellableConnect func(uintptr, uintptr, uintptr, uintptr) uint32 | |||
| 252 | 257 | // signal. Also handles the race condition that may happen | |
| 253 | 258 | // if the cancellable is cancelled right before connecting. | |
| 254 | 259 | // | |
| 255 | - | // @callback is called at most once, either directly at the | |
| 256 | - | // time of the connect if @cancellable is already cancelled, | |
| 257 | - | // or when @cancellable is cancelled in some thread. | |
| 260 | + | // @callback is called exactly once each time @cancellable is cancelled, | |
| 261 | + | // either directly at the time of the connect if @cancellable is already | |
| 262 | + | // cancelled, or when @cancellable is cancelled in some thread. | |
| 263 | + | // In case the cancellable is reset via [method@Gio.Cancellable.reset] | |
| 264 | + | // then the callback can be called again if the @cancellable is cancelled and | |
| 265 | + | // if it had not been previously cancelled at the time | |
| 266 | + | // [method@Gio.Cancellable.connect] was called (e.g. if the connection actually | |
| 267 | + | // took place, returning a non-zero value). | |
| 258 | 268 | // | |
| 259 | 269 | // @data_destroy_func will be called when the handler is | |
| 260 | 270 | // disconnected, or immediately if the cancellable is already | |
| @@ -263,9 +273,21 @@ var xCancellableConnect func(uintptr, uintptr, uintptr, uintptr) uint32 | |||
| 263 | 273 | // See #GCancellable::cancelled for details on how to use this. | |
| 264 | 274 | // | |
| 265 | 275 | // Since GLib 2.40, the lock protecting @cancellable is not held when | |
| 266 | - | // @callback is invoked. This lifts a restriction in place for | |
| 276 | + | // @callback is invoked. This lifts a restriction in place for | |
| 267 | 277 | // earlier GLib versions which now makes it easier to write cleanup | |
| 268 | - | // code that unconditionally invokes e.g. g_cancellable_cancel(). | |
| 278 | + | // code that unconditionally invokes e.g. [method@Gio.Cancellable.cancel]. | |
| 279 | + | // Note that since 2.82 GLib still holds a lock during the callback but it’s | |
| 280 | + | // designed in a way that most of the [class@Gio.Cancellable] methods can be | |
| 281 | + | // called, including [method@Gio.Cancellable.cancel] or | |
| 282 | + | // [method@GObject.Object.unref]. | |
| 283 | + | // | |
| 284 | + | // There are still some methods that will deadlock (by design) when | |
| 285 | + | // called from the [signal@Gio.Cancellable::cancelled] callbacks: | |
| 286 | + | // - [method@Gio.Cancellable.connect] | |
| 287 | + | // - [method@Gio.Cancellable.disconnect] | |
| 288 | + | // - [method@Gio.Cancellable.reset] | |
| 289 | + | // - [method@Gio.Cancellable.make_pollfd] | |
| 290 | + | // - [method@Gio.Cancellable.release_fd] | |
| 269 | 291 | func (x *Cancellable) Connect(CallbackVar *gobject.Callback, DataVar uintptr, DataDestroyFuncVar *glib.DestroyNotify) uint32 { | |
| 270 | 292 | ||
| 271 | 293 | cret := xCancellableConnect(x.GoPointer(), glib.NewCallback(CallbackVar), DataVar, glib.NewCallbackNullable(DataDestroyFuncVar)) | |
| @@ -344,6 +366,11 @@ var xCancellableMakePollfd func(uintptr, *glib.PollFD) bool | |||
| 344 | 366 | // You are not supposed to read from the fd yourself, just check for | |
| 345 | 367 | // readable status. Reading to unset the readable status is done | |
| 346 | 368 | // with g_cancellable_reset(). | |
| 369 | + | // | |
| 370 | + | // Note that in the event that a [signal@Gio.Cancellable::cancelled] signal handler is | |
| 371 | + | // currently running, this call will block until the handler has finished. | |
| 372 | + | // Calling this function from a signal handler will therefore result in a | |
| 373 | + | // deadlock. | |
| 347 | 374 | func (x *Cancellable) MakePollfd(PollfdVar *glib.PollFD) bool { | |
| 348 | 375 | ||
| 349 | 376 | cret := xCancellableMakePollfd(x.GoPointer(), PollfdVar) | |
| @@ -387,6 +414,11 @@ var xCancellableReleaseFd func(uintptr) | |||
| 387 | 414 | // block scarce file descriptors until it is finalized if this function | |
| 388 | 415 | // is not called. This can cause the application to run out of file | |
| 389 | 416 | // descriptors when many #GCancellables are used at the same time. | |
| 417 | + | // | |
| 418 | + | // Note that in the event that a [signal@Gio.Cancellable::cancelled] signal handler is | |
| 419 | + | // currently running, this call will block until the handler has finished. | |
| 420 | + | // Calling this function from a signal handler will therefore result in a | |
| 421 | + | // deadlock. | |
| 390 | 422 | func (x *Cancellable) ReleaseFd() { | |
| 391 | 423 | ||
| 392 | 424 | xCancellableReleaseFd(x.GoPointer()) | |
| @@ -406,6 +438,11 @@ var xCancellableReset func(uintptr) | |||
| 406 | 438 | // is to drop the reference to a cancellable after cancelling it, | |
| 407 | 439 | // and let it die with the outstanding async operations. You should | |
| 408 | 440 | // create a fresh cancellable for further async operations. | |
| 441 | + | // | |
| 442 | + | // In the event that a [signal@Gio.Cancellable::cancelled] signal handler is currently | |
| 443 | + | // running, this call will block until the handler has finished. | |
| 444 | + | // Calling this function from a signal handler will therefore result in a | |
| 445 | + | // deadlock. | |
| 409 | 446 | func (x *Cancellable) Reset() { | |
| 410 | 447 | ||
| 411 | 448 | xCancellableReset(x.GoPointer()) | |
M v4/gio/gcharsetconverter.go +15 -3
| @@ -22,8 +22,8 @@ func (x *CharsetConverterClass) GoPointer() uintptr { | |||
| 22 | 22 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 23 | } | |
| 24 | 24 | ||
| 25 | - | // #GCharsetConverter is an implementation of #GConverter based on | |
| 26 | - | // GIConv. | |
| 25 | + | // `GCharsetConverter` is an implementation of [iface@Gio.Converter] based on | |
| 26 | + | // [struct@GLib.IConv]. | |
| 27 | 27 | type CharsetConverter struct { | |
| 28 | 28 | gobject.Object | |
| 29 | 29 | } | |
| @@ -192,6 +192,18 @@ func (x *CharsetConverter) Convert(InbufVar []byte, InbufSizeVar uint, OutbufVar | |||
| 192 | 192 | ||
| 193 | 193 | } | |
| 194 | 194 | ||
| 195 | + | // Applies @converter to the data in @bytes. | |
| 196 | + | func (x *CharsetConverter) ConvertBytes(BytesVar *glib.Bytes) (*glib.Bytes, error) { | |
| 197 | + | var cerr *glib.Error | |
| 198 | + | ||
| 199 | + | cret := XGConverterConvertBytes(x.GoPointer(), BytesVar, &cerr) | |
| 200 | + | if cerr == nil { | |
| 201 | + | return cret, nil | |
| 202 | + | } | |
| 203 | + | return cret, cerr | |
| 204 | + | ||
| 205 | + | } | |
| 206 | + | ||
| 195 | 207 | // Resets all internal state in the converter, making it behave | |
| 196 | 208 | // as if it was just created. If the converter has any internal | |
| 197 | 209 | // state that would produce output then that output is lost. | |
| @@ -219,7 +231,7 @@ func (x *CharsetConverter) Reset() { | |||
| 219 | 231 | // If the object is not initialized, or initialization returns with an | |
| 220 | 232 | // error, then all operations on the object except g_object_ref() and | |
| 221 | 233 | // g_object_unref() are considered to be invalid, and have undefined | |
| 222 | - | // behaviour. See the [introduction][ginitable] for more details. | |
| 234 | + | // behaviour. See the [description][iface@Gio.Initable#description] for more details. | |
| 223 | 235 | // | |
| 224 | 236 | // Callers should not assume that a class which implements #GInitable can be | |
| 225 | 237 | // initialized multiple times, unless the class explicitly documents itself as | |
M v4/gio/gconverter.go +22 -1
| @@ -29,6 +29,7 @@ func (x *ConverterIface) GoPointer() uintptr { | |||
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | // OverrideConvert sets the callback function. | |
| 32 | + | // Converts data. | |
| 32 | 33 | func (x *ConverterIface) OverrideConvert(cb func(Converter, []byte, uint, []byte, uint, ConverterFlags, uint, uint) ConverterResult) { | |
| 33 | 34 | if cb == nil { | |
| 34 | 35 | x.xConvert = 0 | |
| @@ -40,6 +41,7 @@ func (x *ConverterIface) OverrideConvert(cb func(Converter, []byte, uint, []byte | |||
| 40 | 41 | } | |
| 41 | 42 | ||
| 42 | 43 | // GetConvert gets the callback function. | |
| 44 | + | // Converts data. | |
| 43 | 45 | func (x *ConverterIface) GetConvert() func(Converter, []byte, uint, []byte, uint, ConverterFlags, uint, uint) ConverterResult { | |
| 44 | 46 | if x.xConvert == 0 { | |
| 45 | 47 | return nil | |
| @@ -52,6 +54,7 @@ func (x *ConverterIface) GetConvert() func(Converter, []byte, uint, []byte, uint | |||
| 52 | 54 | } | |
| 53 | 55 | ||
| 54 | 56 | // OverrideReset sets the callback function. | |
| 57 | + | // Reverts the internal state of the converter to its initial state. | |
| 55 | 58 | func (x *ConverterIface) OverrideReset(cb func(Converter)) { | |
| 56 | 59 | if cb == nil { | |
| 57 | 60 | x.xReset = 0 | |
| @@ -63,6 +66,7 @@ func (x *ConverterIface) OverrideReset(cb func(Converter)) { | |||
| 63 | 66 | } | |
| 64 | 67 | ||
| 65 | 68 | // GetReset gets the callback function. | |
| 69 | + | // Reverts the internal state of the converter to its initial state. | |
| 66 | 70 | func (x *ConverterIface) GetReset() func(Converter) { | |
| 67 | 71 | if x.xReset == 0 { | |
| 68 | 72 | return nil | |
| @@ -74,7 +78,9 @@ func (x *ConverterIface) GetReset() func(Converter) { | |||
| 74 | 78 | } | |
| 75 | 79 | } | |
| 76 | 80 | ||
| 77 | - | // #GConverter is implemented by objects that convert | |
| 81 | + | // `GConverter` is an interface for streaming conversions. | |
| 82 | + | // | |
| 83 | + | // `GConverter` is implemented by objects that convert | |
| 78 | 84 | // binary data in various ways. The conversion can be | |
| 79 | 85 | // stateful and may fail at any place. | |
| 80 | 86 | // | |
| @@ -85,6 +91,7 @@ type Converter interface { | |||
| 85 | 91 | GoPointer() uintptr | |
| 86 | 92 | SetGoPointer(uintptr) | |
| 87 | 93 | Convert(InbufVar []byte, InbufSizeVar uint, OutbufVar []byte, OutbufSizeVar uint, FlagsVar ConverterFlags, BytesReadVar uint, BytesWrittenVar uint) (ConverterResult, error) | |
| 94 | + | ConvertBytes(BytesVar *glib.Bytes) (*glib.Bytes, error) | |
| 88 | 95 | Reset() | |
| 89 | 96 | } | |
| 90 | 97 | ||
| @@ -202,6 +209,18 @@ func (x *ConverterBase) Convert(InbufVar []byte, InbufSizeVar uint, OutbufVar [] | |||
| 202 | 209 | ||
| 203 | 210 | } | |
| 204 | 211 | ||
| 212 | + | // Applies @converter to the data in @bytes. | |
| 213 | + | func (x *ConverterBase) ConvertBytes(BytesVar *glib.Bytes) (*glib.Bytes, error) { | |
| 214 | + | var cerr *glib.Error | |
| 215 | + | ||
| 216 | + | cret := XGConverterConvertBytes(x.GoPointer(), BytesVar, &cerr) | |
| 217 | + | if cerr == nil { | |
| 218 | + | return cret, nil | |
| 219 | + | } | |
| 220 | + | return cret, cerr | |
| 221 | + | ||
| 222 | + | } | |
| 223 | + | ||
| 205 | 224 | // Resets all internal state in the converter, making it behave | |
| 206 | 225 | // as if it was just created. If the converter has any internal | |
| 207 | 226 | // state that would produce output then that output is lost. | |
| @@ -212,6 +231,7 @@ func (x *ConverterBase) Reset() { | |||
| 212 | 231 | } | |
| 213 | 232 | ||
| 214 | 233 | var XGConverterConvert func(uintptr, []byte, uint, []byte, uint, ConverterFlags, uint, uint, **glib.Error) ConverterResult | |
| 234 | + | var XGConverterConvertBytes func(uintptr, *glib.Bytes, **glib.Error) *glib.Bytes | |
| 215 | 235 | var XGConverterReset func(uintptr) | |
| 216 | 236 | ||
| 217 | 237 | func init() { | |
| @@ -225,6 +245,7 @@ func init() { | |||
| 225 | 245 | core.PuregoSafeRegister(&xConverterGLibType, lib, "g_converter_get_type") | |
| 226 | 246 | ||
| 227 | 247 | core.PuregoSafeRegister(&XGConverterConvert, lib, "g_converter_convert") | |
| 248 | + | core.PuregoSafeRegister(&XGConverterConvertBytes, lib, "g_converter_convert_bytes") | |
| 228 | 249 | core.PuregoSafeRegister(&XGConverterReset, lib, "g_converter_reset") | |
| 229 | 250 | ||
| 230 | 251 | } | |
M v4/gio/gconverterinputstream.go +12 -3
| @@ -155,11 +155,11 @@ func (x *ConverterInputStreamPrivate) GoPointer() uintptr { | |||
| 155 | 155 | return uintptr(unsafe.Pointer(x)) | |
| 156 | 156 | } | |
| 157 | 157 | ||
| 158 | - | // Converter input stream implements #GInputStream and allows | |
| 158 | + | // Converter input stream implements [class@Gio.InputStream] and allows | |
| 159 | 159 | // conversion of data of various types during reading. | |
| 160 | 160 | // | |
| 161 | - | // As of GLib 2.34, #GConverterInputStream implements | |
| 162 | - | // #GPollableInputStream. | |
| 161 | + | // As of GLib 2.34, `GConverterInputStream` implements | |
| 162 | + | // [iface@Gio.PollableInputStream]. | |
| 163 | 163 | type ConverterInputStream struct { | |
| 164 | 164 | FilterInputStream | |
| 165 | 165 | } | |
| @@ -241,6 +241,9 @@ func (x *ConverterInputStream) CanPoll() bool { | |||
| 241 | 241 | // the stream may not actually be readable even after the source | |
| 242 | 242 | // triggers, so you should use g_pollable_input_stream_read_nonblocking() | |
| 243 | 243 | // rather than g_input_stream_read() from the callback. | |
| 244 | + | // | |
| 245 | + | // The behaviour of this method is undefined if | |
| 246 | + | // g_pollable_input_stream_can_poll() returns %FALSE for @stream. | |
| 244 | 247 | func (x *ConverterInputStream) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 245 | 248 | ||
| 246 | 249 | cret := XGPollableInputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| @@ -255,6 +258,9 @@ func (x *ConverterInputStream) CreateSource(CancellableVar *Cancellable) *glib.S | |||
| 255 | 258 | // non-blocking behavior, you should always use | |
| 256 | 259 | // g_pollable_input_stream_read_nonblocking(), which will return a | |
| 257 | 260 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 261 | + | // | |
| 262 | + | // The behaviour of this method is undefined if | |
| 263 | + | // g_pollable_input_stream_can_poll() returns %FALSE for @stream. | |
| 258 | 264 | func (x *ConverterInputStream) IsReadable() bool { | |
| 259 | 265 | ||
| 260 | 266 | cret := XGPollableInputStreamIsReadable(x.GoPointer()) | |
| @@ -272,6 +278,9 @@ func (x *ConverterInputStream) IsReadable() bool { | |||
| 272 | 278 | // if @cancellable has already been cancelled when you call, which | |
| 273 | 279 | // may happen if you call this method after a source triggers due | |
| 274 | 280 | // to having been cancelled. | |
| 281 | + | // | |
| 282 | + | // The behaviour of this method is undefined if | |
| 283 | + | // g_pollable_input_stream_can_poll() returns %FALSE for @stream. | |
| 275 | 284 | func (x *ConverterInputStream) ReadNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 276 | 285 | var cerr *glib.Error | |
| 277 | 286 | ||
M v4/gio/gconverteroutputstream.go +15 -3
| @@ -155,11 +155,11 @@ func (x *ConverterOutputStreamPrivate) GoPointer() uintptr { | |||
| 155 | 155 | return uintptr(unsafe.Pointer(x)) | |
| 156 | 156 | } | |
| 157 | 157 | ||
| 158 | - | // Converter output stream implements #GOutputStream and allows | |
| 158 | + | // Converter output stream implements [class@Gio.OutputStream] and allows | |
| 159 | 159 | // conversion of data of various types during reading. | |
| 160 | 160 | // | |
| 161 | - | // As of GLib 2.34, #GConverterOutputStream implements | |
| 162 | - | // #GPollableOutputStream. | |
| 161 | + | // As of GLib 2.34, `GConverterOutputStream` implements | |
| 162 | + | // [iface@Gio.PollableOutputStream]. | |
| 163 | 163 | type ConverterOutputStream struct { | |
| 164 | 164 | FilterOutputStream | |
| 165 | 165 | } | |
| @@ -241,6 +241,9 @@ func (x *ConverterOutputStream) CanPoll() bool { | |||
| 241 | 241 | // the stream may not actually be writable even after the source | |
| 242 | 242 | // triggers, so you should use g_pollable_output_stream_write_nonblocking() | |
| 243 | 243 | // rather than g_output_stream_write() from the callback. | |
| 244 | + | // | |
| 245 | + | // The behaviour of this method is undefined if | |
| 246 | + | // g_pollable_output_stream_can_poll() returns %FALSE for @stream. | |
| 244 | 247 | func (x *ConverterOutputStream) CreateSource(CancellableVar *Cancellable) *glib.Source { | |
| 245 | 248 | ||
| 246 | 249 | cret := XGPollableOutputStreamCreateSource(x.GoPointer(), CancellableVar.GoPointer()) | |
| @@ -255,6 +258,9 @@ func (x *ConverterOutputStream) CreateSource(CancellableVar *Cancellable) *glib. | |||
| 255 | 258 | // non-blocking behavior, you should always use | |
| 256 | 259 | // g_pollable_output_stream_write_nonblocking(), which will return a | |
| 257 | 260 | // %G_IO_ERROR_WOULD_BLOCK error rather than blocking. | |
| 261 | + | // | |
| 262 | + | // The behaviour of this method is undefined if | |
| 263 | + | // g_pollable_output_stream_can_poll() returns %FALSE for @stream. | |
| 258 | 264 | func (x *ConverterOutputStream) IsWritable() bool { | |
| 259 | 265 | ||
| 260 | 266 | cret := XGPollableOutputStreamIsWritable(x.GoPointer()) | |
| @@ -276,6 +282,9 @@ func (x *ConverterOutputStream) IsWritable() bool { | |||
| 276 | 282 | // Also note that if %G_IO_ERROR_WOULD_BLOCK is returned some underlying | |
| 277 | 283 | // transports like D/TLS require that you re-send the same @buffer and | |
| 278 | 284 | // @count in the next write call. | |
| 285 | + | // | |
| 286 | + | // The behaviour of this method is undefined if | |
| 287 | + | // g_pollable_output_stream_can_poll() returns %FALSE for @stream. | |
| 279 | 288 | func (x *ConverterOutputStream) WriteNonblocking(BufferVar []byte, CountVar uint, CancellableVar *Cancellable) (int, error) { | |
| 280 | 289 | var cerr *glib.Error | |
| 281 | 290 | ||
| @@ -303,6 +312,9 @@ func (x *ConverterOutputStream) WriteNonblocking(BufferVar []byte, CountVar uint | |||
| 303 | 312 | // Also note that if %G_POLLABLE_RETURN_WOULD_BLOCK is returned some underlying | |
| 304 | 313 | // transports like D/TLS require that you re-send the same @vectors and | |
| 305 | 314 | // @n_vectors in the next write call. | |
| 315 | + | // | |
| 316 | + | // The behaviour of this method is undefined if | |
| 317 | + | // g_pollable_output_stream_can_poll() returns %FALSE for @stream. | |
| 306 | 318 | func (x *ConverterOutputStream) WritevNonblocking(VectorsVar []OutputVector, NVectorsVar uint, BytesWrittenVar uint, CancellableVar *Cancellable) (PollableReturn, error) { | |
| 307 | 319 | var cerr *glib.Error | |
| 308 | 320 | ||
M v4/gio/gcredentials.go +26 -28
| @@ -21,43 +21,41 @@ func (x *CredentialsClass) GoPointer() uintptr { | |||
| 21 | 21 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | - | // The #GCredentials type is a reference-counted wrapper for native | |
| 25 | - | // credentials. This information is typically used for identifying, | |
| 24 | + | // The `GCredentials` type is a reference-counted wrapper for native | |
| 25 | + | // credentials. | |
| 26 | + | // | |
| 27 | + | // The information in `GCredentials` is typically used for identifying, | |
| 26 | 28 | // authenticating and authorizing other processes. | |
| 27 | 29 | // | |
| 28 | - | // Some operating systems supports looking up the credentials of the | |
| 29 | - | // remote peer of a communication endpoint - see e.g. | |
| 30 | - | // g_socket_get_credentials(). | |
| 30 | + | // Some operating systems supports looking up the credentials of the remote | |
| 31 | + | // peer of a communication endpoint - see e.g. [method@Gio.Socket.get_credentials]. | |
| 31 | 32 | // | |
| 32 | 33 | // Some operating systems supports securely sending and receiving | |
| 33 | - | // credentials over a Unix Domain Socket, see | |
| 34 | - | // #GUnixCredentialsMessage, g_unix_connection_send_credentials() and | |
| 35 | - | // g_unix_connection_receive_credentials() for details. | |
| 34 | + | // credentials over a Unix Domain Socket, see [class@Gio.UnixCredentialsMessage], | |
| 35 | + | // [method@Gio.UnixConnection.send_credentials] and | |
| 36 | + | // [method@Gio.UnixConnection.receive_credentials] for details. | |
| 36 | 37 | // | |
| 37 | 38 | // On Linux, the native credential type is a `struct ucred` - see the | |
| 38 | - | // unix(7) man page for details. This corresponds to | |
| 39 | - | // %G_CREDENTIALS_TYPE_LINUX_UCRED. | |
| 39 | + | // [`unix(7)` man page](man:unix(7)) for details. This corresponds to | |
| 40 | + | // `G_CREDENTIALS_TYPE_LINUX_UCRED`. | |
| 40 | 41 | // | |
| 41 | - | // On Apple operating systems (including iOS, tvOS, and macOS), | |
| 42 | - | // the native credential type is a `struct xucred`. | |
| 43 | - | // This corresponds to %G_CREDENTIALS_TYPE_APPLE_XUCRED. | |
| 42 | + | // On Apple operating systems (including iOS, tvOS, and macOS), the native credential | |
| 43 | + | // type is a `struct xucred`. This corresponds to `G_CREDENTIALS_TYPE_APPLE_XUCRED`. | |
| 44 | 44 | // | |
| 45 | - | // On FreeBSD, Debian GNU/kFreeBSD, and GNU/Hurd, the native | |
| 46 | - | // credential type is a `struct cmsgcred`. This corresponds | |
| 47 | - | // to %G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED. | |
| 45 | + | // On FreeBSD, Debian GNU/kFreeBSD, and GNU/Hurd, the native credential type is a | |
| 46 | + | // `struct cmsgcred`. This corresponds to `G_CREDENTIALS_TYPE_FREEBSD_CMSGCRED`. | |
| 48 | 47 | // | |
| 49 | 48 | // On NetBSD, the native credential type is a `struct unpcbid`. | |
| 50 | - | // This corresponds to %G_CREDENTIALS_TYPE_NETBSD_UNPCBID. | |
| 49 | + | // This corresponds to `G_CREDENTIALS_TYPE_NETBSD_UNPCBID`. | |
| 51 | 50 | // | |
| 52 | 51 | // On OpenBSD, the native credential type is a `struct sockpeercred`. | |
| 53 | - | // This corresponds to %G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED. | |
| 52 | + | // This corresponds to `G_CREDENTIALS_TYPE_OPENBSD_SOCKPEERCRED`. | |
| 54 | 53 | // | |
| 55 | - | // On Solaris (including OpenSolaris and its derivatives), the native | |
| 56 | - | // credential type is a `ucred_t`. This corresponds to | |
| 57 | - | // %G_CREDENTIALS_TYPE_SOLARIS_UCRED. | |
| 54 | + | // On Solaris (including OpenSolaris and its derivatives), the native credential type | |
| 55 | + | // is a `ucred_t`. This corresponds to `G_CREDENTIALS_TYPE_SOLARIS_UCRED`. | |
| 58 | 56 | // | |
| 59 | 57 | // Since GLib 2.72, on Windows, the native credentials may contain the PID of a | |
| 60 | - | // process. This corresponds to %G_CREDENTIALS_TYPE_WIN32_PID. | |
| 58 | + | // process. This corresponds to `G_CREDENTIALS_TYPE_WIN32_PID`. | |
| 61 | 59 | type Credentials struct { | |
| 62 | 60 | gobject.Object | |
| 63 | 61 | } | |
| @@ -105,7 +103,7 @@ func (x *Credentials) GetNative(NativeTypeVar CredentialsType) uintptr { | |||
| 105 | 103 | return cret | |
| 106 | 104 | } | |
| 107 | 105 | ||
| 108 | - | var xCredentialsGetUnixPid func(uintptr) int | |
| 106 | + | var xCredentialsGetUnixPid func(uintptr) pid_t | |
| 109 | 107 | ||
| 110 | 108 | // Tries to get the UNIX process identifier from @credentials. This | |
| 111 | 109 | // method is only available on UNIX platforms. | |
| @@ -113,7 +111,7 @@ var xCredentialsGetUnixPid func(uintptr) int | |||
| 113 | 111 | // This operation can fail if #GCredentials is not supported on the | |
| 114 | 112 | // OS or if the native credentials type does not contain information | |
| 115 | 113 | // about the UNIX process ID. | |
| 116 | - | func (x *Credentials) GetUnixPid() (int, error) { | |
| 114 | + | func (x *Credentials) GetUnixPid() (pid_t, error) { | |
| 117 | 115 | var cerr *glib.Error | |
| 118 | 116 | ||
| 119 | 117 | cret := xCredentialsGetUnixPid(x.GoPointer()) | |
| @@ -124,7 +122,7 @@ func (x *Credentials) GetUnixPid() (int, error) { | |||
| 124 | 122 | ||
| 125 | 123 | } | |
| 126 | 124 | ||
| 127 | - | var xCredentialsGetUnixUser func(uintptr) uint | |
| 125 | + | var xCredentialsGetUnixUser func(uintptr) uid_t | |
| 128 | 126 | ||
| 129 | 127 | // Tries to get the UNIX user identifier from @credentials. This | |
| 130 | 128 | // method is only available on UNIX platforms. | |
| @@ -132,7 +130,7 @@ var xCredentialsGetUnixUser func(uintptr) uint | |||
| 132 | 130 | // This operation can fail if #GCredentials is not supported on the | |
| 133 | 131 | // OS or if the native credentials type does not contain information | |
| 134 | 132 | // about the UNIX user. | |
| 135 | - | func (x *Credentials) GetUnixUser() (uint, error) { | |
| 133 | + | func (x *Credentials) GetUnixUser() (uid_t, error) { | |
| 136 | 134 | var cerr *glib.Error | |
| 137 | 135 | ||
| 138 | 136 | cret := xCredentialsGetUnixUser(x.GoPointer()) | |
| @@ -174,7 +172,7 @@ func (x *Credentials) SetNative(NativeTypeVar CredentialsType, NativeVar uintptr | |||
| 174 | 172 | ||
| 175 | 173 | } | |
| 176 | 174 | ||
| 177 | - | var xCredentialsSetUnixUser func(uintptr, uint, **glib.Error) bool | |
| 175 | + | var xCredentialsSetUnixUser func(uintptr, uid_t, **glib.Error) bool | |
| 178 | 176 | ||
| 179 | 177 | // Tries to set the UNIX user identifier on @credentials. This method | |
| 180 | 178 | // is only available on UNIX platforms. | |
| @@ -183,7 +181,7 @@ var xCredentialsSetUnixUser func(uintptr, uint, **glib.Error) bool | |||
| 183 | 181 | // OS or if the native credentials type does not contain information | |
| 184 | 182 | // about the UNIX user. It can also fail if the OS does not allow the | |
| 185 | 183 | // use of "spoofed" credentials. | |
| 186 | - | func (x *Credentials) SetUnixUser(UidVar uint) (bool, error) { | |
| 184 | + | func (x *Credentials) SetUnixUser(UidVar uid_t) (bool, error) { | |
| 187 | 185 | var cerr *glib.Error | |
| 188 | 186 | ||
| 189 | 187 | cret := xCredentialsSetUnixUser(x.GoPointer(), UidVar, &cerr) | |
M v4/gio/gdatagrambased.go +36 -20
| @@ -37,6 +37,7 @@ func (x *DatagramBasedInterface) GoPointer() uintptr { | |||
| 37 | 37 | } | |
| 38 | 38 | ||
| 39 | 39 | // OverrideReceiveMessages sets the callback function. | |
| 40 | + | // Virtual method for g_datagram_based_receive_messages(). | |
| 40 | 41 | func (x *DatagramBasedInterface) OverrideReceiveMessages(cb func(DatagramBased, []InputMessage, uint, int, int64, *Cancellable) int) { | |
| 41 | 42 | if cb == nil { | |
| 42 | 43 | x.xReceiveMessages = 0 | |
| @@ -48,6 +49,7 @@ func (x *DatagramBasedInterface) OverrideReceiveMessages(cb func(DatagramBased, | |||
| 48 | 49 | } | |
| 49 | 50 | ||
| 50 | 51 | // GetReceiveMessages gets the callback function. | |
| 52 | + | // Virtual method for g_datagram_based_receive_messages(). | |
| 51 | 53 | func (x *DatagramBasedInterface) GetReceiveMessages() func(DatagramBased, []InputMessage, uint, int, int64, *Cancellable) int { | |
| 52 | 54 | if x.xReceiveMessages == 0 { | |
| 53 | 55 | return nil | |
| @@ -60,6 +62,7 @@ func (x *DatagramBasedInterface) GetReceiveMessages() func(DatagramBased, []Inpu | |||
| 60 | 62 | } | |
| 61 | 63 | ||
| 62 | 64 | // OverrideSendMessages sets the callback function. | |
| 65 | + | // Virtual method for g_datagram_based_send_messages(). | |
| 63 | 66 | func (x *DatagramBasedInterface) OverrideSendMessages(cb func(DatagramBased, []OutputMessage, uint, int, int64, *Cancellable) int) { | |
| 64 | 67 | if cb == nil { | |
| 65 | 68 | x.xSendMessages = 0 | |
| @@ -71,6 +74,7 @@ func (x *DatagramBasedInterface) OverrideSendMessages(cb func(DatagramBased, []O | |||
| 71 | 74 | } | |
| 72 | 75 | ||
| 73 | 76 | // GetSendMessages gets the callback function. | |
| 77 | + | // Virtual method for g_datagram_based_send_messages(). | |
| 74 | 78 | func (x *DatagramBasedInterface) GetSendMessages() func(DatagramBased, []OutputMessage, uint, int, int64, *Cancellable) int { | |
| 75 | 79 | if x.xSendMessages == 0 { | |
| 76 | 80 | return nil | |
| @@ -83,6 +87,7 @@ func (x *DatagramBasedInterface) GetSendMessages() func(DatagramBased, []OutputM | |||
| 83 | 87 | } | |
| 84 | 88 | ||
| 85 | 89 | // OverrideCreateSource sets the callback function. | |
| 90 | + | // Virtual method for g_datagram_based_create_source(). | |
| 86 | 91 | func (x *DatagramBasedInterface) OverrideCreateSource(cb func(DatagramBased, glib.IOCondition, *Cancellable) *glib.Source) { | |
| 87 | 92 | if cb == nil { | |
| 88 | 93 | x.xCreateSource = 0 | |
| @@ -94,6 +99,7 @@ func (x *DatagramBasedInterface) OverrideCreateSource(cb func(DatagramBased, gli | |||
| 94 | 99 | } | |
| 95 | 100 | ||
| 96 | 101 | // GetCreateSource gets the callback function. | |
| 102 | + | // Virtual method for g_datagram_based_create_source(). | |
| 97 | 103 | func (x *DatagramBasedInterface) GetCreateSource() func(DatagramBased, glib.IOCondition, *Cancellable) *glib.Source { | |
| 98 | 104 | if x.xCreateSource == 0 { | |
| 99 | 105 | return nil | |
| @@ -106,6 +112,7 @@ func (x *DatagramBasedInterface) GetCreateSource() func(DatagramBased, glib.IOCo | |||
| 106 | 112 | } | |
| 107 | 113 | ||
| 108 | 114 | // OverrideConditionCheck sets the callback function. | |
| 115 | + | // Virtual method for g_datagram_based_condition_check(). | |
| 109 | 116 | func (x *DatagramBasedInterface) OverrideConditionCheck(cb func(DatagramBased, glib.IOCondition) glib.IOCondition) { | |
| 110 | 117 | if cb == nil { | |
| 111 | 118 | x.xConditionCheck = 0 | |
| @@ -117,6 +124,7 @@ func (x *DatagramBasedInterface) OverrideConditionCheck(cb func(DatagramBased, g | |||
| 117 | 124 | } | |
| 118 | 125 | ||
| 119 | 126 | // GetConditionCheck gets the callback function. | |
| 127 | + | // Virtual method for g_datagram_based_condition_check(). | |
| 120 | 128 | func (x *DatagramBasedInterface) GetConditionCheck() func(DatagramBased, glib.IOCondition) glib.IOCondition { | |
| 121 | 129 | if x.xConditionCheck == 0 { | |
| 122 | 130 | return nil | |
| @@ -129,6 +137,9 @@ func (x *DatagramBasedInterface) GetConditionCheck() func(DatagramBased, glib.IO | |||
| 129 | 137 | } | |
| 130 | 138 | ||
| 131 | 139 | // OverrideConditionWait sets the callback function. | |
| 140 | + | // Virtual method for | |
| 141 | + | // | |
| 142 | + | // g_datagram_based_condition_wait(). | |
| 132 | 143 | func (x *DatagramBasedInterface) OverrideConditionWait(cb func(DatagramBased, glib.IOCondition, int64, *Cancellable) bool) { | |
| 133 | 144 | if cb == nil { | |
| 134 | 145 | x.xConditionWait = 0 | |
| @@ -140,6 +151,9 @@ func (x *DatagramBasedInterface) OverrideConditionWait(cb func(DatagramBased, gl | |||
| 140 | 151 | } | |
| 141 | 152 | ||
| 142 | 153 | // GetConditionWait gets the callback function. | |
| 154 | + | // Virtual method for | |
| 155 | + | // | |
| 156 | + | // g_datagram_based_condition_wait(). | |
| 143 | 157 | func (x *DatagramBasedInterface) GetConditionWait() func(DatagramBased, glib.IOCondition, int64, *Cancellable) bool { | |
| 144 | 158 | if x.xConditionWait == 0 { | |
| 145 | 159 | return nil | |
| @@ -151,52 +165,54 @@ func (x *DatagramBasedInterface) GetConditionWait() func(DatagramBased, glib.IOC | |||
| 151 | 165 | } | |
| 152 | 166 | } | |
| 153 | 167 | ||
| 154 | - | // A #GDatagramBased is a networking interface for representing datagram-based | |
| 168 | + | // Interface for socket-like objects with datagram semantics. | |
| 169 | + | // | |
| 170 | + | // A `GDatagramBased` is a networking interface for representing datagram-based | |
| 155 | 171 | // communications. It is a more or less direct mapping of the core parts of the | |
| 156 | 172 | // BSD socket API in a portable GObject interface. It is implemented by | |
| 157 | - | // #GSocket, which wraps the UNIX socket API on UNIX and winsock2 on Windows. | |
| 173 | + | // [class@Gio.Socket], which wraps the UNIX socket API on UNIX and winsock2 on Windows. | |
| 158 | 174 | // | |
| 159 | - | // #GDatagramBased is entirely platform independent, and is intended to be used | |
| 160 | - | // alongside higher-level networking APIs such as #GIOStream. | |
| 175 | + | // `GDatagramBased` is entirely platform independent, and is intended to be used | |
| 176 | + | // alongside higher-level networking APIs such as [class@Gio.IOStream]. | |
| 161 | 177 | // | |
| 162 | 178 | // It uses vectored scatter/gather I/O by default, allowing for many messages | |
| 163 | 179 | // to be sent or received in a single call. Where possible, implementations of | |
| 164 | 180 | // the interface should take advantage of vectored I/O to minimise processing | |
| 165 | - | // or system calls. For example, #GSocket uses recvmmsg() and sendmmsg() where | |
| 166 | - | // possible. Callers should take advantage of scatter/gather I/O (the use of | |
| 181 | + | // or system calls. For example, `GSocket` uses `recvmmsg()` and `sendmmsg()` | |
| 182 | + | // where possible. Callers should take advantage of scatter/gather I/O (the use of | |
| 167 | 183 | // multiple buffers per message) to avoid unnecessary copying of data to | |
| 168 | 184 | // assemble or disassemble a message. | |
| 169 | 185 | // | |
| 170 | - | // Each #GDatagramBased operation has a timeout parameter which may be negative | |
| 186 | + | // Each `GDatagramBased` operation has a timeout parameter which may be negative | |
| 171 | 187 | // for blocking behaviour, zero for non-blocking behaviour, or positive for | |
| 172 | 188 | // timeout behaviour. A blocking operation blocks until finished or there is an | |
| 173 | 189 | // error. A non-blocking operation will return immediately with a | |
| 174 | - | // %G_IO_ERROR_WOULD_BLOCK error if it cannot make progress. A timeout operation | |
| 190 | + | // `G_IO_ERROR_WOULD_BLOCK` error if it cannot make progress. A timeout operation | |
| 175 | 191 | // will block until the operation is complete or the timeout expires; if the | |
| 176 | 192 | // timeout expires it will return what progress it made, or | |
| 177 | - | // %G_IO_ERROR_TIMED_OUT if no progress was made. To know when a call would | |
| 178 | - | // successfully run you can call g_datagram_based_condition_check() or | |
| 179 | - | // g_datagram_based_condition_wait(). You can also use | |
| 180 | - | // g_datagram_based_create_source() and attach it to a #GMainContext to get | |
| 181 | - | // callbacks when I/O is possible. | |
| 193 | + | // `G_IO_ERROR_TIMED_OUT` if no progress was made. To know when a call would | |
| 194 | + | // successfully run you can call [method@Gio.DatagramBased.condition_check] or | |
| 195 | + | // [method@Gio.DatagramBased.condition_wait]. You can also use | |
| 196 | + | // [method@Gio.DatagramBased.create_source] and attach it to a [struct@GLib.MainContext] | |
| 197 | + | // to get callbacks when I/O is possible. | |
| 182 | 198 | // | |
| 183 | 199 | // When running a non-blocking operation applications should always be able to | |
| 184 | - | // handle getting a %G_IO_ERROR_WOULD_BLOCK error even when some other function | |
| 200 | + | // handle getting a `G_IO_ERROR_WOULD_BLOCK` error even when some other function | |
| 185 | 201 | // said that I/O was possible. This can easily happen in case of a race | |
| 186 | 202 | // condition in the application, but it can also happen for other reasons. For | |
| 187 | 203 | // instance, on Windows a socket is always seen as writable until a write | |
| 188 | - | // returns %G_IO_ERROR_WOULD_BLOCK. | |
| 204 | + | // returns `G_IO_ERROR_WOULD_BLOCK`. | |
| 189 | 205 | // | |
| 190 | - | // As with #GSocket, #GDatagramBaseds can be either connection oriented (for | |
| 191 | - | // example, SCTP) or connectionless (for example, UDP). #GDatagramBaseds must be | |
| 206 | + | // As with `GSocket`, `GDatagramBased`s can be either connection oriented (for | |
| 207 | + | // example, SCTP) or connectionless (for example, UDP). `GDatagramBased`s must be | |
| 192 | 208 | // datagram-based, not stream-based. The interface does not cover connection | |
| 193 | 209 | // establishment — use methods on the underlying type to establish a connection | |
| 194 | - | // before sending and receiving data through the #GDatagramBased API. For | |
| 210 | + | // before sending and receiving data through the `GDatagramBased` API. For | |
| 195 | 211 | // connectionless socket types the target/source address is specified or | |
| 196 | 212 | // received in each I/O operation. | |
| 197 | 213 | // | |
| 198 | - | // Like most other APIs in GLib, #GDatagramBased is not inherently thread safe. | |
| 199 | - | // To use a #GDatagramBased concurrently from multiple threads, you must | |
| 214 | + | // Like most other APIs in GLib, `GDatagramBased` is not inherently thread safe. | |
| 215 | + | // To use a `GDatagramBased` concurrently from multiple threads, you must | |
| 200 | 216 | // implement your own locking. | |
| 201 | 217 | type DatagramBased interface { | |
| 202 | 218 | GoPointer() uintptr | |
M v4/gio/gdatainputstream.go +2 -2
| @@ -154,8 +154,8 @@ func (x *DataInputStreamPrivate) GoPointer() uintptr { | |||
| 154 | 154 | return uintptr(unsafe.Pointer(x)) | |
| 155 | 155 | } | |
| 156 | 156 | ||
| 157 | - | // Data input stream implements #GInputStream and includes functions for | |
| 158 | - | // reading structured data directly from a binary input stream. | |
| 157 | + | // Data input stream implements [class@Gio.InputStream] and includes functions | |
| 158 | + | // for reading structured data directly from a binary input stream. | |
| 159 | 159 | type DataInputStream struct { | |
| 160 | 160 | BufferedInputStream | |
| 161 | 161 | } | |
M v4/gio/gdataoutputstream.go +2 -2
| @@ -154,8 +154,8 @@ func (x *DataOutputStreamPrivate) GoPointer() uintptr { | |||
| 154 | 154 | return uintptr(unsafe.Pointer(x)) | |
| 155 | 155 | } | |
| 156 | 156 | ||
| 157 | - | // Data output stream implements #GOutputStream and includes functions for | |
| 158 | - | // writing data directly to an output stream. | |
| 157 | + | // Data output stream implements [class@Gio.OutputStream] and includes functions | |
| 158 | + | // for writing data directly to an output stream. | |
| 159 | 159 | type DataOutputStream struct { | |
| 160 | 160 | FilterOutputStream | |
| 161 | 161 | } | |
A v4/gio/gdbusactiongroup.go +345 -0
| @@ -0,0 +1,345 @@ | |||
| 1 | + | // Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gio | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | // `GDBusActionGroup` is an implementation of the [iface@Gio.ActionGroup] | |
| 13 | + | // interface. | |
| 14 | + | // | |
| 15 | + | // `GDBusActionGroup` can be used as a proxy for an action group | |
| 16 | + | // that is exported over D-Bus with [method@Gio.DBusConnection.export_action_group]. | |
| 17 | + | type DBusActionGroup struct { | |
| 18 | + | gobject.Object | |
| 19 | + | } | |
| 20 | + | ||
| 21 | + | var xDBusActionGroupGLibType func() types.GType | |
| 22 | + | ||
| 23 | + | func DBusActionGroupGLibType() types.GType { | |
| 24 | + | return xDBusActionGroupGLibType() | |
| 25 | + | } | |
| 26 | + | ||
| 27 | + | func DBusActionGroupNewFromInternalPtr(ptr uintptr) *DBusActionGroup { | |
| 28 | + | cls := &DBusActionGroup{} | |
| 29 | + | cls.Ptr = ptr | |
| 30 | + | return cls | |
| 31 | + | } | |
| 32 | + | ||
| 33 | + | func (c *DBusActionGroup) GoPointer() uintptr { | |
| 34 | + | if c == nil { | |
| 35 | + | return 0 | |
| 36 | + | } | |
| 37 | + | return c.Ptr | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | func (c *DBusActionGroup) SetGoPointer(ptr uintptr) { | |
| 41 | + | c.Ptr = ptr | |
| 42 | + | } | |
| 43 | + | ||
| 44 | + | // Emits the [signal@Gio.ActionGroup::action-added] signal on @action_group. | |
| 45 | + | // | |
| 46 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 47 | + | func (x *DBusActionGroup) ActionAdded(ActionNameVar string) { | |
| 48 | + | ||
| 49 | + | XGActionGroupActionAdded(x.GoPointer(), ActionNameVar) | |
| 50 | + | ||
| 51 | + | } | |
| 52 | + | ||
| 53 | + | // Emits the [signal@Gio.ActionGroup::action-enabled-changed] signal on @action_group. | |
| 54 | + | // | |
| 55 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 56 | + | func (x *DBusActionGroup) ActionEnabledChanged(ActionNameVar string, EnabledVar bool) { | |
| 57 | + | ||
| 58 | + | XGActionGroupActionEnabledChanged(x.GoPointer(), ActionNameVar, EnabledVar) | |
| 59 | + | ||
| 60 | + | } | |
| 61 | + | ||
| 62 | + | // Emits the [signal@Gio.ActionGroup::action-removed] signal on @action_group. | |
| 63 | + | // | |
| 64 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 65 | + | func (x *DBusActionGroup) ActionRemoved(ActionNameVar string) { | |
| 66 | + | ||
| 67 | + | XGActionGroupActionRemoved(x.GoPointer(), ActionNameVar) | |
| 68 | + | ||
| 69 | + | } | |
| 70 | + | ||
| 71 | + | // Emits the [signal@Gio.ActionGroup::action-state-changed] signal on @action_group. | |
| 72 | + | // | |
| 73 | + | // This function should only be called by [type@Gio.ActionGroup] implementations. | |
| 74 | + | func (x *DBusActionGroup) ActionStateChanged(ActionNameVar string, StateVar *glib.Variant) { | |
| 75 | + | ||
| 76 | + | XGActionGroupActionStateChanged(x.GoPointer(), ActionNameVar, StateVar) | |
| 77 | + | ||
| 78 | + | } | |
| 79 | + | ||
| 80 | + | // Activate the named action within @action_group. | |
| 81 | + | // | |
| 82 | + | // If the action is expecting a parameter, then the correct type of | |
| 83 | + | // parameter must be given as @parameter. If the action is expecting no | |
| 84 | + | // parameters then @parameter must be `NULL`. See | |
| 85 | + | // [method@Gio.ActionGroup.get_action_parameter_type]. | |
| 86 | + | // | |
| 87 | + | // If the [type@Gio.ActionGroup] implementation supports asynchronous remote | |
| 88 | + | // activation over D-Bus, this call may return before the relevant | |
| 89 | + | // D-Bus traffic has been sent, or any replies have been received. In | |
| 90 | + | // order to block on such asynchronous activation calls, | |
| 91 | + | // [method@Gio.DBusConnection.flush] should be called prior to the code, which | |
| 92 | + | // depends on the result of the action activation. Without flushing | |
| 93 | + | // the D-Bus connection, there is no guarantee that the action would | |
| 94 | + | // have been activated. | |
| 95 | + | // | |
| 96 | + | // The following code which runs in a remote app instance, shows an | |
| 97 | + | // example of a ‘quit’ action being activated on the primary app | |
| 98 | + | // instance over D-Bus. Here [method@Gio.DBusConnection.flush] is called | |
| 99 | + | // before `exit()`. Without `g_dbus_connection_flush()`, the ‘quit’ action | |
| 100 | + | // may fail to be activated on the primary instance. | |
| 101 | + | // | |
| 102 | + | // ```c | |
| 103 | + | // // call ‘quit’ action on primary instance | |
| 104 | + | // g_action_group_activate_action (G_ACTION_GROUP (app), "quit", NULL); | |
| 105 | + | // | |
| 106 | + | // // make sure the action is activated now | |
| 107 | + | // g_dbus_connection_flush (…); | |
| 108 | + | // | |
| 109 | + | // g_debug ("Application has been terminated. Exiting."); | |
| 110 | + | // | |
| 111 | + | // exit (0); | |
| 112 | + | // ``` | |
| 113 | + | func (x *DBusActionGroup) ActivateAction(ActionNameVar string, ParameterVar *glib.Variant) { | |
| 114 | + | ||
| 115 | + | XGActionGroupActivateAction(x.GoPointer(), ActionNameVar, ParameterVar) | |
| 116 | + | ||
| 117 | + | } | |
| 118 | + | ||
| 119 | + | // Request for the state of the named action within @action_group to be | |
| 120 | + | // changed to @value. | |
| 121 | + | // | |
| 122 | + | // The action must be stateful and @value must be of the correct type. | |
| 123 | + | // See [method@Gio.ActionGroup.get_action_state_type]. | |
| 124 | + | // | |
| 125 | + | // This call merely requests a change. The action may refuse to change | |
| 126 | + | // its state or may change its state to something other than @value. | |
| 127 | + | // See [method@Gio.ActionGroup.get_action_state_hint]. | |
| 128 | + | // | |
| 129 | + | // If the @value GVariant is floating, it is consumed. | |
| 130 | + | func (x *DBusActionGroup) ChangeActionState(ActionNameVar string, ValueVar *glib.Variant) { | |
| 131 | + | ||
| 132 | + | XGActionGroupChangeActionState(x.GoPointer(), ActionNameVar, ValueVar) | |
| 133 | + | ||
| 134 | + | } | |
| 135 | + | ||
| 136 | + | // Checks if the named action within @action_group is currently enabled. | |
| 137 | + | // | |
| 138 | + | // An action must be enabled in order to be activated or in order to | |
| 139 | + | // have its state changed from outside callers. | |
| 140 | + | func (x *DBusActionGroup) GetActionEnabled(ActionNameVar string) bool { | |
| 141 | + | ||
| 142 | + | cret := XGActionGroupGetActionEnabled(x.GoPointer(), ActionNameVar) | |
| 143 | + | return cret | |
| 144 | + | } | |
| 145 | + | ||
| 146 | + | // Queries the type of the parameter that must be given when activating | |
| 147 | + | // the named action within @action_group. | |
| 148 | + | // | |
| 149 | + | // When activating the action using [method@Gio.ActionGroup.activate_action], | |
| 150 | + | // the [type@GLib.Variant] given to that function must be of the type returned | |
| 151 | + | // by this function. | |
| 152 | + | // | |
| 153 | + | // In the case that this function returns `NULL`, you must not give any | |
| 154 | + | // [type@GLib.Variant], but `NULL` instead. | |
| 155 | + | // | |
| 156 | + | // The parameter type of a particular action will never change but it is | |
| 157 | + | // possible for an action to be removed and for a new action to be added | |
| 158 | + | // with the same name but a different parameter type. | |
| 159 | + | func (x *DBusActionGroup) GetActionParameterType(ActionNameVar string) *glib.VariantType { | |
| 160 | + | ||
| 161 | + | cret := XGActionGroupGetActionParameterType(x.GoPointer(), ActionNameVar) | |
| 162 | + | return cret | |
| 163 | + | } | |
| 164 | + | ||
| 165 | + | // Queries the current state of the named action within @action_group. | |
| 166 | + | // | |
| 167 | + | // If the action is not stateful then `NULL` will be returned. If the | |
| 168 | + | // action is stateful then the type of the return value is the type | |
| 169 | + | // given by [method@Gio.ActionGroup.get_action_state_type]. | |
| 170 | + | // | |
| 171 | + | // The return value (if non-`NULL`) should be freed with | |
| 172 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 173 | + | func (x *DBusActionGroup) GetActionState(ActionNameVar string) *glib.Variant { | |
| 174 | + | ||
| 175 | + | cret := XGActionGroupGetActionState(x.GoPointer(), ActionNameVar) | |
| 176 | + | return cret | |
| 177 | + | } | |
| 178 | + | ||
| 179 | + | // Requests a hint about the valid range of values for the state of the | |
| 180 | + | // named action within @action_group. | |
| 181 | + | // | |
| 182 | + | // If `NULL` is returned it either means that the action is not stateful | |
| 183 | + | // or that there is no hint about the valid range of values for the | |
| 184 | + | // state of the action. | |
| 185 | + | // | |
| 186 | + | // If a [type@GLib.Variant] array is returned then each item in the array is a | |
| 187 | + | // possible value for the state. If a [type@GLib.Variant] pair (ie: two-tuple) is | |
| 188 | + | // returned then the tuple specifies the inclusive lower and upper bound | |
| 189 | + | // of valid values for the state. | |
| 190 | + | // | |
| 191 | + | // In any case, the information is merely a hint. It may be possible to | |
| 192 | + | // have a state value outside of the hinted range and setting a value | |
| 193 | + | // within the range may fail. | |
| 194 | + | // | |
| 195 | + | // The return value (if non-`NULL`) should be freed with | |
| 196 | + | // [method@GLib.Variant.unref] when it is no longer required. | |
| 197 | + | func (x *DBusActionGroup) GetActionStateHint(ActionNameVar string) *glib.Variant { | |
| 198 | + | ||
| 199 | + | cret := XGActionGroupGetActionStateHint(x.GoPointer(), ActionNameVar) | |
| 200 | + | return cret | |
| 201 | + | } | |
| 202 | + | ||
| 203 | + | // Queries the type of the state of the named action within | |
| 204 | + | // @action_group. | |
| 205 | + | // | |
| 206 | + | // If the action is stateful then this function returns the | |
| 207 | + | // [type@GLib.VariantType] of the state. All calls to | |
| 208 | + | // [method@Gio.ActionGroup.change_action_state] must give a [type@GLib.Variant] of this | |
| 209 | + | // type and [method@Gio.ActionGroup.get_action_state] will return a [type@GLib.Variant] | |
| 210 | + | // of the same type. | |
| 211 | + | // | |
| 212 | + | // If the action is not stateful then this function will return `NULL`. | |
| 213 | + | // In that case, [method@Gio.ActionGroup.get_action_state] will return `NULL` | |
| 214 | + | // and you must not call [method@Gio.ActionGroup.change_action_state]. | |
| 215 | + | // | |
| 216 | + | // The state type of a particular action will never change but it is | |
| 217 | + | // possible for an action to be removed and for a new action to be added | |
| 218 | + | // with the same name but a different state type. | |
| 219 | + | func (x *DBusActionGroup) GetActionStateType(ActionNameVar string) *glib.VariantType { | |
| 220 | + | ||
| 221 | + | cret := XGActionGroupGetActionStateType(x.GoPointer(), ActionNameVar) | |
| 222 | + | return cret | |
| 223 | + | } | |
| 224 | + | ||
| 225 | + | // Checks if the named action exists within @action_group. | |
| 226 | + | func (x *DBusActionGroup) HasAction(ActionNameVar string) bool { | |
| 227 | + | ||
| 228 | + | cret := XGActionGroupHasAction(x.GoPointer(), ActionNameVar) | |
| 229 | + | return cret | |
| 230 | + | } | |
| 231 | + | ||
| 232 | + | // Lists the actions contained within @action_group. | |
| 233 | + | // | |
| 234 | + | // The caller is responsible for freeing the list with [func@GLib.strfreev] when | |
| 235 | + | // it is no longer required. | |
| 236 | + | func (x *DBusActionGroup) ListActions() []string { | |
| 237 | + | ||
| 238 | + | cret := XGActionGroupListActions(x.GoPointer()) | |
| 239 | + | return cret | |
| 240 | + | } | |
| 241 | + | ||
| 242 | + | // Queries all aspects of the named action within an @action_group. | |
| 243 | + | // | |
| 244 | + | // This function acquires the information available from | |
| 245 | + | // [method@Gio.ActionGroup.has_action], [method@Gio.ActionGroup.get_action_enabled], | |
| 246 | + | // [method@Gio.ActionGroup.get_action_parameter_type], | |
| 247 | + | // [method@Gio.ActionGroup.get_action_state_type], | |
| 248 | + | // [method@Gio.ActionGroup.get_action_state_hint] and | |
| 249 | + | // [method@Gio.ActionGroup.get_action_state] with a single function call. | |
| 250 | + | // | |
| 251 | + | // This provides two main benefits. | |
| 252 | + | // | |
| 253 | + | // The first is the improvement in efficiency that comes with not having | |
| 254 | + | // to perform repeated lookups of the action in order to discover | |
| 255 | + | // different things about it. The second is that implementing | |
| 256 | + | // [type@Gio.ActionGroup] can now be done by only overriding this one virtual | |
| 257 | + | // function. | |
| 258 | + | // | |
| 259 | + | // The interface provides a default implementation of this function that | |
| 260 | + | // calls the individual functions, as required, to fetch the | |
| 261 | + | // information. The interface also provides default implementations of | |
| 262 | + | // those functions that call this function. All implementations, | |
| 263 | + | // therefore, must override either this function or all of the others. | |
| 264 | + | // | |
| 265 | + | // If the action exists, `TRUE` is returned and any of the requested | |
| 266 | + | // fields (as indicated by having a non-`NULL` reference passed in) are | |
| 267 | + | // filled. If the action doesn’t exist, `FALSE` is returned and the | |
| 268 | + | // fields may or may not have been modified. | |
| 269 | + | func (x *DBusActionGroup) QueryAction(ActionNameVar string, EnabledVar bool, ParameterTypeVar **glib.VariantType, StateTypeVar **glib.VariantType, StateHintVar **glib.Variant, StateVar **glib.Variant) bool { | |
| 270 | + | ||
| 271 | + | cret := XGActionGroupQueryAction(x.GoPointer(), ActionNameVar, EnabledVar, ParameterTypeVar, StateTypeVar, StateHintVar, StateVar) | |
| 272 | + | return cret | |
| 273 | + | } | |
| 274 | + | ||
| 275 | + | // Activates the remote action. | |
| 276 | + | // | |
| 277 | + | // This is the same as g_action_group_activate_action() except that it | |
| 278 | + | // allows for provision of "platform data" to be sent along with the | |
| 279 | + | // activation request. This typically contains details such as the user | |
| 280 | + | // interaction timestamp or startup notification information. | |
| 281 | + | // | |
| 282 | + | // @platform_data must be non-%NULL and must have the type | |
| 283 | + | // %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed. | |
| 284 | + | func (x *DBusActionGroup) ActivateActionFull(ActionNameVar string, ParameterVar *glib.Variant, PlatformDataVar *glib.Variant) { | |
| 285 | + | ||
| 286 | + | XGRemoteActionGroupActivateActionFull(x.GoPointer(), ActionNameVar, ParameterVar, PlatformDataVar) | |
| 287 | + | ||
| 288 | + | } | |
| 289 | + | ||
| 290 | + | // Changes the state of a remote action. | |
| 291 | + | // | |
| 292 | + | // This is the same as g_action_group_change_action_state() except that | |
| 293 | + | // it allows for provision of "platform data" to be sent along with the | |
| 294 | + | // state change request. This typically contains details such as the | |
| 295 | + | // user interaction timestamp or startup notification information. | |
| 296 | + | // | |
| 297 | + | // @platform_data must be non-%NULL and must have the type | |
| 298 | + | // %G_VARIANT_TYPE_VARDICT. If it is floating, it will be consumed. | |
| 299 | + | func (x *DBusActionGroup) ChangeActionStateFull(ActionNameVar string, ValueVar *glib.Variant, PlatformDataVar *glib.Variant) { | |
| 300 | + | ||
| 301 | + | XGRemoteActionGroupChangeActionStateFull(x.GoPointer(), ActionNameVar, ValueVar, PlatformDataVar) | |
| 302 | + | ||
| 303 | + | } | |
| 304 | + | ||
| 305 | + | var xDBusActionGroupGet func(uintptr, string, string) uintptr | |
| 306 | + | ||
| 307 | + | // Obtains a #GDBusActionGroup for the action group which is exported at | |
| 308 | + | // the given @bus_name and @object_path. | |
| 309 | + | // | |
| 310 | + | // The thread default main context is taken at the time of this call. | |
| 311 | + | // All signals on the menu model (and any linked models) are reported | |
| 312 | + | // with respect to this context. All calls on the returned menu model | |
| 313 | + | // (and linked models) must also originate from this same context, with | |
| 314 | + | // the thread default main context unchanged. | |
| 315 | + | // | |
| 316 | + | // This call is non-blocking. The returned action group may or may not | |
| 317 | + | // already be filled in. The correct thing to do is connect the signals | |
| 318 | + | // for the action group to monitor for changes and then to call | |
| 319 | + | // g_action_group_list_actions() to get the initial list. | |
| 320 | + | func DBusActionGroupGet(ConnectionVar *DBusConnection, BusNameVar string, ObjectPathVar string) *DBusActionGroup { | |
| 321 | + | var cls *DBusActionGroup | |
| 322 | + | ||
| 323 | + | cret := xDBusActionGroupGet(ConnectionVar.GoPointer(), BusNameVar, ObjectPathVar) | |
| 324 | + | ||
| 325 | + | if cret == 0 { | |
| 326 | + | return nil | |
| 327 | + | } | |
| 328 | + | cls = &DBusActionGroup{} | |
| 329 | + | cls.Ptr = cret | |
| 330 | + | return cls | |
| 331 | + | } | |
| 332 | + | ||
| 333 | + | func init() { | |
| 334 | + | core.SetPackageName("GIO", "gio-2.0") | |
| 335 | + | core.SetSharedLibrary("GIO", "libgio-2.0.so.0") | |
| 336 | + | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 337 | + | if err != nil { | |
| 338 | + | panic(err) | |
| 339 | + | } | |
| 340 | + | ||
| 341 | + | core.PuregoSafeRegister(&xDBusActionGroupGLibType, lib, "g_dbus_action_group_get_type") | |
| 342 | + | ||
| 343 | + | core.PuregoSafeRegister(&xDBusActionGroupGet, lib, "g_dbus_action_group_get") | |
| 344 | + | ||
| 345 | + | } | |
A v4/gio/gdbusauthobserver.go +200 -0
| @@ -0,0 +1,200 @@ | |||
| 1 | + | // Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gio | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "unsafe" | |
| 6 | + | ||
| 7 | + | "github.com/jwijenbergh/purego" | |
| 8 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 10 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 11 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 12 | + | ) | |
| 13 | + | ||
| 14 | + | // `GDBusAuthObserver` provides a mechanism for participating | |
| 15 | + | // in how a [class@Gio.DBusServer] (or a [class@Gio.DBusConnection]) | |
| 16 | + | // authenticates remote peers. | |
| 17 | + | // | |
| 18 | + | // Simply instantiate a `GDBusAuthObserver` and connect to the | |
| 19 | + | // signals you are interested in. Note that new signals may be added | |
| 20 | + | // in the future. | |
| 21 | + | // | |
| 22 | + | // ## Controlling Authentication Mechanisms | |
| 23 | + | // | |
| 24 | + | // By default, a `GDBusServer` or server-side `GDBusConnection` will allow | |
| 25 | + | // any authentication mechanism to be used. If you only want to allow D-Bus | |
| 26 | + | // connections with the `EXTERNAL` mechanism, which makes use of credentials | |
| 27 | + | // passing and is the recommended mechanism for modern Unix platforms such | |
| 28 | + | // as Linux and the BSD family, you would use a signal handler like this: | |
| 29 | + | // | |
| 30 | + | // ```c | |
| 31 | + | // static gboolean | |
| 32 | + | // on_allow_mechanism (GDBusAuthObserver *observer, | |
| 33 | + | // | |
| 34 | + | // const gchar *mechanism, | |
| 35 | + | // gpointer user_data) | |
| 36 | + | // | |
| 37 | + | // { | |
| 38 | + | // if (g_strcmp0 (mechanism, "EXTERNAL") == 0) | |
| 39 | + | // { | |
| 40 | + | // return TRUE; | |
| 41 | + | // } | |
| 42 | + | // | |
| 43 | + | // return FALSE; | |
| 44 | + | // } | |
| 45 | + | // | |
| 46 | + | // ``` | |
| 47 | + | // | |
| 48 | + | // ## Controlling Authorization | |
| 49 | + | // | |
| 50 | + | // By default, a `GDBusServer` or server-side `GDBusConnection` will accept | |
| 51 | + | // connections from any successfully authenticated user (but not from | |
| 52 | + | // anonymous connections using the `ANONYMOUS` mechanism). If you only | |
| 53 | + | // want to allow D-Bus connections from processes owned by the same uid | |
| 54 | + | // as the server, since GLib 2.68, you should use the | |
| 55 | + | // `G_DBUS_SERVER_FLAGS_AUTHENTICATION_REQUIRE_SAME_USER` flag. It’s equivalent | |
| 56 | + | // to the following signal handler: | |
| 57 | + | // | |
| 58 | + | // ```c | |
| 59 | + | // static gboolean | |
| 60 | + | // on_authorize_authenticated_peer (GDBusAuthObserver *observer, | |
| 61 | + | // | |
| 62 | + | // GIOStream *stream, | |
| 63 | + | // GCredentials *credentials, | |
| 64 | + | // gpointer user_data) | |
| 65 | + | // | |
| 66 | + | // { | |
| 67 | + | // gboolean authorized; | |
| 68 | + | // | |
| 69 | + | // authorized = FALSE; | |
| 70 | + | // if (credentials != NULL) | |
| 71 | + | // { | |
| 72 | + | // GCredentials *own_credentials; | |
| 73 | + | // own_credentials = g_credentials_new (); | |
| 74 | + | // if (g_credentials_is_same_user (credentials, own_credentials, NULL)) | |
| 75 | + | // authorized = TRUE; | |
| 76 | + | // g_object_unref (own_credentials); | |
| 77 | + | // } | |
| 78 | + | // | |
| 79 | + | // return authorized; | |
| 80 | + | // } | |
| 81 | + | // | |
| 82 | + | // ``` | |
| 83 | + | type DBusAuthObserver struct { | |
| 84 | + | gobject.Object | |
| 85 | + | } | |
| 86 | + | ||
| 87 | + | var xDBusAuthObserverGLibType func() types.GType | |
| 88 | + | ||
| 89 | + | func DBusAuthObserverGLibType() types.GType { | |
| 90 | + | return xDBusAuthObserverGLibType() | |
| 91 | + | } | |
| 92 | + | ||
| 93 | + | func DBusAuthObserverNewFromInternalPtr(ptr uintptr) *DBusAuthObserver { | |
| 94 | + | cls := &DBusAuthObserver{} | |
| 95 | + | cls.Ptr = ptr | |
| 96 | + | return cls | |
| 97 | + | } | |
| 98 | + | ||
| 99 | + | var xNewDBusAuthObserver func() uintptr | |
| 100 | + | ||
| 101 | + | // Creates a new #GDBusAuthObserver object. | |
| 102 | + | func NewDBusAuthObserver() *DBusAuthObserver { | |
| 103 | + | var cls *DBusAuthObserver | |
| 104 | + | ||
| 105 | + | cret := xNewDBusAuthObserver() | |
| 106 | + | ||
| 107 | + | if cret == 0 { | |
| 108 | + | return nil | |
| 109 | + | } | |
| 110 | + | cls = &DBusAuthObserver{} | |
| 111 | + | cls.Ptr = cret | |
| 112 | + | return cls | |
| 113 | + | } | |
| 114 | + | ||
| 115 | + | var xDBusAuthObserverAllowMechanism func(uintptr, string) bool | |
| 116 | + | ||
| 117 | + | // Emits the #GDBusAuthObserver::allow-mechanism signal on @observer. | |
| 118 | + | func (x *DBusAuthObserver) AllowMechanism(MechanismVar string) bool { | |
| 119 | + | ||
| 120 | + | cret := xDBusAuthObserverAllowMechanism(x.GoPointer(), MechanismVar) | |
| 121 | + | return cret | |
| 122 | + | } | |
| 123 | + | ||
| 124 | + | var xDBusAuthObserverAuthorizeAuthenticatedPeer func(uintptr, uintptr, uintptr) bool | |
| 125 | + | ||
| 126 | + | // Emits the #GDBusAuthObserver::authorize-authenticated-peer signal on @observer. | |
| 127 | + | func (x *DBusAuthObserver) AuthorizeAuthenticatedPeer(StreamVar *IOStream, CredentialsVar *Credentials) bool { | |
| 128 | + | ||
| 129 | + | cret := xDBusAuthObserverAuthorizeAuthenticatedPeer(x.GoPointer(), StreamVar.GoPointer(), CredentialsVar.GoPointer()) | |
| 130 | + | return cret | |
| 131 | + | } | |
| 132 | + | ||
| 133 | + | func (c *DBusAuthObserver) GoPointer() uintptr { | |
| 134 | + | if c == nil { | |
| 135 | + | return 0 | |
| 136 | + | } | |
| 137 | + | return c.Ptr | |
| 138 | + | } | |
| 139 | + | ||
| 140 | + | func (c *DBusAuthObserver) SetGoPointer(ptr uintptr) { | |
| 141 | + | c.Ptr = ptr | |
| 142 | + | } | |
| 143 | + | ||
| 144 | + | // Emitted to check if @mechanism is allowed to be used. | |
| 145 | + | func (x *DBusAuthObserver) ConnectAllowMechanism(cb *func(DBusAuthObserver, string) bool) uint32 { | |
| 146 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 147 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 148 | + | return gobject.SignalConnect(x.GoPointer(), "allow-mechanism", cbRefPtr) | |
| 149 | + | } | |
| 150 | + | ||
| 151 | + | fcb := func(clsPtr uintptr, MechanismVarp string) bool { | |
| 152 | + | fa := DBusAuthObserver{} | |
| 153 | + | fa.Ptr = clsPtr | |
| 154 | + | cbFn := *cb | |
| 155 | + | ||
| 156 | + | return cbFn(fa, MechanismVarp) | |
| 157 | + | ||
| 158 | + | } | |
| 159 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 160 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 161 | + | return gobject.SignalConnect(x.GoPointer(), "allow-mechanism", cbRefPtr) | |
| 162 | + | } | |
| 163 | + | ||
| 164 | + | // Emitted to check if a peer that is successfully authenticated | |
| 165 | + | // is authorized. | |
| 166 | + | func (x *DBusAuthObserver) ConnectAuthorizeAuthenticatedPeer(cb *func(DBusAuthObserver, uintptr, uintptr) bool) uint32 { | |
| 167 | + | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| 168 | + | if cbRefPtr, ok := glib.GetCallback(cbPtr); ok { | |
| 169 | + | return gobject.SignalConnect(x.GoPointer(), "authorize-authenticated-peer", cbRefPtr) | |
| 170 | + | } | |
| 171 | + | ||
| 172 | + | fcb := func(clsPtr uintptr, StreamVarp uintptr, CredentialsVarp uintptr) bool { | |
| 173 | + | fa := DBusAuthObserver{} | |
| 174 | + | fa.Ptr = clsPtr | |
| 175 | + | cbFn := *cb | |
| 176 | + | ||
| 177 | + | return cbFn(fa, StreamVarp, CredentialsVarp) | |
| 178 | + | ||
| 179 | + | } | |
| 180 | + | cbRefPtr := purego.NewCallback(fcb) | |
| 181 | + | glib.SaveCallback(cbPtr, cbRefPtr) | |
| 182 | + | return gobject.SignalConnect(x.GoPointer(), "authorize-authenticated-peer", cbRefPtr) | |
| 183 | + | } | |
| 184 | + | ||
| 185 | + | func init() { | |
| 186 | + | core.SetPackageName("GIO", "gio-2.0") | |
| 187 | + | core.SetSharedLibrary("GIO", "libgio-2.0.so.0") | |
| 188 | + | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 189 | + | if err != nil { | |
| 190 | + | panic(err) | |
| 191 | + | } | |
| 192 | + | ||
| 193 | + | core.PuregoSafeRegister(&xDBusAuthObserverGLibType, lib, "g_dbus_auth_observer_get_type") | |
| 194 | + | ||
| 195 | + | core.PuregoSafeRegister(&xNewDBusAuthObserver, lib, "g_dbus_auth_observer_new") | |
| 196 | + | ||
| 197 | + | core.PuregoSafeRegister(&xDBusAuthObserverAllowMechanism, lib, "g_dbus_auth_observer_allow_mechanism") | |
| 198 | + | core.PuregoSafeRegister(&xDBusAuthObserverAuthorizeAuthenticatedPeer, lib, "g_dbus_auth_observer_authorize_authenticated_peer") | |
| 199 | + | ||
| 200 | + | } | |
M v4/gio/gdbusconnection.go +1487 -9 collapsed to keep the page light
M v4/gio/gdbusinterface.go +13 -3
| @@ -31,6 +31,7 @@ func (x *DBusInterfaceIface) GoPointer() uintptr { | |||
| 31 | 31 | } | |
| 32 | 32 | ||
| 33 | 33 | // OverrideGetInfo sets the callback function. | |
| 34 | + | // Returns a #GDBusInterfaceInfo. See g_dbus_interface_get_info(). | |
| 34 | 35 | func (x *DBusInterfaceIface) OverrideGetInfo(cb func(DBusInterface) *DBusInterfaceInfo) { | |
| 35 | 36 | if cb == nil { | |
| 36 | 37 | x.xGetInfo = 0 | |
| @@ -42,6 +43,7 @@ func (x *DBusInterfaceIface) OverrideGetInfo(cb func(DBusInterface) *DBusInterfa | |||
| 42 | 43 | } | |
| 43 | 44 | ||
| 44 | 45 | // GetGetInfo gets the callback function. | |
| 46 | + | // Returns a #GDBusInterfaceInfo. See g_dbus_interface_get_info(). | |
| 45 | 47 | func (x *DBusInterfaceIface) GetGetInfo() func(DBusInterface) *DBusInterfaceInfo { | |
| 46 | 48 | if x.xGetInfo == 0 { | |
| 47 | 49 | return nil | |
| @@ -54,6 +56,7 @@ func (x *DBusInterfaceIface) GetGetInfo() func(DBusInterface) *DBusInterfaceInfo | |||
| 54 | 56 | } | |
| 55 | 57 | ||
| 56 | 58 | // OverrideGetObject sets the callback function. | |
| 59 | + | // Gets the enclosing #GDBusObject. See g_dbus_interface_get_object(). | |
| 57 | 60 | func (x *DBusInterfaceIface) OverrideGetObject(cb func(DBusInterface) *DBusObjectBase) { | |
| 58 | 61 | if cb == nil { | |
| 59 | 62 | x.xGetObject = 0 | |
| @@ -69,6 +72,7 @@ func (x *DBusInterfaceIface) OverrideGetObject(cb func(DBusInterface) *DBusObjec | |||
| 69 | 72 | } | |
| 70 | 73 | ||
| 71 | 74 | // GetGetObject gets the callback function. | |
| 75 | + | // Gets the enclosing #GDBusObject. See g_dbus_interface_get_object(). | |
| 72 | 76 | func (x *DBusInterfaceIface) GetGetObject() func(DBusInterface) *DBusObjectBase { | |
| 73 | 77 | if x.xGetObject == 0 { | |
| 74 | 78 | return nil | |
| @@ -87,6 +91,7 @@ func (x *DBusInterfaceIface) GetGetObject() func(DBusInterface) *DBusObjectBase | |||
| 87 | 91 | } | |
| 88 | 92 | ||
| 89 | 93 | // OverrideSetObject sets the callback function. | |
| 94 | + | // Sets the enclosing #GDBusObject. See g_dbus_interface_set_object(). | |
| 90 | 95 | func (x *DBusInterfaceIface) OverrideSetObject(cb func(DBusInterface, DBusObject)) { | |
| 91 | 96 | if cb == nil { | |
| 92 | 97 | x.xSetObject = 0 | |
| @@ -98,6 +103,7 @@ func (x *DBusInterfaceIface) OverrideSetObject(cb func(DBusInterface, DBusObject | |||
| 98 | 103 | } | |
| 99 | 104 | ||
| 100 | 105 | // GetSetObject gets the callback function. | |
| 106 | + | // Sets the enclosing #GDBusObject. See g_dbus_interface_set_object(). | |
| 101 | 107 | func (x *DBusInterfaceIface) GetSetObject() func(DBusInterface, DBusObject) { | |
| 102 | 108 | if x.xSetObject == 0 { | |
| 103 | 109 | return nil | |
| @@ -110,6 +116,7 @@ func (x *DBusInterfaceIface) GetSetObject() func(DBusInterface, DBusObject) { | |||
| 110 | 116 | } | |
| 111 | 117 | ||
| 112 | 118 | // OverrideDupObject sets the callback function. | |
| 119 | + | // Gets a reference to the enclosing #GDBusObject. See g_dbus_interface_dup_object(). Added in 2.32. | |
| 113 | 120 | func (x *DBusInterfaceIface) OverrideDupObject(cb func(DBusInterface) *DBusObjectBase) { | |
| 114 | 121 | if cb == nil { | |
| 115 | 122 | x.xDupObject = 0 | |
| @@ -125,6 +132,7 @@ func (x *DBusInterfaceIface) OverrideDupObject(cb func(DBusInterface) *DBusObjec | |||
| 125 | 132 | } | |
| 126 | 133 | ||
| 127 | 134 | // GetDupObject gets the callback function. | |
| 135 | + | // Gets a reference to the enclosing #GDBusObject. See g_dbus_interface_dup_object(). Added in 2.32. | |
| 128 | 136 | func (x *DBusInterfaceIface) GetDupObject() func(DBusInterface) *DBusObjectBase { | |
| 129 | 137 | if x.xDupObject == 0 { | |
| 130 | 138 | return nil | |
| @@ -142,9 +150,11 @@ func (x *DBusInterfaceIface) GetDupObject() func(DBusInterface) *DBusObjectBase | |||
| 142 | 150 | } | |
| 143 | 151 | } | |
| 144 | 152 | ||
| 145 | - | // The #GDBusInterface type is the base type for D-Bus interfaces both | |
| 146 | - | // on the service side (see #GDBusInterfaceSkeleton) and client side | |
| 147 | - | // (see #GDBusProxy). | |
| 153 | + | // Base type for D-Bus interfaces. | |
| 154 | + | // | |
| 155 | + | // The `GDBusInterface` type is the base type for D-Bus interfaces both | |
| 156 | + | // on the service side (see [class@Gio.DBusInterfaceSkeleton]) and client side | |
| 157 | + | // (see [class@Gio.DBusProxy]). | |
| 148 | 158 | type DBusInterface interface { | |
| 149 | 159 | GoPointer() uintptr | |
| 150 | 160 | SetGoPointer(uintptr) | |
M v4/gio/gdbusinterfaceskeleton.go +10 -0
| @@ -38,6 +38,7 @@ func (x *DBusInterfaceSkeletonClass) GoPointer() uintptr { | |||
| 38 | 38 | } | |
| 39 | 39 | ||
| 40 | 40 | // OverrideGetInfo sets the callback function. | |
| 41 | + | // Returns a #GDBusInterfaceInfo. See g_dbus_interface_skeleton_get_info() for details. | |
| 41 | 42 | func (x *DBusInterfaceSkeletonClass) OverrideGetInfo(cb func(*DBusInterfaceSkeleton) *DBusInterfaceInfo) { | |
| 42 | 43 | if cb == nil { | |
| 43 | 44 | x.xGetInfo = 0 | |
| @@ -49,6 +50,7 @@ func (x *DBusInterfaceSkeletonClass) OverrideGetInfo(cb func(*DBusInterfaceSkele | |||
| 49 | 50 | } | |
| 50 | 51 | ||
| 51 | 52 | // GetGetInfo gets the callback function. | |
| 53 | + | // Returns a #GDBusInterfaceInfo. See g_dbus_interface_skeleton_get_info() for details. | |
| 52 | 54 | func (x *DBusInterfaceSkeletonClass) GetGetInfo() func(*DBusInterfaceSkeleton) *DBusInterfaceInfo { | |
| 53 | 55 | if x.xGetInfo == 0 { | |
| 54 | 56 | return nil | |
| @@ -61,6 +63,7 @@ func (x *DBusInterfaceSkeletonClass) GetGetInfo() func(*DBusInterfaceSkeleton) * | |||
| 61 | 63 | } | |
| 62 | 64 | ||
| 63 | 65 | // OverrideGetVtable sets the callback function. | |
| 66 | + | // Returns a #GDBusInterfaceVTable. See g_dbus_interface_skeleton_get_vtable() for details. | |
| 64 | 67 | func (x *DBusInterfaceSkeletonClass) OverrideGetVtable(cb func(*DBusInterfaceSkeleton) *DBusInterfaceVTable) { | |
| 65 | 68 | if cb == nil { | |
| 66 | 69 | x.xGetVtable = 0 | |
| @@ -72,6 +75,7 @@ func (x *DBusInterfaceSkeletonClass) OverrideGetVtable(cb func(*DBusInterfaceSke | |||
| 72 | 75 | } | |
| 73 | 76 | ||
| 74 | 77 | // GetGetVtable gets the callback function. | |
| 78 | + | // Returns a #GDBusInterfaceVTable. See g_dbus_interface_skeleton_get_vtable() for details. | |
| 75 | 79 | func (x *DBusInterfaceSkeletonClass) GetGetVtable() func(*DBusInterfaceSkeleton) *DBusInterfaceVTable { | |
| 76 | 80 | if x.xGetVtable == 0 { | |
| 77 | 81 | return nil | |
| @@ -84,6 +88,7 @@ func (x *DBusInterfaceSkeletonClass) GetGetVtable() func(*DBusInterfaceSkeleton) | |||
| 84 | 88 | } | |
| 85 | 89 | ||
| 86 | 90 | // OverrideGetProperties sets the callback function. | |
| 91 | + | // Returns a #GVariant with all properties. See g_dbus_interface_skeleton_get_properties(). | |
| 87 | 92 | func (x *DBusInterfaceSkeletonClass) OverrideGetProperties(cb func(*DBusInterfaceSkeleton) *glib.Variant) { | |
| 88 | 93 | if cb == nil { | |
| 89 | 94 | x.xGetProperties = 0 | |
| @@ -95,6 +100,7 @@ func (x *DBusInterfaceSkeletonClass) OverrideGetProperties(cb func(*DBusInterfac | |||
| 95 | 100 | } | |
| 96 | 101 | ||
| 97 | 102 | // GetGetProperties gets the callback function. | |
| 103 | + | // Returns a #GVariant with all properties. See g_dbus_interface_skeleton_get_properties(). | |
| 98 | 104 | func (x *DBusInterfaceSkeletonClass) GetGetProperties() func(*DBusInterfaceSkeleton) *glib.Variant { | |
| 99 | 105 | if x.xGetProperties == 0 { | |
| 100 | 106 | return nil | |
| @@ -107,6 +113,7 @@ func (x *DBusInterfaceSkeletonClass) GetGetProperties() func(*DBusInterfaceSkele | |||
| 107 | 113 | } | |
| 108 | 114 | ||
| 109 | 115 | // OverrideFlush sets the callback function. | |
| 116 | + | // Emits outstanding changes, if any. See g_dbus_interface_skeleton_flush(). | |
| 110 | 117 | func (x *DBusInterfaceSkeletonClass) OverrideFlush(cb func(*DBusInterfaceSkeleton)) { | |
| 111 | 118 | if cb == nil { | |
| 112 | 119 | x.xFlush = 0 | |
| @@ -118,6 +125,7 @@ func (x *DBusInterfaceSkeletonClass) OverrideFlush(cb func(*DBusInterfaceSkeleto | |||
| 118 | 125 | } | |
| 119 | 126 | ||
| 120 | 127 | // GetFlush gets the callback function. | |
| 128 | + | // Emits outstanding changes, if any. See g_dbus_interface_skeleton_flush(). | |
| 121 | 129 | func (x *DBusInterfaceSkeletonClass) GetFlush() func(*DBusInterfaceSkeleton) { | |
| 122 | 130 | if x.xFlush == 0 { | |
| 123 | 131 | return nil | |
| @@ -130,6 +138,7 @@ func (x *DBusInterfaceSkeletonClass) GetFlush() func(*DBusInterfaceSkeleton) { | |||
| 130 | 138 | } | |
| 131 | 139 | ||
| 132 | 140 | // OverrideGAuthorizeMethod sets the callback function. | |
| 141 | + | // Signal class handler for the #GDBusInterfaceSkeleton::g-authorize-method signal. | |
| 133 | 142 | func (x *DBusInterfaceSkeletonClass) OverrideGAuthorizeMethod(cb func(*DBusInterfaceSkeleton, *DBusMethodInvocation) bool) { | |
| 134 | 143 | if cb == nil { | |
| 135 | 144 | x.xGAuthorizeMethod = 0 | |
| @@ -141,6 +150,7 @@ func (x *DBusInterfaceSkeletonClass) OverrideGAuthorizeMethod(cb func(*DBusInter | |||
| 141 | 150 | } | |
| 142 | 151 | ||
| 143 | 152 | // GetGAuthorizeMethod gets the callback function. | |
| 153 | + | // Signal class handler for the #GDBusInterfaceSkeleton::g-authorize-method signal. | |
| 144 | 154 | func (x *DBusInterfaceSkeletonClass) GetGAuthorizeMethod() func(*DBusInterfaceSkeleton, *DBusMethodInvocation) bool { | |
| 145 | 155 | if x.xGAuthorizeMethod == 0 { | |
| 146 | 156 | return nil | |
M v4/gio/gdbusintrospection.go +3 -3
| @@ -226,7 +226,7 @@ func (x *DBusInterfaceInfo) Unref() { | |||
| 226 | 226 | ||
| 227 | 227 | } | |
| 228 | 228 | ||
| 229 | - | // Information about a method on an D-Bus interface. | |
| 229 | + | // Information about a method on a D-Bus interface. | |
| 230 | 230 | type DBusMethodInfo struct { | |
| 231 | 231 | _ structs.HostLayout | |
| 232 | 232 | ||
| @@ -302,10 +302,10 @@ var xNewDBusNodeInfoForXml func(string, **glib.Error) *DBusNodeInfo | |||
| 302 | 302 | // Parses @xml_data and returns a #GDBusNodeInfo representing the data. | |
| 303 | 303 | // | |
| 304 | 304 | // The introspection XML must contain exactly one top-level | |
| 305 | - | // <node> element. | |
| 305 | + | // `<node>` element. | |
| 306 | 306 | // | |
| 307 | 307 | // Note that this routine is using a | |
| 308 | - | // [GMarkup][glib-Simple-XML-Subset-Parser.description]-based | |
| 308 | + | // [GMarkup](../glib/markup.html)-based | |
| 309 | 309 | // parser that only accepts a subset of valid XML documents. | |
| 310 | 310 | func NewDBusNodeInfoForXml(XmlDataVar string) (*DBusNodeInfo, error) { | |
| 311 | 311 | var cerr *glib.Error | |
A v4/gio/gdbusmenumodel.go +75 -0
| @@ -0,0 +1,75 @@ | |||
| 1 | + | // Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gio | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 8 | + | ) | |
| 9 | + | ||
| 10 | + | // `GDBusMenuModel` is an implementation of [class@Gio.MenuModel] that can be | |
| 11 | + | // used as a proxy for a menu model that is exported over D-Bus with | |
| 12 | + | // [method@Gio.DBusConnection.export_menu_model]. | |
| 13 | + | type DBusMenuModel struct { | |
| 14 | + | MenuModel | |
| 15 | + | } | |
| 16 | + | ||
| 17 | + | var xDBusMenuModelGLibType func() types.GType | |
| 18 | + | ||
| 19 | + | func DBusMenuModelGLibType() types.GType { | |
| 20 | + | return xDBusMenuModelGLibType() | |
| 21 | + | } | |
| 22 | + | ||
| 23 | + | func DBusMenuModelNewFromInternalPtr(ptr uintptr) *DBusMenuModel { | |
| 24 | + | cls := &DBusMenuModel{} | |
| 25 | + | cls.Ptr = ptr | |
| 26 | + | return cls | |
| 27 | + | } | |
| 28 | + | ||
| 29 | + | func (c *DBusMenuModel) GoPointer() uintptr { | |
| 30 | + | if c == nil { | |
| 31 | + | return 0 | |
| 32 | + | } | |
| 33 | + | return c.Ptr | |
| 34 | + | } | |
| 35 | + | ||
| 36 | + | func (c *DBusMenuModel) SetGoPointer(ptr uintptr) { | |
| 37 | + | c.Ptr = ptr | |
| 38 | + | } | |
| 39 | + | ||
| 40 | + | var xDBusMenuModelGet func(uintptr, string, string) uintptr | |
| 41 | + | ||
| 42 | + | // Obtains a #GDBusMenuModel for the menu model which is exported | |
| 43 | + | // at the given @bus_name and @object_path. | |
| 44 | + | // | |
| 45 | + | // The thread default main context is taken at the time of this call. | |
| 46 | + | // All signals on the menu model (and any linked models) are reported | |
| 47 | + | // with respect to this context. All calls on the returned menu model | |
| 48 | + | // (and linked models) must also originate from this same context, with | |
| 49 | + | // the thread default main context unchanged. | |
| 50 | + | func DBusMenuModelGet(ConnectionVar *DBusConnection, BusNameVar string, ObjectPathVar string) *DBusMenuModel { | |
| 51 | + | var cls *DBusMenuModel | |
| 52 | + | ||
| 53 | + | cret := xDBusMenuModelGet(ConnectionVar.GoPointer(), BusNameVar, ObjectPathVar) | |
| 54 | + | ||
| 55 | + | if cret == 0 { | |
| 56 | + | return nil | |
| 57 | + | } | |
| 58 | + | cls = &DBusMenuModel{} | |
| 59 | + | cls.Ptr = cret | |
| 60 | + | return cls | |
| 61 | + | } | |
| 62 | + | ||
| 63 | + | func init() { | |
| 64 | + | core.SetPackageName("GIO", "gio-2.0") | |
| 65 | + | core.SetSharedLibrary("GIO", "libgio-2.0.so.0") | |
| 66 | + | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 67 | + | if err != nil { | |
| 68 | + | panic(err) | |
| 69 | + | } | |
| 70 | + | ||
| 71 | + | core.PuregoSafeRegister(&xDBusMenuModelGLibType, lib, "g_dbus_menu_model_get_type") | |
| 72 | + | ||
| 73 | + | core.PuregoSafeRegister(&xDBusMenuModelGet, lib, "g_dbus_menu_model_get") | |
| 74 | + | ||
| 75 | + | } | |
A v4/gio/gdbusmessage.go +746 -0
| @@ -0,0 +1,746 @@ | |||
| 1 | + | // Package gio was automatically generated by github.com/jwijenbergh/puregotk DO NOT EDIT | |
| 2 | + | package gio | |
| 3 | + | ||
| 4 | + | import ( | |
| 5 | + | "github.com/jwijenbergh/purego" | |
| 6 | + | "github.com/jwijenbergh/puregotk/pkg/core" | |
| 7 | + | "github.com/jwijenbergh/puregotk/v4/glib" | |
| 8 | + | "github.com/jwijenbergh/puregotk/v4/gobject" | |
| 9 | + | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 10 | + | ) | |
| 11 | + | ||
| 12 | + | // A type for representing D-Bus messages that can be sent or received | |
| 13 | + | // on a [class@Gio.DBusConnection]. | |
| 14 | + | type DBusMessage struct { | |
| 15 | + | gobject.Object | |
| 16 | + | } | |
| 17 | + | ||
| 18 | + | var xDBusMessageGLibType func() types.GType | |
| 19 | + | ||
| 20 | + | func DBusMessageGLibType() types.GType { | |
| 21 | + | return xDBusMessageGLibType() | |
| 22 | + | } | |
| 23 | + | ||
| 24 | + | func DBusMessageNewFromInternalPtr(ptr uintptr) *DBusMessage { | |
| 25 | + | cls := &DBusMessage{} | |
| 26 | + | cls.Ptr = ptr | |
| 27 | + | return cls | |
| 28 | + | } | |
| 29 | + | ||
| 30 | + | var xNewDBusMessage func() uintptr | |
| 31 | + | ||
| 32 | + | // Creates a new empty #GDBusMessage. | |
| 33 | + | func NewDBusMessage() *DBusMessage { | |
| 34 | + | var cls *DBusMessage | |
| 35 | + | ||
| 36 | + | cret := xNewDBusMessage() | |
| 37 | + | ||
| 38 | + | if cret == 0 { | |
| 39 | + | return nil | |
| 40 | + | } | |
| 41 | + | cls = &DBusMessage{} | |
| 42 | + | cls.Ptr = cret | |
| 43 | + | return cls | |
| 44 | + | } | |
| 45 | + | ||
| 46 | + | var xNewDBusMessageFromBlob func([]byte, uint, DBusCapabilityFlags, **glib.Error) uintptr | |
| 47 | + | ||
| 48 | + | // Creates a new #GDBusMessage from the data stored at @blob. The byte | |
| 49 | + | // order that the message was in can be retrieved using | |
| 50 | + | // g_dbus_message_get_byte_order(). | |
| 51 | + | // | |
| 52 | + | // If the @blob cannot be parsed, contains invalid fields, or contains invalid | |
| 53 | + | // headers, %G_IO_ERROR_INVALID_ARGUMENT will be returned. | |
| 54 | + | func NewDBusMessageFromBlob(BlobVar []byte, BlobLenVar uint, CapabilitiesVar DBusCapabilityFlags) (*DBusMessage, error) { | |
| 55 | + | var cls *DBusMessage | |
| 56 | + | var cerr *glib.Error | |
| 57 | + | ||
| 58 | + | cret := xNewDBusMessageFromBlob(BlobVar, BlobLenVar, CapabilitiesVar, &cerr) | |
| 59 | + | ||
| 60 | + | if cret == 0 { | |
| 61 | + | return nil, cerr | |
| 62 | + | } | |
| 63 | + | cls = &DBusMessage{} | |
| 64 | + | cls.Ptr = cret | |
| 65 | + | if cerr == nil { | |
| 66 | + | return cls, nil | |
| 67 | + | } | |
| 68 | + | return cls, cerr | |
| 69 | + | ||
| 70 | + | } | |
| 71 | + | ||
| 72 | + | var xNewDBusMessageMethodCall func(string, string, string, string) uintptr | |
| 73 | + | ||
| 74 | + | // Creates a new #GDBusMessage for a method call. | |
| 75 | + | func NewDBusMessageMethodCall(NameVar string, PathVar string, InterfaceVar string, MethodVar string) *DBusMessage { | |
| 76 | + | var cls *DBusMessage | |
| 77 | + | ||
| 78 | + | cret := xNewDBusMessageMethodCall(NameVar, PathVar, InterfaceVar, MethodVar) | |
| 79 | + | ||
| 80 | + | if cret == 0 { | |
| 81 | + | return nil | |
| 82 | + | } | |
| 83 | + | cls = &DBusMessage{} | |
| 84 | + | cls.Ptr = cret | |
| 85 | + | return cls | |
| 86 | + | } | |
| 87 | + | ||
| 88 | + | var xNewDBusMessageSignal func(string, string, string) uintptr | |
| 89 | + | ||
| 90 | + | // Creates a new #GDBusMessage for a signal emission. | |
| 91 | + | func NewDBusMessageSignal(PathVar string, InterfaceVar string, SignalVar string) *DBusMessage { | |
| 92 | + | var cls *DBusMessage | |
| 93 | + | ||
| 94 | + | cret := xNewDBusMessageSignal(PathVar, InterfaceVar, SignalVar) | |
| 95 | + | ||
| 96 | + | if cret == 0 { | |
| 97 | + | return nil | |
| 98 | + | } | |
| 99 | + | cls = &DBusMessage{} | |
| 100 | + | cls.Ptr = cret | |
| 101 | + | return cls | |
| 102 | + | } | |
| 103 | + | ||
| 104 | + | var xDBusMessageCopy func(uintptr) uintptr | |
| 105 | + | ||
| 106 | + | // Copies @message. The copy is a deep copy and the returned | |
| 107 | + | // #GDBusMessage is completely identical except that it is guaranteed | |
| 108 | + | // to not be locked. | |
| 109 | + | // | |
| 110 | + | // This operation can fail if e.g. @message contains file descriptors | |
| 111 | + | // and the per-process or system-wide open files limit is reached. | |
| 112 | + | func (x *DBusMessage) Copy() (*DBusMessage, error) { | |
| 113 | + | var cls *DBusMessage | |
| 114 | + | var cerr *glib.Error | |
| 115 | + | ||
| 116 | + | cret := xDBusMessageCopy(x.GoPointer()) | |
| 117 | + | ||
| 118 | + | if cret == 0 { | |
| 119 | + | return nil, cerr | |
| 120 | + | } | |
| 121 | + | cls = &DBusMessage{} | |
| 122 | + | cls.Ptr = cret | |
| 123 | + | if cerr == nil { | |
| 124 | + | return cls, nil | |
| 125 | + | } | |
| 126 | + | return cls, cerr | |
| 127 | + | ||
| 128 | + | } | |
| 129 | + | ||
| 130 | + | var xDBusMessageGetArg0 func(uintptr) string | |
| 131 | + | ||
| 132 | + | // Convenience to get the first item in the body of @message. | |
| 133 | + | // | |
| 134 | + | // See [method@Gio.DBusMessage.get_arg0_path] for returning object-path-typed | |
| 135 | + | // arg0 values. | |
| 136 | + | func (x *DBusMessage) GetArg0() string { | |
| 137 | + | ||
| 138 | + | cret := xDBusMessageGetArg0(x.GoPointer()) | |
| 139 | + | return cret | |
| 140 | + | } | |
| 141 | + | ||
| 142 | + | var xDBusMessageGetArg0Path func(uintptr) string | |
| 143 | + | ||
| 144 | + | // Convenience to get the first item in the body of @message. | |
| 145 | + | // | |
| 146 | + | // See [method@Gio.DBusMessage.get_arg0] for returning string-typed arg0 values. | |
| 147 | + | func (x *DBusMessage) GetArg0Path() string { | |
| 148 | + | ||
| 149 | + | cret := xDBusMessageGetArg0Path(x.GoPointer()) | |
| 150 | + | return cret | |
| 151 | + | } | |
| 152 | + | ||
| 153 | + | var xDBusMessageGetBody func(uintptr) *glib.Variant | |
| 154 | + | ||
| 155 | + | // Gets the body of a message. | |
| 156 | + | func (x *DBusMessage) GetBody() *glib.Variant { | |
| 157 | + | ||
| 158 | + | cret := xDBusMessageGetBody(x.GoPointer()) | |
| 159 | + | return cret | |
| 160 | + | } | |
| 161 | + | ||
| 162 | + | var xDBusMessageGetByteOrder func(uintptr) DBusMessageByteOrder | |
| 163 | + | ||
| 164 | + | // Gets the byte order of @message. | |
| 165 | + | func (x *DBusMessage) GetByteOrder() DBusMessageByteOrder { | |
| 166 | + | ||
| 167 | + | cret := xDBusMessageGetByteOrder(x.GoPointer()) | |
| 168 | + | return cret | |
| 169 | + | } | |
| 170 | + | ||
| 171 | + | var xDBusMessageGetDestination func(uintptr) string | |
| 172 | + | ||
| 173 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. | |
| 174 | + | func (x *DBusMessage) GetDestination() string { | |
| 175 | + | ||
| 176 | + | cret := xDBusMessageGetDestination(x.GoPointer()) | |
| 177 | + | return cret | |
| 178 | + | } | |
| 179 | + | ||
| 180 | + | var xDBusMessageGetErrorName func(uintptr) string | |
| 181 | + | ||
| 182 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field. | |
| 183 | + | func (x *DBusMessage) GetErrorName() string { | |
| 184 | + | ||
| 185 | + | cret := xDBusMessageGetErrorName(x.GoPointer()) | |
| 186 | + | return cret | |
| 187 | + | } | |
| 188 | + | ||
| 189 | + | var xDBusMessageGetFlags func(uintptr) DBusMessageFlags | |
| 190 | + | ||
| 191 | + | // Gets the flags for @message. | |
| 192 | + | func (x *DBusMessage) GetFlags() DBusMessageFlags { | |
| 193 | + | ||
| 194 | + | cret := xDBusMessageGetFlags(x.GoPointer()) | |
| 195 | + | return cret | |
| 196 | + | } | |
| 197 | + | ||
| 198 | + | var xDBusMessageGetHeader func(uintptr, DBusMessageHeaderField) *glib.Variant | |
| 199 | + | ||
| 200 | + | // Gets a header field on @message. | |
| 201 | + | // | |
| 202 | + | // The caller is responsible for checking the type of the returned #GVariant | |
| 203 | + | // matches what is expected. | |
| 204 | + | func (x *DBusMessage) GetHeader(HeaderFieldVar DBusMessageHeaderField) *glib.Variant { | |
| 205 | + | ||
| 206 | + | cret := xDBusMessageGetHeader(x.GoPointer(), HeaderFieldVar) | |
| 207 | + | return cret | |
| 208 | + | } | |
| 209 | + | ||
| 210 | + | var xDBusMessageGetHeaderFields func(uintptr) uintptr | |
| 211 | + | ||
| 212 | + | // Gets an array of all header fields on @message that are set. | |
| 213 | + | func (x *DBusMessage) GetHeaderFields() uintptr { | |
| 214 | + | ||
| 215 | + | cret := xDBusMessageGetHeaderFields(x.GoPointer()) | |
| 216 | + | return cret | |
| 217 | + | } | |
| 218 | + | ||
| 219 | + | var xDBusMessageGetInterface func(uintptr) string | |
| 220 | + | ||
| 221 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. | |
| 222 | + | func (x *DBusMessage) GetInterface() string { | |
| 223 | + | ||
| 224 | + | cret := xDBusMessageGetInterface(x.GoPointer()) | |
| 225 | + | return cret | |
| 226 | + | } | |
| 227 | + | ||
| 228 | + | var xDBusMessageGetLocked func(uintptr) bool | |
| 229 | + | ||
| 230 | + | // Checks whether @message is locked. To monitor changes to this | |
| 231 | + | // value, conncet to the #GObject::notify signal to listen for changes | |
| 232 | + | // on the #GDBusMessage:locked property. | |
| 233 | + | func (x *DBusMessage) GetLocked() bool { | |
| 234 | + | ||
| 235 | + | cret := xDBusMessageGetLocked(x.GoPointer()) | |
| 236 | + | return cret | |
| 237 | + | } | |
| 238 | + | ||
| 239 | + | var xDBusMessageGetMember func(uintptr) string | |
| 240 | + | ||
| 241 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. | |
| 242 | + | func (x *DBusMessage) GetMember() string { | |
| 243 | + | ||
| 244 | + | cret := xDBusMessageGetMember(x.GoPointer()) | |
| 245 | + | return cret | |
| 246 | + | } | |
| 247 | + | ||
| 248 | + | var xDBusMessageGetMessageType func(uintptr) DBusMessageType | |
| 249 | + | ||
| 250 | + | // Gets the type of @message. | |
| 251 | + | func (x *DBusMessage) GetMessageType() DBusMessageType { | |
| 252 | + | ||
| 253 | + | cret := xDBusMessageGetMessageType(x.GoPointer()) | |
| 254 | + | return cret | |
| 255 | + | } | |
| 256 | + | ||
| 257 | + | var xDBusMessageGetNumUnixFds func(uintptr) uint32 | |
| 258 | + | ||
| 259 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field. | |
| 260 | + | func (x *DBusMessage) GetNumUnixFds() uint32 { | |
| 261 | + | ||
| 262 | + | cret := xDBusMessageGetNumUnixFds(x.GoPointer()) | |
| 263 | + | return cret | |
| 264 | + | } | |
| 265 | + | ||
| 266 | + | var xDBusMessageGetPath func(uintptr) string | |
| 267 | + | ||
| 268 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. | |
| 269 | + | func (x *DBusMessage) GetPath() string { | |
| 270 | + | ||
| 271 | + | cret := xDBusMessageGetPath(x.GoPointer()) | |
| 272 | + | return cret | |
| 273 | + | } | |
| 274 | + | ||
| 275 | + | var xDBusMessageGetReplySerial func(uintptr) uint32 | |
| 276 | + | ||
| 277 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field. | |
| 278 | + | func (x *DBusMessage) GetReplySerial() uint32 { | |
| 279 | + | ||
| 280 | + | cret := xDBusMessageGetReplySerial(x.GoPointer()) | |
| 281 | + | return cret | |
| 282 | + | } | |
| 283 | + | ||
| 284 | + | var xDBusMessageGetSender func(uintptr) string | |
| 285 | + | ||
| 286 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. | |
| 287 | + | func (x *DBusMessage) GetSender() string { | |
| 288 | + | ||
| 289 | + | cret := xDBusMessageGetSender(x.GoPointer()) | |
| 290 | + | return cret | |
| 291 | + | } | |
| 292 | + | ||
| 293 | + | var xDBusMessageGetSerial func(uintptr) uint32 | |
| 294 | + | ||
| 295 | + | // Gets the serial for @message. | |
| 296 | + | func (x *DBusMessage) GetSerial() uint32 { | |
| 297 | + | ||
| 298 | + | cret := xDBusMessageGetSerial(x.GoPointer()) | |
| 299 | + | return cret | |
| 300 | + | } | |
| 301 | + | ||
| 302 | + | var xDBusMessageGetSignature func(uintptr) string | |
| 303 | + | ||
| 304 | + | // Convenience getter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. | |
| 305 | + | // | |
| 306 | + | // This will always be non-%NULL, but may be an empty string. | |
| 307 | + | func (x *DBusMessage) GetSignature() string { | |
| 308 | + | ||
| 309 | + | cret := xDBusMessageGetSignature(x.GoPointer()) | |
| 310 | + | return cret | |
| 311 | + | } | |
| 312 | + | ||
| 313 | + | var xDBusMessageGetUnixFdList func(uintptr) uintptr | |
| 314 | + | ||
| 315 | + | // Gets the UNIX file descriptors associated with @message, if any. | |
| 316 | + | // | |
| 317 | + | // This method is only available on UNIX. | |
| 318 | + | // | |
| 319 | + | // The file descriptors normally correspond to %G_VARIANT_TYPE_HANDLE | |
| 320 | + | // values in the body of the message. For example, | |
| 321 | + | // if g_variant_get_handle() returns 5, that is intended to be a reference | |
| 322 | + | // to the file descriptor that can be accessed by | |
| 323 | + | // `g_unix_fd_list_get (list, 5, ...)`. | |
| 324 | + | func (x *DBusMessage) GetUnixFdList() *UnixFDList { | |
| 325 | + | var cls *UnixFDList | |
| 326 | + | ||
| 327 | + | cret := xDBusMessageGetUnixFdList(x.GoPointer()) | |
| 328 | + | ||
| 329 | + | if cret == 0 { | |
| 330 | + | return nil | |
| 331 | + | } | |
| 332 | + | gobject.IncreaseRef(cret) | |
| 333 | + | cls = &UnixFDList{} | |
| 334 | + | cls.Ptr = cret | |
| 335 | + | return cls | |
| 336 | + | } | |
| 337 | + | ||
| 338 | + | var xDBusMessageLock func(uintptr) | |
| 339 | + | ||
| 340 | + | // If @message is locked, does nothing. Otherwise locks the message. | |
| 341 | + | func (x *DBusMessage) Lock() { | |
| 342 | + | ||
| 343 | + | xDBusMessageLock(x.GoPointer()) | |
| 344 | + | ||
| 345 | + | } | |
| 346 | + | ||
| 347 | + | var xDBusMessageNewMethodError func(uintptr, string, string, ...interface{}) uintptr | |
| 348 | + | ||
| 349 | + | // Creates a new #GDBusMessage that is an error reply to @method_call_message. | |
| 350 | + | func (x *DBusMessage) NewMethodError(ErrorNameVar string, ErrorMessageFormatVar string, varArgs ...interface{}) *DBusMessage { | |
| 351 | + | var cls *DBusMessage | |
| 352 | + | ||
| 353 | + | cret := xDBusMessageNewMethodError(x.GoPointer(), ErrorNameVar, ErrorMessageFormatVar, varArgs...) | |
| 354 | + | ||
| 355 | + | if cret == 0 { | |
| 356 | + | return nil | |
| 357 | + | } | |
| 358 | + | cls = &DBusMessage{} | |
| 359 | + | cls.Ptr = cret | |
| 360 | + | return cls | |
| 361 | + | } | |
| 362 | + | ||
| 363 | + | var xDBusMessageNewMethodErrorLiteral func(uintptr, string, string) uintptr | |
| 364 | + | ||
| 365 | + | // Creates a new #GDBusMessage that is an error reply to @method_call_message. | |
| 366 | + | func (x *DBusMessage) NewMethodErrorLiteral(ErrorNameVar string, ErrorMessageVar string) *DBusMessage { | |
| 367 | + | var cls *DBusMessage | |
| 368 | + | ||
| 369 | + | cret := xDBusMessageNewMethodErrorLiteral(x.GoPointer(), ErrorNameVar, ErrorMessageVar) | |
| 370 | + | ||
| 371 | + | if cret == 0 { | |
| 372 | + | return nil | |
| 373 | + | } | |
| 374 | + | cls = &DBusMessage{} | |
| 375 | + | cls.Ptr = cret | |
| 376 | + | return cls | |
| 377 | + | } | |
| 378 | + | ||
| 379 | + | var xDBusMessageNewMethodErrorValist func(uintptr, string, string, []interface{}) uintptr | |
| 380 | + | ||
| 381 | + | // Like g_dbus_message_new_method_error() but intended for language bindings. | |
| 382 | + | func (x *DBusMessage) NewMethodErrorValist(ErrorNameVar string, ErrorMessageFormatVar string, VarArgsVar []interface{}) *DBusMessage { | |
| 383 | + | var cls *DBusMessage | |
| 384 | + | ||
| 385 | + | cret := xDBusMessageNewMethodErrorValist(x.GoPointer(), ErrorNameVar, ErrorMessageFormatVar, VarArgsVar) | |
| 386 | + | ||
| 387 | + | if cret == 0 { | |
| 388 | + | return nil | |
| 389 | + | } | |
| 390 | + | cls = &DBusMessage{} | |
| 391 | + | cls.Ptr = cret | |
| 392 | + | return cls | |
| 393 | + | } | |
| 394 | + | ||
| 395 | + | var xDBusMessageNewMethodReply func(uintptr) uintptr | |
| 396 | + | ||
| 397 | + | // Creates a new #GDBusMessage that is a reply to @method_call_message. | |
| 398 | + | func (x *DBusMessage) NewMethodReply() *DBusMessage { | |
| 399 | + | var cls *DBusMessage | |
| 400 | + | ||
| 401 | + | cret := xDBusMessageNewMethodReply(x.GoPointer()) | |
| 402 | + | ||
| 403 | + | if cret == 0 { | |
| 404 | + | return nil | |
| 405 | + | } | |
| 406 | + | cls = &DBusMessage{} | |
| 407 | + | cls.Ptr = cret | |
| 408 | + | return cls | |
| 409 | + | } | |
| 410 | + | ||
| 411 | + | var xDBusMessagePrint func(uintptr, uint) string | |
| 412 | + | ||
| 413 | + | // Produces a human-readable multi-line description of @message. | |
| 414 | + | // | |
| 415 | + | // The contents of the description has no ABI guarantees, the contents | |
| 416 | + | // and formatting is subject to change at any time. Typical output | |
| 417 | + | // looks something like this: | |
| 418 | + | // ``` | |
| 419 | + | // Flags: none | |
| 420 | + | // Version: 0 | |
| 421 | + | // Serial: 4 | |
| 422 | + | // Headers: | |
| 423 | + | // | |
| 424 | + | // path -> objectpath '/org/gtk/GDBus/TestObject' | |
| 425 | + | // interface -> 'org.gtk.GDBus.TestInterface' | |
| 426 | + | // member -> 'GimmeStdout' | |
| 427 | + | // destination -> ':1.146' | |
| 428 | + | // | |
| 429 | + | // Body: () | |
| 430 | + | // UNIX File Descriptors: | |
| 431 | + | // | |
| 432 | + | // (none) | |
| 433 | + | // | |
| 434 | + | // ``` | |
| 435 | + | // or | |
| 436 | + | // ``` | |
| 437 | + | // Flags: no-reply-expected | |
| 438 | + | // Version: 0 | |
| 439 | + | // Serial: 477 | |
| 440 | + | // Headers: | |
| 441 | + | // | |
| 442 | + | // reply-serial -> uint32 4 | |
| 443 | + | // destination -> ':1.159' | |
| 444 | + | // sender -> ':1.146' | |
| 445 | + | // num-unix-fds -> uint32 1 | |
| 446 | + | // | |
| 447 | + | // Body: () | |
| 448 | + | // UNIX File Descriptors: | |
| 449 | + | // | |
| 450 | + | // fd 12: dev=0:10,mode=020620,ino=5,uid=500,gid=5,rdev=136:2,size=0,atime=1273085037,mtime=1273085851,ctime=1272982635 | |
| 451 | + | // | |
| 452 | + | // ``` | |
| 453 | + | func (x *DBusMessage) Print(IndentVar uint) string { | |
| 454 | + | ||
| 455 | + | cret := xDBusMessagePrint(x.GoPointer(), IndentVar) | |
| 456 | + | return cret | |
| 457 | + | } | |
| 458 | + | ||
| 459 | + | var xDBusMessageSetBody func(uintptr, *glib.Variant) | |
| 460 | + | ||
| 461 | + | // Sets the body @message. As a side-effect the | |
| 462 | + | // %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field is set to the | |
| 463 | + | // type string of @body (or cleared if @body is %NULL). | |
| 464 | + | // | |
| 465 | + | // If @body is floating, @message assumes ownership of @body. | |
| 466 | + | func (x *DBusMessage) SetBody(BodyVar *glib.Variant) { | |
| 467 | + | ||
| 468 | + | xDBusMessageSetBody(x.GoPointer(), BodyVar) | |
| 469 | + | ||
| 470 | + | } | |
| 471 | + | ||
| 472 | + | var xDBusMessageSetByteOrder func(uintptr, DBusMessageByteOrder) | |
| 473 | + | ||
| 474 | + | // Sets the byte order of @message. | |
| 475 | + | func (x *DBusMessage) SetByteOrder(ByteOrderVar DBusMessageByteOrder) { | |
| 476 | + | ||
| 477 | + | xDBusMessageSetByteOrder(x.GoPointer(), ByteOrderVar) | |
| 478 | + | ||
| 479 | + | } | |
| 480 | + | ||
| 481 | + | var xDBusMessageSetDestination func(uintptr, string) | |
| 482 | + | ||
| 483 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_DESTINATION header field. | |
| 484 | + | func (x *DBusMessage) SetDestination(ValueVar string) { | |
| 485 | + | ||
| 486 | + | xDBusMessageSetDestination(x.GoPointer(), ValueVar) | |
| 487 | + | ||
| 488 | + | } | |
| 489 | + | ||
| 490 | + | var xDBusMessageSetErrorName func(uintptr, string) | |
| 491 | + | ||
| 492 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field. | |
| 493 | + | func (x *DBusMessage) SetErrorName(ValueVar string) { | |
| 494 | + | ||
| 495 | + | xDBusMessageSetErrorName(x.GoPointer(), ValueVar) | |
| 496 | + | ||
| 497 | + | } | |
| 498 | + | ||
| 499 | + | var xDBusMessageSetFlags func(uintptr, DBusMessageFlags) | |
| 500 | + | ||
| 501 | + | // Sets the flags to set on @message. | |
| 502 | + | func (x *DBusMessage) SetFlags(FlagsVar DBusMessageFlags) { | |
| 503 | + | ||
| 504 | + | xDBusMessageSetFlags(x.GoPointer(), FlagsVar) | |
| 505 | + | ||
| 506 | + | } | |
| 507 | + | ||
| 508 | + | var xDBusMessageSetHeader func(uintptr, DBusMessageHeaderField, *glib.Variant) | |
| 509 | + | ||
| 510 | + | // Sets a header field on @message. | |
| 511 | + | // | |
| 512 | + | // If @value is floating, @message assumes ownership of @value. | |
| 513 | + | func (x *DBusMessage) SetHeader(HeaderFieldVar DBusMessageHeaderField, ValueVar *glib.Variant) { | |
| 514 | + | ||
| 515 | + | xDBusMessageSetHeader(x.GoPointer(), HeaderFieldVar, ValueVar) | |
| 516 | + | ||
| 517 | + | } | |
| 518 | + | ||
| 519 | + | var xDBusMessageSetInterface func(uintptr, string) | |
| 520 | + | ||
| 521 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_INTERFACE header field. | |
| 522 | + | func (x *DBusMessage) SetInterface(ValueVar string) { | |
| 523 | + | ||
| 524 | + | xDBusMessageSetInterface(x.GoPointer(), ValueVar) | |
| 525 | + | ||
| 526 | + | } | |
| 527 | + | ||
| 528 | + | var xDBusMessageSetMember func(uintptr, string) | |
| 529 | + | ||
| 530 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_MEMBER header field. | |
| 531 | + | func (x *DBusMessage) SetMember(ValueVar string) { | |
| 532 | + | ||
| 533 | + | xDBusMessageSetMember(x.GoPointer(), ValueVar) | |
| 534 | + | ||
| 535 | + | } | |
| 536 | + | ||
| 537 | + | var xDBusMessageSetMessageType func(uintptr, DBusMessageType) | |
| 538 | + | ||
| 539 | + | // Sets @message to be of @type. | |
| 540 | + | func (x *DBusMessage) SetMessageType(TypeVar DBusMessageType) { | |
| 541 | + | ||
| 542 | + | xDBusMessageSetMessageType(x.GoPointer(), TypeVar) | |
| 543 | + | ||
| 544 | + | } | |
| 545 | + | ||
| 546 | + | var xDBusMessageSetNumUnixFds func(uintptr, uint32) | |
| 547 | + | ||
| 548 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header field. | |
| 549 | + | func (x *DBusMessage) SetNumUnixFds(ValueVar uint32) { | |
| 550 | + | ||
| 551 | + | xDBusMessageSetNumUnixFds(x.GoPointer(), ValueVar) | |
| 552 | + | ||
| 553 | + | } | |
| 554 | + | ||
| 555 | + | var xDBusMessageSetPath func(uintptr, string) | |
| 556 | + | ||
| 557 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_PATH header field. | |
| 558 | + | func (x *DBusMessage) SetPath(ValueVar string) { | |
| 559 | + | ||
| 560 | + | xDBusMessageSetPath(x.GoPointer(), ValueVar) | |
| 561 | + | ||
| 562 | + | } | |
| 563 | + | ||
| 564 | + | var xDBusMessageSetReplySerial func(uintptr, uint32) | |
| 565 | + | ||
| 566 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_REPLY_SERIAL header field. | |
| 567 | + | func (x *DBusMessage) SetReplySerial(ValueVar uint32) { | |
| 568 | + | ||
| 569 | + | xDBusMessageSetReplySerial(x.GoPointer(), ValueVar) | |
| 570 | + | ||
| 571 | + | } | |
| 572 | + | ||
| 573 | + | var xDBusMessageSetSender func(uintptr, string) | |
| 574 | + | ||
| 575 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SENDER header field. | |
| 576 | + | func (x *DBusMessage) SetSender(ValueVar string) { | |
| 577 | + | ||
| 578 | + | xDBusMessageSetSender(x.GoPointer(), ValueVar) | |
| 579 | + | ||
| 580 | + | } | |
| 581 | + | ||
| 582 | + | var xDBusMessageSetSerial func(uintptr, uint32) | |
| 583 | + | ||
| 584 | + | // Sets the serial for @message. | |
| 585 | + | // | |
| 586 | + | // The [D-Bus specification](https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages) | |
| 587 | + | // does not allow the @serial to be zero. | |
| 588 | + | func (x *DBusMessage) SetSerial(SerialVar uint32) { | |
| 589 | + | ||
| 590 | + | xDBusMessageSetSerial(x.GoPointer(), SerialVar) | |
| 591 | + | ||
| 592 | + | } | |
| 593 | + | ||
| 594 | + | var xDBusMessageSetSignature func(uintptr, string) | |
| 595 | + | ||
| 596 | + | // Convenience setter for the %G_DBUS_MESSAGE_HEADER_FIELD_SIGNATURE header field. | |
| 597 | + | func (x *DBusMessage) SetSignature(ValueVar string) { | |
| 598 | + | ||
| 599 | + | xDBusMessageSetSignature(x.GoPointer(), ValueVar) | |
| 600 | + | ||
| 601 | + | } | |
| 602 | + | ||
| 603 | + | var xDBusMessageSetUnixFdList func(uintptr, uintptr) | |
| 604 | + | ||
| 605 | + | // Sets the UNIX file descriptors associated with @message. As a | |
| 606 | + | // side-effect the %G_DBUS_MESSAGE_HEADER_FIELD_NUM_UNIX_FDS header | |
| 607 | + | // field is set to the number of fds in @fd_list (or cleared if | |
| 608 | + | // @fd_list is %NULL). | |
| 609 | + | // | |
| 610 | + | // This method is only available on UNIX. | |
| 611 | + | // | |
| 612 | + | // When designing D-Bus APIs that are intended to be interoperable, | |
| 613 | + | // please note that non-GDBus implementations of D-Bus can usually only | |
| 614 | + | // access file descriptors if they are referenced by a value of type | |
| 615 | + | // %G_VARIANT_TYPE_HANDLE in the body of the message. | |
| 616 | + | func (x *DBusMessage) SetUnixFdList(FdListVar *UnixFDList) { | |
| 617 | + | ||
| 618 | + | xDBusMessageSetUnixFdList(x.GoPointer(), FdListVar.GoPointer()) | |
| 619 | + | ||
| 620 | + | } | |
| 621 | + | ||
| 622 | + | var xDBusMessageToBlob func(uintptr, uint, DBusCapabilityFlags, **glib.Error) uintptr | |
| 623 | + | ||
| 624 | + | // Serializes @message to a blob. The byte order returned by | |
| 625 | + | // g_dbus_message_get_byte_order() will be used. | |
| 626 | + | func (x *DBusMessage) ToBlob(OutSizeVar uint, CapabilitiesVar DBusCapabilityFlags) (uintptr, error) { | |
| 627 | + | var cerr *glib.Error | |
| 628 | + | ||
| 629 | + | cret := xDBusMessageToBlob(x.GoPointer(), OutSizeVar, CapabilitiesVar, &cerr) | |
| 630 | + | if cerr == nil { | |
| 631 | + | return cret, nil | |
| 632 | + | } | |
| 633 | + | return cret, cerr | |
| 634 | + | ||
| 635 | + | } | |
| 636 | + | ||
| 637 | + | var xDBusMessageToGerror func(uintptr) bool | |
| 638 | + | ||
| 639 | + | // If @message is not of type %G_DBUS_MESSAGE_TYPE_ERROR does | |
| 640 | + | // nothing and returns %FALSE. | |
| 641 | + | // | |
| 642 | + | // Otherwise this method encodes the error in @message as a #GError | |
| 643 | + | // using g_dbus_error_set_dbus_error() using the information in the | |
| 644 | + | // %G_DBUS_MESSAGE_HEADER_FIELD_ERROR_NAME header field of @message as | |
| 645 | + | // well as the first string item in @message's body. | |
| 646 | + | func (x *DBusMessage) ToGerror() (bool, error) { | |
| 647 | + | var cerr *glib.Error | |
| 648 | + | ||
| 649 | + | cret := xDBusMessageToGerror(x.GoPointer()) | |
| 650 | + | if cerr == nil { | |
| 651 | + | return cret, nil | |
| 652 | + | } | |
| 653 | + | return cret, cerr | |
| 654 | + | ||
| 655 | + | } | |
| 656 | + | ||
| 657 | + | func (c *DBusMessage) GoPointer() uintptr { | |
| 658 | + | if c == nil { | |
| 659 | + | return 0 | |
| 660 | + | } | |
| 661 | + | return c.Ptr | |
| 662 | + | } | |
| 663 | + | ||
| 664 | + | func (c *DBusMessage) SetGoPointer(ptr uintptr) { | |
| 665 | + | c.Ptr = ptr | |
| 666 | + | } | |
| 667 | + | ||
| 668 | + | var xDBusMessageBytesNeeded func([]byte, uint, **glib.Error) int | |
| 669 | + | ||
| 670 | + | // Utility function to calculate how many bytes are needed to | |
| 671 | + | // completely deserialize the D-Bus message stored at @blob. | |
| 672 | + | func DBusMessageBytesNeeded(BlobVar []byte, BlobLenVar uint) (int, error) { | |
| 673 | + | var cerr *glib.Error | |
| 674 | + | ||
| 675 | + | cret := xDBusMessageBytesNeeded(BlobVar, BlobLenVar, &cerr) | |
| 676 | + | if cerr == nil { | |
| 677 | + | return cret, nil | |
| 678 | + | } | |
| 679 | + | return cret, cerr | |
| 680 | + | ||
| 681 | + | } | |
| 682 | + | ||
| 683 | + | func init() { | |
| 684 | + | core.SetPackageName("GIO", "gio-2.0") | |
| 685 | + | core.SetSharedLibrary("GIO", "libgio-2.0.so.0") | |
| 686 | + | lib, err := purego.Dlopen(core.GetPath("GIO"), purego.RTLD_NOW|purego.RTLD_GLOBAL) | |
| 687 | + | if err != nil { | |
| 688 | + | panic(err) | |
| 689 | + | } | |
| 690 | + | ||
| 691 | + | core.PuregoSafeRegister(&xDBusMessageGLibType, lib, "g_dbus_message_get_type") | |
| 692 | + | ||
| 693 | + | core.PuregoSafeRegister(&xNewDBusMessage, lib, "g_dbus_message_new") | |
| 694 | + | core.PuregoSafeRegister(&xNewDBusMessageFromBlob, lib, "g_dbus_message_new_from_blob") | |
| 695 | + | core.PuregoSafeRegister(&xNewDBusMessageMethodCall, lib, "g_dbus_message_new_method_call") | |
| 696 | + | core.PuregoSafeRegister(&xNewDBusMessageSignal, lib, "g_dbus_message_new_signal") | |
| 697 | + | ||
| 698 | + | core.PuregoSafeRegister(&xDBusMessageCopy, lib, "g_dbus_message_copy") | |
| 699 | + | core.PuregoSafeRegister(&xDBusMessageGetArg0, lib, "g_dbus_message_get_arg0") | |
| 700 | + | core.PuregoSafeRegister(&xDBusMessageGetArg0Path, lib, "g_dbus_message_get_arg0_path") | |
| 701 | + | core.PuregoSafeRegister(&xDBusMessageGetBody, lib, "g_dbus_message_get_body") | |
| 702 | + | core.PuregoSafeRegister(&xDBusMessageGetByteOrder, lib, "g_dbus_message_get_byte_order") | |
| 703 | + | core.PuregoSafeRegister(&xDBusMessageGetDestination, lib, "g_dbus_message_get_destination") | |
| 704 | + | core.PuregoSafeRegister(&xDBusMessageGetErrorName, lib, "g_dbus_message_get_error_name") | |
| 705 | + | core.PuregoSafeRegister(&xDBusMessageGetFlags, lib, "g_dbus_message_get_flags") | |
| 706 | + | core.PuregoSafeRegister(&xDBusMessageGetHeader, lib, "g_dbus_message_get_header") | |
| 707 | + | core.PuregoSafeRegister(&xDBusMessageGetHeaderFields, lib, "g_dbus_message_get_header_fields") | |
| 708 | + | core.PuregoSafeRegister(&xDBusMessageGetInterface, lib, "g_dbus_message_get_interface") | |
| 709 | + | core.PuregoSafeRegister(&xDBusMessageGetLocked, lib, "g_dbus_message_get_locked") | |
| 710 | + | core.PuregoSafeRegister(&xDBusMessageGetMember, lib, "g_dbus_message_get_member") | |
| 711 | + | core.PuregoSafeRegister(&xDBusMessageGetMessageType, lib, "g_dbus_message_get_message_type") | |
| 712 | + | core.PuregoSafeRegister(&xDBusMessageGetNumUnixFds, lib, "g_dbus_message_get_num_unix_fds") | |
| 713 | + | core.PuregoSafeRegister(&xDBusMessageGetPath, lib, "g_dbus_message_get_path") | |
| 714 | + | core.PuregoSafeRegister(&xDBusMessageGetReplySerial, lib, "g_dbus_message_get_reply_serial") | |
| 715 | + | core.PuregoSafeRegister(&xDBusMessageGetSender, lib, "g_dbus_message_get_sender") | |
| 716 | + | core.PuregoSafeRegister(&xDBusMessageGetSerial, lib, "g_dbus_message_get_serial") | |
| 717 | + | core.PuregoSafeRegister(&xDBusMessageGetSignature, lib, "g_dbus_message_get_signature") | |
| 718 | + | core.PuregoSafeRegister(&xDBusMessageGetUnixFdList, lib, "g_dbus_message_get_unix_fd_list") | |
| 719 | + | core.PuregoSafeRegister(&xDBusMessageLock, lib, "g_dbus_message_lock") | |
| 720 | + | core.PuregoSafeRegister(&xDBusMessageNewMethodError, lib, "g_dbus_message_new_method_error") | |
| 721 | + | core.PuregoSafeRegister(&xDBusMessageNewMethodErrorLiteral, lib, "g_dbus_message_new_method_error_literal") | |
| 722 | + | core.PuregoSafeRegister(&xDBusMessageNewMethodErrorValist, lib, "g_dbus_message_new_method_error_valist") | |
| 723 | + | core.PuregoSafeRegister(&xDBusMessageNewMethodReply, lib, "g_dbus_message_new_method_reply") | |
| 724 | + | core.PuregoSafeRegister(&xDBusMessagePrint, lib, "g_dbus_message_print") | |
| 725 | + | core.PuregoSafeRegister(&xDBusMessageSetBody, lib, "g_dbus_message_set_body") | |
| 726 | + | core.PuregoSafeRegister(&xDBusMessageSetByteOrder, lib, "g_dbus_message_set_byte_order") | |
| 727 | + | core.PuregoSafeRegister(&xDBusMessageSetDestination, lib, "g_dbus_message_set_destination") | |
| 728 | + | core.PuregoSafeRegister(&xDBusMessageSetErrorName, lib, "g_dbus_message_set_error_name") | |
| 729 | + | core.PuregoSafeRegister(&xDBusMessageSetFlags, lib, "g_dbus_message_set_flags") | |
| 730 | + | core.PuregoSafeRegister(&xDBusMessageSetHeader, lib, "g_dbus_message_set_header") | |
| 731 | + | core.PuregoSafeRegister(&xDBusMessageSetInterface, lib, "g_dbus_message_set_interface") | |
| 732 | + | core.PuregoSafeRegister(&xDBusMessageSetMember, lib, "g_dbus_message_set_member") | |
| 733 | + | core.PuregoSafeRegister(&xDBusMessageSetMessageType, lib, "g_dbus_message_set_message_type") | |
| 734 | + | core.PuregoSafeRegister(&xDBusMessageSetNumUnixFds, lib, "g_dbus_message_set_num_unix_fds") | |
| 735 | + | core.PuregoSafeRegister(&xDBusMessageSetPath, lib, "g_dbus_message_set_path") | |
| 736 | + | core.PuregoSafeRegister(&xDBusMessageSetReplySerial, lib, "g_dbus_message_set_reply_serial") | |
| 737 | + | core.PuregoSafeRegister(&xDBusMessageSetSender, lib, "g_dbus_message_set_sender") | |
| 738 | + | core.PuregoSafeRegister(&xDBusMessageSetSerial, lib, "g_dbus_message_set_serial") | |
| 739 | + | core.PuregoSafeRegister(&xDBusMessageSetSignature, lib, "g_dbus_message_set_signature") | |
| 740 | + | core.PuregoSafeRegister(&xDBusMessageSetUnixFdList, lib, "g_dbus_message_set_unix_fd_list") | |
| 741 | + | core.PuregoSafeRegister(&xDBusMessageToBlob, lib, "g_dbus_message_to_blob") | |
| 742 | + | core.PuregoSafeRegister(&xDBusMessageToGerror, lib, "g_dbus_message_to_gerror") | |
| 743 | + | ||
| 744 | + | core.PuregoSafeRegister(&xDBusMessageBytesNeeded, lib, "g_dbus_message_bytes_needed") | |
| 745 | + | ||
| 746 | + | } | |
M v4/gio/gdbusmethodinvocation.go +371 -0 collapsed to keep the page light
M v4/gio/gdbusnameowning.go +31 -29
| @@ -19,37 +19,38 @@ type BusNameLostCallback func(uintptr, string, uintptr) | |||
| 19 | 19 | ||
| 20 | 20 | var xBusOwnName func(BusType, string, BusNameOwnerFlags, uintptr, uintptr, uintptr, uintptr, uintptr) uint | |
| 21 | 21 | ||
| 22 | - | // Starts acquiring @name on the bus specified by @bus_type and calls | |
| 23 | - | // @name_acquired_handler and @name_lost_handler when the name is | |
| 24 | - | // acquired respectively lost. Callbacks will be invoked in the | |
| 25 | - | // [thread-default main context][g-main-context-push-thread-default] | |
| 22 | + | // Requests ownership of @name on the bus specified by @bus_type. | |
| 23 | + | // | |
| 24 | + | // It asynchronously calls @name_acquired_handler and @name_lost_handler when | |
| 25 | + | // the name is acquired and lost, respectively. | |
| 26 | + | // | |
| 27 | + | // Callbacks will be invoked in the thread-default | |
| 28 | + | // main context (see [method@GLib.MainContext.push_thread_default]) | |
| 26 | 29 | // of the thread you are calling this function from. | |
| 27 | 30 | // | |
| 28 | 31 | // You are guaranteed that one of the @name_acquired_handler and @name_lost_handler | |
| 29 | - | // callbacks will be invoked after calling this function - there are three | |
| 32 | + | // callbacks will be invoked after calling this function — there are three | |
| 30 | 33 | // possible cases: | |
| 31 | 34 | // | |
| 32 | - | // - @name_lost_handler with a %NULL connection (if a connection to the bus | |
| 33 | - | // can't be made). | |
| 34 | - | // | |
| 35 | - | // - @bus_acquired_handler then @name_lost_handler (if the name can't be | |
| 36 | - | // obtained) | |
| 37 | - | // | |
| 35 | + | // - @name_lost_handler with a `NULL` connection (if a connection to the bus | |
| 36 | + | // can’t be made). | |
| 37 | + | // - @bus_acquired_handler then @name_lost_handler (if the name can’t be | |
| 38 | + | // obtained). | |
| 38 | 39 | // - @bus_acquired_handler then @name_acquired_handler (if the name was | |
| 39 | 40 | // obtained). | |
| 40 | 41 | // | |
| 41 | - | // When you are done owning the name, just call g_bus_unown_name() | |
| 42 | - | // with the owner id this function returns. | |
| 42 | + | // When you are done owning the name, call [func@Gio.bus_unown_name] with the | |
| 43 | + | // owner ID this function returns. | |
| 43 | 44 | // | |
| 44 | 45 | // If the name is acquired or lost (for example another application | |
| 45 | 46 | // could acquire the name if you allow replacement or the application | |
| 46 | 47 | // currently owning the name exits), the handlers are also invoked. | |
| 47 | - | // If the #GDBusConnection that is used for attempting to own the name | |
| 48 | + | // If the [class@Gio.DBusConnection] that is used for attempting to own the name | |
| 48 | 49 | // closes, then @name_lost_handler is invoked since it is no longer | |
| 49 | 50 | // possible for other processes to access the process. | |
| 50 | 51 | // | |
| 51 | - | // You cannot use g_bus_own_name() several times for the same name (unless | |
| 52 | - | // interleaved with calls to g_bus_unown_name()) - only the first call | |
| 52 | + | // You cannot use [func@Gio.bus_own_name] several times for the same name (unless | |
| 53 | + | // interleaved with calls to [func@Gio.bus_unown_name]) — only the first call | |
| 53 | 54 | // will work. | |
| 54 | 55 | // | |
| 55 | 56 | // Another guarantee is that invocations of @name_acquired_handler | |
| @@ -58,14 +59,14 @@ var xBusOwnName func(BusType, string, BusNameOwnerFlags, uintptr, uintptr, uintp | |||
| 58 | 59 | // guaranteed that the next time one of the handlers is invoked, it | |
| 59 | 60 | // will be @name_lost_handler. The reverse is also true. | |
| 60 | 61 | // | |
| 61 | - | // If you plan on exporting objects (using e.g. | |
| 62 | - | // g_dbus_connection_register_object()), note that it is generally too late | |
| 62 | + | // If you plan on exporting objects (using, for example, | |
| 63 | + | // [method@Gio.DBusConnection.register_object]), note that it is generally too late | |
| 63 | 64 | // to export the objects in @name_acquired_handler. Instead, you can do this | |
| 64 | 65 | // in @bus_acquired_handler since you are guaranteed that this will run | |
| 65 | 66 | // before @name is requested from the bus. | |
| 66 | 67 | // | |
| 67 | - | // This behavior makes it very simple to write applications that wants | |
| 68 | - | // to [own names][gdbus-owning-names] and export objects. | |
| 68 | + | // This behavior makes it very simple to write applications that want | |
| 69 | + | // to [own names](dbus-name-owning.html#d-bus-name-owning) and export objects. | |
| 69 | 70 | // Simply register objects to be exported in @bus_acquired_handler and | |
| 70 | 71 | // unregister the objects (if any) in @name_lost_handler. | |
| 71 | 72 | func BusOwnName(BusTypeVar BusType, NameVar string, FlagsVar BusNameOwnerFlags, BusAcquiredHandlerVar *BusAcquiredCallback, NameAcquiredHandlerVar *BusNameAcquiredCallback, NameLostHandlerVar *BusNameLostCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| @@ -76,8 +77,8 @@ func BusOwnName(BusTypeVar BusType, NameVar string, FlagsVar BusNameOwnerFlags, | |||
| 76 | 77 | ||
| 77 | 78 | var xBusOwnNameOnConnection func(uintptr, string, BusNameOwnerFlags, uintptr, uintptr, uintptr, uintptr) uint | |
| 78 | 79 | ||
| 79 | - | // Like g_bus_own_name() but takes a #GDBusConnection instead of a | |
| 80 | - | // #GBusType. | |
| 80 | + | // Like [func@Gio.bus_own_name] but takes a [class@Gio.DBusConnection] instead | |
| 81 | + | // of a [enum@Gio.BusType]. | |
| 81 | 82 | func BusOwnNameOnConnection(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameOwnerFlags, NameAcquiredHandlerVar *BusNameAcquiredCallback, NameLostHandlerVar *BusNameLostCallback, UserDataVar uintptr, UserDataFreeFuncVar *glib.DestroyNotify) uint { | |
| 82 | 83 | ||
| 83 | 84 | cret := xBusOwnNameOnConnection(ConnectionVar.GoPointer(), NameVar, FlagsVar, glib.NewCallbackNullable(NameAcquiredHandlerVar), glib.NewCallbackNullable(NameLostHandlerVar), UserDataVar, glib.NewCallbackNullable(UserDataFreeFuncVar)) | |
| @@ -86,7 +87,7 @@ func BusOwnNameOnConnection(ConnectionVar *DBusConnection, NameVar string, Flags | |||
| 86 | 87 | ||
| 87 | 88 | var xBusOwnNameOnConnectionWithClosures func(uintptr, string, BusNameOwnerFlags, *gobject.Closure, *gobject.Closure) uint | |
| 88 | 89 | ||
| 89 | - | // Version of g_bus_own_name_on_connection() using closures instead of | |
| 90 | + | // Version of [func@Gio.bus_own_name_on_connection] using closures instead of | |
| 90 | 91 | // callbacks for easier binding in other languages. | |
| 91 | 92 | func BusOwnNameOnConnectionWithClosures(ConnectionVar *DBusConnection, NameVar string, FlagsVar BusNameOwnerFlags, NameAcquiredClosureVar *gobject.Closure, NameLostClosureVar *gobject.Closure) uint { | |
| 92 | 93 | ||
| @@ -96,7 +97,7 @@ func BusOwnNameOnConnectionWithClosures(ConnectionVar *DBusConnection, NameVar s | |||
| 96 | 97 | ||
| 97 | 98 | var xBusOwnNameWithClosures func(BusType, string, BusNameOwnerFlags, *gobject.Closure, *gobject.Closure, *gobject.Closure) uint | |
| 98 | 99 | ||
| 99 | - | // Version of g_bus_own_name() using closures instead of callbacks for | |
| 100 | + | // Version of [func@Gio.bus_own_name using closures instead of callbacks for | |
| 100 | 101 | // easier binding in other languages. | |
| 101 | 102 | func BusOwnNameWithClosures(BusTypeVar BusType, NameVar string, FlagsVar BusNameOwnerFlags, BusAcquiredClosureVar *gobject.Closure, NameAcquiredClosureVar *gobject.Closure, NameLostClosureVar *gobject.Closure) uint { | |
| 102 | 103 | ||
| @@ -109,11 +110,12 @@ var xBusUnownName func(uint) | |||
| 109 | 110 | // Stops owning a name. | |
| 110 | 111 | // | |
| 111 | 112 | // Note that there may still be D-Bus traffic to process (relating to owning | |
| 112 | - | // and unowning the name) in the current thread-default #GMainContext after | |
| 113 | - | // this function has returned. You should continue to iterate the #GMainContext | |
| 114 | - | // until the #GDestroyNotify function passed to g_bus_own_name() is called, in | |
| 115 | - | // order to avoid memory leaks through callbacks queued on the #GMainContext | |
| 116 | - | // after it’s stopped being iterated. | |
| 113 | + | // and unowning the name) in the current thread-default | |
| 114 | + | // [struct@GLib.MainContext] after this function has returned. You should | |
| 115 | + | // continue to iterate the [struct@GLib.MainContext] until the | |
| 116 | + | // [callback@GLib.DestroyNotify] function passed to [func@Gio.bus_own_name] is | |
| 117 | + | // called, in order to avoid memory leaks through callbacks queued on the | |
| 118 | + | // [struct@GLib.MainContext] after it’s stopped being iterated. | |
| 117 | 119 | func BusUnownName(OwnerIdVar uint) { | |
| 118 | 120 | ||
| 119 | 121 | xBusUnownName(OwnerIdVar) | |
M v4/gio/gdbusnamewatching.go +3 -3
| @@ -39,8 +39,8 @@ var xBusWatchName func(BusType, string, BusNameWatcherFlags, uintptr, uintptr, u | |||
| 39 | 39 | // Starts watching @name on the bus specified by @bus_type and calls | |
| 40 | 40 | // @name_appeared_handler and @name_vanished_handler when the name is | |
| 41 | 41 | // known to have an owner respectively known to lose its | |
| 42 | - | // owner. Callbacks will be invoked in the | |
| 43 | - | // [thread-default main context][g-main-context-push-thread-default] | |
| 42 | + | // owner. Callbacks will be invoked in the thread-default main context | |
| 43 | + | // (see [method@GLib.MainContext.push_thread_default]) | |
| 44 | 44 | // of the thread you are calling this function from. | |
| 45 | 45 | // | |
| 46 | 46 | // You are guaranteed that one of the handlers will be invoked after | |
| @@ -61,7 +61,7 @@ var xBusWatchName func(BusType, string, BusNameWatcherFlags, uintptr, uintptr, u | |||
| 61 | 61 | // will be @name_vanished_handler. The reverse is also true. | |
| 62 | 62 | // | |
| 63 | 63 | // This behavior makes it very simple to write applications that want | |
| 64 | - | // to take action when a certain [name exists][gdbus-watching-names]. | |
| 64 | + | // to take action when a certain [name exists](dbus-name-watching.html#d-bus-name-watching). | |
| 65 | 65 | // Basically, the application should create object proxies in | |
| 66 | 66 | // @name_appeared_handler and destroy them again (if any) in | |
| 67 | 67 | // @name_vanished_handler. | |
M v4/gio/gdbusobject.go +13 -3
| @@ -33,6 +33,7 @@ func (x *DBusObjectIface) GoPointer() uintptr { | |||
| 33 | 33 | } | |
| 34 | 34 | ||
| 35 | 35 | // OverrideGetObjectPath sets the callback function. | |
| 36 | + | // Returns the object path. See g_dbus_object_get_object_path(). | |
| 36 | 37 | func (x *DBusObjectIface) OverrideGetObjectPath(cb func(DBusObject) string) { | |
| 37 | 38 | if cb == nil { | |
| 38 | 39 | x.xGetObjectPath = 0 | |
| @@ -44,6 +45,7 @@ func (x *DBusObjectIface) OverrideGetObjectPath(cb func(DBusObject) string) { | |||
| 44 | 45 | } | |
| 45 | 46 | ||
| 46 | 47 | // GetGetObjectPath gets the callback function. | |
| 48 | + | // Returns the object path. See g_dbus_object_get_object_path(). | |
| 47 | 49 | func (x *DBusObjectIface) GetGetObjectPath() func(DBusObject) string { | |
| 48 | 50 | if x.xGetObjectPath == 0 { | |
| 49 | 51 | return nil | |
| @@ -56,6 +58,7 @@ func (x *DBusObjectIface) GetGetObjectPath() func(DBusObject) string { | |||
| 56 | 58 | } | |
| 57 | 59 | ||
| 58 | 60 | // OverrideGetInterfaces sets the callback function. | |
| 61 | + | // Returns all interfaces. See g_dbus_object_get_interfaces(). | |
| 59 | 62 | func (x *DBusObjectIface) OverrideGetInterfaces(cb func(DBusObject) *glib.List) { | |
| 60 | 63 | if cb == nil { | |
| 61 | 64 | x.xGetInterfaces = 0 | |
| @@ -67,6 +70,7 @@ func (x *DBusObjectIface) OverrideGetInterfaces(cb func(DBusObject) *glib.List) | |||
| 67 | 70 | } | |
| 68 | 71 | ||
| 69 | 72 | // GetGetInterfaces gets the callback function. | |
| 73 | + | // Returns all interfaces. See g_dbus_object_get_interfaces(). | |
| 70 | 74 | func (x *DBusObjectIface) GetGetInterfaces() func(DBusObject) *glib.List { | |
| 71 | 75 | if x.xGetInterfaces == 0 { | |
| 72 | 76 | return nil | |
| @@ -79,6 +83,7 @@ func (x *DBusObjectIface) GetGetInterfaces() func(DBusObject) *glib.List { | |||
| 79 | 83 | } | |
| 80 | 84 | ||
| 81 | 85 | // OverrideGetInterface sets the callback function. | |
| 86 | + | // Returns an interface by name. See g_dbus_object_get_interface(). | |
| 82 | 87 | func (x *DBusObjectIface) OverrideGetInterface(cb func(DBusObject, string) *DBusInterfaceBase) { | |
| 83 | 88 | if cb == nil { | |
| 84 | 89 | x.xGetInterface = 0 | |
| @@ -94,6 +99,7 @@ func (x *DBusObjectIface) OverrideGetInterface(cb func(DBusObject, string) *DBus | |||
| 94 | 99 | } | |
| 95 | 100 | ||
| 96 | 101 | // GetGetInterface gets the callback function. | |
| 102 | + | // Returns an interface by name. See g_dbus_object_get_interface(). | |
| 97 | 103 | func (x *DBusObjectIface) GetGetInterface() func(DBusObject, string) *DBusInterfaceBase { | |
| 98 | 104 | if x.xGetInterface == 0 { | |
| 99 | 105 | return nil | |
| @@ -112,6 +118,7 @@ func (x *DBusObjectIface) GetGetInterface() func(DBusObject, string) *DBusInterf | |||
| 112 | 118 | } | |
| 113 | 119 | ||
| 114 | 120 | // OverrideInterfaceAdded sets the callback function. | |
| 121 | + | // Signal handler for the #GDBusObject::interface-added signal. | |
| 115 | 122 | func (x *DBusObjectIface) OverrideInterfaceAdded(cb func(DBusObject, DBusInterface)) { | |
| 116 | 123 | if cb == nil { | |
| 117 | 124 | x.xInterfaceAdded = 0 | |
| @@ -123,6 +130,7 @@ func (x *DBusObjectIface) OverrideInterfaceAdded(cb func(DBusObject, DBusInterfa | |||
| 123 | 130 | } | |
| 124 | 131 | ||
| 125 | 132 | // GetInterfaceAdded gets the callback function. | |
| 133 | + | // Signal handler for the #GDBusObject::interface-added signal. | |
| 126 | 134 | func (x *DBusObjectIface) GetInterfaceAdded() func(DBusObject, DBusInterface) { | |
| 127 | 135 | if x.xInterfaceAdded == 0 { | |
| 128 | 136 | return nil | |
| @@ -135,6 +143,7 @@ func (x *DBusObjectIface) GetInterfaceAdded() func(DBusObject, DBusInterface) { | |||
| 135 | 143 | } | |
| 136 | 144 | ||
| 137 | 145 | // OverrideInterfaceRemoved sets the callback function. | |
| 146 | + | // Signal handler for the #GDBusObject::interface-removed signal. | |
| 138 | 147 | func (x *DBusObjectIface) OverrideInterfaceRemoved(cb func(DBusObject, DBusInterface)) { | |
| 139 | 148 | if cb == nil { | |
| 140 | 149 | x.xInterfaceRemoved = 0 | |
| @@ -146,6 +155,7 @@ func (x *DBusObjectIface) OverrideInterfaceRemoved(cb func(DBusObject, DBusInter | |||
| 146 | 155 | } | |
| 147 | 156 | ||
| 148 | 157 | // GetInterfaceRemoved gets the callback function. | |
| 158 | + | // Signal handler for the #GDBusObject::interface-removed signal. | |
| 149 | 159 | func (x *DBusObjectIface) GetInterfaceRemoved() func(DBusObject, DBusInterface) { | |
| 150 | 160 | if x.xInterfaceRemoved == 0 { | |
| 151 | 161 | return nil | |
| @@ -157,9 +167,9 @@ func (x *DBusObjectIface) GetInterfaceRemoved() func(DBusObject, DBusInterface) | |||
| 157 | 167 | } | |
| 158 | 168 | } | |
| 159 | 169 | ||
| 160 | - | // The #GDBusObject type is the base type for D-Bus objects on both | |
| 161 | - | // the service side (see #GDBusObjectSkeleton) and the client side | |
| 162 | - | // (see #GDBusObjectProxy). It is essentially just a container of | |
| 170 | + | // The `GDBusObject` type is the base type for D-Bus objects on both | |
| 171 | + | // the service side (see [class@Gio.DBusObjectSkeleton]) and the client side | |
| 172 | + | // (see [class@Gio.DBusObjectProxy]). It is essentially just a container of | |
| 163 | 173 | // interfaces. | |
| 164 | 174 | type DBusObject interface { | |
| 165 | 175 | GoPointer() uintptr | |
M v4/gio/gdbusobjectmanager.go +20 -4
| @@ -39,6 +39,7 @@ func (x *DBusObjectManagerIface) GoPointer() uintptr { | |||
| 39 | 39 | } | |
| 40 | 40 | ||
| 41 | 41 | // OverrideGetObjectPath sets the callback function. | |
| 42 | + | // Virtual function for g_dbus_object_manager_get_object_path(). | |
| 42 | 43 | func (x *DBusObjectManagerIface) OverrideGetObjectPath(cb func(DBusObjectManager) string) { | |
| 43 | 44 | if cb == nil { | |
| 44 | 45 | x.xGetObjectPath = 0 | |
| @@ -50,6 +51,7 @@ func (x *DBusObjectManagerIface) OverrideGetObjectPath(cb func(DBusObjectManager | |||
| 50 | 51 | } | |
| 51 | 52 | ||
| 52 | 53 | // GetGetObjectPath gets the callback function. | |
| 54 | + | // Virtual function for g_dbus_object_manager_get_object_path(). | |
| 53 | 55 | func (x *DBusObjectManagerIface) GetGetObjectPath() func(DBusObjectManager) string { | |
| 54 | 56 | if x.xGetObjectPath == 0 { | |
| 55 | 57 | return nil | |
| @@ -62,6 +64,7 @@ func (x *DBusObjectManagerIface) GetGetObjectPath() func(DBusObjectManager) stri | |||
| 62 | 64 | } | |
| 63 | 65 | ||
| 64 | 66 | // OverrideGetObjects sets the callback function. | |
| 67 | + | // Virtual function for g_dbus_object_manager_get_objects(). | |
| 65 | 68 | func (x *DBusObjectManagerIface) OverrideGetObjects(cb func(DBusObjectManager) *glib.List) { | |
| 66 | 69 | if cb == nil { | |
| 67 | 70 | x.xGetObjects = 0 | |
| @@ -73,6 +76,7 @@ func (x *DBusObjectManagerIface) OverrideGetObjects(cb func(DBusObjectManager) * | |||
| 73 | 76 | } | |
| 74 | 77 | ||
| 75 | 78 | // GetGetObjects gets the callback function. | |
| 79 | + | // Virtual function for g_dbus_object_manager_get_objects(). | |
| 76 | 80 | func (x *DBusObjectManagerIface) GetGetObjects() func(DBusObjectManager) *glib.List { | |
| 77 | 81 | if x.xGetObjects == 0 { | |
| 78 | 82 | return nil | |
| @@ -85,6 +89,7 @@ func (x *DBusObjectManagerIface) GetGetObjects() func(DBusObjectManager) *glib.L | |||
| 85 | 89 | } | |
| 86 | 90 | ||
| 87 | 91 | // OverrideGetObject sets the callback function. | |
| 92 | + | // Virtual function for g_dbus_object_manager_get_object(). | |
| 88 | 93 | func (x *DBusObjectManagerIface) OverrideGetObject(cb func(DBusObjectManager, string) *DBusObjectBase) { | |
| 89 | 94 | if cb == nil { | |
| 90 | 95 | x.xGetObject = 0 | |
| @@ -100,6 +105,7 @@ func (x *DBusObjectManagerIface) OverrideGetObject(cb func(DBusObjectManager, st | |||
| 100 | 105 | } | |
| 101 | 106 | ||
| 102 | 107 | // GetGetObject gets the callback function. | |
| 108 | + | // Virtual function for g_dbus_object_manager_get_object(). | |
| 103 | 109 | func (x *DBusObjectManagerIface) GetGetObject() func(DBusObjectManager, string) *DBusObjectBase { | |
| 104 | 110 | if x.xGetObject == 0 { | |
| 105 | 111 | return nil | |
| @@ -118,6 +124,7 @@ func (x *DBusObjectManagerIface) GetGetObject() func(DBusObjectManager, string) | |||
| 118 | 124 | } | |
| 119 | 125 | ||
| 120 | 126 | // OverrideGetInterface sets the callback function. | |
| 127 | + | // Virtual function for g_dbus_object_manager_get_interface(). | |
| 121 | 128 | func (x *DBusObjectManagerIface) OverrideGetInterface(cb func(DBusObjectManager, string, string) *DBusInterfaceBase) { | |
| 122 | 129 | if cb == nil { | |
| 123 | 130 | x.xGetInterface = 0 | |
| @@ -133,6 +140,7 @@ func (x *DBusObjectManagerIface) OverrideGetInterface(cb func(DBusObjectManager, | |||
| 133 | 140 | } | |
| 134 | 141 | ||
| 135 | 142 | // GetGetInterface gets the callback function. | |
| 143 | + | // Virtual function for g_dbus_object_manager_get_interface(). | |
| 136 | 144 | func (x *DBusObjectManagerIface) GetGetInterface() func(DBusObjectManager, string, string) *DBusInterfaceBase { | |
| 137 | 145 | if x.xGetInterface == 0 { | |
| 138 | 146 | return nil | |
| @@ -151,6 +159,7 @@ func (x *DBusObjectManagerIface) GetGetInterface() func(DBusObjectManager, strin | |||
| 151 | 159 | } | |
| 152 | 160 | ||
| 153 | 161 | // OverrideObjectAdded sets the callback function. | |
| 162 | + | // Signal handler for the #GDBusObjectManager::object-added signal. | |
| 154 | 163 | func (x *DBusObjectManagerIface) OverrideObjectAdded(cb func(DBusObjectManager, DBusObject)) { | |
| 155 | 164 | if cb == nil { | |
| 156 | 165 | x.xObjectAdded = 0 | |
| @@ -162,6 +171,7 @@ func (x *DBusObjectManagerIface) OverrideObjectAdded(cb func(DBusObjectManager, | |||
| 162 | 171 | } | |
| 163 | 172 | ||
| 164 | 173 | // GetObjectAdded gets the callback function. | |
| 174 | + | // Signal handler for the #GDBusObjectManager::object-added signal. | |
| 165 | 175 | func (x *DBusObjectManagerIface) GetObjectAdded() func(DBusObjectManager, DBusObject) { | |
| 166 | 176 | if x.xObjectAdded == 0 { | |
| 167 | 177 | return nil | |
| @@ -174,6 +184,7 @@ func (x *DBusObjectManagerIface) GetObjectAdded() func(DBusObjectManager, DBusOb | |||
| 174 | 184 | } | |
| 175 | 185 | ||
| 176 | 186 | // OverrideObjectRemoved sets the callback function. | |
| 187 | + | // Signal handler for the #GDBusObjectManager::object-removed signal. | |
| 177 | 188 | func (x *DBusObjectManagerIface) OverrideObjectRemoved(cb func(DBusObjectManager, DBusObject)) { | |
| 178 | 189 | if cb == nil { | |
| 179 | 190 | x.xObjectRemoved = 0 | |
| @@ -185,6 +196,7 @@ func (x *DBusObjectManagerIface) OverrideObjectRemoved(cb func(DBusObjectManager | |||
| 185 | 196 | } | |
| 186 | 197 | ||
| 187 | 198 | // GetObjectRemoved gets the callback function. | |
| 199 | + | // Signal handler for the #GDBusObjectManager::object-removed signal. | |
| 188 | 200 | func (x *DBusObjectManagerIface) GetObjectRemoved() func(DBusObjectManager, DBusObject) { | |
| 189 | 201 | if x.xObjectRemoved == 0 { | |
| 190 | 202 | return nil | |
| @@ -197,6 +209,7 @@ func (x *DBusObjectManagerIface) GetObjectRemoved() func(DBusObjectManager, DBus | |||
| 197 | 209 | } | |
| 198 | 210 | ||
| 199 | 211 | // OverrideInterfaceAdded sets the callback function. | |
| 212 | + | // Signal handler for the #GDBusObjectManager::interface-added signal. | |
| 200 | 213 | func (x *DBusObjectManagerIface) OverrideInterfaceAdded(cb func(DBusObjectManager, DBusObject, DBusInterface)) { | |
| 201 | 214 | if cb == nil { | |
| 202 | 215 | x.xInterfaceAdded = 0 | |
| @@ -208,6 +221,7 @@ func (x *DBusObjectManagerIface) OverrideInterfaceAdded(cb func(DBusObjectManage | |||
| 208 | 221 | } | |
| 209 | 222 | ||
| 210 | 223 | // GetInterfaceAdded gets the callback function. | |
| 224 | + | // Signal handler for the #GDBusObjectManager::interface-added signal. | |
| 211 | 225 | func (x *DBusObjectManagerIface) GetInterfaceAdded() func(DBusObjectManager, DBusObject, DBusInterface) { | |
| 212 | 226 | if x.xInterfaceAdded == 0 { | |
| 213 | 227 | return nil | |
| @@ -220,6 +234,7 @@ func (x *DBusObjectManagerIface) GetInterfaceAdded() func(DBusObjectManager, DBu | |||
| 220 | 234 | } | |
| 221 | 235 | ||
| 222 | 236 | // OverrideInterfaceRemoved sets the callback function. | |
| 237 | + | // Signal handler for the #GDBusObjectManager::interface-removed signal. | |
| 223 | 238 | func (x *DBusObjectManagerIface) OverrideInterfaceRemoved(cb func(DBusObjectManager, DBusObject, DBusInterface)) { | |
| 224 | 239 | if cb == nil { | |
| 225 | 240 | x.xInterfaceRemoved = 0 | |
| @@ -231,6 +246,7 @@ func (x *DBusObjectManagerIface) OverrideInterfaceRemoved(cb func(DBusObjectMana | |||
| 231 | 246 | } | |
| 232 | 247 | ||
| 233 | 248 | // GetInterfaceRemoved gets the callback function. | |
| 249 | + | // Signal handler for the #GDBusObjectManager::interface-removed signal. | |
| 234 | 250 | func (x *DBusObjectManagerIface) GetInterfaceRemoved() func(DBusObjectManager, DBusObject, DBusInterface) { | |
| 235 | 251 | if x.xInterfaceRemoved == 0 { | |
| 236 | 252 | return nil | |
| @@ -242,13 +258,13 @@ func (x *DBusObjectManagerIface) GetInterfaceRemoved() func(DBusObjectManager, D | |||
| 242 | 258 | } | |
| 243 | 259 | } | |
| 244 | 260 | ||
| 245 | - | // The #GDBusObjectManager type is the base type for service- and | |
| 261 | + | // The `GDBusObjectManager` type is the base type for service- and | |
| 246 | 262 | // client-side implementations of the standardized | |
| 247 | - | // [org.freedesktop.DBus.ObjectManager](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) | |
| 263 | + | // [`org.freedesktop.DBus.ObjectManager`](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) | |
| 248 | 264 | // interface. | |
| 249 | 265 | // | |
| 250 | - | // See #GDBusObjectManagerClient for the client-side implementation | |
| 251 | - | // and #GDBusObjectManagerServer for the service-side implementation. | |
| 266 | + | // See [class@Gio.DBusObjectManagerClient] for the client-side implementation | |
| 267 | + | // and [class@Gio.DBusObjectManagerServer] for the service-side implementation. | |
| 252 | 268 | type DBusObjectManager interface { | |
| 253 | 269 | GoPointer() uintptr | |
| 254 | 270 | SetGoPointer(uintptr) | |
M v4/gio/gdbusobjectmanagerclient.go +69 -62
| @@ -30,6 +30,7 @@ func (x *DBusObjectManagerClientClass) GoPointer() uintptr { | |||
| 30 | 30 | } | |
| 31 | 31 | ||
| 32 | 32 | // OverrideInterfaceProxySignal sets the callback function. | |
| 33 | + | // Signal class handler for the #GDBusObjectManagerClient::interface-proxy-signal signal. | |
| 33 | 34 | func (x *DBusObjectManagerClientClass) OverrideInterfaceProxySignal(cb func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, string, string, *glib.Variant)) { | |
| 34 | 35 | if cb == nil { | |
| 35 | 36 | x.xInterfaceProxySignal = 0 | |
| @@ -41,6 +42,7 @@ func (x *DBusObjectManagerClientClass) OverrideInterfaceProxySignal(cb func(*DBu | |||
| 41 | 42 | } | |
| 42 | 43 | ||
| 43 | 44 | // GetInterfaceProxySignal gets the callback function. | |
| 45 | + | // Signal class handler for the #GDBusObjectManagerClient::interface-proxy-signal signal. | |
| 44 | 46 | func (x *DBusObjectManagerClientClass) GetInterfaceProxySignal() func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, string, string, *glib.Variant) { | |
| 45 | 47 | if x.xInterfaceProxySignal == 0 { | |
| 46 | 48 | return nil | |
| @@ -53,6 +55,7 @@ func (x *DBusObjectManagerClientClass) GetInterfaceProxySignal() func(*DBusObjec | |||
| 53 | 55 | } | |
| 54 | 56 | ||
| 55 | 57 | // OverrideInterfaceProxyPropertiesChanged sets the callback function. | |
| 58 | + | // Signal class handler for the #GDBusObjectManagerClient::interface-proxy-properties-changed signal. | |
| 56 | 59 | func (x *DBusObjectManagerClientClass) OverrideInterfaceProxyPropertiesChanged(cb func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, *glib.Variant, string)) { | |
| 57 | 60 | if cb == nil { | |
| 58 | 61 | x.xInterfaceProxyPropertiesChanged = 0 | |
| @@ -64,6 +67,7 @@ func (x *DBusObjectManagerClientClass) OverrideInterfaceProxyPropertiesChanged(c | |||
| 64 | 67 | } | |
| 65 | 68 | ||
| 66 | 69 | // GetInterfaceProxyPropertiesChanged gets the callback function. | |
| 70 | + | // Signal class handler for the #GDBusObjectManagerClient::interface-proxy-properties-changed signal. | |
| 67 | 71 | func (x *DBusObjectManagerClientClass) GetInterfaceProxyPropertiesChanged() func(*DBusObjectManagerClient, *DBusObjectProxy, *DBusProxy, *glib.Variant, string) { | |
| 68 | 72 | if x.xInterfaceProxyPropertiesChanged == 0 { | |
| 69 | 73 | return nil | |
| @@ -83,79 +87,82 @@ func (x *DBusObjectManagerClientPrivate) GoPointer() uintptr { | |||
| 83 | 87 | return uintptr(unsafe.Pointer(x)) | |
| 84 | 88 | } | |
| 85 | 89 | ||
| 86 | - | // #GDBusObjectManagerClient is used to create, monitor and delete object | |
| 87 | - | // proxies for remote objects exported by a #GDBusObjectManagerServer (or any | |
| 88 | - | // code implementing the | |
| 90 | + | // `GDBusObjectManagerClient` is used to create, monitor and delete object | |
| 91 | + | // proxies for remote objects exported by a [class@Gio.DBusObjectManagerServer] | |
| 92 | + | // (or any code implementing the | |
| 89 | 93 | // [org.freedesktop.DBus.ObjectManager](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) | |
| 90 | 94 | // interface). | |
| 91 | 95 | // | |
| 92 | 96 | // Once an instance of this type has been created, you can connect to | |
| 93 | - | // the #GDBusObjectManager::object-added and | |
| 94 | - | // #GDBusObjectManager::object-removed signals and inspect the | |
| 95 | - | // #GDBusObjectProxy objects returned by | |
| 96 | - | // g_dbus_object_manager_get_objects(). | |
| 97 | + | // the [signal@Gio.DBusObjectManager::object-added] and | |
| 98 | + | // [signal@Gio.DBusObjectManager::object-removed signals] and inspect the | |
| 99 | + | // [class@Gio.DBusObjectProxy] objects returned by | |
| 100 | + | // [method@Gio.DBusObjectManager.get_objects]. | |
| 97 | 101 | // | |
| 98 | - | // If the name for a #GDBusObjectManagerClient is not owned by anyone at | |
| 102 | + | // If the name for a `GDBusObjectManagerClient` is not owned by anyone at | |
| 99 | 103 | // object construction time, the default behavior is to request the | |
| 100 | 104 | // message bus to launch an owner for the name. This behavior can be | |
| 101 | - | // disabled using the %G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START | |
| 102 | - | // flag. It's also worth noting that this only works if the name of | |
| 105 | + | // disabled using the `G_DBUS_OBJECT_MANAGER_CLIENT_FLAGS_DO_NOT_AUTO_START` | |
| 106 | + | // flag. It’s also worth noting that this only works if the name of | |
| 103 | 107 | // interest is activatable in the first place. E.g. in some cases it | |
| 104 | 108 | // is not possible to launch an owner for the requested name. In this | |
| 105 | - | // case, #GDBusObjectManagerClient object construction still succeeds but | |
| 109 | + | // case, `GDBusObjectManagerClient` object construction still succeeds but | |
| 106 | 110 | // there will be no object proxies | |
| 107 | - | // (e.g. g_dbus_object_manager_get_objects() returns the empty list) and | |
| 108 | - | // the #GDBusObjectManagerClient:name-owner property is %NULL. | |
| 111 | + | // (e.g. [method@Gio.DBusObjectManager.get_objects] returns the empty list) and | |
| 112 | + | // the [property@Gio.DBusObjectManagerClient:name-owner] property is `NULL`. | |
| 109 | 113 | // | |
| 110 | 114 | // The owner of the requested name can come and go (for example | |
| 111 | - | // consider a system service being restarted) – #GDBusObjectManagerClient | |
| 112 | - | // handles this case too; simply connect to the #GObject::notify | |
| 113 | - | // signal to watch for changes on the #GDBusObjectManagerClient:name-owner | |
| 114 | - | // property. When the name owner vanishes, the behavior is that | |
| 115 | - | // #GDBusObjectManagerClient:name-owner is set to %NULL (this includes | |
| 116 | - | // emission of the #GObject::notify signal) and then | |
| 117 | - | // #GDBusObjectManager::object-removed signals are synthesized | |
| 115 | + | // consider a system service being restarted) – `GDBusObjectManagerClient` | |
| 116 | + | // handles this case too; simply connect to the [signal@GObject.Object::notify] | |
| 117 | + | // signal to watch for changes on the | |
| 118 | + | // [property@Gio.DBusObjectManagerClient:name-owner] property. When the name | |
| 119 | + | // owner vanishes, the behavior is that | |
| 120 | + | // [property@Gio.DBusObjectManagerClient:name-owner] is set to `NULL` (this | |
| 121 | + | // includes emission of the [signal@GObject.Object::notify] signal) and then | |
| 122 | + | // [signal@Gio.DBusObjectManager::object-removed] signals are synthesized | |
| 118 | 123 | // for all currently existing object proxies. Since | |
| 119 | - | // #GDBusObjectManagerClient:name-owner is %NULL when this happens, you can | |
| 120 | - | // use this information to disambiguate a synthesized signal from a | |
| 121 | - | // genuine signal caused by object removal on the remote | |
| 122 | - | // #GDBusObjectManager. Similarly, when a new name owner appears, | |
| 123 | - | // #GDBusObjectManager::object-added signals are synthesized | |
| 124 | - | // while #GDBusObjectManagerClient:name-owner is still %NULL. Only when all | |
| 125 | - | // object proxies have been added, the #GDBusObjectManagerClient:name-owner | |
| 126 | - | // is set to the new name owner (this includes emission of the | |
| 127 | - | // #GObject::notify signal). Furthermore, you are guaranteed that | |
| 128 | - | // #GDBusObjectManagerClient:name-owner will alternate between a name owner | |
| 129 | - | // (e.g. `:1.42`) and %NULL even in the case where | |
| 124 | + | // [property@Gio.DBusObjectManagerClient:name-owner] is `NULL` when this | |
| 125 | + | // happens, you can use this information to disambiguate a synthesized signal | |
| 126 | + | // from a genuine signal caused by object removal on the remote | |
| 127 | + | // [iface@Gio.DBusObjectManager]. Similarly, when a new name owner appears, | |
| 128 | + | // [signal@Gio.DBusObjectManager::object-added] signals are synthesized | |
| 129 | + | // while [property@Gio.DBusObjectManagerClient:name-owner] is still `NULL`. Only | |
| 130 | + | // when all object proxies have been added, the | |
| 131 | + | // [property@Gio.DBusObjectManagerClient:name-owner] is set to the new name | |
| 132 | + | // owner (this includes emission of the [signal@GObject.Object::notify] signal). | |
| 133 | + | // Furthermore, you are guaranteed that | |
| 134 | + | // [property@Gio.DBusObjectManagerClient:name-owner] will alternate between a | |
| 135 | + | // name owner (e.g. `:1.42`) and `NULL` even in the case where | |
| 130 | 136 | // the name of interest is atomically replaced | |
| 131 | 137 | // | |
| 132 | - | // Ultimately, #GDBusObjectManagerClient is used to obtain #GDBusProxy | |
| 133 | - | // instances. All signals (including the | |
| 134 | - | // org.freedesktop.DBus.Properties::PropertiesChanged signal) | |
| 135 | - | // delivered to #GDBusProxy instances are guaranteed to originate | |
| 138 | + | // Ultimately, `GDBusObjectManagerClient` is used to obtain | |
| 139 | + | // [class@Gio.DBusProxy] instances. All signals (including the | |
| 140 | + | // `org.freedesktop.DBus.Properties::PropertiesChanged` signal) | |
| 141 | + | // delivered to [class@Gio.DBusProxy] instances are guaranteed to originate | |
| 136 | 142 | // from the name owner. This guarantee along with the behavior | |
| 137 | 143 | // described above, means that certain race conditions including the | |
| 138 | - | // "half the proxy is from the old owner and the other half is from | |
| 139 | - | // the new owner" problem cannot happen. | |
| 144 | + | // “half the proxy is from the old owner and the other half is from | |
| 145 | + | // the new owner” problem cannot happen. | |
| 140 | 146 | // | |
| 141 | 147 | // To avoid having the application connect to signals on the returned | |
| 142 | - | // #GDBusObjectProxy and #GDBusProxy objects, the | |
| 143 | - | // #GDBusObject::interface-added, | |
| 144 | - | // #GDBusObject::interface-removed, | |
| 145 | - | // #GDBusProxy::g-properties-changed and | |
| 146 | - | // #GDBusProxy::g-signal signals | |
| 147 | - | // are also emitted on the #GDBusObjectManagerClient instance managing these | |
| 148 | + | // [class@Gio.DBusObjectProxy] and [class@Gio.DBusProxy] objects, the | |
| 149 | + | // [signal@Gio.DBusObject::interface-added], | |
| 150 | + | // [signal@Gio.DBusObject::interface-removed], | |
| 151 | + | // [signal@Gio.DBusProxy::g-properties-changed] and | |
| 152 | + | // [signal@Gio.DBusProxy::g-signal] signals | |
| 153 | + | // are also emitted on the `GDBusObjectManagerClient` instance managing these | |
| 148 | 154 | // objects. The signals emitted are | |
| 149 | - | // #GDBusObjectManager::interface-added, | |
| 150 | - | // #GDBusObjectManager::interface-removed, | |
| 151 | - | // #GDBusObjectManagerClient::interface-proxy-properties-changed and | |
| 152 | - | // #GDBusObjectManagerClient::interface-proxy-signal. | |
| 155 | + | // [signal@Gio.DBusObjectManager::interface-added], | |
| 156 | + | // [signal@Gio.DBusObjectManager::interface-removed], | |
| 157 | + | // [signal@Gio.DBusObjectManagerClient::interface-proxy-properties-changed] and | |
| 158 | + | // [signal@Gio.DBusObjectManagerClient::interface-proxy-signal]. | |
| 153 | 159 | // | |
| 154 | 160 | // Note that all callbacks and signals are emitted in the | |
| 155 | - | // [thread-default main context][g-main-context-push-thread-default] | |
| 156 | - | // that the #GDBusObjectManagerClient object was constructed | |
| 157 | - | // in. Additionally, the #GDBusObjectProxy and #GDBusProxy objects | |
| 158 | - | // originating from the #GDBusObjectManagerClient object will be created in | |
| 161 | + | // thread-default main context (see | |
| 162 | + | // [method@GLib.MainContext.push_thread_default]) that the | |
| 163 | + | // `GDBusObjectManagerClient` object was constructed in. Additionally, the | |
| 164 | + | // [class@Gio.DBusObjectProxy] and [class@Gio.DBusProxy] objects | |
| 165 | + | // originating from the `GDBusObjectManagerClient` object will be created in | |
| 159 | 166 | // the same context and, consequently, will deliver signals in the | |
| 160 | 167 | // same main loop. | |
| 161 | 168 | type DBusObjectManagerClient struct { | |
| @@ -334,8 +341,8 @@ func (c *DBusObjectManagerClient) SetGoPointer(ptr uintptr) { | |||
| 334 | 341 | // This signal exists purely as a convenience to avoid having to | |
| 335 | 342 | // connect signals to all interface proxies managed by @manager. | |
| 336 | 343 | // | |
| 337 | - | // This signal is emitted in the | |
| 338 | - | // [thread-default main context][g-main-context-push-thread-default] | |
| 344 | + | // This signal is emitted in the thread-default main context | |
| 345 | + | // (see [method@GLib.MainContext.push_thread_default]) | |
| 339 | 346 | // that @manager was constructed in. | |
| 340 | 347 | func (x *DBusObjectManagerClient) ConnectInterfaceProxyPropertiesChanged(cb *func(DBusObjectManagerClient, uintptr, uintptr, uintptr, []string)) uint32 { | |
| 341 | 348 | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| @@ -361,8 +368,8 @@ func (x *DBusObjectManagerClient) ConnectInterfaceProxyPropertiesChanged(cb *fun | |||
| 361 | 368 | // This signal exists purely as a convenience to avoid having to | |
| 362 | 369 | // connect signals to all interface proxies managed by @manager. | |
| 363 | 370 | // | |
| 364 | - | // This signal is emitted in the | |
| 365 | - | // [thread-default main context][g-main-context-push-thread-default] | |
| 371 | + | // This signal is emitted in the thread-default main context | |
| 372 | + | // (see [method@GLib.MainContext.push_thread_default]) | |
| 366 | 373 | // that @manager was constructed in. | |
| 367 | 374 | func (x *DBusObjectManagerClient) ConnectInterfaceProxySignal(cb *func(DBusObjectManagerClient, uintptr, uintptr, string, string, uintptr)) uint32 { | |
| 368 | 375 | cbPtr := uintptr(unsafe.Pointer(cb)) | |
| @@ -519,7 +526,7 @@ func (x *DBusObjectManagerClient) GetObjects() *glib.List { | |||
| 519 | 526 | // If the object is not initialized, or initialization returns with an | |
| 520 | 527 | // error, then all operations on the object except g_object_ref() and | |
| 521 | 528 | // g_object_unref() are considered to be invalid, and have undefined | |
| 522 | - | // behaviour. See the [introduction][ginitable] for more details. | |
| 529 | + | // behaviour. See the [description][iface@Gio.Initable#description] for more details. | |
| 523 | 530 | // | |
| 524 | 531 | // Callers should not assume that a class which implements #GInitable can be | |
| 525 | 532 | // initialized multiple times, unless the class explicitly documents itself as | |
| @@ -555,10 +562,10 @@ var xDBusObjectManagerClientNew func(uintptr, DBusObjectManagerClientFlags, stri | |||
| 555 | 562 | // Asynchronously creates a new #GDBusObjectManagerClient object. | |
| 556 | 563 | // | |
| 557 | 564 | // This is an asynchronous failable constructor. When the result is | |
| 558 | - | // ready, @callback will be invoked in the | |
| 559 | - | // [thread-default main context][g-main-context-push-thread-default] | |
| 560 | - | // of the thread you are calling this method from. You can | |
| 561 | - | // then call g_dbus_object_manager_client_new_finish() to get the result. See | |
| 565 | + | // ready, @callback will be invoked in the thread-default main context | |
| 566 | + | // (see [method@GLib.MainContext.push_thread_default]) | |
| 567 | + | // of the thread you are calling this method from. You can then call | |
| 568 | + | // g_dbus_object_manager_client_new_finish() to get the result. See | |
| 562 | 569 | // g_dbus_object_manager_client_new_sync() for the synchronous version. | |
| 563 | 570 | func DBusObjectManagerClientNew(ConnectionVar *DBusConnection, FlagsVar DBusObjectManagerClientFlags, NameVar string, ObjectPathVar string, GetProxyTypeFuncVar *DBusProxyTypeFunc, GetProxyTypeUserDataVar uintptr, GetProxyTypeDestroyNotifyVar *glib.DestroyNotify, CancellableVar *Cancellable, CallbackVar *AsyncReadyCallback, UserDataVar uintptr) { | |
| 564 | 571 | ||
| @@ -572,8 +579,8 @@ var xDBusObjectManagerClientNewForBus func(BusType, DBusObjectManagerClientFlags | |||
| 572 | 579 | // #GDBusConnection. | |
| 573 | 580 | // | |
| 574 | 581 | // This is an asynchronous failable constructor. When the result is | |
| 575 | - | // ready, @callback will be invoked in the | |
| 576 | - | // [thread-default main loop][g-main-context-push-thread-default] | |
| 582 | + | // ready, @callback will be invoked in the thread-default main context | |
| 583 | + | // (see [method@GLib.MainContext.push_thread_default]) | |
| 577 | 584 | // of the thread you are calling this method from. You can | |
| 578 | 585 | // then call g_dbus_object_manager_client_new_for_bus_finish() to get the result. See | |
| 579 | 586 | // g_dbus_object_manager_client_new_for_bus_sync() for the synchronous version. | |
M v4/gio/gdbusobjectmanagerserver.go +6 -7
| @@ -33,9 +33,9 @@ func (x *DBusObjectManagerServerPrivate) GoPointer() uintptr { | |||
| 33 | 33 | return uintptr(unsafe.Pointer(x)) | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | - | // #GDBusObjectManagerServer is used to export #GDBusObject instances using | |
| 37 | - | // the standardized | |
| 38 | - | // [org.freedesktop.DBus.ObjectManager](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) | |
| 36 | + | // `GDBusObjectManagerServer` is used to export [iface@Gio.DBusObject] instances | |
| 37 | + | // using the standardized | |
| 38 | + | // [`org.freedesktop.DBus.ObjectManager`](http://dbus.freedesktop.org/doc/dbus-specification.html#standard-interfaces-objectmanager) | |
| 39 | 39 | // interface. For example, remote D-Bus clients can get all objects | |
| 40 | 40 | // and properties in a single call. Additionally, any change in the | |
| 41 | 41 | // object hierarchy is broadcast using signals. This means that D-Bus | |
| @@ -51,10 +51,9 @@ func (x *DBusObjectManagerServerPrivate) GoPointer() uintptr { | |||
| 51 | 51 | // It is supported, but not recommended, to export an object manager at the root | |
| 52 | 52 | // path, `/`. | |
| 53 | 53 | // | |
| 54 | - | // See #GDBusObjectManagerClient for the client-side code that is | |
| 55 | - | // intended to be used with #GDBusObjectManagerServer or any D-Bus | |
| 56 | - | // object implementing the org.freedesktop.DBus.ObjectManager | |
| 57 | - | // interface. | |
| 54 | + | // See [class@Gio.DBusObjectManagerClient] for the client-side code that is | |
| 55 | + | // intended to be used with `GDBusObjectManagerServer` or any D-Bus | |
| 56 | + | // object implementing the `org.freedesktop.DBus.ObjectManager` interface. | |
| 58 | 57 | type DBusObjectManagerServer struct { | |
| 59 | 58 | gobject.Object | |
| 60 | 59 | } | |
M v4/gio/gdbusobjectproxy.go +3 -3
| @@ -33,9 +33,9 @@ func (x *DBusObjectProxyPrivate) GoPointer() uintptr { | |||
| 33 | 33 | return uintptr(unsafe.Pointer(x)) | |
| 34 | 34 | } | |
| 35 | 35 | ||
| 36 | - | // A #GDBusObjectProxy is an object used to represent a remote object | |
| 37 | - | // with one or more D-Bus interfaces. Normally, you don't instantiate | |
| 38 | - | // a #GDBusObjectProxy yourself - typically #GDBusObjectManagerClient | |
| 36 | + | // A `GDBusObjectProxy` is an object used to represent a remote object | |
| 37 | + | // with one or more D-Bus interfaces. Normally, you don’t instantiate | |
| 38 | + | // a `GDBusObjectProxy` yourself — typically [class@Gio.DBusObjectManagerClient] | |
| 39 | 39 | // is used to obtain it. | |
| 40 | 40 | type DBusObjectProxy struct { | |
| 41 | 41 | gobject.Object | |
M v4/gio/gdbusobjectskeleton.go +4 -2
| @@ -28,6 +28,7 @@ func (x *DBusObjectSkeletonClass) GoPointer() uintptr { | |||
| 28 | 28 | } | |
| 29 | 29 | ||
| 30 | 30 | // OverrideAuthorizeMethod sets the callback function. | |
| 31 | + | // Signal class handler for the #GDBusObjectSkeleton::authorize-method signal. | |
| 31 | 32 | func (x *DBusObjectSkeletonClass) OverrideAuthorizeMethod(cb func(*DBusObjectSkeleton, *DBusInterfaceSkeleton, *DBusMethodInvocation) bool) { | |
| 32 | 33 | if cb == nil { | |
| 33 | 34 | x.xAuthorizeMethod = 0 | |
| @@ -39,6 +40,7 @@ func (x *DBusObjectSkeletonClass) OverrideAuthorizeMethod(cb func(*DBusObjectSke | |||
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | 42 | // GetAuthorizeMethod gets the callback function. | |
| 43 | + | // Signal class handler for the #GDBusObjectSkeleton::authorize-method signal. | |
| 42 | 44 | func (x *DBusObjectSkeletonClass) GetAuthorizeMethod() func(*DBusObjectSkeleton, *DBusInterfaceSkeleton, *DBusMethodInvocation) bool { | |
| 43 | 45 | if x.xAuthorizeMethod == 0 { | |
| 44 | 46 | return nil | |
| @@ -58,11 +60,11 @@ func (x *DBusObjectSkeletonPrivate) GoPointer() uintptr { | |||
| 58 | 60 | return uintptr(unsafe.Pointer(x)) | |
| 59 | 61 | } | |
| 60 | 62 | ||
| 61 | - | // A #GDBusObjectSkeleton instance is essentially a group of D-Bus | |
| 63 | + | // A `GDBusObjectSkeleton` instance is essentially a group of D-Bus | |
| 62 | 64 | // interfaces. The set of exported interfaces on the object may be | |
| 63 | 65 | // dynamic and change at runtime. | |
| 64 | 66 | // | |
| 65 | - | // This type is intended to be used with #GDBusObjectManager. | |
| 67 | + | // This type is intended to be used with [iface@Gio.DBusObjectManager]. | |
| 66 | 68 | type DBusObjectSkeleton struct { | |
| 67 | 69 | gobject.Object | |
| 68 | 70 | } | |
M v4/gio/gdbusproxy.go +46 -39 collapsed to keep the page light
A v4/gio/gdbusserver.go +267 -0 collapsed to keep the page light
M v4/gio/gdebugcontroller.go +9 -8
| @@ -21,20 +21,21 @@ func (x *DebugControllerInterface) GoPointer() uintptr { | |||
| 21 | 21 | return uintptr(unsafe.Pointer(x)) | |
| 22 | 22 | } | |
| 23 | 23 | ||
| 24 | - | // #GDebugController is an interface to expose control of debugging features and | |
| 24 | + | // `GDebugController` is an interface to expose control of debugging features and | |
| 25 | 25 | // debug output. | |
| 26 | 26 | // | |
| 27 | - | // It is implemented on Linux using #GDebugControllerDBus, which exposes a D-Bus | |
| 28 | - | // interface to allow authenticated peers to control debug features in this | |
| 29 | - | // process. | |
| 27 | + | // It is implemented on Linux using [class@Gio.DebugControllerDBus], which | |
| 28 | + | // exposes a D-Bus interface to allow authenticated peers to control debug | |
| 29 | + | // features in this process. | |
| 30 | 30 | // | |
| 31 | 31 | // Whether debug output is enabled is exposed as | |
| 32 | - | // #GDebugController:debug-enabled. This controls g_log_set_debug_enabled() by | |
| 33 | - | // default. Application code may connect to the #GObject::notify signal for it | |
| 32 | + | // [property@Gio.DebugController:debug-enabled]. This controls | |
| 33 | + | // [func@GLib.log_set_debug_enabled] by default. Application code may | |
| 34 | + | // connect to the [signal@GObject.Object::notify] signal for it | |
| 34 | 35 | // to control other parts of its debug infrastructure as necessary. | |
| 35 | 36 | // | |
| 36 | 37 | // If your application or service is using the default GLib log writer function, | |
| 37 | - | // creating one of the built-in implementations of #GDebugController should be | |
| 38 | + | // creating one of the built-in implementations of `GDebugController` should be | |
| 38 | 39 | // all that’s needed to dynamically enable or disable debug output. | |
| 39 | 40 | type DebugController interface { | |
| 40 | 41 | GoPointer() uintptr | |
| @@ -83,7 +84,7 @@ var XGDebugControllerSetDebugEnabled func(uintptr, bool) | |||
| 83 | 84 | ||
| 84 | 85 | const ( | |
| 85 | 86 | // Extension point for debug control functionality. | |
| 86 | - | // See [Extending GIO][extending-gio]. | |
| 87 | + | // See [Extending GIO](overview.html#extending-gio). | |
| 87 | 88 | DEBUG_CONTROLLER_EXTENSION_POINT_NAME string = "gio-debug-controller" | |
| 88 | 89 | ) | |
| 89 | 90 | ||
M v4/gio/gdebugcontrollerdbus.go +25 -19
| @@ -28,6 +28,7 @@ func (x *DebugControllerDBusClass) GoPointer() uintptr { | |||
| 28 | 28 | } | |
| 29 | 29 | ||
| 30 | 30 | // OverrideAuthorize sets the callback function. | |
| 31 | + | // Default handler for the #GDebugControllerDBus::authorize signal. | |
| 31 | 32 | func (x *DebugControllerDBusClass) OverrideAuthorize(cb func(*DebugControllerDBus, *DBusMethodInvocation) bool) { | |
| 32 | 33 | if cb == nil { | |
| 33 | 34 | x.xAuthorize = 0 | |
| @@ -39,6 +40,7 @@ func (x *DebugControllerDBusClass) OverrideAuthorize(cb func(*DebugControllerDBu | |||
| 39 | 40 | } | |
| 40 | 41 | ||
| 41 | 42 | // GetAuthorize gets the callback function. | |
| 43 | + | // Default handler for the #GDebugControllerDBus::authorize signal. | |
| 42 | 44 | func (x *DebugControllerDBusClass) GetAuthorize() func(*DebugControllerDBus, *DBusMethodInvocation) bool { | |
| 43 | 45 | if x.xAuthorize == 0 { | |
| 44 | 46 | return nil | |
| @@ -50,29 +52,32 @@ func (x *DebugControllerDBusClass) GetAuthorize() func(*DebugControllerDBus, *DB | |||
| 50 | 52 | } | |
| 51 | 53 | } | |
| 52 | 54 | ||
| 53 | - | // #GDebugControllerDBus is an implementation of #GDebugController which exposes | |
| 54 | - | // debug settings as a D-Bus object. | |
| 55 | + | // `GDebugControllerDBus` is an implementation of [iface@Gio.DebugController] | |
| 56 | + | // which exposes debug settings as a D-Bus object. | |
| 55 | 57 | // | |
| 56 | - | // It is a #GInitable object, and will register an object at | |
| 58 | + | // It is a [iface@Gio.Initable] object, and will register an object at | |
| 57 | 59 | // `/org/gtk/Debugging` on the bus given as | |
| 58 | - | // #GDebugControllerDBus:connection once it’s initialized. The object will be | |
| 59 | - | // unregistered when the last reference to the #GDebugControllerDBus is dropped. | |
| 60 | + | // [property@Gio.DebugControllerDBus:connection] once it’s initialized. The | |
| 61 | + | // object will be unregistered when the last reference to the | |
| 62 | + | // `GDebugControllerDBus` is dropped. | |
| 60 | 63 | // | |
| 61 | 64 | // This D-Bus object can be used by remote processes to enable or disable debug | |
| 62 | 65 | // output in this process. Remote processes calling | |
| 63 | 66 | // `org.gtk.Debugging.SetDebugEnabled()` will affect the value of | |
| 64 | - | // #GDebugController:debug-enabled and, by default, g_log_get_debug_enabled(). | |
| 65 | - | // default. | |
| 67 | + | // [property@Gio.DebugController:debug-enabled] and, by default, | |
| 68 | + | // [func@GLib.log_get_debug_enabled]. | |
| 66 | 69 | // | |
| 67 | - | // By default, all processes will be able to call `SetDebugEnabled()`. If this | |
| 68 | - | // process is privileged, or might expose sensitive information in its debug | |
| 69 | - | // output, you may want to restrict the ability to enable debug output to | |
| 70 | - | // privileged users or processes. | |
| 70 | + | // By default, no processes are allowed to call `SetDebugEnabled()` unless a | |
| 71 | + | // [signal@Gio.DebugControllerDBus::authorize] signal handler is installed. This | |
| 72 | + | // is because the process may be privileged, or might expose sensitive | |
| 73 | + | // information in its debug output. You may want to restrict the ability to | |
| 74 | + | // enable debug output to privileged users or processes. | |
| 71 | 75 | // | |
| 72 | 76 | // One option is to install a D-Bus security policy which restricts access to | |
| 73 | 77 | // `SetDebugEnabled()`, installing something like the following in | |
| 74 | 78 | // `$datadir/dbus-1/system.d/`: | |
| 75 | - | // |[<!-- language="XML" --> | |
| 79 | + | // | |
| 80 | + | // ```xml | |
| 76 | 81 | // <?xml version="1.0"?> <!--*-nxml-*--> | |
| 77 | 82 | // <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" | |
| 78 | 83 | // | |
| @@ -88,7 +93,7 @@ func (x *DebugControllerDBusClass) GetAuthorize() func(*DebugControllerDBus, *DB | |||
| 88 | 93 | // </policy> | |
| 89 | 94 | // | |
| 90 | 95 | // </busconfig> | |
| 91 | - | // ]| | |
| 96 | + | // ``` | |
| 92 | 97 | // | |
| 93 | 98 | // This will prevent the `SetDebugEnabled()` method from being called by all | |
| 94 | 99 | // except root. It will not prevent the `DebugEnabled` property from being read, | |
| @@ -96,9 +101,10 @@ func (x *DebugControllerDBusClass) GetAuthorize() func(*DebugControllerDBus, *DB | |||
| 96 | 101 | // | |
| 97 | 102 | // Another option is to use polkit to allow or deny requests on a case-by-case | |
| 98 | 103 | // basis, allowing for the possibility of dynamic authorisation. To do this, | |
| 99 | - | // connect to the #GDebugControllerDBus::authorize signal and query polkit in | |
| 100 | - | // it: | |
| 101 | - | // |[<!-- language="C" --> | |
| 104 | + | // connect to the [signal@Gio.DebugControllerDBus::authorize] signal and query | |
| 105 | + | // polkit in it: | |
| 106 | + | // | |
| 107 | + | // ```c | |
| 102 | 108 | // | |
| 103 | 109 | // g_autoptr(GError) child_error = NULL; | |
| 104 | 110 | // g_autoptr(GDBusConnection) connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, NULL); | |
| @@ -108,7 +114,7 @@ func (x *DebugControllerDBusClass) GetAuthorize() func(*DebugControllerDBus, *DB | |||
| 108 | 114 | // debug_controller = G_DEBUG_CONTROLLER (g_debug_controller_dbus_new (priv->connection, NULL, &child_error)); | |
| 109 | 115 | // if (debug_controller == NULL) | |
| 110 | 116 | // { | |
| 111 | - | // g_error ("Could not register debug controller on bus: %s"), | |
| 117 | + | // g_error ("Could not register debug controller on bus: %s", | |
| 112 | 118 | // child_error->message); | |
| 113 | 119 | // } | |
| 114 | 120 | // | |
| @@ -161,7 +167,7 @@ func (x *DebugControllerDBusClass) GetAuthorize() func(*DebugControllerDBus, *DB | |||
| 161 | 167 | // return polkit_authorization_result_get_is_authorized (auth_result); | |
| 162 | 168 | // } | |
| 163 | 169 | // | |
| 164 | - | // ]| | |
| 170 | + | // ``` | |
| 165 | 171 | type DebugControllerDBus struct { | |
| 166 | 172 | gobject.Object | |
| 167 | 173 | } | |
| @@ -308,7 +314,7 @@ func (x *DebugControllerDBus) SetDebugEnabled(DebugEnabledVar bool) { | |||
| 308 | 314 | // If the object is not initialized, or initialization returns with an | |
| 309 | 315 | // error, then all operations on the object except g_object_ref() and | |
| 310 | 316 | // g_object_unref() are considered to be invalid, and have undefined | |
| 311 | - | // behaviour. See the [introduction][ginitable] for more details. | |
| 317 | + | // behaviour. See the [description][iface@Gio.Initable#description] for more details. | |
| 312 | 318 | // | |
| 313 | 319 | // Callers should not assume that a class which implements #GInitable can be | |
| 314 | 320 | // initialized multiple times, unless the class explicitly documents itself as | |
M v4/gio/gdesktopappinfo.go +117 -92 collapsed to keep the page light
M v4/gio/gdrive.go +83 -11 collapsed to keep the page light
M v4/gio/gdtlsclientconnection.go +10 -2
| @@ -23,8 +23,8 @@ func (x *DtlsClientConnectionInterface) GoPointer() uintptr { | |||
| 23 | 23 | return uintptr(unsafe.Pointer(x)) | |
| 24 | 24 | } | |
| 25 | 25 | ||
| 26 | - | // #GDtlsClientConnection is the client-side subclass of | |
| 27 | - | // #GDtlsConnection, representing a client-side DTLS connection. | |
| 26 | + | // `GDtlsClientConnection` is the client-side subclass of | |
| 27 | + | // [iface@Gio.DtlsConnection], representing a client-side DTLS connection. | |
| 28 | 28 | type DtlsClientConnection interface { | |
| 29 | 29 | GoPointer() uintptr | |
| 30 | 30 | SetGoPointer(uintptr) | |
| @@ -85,6 +85,10 @@ func (x *DtlsClientConnectionBase) GetServerIdentity() *SocketConnectableBase { | |||
| 85 | 85 | } | |
| 86 | 86 | ||
| 87 | 87 | // Gets @conn's validation flags | |
| 88 | + | // | |
| 89 | + | // This function does not work as originally designed and is impossible | |
| 90 | + | // to use correctly. See #GDtlsClientConnection:validation-flags for more | |
| 91 | + | // information. | |
| 88 | 92 | func (x *DtlsClientConnectionBase) GetValidationFlags() TlsCertificateFlags { | |
| 89 | 93 | ||
| 90 | 94 | cret := XGDtlsClientConnectionGetValidationFlags(x.GoPointer()) | |
| @@ -104,6 +108,10 @@ func (x *DtlsClientConnectionBase) SetServerIdentity(IdentityVar SocketConnectab | |||
| 104 | 108 | // Sets @conn's validation flags, to override the default set of | |
| 105 | 109 | // checks performed when validating a server certificate. By default, | |
| 106 | 110 | // %G_TLS_CERTIFICATE_VALIDATE_ALL is used. | |
| 111 | + | // | |
| 112 | + | // This function does not work as originally designed and is impossible | |
| 113 | + | // to use correctly. See #GDtlsClientConnection:validation-flags for more | |
| 114 | + | // information. | |
| 107 | 115 | func (x *DtlsClientConnectionBase) SetValidationFlags(FlagsVar TlsCertificateFlags) { | |
| 108 | 116 | ||
| 109 | 117 | XGDtlsClientConnectionSetValidationFlags(x.GoPointer(), FlagsVar) | |
M v4/gio/gdtlsconnection.go +37 -15 collapsed to keep the page light
M v4/gio/gdtlsserverconnection.go +2 -2
| @@ -22,8 +22,8 @@ func (x *DtlsServerConnectionInterface) GoPointer() uintptr { | |||
| 22 | 22 | return uintptr(unsafe.Pointer(x)) | |
| 23 | 23 | } | |
| 24 | 24 | ||
| 25 | - | // #GDtlsServerConnection is the server-side subclass of #GDtlsConnection, | |
| 26 | - | // representing a server-side DTLS connection. | |
| 25 | + | // `GDtlsServerConnection` is the server-side subclass of | |
| 26 | + | // [iface@Gio.DtlsConnection], representing a server-side DTLS connection. | |
| 27 | 27 | type DtlsServerConnection interface { | |
| 28 | 28 | GoPointer() uintptr | |
| 29 | 29 | SetGoPointer(uintptr) | |
M v4/gio/gemblem.go +9 -2 collapsed to keep the page light
M v4/gio/gemblemedicon.go +11 -4 collapsed to keep the page light
M v4/gio/gfile.go +478 -71 collapsed to keep the page light
M v4/gio/gfiledescriptorbased.go +7 -3 collapsed to keep the page light
M v4/gio/gfileenumerator.go +71 -19 collapsed to keep the page light
M v4/gio/gfileicon.go +10 -1 collapsed to keep the page light
M v4/gio/gfileinfo.go +273 -34 collapsed to keep the page light
M v4/gio/gfileinputstream.go +5 -5 collapsed to keep the page light
M v4/gio/gfileiostream.go +11 -12 collapsed to keep the page light
M v4/gio/gfilemonitor.go +10 -11 collapsed to keep the page light
M v4/gio/gfileoutputstream.go +7 -7 collapsed to keep the page light
M v4/gio/gicon.go +53 -33 collapsed to keep the page light
M v4/gio/ginetaddress.go +7 -7 collapsed to keep the page light
M v4/gio/ginetaddressmask.go +3 -3 collapsed to keep the page light
M v4/gio/ginetsocketaddress.go +5 -2 collapsed to keep the page light
M v4/gio/ginitable.go +14 -12 collapsed to keep the page light
M v4/gio/ginputstream.go +11 -9 collapsed to keep the page light
D v4/gio/gio-2.0.go +0 -6489 large diff (6489 lines changed): collapsed
M v4/gio/gioenums.go +28 -4 collapsed to keep the page light
M v4/gio/gioerror.go +39 -5 collapsed to keep the page light
M v4/gio/giostream.go +30 -28 collapsed to keep the page light
M v4/gio/giotypes.go +229 -126 collapsed to keep the page light
M v4/gio/glistmodel.go +44 -17 collapsed to keep the page light
M v4/gio/gliststore.go +22 -3 collapsed to keep the page light
M v4/gio/gloadableicon.go +8 -2 collapsed to keep the page light
M v4/gio/gmemoryinputstream.go +12 -3 collapsed to keep the page light
M v4/gio/gmemorymonitor.go +18 -10 collapsed to keep the page light
M v4/gio/gmemoryoutputstream.go +15 -3 collapsed to keep the page light
A v4/gio/gmenu.go +741 -0 collapsed to keep the page light
A v4/gio/gmenuexporter.go +10 -0 collapsed to keep the page light
M v4/gio/gmenumodel.go +45 -37 collapsed to keep the page light
M v4/gio/gmount.go +83 -17 collapsed to keep the page light
M v4/gio/gmountoperation.go +9 -8 collapsed to keep the page light
M v4/gio/gnativesocketaddress.go +3 -0
| @@ -29,6 +29,9 @@ func (x *NativeSocketAddressPrivate) GoPointer() uintptr { | |||
| 29 | 29 | } | |
| 30 | 30 | ||
| 31 | 31 | // A socket address of some unknown native type. | |
| 32 | + | // | |
| 33 | + | // This corresponds to a general `struct sockaddr` of a type not otherwise | |
| 34 | + | // handled by GLib. | |
| 32 | 35 | type NativeSocketAddress struct { | |
| 33 | 36 | SocketAddress | |
| 34 | 37 | } | |
M v4/gio/gnetworkaddress.go +2 -2 collapsed to keep the page light
M v4/gio/gnetworkmonitor.go +22 -2 collapsed to keep the page light
M v4/gio/gnetworkservice.go +3 -3 collapsed to keep the page light
A v4/gio/gnotification.go +289 -0 collapsed to keep the page light
M v4/gio/goutputstream.go +12 -6 collapsed to keep the page light
M v4/gio/gpermission.go +5 -5 collapsed to keep the page light
M v4/gio/gpollableinputstream.go +27 -1 collapsed to keep the page light
M v4/gio/gpollableoutputstream.go +36 -1 collapsed to keep the page light
M v4/gio/gpowerprofilemonitor.go +12 -10 collapsed to keep the page light
A v4/gio/gpropertyaction.go +243 -0 collapsed to keep the page light
M v4/gio/gproxy.go +17 -5 collapsed to keep the page light
M v4/gio/gproxyaddress.go +1 -1 collapsed to keep the page light
M v4/gio/gproxyaddressenumerator.go +8 -7 collapsed to keep the page light
M v4/gio/gproxyresolver.go +26 -9 collapsed to keep the page light
M v4/gio/gremoteactiongroup.go +13 -9 collapsed to keep the page light
M v4/gio/gresolver.go +49 -7 collapsed to keep the page light
M v4/gio/gresource.go +46 -20 collapsed to keep the page light
M v4/gio/gseekable.go +18 -8 collapsed to keep the page light
M v4/gio/gsettings.go +427 -299 collapsed to keep the page light
M v4/gio/gsettingsbackend.go +52 -37 collapsed to keep the page light
M v4/gio/gsettingsschema.go +15 -15 collapsed to keep the page light
A v4/gio/gsimpleaction.go +350 -0 collapsed to keep the page light
M v4/gio/gsimpleactiongroup.go +91 -59 collapsed to keep the page light
M v4/gio/gsimpleasyncresult.go +53 -52 collapsed to keep the page light
A v4/gio/gsimpleiostream.go +76 -0 collapsed to keep the page light
A v4/gio/gsimplepermission.go +72 -0 collapsed to keep the page light
M v4/gio/gsimpleproxyresolver.go +5 -5 collapsed to keep the page light
M v4/gio/gsocket.go +98 -26 collapsed to keep the page light
M v4/gio/gsocketaddress.go +4 -3 collapsed to keep the page light
M v4/gio/gsocketaddressenumerator.go +18 -11 collapsed to keep the page light
M v4/gio/gsocketclient.go +8 -8 collapsed to keep the page light
M v4/gio/gsocketconnectable.go +16 -6 collapsed to keep the page light
M v4/gio/gsocketconnection.go +14 -10 collapsed to keep the page light
M v4/gio/gsocketcontrolmessage.go +19 -9 collapsed to keep the page light
M v4/gio/gsocketlistener.go +12 -9 collapsed to keep the page light
M v4/gio/gsocketservice.go +15 -13 collapsed to keep the page light
A v4/gio/gsubprocess.go +641 -0 collapsed to keep the page light
A v4/gio/gsubprocesslauncher.go +427 -0 collapsed to keep the page light
M v4/gio/gtask.go +511 -398 collapsed to keep the page light
M v4/gio/gtcpconnection.go +1 -1 collapsed to keep the page light
M v4/gio/gtcpwrapperconnection.go +6 -5 collapsed to keep the page light
A v4/gio/gtestdbus.go +243 -0 collapsed to keep the page light
M v4/gio/gthemedicon.go +13 -4 collapsed to keep the page light
A v4/gio/gthreadedresolver.go +48 -0 collapsed to keep the page light
M v4/gio/gthreadedsocketservice.go +7 -6 collapsed to keep the page light
M v4/gio/gtlsbackend.go +22 -2 collapsed to keep the page light
M v4/gio/gtlscertificate.go +3 -1 collapsed to keep the page light
M v4/gio/gtlsclientconnection.go +4 -2 collapsed to keep the page light
M v4/gio/gtlsconnection.go +40 -6 collapsed to keep the page light
M v4/gio/gtlsdatabase.go +82 -4 collapsed to keep the page light
M v4/gio/gtlsfiledatabase.go +2 -2 collapsed to keep the page light
M v4/gio/gtlsinteraction.go +51 -7 collapsed to keep the page light
M v4/gio/gtlspassword.go +12 -1 collapsed to keep the page light
M v4/gio/gtlsserverconnection.go +2 -2 collapsed to keep the page light
M v4/gio/gunixconnection.go +2 -2 collapsed to keep the page light
M v4/gio/gunixcredentialsmessage.go +8 -8 collapsed to keep the page light
M v4/gio/gunixfdlist.go +11 -7 collapsed to keep the page light
M v4/gio/gunixfdmessage.go +7 -7 collapsed to keep the page light
M v4/gio/gunixinputstream.go +12 -3 collapsed to keep the page light
M v4/gio/gunixmounts.go +420 -67 collapsed to keep the page light
M v4/gio/gunixoutputstream.go +15 -3 collapsed to keep the page light
M v4/gio/gunixsocketaddress.go +5 -4 collapsed to keep the page light
M v4/gio/gvfs.go +2 -2 collapsed to keep the page light
M v4/gio/gvolume.go +96 -27 collapsed to keep the page light
M v4/gio/gvolumemonitor.go +6 -6 collapsed to keep the page light
M v4/gio/gzlibcompressor.go +13 -1 collapsed to keep the page light
M v4/gio/gzlibdecompressor.go +13 -1 collapsed to keep the page light
A v4/glib/gallocator.go +195 -0 collapsed to keep the page light
M v4/glib/garray.go +361 -71 collapsed to keep the page light
M v4/glib/gasyncqueue.go +30 -3 collapsed to keep the page light
M v4/glib/gatomic.go +101 -9 collapsed to keep the page light
M v4/glib/gbacktrace.go +1 -1 collapsed to keep the page light
M v4/glib/gbase64.go +1 -1 collapsed to keep the page light
M v4/glib/gbitlock.go +42 -1 collapsed to keep the page light
M v4/glib/gbookmarkfile.go +88 -18 collapsed to keep the page light
A v4/glib/gcache.go +121 -0 collapsed to keep the page light
M v4/glib/gcharset.go +5 -4 collapsed to keep the page light
M v4/glib/gchecksum.go +16 -4 collapsed to keep the page light
A v4/glib/gcompletion.go +154 -0 collapsed to keep the page light
M v4/glib/gconvert.go +19 -8 collapsed to keep the page light
M v4/glib/gdataset.go +18 -2 collapsed to keep the page light
M v4/glib/gdate.go +45 -17 collapsed to keep the page light
M v4/glib/gdatetime.go +180 -79 collapsed to keep the page light
M v4/glib/gdir.go +66 -2 collapsed to keep the page light
M v4/glib/genviron.go +1 -1 collapsed to keep the page light
M v4/glib/gerror.go +50 -12 collapsed to keep the page light
M v4/glib/gfileutils.go +85 -22 collapsed to keep the page light
M v4/glib/ggettext.go +4 -4 collapsed to keep the page light
M v4/glib/ghash.go +166 -7 collapsed to keep the page light
M v4/glib/ghmac.go +51 -4 collapsed to keep the page light
M v4/glib/ghook.go +11 -1 collapsed to keep the page light
M v4/glib/ghostutils.go +1 -1 collapsed to keep the page light
M v4/glib/giochannel.go +142 -5 collapsed to keep the page light
M v4/glib/gkeyfile.go +361 -171 collapsed to keep the page light
D v4/glib/glib-2.0.go +0 -58 collapsed to keep the page light
M v4/glib/glib-types.go +1 -3 collapsed to keep the page light
M v4/glib/glib-unix.go +103 -15 collapsed to keep the page light
M v4/glib/glibconfig.go +22 -82 collapsed to keep the page light
M v4/glib/glist.go +1 -1 collapsed to keep the page light
M v4/glib/gmacros.go +16 -0 collapsed to keep the page light
M v4/glib/gmain.go +473 -372 collapsed to keep the page light
M v4/glib/gmappedfile.go +1 -1 collapsed to keep the page light
M v4/glib/gmarkup.go +47 -3 collapsed to keep the page light
M v4/glib/gmem.go +108 -5 collapsed to keep the page light
M v4/glib/gmessages.go +280 -175 collapsed to keep the page light
M v4/glib/gnode.go +34 -12 collapsed to keep the page light
M v4/glib/goption.go +62 -30 collapsed to keep the page light
A v4/glib/gpathbuf.go +300 -0 collapsed to keep the page light
M v4/glib/gpattern.go +52 -28 collapsed to keep the page light
M v4/glib/gpoll.go +1 -1 collapsed to keep the page light
M v4/glib/gprimes.go +1 -1 collapsed to keep the page light
M v4/glib/gprintf.go +13 -13 collapsed to keep the page light
M v4/glib/gqsort.go +19 -4 collapsed to keep the page light
M v4/glib/gquark.go +27 -3 collapsed to keep the page light
M v4/glib/gqueue.go +2 -2 collapsed to keep the page light
M v4/glib/grand.go +45 -1 collapsed to keep the page light
M v4/glib/grcbox.go +6 -1 collapsed to keep the page light
M v4/glib/grefcount.go +42 -1 collapsed to keep the page light
M v4/glib/grefstring.go +16 -1 collapsed to keep the page light
M v4/glib/gregex.go +47 -50 collapsed to keep the page light
A v4/glib/grel.go +198 -0 collapsed to keep the page light
M v4/glib/gscanner.go +2 -2 collapsed to keep the page light
M v4/glib/gsequence.go +51 -2 collapsed to keep the page light
M v4/glib/gshell.go +1 -1 collapsed to keep the page light
M v4/glib/gslice.go +21 -16 collapsed to keep the page light
M v4/glib/gslist.go +1 -1 collapsed to keep the page light
M v4/glib/gspawn.go +21 -9 collapsed to keep the page light
M v4/glib/gstdio.go +254 -2 collapsed to keep the page light
M v4/glib/gstrfuncs.go +252 -221 collapsed to keep the page light
M v4/glib/gstring.go +41 -2 collapsed to keep the page light
M v4/glib/gstringchunk.go +24 -3 collapsed to keep the page light
M v4/glib/gstrvbuilder.go +67 -5 collapsed to keep the page light
M v4/glib/gtestutils.go +393 -250 collapsed to keep the page light
M v4/glib/gthread.go +1388 -5 collapsed to keep the page light
M v4/glib/gthreadpool.go +28 -5 collapsed to keep the page light
M v4/glib/gtimer.go +6 -2 collapsed to keep the page light
M v4/glib/gtimezone.go +32 -3 collapsed to keep the page light
M v4/glib/gtrashstack.go +14 -3 collapsed to keep the page light
M v4/glib/gtree.go +2 -2 collapsed to keep the page light
M v4/glib/gtypes.go +18 -10 collapsed to keep the page light
M v4/glib/gunicode.go +173 -72 collapsed to keep the page light
M v4/glib/guri.go +101 -50 collapsed to keep the page light
M v4/glib/gutils.go +24 -13 collapsed to keep the page light
M v4/glib/guuid.go +1 -1 collapsed to keep the page light
A v4/glib/gvariant-parser.go +28 -0 collapsed to keep the page light
M v4/glib/gvariant.go +143 -113 collapsed to keep the page light
M v4/glib/gvarianttype.go +195 -166 collapsed to keep the page light
M v4/glib/gversion.go +1 -1 collapsed to keep the page light
M v4/glib/main.go +1 -1 collapsed to keep the page light
M v4/gmodule/gmodule.go +1 -1 collapsed to keep the page light
A v4/gmodule/gmoduleconf.go +12 -0 collapsed to keep the page light
M v4/gobject/gbinding.go +276 -1 collapsed to keep the page light
A v4/gobject/gbindinggroup.go +155 -0 collapsed to keep the page light
M v4/gobject/gclosure.go +7 -7 collapsed to keep the page light
M v4/gobject/genums.go +4 -4 collapsed to keep the page light
A v4/gobject/glib-types.go +32 -0 collapsed to keep the page light
M v4/gobject/gmarshal.go +48 -43 collapsed to keep the page light
D v4/gobject/gobject-2.0.go +0 -790 collapsed to keep the page light
M v4/gobject/gobject.go +230 -59 collapsed to keep the page light
M v4/gobject/gparam.go +134 -18 collapsed to keep the page light
M v4/gobject/gsignal.go +79 -25 collapsed to keep the page light
A v4/gobject/gsignalgroup.go +279 -0 collapsed to keep the page light
M v4/gobject/gtype.go +293 -177 collapsed to keep the page light
M v4/gobject/gtypemodule.go +21 -12 collapsed to keep the page light
M v4/gobject/gtypeplugin.go +138 -0 collapsed to keep the page light
M v4/gobject/gvalue.go +18 -0 collapsed to keep the page light
M v4/gobject/gvaluearray.go +28 -2 collapsed to keep the page light
A v4/gobject/gvaluecollector.go +11 -0 collapsed to keep the page light
M v4/gobject/main.go +24 -0 collapsed to keep the page light
M v4/gsk/gskbroadwayrenderer.go +3 -0 collapsed to keep the page light
M v4/gsk/gskcairorenderer.go +1 -1 collapsed to keep the page light
M v4/gsk/gskenums.go +212 -2 collapsed to keep the page light
M v4/gsk/gskglrenderer.go +54 -1 collapsed to keep the page light
M v4/gsk/gskglshader.go +3 -4 collapsed to keep the page light
A v4/gsk/gskpath.go +93 -0 collapsed to keep the page light
A v4/gsk/gskpathpoint.go +189 -0 collapsed to keep the page light
M v4/gsk/gskrenderer.go +35 -17 collapsed to keep the page light
M v4/gsk/gskrendernode.go +40 -12 collapsed to keep the page light
M v4/gsk/gskrendernodeimpl.go +479 -8 collapsed to keep the page light
M v4/gsk/gskroundedrect.go +19 -18 collapsed to keep the page light
A v4/gsk/gskstroke.go +28 -0 collapsed to keep the page light
M v4/gsk/gsktransform.go +3 -4 collapsed to keep the page light
M v4/gsk/gsktypes.go +1183 -27 collapsed to keep the page light
A v4/gsk/gskvulkanrenderer.go +85 -0 collapsed to keep the page light
D v4/gsk/main.go +0 -76 collapsed to keep the page light
M v4/gtk/gtkaboutdialog.go +166 -19 collapsed to keep the page light
M v4/gtk/gtkaccelgroup.go +6 -6 collapsed to keep the page light
M v4/gtk/gtkaccessible.go +477 -12 collapsed to keep the page light
A v4/gtk/gtkaccessiblerange.go +96 -0 collapsed to keep the page light
A v4/gtk/gtkaccessibletext.go +498 -0 collapsed to keep the page light
M v4/gtk/gtkactionable.go +9 -2 collapsed to keep the page light
M v4/gtk/gtkactionbar.go +162 -22 collapsed to keep the page light
M v4/gtk/gtkadjustment.go +4 -4 collapsed to keep the page light
A v4/gtk/gtkalertdialog.go +266 -0 collapsed to keep the page light
M v4/gtk/gtkappchooserbutton.go +152 -12 collapsed to keep the page light
M v4/gtk/gtkappchooserdialog.go +156 -11 collapsed to keep the page light
M v4/gtk/gtkappchooserwidget.go +146 -11 collapsed to keep the page light
M v4/gtk/gtkapplication.go +169 -114 collapsed to keep the page light
M v4/gtk/gtkapplicationwindow.go +245 -81 collapsed to keep the page light
M v4/gtk/gtkaspectframe.go +153 -12 collapsed to keep the page light
M v4/gtk/gtkassistant.go +153 -13 collapsed to keep the page light
M v4/gtk/gtkatcontext.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkbinlayout.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkbitset.go +3 -2 collapsed to keep the page light
M v4/gtk/gtkbookmarklist.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkboolfilter.go +4 -5 collapsed to keep the page light
M v4/gtk/gtkborder.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkbox.go +199 -31 collapsed to keep the page light
M v4/gtk/gtkboxlayout.go +22 -2 collapsed to keep the page light
M v4/gtk/gtkbuildable.go +120 -12 collapsed to keep the page light
M v4/gtk/gtkbuilder.go +256 -49 collapsed to keep the page light
M v4/gtk/gtkbuilderlistitemfactory.go +12 -4 collapsed to keep the page light
M v4/gtk/gtkbuilderscope.go +41 -2 collapsed to keep the page light
M v4/gtk/gtkbutton.go +201 -16 collapsed to keep the page light
M v4/gtk/gtkcalendar.go +229 -14 collapsed to keep the page light
M v4/gtk/gtkcellarea.go +176 -8 collapsed to keep the page light
M v4/gtk/gtkcellareabox.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkcellareacontext.go +28 -0 collapsed to keep the page light
M v4/gtk/gtkcelleditable.go +14 -0 collapsed to keep the page light
M v4/gtk/gtkcelllayout.go +46 -2 collapsed to keep the page light
M v4/gtk/gtkcellrenderer.go +29 -2 collapsed to keep the page light
M v4/gtk/gtkcellrendererspin.go +0 -2 collapsed to keep the page light
M v4/gtk/gtkcellview.go +146 -11 collapsed to keep the page light
M v4/gtk/gtkcenterbox.go +195 -23 collapsed to keep the page light
M v4/gtk/gtkcenterlayout.go +29 -2 collapsed to keep the page light
M v4/gtk/gtkcheckbutton.go +175 -16 collapsed to keep the page light
M v4/gtk/gtkcolorbutton.go +151 -11 collapsed to keep the page light
M v4/gtk/gtkcolorchooserdialog.go +158 -11 collapsed to keep the page light
M v4/gtk/gtkcolorchooserwidget.go +153 -10 collapsed to keep the page light
A v4/gtk/gtkcolordialog.go +185 -0 collapsed to keep the page light
A v4/gtk/gtkcolordialogbutton.go +466 -0 collapsed to keep the page light
M v4/gtk/gtkcolumnview.go +263 -26 collapsed to keep the page light
A v4/gtk/gtkcolumnviewcell.go +182 -0 collapsed to keep the page light
M v4/gtk/gtkcolumnviewcolumn.go +37 -11 collapsed to keep the page light
A v4/gtk/gtkcolumnviewrow.go +241 -0 collapsed to keep the page light
A v4/gtk/gtkcolumnviewsorter.go +171 -0 collapsed to keep the page light
M v4/gtk/gtkcombobox.go +161 -13 collapsed to keep the page light
M v4/gtk/gtkcomboboxtext.go +155 -15 collapsed to keep the page light
M v4/gtk/gtkconstraint.go +3 -3 collapsed to keep the page light
M v4/gtk/gtkconstraintguide.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkconstraintlayout.go +13 -2 collapsed to keep the page light
M v4/gtk/gtkcsserror.go +11 -0 collapsed to keep the page light
M v4/gtk/gtkcsslocation.go +1 -12 collapsed to keep the page light
M v4/gtk/gtkcssprovider.go +32 -3 collapsed to keep the page light
M v4/gtk/gtkcsssection.go +23 -1 collapsed to keep the page light
M v4/gtk/gtkcustomfilter.go +10 -11 collapsed to keep the page light
M v4/gtk/gtkcustomlayout.go +3 -3 collapsed to keep the page light
M v4/gtk/gtkcustomsorter.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkdebug.go +8 -6 collapsed to keep the page light
M v4/gtk/gtkdialog.go +155 -11 collapsed to keep the page light
A v4/gtk/gtkdialogerror.go +56 -0 collapsed to keep the page light
M v4/gtk/gtkdirectorylist.go +4 -4 collapsed to keep the page light
M v4/gtk/gtkdragicon.go +169 -33 collapsed to keep the page light
M v4/gtk/gtkdragsource.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkdrawingarea.go +154 -17 collapsed to keep the page light
M v4/gtk/gtkdropcontrollermotion.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkdropdown.go +219 -18 collapsed to keep the page light
M v4/gtk/gtkdroptarget.go +3 -3 collapsed to keep the page light
M v4/gtk/gtkdroptargetasync.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkeditable.go +46 -1 collapsed to keep the page light
M v4/gtk/gtkeditablelabel.go +208 -13 collapsed to keep the page light
M v4/gtk/gtkemojichooser.go +165 -13 collapsed to keep the page light
M v4/gtk/gtkentry.go +207 -20 collapsed to keep the page light
M v4/gtk/gtkentrybuffer.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkentrycompletion.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkenums.go +251 -31 collapsed to keep the page light
M v4/gtk/gtkeventcontroller.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerfocus.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerkey.go +3 -4 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerlegacy.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkeventcontrollermotion.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkeventcontrollerscroll.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkexpander.go +164 -24 collapsed to keep the page light
M v4/gtk/gtkexpression.go +34 -9 collapsed to keep the page light
M v4/gtk/gtkfilechooserdialog.go +152 -12 collapsed to keep the page light
M v4/gtk/gtkfilechooserwidget.go +166 -10 collapsed to keep the page light
A v4/gtk/gtkfiledialog.go +637 -0 collapsed to keep the page light
M v4/gtk/gtkfilefilter.go +18 -14 collapsed to keep the page light
A v4/gtk/gtkfilelauncher.go +221 -0 collapsed to keep the page light
M v4/gtk/gtkfilter.go +16 -17 collapsed to keep the page light
M v4/gtk/gtkfilterlistmodel.go +37 -4 collapsed to keep the page light
M v4/gtk/gtkfixed.go +146 -11 collapsed to keep the page light
M v4/gtk/gtkfixedlayout.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkflattenlistmodel.go +35 -4 collapsed to keep the page light
M v4/gtk/gtkflowbox.go +327 -26 collapsed to keep the page light
M v4/gtk/gtkfontbutton.go +151 -11 collapsed to keep the page light
M v4/gtk/gtkfontchooserdialog.go +156 -11 collapsed to keep the page light
M v4/gtk/gtkfontchooserwidget.go +145 -10 collapsed to keep the page light
A v4/gtk/gtkfontdialog.go +358 -0 collapsed to keep the page light
A v4/gtk/gtkfontdialogbutton.go +604 -0 collapsed to keep the page light
M v4/gtk/gtkframe.go +158 -15 collapsed to keep the page light
M v4/gtk/gtkgesture.go +48 -5 collapsed to keep the page light
M v4/gtk/gtkgestureclick.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkgesturedrag.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkgesturelongpress.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkgesturepan.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkgesturerotate.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkgesturesingle.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkgesturestylus.go +27 -1 collapsed to keep the page light
M v4/gtk/gtkgestureswipe.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkgesturezoom.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkglarea.go +209 -13 collapsed to keep the page light
A v4/gtk/gtkgraphicsoffload.go +497 -0 collapsed to keep the page light
M v4/gtk/gtkgrid.go +155 -14 collapsed to keep the page light
M v4/gtk/gtkgridlayout.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkgridview.go +190 -14 collapsed to keep the page light
M v4/gtk/gtkheaderbar.go +189 -25 collapsed to keep the page light
M v4/gtk/gtkicontheme.go +15 -7 collapsed to keep the page light
M v4/gtk/gtkiconview.go +156 -13 collapsed to keep the page light
M v4/gtk/gtkimage.go +153 -13 collapsed to keep the page light
M v4/gtk/gtkimcontext.go +220 -40 collapsed to keep the page light
M v4/gtk/gtkimcontextsimple.go +7 -3 collapsed to keep the page light
M v4/gtk/gtkimmodule.go +1 -0 collapsed to keep the page light
M v4/gtk/gtkimmulticontext.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkinfobar.go +153 -13 collapsed to keep the page light
M v4/gtk/gtkinscription.go +188 -12 collapsed to keep the page light
M v4/gtk/gtklabel.go +352 -143 collapsed to keep the page light
M v4/gtk/gtklayoutchild.go +1 -2 collapsed to keep the page light
M v4/gtk/gtklayoutmanager.go +39 -2 collapsed to keep the page light
M v4/gtk/gtklevelbar.go +157 -17 collapsed to keep the page light
M v4/gtk/gtklinkbutton.go +168 -15 collapsed to keep the page light
M v4/gtk/gtklistbase.go +189 -11 collapsed to keep the page light
M v4/gtk/gtklistbox.go +369 -30 collapsed to keep the page light
A v4/gtk/gtklistheader.go +158 -0 collapsed to keep the page light
M v4/gtk/gtklistitem.go +90 -17 collapsed to keep the page light
M v4/gtk/gtklistitemfactory.go +4 -5 collapsed to keep the page light
M v4/gtk/gtkliststore.go +35 -16 collapsed to keep the page light
M v4/gtk/gtklistview.go +231 -17 collapsed to keep the page light
M v4/gtk/gtklockbutton.go +169 -14 collapsed to keep the page light
M v4/gtk/gtkmain.go +59 -42 collapsed to keep the page light
M v4/gtk/gtkmaplistmodel.go +35 -1 collapsed to keep the page light
M v4/gtk/gtkmediacontrols.go +152 -12 collapsed to keep the page light
M v4/gtk/gtkmediafile.go +5 -4 collapsed to keep the page light
M v4/gtk/gtkmediastream.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkmenubutton.go +201 -14 collapsed to keep the page light
M v4/gtk/gtkmessagedialog.go +152 -12 collapsed to keep the page light
M v4/gtk/gtkmountoperation.go +6 -6 collapsed to keep the page light
M v4/gtk/gtkmultifilter.go +10 -11 collapsed to keep the page light
M v4/gtk/gtkmultiselection.go +34 -3 collapsed to keep the page light
M v4/gtk/gtkmultisorter.go +2 -3 collapsed to keep the page light
M v4/gtk/gtknative.go +1 -2 collapsed to keep the page light
M v4/gtk/gtknativedialog.go +5 -3 collapsed to keep the page light
M v4/gtk/gtknoselection.go +36 -3 collapsed to keep the page light
M v4/gtk/gtknotebook.go +224 -35 collapsed to keep the page light
M v4/gtk/gtknumericsorter.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkorientable.go +7 -2 collapsed to keep the page light
M v4/gtk/gtkoverlay.go +152 -13 collapsed to keep the page light
M v4/gtk/gtkoverlaylayout.go +2 -2 collapsed to keep the page light
M v4/gtk/gtkpadcontroller.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkpagesetup.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkpagesetupunixdialog.go +158 -13 collapsed to keep the page light
M v4/gtk/gtkpaned.go +174 -16 collapsed to keep the page light
M v4/gtk/gtkpasswordentry.go +195 -13 collapsed to keep the page light
M v4/gtk/gtkpicture.go +155 -15 collapsed to keep the page light
M v4/gtk/gtkpopover.go +196 -31 collapsed to keep the page light
M v4/gtk/gtkpopovermenu.go +196 -45 collapsed to keep the page light
M v4/gtk/gtkpopovermenubar.go +155 -16 collapsed to keep the page light
M v4/gtk/gtkprintcontext.go +1 -1 collapsed to keep the page light
A v4/gtk/gtkprintdialog.go +425 -0 collapsed to keep the page light
M v4/gtk/gtkprinter.go +4 -3 collapsed to keep the page light
M v4/gtk/gtkprintjob.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkprintoperation.go +63 -11 collapsed to keep the page light
M v4/gtk/gtkprintoperationpreview.go +1 -2 collapsed to keep the page light
M v4/gtk/gtkprintsettings.go +45 -29 collapsed to keep the page light
M v4/gtk/gtkprintunixdialog.go +153 -13 collapsed to keep the page light
M v4/gtk/gtkprogressbar.go +155 -16 collapsed to keep the page light
M v4/gtk/gtkrange.go +152 -12 collapsed to keep the page light
M v4/gtk/gtkrecentmanager.go +13 -2 collapsed to keep the page light
M v4/gtk/gtkrevealer.go +147 -12 collapsed to keep the page light
M v4/gtk/gtkroot.go +4 -4 collapsed to keep the page light
M v4/gtk/gtkscale.go +174 -22 collapsed to keep the page light
M v4/gtk/gtkscalebutton.go +195 -13 collapsed to keep the page light
M v4/gtk/gtkscrollable.go +1 -1 collapsed to keep the page light
M v4/gtk/gtkscrollbar.go +153 -13 collapsed to keep the page light
M v4/gtk/gtkscrolledwindow.go +174 -34 collapsed to keep the page light
M v4/gtk/gtksearchbar.go +160 -14
| @@ -8,9 +8,14 @@ import ( | |||
| 8 | 8 | "github.com/jwijenbergh/puregotk/v4/gobject/types" | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | - | // `GtkSearchBar` is a container made to have a search entry. | |
| 11 | + | // Reveals a search entry when search is started. | |
| 12 | 12 | // | |
| 13 | - | //  | |
| 13 | + | // <picture> | |
| 14 | + | // | |
| 15 | + | // <source srcset="search-bar-dark.png" media="(prefers-color-scheme: dark)"> | |
| 16 | + | // <img alt="An example GtkSearchBar" src="search-bar.png"> | |
| 17 | + | // | |
| 18 | + | // </picture> | |
| 14 | 19 | // | |
| 15 | 20 | // It can also contain additional widgets, such as drop-down menus, | |
| 16 | 21 | // or buttons. The search bar would appear when a search is started | |
| @@ -34,6 +39,12 @@ import ( | |||
| 34 | 39 | // | |
| 35 | 40 | // [A simple example](https://gitlab.gnome.org/GNOME/gtk/tree/main/examples/search-bar.c) | |
| 36 | 41 | // | |
| 42 | + | // # Shortcuts and Gestures | |
| 43 | + | // | |
| 44 | + | // `GtkSearchBar` supports the following keyboard shortcuts: | |
| 45 | + | // | |
| 46 | + | // - <kbd>Escape</kbd> hides the search bar. | |
| 47 | + | // | |
| 37 | 48 | // # CSS nodes | |
| 38 | 49 | // | |
| 39 | 50 | // ``` | |
| @@ -53,7 +64,7 @@ import ( | |||
| 53 | 64 | // | |
| 54 | 65 | // # Accessibility | |
| 55 | 66 | // | |
| 56 | - | // `GtkSearchBar` uses the %GTK_ACCESSIBLE_ROLE_SEARCH role. | |
| 67 | + | // `GtkSearchBar` uses the [enum@Gtk.AccessibleRole.search] role. | |
| 57 | 68 | type SearchBar struct { | |
| 58 | 69 | Widget | |
| 59 | 70 | } | |
| @@ -92,7 +103,7 @@ func NewSearchBar() *SearchBar { | |||
| 92 | 103 | ||
| 93 | 104 | var xSearchBarConnectEntry func(uintptr, uintptr) | |
| 94 | 105 | ||
| 95 | - | // Connects the `GtkEditable widget passed as the one to be used in | |
| 106 | + | // Connects the `GtkEditable` widget passed as the one to be used in | |
| 96 | 107 | // this search bar. | |
| 97 | 108 | // | |
| 98 | 109 | // The entry should be a descendant of the search bar. Calling this | |
| @@ -218,34 +229,165 @@ func (c *SearchBar) SetGoPointer(ptr uintptr) { | |||
| 218 | 229 | c.Ptr = ptr | |
| 219 | 230 | } | |
| 220 | 231 | ||
| 221 | - | // Retrieves the `GtkAccessibleRole` for the given `GtkAccessible`. | |
| 232 | + | // Requests the user's screen reader to announce the given message. | |
| 233 | + | // | |
| 234 | + | // This kind of notification is useful for messages that | |
| 235 | + | // either have only a visual representation or that are not | |
| 236 | + | // exposed visually at all, e.g. a notification about a | |
| 237 | + | // successful operation. | |
| 238 | + | // | |
| 239 | + | // Also, by using this API, you can ensure that the message | |
| 240 | + | // does not interrupts the user's current screen reader output. | |
| 241 | + | func (x *SearchBar) Announce(MessageVar string, PriorityVar AccessibleAnnouncementPriority) { | |
| 242 | + | ||
| 243 | + | XGtkAccessibleAnnounce(x.GoPointer(), MessageVar, PriorityVar) | |
| 244 | + | ||
| 245 | + | } | |
| 246 | + | ||
| 247 | + | // Retrieves the accessible parent for an accessible object. | |
| 248 | + | // | |
| 249 | + | // This function returns `NULL` for top level widgets. | |
| 250 | + | func (x *SearchBar) GetAccessibleParent() *AccessibleBase { | |
| 251 | + | var cls *AccessibleBase | |
| 252 | + | ||
| 253 | + | cret := XGtkAccessibleGetAccessibleParent(x.GoPointer()) | |
| 254 | + | ||
| 255 | + | if cret == 0 { | |
| 256 | + | return nil | |
| 257 | + | } | |
| 258 | + | cls = &AccessibleBase{} | |
| 259 | + | cls.Ptr = cret | |
| 260 | + | return cls | |
| 261 | + | } | |
| 262 | + | ||
| 263 | + | // Retrieves the accessible role of an accessible object. | |
| 222 | 264 | func (x *SearchBar) GetAccessibleRole() AccessibleRole { | |
| 223 | 265 | ||
| 224 | 266 | cret := XGtkAccessibleGetAccessibleRole(x.GoPointer()) | |
| 225 | 267 | return cret | |
| 226 | 268 | } | |
| 227 | 269 | ||
| 228 | - | // Resets the accessible @property to its default value. | |
| 270 | + | // Retrieves the implementation for the given accessible object. | |
| 271 | + | func (x *SearchBar) GetAtContext() *ATContext { | |
| 272 | + | var cls *ATContext | |
| 273 | + | ||
| 274 | + | cret := XGtkAccessibleGetAtContext(x.GoPointer()) | |
| 275 | + | ||
| 276 | + | if cret == 0 { | |
| 277 | + | return nil | |
| 278 | + | } | |
| 279 | + | cls = &ATContext{} | |
| 280 | + | cls.Ptr = cret | |
| 281 | + | return cls | |
| 282 | + | } | |
| 283 | + | ||
| 284 | + | // Queries the coordinates and dimensions of this accessible | |
| 285 | + | // | |
| 286 | + | // This functionality can be overridden by `GtkAccessible` | |
| 287 | + | // implementations, e.g. to get the bounds from an ignored | |
| 288 | + | // child widget. | |
| 289 | + | func (x *SearchBar) GetBounds(XVar int, YVar int, WidthVar int, HeightVar int) bool { | |
| 290 | + | ||
| 291 | + | cret := XGtkAccessibleGetBounds(x.GoPointer(), XVar, YVar, WidthVar, HeightVar) | |
| 292 | + | return cret | |
| 293 | + | } | |
| 294 | + | ||
| 295 | + | // Retrieves the first accessible child of an accessible object. | |
| 296 | + | func (x *SearchBar) GetFirstAccessibleChild() *AccessibleBase { | |
| 297 | + | var cls *AccessibleBase | |
| 298 | + | ||
| 299 | + | cret := XGtkAccessibleGetFirstAccessibleChild(x.GoPointer()) | |
| 300 | + | ||
| 301 | + | if cret == 0 { | |
| 302 | + | return nil | |
| 303 | + | } | |
| 304 | + | cls = &AccessibleBase{} | |
| 305 | + | cls.Ptr = cret | |
| 306 | + | return cls | |
| 307 | + | } | |
| 308 | + | ||
| 309 | + | // Retrieves the next accessible sibling of an accessible object | |
| 310 | + | func (x *SearchBar) GetNextAccessibleSibling() *AccessibleBase { | |
| 311 | + | var cls *AccessibleBase | |
| 312 | + | ||
| 313 | + | cret := XGtkAccessibleGetNextAccessibleSibling(x.GoPointer()) | |
| 314 | + | ||
| 315 | + | if cret == 0 { | |
| 316 | + | return nil | |
| 317 | + | } | |
| 318 | + | cls = &AccessibleBase{} | |
| 319 | + | cls.Ptr = cret | |
| 320 | + | return cls | |
| 321 | + | } | |
| 322 | + | ||
| 323 | + | // Queries a platform state, such as focus. | |
| 324 | + | // | |
| 325 | + | // This functionality can be overridden by `GtkAccessible` | |
| 326 | + | // implementations, e.g. to get platform state from an ignored | |
| 327 | + | // child widget, as is the case for `GtkText` wrappers. | |
| 328 | + | func (x *SearchBar) GetPlatformState(StateVar AccessiblePlatformState) bool { | |
| 329 | + | ||
| 330 | + | cret := XGtkAccessibleGetPlatformState(x.GoPointer(), StateVar) | |
| 331 | + | return cret | |
| 332 | + | } | |
| 333 | + | ||
| 334 | + | // Resets the accessible property to its default value. | |
| 229 | 335 | func (x *SearchBar) ResetProperty(PropertyVar AccessibleProperty) { | |
| 230 | 336 | ||
| 231 | 337 | XGtkAccessibleResetProperty(x.GoPointer(), PropertyVar) | |
| 232 | 338 | ||
| 233 | 339 | } | |
| 234 | 340 | ||
| 235 | - | // Resets the accessible @relation to its default value. | |
| 341 | + | // Resets the accessible relation to its default value. | |
| 236 | 342 | func (x *SearchBar) ResetRelation(RelationVar AccessibleRelation) { | |
| 237 | 343 | ||
| 238 | 344 | XGtkAccessibleResetRelation(x.GoPointer(), RelationVar) | |
| 239 | 345 | ||
| 240 | 346 | } | |
| 241 | 347 | ||
| 242 | - | // Resets the accessible @state to its default value. | |
| 348 | + | // Resets the accessible state to its default value. | |
| 243 | 349 | func (x *SearchBar) ResetState(StateVar AccessibleState) { | |
| 244 | 350 | ||
| 245 | 351 | XGtkAccessibleResetState(x.GoPointer(), StateVar) | |
| 246 | 352 | ||
| 247 | 353 | } | |
| 248 | 354 | ||
| 355 | + | // Sets the parent and sibling of an accessible object. | |
| 356 | + | // | |
| 357 | + | // This function is meant to be used by accessible implementations that are | |
| 358 | + | // not part of the widget hierarchy, and but act as a logical bridge between | |
| 359 | + | // widgets. For instance, if a widget creates an object that holds metadata | |
| 360 | + | // for each child, and you want that object to implement the `GtkAccessible` | |
| 361 | + | // interface, you will use this function to ensure that the parent of each | |
| 362 | + | // child widget is the metadata object, and the parent of each metadata | |
| 363 | + | // object is the container widget. | |
| 364 | + | func (x *SearchBar) SetAccessibleParent(ParentVar Accessible, NextSiblingVar Accessible) { | |
| 365 | + | ||
| 366 | + | XGtkAccessibleSetAccessibleParent(x.GoPointer(), ParentVar.GoPointer(), NextSiblingVar.GoPointer()) | |
| 367 | + | ||
| 368 | + | } | |
| 369 | + | ||
| 370 | + | // Updates the next accessible sibling. | |
| 371 | + | // | |
| 372 | + | // That might be useful when a new child of a custom accessible | |
| 373 | + | // is created, and it needs to be linked to a previous child. | |
| 374 | + | func (x *SearchBar) UpdateNextAccessibleSibling(NewSiblingVar Accessible) { | |
| 375 | + | ||
| 376 | + | XGtkAccessibleUpdateNextAccessibleSibling(x.GoPointer(), NewSiblingVar.GoPointer()) | |
| 377 | + | ||
| 378 | + | } | |
| 379 | + | ||
| 380 | + | // Informs ATs that the platform state has changed. | |
| 381 | + | // | |
| 382 | + | // This function should be used by `GtkAccessible` implementations that | |
| 383 | + | // have a platform state but are not widgets. Widgets handle platform | |
| 384 | + | // states automatically. | |
| 385 | + | func (x *SearchBar) UpdatePlatformState(StateVar AccessiblePlatformState) { | |
| 386 | + | ||
| 387 | + | XGtkAccessibleUpdatePlatformState(x.GoPointer(), StateVar) | |
| 388 | + | ||
| 389 | + | } | |
| 390 | + | ||
| 249 | 391 | // Updates a list of accessible properties. | |
| 250 | 392 | // | |
| 251 | 393 | // See the [enum@Gtk.AccessibleProperty] documentation for the | |
| @@ -288,7 +430,7 @@ func (x *SearchBar) UpdatePropertyValue(NPropertiesVar int, PropertiesVar []Acce | |||
| 288 | 430 | // relation change must be communicated to assistive technologies. | |
| 289 | 431 | // | |
| 290 | 432 | // If the [enum@Gtk.AccessibleRelation] requires a list of references, | |
| 291 | - | // you should pass each reference individually, followed by %NULL, e.g. | |
| 433 | + | // you should pass each reference individually, followed by `NULL`, e.g. | |
| 292 | 434 | // | |
| 293 | 435 | // ```c | |
| 294 | 436 | // gtk_accessible_update_relation (accessible, | |
| @@ -318,13 +460,17 @@ func (x *SearchBar) UpdateRelationValue(NRelationsVar int, RelationsVar []Access | |||
| 318 | 460 | ||
| 319 | 461 | } | |
| 320 | 462 | ||
| 321 | - | // Updates a list of accessible states. See the [enum@Gtk.AccessibleState] | |
| 322 | - | // documentation for the value types of accessible states. | |
| 463 | + | // Updates a list of accessible states. | |
| 323 | 464 | // | |
| 324 | - | // This function should be called by `GtkWidget` types whenever an accessible | |
| 325 | - | // state change must be communicated to assistive technologies. | |
| 465 | + | // See the [enum@Gtk.AccessibleState] documentation for the | |
| 466 | + | // value types of accessible states. | |
| 467 | + | // | |
| 468 | + | // This function should be called by `GtkWidget` types whenever | |
| 469 | + | // an accessible state change must be communicated to assistive | |
| 470 | + | // technologies. | |
| 326 | 471 | // | |
| 327 | 472 | // Example: | |
| 473 | + | // | |
| 328 | 474 | // ```c | |
| 329 | 475 | // value = GTK_ACCESSIBLE_TRISTATE_MIXED; | |
| 330 | 476 | // gtk_accessible_update_state (GTK_ACCESSIBLE (check_button), | |
| @@ -354,7 +500,7 @@ func (x *SearchBar) UpdateStateValue(NStatesVar int, StatesVar []AccessibleState | |||
| 354 | 500 | // Gets the ID of the @buildable object. | |
| 355 | 501 | // | |
| 356 | 502 | // `GtkBuilder` sets the name based on the ID attribute | |
| 357 | - | // of the <object> tag used to construct the @buildable. | |
| 503 | + | // of the `<object>` tag used to construct the @buildable. | |
| 358 | 504 | func (x *SearchBar) GetBuildableId() string { | |
| 359 | 505 | ||
| 360 | 506 | cret := XGtkBuildableGetBuildableId(x.GoPointer()) | |