Skip to content

Commit

Permalink
Update to 6.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbannon committed Dec 23, 2022
1 parent e974cd5 commit cc601da
Show file tree
Hide file tree
Showing 7 changed files with 169 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cbindings/Qt6Pas.pro
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@



# Binding Release Version 6.2.4 against Qt6 6.2 LTS release.
# Binding Release Version 6.2.5 against Qt6 6.2 LTS release.

win32:VERSION = 6.2.4.0
else:VERSION = 6.2.4
win32:VERSION = 6.2.5.0
else:VERSION = 6.2.5
VER_MAJ = 6
VER_MIN = 2
VER_PAT = 4
VER_PAT = 5
win32:VERSION_PE_HEADER = 6.2

QT += gui printsupport
Expand Down Expand Up @@ -702,5 +702,8 @@ SOURCES += \
qprintpreviewdialog_hook_c.cpp \
qprintpreviewwidget_hook_c.cpp \
qsystemtrayicon_hook_c.cpp \
qgraphicsscene_hook_c.cpp
qgraphicsscene_hook_c.cpp \
qnativeeventfilter_hook_c.cpp \
qnativeeventfilter_hook.h \
qnativeeventfilter_hook_c.h
# end of file
10 changes: 10 additions & 0 deletions cbindings/qt62.pas
Original file line number Diff line number Diff line change
Expand Up @@ -15392,6 +15392,16 @@ procedure QGraphicsScene_hook_hook_sceneRectChanged(handle: QGraphicsScene_hookH
procedure QGraphicsScene_hook_hook_selectionChanged(handle: QGraphicsScene_hookH; hook: QGraphicsScene_selectionChanged_Event); cdecl; external Qt6PasLib name 'QGraphicsScene_hook_hook_selectionChanged';
procedure QGraphicsScene_hook_hook_focusItemChanged(handle: QGraphicsScene_hookH; hook: QGraphicsScene_focusItemChanged_Event); cdecl; external Qt6PasLib name 'QGraphicsScene_hook_hook_focusItemChanged';

type
QNativeEventFilter_hookH = class(TObject) end;
QNativeEventFilterEvent = function (handle: QNativeEventFilter_hookH; eventType: QByteArrayH; message: PtrInt):boolean of object cdecl;

function QNativeEventFilter_hook_Create(handle : QCoreApplicationH) : QNativeEventFilter_hookH; cdecl; external Qt6PasLib name 'Q_NativeEventFilter_hook_Create';
procedure QNativeEventFilter_Destroy(handle : QNativeEventFilter_hookH ); cdecl; external Qt6PasLib name 'Q_NativeEventFilter_hook_Destroy';
procedure QNativeEventFilter_hook_installfilter(handle : QNativeEventFilter_hookH; hook : QNativeEventFilterEvent); cdecl; external Qt6PasLib name 'Q_NativeEventFilter_hook_installfilter';
procedure QNativeEventFilter_hook_destroyed(handle : QNativeEventFilter_hookH; hook : QObject_destroyed_Event); cdecl; external Qt6PasLib name 'Q_NativeEventFilter_hook_destroyed';
procedure QNativeEventFilter_hook_removefilter(handle : QNativeEventFilter_hookH); cdecl; external Qt6PasLib name 'Q_NativeEventFilter_hook_removefilter';

//=======================================================
// Dynamic Qt Version
//=======================================================
Expand Down
3 changes: 3 additions & 0 deletions cbindings/src/chandles.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,4 +485,7 @@ typedef struct QAccessibleEvent__ { PTRINT dummy; } *QAccessibleEventH;
typedef struct QAccessibleInterface__ { PTRINT dummy; } *QAccessibleInterfaceH;
typedef struct QAccessibleWidget__ { PTRINT dummy; } *QAccessibleWidgetH;
typedef struct QLCLAccessibleWidget__ { PTRINT dummy; } *QLCLAccessibleWidgetH;

typedef struct Q_NativeEventFilter_hook__ { PTRINT dummy; } *Q_NativeEventFilter_hookH;
typedef struct Q_NativeEventFilter__ { PTRINT dummy; } *Q_NativeEventFilterH;
#endif
2 changes: 2 additions & 0 deletions cbindings/src/pascalbind.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,4 +300,6 @@ inline void copyQRealArrayToQVectorQReal(PQRealArray parr,QVector<qreal> &qvecto

C_EXPORT void initializeQRealArray(GetQRealArrayAddr gaa, GetQRealArrayLength gal, SetQRealArrayLength sal);

typedef bool (*NativeEventFilter)(const QByteArray &eventType, void *message, qintptr *result);

#endif
87 changes: 87 additions & 0 deletions cbindings/src/qnativeeventfilter_hook.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
//******************************************************************************
// Copyright (c) 2005-2022 by Matteo Salvi
//
// See the included file COPYING.TXT for details about the copyright.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//******************************************************************************

#ifndef Q_NATIVEEVENTFILTER_HOOK_H
#define Q_NATIVEEVENTFILTER_HOOK_H

#include <qcoreapplication.h>
#include <qabstractnativeeventfilter.h>
#include "pascalbind.h"

class Q_NativeEventFilter_hook : public QAbstractNativeEventFilter {

public:
bool nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) override;

Q_NativeEventFilter_hook(QCoreApplication *handle) : QAbstractNativeEventFilter() {
this->handle = handle;
this->events.func = NULL;
this->destroyed_event.func = NULL;
}

virtual ~Q_NativeEventFilter_hook() {
if (handle) {
handle->removeNativeEventFilter(this);
handle = NULL;
}
}

void hook_installfilter(QHook &hook) {
if (handle) {
if (!events.func) {
handle->installNativeEventFilter(this);
events = hook;
}
if (!hook.func)
handle->removeNativeEventFilter(this);
events = hook;
}
}
void hook_removefilter() {
if (handle) {
handle->removeNativeEventFilter(this);
events.func = NULL;
}
}

void hook_destroyed(QHook &hook) {
destroyed_event = hook;
}

protected:

QCoreApplication *handle;

private slots:

void destroyed_hook() {
if ( destroyed_event.func ) {
typedef void (*func_type)(void *data);
(*(func_type)destroyed_event.func)(destroyed_event.data);
}
handle = NULL;
}

private:
QHook events;
QHook destroyed_event;
};


bool Q_NativeEventFilter_hook::nativeEventFilter(const QByteArray &eventType, void *message, qintptr *result) {
if (events.func) {
Q_NativeEventFilter_hook* sender = this;
typedef bool (*func_type)(void *data, Q_NativeEventFilter_hook* sender, const QByteArray &eventType, void *message);
return (*(func_type)events.func)(events.data, sender, eventType, message);
}
return false;
}

#endif
36 changes: 36 additions & 0 deletions cbindings/src/qnativeeventfilter_hook_c.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//******************************************************************************
// Copyright (c) 2005-2022 by Matteo Salvi
//
// See the included file COPYING.TXT for details about the copyright.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//******************************************************************************

#include "qnativeeventfilter_hook_c.h"

Q_NativeEventFilter_hookH Q_NativeEventFilter_hook_Create(QCoreApplicationH handle)
{
return (Q_NativeEventFilter_hookH) new Q_NativeEventFilter_hook((QCoreApplication*)handle);
}

void Q_NativeEventFilter_hook_Destroy(Q_NativeEventFilter_hookH handle)
{
delete (Q_NativeEventFilter_hook *)handle;
}

void Q_NativeEventFilter_hook_installfilter(Q_NativeEventFilter_hookH handle, QHookH hook)
{
((Q_NativeEventFilter_hook *)handle)->hook_installfilter(hook);
}

void Q_NativeEventFilter_hook_destroyed(Q_NativeEventFilter_hookH handle, QHookH hook)
{
((Q_NativeEventFilter_hook *)handle)->hook_destroyed(hook);
}

void Q_NativeEventFilter_hook_removefilter(Q_NativeEventFilter_hookH handle)
{
((Q_NativeEventFilter_hook *)handle)->hook_removefilter();
}
23 changes: 23 additions & 0 deletions cbindings/src/qnativeeventfilter_hook_c.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//******************************************************************************
// Copyright (c) 2005-2022 by Matteo Salvi
//
// See the included file COPYING.TXT for details about the copyright.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//******************************************************************************

#ifndef Q_NATIVEEVENTFILTER_HOOK_C_H
#define Q_NATIVEEVENTFILTER_HOOK_C_H

#include "qnativeeventfilter_hook.h"
#include "pascalbind.h"

C_EXPORT Q_NativeEventFilter_hookH Q_NativeEventFilter_hook_Create(QCoreApplicationH handle);
C_EXPORT void Q_NativeEventFilter_hook_Destroy(Q_NativeEventFilter_hookH handle);
C_EXPORT void Q_NativeEventFilter_hook_installfilter(Q_NativeEventFilter_hookH handle, QHookH hook);
C_EXPORT void Q_NativeEventFilter_hook_destroyed(Q_NativeEventFilter_hookH handle, QHookH hook);
C_EXPORT void Q_NativeEventFilter_hook_removefilter(Q_NativeEventFilter_hookH handle);

#endif

0 comments on commit cc601da

Please sign in to comment.