gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r6957 - gnunet-gtk/src/plugins/chat


From: gnunet
Subject: [GNUnet-SVN] r6957 - gnunet-gtk/src/plugins/chat
Date: Sat, 31 May 2008 14:42:53 -0600 (MDT)

Author: grothoff
Date: 2008-05-31 14:42:52 -0600 (Sat, 31 May 2008)
New Revision: 6957

Removed:
   gnunet-gtk/src/plugins/chat/chat.h
Modified:
   gnunet-gtk/src/plugins/chat/Makefile.am
   gnunet-gtk/src/plugins/chat/chat.c
Log:
adopting to new API

Modified: gnunet-gtk/src/plugins/chat/Makefile.am
===================================================================
--- gnunet-gtk/src/plugins/chat/Makefile.am     2008-05-31 20:30:09 UTC (rev 
6956)
+++ gnunet-gtk/src/plugins/chat/Makefile.am     2008-05-31 20:42:52 UTC (rev 
6957)
@@ -11,12 +11,12 @@
 
 libgnunetgtkmodule_chat_la_SOURCES = \
   chat.c
-  
+
 libgnunetgtkmodule_chat_la_LIBADD = \
   $(top_builddir)/src/common/libgnunetgtk_common.la \
   -lgnunetutil \
   -lgnunetchat_api \
   @GTK_LIBS@ @GNUNETGTK_LIBS@
-  
+
 libgnunetgtkmodule_chat_la_LDFLAGS = \
   -export-dynamic -avoid-version -module

Modified: gnunet-gtk/src/plugins/chat/chat.c
===================================================================
--- gnunet-gtk/src/plugins/chat/chat.c  2008-05-31 20:30:09 UTC (rev 6956)
+++ gnunet-gtk/src/plugins/chat/chat.c  2008-05-31 20:42:52 UTC (rev 6957)
@@ -26,8 +26,15 @@
  * 
  */
 
-#include "chat.h"
+#include "platform.h"
+#include <GNUnet/gnunet_chat_lib.h>
+#include "gnunetgtk_common.h"
 
+/* YUCK -- why? */
+#include "../fs/meta.h"
+#include "../fs/meta.c"
+
+
 struct GNUNET_CHAT_safe_write_struct
 {
   GtkWidget *chatWindow;
@@ -41,8 +48,25 @@
   const char *nick;
 };
 
+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;
+  gchar *room_name;
 
+};
 
+struct GNUNET_CHAT_member_list
+{
+  struct GNUNET_CHAT_member_list *next;
+  struct GNUNET_CHAT_member_list *prev;
+  char *nick;
+};
+
+
 static struct GNUNET_ClientServerConnection *sock;
 
 static struct GNUNET_Mutex *lock;
@@ -79,7 +103,7 @@
 }
 
 /* Safe call to add a nick to the chat room view */
-static void *
+/* static */ void *
 write_nick_save_call (void *arg)
 {
   struct GNUNET_CHAT_safe_nick_write_struct *writeholder = arg;
@@ -117,7 +141,7 @@
 }
 
 /* Safe call to remove a nick from the chat room view */
-static void *
+/* static */ void *
 remove_nick_save_call (void *arg)
 {
   struct GNUNET_CHAT_safe_nick_write_struct *writeholder = arg;
@@ -173,6 +197,7 @@
 receive_callback (void *cls,
                   struct GNUNET_CHAT_Room *room,
                   const GNUNET_HashCode *sender,
+                 const struct GNUNET_ECRS_MetaData * member_info,
                   const char *message,
                  GNUNET_CHAT_MSG_OPTIONS options)
 {
@@ -205,7 +230,8 @@
 static int
 member_list_callback (void *cls,
                      const struct GNUNET_ECRS_MetaData * member_info,
-                     const GNUNET_RSA_PublicKey * pkey)
+                     const GNUNET_RSA_PublicKey * pkey,
+                     GNUNET_CHAT_MSG_OPTIONS opt)
 {
   struct GNUNET_CHAT_gui_chat_client *client = cls;
   GtkWidget *chatnicklist;
@@ -256,31 +282,7 @@
   gtk_widget_show (tab);
 }
 
-void
-on_chat_room_name_button_click_event_chat (GtkWidget * widget, gpointer data)
-{
-  GtkEntry *room_entry;
-  GtkEntry *nick_entry;
-  char *room_text;
-  char *nick_text;
-
-  room_entry =
-    GTK_ENTRY (glade_xml_get_widget
-               (GNUNET_GTK_get_main_glade_XML (), "chatRoomNameEntry"));
-  nick_entry =
-    GTK_ENTRY (glade_xml_get_widget
-               (GNUNET_GTK_get_main_glade_XML (), "chatRoomMonikerEntry"));
-
-  room_text = (char *) gtk_entry_get_text (room_entry);
-  nick_text = (char *) gtk_entry_get_text (nick_entry);
-
-  create_chat_room_tab (room_text, nick_text);
-
-  gtk_entry_set_text (nick_entry, "");
-  gtk_entry_set_text (room_entry, "");
-}
-
-int
+static int
 create_chat_room_tab (char *room_name, char *nick)
 {
   GladeXML *chatXML;
@@ -291,6 +293,7 @@
   struct GNUNET_CHAT_gui_chat_client *client;
   struct GNUNET_CHAT_gui_chat_client *pos;
   struct GNUNET_ECRS_MetaData * meta;
+  GNUNET_HashCode me;
 
   chatnotebook =
     glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (), "chatnotebook");
@@ -316,9 +319,11 @@
     GNUNET_CHAT_join_room (chat_ectx, chat_cfg, nick,
                           meta,
                           room_name,
+                          -1, 
                            &receive_callback, client, &member_list_callback,
                            client,
-                          NULL, NULL);
+                          NULL, NULL,
+                          &me);
   GNUNET_ECRS_meta_data_destroy(meta);
   client->room = chatRoom;
   client->chatFrame = newChatWindow;
@@ -340,11 +345,30 @@
   return GNUNET_OK;
 }
 
-int
-remove_chat_room_tab (char *room_name)
+
+
+void
+on_chat_room_name_button_click_event_chat (GtkWidget * widget, gpointer data)
 {
+  GtkEntry *room_entry;
+  GtkEntry *nick_entry;
+  char *room_text;
+  char *nick_text;
 
-  return GNUNET_SYSERR;
+  room_entry =
+    GTK_ENTRY (glade_xml_get_widget
+               (GNUNET_GTK_get_main_glade_XML (), "chatRoomNameEntry"));
+  nick_entry =
+    GTK_ENTRY (glade_xml_get_widget
+               (GNUNET_GTK_get_main_glade_XML (), "chatRoomMonikerEntry"));
+
+  room_text = (char *) gtk_entry_get_text (room_entry);
+  nick_text = (char *) gtk_entry_get_text (nick_entry);
+
+  create_chat_room_tab (room_text, nick_text);
+
+  gtk_entry_set_text (nick_entry, "");
+  gtk_entry_set_text (room_entry, "");
 }
 
 void

Deleted: gnunet-gtk/src/plugins/chat/chat.h
===================================================================
--- gnunet-gtk/src/plugins/chat/chat.h  2008-05-31 20:30:09 UTC (rev 6956)
+++ gnunet-gtk/src/plugins/chat/chat.h  2008-05-31 20:42:52 UTC (rev 6957)
@@ -1,70 +0,0 @@
-/*
-     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 plugins/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;
-  gchar *room_name;
-
-};
-
-struct GNUNET_CHAT_member_list
-{
-  struct GNUNET_CHAT_member_list *next;
-  struct GNUNET_CHAT_member_list *prev;
-  char *nick;
-};
-
-
-void
-on_chat_frame_send_button_click_event_chat (GtkWidget * widget,
-                                            gpointer data);
-
-
-#endif /*CHAT_H_ */
-
-/* end of chat.h */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]