2 * GNT - The GLib Ncurses Toolkit
4 * GNT is the legal property of its developers, whose names are too numerous
5 * to list here. Please refer to the COPYRIGHT file distributed with this
8 * This library is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
23 #include "gntclipboard.h"
30 static guint signals
[SIGS
] = { 0 };
33 gnt_clipboard_class_init(GntClipboardClass
*klass
)
35 signals
[SIG_CLIPBOARD
] =
36 g_signal_new("clipboard_changed",
37 G_TYPE_FROM_CLASS(klass
),
41 g_cclosure_marshal_VOID__POINTER
,
42 G_TYPE_NONE
, 1, G_TYPE_POINTER
);
46 /******************************************************************************
48 *****************************************************************************/
51 gnt_clipboard_set_string(GntClipboard
*clipboard
, const gchar
*string
)
53 g_free(clipboard
->string
);
54 clipboard
->string
= g_strdup(string
);
55 g_signal_emit(clipboard
, signals
[SIG_CLIPBOARD
], 0, clipboard
->string
);
59 gnt_clipboard_get_string(GntClipboard
*clipboard
)
61 return g_strdup(clipboard
->string
);
64 static void gnt_clipboard_init(GTypeInstance
*instance
, gpointer
class) {
65 GntClipboard
*clipboard
= GNT_CLIPBOARD(instance
);
66 clipboard
->string
= g_strdup("");
70 gnt_clipboard_get_gtype(void)
72 static GType type
= 0;
75 static const GTypeInfo info
= {
76 sizeof(GntClipboardClass
),
78 NULL
, /* base_finalize */
79 (GClassInitFunc
)gnt_clipboard_class_init
,
81 NULL
, /* class_data */
84 gnt_clipboard_init
, /* instance_init */
85 NULL
/* value_table */
88 type
= g_type_register_static(G_TYPE_OBJECT
,