/pidgin/main: caa6f35efd7a: Image store: very initial implementa...

Tomasz Wasilczyk twasilczyk at pidgin.im
Wed Apr 9 14:20:28 EDT 2014


Changeset: caa6f35efd7ab92705b16b8571eeb46d4db04904
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-09 20:20 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/caa6f35efd7a

Description:

Image store: very initial implementation

diffstat:

 libpurple/Makefile.am    |   2 +
 libpurple/Makefile.mingw |   1 +
 libpurple/core.c         |   3 ++
 libpurple/image-store.c  |  56 ++++++++++++++++++++++++++++++++++++++++++
 libpurple/image-store.h  |  64 ++++++++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 126 insertions(+), 0 deletions(-)

diffs (187 lines):

diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -72,6 +72,7 @@ purple_coresources = \
 	http.c \
 	idle.c \
 	image.c \
+	image-store.c \
 	imgstore.c \
 	keyring.c \
 	log.c \
@@ -157,6 +158,7 @@ purple_coreheaders = \
 	http.h \
 	idle.h \
 	image.h \
+	image-store.h \
 	imgstore.h \
 	keyring.h \
 	log.h \
diff --git a/libpurple/Makefile.mingw b/libpurple/Makefile.mingw
--- a/libpurple/Makefile.mingw
+++ b/libpurple/Makefile.mingw
@@ -96,6 +96,7 @@ C_SRC =	\
 			http.c \
 			idle.c \
 			image.c \
+			image-store.c \
 			imgstore.c \
 			keyring.c \
 			log.c \
diff --git a/libpurple/core.c b/libpurple/core.c
--- a/libpurple/core.c
+++ b/libpurple/core.c
@@ -31,6 +31,7 @@
 #include "glibcompat.h"
 #include "http.h"
 #include "idle.h"
+#include "image-store.h"
 #include "imgstore.h"
 #include "keyring.h"
 #include "network.h"
@@ -179,6 +180,7 @@ purple_core_init(const char *ui)
 
 	/* The buddy icon code uses the imgstore, so init it early. */
 	purple_imgstore_init();
+	_purple_image_store_init();
 
 	/* Accounts use status, buddy icons and connection signals, so
 	 * initialize these before accounts
@@ -279,6 +281,7 @@ purple_core_quit(void)
 	purple_proxy_uninit();
 	purple_dnsquery_uninit();
 	purple_imgstore_uninit();
+	_purple_image_store_uninit();
 	purple_network_uninit();
 
 	/* Everything after unloading all plugins must not fail if prpls aren't
diff --git a/libpurple/image-store.c b/libpurple/image-store.c
new file mode 100644
--- /dev/null
+++ b/libpurple/image-store.c
@@ -0,0 +1,56 @@
+/* purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ */
+
+#include "image-store.h"
+
+guint
+purple_image_store_add(PurpleImage *image)
+{
+	return 0;
+}
+
+guint
+purple_image_store_add_weak(PurpleImage *image)
+{
+	return 0;
+}
+
+guint
+purple_image_store_add_temporary(PurpleImage *image)
+{
+	return 0;
+}
+
+PurpleImage *
+purple_image_store_get(guint id)
+{
+	return NULL;
+}
+
+void
+_purple_image_store_init(void)
+{
+}
+
+void
+_purple_image_store_uninit(void)
+{
+}
diff --git a/libpurple/image-store.h b/libpurple/image-store.h
new file mode 100644
--- /dev/null
+++ b/libpurple/image-store.h
@@ -0,0 +1,64 @@
+/* purple
+ *
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program 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 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+ */
+
+#ifndef _PURPLE_IMAGE_STORE_H_
+#define _PURPLE_IMAGE_STORE_H_
+/**
+ * SECTION:image-store
+ * @include:image-store.h
+ * @section_id: libpurple-image-store
+ * @short_description: todo
+ * @title: Image store
+ *
+ * TODO desc.
+ */
+
+#include "image.h"
+
+#define PURPLE_IMAGE_STORE_PROTOCOL "purple-image:"
+#define PURPLE_IMAGE_STORE_STOCK_PROTOCOL "purple-stock-image:"
+
+G_BEGIN_DECLS
+
+/* increases and maintains reference count */
+guint
+purple_image_store_add(PurpleImage *image);
+
+/* doesn't change reference count and is removed from the store when obj is destroyed */
+guint
+purple_image_store_add_weak(PurpleImage *image);
+
+/* increases reference count for five seconds */
+guint
+purple_image_store_add_temporary(PurpleImage *image);
+
+PurpleImage *
+purple_image_store_get(guint id);
+
+void
+_purple_image_store_init(void);
+
+void
+_purple_image_store_uninit(void);
+
+G_END_DECLS
+
+#endif /* _PURPLE_IMAGE_STORE_H_ */



More information about the Commits mailing list