glimmer-dsl-opal 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 321f0f4121858de374edacf81772b65ff3bd0ee1e155531b5a04681c1e7f5fa0
4
- data.tar.gz: 5bfab859f5b96458ca452444253a8fb1fefe5274e2bdbc892e574ab6fcd74ed0
3
+ metadata.gz: 1d32ed10e3cc93c0f4bde45e35265071c281d73b4371e68306dccbb3e3406e05
4
+ data.tar.gz: 421daff761291fa3e118d090c450378ab5291f640ed5d81292560d1d8df8736b
5
5
  SHA512:
6
- metadata.gz: 58ee88fda2ed5729f1c3b58035d6aa252fbb23ac2a12b120e88040aa485d7e34bf9f337c1a8e6f289c73c23528aec4dd735a00c0542c4c120c9499141815cc38
7
- data.tar.gz: d70d728a4beb4ff5bff63c68b823155ab39b014163698fe875ffacbba09c2e18b91fc3b11fd529876857187fe7aae5e331ecf32b06f4d417a0615bd38d64877a
6
+ metadata.gz: 220ad6c819df436720e3756b9cef24a74ced1f6c1a14aa7ed5604b09b949a8badc99bbbfb1ce5a048b80c35bde882d0f0136e788dc07a54c9071ebaa9c72a680
7
+ data.tar.gz: 80c1d6150624d0095ec7965f060e572841e1a7446b664c4741bd553302a805a051593084e495ccee472e66865e398f77443c5d91253f26fa3320b8fc9d9e168a
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## 0.4.0
4
+
5
+ - Support `display` keyword representing an SWT Display
6
+ - Support display `on_swt_keydown` event listener (display-wide widget observer)
7
+ - Support `DisplayProxy#shells` method keeping track of open shell
8
+ - Make a custom shell open in the same window if there is no shell open already
9
+ - Support `sync_exec` keyword as just an alias to `async_exec`
10
+ - Provide a makeshift require for 'glimmer-dsl-swt' that requires 'glimmer-dsl-opal' instead
11
+ - Fake APIs on the web for OS.os?, File.read, Display.setAppName, Display.setAppVersion
12
+ - Provide a minimal URI class that supports URI::encode_www_form_component and URI::decode_www_form_component from Ruby
13
+
3
14
  ## 0.3.0
4
15
 
5
16
  - Support opening a custom shell in a browser tab/window by passing in query parameters to URL (e.g. ?custom_shell=keyword+option1=value1 etc...)
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Opal 0.3.0 (Webify Desktop Apps)
1
+ # [<img src="https://raw.githubusercontent.com/AndyObtiva/glimmer/master/images/glimmer-logo-hi-res.png" height=85 />](https://github.com/AndyObtiva/glimmer) Glimmer DSL for Opal 0.4.0 (Webify Desktop Apps)
2
2
  [![Gem Version](https://badge.fury.io/rb/glimmer-dsl-opal.svg)](http://badge.fury.io/rb/glimmer-dsl-opal)
3
3
  [![Join the chat at https://gitter.im/AndyObtiva/glimmer](https://badges.gitter.im/AndyObtiva/glimmer.svg)](https://gitter.im/AndyObtiva/glimmer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
4
4
 
@@ -8,7 +8,10 @@
8
8
 
9
9
  Glimmer DSL for Opal successfully reuses the entire [Glimmer](https://github.com/AndyObtiva/glimmer) core DSL engine in [Opal Ruby](https://opalrb.com/) inside a web browser, and as such inherits the full range of powerful Glimmer desktop [data-binding](https://github.com/AndyObtiva/glimmer#data-binding) capabilities for the web.
10
10
 
11
- NOTE: Alpha Version 0.3.0 only supports bare-minimum capabilities for the following [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) [samples](https://github.com/AndyObtiva/glimmer#samples):
11
+ NOTE: Alpha Version 0.4.0 only supports bare-minimum capabilities for the following [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) [samples](https://github.com/AndyObtiva/glimmer#samples):
12
+
13
+ Hello:
14
+
12
15
  - [Hello, World!](#hello-world)
13
16
  - [Hello, Combo!](#hello-combo)
14
17
  - [Hello, Computed!](#hello-computed)
@@ -18,16 +21,31 @@ NOTE: Alpha Version 0.3.0 only supports bare-minimum capabilities for the follow
18
21
  - [Hello, Tab!](#hello-tab)
19
22
  - [Hello, Custom Widget!](#hello-custom-widget)
20
23
  - [Hello, Custom Shell!](#hello-custom-shell)
24
+
25
+ Elaborate:
26
+
21
27
  - [Login](#login)
22
28
  - [Tic Tac Toe](#tic-tac-toe)
23
29
  - [Contact Manager](#contact-manager)
24
30
 
31
+ External:
32
+
33
+ - [Glimmer Calculator](#glimmer-calculator)
34
+
25
35
  Other [Glimmer](https://github.com/AndyObtiva/glimmer) DSL gems:
26
36
  - [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt): Glimmer DSL for SWT (JRuby Desktop Development GUI Library)
27
37
  - [glimmer-dsl-tk](https://github.com/AndyObtiva/glimmer-dsl-tk): Glimmer DSL for Tk (Ruby Desktop Development GUI Library)
28
38
  - [glimmer-dsl-xml](https://github.com/AndyObtiva/glimmer-dsl-xml): Glimmer DSL for XML (& HTML)
29
39
  - [glimmer-dsl-css](https://github.com/AndyObtiva/glimmer-dsl-css): Glimmer DSL for CSS (Cascading Style Sheets)
30
40
 
41
+ ## Background
42
+
43
+ The idea behind Glimmer DSL for Opal is that you start by having a [Glimmer DSL for SWT](https://github.com/AndyObtiva/glimmer-dsl-swt) desktop app that communicates with a Rails API for any web/cloud concerns. The GUI DSL is very simple in Glimmer DSL for SWT. Once the app is built. You simply embed it in a Rails app as a one line require statement after adding the Glimmer DSL for Opal gem, and BOOM, it just works on the web inside a web browser with the same server/client communication you had in the desktop app (I am working on adding minimal support for net/http in Opal so that desktop apps that use it continue to work in a web browser).
44
+
45
+ Part of the idea is that web browsers just render GUI widgets similar to those of a desktop app (after all a web browser is a desktop app), so whether you run your GUI on the desktop or on the web should just be a low-level concern, hopefully automated completely with Glimmer DSL for Opal.
46
+
47
+ Last but not least, you would likely want some special branding on the web, so you can push that off to a web designer who would be more than happy to do the web graphic design and customize the look and feel with pure CSS (no need for programming with Ruby or JavaScript). This enables a clean separation of concerns and distribution of tasks among developers and designers, let alone saving effort on the web GUI by reusing the desktop GUI as a base right off the bat.
48
+
31
49
  ## Supported Glimmer DSL Keywords
32
50
 
33
51
  The following keywords from [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) have partial support in Opal:
@@ -45,8 +63,8 @@ Widgets:
45
63
  - `table`
46
64
  - `table_column`
47
65
  - `message_box`
48
- - CustomWidget (ability to define any keyword as a custom widget)
49
- - CustomShell (ability to define any keyword as a custom shell (aka custom window) that opens in a new browser window)
66
+ - Glimmer::UI::CustomWidget: ability to define any keyword as a custom widget
67
+ - Glimmer::UI::CustomShell: ability to define any keyword as a custom shell (aka custom window) that opens in a new browser window (tab) automatically unless there is no shell open in the current browser window (tab)
50
68
 
51
69
  Layouts:
52
70
  - `grid_layout`
@@ -65,6 +83,7 @@ Data-Binding/Observers:
65
83
  - `on_modify_text`
66
84
 
67
85
  Event loop:
86
+ - `display`
68
87
  - `async_exec`
69
88
 
70
89
  ## Pre-requisites
@@ -77,12 +96,16 @@ Event loop:
77
96
 
78
97
  (NOTE: if you run into issues, keep in mind this is a very early experimental and incomplete alpha. Also, there is a slight chance issues you encounter are fixed in master or some other branch that you could check out instead)
79
98
 
80
- Please install a Rails 5 gem (e.g. `gem install rails -v5.2.4.3` )
99
+ Please install a Rails 5 gem:
100
+
101
+ ```
102
+ gem install rails -v5.2.4.4
103
+ ```
81
104
 
82
105
  Start a new Rails 5 app:
83
106
 
84
107
  ```
85
- rails new glimmer_app
108
+ rails new glimmer_app_server
86
109
  ```
87
110
 
88
111
  Add the following to `Gemfile`:
@@ -91,7 +114,7 @@ Add the following to `Gemfile`:
91
114
  gem 'opal-rails', '~> 1.1.2'
92
115
  gem 'opal-async', '~> 1.2.0'
93
116
  gem 'opal-jquery', '~> 0.4.4'
94
- gem 'glimmer-dsl-opal', '~> 0.3.0', require: false
117
+ gem 'glimmer-dsl-opal', '~> 0.4.0', require: false
95
118
  gem 'glimmer-dsl-xml', '~> 1.1.0', require: false
96
119
  gem 'glimmer-dsl-css', '~> 1.1.0', require: false
97
120
 
@@ -104,12 +127,6 @@ Edit `config/initializers/assets.rb` and add the following at the bottom:
104
127
  Opal.use_gem 'glimmer-dsl-opal'
105
128
  ```
106
129
 
107
- Add the following line to the top of an empty `app/assets/javascripts/application.rb` (replacing `application.js`)
108
-
109
- ```ruby
110
- require 'glimmer-dsl-opal' # brings opal and other dependencies automatically
111
- ```
112
-
113
130
  Run:
114
131
 
115
132
  ```
@@ -119,10 +136,16 @@ rails g scaffold welcome
119
136
  Modify `config/routes.rb`:
120
137
 
121
138
  ```ruby
122
- root to: 'welcome#index'
139
+ root to: 'welcomes#index'
123
140
  ```
124
141
 
125
- Add more code to `app/assets/javascripts/application.rb` inside a `Document.ready?` block from one of the samples below or a [Glimmer](https://github.com/AndyObtiva/glimmer) [app](https://github.com/AndyObtiva/glimmer#app)/[custom-shell gem](https://github.com/AndyObtiva/glimmer#custom-shell-gem).
142
+ Add the following line to the top of an empty `app/assets/javascripts/application.rb` (replacing `application.js`)
143
+
144
+ ```ruby
145
+ require 'glimmer-dsl-opal' # brings opal and other dependencies automatically
146
+ ```
147
+
148
+ Open a `Document.ready?` block and add inside it Glimmer GUI DSL code or a require statement for one of the samples below.
126
149
 
127
150
  ```ruby
128
151
  Document.ready? do
@@ -130,6 +153,24 @@ Document.ready? do
130
153
  end
131
154
  ```
132
155
 
156
+ Example to confirm setup is working:
157
+
158
+ ```ruby
159
+ Document.ready? do
160
+ include Glimmer
161
+
162
+ shell {
163
+ fill_layout
164
+ text 'Example to confirm setup is working'
165
+ label {
166
+ text "Welcome to Glimmer DSL for Opal!"
167
+ foreground :red
168
+ font height: 24
169
+ }
170
+ }.open
171
+ end
172
+ ```
173
+
133
174
  ## Samples
134
175
 
135
176
  Follow the instructions below to try out [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) samples webified via [glimmer-dsl-opal](https://rubygems.org/gems/glimmer-dsl-opal)
@@ -138,6 +179,8 @@ Also, this external sample app contains all the samples mentioned below configur
138
179
 
139
180
  [https://github.com/AndyObtiva/sample-glimmer-dsl-opal-rails5-app](https://github.com/AndyObtiva/sample-glimmer-dsl-opal-rails5-app)
140
181
 
182
+ Some of the screenshots might be out of date with updates done to samples in both [glimmer-dsl-swt](https://github.com/AndyObtiva/glimmer-dsl-swt) and [glimmer-dsl-opal](https://github.com/AndyObtiva/glimmer-dsl-opal).
183
+
141
184
  ### Hello Samples
142
185
 
143
186
  #### Hello, World!
@@ -1567,6 +1610,39 @@ Glimmer DSL for Opal Contact Manager Edit Done
1567
1610
 
1568
1611
  ![Glimmer DSL for Opal Contact Manager Edit Done](images/glimmer-dsl-opal-contact-manager-edit-done.png)
1569
1612
 
1613
+ ### External Samples
1614
+
1615
+ #### Glimmer Calculator
1616
+
1617
+ Add the [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator) gem to `Gemfile` (without requiring):
1618
+
1619
+ ```
1620
+ gem 'glimmer-cs-calculator', require: false
1621
+ ```
1622
+
1623
+ Add the following require statement to `app/assets/javascripts/application.rb`
1624
+
1625
+ ```ruby
1626
+ require 'glimmer-cs-calculator/launch'
1627
+ ```
1628
+
1629
+ Glimmer app on the desktop (using the [`glimmer-dsl-swt`](https://github.com/AndyObtiva/glimmer-dsl-swt) gem):
1630
+
1631
+ ![Glimmer Calculator Linux](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-linux.png)
1632
+
1633
+ Glimmer app on the web (using `glimmer-dsl-opal` gem):
1634
+
1635
+ Start the Rails server:
1636
+ ```
1637
+ rails s
1638
+ ```
1639
+
1640
+ Visit `http://localhost:3000`
1641
+
1642
+ You should see "Glimmer Calculator"
1643
+
1644
+ ![Glimmer Calculator Opal](https://raw.githubusercontent.com/AndyObtiva/glimmer-cs-calculator/master/glimmer-cs-calculator-screenshot-opal.png)
1645
+
1570
1646
  ## Help
1571
1647
 
1572
1648
  ### Issues
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.4.0
@@ -3,10 +3,13 @@ require 'opal'
3
3
  if RUBY_PLATFORM == 'opal'
4
4
  GLIMMER_DSL_OPAL_ROOT = File.expand_path('../..', __FILE__)
5
5
  GLIMMER_DSL_OPAL_LIB = File.join(GLIMMER_DSL_OPAL_ROOT, 'lib')
6
- GLIMMER_DSL_OPAL_MISSING = File.join(GLIMMER_DSL_OPAL_ROOT, 'lib', 'glimmer-dsl-opal', 'missing')
6
+ # GLIMMER_DSL_OPAL_MISSING = File.join(GLIMMER_DSL_OPAL_ROOT, 'lib', 'glimmer-dsl-opal', 'missing')
7
7
 
8
8
  $LOAD_PATH.unshift(GLIMMER_DSL_OPAL_LIB)
9
- $LOAD_PATH.unshift(GLIMMER_DSL_OPAL_MISSING) # missing Ruby classes/methods
9
+ # $LOAD_PATH.unshift(GLIMMER_DSL_OPAL_MISSING) # missing Ruby classes/methods
10
+ # TODO look into making append_path work (causing some trouble right now)
11
+ # Opal.append_path pd File.expand_path('../glimmer-dsl-opal/missing', __FILE__)
12
+ # Opal.append_path GLIMMER_DSL_OPAL_MISSING
10
13
 
11
14
  require 'opal-parser'
12
15
  require 'native' # move this to opal-async
@@ -18,7 +21,7 @@ if RUBY_PLATFORM == 'opal'
18
21
  require 'facets/hash/symbolize_keys'
19
22
  require 'glimmer-dsl-opal/ext/exception'
20
23
  require 'glimmer-dsl-opal/ext/date'
21
- require 'glimmer-dsl-opal/missing/uri'
24
+ require 'uri'
22
25
 
23
26
  # Spiking async logging
24
27
  # logger = Glimmer::Config.logger
@@ -43,6 +46,7 @@ if RUBY_PLATFORM == 'opal'
43
46
  method = method_symbol.to_s
44
47
  result = false
45
48
  result ||= method == '<<'
49
+ result ||= method == 'handle'
46
50
  end
47
51
 
48
52
  end
@@ -0,0 +1,36 @@
1
+ class OS
2
+ class << self
3
+ def windows?
4
+ # No Op in Opal
5
+ end
6
+
7
+ def mac?
8
+ # No Op in Opal
9
+ end
10
+
11
+ def linux?
12
+ # No Op in Opal
13
+ end
14
+ end
15
+ end
16
+
17
+ class File
18
+ class << self
19
+ def read(*args, &block)
20
+ # No Op in Opal
21
+ end
22
+ end
23
+ end
24
+
25
+ class Display
26
+ class << self
27
+ def setAppName(app_name)
28
+ # No Op in Opal
29
+ end
30
+ def setAppVersion(version)
31
+ # No Op in Opal
32
+ end
33
+ end
34
+ end
35
+
36
+ require 'glimmer-dsl-opal'
@@ -1,16 +1,32 @@
1
+ # Copyright (c) 2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
1
22
  require 'glimmer/dsl/static_expression'
2
- require 'glimmer/dsl/top_level_expression'
3
- require 'glimmer/swt/display_proxy'
23
+ require 'glimmer/dsl/opal/exec_expression'
4
24
 
5
25
  module Glimmer
6
26
  module DSL
7
27
  module Opal
8
28
  class AsyncExecExpression < StaticExpression
9
- include TopLevelExpression
10
-
11
- def interpret(parent, keyword, *args, &block)
12
- Glimmer::SWT::DisplayProxy.instance.async_exec(&block)
13
- end
29
+ include ExecExpression
14
30
  end
15
31
  end
16
32
  end
@@ -25,6 +25,7 @@ require 'glimmer/dsl/parent_expression'
25
25
  require 'glimmer/dsl/top_level_expression'
26
26
  require 'glimmer/ui/custom_widget'
27
27
  require 'glimmer/ui/custom_shell'
28
+ require 'glimmer/swt/make_shift_shell_proxy'
28
29
 
29
30
  module Glimmer
30
31
  module DSL
@@ -42,18 +43,32 @@ module Glimmer
42
43
  custom_widget_class = UI::CustomWidget.for(keyword)
43
44
  # TODO clean code by extracting methods into CustomShell
44
45
  if !Glimmer::UI::CustomShell.requested? && custom_widget_class.ancestors.include?(Glimmer::UI::CustomShell)
45
- options = args.last.is_a?(Hash) ? args.pop : {}
46
- options = options.merge('swt_style' => args.join(',')) unless args.join(',').empty?
47
- params = {
48
- 'custom_shell' => keyword
49
- }.merge(options)
50
- param_string = params.to_a.map {|k, v| "#{k}=#{URI.encode_www_form_component(v)}"}.join('&')
51
- url = "#{`document.location.href`}?#{param_string}"
52
- `window.open(#{url})`
53
- # just a placeholder that has an open method # TODO return an actual CustomShell in the future that does the work happening above in the #open method
54
- Struct.new(:open).new(true)
55
- else
56
- custom_widget_class.new(parent, *args, options, &block)
46
+ if Glimmer::SWT::DisplayProxy.instance.shells.empty?
47
+ custom_widget_class.new(parent, *args, {}, &block)
48
+ else
49
+ options = args.last.is_a?(Hash) ? args.pop : {}
50
+ options = options.merge('swt_style' => args.join(',')) unless args.join(',').empty?
51
+ params = {
52
+ 'custom_shell' => keyword
53
+ }.merge(options)
54
+ param_string = params.to_a.map {|k, v| "#{k}=#{URI.encode_www_form_component(v)}"}.join('&')
55
+ url = "#{`document.location.href`}?#{param_string}"
56
+ `window.open(#{url})`
57
+ # just a placeholder that has an open method # TODO return an actual CustomShell in the future that does the work happening above in the #open method
58
+ Glimmer::SWT::MakeShiftShellProxy.new
59
+ end
60
+ else
61
+ if Glimmer::UI::CustomShell.requested_and_not_handled?
62
+ parameters = Glimmer::UI::CustomShell.request_parameter_string.split("&").map {|str| str.split("=")}.to_h
63
+ `history.pushState(#{parameters.merge('custom_shell_handled' => 'true')}, document.title, #{"?#{Glimmer::UI::CustomShell.encoded_request_parameter_string}&custom_shell_handled=true"})`
64
+ custom_shell_keyword = parameters.delete('custom_shell')
65
+ CustomWidgetExpression.new.interpret(nil, custom_shell_keyword, *[parameters])
66
+ `history.pushState(#{parameters.reject {|k,v| k == 'custom_shell_handled'}}, document.title, #{"?#{Glimmer::UI::CustomShell.encoded_request_parameter_string.sub('&custom_shell_handled=true', '')}"})`
67
+ # just a placeholder that has an open method # TODO return an actual CustomShell in the future that does the work happening above in the #open method
68
+ Glimmer::SWT::MakeShiftShellProxy.new
69
+ else
70
+ custom_widget_class&.new(parent, *args, {}, &block)
71
+ end
57
72
  end
58
73
  end
59
74
 
@@ -0,0 +1,40 @@
1
+ # Copyright (c) 2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer/dsl/static_expression'
23
+ require 'glimmer/dsl/parent_expression'
24
+ require 'glimmer/dsl/top_level_expression'
25
+ require 'glimmer/swt/display_proxy'
26
+
27
+ module Glimmer
28
+ module DSL
29
+ module Opal
30
+ class DisplayExpression < StaticExpression
31
+ include TopLevelExpression
32
+ include ParentExpression
33
+
34
+ def interpret(parent, keyword, *args, &block)
35
+ Glimmer::SWT::DisplayProxy.instance(*args)
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -5,10 +5,12 @@ require 'glimmer/dsl/opal/widget_expression'
5
5
  require 'glimmer/dsl/opal/property_expression'
6
6
  require 'glimmer/dsl/opal/bind_expression'
7
7
  require 'glimmer/dsl/opal/data_binding_expression'
8
+ require 'glimmer/dsl/opal/display_expression'
8
9
  require 'glimmer/dsl/opal/combo_selection_data_binding_expression'
9
10
  require 'glimmer/dsl/opal/widget_listener_expression'
10
11
  require 'glimmer/dsl/opal/message_box_expression'
11
12
  require 'glimmer/dsl/opal/async_exec_expression'
13
+ require 'glimmer/dsl/opal/sync_exec_expression'
12
14
  require 'glimmer/dsl/opal/observe_expression'
13
15
  require 'glimmer/dsl/opal/layout_expression'
14
16
  require 'glimmer/dsl/opal/layout_data_expression'
@@ -0,0 +1,55 @@
1
+ # Copyright (c) 2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer/dsl/top_level_expression'
23
+ require 'glimmer/swt/display_proxy'
24
+
25
+ module Glimmer
26
+ module DSL
27
+ module Opal
28
+ # Mixin for common code in async_exec and sync_exec expressions
29
+ # Uses name in subclass to auto-derive exec_operation
30
+ module ExecExpression
31
+ include TopLevelExpression
32
+
33
+ def exec_operation
34
+ @exec_operation ||= self.class.name.split(/::/).last.sub(/Expression$/, '').underscore
35
+ end
36
+
37
+ def can_interpret?(parent, keyword, *args, &block)
38
+ keyword == exec_operation and
39
+ block_given? and
40
+ args.empty?
41
+ end
42
+
43
+ def interpret(parent, keyword, *args, &block)
44
+ Glimmer::SWT::DisplayProxy.instance.send(exec_operation) do |*args|
45
+ begin
46
+ block.call(*args)
47
+ rescue => e
48
+ Glimmer::Config.logger.error e.full_message
49
+ end
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
55
+ end
@@ -2,6 +2,7 @@ require 'glimmer/dsl/static_expression'
2
2
  require 'glimmer/dsl/top_level_expression'
3
3
  require 'glimmer/dsl/parent_expression'
4
4
  require 'glimmer/swt/shell_proxy'
5
+ require 'glimmer/swt/make_shift_shell_proxy'
5
6
  require 'glimmer/ui/custom_shell'
6
7
  require 'glimmer/dsl/opal/custom_widget_expression'
7
8
 
@@ -12,15 +13,15 @@ module Glimmer
12
13
  include TopLevelExpression
13
14
  include ParentExpression
14
15
 
15
- def interpret(parent, keyword, *args, &block)
16
+ def interpret(parent, keyword, *args, &block)
16
17
  if Glimmer::UI::CustomShell.requested_and_not_handled?
17
18
  parameters = Glimmer::UI::CustomShell.request_parameter_string.split("&").map {|str| str.split("=")}.to_h
18
19
  `history.pushState(#{parameters.merge('custom_shell_handled' => 'true')}, document.title, #{"?#{Glimmer::UI::CustomShell.encoded_request_parameter_string}&custom_shell_handled=true"})`
19
20
  custom_shell_keyword = parameters.delete('custom_shell')
20
21
  CustomWidgetExpression.new.interpret(nil, custom_shell_keyword, *[parameters])
21
22
  `history.pushState(#{parameters.reject {|k,v| k == 'custom_shell_handled'}}, document.title, #{"?#{Glimmer::UI::CustomShell.encoded_request_parameter_string.sub('&custom_shell_handled=true', '')}"})`
22
- # just a placeholder that has an open method # TODO return an actual CustomShell in the future that does the work happening above in the #open method
23
- Struct.new(:open).new(true)
23
+ # just a placeholder that has an open method # TODO return an actual CustomShell in the future that does the work happening above in the #open method
24
+ Glimmer::SWT::MakeShiftShellProxy.new
24
25
  else
25
26
  Glimmer::SWT::ShellProxy.new(*args)
26
27
  end
@@ -0,0 +1,33 @@
1
+ # Copyright (c) 2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ require 'glimmer/dsl/static_expression'
23
+ require 'glimmer/dsl/opal/exec_expression'
24
+
25
+ module Glimmer
26
+ module DSL
27
+ module Opal
28
+ class SyncExecExpression < StaticExpression
29
+ include ExecExpression
30
+ end
31
+ end
32
+ end
33
+ end
@@ -1,12 +1,33 @@
1
1
  module Glimmer
2
2
  module SWT
3
- class DisplayProxy
3
+ class DisplayProxy < WidgetProxy
4
4
  class << self
5
5
  def instance
6
6
  @instance ||= new
7
7
  end
8
8
  end
9
9
 
10
+ def initialize
11
+ # Do not call super
12
+ end
13
+
14
+ def path
15
+ "html body"
16
+ end
17
+
18
+ # Root element representing widget. Must be overridden by subclasses if different from div
19
+ def element
20
+ 'body'
21
+ end
22
+
23
+ def listener_dom_element
24
+ Document
25
+ end
26
+
27
+ def render
28
+ # No rendering as body is rendered as part of ShellProxy.. this class only serves as an SWT Display utility
29
+ end
30
+
10
31
  def async_exec(&block)
11
32
  executer = lambda do
12
33
  if Document.find('.modal').to_a.empty?
@@ -20,6 +41,39 @@ module Glimmer
20
41
  end
21
42
  # sync_exec kept for API compatibility reasons
22
43
  alias sync_exec async_exec
44
+
45
+ def observation_request_to_event_mapping
46
+ {
47
+ 'on_swt_keydown' => [
48
+ {
49
+ event: 'keypress',
50
+ event_handler: -> (event_listener) {
51
+ -> (event) {
52
+ event.singleton_class.define_method(:character) do
53
+ which || key_code
54
+ end
55
+ event_listener.call(event)
56
+ }
57
+ }
58
+ },
59
+ {
60
+ event: 'keydown',
61
+ event_handler: -> (event_listener) {
62
+ -> (event) {
63
+ event.singleton_class.define_method(:character) do
64
+ which || key_code
65
+ end
66
+ event_listener.call(event) if event.key_code != 13 && (event.key_code == 127 || event.key_code <= 31)
67
+ }
68
+ }
69
+ }
70
+ ]
71
+ }
72
+ end
73
+
74
+ def shells
75
+ @shells ||= []
76
+ end
23
77
  end
24
78
  end
25
79
  end
@@ -54,8 +54,8 @@ module Glimmer
54
54
 
55
55
  def margin_height=(pixels)
56
56
  @margin_height = pixels
57
- @parent.dom_element.css('margin-top', @margin_height)
58
- @parent.dom_element.css('margin-bottom', @margin_height)
57
+ @parent.dom_element.css('padding-top', @margin_height)
58
+ @parent.dom_element.css('padding-bottom', @margin_height)
59
59
  end
60
60
 
61
61
  def spacing=(spacing)
@@ -47,8 +47,8 @@ module Glimmer
47
47
 
48
48
  def margin_height=(pixels)
49
49
  @margin_height = pixels
50
- @parent.dom_element.css('margin-top', @margin_height)
51
- @parent.dom_element.css('margin-bottom', @margin_height)
50
+ @parent.dom_element.css('padding-top', @margin_height)
51
+ @parent.dom_element.css('padding-bottom', @margin_height)
52
52
  end
53
53
 
54
54
  def reapply
@@ -59,8 +59,8 @@ module Glimmer
59
59
  grid-row-gap: #{@vertical_spacing}px;
60
60
  grid-column-gap: #{@horizontal_spacing}px;
61
61
  justify-content: start;
62
- align-items: start;
63
- align-content: start;
62
+ place-content: start;
63
+ align-items: stretch;
64
64
  CSS
65
65
  layout_css.split(";").map(&:strip).map {|l| l.split(':').map(&:strip)}.each do |key, value|
66
66
  @parent.dom_element.css(key, value) unless key.nil?
@@ -50,7 +50,7 @@ module Glimmer
50
50
 
51
51
  def vertical_span=(value)
52
52
  @vertical_span = value
53
- @parent.dom_element.css('grid-row-start', "span #{@horizontal_span}")
53
+ @parent.dom_element.css('grid-row-start', "span #{@vertical_span}")
54
54
  reapply
55
55
  end
56
56
 
@@ -0,0 +1,38 @@
1
+ # Copyright (c) 2020 Andy Maleh
2
+ #
3
+ # Permission is hereby granted, free of charge, to any person obtaining
4
+ # a copy of this software and associated documentation files (the
5
+ # "Software"), to deal in the Software without restriction, including
6
+ # without limitation the rights to use, copy, modify, merge, publish,
7
+ # distribute, sublicense, and/or sell copies of the Software, and to
8
+ # permit persons to whom the Software is furnished to do so, subject to
9
+ # the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be
12
+ # included in all copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+ module Glimmer
23
+ module SWT
24
+ class MakeShiftShellProxy < Glimmer::SWT::ShellProxy
25
+ def initialize(*args, &block)
26
+ # No Op
27
+ end
28
+
29
+ def add_child(child)
30
+ # No Op
31
+ end
32
+
33
+ def open
34
+ # No Op
35
+ end
36
+ end
37
+ end
38
+ end
@@ -75,8 +75,8 @@ module Glimmer
75
75
 
76
76
  def margin_height=(pixels)
77
77
  @margin_height = pixels
78
- @parent.dom_element.css('margin-top', @margin_height)
79
- @parent.dom_element.css('margin-bottom', @margin_height)
78
+ @parent.dom_element.css('padding-top', @margin_height)
79
+ @parent.dom_element.css('padding-bottom', @margin_height)
80
80
  end
81
81
 
82
82
  def spacing=(spacing)
@@ -1,4 +1,5 @@
1
1
  require 'glimmer/swt/widget_proxy'
2
+ require 'glimmer/swt/display_proxy'
2
3
  require 'glimmer/swt/point'
3
4
 
4
5
  module Glimmer
@@ -240,6 +241,7 @@ module Glimmer
240
241
  def open
241
242
  # TODO consider the idea of delaying rendering till the open method
242
243
  # TODO make it start as hidden and show shell upon open
244
+ Glimmer::SWT::DisplayProxy.instance.shells << self
243
245
  end
244
246
  end
245
247
  end
@@ -0,0 +1,44 @@
1
+ require 'glimmer/swt/widget_proxy'
2
+ require 'glimmer/swt/text_proxy'
3
+ require 'glimmer/swt/swt_proxy'
4
+
5
+ module Glimmer
6
+ module SWT
7
+ class StyledTextProxy < TextProxy
8
+ attr_reader :alignment, :right_margin, :editable, :caret
9
+
10
+ def alignment=(value)
11
+ @alignment = %w[left center right].detect {|alignment_value| SWTProxy[alignment_value] == value}
12
+ dom_element.css('text-align', @alignment)
13
+ end
14
+
15
+ def right_margin=(value)
16
+ @right_margin = value.to_i
17
+ dom_element.css('padding-right', @right_margin)
18
+ end
19
+
20
+ def editable=(value)
21
+ @editable = value
22
+ if !@editable
23
+ dom_element.attr('disabled', true)
24
+ dom_element.css('background', :white)
25
+ dom_element.css('border', 'solid 1px rgb(118, 118, 118)')
26
+ dom_element.css('border-radius', '3px')
27
+ # :hover {
28
+ # border-color: rgb(80, 80, 80);
29
+ # }
30
+ else
31
+ dom_element.prop('disabled', false)
32
+ dom_element.css('background', nil)
33
+ dom_element.css('border', nil)
34
+ dom_element.css('border-radius', nil)
35
+ end
36
+ end
37
+
38
+ def caret=(value)
39
+ @caret = value
40
+ # TODO implement (not needed for disabling caret though)
41
+ end
42
+ end
43
+ end
44
+ end
@@ -259,6 +259,10 @@ module Glimmer
259
259
  path
260
260
  end
261
261
 
262
+ def listener_dom_element
263
+ Document.find(listener_path)
264
+ end
265
+
262
266
  def can_handle_observation_request?(observation_request)
263
267
  # TODO sort this out for Opal
264
268
  observation_request = observation_request.to_s
@@ -272,19 +276,19 @@ module Glimmer
272
276
  end
273
277
  end
274
278
 
275
- def handle_observation_request(keyword, &event_listener)
279
+ def handle_observation_request(keyword, &event_listener)
276
280
  return unless observation_request_to_event_mapping.keys.include?(keyword)
277
281
  @observation_requests ||= {}
278
282
  @observation_requests[keyword] ||= Set.new
279
283
  event = nil
280
284
  delegate = nil
281
- [observation_request_to_event_mapping[keyword]].flatten.each do |mapping|
285
+ [observation_request_to_event_mapping[keyword]].flatten.each do |mapping|
282
286
  @observation_requests[keyword] << event_listener
283
287
  event = mapping[:event]
284
288
  event_handler = mapping[:event_handler]
285
289
  potential_event_listener = event_handler&.call(event_listener)
286
290
  event_listener = potential_event_listener || event_listener
287
- delegate = Document.find(listener_path).on(event, &event_listener)
291
+ delegate = listener_dom_element.on(event, &event_listener)
288
292
  end
289
293
  # TODO update code below for new WidgetProxy API
290
294
  EventListenerProxy.new(element_proxy: self, event: event, selector: selector, delegate: delegate)
@@ -486,5 +490,6 @@ require 'glimmer/swt/table_column_proxy'
486
490
  require 'glimmer/swt/table_item_proxy'
487
491
  require 'glimmer/swt/table_proxy'
488
492
  require 'glimmer/swt/text_proxy'
493
+ require 'glimmer/swt/styled_text_proxy'
489
494
 
490
495
  require 'glimmer/dsl/opal/widget_expression'
@@ -20,6 +20,7 @@
20
20
  # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
 
22
22
  require 'glimmer/ui/custom_widget'
23
+ require 'glimmer/swt/display_proxy'
23
24
  require 'glimmer/error'
24
25
 
25
26
  module Glimmer
@@ -53,7 +54,7 @@ module Glimmer
53
54
 
54
55
  def initialize(parent, args, options, &content)
55
56
  super(parent, args, options, &content)
56
- raise Error, 'Invalid custom shell body root! Must be a shell or another custom shell.' unless body_root.is_a?(Glimmer::SWT::ShellProxy)
57
+ raise Error, 'Invalid custom shell body root! Must be a shell or another custom shell.' unless body_root.is_a?(Glimmer::SWT::ShellProxy) || body_root.is_a?(Glimmer::UI::CustomShell)
57
58
  end
58
59
 
59
60
  # Classes may override
@@ -152,11 +152,12 @@ module Glimmer
152
152
 
153
153
  def initialize(parent, args, options, &content)
154
154
  @parent = parent
155
- options = args.delete_at(-1) if options.nil? && args.is_a?(Array) && args.last.is_a?(Hash)
155
+ options = args.delete_at(-1) if args.is_a?(Array) && args.last.is_a?(Hash)
156
156
  if args.is_a?(Hash)
157
157
  options = args
158
158
  args = []
159
159
  end
160
+ options ||= {}
160
161
  args = options.delete('swt_style').split(',').map(&:to_sym) if options['swt_style']
161
162
  @args = args
162
163
  @swt_style = SWT::SWTProxy[*@args]
@@ -19,8 +19,8 @@ module URI
19
19
  end
20
20
  end
21
21
 
22
- TBLENCWWWCOMP_ = {"\u0000"=>"%00", "\u0001"=>"%01", "\u0002"=>"%02", "\u0003"=>"%03", "\u0004"=>"%04", "\u0005"=>"%05", "\u0006"=>"%06", "\a"=>"%07", "\b"=>"%08", "\t"=>"%09", "\n"=>"%0A", "\v"=>"%0B", "\f"=>"%0C", "\r"=>"%0D", "\u000E"=>"%0E", "\u000F"=>"%0F", "\u0010"=>"%10", "\u0011"=>"%11", "\u0012"=>"%12", "\u0013"=>"%13", "\u0014"=>"%14", "\u0015"=>"%15", "\u0016"=>"%16", "\u0017"=>"%17", "\u0018"=>"%18", "\u0019"=>"%19", "\u001A"=>"%1A", "\e"=>"%1B", "\u001C"=>"%1C", "\u001D"=>"%1D", "\u001E"=>"%1E", "\u001F"=>"%1F", " "=>"+", "!"=>"%21", "\""=>"%22", "#"=>"%23", "$"=>"%24", "%"=>"%25", "&"=>"%26", "'"=>"%27", "("=>"%28", ")"=>"%29", "*"=>"%2A", "+"=>"%2B", ","=>"%2C", "-"=>"%2D", "."=>"%2E", "/"=>"%2F", "0"=>"%30", "1"=>"%31", "2"=>"%32", "3"=>"%33", "4"=>"%34", "5"=>"%35", "6"=>"%36", "7"=>"%37", "8"=>"%38", "9"=>"%39", ":"=>"%3A", ";"=>"%3B", "<"=>"%3C", "="=>"%3D", ">"=>"%3E", "?"=>"%3F", "@"=>"%40", "A"=>"%41", "B"=>"%42", "C"=>"%43", "D"=>"%44", "E"=>"%45", "F"=>"%46", "G"=>"%47", "H"=>"%48", "I"=>"%49", "J"=>"%4A", "K"=>"%4B", "L"=>"%4C", "M"=>"%4D", "N"=>"%4E", "O"=>"%4F", "P"=>"%50", "Q"=>"%51", "R"=>"%52", "S"=>"%53", "T"=>"%54", "U"=>"%55", "V"=>"%56", "W"=>"%57", "X"=>"%58", "Y"=>"%59", "Z"=>"%5A", "["=>"%5B", "\\"=>"%5C", "]"=>"%5D", "^"=>"%5E", "_"=>"%5F", "`"=>"%60", "a"=>"%61", "b"=>"%62", "c"=>"%63", "d"=>"%64", "e"=>"%65", "f"=>"%66", "g"=>"%67", "h"=>"%68", "i"=>"%69", "j"=>"%6A", "k"=>"%6B", "l"=>"%6C", "m"=>"%6D", "n"=>"%6E", "o"=>"%6F", "p"=>"%70", "q"=>"%71", "r"=>"%72", "s"=>"%73", "t"=>"%74", "u"=>"%75", "v"=>"%76", "w"=>"%77", "x"=>"%78", "y"=>"%79", "z"=>"%7A", "{"=>"%7B", "|"=>"%7C", "}"=>"%7D", "~"=>"%7E", "\u007F"=>"%7F", "\u0080"=>"%80", "\u0081"=>"%81", "\u0082"=>"%82", "\u0083"=>"%83", "\u0084"=>"%84", "\u0085"=>"%85", "\u0086"=>"%86", "\u0087"=>"%87", "\u0088"=>"%88", "\u0089"=>"%89", "\u008A"=>"%8A", "\u008B"=>"%8B", "\u008C"=>"%8C", "\u008D"=>"%8D", "\u008E"=>"%8E", "\u008F"=>"%8F", "\u0090"=>"%90", "\u0091"=>"%91", "\u0092"=>"%92", "\u0093"=>"%93", "\u0094"=>"%94", "\u0095"=>"%95", "\u0096"=>"%96", "\u0097"=>"%97", "\u0098"=>"%98", "\u0099"=>"%99", "\u009A"=>"%9A", "\u009B"=>"%9B", "\u009C"=>"%9C", "\u009D"=>"%9D", "\u009E"=>"%9E", "\u009F"=>"%9F", "\u00A0"=>"%A0", "\u00A1"=>"%A1", "\u00A2"=>"%A2", "\u00A3"=>"%A3", "\u00A4"=>"%A4", "\u00A5"=>"%A5", "\u00A6"=>"%A6", "\u00A7"=>"%A7", "\u00A8"=>"%A8", "\u00A9"=>"%A9", "\u00AA"=>"%AA", "\u00AB"=>"%AB", "\u00AC"=>"%AC", "\u00AD"=>"%AD", "\u00AE"=>"%AE", "\u00AF"=>"%AF", "\u00B0"=>"%B0", "\u00B1"=>"%B1", "\u00B2"=>"%B2", "\u00B3"=>"%B3", "\u00B4"=>"%B4", "\u00B5"=>"%B5", "\u00B6"=>"%B6", "\u00B7"=>"%B7", "\u00B8"=>"%B8", "\u00B9"=>"%B9", "\u00BA"=>"%BA", "\u00BB"=>"%BB", "\u00BC"=>"%BC", "\u00BD"=>"%BD", "\u00BE"=>"%BE", "\u00BF"=>"%BF", "\u00C0"=>"%C0", "\u00C1"=>"%C1", "\u00C2"=>"%C2", "\u00C3"=>"%C3", "\u00C4"=>"%C4", "\u00C5"=>"%C5", "\u00C6"=>"%C6", "\u00C7"=>"%C7", "\u00C8"=>"%C8", "\u00C9"=>"%C9", "\u00CA"=>"%CA", "\u00CB"=>"%CB", "\u00CC"=>"%CC", "\u00CD"=>"%CD", "\u00CE"=>"%CE", "\u00CF"=>"%CF", "\u00D0"=>"%D0", "\u00D1"=>"%D1", "\u00D2"=>"%D2", "\u00D3"=>"%D3", "\u00D4"=>"%D4", "\u00D5"=>"%D5", "\u00D6"=>"%D6", "\u00D7"=>"%D7", "\u00D8"=>"%D8", "\u00D9"=>"%D9", "\u00DA"=>"%DA", "\u00DB"=>"%DB", "\u00DC"=>"%DC", "\u00DD"=>"%DD", "\u00DE"=>"%DE", "\u00DF"=>"%DF", "\u00E0"=>"%E0", "\u00E1"=>"%E1", "\u00E2"=>"%E2", "\u00E3"=>"%E3", "\u00E4"=>"%E4", "\u00E5"=>"%E5", "\u00E6"=>"%E6", "\u00E7"=>"%E7", "\u00E8"=>"%E8", "\u00E9"=>"%E9", "\u00EA"=>"%EA", "\u00EB"=>"%EB", "\u00EC"=>"%EC", "\u00ED"=>"%ED", "\u00EE"=>"%EE", "\u00EF"=>"%EF", "\u00F0"=>"%F0", "\u00F1"=>"%F1", "\u00F2"=>"%F2", "\u00F3"=>"%F3", "\u00F4"=>"%F4", "\u00F5"=>"%F5", "\u00F6"=>"%F6", "\u00F7"=>"%F7", "\u00F8"=>"%F8", "\u00F9"=>"%F9", "\u00FA"=>"%FA", "\u00FB"=>"%FB", "\u00FC"=>"%FC", "\u00FD"=>"%FD", "\u00FE"=>"%FE", "\u00FF"=>"%FF"}.freeze
23
- TBLDECWWWCOMP_ = TBLENCWWWCOMP_.invert.freeze
22
+ TBLENCWWWCOMP_ = {"\u0000"=>"%00", "\u0001"=>"%01", "\u0002"=>"%02", "\u0003"=>"%03", "\u0004"=>"%04", "\u0005"=>"%05", "\u0006"=>"%06", "\a"=>"%07", "\b"=>"%08", "\t"=>"%09", "\n"=>"%0A", "\v"=>"%0B", "\f"=>"%0C", "\r"=>"%0D", "\u000E"=>"%0E", "\u000F"=>"%0F", "\u0010"=>"%10", "\u0011"=>"%11", "\u0012"=>"%12", "\u0013"=>"%13", "\u0014"=>"%14", "\u0015"=>"%15", "\u0016"=>"%16", "\u0017"=>"%17", "\u0018"=>"%18", "\u0019"=>"%19", "\u001A"=>"%1A", "\e"=>"%1B", "\u001C"=>"%1C", "\u001D"=>"%1D", "\u001E"=>"%1E", "\u001F"=>"%1F", " "=>"+", "!"=>"%21", "\""=>"%22", "#"=>"%23", "$"=>"%24", "%"=>"%25", "&"=>"%26", "'"=>"%27", "("=>"%28", ")"=>"%29", "*"=>"%2A", "+"=>"%2B", ","=>"%2C", "-"=>"%2D", "."=>"%2E", "/"=>"%2F", "0"=>"%30", "1"=>"%31", "2"=>"%32", "3"=>"%33", "4"=>"%34", "5"=>"%35", "6"=>"%36", "7"=>"%37", "8"=>"%38", "9"=>"%39", ":"=>"%3A", ";"=>"%3B", "<"=>"%3C", "="=>"%3D", ">"=>"%3E", "?"=>"%3F", "@"=>"%40", "A"=>"%41", "B"=>"%42", "C"=>"%43", "D"=>"%44", "E"=>"%45", "F"=>"%46", "G"=>"%47", "H"=>"%48", "I"=>"%49", "J"=>"%4A", "K"=>"%4B", "L"=>"%4C", "M"=>"%4D", "N"=>"%4E", "O"=>"%4F", "P"=>"%50", "Q"=>"%51", "R"=>"%52", "S"=>"%53", "T"=>"%54", "U"=>"%55", "V"=>"%56", "W"=>"%57", "X"=>"%58", "Y"=>"%59", "Z"=>"%5A", "["=>"%5B", "\\"=>"%5C", "]"=>"%5D", "^"=>"%5E", "_"=>"%5F", "`"=>"%60", "a"=>"%61", "b"=>"%62", "c"=>"%63", "d"=>"%64", "e"=>"%65", "f"=>"%66", "g"=>"%67", "h"=>"%68", "i"=>"%69", "j"=>"%6A", "k"=>"%6B", "l"=>"%6C", "m"=>"%6D", "n"=>"%6E", "o"=>"%6F", "p"=>"%70", "q"=>"%71", "r"=>"%72", "s"=>"%73", "t"=>"%74", "u"=>"%75", "v"=>"%76", "w"=>"%77", "x"=>"%78", "y"=>"%79", "z"=>"%7A", "{"=>"%7B", "|"=>"%7C", "}"=>"%7D", "~"=>"%7E", "\u007F"=>"%7F", "\u0080"=>"%80", "\u0081"=>"%81", "\u0082"=>"%82", "\u0083"=>"%83", "\u0084"=>"%84", "\u0085"=>"%85", "\u0086"=>"%86", "\u0087"=>"%87", "\u0088"=>"%88", "\u0089"=>"%89", "\u008A"=>"%8A", "\u008B"=>"%8B", "\u008C"=>"%8C", "\u008D"=>"%8D", "\u008E"=>"%8E", "\u008F"=>"%8F", "\u0090"=>"%90", "\u0091"=>"%91", "\u0092"=>"%92", "\u0093"=>"%93", "\u0094"=>"%94", "\u0095"=>"%95", "\u0096"=>"%96", "\u0097"=>"%97", "\u0098"=>"%98", "\u0099"=>"%99", "\u009A"=>"%9A", "\u009B"=>"%9B", "\u009C"=>"%9C", "\u009D"=>"%9D", "\u009E"=>"%9E", "\u009F"=>"%9F", "\u00A0"=>"%A0", "\u00A1"=>"%A1", "\u00A2"=>"%A2", "\u00A3"=>"%A3", "\u00A4"=>"%A4", "\u00A5"=>"%A5", "\u00A6"=>"%A6", "\u00A7"=>"%A7", "\u00A8"=>"%A8", "\u00A9"=>"%A9", "\u00AA"=>"%AA", "\u00AB"=>"%AB", "\u00AC"=>"%AC", "\u00AD"=>"%AD", "\u00AE"=>"%AE", "\u00AF"=>"%AF", "\u00B0"=>"%B0", "\u00B1"=>"%B1", "\u00B2"=>"%B2", "\u00B3"=>"%B3", "\u00B4"=>"%B4", "\u00B5"=>"%B5", "\u00B6"=>"%B6", "\u00B7"=>"%B7", "\u00B8"=>"%B8", "\u00B9"=>"%B9", "\u00BA"=>"%BA", "\u00BB"=>"%BB", "\u00BC"=>"%BC", "\u00BD"=>"%BD", "\u00BE"=>"%BE", "\u00BF"=>"%BF", "\u00C0"=>"%C0", "\u00C1"=>"%C1", "\u00C2"=>"%C2", "\u00C3"=>"%C3", "\u00C4"=>"%C4", "\u00C5"=>"%C5", "\u00C6"=>"%C6", "\u00C7"=>"%C7", "\u00C8"=>"%C8", "\u00C9"=>"%C9", "\u00CA"=>"%CA", "\u00CB"=>"%CB", "\u00CC"=>"%CC", "\u00CD"=>"%CD", "\u00CE"=>"%CE", "\u00CF"=>"%CF", "\u00D0"=>"%D0", "\u00D1"=>"%D1", "\u00D2"=>"%D2", "\u00D3"=>"%D3", "\u00D4"=>"%D4", "\u00D5"=>"%D5", "\u00D6"=>"%D6", "\u00D7"=>"%D7", "\u00D8"=>"%D8", "\u00D9"=>"%D9", "\u00DA"=>"%DA", "\u00DB"=>"%DB", "\u00DC"=>"%DC", "\u00DD"=>"%DD", "\u00DE"=>"%DE", "\u00DF"=>"%DF", "\u00E0"=>"%E0", "\u00E1"=>"%E1", "\u00E2"=>"%E2", "\u00E3"=>"%E3", "\u00E4"=>"%E4", "\u00E5"=>"%E5", "\u00E6"=>"%E6", "\u00E7"=>"%E7", "\u00E8"=>"%E8", "\u00E9"=>"%E9", "\u00EA"=>"%EA", "\u00EB"=>"%EB", "\u00EC"=>"%EC", "\u00ED"=>"%ED", "\u00EE"=>"%EE", "\u00EF"=>"%EF", "\u00F0"=>"%F0", "\u00F1"=>"%F1", "\u00F2"=>"%F2", "\u00F3"=>"%F3", "\u00F4"=>"%F4", "\u00F5"=>"%F5", "\u00F6"=>"%F6", "\u00F7"=>"%F7", "\u00F8"=>"%F8", "\u00F9"=>"%F9", "\u00FA"=>"%FA", "\u00FB"=>"%FB", "\u00FC"=>"%FC", "\u00FD"=>"%FD", "\u00FE"=>"%FE", "\u00FF"=>"%FF"}
23
+ TBLDECWWWCOMP_ = TBLENCWWWCOMP_.invert
24
24
 
25
25
  # Encodes given +str+ to URL-encoded form data.
26
26
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glimmer-dsl-opal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AndyMaleh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-13 00:00:00.000000000 Z
11
+ date: 2020-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: glimmer
@@ -212,8 +212,6 @@ files:
212
212
  - lib/glimmer-dsl-opal.rb
213
213
  - lib/glimmer-dsl-opal/ext/date.rb
214
214
  - lib/glimmer-dsl-opal/ext/exception.rb
215
- - lib/glimmer-dsl-opal/missing/net/http.rb
216
- - lib/glimmer-dsl-opal/missing/uri.rb
217
215
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager.rb
218
216
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact.rb
219
217
  - lib/glimmer-dsl-opal/samples/elaborate/contact_manager/contact_manager_presenter.rb
@@ -233,6 +231,7 @@ files:
233
231
  - lib/glimmer-dsl-opal/samples/hello/hello_tab.rb
234
232
  - lib/glimmer-dsl-opal/samples/hello/hello_world.rb
235
233
  - lib/glimmer-dsl-opal/vendor/jquery.js
234
+ - lib/glimmer-dsl-swt.rb
236
235
  - lib/glimmer/data_binding/element_binding.rb
237
236
  - lib/glimmer/data_binding/ext/observable_model.rb
238
237
  - lib/glimmer/data_binding/list_selection_binding.rb
@@ -245,7 +244,9 @@ files:
245
244
  - lib/glimmer/dsl/opal/combo_selection_data_binding_expression.rb
246
245
  - lib/glimmer/dsl/opal/custom_widget_expression.rb
247
246
  - lib/glimmer/dsl/opal/data_binding_expression.rb
247
+ - lib/glimmer/dsl/opal/display_expression.rb
248
248
  - lib/glimmer/dsl/opal/dsl.rb
249
+ - lib/glimmer/dsl/opal/exec_expression.rb
249
250
  - lib/glimmer/dsl/opal/font_expression.rb
250
251
  - lib/glimmer/dsl/opal/layout_data_expression.rb
251
252
  - lib/glimmer/dsl/opal/layout_expression.rb
@@ -257,6 +258,7 @@ files:
257
258
  - lib/glimmer/dsl/opal/rgba_expression.rb
258
259
  - lib/glimmer/dsl/opal/shell_expression.rb
259
260
  - lib/glimmer/dsl/opal/swt_expression.rb
261
+ - lib/glimmer/dsl/opal/sync_exec_expression.rb
260
262
  - lib/glimmer/dsl/opal/table_column_expression.rb
261
263
  - lib/glimmer/dsl/opal/table_expression.rb
262
264
  - lib/glimmer/dsl/opal/table_items_data_binding_expression.rb
@@ -277,12 +279,14 @@ files:
277
279
  - lib/glimmer/swt/layout_data_proxy.rb
278
280
  - lib/glimmer/swt/layout_proxy.rb
279
281
  - lib/glimmer/swt/list_proxy.rb
282
+ - lib/glimmer/swt/make_shift_shell_proxy.rb
280
283
  - lib/glimmer/swt/message_box_proxy.rb
281
284
  - lib/glimmer/swt/point.rb
282
285
  - lib/glimmer/swt/property_owner.rb
283
286
  - lib/glimmer/swt/row_layout_proxy.rb
284
287
  - lib/glimmer/swt/shell_proxy.rb
285
288
  - lib/glimmer/swt/style_constantizable.rb
289
+ - lib/glimmer/swt/styled_text_proxy.rb
286
290
  - lib/glimmer/swt/swt_proxy.rb
287
291
  - lib/glimmer/swt/tab_folder_proxy.rb
288
292
  - lib/glimmer/swt/tab_item_proxy.rb
@@ -294,6 +298,8 @@ files:
294
298
  - lib/glimmer/ui/custom_shell.rb
295
299
  - lib/glimmer/ui/custom_widget.rb
296
300
  - lib/glimmer/util/proc_tracker.rb
301
+ - lib/net/http.rb
302
+ - lib/uri.rb
297
303
  homepage: http://github.com/AndyObtiva/glimmer-dsl-opal
298
304
  licenses:
299
305
  - MIT