| ︙ | | | ︙ | |
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
char icontitle[sizeof(((Config *)0)->wintitle)];
int master_fd, master_func_id, exited;
void *ldisc;
Backend *back;
void *backhandle;
Terminal *term;
void *logctx;
Config cfg;
};
struct draw_ctx {
GdkGC *gc;
struct gui_data *inst;
};
|
>
|
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
|
char icontitle[sizeof(((Config *)0)->wintitle)];
int master_fd, master_func_id, exited;
void *ldisc;
Backend *back;
void *backhandle;
Terminal *term;
void *logctx;
struct unicode_data ucsdata;
Config cfg;
};
struct draw_ctx {
GdkGC *gc;
struct gui_data *inst;
};
|
| ︙ | | | ︙ | |
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
|
} else {
inst->pasteout_data_utf8 = NULL;
inst->pasteout_data_utf8_len = 0;
}
inst->pasteout_data = smalloc(len*6);
inst->pasteout_data_len = len*6;
inst->pasteout_data_len = wc_to_mb(line_codepage, 0, data, len,
inst->pasteout_data,
inst->pasteout_data_len, NULL, NULL);
if (inst->pasteout_data_len == 0) {
sfree(inst->pasteout_data);
inst->pasteout_data = NULL;
} else {
inst->pasteout_data =
srealloc(inst->pasteout_data, inst->pasteout_data_len);
}
|
|
|
|
>
|
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
|
} else {
inst->pasteout_data_utf8 = NULL;
inst->pasteout_data_utf8_len = 0;
}
inst->pasteout_data = smalloc(len*6);
inst->pasteout_data_len = len*6;
inst->pasteout_data_len = wc_to_mb(inst->ucsdata.line_codepage, 0,
data, len, inst->pasteout_data,
inst->pasteout_data_len,
NULL, NULL, NULL);
if (inst->pasteout_data_len == 0) {
sfree(inst->pasteout_data);
inst->pasteout_data = NULL;
} else {
inst->pasteout_data =
srealloc(inst->pasteout_data, inst->pasteout_data_len);
}
|
| ︙ | | | ︙ | |
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
|
if (inst->pastein_data)
sfree(inst->pastein_data);
inst->pastein_data = smalloc(seldata->length * sizeof(wchar_t));
inst->pastein_data_len = seldata->length;
inst->pastein_data_len =
mb_to_wc((seldata->type == inst->utf8_string_atom ?
CS_UTF8 : line_codepage),
0, seldata->data, seldata->length,
inst->pastein_data, inst->pastein_data_len);
term_do_paste(inst->term);
if (term_paste_pending(inst->term))
inst->term_paste_idle_id = gtk_idle_add(idle_paste_func, inst);
|
|
|
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
|
if (inst->pastein_data)
sfree(inst->pastein_data);
inst->pastein_data = smalloc(seldata->length * sizeof(wchar_t));
inst->pastein_data_len = seldata->length;
inst->pastein_data_len =
mb_to_wc((seldata->type == inst->utf8_string_atom ?
CS_UTF8 : inst->ucsdata.line_codepage),
0, seldata->data, seldata->length,
inst->pastein_data, inst->pastein_data_len);
term_do_paste(inst->term);
if (term_paste_pending(inst->term))
inst->term_paste_idle_id = gtk_idle_add(idle_paste_func, inst);
|
| ︙ | | | ︙ | |
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
|
x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
gwcs, len*2);
sfree(gwcs);
} else {
gcs = smalloc(sizeof(GdkWChar) * (len+1));
wc_to_mb(inst->fontinfo[fontid].charset, 0,
wcs, len, gcs, len, ".", NULL);
gdk_draw_text(inst->pixmap, inst->fonts[fontid], gc,
x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
gcs, len);
sfree(gcs);
}
sfree(wcs);
|
|
|
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
|
x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
gwcs, len*2);
sfree(gwcs);
} else {
gcs = smalloc(sizeof(GdkWChar) * (len+1));
wc_to_mb(inst->fontinfo[fontid].charset, 0,
wcs, len, gcs, len, ".", NULL, NULL);
gdk_draw_text(inst->pixmap, inst->fonts[fontid], gc,
x*inst->font_width+inst->cfg.window_border,
y*inst->font_height+inst->cfg.window_border+inst->fonts[0]->ascent,
gcs, len);
sfree(gcs);
}
sfree(wcs);
|
| ︙ | | | ︙ | |
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
|
inst->font_width = gdk_char_width(inst->fonts[0], ' ');
inst->font_height = inst->fonts[0]->ascent + inst->fonts[0]->descent;
inst->compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE);
inst->utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE);
inst->direct_to_font = init_ucs(inst->cfg.line_codepage, font_charset);
inst->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
if (inst->cfg.wintitle[0])
set_title(inst, inst->cfg.wintitle);
else
set_title(inst, "pterm");
|
|
>
|
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
|
inst->font_width = gdk_char_width(inst->fonts[0], ' ');
inst->font_height = inst->fonts[0]->ascent + inst->fonts[0]->descent;
inst->compound_text_atom = gdk_atom_intern("COMPOUND_TEXT", FALSE);
inst->utf8_string_atom = gdk_atom_intern("UTF8_STRING", FALSE);
inst->direct_to_font = init_ucs(&inst->ucsdata,
inst->cfg.line_codepage, font_charset);
inst->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
if (inst->cfg.wintitle[0])
set_title(inst, inst->cfg.wintitle);
else
set_title(inst, "pterm");
|
| ︙ | | | ︙ | |
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
|
inst->textcursor = make_mouse_ptr(inst, GDK_XTERM);
inst->rawcursor = make_mouse_ptr(inst, GDK_LEFT_PTR);
inst->blankcursor = make_mouse_ptr(inst, -1);
make_mouse_ptr(inst, -2); /* clean up cursor font */
inst->currcursor = inst->textcursor;
show_mouseptr(inst, 1);
inst->term = term_init(&inst->cfg, inst);
inst->logctx = log_init(inst, &inst->cfg);
term_provide_logctx(inst->term, inst->logctx);
inst->back = &pty_backend;
inst->back->init((void *)inst->term, &inst->backhandle, &inst->cfg,
NULL, 0, NULL, 0);
inst->back->provide_logctx(inst->backhandle, inst->logctx);
|
|
|
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
|
inst->textcursor = make_mouse_ptr(inst, GDK_XTERM);
inst->rawcursor = make_mouse_ptr(inst, GDK_LEFT_PTR);
inst->blankcursor = make_mouse_ptr(inst, -1);
make_mouse_ptr(inst, -2); /* clean up cursor font */
inst->currcursor = inst->textcursor;
show_mouseptr(inst, 1);
inst->term = term_init(&inst->cfg, &inst->ucsdata, inst);
inst->logctx = log_init(inst, &inst->cfg);
term_provide_logctx(inst->term, inst->logctx);
inst->back = &pty_backend;
inst->back->init((void *)inst->term, &inst->backhandle, &inst->cfg,
NULL, 0, NULL, 0);
inst->back->provide_logctx(inst->backhandle, inst->logctx);
|
| ︙ | | | ︙ | |