| ︙ | | | ︙ | |
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
Backend *back;
void *backhandle;
Terminal *term;
void *logctx;
int exited;
struct unicode_data ucsdata;
Config cfg;
};
struct draw_ctx {
GdkGC *gc;
struct gui_data *inst;
};
|
>
|
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
|
Backend *back;
void *backhandle;
Terminal *term;
void *logctx;
int exited;
struct unicode_data ucsdata;
Config cfg;
void *eventlogstuff;
};
struct draw_ctx {
GdkGC *gc;
struct gui_data *inst;
};
|
| ︙ | | | ︙ | |
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
|
* log files. I can always make it properly configurable later.
*/
return 2;
}
void logevent(void *frontend, char *string)
{
/*
* This is not a very helpful function: events are logged
* pretty much exclusively by the back end, and our pty back
* end is self-contained. So we need do nothing.
*/
}
int font_dimension(void *frontend, int which)/* 0 for width, 1 for height */
{
struct gui_data *inst = (struct gui_data *)frontend;
if (which)
|
|
|
|
|
|
>
|
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
|
* log files. I can always make it properly configurable later.
*/
return 2;
}
void logevent(void *frontend, char *string)
{
Terminal *term = (Terminal *)frontend;
struct gui_data *inst = (struct gui_data *)term->frontend;
log_eventlog(inst->logctx, string);
logevent_dlg(inst->eventlogstuff, string);
}
int font_dimension(void *frontend, int which)/* 0 for width, 1 for height */
{
struct gui_data *inst = (struct gui_data *)frontend;
if (which)
|
| ︙ | | | ︙ | |
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
|
}
void about_menuitem(GtkMenuItem *item, gpointer data)
{
/* struct gui_data *inst = (struct gui_data *)data; */
about_box();
}
void update_specials_menu(void *frontend)
{
Terminal *term = (Terminal *)frontend;
struct gui_data *inst = (struct gui_data *)term->frontend;
const struct telnet_special *specials;
|
>
>
>
>
>
>
|
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
|
}
void about_menuitem(GtkMenuItem *item, gpointer data)
{
/* struct gui_data *inst = (struct gui_data *)data; */
about_box();
}
void event_log_menuitem(GtkMenuItem *item, gpointer data)
{
struct gui_data *inst = (struct gui_data *)data;
showeventlog(inst->eventlogstuff, inst->window);
}
void update_specials_menu(void *frontend)
{
Terminal *term = (Terminal *)frontend;
struct gui_data *inst = (struct gui_data *)term->frontend;
const struct telnet_special *specials;
|
| ︙ | | | ︙ | |
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
|
/*
* Set up the Ctrl+rightclick context menu.
*/
{
GtkWidget *menuitem;
char *s;
inst->menu = gtk_menu_new();
#define MKMENUITEM(title, func) do { \
menuitem = title ? gtk_menu_item_new_with_label(title) : \
gtk_menu_item_new(); \
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
gtk_widget_show(menuitem); \
if (func != NULL) \
gtk_signal_connect(GTK_OBJECT(menuitem), "activate", \
GTK_SIGNAL_FUNC(func), inst); \
} while (0)
MKMENUITEM("Special Commands", NULL);
inst->specialsmenu = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), inst->specialsmenu);
inst->specialsitem1 = menuitem;
MKMENUITEM(NULL, NULL);
inst->specialsitem2 = menuitem;
MKMENUITEM("Clear Scrollback", clear_scrollback_menuitem);
|
>
>
>
|
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
|
/*
* Set up the Ctrl+rightclick context menu.
*/
{
GtkWidget *menuitem;
char *s;
extern const int use_event_log;
inst->menu = gtk_menu_new();
#define MKMENUITEM(title, func) do { \
menuitem = title ? gtk_menu_item_new_with_label(title) : \
gtk_menu_item_new(); \
gtk_container_add(GTK_CONTAINER(inst->menu), menuitem); \
gtk_widget_show(menuitem); \
if (func != NULL) \
gtk_signal_connect(GTK_OBJECT(menuitem), "activate", \
GTK_SIGNAL_FUNC(func), inst); \
} while (0)
if (use_event_log)
MKMENUITEM("Event Log", event_log_menuitem);
MKMENUITEM("Special Commands", NULL);
inst->specialsmenu = gtk_menu_new();
gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), inst->specialsmenu);
inst->specialsitem1 = menuitem;
MKMENUITEM(NULL, NULL);
inst->specialsitem2 = menuitem;
MKMENUITEM("Clear Scrollback", clear_scrollback_menuitem);
|
| ︙ | | | ︙ | |
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
|
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);
uxsel_init();
|
>
>
|
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
|
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->eventlogstuff = eventlogstuff_new();
inst->term = term_init(&inst->cfg, &inst->ucsdata, inst);
inst->logctx = log_init(inst, &inst->cfg);
term_provide_logctx(inst->term, inst->logctx);
uxsel_init();
|
| ︙ | | | ︙ | |