fzeet 0.6.7 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/LICENSE +1 -1
- data/README.md +33 -1
- data/RELNOTES.md +4 -0
- data/examples/Control/Button.rbw +1 -1
- data/examples/Control/WebBrowser/jQueryUI.html +3 -17
- data/examples/Menu/ContextMenu.rbw +1 -1
- data/examples/Raw/Command.rbw +19 -0
- data/examples/Raw/Hello.rbw +19 -0
- data/examples/Raw/LifeCycle.rbw +19 -0
- data/examples/Raw/Minimal.rbw +19 -0
- data/lib/fzeet.rb +19 -6
- data/lib/fzeet/windows.rb +19 -0
- data/lib/fzeet/windows/com/Common.rb +4 -3
- data/lib/fzeet/windows/comctl.rb +19 -0
- data/lib/fzeet/windows/comctl/Button.rb +19 -0
- data/lib/fzeet/windows/comctl/ComboBox.rb +19 -0
- data/lib/fzeet/windows/comctl/ComboBoxEx.rb +19 -0
- data/lib/fzeet/windows/comctl/Common.rb +19 -0
- data/lib/fzeet/windows/comctl/DateTimePicker.rb +19 -0
- data/lib/fzeet/windows/comctl/Edit.rb +19 -0
- data/lib/fzeet/windows/comctl/Header.rb +21 -2
- data/lib/fzeet/windows/comctl/ListView.rb +23 -4
- data/lib/fzeet/windows/comctl/MonthCalendar.rb +19 -0
- data/lib/fzeet/windows/comctl/ProgressBar.rb +19 -0
- data/lib/fzeet/windows/comctl/PropertySheet.rb +21 -2
- data/lib/fzeet/windows/comctl/SysLink.rb +19 -0
- data/lib/fzeet/windows/comctl/Tab.rb +19 -0
- data/lib/fzeet/windows/comctl/TreeView.rb +21 -2
- data/lib/fzeet/windows/comctl/UpDown.rb +19 -0
- data/lib/fzeet/windows/comdlg.rb +19 -0
- data/lib/fzeet/windows/comdlg/ColorDialog.rb +19 -0
- data/lib/fzeet/windows/comdlg/Common.rb +19 -0
- data/lib/fzeet/windows/comdlg/FileDialog.rb +20 -1
- data/lib/fzeet/windows/comdlg/FindReplaceDialog.rb +19 -0
- data/lib/fzeet/windows/comdlg/FontDialog.rb +19 -0
- data/lib/fzeet/windows/comdlg/PrintDialog.rb +19 -0
- data/lib/fzeet/windows/comdlg/ShellFileDialog.rb +19 -0
- data/lib/fzeet/windows/core/Common.rb +1 -1
- data/lib/fzeet/windows/scintilla.rb +19 -0
- data/lib/fzeet/windows/shell.rb +19 -0
- data/lib/fzeet/windows/shell/BrowseForFolder.rb +19 -0
- data/lib/fzeet/windows/shell/Common.rb +19 -0
- data/lib/fzeet/windows/shell/FileDialog.rb +19 -0
- data/lib/fzeet/windows/uiribbon.rb +19 -0
- data/lib/fzeet/windows/user.rb +19 -0
- data/lib/fzeet/windows/user/Control.rb +19 -0
- data/lib/fzeet/windows/user/Control/ComboBox.rb +19 -0
- data/lib/fzeet/windows/user/Control/ListBox.rb +21 -2
- data/lib/fzeet/windows/user/SystemParametersInfo.rb +2 -2
- data/lib/fzeet/windows/user/Window.rb +19 -0
- data/lib/fzeet/windows/user/Window/Common.rb +19 -0
- data/lib/fzeet/windows/user/Window/Container.rb +19 -0
- data/lib/fzeet/windows/user/Window/Dialog.rb +19 -0
- data/lib/fzeet/windows/user/Window/MDI.rb +19 -0
- data/lib/fzeet/windows/user/Window/View.rb +19 -0
- data/lib/fzeet/windows/user/Window/Window.rb +19 -0
- data/lib/fzeet/windows/user/Window/WindowMethods.rb +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
data.tar.gz: !binary |-
|
6
|
-
NTRmZDhlMzY5OTgxYThjOWFmODQzYTc2NTk1MmViZDkzMDlkYzFkYQ==
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5df0ce12171c265bfb86d255ae7bc2e40140500f
|
4
|
+
data.tar.gz: 7217069cca2a8c17b672525413048889ee5f202c
|
7
5
|
SHA512:
|
8
|
-
metadata.gz:
|
9
|
-
|
10
|
-
NzdhYWU3NmFjMjdiYjY0MTQ5OGE1NjkzMTllNWNlZjQ5MGQxMmRlMDMxOTQy
|
11
|
-
NDE1ZDhlNjJiNzEwNjZiYThjMTdlZDExOThlYWM2MjVhODNlZWQ=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
NzgzMzIxNTRkMTg5NTYzNzI3N2FlZTgyZmY1Njg4MGUwYjBlODkxMDczYzdk
|
14
|
-
NTE5MTc2ZTgyNWZlYzAwN2RjMWI0ZDE2YTc3ZTU3ZDRlMjdkMDA4NmEzODA2
|
15
|
-
NDUxOTkxNjMzY2M3Yjg3MzFhODM2MzgzNmMxMGZkNWE4NmVkMTE=
|
6
|
+
metadata.gz: 1be673c897d2994791643ea4a168e0d4a3f4610a73002a44ffb40e975c9a794cfd38cd914e168192cbaedace399c2131ba8caf790c4f95306a61f72910a2c011
|
7
|
+
data.tar.gz: 59bc5eca31c720a41ae486bb4d3dc6d71be7b67f696c06e13b110898a269a570ba6429eadfbc1f7935d225a1b73e6bf54f38233d8d2ec1df0ed14c2b3e3cc512
|
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,9 +1,34 @@
|
|
1
1
|
# fzeet
|
2
2
|
|
3
|
-
Ruby
|
3
|
+
Ruby FFI (x86) bindings to (and rubyesque APIs on top) GUI/COM related Windows APIs
|
4
4
|
|
5
5
|
![Screenshot](./screenshot.png)
|
6
6
|
|
7
|
+
```ruby
|
8
|
+
require 'fzeet'
|
9
|
+
|
10
|
+
include Fzeet
|
11
|
+
|
12
|
+
Application.run(View.new) { |window|
|
13
|
+
UIRibbon.new(window).
|
14
|
+
on(CmdButton1) { message 'on(CmdButton1)' }.
|
15
|
+
on(CmdSplit1) { message 'on(CmdSplit1)' }.
|
16
|
+
on(CmdToggle1) { window.ribbon[CmdCheck1].toggle(:checked) }.
|
17
|
+
on(CmdCheck1) { window.ribbon[CmdToggle1].toggle(:checked) }.
|
18
|
+
|
19
|
+
on(CmdHelp) { message 'on(CmdHelp)' }
|
20
|
+
|
21
|
+
window.ribbon[CmdToggle1].checked = true
|
22
|
+
|
23
|
+
window.
|
24
|
+
on(:draw, Control::Font) { |dc| dc.sms 'Right-click (or menu key) for context menu' }.
|
25
|
+
|
26
|
+
on(:contextmenu) { |args|
|
27
|
+
window.ribbon.contextualUI(CmdContextMap1, args[:x], args[:y])
|
28
|
+
}
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
7
32
|
## Install
|
8
33
|
|
9
34
|
gem install fzeet
|
@@ -11,3 +36,10 @@ gem install fzeet
|
|
11
36
|
## Use
|
12
37
|
|
13
38
|
See examples folder
|
39
|
+
|
40
|
+
## Issues
|
41
|
+
|
42
|
+
- uses the ANSI versions of Windows bindings
|
43
|
+
- declares DPI awareness, but the examples use pixel coordinates
|
44
|
+
- uses _id2ref, so passing -X+O to jrubyw is required when running with JRuby
|
45
|
+
- Windows version identification is outdated
|
data/RELNOTES.md
CHANGED
data/examples/Control/Button.rbw
CHANGED
@@ -24,7 +24,7 @@ Application.run { |window| window.dialog = true
|
|
24
24
|
window[:button2].on(:doubleclicked) { message 'on(:command, :button2, :doubleclicked)' }
|
25
25
|
window[:button3].
|
26
26
|
on(:clicked) { message 'on(:command, :button3, :clicked)' }.
|
27
|
-
on(:dropdown) { |args| using(
|
27
|
+
on(:dropdown) { |args| Fzeet.using(
|
28
28
|
PopupMenu.new.
|
29
29
|
append(:string, 'Item&1', :item1)
|
30
30
|
) { |popup|
|
@@ -3,38 +3,24 @@
|
|
3
3
|
<head>
|
4
4
|
<title>jQueryUI</title>
|
5
5
|
|
6
|
-
<link rel='stylesheet' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.
|
6
|
+
<link rel='stylesheet' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/base/jquery-ui.css' />
|
7
7
|
|
8
8
|
<style>
|
9
9
|
* {
|
10
10
|
font-size: small;
|
11
11
|
}
|
12
|
-
|
13
|
-
#themeswitcher {
|
14
|
-
float: right;
|
15
|
-
}
|
16
|
-
|
17
|
-
#tabs {
|
18
|
-
clear: both;
|
19
|
-
}
|
20
12
|
</style>
|
21
13
|
|
22
|
-
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.
|
23
|
-
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.
|
24
|
-
|
25
|
-
<script src='http://jqueryui.com/themeroller/themeswitchertool/'></script>
|
14
|
+
<script src='http://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
|
15
|
+
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js'></script>
|
26
16
|
|
27
17
|
<script>
|
28
18
|
jQuery(function (j) {
|
29
|
-
j('#themeswitcher').themeswitcher({width: 250, height: 600, closeOnSelect: false});
|
30
|
-
|
31
19
|
j('#tabs').tabs();
|
32
20
|
});
|
33
21
|
</script>
|
34
22
|
</head>
|
35
23
|
<body>
|
36
|
-
<div id='themeswitcher'></div>
|
37
|
-
|
38
24
|
<div id='tabs'>
|
39
25
|
<ul>
|
40
26
|
<li><a id='tab1' href='#page1'>tab1</a></li>
|
@@ -6,7 +6,7 @@ Application.run(View.new) { |window|
|
|
6
6
|
window.
|
7
7
|
on(:draw, Control::Font) { |dc| dc.sms 'Right-click (or menu key) for context menu' }.
|
8
8
|
|
9
|
-
on(:contextmenu) { |args| using(
|
9
|
+
on(:contextmenu) { |args| Fzeet.using(
|
10
10
|
PopupMenu.new.
|
11
11
|
append(:string, 'Item&1', :item1)
|
12
12
|
) { |popup|
|
data/examples/Raw/Command.rbw
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require 'fzeet/windows'
|
2
21
|
|
3
22
|
include Fzeet::Windows
|
data/examples/Raw/Hello.rbw
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require 'fzeet/windows'
|
2
21
|
|
3
22
|
include Fzeet::Windows
|
data/examples/Raw/LifeCycle.rbw
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require 'fzeet/windows'
|
2
21
|
|
3
22
|
include Fzeet::Windows
|
data/examples/Raw/Minimal.rbw
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require 'fzeet/windows'
|
2
21
|
|
3
22
|
include Fzeet::Windows
|
data/lib/fzeet.rb
CHANGED
@@ -1,8 +1,25 @@
|
|
1
|
+
require 'ffi'
|
2
|
+
|
3
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
4
|
+
# TODO: switch to composition instead inheriting FFI structs
|
5
|
+
module PropagateFFIStructLayout
|
6
|
+
def inherited(child_class)
|
7
|
+
child_class.instance_variable_set '@layout', layout
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
class FFI::Struct
|
12
|
+
def self.inherited(child_class)
|
13
|
+
child_class.extend PropagateFFIStructLayout
|
14
|
+
end
|
15
|
+
end
|
16
|
+
# END FIXME
|
17
|
+
|
1
18
|
require_relative 'fzeet/windows'
|
2
19
|
|
3
|
-
|
4
|
-
VERSION = '0.6.7'
|
20
|
+
FZEET_VERSION = '0.7.0'
|
5
21
|
|
22
|
+
module Fzeet
|
6
23
|
module Windows
|
7
24
|
DetonateLastError(0, :InitCommonControlsEx,
|
8
25
|
INITCOMMONCONTROLSEX.new.tap { |icc|
|
@@ -24,7 +41,3 @@ module Fzeet
|
|
24
41
|
InitializeOle()
|
25
42
|
end
|
26
43
|
end
|
27
|
-
|
28
|
-
if __FILE__ == $0
|
29
|
-
puts Fzeet::VERSION
|
30
|
-
end
|
data/lib/fzeet/windows.rb
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require_relative 'windows/libc'
|
2
21
|
|
3
22
|
require_relative 'windows/kernel'
|
@@ -109,8 +109,9 @@ module Fzeet
|
|
109
109
|
const_set(:VTBL, Class.new(FFI::Struct) {
|
110
110
|
const_set(:SPEC, Hash[(ifaces.map { |iface| iface::VTBL::SPEC.to_a } << spec.to_a).flatten(1)])
|
111
111
|
|
112
|
-
layout
|
112
|
+
layout(
|
113
113
|
*self::SPEC.map { |name, signature| [name, callback(*signature)] }.flatten
|
114
|
+
)
|
114
115
|
})
|
115
116
|
|
116
117
|
layout \
|
@@ -159,7 +160,7 @@ module Fzeet
|
|
159
160
|
send(:include, Helpers)
|
160
161
|
|
161
162
|
def initialize(pointer)
|
162
|
-
|
163
|
+
super(pointer)
|
163
164
|
|
164
165
|
@vtbl = self.class::VTBL.new(self[:lpVtbl])
|
165
166
|
end
|
@@ -191,7 +192,7 @@ module Fzeet
|
|
191
192
|
raise "CoCreateInstance failed (#{self.class})." if
|
192
193
|
Windows.FAILED(Windows.CoCreateInstance(self.class::CLSID, nil, @opts[:clsctx], self.class::IID, ppv))
|
193
194
|
|
194
|
-
|
195
|
+
super(ppv.read_pointer)
|
195
196
|
}
|
196
197
|
|
197
198
|
@vtbl = self.class::VTBL.new(self[:lpVtbl])
|
data/lib/fzeet/windows/comctl.rb
CHANGED
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require_relative 'comctl/Button'
|
2
21
|
require_relative 'comctl/SysLink' if Fzeet::Windows::Version >= :xp
|
3
22
|
require_relative 'comctl/Edit'
|
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require_relative 'Common'
|
2
21
|
|
3
22
|
module Fzeet
|
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require_relative 'Common'
|
2
21
|
|
3
22
|
module Fzeet
|
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require_relative 'Common'
|
2
21
|
|
3
22
|
module Fzeet
|
@@ -1,3 +1,22 @@
|
|
1
|
+
if __FILE__ == $0
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
# FIXME: dirty fix to propagate FFI structs layout down the inheritance hierarchy
|
5
|
+
# TODO: switch to composition instead inheriting FFI structs
|
6
|
+
module PropagateFFIStructLayout
|
7
|
+
def inherited(child_class)
|
8
|
+
child_class.instance_variable_set '@layout', layout
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
class FFI::Struct
|
13
|
+
def self.inherited(child_class)
|
14
|
+
child_class.extend PropagateFFIStructLayout
|
15
|
+
end
|
16
|
+
end
|
17
|
+
# END FIXME
|
18
|
+
end
|
19
|
+
|
1
20
|
require_relative '../user'
|
2
21
|
|
3
22
|
module Fzeet
|