How to use return_type method in wpt

Best JavaScript code snippet using wpt

generate_bindings.py

Source:generate_bindings.py Github

copy

Full Screen

1#!/usr/bin/env python2# Copyright (c) 2012 The Chromium Authors. All rights reserved.3# Use of this source code is governed by a BSD-style license that can be4# found in the LICENSE file.5"""code generator for GL/GLES extension wrangler."""6import optparse7import os8import collections9import re10import platform11import sys12from subprocess import call13from collections import namedtuple14HEADER_PATHS = [15 '../../third_party/khronos',16 '../../third_party/mesa/src/include',17 '.',18 '../../gpu',19]20UNCONDITIONALLY_BOUND_EXTENSIONS = set([21 'WGL_ARB_extensions_string',22 'WGL_EXT_extensions_string',23 'GL_CHROMIUM_gles_depth_binding_hack', # crbug.com/44820624 'GL_CHROMIUM_glgetstringi_hack', # crbug.com/47039625 'GL_CHROMIUM_egl_khr_fence_sync_hack', # crbug.com/50475826])27"""Function binding conditions can be specified manually by supplying a versions28array instead of the names array. Each version has the following keys:29 name: Mandatory. Name of the function. Multiple versions can have the same30 name but different conditions.31 extensions: Extra Extensions for which the function is bound. Only needed32 in some cases where the extension cannot be parsed from the33 headers.34By default, the function gets its name from the first name in its names or35versions array. This can be overridden by supplying a 'known_as' key.36"""37GL_FUNCTIONS = [38{ 'return_type': 'void',39 'names': ['glActiveTexture'],40 'arguments': 'GLenum texture', },41{ 'return_type': 'void',42 'names': ['glAttachShader'],43 'arguments': 'GLuint program, GLuint shader', },44{ 'return_type': 'void',45 'versions': [{ 'name': 'glBeginQuery' },46 { 'name': 'glBeginQueryARB' },47 { 'name': 'glBeginQueryEXT',48 'extensions': ['GL_EXT_occlusion_query_boolean'] }],49 'arguments': 'GLenum target, GLuint id', },50{ 'return_type': 'void',51 'versions': [{ 'name': 'glBeginTransformFeedback' }],52 'arguments': 'GLenum primitiveMode', },53{ 'return_type': 'void',54 'names': ['glBindAttribLocation'],55 'arguments': 'GLuint program, GLuint index, const char* name', },56{ 'return_type': 'void',57 'names': ['glBindBuffer'],58 'arguments': 'GLenum target, GLuint buffer', },59{ 'return_type': 'void',60 'versions': [{ 'name': 'glBindBufferBase' }],61 'arguments': 'GLenum target, GLuint index, GLuint buffer', },62{ 'return_type': 'void',63 'versions': [{ 'name': 'glBindBufferRange' }],64 'arguments': 'GLenum target, GLuint index, GLuint buffer, GLintptr offset, '65 'GLsizeiptr size', },66{ 'return_type': 'void',67 'names': ['glBindFragDataLocation'],68 'arguments': 'GLuint program, GLuint colorNumber, const char* name', },69{ 'return_type': 'void',70 'names': ['glBindFragDataLocationIndexed'],71 'arguments':72 'GLuint program, GLuint colorNumber, GLuint index, const char* name', },73{ 'return_type': 'void',74 'names': ['glBindFramebufferEXT', 'glBindFramebuffer'],75 'arguments': 'GLenum target, GLuint framebuffer', },76{ 'return_type': 'void',77 'names': ['glBindRenderbufferEXT', 'glBindRenderbuffer'],78 'arguments': 'GLenum target, GLuint renderbuffer', },79{ 'return_type': 'void',80 'versions': [{ 'name': 'glBindSampler' }],81 'arguments': 'GLuint unit, GLuint sampler', },82{ 'return_type': 'void',83 'names': ['glBindTexture'],84 'arguments': 'GLenum target, GLuint texture', },85{ 'return_type': 'void',86 'versions': [{ 'name': 'glBindTransformFeedback' }],87 'arguments': 'GLenum target, GLuint id', },88{ 'return_type': 'void',89 'known_as': 'glBindVertexArrayOES',90 'versions': [{ 'name': 'glBindVertexArray',91 'extensions': ['GL_ARB_vertex_array_object'], },92 { 'name': 'glBindVertexArrayOES' },93 { 'name': 'glBindVertexArrayAPPLE',94 'extensions': ['GL_APPLE_vertex_array_object'] }],95 'arguments': 'GLuint array' },96{ 'return_type': 'void',97 'known_as': 'glBlendBarrierKHR',98 'versions': [{ 'name': 'glBlendBarrierNV',99 'extensions': ['GL_NV_blend_equation_advanced'] },100 { 'name': 'glBlendBarrierKHR',101 'extensions': ['GL_KHR_blend_equation_advanced'] }],102 'arguments': 'void' },103{ 'return_type': 'void',104 'names': ['glBlendColor'],105 'arguments': 'GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha', },106{ 'return_type': 'void',107 'names': ['glBlendEquation'],108 'arguments': ' GLenum mode ', },109{ 'return_type': 'void',110 'names': ['glBlendEquationSeparate'],111 'arguments': 'GLenum modeRGB, GLenum modeAlpha', },112{ 'return_type': 'void',113 'names': ['glBlendFunc'],114 'arguments': 'GLenum sfactor, GLenum dfactor', },115{ 'return_type': 'void',116 'names': ['glBlendFuncSeparate'],117 'arguments':118 'GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha', },119{ 'return_type': 'void',120 'names': ['glBlitFramebuffer'],121 'arguments': 'GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, '122 'GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, '123 'GLbitfield mask, GLenum filter', },124{ 'return_type': 'void',125 'names': ['glBlitFramebufferANGLE', 'glBlitFramebuffer'],126 'arguments': 'GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, '127 'GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, '128 'GLbitfield mask, GLenum filter', },129{ 'return_type': 'void',130 'names': ['glBlitFramebufferEXT', 'glBlitFramebuffer'],131 'arguments': 'GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, '132 'GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, '133 'GLbitfield mask, GLenum filter', },134{ 'return_type': 'void',135 'names': ['glBufferData'],136 'arguments':137 'GLenum target, GLsizeiptr size, const void* data, GLenum usage', },138{ 'return_type': 'void',139 'names': ['glBufferSubData'],140 'arguments':141 'GLenum target, GLintptr offset, GLsizeiptr size, const void* data', },142{ 'return_type': 'GLenum',143 'names': ['glCheckFramebufferStatusEXT',144 'glCheckFramebufferStatus'],145 'arguments': 'GLenum target',146 'logging_code': """147 GL_SERVICE_LOG("GL_RESULT: " << GLEnums::GetStringEnum(result));148""", },149{ 'return_type': 'void',150 'names': ['glClear'],151 'arguments': 'GLbitfield mask', },152{ 'return_type': 'void',153 'versions': [{ 'name': 'glClearBufferfi' }],154 'arguments': 'GLenum buffer, GLint drawbuffer, const GLfloat depth, '155 'GLint stencil', },156{ 'return_type': 'void',157 'versions': [{ 'name': 'glClearBufferfv' }],158 'arguments': 'GLenum buffer, GLint drawbuffer, const GLfloat* value', },159{ 'return_type': 'void',160 'versions': [{ 'name': 'glClearBufferiv' }],161 'arguments': 'GLenum buffer, GLint drawbuffer, const GLint* value', },162{ 'return_type': 'void',163 'versions': [{ 'name': 'glClearBufferuiv' }],164 'arguments': 'GLenum buffer, GLint drawbuffer, const GLuint* value', },165{ 'return_type': 'void',166 'names': ['glClearColor'],167 'arguments': 'GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha', },168{ 'return_type': 'void',169 'versions': [{ 'name': 'glClearDepth',170 'extensions': ['GL_CHROMIUM_gles_depth_binding_hack'] }],171 'arguments': 'GLclampd depth', },172{ 'return_type': 'void',173 'names': ['glClearDepthf'],174 'arguments': 'GLclampf depth', },175{ 'return_type': 'void',176 'names': ['glClearStencil'],177 'arguments': 'GLint s', },178{ 'return_type': 'GLenum',179 'versions': [{ 'name': 'glClientWaitSync',180 'extensions': ['GL_ARB_sync'] }],181 'arguments': 'GLsync sync, GLbitfield flags, GLuint64 timeout', },182{ 'return_type': 'void',183 'names': ['glColorMask'],184 'arguments':185 'GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha', },186{ 'return_type': 'void',187 'names': ['glCompileShader'],188 'arguments': 'GLuint shader', },189{ 'return_type': 'void',190 'names': ['glCompressedTexImage2D'],191 'arguments':192 'GLenum target, GLint level, GLenum internalformat, GLsizei width, '193 'GLsizei height, GLint border, GLsizei imageSize, const void* data', },194{ 'return_type': 'void',195 'versions': [{ 'name': 'glCompressedTexImage3D' }],196 'arguments':197 'GLenum target, GLint level, GLenum internalformat, GLsizei width, '198 'GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, '199 'const void* data', },200{ 'return_type': 'void',201 'names': ['glCompressedTexSubImage2D'],202 'arguments':203 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '204 'GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, '205 'const void* data', },206{ 'return_type': 'void',207 'versions': [{ 'name': 'glCompressedTexSubImage3D' }],208 'arguments':209 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '210 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '211 'GLenum format, GLsizei imageSize, const void* data', },212{ 'return_type': 'void',213 'versions': [{ 'name': 'glCopyBufferSubData' }],214 'arguments':215 'GLenum readTarget, GLenum writeTarget, GLintptr readOffset, '216 'GLintptr writeOffset, GLsizeiptr size', },217{ 'return_type': 'void',218 'names': ['glCopyTexImage2D'],219 'arguments':220 'GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, '221 'GLsizei width, GLsizei height, GLint border', },222{ 'return_type': 'void',223 'names': ['glCopyTexSubImage2D'],224 'arguments':225 'GLenum target, GLint level, GLint xoffset, '226 'GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height', },227{ 'return_type': 'void',228 'versions': [{ 'name': 'glCopyTexSubImage3D' }],229 'arguments':230 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '231 'GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height', },232{ 'return_type': 'GLuint',233 'names': ['glCreateProgram'],234 'arguments': 'void', },235{ 'return_type': 'GLuint',236 'names': ['glCreateShader'],237 'arguments': 'GLenum type', },238{ 'return_type': 'void',239 'names': ['glCullFace'],240 'arguments': 'GLenum mode', },241{ 'return_type': 'void',242 'names': ['glDeleteBuffers'],243 'known_as': 'glDeleteBuffersARB',244 'arguments': 'GLsizei n, const GLuint* buffers', },245{ 'return_type': 'void',246 'known_as': 'glDeleteFencesAPPLE',247 'versions': [{ 'name': 'glDeleteFencesAPPLE',248 'extensions': ['GL_APPLE_fence'] }],249 'arguments': 'GLsizei n, const GLuint* fences', },250{ 'return_type': 'void',251 'names': ['glDeleteFencesNV'],252 'arguments': 'GLsizei n, const GLuint* fences', },253{ 'return_type': 'void',254 'names': ['glDeleteFramebuffersEXT', 'glDeleteFramebuffers'],255 'arguments': 'GLsizei n, const GLuint* framebuffers', },256{ 'return_type': 'void',257 'names': ['glDeleteProgram'],258 'arguments': 'GLuint program', },259{ 'return_type': 'void',260 'versions': [{ 'name': 'glDeleteQueries' },261 { 'name': 'glDeleteQueriesARB'},262 { 'name': 'glDeleteQueriesEXT',263 'extensions': ['GL_EXT_occlusion_query_boolean'] }],264 'arguments': 'GLsizei n, const GLuint* ids', },265{ 'return_type': 'void',266 'names': ['glDeleteRenderbuffersEXT', 'glDeleteRenderbuffers'],267 'arguments': 'GLsizei n, const GLuint* renderbuffers', },268{ 'return_type': 'void',269 'versions': [{ 'name': 'glDeleteSamplers' }],270 'arguments': 'GLsizei n, const GLuint* samplers', },271{ 'return_type': 'void',272 'names': ['glDeleteShader'],273 'arguments': 'GLuint shader', },274{ 'return_type': 'void',275 'versions': [{ 'name': 'glDeleteSync',276 'extensions': ['GL_ARB_sync'] }],277 'arguments': 'GLsync sync', },278{ 'return_type': 'void',279 'names': ['glDeleteTextures'],280 'arguments': 'GLsizei n, const GLuint* textures', },281{ 'return_type': 'void',282 'versions': [{ 'name': 'glDeleteTransformFeedbacks' }],283 'arguments': 'GLsizei n, const GLuint* ids', },284{ 'return_type': 'void',285 'known_as': 'glDeleteVertexArraysOES',286 'versions': [{ 'name': 'glDeleteVertexArrays',287 'extensions': ['GL_ARB_vertex_array_object'], },288 { 'name': 'glDeleteVertexArraysOES' },289 { 'name': 'glDeleteVertexArraysAPPLE',290 'extensions': ['GL_APPLE_vertex_array_object'] }],291 'arguments': 'GLsizei n, const GLuint* arrays' },292{ 'return_type': 'void',293 'names': ['glDepthFunc'],294 'arguments': 'GLenum func', },295{ 'return_type': 'void',296 'names': ['glDepthMask'],297 'arguments': 'GLboolean flag', },298{ 'return_type': 'void',299 'versions': [{ 'name': 'glDepthRange',300 'extensions': ['GL_CHROMIUM_gles_depth_binding_hack'] }],301 'arguments': 'GLclampd zNear, GLclampd zFar', },302{ 'return_type': 'void',303 'names': ['glDepthRangef'],304 'arguments': 'GLclampf zNear, GLclampf zFar', },305{ 'return_type': 'void',306 'names': ['glDetachShader'],307 'arguments': 'GLuint program, GLuint shader', },308{ 'return_type': 'void',309 'names': ['glDisable'],310 'arguments': 'GLenum cap', },311{ 'return_type': 'void',312 'names': ['glDisableVertexAttribArray'],313 'arguments': 'GLuint index', },314{ 'return_type': 'void',315 'versions': [{ 'name': 'glDiscardFramebufferEXT',316 'extensions': ['GL_EXT_discard_framebuffer'] }],317 'arguments': 'GLenum target, GLsizei numAttachments, '318 'const GLenum* attachments' },319{ 'return_type': 'void',320 'names': ['glDrawArrays'],321 'arguments': 'GLenum mode, GLint first, GLsizei count', },322{ 'return_type': 'void',323 'known_as': 'glDrawArraysInstancedANGLE',324 'names': ['glDrawArraysInstancedARB', 'glDrawArraysInstancedANGLE',325 'glDrawArraysInstanced'],326 'arguments': 'GLenum mode, GLint first, GLsizei count, GLsizei primcount', },327{ 'return_type': 'void',328 'names': ['glDrawBuffer'],329 'arguments': 'GLenum mode', },330{ 'return_type': 'void',331 'names': ['glDrawBuffersARB', 'glDrawBuffersEXT', 'glDrawBuffers'],332 'arguments': 'GLsizei n, const GLenum* bufs', },333{ 'return_type': 'void',334 'names': ['glDrawElements'],335 'arguments':336 'GLenum mode, GLsizei count, GLenum type, const void* indices', },337{ 'return_type': 'void',338 'known_as': 'glDrawElementsInstancedANGLE',339 'names': ['glDrawElementsInstancedARB', 'glDrawElementsInstancedANGLE',340 'glDrawElementsInstanced'],341 'arguments':342 'GLenum mode, GLsizei count, GLenum type, const void* indices, '343 'GLsizei primcount', },344{ 'return_type': 'void',345 'versions': [{ 'name': 'glDrawRangeElements' }],346 'arguments': 'GLenum mode, GLuint start, GLuint end, GLsizei count, '347 'GLenum type, const void* indices', },348{ 'return_type': 'void',349 'names': ['glEGLImageTargetRenderbufferStorageOES'],350 'arguments': 'GLenum target, GLeglImageOES image', },351{ 'return_type': 'void',352 'names': ['glEGLImageTargetTexture2DOES'],353 'arguments': 'GLenum target, GLeglImageOES image', },354{ 'return_type': 'void',355 'names': ['glEnable'],356 'arguments': 'GLenum cap', },357{ 'return_type': 'void',358 'names': ['glEnableVertexAttribArray'],359 'arguments': 'GLuint index', },360{ 'return_type': 'void',361 'versions': [{ 'name': 'glEndQuery' },362 { 'name': 'glEndQueryARB' },363 { 'name': 'glEndQueryEXT',364 'extensions': ['GL_EXT_occlusion_query_boolean'] }],365 'arguments': 'GLenum target', },366{ 'return_type': 'void',367 'versions': [{ 'name': 'glEndTransformFeedback' }],368 'arguments': 'void', },369{ 'return_type': 'GLsync',370 'versions': [{ 'name': 'glFenceSync',371 'extensions': ['GL_ARB_sync'] }],372 'arguments': 'GLenum condition, GLbitfield flags', },373{ 'return_type': 'void',374 'names': ['glFinish'],375 'arguments': 'void', },376{ 'return_type': 'void',377 'known_as': 'glFinishFenceAPPLE',378 'versions': [{ 'name': 'glFinishFenceAPPLE',379 'extensions': ['GL_APPLE_fence'] }],380 'arguments': 'GLuint fence', },381{ 'return_type': 'void',382 'names': ['glFinishFenceNV'],383 'arguments': 'GLuint fence', },384{ 'return_type': 'void',385 'names': ['glFlush'],386 'arguments': 'void', },387{ 'return_type': 'void',388 'names': ['glFlushMappedBufferRange'],389 'arguments': 'GLenum target, GLintptr offset, GLsizeiptr length', },390{ 'return_type': 'void',391 'names': ['glFramebufferRenderbufferEXT', 'glFramebufferRenderbuffer'],392 'arguments':393 'GLenum target, GLenum attachment, GLenum renderbuffertarget, '394 'GLuint renderbuffer', },395{ 'return_type': 'void',396 'names': ['glFramebufferTexture2DEXT', 'glFramebufferTexture2D'],397 'arguments':398 'GLenum target, GLenum attachment, GLenum textarget, GLuint texture, '399 'GLint level', },400{ 'return_type': 'void',401 'names': ['glFramebufferTexture2DMultisampleEXT'],402 'arguments':403 'GLenum target, GLenum attachment, GLenum textarget, GLuint texture, '404 'GLint level, GLsizei samples', },405{ 'return_type': 'void',406 'names': ['glFramebufferTexture2DMultisampleIMG'],407 'arguments':408 'GLenum target, GLenum attachment, GLenum textarget, GLuint texture, '409 'GLint level, GLsizei samples', },410{ 'return_type': 'void',411 'versions': [{ 'name': 'glFramebufferTextureLayer' }],412 'arguments': 'GLenum target, GLenum attachment, GLuint texture, GLint level, '413 'GLint layer', },414{ 'return_type': 'void',415 'names': ['glFrontFace'],416 'arguments': 'GLenum mode', },417{ 'return_type': 'void',418 'names': ['glGenBuffers'],419 'known_as': 'glGenBuffersARB',420 'arguments': 'GLsizei n, GLuint* buffers', },421{ 'return_type': 'void',422 'names': ['glGenerateMipmapEXT', 'glGenerateMipmap'],423 'arguments': 'GLenum target', },424{ 'return_type': 'void',425 'known_as': 'glGenFencesAPPLE',426 'versions': [{ 'name': 'glGenFencesAPPLE',427 'extensions': ['GL_APPLE_fence'] }],428 'arguments': 'GLsizei n, GLuint* fences', },429{ 'return_type': 'void',430 'names': ['glGenFencesNV'],431 'arguments': 'GLsizei n, GLuint* fences', },432{ 'return_type': 'void',433 'names': ['glGenFramebuffersEXT', 'glGenFramebuffers'],434 'arguments': 'GLsizei n, GLuint* framebuffers', },435{ 'return_type': 'void',436 'versions': [{ 'name': 'glGenQueries' },437 { 'name': 'glGenQueriesARB', },438 { 'name' : 'glGenQueriesEXT',439 'extensions': ['GL_EXT_occlusion_query_boolean'] }],440 'arguments': 'GLsizei n, GLuint* ids', },441{ 'return_type': 'void',442 'names': ['glGenRenderbuffersEXT', 'glGenRenderbuffers'],443 'arguments': 'GLsizei n, GLuint* renderbuffers', },444{ 'return_type': 'void',445 'versions': [{ 'name': 'glGenSamplers' }],446 'arguments': 'GLsizei n, GLuint* samplers', },447{ 'return_type': 'void',448 'names': ['glGenTextures'],449 'arguments': 'GLsizei n, GLuint* textures', },450{ 'return_type': 'void',451 'versions': [{ 'name': 'glGenTransformFeedbacks' }],452 'arguments': 'GLsizei n, GLuint* ids', },453{ 'return_type': 'void',454 'known_as': 'glGenVertexArraysOES',455 'versions': [{ 'name': 'glGenVertexArrays',456 'extensions': ['GL_ARB_vertex_array_object'], },457 { 'name': 'glGenVertexArraysOES' },458 { 'name': 'glGenVertexArraysAPPLE',459 'extensions': ['GL_APPLE_vertex_array_object'] }],460 'arguments': 'GLsizei n, GLuint* arrays', },461{ 'return_type': 'void',462 'names': ['glGetActiveAttrib'],463 'arguments':464 'GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, '465 'GLint* size, GLenum* type, char* name', },466{ 'return_type': 'void',467 'names': ['glGetActiveUniform'],468 'arguments':469 'GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, '470 'GLint* size, GLenum* type, char* name', },471{ 'return_type': 'void',472 'versions': [{ 'name': 'glGetActiveUniformBlockiv' }],473 'arguments': 'GLuint program, GLuint uniformBlockIndex, GLenum pname, '474 'GLint* params', },475{ 'return_type': 'void',476 'versions': [{ 'name': 'glGetActiveUniformBlockName' }],477 'arguments': 'GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, '478 'GLsizei* length, char* uniformBlockName', },479{ 'return_type': 'void',480 'versions': [{ 'name': 'glGetActiveUniformsiv' }],481 'arguments': 'GLuint program, GLsizei uniformCount, '482 'const GLuint* uniformIndices, GLenum pname, GLint* params', },483{ 'return_type': 'void',484 'names': ['glGetAttachedShaders'],485 'arguments':486 'GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders', },487{ 'return_type': 'GLint',488 'names': ['glGetAttribLocation'],489 'arguments': 'GLuint program, const char* name', },490{ 'return_type': 'void',491 'names': ['glGetBooleanv'],492 'arguments': 'GLenum pname, GLboolean* params', },493{ 'return_type': 'void',494 'names': ['glGetBufferParameteriv'],495 'arguments': 'GLenum target, GLenum pname, GLint* params', },496{ 'return_type': 'GLenum',497 'names': ['glGetError'],498 'arguments': 'void',499 'logging_code': """500 GL_SERVICE_LOG("GL_RESULT: " << GLEnums::GetStringError(result));501""", },502{ 'return_type': 'void',503 'names': ['glGetFenceivNV'],504 'arguments': 'GLuint fence, GLenum pname, GLint* params', },505{ 'return_type': 'void',506 'names': ['glGetFloatv'],507 'arguments': 'GLenum pname, GLfloat* params', },508{ 'return_type': 'GLint',509 'versions': [{ 'name': 'glGetFragDataLocation' }],510 'arguments': 'GLuint program, const char* name', },511{ 'return_type': 'void',512 'names': ['glGetFramebufferAttachmentParameterivEXT',513 'glGetFramebufferAttachmentParameteriv'],514 'arguments': 'GLenum target, '515 'GLenum attachment, GLenum pname, GLint* params', },516{ 'return_type': 'GLenum',517 'names': ['glGetGraphicsResetStatusARB',518 'glGetGraphicsResetStatusKHR',519 'glGetGraphicsResetStatusEXT',520 'glGetGraphicsResetStatus'],521 'arguments': 'void', },522{ 'return_type': 'void',523 'versions': [{ 'name': 'glGetInteger64i_v' }],524 'arguments': 'GLenum target, GLuint index, GLint64* data', },525{ 'return_type': 'void',526 'names': ['glGetInteger64v'],527 'arguments': 'GLenum pname, GLint64* params', },528{ 'return_type': 'void',529 'versions': [{ 'name': 'glGetIntegeri_v' }],530 'arguments': 'GLenum target, GLuint index, GLint* data', },531{ 'return_type': 'void',532 'names': ['glGetIntegerv'],533 'arguments': 'GLenum pname, GLint* params', },534{ 'return_type': 'void',535 'versions': [{ 'name': 'glGetInternalformativ' }],536 'arguments': 'GLenum target, GLenum internalformat, GLenum pname, '537 'GLsizei bufSize, GLint* params', },538{ 'return_type': 'void',539 'known_as': 'glGetProgramBinary',540 'versions': [{ 'name': 'glGetProgramBinaryOES' },541 { 'name': 'glGetProgramBinary',542 'extensions': ['GL_ARB_get_program_binary'] }],543 'arguments': 'GLuint program, GLsizei bufSize, GLsizei* length, '544 'GLenum* binaryFormat, GLvoid* binary' },545{ 'return_type': 'void',546 'names': ['glGetProgramInfoLog'],547 'arguments':548 'GLuint program, GLsizei bufsize, GLsizei* length, char* infolog', },549{ 'return_type': 'void',550 'names': ['glGetProgramiv'],551 'arguments': 'GLuint program, GLenum pname, GLint* params', },552{ 'return_type': 'GLint',553 'names': ['glGetProgramResourceLocation'],554 'arguments': 'GLuint program, GLenum programInterface, const char* name', },555{ 'return_type': 'void',556 'versions': [{ 'name': 'glGetQueryiv' },557 { 'name': 'glGetQueryivARB' },558 { 'name': 'glGetQueryivEXT',559 'extensions': ['GL_EXT_occlusion_query_boolean'] }],560 'arguments': 'GLenum target, GLenum pname, GLint* params', },561{ 'return_type': 'void',562 'versions': [{ 'name': 'glGetQueryObjecti64v',563 'extensions': ['GL_ARB_timer_query'] },564 { 'name': 'glGetQueryObjecti64vEXT' }],565 'arguments': 'GLuint id, GLenum pname, GLint64* params', },566{ 'return_type': 'void',567 'versions': [{ 'name': 'glGetQueryObjectiv' },568 { 'name': 'glGetQueryObjectivARB' },569 { 'name': 'glGetQueryObjectivEXT' }],570 'arguments': 'GLuint id, GLenum pname, GLint* params', },571{ 'return_type': 'void',572 'versions': [{ 'name': 'glGetQueryObjectui64v',573 'extensions': ['GL_ARB_timer_query'] },574 { 'name': 'glGetQueryObjectui64vEXT' }],575 'arguments': 'GLuint id, GLenum pname, GLuint64* params', },576{ 'return_type': 'void',577 'versions': [{ 'name': 'glGetQueryObjectuiv' },578 { 'name': 'glGetQueryObjectuivARB' },579 { 'name': 'glGetQueryObjectuivEXT',580 'extensions': ['GL_EXT_occlusion_query_boolean'] }],581 'arguments': 'GLuint id, GLenum pname, GLuint* params', },582{ 'return_type': 'void',583 'names': ['glGetRenderbufferParameterivEXT', 'glGetRenderbufferParameteriv'],584 'arguments': 'GLenum target, GLenum pname, GLint* params', },585{ 'return_type': 'void',586 'versions': [{ 'name': 'glGetSamplerParameterfv' }],587 'arguments': 'GLuint sampler, GLenum pname, GLfloat* params', },588{ 'return_type': 'void',589 'versions': [{ 'name': 'glGetSamplerParameteriv' }],590 'arguments': 'GLuint sampler, GLenum pname, GLint* params', },591{ 'return_type': 'void',592 'names': ['glGetShaderInfoLog'],593 'arguments':594 'GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog', },595{ 'return_type': 'void',596 'names': ['glGetShaderiv'],597 'arguments': 'GLuint shader, GLenum pname, GLint* params', },598{ 'return_type': 'void',599 'names': ['glGetShaderPrecisionFormat'],600 'arguments': 'GLenum shadertype, GLenum precisiontype, '601 'GLint* range, GLint* precision', },602{ 'return_type': 'void',603 'names': ['glGetShaderSource'],604 'arguments':605 'GLuint shader, GLsizei bufsize, GLsizei* length, char* source', },606{ 'return_type': 'const GLubyte*',607 'names': ['glGetString'],608 'arguments': 'GLenum name', },609{ 'return_type': 'const GLubyte*',610 # This is needed for bootstrapping on the desktop GL core profile.611 # It won't be called unless the expected GL version is used.612 'versions': [{ 'name': 'glGetStringi',613 'extensions': ['GL_CHROMIUM_glgetstringi_hack'] }],614 'arguments': 'GLenum name, GLuint index', },615{ 'return_type': 'void',616 'versions': [{ 'name': 'glGetSynciv',617 'extensions': ['GL_ARB_sync'] }],618 'arguments':619 'GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length,'620 'GLint* values', },621{ 'return_type': 'void',622 'names': ['glGetTexLevelParameterfv'],623 'arguments': 'GLenum target, GLint level, GLenum pname, GLfloat* params', },624{ 'return_type': 'void',625 'names': ['glGetTexLevelParameteriv'],626 'arguments': 'GLenum target, GLint level, GLenum pname, GLint* params', },627{ 'return_type': 'void',628 'names': ['glGetTexParameterfv'],629 'arguments': 'GLenum target, GLenum pname, GLfloat* params', },630{ 'return_type': 'void',631 'names': ['glGetTexParameteriv'],632 'arguments': 'GLenum target, GLenum pname, GLint* params', },633{ 'return_type': 'void',634 'versions': [{ 'name': 'glGetTransformFeedbackVarying' }],635 'arguments': 'GLuint program, GLuint index, GLsizei bufSize, '636 'GLsizei* length, GLsizei* size, GLenum* type, char* name', },637{ 'return_type': 'void',638 'names': ['glGetTranslatedShaderSourceANGLE'],639 'arguments':640 'GLuint shader, GLsizei bufsize, GLsizei* length, char* source', },641{ 'return_type': 'GLuint',642 'versions': [{ 'name': 'glGetUniformBlockIndex' }],643 'arguments': 'GLuint program, const char* uniformBlockName', },644{ 'return_type': 'void',645 'names': ['glGetUniformfv'],646 'arguments': 'GLuint program, GLint location, GLfloat* params', },647{ 'return_type': 'void',648 'versions': [{ 'name': 'glGetUniformIndices' }],649 'arguments': 'GLuint program, GLsizei uniformCount, '650 'const char* const* uniformNames, GLuint* uniformIndices', },651{ 'return_type': 'void',652 'names': ['glGetUniformiv'],653 'arguments': 'GLuint program, GLint location, GLint* params', },654{ 'return_type': 'GLint',655 'names': ['glGetUniformLocation'],656 'arguments': 'GLuint program, const char* name', },657{ 'return_type': 'void',658 'names': ['glGetUniformuiv'],659 'arguments': 'GLuint program, GLint location, GLuint* params', },660{ 'return_type': 'void',661 'names': ['glGetVertexAttribfv'],662 'arguments': 'GLuint index, GLenum pname, GLfloat* params', },663{ 'return_type': 'void',664 'names': ['glGetVertexAttribiv'],665 'arguments': 'GLuint index, GLenum pname, GLint* params', },666{ 'return_type': 'void',667 'names': ['glGetVertexAttribPointerv'],668 'arguments': 'GLuint index, GLenum pname, void** pointer', },669{ 'return_type': 'void',670 'names': ['glHint'],671 'arguments': 'GLenum target, GLenum mode', },672{ 'return_type': 'void',673 'names': ['glInsertEventMarkerEXT'],674 'arguments': 'GLsizei length, const char* marker', },675{ 'return_type': 'void',676 'versions': [{ 'name': 'glInvalidateFramebuffer' }],677 'arguments': 'GLenum target, GLsizei numAttachments, '678 'const GLenum* attachments' },679{ 'return_type': 'void',680 'versions': [{ 'name': 'glInvalidateSubFramebuffer' }],681 'arguments':682 'GLenum target, GLsizei numAttachments, const GLenum* attachments, '683 'GLint x, GLint y, GLint width, GLint height', },684{ 'return_type': 'GLboolean',685 'names': ['glIsBuffer'],686 'arguments': 'GLuint buffer', },687{ 'return_type': 'GLboolean',688 'names': ['glIsEnabled'],689 'arguments': 'GLenum cap', },690{ 'return_type': 'GLboolean',691 'known_as': 'glIsFenceAPPLE',692 'versions': [{ 'name': 'glIsFenceAPPLE',693 'extensions': ['GL_APPLE_fence'] }],694 'arguments': 'GLuint fence', },695{ 'return_type': 'GLboolean',696 'names': ['glIsFenceNV'],697 'arguments': 'GLuint fence', },698{ 'return_type': 'GLboolean',699 'names': ['glIsFramebufferEXT', 'glIsFramebuffer'],700 'arguments': 'GLuint framebuffer', },701{ 'return_type': 'GLboolean',702 'names': ['glIsProgram'],703 'arguments': 'GLuint program', },704{ 'return_type': 'GLboolean',705 'versions': [{ 'name': 'glIsQuery' },706 { 'name': 'glIsQueryARB' },707 { 'name': 'glIsQueryEXT',708 'extensions': ['GL_EXT_occlusion_query_boolean'] }],709 'arguments': 'GLuint query', },710{ 'return_type': 'GLboolean',711 'names': ['glIsRenderbufferEXT', 'glIsRenderbuffer'],712 'arguments': 'GLuint renderbuffer', },713{ 'return_type': 'GLboolean',714 'versions': [{ 'name': 'glIsSampler' }],715 'arguments': 'GLuint sampler', },716{ 'return_type': 'GLboolean',717 'names': ['glIsShader'],718 'arguments': 'GLuint shader', },719{ 'return_type': 'GLboolean',720 'versions': [{ 'name': 'glIsSync',721 'extensions': ['GL_ARB_sync'] }],722 'arguments': 'GLsync sync', },723{ 'return_type': 'GLboolean',724 'names': ['glIsTexture'],725 'arguments': 'GLuint texture', },726{ 'return_type': 'GLboolean',727 'versions': [{ 'name': 'glIsTransformFeedback' }],728 'arguments': 'GLuint id', },729{ 'return_type': 'GLboolean',730 'known_as': 'glIsVertexArrayOES',731 'versions': [{ 'name': 'glIsVertexArray',732 'extensions': ['GL_ARB_vertex_array_object'], },733 { 'name': 'glIsVertexArrayOES' },734 { 'name': 'glIsVertexArrayAPPLE',735 'extensions': ['GL_APPLE_vertex_array_object'] }],736 'arguments': 'GLuint array' },737{ 'return_type': 'void',738 'names': ['glLineWidth'],739 'arguments': 'GLfloat width', },740{ 'return_type': 'void',741 'names': ['glLinkProgram'],742 'arguments': 'GLuint program', },743{ 'return_type': 'void*',744 'known_as': 'glMapBuffer',745 'names': ['glMapBufferOES', 'glMapBuffer'],746 'arguments': 'GLenum target, GLenum access', },747{ 'return_type': 'void*',748 'known_as': 'glMapBufferRange',749 'versions': [{ 'name': 'glMapBufferRange',750 'extensions': ['GL_ARB_map_buffer_range'] },751 { 'name': 'glMapBufferRangeEXT',752 'extensions': ['GL_EXT_map_buffer_range'] }],753 'arguments':754 'GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access', },755{ 'return_type': 'void',756 'known_as': 'glMatrixLoadfEXT',757 'versions': [{ 'name': 'glMatrixLoadfEXT',758 'extensions': ['GL_EXT_direct_state_access',759 'GL_NV_path_rendering'] }],760 'arguments': 'GLenum matrixMode, const GLfloat* m' },761{ 'return_type': 'void',762 'known_as': 'glMatrixLoadIdentityEXT',763 'versions': [{ 'name': 'glMatrixLoadIdentityEXT',764 'extensions': ['GL_EXT_direct_state_access',765 'GL_NV_path_rendering'] },],766 'arguments': 'GLenum matrixMode' },767{ 'return_type': 'void',768 'versions': [{ 'name': 'glPauseTransformFeedback' }],769 'arguments': 'void', },770{ 'return_type': 'void',771 'names': ['glPixelStorei'],772 'arguments': 'GLenum pname, GLint param', },773{ 'return_type': 'void',774 'names': ['glPointParameteri'],775 'arguments': 'GLenum pname, GLint param', },776{ 'return_type': 'void',777 'names': ['glPolygonOffset'],778 'arguments': 'GLfloat factor, GLfloat units', },779{ 'return_type': 'void',780 'names': ['glPopGroupMarkerEXT'],781 'arguments': 'void', },782{ 'return_type': 'void',783 'known_as': 'glProgramBinary',784 'versions': [{ 'name': 'glProgramBinaryOES' },785 { 'name': 'glProgramBinary',786 'extensions': ['GL_ARB_get_program_binary'] }],787 'arguments': 'GLuint program, GLenum binaryFormat, '788 'const GLvoid* binary, GLsizei length' },789{ 'return_type': 'void',790 'versions': [{ 'name': 'glProgramParameteri',791 'extensions': ['GL_ARB_get_program_binary'] }],792 'arguments': 'GLuint program, GLenum pname, GLint value' },793{ 'return_type': 'void',794 'names': ['glPushGroupMarkerEXT'],795 'arguments': 'GLsizei length, const char* marker', },796{ 'return_type': 'void',797 'versions': [{ 'name': 'glQueryCounter',798 'extensions': ['GL_ARB_timer_query'] },799 { 'name': 'glQueryCounterEXT' }],800 'arguments': 'GLuint id, GLenum target', },801{ 'return_type': 'void',802 'names': ['glReadBuffer'],803 'arguments': 'GLenum src', },804{ 'return_type': 'void',805 'names': ['glReadPixels'],806 'arguments':807 'GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, '808 'GLenum type, void* pixels', },809{ 'return_type': 'void',810 'names': ['glReleaseShaderCompiler'],811 'arguments': 'void', },812{ 'return_type': 'void',813 'names': ['glRenderbufferStorageEXT', 'glRenderbufferStorage'],814 'arguments':815 'GLenum target, GLenum internalformat, GLsizei width, GLsizei height', },816{ 'return_type': 'void',817 'names': ['glRenderbufferStorageMultisample'],818 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '819 'GLsizei width, GLsizei height', },820{ 'return_type': 'void',821 'names': ['glRenderbufferStorageMultisampleANGLE'],822 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '823 'GLsizei width, GLsizei height', },824{ 'return_type': 'void',825 'names': ['glRenderbufferStorageMultisampleEXT'],826 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '827 'GLsizei width, GLsizei height', },828{ 'return_type': 'void',829 'names': ['glRenderbufferStorageMultisampleIMG'],830 'arguments': 'GLenum target, GLsizei samples, GLenum internalformat, '831 'GLsizei width, GLsizei height', },832{ 'return_type': 'void',833 'versions': [{ 'name': 'glResumeTransformFeedback' }],834 'arguments': 'void', },835{ 'return_type': 'void',836 'names': ['glSampleCoverage'],837 'arguments': 'GLclampf value, GLboolean invert', },838{ 'return_type': 'void',839 'versions': [{ 'name': 'glSamplerParameterf' }],840 'arguments': 'GLuint sampler, GLenum pname, GLfloat param', },841{ 'return_type': 'void',842 'versions': [{ 'name': 'glSamplerParameterfv' }],843 'arguments': 'GLuint sampler, GLenum pname, const GLfloat* params', },844{ 'return_type': 'void',845 'versions': [{ 'name': 'glSamplerParameteri' }],846 'arguments': 'GLuint sampler, GLenum pname, GLint param', },847{ 'return_type': 'void',848 'versions': [{ 'name': 'glSamplerParameteriv' }],849 'arguments': 'GLuint sampler, GLenum pname, const GLint* params', },850{ 'return_type': 'void',851 'names': ['glScissor'],852 'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', },853{ 'return_type': 'void',854 'known_as': 'glSetFenceAPPLE',855 'versions': [{ 'name': 'glSetFenceAPPLE',856 'extensions': ['GL_APPLE_fence'] }],857 'arguments': 'GLuint fence', },858{ 'return_type': 'void',859 'names': ['glSetFenceNV'],860 'arguments': 'GLuint fence, GLenum condition', },861{ 'return_type': 'void',862 'names': ['glShaderBinary'],863 'arguments': 'GLsizei n, const GLuint* shaders, GLenum binaryformat, '864 'const void* binary, GLsizei length', },865{ 'return_type': 'void',866 'names': ['glShaderSource'],867 'arguments': 'GLuint shader, GLsizei count, const char* const* str, '868 'const GLint* length',869 'logging_code': """870 GL_SERVICE_LOG_CODE_BLOCK({871 for (GLsizei ii = 0; ii < count; ++ii) {872 if (str[ii]) {873 if (length && length[ii] >= 0) {874 std::string source(str[ii], length[ii]);875 GL_SERVICE_LOG(" " << ii << ": ---\\n" << source << "\\n---");876 } else {877 GL_SERVICE_LOG(" " << ii << ": ---\\n" << str[ii] << "\\n---");878 }879 } else {880 GL_SERVICE_LOG(" " << ii << ": NULL");881 }882 }883 });884""", },885{ 'return_type': 'void',886 'names': ['glStencilFunc'],887 'arguments': 'GLenum func, GLint ref, GLuint mask', },888{ 'return_type': 'void',889 'names': ['glStencilFuncSeparate'],890 'arguments': 'GLenum face, GLenum func, GLint ref, GLuint mask', },891{ 'return_type': 'void',892 'names': ['glStencilMask'],893 'arguments': 'GLuint mask', },894{ 'return_type': 'void',895 'names': ['glStencilMaskSeparate'],896 'arguments': 'GLenum face, GLuint mask', },897{ 'return_type': 'void',898 'names': ['glStencilOp'],899 'arguments': 'GLenum fail, GLenum zfail, GLenum zpass', },900{ 'return_type': 'void',901 'names': ['glStencilOpSeparate'],902 'arguments': 'GLenum face, GLenum fail, GLenum zfail, GLenum zpass', },903{ 'return_type': 'GLboolean',904 'known_as': 'glTestFenceAPPLE',905 'versions': [{ 'name': 'glTestFenceAPPLE',906 'extensions': ['GL_APPLE_fence'] }],907 'arguments': 'GLuint fence', },908{ 'return_type': 'GLboolean',909 'names': ['glTestFenceNV'],910 'arguments': 'GLuint fence', },911{ 'return_type': 'void',912 'names': ['glTexImage2D'],913 'arguments':914 'GLenum target, GLint level, GLint internalformat, GLsizei width, '915 'GLsizei height, GLint border, GLenum format, GLenum type, '916 'const void* pixels', },917{ 'return_type': 'void',918 'versions': [{ 'name': 'glTexImage3D' }],919 'arguments':920 'GLenum target, GLint level, GLint internalformat, GLsizei width, '921 'GLsizei height, GLsizei depth, GLint border, GLenum format, '922 'GLenum type, const void* pixels', },923{ 'return_type': 'void',924 'names': ['glTexParameterf'],925 'arguments': 'GLenum target, GLenum pname, GLfloat param', },926{ 'return_type': 'void',927 'names': ['glTexParameterfv'],928 'arguments': 'GLenum target, GLenum pname, const GLfloat* params', },929{ 'return_type': 'void',930 'names': ['glTexParameteri'],931 'arguments': 'GLenum target, GLenum pname, GLint param', },932{ 'return_type': 'void',933 'names': ['glTexParameteriv'],934 'arguments': 'GLenum target, GLenum pname, const GLint* params', },935{ 'return_type': 'void',936 'known_as': 'glTexStorage2DEXT',937 'versions': [{ 'name': 'glTexStorage2D',938 'extensions': ['GL_ARB_texture_storage'] },939 { 'name': 'glTexStorage2DEXT',940 'extensions': ['GL_EXT_texture_storage'] }],941 'arguments': 'GLenum target, GLsizei levels, GLenum internalformat, '942 'GLsizei width, GLsizei height', },943{ 'return_type': 'void',944 'versions': [{ 'name': 'glTexStorage3D' }],945 'arguments': 'GLenum target, GLsizei levels, GLenum internalformat, '946 'GLsizei width, GLsizei height, GLsizei depth', },947{ 'return_type': 'void',948 'names': ['glTexSubImage2D'],949 'arguments':950 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '951 'GLsizei width, GLsizei height, GLenum format, GLenum type, '952 'const void* pixels', },953{ 'return_type': 'void',954 'versions': [{ 'name': 'glTexSubImage3D' }],955 'arguments':956 'GLenum target, GLint level, GLint xoffset, GLint yoffset, '957 'GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, '958 'GLenum format, GLenum type, const void* pixels', },959{ 'return_type': 'void',960 'versions': [{ 'name': 'glTransformFeedbackVaryings' }],961 'arguments': 'GLuint program, GLsizei count, const char* const* varyings, '962 'GLenum bufferMode', },963{ 'return_type': 'void',964 'names': ['glUniform1f'],965 'arguments': 'GLint location, GLfloat x', },966{ 'return_type': 'void',967 'names': ['glUniform1fv'],968 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },969{ 'return_type': 'void',970 'names': ['glUniform1i'],971 'arguments': 'GLint location, GLint x', },972{ 'return_type': 'void',973 'names': ['glUniform1iv'],974 'arguments': 'GLint location, GLsizei count, const GLint* v', },975{ 'return_type': 'void',976 'versions': [{ 'name': 'glUniform1ui' }],977 'arguments': 'GLint location, GLuint v0', },978{ 'return_type': 'void',979 'versions': [{ 'name': 'glUniform1uiv' }],980 'arguments': 'GLint location, GLsizei count, const GLuint* v', },981{ 'return_type': 'void',982 'names': ['glUniform2f'],983 'arguments': 'GLint location, GLfloat x, GLfloat y', },984{ 'return_type': 'void',985 'names': ['glUniform2fv'],986 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },987{ 'return_type': 'void',988 'names': ['glUniform2i'],989 'arguments': 'GLint location, GLint x, GLint y', },990{ 'return_type': 'void',991 'names': ['glUniform2iv'],992 'arguments': 'GLint location, GLsizei count, const GLint* v', },993{ 'return_type': 'void',994 'versions': [{ 'name': 'glUniform2ui' }],995 'arguments': 'GLint location, GLuint v0, GLuint v1', },996{ 'return_type': 'void',997 'versions': [{ 'name': 'glUniform2uiv' }],998 'arguments': 'GLint location, GLsizei count, const GLuint* v', },999{ 'return_type': 'void',1000 'names': ['glUniform3f'],1001 'arguments': 'GLint location, GLfloat x, GLfloat y, GLfloat z', },1002{ 'return_type': 'void',1003 'names': ['glUniform3fv'],1004 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },1005{ 'return_type': 'void',1006 'names': ['glUniform3i'],1007 'arguments': 'GLint location, GLint x, GLint y, GLint z', },1008{ 'return_type': 'void',1009 'names': ['glUniform3iv'],1010 'arguments': 'GLint location, GLsizei count, const GLint* v', },1011{ 'return_type': 'void',1012 'versions': [{ 'name': 'glUniform3ui' }],1013 'arguments': 'GLint location, GLuint v0, GLuint v1, GLuint v2', },1014{ 'return_type': 'void',1015 'versions': [{ 'name': 'glUniform3uiv' }],1016 'arguments': 'GLint location, GLsizei count, const GLuint* v', },1017{ 'return_type': 'void',1018 'names': ['glUniform4f'],1019 'arguments': 'GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w', },1020{ 'return_type': 'void',1021 'names': ['glUniform4fv'],1022 'arguments': 'GLint location, GLsizei count, const GLfloat* v', },1023{ 'return_type': 'void',1024 'names': ['glUniform4i'],1025 'arguments': 'GLint location, GLint x, GLint y, GLint z, GLint w', },1026{ 'return_type': 'void',1027 'names': ['glUniform4iv'],1028 'arguments': 'GLint location, GLsizei count, const GLint* v', },1029{ 'return_type': 'void',1030 'versions': [{ 'name': 'glUniform4ui' }],1031 'arguments': 'GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3', },1032{ 'return_type': 'void',1033 'versions': [{ 'name': 'glUniform4uiv' }],1034 'arguments': 'GLint location, GLsizei count, const GLuint* v', },1035{ 'return_type': 'void',1036 'versions': [{ 'name': 'glUniformBlockBinding' }],1037 'arguments': 'GLuint program, GLuint uniformBlockIndex, '1038 'GLuint uniformBlockBinding', },1039{ 'return_type': 'void',1040 'names': ['glUniformMatrix2fv'],1041 'arguments': 'GLint location, GLsizei count, '1042 'GLboolean transpose, const GLfloat* value', },1043{ 'return_type': 'void',1044 'versions': [{ 'name': 'glUniformMatrix2x3fv' }],1045 'arguments': 'GLint location, GLsizei count, '1046 'GLboolean transpose, const GLfloat* value', },1047{ 'return_type': 'void',1048 'versions': [{ 'name': 'glUniformMatrix2x4fv' }],1049 'arguments': 'GLint location, GLsizei count, '1050 'GLboolean transpose, const GLfloat* value', },1051{ 'return_type': 'void',1052 'names': ['glUniformMatrix3fv'],1053 'arguments': 'GLint location, GLsizei count, '1054 'GLboolean transpose, const GLfloat* value', },1055{ 'return_type': 'void',1056 'versions': [{ 'name': 'glUniformMatrix3x2fv' }],1057 'arguments': 'GLint location, GLsizei count, '1058 'GLboolean transpose, const GLfloat* value', },1059{ 'return_type': 'void',1060 'versions': [{ 'name': 'glUniformMatrix3x4fv' }],1061 'arguments': 'GLint location, GLsizei count, '1062 'GLboolean transpose, const GLfloat* value', },1063{ 'return_type': 'void',1064 'names': ['glUniformMatrix4fv'],1065 'arguments': 'GLint location, GLsizei count, '1066 'GLboolean transpose, const GLfloat* value', },1067{ 'return_type': 'void',1068 'versions': [{ 'name': 'glUniformMatrix4x2fv' }],1069 'arguments': 'GLint location, GLsizei count, '1070 'GLboolean transpose, const GLfloat* value', },1071{ 'return_type': 'void',1072 'versions': [{ 'name': 'glUniformMatrix4x3fv' }],1073 'arguments': 'GLint location, GLsizei count, '1074 'GLboolean transpose, const GLfloat* value', },1075{ 'return_type': 'GLboolean',1076 'known_as': 'glUnmapBuffer',1077 'names': ['glUnmapBufferOES', 'glUnmapBuffer'],1078 'arguments': 'GLenum target', },1079{ 'return_type': 'void',1080 'names': ['glUseProgram'],1081 'arguments': 'GLuint program', },1082{ 'return_type': 'void',1083 'names': ['glValidateProgram'],1084 'arguments': 'GLuint program', },1085{ 'return_type': 'void',1086 'names': ['glVertexAttrib1f'],1087 'arguments': 'GLuint indx, GLfloat x', },1088{ 'return_type': 'void',1089 'names': ['glVertexAttrib1fv'],1090 'arguments': 'GLuint indx, const GLfloat* values', },1091{ 'return_type': 'void',1092 'names': ['glVertexAttrib2f'],1093 'arguments': 'GLuint indx, GLfloat x, GLfloat y', },1094{ 'return_type': 'void',1095 'names': ['glVertexAttrib2fv'],1096 'arguments': 'GLuint indx, const GLfloat* values', },1097{ 'return_type': 'void',1098 'names': ['glVertexAttrib3f'],1099 'arguments': 'GLuint indx, GLfloat x, GLfloat y, GLfloat z', },1100{ 'return_type': 'void',1101 'names': ['glVertexAttrib3fv'],1102 'arguments': 'GLuint indx, const GLfloat* values', },1103{ 'return_type': 'void',1104 'names': ['glVertexAttrib4f'],1105 'arguments': 'GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w', },1106{ 'return_type': 'void',1107 'names': ['glVertexAttrib4fv'],1108 'arguments': 'GLuint indx, const GLfloat* values', },1109{ 'return_type': 'void',1110 'known_as': 'glVertexAttribDivisorANGLE',1111 'names': ['glVertexAttribDivisorARB', 'glVertexAttribDivisorANGLE',1112 'glVertexAttribDivisor'],1113 'arguments':1114 'GLuint index, GLuint divisor', },1115{ 'return_type': 'void',1116 'versions': [{ 'name': 'glVertexAttribI4i' }],1117 'arguments': 'GLuint indx, GLint x, GLint y, GLint z, GLint w', },1118{ 'return_type': 'void',1119 'versions': [{ 'name': 'glVertexAttribI4iv' }],1120 'arguments': 'GLuint indx, const GLint* values', },1121{ 'return_type': 'void',1122 'versions': [{ 'name': 'glVertexAttribI4ui' }],1123 'arguments': 'GLuint indx, GLuint x, GLuint y, GLuint z, GLuint w', },1124{ 'return_type': 'void',1125 'versions': [{ 'name': 'glVertexAttribI4uiv' }],1126 'arguments': 'GLuint indx, const GLuint* values', },1127{ 'return_type': 'void',1128 'versions': [{ 'name': 'glVertexAttribIPointer' }],1129 'arguments': 'GLuint indx, GLint size, GLenum type, GLsizei stride, '1130 'const void* ptr', },1131{ 'return_type': 'void',1132 'names': ['glVertexAttribPointer'],1133 'arguments': 'GLuint indx, GLint size, GLenum type, GLboolean normalized, '1134 'GLsizei stride, const void* ptr', },1135{ 'return_type': 'void',1136 'names': ['glViewport'],1137 'arguments': 'GLint x, GLint y, GLsizei width, GLsizei height', },1138{ 'return_type': 'GLenum',1139 'versions': [{ 'name': 'glWaitSync',1140 'extensions': ['GL_ARB_sync'] }],1141 'arguments':1142 'GLsync sync, GLbitfield flags, GLuint64 timeout', },1143]1144OSMESA_FUNCTIONS = [1145{ 'return_type': 'void',1146 'names': ['OSMesaColorClamp'],1147 'arguments': 'GLboolean enable', },1148{ 'return_type': 'OSMesaContext',1149 'names': ['OSMesaCreateContext'],1150 'arguments': 'GLenum format, OSMesaContext sharelist', },1151{ 'return_type': 'OSMesaContext',1152 'names': ['OSMesaCreateContextExt'],1153 'arguments':1154 'GLenum format, GLint depthBits, GLint stencilBits, GLint accumBits, '1155 'OSMesaContext sharelist', },1156{ 'return_type': 'void',1157 'names': ['OSMesaDestroyContext'],1158 'arguments': 'OSMesaContext ctx', },1159{ 'return_type': 'GLboolean',1160 'names': ['OSMesaGetColorBuffer'],1161 'arguments': 'OSMesaContext c, GLint* width, GLint* height, GLint* format, '1162 'void** buffer', },1163{ 'return_type': 'OSMesaContext',1164 'names': ['OSMesaGetCurrentContext'],1165 'arguments': 'void', },1166{ 'return_type': 'GLboolean',1167 'names': ['OSMesaGetDepthBuffer'],1168 'arguments':1169 'OSMesaContext c, GLint* width, GLint* height, GLint* bytesPerValue, '1170 'void** buffer', },1171{ 'return_type': 'void',1172 'names': ['OSMesaGetIntegerv'],1173 'arguments': 'GLint pname, GLint* value', },1174{ 'return_type': 'OSMESAproc',1175 'names': ['OSMesaGetProcAddress'],1176 'arguments': 'const char* funcName', },1177{ 'return_type': 'GLboolean',1178 'names': ['OSMesaMakeCurrent'],1179 'arguments': 'OSMesaContext ctx, void* buffer, GLenum type, GLsizei width, '1180 'GLsizei height', },1181{ 'return_type': 'void',1182 'names': ['OSMesaPixelStore'],1183 'arguments': 'GLint pname, GLint value', },1184]1185EGL_FUNCTIONS = [1186{ 'return_type': 'EGLBoolean',1187 'names': ['eglBindAPI'],1188 'arguments': 'EGLenum api', },1189{ 'return_type': 'EGLBoolean',1190 'names': ['eglBindTexImage'],1191 'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint buffer', },1192{ 'return_type': 'EGLBoolean',1193 'names': ['eglChooseConfig'],1194 'arguments': 'EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, '1195 'EGLint config_size, EGLint* num_config', },1196{ 'return_type': 'EGLint',1197 'versions': [{ 'name': 'eglClientWaitSyncKHR',1198 'extensions': [1199 'EGL_KHR_fence_sync',1200 'GL_CHROMIUM_egl_khr_fence_sync_hack'1201 ] }],1202 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, '1203 'EGLTimeKHR timeout' },1204{ 'return_type': 'EGLBoolean',1205 'names': ['eglCopyBuffers'],1206 'arguments':1207 'EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target', },1208{ 'return_type': 'EGLContext',1209 'names': ['eglCreateContext'],1210 'arguments': 'EGLDisplay dpy, EGLConfig config, EGLContext share_context, '1211 'const EGLint* attrib_list', },1212{ 'return_type': 'EGLImageKHR',1213 'versions': [{ 'name': 'eglCreateImageKHR',1214 'extensions':1215 ['EGL_KHR_image_base', 'EGL_KHR_gl_texture_2D_image'] }],1216 'arguments':1217 'EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, '1218 'const EGLint* attrib_list' },1219{ 'return_type': 'EGLSurface',1220 'names': ['eglCreatePbufferFromClientBuffer'],1221 'arguments':1222 'EGLDisplay dpy, EGLenum buftype, void* buffer, EGLConfig config, '1223 'const EGLint* attrib_list', },1224{ 'return_type': 'EGLSurface',1225 'names': ['eglCreatePbufferSurface'],1226 'arguments': 'EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list', },1227{ 'return_type': 'EGLSurface',1228 'names': ['eglCreatePixmapSurface'],1229 'arguments': 'EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, '1230 'const EGLint* attrib_list', },1231{ 'return_type': 'EGLSyncKHR',1232 'versions': [{ 'name': 'eglCreateSyncKHR',1233 'extensions': [1234 'EGL_KHR_fence_sync',1235 'GL_CHROMIUM_egl_khr_fence_sync_hack'1236 ] }],1237 'arguments': 'EGLDisplay dpy, EGLenum type, const EGLint* attrib_list' },1238{ 'return_type': 'EGLSurface',1239 'names': ['eglCreateWindowSurface'],1240 'arguments': 'EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, '1241 'const EGLint* attrib_list', },1242{ 'return_type': 'EGLBoolean',1243 'names': ['eglDestroyContext'],1244 'arguments': 'EGLDisplay dpy, EGLContext ctx', },1245{ 'return_type': 'EGLBoolean',1246 'versions': [{ 'name' : 'eglDestroyImageKHR',1247 'extensions': ['EGL_KHR_image_base'] }],1248 'arguments': 'EGLDisplay dpy, EGLImageKHR image' },1249{ 'return_type': 'EGLBoolean',1250 'names': ['eglDestroySurface'],1251 'arguments': 'EGLDisplay dpy, EGLSurface surface', },1252{ 'return_type': 'EGLBoolean',1253 'versions': [{ 'name': 'eglDestroySyncKHR',1254 'extensions': [1255 'EGL_KHR_fence_sync',1256 'GL_CHROMIUM_egl_khr_fence_sync_hack'1257 ] }],1258 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync' },1259{ 'return_type': 'EGLBoolean',1260 'names': ['eglGetConfigAttrib'],1261 'arguments':1262 'EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint* value', },1263{ 'return_type': 'EGLBoolean',1264 'names': ['eglGetConfigs'],1265 'arguments': 'EGLDisplay dpy, EGLConfig* configs, EGLint config_size, '1266 'EGLint* num_config', },1267{ 'return_type': 'EGLContext',1268 'names': ['eglGetCurrentContext'],1269 'arguments': 'void', },1270{ 'return_type': 'EGLDisplay',1271 'names': ['eglGetCurrentDisplay'],1272 'arguments': 'void', },1273{ 'return_type': 'EGLSurface',1274 'names': ['eglGetCurrentSurface'],1275 'arguments': 'EGLint readdraw', },1276{ 'return_type': 'EGLDisplay',1277 'names': ['eglGetDisplay'],1278 'arguments': 'EGLNativeDisplayType display_id', },1279{ 'return_type': 'EGLint',1280 'names': ['eglGetError'],1281 'arguments': 'void', },1282{ 'return_type': 'EGLDisplay',1283 'known_as': 'eglGetPlatformDisplayEXT',1284 'versions': [{ 'name': 'eglGetPlatformDisplayEXT',1285 'client_extensions': ['EGL_EXT_platform_base'], }],1286 'arguments': 'EGLenum platform, void* native_display, '1287 'const EGLint* attrib_list', },1288{ 'return_type': '__eglMustCastToProperFunctionPointerType',1289 'names': ['eglGetProcAddress'],1290 'arguments': 'const char* procname', },1291{ 'return_type': 'EGLBoolean',1292 'versions': [{ 'name': 'eglGetSyncAttribKHR',1293 'extensions': [1294 'EGL_KHR_fence_sync',1295 'GL_CHROMIUM_egl_khr_fence_sync_hack'1296 ] }],1297 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, '1298 'EGLint* value' },1299{ 'return_type': 'EGLBoolean',1300 'names': ['eglGetSyncValuesCHROMIUM'],1301 'arguments':1302 'EGLDisplay dpy, EGLSurface surface, '1303 'EGLuint64CHROMIUM* ust, EGLuint64CHROMIUM* msc, '1304 'EGLuint64CHROMIUM* sbc', },1305{ 'return_type': 'EGLBoolean',1306 'names': ['eglInitialize'],1307 'arguments': 'EGLDisplay dpy, EGLint* major, EGLint* minor', },1308{ 'return_type': 'EGLBoolean',1309 'names': ['eglMakeCurrent'],1310 'arguments':1311 'EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx', },1312{ 'return_type': 'EGLBoolean',1313 'names': ['eglPostSubBufferNV'],1314 'arguments': 'EGLDisplay dpy, EGLSurface surface, '1315 'EGLint x, EGLint y, EGLint width, EGLint height', },1316{ 'return_type': 'EGLenum',1317 'names': ['eglQueryAPI'],1318 'arguments': 'void', },1319{ 'return_type': 'EGLBoolean',1320 'names': ['eglQueryContext'],1321 'arguments':1322 'EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint* value', },1323{ 'return_type': 'const char*',1324 'names': ['eglQueryString'],1325 'arguments': 'EGLDisplay dpy, EGLint name', },1326{ 'return_type': 'EGLBoolean',1327 'names': ['eglQuerySurface'],1328 'arguments':1329 'EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* value', },1330{ 'return_type': 'EGLBoolean',1331 'names': ['eglQuerySurfacePointerANGLE'],1332 'arguments':1333 'EGLDisplay dpy, EGLSurface surface, EGLint attribute, void** value', },1334{ 'return_type': 'EGLBoolean',1335 'names': ['eglReleaseTexImage'],1336 'arguments': 'EGLDisplay dpy, EGLSurface surface, EGLint buffer', },1337{ 'return_type': 'EGLBoolean',1338 'names': ['eglReleaseThread'],1339 'arguments': 'void', },1340{ 'return_type': 'EGLBoolean',1341 'names': ['eglSurfaceAttrib'],1342 'arguments':1343 'EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value', },1344{ 'return_type': 'EGLBoolean',1345 'names': ['eglSwapBuffers'],1346 'arguments': 'EGLDisplay dpy, EGLSurface surface', },1347{ 'return_type': 'EGLBoolean',1348 'names': ['eglSwapInterval'],1349 'arguments': 'EGLDisplay dpy, EGLint interval', },1350{ 'return_type': 'EGLBoolean',1351 'names': ['eglTerminate'],1352 'arguments': 'EGLDisplay dpy', },1353{ 'return_type': 'EGLBoolean',1354 'names': ['eglWaitClient'],1355 'arguments': 'void', },1356{ 'return_type': 'EGLBoolean',1357 'names': ['eglWaitGL'],1358 'arguments': 'void', },1359{ 'return_type': 'EGLBoolean',1360 'names': ['eglWaitNative'],1361 'arguments': 'EGLint engine', },1362{ 'return_type': 'EGLint',1363 'versions': [{ 'name': 'eglWaitSyncKHR',1364 'extensions': ['EGL_KHR_wait_sync'] }],1365 'arguments': 'EGLDisplay dpy, EGLSyncKHR sync, EGLint flags' },1366]1367WGL_FUNCTIONS = [1368{ 'return_type': 'BOOL',1369 'names': ['wglChoosePixelFormatARB'],1370 'arguments':1371 'HDC dc, const int* int_attrib_list, const float* float_attrib_list, '1372 'UINT max_formats, int* formats, UINT* num_formats', },1373{ 'return_type': 'BOOL',1374 'names': ['wglCopyContext'],1375 'arguments': 'HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask', },1376{ 'return_type': 'HGLRC',1377 'names': ['wglCreateContext'],1378 'arguments': 'HDC hdc', },1379{ 'return_type': 'HGLRC',1380 'names': ['wglCreateLayerContext'],1381 'arguments': 'HDC hdc, int iLayerPlane', },1382{ 'return_type': 'HPBUFFERARB',1383 'names': ['wglCreatePbufferARB'],1384 'arguments': 'HDC hDC, int iPixelFormat, int iWidth, int iHeight, '1385 'const int* piAttribList', },1386{ 'return_type': 'BOOL',1387 'names': ['wglDeleteContext'],1388 'arguments': 'HGLRC hglrc', },1389{ 'return_type': 'BOOL',1390 'names': ['wglDestroyPbufferARB'],1391 'arguments': 'HPBUFFERARB hPbuffer', },1392{ 'return_type': 'HGLRC',1393 'names': ['wglGetCurrentContext'],1394 'arguments': '', },1395{ 'return_type': 'HDC',1396 'names': ['wglGetCurrentDC'],1397 'arguments': '', },1398{ 'return_type': 'const char*',1399 'names': ['wglGetExtensionsStringARB'],1400 'arguments': 'HDC hDC', },1401{ 'return_type': 'const char*',1402 'names': ['wglGetExtensionsStringEXT'],1403 'arguments': '', },1404{ 'return_type': 'HDC',1405 'names': ['wglGetPbufferDCARB'],1406 'arguments': 'HPBUFFERARB hPbuffer', },1407{ 'return_type': 'BOOL',1408 'names': ['wglMakeCurrent'],1409 'arguments': 'HDC hdc, HGLRC hglrc', },1410{ 'return_type': 'BOOL',1411 'names': ['wglQueryPbufferARB'],1412 'arguments': 'HPBUFFERARB hPbuffer, int iAttribute, int* piValue', },1413{ 'return_type': 'int',1414 'names': ['wglReleasePbufferDCARB'],1415 'arguments': 'HPBUFFERARB hPbuffer, HDC hDC', },1416{ 'return_type': 'BOOL',1417 'names': ['wglShareLists'],1418 'arguments': 'HGLRC hglrc1, HGLRC hglrc2', },1419{ 'return_type': 'BOOL',1420 'names': ['wglSwapIntervalEXT'],1421 'arguments': 'int interval', },1422{ 'return_type': 'BOOL',1423 'names': ['wglSwapLayerBuffers'],1424 'arguments': 'HDC hdc, UINT fuPlanes', },1425]1426GLX_FUNCTIONS = [1427{ 'return_type': 'void',1428 'names': ['glXBindTexImageEXT'],1429 'arguments':1430 'Display* dpy, GLXDrawable drawable, int buffer, int* attribList', },1431{ 'return_type': 'GLXFBConfig*',1432 'names': ['glXChooseFBConfig'],1433 'arguments':1434 'Display* dpy, int screen, const int* attribList, int* nitems', },1435{ 'return_type': 'XVisualInfo*',1436 'names': ['glXChooseVisual'],1437 'arguments': 'Display* dpy, int screen, int* attribList', },1438{ 'return_type': 'void',1439 'names': ['glXCopyContext'],1440 'arguments':1441 'Display* dpy, GLXContext src, GLXContext dst, unsigned long mask', },1442{ 'return_type': 'void',1443 'names': ['glXCopySubBufferMESA'],1444 'arguments': 'Display* dpy, GLXDrawable drawable, '1445 'int x, int y, int width, int height', },1446{ 'return_type': 'GLXContext',1447 'names': ['glXCreateContext'],1448 'arguments':1449 'Display* dpy, XVisualInfo* vis, GLXContext shareList, int direct', },1450{ 'return_type': 'GLXContext',1451 'names': ['glXCreateContextAttribsARB'],1452 'arguments':1453 'Display* dpy, GLXFBConfig config, GLXContext share_context, int direct, '1454 'const int* attrib_list', },1455{ 'return_type': 'GLXPixmap',1456 'names': ['glXCreateGLXPixmap'],1457 'arguments': 'Display* dpy, XVisualInfo* visual, Pixmap pixmap', },1458{ 'return_type': 'GLXContext',1459 'names': ['glXCreateNewContext'],1460 'arguments': 'Display* dpy, GLXFBConfig config, int renderType, '1461 'GLXContext shareList, int direct', },1462{ 'return_type': 'GLXPbuffer',1463 'names': ['glXCreatePbuffer'],1464 'arguments': 'Display* dpy, GLXFBConfig config, const int* attribList', },1465{ 'return_type': 'GLXPixmap',1466 'names': ['glXCreatePixmap'],1467 'arguments': 'Display* dpy, GLXFBConfig config, '1468 'Pixmap pixmap, const int* attribList', },1469{ 'return_type': 'GLXWindow',1470 'names': ['glXCreateWindow'],1471 'arguments':1472 'Display* dpy, GLXFBConfig config, Window win, const int* attribList', },1473{ 'return_type': 'void',1474 'names': ['glXDestroyContext'],1475 'arguments': 'Display* dpy, GLXContext ctx', },1476{ 'return_type': 'void',1477 'names': ['glXDestroyGLXPixmap'],1478 'arguments': 'Display* dpy, GLXPixmap pixmap', },1479{ 'return_type': 'void',1480 'names': ['glXDestroyPbuffer'],1481 'arguments': 'Display* dpy, GLXPbuffer pbuf', },1482{ 'return_type': 'void',1483 'names': ['glXDestroyPixmap'],1484 'arguments': 'Display* dpy, GLXPixmap pixmap', },1485{ 'return_type': 'void',1486 'names': ['glXDestroyWindow'],1487 'arguments': 'Display* dpy, GLXWindow window', },1488{ 'return_type': 'const char*',1489 'names': ['glXGetClientString'],1490 'arguments': 'Display* dpy, int name', },1491{ 'return_type': 'int',1492 'names': ['glXGetConfig'],1493 'arguments': 'Display* dpy, XVisualInfo* visual, int attrib, int* value', },1494{ 'return_type': 'GLXContext',1495 'names': ['glXGetCurrentContext'],1496 'arguments': 'void', },1497{ 'return_type': 'Display*',1498 'names': ['glXGetCurrentDisplay'],1499 'arguments': 'void', },1500{ 'return_type': 'GLXDrawable',1501 'names': ['glXGetCurrentDrawable'],1502 'arguments': 'void', },1503{ 'return_type': 'GLXDrawable',1504 'names': ['glXGetCurrentReadDrawable'],1505 'arguments': 'void', },1506{ 'return_type': 'int',1507 'names': ['glXGetFBConfigAttrib'],1508 'arguments': 'Display* dpy, GLXFBConfig config, int attribute, int* value', },1509{ 'return_type': 'GLXFBConfig',1510 'names': ['glXGetFBConfigFromVisualSGIX'],1511 'arguments': 'Display* dpy, XVisualInfo* visualInfo', },1512{ 'return_type': 'GLXFBConfig*',1513 'names': ['glXGetFBConfigs'],1514 'arguments': 'Display* dpy, int screen, int* nelements', },1515{ 'return_type': 'bool',1516 'names': ['glXGetMscRateOML'],1517 'arguments':1518 'Display* dpy, GLXDrawable drawable, int32* numerator, '1519 'int32* denominator' },1520{ 'return_type': 'void',1521 'names': ['glXGetSelectedEvent'],1522 'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long* mask', },1523{ 'return_type': 'bool',1524 'names': ['glXGetSyncValuesOML'],1525 'arguments':1526 'Display* dpy, GLXDrawable drawable, int64* ust, int64* msc, '1527 'int64* sbc' },1528{ 'return_type': 'XVisualInfo*',1529 'names': ['glXGetVisualFromFBConfig'],1530 'arguments': 'Display* dpy, GLXFBConfig config', },1531{ 'return_type': 'int',1532 'names': ['glXIsDirect'],1533 'arguments': 'Display* dpy, GLXContext ctx', },1534{ 'return_type': 'int',1535 'names': ['glXMakeContextCurrent'],1536 'arguments':1537 'Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx', },1538{ 'return_type': 'int',1539 'names': ['glXMakeCurrent'],1540 'arguments': 'Display* dpy, GLXDrawable drawable, GLXContext ctx', },1541{ 'return_type': 'int',1542 'names': ['glXQueryContext'],1543 'arguments': 'Display* dpy, GLXContext ctx, int attribute, int* value', },1544{ 'return_type': 'void',1545 'names': ['glXQueryDrawable'],1546 'arguments':1547 'Display* dpy, GLXDrawable draw, int attribute, unsigned int* value', },1548{ 'return_type': 'int',1549 'names': ['glXQueryExtension'],1550 'arguments': 'Display* dpy, int* errorb, int* event', },1551{ 'return_type': 'const char*',1552 'names': ['glXQueryExtensionsString'],1553 'arguments': 'Display* dpy, int screen', },1554{ 'return_type': 'const char*',1555 'names': ['glXQueryServerString'],1556 'arguments': 'Display* dpy, int screen, int name', },1557{ 'return_type': 'int',1558 'names': ['glXQueryVersion'],1559 'arguments': 'Display* dpy, int* maj, int* min', },1560{ 'return_type': 'void',1561 'names': ['glXReleaseTexImageEXT'],1562 'arguments': 'Display* dpy, GLXDrawable drawable, int buffer', },1563{ 'return_type': 'void',1564 'names': ['glXSelectEvent'],1565 'arguments': 'Display* dpy, GLXDrawable drawable, unsigned long mask', },1566{ 'return_type': 'void',1567 'names': ['glXSwapBuffers'],1568 'arguments': 'Display* dpy, GLXDrawable drawable', },1569{ 'return_type': 'void',1570 'names': ['glXSwapIntervalEXT'],1571 'arguments': 'Display* dpy, GLXDrawable drawable, int interval', },1572{ 'return_type': 'void',1573 'names': ['glXSwapIntervalMESA'],1574 'arguments': 'unsigned int interval', },1575{ 'return_type': 'void',1576 'names': ['glXUseXFont'],1577 'arguments': 'Font font, int first, int count, int list', },1578{ 'return_type': 'void',1579 'names': ['glXWaitGL'],1580 'arguments': 'void', },1581{ 'return_type': 'int',1582 'names': ['glXWaitVideoSyncSGI'],1583 'arguments': 'int divisor, int remainder, unsigned int* count', },1584{ 'return_type': 'void',1585 'names': ['glXWaitX'],1586 'arguments': 'void', },1587]1588FUNCTION_SETS = [1589 [GL_FUNCTIONS, 'gl', [1590 'GL/gl.h',1591 'noninclude/GL/glext.h',1592 'GLES2/gl2ext.h',1593 'GLES3/gl3.h',1594 'GLES3/gl31.h',1595 # Files below are Chromium-specific and shipped with Chromium sources.1596 'GL/glextchromium.h',1597 'GLES2/gl2chromium.h',1598 'GLES2/gl2extchromium.h'1599 ], []],1600 [OSMESA_FUNCTIONS, 'osmesa', [], []],1601 [EGL_FUNCTIONS, 'egl', [1602 'EGL/eglext.h',1603 # Files below are Chromium-specific and shipped with Chromium sources.1604 'EGL/eglextchromium.h',1605 ],1606 [1607 'EGL_ANGLE_d3d_share_handle_client_buffer',1608 'EGL_ANGLE_surface_d3d_texture_2d_share_handle',1609 ],1610 ],1611 [WGL_FUNCTIONS, 'wgl', ['noninclude/GL/wglext.h'], []],1612 [GLX_FUNCTIONS, 'glx', ['GL/glx.h', 'noninclude/GL/glxext.h'], []],1613]1614GLES2_HEADERS_WITH_ENUMS = [1615 'GLES2/gl2.h',1616 'GLES2/gl2ext.h',1617 'GLES2/gl2chromium.h',1618 'GLES2/gl2extchromium.h',1619 'GLES3/gl3.h',1620]1621SELF_LOCATION = os.path.dirname(os.path.abspath(__file__))1622LICENSE_AND_HEADER = """\1623// Copyright 2014 The Chromium Authors. All rights reserved.1624// Use of this source code is governed by a BSD-style license that can be1625// found in the LICENSE file.1626//1627// This file is auto-generated from1628// ui/gl/generate_bindings.py1629// It's formatted by clang-format using chromium coding style:1630// clang-format -i -style=chromium filename1631// DO NOT EDIT!1632"""1633GLVersion = namedtuple('GLVersion', 'is_es major_version minor_version')1634def GLVersionBindAlways(version):1635 return version.major_version <= 21636def GetStaticBinding(func):1637 """If this function has a name assigned to it that should be bound always,1638 then return this name.1639 This will be the case if either a function name is specified1640 that depends on an extension from UNCONDITIONALLY_BOUND_EXTENSIONS,1641 or if the GL version it depends on is assumed to be available (e.g. <=2.1).1642 There can only be one name that satisfies this condition (or the bindings1643 would be ambiguous)."""1644 static_bindings = set([])1645 for version in func['versions']:1646 if 'extensions' in version:1647 extensions = version['extensions']1648 num_unconditional_extensions = len(1649 extensions & UNCONDITIONALLY_BOUND_EXTENSIONS)1650 if num_unconditional_extensions:1651 static_bindings.add(version['name'])1652 elif 'gl_versions' in version:1653 versions = [v for v in version['gl_versions'] if GLVersionBindAlways(v)]1654 # It's only unconditional if it exists in GL and GLES1655 if len(versions) == 2:1656 assert versions[0].is_es != versions[1].is_es1657 static_bindings.add(version['name'])1658 else:1659 static_bindings.add(version['name'])1660 # Avoid ambiguous bindings (static binding with different names)1661 assert len(static_bindings) <= 11662 if len(static_bindings):1663 static_name = static_bindings.pop()1664 # Avoid ambiguous bindings (static and dynamic bindings with1665 # different names)1666 assert len([v['name'] for v in func['versions']1667 if v['name'] != static_name]) == 0, func1668 return static_name1669 else:1670 return None1671def GenerateHeader(file, functions, set_name,1672 used_extensions, used_client_extensions):1673 """Generates gl_bindings_autogen_x.h"""1674 # Write file header.1675 file.write(LICENSE_AND_HEADER +1676"""1677#ifndef UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_1678#define UI_GFX_GL_GL_BINDINGS_AUTOGEN_%(name)s_H_1679namespace gfx {1680class GLContext;1681""" % {'name': set_name.upper()})1682 # Write typedefs for function pointer types. Always use the GL name for the1683 # typedef.1684 file.write('\n')1685 for func in functions:1686 file.write('typedef %s (GL_BINDING_CALL *%sProc)(%s);\n' %1687 (func['return_type'], func['known_as'], func['arguments']))1688 # Write declarations for booleans indicating which extensions are available.1689 file.write('\n')1690 file.write("struct Extensions%s {\n" % set_name.upper())1691 for extension in sorted(used_client_extensions):1692 file.write(' bool b_%s;\n' % extension)1693 for extension in sorted(used_extensions):1694 file.write(' bool b_%s;\n' % extension)1695 file.write('};\n')1696 file.write('\n')1697 # Write Procs struct.1698 file.write("struct Procs%s {\n" % set_name.upper())1699 for func in functions:1700 file.write(' %sProc %sFn;\n' % (func['known_as'], func['known_as']))1701 file.write('};\n')1702 file.write('\n')1703 # Write Api class.1704 file.write(1705"""class GL_EXPORT %(name)sApi {1706 public:1707 %(name)sApi();1708 virtual ~%(name)sApi();1709""" % {'name': set_name.upper()})1710 for func in functions:1711 file.write(' virtual %s %sFn(%s) = 0;\n' %1712 (func['return_type'], func['known_as'], func['arguments']))1713 file.write('};\n')1714 file.write('\n')1715 file.write( '} // namespace gfx\n')1716 # Write macros to invoke function pointers. Always use the GL name for the1717 # macro.1718 file.write('\n')1719 for func in functions:1720 file.write('#define %s ::gfx::g_current_%s_context->%sFn\n' %1721 (func['known_as'], set_name.lower(), func['known_as']))1722 file.write('\n')1723 file.write('#endif // UI_GFX_GL_GL_BINDINGS_AUTOGEN_%s_H_\n' %1724 set_name.upper())1725def GenerateAPIHeader(file, functions, set_name):1726 """Generates gl_bindings_api_autogen_x.h"""1727 # Write file header.1728 file.write(LICENSE_AND_HEADER)1729 # Write API declaration.1730 for func in functions:1731 file.write(' %s %sFn(%s) override;\n' %1732 (func['return_type'], func['known_as'], func['arguments']))1733 file.write('\n')1734def GenerateMockHeader(file, functions, set_name):1735 """Generates gl_mock_autogen_x.h"""1736 # Write file header.1737 file.write(LICENSE_AND_HEADER)1738 # Write API declaration.1739 for func in functions:1740 args = func['arguments']1741 if args == 'void':1742 args = ''1743 arg_count = 01744 if len(args):1745 arg_count = func['arguments'].count(',') + 11746 # TODO(zmo): crbug.com/4563401747 # For now gmock supports at most 10 args.1748 if arg_count <= 10:1749 file.write(' MOCK_METHOD%d(%s, %s(%s));\n' %1750 (arg_count, func['known_as'][2:], func['return_type'], args))1751 else:1752 file.write(' // TODO(zmo): crbug.com/456340\n')1753 file.write(' // %s cannot be mocked because it has %d args.\n' %1754 (func['known_as'], arg_count))1755 file.write('\n')1756def GenerateSource(file, functions, set_name, used_extensions,1757 used_client_extensions, options):1758 """Generates gl_bindings_autogen_x.cc"""1759 set_header_name = "ui/gl/gl_" + set_name.lower() + "_api_implementation.h"1760 include_list = [ 'base/trace_event/trace_event.h',1761 'ui/gl/gl_enums.h',1762 'ui/gl/gl_bindings.h',1763 'ui/gl/gl_context.h',1764 'ui/gl/gl_implementation.h',1765 'ui/gl/gl_version_info.h',1766 set_header_name ]1767 includes_string = "\n".join(["#include \"{0}\"".format(h)1768 for h in sorted(include_list)])1769 # Write file header.1770 file.write(LICENSE_AND_HEADER +1771"""1772#include <string>1773%s1774namespace gfx {1775""" % includes_string)1776 file.write('\n')1777 file.write('static bool g_debugBindingsInitialized;\n')1778 file.write('Driver%s g_driver_%s;\n' % (set_name.upper(), set_name.lower()))1779 file.write('\n')1780 # Write stub functions that take the place of some functions before a context1781 # is initialized. This is done to provide clear asserts on debug build and to1782 # avoid crashing in case of a bug on release build.1783 file.write('\n')1784 num_dynamic = 01785 for func in functions:1786 static_binding = GetStaticBinding(func)1787 if static_binding:1788 func['static_binding'] = static_binding1789 else:1790 num_dynamic = num_dynamic + 11791 print "[%s] %d static bindings, %d dynamic bindings" % (1792 set_name, len(functions) - num_dynamic, num_dynamic)1793 # Write function to initialize the function pointers that are always the same1794 # and to initialize bindings where choice of the function depends on the1795 # extension string or the GL version to point to stub functions.1796 file.write('\n')1797 file.write('void Driver%s::InitializeStaticBindings() {\n' %1798 set_name.upper())1799 def WriteFuncBinding(file, known_as, version_name):1800 file.write(1801 ' fn.%sFn = reinterpret_cast<%sProc>(GetGLProcAddress("%s"));\n' %1802 (known_as, known_as, version_name))1803 for func in functions:1804 if 'static_binding' in func:1805 WriteFuncBinding(file, func['known_as'], func['static_binding'])1806 else:1807 file.write(' fn.%sFn = 0;\n' % func['known_as'])1808 def GetGLVersionCondition(gl_version):1809 if GLVersionBindAlways(gl_version):1810 if gl_version.is_es:1811 return 'ver->is_es'1812 else:1813 return '!ver->is_es'1814 elif gl_version.is_es:1815 return 'ver->IsAtLeastGLES(%du, %du)' % (1816 gl_version.major_version, gl_version.minor_version)1817 else:1818 return 'ver->IsAtLeastGL(%du, %du)' % (1819 gl_version.major_version, gl_version.minor_version)1820 def GetBindingCondition(version):1821 conditions = []1822 if 'gl_versions' in version:1823 conditions.extend(1824 [GetGLVersionCondition(v) for v in version['gl_versions']])1825 if 'extensions' in version and version['extensions']:1826 conditions.extend(1827 ['ext.b_%s' % e for e in version['extensions']])1828 return ' || '.join(conditions)1829 def WriteConditionalFuncBinding(file, func):1830 assert len(func['versions']) > 01831 known_as = func['known_as']1832 i = 01833 first_version = True1834 while i < len(func['versions']):1835 version = func['versions'][i]1836 cond = GetBindingCondition(version)1837 if first_version:1838 file.write(' if (%s) {\n ' % cond)1839 else:1840 file.write(' else if (%s) {\n ' % (cond))1841 WriteFuncBinding(file, known_as, version['name'])1842 if options.validate_bindings:1843 if not 'is_optional' in func or not func['is_optional']:1844 file.write('DCHECK(fn.%sFn);\n' % known_as)1845 file.write('}\n')1846 i += 11847 first_version = False1848 # TODO(jmadill): make more robust1849 def IsClientExtensionFunc(func):1850 assert len(func['versions']) > 01851 if 'client_extensions' in func['versions'][0]:1852 assert len(func['versions']) == 11853 return True1854 return False1855 file.write("}\n\n");1856 if set_name == 'gl':1857 file.write("""\1858void DriverGL::InitializeDynamicBindings(1859 GLContext* context) {1860 DCHECK(context && context->IsCurrent(NULL));1861 const GLVersionInfo* ver = context->GetVersionInfo();1862 ALLOW_UNUSED_LOCAL(ver);1863 std::string extensions = context->GetExtensions() + " ";1864 ALLOW_UNUSED_LOCAL(extensions);1865""")1866 elif set_name == 'egl':1867 file.write("""\1868void DriverEGL::InitializeExtensionBindings() {1869 std::string client_extensions(GetClientExtensions());1870 client_extensions += " ";1871 ALLOW_UNUSED_LOCAL(client_extensions);1872""")1873 else:1874 file.write("""\1875void Driver%s::InitializeExtensionBindings() {1876 std::string extensions(GetPlatformExtensions());1877 extensions += " ";1878 ALLOW_UNUSED_LOCAL(extensions);1879""" % (set_name.upper(),))1880 def OutputExtensionBindings(extension_var, extensions, extension_funcs):1881 # Extra space at the end of the extension name is intentional,1882 # it is used as a separator1883 for extension in extensions:1884 file.write(' ext.b_%s = %s.find("%s ") != std::string::npos;\n' %1885 (extension, extension_var, extension))1886 for func in extension_funcs:1887 if not 'static_binding' in func:1888 file.write('\n')1889 file.write(' debug_fn.%sFn = 0;\n' % func['known_as'])1890 WriteConditionalFuncBinding(file, func)1891 OutputExtensionBindings(1892 'client_extensions',1893 sorted(used_client_extensions),1894 [ f for f in functions if IsClientExtensionFunc(f) ])1895 if set_name == 'egl':1896 file.write("""\1897 std::string extensions(GetPlatformExtensions());1898 extensions += " ";1899 ALLOW_UNUSED_LOCAL(extensions);1900""")1901 OutputExtensionBindings(1902 'extensions',1903 sorted(used_extensions),1904 [ f for f in functions if not IsClientExtensionFunc(f) ])1905 # Some new function pointers have been added, so update them in debug bindings1906 file.write('\n')1907 file.write(' if (g_debugBindingsInitialized)\n')1908 file.write(' InitializeDebugBindings();\n')1909 file.write('}\n')1910 file.write('\n')1911 # Write logging wrappers for each function.1912 file.write('extern "C" {\n')1913 for func in functions:1914 return_type = func['return_type']1915 arguments = func['arguments']1916 file.write('\n')1917 file.write('static %s GL_BINDING_CALL Debug_%s(%s) {\n' %1918 (return_type, func['known_as'], arguments))1919 argument_names = re.sub(1920 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', arguments)1921 argument_names = re.sub(1922 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', argument_names)1923 log_argument_names = re.sub(1924 r'const char\* ([a-zA-Z0-9_]+)', r'CONSTCHAR_\1', arguments)1925 log_argument_names = re.sub(1926 r'(const )?[a-zA-Z0-9_]+\* ([a-zA-Z0-9_]+)',1927 r'CONSTVOID_\2', log_argument_names)1928 log_argument_names = re.sub(1929 r'(?<!E)GLenum ([a-zA-Z0-9_]+)', r'GLenum_\1', log_argument_names)1930 log_argument_names = re.sub(1931 r'(?<!E)GLboolean ([a-zA-Z0-9_]+)', r'GLboolean_\1', log_argument_names)1932 log_argument_names = re.sub(1933 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2',1934 log_argument_names)1935 log_argument_names = re.sub(1936 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2',1937 log_argument_names)1938 log_argument_names = re.sub(1939 r'CONSTVOID_([a-zA-Z0-9_]+)',1940 r'static_cast<const void*>(\1)', log_argument_names)1941 log_argument_names = re.sub(1942 r'CONSTCHAR_([a-zA-Z0-9_]+)', r'\1', log_argument_names)1943 log_argument_names = re.sub(1944 r'GLenum_([a-zA-Z0-9_]+)', r'GLEnums::GetStringEnum(\1)',1945 log_argument_names)1946 log_argument_names = re.sub(1947 r'GLboolean_([a-zA-Z0-9_]+)', r'GLEnums::GetStringBool(\1)',1948 log_argument_names)1949 log_argument_names = log_argument_names.replace(',', ' << ", " <<')1950 if argument_names == 'void' or argument_names == '':1951 argument_names = ''1952 log_argument_names = ''1953 else:1954 log_argument_names = " << " + log_argument_names1955 function_name = func['known_as']1956 if return_type == 'void':1957 file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' %1958 (function_name, log_argument_names))1959 file.write(' g_driver_%s.debug_fn.%sFn(%s);\n' %1960 (set_name.lower(), function_name, argument_names))1961 if 'logging_code' in func:1962 file.write("%s\n" % func['logging_code'])1963 if options.generate_dchecks and set_name == 'gl':1964 file.write(' {\n')1965 file.write(' GLenum error = g_driver_gl.debug_fn.glGetErrorFn();\n')1966 file.write(' DCHECK(error == 0);\n')1967 file.write(' }\n')1968 else:1969 file.write(' GL_SERVICE_LOG("%s" << "(" %s << ")");\n' %1970 (function_name, log_argument_names))1971 file.write(' %s result = g_driver_%s.debug_fn.%sFn(%s);\n' %1972 (return_type, set_name.lower(), function_name, argument_names))1973 if 'logging_code' in func:1974 file.write("%s\n" % func['logging_code'])1975 else:1976 file.write(' GL_SERVICE_LOG("GL_RESULT: " << result);\n')1977 if options.generate_dchecks and set_name == 'gl':1978 file.write(' {\n')1979 file.write(' GLenum _error = g_driver_gl.debug_fn.glGetErrorFn();\n')1980 file.write(' DCHECK(_error == 0);\n')1981 file.write(' }\n')1982 file.write(' return result;\n')1983 file.write('}\n')1984 file.write('} // extern "C"\n')1985 # Write function to initialize the debug function pointers.1986 file.write('\n')1987 file.write('void Driver%s::InitializeDebugBindings() {\n' %1988 set_name.upper())1989 for func in functions:1990 first_name = func['known_as']1991 file.write(' if (!debug_fn.%sFn) {\n' % first_name)1992 file.write(' debug_fn.%sFn = fn.%sFn;\n' % (first_name, first_name))1993 file.write(' fn.%sFn = Debug_%s;\n' % (first_name, first_name))1994 file.write(' }\n')1995 file.write(' g_debugBindingsInitialized = true;\n')1996 file.write('}\n')1997 # Write function to clear all function pointers.1998 file.write('\n')1999 file.write("""void Driver%s::ClearBindings() {2000 memset(this, 0, sizeof(*this));2001}2002""" % set_name.upper())2003 def MakeArgNames(arguments):2004 argument_names = re.sub(2005 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', arguments)2006 argument_names = re.sub(2007 r'(const )?[a-zA-Z0-9_]+\** ([a-zA-Z0-9_]+)', r'\2', argument_names)2008 if argument_names == 'void' or argument_names == '':2009 argument_names = ''2010 return argument_names2011 # Write GLApiBase functions2012 for func in functions:2013 function_name = func['known_as']2014 return_type = func['return_type']2015 arguments = func['arguments']2016 file.write('\n')2017 file.write('%s %sApiBase::%sFn(%s) {\n' %2018 (return_type, set_name.upper(), function_name, arguments))2019 argument_names = MakeArgNames(arguments)2020 if return_type == 'void':2021 file.write(' driver_->fn.%sFn(%s);\n' %2022 (function_name, argument_names))2023 else:2024 file.write(' return driver_->fn.%sFn(%s);\n' %2025 (function_name, argument_names))2026 file.write('}\n')2027 # Write TraceGLApi functions2028 for func in functions:2029 function_name = func['known_as']2030 return_type = func['return_type']2031 arguments = func['arguments']2032 file.write('\n')2033 file.write('%s Trace%sApi::%sFn(%s) {\n' %2034 (return_type, set_name.upper(), function_name, arguments))2035 argument_names = MakeArgNames(arguments)2036 file.write(' TRACE_EVENT_BINARY_EFFICIENT0("gpu", "TraceGLAPI::%s")\n' %2037 function_name)2038 if return_type == 'void':2039 file.write(' %s_api_->%sFn(%s);\n' %2040 (set_name.lower(), function_name, argument_names))2041 else:2042 file.write(' return %s_api_->%sFn(%s);\n' %2043 (set_name.lower(), function_name, argument_names))2044 file.write('}\n')2045 # Write NoContextGLApi functions2046 if set_name.upper() == "GL":2047 for func in functions:2048 function_name = func['known_as']2049 return_type = func['return_type']2050 arguments = func['arguments']2051 file.write('\n')2052 file.write('%s NoContextGLApi::%sFn(%s) {\n' %2053 (return_type, function_name, arguments))2054 argument_names = MakeArgNames(arguments)2055 no_context_error = "Trying to call %s() without current GL context" % function_name2056 file.write(' NOTREACHED() << "%s";\n' % no_context_error)2057 file.write(' LOG(ERROR) << "%s";\n' % no_context_error)2058 default_value = { 'GLenum': 'static_cast<GLenum>(0)',2059 'GLuint': '0U',2060 'GLint': '0',2061 'GLboolean': 'GL_FALSE',2062 'GLbyte': '0',2063 'GLubyte': '0',2064 'GLbutfield': '0',2065 'GLushort': '0',2066 'GLsizei': '0',2067 'GLfloat': '0.0f',2068 'GLdouble': '0.0',2069 'GLsync': 'NULL'}2070 if return_type.endswith('*'):2071 file.write(' return NULL;\n')2072 elif return_type != 'void':2073 file.write(' return %s;\n' % default_value[return_type])2074 file.write('}\n')2075 file.write('\n')2076 file.write('} // namespace gfx\n')2077def GetUniquelyNamedFunctions(functions):2078 uniquely_named_functions = {}2079 for func in functions:2080 for version in func['versions']:2081 uniquely_named_functions[version['name']] = ({2082 'name': version['name'],2083 'return_type': func['return_type'],2084 'arguments': func['arguments'],2085 'known_as': func['known_as']2086 })2087 return uniquely_named_functions2088def GenerateMockBindingsHeader(file, functions):2089 """Headers for functions that invoke MockGLInterface members"""2090 file.write(LICENSE_AND_HEADER)2091 uniquely_named_functions = GetUniquelyNamedFunctions(functions)2092 for key in sorted(uniquely_named_functions.iterkeys()):2093 func = uniquely_named_functions[key]2094 file.write('static %s GL_BINDING_CALL Mock_%s(%s);\n' %2095 (func['return_type'], func['name'], func['arguments']))2096def GenerateMockBindingsSource(file, functions):2097 """Generates functions that invoke MockGLInterface members and a2098 GetGLProcAddress function that returns addresses to those functions."""2099 file.write(LICENSE_AND_HEADER +2100"""2101#include <string.h>2102#include "ui/gl/gl_mock.h"2103namespace gfx {2104// This is called mainly to prevent the compiler combining the code of mock2105// functions with identical contents, so that their function pointers will be2106// different.2107void MakeFunctionUnique(const char *func_name) {2108 VLOG(2) << "Calling mock " << func_name;2109}2110""")2111 # Write functions that trampoline into the set MockGLInterface instance.2112 uniquely_named_functions = GetUniquelyNamedFunctions(functions)2113 sorted_function_names = sorted(uniquely_named_functions.iterkeys())2114 for key in sorted_function_names:2115 func = uniquely_named_functions[key]2116 file.write('\n')2117 file.write('%s GL_BINDING_CALL MockGLInterface::Mock_%s(%s) {\n' %2118 (func['return_type'], func['name'], func['arguments']))2119 file.write(' MakeFunctionUnique("%s");\n' % func['name'])2120 arg_re = r'(const )?[a-zA-Z0-9]+((\s*const\s*)?\*)* ([a-zA-Z0-9]+)'2121 argument_names = re.sub(arg_re, r'\4', func['arguments'])2122 if argument_names == 'void':2123 argument_names = ''2124 function_name = func['known_as'][2:]2125 if func['return_type'] == 'void':2126 file.write(' interface_->%s(%s);\n' %2127 (function_name, argument_names))2128 else:2129 file.write(' return interface_->%s(%s);\n' %2130 (function_name, argument_names))2131 file.write('}\n')2132 # Write an 'invalid' function to catch code calling through uninitialized2133 # function pointers or trying to interpret the return value of2134 # GLProcAddress().2135 file.write('\n')2136 file.write('static void MockInvalidFunction() {\n')2137 file.write(' NOTREACHED();\n')2138 file.write('}\n')2139 # Write a function to lookup a mock GL function based on its name.2140 file.write('\n')2141 file.write('void* GL_BINDING_CALL ' +2142 'MockGLInterface::GetGLProcAddress(const char* name) {\n')2143 for key in sorted_function_names:2144 name = uniquely_named_functions[key]['name']2145 file.write(' if (strcmp(name, "%s") == 0)\n' % name)2146 file.write(' return reinterpret_cast<void*>(Mock_%s);\n' % name)2147 # Always return a non-NULL pointer like some EGL implementations do.2148 file.write(' return reinterpret_cast<void*>(&MockInvalidFunction);\n')2149 file.write('}\n')2150 file.write('\n')2151 file.write('} // namespace gfx\n')2152def GenerateEnumUtils(out_file, input_filenames):2153 enum_re = re.compile(r'\#define\s+(GL_[a-zA-Z0-9_]+)\s+([0-9A-Fa-fx]+)')2154 dict = {}2155 for fname in input_filenames:2156 lines = open(fname).readlines()2157 for line in lines:2158 m = enum_re.match(line)2159 if m:2160 name = m.group(1)2161 value = m.group(2)2162 if len(value) <= 10:2163 if not value in dict:2164 dict[value] = name2165 # check our own _CHROMIUM macro conflicts with khronos GL headers.2166 elif dict[value] != name and (name.endswith('_CHROMIUM') or2167 dict[value].endswith('_CHROMIUM')):2168 raise RunTimeError("code collision: %s and %s have the same code %s"2169 % (dict[value], name, value))2170 out_file.write(LICENSE_AND_HEADER)2171 out_file.write("static const GLEnums::EnumToString "2172 "enum_to_string_table[] = {\n")2173 for value in dict:2174 out_file.write(' { %s, "%s", },\n' % (value, dict[value]))2175 out_file.write("""};2176const GLEnums::EnumToString* const GLEnums::enum_to_string_table_ =2177 enum_to_string_table;2178const size_t GLEnums::enum_to_string_table_len_ =2179 sizeof(enum_to_string_table) / sizeof(enum_to_string_table[0]);2180""")2181def ParseFunctionsFromHeader(header_file, extensions, versions):2182 """Parse a C extension header file and return a map from extension names to2183 a list of functions.2184 Args:2185 header_file: Line-iterable C header file.2186 Returns:2187 Map of extension name => functions, Map of gl version => functions.2188 Functions will only be in either one of the two maps.2189 """2190 version_start = re.compile(2191 r'#ifndef GL_(ES_|)VERSION((?:_[0-9])+)$')2192 extension_start = re.compile(2193 r'#ifndef ((?:GL|EGL|WGL|GLX)_[A-Z]+_[a-zA-Z]\w+)')2194 extension_function = re.compile(r'.+\s+([a-z]+\w+)\s*\(')2195 typedef = re.compile(r'typedef .*')2196 macro_start = re.compile(r'^#(if|ifdef|ifndef).*')2197 macro_end = re.compile(r'^#endif.*')2198 macro_depth = 02199 current_version = None2200 current_version_depth = 02201 current_extension = None2202 current_extension_depth = 02203 # Pick up all core functions here, since some of them are missing in the2204 # Khronos headers.2205 hdr = os.path.basename(header_file.name)2206 if hdr == "gl.h":2207 current_version = GLVersion(False, 1, 0)2208 line_num = 12209 for line in header_file:2210 version_match = version_start.match(line)2211 if macro_start.match(line):2212 macro_depth += 12213 if version_match:2214 if current_version:2215 raise RuntimeError('Nested GL version macro in %s at line %d' % (2216 header_file.name, line_num))2217 current_version_depth = macro_depth2218 es = version_match.group(1)2219 major_version, minor_version =\2220 version_match.group(2).lstrip('_').split('_')2221 is_es = len(es) > 02222 if (not is_es) and (major_version == '1'):2223 minor_version = 02224 current_version = GLVersion(2225 is_es, int(major_version), int(minor_version))2226 elif macro_end.match(line):2227 macro_depth -= 12228 if macro_depth < current_extension_depth:2229 current_extension = None2230 if macro_depth < current_version_depth:2231 current_version = None2232 match = extension_start.match(line)2233 if match and not version_match:2234 if current_version and hdr != "gl.h":2235 raise RuntimeError('Nested GL version macro in %s at line %d' % (2236 header_file.name, line_num))2237 current_extension = match.group(1)2238 current_extension_depth = macro_depth2239 match = extension_function.match(line)2240 if match and not typedef.match(line):2241 if current_extension:2242 extensions[current_extension].add(match.group(1))2243 elif current_version:2244 versions[current_version].add(match.group(1))2245 line_num = line_num + 12246def GetDynamicFunctions(extension_headers):2247 """Parse all optional functions from a list of header files.2248 Args:2249 extension_headers: List of header file names.2250 Returns:2251 Map of extension name => list of functions,2252 Map of gl version => list of functions.2253 """2254 extensions = collections.defaultdict(lambda: set([]))2255 gl_versions = collections.defaultdict(lambda: set([]))2256 for header in extension_headers:2257 ParseFunctionsFromHeader(open(header), extensions, gl_versions)2258 return extensions, gl_versions2259def GetFunctionToExtensionsMap(extensions):2260 """Construct map from a function names to extensions which define the2261 function.2262 Args:2263 extensions: Map of extension name => functions.2264 Returns:2265 Map of function name => extension names.2266 """2267 function_to_extensions = {}2268 for extension, functions in extensions.items():2269 for function in functions:2270 if not function in function_to_extensions:2271 function_to_extensions[function] = set([])2272 function_to_extensions[function].add(extension)2273 return function_to_extensions2274def GetFunctionToGLVersionsMap(gl_versions):2275 """Construct map from a function names to GL versions which define the2276 function.2277 Args:2278 extensions: Map of gl versions => functions.2279 Returns:2280 Map of function name => gl versions.2281 """2282 function_to_gl_versions = {}2283 for gl_version, functions in gl_versions.items():2284 for function in functions:2285 if not function in function_to_gl_versions:2286 function_to_gl_versions[function] = set([])2287 function_to_gl_versions[function].add(gl_version)2288 return function_to_gl_versions2289def LooksLikeExtensionFunction(function):2290 """Heuristic to see if a function name is consistent with extension function2291 naming."""2292 vendor = re.match(r'\w+?([A-Z][A-Z]+)$', function)2293 return vendor is not None and not vendor.group(1) in ['GL', 'API', 'DC']2294def SortVersions(key):2295 # Prefer functions from the core for binding2296 if 'gl_versions' in key:2297 return 02298 else:2299 return 12300def FillExtensionsFromHeaders(functions, extension_headers, extra_extensions):2301 """Determine which functions belong to extensions based on extension headers,2302 and fill in this information to the functions table for functions that don't2303 already have the information.2304 Args:2305 functions: List of (return type, function versions, arguments).2306 extension_headers: List of header file names.2307 extra_extensions: Extensions to add to the list.2308 Returns:2309 Set of used extensions.2310 """2311 # Parse known extensions.2312 extensions, gl_versions = GetDynamicFunctions(extension_headers)2313 functions_to_extensions = GetFunctionToExtensionsMap(extensions)2314 functions_to_gl_versions = GetFunctionToGLVersionsMap(gl_versions)2315 # Fill in the extension information.2316 used_extensions = set()2317 used_client_extensions = set()2318 used_functions_by_version = collections.defaultdict(lambda: set([]))2319 for func in functions:2320 for version in func['versions']:2321 name = version['name']2322 # There should only be one version entry per name string.2323 if len([v for v in func['versions'] if v['name'] == name]) > 1:2324 raise RuntimeError(2325 'Duplicate version entries with same name for %s' % name)2326 # Make sure we know about all extensions and extension functions.2327 extensions_from_headers = set([])2328 if name in functions_to_extensions:2329 extensions_from_headers = set(functions_to_extensions[name])2330 explicit_extensions = set([])2331 if 'client_extensions' in version:2332 assert not 'extensions' in version2333 version['extensions'] = version['client_extensions']2334 if 'extensions' in version:2335 explicit_extensions = set(version['extensions'])2336 in_both = explicit_extensions.intersection(extensions_from_headers)2337 if len(in_both):2338 print "[%s] Specified redundant extensions for binding: %s" % (2339 name, ', '.join(in_both))2340 diff = explicit_extensions - extensions_from_headers2341 if len(diff):2342 print "[%s] Specified extra extensions for binding: %s" % (2343 name, ', '.join(diff))2344 all_extensions = extensions_from_headers.union(explicit_extensions)2345 if len(all_extensions):2346 version['extensions'] = all_extensions2347 if 'extensions' in version:2348 assert len(version['extensions'])2349 if 'client_extensions' in version:2350 used_client_extensions.update(version['extensions'])2351 else:2352 used_extensions.update(version['extensions'])2353 if not 'extensions' in version and LooksLikeExtensionFunction(name):2354 raise RuntimeError('%s looks like an extension function but does not '2355 'belong to any of the known extensions.' % name)2356 if name in functions_to_gl_versions:2357 assert not 'gl_versions' in version2358 version['gl_versions'] = functions_to_gl_versions[name]2359 for v in version['gl_versions']:2360 used_functions_by_version[v].add(name)2361 func['versions'] = sorted(func['versions'], key=SortVersions)2362 # Add extensions that do not have any functions.2363 used_extensions.update(extra_extensions)2364 # Print out used function count by GL(ES) version.2365 for v in sorted([v for v in used_functions_by_version if v.is_es]):2366 print "OpenGL ES %d.%d: %d used functions" % (2367 v.major_version, v.minor_version, len(used_functions_by_version[v]))2368 for v in sorted([v for v in used_functions_by_version if not v.is_es]):2369 print "OpenGL %d.%d: %d used functions" % (2370 v.major_version, v.minor_version, len(used_functions_by_version[v]))2371 return used_extensions, used_client_extensions2372def ResolveHeader(header, header_paths):2373 for path in header_paths:2374 result = os.path.join(path, header)2375 if not os.path.isabs(path):2376 result = os.path.abspath(os.path.join(SELF_LOCATION, result))2377 if os.path.exists(result):2378 # Always use forward slashes as path separators. Otherwise backslashes2379 # may be incorrectly interpreted as escape characters.2380 return result.replace(os.path.sep, '/')2381 raise Exception('Header %s not found.' % header)2382def main(argv):2383 """This is the main function."""2384 parser = optparse.OptionParser()2385 parser.add_option('--inputs', action='store_true')2386 parser.add_option('--verify-order', action='store_true')2387 parser.add_option('--generate-dchecks', action='store_true',2388 help='Generates DCHECKs into the logging functions '2389 'asserting no GL errors (useful for debugging)')2390 parser.add_option('--validate-bindings', action='store_true',2391 help='Generate DCHECKs to validate function bindings '2392 ' were correctly supplied (useful for debugging)')2393 options, args = parser.parse_args(argv)2394 if options.inputs:2395 for [_, _, headers, _] in FUNCTION_SETS:2396 for header in headers:2397 print ResolveHeader(header, HEADER_PATHS)2398 return 02399 directory = SELF_LOCATION2400 if len(args) >= 1:2401 directory = args[0]2402 def ClangFormat(filename):2403 formatter = "clang-format"2404 if platform.system() == "Windows":2405 formatter += ".bat"2406 call([formatter, "-i", "-style=chromium", filename])2407 for [functions, set_name, extension_headers, extensions] in FUNCTION_SETS:2408 # Function names can be specified in two ways (list of unique names or list2409 # of versions with different binding conditions). Fill in the data to the2410 # versions list in case it is missing, so that can be used from here on:2411 for func in functions:2412 assert 'versions' in func or 'names' in func, 'Function with no names'2413 if 'versions' not in func:2414 func['versions'] = [{'name': n} for n in func['names']]2415 # Use the first version's name unless otherwise specified2416 if 'known_as' not in func:2417 func['known_as'] = func['versions'][0]['name']2418 # Make sure that 'names' is not accidentally used instead of 'versions'2419 if 'names' in func:2420 del func['names']2421 # Check function names in each set is sorted in alphabetical order.2422 for index in range(len(functions) - 1):2423 func_name = functions[index]['known_as']2424 next_func_name = functions[index + 1]['known_as']2425 if func_name.lower() > next_func_name.lower():2426 raise Exception(2427 'function %s is not in alphabetical order' % next_func_name)2428 if options.verify_order:2429 continue2430 extension_headers = [ResolveHeader(h, HEADER_PATHS)2431 for h in extension_headers]2432 used_extensions, used_client_extensions = FillExtensionsFromHeaders(2433 functions, extension_headers, extensions)2434 header_file = open(2435 os.path.join(directory, 'gl_bindings_autogen_%s.h' % set_name), 'wb')2436 GenerateHeader(header_file, functions, set_name,2437 used_extensions, used_client_extensions)2438 header_file.close()2439 ClangFormat(header_file.name)2440 header_file = open(2441 os.path.join(directory, 'gl_bindings_api_autogen_%s.h' % set_name),2442 'wb')2443 GenerateAPIHeader(header_file, functions, set_name)2444 header_file.close()2445 ClangFormat(header_file.name)2446 source_file = open(2447 os.path.join(directory, 'gl_bindings_autogen_%s.cc' % set_name), 'wb')2448 GenerateSource(source_file, functions, set_name,2449 used_extensions, used_client_extensions, options)2450 source_file.close()2451 ClangFormat(source_file.name)2452 if not options.verify_order:2453 header_file = open(2454 os.path.join(directory, 'gl_mock_autogen_gl.h'), 'wb')2455 GenerateMockHeader(header_file, GL_FUNCTIONS, 'gl')2456 header_file.close()2457 ClangFormat(header_file.name)2458 header_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.h'),2459 'wb')2460 GenerateMockBindingsHeader(header_file, GL_FUNCTIONS)2461 header_file.close()2462 ClangFormat(header_file.name)2463 source_file = open(os.path.join(directory, 'gl_bindings_autogen_mock.cc'),2464 'wb')2465 GenerateMockBindingsSource(source_file, GL_FUNCTIONS)2466 source_file.close()2467 ClangFormat(source_file.name)2468 enum_header_filenames = [ResolveHeader(h, HEADER_PATHS)2469 for h in GLES2_HEADERS_WITH_ENUMS]2470 header_file = open(os.path.join(directory,2471 'gl_enums_implementation_autogen.h'),2472 'wb')2473 GenerateEnumUtils(header_file, enum_header_filenames)2474 header_file.close()2475 ClangFormat(header_file.name)2476 return 02477if __name__ == '__main__':...

Full Screen

Full Screen

neovim_rpc_server_api_info.py

Source:neovim_rpc_server_api_info.py Github

copy

Full Screen

1# result of neovim `api_info()`2API_INFO = {3 "version": {4 "major": 0,5 "api_level": 1,6 "api_prerelease": False,7 "patch": 7,8 "api_compatible": 0,9 "minor": 110 },11 "types": {12 "Window": {13 "id": 1,14 "prefix": "nvim_win_"15 },16 "Tabpage": {17 "id": 2,18 "prefix": "nvim_tabpage_"19 },20 "Buffer": {21 "id": 0,22 "prefix": "nvim_buf_"23 }24 },25 "functions": [26 {27 "method": True,28 "name": "nvim_buf_line_count",29 "return_type": "Integer",30 "parameters": [31 [32 "Buffer",33 "buffer"34 ]35 ],36 "since": 137 },38 {39 "method": False,40 "deprecated_since": 1,41 "name": "buffer_get_line",42 "return_type": "String",43 "parameters": [44 [45 "Buffer",46 "buffer"47 ],48 [49 "Integer",50 "index"51 ]52 ],53 "since": 054 },55 {56 "method": False,57 "deprecated_since": 1,58 "name": "buffer_set_line",59 "return_type": "void",60 "parameters": [61 [62 "Buffer",63 "buffer"64 ],65 [66 "Integer",67 "index"68 ],69 [70 "String",71 "line"72 ]73 ],74 "since": 075 },76 {77 "method": False,78 "deprecated_since": 1,79 "name": "buffer_del_line",80 "return_type": "void",81 "parameters": [82 [83 "Buffer",84 "buffer"85 ],86 [87 "Integer",88 "index"89 ]90 ],91 "since": 092 },93 {94 "method": False,95 "deprecated_since": 1,96 "name": "buffer_get_line_slice",97 "return_type": "ArrayOf(String)",98 "parameters": [99 [100 "Buffer",101 "buffer"102 ],103 [104 "Integer",105 "start"106 ],107 [108 "Integer",109 "end"110 ],111 [112 "Boolean",113 "include_start"114 ],115 [116 "Boolean",117 "include_end"118 ]119 ],120 "since": 0121 },122 {123 "method": True,124 "name": "nvim_buf_get_lines",125 "return_type": "ArrayOf(String)",126 "parameters": [127 [128 "Buffer",129 "buffer"130 ],131 [132 "Integer",133 "start"134 ],135 [136 "Integer",137 "end"138 ],139 [140 "Boolean",141 "strict_indexing"142 ]143 ],144 "since": 1145 },146 {147 "method": False,148 "deprecated_since": 1,149 "name": "buffer_set_line_slice",150 "return_type": "void",151 "parameters": [152 [153 "Buffer",154 "buffer"155 ],156 [157 "Integer",158 "start"159 ],160 [161 "Integer",162 "end"163 ],164 [165 "Boolean",166 "include_start"167 ],168 [169 "Boolean",170 "include_end"171 ],172 [173 "ArrayOf(String)",174 "replacement"175 ]176 ],177 "since": 0178 },179 {180 "method": True,181 "name": "nvim_buf_set_lines",182 "return_type": "void",183 "parameters": [184 [185 "Buffer",186 "buffer"187 ],188 [189 "Integer",190 "start"191 ],192 [193 "Integer",194 "end"195 ],196 [197 "Boolean",198 "strict_indexing"199 ],200 [201 "ArrayOf(String)",202 "replacement"203 ]204 ],205 "since": 1206 },207 {208 "method": True,209 "name": "nvim_buf_get_var",210 "return_type": "Object",211 "parameters": [212 [213 "Buffer",214 "buffer"215 ],216 [217 "String",218 "name"219 ]220 ],221 "since": 1222 },223 {224 "method": True,225 "name": "nvim_buf_get_mark",226 "return_type": "ArrayOf(Integer, 2)",227 "parameters": [228 [229 "Buffer",230 "buffer"231 ],232 [233 "String",234 "name"235 ]236 ],237 "since": 1238 },239 {240 "method": True,241 "name": "nvim_buf_set_var",242 "return_type": "void",243 "parameters": [244 [245 "Buffer",246 "buffer"247 ],248 [249 "String",250 "name"251 ],252 [253 "Object",254 "value"255 ]256 ],257 "since": 1258 },259 {260 "method": True,261 "name": "nvim_buf_del_var",262 "return_type": "void",263 "parameters": [264 [265 "Buffer",266 "buffer"267 ],268 [269 "String",270 "name"271 ]272 ],273 "since": 1274 },275 {276 "method": False,277 "deprecated_since": 1,278 "name": "buffer_set_var",279 "return_type": "Object",280 "parameters": [281 [282 "Buffer",283 "buffer"284 ],285 [286 "String",287 "name"288 ],289 [290 "Object",291 "value"292 ]293 ],294 "since": 0295 },296 {297 "method": False,298 "deprecated_since": 1,299 "name": "buffer_del_var",300 "return_type": "Object",301 "parameters": [302 [303 "Buffer",304 "buffer"305 ],306 [307 "String",308 "name"309 ]310 ],311 "since": 0312 },313 {314 "method": True,315 "name": "nvim_buf_get_option",316 "return_type": "Object",317 "parameters": [318 [319 "Buffer",320 "buffer"321 ],322 [323 "String",324 "name"325 ]326 ],327 "since": 1328 },329 {330 "method": True,331 "name": "nvim_buf_set_option",332 "return_type": "void",333 "parameters": [334 [335 "Buffer",336 "buffer"337 ],338 [339 "String",340 "name"341 ],342 [343 "Object",344 "value"345 ]346 ],347 "since": 1348 },349 {350 "method": True,351 "name": "nvim_buf_get_number",352 "return_type": "Integer",353 "parameters": [354 [355 "Buffer",356 "buffer"357 ]358 ],359 "since": 1360 },361 {362 "method": True,363 "name": "nvim_buf_get_name",364 "return_type": "String",365 "parameters": [366 [367 "Buffer",368 "buffer"369 ]370 ],371 "since": 1372 },373 {374 "method": True,375 "name": "nvim_buf_set_name",376 "return_type": "void",377 "parameters": [378 [379 "Buffer",380 "buffer"381 ],382 [383 "String",384 "name"385 ]386 ],387 "since": 1388 },389 {390 "method": True,391 "name": "nvim_buf_is_valid",392 "return_type": "Boolean",393 "parameters": [394 [395 "Buffer",396 "buffer"397 ]398 ],399 "since": 1400 },401 {402 "method": False,403 "deprecated_since": 1,404 "name": "buffer_insert",405 "return_type": "void",406 "parameters": [407 [408 "Buffer",409 "buffer"410 ],411 [412 "Integer",413 "lnum"414 ],415 [416 "ArrayOf(String)",417 "lines"418 ]419 ],420 "since": 0421 },422 {423 "method": True,424 "name": "nvim_buf_get_mark",425 "return_type": "ArrayOf(Integer, 2)",426 "parameters": [427 [428 "Buffer",429 "buffer"430 ],431 [432 "String",433 "name"434 ]435 ],436 "since": 1437 },438 {439 "method": True,440 "name": "nvim_buf_add_highlight",441 "return_type": "Integer",442 "parameters": [443 [444 "Buffer",445 "buffer"446 ],447 [448 "Integer",449 "src_id"450 ],451 [452 "String",453 "hl_group"454 ],455 [456 "Integer",457 "line"458 ],459 [460 "Integer",461 "col_start"462 ],463 [464 "Integer",465 "col_end"466 ]467 ],468 "since": 1469 },470 {471 "method": True,472 "name": "nvim_buf_clear_highlight",473 "return_type": "void",474 "parameters": [475 [476 "Buffer",477 "buffer"478 ],479 [480 "Integer",481 "src_id"482 ],483 [484 "Integer",485 "line_start"486 ],487 [488 "Integer",489 "line_end"490 ]491 ],492 "since": 1493 },494 {495 "method": True,496 "name": "nvim_tabpage_list_wins",497 "return_type": "ArrayOf(Window)",498 "parameters": [499 [500 "Tabpage",501 "tabpage"502 ]503 ],504 "since": 1505 },506 {507 "method": True,508 "name": "nvim_tabpage_get_var",509 "return_type": "Object",510 "parameters": [511 [512 "Tabpage",513 "tabpage"514 ],515 [516 "String",517 "name"518 ]519 ],520 "since": 1521 },522 {523 "method": True,524 "name": "nvim_tabpage_set_var",525 "return_type": "void",526 "parameters": [527 [528 "Tabpage",529 "tabpage"530 ],531 [532 "String",533 "name"534 ],535 [536 "Object",537 "value"538 ]539 ],540 "since": 1541 },542 {543 "method": True,544 "name": "nvim_tabpage_del_var",545 "return_type": "void",546 "parameters": [547 [548 "Tabpage",549 "tabpage"550 ],551 [552 "String",553 "name"554 ]555 ],556 "since": 1557 },558 {559 "method": False,560 "deprecated_since": 1,561 "name": "tabpage_set_var",562 "return_type": "Object",563 "parameters": [564 [565 "Tabpage",566 "tabpage"567 ],568 [569 "String",570 "name"571 ],572 [573 "Object",574 "value"575 ]576 ],577 "since": 0578 },579 {580 "method": False,581 "deprecated_since": 1,582 "name": "tabpage_del_var",583 "return_type": "Object",584 "parameters": [585 [586 "Tabpage",587 "tabpage"588 ],589 [590 "String",591 "name"592 ]593 ],594 "since": 0595 },596 {597 "method": True,598 "name": "nvim_tabpage_get_win",599 "return_type": "Window",600 "parameters": [601 [602 "Tabpage",603 "tabpage"604 ]605 ],606 "since": 1607 },608 {609 "method": True,610 "name": "nvim_tabpage_get_number",611 "return_type": "Integer",612 "parameters": [613 [614 "Tabpage",615 "tabpage"616 ]617 ],618 "since": 1619 },620 {621 "method": True,622 "name": "nvim_tabpage_is_valid",623 "return_type": "Boolean",624 "parameters": [625 [626 "Tabpage",627 "tabpage"628 ]629 ],630 "since": 1631 },632 {633 "method": False,634 "name": "nvim_ui_attach",635 "return_type": "void",636 "parameters": [637 [638 "Integer",639 "width"640 ],641 [642 "Integer",643 "height"644 ],645 [646 "Dictionary",647 "options"648 ]649 ],650 "since": 1651 },652 {653 "method": False,654 "deprecated_since": 1,655 "name": "ui_attach",656 "return_type": "void",657 "parameters": [658 [659 "Integer",660 "width"661 ],662 [663 "Integer",664 "height"665 ],666 [667 "Boolean",668 "enable_rgb"669 ]670 ],671 "since": 0672 },673 {674 "method": False,675 "name": "nvim_ui_detach",676 "return_type": "void",677 "parameters": [],678 "since": 1679 },680 {681 "method": False,682 "name": "nvim_ui_try_resize",683 "return_type": "void",684 "parameters": [685 [686 "Integer",687 "width"688 ],689 [690 "Integer",691 "height"692 ]693 ],694 "since": 1695 },696 {697 "method": False,698 "name": "nvim_ui_set_option",699 "return_type": "void",700 "parameters": [701 [702 "String",703 "name"704 ],705 [706 "Object",707 "value"708 ]709 ],710 "since": 1711 },712 {713 "method": False,714 "name": "nvim_command",715 "return_type": "void",716 "parameters": [717 [718 "String",719 "command"720 ]721 ],722 "since": 1723 },724 {725 "method": False,726 "name": "nvim_feedkeys",727 "return_type": "void",728 "parameters": [729 [730 "String",731 "keys"732 ],733 [734 "String",735 "mode"736 ],737 [738 "Boolean",739 "escape_csi"740 ]741 ],742 "since": 1743 },744 {745 "method": False,746 "name": "nvim_input",747 "return_type": "Integer",748 "parameters": [749 [750 "String",751 "keys"752 ]753 ],754 "since": 1755 },756 {757 "method": False,758 "name": "nvim_replace_termcodes",759 "return_type": "String",760 "parameters": [761 [762 "String",763 "str"764 ],765 [766 "Boolean",767 "from_part"768 ],769 [770 "Boolean",771 "do_lt"772 ],773 [774 "Boolean",775 "special"776 ]777 ],778 "since": 1779 },780 {781 "method": False,782 "name": "nvim_command_output",783 "return_type": "String",784 "parameters": [785 [786 "String",787 "str"788 ]789 ],790 "since": 1791 },792 {793 "method": False,794 "name": "nvim_eval",795 "return_type": "Object",796 "parameters": [797 [798 "String",799 "expr"800 ]801 ],802 "since": 1803 },804 {805 "method": False,806 "name": "nvim_call_function",807 "return_type": "Object",808 "parameters": [809 [810 "String",811 "fname"812 ],813 [814 "Array",815 "args"816 ]817 ],818 "since": 1819 },820 {821 "method": False,822 "name": "nvim_strwidth",823 "return_type": "Integer",824 "parameters": [825 [826 "String",827 "str"828 ]829 ],830 "since": 1831 },832 {833 "method": False,834 "name": "nvim_list_runtime_paths",835 "return_type": "ArrayOf(String)",836 "parameters": [],837 "since": 1838 },839 {840 "method": False,841 "name": "nvim_set_current_dir",842 "return_type": "void",843 "parameters": [844 [845 "String",846 "dir"847 ]848 ],849 "since": 1850 },851 {852 "method": False,853 "name": "nvim_get_current_line",854 "return_type": "String",855 "parameters": [],856 "since": 1857 },858 {859 "method": False,860 "name": "nvim_set_current_line",861 "return_type": "void",862 "parameters": [863 [864 "String",865 "line"866 ]867 ],868 "since": 1869 },870 {871 "method": False,872 "name": "nvim_del_current_line",873 "return_type": "void",874 "parameters": [],875 "since": 1876 },877 {878 "method": False,879 "name": "nvim_get_var",880 "return_type": "Object",881 "parameters": [882 [883 "String",884 "name"885 ]886 ],887 "since": 1888 },889 {890 "method": False,891 "name": "nvim_set_var",892 "return_type": "void",893 "parameters": [894 [895 "String",896 "name"897 ],898 [899 "Object",900 "value"901 ]902 ],903 "since": 1904 },905 {906 "method": False,907 "name": "nvim_del_var",908 "return_type": "void",909 "parameters": [910 [911 "String",912 "name"913 ]914 ],915 "since": 1916 },917 {918 "method": False,919 "deprecated_since": 1,920 "name": "vim_set_var",921 "return_type": "Object",922 "parameters": [923 [924 "String",925 "name"926 ],927 [928 "Object",929 "value"930 ]931 ],932 "since": 0933 },934 {935 "method": False,936 "deprecated_since": 1,937 "name": "vim_del_var",938 "return_type": "Object",939 "parameters": [940 [941 "String",942 "name"943 ]944 ],945 "since": 0946 },947 {948 "method": False,949 "name": "nvim_get_vvar",950 "return_type": "Object",951 "parameters": [952 [953 "String",954 "name"955 ]956 ],957 "since": 1958 },959 {960 "method": False,961 "name": "nvim_get_option",962 "return_type": "Object",963 "parameters": [964 [965 "String",966 "name"967 ]968 ],969 "since": 1970 },971 {972 "method": False,973 "name": "nvim_set_option",974 "return_type": "void",975 "parameters": [976 [977 "String",978 "name"979 ],980 [981 "Object",982 "value"983 ]984 ],985 "since": 1986 },987 {988 "method": False,989 "name": "nvim_out_write",990 "return_type": "void",991 "parameters": [992 [993 "String",994 "str"995 ]996 ],997 "since": 1998 },999 {1000 "method": False,1001 "name": "nvim_err_write",1002 "return_type": "void",1003 "parameters": [1004 [1005 "String",1006 "str"1007 ]1008 ],1009 "since": 11010 },1011 {1012 "method": False,1013 "name": "nvim_err_writeln",1014 "return_type": "void",1015 "parameters": [1016 [1017 "String",1018 "str"1019 ]1020 ],1021 "since": 11022 },1023 {1024 "method": False,1025 "name": "nvim_list_bufs",1026 "return_type": "ArrayOf(Buffer)",1027 "parameters": [],1028 "since": 11029 },1030 {1031 "method": False,1032 "name": "nvim_get_current_buf",1033 "return_type": "Buffer",1034 "parameters": [],1035 "since": 11036 },1037 {1038 "method": False,1039 "name": "nvim_set_current_buf",1040 "return_type": "void",1041 "parameters": [1042 [1043 "Buffer",1044 "buffer"1045 ]1046 ],1047 "since": 11048 },1049 {1050 "method": False,1051 "name": "nvim_list_wins",1052 "return_type": "ArrayOf(Window)",1053 "parameters": [],1054 "since": 11055 },1056 {1057 "method": False,1058 "name": "nvim_get_current_win",1059 "return_type": "Window",1060 "parameters": [],1061 "since": 11062 },1063 {1064 "method": False,1065 "name": "nvim_set_current_win",1066 "return_type": "void",1067 "parameters": [1068 [1069 "Window",1070 "window"1071 ]1072 ],1073 "since": 11074 },1075 {1076 "method": False,1077 "name": "nvim_list_tabpages",1078 "return_type": "ArrayOf(Tabpage)",1079 "parameters": [],1080 "since": 11081 },1082 {1083 "method": False,1084 "name": "nvim_get_current_tabpage",1085 "return_type": "Tabpage",1086 "parameters": [],1087 "since": 11088 },1089 {1090 "method": False,1091 "name": "nvim_set_current_tabpage",1092 "return_type": "void",1093 "parameters": [1094 [1095 "Tabpage",1096 "tabpage"1097 ]1098 ],1099 "since": 11100 },1101 {1102 "method": False,1103 "name": "nvim_subscribe",1104 "return_type": "void",1105 "parameters": [1106 [1107 "String",1108 "event"1109 ]1110 ],1111 "since": 11112 },1113 {1114 "method": False,1115 "name": "nvim_unsubscribe",1116 "return_type": "void",1117 "parameters": [1118 [1119 "String",1120 "event"1121 ]1122 ],1123 "since": 11124 },1125 {1126 "method": False,1127 "name": "nvim_get_color_by_name",1128 "return_type": "Integer",1129 "parameters": [1130 [1131 "String",1132 "name"1133 ]1134 ],1135 "since": 11136 },1137 {1138 "method": False,1139 "name": "nvim_get_color_map",1140 "return_type": "Dictionary",1141 "parameters": [],1142 "since": 11143 },1144 {1145 "method": False,1146 "name": "nvim_get_api_info",1147 "return_type": "Array",1148 "parameters": [],1149 "since": 11150 },1151 {1152 "method": False,1153 "name": "nvim_call_atomic",1154 "return_type": "Array",1155 "parameters": [1156 [1157 "Array",1158 "calls"1159 ]1160 ],1161 "since": 11162 },1163 {1164 "method": True,1165 "name": "nvim_win_get_buf",1166 "return_type": "Buffer",1167 "parameters": [1168 [1169 "Window",1170 "window"1171 ]1172 ],1173 "since": 11174 },1175 {1176 "method": True,1177 "name": "nvim_win_get_cursor",1178 "return_type": "ArrayOf(Integer, 2)",1179 "parameters": [1180 [1181 "Window",1182 "window"1183 ]1184 ],1185 "since": 11186 },1187 {1188 "method": True,1189 "name": "nvim_win_set_cursor",1190 "return_type": "void",1191 "parameters": [1192 [1193 "Window",1194 "window"1195 ],1196 [1197 "ArrayOf(Integer, 2)",1198 "pos"1199 ]1200 ],1201 "since": 11202 },1203 {1204 "method": True,1205 "name": "nvim_win_get_height",1206 "return_type": "Integer",1207 "parameters": [1208 [1209 "Window",1210 "window"1211 ]1212 ],1213 "since": 11214 },1215 {1216 "method": True,1217 "name": "nvim_win_set_height",1218 "return_type": "void",1219 "parameters": [1220 [1221 "Window",1222 "window"1223 ],1224 [1225 "Integer",1226 "height"1227 ]1228 ],1229 "since": 11230 },1231 {1232 "method": True,1233 "name": "nvim_win_get_width",1234 "return_type": "Integer",1235 "parameters": [1236 [1237 "Window",1238 "window"1239 ]1240 ],1241 "since": 11242 },1243 {1244 "method": True,1245 "name": "nvim_win_set_width",1246 "return_type": "void",1247 "parameters": [1248 [1249 "Window",1250 "window"1251 ],1252 [1253 "Integer",1254 "width"1255 ]1256 ],1257 "since": 11258 },1259 {1260 "method": True,1261 "name": "nvim_win_get_var",1262 "return_type": "Object",1263 "parameters": [1264 [1265 "Window",1266 "window"1267 ],1268 [1269 "String",1270 "name"1271 ]1272 ],1273 "since": 11274 },1275 {1276 "method": True,1277 "name": "nvim_win_set_var",1278 "return_type": "void",1279 "parameters": [1280 [1281 "Window",1282 "window"1283 ],1284 [1285 "String",1286 "name"1287 ],1288 [1289 "Object",1290 "value"1291 ]1292 ],1293 "since": 11294 },1295 {1296 "method": True,1297 "name": "nvim_win_del_var",1298 "return_type": "void",1299 "parameters": [1300 [1301 "Window",1302 "window"1303 ],1304 [1305 "String",1306 "name"1307 ]1308 ],1309 "since": 11310 },1311 {1312 "method": False,1313 "deprecated_since": 1,1314 "name": "window_set_var",1315 "return_type": "Object",1316 "parameters": [1317 [1318 "Window",1319 "window"1320 ],1321 [1322 "String",1323 "name"1324 ],1325 [1326 "Object",1327 "value"1328 ]1329 ],1330 "since": 01331 },1332 {1333 "method": False,1334 "deprecated_since": 1,1335 "name": "window_del_var",1336 "return_type": "Object",1337 "parameters": [1338 [1339 "Window",1340 "window"1341 ],1342 [1343 "String",1344 "name"1345 ]1346 ],1347 "since": 01348 },1349 {1350 "method": True,1351 "name": "nvim_win_get_option",1352 "return_type": "Object",1353 "parameters": [1354 [1355 "Window",1356 "window"1357 ],1358 [1359 "String",1360 "name"1361 ]1362 ],1363 "since": 11364 },1365 {1366 "method": True,1367 "name": "nvim_win_set_option",1368 "return_type": "void",1369 "parameters": [1370 [1371 "Window",1372 "window"1373 ],1374 [1375 "String",1376 "name"1377 ],1378 [1379 "Object",1380 "value"1381 ]1382 ],1383 "since": 11384 },1385 {1386 "method": True,1387 "name": "nvim_win_get_position",1388 "return_type": "ArrayOf(Integer, 2)",1389 "parameters": [1390 [1391 "Window",1392 "window"1393 ]1394 ],1395 "since": 11396 },1397 {1398 "method": True,1399 "name": "nvim_win_get_tabpage",1400 "return_type": "Tabpage",1401 "parameters": [1402 [1403 "Window",1404 "window"1405 ]1406 ],1407 "since": 11408 },1409 {1410 "method": True,1411 "name": "nvim_win_get_number",1412 "return_type": "Integer",1413 "parameters": [1414 [1415 "Window",1416 "window"1417 ]1418 ],1419 "since": 11420 },1421 {1422 "method": True,1423 "name": "nvim_win_is_valid",1424 "return_type": "Boolean",1425 "parameters": [1426 [1427 "Window",1428 "window"1429 ]1430 ],1431 "since": 11432 },1433 {1434 "method": True,1435 "deprecated_since": 1,1436 "name": "buffer_line_count",1437 "return_type": "Integer",1438 "parameters": [1439 [1440 "Buffer",1441 "buffer"1442 ]1443 ],1444 "since": 01445 },1446 {1447 "method": True,1448 "deprecated_since": 1,1449 "name": "buffer_get_lines",1450 "return_type": "ArrayOf(String)",1451 "parameters": [1452 [1453 "Buffer",1454 "buffer"1455 ],1456 [1457 "Integer",1458 "start"1459 ],1460 [1461 "Integer",1462 "end"1463 ],1464 [1465 "Boolean",1466 "strict_indexing"1467 ]1468 ],1469 "since": 01470 },1471 {1472 "method": True,1473 "deprecated_since": 1,1474 "name": "buffer_set_lines",1475 "return_type": "void",1476 "parameters": [1477 [1478 "Buffer",1479 "buffer"1480 ],1481 [1482 "Integer",1483 "start"1484 ],1485 [1486 "Integer",1487 "end"1488 ],1489 [1490 "Boolean",1491 "strict_indexing"1492 ],1493 [1494 "ArrayOf(String)",1495 "replacement"1496 ]1497 ],1498 "since": 01499 },1500 {1501 "method": True,1502 "deprecated_since": 1,1503 "name": "buffer_get_var",1504 "return_type": "Object",1505 "parameters": [1506 [1507 "Buffer",1508 "buffer"1509 ],1510 [1511 "String",1512 "name"1513 ]1514 ],1515 "since": 01516 },1517 {1518 "method": True,1519 "deprecated_since": 1,1520 "name": "buffer_get_option",1521 "return_type": "Object",1522 "parameters": [1523 [1524 "Buffer",1525 "buffer"1526 ],1527 [1528 "String",1529 "name"1530 ]1531 ],1532 "since": 01533 },1534 {1535 "method": True,1536 "deprecated_since": 1,1537 "name": "buffer_set_option",1538 "return_type": "void",1539 "parameters": [1540 [1541 "Buffer",1542 "buffer"1543 ],1544 [1545 "String",1546 "name"1547 ],1548 [1549 "Object",1550 "value"1551 ]1552 ],1553 "since": 01554 },1555 {1556 "method": True,1557 "deprecated_since": 1,1558 "name": "buffer_get_number",1559 "return_type": "Integer",1560 "parameters": [1561 [1562 "Buffer",1563 "buffer"1564 ]1565 ],1566 "since": 01567 },1568 {1569 "method": True,1570 "deprecated_since": 1,1571 "name": "buffer_get_name",1572 "return_type": "String",1573 "parameters": [1574 [1575 "Buffer",1576 "buffer"1577 ]1578 ],1579 "since": 01580 },1581 {1582 "method": True,1583 "deprecated_since": 1,1584 "name": "buffer_set_name",1585 "return_type": "void",1586 "parameters": [1587 [1588 "Buffer",1589 "buffer"1590 ],1591 [1592 "String",1593 "name"1594 ]1595 ],1596 "since": 01597 },1598 {1599 "method": True,1600 "deprecated_since": 1,1601 "name": "buffer_is_valid",1602 "return_type": "Boolean",1603 "parameters": [1604 [1605 "Buffer",1606 "buffer"1607 ]1608 ],1609 "since": 01610 },1611 {1612 "method": True,1613 "deprecated_since": 1,1614 "name": "buffer_get_mark",1615 "return_type": "ArrayOf(Integer, 2)",1616 "parameters": [1617 [1618 "Buffer",1619 "buffer"1620 ],1621 [1622 "String",1623 "name"1624 ]1625 ],1626 "since": 01627 },1628 {1629 "method": True,1630 "deprecated_since": 1,1631 "name": "buffer_add_highlight",1632 "return_type": "Integer",1633 "parameters": [1634 [1635 "Buffer",1636 "buffer"1637 ],1638 [1639 "Integer",1640 "src_id"1641 ],1642 [1643 "String",1644 "hl_group"1645 ],1646 [1647 "Integer",1648 "line"1649 ],1650 [1651 "Integer",1652 "col_start"1653 ],1654 [1655 "Integer",1656 "col_end"1657 ]1658 ],1659 "since": 01660 },1661 {1662 "method": True,1663 "deprecated_since": 1,1664 "name": "buffer_clear_highlight",1665 "return_type": "void",1666 "parameters": [1667 [1668 "Buffer",1669 "buffer"1670 ],1671 [1672 "Integer",1673 "src_id"1674 ],1675 [1676 "Integer",1677 "line_start"1678 ],1679 [1680 "Integer",1681 "line_end"1682 ]1683 ],1684 "since": 01685 },1686 {1687 "method": True,1688 "deprecated_since": 1,1689 "name": "tabpage_get_windows",1690 "return_type": "ArrayOf(Window)",1691 "parameters": [1692 [1693 "Tabpage",1694 "tabpage"1695 ]1696 ],1697 "since": 01698 },1699 {1700 "method": True,1701 "deprecated_since": 1,1702 "name": "tabpage_get_var",1703 "return_type": "Object",1704 "parameters": [1705 [1706 "Tabpage",1707 "tabpage"1708 ],1709 [1710 "String",1711 "name"1712 ]1713 ],1714 "since": 01715 },1716 {1717 "method": True,1718 "deprecated_since": 1,1719 "name": "tabpage_get_window",1720 "return_type": "Window",1721 "parameters": [1722 [1723 "Tabpage",1724 "tabpage"1725 ]1726 ],1727 "since": 01728 },1729 {1730 "method": True,1731 "deprecated_since": 1,1732 "name": "tabpage_is_valid",1733 "return_type": "Boolean",1734 "parameters": [1735 [1736 "Tabpage",1737 "tabpage"1738 ]1739 ],1740 "since": 01741 },1742 {1743 "method": False,1744 "deprecated_since": 1,1745 "name": "ui_detach",1746 "return_type": "void",1747 "parameters": [],1748 "since": 01749 },1750 {1751 "method": False,1752 "deprecated_since": 1,1753 "name": "ui_try_resize",1754 "return_type": "Object",1755 "parameters": [1756 [1757 "Integer",1758 "width"1759 ],1760 [1761 "Integer",1762 "height"1763 ]1764 ],1765 "since": 01766 },1767 {1768 "method": False,1769 "deprecated_since": 1,1770 "name": "vim_command",1771 "return_type": "void",1772 "parameters": [1773 [1774 "String",1775 "command"1776 ]1777 ],1778 "since": 01779 },1780 {1781 "method": False,1782 "deprecated_since": 1,1783 "name": "vim_feedkeys",1784 "return_type": "void",1785 "parameters": [1786 [1787 "String",1788 "keys"1789 ],1790 [1791 "String",1792 "mode"1793 ],1794 [1795 "Boolean",1796 "escape_csi"1797 ]1798 ],1799 "since": 01800 },1801 {1802 "method": False,1803 "deprecated_since": 1,1804 "name": "vim_input",1805 "return_type": "Integer",1806 "parameters": [1807 [1808 "String",1809 "keys"1810 ]1811 ],1812 "since": 01813 },1814 {1815 "method": False,1816 "deprecated_since": 1,1817 "name": "vim_replace_termcodes",1818 "return_type": "String",1819 "parameters": [1820 [1821 "String",1822 "str"1823 ],1824 [1825 "Boolean",1826 "from_part"1827 ],1828 [1829 "Boolean",1830 "do_lt"1831 ],1832 [1833 "Boolean",1834 "special"1835 ]1836 ],1837 "since": 01838 },1839 {1840 "method": False,1841 "deprecated_since": 1,1842 "name": "vim_command_output",1843 "return_type": "String",1844 "parameters": [1845 [1846 "String",1847 "str"1848 ]1849 ],1850 "since": 01851 },1852 {1853 "method": False,1854 "deprecated_since": 1,1855 "name": "vim_eval",1856 "return_type": "Object",1857 "parameters": [1858 [1859 "String",1860 "expr"1861 ]1862 ],1863 "since": 01864 },1865 {1866 "method": False,1867 "deprecated_since": 1,1868 "name": "vim_call_function",1869 "return_type": "Object",1870 "parameters": [1871 [1872 "String",1873 "fname"1874 ],1875 [1876 "Array",1877 "args"1878 ]1879 ],1880 "since": 01881 },1882 {1883 "method": False,1884 "deprecated_since": 1,1885 "name": "vim_strwidth",1886 "return_type": "Integer",1887 "parameters": [1888 [1889 "String",1890 "str"1891 ]1892 ],1893 "since": 01894 },1895 {1896 "method": False,1897 "deprecated_since": 1,1898 "name": "vim_list_runtime_paths",1899 "return_type": "ArrayOf(String)",1900 "parameters": [],1901 "since": 01902 },1903 {1904 "method": False,1905 "deprecated_since": 1,1906 "name": "vim_change_directory",1907 "return_type": "void",1908 "parameters": [1909 [1910 "String",1911 "dir"1912 ]1913 ],1914 "since": 01915 },1916 {1917 "method": False,1918 "deprecated_since": 1,1919 "name": "vim_get_current_line",1920 "return_type": "String",1921 "parameters": [],1922 "since": 01923 },1924 {1925 "method": False,1926 "deprecated_since": 1,1927 "name": "vim_set_current_line",1928 "return_type": "void",1929 "parameters": [1930 [1931 "String",1932 "line"1933 ]1934 ],1935 "since": 01936 },1937 {1938 "method": False,1939 "deprecated_since": 1,1940 "name": "vim_del_current_line",1941 "return_type": "void",1942 "parameters": [],1943 "since": 01944 },1945 {1946 "method": False,1947 "deprecated_since": 1,1948 "name": "vim_get_var",1949 "return_type": "Object",1950 "parameters": [1951 [1952 "String",1953 "name"1954 ]1955 ],1956 "since": 01957 },1958 {1959 "method": False,1960 "deprecated_since": 1,1961 "name": "vim_get_vvar",1962 "return_type": "Object",1963 "parameters": [1964 [1965 "String",1966 "name"1967 ]1968 ],1969 "since": 01970 },1971 {1972 "method": False,1973 "deprecated_since": 1,1974 "name": "vim_get_option",1975 "return_type": "Object",1976 "parameters": [1977 [1978 "String",1979 "name"1980 ]1981 ],1982 "since": 01983 },1984 {1985 "method": False,1986 "deprecated_since": 1,1987 "name": "vim_set_option",1988 "return_type": "void",1989 "parameters": [1990 [1991 "String",1992 "name"1993 ],1994 [1995 "Object",1996 "value"1997 ]1998 ],1999 "since": 02000 },2001 {2002 "method": False,2003 "deprecated_since": 1,2004 "name": "vim_out_write",2005 "return_type": "void",2006 "parameters": [2007 [2008 "String",2009 "str"2010 ]2011 ],2012 "since": 02013 },2014 {2015 "method": False,2016 "deprecated_since": 1,2017 "name": "vim_err_write",2018 "return_type": "void",2019 "parameters": [2020 [2021 "String",2022 "str"2023 ]2024 ],2025 "since": 02026 },2027 {2028 "method": False,2029 "deprecated_since": 1,2030 "name": "vim_report_error",2031 "return_type": "void",2032 "parameters": [2033 [2034 "String",2035 "str"2036 ]2037 ],2038 "since": 02039 },2040 {2041 "method": False,2042 "deprecated_since": 1,2043 "name": "vim_get_buffers",2044 "return_type": "ArrayOf(Buffer)",2045 "parameters": [],2046 "since": 02047 },2048 {2049 "method": False,2050 "deprecated_since": 1,2051 "name": "vim_get_current_buffer",2052 "return_type": "Buffer",2053 "parameters": [],2054 "since": 02055 },2056 {2057 "method": False,2058 "deprecated_since": 1,2059 "name": "vim_set_current_buffer",2060 "return_type": "void",2061 "parameters": [2062 [2063 "Buffer",2064 "buffer"2065 ]2066 ],2067 "since": 02068 },2069 {2070 "method": False,2071 "deprecated_since": 1,2072 "name": "vim_get_windows",2073 "return_type": "ArrayOf(Window)",2074 "parameters": [],2075 "since": 02076 },2077 {2078 "method": False,2079 "deprecated_since": 1,2080 "name": "vim_get_current_window",2081 "return_type": "Window",2082 "parameters": [],2083 "since": 02084 },2085 {2086 "method": False,2087 "deprecated_since": 1,2088 "name": "vim_set_current_window",2089 "return_type": "void",2090 "parameters": [2091 [2092 "Window",2093 "window"2094 ]2095 ],2096 "since": 02097 },2098 {2099 "method": False,2100 "deprecated_since": 1,2101 "name": "vim_get_tabpages",2102 "return_type": "ArrayOf(Tabpage)",2103 "parameters": [],2104 "since": 02105 },2106 {2107 "method": False,2108 "deprecated_since": 1,2109 "name": "vim_get_current_tabpage",2110 "return_type": "Tabpage",2111 "parameters": [],2112 "since": 02113 },2114 {2115 "method": False,2116 "deprecated_since": 1,2117 "name": "vim_set_current_tabpage",2118 "return_type": "void",2119 "parameters": [2120 [2121 "Tabpage",2122 "tabpage"2123 ]2124 ],2125 "since": 02126 },2127 {2128 "method": False,2129 "deprecated_since": 1,2130 "name": "vim_subscribe",2131 "return_type": "void",2132 "parameters": [2133 [2134 "String",2135 "event"2136 ]2137 ],2138 "since": 02139 },2140 {2141 "method": False,2142 "deprecated_since": 1,2143 "name": "vim_unsubscribe",2144 "return_type": "void",2145 "parameters": [2146 [2147 "String",2148 "event"2149 ]2150 ],2151 "since": 02152 },2153 {2154 "method": False,2155 "deprecated_since": 1,2156 "name": "vim_name_to_color",2157 "return_type": "Integer",2158 "parameters": [2159 [2160 "String",2161 "name"2162 ]2163 ],2164 "since": 02165 },2166 {2167 "method": False,2168 "deprecated_since": 1,2169 "name": "vim_get_color_map",2170 "return_type": "Dictionary",2171 "parameters": [],2172 "since": 02173 },2174 {2175 "method": False,2176 "deprecated_since": 1,2177 "name": "vim_get_api_info",2178 "return_type": "Array",2179 "parameters": [],2180 "since": 02181 },2182 {2183 "method": True,2184 "deprecated_since": 1,2185 "name": "window_get_buffer",2186 "return_type": "Buffer",2187 "parameters": [2188 [2189 "Window",2190 "window"2191 ]2192 ],2193 "since": 02194 },2195 {2196 "method": True,2197 "deprecated_since": 1,2198 "name": "window_get_cursor",2199 "return_type": "ArrayOf(Integer, 2)",2200 "parameters": [2201 [2202 "Window",2203 "window"2204 ]2205 ],2206 "since": 02207 },2208 {2209 "method": True,2210 "deprecated_since": 1,2211 "name": "window_set_cursor",2212 "return_type": "void",2213 "parameters": [2214 [2215 "Window",2216 "window"2217 ],2218 [2219 "ArrayOf(Integer, 2)",2220 "pos"2221 ]2222 ],2223 "since": 02224 },2225 {2226 "method": True,2227 "deprecated_since": 1,2228 "name": "window_get_height",2229 "return_type": "Integer",2230 "parameters": [2231 [2232 "Window",2233 "window"2234 ]2235 ],2236 "since": 02237 },2238 {2239 "method": True,2240 "deprecated_since": 1,2241 "name": "window_set_height",2242 "return_type": "void",2243 "parameters": [2244 [2245 "Window",2246 "window"2247 ],2248 [2249 "Integer",2250 "height"2251 ]2252 ],2253 "since": 02254 },2255 {2256 "method": True,2257 "deprecated_since": 1,2258 "name": "window_get_width",2259 "return_type": "Integer",2260 "parameters": [2261 [2262 "Window",2263 "window"2264 ]2265 ],2266 "since": 02267 },2268 {2269 "method": True,2270 "deprecated_since": 1,2271 "name": "window_set_width",2272 "return_type": "void",2273 "parameters": [2274 [2275 "Window",2276 "window"2277 ],2278 [2279 "Integer",2280 "width"2281 ]2282 ],2283 "since": 02284 },2285 {2286 "method": True,2287 "deprecated_since": 1,2288 "name": "window_get_var",2289 "return_type": "Object",2290 "parameters": [2291 [2292 "Window",2293 "window"2294 ],2295 [2296 "String",2297 "name"2298 ]2299 ],2300 "since": 02301 },2302 {2303 "method": True,2304 "deprecated_since": 1,2305 "name": "window_get_option",2306 "return_type": "Object",2307 "parameters": [2308 [2309 "Window",2310 "window"2311 ],2312 [2313 "String",2314 "name"2315 ]2316 ],2317 "since": 02318 },2319 {2320 "method": True,2321 "deprecated_since": 1,2322 "name": "window_set_option",2323 "return_type": "void",2324 "parameters": [2325 [2326 "Window",2327 "window"2328 ],2329 [2330 "String",2331 "name"2332 ],2333 [2334 "Object",2335 "value"2336 ]2337 ],2338 "since": 02339 },2340 {2341 "method": True,2342 "deprecated_since": 1,2343 "name": "window_get_position",2344 "return_type": "ArrayOf(Integer, 2)",2345 "parameters": [2346 [2347 "Window",2348 "window"2349 ]2350 ],2351 "since": 02352 },2353 {2354 "method": True,2355 "deprecated_since": 1,2356 "name": "window_get_tabpage",2357 "return_type": "Tabpage",2358 "parameters": [2359 [2360 "Window",2361 "window"2362 ]2363 ],2364 "since": 02365 },2366 {2367 "method": True,2368 "deprecated_since": 1,2369 "name": "window_is_valid",2370 "return_type": "Boolean",2371 "parameters": [2372 [2373 "Window",2374 "window"2375 ]2376 ],2377 "since": 02378 }2379 ],2380 "error_types": {2381 "Validation": {2382 "id": 12383 },2384 "Exception": {2385 "id": 02386 }2387 }...

Full Screen

Full Screen

test_boxplot_method.py

Source:test_boxplot_method.py Github

copy

Full Screen

...80 columns=['one', 'two', 'three', 'four'])81 with pytest.raises(ValueError):82 df.boxplot(return_type='NOTATYPE')83 result = df.boxplot()84 self._check_box_return_type(result, 'axes')85 with tm.assert_produces_warning(False):86 result = df.boxplot(return_type='dict')87 self._check_box_return_type(result, 'dict')88 with tm.assert_produces_warning(False):89 result = df.boxplot(return_type='axes')90 self._check_box_return_type(result, 'axes')91 with tm.assert_produces_warning(False):92 result = df.boxplot(return_type='both')93 self._check_box_return_type(result, 'both')94 @pytest.mark.slow95 def test_boxplot_axis_limits(self):96 def _check_ax_limits(col, ax):97 y_min, y_max = ax.get_ylim()98 assert y_min <= col.min()99 assert y_max >= col.max()100 df = self.hist_df.copy()101 df['age'] = np.random.randint(1, 20, df.shape[0])102 # One full row103 height_ax, weight_ax = df.boxplot(['height', 'weight'], by='category')104 _check_ax_limits(df['height'], height_ax)105 _check_ax_limits(df['weight'], weight_ax)106 assert weight_ax._sharey == height_ax107 # Two rows, one partial108 p = df.boxplot(['height', 'weight', 'age'], by='category')109 height_ax, weight_ax, age_ax = p[0, 0], p[0, 1], p[1, 0]110 dummy_ax = p[1, 1]111 _check_ax_limits(df['height'], height_ax)112 _check_ax_limits(df['weight'], weight_ax)113 _check_ax_limits(df['age'], age_ax)114 assert weight_ax._sharey == height_ax115 assert age_ax._sharey == height_ax116 assert dummy_ax._sharey is None117 @pytest.mark.slow118 def test_boxplot_empty_column(self):119 df = DataFrame(np.random.randn(20, 4))120 df.loc[:, 0] = np.nan121 _check_plot_works(df.boxplot, return_type='axes')122 @pytest.mark.slow123 def test_figsize(self):124 df = DataFrame(np.random.rand(10, 5),125 columns=['A', 'B', 'C', 'D', 'E'])126 result = df.boxplot(return_type='axes', figsize=(12, 8))127 assert result.figure.bbox_inches.width == 12128 assert result.figure.bbox_inches.height == 8129 def test_fontsize(self):130 df = DataFrame({"a": [1, 2, 3, 4, 5, 6]})131 self._check_ticks_props(df.boxplot("a", fontsize=16),132 xlabelsize=16, ylabelsize=16)133@td.skip_if_no_mpl134class TestDataFrameGroupByPlots(TestPlotBase):135 @pytest.mark.slow136 def test_boxplot_legacy1(self):137 grouped = self.hist_df.groupby(by='gender')138 with tm.assert_produces_warning(UserWarning):139 axes = _check_plot_works(grouped.boxplot, return_type='axes')140 self._check_axes_shape(list(axes.values), axes_num=2, layout=(1, 2))141 axes = _check_plot_works(grouped.boxplot, subplots=False,142 return_type='axes')143 self._check_axes_shape(axes, axes_num=1, layout=(1, 1))144 @pytest.mark.slow145 def test_boxplot_legacy2(self):146 tuples = lzip(string.ascii_letters[:10], range(10))147 df = DataFrame(np.random.rand(10, 3),148 index=MultiIndex.from_tuples(tuples))149 grouped = df.groupby(level=1)150 with tm.assert_produces_warning(UserWarning):151 axes = _check_plot_works(grouped.boxplot, return_type='axes')152 self._check_axes_shape(list(axes.values), axes_num=10, layout=(4, 3))153 axes = _check_plot_works(grouped.boxplot, subplots=False,154 return_type='axes')155 self._check_axes_shape(axes, axes_num=1, layout=(1, 1))156 @pytest.mark.slow157 def test_boxplot_legacy3(self):158 tuples = lzip(string.ascii_letters[:10], range(10))159 df = DataFrame(np.random.rand(10, 3),160 index=MultiIndex.from_tuples(tuples))161 grouped = df.unstack(level=1).groupby(level=0, axis=1)162 with tm.assert_produces_warning(UserWarning):163 axes = _check_plot_works(grouped.boxplot, return_type='axes')164 self._check_axes_shape(list(axes.values), axes_num=3, layout=(2, 2))165 axes = _check_plot_works(grouped.boxplot, subplots=False,166 return_type='axes')167 self._check_axes_shape(axes, axes_num=1, layout=(1, 1))168 @pytest.mark.slow169 def test_grouped_plot_fignums(self):170 n = 10171 weight = Series(np.random.normal(166, 20, size=n))172 height = Series(np.random.normal(60, 10, size=n))173 with tm.RNGContext(42):174 gender = np.random.choice(['male', 'female'], size=n)175 df = DataFrame({'height': height, 'weight': weight, 'gender': gender})176 gb = df.groupby('gender')177 res = gb.plot()178 assert len(self.plt.get_fignums()) == 2179 assert len(res) == 2180 tm.close()181 res = gb.boxplot(return_type='axes')182 assert len(self.plt.get_fignums()) == 1183 assert len(res) == 2184 tm.close()185 # now works with GH 5610 as gender is excluded186 res = df.groupby('gender').hist()187 tm.close()188 @pytest.mark.slow189 def test_grouped_box_return_type(self):190 df = self.hist_df191 # old style: return_type=None192 result = df.boxplot(by='gender')193 assert isinstance(result, np.ndarray)194 self._check_box_return_type(195 result, None,196 expected_keys=['height', 'weight', 'category'])197 # now for groupby198 result = df.groupby('gender').boxplot(return_type='dict')199 self._check_box_return_type(200 result, 'dict', expected_keys=['Male', 'Female'])201 columns2 = 'X B C D A G Y N Q O'.split()202 df2 = DataFrame(random.randn(50, 10), columns=columns2)203 categories2 = 'A B C D E F G H I J'.split()204 df2['category'] = categories2 * 5205 for t in ['dict', 'axes', 'both']:206 returned = df.groupby('classroom').boxplot(return_type=t)207 self._check_box_return_type(208 returned, t, expected_keys=['A', 'B', 'C'])209 returned = df.boxplot(by='classroom', return_type=t)210 self._check_box_return_type(211 returned, t,212 expected_keys=['height', 'weight', 'category'])213 returned = df2.groupby('category').boxplot(return_type=t)214 self._check_box_return_type(returned, t, expected_keys=categories2)215 returned = df2.boxplot(by='category', return_type=t)216 self._check_box_return_type(returned, t, expected_keys=columns2)217 @pytest.mark.slow218 def test_grouped_box_layout(self):219 df = self.hist_df220 pytest.raises(ValueError, df.boxplot, column=['weight', 'height'],221 by=df.gender, layout=(1, 1))222 pytest.raises(ValueError, df.boxplot,223 column=['height', 'weight', 'category'],224 layout=(2, 1), return_type='dict')225 pytest.raises(ValueError, df.boxplot, column=['weight', 'height'],226 by=df.gender, layout=(-1, -1))227 # _check_plot_works adds an ax so catch warning. see GH #13188228 with tm.assert_produces_warning(UserWarning):229 box = _check_plot_works(df.groupby('gender').boxplot,230 column='height', return_type='dict')...

Full Screen

Full Screen

utils.py

Source:utils.py Github

copy

Full Screen

1import ast2import inspect3import json4import os5import collections6def load_ast_tree(filename):7 try:8 with open(filename) as f:9 fstr = f.read()10 return ast.parse(fstr, filename=filename)11 except:12 return ast.parse("()")13def convert_ast(node, return_type='string', include_type=False, sep=':'):14 count = 115 def _flatten_dict(d, parent_key='', sep=':'):16 items = []17 for k, v in d.items():18 new_key = parent_key + sep + k if parent_key else k19 if isinstance(v, collections.MutableMapping):20 items.extend(_flatten_dict(v, new_key, sep=sep).items())21 else:22 items.append((new_key, v))23 return dict(items)24 def _flatten_list(lst):25 return sum(([x] if not isinstance(x, list) else _flatten_list(x) for x in lst), [])26 def _format(node):27 nonlocal count28 if isinstance(node, ast.AST):29 d = _flatten_dict({ key: _format(value) for key, value in ast.iter_fields(node) if key != 'ctx' and key != 'type_comment' and key != 'kind'})30 if include_type:31 d['type'] = node.__class__.__name__32 return d33 elif isinstance(node, list):34 return sep.join(_flatten_list([value for list_node in node for value in _format(list_node).values() if value]))35 return str(node)36 if not isinstance(node, ast.AST):37 raise TypeError('expected AST, got %r' % node.__class__.__name__)38 if return_type == 'string':39 return sep.join([value for value in _format(node).values() if value])40 elif return_type == 'list':41 return list(_format(node).values())42 else:43 return _format(node)44def get_calls(source, return_type='string', include_type=False):45 calls = []46 def visit_Call(node):47 calls.append(convert_ast(node, return_type, include_type))48 node_iter = ast.NodeVisitor()49 node_iter.visit_Call = visit_Call50 try:51 node_iter.visit(ast.parse(inspect.getsource(source)))52 except OSError:53 return []54 return calls55def get_assignments(source, return_type='string', include_type=False):56 assignments = []57 def visit_Assign(node):58 assignments.append(convert_ast(node, return_type, include_type))59 node_iter = ast.NodeVisitor()60 node_iter.visit_Assign = visit_Assign61 62 try:63 node_iter.visit(ast.parse(inspect.getsource(source)))64 except OSError:65 return []66 return assignments67def get_calls_from_child(child_node, return_type='string', include_type=False):68 calls = []69 def visit_Call(node):70 calls.append(convert_ast(node, return_type, include_type))71 node_iter = ast.NodeVisitor()72 node_iter.visit_Call = visit_Call73 try:74 node_iter.visit(child_node) #ast.parse(inspect.getsource(source)))75 except OSError:76 return []77 return calls78def get_returns_from_child(child_node, return_type='string', include_type=False):79 returns = []80 def visit_Return(node):81 returns.append(convert_ast(node, return_type, include_type))82 node_iter = ast.NodeVisitor()83 node_iter.visit_Return = visit_Return84 try:85 node_iter.visit(child_node) #ast.parse(inspect.getsource(source)))86 except OSError:87 return []88 return returns89def get_classes(source, return_type='string', include_type=False):90 classes = []91 def visit_ClassDef(node):92 classes.append(convert_ast(node, return_type, include_type))93 node_iter = ast.NodeVisitor()94 node_iter.visit_ClassDef = visit_ClassDef95 96 try:97 node_iter.visit(ast.parse(inspect.getsource(source)))98 except OSError:99 return []100 return classes101def get_assignments_from_child(child_node, return_type='string', include_type=False):102 assignments = []103 def visit_Assign(node):104 assignments.append(convert_ast(node, return_type, include_type))105 node_iter = ast.NodeVisitor()106 node_iter.visit_Assign = visit_Assign107 108 try:109 node_iter.visit(child_node) #ast.parse(inspect.getsource(source)))110 except OSError:111 return []112 return assignments113def get_augassignments_from_child(child_node, return_type='string', include_type=False):114 assignments = []115 def visit_AugAssign(node):116 assignments.append(convert_ast(node, return_type, include_type))117 node_iter = ast.NodeVisitor()118 node_iter.visit_AugAssign = visit_AugAssign119 120 try:121 node_iter.visit(child_node) #ast.parse(inspect.getsource(source)))122 except OSError:123 return []124 return assignments125def get_if_statements_from_child(child_node, return_type='string', include_type=False):126 ifs = []127 def visit_If(node):128 ifs.append(convert_ast(node, return_type, include_type))129 node_iter = ast.NodeVisitor()130 node_iter.visit_If = visit_If131 try:132 node_iter.visit(child_node) #ast.parse(inspect.getsource(source)))133 except OSError:134 return []135 return ifs136def get_functions(source, return_type='string', include_type=False):137 functions = []138 def visit_FunctionDef(node):139 functions.append(convert_ast(node, return_type, include_type))140 node_iter = ast.NodeVisitor()141 node_iter.visit_FunctionDef = visit_FunctionDef142 143 try:144 node_iter.visit(ast.parse(inspect.getsource(source)))145 except OSError:146 return []147 return functions148def get_if_statements(source, return_type='string', include_type=False):149 ifs = []150 def visit_If(node):151 ifs.append(convert_ast(node, return_type, include_type))152 node_iter = ast.NodeVisitor()153 node_iter.visit_If = visit_If154 try:155 node_iter.visit(ast.parse(inspect.getsource(source)))156 except OSError:157 return []158 return ifs159def get_for_loops(source, return_type='string', include_type=False):160 loops = []161 def visit_For(node):162 loops.append(convert_ast(node, return_type, include_type))163 node_iter = ast.NodeVisitor()164 node_iter.visit_For = visit_For165 try:166 node_iter.visit(ast.parse(inspect.getsource(source)))167 except OSError:168 return []169 return loops170def get_for_loops_from_child(child_node, return_type='string', include_type=False):171 loops = []172 def visit_For(node):173 loops.append(convert_ast(node, return_type, include_type))174 node_iter = ast.NodeVisitor()175 node_iter.visit_For = visit_For176 try:177 node_iter.visit(child_node) #ast.parse(inspect.getsource(source)))178 except OSError:179 return []...

Full Screen

Full Screen

index.ts

Source:index.ts Github

copy

Full Screen

1export const DATA = {2 VARIABLES: [3 {4 name: "DISTANCE",5 type: "number",6 group: "number",7 title: "Formula.Variable.description",8 },9 {10 name: "LENGHT",11 type: "number",12 group: "number",13 title: "Formula.Variable.description",14 },15 {16 name: "HEIGHT",17 type: "number",18 group: "number",19 title: "Formula.Variable.description",20 },21 {22 name: "WEIGHT",23 type: "number",24 group: "number",25 title: "Formula.Variable.description",26 },27 {28 name: "LATITUDE",29 type: "number",30 group: "number",31 title: "Formula.Variable.description",32 },33 {34 name: "REPLICAS",35 type: "number",36 group: "number",37 title: "Formula.Variable.description",38 },39 {40 name: "CODE_GENDER",41 type: "string",42 group: "string",43 title: "Formula.Variable.description",44 },45 {46 name: "AMT_ANNUITY",47 type: "number",48 group: "number",49 title: "Formula.Variable.description",50 },51 {52 name: "CNT_FAM_MEMBERS",53 type: "string",54 group: "string",55 title: "Formula.Variable.description",56 },57 ],58 OPERATORS: [59 {60 name: "and",61 return_type: "boolean",62 arguments_types: ["boolean", "boolean"],63 },64 {65 name: "or",66 return_type: "boolean",67 arguments_types: ["boolean", "boolean"],68 },69 {70 name: "+",71 return_type: "number",72 arguments_types: ["number", "number"],73 },74 {75 name: "-",76 return_type: "number",77 arguments_types: ["number", "number"],78 },79 {80 name: "*",81 return_type: "number",82 arguments_types: ["number", "number"],83 },84 {85 name: "/",86 return_type: "number",87 arguments_types: ["number", "number"],88 },89 {90 name: "<",91 return_type: "boolean",92 arguments_types: ["any", "any"],93 },94 {95 name: "<=",96 return_type: "boolean",97 arguments_types: ["any", "any"],98 },99 {100 name: "==",101 return_type: "boolean",102 arguments_types: ["any", "any"],103 },104 {105 name: "!=",106 return_type: "boolean",107 arguments_types: ["any", "any"],108 },109 {110 name: ">",111 return_type: "boolean",112 arguments_types: ["any", "any"],113 },114 {115 name: ">=",116 return_type: "boolean",117 arguments_types: ["any", "any"],118 },119 {120 name: "like",121 return_type: "boolean",122 arguments_types: ["string", "string"],123 },124 {125 name: "ilike",126 return_type: "boolean",127 arguments_types: ["string", "string"],128 },129 {130 name: "contains",131 return_type: "boolean",132 arguments_types: ["string", "string"],133 },134 ],135 FUNCTIONS: [136 {137 name: "curent_date",138 return_type: "datetime",139 arguments_types: [],140 group: "datetime",141 title: "Formula.Function.description",142 },143 {144 name: "current_time",145 return_type: "datetime",146 arguments_types: [],147 group: "datetime",148 title: "Formula.Function.description",149 },150 {151 name: "current_timestamp",152 return_type: "number",153 arguments_types: [],154 group: "number",155 title: "Formula.Function.description",156 },157 {158 name: "now",159 return_type: "datetime",160 arguments_types: [],161 group: "datetime",162 title: "Formula.Function.description",163 },164 {165 name: "concat",166 arbitrary_args: true,167 return_type: "string",168 arguments_types: ["string"],169 group: "string",170 title: "Formula.Function.description",171 },172 {173 name: "cahr_length",174 return_type: "number",175 arguments_types: ["string"],176 group: "number",177 title: "Formula.Function.description",178 },179 {180 name: "random",181 return_type: "number",182 arguments_types: [],183 group: "number",184 title: "Formula.Function.description",185 },186 {187 name: "coalesce",188 arbitrary_args: true,189 return_type: "any",190 arguments_types: ["any"],191 group: "any",192 title: "Formula.Function.description",193 },194 {195 name: "in",196 is_operator: true,197 return_type: "boolean",198 arguments_types: ["any"],199 arbitrary_args: true,200 group: "boolean",201 title: "Formula.Function.description",202 },203 {204 name: "between",205 is_operator: true,206 return_type: "boolean",207 arguments_types: ["number", "number"],208 arbitrary_args: false,209 group: "boolean",210 title: "Formula.Function.description",211 },212 {213 name: "not_in",214 is_operator: true,215 return_type: "boolean",216 arguments_types: ["any"],217 arbitrary_args: true,218 group: "boolean",219 title: "Formula.Function.description",220 },221 {222 name: "startwith",223 return_type: "boolean",224 arguments_types: ["string"],225 group: "boolean",226 title: "Formula.Function.description",227 },228 {229 name: "endwith",230 return_type: "boolean",231 arguments_types: ["string"],232 group: "boolean",233 title: "Formula.Function.description",234 },235 {236 name: "not",237 return_type: "boolean",238 arguments_types: ["boolean"],239 group: "boolean",240 title: "Formula.Function.description",241 },242 {243 name: "power",244 return_type: "number",245 arguments_types: ["number", "number"],246 group: "number",247 title: "Formula.Function.description",248 },249 {250 name: "ln",251 return_type: "number",252 arguments_types: ["number"],253 group: "number",254 title: "Formula.Function.description",255 },256 {257 name: "exp",258 return_type: "number",259 arguments_types: ["number"],260 group: "number",261 title: "Formula.Function.description",262 },263 {264 name: "sqrt",265 return_type: "number",266 arguments_types: ["number"],267 group: "number",268 title: "Formula.Function.description",269 },270 {271 name: "abs",272 return_type: "number",273 arguments_types: ["number"],274 group: "number",275 title: "Formula.Function.description",276 },277 {278 name: "ceil",279 return_type: "number",280 arguments_types: ["number"],281 group: "number",282 title: "Formula.Function.description",283 },284 {285 name: "floor",286 return_type: "number",287 arguments_types: ["number"],288 group: "number",289 title: "Formula.Function.description",290 },291 ],...

Full Screen

Full Screen

app.js

Source:app.js Github

copy

Full Screen

1/**2 * Click to Chat - new interface3 */4var url = window.location.href;5// post title6var post_title = ht_ctc_var.post_title;7// is_mobile yes/no8var is_mobile = ht_ctc_var.is_mobile;9/**10 * click 11 */12ht_ctc_click_event();13function ht_ctc_click_event() {14 // chat15 var ht_ctc_chat = document.querySelectorAll('.ht-ctc-chat');16 if (ht_ctc_chat) {17 for(var i = 0; i < ht_ctc_chat.length; i++)18 {19 ht_ctc_chat[i].addEventListener('click', ht_ctc_clicked_chat );20 }21 }22 23 // share24 var ht_ctc_share = document.querySelectorAll('.ht-ctc-share');25 if (ht_ctc_share) {26 for(var i = 0; i < ht_ctc_share.length; i++)27 {28 ht_ctc_share[i].addEventListener('click', ht_ctc_clicked_share );29 }30 }31 // group32 var ht_ctc_group = document.querySelectorAll('.ht-ctc-group');33 if (ht_ctc_group) {34 for(var i = 0; i < ht_ctc_group.length; i++)35 {36 ht_ctc_group[i].addEventListener('click', ht_ctc_clicked_group );37 }38 }39 // var woo = document.querySelector('.ht-ctc-chat-woo');40 // if (woo) {41 // woo.addEventListener('click', ht_click_clicked);42 // }43}44// return_type45function ht_ctc_clicked_chat() {46 ht_ctc_clicked('chat');47}48function ht_ctc_clicked_share() {49 ht_ctc_clicked('share');50}51function ht_ctc_clicked_group() {52 ht_ctc_clicked('group');53}54// clicked55function ht_ctc_clicked( return_type ) {56 // link57 ht_ctc_link( return_type );58 // analytics59 ht_ctc_analytics( return_type );60}61// link62function ht_ctc_link( return_type ) {63 var base_link = '';64 if (is_mobile == 'yes') {65 // mobile, tab devices66 67 if (return_type == 'group') {68 // group69 var base_link = 'https://chat.whatsapp.com/';70 } else if (return_type == 'share') {71 // share72 var base_link = 'https://api.whatsapp.com/send';73 } else {74 // chat75 // new way added direclty - window.open - using wa.me link76 var base_link = 'https://api.whatsapp.com/send';77 }78 } else {79 // desktop devices80 81 if (return_type == 'group') {82 // group83 var base_link = 'https://chat.whatsapp.com/';84 } else if (return_type == 'share') {85 // share86 var base_link = 'https://web.whatsapp.com/send';87 } else {88 // chat89 // new way added direclty - window.open - using wa.me link90 var base_link = 'https://web.whatsapp.com/send';91 }92 }93 // var width = '10000';94 // var height = '1000';95 // var three = 'noopener';96 // var blank = '';97 // if ( 1 == 10 ) {98 // // height, width99 // var three = 'width='+width+',height='+height;100 // } else if ( 1 == 1 ) {101 // // blank102 // var blank = "_blank";103 // if ( 1 == 1 ) {104 // // noopener105 // var noopener = "noopener";106 // }107 // }108 // link109 if (return_type == 'group') {110 // group111 var group_id = ht_ctc_var_group.group_id;112 window.open(base_link + group_id, '_blank', 'noopener');113 } else if (return_type == 'share') {114 // share115 var share_text = ht_ctc_var_share.share_text;116 window.open(base_link + '?text=' + share_text, '_blank', 'noopener');117 } else {118 // chat119 var number = ht_ctc_var_chat.number;120 var pre_filled = ht_ctc_var_chat.pre_filled;121 // web/api.whastapp or wa.me122 if ( '1' == ht_ctc_var_chat.webandapi ) {123 // i.e. if web.whatsapp / api.whatsapp is checked124 window.open(base_link + '?phone=' + number + '&text=' + pre_filled, '_blank', 'noopener');125 } else {126 // new way - wa.me link127 var base_link = 'https://wa.me/';128 window.open(base_link + number + '?text=' + pre_filled, '_blank', 'noopener');129 }130 131 }132}133// shortcode link134// know issue - if in link "" are used the link my not work properly.. (prefilled message)135function ht_ctc_shortcode_click(link) {136 data_link = link.getAttribute("data-ctc-link");137 window.open(data_link, '_blank', 'noopener');138 return_type = link.getAttribute("data-ctc-type");139 ht_ctc_analytics( return_type );140}141// Analytics142function ht_ctc_analytics( return_type ){143 // Google Analytics144 var is_ga_enable = ht_ctc_var.is_ga_enable;145 if ( 'yes' == is_ga_enable ) {146 ht_ctc_ga( return_type );147 }148 // FB Analytics149 var is_fb_an_enable = ht_ctc_var.is_fb_an_enable;150 if ( 'yes' == is_fb_an_enable ) {151 ht_ctc_fb_an( return_type );152 }153}154// Google Analytics155function ht_ctc_ga( return_type ) {156 var ga_category = 'Click to Chat for WhatsApp';157 var ga_action = 'return type: ' + return_type ;158 var ga_label = post_title + ', ' + url ;159 // // ga('send', 'event', 'Contact', 'Call Now Button', 'Phone');160 if ("ga" in window) {161 // if ( ga.window && ga.create) {162 tracker = ga.getAll()[0];163 if (tracker) tracker.send("event", ga_category, ga_action, ga_label );164 } else if ("gtag" in window) {165 gtag('event', ga_action, {166 'event_category': ga_category,167 'event_label': ga_label,168 });169 }170}171// FB Analytics172function ht_ctc_fb_an( return_type ) {173 174 var fb_event_name = 'Click to Chat for WhatsApp';175 var params = {};176 params['Category'] = 'Click to Chat for WhatsApp';177 params['Action'] = 'return type: ' + return_type;178 params['Label'] = post_title + ', ' + url ;179 // if fb analytics is not installed, then uncheck fb analytics option from main plugin settings180 FB.AppEvents.logEvent( fb_event_name, null, params);...

Full Screen

Full Screen

Func.py

Source:Func.py Github

copy

Full Screen

1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood2# Copyright (c) 2009 The Hewlett-Packard Development Company3# All rights reserved.4#5# Redistribution and use in source and binary forms, with or without6# modification, are permitted provided that the following conditions are7# met: redistributions of source code must retain the above copyright8# notice, this list of conditions and the following disclaimer;9# redistributions in binary form must reproduce the above copyright10# notice, this list of conditions and the following disclaimer in the11# documentation and/or other materials provided with the distribution;12# neither the name of the copyright holders nor the names of its13# contributors may be used to endorse or promote products derived from14# this software without specific prior written permission.15#16# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS17# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT18# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR19# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT20# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT22# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.27from slicc.symbols.Symbol import Symbol28from slicc.symbols.Type import Type29class Func(Symbol):30 def __init__(self, table, ident, name, location, return_type, param_types,31 param_strings, body, pairs):32 super(Func, self).__init__(table, ident, location, pairs)33 self.return_type = return_type34 self.param_types = param_types35 self.param_strings = param_strings36 self.body = body37 self.isInternalMachineFunc = False38 self.c_ident = ident39 self.c_name = name40 self.class_name = ""41 def __repr__(self):42 return ""43 @property44 def prototype(self):45 if "external" in self:46 return ""47 return_type = self.return_type.c_ident48 void_type = self.symtab.find("void", Type)49 if "return_by_ref" in self and self.return_type != void_type:50 return_type += "&"51 elif "return_by_pointer" in self and self.return_type != void_type:52 return_type += "*"53 return "%s %s(%s);" % (return_type, self.c_name,54 ", ".join(self.param_strings))55 def writeCodeFiles(self, path, includes):56 return57 def checkArguments(self, args):58 if len(args) != len(self.param_types):59 self.error("Wrong number of arguments passed to function : '%s'" +\60 " Expected %d, got %d", self.c_ident,61 len(self.param_types), len(args))62 cvec = []63 type_vec = []64 for expr,expected_type in zip(args, self.param_types):65 # Check the types of the parameter66 actual_type,param_code = expr.inline(True)67 if str(actual_type) != 'OOD' and \68 str(actual_type) != str(expected_type) and \69 str(actual_type["interface"]) != str(expected_type):70 expr.error("Type mismatch: expected: %s actual: %s" % \71 (expected_type, actual_type))72 cvec.append(param_code)73 type_vec.append(expected_type)74 return cvec, type_vec75 def generateCode(self):76 '''This write a function of object Chip'''77 if "external" in self:78 return ""79 code = self.symtab.codeFormatter()80 # Generate function header81 void_type = self.symtab.find("void", Type)82 return_type = self.return_type.c_ident83 if "return_by_ref" in self and self.return_type != void_type:84 return_type += "&"85 if "return_by_pointer" in self and self.return_type != void_type:86 return_type += "*"87 params = ', '.join(self.param_strings)88 code('''89$return_type90${{self.class_name}}::${{self.c_name}}($params)91{92${{self.body}}93}94''')95 return str(code)...

Full Screen

Full Screen

batch_retrieval.ts

Source:batch_retrieval.ts Github

copy

Full Screen

1import {2 Deferred,3 collectInListAndSchedule,4 nextTick,5} from 'scrivito_sdk/common';6type Mget<KEY_TYPE, RETURN_TYPE> = (keys: KEY_TYPE[]) => Promise<RETURN_TYPE[]>;7interface Item<KEY_TYPE, RETURN_TYPE> {8 key: KEY_TYPE;9 deferred: Deferred<RETURN_TYPE>;10}11export class BatchRetrieval<KEY_TYPE, RETURN_TYPE> {12 private mget: Mget<KEY_TYPE, RETURN_TYPE>;13 private batchSize: number;14 constructor(15 mget: Mget<KEY_TYPE, RETURN_TYPE>,16 { batchSize }: { batchSize?: number } = {}17 ) {18 this.mget = mget;19 this.batchSize = batchSize || 100;20 }21 retrieve(key: KEY_TYPE): Promise<RETURN_TYPE> {22 const deferred = new Deferred<RETURN_TYPE>();23 this.scheduleItem({ key, deferred });24 return deferred.promise;25 }26 private scheduleItem = collectInListAndSchedule<Item<KEY_TYPE, RETURN_TYPE>>(27 nextTick,28 (items: Item<KEY_TYPE, RETURN_TYPE>[]) => {29 const nextBatch = items.splice(0, this.batchSize);30 const keys = nextBatch.map((item) => item.key);31 this.mget(keys).then(32 (results) => {33 nextBatch.forEach(({ key, deferred }, index) => {34 if (index < results.length) {35 const result = results[index];36 deferred.resolve(result);37 } else {38 this.retrieve(key).then(deferred.resolve, deferred.reject);39 }40 });41 },42 (error) => {43 nextBatch.forEach((item) => item.deferred.reject(error));44 }45 );46 return items;47 }48 );...

Full Screen

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.getLocations(function(err, data) {4 if (err) return console.error(err);5 console.log(data);6});7wpt.getTesters(function(err, data) {8 if (err) return console.error(err);9 console.log(data);10});11wpt.getTesters(function(err, data) {12 if (err) return console.error(err);13 console.log(data);14});15wpt.getTesters(function(err, data) {16 if (err) return console.error(err);17 console.log(data);18});19wpt.getTesters(function(err, data) {20 if (err) return console.error(err);21 console.log(data);22});23wpt.getTesters(function(err, data) {24 if (err) return console.error(err);25 console.log(data);26});27wpt.getTesters(function(err, data) {28 if (err) return console.error(err);29 console.log(data);30});31wpt.getTesters(function(err, data) {32 if (err) return console.error(err);33 console.log(data);34});35wpt.getTesters(function(err, data) {36 if (err) return console.error(err);37 console.log(data);38});39wpt.getTesters(function(err, data) {40 if (err) return console.error(err);41 console.log(data);42});43wpt.getTesters(function(err, data) {44 if (err) return console.error(err);45 console.log(data);46});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 wpt.getTestResults(data.data.testId, function(err, data) {5 if (err) return console.error(err);6 console.log(data);7 });8});9#### wpt.getTestResults(testId, callback)10var wpt = require('webpagetest');11var wpt = new WebPageTest('www.webpagetest.org');12 if (err) return console.error(err);13 wpt.getTestResults(data.data.testId, function(err, data) {14 if (err) return console.error(err);15 console.log(data);16 });17});18#### wpt.getLocations(callback)19var wpt = require('webpagetest');20var wpt = new WebPageTest('www.webpagetest.org');21wpt.getLocations(function(err, data) {22 if (err) return console.error(err);23 console.log(data);24});25#### wpt.getTesters(callback)

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 console.log('Test submitted to WebPageTest! Check results at %s', data.data.userUrl);5 wpt.getTestResults(data.data.testId, function(err, data) {6 if (err) return console.error(err);7 console.log('Test for %s finished. First View Speed Index: %d', data.data.url, data.data.average.firstView.SpeedIndex);8 });9});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 wpt.getTestResults(data.data.testId, function(err, data) {5 if (err) return console.error(err);6 console.log(data.data.median.firstView.SpeedIndex);7 });8});9var wpt = require('webpagetest');10var wpt = new WebPageTest('www.webpagetest.org');11wpt.getLocations(function(err, data) {12 if (err) return console.error(err);13 console.log(data);14});15var wpt = require('webpagetest');16var wpt = new WebPageTest('www.webpagetest.org');17wpt.getLocations(function(err, data) {18 if (err) return console.error(err);19 console.log(data);20});21var wpt = require('webpagetest');22var wpt = new WebPageTest('www.webpagetest.org');23wpt.getTesters(function(err, data) {24 if (err) return console.error(err);25 console.log(data);26});27var wpt = require('webpagetest');28var wpt = new WebPageTest('www.webpagetest.org');29wpt.getTestStatus(testId, function(err, data) {30 if (err) return console.error(err);31 console.log(data);32});33var wpt = require('webpagetest');34var wpt = new WebPageTest('www.webpagetest.org');35wpt.getTestResults(testId, function(err, data) {36 if (err) return console.error(err);37 console.log(data);

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3wpt.getLocations(function(err, locations) {4 if (err) {5 console.log(err);6 } else {7 console.log(locations);8 }9});10var wpt = require('webpagetest');11var wpt = new WebPageTest('www.webpagetest.org');12wpt.getLocations(function(err, locations) {13 if (err) {14 console.log(err);15 } else {16 console.log(locations);17 }18});19var wpt = require('webpagetest');20var wpt = new WebPageTest('www.webpagetest.org');21 if (err) {22 console.log(err);23 } else {24 console.log(data);25 }26});27var wpt = require('webpagetest');28var wpt = new WebPageTest('www.webpagetest.org');29 if (err) {30 console.log(err);31 } else {32 console.log(data);33 }34});35var wpt = require('webpagetest');36var wpt = new WebPageTest('www.webpagetest.org');37wpt.getTestStatus('140607_

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.log(err);4 wpt.getTestResults(data.data.testId, function(err, data) {5 if (err) return console.log(err);6 console.log(data.data.median.firstView);7 });8});

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var wpt = new WebPageTest('www.webpagetest.org');3 if (err) return console.error(err);4 console.log(data);5});6 if (err) return console.error(err);7 console.log(data);8});9 if (err) return console.error(err);10 console.log(data);11});12var wpt = require('webpagetest');13var wpt = new WebPageTest('www.webpagetest.org');14 if (err) return console.error(err);15 console.log(data);16});17var wpt = require('webpagetest');18var wpt = new WebPageTest('www.webpagetest.org');19 if (err) return console.error(err);20 console.log(data);21});22var wpt = require('webpagetest');23var wpt = new WebPageTest('www.webpagetest.org');24 if (err) return console.error(err);

Full Screen

Using AI Code Generation

copy

Full Screen

1const wptools = require('wptools');2wptools.page('Albert Einstein').then(page => page.return_type('wikitext').get()).then(data => {3 console.log(data);4});5const wptools = require('wptools');6wptools.page('Albert Einstein').then(page => page.return_type('wikitext').get()).then(data => {7 console.log(data);8});9const wptools = require('wptools');10wptools.page('Albert Einstein').then(page => page.return_type('wikitext').get()).then(data => {11 console.log(data);12});13const wptools = require('wptools');14wptools.page('Albert Einstein').then(page => page.return_type('wikitext').get()).then(data => {15 console.log(data);16});17const wptools = require('wptools');18wptools.page('Albert Einstein').then(page => page.return_type('wikitext').get()).then(data => {19 console.log(data);20});21const wptools = require('wptools');22wptools.page('Albert Einstein').then(page => page.return_type('wikitext').get()).then(data => {23 console.log(data);24});25const wptools = require('wptools');26wptools.page('Albert Einstein').then(page => page.return_type('wikitext').get()).then(data => {27 console.log(data);28});29const wptools = require('wptools');

Full Screen

Using AI Code Generation

copy

Full Screen

1var wpt = require('webpagetest');2var options = {3};4var test = new wpt('www.webpagetest.org', options);5 if (err) return console.log(err);6 console.log(data);7 test.getTestResults(data.data.testId, function(err, data) {8 if (err) return console.log(err);9 console.log(data);10 });11});

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run wpt automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful