forked from github-linguist/linguist
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Genie samples and improve heuristics (github-linguist#5021)
Samples: * Genie/web.gs * Source: https://github.com/korylprince/WebKiosk/blob/22c6c656ba8080451167c4d52d950fc75b9844df/web.gs * License: Public Domain * Genie/IDataLoader.gs * Source: https://github.com/darkoverlordofdata/liboverlap2d/blob/53f66d46e3d992bdb303f356b919d3c1ef66d0ea/src/resources/IDataLoader.gs * License: Apache 2 Improve Gosu heuristic and add Genie heuristic for the common `[indent=\d+\]` construct. Co-authored-by: Colin Seymour <[email protected]>
- Loading branch information
Showing
4 changed files
with
103 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* IDataLoader.gs | ||
* | ||
* | ||
* | ||
*/ | ||
[indent=4] | ||
uses Gee | ||
uses sdx | ||
uses sdx.math | ||
uses sdx.graphics.s2d | ||
uses o2d.data | ||
|
||
namespace o2d.resources | ||
|
||
interface IDataLoader : Object | ||
def abstract loadSceneVO(sceneName: string): SceneVO | ||
def abstract loadProjectVO(): ProjectInfoVO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
[indent=4] | ||
// valac --pkg gtk+-3.0 --pkg webkitgtk-3.0 web.gs | ||
|
||
uses | ||
Gtk | ||
WebKit | ||
|
||
class ValaBrowser : Window | ||
|
||
webview: WebView | ||
button: ToolButton | ||
spinner: Spinner | ||
|
||
init | ||
window_position = WindowPosition.CENTER | ||
set_default_size(1024, 768) | ||
create_widgets() | ||
connect_signals () | ||
webview.grab_focus () | ||
var settings = new WebSettings() | ||
settings.set("enable-default-context-menu",false) | ||
webview.set_settings(settings) | ||
|
||
def create_widgets () : void | ||
var toolbar = new Toolbar () | ||
toolbar.set_style(ToolbarStyle.BOTH) | ||
toolbar.get_style_context().add_class(STYLE_CLASS_PRIMARY_TOOLBAR) | ||
this.button = new ToolButton(null,"Refresh") | ||
toolbar.add (this.button) | ||
this.webview = new WebView () | ||
this.spinner = new Spinner() | ||
this.spinner.set_margin_left(5) | ||
this.spinner.set_margin_right(5) | ||
this.spinner.set_margin_bottom(5) | ||
this.spinner.set_margin_top(5) | ||
this.spinner.start() | ||
var fixed = new Fixed() | ||
fixed.add(this.spinner) | ||
fixed.set_halign(Align.START) | ||
fixed.set_valign(Align.END) | ||
var overlay = new Overlay() | ||
overlay.add(this.webview) | ||
overlay.add_overlay(fixed) | ||
var vbox = new Box (Orientation.VERTICAL, 0) | ||
vbox.pack_start (toolbar, false, true, 0) | ||
vbox.pack_start(overlay,true,true,0) | ||
add (vbox) | ||
|
||
|
||
def connect_signals () : void | ||
this.destroy.connect (Gtk.main_quit) | ||
this.button.clicked.connect (this.start) | ||
this.webview.document_load_finished.connect(this.loaded) | ||
this.webview.load_started.connect(this.started) | ||
|
||
|
||
def start () : void | ||
show_all () | ||
//URL to show | ||
this.webview.open ("https://google.com") | ||
|
||
|
||
def loaded () : void | ||
this.spinner.hide() | ||
//Use the next command to run some javascript on page load | ||
//this.webview.execute_script("$('body').show()") | ||
|
||
def started () : void | ||
show_all() | ||
|
||
def main (arg: array of string[]) : int | ||
Gtk.init (ref arg) | ||
var browser = new ValaBrowser () | ||
browser.start () | ||
Gtk.main () | ||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters