@@ -988,6 +988,120 @@ impl From<EllipsizeMode> for glib::Value {
988
988
}
989
989
}
990
990
991
+ #[ cfg( feature = "v1_57" ) ]
992
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
993
+ #[ derive( Debug , Eq , PartialEq , Ord , PartialOrd , Hash , Clone , Copy ) ]
994
+ #[ non_exhaustive]
995
+ #[ doc( alias = "PangoFontColor" ) ]
996
+ pub enum FontColor {
997
+ #[ doc( alias = "PANGO_FONT_COLOR_FORBIDDEN" ) ]
998
+ Forbidden ,
999
+ #[ doc( alias = "PANGO_FONT_COLOR_REQUIRED" ) ]
1000
+ Required ,
1001
+ #[ doc( alias = "PANGO_FONT_COLOR_DONT_CARE" ) ]
1002
+ DontCare ,
1003
+ #[ doc( hidden) ]
1004
+ __Unknown( i32 ) ,
1005
+ }
1006
+
1007
+ #[ cfg( feature = "v1_57" ) ]
1008
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1009
+ #[ doc( hidden) ]
1010
+ impl IntoGlib for FontColor {
1011
+ type GlibType = ffi:: PangoFontColor ;
1012
+
1013
+ #[ inline]
1014
+ fn into_glib ( self ) -> ffi:: PangoFontColor {
1015
+ match self {
1016
+ Self :: Forbidden => ffi:: PANGO_FONT_COLOR_FORBIDDEN ,
1017
+ Self :: Required => ffi:: PANGO_FONT_COLOR_REQUIRED ,
1018
+ Self :: DontCare => ffi:: PANGO_FONT_COLOR_DONT_CARE ,
1019
+ Self :: __Unknown( value) => value,
1020
+ }
1021
+ }
1022
+ }
1023
+
1024
+ #[ cfg( feature = "v1_57" ) ]
1025
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1026
+ #[ doc( hidden) ]
1027
+ impl FromGlib < ffi:: PangoFontColor > for FontColor {
1028
+ #[ inline]
1029
+ unsafe fn from_glib ( value : ffi:: PangoFontColor ) -> Self {
1030
+ match value {
1031
+ ffi:: PANGO_FONT_COLOR_FORBIDDEN => Self :: Forbidden ,
1032
+ ffi:: PANGO_FONT_COLOR_REQUIRED => Self :: Required ,
1033
+ ffi:: PANGO_FONT_COLOR_DONT_CARE => Self :: DontCare ,
1034
+ value => Self :: __Unknown ( value) ,
1035
+ }
1036
+ }
1037
+ }
1038
+
1039
+ #[ cfg( feature = "v1_57" ) ]
1040
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1041
+ impl StaticType for FontColor {
1042
+ #[ inline]
1043
+ #[ doc( alias = "pango_font_color_get_type" ) ]
1044
+ fn static_type ( ) -> glib:: Type {
1045
+ unsafe { from_glib ( ffi:: pango_font_color_get_type ( ) ) }
1046
+ }
1047
+ }
1048
+
1049
+ #[ cfg( feature = "v1_57" ) ]
1050
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1051
+ impl glib:: HasParamSpec for FontColor {
1052
+ type ParamSpec = glib:: ParamSpecEnum ;
1053
+ type SetValue = Self ;
1054
+ type BuilderFn = fn ( & str , Self ) -> glib:: ParamSpecEnumBuilder < Self > ;
1055
+
1056
+ fn param_spec_builder ( ) -> Self :: BuilderFn {
1057
+ Self :: ParamSpec :: builder_with_default
1058
+ }
1059
+ }
1060
+
1061
+ #[ cfg( feature = "v1_57" ) ]
1062
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1063
+ impl glib:: value:: ValueType for FontColor {
1064
+ type Type = Self ;
1065
+ }
1066
+
1067
+ #[ cfg( feature = "v1_57" ) ]
1068
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1069
+ unsafe impl < ' a > glib:: value:: FromValue < ' a > for FontColor {
1070
+ type Checker = glib:: value:: GenericValueTypeChecker < Self > ;
1071
+
1072
+ #[ inline]
1073
+ unsafe fn from_value ( value : & ' a glib:: Value ) -> Self {
1074
+ from_glib ( glib:: gobject_ffi:: g_value_get_enum ( value. to_glib_none ( ) . 0 ) )
1075
+ }
1076
+ }
1077
+
1078
+ #[ cfg( feature = "v1_57" ) ]
1079
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1080
+ impl ToValue for FontColor {
1081
+ #[ inline]
1082
+ fn to_value ( & self ) -> glib:: Value {
1083
+ let mut value = glib:: Value :: for_value_type :: < Self > ( ) ;
1084
+ unsafe {
1085
+ glib:: gobject_ffi:: g_value_set_enum ( value. to_glib_none_mut ( ) . 0 , self . into_glib ( ) ) ;
1086
+ }
1087
+ value
1088
+ }
1089
+
1090
+ #[ inline]
1091
+ fn value_type ( & self ) -> glib:: Type {
1092
+ Self :: static_type ( )
1093
+ }
1094
+ }
1095
+
1096
+ #[ cfg( feature = "v1_57" ) ]
1097
+ #[ cfg_attr( docsrs, doc( cfg( feature = "v1_57" ) ) ) ]
1098
+ impl From < FontColor > for glib:: Value {
1099
+ #[ inline]
1100
+ fn from ( v : FontColor ) -> Self {
1101
+ ToValue :: to_value ( & v)
1102
+ }
1103
+ }
1104
+
991
1105
#[ cfg( feature = "v1_50" ) ]
992
1106
#[ cfg_attr( docsrs, doc( cfg( feature = "v1_50" ) ) ) ]
993
1107
#[ derive( Debug , Eq , PartialEq , Ord , PartialOrd , Hash , Clone , Copy ) ]
0 commit comments