*/
}
+char *get_ttymode(void *frontend, const char *mode)
+{
+ struct gui_data *inst = (struct gui_data *)frontend;
+ return term_get_ttymode(inst->term, mode);
+}
+
int from_backend(void *frontend, int is_stderr, const char *data, int len)
{
struct gui_data *inst = (struct gui_data *)frontend;
return term_data(inst->term, is_stderr, data, len);
}
+int from_backend_untrusted(void *frontend, const char *data, int len)
+{
+ struct gui_data *inst = (struct gui_data *)frontend;
+ return term_data_untrusted(inst->term, data, len);
+}
+
+int get_userpass_input(prompts_t *p, unsigned char *in, int inlen)
+{
+ struct gui_data *inst = (struct gui_data *)p->frontend;
+ int ret;
+ ret = cmdline_get_passwd_input(p, in, inlen);
+ if (ret == -1)
+ ret = term_get_userpass_input(inst->term, p, in, inlen);
+ return ret;
+}
+
void logevent(void *frontend, const char *string)
{
struct gui_data *inst = (struct gui_data *)frontend;
gdk_colormap_free_colors(inst->colmap, inst->cols + n, 1);
gdk_colormap_alloc_colors(inst->colmap, inst->cols + n, 1,
- FALSE, FALSE, success);
+ FALSE, TRUE, success);
if (!success[0])
g_error("%s: couldn't allocate colour %d (#%02x%02x%02x)\n", appname,
n, r, g, b);
for (i = 0; i < NEXTCOLOURS; i++) {
if (i < 216) {
int r = i / 36, g = (i / 6) % 6, b = i % 6;
- inst->cols[i+16].red = r * 0x3333;
- inst->cols[i+16].green = g * 0x3333;
- inst->cols[i+16].blue = b * 0x3333;
+ inst->cols[i+16].red = r ? r * 0x2828 + 0x3737 : 0;
+ inst->cols[i+16].green = g ? g * 0x2828 + 0x3737 : 0;
+ inst->cols[i+16].blue = b ? b + 0x2828 + 0x3737 : 0;
} else {
int shade = i - 216;
- shade = (shade + 1) * 0xFFFF / (NEXTCOLOURS - 216 + 1);
+ shade = shade * 0x0a0a + 0x0808;
inst->cols[i+16].red = inst->cols[i+16].green =
inst->cols[i+16].blue = shade;
}
}
gdk_colormap_alloc_colors(inst->colmap, inst->cols, NALLCOLOURS,
- FALSE, FALSE, success);
+ FALSE, TRUE, success);
for (i = 0; i < NALLCOLOURS; i++) {
if (!success[i])
g_error("%s: couldn't allocate colour %d (#%02x%02x%02x)\n",
return ptr;
}
-void write_clip(void *frontend, wchar_t * data, int len, int must_deselect)
+void write_clip(void *frontend, wchar_t * data, int *attr, int len, int must_deselect)
{
struct gui_data *inst = (struct gui_data *)frontend;
if (inst->pasteout_data)
* may want to perform additional actions on any kind of bell (for
* example, taskbar flashing in Windows).
*/
-void beep(void *frontend, int mode)
+void do_beep(void *frontend, int mode)
{
if (mode != BELL_VISUAL)
gdk_beep();
GdkGC *gc = dctx->gc;
int ncombining, combining;
int nfg, nbg, t, fontid, shadow, rlen, widefactor;
+ int monochrome = gtk_widget_get_visual(inst->area)->depth == 1;
if (attr & TATTR_COMBINING) {
ncombining = len;
} else
ncombining = 1;
- nfg = ((attr & ATTR_FGMASK) >> ATTR_FGSHIFT);
- nbg = ((attr & ATTR_BGMASK) >> ATTR_BGSHIFT);
- if (attr & ATTR_REVERSE) {
+ nfg = ((monochrome ? ATTR_DEFFG : (attr & ATTR_FGMASK)) >> ATTR_FGSHIFT);
+ nbg = ((monochrome ? ATTR_DEFBG : (attr & ATTR_BGMASK)) >> ATTR_BGSHIFT);
+ if (!!(attr & ATTR_REVERSE) ^ (monochrome && (attr & TATTR_ACTCURS))) {
t = nfg;
nfg = nbg;
nbg = t;
if (nbg < 16) nbg |= 8;
else if (nbg >= 256) nbg |= 1;
}
- if (attr & TATTR_ACTCURS) {
+ if ((attr & TATTR_ACTCURS) && !monochrome) {
nfg = 260;
nbg = 261;
}