summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore/ecore_main.c
diff options
context:
space:
mode:
authorDaniel Juyung Seo <seojuyung2@gmail.com>2012-02-02 05:21:24 +0000
committerDaniel Juyung Seo <seojuyung2@gmail.com>2012-02-02 05:21:24 +0000
commitde5074849f8f109b953b41b081dfdd77c396ca89 (patch)
treed90dd2b95bdd17d6b0b7ac88764adbc38d2ce2ce /legacy/ecore/src/lib/ecore/ecore_main.c
parent705522795705289d7fc697c0aeae0b349e2e6471 (diff)
ecore ecore_main.c: Fixed formatting. It has nice documentation. Thanks raster :O
SVN revision: 67685
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore_main.c89
1 files changed, 52 insertions, 37 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore_main.c b/legacy/ecore/src/lib/ecore/ecore_main.c
index 76aced6dd1..79814c4bce 100644
--- a/legacy/ecore/src/lib/ecore/ecore_main.c
+++ b/legacy/ecore/src/lib/ecore/ecore_main.c
@@ -848,6 +848,21 @@ _ecore_main_fd_handler_del(Ecore_Fd_Handler *fd_handler)
848 * DO NOT use this function unless you are the person God comes to ask for 848 * DO NOT use this function unless you are the person God comes to ask for
849 * advice when He has trouble managing the Universe. 849 * advice when He has trouble managing the Universe.
850 */ 850 */
851
852EAPI int
853ecore_main_loop_iterate_may_block(int may_block)
854{
855#ifndef USE_G_MAIN_LOOP
856 _ecore_lock();
857in_main_loop++;
858 _ecore_main_loop_iterate_internal(!may_block);
859in_main_loop--;
860 _ecore_unlock();
861 return _ecore_event_exist();
862#else
863 return g_main_context_iteration(NULL, may_block);
864#endif
865}
851EAPI void 866EAPI void
852ecore_main_loop_iterate(void) 867ecore_main_loop_iterate(void)
853{ 868{
@@ -1742,14 +1757,14 @@ _ecore_main_loop_iterate_internal(int once_only)
1742 if (_ecore_event_exist()) 1757 if (_ecore_event_exist())
1743 { 1758 {
1744 /* but first conceptually enter an idle state */ 1759 /* but first conceptually enter an idle state */
1745 _ecore_idle_enterer_call(); 1760 _ecore_idle_enterer_call();
1746 _ecore_throttle(); 1761 _ecore_throttle();
1747 /* now quickly poll to see which input fd's are active */ 1762 /* now quickly poll to see which input fd's are active */
1748 _ecore_main_select(0.0); 1763 _ecore_main_select(0.0);
1749 /* allow newly queued timers to expire from now on */ 1764 /* allow newly queued timers to expire from now on */
1750 _ecore_timer_enable_new(); 1765 _ecore_timer_enable_new();
1751 /* go straight to processing the events we had queued */ 1766 /* go straight to processing the events we had queued */
1752 goto process_all; 1767 goto process_all;
1753 } 1768 }
1754 1769
1755 if (once_only) 1770 if (once_only)
@@ -1758,17 +1773,17 @@ _ecore_main_loop_iterate_internal(int once_only)
1758 * if we got any events or signals, allow new timers to process. 1773 * if we got any events or signals, allow new timers to process.
1759 * use bitwise or to force both conditions to be tested and 1774 * use bitwise or to force both conditions to be tested and
1760 * merged together */ 1775 * merged together */
1761 if (_ecore_main_select(0.0) | _ecore_signal_count_get()) 1776 if (_ecore_main_select(0.0) | _ecore_signal_count_get())
1762 { 1777 {
1763 _ecore_timer_enable_new(); 1778 _ecore_timer_enable_new();
1764 goto process_all; 1779 goto process_all;
1765 } 1780 }
1766 } 1781 }
1767 else 1782 else
1768 { 1783 {
1769 /* call idle enterers ... */ 1784 /* call idle enterers ... */
1770 _ecore_idle_enterer_call(); 1785 _ecore_idle_enterer_call();
1771 _ecore_throttle(); 1786 _ecore_throttle();
1772 } 1787 }
1773 1788
1774 /* if these calls caused any buffered events to appear - deal with them */ 1789 /* if these calls caused any buffered events to appear - deal with them */
@@ -1787,10 +1802,10 @@ _ecore_main_loop_iterate_internal(int once_only)
1787 if (once_only) 1802 if (once_only)
1788 { 1803 {
1789 /* in once_only mode enter idle here instead and then return */ 1804 /* in once_only mode enter idle here instead and then return */
1790 _ecore_idle_enterer_call(); 1805 _ecore_idle_enterer_call();
1791 _ecore_throttle(); 1806 _ecore_throttle();
1792 _ecore_timer_enable_new(); 1807 _ecore_timer_enable_new();
1793 goto done; 1808 goto done;
1794 } 1809 }
1795 1810
1796 _ecore_fps_marker_1(); 1811 _ecore_fps_marker_1();
@@ -1808,23 +1823,23 @@ start_loop: /***************************************************************/
1808 if (!_ecore_event_exist()) 1823 if (!_ecore_event_exist())
1809 { 1824 {
1810 /* init flags */ 1825 /* init flags */
1811 next_time = _ecore_timer_next_get(); 1826 next_time = _ecore_timer_next_get();
1812 /* no idlers */ 1827 /* no idlers */
1813 if (!_ecore_idler_exist()) 1828 if (!_ecore_idler_exist())
1814 { 1829 {
1815 /* sleep until timeout or forever (-1.0) waiting for on fds */ 1830 /* sleep until timeout or forever (-1.0) waiting for on fds */
1816 _ecore_main_select(next_time); 1831 _ecore_main_select(next_time);
1817 } 1832 }
1818 else 1833 else
1819 { 1834 {
1820 int action = LOOP_CONTINUE; 1835 int action = LOOP_CONTINUE;
1821 1836
1822 /* no timers - spin */ 1837 /* no timers - spin */
1823 if (next_time < 0) action = _ecore_main_loop_spin_no_timers(); 1838 if (next_time < 0) action = _ecore_main_loop_spin_no_timers();
1824 /* timers - spin */ 1839 /* timers - spin */
1825 else action = _ecore_main_loop_spin_timers(); 1840 else action = _ecore_main_loop_spin_timers();
1826 if (action == SPIN_RESTART) goto start_loop; 1841 if (action == SPIN_RESTART) goto start_loop;
1827 } 1842 }
1828 } 1843 }
1829 _ecore_fps_marker_2(); 1844 _ecore_fps_marker_2();
1830 1845
@@ -1847,8 +1862,8 @@ process_all: /***********************************************************/
1847 if (once_only) 1862 if (once_only)
1848 { 1863 {
1849 /* if in once_only mode handle idle exiting */ 1864 /* if in once_only mode handle idle exiting */
1850 _ecore_idle_enterer_call(); 1865 _ecore_idle_enterer_call();
1851 _ecore_throttle(); 1866 _ecore_throttle();
1852 } 1867 }
1853 1868
1854done: /*******************************************************************/ 1869done: /*******************************************************************/