Added a function to copy the selection to the clipboard

This commit is contained in:
Pierre Pronchery 2011-01-26 01:26:45 +00:00
parent fba5ed6b9a
commit 3d5a5222b7
5 changed files with 38 additions and 1 deletions

View File

@ -291,6 +291,13 @@ int ghtml_set_proxy(GtkWidget * ghtml, SurferProxyType type, char const * http,
/* useful */
/* ghtml_copy */
void ghtml_copy(GtkWidget * ghtml)
{
/* FIXME implement */
}
/* ghtml_execute */
void ghtml_execute(GtkWidget * ghtml, char const * code)
{

View File

@ -412,6 +412,13 @@ int ghtml_set_proxy(GtkWidget * ghtml, SurferProxyType type, char const * http,
/* useful */
/* ghtml_copy */
void ghtml_copy(GtkWidget * ghtml)
{
/* FIXME implement */
}
/* ghtml_execute */
void ghtml_execute(GtkWidget * ghtml, char const * code)
{

View File

@ -1,5 +1,5 @@
/* $Id$ */
/* Copyright (c) 2010 Pierre Pronchery <khorben@defora.org> */
/* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Surfer */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -443,6 +443,20 @@ int ghtml_set_proxy(GtkWidget * ghtml, SurferProxyType type, char const * http,
/* useful */
/* ghtml_copy */
void ghtml_copy(GtkWidget * widget)
{
GHtml * ghtml;
GtkTextBuffer * buffer;
GtkClipboard * clipboard;
ghtml = g_object_get_data(G_OBJECT(widget), "ghtml");
clipboard = gtk_widget_get_clipboard(ghtml->view,
GDK_SELECTION_CLIPBOARD);
gtk_text_buffer_copy_clipboard(ghtml->tbuffer, clipboard);
}
/* ghtml_execute */
void ghtml_execute(GtkWidget * ghtml, char const * code)
{

View File

@ -352,6 +352,13 @@ int ghtml_set_proxy(GtkWidget * widget, SurferProxyType type, char const * http,
/* useful */
/* ghtml_copy */
void ghtml_copy(GtkWidget * ghtml)
{
/* FIXME implement */
}
/* ghtml_execute */
void ghtml_execute(GtkWidget * widget, char const * code)
{

View File

@ -63,6 +63,8 @@ gboolean ghtml_find(GtkWidget * ghtml, char const * text, gboolean sensitive,
void ghtml_redo(GtkWidget * ghtml);
void ghtml_undo(GtkWidget * ghtml);
void ghtml_copy(GtkWidget * ghtml);
void ghtml_zoom_in(GtkWidget * ghtml);
void ghtml_zoom_out(GtkWidget * ghtml);
void ghtml_zoom_reset(GtkWidget * ghtml);