Mon, 03 Feb 2014 22:40:31 +0530
Swap @title and @short_description roles
| 6982 | 1 | /** |
| 33659 | 2 | * @file imgstore.h Utility functions for reference-counted in-memory |
| 3 | * image data. | |
| 6982 | 4 | * @ingroup core |
|
20889
3d0ef192f98c
All the links to libpurple signal pages were in the comment containing the
Will Thompson <resiak@pidgin.im>
parents:
20147
diff
changeset
|
5 | * @see @ref imgstore-signals |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
7 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
8 | /* purple |
| 6982 | 9 | * |
| 15884 | 10 | * Purple is the legal property of its developers, whose names are too numerous |
| 8046 | 11 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 12 | * source distribution. | |
| 6982 | 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify | |
| 15 | * it under the terms of the GNU General Public License as published by | |
| 16 | * the Free Software Foundation; either version 2 of the License, or | |
| 17 | * (at your option) any later version. | |
| 18 | * | |
| 19 | * This program is distributed in the hope that it will be useful, | |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 22 | * GNU General Public License for more details. | |
| 23 | * | |
| 24 | * You should have received a copy of the GNU General Public License | |
| 25 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18412
diff
changeset
|
26 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 6982 | 27 | */ |
| 15884 | 28 | #ifndef _PURPLE_IMGSTORE_H_ |
| 29 | #define _PURPLE_IMGSTORE_H_ | |
| 6982 | 30 | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
31 | #include <glib.h> |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16437
diff
changeset
|
32 | |
|
33052
df92c3d93904
From now on, prpls must specify images using SRC instead of ID.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32787
diff
changeset
|
33 | #define PURPLE_STORED_IMAGE_PROTOCOL "purple-image:" |
|
34490
4825e8b34919
E2EE: implement PURPLE_STOCK_IMAGE_PROTOCOL
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
33661
diff
changeset
|
34 | #define PURPLE_STOCK_IMAGE_PROTOCOL "purple-stock-image:" |
|
33052
df92c3d93904
From now on, prpls must specify images using SRC instead of ID.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32787
diff
changeset
|
35 | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
36 | /** |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
37 | * PurpleStoredImage: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
38 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
39 | * A reference-counted immutable wrapper around an image's data and its |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
40 | * filename. |
|
22613
1077236bf4fb
Add docs to PurpleStoredImage so that doxygen links to it show up
Will Thompson <resiak@pidgin.im>
parents:
20889
diff
changeset
|
41 | */ |
| 15884 | 42 | typedef struct _PurpleStoredImage PurpleStoredImage; |
| 6982 | 43 | |
|
34797
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
44 | #define PURPLE_TYPE_STORED_IMAGE (purple_imgstore_get_type()) |
|
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
45 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32298
diff
changeset
|
46 | G_BEGIN_DECLS |
| 6982 | 47 | |
| 48 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
49 | * purple_imgstore_get_type: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
50 | * |
|
34797
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
51 | * Returns the GType for the PurpleStoredImage boxed structure. |
|
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
52 | * TODO Boxing of PurpleStoredImage is a temporary solution to having a GType |
|
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
53 | * for stored images. This should rather be a GObject instead of a GBoxed. |
|
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
54 | */ |
|
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
55 | GType purple_imgstore_get_type(void); |
|
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
56 | |
|
57724af9660d
Added temporary GBoxed to PurpleStoredImage
Ankit Vani <a@nevitus.org>
parents:
33661
diff
changeset
|
57 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
58 | * purple_imgstore_new: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
59 | * @data: Pointer to the image data, which the imgstore will take |
|
33654
cf6979b92221
Spaces instead of tabs in doxygen comments.
Mark Doliner <mark@kingant.net>
parents:
22895
diff
changeset
|
60 | * ownership of and free as appropriate. If you want a |
|
cf6979b92221
Spaces instead of tabs in doxygen comments.
Mark Doliner <mark@kingant.net>
parents:
22895
diff
changeset
|
61 | * copy of the data, make it before calling this function. |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
62 | * @size: Image data's size. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
63 | * @filename: Filename associated with image. This is for your |
|
22763
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
64 | * convenience. It could be the full path to the |
|
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
65 | * image or, more commonly, the filename of the image |
|
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
66 | * without any directory information. It can also be |
|
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
67 | * NULL, if you don't need to keep track of a filename. |
|
33660
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
68 | * If you intend to use this filename to write the file to |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
69 | * disk, make sure the filename is appropriately escaped. |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
70 | * You may wish to use purple_escape_filename(). |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
71 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
72 | * Create a new PurpleStoredImage. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
73 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
74 | * The image is not added to the image store and no ID is assigned. If you |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
75 | * need to reference the image by an ID, use purple_imgstore_new_with_id() |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
76 | * instead. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
77 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
78 | * The caller owns a reference to this image and must dereference it with |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
79 | * purple_imgstore_unref() for it to be freed. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
80 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
81 | * Returns: The image, or NULL if the image could not be created (because of |
| 33656 | 82 | * empty data or size). |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
83 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
84 | PurpleStoredImage * |
| 33661 | 85 | purple_imgstore_new(gpointer data, size_t size, const char *filename); |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
86 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
87 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
88 | * purple_imgstore_new_from_file: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
89 | * @path: The path to the image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
90 | * |
| 33661 | 91 | * Create a PurpleStoredImage using purple_imgstore_new() by reading the |
| 33656 | 92 | * given filename from disk. |
| 93 | * | |
|
33658
bf6e40d37a72
Ever better documentation!
Mark Doliner <mark@kingant.net>
parents:
33656
diff
changeset
|
94 | * The image is not added to the image store and no ID is assigned. If you |
| 33661 | 95 | * need to reference the image by an ID, use purple_imgstore_new_with_id() |
|
33658
bf6e40d37a72
Ever better documentation!
Mark Doliner <mark@kingant.net>
parents:
33656
diff
changeset
|
96 | * instead. |
|
bf6e40d37a72
Ever better documentation!
Mark Doliner <mark@kingant.net>
parents:
33656
diff
changeset
|
97 | * |
| 33659 | 98 | * Make sure the filename is appropriately escaped. You may wish to use |
| 99 | * purple_escape_filename(). The PurpleStoredImage's filename will be set | |
| 100 | * to the given path. | |
| 101 | * | |
|
33658
bf6e40d37a72
Ever better documentation!
Mark Doliner <mark@kingant.net>
parents:
33656
diff
changeset
|
102 | * The caller owns a reference to this image and must dereference it with |
|
bf6e40d37a72
Ever better documentation!
Mark Doliner <mark@kingant.net>
parents:
33656
diff
changeset
|
103 | * purple_imgstore_unref() for it to be freed. |
|
22652
ba50c2bc1adc
Make it simple to create a stored-image from a filename.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
104 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
105 | * Returns: The image, or NULL if the image could not be created (because of |
| 33656 | 106 | * empty data or size). |
|
22652
ba50c2bc1adc
Make it simple to create a stored-image from a filename.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
107 | */ |
|
ba50c2bc1adc
Make it simple to create a stored-image from a filename.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
108 | PurpleStoredImage * |
|
ba50c2bc1adc
Make it simple to create a stored-image from a filename.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
109 | purple_imgstore_new_from_file(const char *path); |
|
ba50c2bc1adc
Make it simple to create a stored-image from a filename.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
110 | |
|
ba50c2bc1adc
Make it simple to create a stored-image from a filename.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20889
diff
changeset
|
111 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
112 | * purple_imgstore_new_with_id: |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
113 | * @data: Pointer to the image data, which the imgstore will take |
|
33654
cf6979b92221
Spaces instead of tabs in doxygen comments.
Mark Doliner <mark@kingant.net>
parents:
22895
diff
changeset
|
114 | * ownership of and free as appropriate. If you want a |
|
cf6979b92221
Spaces instead of tabs in doxygen comments.
Mark Doliner <mark@kingant.net>
parents:
22895
diff
changeset
|
115 | * copy of the data, make it before calling this function. |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
116 | * @size: Image data's size. |
|
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
117 | * @filename: Filename associated with image. This is for your |
|
22763
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
118 | * convenience. It could be the full path to the |
|
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
119 | * image or, more commonly, the filename of the image |
|
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
120 | * without any directory information. It can also be |
|
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
121 | * NULL, if you don't need to keep track of a filename. |
|
33660
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
122 | * If you intend to use this filename to write the file to |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
123 | * disk, make sure the filename is appropriately escaped. |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
124 | * You may wish to use purple_escape_filename() |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
125 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
126 | * Create a PurpleStoredImage using purple_imgstore_new() and add the |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
127 | * image to the image store. A unique ID will be assigned to the image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
128 | * |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
129 | * The caller owns a reference to the image and must dereference it with |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
130 | * purple_imgstore_unref() or purple_imgstore_unref_by_id() for it to be |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
131 | * freed. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
132 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
133 | * Returns: ID for the image. This is a unique number that can be used |
|
33655
732c94e8b7ec
Document the error condition.
Mark Doliner <mark@kingant.net>
parents:
33654
diff
changeset
|
134 | * within libpurple to reference the image. 0 is returned if the |
| 33661 | 135 | * image could not be created (because of empty data or size). |
| 6982 | 136 | */ |
| 33661 | 137 | int purple_imgstore_new_with_id(gpointer data, size_t size, const char *filename); |
| 6982 | 138 | |
| 139 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
140 | * purple_imgstore_find_by_id: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
141 | * @id: The ID for the image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
142 | * |
| 6982 | 143 | * Retrieve an image from the store. The caller does not own a |
| 144 | * reference to the image. | |
| 145 | * | |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
146 | * Returns: A pointer to the requested image, or NULL if it was not found. |
| 6982 | 147 | */ |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
148 | PurpleStoredImage *purple_imgstore_find_by_id(int id); |
| 6982 | 149 | |
| 150 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
151 | * purple_imgstore_get_data: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
152 | * @img: The Image. |
| 8962 | 153 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
154 | * Retrieves a pointer to the image's data. |
| 8962 | 155 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
156 | * Returns: A pointer to the data, which must not |
| 8962 | 157 | * be freed or modified. |
| 158 | */ | |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
159 | gconstpointer purple_imgstore_get_data(PurpleStoredImage *img); |
| 8962 | 160 | |
| 161 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
162 | * purple_imgstore_get_size: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
163 | * @img: The Image. |
| 8962 | 164 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
165 | * Retrieves the length of the image's data. |
| 8962 | 166 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
167 | * Returns: The size of the data that the pointer returned by |
| 15884 | 168 | * purple_imgstore_get_data points to. |
| 8962 | 169 | */ |
|
16599
43f9ca8adbef
Fix the name of the parameter for purple_imgstore_get_size() so that Doxygen will stop crying.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
170 | size_t purple_imgstore_get_size(PurpleStoredImage *img); |
| 8962 | 171 | |
| 172 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
173 | * purple_imgstore_get_filename: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
174 | * @img: The image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
175 | * |
|
33660
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
176 | * Retrieves a pointer to the image's filename. If you intend to use this |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
177 | * filename to write the file to disk, make sure the filename was |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
178 | * appropriately escaped when you created the PurpleStoredImage. You may |
|
632df42123db
Implore people to escape filenames.
Mark Doliner <mark@kingant.net>
parents:
33659
diff
changeset
|
179 | * wish to use purple_escape_filename(). |
| 8962 | 180 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
181 | * Returns: A pointer to the filename, which must not |
| 8962 | 182 | * be freed or modified. |
| 183 | */ | |
|
16775
8627d2560d40
Get rid of two harmless warnings:
Mark Doliner <markdoliner@pidgin.im>
parents:
16599
diff
changeset
|
184 | const char *purple_imgstore_get_filename(const PurpleStoredImage *img); |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
185 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
186 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
187 | * purple_imgstore_get_extension: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
188 | * @img: The image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
189 | * |
|
22763
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
190 | * Looks at the magic numbers of the image data (the first few bytes) |
|
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
191 | * and returns an extension corresponding to the image's file type. |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
192 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
193 | * Returns: The image's extension (for example "png") or "icon" |
|
22763
6e4bbebdf127
Better documentation.
Mark Doliner <markdoliner@pidgin.im>
parents:
22613
diff
changeset
|
194 | * if unknown. |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
195 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
196 | const char *purple_imgstore_get_extension(PurpleStoredImage *img); |
| 8962 | 197 | |
| 198 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
199 | * purple_imgstore_ref: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
200 | * @img: The image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
201 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
202 | * Increment the reference count. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
203 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
204 | * Returns: @img |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
205 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
206 | PurpleStoredImage * |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
207 | purple_imgstore_ref(PurpleStoredImage *img); |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
208 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
209 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
210 | * purple_imgstore_unref: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
211 | * @img: The image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
212 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
213 | * Decrement the reference count. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
214 | * |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
215 | * If the reference count reaches zero, the image will be freed. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
216 | * |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
217 | * Returns: @img or %NULL if the reference count reached zero. |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
218 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
219 | PurpleStoredImage * |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
220 | purple_imgstore_unref(PurpleStoredImage *img); |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
221 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
222 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
223 | * purple_imgstore_ref_by_id: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
224 | * @id: The ID for the image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
225 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
226 | * Increment the reference count using an ID. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
227 | * |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
228 | * This is a convience wrapper for purple_imgstore_find_by_id() and |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
229 | * purple_imgstore_ref(), so if you have a PurpleStoredImage, it'll |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
230 | * be more efficient to call purple_imgstore_ref() directly. |
| 6982 | 231 | */ |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
232 | void purple_imgstore_ref_by_id(int id); |
| 6982 | 233 | |
| 234 | /** | |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
235 | * purple_imgstore_unref_by_id: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
236 | * @id: The ID for the image. |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
237 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
238 | * Decrement the reference count using an ID. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
239 | * |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
240 | * This is a convience wrapper for purple_imgstore_find_by_id() and |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
241 | * purple_imgstore_unref(), so if you have a PurpleStoredImage, it'll |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
242 | * be more efficient to call purple_imgstore_unref() directly. |
| 6982 | 243 | */ |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
244 | void purple_imgstore_unref_by_id(int id); |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
245 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
246 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
247 | * purple_imgstore_get_handle: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
248 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
249 | * Returns the image store subsystem handle. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
250 | * |
|
35393
00f876b129bc
Initial replacements for gtk-doc style comments
Ankit Vani <a@nevitus.org>
parents:
35047
diff
changeset
|
251 | * Returns: The subsystem handle. |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
252 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
253 | void *purple_imgstore_get_handle(void); |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
254 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
255 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
256 | * purple_imgstore_init: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
257 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
258 | * Initializes the image store subsystem. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
259 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
260 | void purple_imgstore_init(void); |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
261 | |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
262 | /** |
|
35397
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
263 | * purple_imgstore_uninit: |
|
31fa3a1aeff5
Move changes from soc.2013.gobjectification.gtkdoc to this branch
Ankit Vani <a@nevitus.org>
parents:
35393
diff
changeset
|
264 | * |
|
16437
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
265 | * Uninitializes the image store subsystem. |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
266 | */ |
|
7ff7c3405ea2
Rework the buddy icon subsystem to use the imgstore subsystem, and modify the
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
267 | void purple_imgstore_uninit(void); |
| 6982 | 268 | |
|
32787
7072f190d6ad
Use G_BEGIN/END_DECLS in public libpurple files. This was
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32298
diff
changeset
|
269 | G_END_DECLS |
| 6982 | 270 | |
| 15884 | 271 | #endif /* _PURPLE_IMGSTORE_H_ */ |