400 Commits

Author SHA1 Message Date
daf3e82896 genbindings: subclass override functions need to use goMethodName 2025-02-01 14:35:54 +13:00
Jacek Sieka
187c0a02ec Move go name mangling to emitgo
This change helps keep rules for each language separate by moving `go`
rules to `emitgo` while the C bindings stay closer to the original Qt
naming (that already is mostly C-safe).

Although it doesn't practically matter for go, it makes it slightly
easier to reuse the generated code in other languages which have
different keywords and naming conventions.

The cabi generator also gains a few helpers to help keep names
consistent across files which hopefully aids reading the generator code
- it did for me at least;)

The rule that converts under_score to CamelCase is left for another day
since moving it turns out to be more invasive due to name collision
handling - when underscores are kept, there are fewer name conflicts
which ends up causing name changes in  the public go api when done
naively.
2025-02-01 13:44:32 +13:00
Jacek Sieka
439f3a1fb5 const in callbacks
Since callback signatures are now generated in C++, might as well go
ahead and retain `const` and the pointer type, removing a `const_cast`
in the process.
2025-01-27 14:14:23 +01:00
c80c0ff441 genbindings: fix indexing of zero-length byte arrays 2025-01-24 18:52:12 +13:00
7e8f451e48 genbindings: fix checking private methods of wrong class 2025-01-19 17:07:29 +13:00
d3319cf273 genbindings: move inheritance exceptions to config-allowlist 2025-01-19 17:07:29 +13:00
8705ac0b5c genbindings: expand virtual overrides to cover indirect base classes 2025-01-19 16:38:55 +13:00
883ba8c131 genbindings: change AllInherits() to return lookupResultClass 2025-01-19 16:38:27 +13:00
5cce6739f5 genbindings: remove last use of isSubclass variable 2025-01-18 17:57:25 +13:00
3697849067 genbindings: use dynamic_cast's return value to verify override is safe 2025-01-18 17:57:16 +13:00
Jacek Sieka
929e4e630a Simplify delete
The subclassing structure in `miqt` is such that nothing ever inherits
from `MiqtVirtual` - also, for `MiqtVirtual` to work correctly when Qt
deletes an instance part of a tree of widgets, the technique can only be
used with types that already have a virtual destructor.

Therefore:
* make `MiqtVirtual` final to ensure nothing inherits from it by
accident
* remove `virtual` inheritance of its base class - since there is no MI
invonved and no further inheritance, there can also not be any diamond
inheritance structures - removing `virtual` makes inheritance a bit
cheaper
* remove `isSubclass` from `delete` function - C++ already calls the
most inherited destructor
* mark destructor `override` to verify said assumption
2025-01-18 17:46:50 +13:00
Jacek Sieka
5cbbec5619 Log blocked methods
Blocked methods are the source of many gaps in the binding - in
particular, they block qt_metacall/activate/etc that is necessary for
implementing meta-object support.

This change makes them visible in logs and also removes log timestamps
so that logs from two runs easily can be diffed.
2025-01-15 10:56:57 +01:00
f15c54b153 genbindings: blocklist QHashSeed::size_t 2025-01-11 17:40:38 +13:00
3a63a129ae
Merge pull request #124 from arnetheduck/cgo-export
Avoid dependency on exported go header
2025-01-11 15:21:00 +13:00
Jacek Sieka
a0c6344ecd Avoid dependency on exported go header
The expected type of the callback is already known from the AST - this
change reduces dependency on cgo specifics and makes the generated C ABI
entirely cgo-independent - in particular, there is no need to include
`_cgo_export.h` any more.
2025-01-07 12:55:40 +01:00
Jacek Sieka
765592cca2 Small fixes
* `stdlib` is not used / needed
* `miqt_strdup` doesn't exist
* consistently use nameprefix for `_ret`
2025-01-07 09:29:45 +01:00
81dd216f13 genbindings: add qfloat16 exceptions 2025-01-04 12:47:53 +13:00
ad635b2b38 genbindings: support conversion operators 2025-01-04 12:18:54 +13:00
Jacek Sieka
60cb03785f genbindings: fix race condition in clang output pipe 2025-01-04 10:39:54 +13:00
dba031643c genbindings: move all large int constants to a 64-bit only build file 2024-12-31 16:48:28 +13:00
641dbd6d21 genbindings/cabi: add automatic -D_Bool=bool handling 2024-12-11 19:55:32 +13:00
5a7a46e28f genbindings: use separate virtbase helper to get base pointers 2024-12-07 17:44:27 +13:00
1baf7342e5 genbindings: merge codepaths for go return value construction 2024-12-07 15:00:03 +13:00
5271f8d4a1 genbindings: panic when trying to override methods on non-subclass 2024-12-07 14:18:47 +13:00
6b2935add1 webengine: add genbindings integration 2024-11-27 18:16:40 +13:00
9d587fdadf genbindings/go: avoid name collisions between enums and enum entries 2024-11-27 18:12:40 +13:00
5b25ae9cad genbindings: enums by reference also need c-style cast 2024-11-27 18:00:23 +13:00
db5fadaeb7 webkit: add genbindings support 2024-11-26 22:31:23 +13:00
bfbaeaf514 genbindings: add missing header includes for some container types 2024-11-26 20:09:30 +13:00
d28621c941 qtscript: genbindings configuration 2024-11-26 19:55:10 +13:00
fc47abea0e svg: add genbindings configuration 2024-11-26 19:52:58 +13:00
25e10f2824 genbindings/cabi: QFlags<>& use C-style cast 2024-11-26 19:52:29 +13:00
13deba55b7 genbindings/config: do not subclass platform-specific QAbstractEventDispatcher 2024-11-23 21:11:24 +13:00
7f2e4d07df genbindings/config: prevent some classes from subclassing 2024-11-23 19:34:38 +13:00
a5dafbf132 genbindings: fix trying to add super parameters for pure virtual methods 2024-11-23 19:34:22 +13:00
756086cd50 genbindings: enforce AllowVirtualForClass at construction time 2024-11-23 19:34:05 +13:00
c36d14c540 genbindings: allow some classes to inherit from QList<> 2024-11-23 19:32:09 +13:00
4997641327 genbindings: allow subclassing abstract classes 2024-11-23 19:31:27 +13:00
b643477cca cflags: remove -fPIC from all cflags 2024-11-23 18:33:43 +13:00
f45604ee13 genbindings: move QAccessibleWidget hack into standard config 2024-11-23 18:05:15 +13:00
6e0c417f00 genbindings/config: update for Qt 6.8 2024-11-22 19:05:48 +13:00
2a502f24ff genbindings: change simple operator== to use infix syntax 2024-11-22 18:58:56 +13:00
bbc75b8ef1 linuxonly: fix ifdef quirks for building on windows 2024-11-19 20:45:45 +13:00
392a92434a genbindings/config: omit QxxPrivate::xx 2024-11-19 20:00:40 +13:00
b50870b9d9 genbindings: intptr_t-qintptr pointer casts require C-style casts 2024-11-19 20:00:35 +13:00
90de7178f2 genbindings: fix some cases of missing :: escaping 2024-11-19 19:59:55 +13:00
40abeecd54 genbindings/subclassing: accurate pointer type management for subclasses 2024-11-19 19:28:30 +13:00
6fa97722c5 genbindings: delete either subclass or direct class 2024-11-19 19:28:00 +13:00
fb56258334 genbindings: constructors return every subclass pointer 2024-11-19 19:27:19 +13:00
eca87471ee genbindings/types: pointer and return type fixes 2024-11-19 19:25:48 +13:00