mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
genbindings: add common binding.h
This commit is contained in:
parent
d2c5d27f37
commit
4882ed676a
@ -536,6 +536,8 @@ func emitBindingHeader(src *CppParsedHeader, filename string) (string, error) {
|
|||||||
|
|
||||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||||
|
|
||||||
|
#include "binding.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -638,12 +640,6 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {
|
|||||||
|
|
||||||
ret.WriteString(`#include "` + filename + "\"\n\n")
|
ret.WriteString(`#include "` + filename + "\"\n\n")
|
||||||
ret.WriteString(`#include "gen_` + filename + "\"\n")
|
ret.WriteString(`#include "gen_` + filename + "\"\n")
|
||||||
ret.WriteString(`
|
|
||||||
extern "C" {
|
|
||||||
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
||||||
}
|
|
||||||
|
|
||||||
`)
|
|
||||||
|
|
||||||
for _, c := range src.Classes {
|
for _, c := range src.Classes {
|
||||||
|
|
||||||
|
16
qt/binding.h
Normal file
16
qt/binding.h
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#ifndef GEN_QABSTRACTANIMATION_H
|
||||||
|
#define GEN_QABSTRACTANIMATION_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// miqt_exec_callback calls a Go function pointer for a connect() slot.
|
||||||
|
// The function is defined in Go.
|
||||||
|
void miqt_exec_callback(void* cb, int argc, void* argv);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user