home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xtappmainloop.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  7.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4. XtAppNextEvent(3Xt)       XT FUNCTIONS          XtAppNextEvent(3Xt)
  5.  
  6.  
  7. NNAAMMEE
  8.        XtAppNextEvent, XtAppPending, XtAppPeekEvent, XtApp-
  9.        ProcessEvent, XtDispatchEvent, XtAppMainLoop - query and
  10.        process events and input
  11.  
  12. SSYYNNTTAAXX
  13.        void XtAppNextEvent(_a_p_p___c_o_n_t_e_x_t, _e_v_e_n_t___r_e_t_u_r_n)
  14.          XtAppContext _a_p_p___c_o_n_t_e_x_t;
  15.          XEvent *_e_v_e_n_t___r_e_t_u_r_n;
  16.  
  17.        Boolean XtAppPeekEvent(_a_p_p___c_o_n_t_e_x_t, _e_v_e_n_t___r_e_t_u_r_n)
  18.          XtAppContext _a_p_p___c_o_n_t_e_x_t;
  19.          XEvent *_e_v_e_n_t___r_e_t_u_r_n;
  20.  
  21.        XtInputMask XtAppPending(_a_p_p___c_o_n_t_e_x_t)
  22.          XtAppContext _a_p_p___c_o_n_t_e_x_t;
  23.  
  24.        void XtAppProcessEvent(_a_p_p___c_o_n_t_e_x_t, _m_a_s_k)
  25.          XtAppContext _a_p_p___c_o_n_t_e_x_t;
  26.          XtInputMask _m_a_s_k;
  27.  
  28.        Boolean XtDispatchEvent(_e_v_e_n_t)
  29.          XEvent *_e_v_e_n_t;
  30.  
  31.        void XtAppMainLoop(_a_p_p___c_o_n_t_e_x_t)
  32.          XtAppContext _a_p_p___c_o_n_t_e_x_t;
  33.  
  34. AARRGGUUMMEENNTTSS
  35.        _a_p_p___c_o_n_t_e_x_t
  36.          Specifies the application context that identi-
  37.          fies the application .
  38.  
  39.        _e_v_e_n_t     Specifies a pointer to the event structure that
  40.          is to be dispatched to the appropriate event
  41.          handler.
  42.  
  43.        _e_v_e_n_t___r_e_t_u_r_n
  44.          Returns the event information to the specified
  45.          event structure.
  46.  
  47.        _m_a_s_k     Specifies what types of events to process.  The
  48.          mask is the bitwise inclusive OR of any combina-
  49.          tion of _X_t_I_M_X_E_v_e_n_t, _X_t_I_M_T_i_m_e_r,
  50.          _X_t_I_M_A_l_t_e_r_n_a_t_e_I_n_p_u_t, and _X_t_I_M_S_i_g_n_a_l.  As a conve-
  51.          nience, the X Toolkit defines the symbolic name
  52.          _X_t_I_M_A_l_l to be the bitwise inclusive OR of all
  53.          event types.
  54.  
  55. DDEESSCCRRIIPPTTIIOONN
  56.        If the X event queue is empty, _X_t_A_p_p_N_e_x_t_E_v_e_n_t flushes the
  57.        X output buffers of each Display in the application con-
  58.        text and waits for an event while looking at the other
  59.        input sources, timeout timeout values, and signal handlers
  60.        and calling any callback procedures triggered by them.
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XtAppNextEvent(3Xt)       XT FUNCTIONS          XtAppNextEvent(3Xt)
  71.  
  72.  
  73.        This wait time can be used for background processing (see
  74.        Section 7.8).
  75.  
  76.        If there is an event in the queue, _X_t_A_p_p_P_e_e_k_E_v_e_n_t fills in
  77.        the event and returns a nonzero value. If no X input is on
  78.        the queue, _X_t_A_p_p_P_e_e_k_E_v_e_n_t flushes the output buffer and
  79.        blocks until input is available (possibly calling some
  80.        timeout callbacks in the process).  If the input is an
  81.        event, _X_t_A_p_p_P_e_e_k_E_v_e_n_t fills in the event and returns a
  82.        nonzero value.  Otherwise, the input is for an alternate
  83.        input source, and _X_t_A_p_p_P_e_e_k_E_v_e_n_t returns zero.
  84.  
  85.        The _X_t_A_p_p_P_e_n_d_i_n_g function returns a nonzero value if there
  86.        are events pending from the X server, timer pending, or
  87.        other input sources pending. The value returned is a bit
  88.        mask that is the OR of _X_t_I_M_X_E_v_e_n_t, _X_t_I_M_T_i_m_e_r,
  89.        _X_t_I_M_A_l_t_e_r_n_a_t_e_I_n_p_u_t, and _X_t_I_M_S_i_g_n_a_l (see
  90.        _X_t_A_p_p_P_r_o_c_e_s_s_E_v_e_n_t).  If there are no events pending,
  91.        _X_t_A_p_p_P_e_n_d_i_n_g flushes the output buffer and returns zero.
  92.  
  93.        The _X_t_A_p_p_P_r_o_c_e_s_s_E_v_e_n_t function processes one timer, alter-
  94.        nate input, signal source, or X event.  If there is noth-
  95.        ing of the appropriate type to process, _X_t_A_p_p_P_r_o_c_e_s_s_E_v_e_n_t
  96.        blocks until there is.  If there is more than one type of
  97.        thing available to process, it is undefined which will get
  98.        processed.  Usually, this procedure is not called by
  99.        client applications (see _X_t_A_p_p_M_a_i_n_L_o_o_p).     _X_t_A_p_p_P_r_o_c_e_s_s_-
  100.        _E_v_e_n_t processes timer events by calling any appropriate
  101.        timer callbacks, alternate input by calling any appropri-
  102.        ate alternate input callbacks, signal source by calling
  103.        any appropriate signal callbacks, and X events by calling
  104.        _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t.
  105.  
  106.        When an X event is received, it is passed to
  107.        _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t, which calls the appropriate event han-
  108.        dlers and passes them the widget, the event, and client-
  109.        specific data registered with each procedure.  If there
  110.        are no handlers for that event registered, the event is
  111.        ignored and the dispatcher simply returns.  The order in
  112.        which the handlers are called is undefined.
  113.  
  114.        The _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t function sends those events to the
  115.        event handler functions that have been previously regis-
  116.        tered with the dispatch routine.     _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t returns
  117.        _T_r_u_e if it dispatched the event to some handler and _F_a_l_s_e
  118.        if it found no handler to dispatch the event to.     The most
  119.        common use of _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t is to dispatch events
  120.        acquired with the _X_t_A_p_p_N_e_x_t_E_v_e_n_t procedure.  However, it
  121.        also can be used to dispatch user-constructed events.  _X_t_-
  122.        _D_i_s_p_a_t_c_h_E_v_e_n_t also is responsible for implementing the
  123.        grab semantics for _X_t_A_d_d_G_r_a_b.
  124.  
  125.        The _X_t_A_p_p_M_a_i_n_L_o_o_p function first reads the next incoming X
  126.        event by calling _X_t_A_p_p_N_e_x_t_E_v_e_n_t and then it dispatches the
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XtAppNextEvent(3Xt)       XT FUNCTIONS          XtAppNextEvent(3Xt)
  137.  
  138.  
  139.        event to the appropriate registered procedure by calling
  140.        _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t.     This constitutes the main loop of X
  141.        Toolkit applications, and, as such, it does not return.
  142.        Applications are expected to exit in response to some user
  143.        action.    There is nothing special about _X_t_A_p_p_M_a_i_n_L_o_o_p; it
  144.        is simply an infinite loop that calls _X_t_A_p_p_N_e_x_t_E_v_e_n_t and
  145.        then _X_t_D_i_s_p_a_t_c_h_E_v_e_n_t.
  146.  
  147.        Applications can provide their own version of this loop,
  148.        which tests some global termination flag or tests that the
  149.        number of top-level widgets is larger than zero before
  150.        circling back to the call to _X_t_A_p_p_N_e_x_t_E_v_e_n_t.
  151.  
  152. SSEEEE AALLSSOO
  153.        _X _T_o_o_l_k_i_t _I_n_t_r_i_n_s_i_c_s _- _C _L_a_n_g_u_a_g_e _I_n_t_e_r_f_a_c_e
  154.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.