original_docstring: Writes the context state client side implementation.
docstring: Writes the context state client side implementation.
docstring_tokens: Writes the context state client side implementation .
code: def WriteClientContextStateImpl(self, filename):
      """Writes the context state client side implementation."""
      file = CHeaderWriter(
          filename,
          "// It is included by client_context_state.cc\n")
      code = []
      for capability in _CAPABILITY_FLAGS:
        code.append("%s(%s)" %
                    (capability['name'],
                     ('false', 'true')['default' in capability]))
      file.Write(
        "ClientContextState::EnableFlags::EnableFlags()\n    : %s {\n}\n" %
        ",\n      ".join(code))
      file.Write("\n")
  
      file.Write("""
  bool ClientContextState::SetCapabilityState(
      GLenum cap, bool enabled, bool* changed) {
    *changed = false;
    switch (cap) {
  """)
      for capability in _CAPABILITY_FLAGS:
        file.Write("    case GL_%s:\n" % capability['name'].upper())
        file.Write("""      if (enable_flags.%(name)s != enabled) {
           *changed = true;
           enable_flags.%(name)s = enabled;
        }
        return true;
  """ % capability)
      file.Write("""    default:
        return false;
    }
  }
  """)
      file.Write("""bool ClientContextState::GetEnabled(
      GLenum cap, bool* enabled) const {
    switch (cap) {
  """)
      for capability in _CAPABILITY_FLAGS:
        file.Write("    case GL_%s:\n" % capability['name'].upper())
        file.Write("      *enabled = enable_flags.%s;\n" % capability['name'])
        file.Write("      return true;\n")
      file.Write("""    default:
        return false;
    }
  }
  """)
      file.Close()
      self.generated_cpp_filenames.append(file.filename)
code_tokens: def WriteClientContextStateImpl ( self , filename ) : file = CHeaderWriter ( filename , "// It is included by client_context_state.cc\n" ) code = [ ] for capability in _CAPABILITY_FLAGS : code . append ( "%s(%s)" % ( capability [ 'name' ] , ( 'false' , 'true' ) [ 'default' in capability ] ) ) file . Write ( "ClientContextState::EnableFlags::EnableFlags()\n    : %s {\n}\n" % ",\n      " . join ( code ) ) file . Write ( "\n" ) file . Write ( """
  bool ClientContextState::SetCapabilityState(
      GLenum cap, bool enabled, bool* changed) {
    *changed = false;
    switch (cap) {
  """ ) for capability in _CAPABILITY_FLAGS : file . Write ( "    case GL_%s:\n" % capability [ 'name' ] . upper ( ) ) file . Write ( """      if (enable_flags.%(name)s != enabled) {
           *changed = true;
           enable_flags.%(name)s = enabled;
        }
        return true;
  """ % capability ) file . Write ( """    default:
        return false;
    }
  }
  """ ) file . Write ( """bool ClientContextState::GetEnabled(
      GLenum cap, bool* enabled) const {
    switch (cap) {
  """ ) for capability in _CAPABILITY_FLAGS : file . Write ( "    case GL_%s:\n" % capability [ 'name' ] . upper ( ) ) file . Write ( "      *enabled = enable_flags.%s;\n" % capability [ 'name' ] ) file . Write ( "      return true;\n" ) file . Write ( """    default:
        return false;
    }
  }
  """ ) file . Close ( ) self . generated_cpp_filenames . append ( file . filename )
short_docstring: Writes the context state client side implementation.
short_docstring_tokens: Writes the context state client side implementation .
comment: """Writes the context state client side implementation."""