NAME

XtConvertAndStore, XtCallConverter - invoke resource converters

SYNTAX

Boolean XtConvertAndStore(Widget _w_i_d_g_e_t, String _f_r_o_m___t_y_p_e, XrmValuePtr _f_r_o_m, String _t_o___t_y_p_e, XrmValuePtr _t_o___i_n___o_u_t); Boolean XtCallConverter(Display* _d_p_y, XtConverter _c_o_n_v_e_r_t_e_r, XrmValuePtr _a_r_g_s, Cardinal _n_u_m___a_r_g_s, XrmValuePtr _f_r_o_m, XrmValuePtr _t_o___i_n___o_u_t, XtCacheRef* _c_a_c_h_e___r_e_f___r_e_t_u_r_n);

ARGUMENTS

_a_r_g_s Specifies the argument list that contains the additional arguments needed
to perform the conversion, or NULL.
_c_o_n_v_e_r_t_e_r Specifies the conversion procedure that is to be called.
_f_r_o_m Specifies the value to be converted.
_f_r_o_m___t_y_p_e Specifies the source type.
_n_u_m___a_r_g_s Specifies the number of additional arguments (often zero).
_t_o___t_y_p_e Specifies the destination type.
_t_o___i_n___o_u_t Returns the converted value.
_w_i_d_g_e_t Specifies the widget to use for additional arguments, if any are needed,
and the destroy callback list.
_d_p_y Specifies the display with which the conversion is to be associated.

DESCRIPTION

The _X_t_C_o_n_v_e_r_t_A_n_d_S_t_o_r_e function looks up the type converter registered to convert from_type to to_type, computes any additional arguments needed, and then calls _X_t_C_a_l_l_C_o_n_v_e_r_t_e_r. (or _X_t_D_i_r_e_c_t_C_o_n_v_e_r_t if an old-style converter was registered with _X_t_A_d_d_C_o_n_v_e_r_t_e_r or _X_t_A_p_p_A_d_d_C_o_n_v_e_r_t_e_r. ) with the from and to_in_out arguments.

The _X_t_C_a_l_l_C_o_n_v_e_r_t_e_r function looks up the specified type converter in the application context associated with the display and, if the converter was not registered or was registered with cache type _X_t_C_a_c_h_e_A_l_l or _X_t_C_a_c_h_e_B_y_D_i_s_p_l_a_y looks in the conversion cache to see if this conversion procedure has been called with the specified conversion arguments. If so, it checks the success status of the prior call, and if the conversion failed, _X_t_C_a_l_l_C_o_n_v_e_r_t_e_r returns _F_a_l_s_e immediately; otherwise it checks the size specified in the _t_o argument and, if it is greater than or equal to the size stored in the cache, copies the information stored in the cache into the location specified by _t_o_-_>_a_d_d_r, stores the cache size into _t_o_-_>_s_i_z_e, and returns _T_r_u_e. If the size specified in the _t_o argument is smaller than the size stored in the cache, _X_t_C_a_l_l_C_o_n_v_e_r_t_e_r copies the cache size into the _t_o_-_>_s_i_z_e and returns _F_a_l_s_e. If the converter was registered with cache type _X_t_C_a_c_h_e_N_o_n_e or no value was found in the conversion cache, _X_t_C_a_l_l_C_o_n_v_e_r_t_e_r calls the converter and, if it was not registered with cache type _X_t_C_a_c_h_e_N_o_n_e, enters the result into the cache. _X_t_C_a_l_l_C_o_n_v_e_r_t_e_r then returns what the converter returned.

The _c_a_c_h_e___r_e_f___r_e_t_u_r_n field specifies storage allocated by the caller in which an opaque value will be stored. If the type converter has been registered with the _X_t_C_a_c_h_e_R_e_f_C_o_u_n_t modifier and if the value returned in in _c_a_c_h_e___r_e_f___r_e_t_u_r_n is non-NULL, then the call should store the _c_a_c_h_e___r_e_f___r_e_t_u_r_n value in order to decrement the reference count when the converted value is no longer required. The _c_a_c_h_e___r_e_f___r_e_t_u_r_n argument should be NULL if the caller is unwilling or unable to store the value.

SEE ALSO

XtAppReleaseCacheRefs(3Xt)
_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
_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e