discord-rpc/include/discord-rpc.h

52 lines
1.5 KiB
C
Raw Normal View History

2017-06-23 23:04:36 +00:00
#pragma once
2017-06-29 16:38:07 +00:00
#include <stdint.h>
2017-06-23 23:04:36 +00:00
2017-07-25 16:27:48 +00:00
#ifdef __cplusplus
extern "C" {
#endif
2017-07-20 20:22:11 +00:00
typedef struct DiscordRichPresence {
2017-07-28 23:06:46 +00:00
const char* state; /* max 128 bytes */
const char* details; /* max 128 bytes */
2017-06-29 16:38:07 +00:00
int64_t startTimestamp;
int64_t endTimestamp;
2017-07-28 23:06:46 +00:00
const char* largeImageKey; /* max 32 bytes */
const char* largeImageText; /* max 128 bytes */
const char* smallImageKey; /* max 32 bytes */
const char* smallImageText; /* max 128 bytes */
const char* partyId; /* max 128 bytes */
2017-06-29 15:58:38 +00:00
int partySize;
int partyMax;
2017-07-28 23:06:46 +00:00
const char* matchSecret; /* max 128 bytes */
const char* joinSecret; /* max 128 bytes */
const char* spectateSecret; /* max 128 bytes */
int8_t instance;
} DiscordRichPresence;
2017-06-23 23:04:36 +00:00
2017-07-20 20:22:11 +00:00
typedef struct DiscordEventHandlers {
2017-06-23 23:04:36 +00:00
void (*ready)();
void (*disconnected)(int errorCode, const char* message);
2017-07-24 21:58:53 +00:00
void (*errored)(int errorCode, const char* message);
2017-06-23 23:04:36 +00:00
void (*joinGame)(const char* joinSecret);
void (*spectateGame)(const char* spectateSecret);
} DiscordEventHandlers;
2017-06-23 23:04:36 +00:00
2017-07-27 20:52:37 +00:00
void Discord_Initialize(const char* applicationId,
DiscordEventHandlers* handlers,
int autoRegister);
2017-06-29 15:58:38 +00:00
void Discord_Shutdown();
2017-07-07 16:41:20 +00:00
/* checks for incoming messages, dispatches callbacks */
2017-07-18 16:47:33 +00:00
void Discord_RunCallbacks();
/* If you disable the lib starting its own io thread, you'll need to call this from your own */
#ifdef DISCORD_DISABLE_IO_THREAD
void Discord_UpdateConnection();
#endif
2017-07-07 16:41:20 +00:00
2017-07-20 22:59:15 +00:00
void Discord_UpdatePresence(const DiscordRichPresence* presence);
2017-07-25 16:27:48 +00:00
#ifdef __cplusplus
} /* extern "C" */
#endif