1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-06-28 09:26:46 +02:00

Started adding support for popup notifications and adjustments to new core

This commit is contained in:
mannol
2014-07-27 01:49:59 +02:00
parent 02b192d6ee
commit 18a6f621f0
12 changed files with 162 additions and 81 deletions

View File

@ -31,6 +31,7 @@
#include "misc_tools.h"
#include "toxic_strings.h"
#include "line_info.h"
#include "notify.h"
/* add a char to input field and buffer */
void input_new_char(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_y)
@ -41,12 +42,12 @@ void input_new_char(ToxWindow *self, wint_t key, int x, int y, int mx_x, int mx_
/* this is the only place we need to do this check */
if (cur_len == -1) {
beep();
notify(self, error, 0);
return;
}
if (add_char_to_buf(ctx, key) == -1) {
beep();
notify(self, error, 0);
return;
}
@ -62,7 +63,7 @@ static void input_backspace(ToxWindow *self, int x, int mx_x)
ChatContext *ctx = self->chatwin;
if (del_char_buf_bck(ctx) == -1) {
beep();
notify(self, error, 0);
return;
}
@ -79,21 +80,21 @@ static void input_backspace(ToxWindow *self, int x, int mx_x)
static void input_delete(ToxWindow *self)
{
if (del_char_buf_frnt(self->chatwin) == -1)
beep();
notify(self, error, 0);
}
/* deletes entire line before cursor from input field and buffer */
static void input_discard(ToxWindow *self)
{
if (discard_buf(self->chatwin) == -1)
beep();
notify(self, error, 0);
}
/* deletes entire line after cursor from input field and buffer */
static void input_kill(ChatContext *ctx)
{
if (kill_buf(ctx) == -1)
beep();
notify(NULL, error, NT_ALWAYS);
}
static void input_yank(ToxWindow *self, int x, int mx_x)
@ -101,7 +102,7 @@ static void input_yank(ToxWindow *self, int x, int mx_x)
ChatContext *ctx = self->chatwin;
if (yank_buf(ctx) == -1) {
beep();
notify(self, error, 0);
return;
}