noirchat/x11/x11.h

63 lines
1.2 KiB
C

#ifndef X11_H
#define X11_H
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include "x11_assets.h"
#include "../ui_common.h"
#include "../common.h"
#include "../net.h"
#include "../macros.h"
Display *display;
Window window;
int screen;
GC gc;
GC tmp_gc;
GC string_gc;
XColor tmp_color;
XEvent event;
KeySym key;
char key_text[255];
XTextItem x_logo;
// colors
Colormap colormap;
GC green_gc;
XColor green_color;
int redrawInterface();
/* buttons */
Input quit_button;
Input start_button;
Input stop_button;
Input restart_button;
Input list_button;
Input test_input;
Input send_button;
/* input fields */
Input address_input;
Input text_input;
Input newButton(int x, int y, const void* data, size_t size, void(*callback));
Input newInput(int x, int y, const void* data, size_t size, void(*callback));
Input newTextInput(int x, int y, size_t size, void(*callback));
void textInput(Input *input, const char character);
int iterateInput(Input *input);
int addInput(Input *input);
void freeInput(Input input);
int drawInput(const Input *input);
int drawInputText(const Input *input);
void sendMessage(char *str, size_t string_length);
void setAddress(char *str, size_t string_length);
#endif