renamed optional parameter of connect macro to user_data

This commit is contained in:
Stefan Salewski 2020-05-20 21:46:43 +02:00
commit 3ba2a7def5
3 changed files with 6 additions and 6 deletions

View file

@ -1,6 +1,6 @@
= High level GTK3 (and GTK4) bindings for the Nim programming language = High level GTK3 (and GTK4) bindings for the Nim programming language
(c) Stefan Salewski (c) Stefan Salewski
//Version 0.7.5 //Version 0.7.6
:experimental: :experimental:
:imagesdir: http://ssalewski.de/tmp :imagesdir: http://ssalewski.de/tmp
:source-highlighter: pygments :source-highlighter: pygments

View file

@ -1,6 +1,6 @@
# Package # Package
version = "0.7.5" version = "0.7.6"
author = "Stefan Salewski" author = "Stefan Salewski"
description = "High level GObject-Introspection based GTK3/GTK4 bindings" description = "High level GObject-Introspection based GTK3/GTK4 bindings"
license = "MIT" license = "MIT"

View file

@ -158,14 +158,14 @@ proc $1$2 {.cdecl.} =
r1s.add(" " & names[i] & "1.impl = " & names[i] & "\n") r1s.add(" " & names[i] & "1.impl = " & names[i] & "\n")
if not ignoreArg.boolVal: if not ignoreArg.boolVal:
if getTypeInst(arg).typeKind == ntyRef: if getTypeInst(arg).typeKind == ntyRef:
resu.add(", cast[$5](data)") resu.add(", cast[$5](user_data)")
else: else:
resu.add(", cast[ptr $5](data)[]") resu.add(", cast[ptr $5](user_data)[]")
resu.add(")") resu.add(")")
if resl == "gboolean": if resl == "gboolean":
resu.add(".ord.gboolean") resu.add(".ord.gboolean")
r1s.add(resu & "\n") r1s.add(resu & "\n")
all = all.replace(")", "; data: pointer)") all = all.replace(")", "; user_data: pointer)")
r1s = r1s % [$procNameCdecl, all, $p, wts, ats] r1s = r1s % [$procNameCdecl, all, $p, wts, ats]
# echo r1s # echo r1s
result = parseStmt(r1s) result = parseStmt(r1s)
@ -426,4 +426,4 @@ $1(column, renderer, $6)
""" % [$procName, ats, $column, $renderer, $procNameCdecl, argStr, $procNameDestroy] """ % [$procName, ats, $column, $renderer, $procNameCdecl, argStr, $procNameDestroy]
result = parseStmt(r0s & r1s & r2s) result = parseStmt(r0s & r1s & r2s)
# 423 lines # 429 lines