Author: nevans Date: 2008-03-03 15:24:46 -0700 (Mon, 03 Mar 2008) New Revision: 6532
Added: gnunet-gtk/src/plugins/chat/chat.h Modified: gnunet-gtk/src/plugins/chat/chat.c Log: Modified: gnunet-gtk/src/plugins/chat/chat.c =================================================================== --- gnunet-gtk/src/plugins/chat/chat.c 2008-03-03 21:54:39 UTC (rev 6531) +++ gnunet-gtk/src/plugins/chat/chat.c 2008-03-03 22:24:46 UTC (rev 6532) @@ -30,6 +30,8 @@ const GNUNET_RSA_PublicKey pub_key; const struct GNUNET_RSA_PrivateKey *priv_key; +struct GNUNET_GE_Context *ectx; +struct GNUNET_GC_Configuration *cfg; /** * A message was sent in the chat to us. @@ -53,7 +55,9 @@ const char *message, GNUNET_CronTime timestamp, GNUNET_CHAT_MSG_OPTIONS options) { - fprintf (stdout, "%s: %s\n", senderNick, message); + g_print ("%s: %s\n", senderNick, message); + /*Write the message to the appropriate room... + * Somehow G wants me to do this without knowing which room it's headed to, but I don't see how...*/ return GNUNET_OK; } @@ -62,23 +66,16 @@ { GtkWidget *tab; GtkWidget *button; - GtkWidget *hbox; priv_key = GNUNET_RSA_create_key (); GNUNET_RSA_get_public_key (priv_key, &pub_key); + /* Need to initialize ectx and cfg in here somehow... Still trying to figure that out. + * Once those are set up, the rest of this junk should be okay for now. (ingnoring memory leaks and such of course) + */ - g_print("g_print works!\n"); - hbox = - glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "chatHBox"); - - tab = glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "chatnotebookvbox"); - - button = gtk_button_new_with_label("hello world"); - gtk_container_add(GTK_CONTAINER(tab), button); - gtk_widget_show (tab); } @@ -112,6 +109,7 @@ GtkWidget *newChatWindow; GtkWidget *chatnotebook; GtkWidget *chatLabel; + struct GNUNET_CHAT_Room *chatRoom; chatnotebook = glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "chatnotebook"); chatXML = glade_xml_new (GNUNET_GTK_get_glade_filename (), "chatFrame",PACKAGE_NAME); @@ -123,7 +121,8 @@ gtk_widget_show (chatnotebook); - GNUNET_CHAT_gui_join_room (nick,room_name,&pub_key,priv_key,&receive_callback,NULL); + chatRoom = GNUNET_CHAT_join_room (ectx,cfg,nick,room_name,&pub_key,priv_key,NULL,&receive_callback,NULL); + return 1; } Added: gnunet-gtk/src/plugins/chat/chat.h =================================================================== --- gnunet-gtk/src/plugins/chat/chat.h (rev 0) +++ gnunet-gtk/src/plugins/chat/chat.h 2008-03-03 22:24:46 UTC (rev 6532) @@ -0,0 +1,63 @@ +/* + This file is part of GNUnet. + (C) 2008 Christian Grothoff (and other contributing authors) + + GNUnet is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 2, or (at your + option) any later version. + + GNUnet is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNUnet; see the file COPYING. If not, write to the + Free Software Foundation, Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. +*/ + +/** + * @author Nathan Evans + * @file applications/chat/chat.h + **/ +#ifndef CHAT_H_ +#define CHAT_H_ + +#include "platform.h" +#include <GNUnet/gnunet_chat_lib.h> +#include "../fs/meta.h" +#include "../fs/meta.c" +#include "platform.h" +#include "gnunetgtk_common.h" + +void +on_chat_room_name_button_click_event_chat(GtkWidget* widget, gpointer data); + +int +create_chat_room_tab(char *room_name,char *nick); + +int +remove_chat_room_tab(char *room_name); + + + +struct GNUNET_CHAT_gui_chat_client +{ + struct GNUNET_CHAT_gui_chat_client *next; + struct GNUNET_CHAT_gui_chat_client *prev; + int number; + GtkWidget *chatFrame; + struct GNUNET_CHAT_Room *room; + +}; + + +void +on_chat_frame_send_button_click_event_chat(GtkWidget* widget, gpointer data); + + +#endif /*CHAT_H_*/ + +/* end of chat.h */ _______________________________________________ GNUnet-SVN mailing list GNUnet-SVN@gnu.org http://lists.gnu.org/mailman/listinfo/gnunet-svn