parameters: (self, func, f)
docstring: Overridden from TypeHandler.
docstring_summary: Overridden from TypeHandler.
docstring_tokens: Overridden from TypeHandler .
function: def WriteHandlerImplementation(self, func, f):
      """Overridden from TypeHandler."""
      state_name = func.GetInfo('state')
      state = _STATES[state_name]
      states = state['states']
      args = func.GetOriginalArgs()
      num_args = len(args)
      assert num_args == 2
      f.write("  switch (%s) {\n" % args[0].name)
      for state in states:
        f.write("    case %s:\n" % state['enum'])
        f.write("      if (state_.%s != %s) {\n" %
                   (state['name'], args[1].name))
        f.write("        state_.%s = %s;\n" % (state['name'], args[1].name))
        if not func.GetInfo("no_gl"):
          operation = "        %s(%s);\n" % \
                      (func.GetGLFunctionName(), func.MakeOriginalArgString(""))
          f.write(GuardState(state, operation))
        f.write("      }\n")
        f.write("      break;\n")
      f.write("    default:\n")
      f.write("      NOTREACHED();\n")
      f.write("  }\n")
function_tokens: def WriteHandlerImplementation ( self , func , f ) : state_name = func . GetInfo ( 'state' ) state = _STATES [ state_name ] states = state [ 'states' ] args = func . GetOriginalArgs ( ) num_args = len ( args ) assert num_args == 2 f . write ( "  switch (%s) {\n" % args [ 0 ] . name ) for state in states : f . write ( "    case %s:\n" % state [ 'enum' ] ) f . write ( "      if (state_.%s != %s) {\n" % ( state [ 'name' ] , args [ 1 ] . name ) ) f . write ( "        state_.%s = %s;\n" % ( state [ 'name' ] , args [ 1 ] . name ) ) if not func . GetInfo ( "no_gl" ) : operation = "        %s(%s);\n" % ( func . GetGLFunctionName ( ) , func . MakeOriginalArgString ( "" ) ) f . write ( GuardState ( state , operation ) ) f . write ( "      }\n" ) f . write ( "      break;\n" ) f . write ( "    default:\n" ) f . write ( "      NOTREACHED();\n" ) f . write ( "  }\n" )