summaryrefslogtreecommitdiff
path: root/specs
diff options
context:
space:
mode:
authorJose Fonseca <jfonseca@vmware.com>2015-08-13 20:38:40 +0100
committerJose Fonseca <jfonseca@vmware.com>2015-08-13 22:01:48 +0100
commit25a41c503bbec8eed83bdc0e9b5c1de35f175464 (patch)
tree91bad4df39813d748da5901166222c1c9dd82551 /specs
parentda621b59eb8ac436d9fefab51a3954cfd7252c44 (diff)
specs: Merge D2D spec modules.
Diffstat (limited to 'specs')
-rw-r--r--specs/d2d1.py98
-rw-r--r--specs/d2dbasetypes.py80
-rw-r--r--specs/d2derr.py62
3 files changed, 96 insertions, 144 deletions
diff --git a/specs/d2d1.py b/specs/d2d1.py
index 89b0cde7..d08c01a3 100644
--- a/specs/d2d1.py
+++ b/specs/d2d1.py
@@ -26,11 +26,105 @@
from winapi import *
from dxgi import DXGI_FORMAT, IDXGISurface
-from d2derr import *
-from d2dbasetypes import *
from dwrite import *
+
+#
+# D2D
+#
+
+HRESULT = MAKE_HRESULT(errors = [
+ "D2DERR_UNSUPPORTED_PIXEL_FORMAT",
+ "D2DERR_INSUFFICIENT_BUFFER",
+ "D2DERR_WRONG_STATE",
+ "D2DERR_NOT_INITIALIZED",
+ "D2DERR_UNSUPPORTED_OPERATION",
+ "D2DERR_SCANNER_FAILED",
+ "D2DERR_SCREEN_ACCESS_DENIED",
+ "D2DERR_DISPLAY_STATE_INVALID",
+ "D2DERR_ZERO_VECTOR",
+ "D2DERR_INTERNAL_ERROR",
+ "D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED",
+ "D2DERR_INVALID_CALL",
+ "D2DERR_NO_HARDWARE_DEVICE",
+ "D2DERR_RECREATE_TARGET",
+ "D2DERR_TOO_MANY_SHADER_ELEMENTS",
+ "D2DERR_SHADER_COMPILE_FAILED",
+ "D2DERR_MAX_TEXTURE_SIZE_EXCEEDED",
+ "D2DERR_UNSUPPORTED_VERSION",
+ "D2DERR_BAD_NUMBER",
+ "D2DERR_WRONG_FACTORY",
+ "D2DERR_LAYER_ALREADY_IN_USE",
+ "D2DERR_POP_CALL_DID_NOT_MATCH_PUSH",
+ "D2DERR_WRONG_RESOURCE_DOMAIN",
+ "D2DERR_PUSH_POP_UNBALANCED",
+ "D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT",
+ "D2DERR_INCOMPATIBLE_BRUSH_TYPES",
+ "D2DERR_WIN32_ERROR",
+ "D2DERR_TARGET_NOT_GDI_COMPATIBLE",
+ "D2DERR_TEXT_EFFECT_IS_WRONG_TYPE",
+ "D2DERR_TEXT_RENDERER_NOT_RELEASED",
+ "D2DERR_EXCEEDS_MAX_BITMAP_SIZE",
+])
+
+D3DCOLORVALUE = Struct("D3DCOLORVALUE", [
+ (FLOAT, "r"),
+ (FLOAT, "g"),
+ (FLOAT, "b"),
+ (FLOAT, "a"),
+])
+
+D2D_POINT_2U = Struct("D2D_POINT_2U", [
+ (UINT32, "x"),
+ (UINT32, "y"),
+])
+
+D2D_POINT_2F = Struct("D2D_POINT_2F", [
+ (FLOAT, "x"),
+ (FLOAT, "y"),
+])
+
+D2D_RECT_F = Struct("D2D_RECT_F", [
+ (FLOAT, "left"),
+ (FLOAT, "top"),
+ (FLOAT, "right"),
+ (FLOAT, "bottom"),
+])
+
+D2D_RECT_U = Struct("D2D_RECT_U", [
+ (UINT32, "left"),
+ (UINT32, "top"),
+ (UINT32, "right"),
+ (UINT32, "bottom"),
+])
+
+D2D_SIZE_F = Struct("D2D_SIZE_F", [
+ (FLOAT, "width"),
+ (FLOAT, "height"),
+])
+
+D2D_SIZE_U = Struct("D2D_SIZE_U", [
+ (UINT32, "width"),
+ (UINT32, "height"),
+])
+
+D2D_COLOR_F = Alias("D2D_COLOR_F", D3DCOLORVALUE)
+D2D_MATRIX_3X2_F = Struct("D2D_MATRIX_3X2_F", [
+ (FLOAT, "_11"),
+ (FLOAT, "_12"),
+ (FLOAT, "_21"),
+ (FLOAT, "_22"),
+ (FLOAT, "_31"),
+ (FLOAT, "_32"),
+])
+
+
+
+#
+# D2D1
+#
+
ID2D1Resource = Interface("ID2D1Resource", IUnknown)
ID2D1Bitmap = Interface("ID2D1Bitmap", ID2D1Resource)
ID2D1GradientStopCollection = Interface("ID2D1GradientStopCollection", ID2D1Resource)
diff --git a/specs/d2dbasetypes.py b/specs/d2dbasetypes.py
deleted file mode 100644
index 86ba7943..00000000
--- a/specs/d2dbasetypes.py
+++ /dev/null
@@ -1,80 +0,0 @@
-##########################################################################
-#
-# Copyright 2011 Jose Fonseca
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-##########################################################################/
-
-
-from winapi import *
-
-
-D3DCOLORVALUE = Struct("D3DCOLORVALUE", [
- (FLOAT, "r"),
- (FLOAT, "g"),
- (FLOAT, "b"),
- (FLOAT, "a"),
-])
-
-D2D_POINT_2U = Struct("D2D_POINT_2U", [
- (UINT32, "x"),
- (UINT32, "y"),
-])
-
-D2D_POINT_2F = Struct("D2D_POINT_2F", [
- (FLOAT, "x"),
- (FLOAT, "y"),
-])
-
-D2D_RECT_F = Struct("D2D_RECT_F", [
- (FLOAT, "left"),
- (FLOAT, "top"),
- (FLOAT, "right"),
- (FLOAT, "bottom"),
-])
-
-D2D_RECT_U = Struct("D2D_RECT_U", [
- (UINT32, "left"),
- (UINT32, "top"),
- (UINT32, "right"),
- (UINT32, "bottom"),
-])
-
-D2D_SIZE_F = Struct("D2D_SIZE_F", [
- (FLOAT, "width"),
- (FLOAT, "height"),
-])
-
-D2D_SIZE_U = Struct("D2D_SIZE_U", [
- (UINT32, "width"),
- (UINT32, "height"),
-])
-
-D2D_COLOR_F = Alias("D2D_COLOR_F", D3DCOLORVALUE)
-D2D_MATRIX_3X2_F = Struct("D2D_MATRIX_3X2_F", [
- (FLOAT, "_11"),
- (FLOAT, "_12"),
- (FLOAT, "_21"),
- (FLOAT, "_22"),
- (FLOAT, "_31"),
- (FLOAT, "_32"),
-])
-
diff --git a/specs/d2derr.py b/specs/d2derr.py
deleted file mode 100644
index c6000039..00000000
--- a/specs/d2derr.py
+++ /dev/null
@@ -1,62 +0,0 @@
-##########################################################################
-#
-# Copyright 2011 Jose Fonseca
-# All Rights Reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
-#
-##########################################################################/
-
-
-from winapi import *
-
-
-HRESULT = MAKE_HRESULT(errors = [
- "D2DERR_UNSUPPORTED_PIXEL_FORMAT",
- "D2DERR_INSUFFICIENT_BUFFER",
- "D2DERR_WRONG_STATE",
- "D2DERR_NOT_INITIALIZED",
- "D2DERR_UNSUPPORTED_OPERATION",
- "D2DERR_SCANNER_FAILED",
- "D2DERR_SCREEN_ACCESS_DENIED",
- "D2DERR_DISPLAY_STATE_INVALID",
- "D2DERR_ZERO_VECTOR",
- "D2DERR_INTERNAL_ERROR",
- "D2DERR_DISPLAY_FORMAT_NOT_SUPPORTED",
- "D2DERR_INVALID_CALL",
- "D2DERR_NO_HARDWARE_DEVICE",
- "D2DERR_RECREATE_TARGET",
- "D2DERR_TOO_MANY_SHADER_ELEMENTS",
- "D2DERR_SHADER_COMPILE_FAILED",
- "D2DERR_MAX_TEXTURE_SIZE_EXCEEDED",
- "D2DERR_UNSUPPORTED_VERSION",
- "D2DERR_BAD_NUMBER",
- "D2DERR_WRONG_FACTORY",
- "D2DERR_LAYER_ALREADY_IN_USE",
- "D2DERR_POP_CALL_DID_NOT_MATCH_PUSH",
- "D2DERR_WRONG_RESOURCE_DOMAIN",
- "D2DERR_PUSH_POP_UNBALANCED",
- "D2DERR_RENDER_TARGET_HAS_LAYER_OR_CLIPRECT",
- "D2DERR_INCOMPATIBLE_BRUSH_TYPES",
- "D2DERR_WIN32_ERROR",
- "D2DERR_TARGET_NOT_GDI_COMPATIBLE",
- "D2DERR_TEXT_EFFECT_IS_WRONG_TYPE",
- "D2DERR_TEXT_RENDERER_NOT_RELEASED",
- "D2DERR_EXCEEDS_MAX_BITMAP_SIZE",
-])