home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / Xi / XOpenDevice.z / XOpenDevice
Encoding:
Text File  |  2002-10-03  |  8.3 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXOOOOppppeeeennnnDDDDeeeevvvviiiicccceeee((((3333XXXX11111111))))  XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))   XXXXOOOOppppeeeennnnDDDDeeeevvvviiiicccceeee((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XOpenDevice, XCloseDevice - open or close an extension input
  10.           device
  11.  
  12.      SSSSYYYYNNNNTTTTAAAAXXXX
  13.           XXXXDDDDeeeevvvviiiicccceeee ****XXXXOOOOppppeeeennnnDDDDeeeevvvviiiicccceeee((((_d_i_s_p_l_a_y,,,, _d_e_v_i_c_e__i_d))))
  14.                 DDDDiiiissssppppllllaaaayyyy ****_d_i_s_p_l_a_y;;;;
  15.                 XXXXIIIIDDDD _d_e_v_i_c_e__i_d;;;;
  16.  
  17.           XXXXCCCClllloooosssseeeeDDDDeeeevvvviiiicccceeee((((_d_i_s_p_l_a_y,,,, _d_e_v_i_c_e))))
  18.                 DDDDiiiissssppppllllaaaayyyy ****_d_i_s_p_l_a_y;;;;
  19.                 XXXXDDDDeeeevvvviiiicccceeee ****_d_e_v_i_c_e;;;;
  20.  
  21.  
  22.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  23.           _d_i_s_p_l_a_y     Specifies the connection to the X server.
  24.  
  25.           _d_e_v_i_c_e__i_d   Specifies the id of the device to be opened
  26.  
  27.           _d_e_v_i_c_e      Specifies the device to be closed
  28.  
  29.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  30.           The _X_O_p_e_n_D_e_v_i_c_e request makes an input device accessible to
  31.           a client through input extension protocol requests.  If
  32.           successful, it returns a pointer to an XXXXDDDDeeeevvvviiiicccceeee structure.
  33.  
  34.           The _X_C_l_o_s_e_D_e_v_i_c_e request makes an input device inaccessible
  35.           to a client through input extension protocol requests.
  36.           Before terminating, and client that has opened input devices
  37.           through the input extension should close them via
  38.           _C_l_o_s_e_D_e_v_i_c_e.
  39.  
  40.           When a client makes an _X_C_l_o_s_e_D_e_v_i_c_e request, any active
  41.           grabs that the client has on the device are released.  Any
  42.           event selections that the client has are deleted, as well as
  43.           any passive grabs.  If the requesting client is the last
  44.           client accessing the device, the server may disable all
  45.           access by X to the device.
  46.  
  47.           _X_O_p_e_n_D_e_v_i_c_e and _X_C_l_o_s_e_D_e_v_i_c_e can generate a _B_a_d_D_e_v_i_c_e error.
  48.  
  49.      SSSSTTTTRRRRUUUUCCCCTTTTUUUURRRREEEESSSS
  50.           The _X_D_e_v_i_c_e structure returned by _X_O_p_e_n_D_e_v_i_c_e contains:
  51.           typedef struct {
  52.                XID device_id;
  53.                int num_classes;
  54.                XInputClassInfo *classes;
  55.           } XDevice;
  56.  
  57.           The classes field is a pointer to an array of
  58.           XInputClassInfo structures.  Each element of this array
  59.           contains an event type base for a class of input supported
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 10/3/02)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXOOOOppppeeeennnnDDDDeeeevvvviiiicccceeee((((3333XXXX11111111))))  XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))   XXXXOOOOppppeeeennnnDDDDeeeevvvviiiicccceeee((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.           by the specified device.  The num_classes field indicates
  75.           the number of elements in the classes array.
  76.  
  77.           The _X_I_n_p_u_t_C_l_a_s_s_I_n_f_o structure contains:
  78.  
  79.           typedef struct {
  80.                unsigned char input_class;
  81.                unsigned char event_type_base;
  82.           } XInputClassInfo;
  83.  
  84.           The input_class field identifies one class of input
  85.           supported by the device.  Defined types include _K_e_y_C_l_a_s_s,
  86.           _B_u_t_t_o_n_C_l_a_s_s, _V_a_l_u_a_t_o_r_C_l_a_s_s, _P_r_o_x_i_m_i_t_y_C_l_a_s_s, _F_e_e_d_b_a_c_k_C_l_a_s_s,
  87.           _F_o_c_u_s_C_l_a_s_s, and _O_t_h_e_r_C_l_a_s_s.  The event_type_base identifies
  88.           the event type of the first event in that class.
  89.  
  90.           The information contained in the _X_I_n_p_u_t_C_l_a_s_s_I_n_f_o structure
  91.           is used by macros to obtain the event classes that clients
  92.           use in making _X_S_e_l_e_c_t_E_x_t_e_n_s_i_o_n_E_v_e_n_t requests.  Currently
  93.           defined macros include _D_e_v_i_c_e_K_e_y_P_r_e_s_s, _D_e_v_i_c_e_K_e_y_R_e_l_e_a_s_e,
  94.           _D_e_v_i_c_e_B_u_t_t_o_n_P_r_e_s_s, _D_e_v_i_c_e_B_u_t_t_o_n_R_e_l_e_s_e, _D_e_v_i_c_e_M_o_t_i_o_n_N_o_t_i_f_y,
  95.           _D_e_v_i_c_e_F_o_c_u_s_I_n, _D_e_v_i_c_e_F_o_c_u_s_O_u_t, _P_r_o_x_i_m_i_t_y_I_n, _P_r_o_x_i_m_i_t_y_O_u_t,
  96.           _D_e_v_i_c_e_S_t_a_t_e_N_o_t_i_f_y, _D_e_v_i_c_e_M_a_p_p_i_i_n_g_N_o_t_i_f_y, _C_h_a_n_g_e_D_e_v_i_c_e_N_o_t_i_f_y,
  97.           _D_e_v_i_c_e_P_o_i_n_t_e_r_M_o_t_i_o_n_H_i_n_t, _D_e_v_i_c_e_B_u_t_t_o_n_1_M_o_t_i_o_n,
  98.           _D_e_v_i_c_e_B_u_t_t_o_n_2_M_o_t_i_o_n, _D_e_v_i_c_e_B_u_t_t_o_n_3_M_o_t_i_o_n,
  99.           _D_e_v_i_c_e_B_u_t_t_o_n_4_M_o_t_i_o_n, _D_e_v_i_c_e_B_u_t_t_o_n_5_M_o_t_i_o_n,
  100.           _D_e_v_i_c_e_B_u_t_t_o_n_M_o_t_i_o_n, _D_e_v_i_c_e_O_w_n_e_r_G_r_a_b_B_u_t_t_o_n,
  101.           _D_e_v_i_c_e_B_u_t_t_o_n_P_r_e_s_s_G_r_a_b, and _N_o_E_x_t_e_n_s_i_o_n_E_v_e_n_t.
  102.  
  103.           To obtain the proper event class for a particular device,
  104.           one of the above macros is invoked using the _X_D_e_v_i_c_e
  105.           structure for that device.  For example,
  106.  
  107.           DeviceKeyPress (*device, type, eventclass);
  108.  
  109.           returns the _D_e_v_i_c_e_K_e_y_P_r_e_s_s event type and the eventclass for
  110.           _D_e_v_i_c_e_K_e_y_P_r_e_s_s events from the specified device.
  111.  
  112.           This _e_v_e_n_t_c_l_a_s_s can then be used in an _X_S_e_l_e_c_t_E_x_t_e_n_s_i_o_n_E_v_e_n_t
  113.           request to ask the server to send _D_e_v_i_c_e_K_e_y_P_r_e_s_s events from
  114.           this device. When a selected event is received via
  115.           _X_N_e_x_t_E_v_e_n_t, the _t_y_p_e can be used for comparison with the
  116.           type in the event.
  117.  
  118.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  119.           _B_a_d_D_e_v_i_c_e   An invalid device was specified.  The specified
  120.                       device does not exist, or is the X keyboard or X
  121.                       pointer.  This error may also occur if some
  122.                       other client has caused the specified device to
  123.                       become the X keyboard or X pointer device via
  124.                       the _X_C_h_a_n_g_e_K_e_y_b_o_a_r_d_D_e_v_i_c_e or
  125.                       _X_C_h_a_n_g_e_P_o_i_n_t_e_r_D_e_v_i_c_e requests.
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 10/3/02)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXOOOOppppeeeennnnDDDDeeeevvvviiiicccceeee((((3333XXXX11111111))))  XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))   XXXXOOOOppppeeeennnnDDDDeeeevvvviiiicccceeee((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  141.           _P_r_o_g_r_a_m_m_i_n_g _w_i_t_h _X_l_i_b
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  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.      Page 3                                          (printed 10/3/02)
  196.  
  197.  
  198.  
  199.