mirror of
https://github.com/status-im/dotherside.git
synced 2025-02-07 02:05:00 +00:00
Improved the documentation
This commit is contained in:
parent
fcdb2ce98f
commit
755ba4ac24
@ -351,6 +351,7 @@ DOS_API DosQObject *DOS_CALL dos_qvariant_toQObject(const DosQVariant *vptr);
|
||||
/// @{
|
||||
|
||||
/// \brief Create a new QMetaObject
|
||||
/// \param superClassMetaObject The superclass metaobject
|
||||
/// \param className The class name
|
||||
/// \param signalDefinitions The SignalDefinitions
|
||||
/// \param slotDefinitions The SlotDefinitions struct
|
||||
@ -365,7 +366,6 @@ DOS_API DosQMetaObject *DOS_CALL dos_qmetaobject_create(DosQMetaObject *superCla
|
||||
const SlotDefinitions *slotDefinitions,
|
||||
const PropertyDefinitions *propertyDefinitions);
|
||||
|
||||
|
||||
/// \brief Free the memory allocated for the given QMetaObject
|
||||
/// \param vptr The QMetaObject
|
||||
DOS_API void DOS_CALL dos_qmetaobject_delete(DosQMetaObject *vptr);
|
||||
@ -383,6 +383,7 @@ DOS_API DosQMetaObject *DOS_CALL dos_qabstractlistmodel_qmetaobject();
|
||||
|
||||
|
||||
/// \brief Create a new QAbstractListModel
|
||||
/// \param callbackObject The pointer of QAbstractListModel in the binded language
|
||||
/// \param metaObject The QMetaObject for this QAbstractListModel
|
||||
/// \param dObjectCallback The callback for handling the properties read/write and slots execution
|
||||
/// \param rowCountCallback The callback for handling the QAbstractListModel::rowCount() execution
|
||||
@ -391,7 +392,7 @@ DOS_API DosQMetaObject *DOS_CALL dos_qabstractlistmodel_qmetaobject();
|
||||
/// \param setDataCallback The callback for handling the QAbstractListModel::setData() execution
|
||||
/// \param roleNamesCallback The callback for handling the QAbstractListModel::roleNames() execution
|
||||
/// \param flagsCallback The callback for handling the QAbstractListModel::flags() execution
|
||||
/// \param headedDataCallback The callback for handling the QAbstractListModel::headerData() execution
|
||||
/// \param headerDataCallback The callback for handling the QAbstractListModel::headerData() execution
|
||||
DOS_API DosQAbstractListModel *DOS_CALL dos_qabstractlistmodel_create(void *callbackObject,
|
||||
DosQMetaObject *metaObject,
|
||||
DObjectCallback dObjectCallback,
|
||||
@ -459,16 +460,20 @@ DOS_API void DOS_CALL dos_qabstractlistmodel_dataChanged(DosQAbstractListModel *
|
||||
DOS_API DosQMetaObject *DOS_CALL dos_qobject_qmetaobject();
|
||||
|
||||
/// \brief Create a new QObject
|
||||
/// \param dObjectPointer The pointer of the QObject in the binded language
|
||||
/// \param metaObject The QMetaObject associated to the given QObject
|
||||
/// \param dObjectCallback The callback called from QML whenever a slot or property
|
||||
/// should be in read, write or invoked
|
||||
/// \return A new QObject
|
||||
/// \note The returned QObject should be freed by calling dos_qobject_delete()
|
||||
/// \note The \p dObjectPointer is usefull for forwarding a property read/slot to the correct
|
||||
/// object in the binded language in the callback
|
||||
DOS_API DosQObject *DOS_CALL dos_qobject_create(void *dObjectPointer,
|
||||
DosQMetaObject *metaObject,
|
||||
DObjectCallback dObjectCallback);
|
||||
|
||||
/// \brief Emit a signal definited in a QObject
|
||||
/// \param vptr The QObject
|
||||
/// \param name The signal name
|
||||
/// \param parametersCount The number of parameters in the \p parameters array
|
||||
/// \param parameters An array of DosQVariant with the values of signal arguments
|
||||
@ -540,7 +545,7 @@ DOS_API bool DOS_CALL dos_qmodelindex_isValid(const DosQModelIndex *vptr);
|
||||
|
||||
/// \brief Calls the QModelIndex::data() function
|
||||
/// \param vptr The QModelIndex
|
||||
/// \param int The model role to which we want the data
|
||||
/// \param role The model role to which we want the data
|
||||
/// \return The QVariant associated at the given role
|
||||
/// \note The returned QVariant should be freed by calling the dos_qvariant_delete() function
|
||||
DOS_API DosQVariant *DOS_CALL dos_qmodelindex_data (const DosQModelIndex *vptr, int role);
|
||||
@ -574,7 +579,7 @@ DOS_API void DOS_CALL dos_qmodelindex_assign (DosQModelIndex *l, const DosQModel
|
||||
|
||||
/// @}
|
||||
|
||||
/// \defgroup QHash
|
||||
/// \defgroup QHash QHash
|
||||
/// \brief Functions related to the QHash class
|
||||
/// @{
|
||||
|
||||
|
@ -99,7 +99,7 @@ typedef void (DOS_CALL *HeaderDataCallback)(void *self, int section, int orienta
|
||||
|
||||
/// Callback called from QML for creating a registered type
|
||||
/**
|
||||
* When a type is created through the QML engine a new QObject \i"Wrapper" is created. This becomes a proxy
|
||||
* When a type is created through the QML engine a new QObject \p "Wrapper" is created. This becomes a proxy
|
||||
* between the "default" QObject created through dos_qobject_create() and the QML engine. This imply that implementation
|
||||
* for this callback should swap the DosQObject* stored in the binded language with the wrapper. At the end the wrapper
|
||||
* becomes the owner of the original "default" DosQObject. Furthermore if the binding language is garbage collected you
|
||||
@ -149,8 +149,13 @@ typedef void (DOS_CALL *CreateDObject)(int id, void *wrapper, void **dosQObject,
|
||||
*/
|
||||
typedef void (DOS_CALL *DeleteDObject)(int id, void * bindedQObject);
|
||||
|
||||
/// \brief Store an array of QVariant
|
||||
/// \note This struct should be freed by calling dos_qvariantarray_delete(DosQVariantArray *ptr). This in turn
|
||||
/// cleans up the internal array
|
||||
struct DosQVariantArray {
|
||||
/// The number of elements
|
||||
int size;
|
||||
/// The array
|
||||
DosQVariant** data;
|
||||
};
|
||||
|
||||
@ -179,39 +184,65 @@ struct QmlRegisterType {
|
||||
DeleteDObject deleteDObject;
|
||||
};
|
||||
|
||||
/// Represents a single signal definition
|
||||
struct SignalDefinition {
|
||||
/// The signal name
|
||||
const char *name;
|
||||
/// The signal parameters count
|
||||
int parametersCount;
|
||||
/// The signal parameters metatypes
|
||||
int *parametersMetaTypes;
|
||||
};
|
||||
|
||||
/// Represents a set of signal definitions
|
||||
struct SignalDefinitions {
|
||||
/// The total number of signals
|
||||
int count;
|
||||
/// The signal definitions array
|
||||
SignalDefinition *definitions;
|
||||
};
|
||||
|
||||
/// Represents a single slot definition
|
||||
struct SlotDefinition {
|
||||
/// The slot name
|
||||
const char *name;
|
||||
/// The slot return type
|
||||
int returnMetaType;
|
||||
/// The slot parameters count
|
||||
int parametersCount;
|
||||
/// The slot parameters metatypes
|
||||
int *parametersMetaTypes;
|
||||
};
|
||||
|
||||
/// Represents a set of slot definitions
|
||||
struct SlotDefinitions {
|
||||
/// The total number of slots
|
||||
int count;
|
||||
/// The slot definitions array
|
||||
SlotDefinition *definitions;
|
||||
};
|
||||
|
||||
/// Represents a single property definition
|
||||
struct PropertyDefinition {
|
||||
/// The property name
|
||||
const char *name;
|
||||
/// The property metatype
|
||||
int propertyMetaType;
|
||||
/// The name of the property read slot
|
||||
const char *readSlot;
|
||||
/// \brief The name of the property write slot
|
||||
/// \note Setting this to null means a readonly proeperty
|
||||
const char *writeSlot;
|
||||
/// \brief The name of the property notify signals
|
||||
/// \note Setting this to null means a constant property
|
||||
const char *notifySignal;
|
||||
};
|
||||
|
||||
/// Represents a set of property definitions
|
||||
struct PropertyDefinitions {
|
||||
/// The total number of properties
|
||||
int count;
|
||||
/// The property definitions array
|
||||
PropertyDefinition *definitions;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user