247 |
} |
} |
248 |
} |
} |
249 |
|
|
250 |
|
#ifndef NO_COPY_N_PASTE |
251 |
static void on_destroy_textview(GtkWidget *widget, gpointer data) { |
static void on_destroy_textview(GtkWidget *widget, gpointer data) { |
252 |
appdata_t *appdata = (appdata_t*)data; |
appdata_t *appdata = (appdata_t*)data; |
253 |
int destroy_active = FALSE; |
int destroy_active = FALSE; |
285 |
gtk_widget_set_sensitive(appdata->menu_paste, FALSE); |
gtk_widget_set_sensitive(appdata->menu_paste, FALSE); |
286 |
} |
} |
287 |
} |
} |
288 |
|
#endif |
289 |
|
|
290 |
static void on_destroy_htmlview(GtkWidget *widget, gpointer data) { |
static void on_destroy_htmlview(GtkWidget *widget, gpointer data) { |
291 |
http_context_t *context = (http_context_t*)data; |
http_context_t *context = (http_context_t*)data; |
314 |
load_context = tmp_context; |
load_context = tmp_context; |
315 |
} |
} |
316 |
|
|
317 |
|
#ifndef NO_COPY_N_PASTE |
318 |
on_destroy_textview(widget, context->appdata); |
on_destroy_textview(widget, context->appdata); |
319 |
|
#endif |
320 |
|
|
321 |
/* destroy context */ |
/* destroy context */ |
322 |
free(data); |
free(data); |
323 |
} |
} |
324 |
|
|
325 |
|
#ifndef NO_COPY_N_PASTE |
326 |
static gboolean focus_in(GtkWidget *widget, GdkEventFocus *event, |
static gboolean focus_in(GtkWidget *widget, GdkEventFocus *event, |
327 |
gpointer data) { |
gpointer data) { |
328 |
appdata_t *appdata = (appdata_t*)data; |
appdata_t *appdata = (appdata_t*)data; |
348 |
void html_copy_to_clipboard(appdata_t *appdata) { |
void html_copy_to_clipboard(appdata_t *appdata) { |
349 |
gtk_html_copy(GTK_HTML(appdata->active_buffer)); |
gtk_html_copy(GTK_HTML(appdata->active_buffer)); |
350 |
} |
} |
351 |
|
#endif |
352 |
|
|
353 |
/* panning a gtkhtml view currently doesn't work well */ |
/* panning a gtkhtml view currently doesn't work well */ |
354 |
#undef PANNABLE_HTML |
#undef PANNABLE_HTML |
419 |
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); |
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); |
420 |
gtk_text_buffer_set_text(buffer, text, strlen(text)); |
gtk_text_buffer_set_text(buffer, text, strlen(text)); |
421 |
|
|
422 |
#ifndef USE_MAEMO |
#ifndef USE_HILDON_TEXT_VIEW |
423 |
view = gtk_text_view_new_with_buffer(buffer); |
view = gtk_text_view_new_with_buffer(buffer); |
424 |
#else |
#else |
425 |
view = hildon_text_view_new(); |
view = hildon_text_view_new(); |
430 |
gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE); |
gtk_text_view_set_editable(GTK_TEXT_VIEW(view), FALSE); |
431 |
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(view), FALSE); |
gtk_text_view_set_cursor_visible(GTK_TEXT_VIEW(view), FALSE); |
432 |
|
|
433 |
|
#ifndef NO_COPY_N_PASTE |
434 |
g_signal_connect(G_OBJECT(view), "destroy", |
g_signal_connect(G_OBJECT(view), "destroy", |
435 |
G_CALLBACK(on_destroy_textview), appdata); |
G_CALLBACK(on_destroy_textview), appdata); |
436 |
|
#endif |
437 |
} |
} |
438 |
|
|
439 |
|
#ifndef NO_COPY_N_PASTE |
440 |
g_signal_connect(G_OBJECT(view), "focus-in-event", |
g_signal_connect(G_OBJECT(view), "focus-in-event", |
441 |
G_CALLBACK(focus_in), appdata); |
G_CALLBACK(focus_in), appdata); |
442 |
|
#endif |
443 |
|
|
444 |
if(scrollwin) { |
if(scrollwin) { |
445 |
#ifndef USE_PANNABLE_AREA |
#ifndef USE_PANNABLE_AREA |