enums-and-flags            package:RGtk2            R Documentation

_E_n_u_m_s _a_n_d _F_l_a_g_s

_D_e_s_c_r_i_p_t_i_o_n:

     Convenience functions and operators for operating on bitflags and
     enums

_U_s_a_g_e:

     as.flag(x)
     "[.flags"(x, value)
     "|.flag"(x, y)
     "&.flag"(x, y)
     "!.flag"(x)
     "==.enum"(x, y)

_A_r_g_u_m_e_n_t_s:

       x: Numeric value to coerce to a 'flag', an object of class
          'flags', or the left hand operand

       y: Right hand operand

   value: The character id or index for a particular flag in a 'flags'
          vector

_D_e_t_a_i_l_s:

     The libraries bound by RGtk2 often return numeric values that are
     either bitflags or enumerations. In order to facilitate operations
     on these types (especially bitflags), several methods  have been
     defined corresponding to conventional operators for performing
     bitwise operations  and comparisons. 

     RGtk2 defines all of the enum and flag types from the API's as
     vectors of class  'flags' or 'enums' with their names
     corresponding to the  nicknames of the values. The '[' operator on
     the 'flags' class  retrieves a value as a 'flag'. This only
     necessary for the bitwise ops and  thus is not necessary for
     enums.

     The '==.enum' method compares a 'enum' with either a  character or
     numeric representation of an enum value.

_V_a_l_u_e:

     A 'flag' for 'as.flag', '[.flags', and the bitwise operators. A
     logical value for '==.enum'.

_N_o_t_e:

     Sometimes the API does not return a value specifically as a
     'flag'.  In this case, it is a generic numeric value and should be
     coerced with 'as.flag'.

_A_u_t_h_o_r(_s):

     Michael Lawrence

