add images

Tue Dec  5 15:41:23 2000  Owen Taylor  <otaylor@redhat.com>

        * glib/Makefile.am glib/mainloop-states*: add images

	* glib/glib-sections.txt: Updated

	* glib/tmpl/main.sgml: More documentation, move function
	docs to .c file.
This commit is contained in:
Owen Taylor 2000-12-05 20:43:58 +00:00 committed by Owen Taylor
parent 74987b2cf0
commit 5791ec5b85
18 changed files with 1234 additions and 327 deletions

View File

@ -1,3 +1,12 @@
Tue Dec 5 15:41:23 2000 Owen Taylor <otaylor@redhat.com>
* glib/Makefile.am glib/mainloop-states*: add images
* glib/glib-sections.txt: Updated
* glib/tmpl/main.sgml: More documentation, move function
docs to .c file.
Mon Nov 13 00:18:55 2000 Owen Taylor <otaylor@redhat.com>
* glib/glib-sections.sgml: Move conversion functions

View File

@ -74,6 +74,12 @@ tmpl_sources = \
tmpl/warnings.sgml \
tmpl/windows.sgml
extra_files = \
mainloop-states.fig \
mainloop-states.png \
mainloop-states.eps \
mainloop-states.gif
####################################
# Everything below here is generic #
@ -82,6 +88,7 @@ tmpl_sources = \
TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
EXTRA_DIST = \
$(extra_files) \
$(DOC_MAIN_SGML_FILE) \
$(DOC_MODULE)-decl.txt \
$(DOC_MODULE)-sections.txt \
@ -117,6 +124,7 @@ sgml:
html:
test -d $(srcdir)/html || mkdir $(srcdir)/html
-cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
cp $(srcdir)/*.gif $(srcdir)/html
@echo '-- Fixing Crossreferences'
cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@ -159,6 +167,6 @@ dist-hook: dist-check-gtkdoc
-cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
-cp $(srcdir)/sgml/*.bottom $(srcdir)/sgml/*.top $(distdir)/sgml
-cp $(srcdir)/html/index.sgml $(distdir)/html
-cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
-cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(srcdir)/html/*.gif $(distdir)/html
.PHONY : html sgml templates scan

View File

@ -319,13 +319,16 @@ g_clear_error
<TITLE>The Main Event Loop</TITLE>
<FILE>main</FILE>
GMainLoop
g_main_loop_new
g_main_loop_destroy
g_main_loop_run
g_main_loop_quit
g_main_loop_is_running
g_main_new
g_main_destroy
g_main_run
g_main_is_running
g_main_pending
g_main_iteration
g_main_quit
g_main_is_running
<SUBSECTION>
G_PRIORITY_HIGH
@ -335,31 +338,64 @@ G_PRIORITY_DEFAULT_IDLE
G_PRIORITY_LOW
<SUBSECTION>
g_timeout_add
g_timeout_add_full
GSourceFunc
GMainContext
g_main_context_get
g_main_context_default
g_main_context_iteration
g_main_iteration
g_main_context_pending
g_main_pending
g_main_context_find_source_by_id
g_main_context_find_source_by_user_data
g_main_context_find_source_by_funcs_user_data
g_main_context_prepare
g_main_context_query
g_main_context_check
g_main_context_dispatch
g_main_context_set_poll_func
g_main_context_get_poll_func
GPollFunc
g_main_context_add_poll
g_main_context_remove_poll
g_main_set_poll_func
<SUBSECTION>
g_timeout_source_new
g_timeout_add
g_timeout_add_full
<SUBSECTION>
g_idle_source_new
g_idle_add
g_idle_add_full
g_idle_remove_by_data
<SUBSECTION>
g_main_add_poll
GPollFD
g_main_remove_poll
<SUBSECTION>
g_main_set_poll_func
g_main_win32_get_poll_func
GPollFunc
<SUBSECTION>
g_source_add
GSource
GSourceFuncs
GSourceCallbackFuncs
g_source_new
g_source_ref
g_source_unref
g_source_add
g_source_destroy
g_source_set_priority
g_source_get_priority
g_source_set_can_recurse
g_source_get_can_recurse
g_source_get_id
g_source_get_context
g_source_connect
GSourceFunc
g_source_connect_indirect
g_source_add_poll
g_source_remove_poll
g_source_get_current_time
g_source_remove
g_source_remove_by_funcs_user_data
g_source_remove_by_source_data
g_source_remove_by_user_data
<SUBSECTION Private>
@ -558,6 +594,7 @@ g_io_channel_ref
g_io_channel_unref
<SUBSECTION>
g_io_create_watch
g_io_add_watch
g_io_add_watch_full
GIOCondition
@ -1067,6 +1104,7 @@ G_MODULE_IMPORT
GCompletion
g_completion_new
GCompletionFunc
GCompletionStrcmpFunc
g_completion_add_items
g_completion_remove_items
g_completion_clear_items
@ -1155,6 +1193,7 @@ g_list_length
g_list_copy
g_list_reverse
g_list_sort
g_list_sort_with_data
GCompareFunc
g_list_concat
g_list_foreach
@ -1202,6 +1241,7 @@ g_slist_length
g_slist_copy
g_slist_reverse
g_slist_sort
g_slist_sort_with_data
g_slist_concat
g_slist_foreach
@ -1341,6 +1381,8 @@ g_array_insert_val
g_array_insert_vals
g_array_remove_index
g_array_remove_index_fast
g_array_sort
g_array_sort_with_data
g_array_index
g_array_set_size
g_array_free
@ -1357,6 +1399,8 @@ g_ptr_array_remove
g_ptr_array_remove_index
g_ptr_array_remove_fast
g_ptr_array_remove_index_fast
g_ptr_array_sort
g_ptr_array_sort_with_data
g_ptr_array_set_size
g_ptr_array_index
g_ptr_array_free
@ -1373,6 +1417,8 @@ g_byte_array_append
g_byte_array_prepend
g_byte_array_remove_index
g_byte_array_remove_index_fast
g_byte_array_sort
g_byte_array_sort_with_data
g_byte_array_set_size
g_byte_array_free
@ -1383,6 +1429,7 @@ g_byte_array_free
<FILE>trees-binary</FILE>
GTree
g_tree_new
g_tree_new_with_data
g_tree_insert
g_tree_nnodes
g_tree_height

View File

@ -0,0 +1,306 @@
%!PS-Adobe-2.0 EPSF-2.0
%%Title: mainloop-stages.eps
%%Creator: fig2dev Version 3.2 Patchlevel 3c
%%CreationDate: Wed Nov 29 12:23:52 2000
%%For: otaylor@fresnel.labs.redhat.com (Owen Taylor)
%%BoundingBox: 0 0 503 291
%%Magnification: 1.0000
%%EndComments
/$F2psDict 200 dict def
$F2psDict begin
$F2psDict /mtrx matrix put
/col-1 {0 setgray} bind def
/col0 {0.000 0.000 0.000 srgb} bind def
/col1 {0.000 0.000 1.000 srgb} bind def
/col2 {0.000 1.000 0.000 srgb} bind def
/col3 {0.000 1.000 1.000 srgb} bind def
/col4 {1.000 0.000 0.000 srgb} bind def
/col5 {1.000 0.000 1.000 srgb} bind def
/col6 {1.000 1.000 0.000 srgb} bind def
/col7 {1.000 1.000 1.000 srgb} bind def
/col8 {0.000 0.000 0.560 srgb} bind def
/col9 {0.000 0.000 0.690 srgb} bind def
/col10 {0.000 0.000 0.820 srgb} bind def
/col11 {0.530 0.810 1.000 srgb} bind def
/col12 {0.000 0.560 0.000 srgb} bind def
/col13 {0.000 0.690 0.000 srgb} bind def
/col14 {0.000 0.820 0.000 srgb} bind def
/col15 {0.000 0.560 0.560 srgb} bind def
/col16 {0.000 0.690 0.690 srgb} bind def
/col17 {0.000 0.820 0.820 srgb} bind def
/col18 {0.560 0.000 0.000 srgb} bind def
/col19 {0.690 0.000 0.000 srgb} bind def
/col20 {0.820 0.000 0.000 srgb} bind def
/col21 {0.560 0.000 0.560 srgb} bind def
/col22 {0.690 0.000 0.690 srgb} bind def
/col23 {0.820 0.000 0.820 srgb} bind def
/col24 {0.500 0.190 0.000 srgb} bind def
/col25 {0.630 0.250 0.000 srgb} bind def
/col26 {0.750 0.380 0.000 srgb} bind def
/col27 {1.000 0.500 0.500 srgb} bind def
/col28 {1.000 0.630 0.630 srgb} bind def
/col29 {1.000 0.750 0.750 srgb} bind def
/col30 {1.000 0.880 0.880 srgb} bind def
/col31 {1.000 0.840 0.000 srgb} bind def
end
save
newpath 0 291 moveto 0 0 lineto 503 0 lineto 503 291 lineto closepath clip newpath
-106.0 402.0 translate
1 -1 scale
/cp {closepath} bind def
/ef {eofill} bind def
/gr {grestore} bind def
/gs {gsave} bind def
/sa {save} bind def
/rs {restore} bind def
/l {lineto} bind def
/m {moveto} bind def
/rm {rmoveto} bind def
/n {newpath} bind def
/s {stroke} bind def
/sh {show} bind def
/slc {setlinecap} bind def
/slj {setlinejoin} bind def
/slw {setlinewidth} bind def
/srgb {setrgbcolor} bind def
/rot {rotate} bind def
/sc {scale} bind def
/sd {setdash} bind def
/ff {findfont} bind def
/sf {setfont} bind def
/scf {scalefont} bind def
/sw {stringwidth} bind def
/tr {translate} bind def
/tnt {dup dup currentrgbcolor
4 -2 roll dup 1 exch sub 3 -1 roll mul add
4 -2 roll dup 1 exch sub 3 -1 roll mul add
4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
bind def
/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
4 -2 roll mul srgb} bind def
/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
/$F2psEnd {$F2psEnteredState restore end} def
$F2psBegin
%%Page: 1 1
10 setmiterlimit
0.06000 0.06000 sc
%
% Fig objects follow
%
/Times-Roman ff 270.00 scf sf
9300 6225 m
gs 1 -1 sc (Initial[n+1]) dup sw pop 2 div neg 0 rm col0 sh gr
/Times-Roman ff 270.00 scf sf
9300 6540 m
gs 1 -1 sc (\(Recursion\)) dup sw pop 2 div neg 0 rm col0 sh gr
% Polyline
15.000 slw
[60] 0 sd
n 1905 6000 m 1800 6000 1800 6420 105 arcto 4 {pop} repeat
1800 6525 3120 6525 105 arcto 4 {pop} repeat
3225 6525 3225 6105 105 arcto 4 {pop} repeat
3225 6000 1905 6000 105 arcto 4 {pop} repeat
cp gs col0 s gr [] 0 sd
% Polyline
[60] 0 sd
gs clippath
3865 5498 m 3806 5431 l 3688 5535 l 3808 5490 l 3747 5602 l cp
3184 5976 m 3243 6043 l 3361 5939 l 3242 5985 l 3302 5872 l cp
eoclip
n 3225 6000 m
3825 5475 l gs col0 s gr gr
[] 0 sd
% arrowhead
n 3302 5872 m 3242 5985 l 3361 5939 l 3302 5872 l cp gs 0.00 setgray ef gr col0 s
% arrowhead
n 3747 5602 m 3808 5490 l 3688 5535 l 3747 5602 l cp gs 0.00 setgray ef gr col0 s
% Polyline
n 4980 5775 m 4875 5775 4875 6270 105 arcto 4 {pop} repeat
4875 6375 6870 6375 105 arcto 4 {pop} repeat
6975 6375 6975 5880 105 arcto 4 {pop} repeat
6975 5775 4980 5775 105 arcto 4 {pop} repeat
cp gs col0 s gr
% Polyline
[60] 0 sd
gs clippath
8457 5969 m 8515 5900 l 8394 5799 l 8458 5911 l 8337 5868 l cp
8042 5505 m 7984 5574 l 8105 5675 l 8042 5564 l 8162 5606 l cp
eoclip
n 8025 5550 m
8475 5925 l gs col0 s gr gr
[] 0 sd
% arrowhead
n 8162 5606 m 8042 5564 l 8105 5675 l 8162 5606 l cp gs 0.00 setgray ef gr col0 s
% arrowhead
n 8337 5868 m 8458 5911 l 8394 5799 l 8337 5868 l cp gs 0.00 setgray ef gr col0 s
% Polyline
[60] 0 sd
n 8580 5850 m 8475 5850 8475 6570 105 arcto 4 {pop} repeat
8475 6675 10020 6675 105 arcto 4 {pop} repeat
10125 6675 10125 5955 105 arcto 4 {pop} repeat
10125 5850 8580 5850 105 arcto 4 {pop} repeat
cp gs col0 s gr [] 0 sd
% Polyline
n 7155 3825 m 7050 3825 7050 4320 105 arcto 4 {pop} repeat
7050 4425 9045 4425 105 arcto 4 {pop} repeat
9150 4425 9150 3930 105 arcto 4 {pop} repeat
9150 3825 7155 3825 105 arcto 4 {pop} repeat
cp gs col0 s gr
% Polyline
n 5055 2100 m 4950 2100 4950 2595 105 arcto 4 {pop} repeat
4950 2700 6945 2700 105 arcto 4 {pop} repeat
7050 2700 7050 2205 105 arcto 4 {pop} repeat
7050 2100 5055 2100 105 arcto 4 {pop} repeat
cp gs col0 s gr
% Polyline
n 2730 3900 m 2625 3900 2625 4395 105 arcto 4 {pop} repeat
2625 4500 4620 4500 105 arcto 4 {pop} repeat
4725 4500 4725 4005 105 arcto 4 {pop} repeat
4725 3900 2730 3900 105 arcto 4 {pop} repeat
cp gs col0 s gr
% Polyline
[60] 0 sd
n 8580 1875 m 8475 1875 8475 2295 105 arcto 4 {pop} repeat
8475 2400 9645 2400 105 arcto 4 {pop} repeat
9750 2400 9750 1980 105 arcto 4 {pop} repeat
9750 1875 8580 1875 105 arcto 4 {pop} repeat
cp gs col0 s gr [] 0 sd
% Polyline
[60] 0 sd
gs clippath
8518 2419 m 8451 2358 l 8345 2474 l 8460 2416 l 8412 2534 l cp
8003 2848 m 8070 2909 l 8176 2793 l 8062 2852 l 8109 2733 l cp
eoclip
n 8047 2868 m
8475 2400 l gs col0 s gr gr
[] 0 sd
% arrowhead
n 8109 2733 m 8062 2852 l 8176 2793 l 8109 2733 l cp gs 0.00 setgray ef gr col0 s
% arrowhead
n 8412 2534 m 8460 2416 l 8345 2474 l 8412 2534 l cp gs 0.00 setgray ef gr col0 s
% Polyline
2 slj
gs clippath
3340 4475 m 3252 4494 l 3286 4648 l 3305 4522 l 3374 4629 l cp
eoclip
n 4875 6075 m 4874 6075 l 4872 6074 l 4868 6073 l 4861 6072 l 4852 6070 l
4839 6067 l 4824 6064 l 4805 6059 l 4783 6054 l 4759 6048 l
4731 6041 l 4701 6033 l 4669 6025 l 4635 6015 l 4600 6004 l
4563 5993 l 4526 5981 l 4487 5967 l 4448 5953 l 4408 5937 l
4367 5920 l 4326 5901 l 4284 5881 l 4241 5859 l 4198 5835 l
4154 5809 l 4109 5781 l 4063 5749 l 4016 5715 l 3968 5678 l
3920 5638 l 3872 5595 l 3825 5550 l 3780 5503 l 3737 5455 l
3697 5407 l 3660 5359 l 3626 5312 l 3594 5266 l 3566 5221 l
3540 5177 l 3516 5134 l 3494 5091 l 3474 5049 l 3455 5008 l
3438 4967 l 3422 4927 l 3408 4888 l 3394 4849 l 3382 4812 l
3371 4775 l 3360 4740 l 3350 4706 l 3342 4674 l 3334 4644 l
3327 4616 l 3321 4592 l 3316 4570 l 3311 4551 l 3308 4536 l
3305 4523 l 3303 4514 l
3300 4500 l gs col0 s gr gr
% arrowhead
0 slj
n 3374 4629 m 3305 4522 l 3286 4648 l 3374 4629 l cp gs 0.00 setgray ef gr col0 s
% Polyline
2 slj
gs clippath
6943 6114 m 6978 6197 l 7123 6135 l 6995 6141 l 7087 6052 l cp
eoclip
n 8475 4500 m 8475 4501 l 8475 4503 l 8475 4508 l 8475 4515 l 8474 4525 l
8474 4538 l 8473 4553 l 8472 4573 l 8470 4594 l 8468 4619 l
8465 4646 l 8462 4675 l 8457 4706 l 8452 4739 l 8445 4773 l
8437 4808 l 8427 4845 l 8416 4882 l 8403 4921 l 8388 4961 l
8370 5002 l 8350 5045 l 8326 5090 l 8299 5137 l 8268 5186 l
8232 5237 l 8192 5290 l 8148 5345 l 8100 5400 l 8057 5445 l
8013 5490 l 7968 5533 l 7923 5573 l 7878 5612 l 7833 5649 l
7789 5684 l 7745 5717 l 7701 5749 l 7658 5779 l 7615 5807 l
7573 5834 l 7531 5861 l 7489 5886 l 7447 5910 l 7407 5933 l
7366 5955 l 7327 5977 l 7288 5997 l 7250 6017 l 7214 6035 l
7180 6052 l 7147 6068 l 7117 6083 l 7090 6096 l 7065 6108 l
7043 6118 l 7025 6127 l 7010 6134 l 6998 6140 l 6989 6144 l
6975 6150 l gs col0 s gr gr
% arrowhead
0 slj
n 7087 6052 m 6995 6141 l 7123 6135 l 7087 6052 l cp gs 0.00 setgray ef gr col0 s
% Polyline
2 slj
gs clippath
8433 3848 m 8521 3831 l 8493 3676 l 8471 3803 l 8404 3693 l cp
eoclip
n 7050 2400 m 7051 2400 l 7054 2401 l 7058 2401 l 7066 2403 l 7076 2404 l
7090 2407 l 7107 2410 l 7127 2414 l 7150 2418 l 7177 2424 l
7206 2430 l 7238 2437 l 7271 2445 l 7306 2454 l 7343 2463 l
7381 2474 l 7419 2486 l 7458 2499 l 7498 2513 l 7538 2528 l
7579 2545 l 7621 2564 l 7663 2585 l 7706 2608 l 7750 2634 l
7795 2662 l 7841 2694 l 7887 2728 l 7933 2766 l 7980 2807 l
8025 2850 l 8068 2895 l 8109 2942 l 8147 2988 l 8181 3034 l
8213 3080 l 8241 3125 l 8267 3169 l 8290 3212 l 8311 3254 l
8330 3296 l 8347 3337 l 8362 3377 l 8376 3417 l 8389 3456 l
8401 3494 l 8412 3532 l 8421 3569 l 8430 3604 l 8438 3637 l
8445 3669 l 8451 3698 l 8457 3725 l 8461 3748 l 8465 3768 l
8468 3785 l 8471 3799 l 8472 3809 l
8475 3825 l gs col0 s gr gr
% arrowhead
0 slj
n 8404 3693 m 8471 3803 l 8493 3676 l 8404 3693 l cp gs 0.00 setgray ef gr col0 s
% Polyline
2 slj
gs clippath
4970 2442 m 4959 2353 l 4803 2372 l 4928 2403 l 4814 2461 l cp
eoclip
n 3375 3900 m 3375 3899 l 3376 3897 l 3377 3892 l 3378 3886 l 3380 3876 l
3383 3863 l 3386 3848 l 3391 3828 l 3396 3806 l 3402 3781 l
3409 3753 l 3417 3722 l 3425 3689 l 3435 3655 l 3446 3619 l
3457 3581 l 3469 3543 l 3483 3504 l 3497 3464 l 3513 3423 l
3530 3383 l 3549 3341 l 3569 3299 l 3591 3257 l 3615 3214 l
3641 3170 l 3669 3125 l 3701 3080 l 3735 3034 l 3772 2988 l
3812 2941 l 3855 2895 l 3900 2850 l 3950 2804 l 4001 2762 l
4052 2723 l 4102 2687 l 4152 2655 l 4201 2625 l 4248 2599 l
4295 2576 l 4340 2555 l 4385 2536 l 4429 2519 l 4472 2504 l
4515 2490 l 4557 2477 l 4598 2466 l 4638 2456 l 4677 2447 l
4715 2439 l 4751 2432 l 4784 2426 l 4815 2420 l 4843 2415 l
4868 2411 l 4890 2408 l 4908 2406 l 4922 2404 l 4933 2402 l
4950 2400 l gs col0 s gr gr
% arrowhead
0 slj
n 4814 2461 m 4928 2403 l 4803 2372 l 4814 2461 l cp gs 0.00 setgray ef gr col0 s
/Times-Roman ff 360.00 scf sf
5925 6225 m
gs 1 -1 sc (Initial[n]) dup sw pop 2 div neg 0 rm col0 sh gr
/Times-Roman ff 360.00 scf sf
8100 4275 m
gs 1 -1 sc (Dispatching) dup sw pop 2 div neg 0 rm col0 sh gr
/Times-Roman ff 360.00 scf sf
3675 4350 m
gs 1 -1 sc (Prepared) dup sw pop 2 div neg 0 rm col0 sh gr
/Times-Roman ff 360.00 scf sf
5925 2550 m
gs 1 -1 sc (Polling) dup sw pop 2 div neg 0 rm col0 sh gr
/Times-Roman ff 270.00 scf sf
4050 3300 m
gs 1 -1 sc (query\(\)) col0 sh gr
/Times-Roman ff 270.00 scf sf
7800 3225 m
gs 1 -1 sc (check\(\)) dup sw pop neg 0 rm col0 sh gr
/Times-Roman ff 270.00 scf sf
2475 6375 m
gs 1 -1 sc (Working) dup sw pop 2 div neg 0 rm col0 sh gr
/Times-Roman ff 270.00 scf sf
3900 5400 m
gs 1 -1 sc (prepare\(\)) col0 sh gr
/Times-Roman ff 270.00 scf sf
8025 5325 m
gs 1 -1 sc (dispatch\(\)) dup sw pop neg 0 rm col0 sh gr
/Times-Roman ff 270.00 scf sf
9150 2250 m
gs 1 -1 sc (Working) dup sw pop 2 div neg 0 rm col0 sh gr
$F2psEnd
rs

View File

@ -0,0 +1,65 @@
#FIG 3.2
Landscape
Center
Inches
Letter
100.00
Single
-2
1200 2
6 8625 6000 9975 6600
4 1 0 50 0 0 18 0.0000 4 240 1290 9300 6225 Initial[n+1]\001
4 1 0 50 0 0 18 0.0000 4 255 1335 9300 6540 (Recursion)\001
-6
2 4 1 2 0 7 50 0 -1 4.000 0 0 7 0 0 5
3225 6525 3225 6000 1800 6000 1800 6525 3225 6525
2 1 1 2 0 7 50 0 -1 4.000 0 0 -1 1 1 2
1 1 2.00 90.00 120.00
1 1 2.00 90.00 120.00
3225 6000 3825 5475
2 4 0 2 0 7 50 0 -1 0.000 0 0 7 0 0 5
6975 6375 6975 5775 4875 5775 4875 6375 6975 6375
2 1 1 2 0 7 50 0 -1 4.000 0 0 -1 1 1 2
1 1 2.00 90.00 120.00
1 1 2.00 90.00 120.00
8025 5550 8475 5925
2 4 1 2 0 7 50 0 -1 4.000 0 0 7 0 0 5
10125 6675 10125 5850 8475 5850 8475 6675 10125 6675
2 4 0 2 0 7 50 0 -1 0.000 0 0 7 0 0 5
9150 4425 9150 3825 7050 3825 7050 4425 9150 4425
2 4 0 2 0 7 50 0 -1 0.000 0 0 7 0 0 5
7050 2700 7050 2100 4950 2100 4950 2700 7050 2700
2 4 0 2 0 7 50 0 -1 0.000 0 0 7 0 0 5
4725 4500 4725 3900 2625 3900 2625 4500 4725 4500
2 4 1 2 0 7 50 0 -1 4.000 0 0 7 0 0 5
9750 2400 9750 1875 8475 1875 8475 2400 9750 2400
2 1 1 2 0 7 50 0 -1 4.000 0 0 -1 1 1 2
1 1 2.00 90.00 120.00
1 1 2.00 90.00 120.00
8047 2868 8475 2400
3 2 0 2 0 7 50 0 -1 0.000 0 1 0 3
1 1 2.00 90.00 120.00
4875 6075 3825 5550 3300 4500
0.000 -1.000 0.000
3 2 0 2 0 7 50 0 -1 0.000 0 1 0 3
1 1 2.00 90.00 120.00
8475 4500 8100 5400 6975 6150
0.000 -1.000 0.000
3 2 0 2 0 7 50 0 -1 0.000 0 1 0 3
1 1 2.00 90.00 120.00
7050 2400 8025 2850 8475 3825
0.000 -1.000 0.000
3 2 0 2 0 7 50 0 -1 0.000 0 1 0 3
1 1 2.00 90.00 120.00
3375 3900 3900 2850 4950 2400
0.000 -1.000 0.000
4 1 0 50 0 0 24 0.0000 4 315 1290 5925 6225 Initial[n]\001
4 1 0 50 0 0 24 0.0000 4 330 1770 8100 4275 Dispatching\001
4 1 0 50 0 0 24 0.0000 4 330 1320 3675 4350 Prepared\001
4 1 0 50 0 0 24 0.0000 4 330 1050 5925 2550 Polling\001
4 0 0 50 0 0 18 0.0000 4 255 825 4050 3300 query()\001
4 2 0 50 0 0 18 0.0000 4 255 855 7800 3225 check()\001
4 1 0 50 0 0 18 0.0000 4 255 990 2475 6375 Working\001
4 0 0 50 0 0 18 0.0000 4 255 1050 3900 5400 prepare()\001
4 2 0 50 0 0 18 0.0000 4 255 1140 8025 5325 dispatch()\001
4 1 0 50 0 0 18 0.0000 4 255 990 9150 2250 Working\001

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@ -209,6 +209,25 @@ g_array_remove_index().
@Returns: the #GArray.
<!-- ##### FUNCTION g_array_sort ##### -->
<para>
</para>
@array:
@compare_func:
<!-- ##### FUNCTION g_array_sort_with_data ##### -->
<para>
</para>
@array:
@compare_func:
@user_data:
<!-- ##### MACRO g_array_index ##### -->
<para>
Returns the element of a #GArray at the given index.

View File

@ -123,6 +123,25 @@ g_byte_array_remove_index().
@Returns: the #GByteArray.
<!-- ##### FUNCTION g_byte_array_sort ##### -->
<para>
</para>
@array:
@compare_func:
<!-- ##### FUNCTION g_byte_array_sort_with_data ##### -->
<para>
</para>
@array:
@compare_func:
@user_data:
<!-- ##### FUNCTION g_byte_array_set_size ##### -->
<para>
Sets the size of the #GByteArray, expanding it if necessary.

View File

@ -156,6 +156,25 @@ g_ptr_array_remove_index().
@Returns: the pointer which was removed.
<!-- ##### FUNCTION g_ptr_array_sort ##### -->
<para>
</para>
@array:
@compare_func:
<!-- ##### FUNCTION g_ptr_array_sort_with_data ##### -->
<para>
</para>
@array:
@compare_func:
@user_data:
<!-- ##### FUNCTION g_ptr_array_set_size ##### -->
<para>
Sets the size of the array, expanding it if necessary.

View File

@ -47,6 +47,7 @@ g_completion_complete().
@func:
@prefix:
@cache:
@strncmp_func:
<!-- ##### FUNCTION g_completion_new ##### -->
<para>
@ -70,6 +71,16 @@ This is used when you use data structures as #GCompletion items.
@Returns: the string corresponding to the item.
<!-- ##### USER_FUNCTION GCompletionStrcmpFunc ##### -->
<para>
</para>
@s1:
@s2:
@Returns:
<!-- ##### FUNCTION g_completion_add_items ##### -->
<para>
Adds items to the #GCompletion.

View File

@ -1,3 +1,10 @@
<!-- ##### FUNCTION g_main_remove_poll ##### -->
<para>
Removes a file descriptor from the list being polled.
</para>
@fd: the #GPollFD to remove.
<!-- ##### MACRO lseek ##### -->
<para>
@ -17,6 +24,22 @@
</para>
<!-- ##### FUNCTION g_main_add_poll ##### -->
<para>
Adds a file descriptor to be polled.
This is usually combined with g_source_add() to add an event source.
The event source's check function will typically test the revents
field in the #GPollFD struct and return TRUE if events need to be processed.
</para>
@fd: a #GPollFD, which is a file descriptor together with a bitwise
combination of #GIOCondition flags determining which events to poll for.
@priority: the priority of the poll, which should be the same as the priority
used for g_source_add() to ensure that the file descriptor is polled whenever
the results may be needed.
See #G_PRIORITY_DEFAULT, #G_PRIORITY_DEFAULT_IDLE, #G_PRIORITY_HIGH,
#G_PRIORITY_HIGH_IDLE, and #G_PRIORITY_LOW.
<!-- ##### MACRO pclose ##### -->
<para>
@ -42,6 +65,19 @@ Turns the argument into a string literal by using the '#' stringizing operator.
</para>
<!-- ##### FUNCTION g_source_remove_by_source_data ##### -->
<para>
Removes the first event source found with the given source data.
</para>
<para>
Event sources are sorted with the highest priority first. Sources with equal
priority are stored in the order in which they were added.
</para>
@source_data: the source data, which contains information specific to the
type of source.
@Returns: TRUE if an event source was found and removed.
<!-- ##### MACRO open ##### -->
<para>
@ -78,3 +114,10 @@ Turns the argument into a string literal by using the '#' stringizing operator.
</para>
<!-- ##### FUNCTION g_main_win32_get_poll_func ##### -->
<para>
</para>
@Returns:

View File

@ -209,6 +209,16 @@ Decrements the reference count of a #GIOChannel.
@channel: a #GIOChannel.
<!-- ##### FUNCTION g_io_create_watch ##### -->
<para>
</para>
@channel:
@condition:
@Returns:
<!-- ##### FUNCTION g_io_add_watch ##### -->
<para>
Adds the #GIOChannel into the
@ -314,6 +324,6 @@ generic way.
@io_write:
@io_seek:
@io_close:
@io_add_watch:
@io_create_watch:
@io_free:

View File

@ -268,6 +268,17 @@ value if the first element comes after the second.
@Returns: the start of the sorted #GList.
<!-- ##### FUNCTION g_list_sort_with_data ##### -->
<para>
</para>
@list:
@compare_func:
@user_data:
@Returns:
<!-- ##### USER_FUNCTION GCompareFunc ##### -->
<para>
Specifies the type of a comparison function used to compare two

View File

@ -271,6 +271,17 @@ value if the first element comes after the second.
@Returns: the start of the sorted #GList.
<!-- ##### FUNCTION g_slist_sort_with_data ##### -->
<para>
</para>
@list:
@compare_func:
@user_data:
@Returns:
<!-- ##### FUNCTION g_slist_concat ##### -->
<para>
Adds the second #GSList onto the end of the first #GSList.

View File

@ -5,46 +5,97 @@ The Main Event Loop
manages all available sources of events.
<!-- ##### SECTION Long_Description ##### -->
<para>
The main event loop manages all the available sources of events for GLib
and GTK+ applications. These events can come from any number of different
types of sources such as file descriptors (plain files, pipes or sockets)
and timeouts.
New types of event sources can also be added using g_source_add().
</para>
<para>
Each event source is assigned a priority.
The default priority, #G_PRIORITY_DEFAULT, is 0.
Values less than 0 denote higher priorities.
Values greater than 0 denote lower priorities.
Events from high priority sources
are always processed before events from lower priority sources.
</para>
<para>
Idle functions can also be added, and assigned a priority. These will be
run whenever no events with a higher priority are ready to be processed.
</para>
<para>
The #GMainLoop data type represents a main event loop.
A #GMainLoop is created with g_main_new(). After adding the initial event
sources, g_main_run() is called. This continuously checks for new events
from each of the event sources and dispatches them.
Finally, the processing of an event from one of the sources leads to a call
to g_main_quit() to exit the main loop, and g_main_run() returns.
</para>
<para>
It is possible to create new instances of #GMainLoop recursively.
This is often used in GTK+ applications when showing modal dialog boxes.
However, all event sources are global; they are not tied to a particular
#GMainLoop.
</para>
<para>
GTK+ contains wrappers of many of these functions,
e.g. gtk_main(), gtk_main_quit(), gtk_events_pending(), gtk_idle_add(),
gtk_timeout_add() and gtk_input_add_full().
In a GTK+ application, these wrapper functions should be used instead.
</para>
<para>
The main event loop manages all the available sources of events for
GLib and GTK+ applications. These events can come from any number of
different types of sources such as file descriptors (plain files,
pipes or sockets) and timeouts. New types of event sources can also
be added using g_source_add().
</para>
<para>
To allow multiple independent sets of sources to be handled in
different threads, each source is associated with a #GMainContext.
A #GMainContext can only be running in a single thread, but
sources can be added and removed from it from other threads.
</para>
<para>
Each event source is assigned a priority. The default priority,
#G_PRIORITY_DEFAULT, is 0. Values less than 0 denote higher
priorities. Values greater than 0 denote lower priorities. Events
from high priority sources are always processed before events from
lower priority sources.
</para>
<para>
Idle functions can also be added, and assigned a priority. These will
be run whenever no events with a higher priority are ready to be
processed.
</para>
<para>
The #GMainLoop data type represents a main event loop. A #GMainLoop
is created with g_main_loop_new(). After adding the initial event sources,
g_main_run() is called. This continuously checks for new events from
each of the event sources and dispatches them. Finally, the
processing of an event from one of the sources leads to a call to
g_main_quit() to exit the main loop, and g_main_run() returns.
</para>
<para>
It is possible to create new instances of #GMainLoop recursively.
This is often used in GTK+ applications when showing modal dialog
boxes. Note that event sources are associated with a particular
#GMainContext, and will be checked and dispatched for all main
loops associated with that #GMainContext.
</para>
<para>
GTK+ contains wrappers of many of these functions, e.g. gtk_main(),
gtk_main_quit(), gtk_events_pending(), gtk_idle_add(),
gtk_timeout_add() and gtk_input_add_full().
</para>
<refsect2>
<title>Creating new sources types</title>
<para>
One of the unusual features of the GTK+ main loop functionality
is that new types of event source can be created and used in
addition to the builtin type of event source. A new event source
type is used for handling GDK events. A new source type is
created by <firstterm>deriving</firstterm> from the #GSource
structure. The derived type of source is represented by a
structure that has the #GSource structure as a first elemeent,
and other elements specific to the new source type. To create
an instance of the new source type, call g_source_new() passing
in the size of the derived structure and a table of functions.
These #GSourceFuncs determine the behavior of the new source
types.
</para>
<para>
New source types basically interact with with the main context
in two ways. Their prepare function in #GSourceFuncs can set
a timeout to determine the maximum amount of time that the
main loop will sleep before checking the source again. In
addition, or as well, the source can add file descriptors to
the set that the main context checks using g_source_add_poll().
</para>
</refsect2>
<refsect2>
<title>Customizing the main loop iteration</title>
<para>
Single iterations of a #GMainContext can be run with
g_main_context_iteration(). In some cases, more detailed control
of exactly how the details of the main loop work is desired,
for instance, when integrating the #GMainLoop with an external
main loop. In such cases, you can call the component functions
of g_main_context_iteration() directly. These functions
are g_main_context_prepare(), g_main_context_query(),
g_main_context_check() and g_main_context_dispatch().
</para>
<para>
The operation of these functions can best be seen in terms
of a state diagram, as shown in <xref linkend="mainloop-states">.
</para>
<figure id="mainloop-states">
<title>States of a Main Context</title>
<graphic fileref="mainloop-states.gif" format="gif"></graphic>
</figure>
</refsect2>
<!-- ##### SECTION See_Also ##### -->
<para>
@ -57,9 +108,53 @@ of a GLib or GTK+ application.
</para>
<!-- ##### FUNCTION g_main_new ##### -->
<!-- ##### FUNCTION g_main_loop_new ##### -->
<para>
Creates a new #GMainLoop.
</para>
@context:
@is_running:
@Returns:
<!-- ##### FUNCTION g_main_loop_destroy ##### -->
<para>
</para>
@loop:
<!-- ##### FUNCTION g_main_loop_run ##### -->
<para>
</para>
@loop:
<!-- ##### FUNCTION g_main_loop_quit ##### -->
<para>
</para>
@loop:
<!-- ##### FUNCTION g_main_loop_is_running ##### -->
<para>
</para>
@loop:
@Returns:
<!-- ##### MACRO g_main_new ##### -->
<para>
Creates a new #GMainLoop for the default main loop. A compatibility
macro, see g_main_loop_new().
</para>
@is_running: set to TRUE to indicate that the loop is running. This is not
@ -67,63 +162,42 @@ very important since calling g_main_run() will set this to TRUE anyway.
@Returns: a new #GMainLoop.
<!-- ##### FUNCTION g_main_destroy ##### -->
<!-- ##### MACRO g_main_destroy ##### -->
<para>
Frees the memory allocated for the #GMainLoop.
Frees the memory allocated for the #GMainLoop. A compatibility macro, see
g_main_loop_destroy().
</para>
@loop: a #GMainLoop.
<!-- ##### FUNCTION g_main_run ##### -->
<!-- ##### MACRO g_main_run ##### -->
<para>
Runs a main loop until it stops running, which occurs when g_main_quit()
is called.
Runs a main loop until it stops running. A compatibility macro, see g_main_loop_run().
</para>
@loop: a #GMainLoop.
<!-- ##### FUNCTION g_main_is_running ##### -->
<para>
Returns TRUE if the main loop is running.
</para>
@loop: a #GMainLoop.
@Returns: TRUE if the main loop is running.
<!-- ##### FUNCTION g_main_pending ##### -->
<para>
Returns TRUE if any events are pending (i.e. ready to be processed).
</para>
@Returns: TRUE if any events are pending.
<!-- ##### FUNCTION g_main_iteration ##### -->
<para>
Runs a single iteration of the main loop.
This will check which event sources are ready to be processed, and will
process the highest priority event sources which are ready.
</para>
@may_block: set to TRUE if it should block (i.e. wait) until an event source
becomes ready. It will return after an event source has been processed.
If set to FALSE it will return immediately if no event source is ready to be
processed.
@Returns: TRUE if more events are pending.
<!-- ##### FUNCTION g_main_quit ##### -->
<!-- ##### MACRO g_main_quit ##### -->
<para>
Stops the #GMainLoop. If g_main_run() was called to run the #GMainLoop,
it will now return.
it will now return. A compatibility macro, see g_main_loop_quit().
</para>
@loop: a #GMainLoop.
<!-- ##### MACRO g_main_is_running ##### -->
<para>
Checks if the main loop is running. A compatibility macro, see
g_main_loop_is_running().
</para>
@loop: a #GMainLoop.
@Returns: %TRUE if the main loop is running.
<!-- ##### MACRO G_PRIORITY_HIGH ##### -->
<para>
Use this for high priority event sources.
@ -169,123 +243,276 @@ It is not used within GLib or GTK+.
<!-- ##### FUNCTION g_timeout_add ##### -->
<!-- ##### STRUCT GMainContext ##### -->
<para>
Sets a function to be called at regular intervals, with the default priority,
#G_PRIORITY_DEFAULT.
The function is called repeatedly until it returns FALSE, at which point
the timeout is automatically destroyed and the function will not be called
again.
The first call to the function will be at the end of the first @interval.
</para>
<para>
Note that timeout functions may be delayed, due to the processing of other
event sources. Thus they should not be relied on for precise timing.
After each call to the timeout function, the time of the next
timeout is recalculated based on the current time and the given interval
(it does not try to 'catch up' time lost in delays).
</para>
@interval: the time between calls to @function, in milliseconds (1/1000ths
of a second.)
@function: the function to call at each interval.
@data: data to pass to @function.
@Returns: the id of the event source.
<!-- ##### FUNCTION g_main_context_get ##### -->
<para>
</para>
@thread:
@Returns:
<!-- ##### FUNCTION g_main_context_default ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION g_main_context_iteration ##### -->
<para>
</para>
@context:
@may_block:
@Returns:
<!-- ##### MACRO g_main_iteration ##### -->
<para>
Runs a single iteration for the default #GMainContext.
A compatibility macro, see g_main_context_iteration().
</para>
@may_block: set to TRUE if it should block (i.e. wait) until an event source
becomes ready. It will return after an event source has been processed.
If set to FALSE it will return immediately if no event source is ready to be
processed.
@Returns: TRUE if more events are pending.
<!-- ##### FUNCTION g_main_context_pending ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### MACRO g_main_pending ##### -->
<para>
Checks if any events are pending for the default #GMainContext
(i.e. ready to be processed). A compatibility macro, see
g_main_context_pending().
</para>
@Returns: %TRUE if any events are pending.
<!-- ##### FUNCTION g_main_context_find_source_by_id ##### -->
<para>
</para>
@context:
@id:
@Returns:
<!-- ##### FUNCTION g_main_context_find_source_by_user_data ##### -->
<para>
</para>
@context:
@user_data:
@Returns:
<!-- ##### FUNCTION g_main_context_find_source_by_funcs_user_data ##### -->
<para>
</para>
@context:
@funcs:
@user_data:
@Returns:
<!-- # Unused Parameters # -->
@source_data:
<!-- ##### FUNCTION g_main_context_prepare ##### -->
<para>
</para>
@context:
@priority:
@Returns:
<!-- ##### FUNCTION g_main_context_query ##### -->
<para>
</para>
@context:
@max_priority:
@timeout:
@fds:
@n_fds:
@Returns:
<!-- ##### FUNCTION g_main_context_check ##### -->
<para>
</para>
@context:
@max_priority:
@fds:
@n_fds:
@Returns:
<!-- ##### FUNCTION g_main_context_dispatch ##### -->
<para>
</para>
@context:
<!-- ##### FUNCTION g_main_context_set_poll_func ##### -->
<para>
</para>
@context:
@func:
<!-- ##### FUNCTION g_main_context_get_poll_func ##### -->
<para>
</para>
@context:
@Returns:
<!-- ##### USER_FUNCTION GPollFunc ##### -->
<para>
Specifies the type of function passed to g_main_set_poll_func().
The semantics of the function should match those of the
<function>poll()</function> system call.
</para>
@ufds: an array of #GPollFD elements.
@nfsd: the number of elements in @ufds.
@timeout: the maximum time to wait for an event of the file descriptors.
A negative value indicates an infinite timeout.
@Returns: the number of #GPollFD elements which have events or errors reported,
or -1 if an error occurred.
<!-- ##### FUNCTION g_main_context_add_poll ##### -->
<para>
</para>
@context:
@fd:
@priority:
<!-- ##### FUNCTION g_main_context_remove_poll ##### -->
<para>
</para>
@context:
@fd:
<!-- ##### MACRO g_main_set_poll_func ##### -->
<para>
Sets the function to use for the handle polling of file descriptors
for the default main context. This is a compatability macro, see
g_main_context_set_poll_func() for full details.
</para>
@func: the function to call to poll all file descriptors.
<!-- ##### FUNCTION g_timeout_source_new ##### -->
<para>
</para>
@interval:
@Returns:
<!-- ##### FUNCTION g_timeout_add ##### -->
<para>
</para>
@interval:
@function:
@data:
@Returns:
<!-- ##### FUNCTION g_timeout_add_full ##### -->
<para>
Sets a function to be called at regular intervals, with the given priority.
The function is called repeatedly until it returns FALSE, at which point
the timeout is automatically destroyed and the function will not be called
again.
The @notify function is called when the timeout is destroyed.
The first call to the function will be at the end of the first @interval.
</para>
@priority:
@interval:
@function:
@data:
@notify:
@Returns:
<!-- ##### FUNCTION g_idle_source_new ##### -->
<para>
Note that timeout functions may be delayed, due to the processing of other
event sources. Thus they should not be relied on for precise timing.
After each call to the timeout function, the time of the next
timeout is recalculated based on the current time and the given interval
(it does not try to 'catch up' time lost in delays).
</para>
@priority: the priority of the function. See #G_PRIORITY_DEFAULT,
#G_PRIORITY_DEFAULT_IDLE, #G_PRIORITY_HIGH, #G_PRIORITY_HIGH_IDLE, and
#G_PRIORITY_LOW.
@interval: the time between calls to the function, in milliseconds (1/1000ths
of a second.)
@function: the function to call at each interval.
@data: data to pass to @function (and @notify).
@notify: the function to call when the timeout is destroyed, or NULL.
@Returns: the id of event source.
<!-- ##### 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 one
of the above functions.
@Returns: it should return FALSE if the source should be removed.
@Returns:
<!-- ##### FUNCTION g_idle_add ##### -->
<para>
Adds a function to be called whenever there are no higher priority events
pending. The function is given the default idle priority,
#G_PRIORITY_DEFAULT_IDLE.
If the function returns FALSE it is automatically removed from the list of
event sources and will not be called again.
</para>
@function: the function to call.
@data: data to pass to the function.
@Returns: the id of the event source.
@function:
@data:
@Returns:
<!-- ##### FUNCTION g_idle_add_full ##### -->
<para>
Adds a function to be called whenever there are no higher priority events
pending.
If the function returns FALSE it is automatically removed from the list of
event sources and will not be called again.
</para>
@priority: the priority of the idle function, which should be somewhere around
#G_PRIORITY_DEFAULT_IDLE and #G_PRIORITY_HIGH_IDLE.
@function: the function to call.
@data: data to pass to the function.
@destroy: the function to call when the timeout is destroyed, or NULL.
@Returns: the id of the event source.
@priority:
@function:
@data:
@notify:
@Returns:
<!-- # Unused Parameters # -->
@destroy:
<!-- ##### FUNCTION g_idle_remove_by_data ##### -->
<para>
Removes the idle function with the given data.
</para>
@data: the data which is passed to the idle function.
@Returns: TRUE if the idle function was found.
<!-- ##### FUNCTION g_main_add_poll ##### -->
<para>
Adds a file descriptor to be polled.
This is usually combined with g_source_add() to add an event source.
The event source's check function will typically test the revents
field in the #GPollFD struct and return TRUE if events need to be processed.
</para>
@fd: a #GPollFD, which is a file descriptor together with a bitwise
combination of #GIOCondition flags determining which events to poll for.
@priority: the priority of the poll, which should be the same as the priority
used for g_source_add() to ensure that the file descriptor is polled whenever
the results may be needed.
See #G_PRIORITY_DEFAULT, #G_PRIORITY_DEFAULT_IDLE, #G_PRIORITY_HIGH,
#G_PRIORITY_HIGH_IDLE, and #G_PRIORITY_LOW.
@data:
@Returns:
<!-- ##### STRUCT GPollFD ##### -->
@ -323,67 +550,11 @@ poll() function to indicate which events occurred.
@events:
@revents:
<!-- ##### FUNCTION g_main_remove_poll ##### -->
<para>
Removes a file descriptor from the list being polled.
</para>
@fd: the #GPollFD to remove.
<!-- ##### FUNCTION g_main_set_poll_func ##### -->
<para>
Sets the function to use to handle polling of file descriptors.
It will be used instead of the <function>poll()</function> system call
(or GLib's replacement function, which is used where
<function>poll()</function> isn't available).
</para>
<para>
This function could possibly be used to integrate the GLib event loop
with an external event loop.
</para>
@func: the function to call to poll all file descriptors.
<!-- ##### FUNCTION g_main_win32_get_poll_func ##### -->
<!-- ##### STRUCT GSource ##### -->
<para>
</para>
@Returns:
<!-- ##### USER_FUNCTION GPollFunc ##### -->
<para>
Specifies the type of function passed to g_main_set_poll_func().
The semantics of the function should match those of the
<function>poll()</function> system call.
</para>
@ufds: an array of #GPollFD elements.
@nfsd: the number of elements in @ufds.
@timeout: the maximum time to wait for an event of the file descriptors.
@Returns: the number of #GPollFD elements which have events or errors reported,
or -1 if an error occurred.
<!-- ##### FUNCTION g_source_add ##### -->
<para>
Adds an event source to the main loop.
</para>
@priority: the priority of the event source. See #G_PRIORITY_DEFAULT,
#G_PRIORITY_DEFAULT_IDLE, #G_PRIORITY_HIGH, #G_PRIORITY_HIGH_IDLE, and
#G_PRIORITY_LOW.
@can_recurse: if it is safe to call the source functions recursively.
@funcs: the functions to handle the source.
@source_data: data specific to the type of event source.
@user_data: user data which will be passed to the user function handling the
source.
@notify: the function to call when the source is destroyed.
@Returns: the id of the event source.
<!-- ##### STRUCT GSourceFuncs ##### -->
<para>
@ -399,7 +570,7 @@ event sources in a generic manner.
<entry>
Called before all the file descriptors are polled.
If the source can determine that it is ready here (without waiting for the
results of the poll() call) it should return TRUE.
results 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 will
@ -411,7 +582,7 @@ be the minimum of all the @timeout values returned which were >= 0.
<entry>check</entry>
<entry>
Called after all the file descriptors are polled.
The source should return TRUE if it is ready to be processed.
The source should return %TRUE if it is ready to be dispatched.
Note that some time may have passed since the previous prepare function was
called, so the source should be checked again here.
</entry>
@ -420,16 +591,19 @@ called, so the source should be checked again here.
<row>
<entry>dispatch</entry>
<entry>
Called to process the event source, after it has returned TRUE in either
its @prepare or its @check function.
Called to dispatch the event source, after it has returned %TRUE in
either its @prepare or its @check function. The @dispatch function is
passed in a callback function and data. The callback function may be
%NULL if the source was never connected using g_source_connect(). The
@dispatch function should call the callback function with data and
whatever additional parameters are needed for this type of event source.
</entry>
</row>
<row>
<entry>destroy</entry>
<entry>
Called when the source is destroyed. It will be called with the user data
parameter passed to the g_source_add() and related functions.
Called when the source is destroyed.
</entry>
</row>
</tbody></tgroup></informaltable>
@ -462,57 +636,202 @@ the required condition has been met, and returns TRUE if so.
@dispatch:
@destroy:
<!-- ##### FUNCTION g_source_remove ##### -->
<!-- ##### STRUCT GSourceCallbackFuncs ##### -->
<para>
Removes the event source with the given id.
The id is returned when the source is created, either directly with
g_source_add(), or indirectly with g_idle_add(), g_idle_add_full(),
g_timeout_add() and g_timeout_add_full().
</para>
@tag: the id of the event source to remove.
@Returns: TRUE if the source was found and removed.
@ref:
@unref:
@get:
<!-- ##### 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_add ##### -->
<para>
</para>
@source:
@context:
@Returns:
<!-- ##### FUNCTION g_source_destroy ##### -->
<para>
</para>
@source:
<!-- ##### 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_connect ##### -->
<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 one
of the above functions.
@Returns: it should return FALSE if the source should be removed.
<!-- ##### FUNCTION g_source_connect_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>
Removes the first event source found with the given #GSourceFuncs and user
data.
</para>
<para>
Event sources are sorted with the highest priority first. Sources with equal
priority are stored in the order in which they were added.
</para>
@funcs: the #GSourceFuncs of the source to remove.
@user_data: the user data of the source to remove.
@Returns: TRUE if an event source was found and removed.
<!-- ##### FUNCTION g_source_remove_by_source_data ##### -->
<para>
Removes the first event source found with the given source data.
</para>
<para>
Event sources are sorted with the highest priority first. Sources with equal
priority are stored in the order in which they were added.
</para>
@source_data: the source data, which contains information specific to the
type of source.
@Returns: TRUE if an event source was found and removed.
@funcs:
@user_data:
@Returns:
<!-- ##### FUNCTION g_source_remove_by_user_data ##### -->
<para>
Removes the first event source found with the given user data.
</para>
<para>
Event sources are sorted with the highest priority first. Sources with equal
priority are stored in the order in which they were added.
</para>
@user_data: the user data of the source to remove.
@Returns: TRUE if an event source was found and removed.
@user_data:
@Returns:
<!--
Local variables:
mode: sgml
sgml-parent-document: ("../glib-docs.sgml" "book" "refsect2" "")
End:
-->

View File

@ -61,6 +61,16 @@ second.
@Returns: a new #GTree.
<!-- ##### FUNCTION g_tree_new_with_data ##### -->
<para>
</para>
@key_compare_func:
@user_data:
@Returns:
<!-- ##### FUNCTION g_tree_insert ##### -->
<para>
Inserts a key/value pair into a #GTree.

View File

@ -1,33 +1,36 @@
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:See_Also ##### -->
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:Long_Description ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GTypePluginRef ##### -->
<!-- ##### USER_FUNCTION GTypePluginUnRef ##### -->
<para>
</para>
@plugin:
<!-- ##### ENUM GSignalType ##### -->
<!-- ##### FUNCTION g_signals_destroy ##### -->
<para>
</para>
@G_SIGNAL_RUN_FIRST:
@G_SIGNAL_RUN_LAST:
@G_SIGNAL_RUN_CLEANUP:
@G_SIGNAL_NO_RECURSE:
@G_SIGNAL_ACTION:
@G_SIGNAL_NO_HOOKS:
@itype:
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:Long_Description ##### -->
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:Short_Description ##### -->
<!-- ##### STRUCT GTypePluginVTable ##### -->
<para>
</para>
@plugin_ref:
@plugin_unref:
@complete_type_info:
@complete_interface_info:
<!-- ##### FUNCTION g_signal_connect_closure ##### -->
<para>
@ -41,11 +44,35 @@
@after:
@Returns:
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:Title ##### -->
gtypemodule.sgml
<!-- ##### ENUM GSignalType ##### -->
<para>
</para>
@G_SIGNAL_RUN_FIRST:
@G_SIGNAL_RUN_LAST:
@G_SIGNAL_RUN_CLEANUP:
@G_SIGNAL_NO_RECURSE:
@G_SIGNAL_ACTION:
@G_SIGNAL_NO_HOOKS:
<!-- ##### USER_FUNCTION GTypePluginFillTypeInfo ##### -->
<para>
</para>
@plugin:
@g_type:
@info:
@value_table:
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:See_Also ##### -->
<para>
</para>
<!-- ##### USER_FUNCTION GTypePluginUnRef ##### -->
<!-- ##### USER_FUNCTION GTypePluginRef ##### -->
<para>
</para>
@ -68,32 +95,9 @@ gtypemodule.sgml
@flags:
@Returns:
<!-- ##### USER_FUNCTION GTypePluginFillTypeInfo ##### -->
<para>
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:Title ##### -->
gtypemodule.sgml
</para>
@plugin:
@g_type:
@info:
@value_table:
<!-- ##### FUNCTION g_signals_destroy ##### -->
<para>
</para>
@itype:
<!-- ##### STRUCT GTypePluginVTable ##### -->
<para>
</para>
@plugin_ref:
@plugin_unref:
@complete_type_info:
@complete_interface_info:
<!-- ##### USER_FUNCTION GTypePluginFillInterfaceInfo ##### -->
<para>
@ -105,7 +109,3 @@ gtypemodule.sgml
@instance_type:
@info:
<!-- ##### SECTION ./tmpl/gtypemodule.sgml.sgml:Short_Description ##### -->