VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/packer/pack_header.py@ 71007

最後變更 在這個檔案從71007是 69392,由 vboxsync 提交於 7 年 前

GuestHost/OpenGL: scm updates

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id Revision
檔案大小: 2.7 KB
 
1# Copyright (c) 2001, Stanford University
2# All rights reserved.
3#
4# See the file LICENSE.txt for information on redistributing this software.
5
6# This script generates the cr/include/cr_packfunctions.h file from the
7# gl_header.parsed file.
8
9from __future__ import print_function
10import sys
11import string
12
13import apiutil
14
15
16apiutil.CopyrightC()
17
18print("""#ifndef CR_PACKFUNCTIONS_H
19#define CR_PACKFUNCTIONS_H
20
21/* DO NOT EDIT - THIS FILE GENERATED BY THE pack_header.py SCRIPT */
22
23/* Prototypes for the OpenGL packer functions in packer.c and pack_bbox.c */
24
25#include "chromium.h"
26#include "state/cr_client.h"
27#include "cr_pack.h"
28
29#ifdef WINDOWS
30#define PACK_APIENTRY __stdcall
31#else
32#define PACK_APIENTRY
33#endif
34
35#ifdef __cplusplus
36extern "C" {
37#endif
38""")
39
40keys = apiutil.GetDispatchedFunctions(sys.argv[1]+"/APIspec.txt")
41
42
43for func_name in keys:
44 if ("pack" in apiutil.ChromiumProps(func_name) or
45 "extpack" in apiutil.ChromiumProps(func_name) or
46 apiutil.NonVectorFunction(func_name) != '' or
47 apiutil.FindSpecial('packer', func_name)):
48
49 # OK, generate a crPackFooBar() prototype for this function
50 return_type = apiutil.ReturnType(func_name)
51 args = apiutil.Parameters(func_name)
52 if return_type != 'void':
53 if apiutil.IsPointer(return_type):
54 args.append(("return_value", return_type, 0))
55 else:
56 args.append(("return_value", return_type + "*", 0))
57 elif "pixelstore" in apiutil.Properties(func_name):
58 args.append(("packstate", "const CRPixelPackState *", 0))
59
60 if "get" in apiutil.Properties(func_name):
61 args.append(("writeback", "int *", 0))
62
63 print('void PACK_APIENTRY crPack%s(%s);' % (func_name, apiutil.MakeDeclarationStringWithContext('CR_PACKER_CONTEXT', args)))
64 print('void PACK_APIENTRY crPack%sSWAP(%s);' % (func_name, apiutil.MakeDeclarationStringWithContext('CR_PACKER_CONTEXT', args)))
65
66
67
68# Now generate special BBOX, COUNT, SWAP variations on the glVertex and
69# glVertexAttrib functions.
70for func_name in keys:
71 if (func_name[0:6] == "Vertex" and
72 "pervertex" in apiutil.Properties(func_name) and
73 ("pack" in apiutil.ChromiumProps(func_name) or
74 apiutil.NonVectorFunction(func_name) != '')):
75
76 assert apiutil.ReturnType(func_name) == "void"
77
78 args = apiutil.Parameters(func_name)
79 print('void PACK_APIENTRY crPack%sBBOX(%s);' % (func_name, apiutil.MakeDeclarationString(args)))
80 print('void PACK_APIENTRY crPack%sBBOX_COUNT(%s);' % (func_name, apiutil.MakeDeclarationString(args)))
81 print('void PACK_APIENTRY crPack%sBBOXSWAP(%s);' % (func_name, apiutil.MakeDeclarationString(args)))
82 print('void PACK_APIENTRY crPack%sBBOX_COUNTSWAP(%s);' % (func_name, apiutil.MakeDeclarationString(args)))
83
84
85print("""
86#ifdef __cplusplus
87}
88#endif
89
90#endif /* CR_PACKFUNCTIONS_H */
91""")
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette