diff options
author | obscuren <geffobscura@gmail.com> | 2014-09-14 06:13:47 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-09-14 06:13:47 +0800 |
commit | 91ca5d724e1c65a7d9725b65ea0f003161301f63 (patch) | |
tree | 6d96b68fea31b9add6cc58a97dd09c0d6f3d55b5 /ethereal/gui.go | |
parent | 893e9256a0f48b8fd45f29717145a4df23a3a799 (diff) | |
download | go-tangerine-91ca5d724e1c65a7d9725b65ea0f003161301f63.tar go-tangerine-91ca5d724e1c65a7d9725b65ea0f003161301f63.tar.gz go-tangerine-91ca5d724e1c65a7d9725b65ea0f003161301f63.tar.bz2 go-tangerine-91ca5d724e1c65a7d9725b65ea0f003161301f63.tar.lz go-tangerine-91ca5d724e1c65a7d9725b65ea0f003161301f63.tar.xz go-tangerine-91ca5d724e1c65a7d9725b65ea0f003161301f63.tar.zst go-tangerine-91ca5d724e1c65a7d9725b65ea0f003161301f63.zip |
Reworked filters
Diffstat (limited to 'ethereal/gui.go')
-rw-r--r-- | ethereal/gui.go | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/ethereal/gui.go b/ethereal/gui.go index 33fd35e6e..7bb4612c2 100644 --- a/ethereal/gui.go +++ b/ethereal/gui.go @@ -1,5 +1,8 @@ package main +// #include "/Users/jeffrey/go/src/github.com/go-qml/qml/cpp/capi.h" +import "C" + import ( "bytes" "encoding/json" @@ -10,7 +13,9 @@ import ( "strconv" "strings" "time" + "unsafe" + "bitbucket.org/binet/go-ffi/pkg/ffi" "github.com/ethereum/eth-go" "github.com/ethereum/eth-go/ethchain" "github.com/ethereum/eth-go/ethdb" @@ -23,6 +28,29 @@ import ( "gopkg.in/qml.v1" ) +func LoadExtension(path string) (uintptr, error) { + lib, err := ffi.NewLibrary(path) + if err != nil { + return 0, err + } + + so, err := lib.Fct("sharedObject", ffi.Pointer, nil) + if err != nil { + return 0, err + } + + ptr := so() + + /* + err = lib.Close() + if err != nil { + return 0, err + } + */ + + return ptr.Interface().(uintptr), nil +} + var logger = ethlog.NewLogger("GUI") type Gui struct { @@ -91,6 +119,14 @@ func (gui *Gui) Start(assetPath string) { context.SetVar("gui", gui) context.SetVar("eth", gui.uiLib) + vec, errr := LoadExtension("/Users/jeffrey/Desktop/build-libqmltest-Desktop_Qt_5_2_1_clang_64bit-Debug/liblibqmltest_debug.dylib") + fmt.Printf("Fetched vec with addr: %#x\n", vec) + if errr != nil { + fmt.Println(errr) + } else { + context.SetVar("vec", (unsafe.Pointer)(vec)) + } + // Load the main QML interface data, _ := ethutil.Config.Db.Get([]byte("KeyRing")) |