Mercurial > pidgin-twitter
diff pidgin-twitter.h @ 254:c2620a99622b
- divided the source file into several parts.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Sat, 22 Nov 2008 18:01:18 +0900 |
parents | 80be57d8b6fa |
children | 2145f975ef69 |
line wrap: on
line diff
--- a/pidgin-twitter.h Fri Nov 21 22:22:33 2008 +0900 +++ b/pidgin-twitter.h Sat Nov 22 18:01:18 2008 +0900 @@ -15,14 +15,20 @@ #include <gdk-pixbuf/gdk-pixbuf.h> #include <libxml/xmlreader.h> -#include "gtkplugin.h" +#include <gtkplugin.h> +#include <util.h> +#include <debug.h> +#include <connection.h> +#include <version.h> +#include <sound.h> +#include <gtkconv.h> +#include <gtkimhtml.h> + #include "util.h" -#include "debug.h" -#include "connection.h" -#include "version.h" -#include "sound.h" -#include "gtkconv.h" -#include "gtkimhtml.h" +#include "prefs.h" +#include "twitter_api.h" +#include "icon.h" +#include "main.h" /* regp id */ enum { @@ -84,6 +90,11 @@ guint id; } status_t; +typedef struct _source { + guint id; + PurpleConversation *conv; +} source_t; + /* container for api based post */ typedef struct twitter_message { PurpleAccount *account; @@ -197,80 +208,11 @@ #define DEFAULT_ICON_MAX_COUNT (50) #define DEFAULT_ICON_MAX_DAYS (7) #define DAYS_TO_SECONDS(d) ((d) * 86400) +#define NUM_REGPS (13) +#define NUM_SERVICES (4) /* twitter, wassr, identica, jisko. */ /* debug macros */ #define twitter_debug(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_INFO, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); #define twitter_error(fmt, ...) do { if(purple_prefs_get_bool(OPT_LOG_OUTPUT)) purple_debug(PURPLE_DEBUG_ERROR, PLUGIN_NAME, "%s():%4d: " fmt, __FUNCTION__, (int)__LINE__, ## __VA_ARGS__); } while(0); -/* prototypes */ -static void escape(gchar **str); -static gboolean sending_im_cb(PurpleAccount *account, char *recipient, char **buffer, void *data); -static gboolean eval(const GMatchInfo *match_info, GString *result, gpointer user_data); -static void translate(gchar **str, gint which, gint service); -static void playsound(gchar **str, gint which); -static gboolean writing_im_cb(PurpleAccount *account, char *sender, char **buffer, PurpleConversation *conv, int flags, void *data); -static void insert_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *position, gchar *new_text, gint new_text_length, gpointer user_data); -static void delete_text_cb(GtkTextBuffer *textbuffer, GtkTextIter *start_pos, GtkTextIter *end_pos, gpointer user_data); -static void detach_from_window(void); -static void detach_from_conv(PurpleConversation *conv, gpointer null); -static void delete_requested_icon_marks(PidginConversation *gtkconv, GHashTable *table); -static void attach_to_window(void); -static void attach_to_conv(PurpleConversation *conv, gpointer null); -static gboolean is_twitter_account(PurpleAccount *account, const char *name); -static gboolean is_twitter_conv(PurpleConversation *conv); -static gboolean is_wassr_account(PurpleAccount *account, const char *name); -static gboolean is_wassr_conv(PurpleConversation *conv); -static gboolean is_identica_account(PurpleAccount *account, const char *name); -static gboolean is_identica_conv(PurpleConversation *conv); -static gboolean is_jisko_account(PurpleAccount *account, const char *name); -static gboolean is_jisko_conv(PurpleConversation *conv); -static void conv_created_cb(PurpleConversation *conv, gpointer null); -static void deleting_conv_cb(PurpleConversation *conv); -static gboolean receiving_im_cb(PurpleAccount *account, char **sender, char **buffer, PurpleConversation *conv, PurpleMessageFlags *flags, void *data); -static void insert_icon_at_mark(GtkTextMark *requested_mark, gpointer user_data); -static void insert_requested_icon(const gchar *user_name, gint service); -static void got_icon_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message); -static void request_icon(const char *user_name, gint service, gboolean renew); -static void mark_icon_for_user(GtkTextMark *mark, const gchar *user_name, gint service); -static gboolean displaying_im_cb(PurpleAccount *account, const char *who, char **message, PurpleConversation *conv, PurpleMessageFlags flags, void *data); -static void displayed_im_cb(PurpleAccount *account, const char *who, char *message, PurpleConversation *conv, PurpleMessageFlags flags); -static gboolean load_plugin(PurplePlugin *plugin); -static gboolean unload_plugin(PurplePlugin *plugin); -static void counter_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); - -static void init_plugin(PurplePlugin *plugin); -static void remove_marks_func(gpointer key, gpointer value, gpointer user_data); -static void cancel_fetch_func(gpointer key, gpointer value, gpointer user_data); -static gint get_service_type(PurpleConversation *conv); -static GdkPixbuf *make_scaled_pixbuf(const gchar *url_text, gsize len); - -static void parse_user(xmlNode *user, status_t *st); -static void parse_status(xmlNode *status, status_t *st); -static void get_status_with_api_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, size_t len, const gchar *error_message); -static gboolean get_status_with_api(gpointer data); -static void read_timestamp(const char *str, struct tm *res); - -static void strip_markup(gchar **str, gboolean escape); -static gchar *strip_html_markup(const gchar *src); -static GtkWidget *prefs_get_frame(PurplePlugin *plugin); - -/* more prototypes */ -static gboolean is_posted_message(status_t *status, guint lastid); -static void free_status(status_t *st); -static gboolean ensure_path_exists(const char *dir); -static gchar *twitter_memrchr(const gchar *s, int c, size_t n); -static void got_page_cb(PurpleUtilFetchUrlData *url_data, gpointer user_data, const gchar *url_text, gsize len, const gchar *error_message); -static void cleanup_hash_entry_func(gpointer key, gpointer value, gpointer user_data); -static void invalidate_icon_data_func(gpointer key, gpointer value, gpointer user_data); -static void icon_size_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); -static void interval_prefs_cb(const char *name, PurplePrefType type, gconstpointer val, gpointer data); -static void text_changed_cb(gpointer *data); -static void bool_toggled_cb(gpointer *data); -static void spin_changed_cb(gpointer *data); -static void combo_changed_cb(gpointer *data); -static void disconnect_prefs_cb(GtkObject *object, gpointer data); -static GtkWidget *prefs_get_frame(PurplePlugin *plugin); -static void apply_filter(gchar **sender, gchar **buffer, PurpleMessageFlags *flags, int service); -static gint get_service_type_by_account(PurpleAccount *account, const char *sender); - #endif