Commit 8eebbe08 authored by deuce's avatar deuce
Browse files

Add settitle(const char *) ciolib function to set the window title.

parent d9b587c4
......@@ -85,6 +85,7 @@ int try_x_init(int mode)
cio_api.getmouse=NULL;
cio_api.showmouse=NULL;
cio_api.hidemouse=NULL;
cio_api.settitle=x_settitle;
return(1);
}
fprintf(stderr,"X init failed\n");
......@@ -113,6 +114,7 @@ int try_curses_init(int mode)
cio_api.getmouse=curs_getmouse;
cio_api.showmouse=curs_showmouse;
cio_api.hidemouse=curs_hidemouse;
cio_api.settitle=NULL;
return(1);
}
fprintf(stderr,"Curses init failed\n");
......@@ -142,6 +144,7 @@ int try_ansi_init(int mode)
cio_api.getmouse=NULL;
cio_api.showmouse=NULL;
cio_api.hidemouse=NULL;
cio_api.settitle=NULL;
return(1);
}
fprintf(stderr,"ANSI init failed\n");
......@@ -174,6 +177,7 @@ int try_conio_init(int mode)
cio_api.getmouse=win32_getmouse;
cio_api.showmouse=win32_showmouse;
cio_api.hidemouse=win32_hidemouse;
cio_api.settitle=NULL;
return(1);
}
fprintf(stderr,"CONIO init failed\n");
......@@ -759,3 +763,10 @@ int ciolib_hidemouse(void) {
return(cio_api.hidemouse());
return(-1);
}
void ciolib_settitle(const char *title) {
CIOLIB_INIT();
if(cio_api.settitle!=NULL)
cio_api.settitle(title);
}
......@@ -128,6 +128,7 @@ typedef struct {
int (*getmouse) (struct cio_mouse_event *mevent);
int (*hidemouse) (void);
int (*showmouse) (void);
void (*settitle) (const char *);
} cioapi_t;
extern cioapi_t cio_api;
......@@ -173,6 +174,7 @@ void ciolib_window(int sx, int sy, int ex, int ey);
void ciolib_delline(void);
void ciolib_insline(void);
char *ciolib_getpass(const char *prompt);
void settitle(const char *title);
#ifdef __cplusplus
}
#endif
......@@ -214,6 +216,7 @@ char *ciolib_getpass(const char *prompt);
#define getmouse(a) ciolib_getmouse(a)
#define hidemouse() ciolib_hidemouse()
#define showmouse() ciolib_showmouse()
#define settitle(a) ciolib_settitle(a)
#endif
#endif /* Do not add anything after this line */
......@@ -1380,3 +1380,8 @@ tty_kbhit(void)
return(1);
return(0);
}
void x_win_title(const char *title)
{
XStoreName(dpy, win, title);
}
......@@ -188,6 +188,7 @@ int tty_read(int flag);
int tty_peek(int flag);
int tty_kbhit(void);
void tty_beep(void);
void x_win_title(const char *title);
#define TTYF_BLOCK 0x00000008
#define TTYF_POLL 0x00000010
......
......@@ -230,3 +230,8 @@ void x_textmode(int mode)
{
init_mode(mode);
}
void x_settitle(const char *title)
{
x_win_title(title);
}
......@@ -22,6 +22,7 @@ int x_getch(void);
int x_getche(void);
int x_beep(void);
void x_textmode(int mode);
void x_settitle(const char *title);
#ifdef __cplusplus
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment