Re: Mozilla selections question

Philip <[email protected]>
Newsgroups gmane.comp.mozilla.devel.gtk
Organization Telenet Internet
Message-ID <[email protected]>
Havoc Pennington wrote:

> Time to start cut-and-pasting hunks of library.
> 
> Note that a GNOME 2 or GNOME 1 app will work fine with either the 1 or 2
> desktop, or KDE for that matter.

Okay,

So this is my solution for the Gnome 1.x version of the application..


/* My custom function, copypasted from glib 2.0 libs */
gchar* ucs2tostr(guchar *data, gint length);


void on_bla_selection_received (
	GtkWidget       *widget,
	GtkSelectionData *data,
	guint            time,
	gpointer         ...) {


gint realen=strlen(data->data);

if ((realen+1 != data->length)&&
    (realen-1 != data->length)&&(realen != data->length)){


	do_stuff_with_data(ucs2tostr(data->data, data->length));
} else {
	do_stuff_with_data(data->data);
}



I am going to try to use as much standard glib2.0 functions in the
Gnome 2.x port as possible of course.. thats for tomorrow.. this
works at this moment.. which means that I can get HTML selections
from OpenOffice.org and Mozilla ... (whoohoo)


-- 
Philip van Hoof aka freax (http://www.freax.eu.org)
irc: irc.openprojects.net mailto:freax @ linux.be
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.