win-ffi 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/lib/win-ffi/enums/comdlg32/find_replace.rb +27 -27
  3. data/lib/win-ffi/enums/comdlg32/font.rb +32 -32
  4. data/lib/win-ffi/enums/system_info.rb +53 -53
  5. data/lib/win-ffi/enums/user32/pointer_flags.rb +81 -81
  6. data/lib/win-ffi/functions/advapi32/process.rb +32 -32
  7. data/lib/win-ffi/functions/advapi32/system_info.rb +16 -16
  8. data/lib/win-ffi/functions/comdlg32.rb +6 -6
  9. data/lib/win-ffi/functions/comdlg32/error.rb +5 -5
  10. data/lib/win-ffi/functions/comdlg32/find_replace.rb +9 -9
  11. data/lib/win-ffi/functions/msvcrt/handle.rb +12 -12
  12. data/lib/win-ffi/functions/ntdll/system_info.rb +13 -13
  13. data/lib/win-ffi/functions/secur32/system_info.rb +29 -29
  14. data/lib/win-ffi/functions/thread.rb +229 -229
  15. data/lib/win-ffi/functions/user32/cursor.rb +2 -0
  16. data/lib/win-ffi/functions/user32/mouse.rb +1 -1
  17. data/lib/win-ffi/functions/user32/window/window.rb +12 -11
  18. data/lib/win-ffi/functions/winmm.rb +546 -546
  19. data/lib/win-ffi/functions/wtsapi32/process.rb +11 -11
  20. data/lib/win-ffi/struct.rb +15 -15
  21. data/lib/win-ffi/structs/comdlg32/choose_color.rb +22 -22
  22. data/lib/win-ffi/structs/comdlg32/choose_font.rb +27 -27
  23. data/lib/win-ffi/structs/comdlg32/find_replace.rb +23 -23
  24. data/lib/win-ffi/structs/gdi32/abc.rb +8 -8
  25. data/lib/win-ffi/structs/gdi32/abcfloat.rb +10 -10
  26. data/lib/win-ffi/structs/gdi32/bitmap.rb +12 -12
  27. data/lib/win-ffi/structs/gdi32/bitmap_info.rb +10 -10
  28. data/lib/win-ffi/structs/gdi32/bitmap_info_header.rb +16 -16
  29. data/lib/win-ffi/structs/gdi32/blend_function.rb +9 -9
  30. data/lib/win-ffi/structs/gdi32/display_device.rb +11 -11
  31. data/lib/win-ffi/structs/gdi32/handle_table.rb +6 -6
  32. data/lib/win-ffi/structs/gdi32/kerning_pair.rb +8 -8
  33. data/lib/win-ffi/structs/gdi32/log_brush.rb +10 -10
  34. data/lib/win-ffi/structs/gdi32/meta_file_pict.rb +9 -9
  35. data/lib/win-ffi/structs/gdi32/palette_entry.rb +9 -9
  36. data/lib/win-ffi/structs/gdi32/pixel_format_descriptor.rb +56 -56
  37. data/lib/win-ffi/structs/gdi32/rgb_quad.rb +9 -9
  38. data/lib/win-ffi/structs/os_version_info.rb +9 -9
  39. data/lib/win-ffi/structs/point.rb +9 -9
  40. data/lib/win-ffi/structs/rect.rb +41 -27
  41. data/lib/win-ffi/structs/size.rb +5 -5
  42. data/lib/win-ffi/structs/user32/controls/combobox_info.rb +14 -12
  43. data/lib/win-ffi/structs/user32/controls/scroll_info.rb +12 -12
  44. data/lib/win-ffi/structs/user32/controls/scrollbar_info.rb +14 -12
  45. data/lib/win-ffi/structs/user32/cursor_info.rb +11 -9
  46. data/lib/win-ffi/structs/user32/display_device.rb +11 -11
  47. data/lib/win-ffi/structs/user32/draw_text_params.rb +10 -10
  48. data/lib/win-ffi/structs/user32/icon_info.rb +10 -10
  49. data/lib/win-ffi/structs/user32/icon_info_ex.rb +14 -14
  50. data/lib/win-ffi/structs/user32/last_input_info.rb +7 -7
  51. data/lib/win-ffi/structs/user32/mouse_move_point.rb +9 -9
  52. data/lib/win-ffi/structs/user32/msg.rb +18 -16
  53. data/lib/win-ffi/structs/user32/pointer_info.rb +24 -24
  54. data/lib/win-ffi/structs/user32/pointer_pen_info.rb +18 -18
  55. data/lib/win-ffi/structs/user32/pointer_touch_info.rb +18 -17
  56. data/lib/win-ffi/structs/user32/raw_input_device_list.rb +9 -9
  57. data/lib/win-ffi/structs/user32/raw_input_header.rb +9 -9
  58. data/lib/win-ffi/structs/user32/touch_hit_testing_input.rb +13 -10
  59. data/lib/win-ffi/structs/user32/touch_hit_testing_proximity_evaluation.rb +9 -7
  60. data/lib/win-ffi/structs/user32/track_mouse_event.rb +9 -9
  61. data/lib/win-ffi/structs/user32/window/alt_tab_info.rb +17 -17
  62. data/lib/win-ffi/structs/user32/window/bs_info.rb +11 -11
  63. data/lib/win-ffi/structs/user32/window/dlg_template.rb +13 -13
  64. data/lib/win-ffi/structs/user32/window/flashw_info.rb +1 -1
  65. data/lib/win-ffi/structs/user32/window/gui_thread_info.rb +17 -17
  66. data/lib/win-ffi/structs/user32/window/luid.rb +7 -7
  67. data/lib/win-ffi/structs/user32/window/menu_info.rb +12 -12
  68. data/lib/win-ffi/structs/user32/window/menu_item_info.rb +17 -17
  69. data/lib/win-ffi/structs/user32/window/menu_item_template.rb +8 -8
  70. data/lib/win-ffi/structs/user32/window/menubar_info.rb +13 -11
  71. data/lib/win-ffi/structs/user32/window/msgbox_params.rb +15 -15
  72. data/lib/win-ffi/structs/user32/window/title_bar_info.rb +3 -1
  73. data/lib/win-ffi/structs/user32/window/tpm_params.rb +9 -7
  74. data/lib/win-ffi/structs/user32/window/update_layered_window_info.rb +21 -21
  75. data/lib/win-ffi/structs/user32/window/window_placement.rb +32 -32
  76. data/lib/win-ffi/structs/user32/window/window_pos.rb +46 -46
  77. data/lib/win-ffi/version.rb +1 -1
  78. metadata +5 -6
@@ -1,8 +1,8 @@
1
- module WinFFI
2
- module User32
3
- class LUID < FFIStruct
4
- layout :LowPart, :dword,
5
- :HighPart, :long
6
- end
7
- end
1
+ module WinFFI
2
+ module User32
3
+ class LUID < FFIStruct
4
+ layout :LowPart, :dword,
5
+ :HighPart, :long
6
+ end
7
+ end
8
8
  end
@@ -1,13 +1,13 @@
1
- module WinFFI
2
- module User32
3
- class MENUINFO < FFIStruct
4
- layout :cbSize, :dword,
5
- :fMask, :dword,
6
- :dwStyle, :dword,
7
- :cyMax, :uint,
8
- :hbrBack, :hbrush,
9
- :dwContextHelpID, :dword,
10
- :dwMenuData, :ulong
11
- end
12
- end
1
+ module WinFFI
2
+ module User32
3
+ class MENUINFO < FFIStruct
4
+ layout :cbSize, :dword,
5
+ :fMask, :dword,
6
+ :dwStyle, :dword,
7
+ :cyMax, :uint,
8
+ :hbrBack, :hbrush,
9
+ :dwContextHelpID, :dword,
10
+ :dwMenuData, :ulong
11
+ end
12
+ end
13
13
  end
@@ -1,18 +1,18 @@
1
- module WinFFI
2
- module User32
3
- class MENUITEMINFO < FFIStruct
4
- layout :cbSize, :uint,
5
- :fMask, :uint,
6
- :ftype, :uint,
7
- :fState, :uint,
8
- :wID, :uint,
9
- :hSubMenu, :hmenu,
10
- :hbmpChecked, :pointer,
11
- :hbmpUnchecked, :pointer,
12
- :dwItemData, :ulong,
13
- :dwTypeData, :string,
14
- :cch, :uint,
15
- :hbmpItem, :pointer
16
- end
17
- end
1
+ module WinFFI
2
+ module User32
3
+ class MENUITEMINFO < FFIStruct
4
+ layout :cbSize, :uint,
5
+ :fMask, :uint,
6
+ :ftype, :uint,
7
+ :fState, :uint,
8
+ :wID, :uint,
9
+ :hSubMenu, :hmenu,
10
+ :hbmpChecked, :pointer,
11
+ :hbmpUnchecked, :pointer,
12
+ :dwItemData, :ulong,
13
+ :dwTypeData, :string,
14
+ :cch, :uint,
15
+ :hbmpItem, :pointer
16
+ end
17
+ end
18
18
  end
@@ -1,9 +1,9 @@
1
- module WinFFI
2
- module User32
3
- class MENUITEMTEMPLATE < FFIStruct
4
- layout :mtOption, :word,
5
- :mtID, :word,
6
- :mtString, :char
7
- end
8
- end
1
+ module WinFFI
2
+ module User32
3
+ class MENUITEMTEMPLATE < FFIStruct
4
+ layout :mtOption, :word,
5
+ :mtID, :word,
6
+ :mtString, :char
7
+ end
8
+ end
9
9
  end
@@ -1,12 +1,14 @@
1
- module WinFFI
2
- module User32
3
- class MENUBARINFO < FFIStruct
4
- layout :cbSize, :dword,
5
- :rcBar, RECT,
6
- :hMenu, :hmenu,
7
- :hwndMenu, :hwnd,
8
- :fBarFocused, :bool,
9
- :fFocused, :bool
10
- end
11
- end
1
+ require 'win-ffi/structs/rect'
2
+
3
+ module WinFFI
4
+ module User32
5
+ class MENUBARINFO < FFIStruct
6
+ layout :cbSize, :dword,
7
+ :rcBar, RECT,
8
+ :hMenu, :hmenu,
9
+ :hwndMenu, :hwnd,
10
+ :fBarFocused, :bool,
11
+ :fFocused, :bool
12
+ end
13
+ end
12
14
  end
@@ -1,16 +1,16 @@
1
- module WinFFI
2
- module User32
3
- class MSGBOXPARAMS < FFIStruct
4
- layout :cbSize, :uint,
5
- :hwndOwner, :hwnd,
6
- :hInstance, :hinstance,
7
- :lpszText, :string,
8
- :lpszCaption, :string,
9
- :dwStyle, :dword,
10
- :lpszIcon, :string,
11
- :dwContextHelpId, :ulong,
12
- :lpfnMsgBoxCallback, :pointer,
13
- :dwLanguageId, :dword
14
- end
15
- end
1
+ module WinFFI
2
+ module User32
3
+ class MSGBOXPARAMS < FFIStruct
4
+ layout :cbSize, :uint,
5
+ :hwndOwner, :hwnd,
6
+ :hInstance, :hinstance,
7
+ :lpszText, :string,
8
+ :lpszCaption, :string,
9
+ :dwStyle, :dword,
10
+ :lpszIcon, :string,
11
+ :dwContextHelpId, :ulong,
12
+ :lpfnMsgBoxCallback, :pointer,
13
+ :dwLanguageId, :dword
14
+ end
15
+ end
16
16
  end
@@ -1,6 +1,8 @@
1
+ require 'win-ffi/structs/rect'
2
+
1
3
  module WinFFI
2
4
  module User32
3
- class TitleBarInfo < FFIStruct
5
+ class TITLEBARINFO < FFIStruct
4
6
  layout :cbSize, :dword,
5
7
  :rcTitleBar, RECT,
6
8
  :rgstate, :dword
@@ -1,8 +1,10 @@
1
- module WinFFI
2
- module User32
3
- class TPMPARAMS < FFIStruct
4
- layout :cbSize, :uint,
5
- :rcExclude, RECT
6
- end
7
- end
1
+ require 'win-ffi/structs/rect'
2
+
3
+ module WinFFI
4
+ module User32
5
+ class TPMPARAMS < FFIStruct
6
+ layout :cbSize, :uint,
7
+ :rcExclude, RECT
8
+ end
9
+ end
8
10
  end
@@ -1,22 +1,22 @@
1
- require 'win-ffi/structs/point'
2
- require 'win-ffi/structs/size'
3
- require 'win-ffi/enums/user32/layered_window_attributes_flags'
4
- require 'win-ffi/structs/rect'
5
-
6
-
7
- module WinFFI
8
- module User32
9
- class UpdateLayeredWindowInfo < FFIStruct
10
- layout :cbSize, :dword,
11
- :hdcDst, :hdc,
12
- :pptDst, POINT.ptr,
13
- :psize, SIZE.ptr,
14
- :hdcSrc, :hdc,
15
- :pptSrc, POINT.ptr,
16
- :crKey, :dword,
17
- :pblend, :pointer,
18
- :dwFlags, LayeredWindowAttributesFlags,
19
- :prcDirty, RECT.ptr
20
- end
21
- end
1
+ require 'win-ffi/structs/point'
2
+ require 'win-ffi/structs/size'
3
+ require 'win-ffi/enums/user32/layered_window_attributes_flags'
4
+ require 'win-ffi/structs/rect'
5
+
6
+
7
+ module WinFFI
8
+ module User32
9
+ class UPDATELAYEREDWINDOWINFO < FFIStruct
10
+ layout :cbSize, :dword,
11
+ :hdcDst, :hdc,
12
+ :pptDst, POINT.ptr,
13
+ :psize, SIZE.ptr,
14
+ :hdcSrc, :hdc,
15
+ :pptSrc, POINT.ptr,
16
+ :crKey, :dword,
17
+ :pblend, :pointer,
18
+ :dwFlags, LayeredWindowAttributesFlags,
19
+ :prcDirty, RECT.ptr
20
+ end
21
+ end
22
22
  end
@@ -1,32 +1,32 @@
1
- module WinFFI
2
- module User32
3
- class WindowPlacement < FFIStruct
4
- layout :length, :uint,
5
- :flags, :uint,
6
- :showCmd, :uint,
7
- :ptMinPosition, POINT,
8
- :ptMaxPosition, POINT,
9
- :rcNormalPosition, RECT
10
-
11
- #TODO
12
- #remove_method :length=
13
-
14
- def initialize
15
- super
16
- self[:length] = self.size
17
- end
18
-
19
- def showCmd
20
- User32::ShowWindowEnum[self[:showCmd]]
21
- end
22
-
23
- def showCmd=(v)
24
- self[:showCmd] = v.is_a?(Integer) ? v : User32::ShowWindowEnum[v]
25
- end
26
-
27
- def to_s
28
- "showCmd = #{showCmd}, min = #{ptMinPosition}, max = #{ptMaxPosition}, normal = #{rcNormalPosition}"
29
- end
30
- end
31
- end
32
- end
1
+ module WinFFI
2
+ module User32
3
+ class WINDOWPLACEMENT < FFIStruct
4
+ layout :length, :uint,
5
+ :flags, :uint,
6
+ :showCmd, :uint,
7
+ :ptMinPosition, POINT,
8
+ :ptMaxPosition, POINT,
9
+ :rcNormalPosition, RECT
10
+
11
+ #TODO
12
+ #remove_method :length=
13
+
14
+ def initialize
15
+ super
16
+ self[:length] = self.size
17
+ end
18
+
19
+ def showCmd
20
+ User32::ShowWindowEnum[self[:showCmd]]
21
+ end
22
+
23
+ def showCmd=(v)
24
+ self[:showCmd] = v.is_a?(Integer) ? v : User32::ShowWindowEnum[v]
25
+ end
26
+
27
+ def to_s
28
+ "showCmd = #{showCmd}, min = #{ptMinPosition}, max = #{ptMaxPosition}, normal = #{rcNormalPosition}"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,46 +1,46 @@
1
- require_relative '../../../enums/user32/window/set_window_pos_flags'
2
-
3
- module WinFFI
4
- module User32
5
- class WindowPos < FFIStruct
6
- FLAGS_INV = SetWindowPosFlags.to_hash.reduce(Hash.new{|h,k| h[k] = []}){|h,(k,v)| h[v] << k; h}.freeze
7
-
8
- layout :hwnd, :pointer, #HWND
9
- :hwndInsertAfter, :pointer, #HWND
10
- :left, :int,
11
- :top, :int,
12
- :width, :int,
13
- :height, :int,
14
- :flags, :uint
15
-
16
- def flags
17
- val = self[:flags]
18
- Set.new(FLAGS_INV.select { |k,_| val & k != 0 }.reduce([]) { |a,(_,v)| a << v }.flatten)
19
- end
20
-
21
- def flags=(flags)
22
- self[:flags] = [*flags].reduce(0) { |a,f| a | SetWindowPosFlags[f].to_i }
23
- end
24
-
25
- def right
26
- width + left
27
- end
28
-
29
- def right=(v)
30
- self.width = v - left
31
- end
32
-
33
- def bottom
34
- height + top
35
- end
36
-
37
- def bottom=(v)
38
- self.height = v - top
39
- end
40
-
41
- def to_s
42
- "left = #{left}, top = #{top}, width = #{width}, height = #{height}, flags = #{flags.to_a.inspect}"
43
- end
44
- end
45
- end
46
- end
1
+ require_relative '../../../enums/user32/window/set_window_pos_flags'
2
+
3
+ module WinFFI
4
+ module User32
5
+ class WINDOWPOS < FFIStruct
6
+ FLAGS_INV = SetWindowPosFlags.to_hash.reduce(Hash.new{|h,k| h[k] = []}){|h,(k,v)| h[v] << k; h}.freeze
7
+
8
+ layout :hwnd, :pointer, #HWND
9
+ :hwndInsertAfter, :pointer, #HWND
10
+ :left, :int,
11
+ :top, :int,
12
+ :width, :int,
13
+ :height, :int,
14
+ :flags, :uint
15
+
16
+ def flags
17
+ val = self[:flags]
18
+ Set.new(FLAGS_INV.select { |k,_| val & k != 0 }.reduce([]) { |a,(_,v)| a << v }.flatten)
19
+ end
20
+
21
+ def flags=(flags)
22
+ self[:flags] = [*flags].reduce(0) { |a,f| a | SetWindowPosFlags[f].to_i }
23
+ end
24
+
25
+ def right
26
+ width + left
27
+ end
28
+
29
+ def right=(v)
30
+ self.width = v - left
31
+ end
32
+
33
+ def bottom
34
+ height + top
35
+ end
36
+
37
+ def bottom=(v)
38
+ self.height = v - top
39
+ end
40
+
41
+ def to_s
42
+ "left = #{left}, top = #{top}, width = #{width}, height = #{height}, flags = #{flags.to_a.inspect}"
43
+ end
44
+ end
45
+ end
46
+ end
@@ -1,3 +1,3 @@
1
1
  module WinFFI
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: win-ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - P3t3rU5
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-09-14 00:00:00.000000000 Z
12
+ date: 2015-09-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ffi
@@ -331,8 +331,8 @@ post_install_message: |
331
331
  Thanks for choosing WinFFI.
332
332
 
333
333
  ==========================================================================
334
- 0.3.1 Changes:
335
- - First Official Version
334
+ 0.3.2 Changes:
335
+ - Added missing requires and changed the name of some structs to be upcased
336
336
 
337
337
  ==========================================================================
338
338
 
@@ -355,9 +355,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
355
355
  version: '0'
356
356
  requirements: []
357
357
  rubyforge_project:
358
- rubygems_version: 2.4.8
358
+ rubygems_version: 2.4.7
359
359
  signing_key:
360
360
  specification_version: 4
361
361
  summary: FFI definitions for Windows API
362
362
  test_files: []
363
- has_rdoc: