Skip to content

Commit 658489f

Browse files
committed
Update gir: Use docsrs attribute
1 parent 4a6b26b commit 658489f

File tree

168 files changed

+2657
-2679
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+2657
-2679
lines changed

.github/workflows/docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
0.16=0.16
1919
0.15=0.15
2020
0.14=0.14
21+
RUSTFLAGS: --cfg docsrs
2122
steps:
2223
- uses: actions/checkout@v3
2324
with:
@@ -37,7 +38,7 @@ jobs:
3738
- uses: actions-rs/cargo@v1
3839
with:
3940
command: doc
40-
args: -p cairo-rs -p cairo-sys-rs -p gdk-pixbuf -p gdk-pixbuf-sys -p gio -p gio-sys -p glib -p gobject-sys -p glib-sys -p glib-macros -p glib-build-tools -p graphene-rs -p graphene-sys -p pango -p pango-sys -p pangocairo -p pangocairo-sys --features dox --no-deps
41+
args: -p cairo-rs -p cairo-sys-rs -p gdk-pixbuf -p gdk-pixbuf-sys -p gio -p gio-sys -p glib -p gobject-sys -p glib-sys -p glib-macros -p glib-build-tools -p graphene-rs -p graphene-sys -p pango -p pango-sys -p pangocairo -p pangocairo-sys --no-deps
4142
- run: echo "RELEASE=$(echo '${{ github.event.release.tag_name }}' | grep -Po '(\d+)\.(\d+)')" >> ${GITHUB_ENV}
4243
- run: echo "DEST=$(if [ "$GITHUB_EVENT_NAME" == "release" ]; then echo 'stable/${{ env.RELEASE }}'; else echo 'git'; fi)" >> ${GITHUB_ENV}
4344
- name: Grab gtk-rs LOGO

cairo/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ freetype = ["ffi/freetype", "freetype-rs"]
2828
script = ["ffi/script"]
2929
xcb = ["ffi/xcb"]
3030
xlib = ["ffi/xlib"]
31-
dox = ["ffi/dox", "glib/dox", "freetype"]
3231
win32-surface = ["ffi/win32-surface"]
3332

3433
[package.metadata.docs.rs]
35-
features = ["dox"]
34+
rustdoc-args = ["--cfg", "docsrs"]
3635

3736
[dependencies.glib]
3837
optional = true

cairo/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ Currently, the minimum supported Rust version is `1.64.0`.
3131
* [Rust API - Development](https://gtk-rs.org/gtk-rs-core/git/docs/cairo)
3232
* [C API](https://www.cairographics.org/documentation/)
3333

34-
## Documentation features
35-
36-
* **dox** - Used to keep system dependent items in documentation
37-
3834
## X Window features
3935

4036
* **xcb** - X Window System rendering using the XCB library
@@ -44,6 +40,10 @@ Currently, the minimum supported Rust version is `1.64.0`.
4440

4541
* **win32-surface** - Microsoft Windows surface support
4642

43+
## Documentation rustdoc attributes
44+
45+
* **docsrs** - Used to keep system dependent items in documentation
46+
4747
## Using
4848

4949
We recommend using [crates from crates.io](https://crates.io/keywords/gtk-rs),

cairo/src/constants.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ pub const MIME_TYPE_UNIQUE_ID: &str = "application/x-cairo.uuid";
88
pub const MIME_TYPE_JBIG2: &str = "application/x-cairo.jbig2";
99
pub const MIME_TYPE_JBIG2_GLOBAL: &str = "application/x-cairo.jbig2-global";
1010
pub const MIME_TYPE_JBIG2_GLOBAL_ID: &str = "application/x-cairo.jbig2-global-id";
11-
#[cfg(any(feature = "v1_16", feature = "dox"))]
11+
#[cfg(any(feature = "v1_16", docsrs))]
1212
pub const MIME_TYPE_CCITT_FAX: &str = "image/g3fax";
13-
#[cfg(any(feature = "v1_16", feature = "dox"))]
13+
#[cfg(any(feature = "v1_16", docsrs))]
1414
pub const MIME_TYPE_CCITT_FAX_PARAMS: &str = "application/x-cairo.ccitt.params";
15-
#[cfg(any(feature = "v1_16", feature = "dox"))]
15+
#[cfg(any(feature = "v1_16", docsrs))]
1616
pub const MIME_TYPE_EPS: &str = "application/postscript";
17-
#[cfg(any(feature = "v1_16", feature = "dox"))]
17+
#[cfg(any(feature = "v1_16", docsrs))]
1818
pub const MIME_TYPE_EPS_PARAMS: &str = "application/x-cairo.eps.params";
1919

20-
#[cfg(any(feature = "v1_16", feature = "dox"))]
20+
#[cfg(any(feature = "v1_16", docsrs))]
2121
pub const PDF_OUTLINE_ROOT: i32 = 0;
2222

23-
#[cfg(any(feature = "v1_16", feature = "dox"))]
23+
#[cfg(any(feature = "v1_16", docsrs))]
2424
pub const CAIRO_TAG_DEST: &str = "cairo.dest";
25-
#[cfg(any(feature = "v1_16", feature = "dox"))]
25+
#[cfg(any(feature = "v1_16", docsrs))]
2626
pub const CAIRO_TAG_LINK: &str = "Link";

cairo/src/context.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,13 +358,13 @@ impl Context {
358358
unsafe { ffi::cairo_get_line_width(self.0.as_ptr()) }
359359
}
360360

361-
#[cfg(any(feature = "v1_18", feature = "dox"))]
361+
#[cfg(any(feature = "v1_18", docsrs))]
362362
#[doc(alias = "cairo_set_hairline")]
363363
pub fn set_hairline(&self, set_hairline: bool) {
364364
unsafe { ffi::cairo_set_hairline(self.0.as_ptr(), set_hairline.into()) }
365365
}
366366

367-
#[cfg(any(feature = "v1_18", feature = "dox"))]
367+
#[cfg(any(feature = "v1_18", docsrs))]
368368
#[doc(alias = "get_hairline")]
369369
#[doc(alias = "cairo_get_hairline")]
370370
pub fn hairline(&self) -> bool {
@@ -926,7 +926,7 @@ impl Context {
926926
self.status().map(|_| (x1, y1, x2, y2))
927927
}
928928

929-
#[cfg(any(feature = "v1_16", feature = "dox"))]
929+
#[cfg(any(feature = "v1_16", docsrs))]
930930
#[doc(alias = "cairo_tag_begin")]
931931
pub fn tag_begin(&self, tag_name: &str, attributes: &str) {
932932
unsafe {
@@ -936,7 +936,7 @@ impl Context {
936936
}
937937
}
938938

939-
#[cfg(any(feature = "v1_16", feature = "dox"))]
939+
#[cfg(any(feature = "v1_16", docsrs))]
940940
#[doc(alias = "cairo_tag_end")]
941941
pub fn tag_end(&self, tag_name: &str) {
942942
unsafe {

cairo/src/device.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
// Take a look at the license at the top of the repository in the LICENSE file.
22

3-
#[cfg(any(feature = "script", feature = "dox"))]
3+
#[cfg(any(feature = "script", docsrs))]
44
use std::ffi::CString;
55
#[cfg(feature = "use_glib")]
66
use std::marker::PhantomData;
7-
#[cfg(any(feature = "script", feature = "dox"))]
7+
#[cfg(any(feature = "script", docsrs))]
88
use std::path::Path;
99
use std::{fmt, ptr};
1010

1111
#[cfg(feature = "use_glib")]
1212
use glib::translate::*;
1313

1414
use crate::{utils::status_to_result, DeviceType, Error};
15-
#[cfg(any(feature = "script", feature = "dox"))]
15+
#[cfg(any(feature = "script", docsrs))]
1616
use crate::{Content, RecordingSurface, ScriptMode, Surface};
1717

1818
#[derive(Debug)]
@@ -56,7 +56,7 @@ impl Device {
5656
self.0.as_ptr()
5757
}
5858

59-
#[cfg(any(feature = "script", feature = "dox"))]
59+
#[cfg(any(feature = "script", docsrs))]
6060
#[doc(alias = "cairo_script_create")]
6161
pub fn create<P: AsRef<Path>>(filename: P) -> Option<Device> {
6262
unsafe {
@@ -71,7 +71,7 @@ impl Device {
7171
}
7272
}
7373

74-
#[cfg(any(feature = "script", feature = "dox"))]
74+
#[cfg(any(feature = "script", docsrs))]
7575
#[doc(alias = "cairo_script_from_recording_surface")]
7676
pub fn from_recording_surface(&self, surface: &RecordingSurface) -> Result<(), Error> {
7777
unsafe {
@@ -81,20 +81,20 @@ impl Device {
8181
}
8282
}
8383

84-
#[cfg(any(feature = "script", feature = "dox"))]
84+
#[cfg(any(feature = "script", docsrs))]
8585
#[doc(alias = "cairo_script_get_mode")]
8686
#[doc(alias = "get_mode")]
8787
pub fn mode(&self) -> ScriptMode {
8888
unsafe { ScriptMode::from(ffi::cairo_script_get_mode(self.to_raw_none())) }
8989
}
9090

91-
#[cfg(any(feature = "script", feature = "dox"))]
91+
#[cfg(any(feature = "script", docsrs))]
9292
#[doc(alias = "cairo_script_set_mode")]
9393
pub fn set_mode(&self, mode: ScriptMode) {
9494
unsafe { ffi::cairo_script_set_mode(self.to_raw_none(), mode.into()) }
9595
}
9696

97-
#[cfg(any(feature = "script", feature = "dox"))]
97+
#[cfg(any(feature = "script", docsrs))]
9898
#[doc(alias = "cairo_script_surface_create")]
9999
pub fn surface_create(
100100
&self,
@@ -112,7 +112,7 @@ impl Device {
112112
}
113113
}
114114

115-
#[cfg(any(feature = "script", feature = "dox"))]
115+
#[cfg(any(feature = "script", docsrs))]
116116
#[doc(alias = "cairo_script_surface_create_for_target")]
117117
pub fn surface_create_for_target(&self, target: impl AsRef<Surface>) -> Result<Surface, Error> {
118118
let target = target.as_ref();
@@ -125,7 +125,7 @@ impl Device {
125125
}
126126
}
127127

128-
#[cfg(any(feature = "script", feature = "dox"))]
128+
#[cfg(any(feature = "script", docsrs))]
129129
#[doc(alias = "cairo_script_write_comment")]
130130
pub fn write_comment(&self, comment: &str) {
131131
unsafe {
@@ -195,7 +195,7 @@ impl Device {
195195
unsafe { ffi::cairo_device_observer_stroke_elapsed(self.to_raw_none()) }
196196
}
197197

198-
#[cfg(any(feature = "xlib", feature = "xcb", feature = "dox"))]
198+
#[cfg(any(feature = "xlib", feature = "xcb", docsrs))]
199199
#[doc(alias = "cairo_xlib_device_debug_cap_xrender_version")]
200200
#[doc(alias = "cairo_xcb_device_debug_cap_xrender_version")]
201201
pub fn debug_cap_xrender_version(&self, _major_version: i32, _minor_version: i32) {
@@ -232,7 +232,7 @@ impl Device {
232232
}
233233
}
234234

235-
#[cfg(any(feature = "xlib", feature = "xcb", feature = "dox"))]
235+
#[cfg(any(feature = "xlib", feature = "xcb", docsrs))]
236236
#[doc(alias = "cairo_xlib_device_debug_get_precision")]
237237
#[doc(alias = "cairo_xcb_device_debug_get_precision")]
238238
pub fn debug_get_precision(&self) -> i32 {
@@ -261,7 +261,7 @@ impl Device {
261261
}
262262
}
263263

264-
#[cfg(any(feature = "xlib", feature = "xcb", feature = "dox"))]
264+
#[cfg(any(feature = "xlib", feature = "xcb", docsrs))]
265265
#[doc(alias = "cairo_xlib_device_debug_set_precision")]
266266
#[doc(alias = "cairo_xcb_device_debug_set_precision")]
267267
pub fn debug_set_precision(&self, _precision: i32) {

0 commit comments

Comments
 (0)