1 #ifndef UTOX_MAIN_H
2 #define UTOX_MAIN_H
3 
4 /**********************************************************
5  * Includes
6  *********************************************************/
7 #include <tox/tox.h>
8 
9 
10 /**********************************************************
11  * uTox Versions and header information
12  *********************************************************/
13 #include "branding.h"
14 
15 
16 /**********************************************************
17  * UI and Toxcore Limits
18  *********************************************************/
19 
20 #if TOX_VERSION_IS_API_COMPATIBLE(0, 2, 0)
21 // YAY!!
22 #else
23   #error "Unable to compile uTox with this Toxcore version. uTox expects v0.2.*!"
24 #endif
25 
26 #define MAIN_WIDTH 750
27 #define MAIN_HEIGHT 500
28 
29 /* Support for large files. */
30 #define _LARGEFILE_SOURCE
31 #define _FILE_OFFSET_BITS 64
32 
33 #if TOX_VERSION_MAJOR > 0
34 #define ENABLE_MULTIDEVICE 1
35 #endif
36 
37 enum {
38     USER_STATUS_AVAILABLE,
39     USER_STATUS_AWAY_IDLE,
40     USER_STATUS_DO_NOT_DISTURB,
41 };
42 
43 /**
44  * Takes data and the size of data and writes it to the disk
45  *
46  * Returns a bool indicating whether a save is needed
47  */
48 bool utox_data_save_tox(uint8_t *data, size_t length);
49 
50 
51 /**
52  * Reads the tox data from the disk and sets size
53  *
54  * Returns a pointer to the tox data, the caller needs to free it
55  * Returns NULL on failure
56  */
57 uint8_t *utox_data_load_tox(size_t *size);
58 
59 
60 /**
61  * Parses the arguments passed to uTox
62  */
63 void parse_args(int argc, char *argv[],
64                 int8_t *should_launch_at_startup,
65                 int8_t *set_show_window,
66                 bool *allow_root);
67 
68 
69 /**
70  * Initialize uTox
71  */
72 void utox_init(void);
73 
74 /**
75  * Free used resources
76  */
77 void utox_raze(void);
78 
79 #endif
80