Debian Codegraph @

shiny/driver/windriver/syscall_windows.go

raw symbols SCIP
1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package windriver
6
7 import (
8 "unsafe"
9 )
10
11 type _COLORREF uint32
12
13 func _RGB(r, g, b byte) _COLORREF {
14 return _COLORREF(r) | _COLORREF(g)<<8 | _COLORREF(b)<<16
15 }
16
17 type _POINT struct {
18 X int32
19 Y int32
20 }
21
22 type _RECT struct {
23 Left int32
24 Top int32
25 Right int32
26 Bottom int32
27 }
28
29 type _BITMAPINFOHEADER struct {
30 Size uint32
31 Width int32
32 Height int32
33 Planes uint16
34 BitCount uint16
35 Compression uint32
36 SizeImage uint32
37 XPelsPerMeter int32
38 YPelsPerMeter int32
39 ClrUsed uint32
40 ClrImportant uint32
41 }
42
43 type _RGBQUAD struct {
44 Blue byte
45 Green byte
46 Red byte
47 Reserved byte
48 }
49
50 type _BITMAPINFO struct {
51 Header _BITMAPINFOHEADER
52 Colors [1]_RGBQUAD
53 }
54
55 type _BLENDFUNCTION struct {
56 BlendOp byte
57 BlendFlags byte
58 SourceConstantAlpha byte
59 AlphaFormat byte
60 }
61
62 // ToUintptr helps to pass bf to syscall.Syscall.
63 func (bf _BLENDFUNCTION) ToUintptr() uintptr {
64 return *((*uintptr)(unsafe.Pointer(&bf)))
65 }
66
67 type _XFORM struct {
68 eM11 float32
69 eM12 float32
70 eM21 float32
71 eM22 float32
72 eDx float32
73 eDy float32
74 }
75
76 const (
77 _WM_PAINT = 15
78 _WM_WINDOWPOSCHANGED = 71
79 _WM_KEYDOWN = 256
80 _WM_KEYUP = 257
81 _WM_SYSKEYDOWN = 260
82 _WM_SYSKEYUP = 261
83 _WM_MOUSEMOVE = 512
84 _WM_LBUTTONDOWN = 513
85 _WM_LBUTTONUP = 514
86 _WM_RBUTTONDOWN = 516
87 _WM_RBUTTONUP = 517
88 _WM_MBUTTONDOWN = 519
89 _WM_MBUTTONUP = 520
90 _WM_USER = 0x0400
91 )
92
93 const (
94 _WS_OVERLAPPED = 0x00000000
95 _WS_CAPTION = 0x00C00000
96 _WS_SYSMENU = 0x00080000
97 _WS_THICKFRAME = 0x00040000
98 _WS_MINIMIZEBOX = 0x00020000
99 _WS_MAXIMIZEBOX = 0x00010000
100 _WS_OVERLAPPEDWINDOW = _WS_OVERLAPPED | _WS_CAPTION | _WS_SYSMENU | _WS_THICKFRAME | _WS_MINIMIZEBOX | _WS_MAXIMIZEBOX
101 )
102
103 const (
104 _COLOR_BTNFACE = 15
105 )
106
107 const (
108 _IDI_APPLICATION = 32512
109 _IDC_ARROW = 32512
110 )
111
112 const (
113 _BI_RGB = 0
114 _DIB_RGB_COLORS = 0
115
116 _AC_SRC_OVER = 0x00
117 _AC_SRC_ALPHA = 0x01
118
119 _SRCCOPY = 0x00cc0020
120
121 _SHADEBLENDCAPS = 120
122 _SB_NONE = 0
123 )
124
125 const (
126 _GM_COMPATIBLE = 1
127 _GM_ADVANCED = 2
128
129 _MWT_IDENTITY = 1
130 )
131
132 func _GET_X_LPARAM(lp uintptr) int32 {
133 return int32(_LOWORD(lp))
134 }
135
136 func _GET_Y_LPARAM(lp uintptr) int32 {
137 return int32(_HIWORD(lp))
138 }
139
140 func _LOWORD(l uintptr) uint16 {
141 return uint16(uint32(l))
142 }
143
144 func _HIWORD(l uintptr) uint16 {
145 return uint16(uint32(l >> 16))
146 }
147
148 // notes to self
149 // UINT = uint32
150 // callbacks = uintptr
151 // strings = *uint16
152
153 //sys _AlphaBlend(dcdest syscall.Handle, xoriginDest int32, yoriginDest int32, wDest int32, hDest int32, dcsrc syscall.Handle, xoriginSrc int32, yoriginSrc int32, wsrc int32, hsrc int32, ftn uintptr) (err error) = msimg32.AlphaBlend
154 //sys _BitBlt(dcdest syscall.Handle, xdest int32, ydest int32, width int32, height int32, dcsrc syscall.Handle, xsrc int32, ysrc int32, rop uint32) (err error) = gdi32.BitBlt
155 //sys _CreateCompatibleBitmap(dc syscall.Handle, width int32, height int32) (bitmap syscall.Handle, err error) = gdi32.CreateCompatibleBitmap
156 //sys _CreateCompatibleDC(dc syscall.Handle) (newdc syscall.Handle, err error) = gdi32.CreateCompatibleDC
157 //sys _CreateDIBSection(dc syscall.Handle, bmi *_BITMAPINFO, usage uint32, bits **byte, section syscall.Handle, offset uint32) (bitmap syscall.Handle, err error) = gdi32.CreateDIBSection
158 //sys _CreateSolidBrush(color _COLORREF) (brush syscall.Handle, err error) = gdi32.CreateSolidBrush
159 //sys _DeleteDC(dc syscall.Handle) (err error) = gdi32.DeleteDC
160 //sys _DeleteObject(object syscall.Handle) (err error) = gdi32.DeleteObject
161 //sys _FillRect(dc syscall.Handle, rc *_RECT, brush syscall.Handle) (err error) = user32.FillRect
162 //sys _ModifyWorldTransform(dc syscall.Handle, x *_XFORM, mode uint32) (err error) = gdi32.ModifyWorldTransform
163 //sys _SelectObject(dc syscall.Handle, gdiobj syscall.Handle) (newobj syscall.Handle, err error) = gdi32.SelectObject
164 //sys _SetGraphicsMode(dc syscall.Handle, mode int32) (oldmode int32, err error) = gdi32.SetGraphicsMode
165 //sys _SetWorldTransform(dc syscall.Handle, x *_XFORM) (err error) = gdi32.SetWorldTransform
166 //sys _StretchBlt(dcdest syscall.Handle, xdest int32, ydest int32, wdest int32, hdest int32, dcsrc syscall.Handle, xsrc int32, ysrc int32, wsrc int32, hsrc int32, rop uint32) (err error) = gdi32.StretchBlt
167 //sys _GetDeviceCaps(dc syscall.Handle, index int32) (ret int32) = gdi32.GetDeviceCaps