windows-pr 0.6.0 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,3 +1,17 @@
1
+ = 0.6.2 - 21-Dec-2006
2
+ * Added file related constants from sys/stat.h to the Windows::MSVCRT::File
3
+ module.
4
+ * Added the open_osfhandle method to the Windows::Handle module.
5
+ * Changed the signatures for the VirtualFree and VirtualFreeEx functions in
6
+ the Windows::Memory module.
7
+ * Added the Windows::GDI::Bitmap, Windows::GDI::DeviceContext and
8
+ Windows::GDI::PaintingDrawing modules.
9
+
10
+ = 0.6.1 - 22-Nov-2006
11
+ * Changed the signature for VirtualAlloc and VirtualAllocEx in the
12
+ Windows::Memory module (long instead of pointer for first argument).
13
+ * Added the get_osfhandle method to the Windows::Handle module.
14
+
1
15
  = 0.6.0 - 5-Nov-2006
2
16
  * Added the Windows::Volume module.
3
17
 
data/MANIFEST CHANGED
@@ -30,5 +30,10 @@ lib/windows/system_info.rb
30
30
  lib/windows/unicode.rb
31
31
  lib/windows/window.rb
32
32
 
33
+ lib/windows/gdi/bitmap.rb
34
+ lib/windows/gdi/device_context.rb
35
+ lib/windows/gdi/painting_drawing.rb
36
+
33
37
  lib/windows/msvcrt/buffer.rb
34
- lib/windows/msvcrt/file.rb
38
+ lib/windows/msvcrt/file.rb
39
+ lib/windows/msvcrt/string.rb
@@ -11,7 +11,10 @@ module Windows
11
11
  DuplicateHandle = Win32API.new('kernel32', 'DuplicateHandle', 'LLLLLIL', 'I')
12
12
  GetHandleInformation = Win32API.new('kernel32', 'GetHandleInformation', 'LL', 'I')
13
13
  SetHandleInformation = Win32API.new('kernel32', 'SetHandleInformation', 'LLL', 'I')
14
-
14
+
15
+ GetOSFHandle = Win32API.new('msvcrt', '_get_osfhandle', 'I', 'L')
16
+ OpenOSFHandle = Win32API.new('msvcrt', '_open_osfhandle', 'LI', 'I')
17
+
15
18
  def CloseHandle(handle)
16
19
  CloseHandle.call(handle) != 0
17
20
  end
@@ -26,6 +29,14 @@ module Windows
26
29
 
27
30
  def SetHandleInformation(handle, mask, flags)
28
31
  SetHandleInformation.call(handle, mask, flags) != 0
29
- end
32
+ end
33
+
34
+ def get_osfhandle(fd)
35
+ GetOSFHandle.call(fd)
36
+ end
37
+
38
+ def open_osfhandle(handle, flags)
39
+ OpenOSFHandle.call(handle, flags)
40
+ end
30
41
  end
31
42
  end
@@ -26,10 +26,10 @@ module Windows
26
26
  GlobalReAlloc = Win32API.new('kernel32', 'GlobalReAlloc', 'III', 'I')
27
27
  GlobalSize = Win32API.new('kernel32', 'GlobalSize', 'I', 'I')
28
28
  GlobalUnlock = Win32API.new('kernel32', 'GlobalUnlock', 'I', 'I')
29
- VirtualAlloc = Win32API.new('kernel32', 'VirtualAlloc', 'PLLL', 'P')
30
- VirtualAllocEx = Win32API.new('kernel32', 'VirtualAllocEx', 'LPLLL', 'P')
31
- VirtualFree = Win32API.new('kernel32', 'VirtualFree', 'PLL', 'I')
32
- VirtualFreeEx = Win32API.new('kernel32', 'VirtualFreeEx', 'LPLL', 'I')
29
+ VirtualAlloc = Win32API.new('kernel32', 'VirtualAlloc', 'LLLL', 'P')
30
+ VirtualAllocEx = Win32API.new('kernel32', 'VirtualAllocEx', 'LLLLL', 'P')
31
+ VirtualFree = Win32API.new('kernel32', 'VirtualFree', 'LLL', 'I')
32
+ VirtualFreeEx = Win32API.new('kernel32', 'VirtualFreeEx', 'LLLL', 'I')
33
33
  VirtualLock = Win32API.new('kernel32', 'VirtualLock', 'PL', 'I')
34
34
  VirtualProtect = Win32API.new('kernel32', 'VirtualProtect', 'PLLP', 'I')
35
35
  VirtualProtectEx = Win32API.new('kernel32', 'VirtualProtectEx', 'LPLLP', 'I')
@@ -3,6 +3,15 @@ require 'Win32API'
3
3
  module Windows
4
4
  module MSVCRT
5
5
  module File
6
+ S_IFMT = 0170000 # file type mask
7
+ S_IFDIR = 0040000 # directory
8
+ S_IFCHR = 0020000 # character special
9
+ S_IFIFO = 0010000 # pipe
10
+ S_IFREG = 0100000 # regular
11
+ S_IREAD = 0000400 # read permission, owner
12
+ S_IWRITE = 0000200 # write permission, owner
13
+ S_IEXEC = 0000100 # execute/search permission, owner
14
+
6
15
  Stat = Win32API.new('msvcrt', '_stat', 'PP', 'I')
7
16
  Stat64 = Win32API.new('msvcrt', '_stat64', 'PP', 'I')
8
17
 
@@ -18,5 +18,21 @@ module Windows
18
18
  SW_SHOWDEFAULT = 10
19
19
  SW_FORCEMINIMIZE = 11
20
20
  SW_MAX = 11
21
+
22
+ GetClientRect = Win32API.new('user32', 'GetClientRect', 'LP', 'I')
23
+ GetForegroundWindow = Win32API.new('user32', 'GetForegroundWindow', 'V', 'L')
24
+ GetWindowRect = Win32API.new('user32', 'GetWindowRect', 'LP', 'I')
25
+
26
+ def GetClientRect(hwnd, rect)
27
+ GetClientRect.call(hwnd, rect) != 0
28
+ end
29
+
30
+ def GetForegroundWindow
31
+ GetForegroundWindow.call
32
+ end
33
+
34
+ def GetWindowRect(hwnd, rect)
35
+ GetWindowRect.call(hwnd, rect) != 0
36
+ end
21
37
  end
22
38
  end
@@ -2,7 +2,7 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |gem|
4
4
  gem.name = "windows-pr"
5
- gem.version = "0.6.0"
5
+ gem.version = "0.6.2"
6
6
  gem.author = "Daniel J. Berger"
7
7
  gem.email = "djberg96@gmail.com"
8
8
  gem.homepage = "http://www.rubyforge.org/projects/win32utils"
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: windows-pr
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.0
7
- date: 2006-11-17 00:00:00 -07:00
6
+ version: 0.6.2
7
+ date: 2006-12-21 00:00:00 -07:00
8
8
  summary: Windows functions and constants predefined via Win32API
9
9
  require_paths:
10
10
  - lib
@@ -62,6 +62,7 @@ files:
62
62
  - lib/windows/msvcrt/buffer.rb
63
63
  - lib/windows/msvcrt/file.rb
64
64
  - lib/windows/msvcrt/string.rb
65
+ - test/CVS
65
66
  - test/tc_clipboard.rb
66
67
  - test/tc_console.rb
67
68
  - test/tc_error.rb
@@ -79,6 +80,7 @@ files:
79
80
  - test/tc_unicode.rb
80
81
  - test/tc_volume.rb
81
82
  - CHANGES
83
+ - CVS
82
84
  - doc
83
85
  - install.rb
84
86
  - lib