📄 main.sgml
字号:
<!-- ##### FUNCTION g_main_context_remove_poll ##### --><para></para>@context: @fd: <!-- ##### FUNCTION g_main_depth ##### --><para></para>@Returns: <!-- ##### FUNCTION g_main_current_source ##### --><para></para>@Returns: <!-- ##### MACRO g_main_set_poll_func ##### --><para>Sets the function to use for the handle polling of file descriptorsfor the default main context. </para>@func: the function to call to poll all file descriptors.@Deprecated: 2.2: Use g_main_context_set_poll_func() instead.<!-- ##### FUNCTION g_timeout_source_new ##### --><para></para>@interval: @Returns: <!-- ##### FUNCTION g_timeout_source_new_seconds ##### --><para></para>@interval: @Returns: <!-- ##### FUNCTION g_timeout_add ##### --><para></para>@interval: @function: @data: @Returns: <!-- ##### FUNCTION g_timeout_add_full ##### --><para></para>@priority: @interval: @function: @data: @notify: @Returns: <!-- ##### FUNCTION g_timeout_add_seconds ##### --><para></para>@interval: @function: @data: @Returns: <!-- ##### FUNCTION g_timeout_add_seconds_full ##### --><para></para>@priority: @interval: @function: @data: @notify: @Returns: <!-- ##### FUNCTION g_idle_source_new ##### --><para></para>@Returns: <!-- ##### FUNCTION g_idle_add ##### --><para></para>@function: @data: @Returns: <!-- ##### FUNCTION g_idle_add_full ##### --><para></para>@priority: @function: @data: @notify: @Returns: <!-- ##### FUNCTION g_idle_remove_by_data ##### --><para></para>@data: @Returns: <!-- ##### TYPEDEF GPid ##### --><para>A type which is used to hold a process identification. On Unix, processes are identified by a process id (an integer), while Windows uses process handles (which are pointers).</para><!-- ##### USER_FUNCTION GChildWatchFunc ##### --><para>The type of functions to be called when a child exists.</para>@pid: the process id of the child process@status: Status information about the child process, see waitpid(2) for more information about this field@data: user data passed to g_child_watch_add()<!-- ##### FUNCTION g_child_watch_source_new ##### --><para></para>@pid: @Returns: <!-- ##### FUNCTION g_child_watch_add ##### --><para></para>@pid: @function: @data: @Returns: <!-- ##### FUNCTION g_child_watch_add_full ##### --><para></para>@priority: @pid: @function: @data: @notify: @Returns: <!-- ##### STRUCT GPollFD ##### --><para><informaltable pgwide="1" frame="none" role="struct"><tgroup cols="2"><colspec colwidth="2*"/><colspec colwidth="8*"/><tbody><row><entry>#gint fd;</entry><entry>the file descriptor to poll (or a <type>HANDLE</type> on Win32 platforms).</entry></row><row><entry>#gushort events;</entry><entry>a bitwise combination of flags from #GIOCondition, specifying whichevents should be polled for. Typically for reading from a file descriptoryou would use %G_IO_IN | %G_IO_HUP | %G_IO_ERR, and for writing you would use%G_IO_OUT | %G_IO_ERR.</entry></row><row><entry>#gushort revents;</entry><entry>a bitwise combination of flags from #GIOCondition, returned from the<function>poll()</function> function to indicate which events occurred.</entry></row></tbody></tgroup></informaltable></para>@fd: @fd: @events: @revents: <!-- ##### STRUCT GSource ##### --><para>The <structname>GSource</structname> struct is an opaque data type representingan event source.</para><!-- ##### USER_FUNCTION GSourceDummyMarshal ##### --><para>This is just a placeholder for #GClosureMarshal, which cannot be used herefor dependency reasons.</para><!-- ##### STRUCT GSourceFuncs ##### --><para>The #GSourceFuncs struct contains a table of functions used to handleevent sources in a generic manner.</para><para>For idle sources, the prepare and check functions always return %TRUE toindicate that the source is always ready to be processed.The prepare function also returns a timeout value of 0 to ensure that thepoll() call doesn't block (since that would be time wasted which could have been spent running the idle function).</para><para>For timeout sources, the prepare and check functions both return %TRUE if thetimeout interval has expired. The prepare function also returns a timeout value to ensure that the poll() call doesn't block too long and miss the next timeout.</para><para>For file descriptor sources, the prepare function typically returns %FALSE,since it must wait until poll() has been called before it knows whether any events need to be processed. It sets the returned timeout to -1 to indicate that it doesn't mind how long the poll() call blocks.In the check function, it tests the results of the poll()call to see if the required condition has been met, and returns %TRUE if so.</para>@prepare: Called before all the file descriptors are polled.If the source can determine that it is ready here (without waiting for theresults of the poll() call) it should return %TRUE.It can also return a @timeout_ value which should be the maximum timeout(in milliseconds) which should be passed to the poll() call.The actual timeout used will be -1 if all sources returned -1, or it willbe the minimum of all the @timeout_ values returned which were >= 0.@check: Called after all the file descriptors are polled.The source should return %TRUE if it is ready to be dispatched.Note that some time may have passed since the previous prepare function wascalled, so the source should be checked again here.@dispatch: Called to dispatch the event source, after it has returned %TRUE ineither its @prepare or its @check function. The @dispatch function ispassed in a callback function and data. The callback function may be%NULL if the source was never connected to a callback usingg_source_set_callback(). The @dispatch function should call thecallback function with @user_data and whatever additional parameters areneeded for this type of event source.@finalize: Called when the source is finalized.@closure_callback: @closure_marshal: <!-- ##### STRUCT GSourceCallbackFuncs ##### --><para>The <structname>GSourceCallbackFuncs</structname> struct containsfunctions for managing callback objects. </para>@ref: Called when a reference is added to the callback object.@unref: Called when a reference to the callback object is dropped.@get: Called to extract the callback function and data from the callback object.<!-- ##### FUNCTION g_source_new ##### --><para></para>@source_funcs: @struct_size: @Returns: <!-- ##### FUNCTION g_source_ref ##### --><para></para>@source: @Returns: <!-- ##### FUNCTION g_source_unref ##### --><para></para>@source: <!-- ##### FUNCTION g_source_set_funcs ##### --><para></para>@source: @funcs: <!-- ##### FUNCTION g_source_attach ##### --><para></para>@source: @context: @Returns: <!-- ##### FUNCTION g_source_destroy ##### --><para></para>@source: <!-- ##### FUNCTION g_source_is_destroyed ##### --><para></para>@source: @Returns: <!-- ##### FUNCTION g_source_set_priority ##### --><para></para>@source: @priority: <!-- ##### FUNCTION g_source_get_priority ##### --><para></para>@source: @Returns: <!-- ##### FUNCTION g_source_set_can_recurse ##### --><para></para>@source: @can_recurse: <!-- ##### FUNCTION g_source_get_can_recurse ##### --><para></para>@source: @Returns: <!-- ##### FUNCTION g_source_get_id ##### --><para></para>@source: @Returns: <!-- ##### FUNCTION g_source_get_context ##### --><para></para>@source: @Returns: <!-- ##### FUNCTION g_source_set_callback ##### --><para></para>@source: @func: @data: @notify: <!-- ##### USER_FUNCTION GSourceFunc ##### --><para>Specifies the type of function passed to g_timeout_add(), g_timeout_add_full(),g_idle_add(), and g_idle_add_full().</para>@data: data passed to the function, set when the source was created with oneof the above functions.@Returns: it should return %FALSE if the source should be removed.<!-- ##### FUNCTION g_source_set_callback_indirect ##### --><para></para>@source: @callback_data: @callback_funcs: <!-- ##### FUNCTION g_source_add_poll ##### --><para></para>@source: @fd: <!-- ##### FUNCTION g_source_remove_poll ##### --><para></para>@source: @fd: <!-- ##### FUNCTION g_source_get_current_time ##### --><para></para>@source: @timeval: <!-- ##### FUNCTION g_source_remove ##### --><para></para>@tag: @Returns: <!-- ##### FUNCTION g_source_remove_by_funcs_user_data ##### --><para></para>@funcs: @user_data: @Returns: <!-- ##### FUNCTION g_source_remove_by_user_data ##### --><para></para>@user_data: @Returns: <!--Local variables:mode: sgmlsgml-parent-document: ("../glib-docs.sgml" "book" "refsect2" "")End:-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -