changeset 16536:fa8d831e9aa6

merge of 'cf51292b9bf12554eecb319a673f153ef5c6f0e4' and 'db889e441d31dfa6f732d85945c7fca2e2b5fcda'
author Richard Laager <rlaager@wiktel.com>
date Fri, 27 Apr 2007 21:53:07 +0000
parents 42362f23d5a8 (current diff) 72e4e92f9a2c (diff)
children ba7c7b98e294
files PROGRAMMING_NOTES
diffstat 3 files changed, 10 insertions(+), 54 deletions(-) [+]
line wrap: on
line diff
--- a/PROGRAMMING_NOTES	Fri Apr 27 20:21:41 2007 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-Notes on keeping Pidgin, Finch, and libpurple OS independant
-------------------------------------------------------------
-
-General
--------
-- Use G_DIR_SEPARATOR_S and G_DIR_SEPARATOR for paths
-
-- Use g_getenv, g_snprintf, g_vsnprintf
-
-- Use purple_home_dir instead of g_get_home_dir or g_getenv("HOME")
-
-- Make sure when including win32dep.h that it is the last header to
-  be included.
-
-- Open binary files when reading or writing with 'b' mode.
-
-  e.g: fopen("somefile", "wb");
-
-  Not doing so will open files in windows using default translation mode. 
-  i.e. newline -> <CR><LF>
-
-Paths
------
-
-- DATADIR, LOCALEDIR & LIBDIR are defined as functions in the win32 build
-  Doing the following will therefore break the windows build:
-
-  printf("File in DATADIR is: %s\n", DATADIR G_DIR_SEPARATOR_S "pic.png");
-
-  it should be:
-
-  printf("File in DATADIR is: %s%s%s\n", DATADIR, G_DIR_SEPARATOR_S, "pic.png");
-
-PLUGINS & PROTOS
-----------------
-
-- G_MODULE_EXPORT all functions which are to be accessed from outside the
-  scope of its "dll" or "so". (E.G. purple_plugin_init)
-
-- G_MODULE_IMPORT all global variables which are located outside your
-  dynamic library. (E.G. connections)
-
-  (Not doing this will cause "Memory Access Violations" in win32)
--- a/libpurple/gaim-compat.h	Fri Apr 27 20:21:41 2007 +0000
+++ b/libpurple/gaim-compat.h	Fri Apr 27 21:53:07 2007 +0000
@@ -27,6 +27,8 @@
 #ifndef _GAIM_COMPAT_H_
 #define _GAIM_COMPAT_H_
 
+#include <glib.h>
+
 /* from account.h */
 #define GaimAccountUiOps PurpleAccountUiOps
 #define GaimAccount PurpleAccount
@@ -51,7 +53,6 @@
 #define gaim_account_set_password            purple_account_set_password
 #define gaim_account_set_alias               purple_account_set_alias
 #define gaim_account_set_user_info           purple_account_set_user_info
-#define gaim_account_set_buddy_icon          purple_account_set_buddy_icon
 #define gaim_account_set_buddy_icon_path     purple_account_set_buddy_icon_path
 #define gaim_account_set_protocol_id         purple_account_set_protocol_id
 #define gaim_account_set_connection          purple_account_set_connection
@@ -81,7 +82,6 @@
 #define gaim_account_get_password           purple_account_get_password
 #define gaim_account_get_alias              purple_account_get_alias
 #define gaim_account_get_user_info          purple_account_get_user_info
-#define gaim_account_get_buddy_icon         purple_account_get_buddy_icon
 #define gaim_account_get_buddy_icon_path    purple_account_get_buddy_icon_path
 #define gaim_account_get_protocol_id        purple_account_get_protocol_id
 #define gaim_account_get_protocol_name      purple_account_get_protocol_name
@@ -338,22 +338,22 @@
 
 #define GaimBuddyIcon  PurpleBuddyIcon
 
-#define gaim_buddy_icon_new      purple_buddy_icon_new
-#define gaim_buddy_icon_destroy  purple_buddy_icon_destroy
+#define gaim_buddy_icon_new(account, username, icon_data, icon_len)\
+        purple_buddy_icon_new(account, username, g_memdup(icon_data, icon_len), icon_len)
 #define gaim_buddy_icon_ref      purple_buddy_icon_ref
 #define gaim_buddy_icon_unref    purple_buddy_icon_unref
 #define gaim_buddy_icon_update   purple_buddy_icon_update
 
-#define gaim_buddy_icon_set_account   purple_buddy_icon_set_account
-#define gaim_buddy_icon_set_username  purple_buddy_icon_set_username
-#define gaim_buddy_icon_set_data      purple_buddy_icon_set_protocol_data
+#define gaim_buddy_icon_set_data(icon, data, len) \
+        purple_buddy_icon_set_protocol_data(icon, g_memdup(data, len), len, NULL);
 
 #define gaim_buddy_icon_get_account   purple_buddy_icon_get_account
 #define gaim_buddy_icon_get_username  purple_buddy_icon_get_username
 #define gaim_buddy_icon_get_data      purple_buddy_icon_get_data
 #define gaim_buddy_icon_get_type      purple_buddy_icon_get_extension
 
-#define gaim_buddy_icons_set_for_user   purple_buddy_icons_set_for_user
+#define gaim_buddy_icons_set_for_user(icon, data, len) \
+        purple_buddy_icons_set_for_user(icon, g_memdup(data, len), len)
 #define gaim_buddy_icons_find           purple_buddy_icons_find
 #define gaim_buddy_icons_set_caching    purple_buddy_icons_set_caching
 #define gaim_buddy_icons_is_caching     purple_buddy_icons_is_caching
@@ -944,7 +944,6 @@
 
 /* from gaim-client.h */
 
-/* XXX: should this be purple_init, or pidgin_init */
 #define gaim_init  purple_init
 
 /* from idle.h */
@@ -962,7 +961,7 @@
 
 #define GaimStoredImage  PurpleStoredImage
 
-#define gaim_imgstore_add           purple_imgstore_add_with_id
+#define gaim_imgstore_add(data, size, filename) purple_imgstore_add_with_id(g_memdup(data, size), size, filename)
 #define gaim_imgstore_get           purple_imgstore_find_by_id
 #define gaim_imgstore_get_data      purple_imgstore_get_data
 #define gaim_imgstore_get_size      purple_imgstore_get_size
--- a/libpurple/imgstore.h	Fri Apr 27 20:21:41 2007 +0000
+++ b/libpurple/imgstore.h	Fri Apr 27 21:53:07 2007 +0000
@@ -100,7 +100,7 @@
  * @return The size of the data that the pointer returned by
  *         purple_imgstore_get_data points to.
  */
-size_t purple_imgstore_get_size(PurpleStoredImage *i);
+size_t purple_imgstore_get_size(PurpleStoredImage *img);
 
 /**
  * Retrieves a pointer to the image's filename.