mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +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"
|
||||
|
||||
#include "binding.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -638,12 +640,6 @@ func emitBindingCpp(src *CppParsedHeader, filename string) (string, error) {
|
||||
|
||||
ret.WriteString(`#include "` + filename + "\"\n\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 {
|
||||
|
||||
|
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