This commit is contained in:
herbglitch 2025-02-14 03:27:04 -07:00
commit fc5bf78919
36 changed files with 1193 additions and 525 deletions

View file

@ -0,0 +1,38 @@
#ifndef ARC_DBUS_H_
#define ARC_DBUS_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <dbus/dbus.h>
#include <arc/std/vector.h>
/**
* @brief
*/
typedef struct ARC_DBus ARC_DBus;
void ARC_DBus_Create(ARC_DBus **dbus);
void ARC_DBus_Destroy(ARC_DBus *dbus);
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Request.html#org-freedesktop-portal-request-response
void ARC_DBus_RequestResponse();
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-createsession
void ARC_DBus_InitSession(ARC_DBus *dbus);
//Docs: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-bindshortcuts
//NOTE: this is a vector of ARC_DBusShortcut
void ARC_DBus_BindShortcuts(ARC_DBus *dbus, ARC_Vector *dbusShortcutVector);
//NOTE: https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.GlobalShortcuts.html#org-freedesktop-portal-globalshortcuts-listshortcuts
void ARC_DBus_ListShortcuts(ARC_DBus *dbus);
#ifdef __cplusplus
}
#endif
#endif // !ARC_DBUS_H_

View file

@ -0,0 +1,55 @@
#ifndef ARC_DBUS_HELPER_H_
#define ARC_DBUS_HELPER_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <dbus/dbus.h>
/**
* @brief
*/
typedef struct ARC_DBus ARC_DBus;
/**
* @brief
*
* @param[in] dbus
* @param[in] interface
* @param[in] objectPath
*/
void ARC_DBusHelper_BusRequestName(ARC_DBus *dbus, const char *interface, const char *objectPath);
/**
* @brief
*
* @param[in] dbus
* @param[in] interface
* @param[in] objectPath
* @param[in] member
*/
void ARC_DBusHelper_BusAddMatch(ARC_DBus *dbus, const char *interface, const char *objectPath, const char *member);
/**
* @brief
*
* @param[in] message
*/
void ARC_DBusHelper_HandleSignal(DBusMessage *message);
/**
* @brief
*
* @param[in] dictonaryIter
* @param[in] stringKey
* @param[in] varientStringValue
*/
void ARC_DBusHelper_AddStringVarientStringToMessageIterDictionary(DBusMessageIter *dictonaryIter, const char *stringKey, const char *varientStringValue);
#ifdef __cplusplus
}
#endif
#endif // !ARC_DBUS_HELPER_H_

View file

@ -13,6 +13,18 @@ typedef struct ARC_Circle {
int32_t r;
} ARC_Circle;
typedef struct ARC_FCircle {
float x;
float y;
float r;
} ARC_FCircle;
typedef struct ARC_DCircle {
double x;
double y;
double r;
} ARC_DCircle;
#ifdef __cplusplus
}
#endif

View file

@ -9,15 +9,15 @@ extern "C" {
#include "arc/std/string.h"
typedef struct ARC_Config ARC_Config;
void ARC_MathConfig_Init(ARC_Config *config);
uint8_t ARC_Point_Read (ARC_Config *config, ARC_String *string, void **value);
uint8_t ARC_Rect_Read (ARC_Config *config, ARC_String *string, void **value);
uint8_t ARC_RectArray_Read(ARC_Config *config, ARC_String *string, void **value);
void ARC_Point_Delete (ARC_Config *config, ARC_String *string, void *value);
void ARC_Rect_Delete (ARC_Config *config, ARC_String *string, void *value);
void ARC_RectArray_Delete(ARC_Config *config, ARC_String *string, void *value);
//void ARC_MathConfig_Init(ARC_Config *config);
//
//uint8_t ARC_Point_Read (ARC_Config *config, ARC_String *string, void **value);
//uint8_t ARC_Rect_Read (ARC_Config *config, ARC_String *string, void **value);
//uint8_t ARC_RectArray_Read(ARC_Config *config, ARC_String *string, void **value);
//
//void ARC_Point_Delete (ARC_Config *config, ARC_String *string, void *value);
//void ARC_Rect_Delete (ARC_Config *config, ARC_String *string, void *value);
//void ARC_RectArray_Delete(ARC_Config *config, ARC_String *string, void *value);
#ifdef __cplusplus
}

View file

@ -22,6 +22,11 @@ typedef struct ARC_FPoint {
float y;
} ARC_FPoint;
typedef struct ARC_DPoint {
double x;
double y;
} ARC_DPoint;
ARC_FPoint ARC_FPoint_Lerp(ARC_FPoint *start, ARC_FPoint *end, float t);
#ifdef __cplusplus

View file

@ -61,7 +61,7 @@ void ARC_Config_AddKey(ARC_Config *config, ARC_String *type, ARC_ConfigKeyRead k
* @param keyRead function for reading/creating key from string
* @param keyDelete function for deleting stored key
*/
void ARC_Config_AddKeyCString(ARC_Config *config, const char *type, uint64_t length, ARC_ConfigKeyRead keyRead, ARC_ConfigKeyDelete keyDelete);
//void ARC_Config_AddKeyCString(ARC_Config *config, const char *type, uint64_t length, ARC_ConfigKeyRead keyRead, ARC_ConfigKeyDelete keyDelete);
/**
* @brief external callback to add keys to config
@ -99,7 +99,7 @@ void ARC_Config_SetGroup(ARC_Config *config, ARC_String *groupname);
* @param keyname name of key to get from config
* @param value data retrieved from config
*/
void ARC_Config_Get(ARC_Config *config, ARC_String *keyname, void **value);
//void ARC_Config_Get(ARC_Config *config, ARC_String *keyname, void **value);
/**
* @brief commands that can be used in ARC_Config_FileIO