smiley.h
Go to the documentation of this file.
/* 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_SMILEY_H_
#define _PURPLE_SMILEY_H_
#include <glib-object.h>
#include "imgstore.h"
#include "util.h"
typedef struct _PurpleSmiley PurpleSmiley;
typedef struct _PurpleSmileyClass PurpleSmileyClass;
#define PURPLE_TYPE_SMILEY (purple_smiley_get_type ())
#define PURPLE_SMILEY(smiley) (G_TYPE_CHECK_INSTANCE_CAST ((smiley), PURPLE_TYPE_SMILEY, PurpleSmiley))
#define PURPLE_SMILEY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), PURPLE_TYPE_SMILEY, PurpleSmileyClass))
#define PURPLE_IS_SMILEY(smiley) (G_TYPE_CHECK_INSTANCE_TYPE ((smiley), PURPLE_TYPE_SMILEY))
#define PURPLE_IS_SMILEY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PURPLE_TYPE_SMILEY))
#define PURPLE_SMILEY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), PURPLE_TYPE_SMILEY, PurpleSmileyClass))
#ifdef __cplusplus
extern "C" {
#endif
/**************************************************************************/
/**************************************************************************/
GType purple_smiley_get_type(void);
PurpleSmiley *
purple_smiley_new(PurpleStoredImage *img, const char *shortcut);
PurpleSmiley *
purple_smiley_new_from_file(const char *shortcut, const char *filepath);
void
purple_smiley_delete(PurpleSmiley *smiley);
gboolean
purple_smiley_set_shortcut(PurpleSmiley *smiley, const char *shortcut);
void
purple_smiley_set_data(PurpleSmiley *smiley, guchar *smiley_data,
size_t smiley_data_len);
const char *purple_smiley_get_shortcut(const PurpleSmiley *smiley);
const char *purple_smiley_get_checksum(const PurpleSmiley *smiley);
PurpleStoredImage *purple_smiley_get_stored_image(const PurpleSmiley *smiley);
gconstpointer purple_smiley_get_data(const PurpleSmiley *smiley, size_t *len);
const char *purple_smiley_get_extension(const PurpleSmiley *smiley);
char *purple_smiley_get_full_path(PurpleSmiley *smiley);
/**************************************************************************/
/**************************************************************************/
GList *
purple_smileys_get_all(void);
PurpleSmiley *
purple_smileys_find_by_shortcut(const char *shortcut);
PurpleSmiley *
purple_smileys_find_by_checksum(const char *checksum);
const char *purple_smileys_get_storing_dir(void);
void purple_smileys_init(void);
void purple_smileys_uninit(void);
#ifdef __cplusplus
}
#endif
#endif /* _PURPLE_SMILEY_H_ */
imgstore.h
IM Image Store API.
PurpleStoredImage
struct _PurpleStoredImage PurpleStoredImage
A set of utility functions that provide a reference-counted immutable wrapper around an image's data ...
Definition: imgstore.h:37
purple_smiley_get_data
gconstpointer purple_smiley_get_data(const PurpleSmiley *smiley, size_t *len)
Returns the custom smiley's data.
purple_smiley_get_stored_image
PurpleStoredImage * purple_smiley_get_stored_image(const PurpleSmiley *smiley)
Returns the PurpleStoredImage with the reference counter incremented.
purple_smileys_get_all
GList * purple_smileys_get_all(void)
Returns a list of all custom smileys.
purple_smiley_get_type
GType purple_smiley_get_type(void)
GObject-fu.
purple_smileys_get_storing_dir
const char * purple_smileys_get_storing_dir(void)
Returns the directory used to store custom smiley cached files.
purple_smiley_get_extension
const char * purple_smiley_get_extension(const PurpleSmiley *smiley)
Returns an extension corresponding to the custom smiley's file type.
purple_smileys_find_by_shortcut
PurpleSmiley * purple_smileys_find_by_shortcut(const char *shortcut)
Returns a custom smiley given its shortcut.
purple_smileys_init
void purple_smileys_init(void)
Initializes the custom smiley subsystem.
purple_smiley_set_data
void purple_smiley_set_data(PurpleSmiley *smiley, guchar *smiley_data, size_t smiley_data_len)
Changes the custom smiley's image data.
purple_smiley_new_from_file
PurpleSmiley * purple_smiley_new_from_file(const char *shortcut, const char *filepath)
Creates a new custom smiley, reading the image data from a file.
purple_smiley_delete
void purple_smiley_delete(PurpleSmiley *smiley)
Destroys the custom smiley and releases the associated resources.
purple_smiley_get_shortcut
const char * purple_smiley_get_shortcut(const PurpleSmiley *smiley)
Returns the custom smiley's associated shortcut (e.g.
PurpleSmiley
struct _PurpleSmiley PurpleSmiley
A custom smiley.
Definition: smiley.h:44
purple_smileys_find_by_checksum
PurpleSmiley * purple_smileys_find_by_checksum(const char *checksum)
Returns a custom smiley given its checksum.
purple_smileys_uninit
void purple_smileys_uninit(void)
Uninitializes the custom smiley subsystem.
purple_smiley_get_checksum
const char * purple_smiley_get_checksum(const PurpleSmiley *smiley)
Returns the custom smiley data's checksum.
purple_smiley_get_full_path
char * purple_smiley_get_full_path(PurpleSmiley *smiley)
Returns a full path to an custom smiley.
purple_smiley_new
PurpleSmiley * purple_smiley_new(PurpleStoredImage *img, const char *shortcut)
Creates a new custom smiley from a PurpleStoredImage.
purple_smiley_set_shortcut
gboolean purple_smiley_set_shortcut(PurpleSmiley *smiley, const char *shortcut)
Changes the custom smiley's shortcut.
util.h
Utility Functions.