changeset 4481:b30b0a02ada0

[gaim-migrate @ 4756] The last of gtk-related code is out of the conversation framework. There are now functions to set and retrieve the conversation window UI operations structures that will be used in all windows. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 30 Jan 2003 21:25:24 +0000
parents a4a87d79c67c
children 59ff9d0b7b85
files src/aim.c src/conversation.c src/conversation.h
diffstat 3 files changed, 43 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/aim.c	Thu Jan 30 21:09:19 2003 +0000
+++ b/src/aim.c	Thu Jan 30 21:25:24 2003 +0000
@@ -520,6 +520,8 @@
 		}
 	}
 
+	gaim_set_win_ui_ops(gaim_get_gtk_window_ui_ops());
+
 	setup_stock();
 
 #ifndef _WIN32
--- a/src/conversation.c	Thu Jan 30 21:09:19 2003 +0000
+++ b/src/conversation.c	Thu Jan 30 21:25:24 2003 +0000
@@ -45,6 +45,8 @@
 
 #define SEND_TYPED_TIMEOUT 5000
 
+static struct gaim_window_ui_ops *win_ui_ops = NULL;
+
 static GList *conversations = NULL;
 static GList *ims = NULL;
 static GList *chats = NULL;
@@ -436,8 +438,7 @@
 
 	win = g_malloc0(sizeof(struct gaim_window));
 
-	/* CONV XXX */
-	win->ui_ops = gaim_get_gtk_window_ui_ops();
+	win->ui_ops = gaim_get_win_ui_ops();
 
 	if (win->ui_ops != NULL && win->ui_ops->new_window != NULL)
 		win->ui_ops->new_window(win);
@@ -1412,8 +1413,6 @@
 
 	ops->write_conv(conv, who, message, length, flags, mtime);
 
-	/* TODO: Do logging fun stuff. */
-
 	win = gaim_conversation_get_window(conv);
 
 	if (!(flags & WFLAG_NOLOG) &&
@@ -2259,3 +2258,15 @@
 	place_conv = fnc;
 	place_conv_index = index;
 }
+
+void
+gaim_set_win_ui_ops(struct gaim_window_ui_ops *ops)
+{
+	win_ui_ops = ops;
+}
+
+struct gaim_window_ui_ops *
+gaim_get_win_ui_ops(void)
+{
+	return win_ui_ops;
+}
--- a/src/conversation.h	Thu Jan 30 21:09:19 2003 +0000
+++ b/src/conversation.h	Thu Jan 30 21:25:24 2003 +0000
@@ -1078,6 +1078,7 @@
 /**************************************************************************/
 /** @name Conversation Placement Functions                                */
 /**************************************************************************/
+/*@{*/
 
 /**
  * Adds a conversation placement function to the list of possible functions.
@@ -1149,4 +1150,29 @@
  */
 void gaim_conv_placement_set_active(int index);
 
+/*@}*/
+
+/**************************************************************************/
+/** @name UI Registration Functions                                       */
+/**************************************************************************/
+/*@{*/
+
+/**
+ * Sets the UI operations structure to be used in all gaim conversation
+ * windows.
+ *
+ * @param fnc The function.
+ */
+void gaim_set_win_ui_ops(struct gaim_window_ui_ops *ops);
+
+/**
+ * Returns the gaim window UI operations structure to be used in
+ * new windows.
+ *
+ * @return A filled-out gaim_window_ui_ops structure.
+ */
+struct gaim_window_ui_ops *gaim_get_win_ui_ops(void);
+
+/*@}*/
+
 #endif /* _CONVERSATION_H_ */