windows_gui 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d19698398bf2d86bdc449cf6e5874003e960081a
4
- data.tar.gz: b45e14d18728307fff6a1019ef7099b2c08a0eb8
3
+ metadata.gz: 1e252645f441188b5153bc976d7f207dda3229df
4
+ data.tar.gz: 455f36ab22546e9f48f4de1d3fcdbfbed06d0fc2
5
5
  SHA512:
6
- metadata.gz: 0f0f8387b811b38de7ca7981985bd6e8aa66d717c2e1fc7d4dd3b955c7b20b77a90b83fb996c2d0ebab96a160f795ef16728e89aad912a9a35b7a2422053fd26
7
- data.tar.gz: 9c99e81ab2b5b1fc96db84e85fa6e7ac821eb99d9dcc0870356ecb48a40f45f7053d2174a9de54c401df48f3276ba923112de90aa77e8269b65340894b2c3bca
6
+ metadata.gz: a42a9d6d3b6c3f8fa00195a0762801ec1c41837d6c91ede5c88aa42383683515c6410ccf68e28fe3f7c25509168f183bac6691600e5573efa098a78f3478a2a1
7
+ data.tar.gz: ed34353ffe28a1cf53451084ce27369471462a11020e3e23c383857fead66d4cd60330f7fdc02be60395c5713e76933919554c4da2dd9fb6d8f8dbe06bf3c63c
data/RELNOTES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release Notes
2
2
 
3
+ ## 4.0.1
4
+
5
+ Fix example and debug call
6
+
3
7
  ## 4.0.0
4
8
 
5
9
  Improve code (move additional functionality from FFI bindings to external functions)
@@ -13,7 +13,7 @@ def OnCreate(hwnd,
13
13
  )
14
14
  xtra = Id2Ref[GetWindowLong(hwnd, GWL_USERDATA)]
15
15
 
16
- LOGPEN.new { |lp|
16
+ UsingFFIStructs(LOGPEN.new) { |lp|
17
17
  lp[:lopnWidth][:x] = DPIAwareX(10)
18
18
  lp[:lopnColor] = RGB(255, 0, 0)
19
19
 
@@ -38,7 +38,7 @@ def OnPaint(hwnd,
38
38
  )
39
39
  xtra = Id2Ref[GetWindowLong(hwnd, GWL_USERDATA)]
40
40
 
41
- UseObjects(ps[:hdc], xtra[:hpen]) {
41
+ UsingGDIObjects(ps[:hdc], xtra[:hpen]) {
42
42
  xtra[:scribbles].each { |scribble|
43
43
  MoveToEx(ps[:hdc], *scribble[0], nil)
44
44
 
@@ -61,7 +61,7 @@ def OnLButtonDown(hwnd,
61
61
  xtra[:curpos] = [x, y]
62
62
  xtra[:scribbles] << [[x, y]]
63
63
 
64
- RECT.new { |rect|
64
+ UsingFFIStructs(RECT.new) { |rect|
65
65
  SetRect(rect, x, y, x, y)
66
66
  InflateRect(rect, *DPIAwareXY(5, 5))
67
67
  InvalidateRect(hwnd, rect, 1)
@@ -87,8 +87,8 @@ def OnMouseMove(hwnd,
87
87
 
88
88
  xtra[:scribbles].last << [x, y]
89
89
 
90
- UseDC(hwnd) { |hdc|
91
- UseObjects(hdc, xtra[:hpen]) {
90
+ UsingDC(hwnd) { |hdc|
91
+ UsingGDIObjects(hdc, xtra[:hpen]) {
92
92
  MoveToEx(hdc, *xtra[:curpos], nil)
93
93
  LineTo(hdc, x, y)
94
94
 
@@ -167,7 +167,7 @@ end
167
167
  def WinMain
168
168
  Id2RefTrack(xtra = WndExtra.new)
169
169
 
170
- WNDCLASSEX.new { |wc|
170
+ UsingFFIStructs(WNDCLASSEX.new) { |wc|
171
171
  wc[:cbSize] = wc.size
172
172
  wc[:lpfnWndProc] = WindowProc
173
173
  wc[:cbWndExtra] = FFI::Type::Builtin::POINTER.size
@@ -176,7 +176,7 @@ def WinMain
176
176
  wc[:hCursor] = LoadCursor(nil, IDC_CROSS)
177
177
  wc[:hbrBackground] = FFI::Pointer.new(COLOR_WINDOW + 1)
178
178
 
179
- PWSTR(APPNAME) { |className|
179
+ UsingFFIMemoryPointers(PWSTR(APPNAME)) { |className|
180
180
  wc[:lpszClassName] = className
181
181
 
182
182
  DetonateLastError(0, :RegisterClassEx,
@@ -199,7 +199,7 @@ def WinMain
199
199
  ShowWindow(hwnd, SW_SHOWNORMAL)
200
200
  UpdateWindow(hwnd)
201
201
 
202
- MSG.new { |msg|
202
+ UsingFFIStructs(MSG.new) { |msg|
203
203
  until DetonateLastError(-1, :GetMessage,
204
204
  msg, nil, 0, 0
205
205
  ) == 0
@@ -1,7 +1,7 @@
1
1
  require 'weakref'
2
2
  require 'ffi'
3
3
 
4
- WINDOWS_GUI_VERSION = '4.0.0'
4
+ WINDOWS_GUI_VERSION = '4.0.1'
5
5
 
6
6
  WINDOWS_GUI_VISUAL_STYLES = true unless defined?(WINDOWS_GUI_VISUAL_STYLES)
7
7
  WINDOWS_GUI_DPI_AWARE = true unless defined?(WINDOWS_GUI_DPI_AWARE)
@@ -140,7 +140,7 @@ module WindowsGUI
140
140
 
141
141
  Detonate(0, :SetProcessDPIAware)
142
142
 
143
- STDERR.puts "DPI aware init"
143
+ STDERR.puts "DPI aware init" if $DEBUG
144
144
  end
145
145
 
146
146
  module_function \
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: windows_gui
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Radoslav Peev