From: José Fonseca Date: Fri, 29 Apr 2011 09:08:13 +0000 (+0100) Subject: Recognize more D3D9 enums/flags. X-Git-Tag: 2.0_alpha^2~979 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1fa566d54487d9c14477fd9aeac44833087b2ded;p=tools%2Fapitrace.git Recognize more D3D9 enums/flags. --- diff --git a/d3d9.py b/d3d9.py index 6db9536..2f8f142 100644 --- a/d3d9.py +++ b/d3d9.py @@ -32,6 +32,52 @@ from trace import DllTracer D3DSHADER9 = Opaque("const DWORD *") +D3DSPD = Flags(DWORD, [ + "D3DSPD_IUNKNOWN", +]) + +D3DCREATE = Flags(DWORD, [ + "D3DCREATE_FPU_PRESERVE", + "D3DCREATE_MULTITHREADED", + "D3DCREATE_PUREDEVICE", + "D3DCREATE_SOFTWARE_VERTEXPROCESSING", + "D3DCREATE_HARDWARE_VERTEXPROCESSING", + "D3DCREATE_MIXED_VERTEXPROCESSING", + "D3DCREATE_DISABLE_DRIVER_MANAGEMENT", + "D3DCREATE_ADAPTERGROUP_DEVICE", + "D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX", + "D3DCREATE_NOWINDOWCHANGES", + "D3DCREATE_DISABLE_PSGP_THREADING", + "D3DCREATE_ENABLE_PRESENTSTATS", + "D3DCREATE_DISABLE_PRINTSCREEN", + "D3DCREATE_SCREENSAVER", +]) + +D3DADAPTER = FakeEnum(DWORD, [ + "D3DADAPTER_DEFAULT", +]) + +D3DENUM = FakeEnum(DWORD, [ + "D3DENUM_WHQL_LEVEL", +]) + +D3DSGR = Flags(DWORD, [ + "D3DSGR_NO_CALIBRATION", + "D3DSGR_CALIBRATE", +]) + +D3DCURSOR = Flags(DWORD, [ + "D3DCURSOR_IMMEDIATE_UPDATE", +]) + +D3DPRESENT = Flags(DWORD, [ + "D3DPRESENT_DONOTWAIT", + "D3DPRESENT_LINEAR_CONTENT", + "D3DPRESENT_DONOTFLIP", + "D3DPRESENT_FLIPRESTART", + "D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR", +]) + HRESULT = Enum("HRESULT", [ "D3D_OK", "D3DERR_WRONGTEXTUREFORMAT", @@ -110,7 +156,7 @@ PDIRECT3DSWAPCHAIN9EX = WrapPointer(IDirect3DSwapChain9Ex) IDirect3D9.methods += [ Method(HRESULT, "RegisterSoftwareDevice", [(OpaquePointer(Void), "pInitializeFunction")]), Method(UINT, "GetAdapterCount", []), - Method(HRESULT, "GetAdapterIdentifier", [(UINT, "Adapter"), (DWORD, "Flags"), Out(Pointer(D3DADAPTER_IDENTIFIER9), "pIdentifier")]), + Method(HRESULT, "GetAdapterIdentifier", [(UINT, "Adapter"), (D3DENUM, "Flags"), Out(Pointer(D3DADAPTER_IDENTIFIER9), "pIdentifier")]), Method(UINT, "GetAdapterModeCount", [(UINT, "Adapter"), (D3DFORMAT, "Format")]), Method(HRESULT, "EnumAdapterModes", [(UINT, "Adapter"), (D3DFORMAT, "Format"), (UINT, "Mode"), Out(Pointer(D3DDISPLAYMODE), "pMode")]), Method(HRESULT, "GetAdapterDisplayMode", [(UINT, "Adapter"), Out(Pointer(D3DDISPLAYMODE), "pMode")]), @@ -121,7 +167,7 @@ IDirect3D9.methods += [ Method(HRESULT, "CheckDeviceFormatConversion", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (D3DFORMAT, "SourceFormat"), (D3DFORMAT, "TargetFormat")]), Method(HRESULT, "GetDeviceCaps", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), Out(Pointer(D3DCAPS9), "pCaps")]), Method(HMONITOR, "GetAdapterMonitor", [(UINT, "Adapter")]), - Method(HRESULT, "CreateDevice", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (DWORD, "BehaviorFlags"), Out(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(PDIRECT3DDEVICE9), "ppReturnedDeviceInterface")]), + Method(HRESULT, "CreateDevice", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (D3DCREATE, "BehaviorFlags"), Out(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(PDIRECT3DDEVICE9), "ppReturnedDeviceInterface")]), ] IDirect3DDevice9.methods += [ @@ -133,7 +179,7 @@ IDirect3DDevice9.methods += [ Method(HRESULT, "GetDisplayMode", [(UINT, "iSwapChain"), Out(Pointer(D3DDISPLAYMODE), "pMode")]), Method(HRESULT, "GetCreationParameters", [Out(Pointer(D3DDEVICE_CREATION_PARAMETERS), "pParameters")]), Method(HRESULT, "SetCursorProperties", [(UINT, "XHotSpot"), (UINT, "YHotSpot"), (PDIRECT3DSURFACE9, "pCursorBitmap")]), - Method(Void, "SetCursorPosition", [(Int, "X"), (Int, "Y"), (DWORD, "Flags")]), + Method(Void, "SetCursorPosition", [(Int, "X"), (Int, "Y"), (D3DCURSOR, "Flags")]), Method(BOOL, "ShowCursor", [(BOOL, "bShow")]), Method(HRESULT, "CreateAdditionalSwapChain", [Out(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(PDIRECT3DSWAPCHAIN9), "pSwapChain")]), Method(HRESULT, "GetSwapChain", [(UINT, "iSwapChain"), Out(Pointer(PDIRECT3DSWAPCHAIN9), "pSwapChain")]), @@ -143,7 +189,7 @@ IDirect3DDevice9.methods += [ Method(HRESULT, "GetBackBuffer", [(UINT, "iSwapChain"), (UINT, "iBackBuffer"), (D3DBACKBUFFER_TYPE, "Type"), Out(Pointer(PDIRECT3DSURFACE9), "ppBackBuffer")]), Method(HRESULT, "GetRasterStatus", [(UINT, "iSwapChain"), Out(Pointer(D3DRASTER_STATUS), "pRasterStatus")]), Method(HRESULT, "SetDialogBoxMode", [(BOOL, "bEnableDialogs")]), - Method(Void, "SetGammaRamp", [(UINT, "iSwapChain"), (DWORD, "Flags"), (ConstPointer(D3DGAMMARAMP), "pRamp")]), + Method(Void, "SetGammaRamp", [(UINT, "iSwapChain"), (D3DSGR, "Flags"), (ConstPointer(D3DGAMMARAMP), "pRamp")]), Method(Void, "GetGammaRamp", [(UINT, "iSwapChain"), Out(Pointer(D3DGAMMARAMP), "pRamp")]), Method(HRESULT, "CreateTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Levels"), (D3DUSAGE, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DTEXTURE9), "ppTexture"), Out(Pointer(HANDLE), "pSharedHandle")]), Method(HRESULT, "CreateVolumeTexture", [(UINT, "Width"), (UINT, "Height"), (UINT, "Depth"), (UINT, "Levels"), (D3DUSAGE, "Usage"), (D3DFORMAT, "Format"), (D3DPOOL, "Pool"), Out(Pointer(PDIRECT3DVOLUMETEXTURE9), "ppVolumeTexture"), Out(Pointer(HANDLE), "pSharedHandle")]), @@ -207,7 +253,7 @@ IDirect3DDevice9.methods += [ Method(HRESULT, "DrawIndexedPrimitive", [(D3DPRIMITIVETYPE, "PrimitiveType"), (INT, "BaseVertexIndex"), (UINT, "MinVertexIndex"), (UINT, "NumVertices"), (UINT, "startIndex"), (UINT, "primCount")]), Method(HRESULT, "DrawPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "PrimitiveCount"), (OpaquePointer(Const(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]), Method(HRESULT, "DrawIndexedPrimitiveUP", [(D3DPRIMITIVETYPE, "PrimitiveType"), (UINT, "MinVertexIndex"), (UINT, "NumVertices"), (UINT, "PrimitiveCount"), (OpaquePointer(Const(Void)), "pIndexData"), (D3DFORMAT, "IndexDataFormat"), (OpaquePointer(Const(Void)), "pVertexStreamZeroData"), (UINT, "VertexStreamZeroStride")]), - Method(HRESULT, "ProcessVertices", [(UINT, "SrcStartIndex"), (UINT, "DestIndex"), (UINT, "VertexCount"), (PDIRECT3DVERTEXBUFFER9, "pDestBuffer"), (PDIRECT3DVERTEXDECLARATION9, "pVertexDecl"), (DWORD, "Flags")]), + Method(HRESULT, "ProcessVertices", [(UINT, "SrcStartIndex"), (UINT, "DestIndex"), (UINT, "VertexCount"), (PDIRECT3DVERTEXBUFFER9, "pDestBuffer"), (PDIRECT3DVERTEXDECLARATION9, "pVertexDecl"), (D3DPV, "Flags")]), Method(HRESULT, "CreateVertexDeclaration", [(ConstPointer(D3DVERTEXELEMENT9), "pVertexElements"), Out(Pointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]), Method(HRESULT, "SetVertexDeclaration", [(PDIRECT3DVERTEXDECLARATION9, "pDecl")]), Method(HRESULT, "GetVertexDeclaration", [Out(Pointer(PDIRECT3DVERTEXDECLARATION9), "ppDecl")]), @@ -261,11 +307,11 @@ IDirect3DSwapChain9.methods += [ IDirect3DResource9.methods += [ Method(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), - Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (OpaquePointer(Const(Void)), "pData"), (DWORD, "SizeOfData"), (DWORD, "Flags")]), + Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (OpaquePointer(Const(Void)), "pData"), (DWORD, "SizeOfData"), (D3DSPD, "Flags")]), Method(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), Out(OpaquePointer(Void), "pData"), Out(Pointer(DWORD), "pSizeOfData")]), Method(HRESULT, "FreePrivateData", [(REFGUID, "refguid")]), - Method(DWORD, "SetPriority", [(DWORD, "PriorityNew")]), - Method(DWORD, "GetPriority", []), + Method(D3D9_RESOURCE_PRIORITY, "SetPriority", [(D3D9_RESOURCE_PRIORITY, "PriorityNew")]), + Method(D3D9_RESOURCE_PRIORITY, "GetPriority", []), Method(Void, "PreLoad", []), Method(D3DRESOURCETYPE, "GetType", []), ] @@ -341,7 +387,7 @@ IDirect3DSurface9.methods += [ IDirect3DVolume9.methods += [ Method(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), - Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (OpaquePointer(Const(Void)), "pData"), (DWORD, "SizeOfData"), (DWORD, "Flags")]), + Method(HRESULT, "SetPrivateData", [(REFGUID, "refguid"), (OpaquePointer(Const(Void)), "pData"), (DWORD, "SizeOfData"), (D3DSPD, "Flags")]), Method(HRESULT, "GetPrivateData", [(REFGUID, "refguid"), Out(OpaquePointer(Void), "pData"), Out(Pointer(DWORD), "pSizeOfData")]), Method(HRESULT, "FreePrivateData", [(REFGUID, "refguid")]), Method(HRESULT, "GetContainer", [(REFIID, "riid"), Out(Pointer(OpaquePointer(Void)), "ppContainer")]), @@ -354,22 +400,22 @@ IDirect3DQuery9.methods += [ Method(HRESULT, "GetDevice", [Out(Pointer(PDIRECT3DDEVICE9), "ppDevice")]), Method(D3DQUERYTYPE, "GetType", []), Method(DWORD, "GetDataSize", []), - Method(HRESULT, "Issue", [(DWORD, "dwIssueFlags")]), - Method(HRESULT, "GetData", [Out(OpaquePointer(Void), "pData"), (DWORD, "dwSize"), (DWORD, "dwGetDataFlags")]), + Method(HRESULT, "Issue", [(D3DISSUE, "dwIssueFlags")]), + Method(HRESULT, "GetData", [Out(OpaquePointer(Void), "pData"), (DWORD, "dwSize"), (D3DGETDATA, "dwGetDataFlags")]), ] IDirect3D9Ex.methods += [ Method(UINT, "GetAdapterModeCountEx", [(UINT, "Adapter"), (ConstPointer(D3DDISPLAYMODEFILTER), "pFilter") ]), Method(HRESULT, "EnumAdapterModesEx", [(UINT, "Adapter"), (ConstPointer(D3DDISPLAYMODEFILTER), "pFilter"), (UINT, "Mode"), Out(Pointer(D3DDISPLAYMODEEX), "pMode")]), Method(HRESULT, "GetAdapterDisplayModeEx", [(UINT, "Adapter"), Out(Pointer(D3DDISPLAYMODEEX), "pMode"), Out(Pointer(D3DDISPLAYROTATION), "pRotation")]), - Method(HRESULT, "CreateDeviceEx", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (DWORD, "BehaviorFlags"), Out(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(D3DDISPLAYMODEEX), "pFullscreenDisplayMode"), Out(Pointer(PDIRECT3DDEVICE9EX), "ppReturnedDeviceInterface")]), + Method(HRESULT, "CreateDeviceEx", [(UINT, "Adapter"), (D3DDEVTYPE, "DeviceType"), (HWND, "hFocusWindow"), (D3DCREATE, "BehaviorFlags"), Out(Pointer(D3DPRESENT_PARAMETERS), "pPresentationParameters"), Out(Pointer(D3DDISPLAYMODEEX), "pFullscreenDisplayMode"), Out(Pointer(PDIRECT3DDEVICE9EX), "ppReturnedDeviceInterface")]), Method(HRESULT, "GetAdapterLUID", [(UINT, "Adapter"), Out(Pointer(LUID), "pLUID")]), ] IDirect3DDevice9Ex.methods += [ Method(HRESULT, "SetConvolutionMonoKernel", [(UINT, "width"), (UINT, "height"), (Array(Float, "width"), "rows"), (Array(Float, "height"), "columns")]), Method(HRESULT, "ComposeRects", [(PDIRECT3DSURFACE9, "pSrc"), (PDIRECT3DSURFACE9, "pDst"), (PDIRECT3DVERTEXBUFFER9, "pSrcRectDescs"), (UINT, "NumRects"), (PDIRECT3DVERTEXBUFFER9, "pDstRectDescs"), (D3DCOMPOSERECTSOP, "Operation"), (Int, "Xoffset"), (Int, "Yoffset")]), - Method(HRESULT, "PresentEx", [(ConstPointer(RECT), "pSourceRect"), (ConstPointer(RECT), "pDestRect"), (HWND, "hDestWindowOverride"), (ConstPointer(RGNDATA), "pDirtyRegion"), (DWORD, "dwFlags")]), + Method(HRESULT, "PresentEx", [(ConstPointer(RECT), "pSourceRect"), (ConstPointer(RECT), "pDestRect"), (HWND, "hDestWindowOverride"), (ConstPointer(RGNDATA), "pDirtyRegion"), (D3DPRESENT, "dwFlags")]), Method(HRESULT, "GetGPUThreadPriority", [Out(Pointer(INT), "pPriority")]), Method(HRESULT, "SetGPUThreadPriority", [(INT, "Priority")]), Method(HRESULT, "WaitForVBlank", [(UINT, "iSwapChain")]), diff --git a/d3d9types.py b/d3d9types.py index 69b6230..fc72ce1 100644 --- a/d3d9types.py +++ b/d3d9types.py @@ -968,7 +968,7 @@ D3DPOOL = Enum("D3DPOOL", [ "D3DPOOL_SCRATCH", ]) -D3DPRESENT = Flags(DWORD, [ +D3DPRESENT = FakeEnum(DWORD, [ "D3DPRESENT_RATE_DEFAULT", ]) @@ -1311,7 +1311,7 @@ D3DDISPLAYROTATION = Enum("D3DDISPLAYROTATION", [ "D3DDISPLAYROTATION_270", ]) -D3D9_RESOURCE_PRIORITY = Flags(DWORD, [ +D3D9_RESOURCE_PRIORITY = FakeEnum(DWORD, [ "D3D9_RESOURCE_PRIORITY_MINIMUM", "D3D9_RESOURCE_PRIORITY_LOW", "D3D9_RESOURCE_PRIORITY_NORMAL",