Skip to content

Commit 6615e43

Browse files
authored
Merge pull request #14 from Equanox/browserwindow
A golang api for electronJS
2 parents f9f0adc + e6a36cd commit 6615e43

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+30763
-489
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,19 @@ node_modules/
22
npm-debug.log
33
package-lock.json
44
build/
5+
!example/ui/build/
56
dist/
67
vendor/
78
.vscode/
89

10+
.gotron/
11+
.gotron-builder/
12+
gotron-builder
13+
14+
example/example.exe
15+
example/example
16+
example/gotron-builder
17+
918
*.d.ts
19+
20+
.DS_Store

.travis.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: go
22
go:
3-
- "1.10.x"
3+
- "1.11.x"
44

55
sudo: enabled
66

@@ -11,8 +11,11 @@ install:
1111
- sudo apt-key add Release.key
1212
- sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ trusty main'
1313
- sudo apt-get update
14-
- sudo apt-get install --install-recommends winehq-stable
14+
- sudo apt-get --allow-unauthenticated install --install-recommends winehq-stable
1515

1616

1717
script:
18-
- npm run test
18+
- go get -d -v ./...
19+
- cd example/ui && npm run test
20+
- cd ../../
21+
- make test-ci

BrowserWindow.md

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# BrowserWindow
2+
3+
> Create and control browser windows.
4+
5+
## Instance Events
6+
7+
To be implemented.
8+
9+
## Static Methods
10+
11+
To be implemented.
12+
13+
## Instance Properties
14+
15+
To be implemented
16+
17+
## Instance Methods
18+
19+
Objects created with `win := gotron.New()` have the following instance methods. These Methods will only have effect after running `win.Start()`. This is just a list to show implemented and unimplemented methods from electron's BrowserWindow. See [browser-window](https://github.com/electron/electron/blob/master/docs/api/browser-window.md) for full documentation of electron BrowserWindow.
20+
21+
**Note:** Some methods are only available on specific operating systems and are
22+
labeled as such.
23+
24+
### Implemented
25+
* `win.OpenDevTools()`
26+
* `win.SetSize(width int, height int, animate ...bool)`
27+
* `win.Close()`
28+
* `win.Show()`
29+
* `win.Hide()`
30+
* `win.Minimize()`
31+
* `win.Restore()`
32+
* `win.Maximize()`
33+
* `win.UnMaximize()`
34+
* `win.SetFullScreen(flag bool)`
35+
36+
### Not (/partly) implemented
37+
38+
* `win.Destroy()`
39+
* `win.Focus()`
40+
* `win.Blur()`
41+
* `win.IsFocused() bool`
42+
* `win.IsDestroyed() bool`
43+
* `win.ShowInactive()`
44+
* `win.IsVisible() bool`
45+
* `win.IsModal() bool`
46+
* `win.IsMaximised() bool`
47+
* `win.IsMinimized() bool`
48+
* `win.IsFullScreen() bool`
49+
* `win.SetSimpleFullScreen(flag bool)`
50+
* `win.IsSimpleFullScreen() bool`
51+
* `win.IsNormal() bool`
52+
* `win.SetAspectRatio(aspectRatio float64, extraSize string)`
53+
* `win.SetBackgroundColor(backgroundColor string)`
54+
* `win.PreviewFile(path string, displayName ...string)`
55+
* `win.CloseFilePreview()`
56+
* `win.SetBounds(bounds Rectangle, animate ...bool)`
57+
* `win.GetBounds() Rectangle`
58+
* `win.SetContentBounds(bounds Rectangle, animate ...bool)`
59+
* `win.GetContentBounds() Rectangle`
60+
* `win.GetNormalBounds() Rectangle`
61+
* `win.SetEnabled(enable bool)`
62+
* `win.GetSize() []int`
63+
* `win.SetContentSize(width int, height int, animate ...bool)`
64+
* `win.GetContentSize() []int`
65+
* `win.SetMinimumSize(width, height int)`
66+
* `win.GetMinimumSize() []int`
67+
* `win.SetMaximumSize(width, height int)`
68+
* `win.GetMaximumSize() []int`
69+
* `win.SetResizable(resizable bool)`
70+
* `win.IsResizable() bool`
71+
* `win.SetMovable(movable bool)`
72+
* `win.IsMovable() bool`
73+
* `win.SetMinimizable(minimizable bool)`
74+
* `win.IsMinimizable() bool`
75+
* `win.SetMaximizable(maximizable bool)`
76+
* `win.IsMaximizable() bool`
77+
* `win.SetFullScreenable(fullscreenable bool)`
78+
* `win.IsFullScreenable() bool`
79+
* `win.SetClosable(closable bool)`
80+
* `win.IsClosable() bool`
81+
* `win.SetAlwaysOnTop(flag bool, level string, relativeLevel ...int)`
82+
* `win.IsAlwaysOnTop() bool`
83+
* `win.MoveTop()`
84+
* `win.Center()`
85+
* `win.SetPosition(x, y int, animate ...bool)`
86+
* `win.GetPosition() []int`
87+
* `win.SetTitle(title string)`
88+
* `win.GetTitle() string`
89+
* `win.SetSheetOffset(offsetY float64, offsetX ...float64)`
90+
* `win.FlashFrame(flag bool)`
91+
* `win.SetSkipTaskbar(skip bool)`
92+
* `win.SetKiosk(flag bool)`
93+
* `win.IsKiosk() bool`
94+
* `win.GetNativeWindowHandle()`
95+
* `win.HookWindowMessage(message int, callback func([]interface{}) []interface{})`
96+
* `win.IsWindowMessageHooked(message int) bool`
97+
* `win.UnhookWindowMessage(message int)`
98+
* `win.UnhookAllWindowMessages()`
99+
* `win.GetRepresentedFilename() string`
100+
* `win.SetDocumentEdited(edited bool)`
101+
* `win.IsDocumentEdited()`
102+
* `win.FocusOnWebView()`
103+
* `win.BlurWebView()`
104+
* `win.CapturePage(rect []Rectangle, handler func(image string))`
105+
* `win.LoadURL(url, options interface{})`
106+
* `win.LoadFile(filePath string, options interface{})`
107+
* `win.Reload()`
108+
* `win.SetMenu(menu string)`
109+
* `win.SetProgressBar(progress float64, options ...interface{})`
110+
* `win.SetOverlayIcon(overlay string, description string)`
111+
* `win.SetHasShadow(hsShadow bool)`
112+
* `win.HasShadow() bool`
113+
* `win.SetOpacity(opacity float64)`
114+
* `win.GetOpacity() float64`
115+
* `win.SetShape(rects []Rectangle)`
116+
* `win.SetThumbarButtons(buttons interface{}) bool`
117+
* `win.SetThumbnailClip(region Rectangle)`
118+
* `win.SetThumbnailToolTip(toolTip string)`
119+
* `win.SetAppDetails(options interface{})`
120+
* `win.ShowDefinitionForSelection()`
121+
* `win.SetIcon(icon string)`
122+
* `win.SetWindowButtonVisibility(visible bool)`
123+
* `win.SetAutoHideMenuBar(hide bool)`
124+
* `win.IsMenuBarAutoHide() bool`
125+
* `win.SetMenuBarVisibility(visible bool)`
126+
* `win.IsMenuBarVisible() bool`
127+
* `win.SetVisibleOnAllWorkspaces(visible bool, options ...interface{})`
128+
* `win.IsVisibleOnAllWorkspaces() bool`
129+
* `win.SetIgnoreMouseEvents(ignore bool, options ...interface{})`
130+
* `win.SetContentProtection(enable bool)`
131+
* `win.SetFocusable(focusable bool)`
132+
* `win.SetParentWindow(parent *BrowserWindow)`
133+
* `win.GetParentWindow() BrowserWindow`
134+
* `win.GetChildWindows() []BrowserWindow`
135+
* `win.SetAutoHideCursor(autoHide bool)`
136+
* `win.SelectPreviousTab()`
137+
* `win.SelectNextTab()`
138+
* `win.MergeAllWindows()`
139+
* `win.MoveTabToNewWindow()`
140+
* `win.ToggleTabBar()`
141+
* `win.AddTabbedWindow(browserwindow *BrowserWindow)`
142+
* `win.SetVibrancy(vibrancy string)`
143+
* `win.SetTouchBar(touchBar interface{})`
144+
* `win.SetBrowserView(browserView interface{})`
145+
* `win.GetBrowserView() interface{}`

Makefile

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
UNAME := $(shell uname)
2+
3+
EXEC = ./example
4+
5+
6+
#https://stackoverflow.com/questions/4058840/makefile-that-distincts-between-windows-and-unix-like-systems
7+
# ifdef OS
8+
# EXEC = example.exe
9+
# endif
10+
11+
run:
12+
@cd example && go build && $(EXEC)
13+
14+
install-ui:
15+
@cd example/ui && npm run install
16+
17+
build-ui:
18+
@cd example/ui && npm run build
19+
20+
builder:
21+
@make install-builder
22+
@gotron-builder -g=example --linux
23+
24+
install-builder:
25+
@cd cmd/gotron-builder && go install
26+
27+
clean:
28+
@-rm -r .gotron
29+
@-rm -r .gotron-builder
30+
31+
test-ci:
32+
@make install-builder
33+
@gotron-builder -g example -l --ia32
34+
@cd example && gotron-builder
35+
@gotron-builder -g example -a example/ui/build -w
36+
@gotron-builder -g example --out example -w --ia32

0 commit comments

Comments
 (0)