view plugins/toc_commands.c @ 2349:60c716c32c40

[gaim-migrate @ 2362] (Names changed to protect the innocent.) blue:~/gaim/app/src $ ls -l ~/.gaim/logs/mid.log -rw-r--r-- 1 eric eric 607043 Sep 20 03:28 /home/eric/.gaim/logs/mid.log Previously on my 1.4GHz Athlon, displaying this 600k log file in the Log Viewer took 42 seconds: time start: 1001157353 time end : 1001157395 Now, with the new smiley checker, it takes 23: time start: 1001157199 time end : 1001157222 That's still horrible, but it's only a little more than half the time it previously took. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sat, 22 Sep 2001 11:22:59 +0000
parents c9c20663e05b
children
line wrap: on
line source

#define GAIM_PLUGINS
#include "gaim.h"

#include <gtk/gtk.h>

void enter_callback(GtkWidget *widget, GtkWidget *entry) {
	gchar *entry_text;
	entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
	/* this is bad, but you really shouldn't be using this plugin */
	sflap_send(connections->data, entry_text, strlen(entry_text), TYPE_DATA);
}

void destroy_callback(GtkWidget *widget, void *handle) {
	gtk_widget_destroy(widget);
	gaim_plugin_unload(handle);
}

GtkWidget *window;
char *gaim_plugin_init(GModule *h) {
	GtkWidget *entry;

	window = gtk_window_new(GTK_WINDOW_DIALOG);
	gtk_window_set_title(GTK_WINDOW(window), "Gaim - SFLAP interface");

	entry = gtk_entry_new();
	gtk_signal_connect(GTK_OBJECT(entry), "activate",
			   (GtkSignalFunc)enter_callback,
			   entry);
	gtk_container_add(GTK_CONTAINER(window), entry);
	gtk_widget_show(entry);

	gtk_signal_connect(GTK_OBJECT(window), "destroy",
			   (GtkSignalFunc)destroy_callback,
			   h);

	gtk_widget_show(window);

	return NULL;
}

void gaim_plugin_remove() {
	gtk_widget_destroy(window);
}

char *name() {
	return "TOC Interface";
}

char *description() {
	return "Allows you to talk directly to the TOC server, bypassing gaim.";
}