📄 gparamspec.sgml
字号:
<!-- ##### SECTION Title ##### -->GParamSpec<!-- ##### SECTION Short_Description ##### -->Meta data object for parameter specifications.<!-- ##### SECTION Long_Description ##### --><para>#GParamSpec is an object structure that encapsulates the meta datarequired to specify parameters, such as e.g. #GObject properties.</para><!-- ##### SECTION See_Also ##### --><para>g_object_class_install_property(), g_object_set(), g_object_get(),g_object_set_property(), g_object_get_property(), g_value_register_transform_func()</para><!-- ##### MACRO G_TYPE_IS_PARAM ##### --><para>Returns whether @type "is a" %G_TYPE_PARAM.</para>@type: a #GType ID<!-- ##### MACRO G_PARAM_SPEC ##### --><para>Cast a derived #GParamSpec object (e.g. of type #GParamSpecInt) intoa #GParamSpec object.</para>@pspec: a valid #GParamSpec<!-- ##### MACRO G_IS_PARAM_SPEC ##### --><para>Check whether @pspec "is a" valid #GParamSpec structure of type %G_TYPE_PARAMor derived.</para>@pspec: a #GParamSpec<!-- ##### MACRO G_PARAM_SPEC_CLASS ##### --><para>Cast a derived #GParamSpecClass structure into a #GParamSpecClass structure.</para>@pclass: a valid #GParamSpecClass<!-- ##### MACRO G_IS_PARAM_SPEC_CLASS ##### --><para>Check whether @pclass "is a" valid #GParamSpecClass structure of type %G_TYPE_PARAMor derived.</para>@pclass: a #GParamSpecClass<!-- ##### MACRO G_PARAM_SPEC_GET_CLASS ##### --><para>Retrieve the #GParamSpecClass of a #GParamSpec.</para>@pspec: a valid #GParamSpec<!-- ##### MACRO G_PARAM_SPEC_TYPE ##### --><para>Retrive the #GType of this @pspec.</para>@pspec: a valid #GParamSpec<!-- ##### MACRO G_PARAM_SPEC_TYPE_NAME ##### --><para>Retrive the #GType name of this @pspec.</para>@pspec: a valid #GParamSpec<!-- ##### MACRO G_PARAM_SPEC_VALUE_TYPE ##### --><para>Retrive the #GType to intiialize a #GValue for this parameter.</para>@pspec: a valid #GParamSpec<!-- ##### STRUCT GParamSpec ##### --><para></para>@g_type_instance: private #GTypeInstance portion@name: name of this parameter@flags: #GParamFlags flags for this parameter@value_type: the #GValue type for this parameter@owner_type: #GType type that uses (introduces) this paremeter<!-- ##### STRUCT GParamSpecClass ##### --><para></para><!-- ##### ENUM GParamFlags ##### --><para>Through the #GParamFlags flag values, certain aspects of parameterscan be configured.</para>@G_PARAM_READABLE: the parameter is readable@G_PARAM_WRITABLE: the parameter is writable@G_PARAM_CONSTRUCT: the parameter will be set upon object construction@G_PARAM_CONSTRUCT_ONLY: the parameter will only be set upon object construction@G_PARAM_LAX_VALIDATION: upon parameter conversion (see g_param_value_convert()) strict validation is not required@G_PARAM_PRIVATE: <!-- ##### MACRO G_PARAM_READWRITE ##### --><para>#GParamFlags value alias for %G_PARAM_READABLE | %G_PARAM_WRITABLE.</para><!-- ##### MACRO G_PARAM_MASK ##### --><para>Mask containing the bits of #GParamSpec.flags which are reserved for GLib.</para><!-- ##### MACRO G_PARAM_USER_SHIFT ##### --><para>Minimum shift count to be used for user defined flags, to be stored in#GParamSpec.flags.</para><!-- ##### FUNCTION g_param_spec_ref ##### --><para>Increment the reference count of @pspec.</para>@pspec: a valid #GParamSpec@Returns: the #GParamSpec that was passed into this function<!-- ##### FUNCTION g_param_spec_unref ##### --><para>Decrement the reference count of a @pspec.</para>@pspec: a valid #GParamSpec<!-- ##### FUNCTION g_param_spec_sink ##### --><para>The initial reference count of a newly created #GParamSpec is 1,eventhough no one has explicitely called g_param_spec_ref() on it yet.So the einital reference count is flagged as "floating", untill someonecalls: g_param_spec_ref (@pspec); g_param_spec_sink (@pspec);in sequence on it, taking over the initial reference count (thusending up with a @pspec that has a reference count of 1 still, but isnot flagged "floating" anymore).</para>@pspec: a valid #GParamSpec<!-- ##### FUNCTION g_param_value_set_default ##### --><para>Set @value to its default value as specified in @pspec.</para>@pspec: a valid #GParamSpec@value: a #GValue of correct type for @pspec<!-- ##### FUNCTION g_param_value_defaults ##### --><para>Check whether @value contains the default value as specified in @pspec.</para>@pspec: a valid #GParamSpec@value: a #GValue of correct type for @pspec@Returns: whether @value contains the canonical defualt for this @pspec<!-- ##### FUNCTION g_param_value_validate ##### --><para>Ensure that the contents of @value comply with the specificationsset out by @pspec. For example, a #GParamSpecInt might requirethat integers stored in @value may not be smaller than -42 and not begreater than +42. If @value contains an integer outside of this range,it is modified accordingly, so the resulting value will fit into therange -42 .. +42.</para>@pspec: a valid #GParamSpec@value: a #GValue of correct type for @pspec@Returns: whether modifying @value was necessary to ensure validity<!-- ##### FUNCTION g_param_value_convert ##### --><para>This function transforms @src_value into @dest_value if possible,and then validates @dest_value, in order for it to conform to@pspec.If @strict_validation is %TRUE this function will only suceed ifthe transformed @dest_value complied to @pspec without modifications.See also g_value_type_transformable(), g_value_transform() andg_param_value_validate().</para>@pspec: a valid #GParamSpec@src_value: souce #GValue@dest_value: destination #GValue of correct type for @pspec@strict_validation: $TRUE requires @dest_value to conform to @pspec without modifications@Returns: %TRUE if transformation and validation were successfull, %FALSE otherwise and @dest_value is left untouched.<!-- ##### FUNCTION g_param_values_cmp ##### --><para>Compare @value1 with @value2 according to @pspec, and return -1, 0 or +1,if @value1 is found to be less than, equal to or greater than @value2, respectively.</para>@pspec: a valid #GParamSpec@value1: a #GValue of correct type for @pspec@value2: a #GValue of correct type for @pspec@Returns: -1, 0 or +1, for a less than, equal to or greater than result<!-- ##### FUNCTION g_param_spec_get_name ##### --><para></para>@pspec: @Returns: <!-- ##### FUNCTION g_param_spec_get_nick ##### --><para></para>@pspec: @Returns: <!-- ##### FUNCTION g_param_spec_get_blurb ##### --><para></para>@pspec: @Returns: <!-- ##### FUNCTION g_param_spec_get_qdata ##### --><para></para>@pspec: @quark: @Returns: <!-- ##### FUNCTION g_param_spec_set_qdata ##### --><para></para>@pspec: @quark: @data: <!-- ##### FUNCTION g_param_spec_set_qdata_full ##### --><para></para>@pspec: @quark: @data: @destroy: <!-- ##### FUNCTION g_param_spec_steal_qdata ##### --><para></para>@pspec: @quark: @Returns: <!-- ##### FUNCTION g_param_spec_internal ##### --><para></para>@param_type: @name: @nick: @blurb: @flags: @Returns: <!-- ##### STRUCT GParamSpecTypeInfo ##### --><para></para>@instance_size: @n_preallocs: @instance_init: @value_type: @finalize: @value_set_default: @value_validate: @values_cmp: <!-- ##### FUNCTION g_param_type_register_static ##### --><para></para>@name: @pspec_info: @Returns: <!-- ##### STRUCT GParamSpecPool ##### --><para></para><!-- ##### FUNCTION g_param_spec_pool_new ##### --><para></para>@type_prefixing: @Returns: <!-- ##### FUNCTION g_param_spec_pool_insert ##### --><para></para>@pool: @pspec: @owner_type: <!-- ##### FUNCTION g_param_spec_pool_remove ##### --><para></para>@pool: @pspec: <!-- ##### FUNCTION g_param_spec_pool_lookup ##### --><para></para>@pool: @param_name: @owner_type: @walk_ancestors: @Returns: <!-- # Unused Parameters # -->@trailer_p: <!-- ##### FUNCTION g_param_spec_pool_list ##### --><para></para>@pool: @owner_type: @n_pspecs_p: @Returns: <!-- ##### FUNCTION g_param_spec_pool_list_owned ##### --><para></para>@pool: @owner_type: @Returns:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -