Mercurial > hg > nnchat
view ui.h @ 507:e644d373afb9
Fix a memory leak.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 03 Jun 2012 06:31:52 +0300 |
parents | 60e04709ce0f |
children | 942eea564b15 |
line wrap: on
line source
/* * NNChat - Custom chat client for NewbieNudes.com chatrooms * Written by Matti 'ccr' Hämäläinen * (C) Copyright 2008-2012 Tecnic Software productions (TNSP) */ #ifndef LIBNNUI_H #define LIBNNUI_H #ifdef __WIN32 // Undefine because both windows.h and curses.h #define it #undef MOUSE_MOVED #endif #ifdef HAVE_NCURSES_H #include <ncurses.h> #else #include <curses.h> #endif #include "th_types.h" #include "th_string.h" #define SET_MAX_WINDOWS (32) #define NN_BACKBUF_LEN (512) // Backbuffer size (in lines) typedef struct { int *buf; size_t len, bufsize; } nn_line_t; typedef struct { qringbuf_t *data; // "Backbuffer" data for this window int pos; // Current position in the window, 0 = real time BOOL dirty; int num; char *id; // Chatter ID, NULL = main window nn_line_t *line; } nn_window_t; extern nn_window_t *currWin; extern BOOL cursesInit; BOOL nnwin_init(int delay); void nnwin_shutdown(); void nnwin_reset(void); void nnwin_update(BOOL force, nn_editbuf_t *ebuf, char *optUserName, int optUserColor); nn_window_t * nnwin_main_window(); nn_window_t * nnwin_get(const int index); nn_window_t * nnwin_find(const char *id); void nnwin_set_current(nn_window_t *); BOOL nnwin_open(const char *name, BOOL curwin); void nnwin_close(nn_window_t *win); int nnwin_print(nn_window_t *win, const char *fmt); char * nnwin_prompt_requester(const char *info, BOOL allowEmpty); #endif