win_gui 0.1.4 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +3 -13
- data/VERSION +1 -1
- data/lib/win_gui/def_api.rb +3 -1
- data/lib/win_gui/string_extensions.rb +14 -2
- data/win_gui.gemspec +2 -2
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -4,15 +4,15 @@
|
|
4
4
|
|
5
5
|
== DESCRIPTION:
|
6
6
|
|
7
|
-
Welcome to WinGui!
|
8
|
-
|
9
7
|
WinGui is a module that provides convenient wrapper methods for multiple Win32 API
|
10
8
|
functions (mostly from user32.dll) dealing with Windows GUI manipulation/automation.
|
11
9
|
In addition to straightforward API wrappers, it also defines more Ruby-like
|
12
10
|
abstractions and convenience methods for manipulating windows and other GUI
|
13
11
|
elements (such as WinGui::Window class and its methods).
|
14
12
|
|
15
|
-
|
13
|
+
!!! This project has been discontinued due to problems with Win32::API Callbacks and
|
14
|
+
need to support non-MRI Ruby implementations. So, new project is now based on FFI and
|
15
|
+
can be found here:http://github.com/arvicco/win (it is now available as a gem 'win').
|
16
16
|
|
17
17
|
== SUMMARY
|
18
18
|
|
@@ -109,16 +109,6 @@ More examples will follow when the code is closer to production quality...
|
|
109
109
|
This library started as an extension of ideas and code described in excellent book
|
110
110
|
"Scripted GUI Testing with Ruby" by Ian Dees.
|
111
111
|
|
112
|
-
== Note on Patches/Pull Requests
|
113
|
-
|
114
|
-
* Fork the project.
|
115
|
-
* Make your feature addition or bug fix.
|
116
|
-
* Add tests for it. This is important so I don't break it in a
|
117
|
-
future version unintentionally.
|
118
|
-
* Commit, do not mess with rakefile, version, or history.
|
119
|
-
(if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
|
120
|
-
* Send me a pull request. Bonus points for topic branches.
|
121
|
-
|
122
112
|
== LICENSE:
|
123
113
|
|
124
114
|
Copyright (c) 2009 Arvicco. See LICENSE for details
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
data/lib/win_gui/def_api.rb
CHANGED
@@ -5,6 +5,7 @@ module WinGui
|
|
5
5
|
# DLL to use with API decarations by default ('user32')
|
6
6
|
DEFAULT_DLL = 'user32'
|
7
7
|
|
8
|
+
##
|
8
9
|
# Defines new method wrappers for Windows API function call:
|
9
10
|
# - Defines method with original (CamelCase) API function name and original signature (matches MSDN description)
|
10
11
|
# - Defines method with snake_case name (converted from CamelCase function name) with enhanced API signature
|
@@ -150,7 +151,8 @@ module WinGui
|
|
150
151
|
callback = callback 'IIPPPPPP', 'L', &block
|
151
152
|
|
152
153
|
status = api.call(id = [id].pack('L'), callback, cmd, 0)
|
153
|
-
|
154
|
+
id = status == 0 ? id.unpack('L').first : nil
|
155
|
+
[id, status]
|
154
156
|
end
|
155
157
|
end
|
156
158
|
|
@@ -2,11 +2,23 @@ class String
|
|
2
2
|
def snake_case
|
3
3
|
gsub(/([a-z])([A-Z0-9])/, '\1_\2' ).downcase
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
|
+
def camel_case
|
7
|
+
if self.include? '_'
|
8
|
+
self.split('_').map{|e| e.capitalize}.join
|
9
|
+
else
|
10
|
+
unless self =~ (/^[A-Z]/)
|
11
|
+
self.capitalize
|
12
|
+
else
|
13
|
+
self
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
6
18
|
def to_w
|
7
19
|
(self+"\x00").encode('utf-16LE')
|
8
20
|
end
|
9
|
-
|
21
|
+
|
10
22
|
def to_vkeys
|
11
23
|
unless size == 1
|
12
24
|
raise "Can't convert but a single character: #{self}"
|
data/win_gui.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{win_gui}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["arvicco"]
|
12
|
-
s.date = %q{2010-02-
|
12
|
+
s.date = %q{2010-02-14}
|
13
13
|
s.description = %q{Rubyesque interfaces and wrappers for Win32 API GUI functions}
|
14
14
|
s.email = %q{arvitallian@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: win_gui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- arvicco
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-14 00:00:00 +03:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|