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

View File

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