Skip to content
This repository was archived by the owner on Mar 4, 2024. It is now read-only.

Commit 22f0007

Browse files
atk: version guard AtkState::Collapsed
Also ignore the last_defined member, it is not useful
1 parent c73d5c2 commit 22f0007

File tree

6 files changed

+32
-6
lines changed

6 files changed

+32
-6
lines changed

atk/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ dox = ["ffi/dox"]
2525
v2_30 = ["ffi/v2_30"]
2626
v2_32 = ["v2_30", "ffi/v2_32"]
2727
v2_34 = ["v2_32", "ffi/v2_34"]
28+
v2_38 = ["v2_34", "ffi/v2_38"]
2829

2930
[package.metadata.docs.rs]
3031
features = ["dox"]

atk/Gir.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,12 @@ status = "generate"
160160
[[object]]
161161
name = "Atk.StateType"
162162
status = "generate"
163+
[[object.member]]
164+
name = "collapsed"
165+
version = "2.38"
166+
[[object.member]]
167+
name = "last_defined"
168+
alias = true # not useful
163169
[[object.function]]
164170
name = "register"
165171
# Problematic function needs manual implementation

atk/src/auto/enums.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,10 +1362,10 @@ pub enum StateType {
13621362
HasTooltip,
13631363
#[doc(alias = "ATK_STATE_READ_ONLY")]
13641364
ReadOnly,
1365+
#[cfg(any(feature = "v2_38", feature = "dox"))]
1366+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_38")))]
13651367
#[doc(alias = "ATK_STATE_COLLAPSED")]
13661368
Collapsed,
1367-
#[doc(alias = "ATK_STATE_LAST_DEFINED")]
1368-
LastDefined,
13691369
#[doc(hidden)]
13701370
__Unknown(i32),
13711371
}
@@ -1434,8 +1434,8 @@ impl fmt::Display for StateType {
14341434
Self::HasPopup => "HasPopup",
14351435
Self::HasTooltip => "HasTooltip",
14361436
Self::ReadOnly => "ReadOnly",
1437+
#[cfg(any(feature = "v2_38", feature = "dox"))]
14371438
Self::Collapsed => "Collapsed",
1438-
Self::LastDefined => "LastDefined",
14391439
_ => "Unknown",
14401440
}
14411441
)
@@ -1491,8 +1491,8 @@ impl IntoGlib for StateType {
14911491
Self::HasPopup => ffi::ATK_STATE_HAS_POPUP,
14921492
Self::HasTooltip => ffi::ATK_STATE_HAS_TOOLTIP,
14931493
Self::ReadOnly => ffi::ATK_STATE_READ_ONLY,
1494+
#[cfg(any(feature = "v2_38", feature = "dox"))]
14941495
Self::Collapsed => ffi::ATK_STATE_COLLAPSED,
1495-
Self::LastDefined => ffi::ATK_STATE_LAST_DEFINED,
14961496
Self::__Unknown(value) => value,
14971497
}
14981498
}
@@ -1546,8 +1546,8 @@ impl FromGlib<ffi::AtkStateType> for StateType {
15461546
ffi::ATK_STATE_HAS_POPUP => Self::HasPopup,
15471547
ffi::ATK_STATE_HAS_TOOLTIP => Self::HasTooltip,
15481548
ffi::ATK_STATE_READ_ONLY => Self::ReadOnly,
1549+
#[cfg(any(feature = "v2_38", feature = "dox"))]
15491550
ffi::ATK_STATE_COLLAPSED => Self::Collapsed,
1550-
ffi::ATK_STATE_LAST_DEFINED => Self::LastDefined,
15511551
value => Self::__Unknown(value),
15521552
}
15531553
}

atk/sys/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ v2_30 = []
2121
v2_32 = ["v2_30"]
2222
v2_34 = ["v2_32"]
2323
dox = []
24+
v2_38 = ["v2_34"]
2425

2526
[lib]
2627
name = "atk_sys"
@@ -53,3 +54,6 @@ version = "2.32"
5354

5455
[package.metadata.system-deps.atk.v2_34]
5556
version = "2.34"
57+
58+
[package.metadata.system-deps.atk.v2_38]
59+
version = "2.38"

atk/sys/Gir.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,17 @@ ignore = [
1919
"Atk.MINOR_VERSION",
2020
"Atk.VERSION_MIN_REQUIRED",
2121
]
22+
23+
extra_versions = [
24+
"2.38"
25+
]
26+
27+
[[object]]
28+
name = "Atk.StateType"
29+
status = "generate"
30+
[[object.member]]
31+
name = "collapsed"
32+
version = "2.38"
33+
[[object.member]]
34+
name = "last_defined"
35+
alias = true # not useful and should fix -sys tests

atk/sys/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,9 @@ pub const ATK_STATE_CHECKABLE: AtkStateType = 39;
252252
pub const ATK_STATE_HAS_POPUP: AtkStateType = 40;
253253
pub const ATK_STATE_HAS_TOOLTIP: AtkStateType = 41;
254254
pub const ATK_STATE_READ_ONLY: AtkStateType = 42;
255+
#[cfg(any(feature = "v2_38", feature = "dox"))]
256+
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_38")))]
255257
pub const ATK_STATE_COLLAPSED: AtkStateType = 43;
256-
pub const ATK_STATE_LAST_DEFINED: AtkStateType = 44;
257258

258259
pub type AtkTextAttribute = c_int;
259260
pub const ATK_TEXT_ATTR_INVALID: AtkTextAttribute = 0;

0 commit comments

Comments
 (0)