Generate doc comments in the gegl_enum macro.

This commit is contained in:
Bauke 2024-01-27 18:32:58 +01:00
parent 95d611afdb
commit a670fb66b3
Signed by: Bauke
GPG Key ID: C1C0F29952BCF558
2 changed files with 14 additions and 2 deletions

View File

@ -3,6 +3,7 @@
use crate::gegl_enum;
gegl_enum!(
/// The shape for [`FocusBlur`][super::FocusBlur].
FocusBlurShape,
Circle => "circle",
Square => "square",
@ -12,24 +13,28 @@ gegl_enum!(
);
gegl_enum!(
/// The type for [`FocusBlur`][super::FocusBlur].
FocusBlurType,
Gaussian => "gaussian",
Lens => "lens",
);
gegl_enum!(
/// The algorithm type for [`Maze`][super::Maze].
MazeAlgorithmType,
DepthFirst => "depth-first",
Prim => "prim",
);
gegl_enum!(
/// The abyss policy for [`MedianBlur`][super::MedianBlur].
MedianBlurAbyssPolicy,
None => "none",
Clamp => "clamp",
);
gegl_enum!(
/// The neighborhood for [`MedianBlur`][super::MedianBlur].
MedianBlurNeighborhood,
Square => "square",
Circle => "circle",
@ -37,6 +42,7 @@ gegl_enum!(
);
gegl_enum!(
/// The tile type for [`Mosaic`][super::Mosaic].
MosaicTileType,
Squares => "squares",
Hexagons => "hexagons",
@ -45,6 +51,7 @@ gegl_enum!(
);
gegl_enum!(
/// The pattern for [`Newsprint`][super::Newsprint].
NewsprintPattern,
Line => "line",
Circle => "circle",
@ -54,6 +61,7 @@ gegl_enum!(
);
gegl_enum!(
/// The color model for [`Newsprint`][super::Newsprint].
NewsprintColorModel,
BlackOnWhite => "black-on-white",
Cmyk => "cmyk",
@ -62,6 +70,7 @@ gegl_enum!(
);
gegl_enum!(
/// The sampler type for [`StereographicProjection`][super::StereographicProjection].
StereographicProjectionSamplerType,
Nearest => "nearest",
Linear => "linear",
@ -71,12 +80,14 @@ gegl_enum!(
);
gegl_enum!(
/// The fill for [`Waterpixels`][super::Waterpixels].
WaterpixelsFill,
Average => "average",
Random => "random",
);
gegl_enum!(
/// The sampler type for [`Waves`][super::Waves].
WavesSamplerType,
Nearest => "nearest",
Linear => "linear",

View File

@ -57,14 +57,15 @@ macro_rules! gegl_operation {
#[macro_export]
macro_rules! gegl_enum {
(
$(#[$enum_meta:meta])*
$enum_name:ident,
$($key:ident => $value:expr),*,
) => {
#[doc = "TODO: Generate documentation for [`gegl_enum!`]."]
$(#[$enum_meta])*
#[derive(Debug)]
pub enum $enum_name {
$(
#[doc = "TODO: Generate documentation for [`gegl_enum!`]."]
#[doc = concat!("The [`", stringify!($enum_name), "`] `", $value, "`." )]
$key,
)*
}