Skip to content

Commit ab28103

Browse files
committed
add node internal header files for electron main parts
1 parent 372ec8e commit ab28103

36 files changed

+7358
-173
lines changed
Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,34 @@
1-
const {app, BrowserWindow} = require('electron') // http://electronjs.org/docs/api
2-
const path = require('path') // https://nodejs.org/api/path.html
3-
const url = require('url') // https://nodejs.org/api/url.html
4-
5-
let window = null
6-
7-
// Wait until the app is ready
8-
app.once('ready', () => {
9-
// Create a new window
10-
window = new BrowserWindow({
11-
// Set the initial width to 400px
12-
width: 400,
13-
// Set the initial height to 500px
14-
height: 500,
15-
// Don't show the window until it ready, this prevents any white flickering
16-
show: false,
17-
// Don't allow the window to be resized.
18-
resizable: false
19-
})
20-
21-
// Load a URL in the window to the local index.html path
22-
window.loadURL(url.format({
23-
pathname: path.join(__dirname, 'index.html'),
24-
protocol: 'file:',
25-
slashes: true
26-
}))
27-
28-
// Show window when page is ready
29-
window.once('ready-to-show', () => {
30-
console.log('ready-to-show')
31-
window.show()
32-
})
33-
})
1+
//const {app, BrowserWindow} = require('electron') // http://electronjs.org/docs/api
2+
//const path = require('path') // https://nodejs.org/api/path.html
3+
//const url = require('url') // https://nodejs.org/api/url.html
4+
//
5+
//let window = null
6+
//
7+
//// Wait until the app is ready
8+
//app.once('ready', () => {
9+
// // Create a new window
10+
// window = new BrowserWindow({
11+
// // Set the initial width to 400px
12+
// width: 400,
13+
// // Set the initial height to 500px
14+
// height: 500,
15+
// // Don't show the window until it ready, this prevents any white flickering
16+
// show: false,
17+
// // Don't allow the window to be resized.
18+
// resizable: false
19+
// })
20+
//
21+
// // Load a URL in the window to the local index.html path
22+
// window.loadURL(url.format({
23+
// pathname: path.join(__dirname, 'index.html'),
24+
// protocol: 'file:',
25+
// slashes: true
26+
// }))
27+
//
28+
// // Show window when page is ready
29+
// window.once('ready-to-show', () => {
30+
// console.log('ready-to-show')
31+
// window.show()
32+
// })
33+
//})
34+
console.log('Hello From Main Process!')

android_app/app/src/main/res/layout/activity_main.xml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,13 @@
55
android:id="@+id/container"
66
android:layout_width="match_parent"
77
android:layout_height="match_parent"
8-
tools:context=".MainActivity" />
8+
tools:context=".MainActivity" >
9+
10+
<Switch
11+
android:id="@+id/switch1"
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:text="Switch"
15+
tools:layout_editor_absoluteX="159dp"
16+
tools:layout_editor_absoluteY="115dp" />
17+
</androidx.constraintlayout.widget.ConstraintLayout>

android_app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
mavenCentral()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:7.0.2'
8+
classpath 'com.android.tools.build:gradle:7.0.0'
99
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.21"
1010

1111
// NOTE: Do not place your application dependencies here; they belong

android_app/electron/src/main/cpp/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ add_library( # Sets the name of the library.
2727
helper.cpp
2828
android_context.cpp
2929

30+
node.cpp
31+
javascript_environment.cpp
32+
3033
electron_api_app.cpp
3134
electron_api_browser_window.cpp
3235

0 commit comments

Comments
 (0)