forked from cztomczak/cef2go
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcef_linux.go
36 lines (30 loc) · 862 Bytes
/
cef_linux.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2014 The cef2go authors. All rights reserved.
// License: BSD 3-clause.
// Website: https://github.com/CzarekTomczak/cef2go
package cef2go
/*
#cgo CFLAGS: -I.
#include <stdlib.h>
#include "string.h"
#include "include/capi/cef_app_capi.h"
*/
import "C"
import "unsafe"
import (
"os"
)
var _Argv []*C.char = make([]*C.char, len(os.Args))
func FillMainArgs(mainArgs *C.struct__cef_main_args_t,
appHandle unsafe.Pointer) {
// On Linux appHandle is nil.
Logger.Infof("FillMainArgs, argc=%s", len(os.Args))
for i, arg := range os.Args {
_Argv[C.int(i)] = C.CString(arg)
}
mainArgs.argc = C.int(len(os.Args))
mainArgs.argv = &_Argv[0]
}
func FillWindowInfo(windowInfo *C.cef_window_info_t, hwnd unsafe.Pointer) {
Logger.Infof("FillWindowInfo")
windowInfo.parent_widget = (*C.GtkWidget)(hwnd)
}