Wed, 21 Dec 2005 18:43:39 +0000
[gaim-migrate @ 14935]
Jason LeBrun wrote to gaim-devel:
"I have found a small quirk in the way gdk_pixbuf_loader works. When you
are using it without signalling, the proper way to use it is to call
gdk_pixbuf_loader_close *before* calling gdk_pixbuf_loader_get_animation
or gdk_pixbuf_loader_get_pixbuf. The call to gdk_pixbuf_loader_close
signals that no more writes will be occuring.
In particular, this affects images that are less than 1k in size. If
gdk_pixbuf_loader_close is not called before _get_animation, the loader
will not return anything unless it has received more than 1k of data
(the file type sniffing buffer size) or it has been closed.
So, the proper order of calls for loaders in the gtk*.c code is:
gdk_pixbuf_loader_new();
gdk_pixbuf_loader_write();
gdk_pixbuf_loader_close();
gdk_pixbuf_loader_get_animation();"
I know we fixed a bug by changing this in one place. I've gone through and updated the rest.
| 12272 | 1 | /** |
| 2 | * @file idle.h Idle API | |
| 3 | * @ingroup core | |
| 4 | * | |
| 5 | * gaim | |
| 6 | * | |
| 7 | * Gaim is the legal property of its developers, whose names are too numerous | |
| 8 | * to list here. Please refer to the COPYRIGHT file distributed with this | |
| 9 | * source distribution. | |
| 10 | * | |
| 11 | * This program is free software; you can redistribute it and/or modify | |
| 12 | * it under the terms of the GNU General Public License as published by | |
| 13 | * the Free Software Foundation; either version 2 of the License, or | |
| 14 | * (at your option) any later version. | |
| 15 | * | |
| 16 | * This program is distributed in the hope that it will be useful, | |
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | * GNU General Public License for more details. | |
| 20 | * | |
| 21 | * You should have received a copy of the GNU General Public License | |
| 22 | * along with this program; if not, write to the Free Software | |
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | */ | |
| 25 | #ifndef _GAIM_IDLE_H_ | |
| 26 | #define _GAIM_IDLE_H_ | |
| 27 | ||
| 28 | /** | |
| 29 | * Idle UI operations. | |
| 30 | */ | |
| 31 | typedef struct | |
| 32 | { | |
| 33 | time_t (*get_time_idle)(void); | |
| 34 | } GaimIdleUiOps; | |
| 35 | ||
| 36 | #ifdef __cplusplus | |
| 37 | extern "C" { | |
| 38 | #endif | |
| 39 | ||
| 40 | /**************************************************************************/ | |
| 41 | /** @name Idle API */ | |
| 42 | /**************************************************************************/ | |
| 43 | /*@{*/ | |
| 44 | ||
| 45 | /** | |
| 46 | * Touch our idle tracker. This signifies that the user is | |
| 47 | * 'active'. The conversation code calls this when the | |
| 48 | * user sends an IM, for example. | |
| 49 | */ | |
| 50 | void gaim_idle_touch(void); | |
| 51 | ||
| 52 | /** | |
| 53 | * Fake our idle time by setting the time at which our | |
| 54 | * accounts purportedly became idle. This is used by | |
| 55 | * the I'dle Mak'er plugin. | |
| 56 | */ | |
| 57 | void gaim_idle_set(time_t time); | |
| 58 | ||
| 59 | /*@}*/ | |
| 60 | ||
| 61 | /**************************************************************************/ | |
| 62 | /** @name Idle Subsystem */ | |
| 63 | /**************************************************************************/ | |
| 64 | /*@{*/ | |
| 65 | ||
| 66 | /** | |
| 67 | * Sets the UI operations structure to be used for idle reporting. | |
| 68 | * | |
| 69 | * @param ops The UI operations structure. | |
| 70 | */ | |
| 71 | void gaim_idle_set_ui_ops(GaimIdleUiOps *ops); | |
| 72 | ||
| 73 | /** | |
| 74 | * Returns the UI operations structure used for idle reporting. | |
| 75 | * | |
| 76 | * @return The UI operations structure in use. | |
| 77 | */ | |
| 78 | GaimIdleUiOps *gaim_idle_get_ui_ops(void); | |
| 79 | ||
| 80 | /** | |
| 81 | * Initializes the idle system. | |
| 82 | */ | |
| 83 | void gaim_idle_init(void); | |
| 84 | ||
| 85 | /** | |
| 86 | * Uninitializes the idle system. | |
| 87 | */ | |
| 88 | void gaim_idle_uninit(void); | |
| 89 | ||
| 90 | /*@}*/ | |
| 91 | ||
| 92 | #ifdef __cplusplus | |
| 93 | } | |
| 94 | #endif | |
| 95 | ||
| 96 | #endif /* _GAIM_IDLE_H_ */ |