.. lots of changes ..

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@197 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-05-04 10:32:42 +00:00 committed by cras
commit d3dc9a1307
106 changed files with 4864 additions and 1597 deletions

View file

@ -23,7 +23,7 @@
#include "screen.h"
static GString *entry;
static int promptlen, pos, scrstart, scrpos;
static int promptlen, permanent_prompt, pos, scrstart, scrpos;
static char *prompt;
static void entry_screenpos(void)
@ -71,14 +71,11 @@ static void entry_update(void)
void gui_entry_set_prompt(const char *str)
{
if (str != NULL) {
if (prompt != NULL) g_free(prompt);
prompt = g_strdup(str);
if (permanent_prompt) return;
g_free_not_null(prompt);
prompt = g_strdup(str);
promptlen = strlen(prompt);
if (promptlen > 20) {
promptlen = 20;
prompt[20] = '\0';
}
}
set_color(0);
@ -88,6 +85,23 @@ void gui_entry_set_prompt(const char *str)
entry_update();
}
void gui_entry_set_perm_prompt(const char *str)
{
g_return_if_fail(str != NULL);
g_free_not_null(prompt);
prompt = g_strdup(str);
promptlen = strlen(prompt);
permanent_prompt = TRUE;
gui_entry_set_prompt(NULL);
}
void gui_entry_remove_perm_prompt(void)
{
permanent_prompt = FALSE;
}
void gui_entry_set_text(const char *str)
{
g_return_if_fail(str != NULL);
@ -166,8 +180,10 @@ void gui_entry_redraw(void)
void gui_entry_init(void)
{
entry = g_string_new(NULL);
pos = scrpos = 0;
prompt = NULL; promptlen = 0;
permanent_prompt = FALSE;
}
void gui_entry_deinit(void)