glimmer-dsl-swt 4.18.4.2 → 4.18.4.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +33 -0
- data/README.md +84 -5072
- data/VERSION +1 -1
- data/docs/reference/GLIMMER_COMMAND.md +591 -0
- data/docs/reference/GLIMMER_CONFIGURATION.md +183 -0
- data/docs/reference/GLIMMER_GIRB.md +30 -0
- data/docs/reference/GLIMMER_GUI_DSL_SYNTAX.md +3276 -0
- data/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md +202 -0
- data/docs/reference/GLIMMER_SAMPLES.md +676 -0
- data/docs/reference/GLIMMER_STYLE_GUIDE.md +14 -0
- data/glimmer-dsl-swt.gemspec +16 -8
- data/lib/glimmer/dsl/swt/custom_widget_expression.rb +3 -3
- data/lib/glimmer/dsl/swt/exec_expression.rb +1 -1
- data/lib/glimmer/dsl/swt/observe_expression.rb +8 -5
- data/lib/glimmer/dsl/swt/pixel_expression.rb +38 -0
- data/lib/glimmer/dsl/swt/timer_exec_expression.rb +35 -0
- data/lib/glimmer/dsl/swt/widget_expression.rb +1 -0
- data/lib/glimmer/swt/custom/animation.rb +9 -8
- data/lib/glimmer/swt/custom/code_text.rb +24 -20
- data/lib/glimmer/swt/custom/drawable.rb +21 -5
- data/lib/glimmer/swt/custom/shape.rb +62 -57
- data/lib/glimmer/swt/display_proxy.rb +11 -10
- data/lib/glimmer/swt/properties.rb +35 -10
- data/lib/glimmer/swt/shell_proxy.rb +1 -1
- data/lib/glimmer/swt/widget_proxy.rb +16 -3
- data/lib/glimmer/ui/custom_widget.rb +17 -0
- data/samples/elaborate/mandelbrot_fractal.rb +103 -0
- data/samples/elaborate/meta_sample.rb +1 -1
- data/samples/elaborate/tetris.rb +20 -21
- data/samples/elaborate/tetris/view/playfield.rb +1 -1
- data/samples/elaborate/tetris/view/tetris_menu_bar.rb +13 -11
- data/samples/hello/hello_canvas_transform.rb +1 -1
- metadata +14 -6
- data/samples/elaborate/meta_sample/meta_sample_logo.png +0 -0
- data/samples/hello/hello_canvas_transform/hello_canvas_transform_image.png +0 -0
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
4.18.4.
|
1
|
+
4.18.4.7
|
@@ -0,0 +1,591 @@
|
|
1
|
+
## Glimmer Command
|
2
|
+
|
3
|
+
The `glimmer` command allows you to run, scaffold, package, and list Glimmer applications/gems.
|
4
|
+
|
5
|
+
You can bring up usage instructions by running the `glimmer` command without arguments:
|
6
|
+
|
7
|
+
```
|
8
|
+
glimmer
|
9
|
+
```
|
10
|
+
|
11
|
+
On Mac and Linux, it additionally brings up a TUI (Text-based User Interface) for interactive navigation and execution of Glimmer tasks (courtesy of [rake-tui](https://github.com/AndyObtiva/rake-tui)).
|
12
|
+
|
13
|
+
On Windows, it simply lists the available Glimmer tasks at the end (courtsey of [rake](https://github.com/ruby/rake)).
|
14
|
+
|
15
|
+
If you are new to Glimmer, you may read the Basic Usage section and skip the rest until you have gone through [Girb (Glimmer irb) Command](#girb-glimmer-irb-command), [Glimmer GUI DSL Syntax](#glimmer-gui-dsl-syntax), and [Samples](#samples).
|
16
|
+
|
17
|
+
Note: If you encounter an issue running the `glimmer` command, run `bundle exec glimmer` instead.
|
18
|
+
|
19
|
+
### Basic Usage
|
20
|
+
|
21
|
+
```
|
22
|
+
glimmer application.rb
|
23
|
+
```
|
24
|
+
|
25
|
+
Runs a Glimmer application using JRuby, automatically preloading
|
26
|
+
the glimmer ruby gem and SWT jar dependency.
|
27
|
+
|
28
|
+
Run Glimmer samples with:
|
29
|
+
|
30
|
+
```
|
31
|
+
glimmer samples
|
32
|
+
```
|
33
|
+
This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples)
|
34
|
+
|
35
|
+
If you cloned this project locally instead of installing the gem, run `bin/glimmer` instead.
|
36
|
+
|
37
|
+
Example:
|
38
|
+
```
|
39
|
+
bin/glimmer samples
|
40
|
+
```
|
41
|
+
|
42
|
+
### Advanced Usage
|
43
|
+
|
44
|
+
Below are the full usage instructions that come up when running `glimmer` without args.
|
45
|
+
|
46
|
+
```
|
47
|
+
Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.18.4.4
|
48
|
+
|
49
|
+
Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args]) [[application2.rb]...]
|
50
|
+
|
51
|
+
Runs Glimmer applications and tasks.
|
52
|
+
|
53
|
+
When applications are specified, they are run using JRuby,
|
54
|
+
automatically preloading the glimmer Ruby gem and SWT jar dependency.
|
55
|
+
|
56
|
+
Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.
|
57
|
+
|
58
|
+
Glimmer options:
|
59
|
+
- "--bundler=GROUP" : Activates gems in Bundler default group in Gemfile
|
60
|
+
- "--pd=BOOLEAN" : Requires puts_debuggerer to enable pd method
|
61
|
+
- "--quiet=BOOLEAN" : Does not announce file path of Glimmer application being launched
|
62
|
+
- "--debug" : Displays extra debugging information, passes "--debug" to JRuby, and enables debug logging
|
63
|
+
- "--log-level=VALUE" : Sets Glimmer's Ruby logger level ("ERROR" / "WARN" / "INFO" / "DEBUG"; default is none)
|
64
|
+
|
65
|
+
Tasks are run via rake. Some tasks take arguments in square brackets.
|
66
|
+
|
67
|
+
Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):
|
68
|
+
|
69
|
+
Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and letters to filter)
|
70
|
+
‣ glimmer list:gems:customshell[query] # List Glimmer custom shell gems available at rubygems.org (query is optional) [alt: list:gems:cs]
|
71
|
+
glimmer list:gems:customwidget[query] # List Glimmer custom widget gems available at rubygems.org (query is optional) [alt: list:gems:cw]
|
72
|
+
glimmer list:gems:dsl[query] # List Glimmer DSL gems available at rubygems.org (query is optional)
|
73
|
+
glimmer package[type] # Package app for distribution (generating config, jar, and native files) (type is optional)
|
74
|
+
glimmer package:clean # Clean by removing "dist" and "packages" directories
|
75
|
+
glimmer package:config # Generate JAR config file
|
76
|
+
glimmer package:gem # Generate gem under pkg directory
|
77
|
+
glimmer package:gemspec # Generate gemspec
|
78
|
+
glimmer package:jar # Generate JAR file
|
79
|
+
glimmer package:lock_jars # Lock JARs
|
80
|
+
glimmer package:native[type] # Generate Native files
|
81
|
+
glimmer run[app_path] # Runs Glimmer app or custom shell gem in the current directory, unless app_path is specified, then runs it instead (app_path is optional)
|
82
|
+
glimmer samples # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
|
83
|
+
glimmer scaffold[app_name] # Scaffold Glimmer application directory structure to build a new app
|
84
|
+
glimmer scaffold:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
|
85
|
+
glimmer scaffold:customwidget[name,namespace] # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cw]
|
86
|
+
glimmer scaffold:gem:customshell[name,namespace] # Scaffold Glimmer::UI::CustomShell subclass (full window view) under its own Ruby gem + app project (namespace is required) [alt: scaffold:ge...
|
87
|
+
glimmer scaffold:gem:customwidget[name,namespace] # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cw]
|
88
|
+
```
|
89
|
+
|
90
|
+
Example (Glimmer/JRuby option specified):
|
91
|
+
```
|
92
|
+
glimmer --debug samples/hello/hello_world.rb
|
93
|
+
```
|
94
|
+
|
95
|
+
Runs Glimmer application with JRuby debug option to enable JRuby debugging.
|
96
|
+
|
97
|
+
Example (Multiple apps):
|
98
|
+
```
|
99
|
+
glimmer samples/hello/hello_world.rb samples/hello/hello_tab.rb
|
100
|
+
```
|
101
|
+
|
102
|
+
Launches samples/hello/hello_world.rb and samples/hello_tab.rb at the same time, each in a separate JRuby thread.
|
103
|
+
|
104
|
+
Note: under Zsh (Z Shell), glimmer can only be used in its advanced TUI mode (e.g. `glimmer` and then selecting a task) not the primitive rake task mode (e.g. `glimmer scaffold[app]`)
|
105
|
+
|
106
|
+
### Glimmer Samples
|
107
|
+
|
108
|
+
You can list available Glimmer samples by running:
|
109
|
+
|
110
|
+
```
|
111
|
+
glimmer samples
|
112
|
+
```
|
113
|
+
|
114
|
+
This brings up the [Glimmer Meta-Sample (The Sample of Samples)](#samples):
|
115
|
+
|
116
|
+
![Glimmer Meta-Sample](/images/glimmer-meta-sample.png)
|
117
|
+
|
118
|
+
### Scaffolding
|
119
|
+
|
120
|
+
Glimmer borrows from Rails the idea of Scaffolding, that is generating a structure for your app files that
|
121
|
+
helps you get started just like true building scaffolding helps construction workers, civil engineers, and architects.
|
122
|
+
|
123
|
+
Glimmer scaffolding goes beyond just scaffolding the app files that Rails does. It also packages it and launches it,
|
124
|
+
getting you to a running and delivered state of an advanced "Hello, World!" Glimmer application right off the bat.
|
125
|
+
|
126
|
+
This should greatly facilitate building a new Glimmer app by helping you be productive and focus on app details while
|
127
|
+
letting Glimmer scaffolding take care of initial app file structure concerns, such as adding:
|
128
|
+
- Main application class that includes Glimmer (`app/{app_name}.rb`)
|
129
|
+
- Main application view that houses main window content, menu, about dialog, and preferences dialog
|
130
|
+
- View and Model directories (`app/views` and `app/models`)
|
131
|
+
- Rakefile including Glimmer tasks (`Rakefile`)
|
132
|
+
- Version (`VERSION`)
|
133
|
+
- License (`LICENSE.txt`)
|
134
|
+
- Icon (under `package/{platform}/{App Name}.{icon_extension}` for `macosx` .icns, `windows` .ico, and `linux` .png)
|
135
|
+
- Bin file for starting application (`bin/{app_name}.rb`)
|
136
|
+
|
137
|
+
You need to have your Git `user.name` and `github.user` configured before scaffolding since Glimmer uses Juwelier, which relies on them in creating a Git repo for your Glimmer app.
|
138
|
+
|
139
|
+
#### App
|
140
|
+
|
141
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
142
|
+
|
143
|
+
To scaffold a Glimmer app from scratch, run the following command:
|
144
|
+
|
145
|
+
```
|
146
|
+
glimmer scaffold[AppName]
|
147
|
+
```
|
148
|
+
|
149
|
+
This will generate an advanced "Hello, World!" app, package it as a Mac DMG/PKG/APP, Windows APP, or Linux GEM, and launch it all in one fell swoop.
|
150
|
+
|
151
|
+
Suppose you run:
|
152
|
+
|
153
|
+
```
|
154
|
+
glimmer scaffold[greeter]
|
155
|
+
```
|
156
|
+
|
157
|
+
You should see output like the following:
|
158
|
+
|
159
|
+
```
|
160
|
+
$ glimmer scaffold[greeter]
|
161
|
+
create .gitignore
|
162
|
+
create Rakefile
|
163
|
+
create Gemfile
|
164
|
+
create LICENSE.txt
|
165
|
+
create README.rdoc
|
166
|
+
create .document
|
167
|
+
create lib
|
168
|
+
create lib/greeter.rb
|
169
|
+
create spec
|
170
|
+
create spec/spec_helper.rb
|
171
|
+
create spec/greeter_spec.rb
|
172
|
+
create .rspec
|
173
|
+
Juwelier has prepared your gem in ./greeter
|
174
|
+
Created greeter/.gitignore
|
175
|
+
Created greeter/.ruby-version
|
176
|
+
Created greeter/.ruby-gemset
|
177
|
+
Created greeter/VERSION
|
178
|
+
Created greeter/LICENSE.txt
|
179
|
+
Created greeter/Gemfile
|
180
|
+
Created greeter/Rakefile
|
181
|
+
Created greeter/app/greeter.rb
|
182
|
+
Created greeter/app/views/greeter/app_view.rb
|
183
|
+
Created greeter/package/windows/Greeter.ico
|
184
|
+
Created greeter/package/macosx/Greeter.icns
|
185
|
+
Created greeter/package/linux/Greeter.png
|
186
|
+
Created greeter/bin/greeter
|
187
|
+
Created greeter/spec/spec_helper.rb
|
188
|
+
...
|
189
|
+
```
|
190
|
+
|
191
|
+
Eventually, it will launch an advanced "Hello, World!" app window having the title of your application ("Greeter").
|
192
|
+
|
193
|
+
![Glimmer Scaffold App](/images/glimmer-scaffolding-app.png)
|
194
|
+
|
195
|
+
It also comes with a boilerplate Preferences dialog.
|
196
|
+
|
197
|
+
![Glimmer Scaffold App Preferences](/images/glimmer-scaffolding-app-preferences.png)
|
198
|
+
|
199
|
+
Here is the Windows version of the scaffolded "Greeter" app:
|
200
|
+
|
201
|
+
![Glimmer Scaffold App Windows](/images/glimmer-scaffolding-app-windows.png)
|
202
|
+
|
203
|
+
And, here is the Windows version of the boilerplate Preferences dialog.
|
204
|
+
|
205
|
+
![Glimmer Scaffold App Windows Preferences](/images/glimmer-scaffolding-app-windows-preferences.png)
|
206
|
+
|
207
|
+
In order to run the app after making changes, you must run the `glimmer run`. It automatically detects the generated run script under the `bin` directory and uses it as an argument.
|
208
|
+
|
209
|
+
```
|
210
|
+
glimmer run
|
211
|
+
```
|
212
|
+
|
213
|
+
Alternatively, to mantually run the app, you may type:
|
214
|
+
|
215
|
+
```
|
216
|
+
glimmer run[bin/greeter]
|
217
|
+
```
|
218
|
+
|
219
|
+
or:
|
220
|
+
|
221
|
+
```
|
222
|
+
glimmer bin/greeter
|
223
|
+
```
|
224
|
+
|
225
|
+
#### Desktopify
|
226
|
+
|
227
|
+
Desktopify basically turns a website into a desktop application by wrapping the website within a [Browser Widget](#browser-widget).
|
228
|
+
|
229
|
+
The desktopify app is similar to the standard scaffolded app. It can be extended and the [browser may even be instrumented](https://help.eclipse.org/2020-09/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/swt/browser/Browser.html).
|
230
|
+
|
231
|
+
The app even remembers your cookies if you log into the website, close the app, and reopen again.
|
232
|
+
|
233
|
+
Note that on Linux, the default SWT browser, which runs on webkit, does not support HTML5 Video out of the box. If you need video support, open `Gemfile` after scaffolding and enable the line that has the `glimmer-cw-browser-chromium` gem then replace the `browser` in "app/views/snowboard_utah/app_view.rb" with `browser(:chromium)`
|
234
|
+
|
235
|
+
Before you start, make sure you are in a JRuby environment with Glimmer gem installed as per "Direct Install" pre-requisites.
|
236
|
+
|
237
|
+
To scaffold a Glimmer desktopify app from scratch, run the following command:
|
238
|
+
|
239
|
+
```
|
240
|
+
glimmer scaffold:desktopify[app_name,website]
|
241
|
+
```
|
242
|
+
|
243
|
+
This will generate a Glimmer app, package it as a Mac DMG/PKG/APP, Windows APP, or Linux GEM, and launch it all in one fell swoop.
|
244
|
+
|
245
|
+
Suppose you run:
|
246
|
+
|
247
|
+
```
|
248
|
+
glimmer scaffold:desktopify[snowboard_utah,https://www.brightonresort.com]
|
249
|
+
```
|
250
|
+
|
251
|
+
You should see output like the following:
|
252
|
+
|
253
|
+
```
|
254
|
+
$ glimmer scaffold:desktopify[snowboard_utah,https://www.brightonresort.com]
|
255
|
+
Fetching kamelcase-0.0.2.gem
|
256
|
+
Fetching github_api-0.19.0.gem
|
257
|
+
Fetching highline-2.0.3.gem
|
258
|
+
Fetching juwelier-2.4.9.gem
|
259
|
+
Fetching hashie-3.6.0.gem
|
260
|
+
Fetching nokogiri-1.10.10-java.gem
|
261
|
+
Fetching semver2-3.4.2.gem
|
262
|
+
Successfully installed semver2-3.4.2
|
263
|
+
Successfully installed kamelcase-0.0.2
|
264
|
+
Successfully installed highline-2.0.3
|
265
|
+
Successfully installed hashie-3.6.0
|
266
|
+
Successfully installed github_api-0.19.0
|
267
|
+
Successfully installed nokogiri-1.10.10-java
|
268
|
+
Successfully installed juwelier-2.4.9
|
269
|
+
7 gems installed
|
270
|
+
create .gitignore
|
271
|
+
create Rakefile
|
272
|
+
create Gemfile
|
273
|
+
create LICENSE.txt
|
274
|
+
create README.markdown
|
275
|
+
create .document
|
276
|
+
create lib
|
277
|
+
create lib/snowboard_utah.rb
|
278
|
+
create .rspec
|
279
|
+
Juwelier has prepared your gem in ./snowboard_utah
|
280
|
+
Created snowboard_utah/.gitignore
|
281
|
+
Created snowboard_utah/.ruby-version
|
282
|
+
Created snowboard_utah/.ruby-gemset
|
283
|
+
Created snowboard_utah/VERSION
|
284
|
+
Created snowboard_utah/LICENSE.txt
|
285
|
+
Created snowboard_utah/Gemfile
|
286
|
+
Created snowboard_utah/Rakefile
|
287
|
+
Created snowboard_utah/app/snowboard_utah.rb
|
288
|
+
Created snowboard_utah/app/views/snowboard_utah/app_view.rb
|
289
|
+
Created snowboard_utah/package/windows/Snowboard Utah.ico
|
290
|
+
Created snowboard_utah/package/macosx/Snowboard Utah.icns
|
291
|
+
Created snowboard_utah/package/linux/Snowboard Utah.png
|
292
|
+
Created snowboard_utah/bin/snowboard_utah
|
293
|
+
...
|
294
|
+
```
|
295
|
+
|
296
|
+
Eventually, it will launch a desktopified version of "https://www.brightonresort.com" having the title of ("Snowboard Utah").
|
297
|
+
|
298
|
+
Desktopified App on Mac
|
299
|
+
|
300
|
+
![Glimmer Scaffold App](/images/glimmer-scaffolding-desktopify.png)
|
301
|
+
|
302
|
+
It also comes with a boilerplate About dialog.
|
303
|
+
|
304
|
+
![Glimmer Scaffold App About](/images/glimmer-scaffolding-desktopify-about.png)
|
305
|
+
|
306
|
+
Desktopified App on Windows
|
307
|
+
|
308
|
+
![Glimmer Scaffold App](/images/glimmer-scaffolding-desktopify-windows.png)
|
309
|
+
|
310
|
+
Desktopified App on Linux
|
311
|
+
|
312
|
+
![Glimmer Scaffold App](/images/glimmer-scaffolding-desktopify-linux.png)
|
313
|
+
|
314
|
+
In order to run the app after making changes, you must run the `glimmer run`. It automatically detects the generated run script under the `bin` directory and uses it as an argument.
|
315
|
+
|
316
|
+
```
|
317
|
+
glimmer run
|
318
|
+
```
|
319
|
+
|
320
|
+
#### Custom Shell
|
321
|
+
|
322
|
+
To scaffold a Glimmer [custom shell](#custom-shells) (full window view) for an existing Glimmer app, run the following command:
|
323
|
+
|
324
|
+
```
|
325
|
+
glimmer scaffold:customshell[name]
|
326
|
+
```
|
327
|
+
|
328
|
+
Or the following alternative abbreviation:
|
329
|
+
|
330
|
+
```
|
331
|
+
glimmer scaffold:cs[name]
|
332
|
+
```
|
333
|
+
|
334
|
+
#### Custom Widget
|
335
|
+
|
336
|
+
To scaffold a Glimmer [custom widget](#custom-widgets) (part of a view) for an existing Glimmer app, run the following command:
|
337
|
+
|
338
|
+
```
|
339
|
+
glimmer scaffold:customwidget[name]
|
340
|
+
```
|
341
|
+
|
342
|
+
Or the following alternative abbreviation:
|
343
|
+
|
344
|
+
```
|
345
|
+
glimmer scaffold:cw[name]
|
346
|
+
```
|
347
|
+
|
348
|
+
#### Custom Shell Gem
|
349
|
+
|
350
|
+
Custom shell gems are self-contained Glimmer apps as well as reusable [custom shells](#custom-shells).
|
351
|
+
They have everything scaffolded Glimmer apps come with in addition to gem content like a [Juwelier](https://rubygems.org/gems/juwelier) Rakefile that can build gemspec and release gems.
|
352
|
+
Unlike scaffolded Glimmer apps, custom shell gem content lives under the `lib` directory (not `app`).
|
353
|
+
They can be packaged as both a native executable (e.g. Mac DMG/PKG/APP) and a Ruby gem.
|
354
|
+
Of course, you can just build a Ruby gem and disregard native executable packaging if you do not need it.
|
355
|
+
|
356
|
+
To scaffold a Glimmer custom shell gem (full window view distributed as a Ruby gem), run the following command:
|
357
|
+
|
358
|
+
```
|
359
|
+
glimmer scaffold:gem:customshell[name,namespace]
|
360
|
+
```
|
361
|
+
|
362
|
+
Or the following alternative abbreviation:
|
363
|
+
|
364
|
+
```
|
365
|
+
glimmer scaffold:gem:cs[name,namespace]
|
366
|
+
```
|
367
|
+
|
368
|
+
It is important to specify a namespace to avoid having your gem clash with existing gems.
|
369
|
+
|
370
|
+
The Ruby gem name will follow the convention "glimmer-cs-customwidgetname-namespace" (the 'cs' is for Custom Shell).
|
371
|
+
|
372
|
+
Only official Glimmer gems created by the Glimmer project committers will have no namespace (e.g. [glimmer-cs-gladiator](https://rubygems.org/gems/glimmer-cs-gladiator) Ruby gem)
|
373
|
+
|
374
|
+
Since custom shell gems are both an app and a gem, they provide two ways to run:
|
375
|
+
- Run the `glimmer` command and pass it the generated script under the `bin` directory that matches the gem name (e.g. run `glimmer bin/glimmer-cs-calculator`)
|
376
|
+
- Run the executable shell script that ships with the gem directly (does not need the `glimmer` command). It intentionally has a shorter name for convenience since it is meant to be used on the command line (not in a package), so you can leave out the `glimmer-cs-` prefix (e.g. run `bin/calculator` directly). This is also used as the main way of running custom shell gems on Linux.
|
377
|
+
|
378
|
+
Examples:
|
379
|
+
|
380
|
+
- [glimmer-cs-gladiator](https://github.com/AndyObtiva/glimmer-cs-gladiator): Gladiator (Glimmer Editor)
|
381
|
+
- [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator): Glimmer Calculator
|
382
|
+
|
383
|
+
#### Custom Widget Gem
|
384
|
+
|
385
|
+
To scaffold a Glimmer [custom widget](#custom-widgets) gem (part of a view distributed as a Ruby gem), run the following command:
|
386
|
+
|
387
|
+
```
|
388
|
+
glimmer scaffold:gem:customwidget[name,namespace]
|
389
|
+
```
|
390
|
+
|
391
|
+
Or the following alternative abbreviation:
|
392
|
+
|
393
|
+
```
|
394
|
+
glimmer scaffold:gem:cw[name,namespace]
|
395
|
+
```
|
396
|
+
|
397
|
+
|
398
|
+
It is important to specify a namespace to avoid having your gem clash with existing gems.
|
399
|
+
|
400
|
+
The Ruby gem name will follow the convention "glimmer-cw-customwidgetname-namespace" (the 'cw' is for Custom Widget)
|
401
|
+
|
402
|
+
Only official Glimmer gems created by the Glimmer project committers will have no namespace (e.g. [glimmer-cw-video](https://rubygems.org/gems/glimmer-cw-video) Ruby gem)
|
403
|
+
|
404
|
+
Examples:
|
405
|
+
|
406
|
+
- [glimmer-cw-video](https://github.com/AndyObtiva/glimmer-cw-video): Video Widget
|
407
|
+
- [glimmer-cw-cdatetime-nebula](https://github.com/AndyObtiva/glimmer-cw-cdatetime-nebula): Nebula CDateTime Widget
|
408
|
+
|
409
|
+
### Gem Listing
|
410
|
+
|
411
|
+
The `glimmer` command comes with tasks for listing Glimmer related gems to make it easy to find Glimmer [Custom Shells](#custom-shells), [Custom Widgets](#custom-widgets), and DSLs published by others in the Glimmer community on [rubygems.org](http://www.rubygems.org).
|
412
|
+
|
413
|
+
#### Listing Custom Shell Gems
|
414
|
+
|
415
|
+
The following command lists available Glimmer [Custom Shell Gems](#custom-shell-gem) (prefixed with "glimmer-cs-" by scaffolding convention) created by the the Glimmer community and published on [rubygems.org](http://www.rubygems.org):
|
416
|
+
|
417
|
+
```
|
418
|
+
glimmer list:gems:customshell[query]
|
419
|
+
```
|
420
|
+
|
421
|
+
Or the following alternative abbreviation:
|
422
|
+
|
423
|
+
```
|
424
|
+
glimmer list:gems:cs[query]
|
425
|
+
```
|
426
|
+
|
427
|
+
Example:
|
428
|
+
|
429
|
+
```
|
430
|
+
glimmer list:gems:cs
|
431
|
+
```
|
432
|
+
|
433
|
+
Output:
|
434
|
+
|
435
|
+
```
|
436
|
+
|
437
|
+
Glimmer Custom Shell Gems at rubygems.org:
|
438
|
+
|
439
|
+
Name Gem Version Author Description
|
440
|
+
|
441
|
+
Calculator glimmer-cs-calculator 1.0.2 Andy Maleh Calculator - Glimmer Custom Shell
|
442
|
+
Gladiator glimmer-cs-gladiator 0.2.4 Andy Maleh Gladiator (Glimmer Editor) - Glimmer Custom Shell
|
443
|
+
Timer glimmer-cs-timer 1.0.0 Andy Maleh Timer - Glimmer Custom Shell
|
444
|
+
|
445
|
+
```
|
446
|
+
|
447
|
+
#### Listing Custom Widget Gems
|
448
|
+
|
449
|
+
The following command lists available Glimmer [Custom Widget Gems](#custom-widget-gem) (prefixed with "glimmer-cw-" by scaffolding convention) created by the the Glimmer community and published on [rubygems.org](http://www.rubygems.org):
|
450
|
+
|
451
|
+
```
|
452
|
+
glimmer list:gems:customwidget[query]
|
453
|
+
```
|
454
|
+
|
455
|
+
Or the following alternative abbreviation:
|
456
|
+
|
457
|
+
```
|
458
|
+
glimmer list:gems:cw[query]
|
459
|
+
```
|
460
|
+
|
461
|
+
Example:
|
462
|
+
|
463
|
+
Check if there is a custom video widget for Glimmer.
|
464
|
+
|
465
|
+
```
|
466
|
+
glimmer list:gems:cw[video]
|
467
|
+
```
|
468
|
+
|
469
|
+
Output:
|
470
|
+
|
471
|
+
```
|
472
|
+
|
473
|
+
Glimmer Custom Widget Gems matching [video] at rubygems.org:
|
474
|
+
|
475
|
+
Name Gem Version Author Description
|
476
|
+
|
477
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
478
|
+
|
479
|
+
```
|
480
|
+
|
481
|
+
Example:
|
482
|
+
|
483
|
+
Check all custom widgets for Glimmer.
|
484
|
+
|
485
|
+
```
|
486
|
+
glimmer list:gems:cw
|
487
|
+
```
|
488
|
+
|
489
|
+
Output:
|
490
|
+
|
491
|
+
```
|
492
|
+
|
493
|
+
Glimmer Custom Widget Gems at rubygems.org:
|
494
|
+
|
495
|
+
Name Gem Version Author Description
|
496
|
+
|
497
|
+
Browser (Chromium) glimmer-cw-browser-chromium 1.0.0 Andy Maleh Chromium Browser - Glimmer Custom Widget
|
498
|
+
Cdatetime (Nebula) glimmer-cw-cdatetime-nebula 1.5.0.0.1 Andy Maleh Nebula CDateTime Widget - Glimmer Custom Widget
|
499
|
+
Video glimmer-cw-video 1.0.0 Andy Maleh Glimmer Custom Widget - Video
|
500
|
+
|
501
|
+
```
|
502
|
+
|
503
|
+
#### Listing DSL Gems
|
504
|
+
|
505
|
+
The following command lists available Glimmer [DSL Gems](#multi-dsl-support) (prefixed with "glimmer-dsl-" by convention) created by the the Glimmer community and published on [rubygems.org](http://www.rubygems.org):
|
506
|
+
|
507
|
+
```
|
508
|
+
glimmer list:gems:dsl[query]
|
509
|
+
```
|
510
|
+
|
511
|
+
Example:
|
512
|
+
|
513
|
+
```
|
514
|
+
glimmer list:gems:dsl
|
515
|
+
```
|
516
|
+
|
517
|
+
Output:
|
518
|
+
|
519
|
+
```
|
520
|
+
|
521
|
+
Glimmer DSL Gems at rubygems.org:
|
522
|
+
|
523
|
+
Name Gem Version Author Description
|
524
|
+
|
525
|
+
Css glimmer-dsl-css 1.1.0 AndyMaleh Glimmer DSL for CSS
|
526
|
+
Opal glimmer-dsl-opal 0.10.2 AndyMaleh Glimmer DSL for Opal
|
527
|
+
Swt glimmer-dsl-swt 4.18.4.4 AndyMaleh Glimmer DSL for SWT
|
528
|
+
Tk glimmer-dsl-tk 0.0.6 AndyMaleh Glimmer DSL for Tk
|
529
|
+
Xml glimmer-dsl-xml 1.1.0 AndyMaleh Glimmer DSL for XML
|
530
|
+
```
|
531
|
+
|
532
|
+
### Packaging
|
533
|
+
|
534
|
+
Glimmer supports packaging applications as native files on Mac and Windows.
|
535
|
+
|
536
|
+
Glimmer packaging tasks are detailed under [Packaging & Distribution](/docs/reference/GLIMMER_PACKAGING_AND_DISTRIBUTION.md).
|
537
|
+
|
538
|
+
On Linux, the Glimmer [App](#app) and [Custom Shell Gem](#custom-shell-gem) scaffolding options provide a Gem Packaged Shell Script (e.g. `calculator` command becomes available after installing the [glimmer-cs-calculator](https://github.com/AndyObtiva/glimmer-cs-calculator) gem)
|
539
|
+
|
540
|
+
You may run `glimmer package:gem` to generate gem or just rely on the included [Juwelier](https://rubygems.org/gems/juwelier) `rake release` task to release the gem.
|
541
|
+
|
542
|
+
### Raw JRuby Command
|
543
|
+
|
544
|
+
If there is a need to run Glimmer directly via the `jruby` command, you
|
545
|
+
may run the following on Windows/Linux:
|
546
|
+
|
547
|
+
```
|
548
|
+
jruby -r glimmer-dsl-swt -S application.rb
|
549
|
+
```
|
550
|
+
|
551
|
+
Or, the following on Mac:
|
552
|
+
|
553
|
+
```
|
554
|
+
jruby -J-XstartOnFirstThread -r glimmer-dsl-swt -S application.rb
|
555
|
+
```
|
556
|
+
|
557
|
+
If you want to use a specific custom version of SWT, run the following on Windows/Linux:
|
558
|
+
|
559
|
+
```
|
560
|
+
jruby -J-classpath "path_to/swt.jar" -r glimmer-dsl-swt -S application.rb
|
561
|
+
```
|
562
|
+
|
563
|
+
Or, the following on Mac:
|
564
|
+
|
565
|
+
```
|
566
|
+
jruby -J-XstartOnFirstThread -J-classpath "path_to/swt.jar" -r glimmer-dsl-swt -S application.rb
|
567
|
+
```
|
568
|
+
|
569
|
+
The `-J-classpath` option specifies the `swt.jar` file path, which can be a
|
570
|
+
manually downloaded version of SWT, or otherwise the one included in the gem. You can lookup the one included in the gem by running `jgem which glimmer` to find the gem path and then look through the `vendor` directory.
|
571
|
+
|
572
|
+
The `-r` option preloads (requires) the `glimmer` library in Ruby.
|
573
|
+
|
574
|
+
The `-S` option specifies a script to run.
|
575
|
+
|
576
|
+
#### Mac Support
|
577
|
+
|
578
|
+
The Mac is well supported with the `glimmer` command. The advice below is not needed if you are using it.
|
579
|
+
|
580
|
+
However, if there is a reason to use the raw `jruby` command directly instead of the `glimmer` command, you need to pass an extra option (`-J-XstartOnFirstThread`) to JRuby on the Mac (Glimmer automatically passes it for you when using the `glimmer` command).
|
581
|
+
|
582
|
+
Example:
|
583
|
+
```
|
584
|
+
jruby -J-XstartOnFirstThread -J-classpath "path_to/swt.jar" -r glimmer-dsl-swt -S application.rb
|
585
|
+
```
|
586
|
+
|
587
|
+
## License
|
588
|
+
|
589
|
+
[MIT](LICENSE.txt)
|
590
|
+
|
591
|
+
Copyright (c) 2007-2021 - Andy Maleh.
|