Mercurial > pidgin
view src/gtkutils.h @ 7011:4375bf2d9020
[gaim-migrate @ 7574]
The user-visible changes? Gaim now shows peep's away messages in their
tooltip for AIM over oscar.
Things to do:
-Make sure this doesn't screw up with huge buddy lists
-Replace %n with your screen name, etc. in the tooltip
-Leave in b, i, u tags in the tooltip
-Fix the 2 8 byte memleaks in locate.c
Client authors that aren't me will want to read the following pretty
closely...
I made some internal libfaim changes. I desire to make libfaim cleaner.
I don't know if this really helps or not. Here's what I've done:
Changed all the SNAC-sending functions in info.c to NOT take a conn
argument. The connection is looked up from the session. I'm trying
to make oscar.c less-aware of connections.
Added aim_locate_finduserinfo() - Use for getting the aim_userinfo_t for the
given screenname.
Added aim_locate_getinfoshort() - Use this to request that the servers send
you profile info, away message, caps, or a combination of the above. It's
like aim_locate_getinfo() but less rate limited.
Renamed aim_bos_reqlocaterights() to aim_locate_reqrights()
Renamed aim_getinfo() to aim_locate_getinfo()
Renamed aim_setdirectoryinfo() to aim_locate_setdirinfo()
Renamed aim_0002_000b() to aim_locate_000b()
Renamed aim_setuserinterests() to aim_locate_setinterests()
Removed aim_userinfo_sn()
Removed aim_userinfo_flags()
Removed aim_userinfo_idle()
Removed aim_userinfo_warnlevel()
Removed aim_userinfo_createtime()
Removed aim_userinfo_membersince()
Removed aim_userinfo_onlinesince()
Removed aim_userinfo_sessionlen()
Removed aim_userinfo_hascap()
Renamed info.c to locate.c
Made locate.c keep a static, linked list of nodes of sn, away message,
available message, user info. This list is maintained by libfaim
automatically. Now clients don't have to keep track of all this stuff
themselves, and users won't have to wait for away message/info retrieval
if the person is in your buddy list. libfaim uses the iChat way of
retrieving stuff, which is not nearly as rate limited as the old way.
I actually have a feeling WinAIM uses the same SNAC now (although I
didn't check), but I like pluggin iChat because it's innovative.
Moved sess->emailinfo to a static variable inside email.c.
Removed evilhack from oscar.c
I think that's about everything...
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 29 Sep 2003 12:30:03 +0000 |
parents | 41120df7ed94 |
children | acd2a66e59ed |
line wrap: on
line source
/** * @file gtkutils.h GTK+ utility functions * @ingroup gtkui * * gaim * * Copyright (C) 2003 Christian Hammond <chipx86@gnupdate.org> * * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef _GAIM_GTK_UTILS_H_ #define _GAIM_GTK_UTILS_H_ #include <gtk/gtk.h> #include "gtkconv.h" #include "prpl.h" typedef enum { GAIM_BUTTON_HORIZONTAL, GAIM_BUTTON_VERTICAL } GaimButtonOrientation; typedef enum { GAIM_BUTTON_NONE = 0, GAIM_BUTTON_TEXT, GAIM_BUTTON_IMAGE, GAIM_BUTTON_TEXT_IMAGE } GaimButtonStyle; typedef gboolean (*GaimCheckAccountFunc)(GaimAccount *account); /** * Sets up a gtkimhtml widget, loads it with smileys, and sets the * default signal handlers. * * @param imhtml The gtkimhtml widget to setup. */ void gaim_setup_imhtml(GtkWidget *imhtml); /** * Surrounds the selected text in a conversation with the specified * pre and post strings. * * @param gtkconv The GTK+ conversation. * @param pre The prefix string. * @param post The postfix string. */ void gaim_gtk_surround(GaimGtkConversation *gtkconv, const char *pre, const char *post); /** * Advances the cursor past the position of the specified tags. * * @param gtkconv The GTK+ conversation. * @param pre The prefix string. * @param post The postfix string. */ void gaim_gtk_advance_past(GaimGtkConversation *gtkconv, const char *pre, const char *post); /** * Surrounds the selected text with the specified font. * * @param gtkconv The GTK+ conversation. * @param font The new font. */ void gaim_gtk_set_font_face(GaimGtkConversation *gtkconv, const char *font); /** * Displays a dialog for saving the buddy icon in a conversation. * * @param obj @c NULL * @param conv The conversation. */ void gaim_gtk_save_icon_dialog(GtkObject *obj, GaimConversation *conv); /** * Returns the display style for buttons for the specified conversation * type. * * @param type The conversation type. * * @return The display style. */ int gaim_gtk_get_dispstyle(GaimConversationType type); /** * Changes a button to be either text or image, depending on * preferences. * * This function destroys the old button pointed to by @a button and * returns the new replacement button. * * @param text The text for the button. * @param button The button widget. * @param stock The stock image. * @param type The conversation type the button belongs to. * * @return The new button widget to replace the old one. */ GtkWidget *gaim_gtk_change_text(const char *text, GtkWidget *button, const char *stock, GaimConversationType type); /** * Toggles the sensitivity of a widget. * * @param widget @c NULL. Used for signal handlers. * @param to_toggle The widget to toggle. */ void gaim_gtk_toggle_sensitive(GtkWidget *widget, GtkWidget *to_toggle); /** * Toggles the sensitivity of all widgets in a pointer array. * * @param w @c NULL. Used for signal handlers. * @param data The array containing the widgets to toggle. */ void gtk_toggle_sensitive_array(GtkWidget *w, GPtrArray *data); /** * Adds a seperator to a menu. * * @param menu The menu to add a seperator to. */ void gaim_separator(GtkWidget *menu); /** * Creates a menu item. * * @param menu The menu to which to append the menu item. * @param str The title to use for the newly created menu item. * * @return The newly created menu item. */ GtkWidget *gaim_new_item(GtkWidget *menu, const char *str); /** * Creates a check menu item. * * @param menu The menu to which to append the check menu item. * @param str The title to use for the newly created menu item. * @param sf A function to call when the menu item is activated. * @param data Data to pass to the signal function. * @param checked The initial state of the check item * * @return The newly created menu item. */ GtkWidget *gaim_new_check_item(GtkWidget *menu, const char *str, GtkSignalFunc sf, gpointer data, gboolean checked); /** * Creates a menu item. * * @param menu The menu to which to append the menu item. * @param str The title for the menu item. * @param icon An icon to place to the left of the menu item, * or @c NULL for no icon. * @param sf A function to call when the menu item is activated. * @param data Data to pass to the signal function. * @param accel_key Something. * @param accel_mods Something. * @param mod Something. * * @return The newly created menu item. */ GtkWidget *gaim_new_item_from_stock(GtkWidget *menu, const char *str, const char *icon, GtkSignalFunc sf, gpointer data, guint accel_key, guint accel_mods, char *mod); /** * Creates a button with the specified text and stock icon. * * @param text The text for the button. * @param icon The stock icon name. * @param style The orientation of the button. * * @return The button. */ GtkWidget *gaim_pixbuf_button_from_stock(const char *text, const char *icon, GaimButtonOrientation style); /** * Creates a toolbar button with the stock icon. * * @param stock The stock icon name. * * @return The button. */ GtkWidget *gaim_pixbuf_toolbar_button_from_stock(const char *stock); /** * Creates a HIG preferences frame. * * @param parent The widget to put the frame into. * @param title The title for the frame. * * @return The vbox to put things into. */ GtkWidget *gaim_gtk_make_frame(GtkWidget *parent, const char *title); /** * Creates a drop-down option menu filled with protocols. * * @param protocol The protocol to select by default. * @param cb The callback to call when a protocol is selected. * @param user_data Data to pass to the callback function. * * @return The drop-down option menu. */ GtkWidget *gaim_gtk_protocol_option_menu_new(GaimProtocol protocol, GCallback cb, gpointer user_data); /** * Creates a drop-down option menu filled with accounts. * * @param default_account The account to select by default. * @param show_all Whether or not to show all accounts, or just * active accounts. * @param cb The callback to call when an account is selected. * @param check_account_func A function for checking if an account should * be shown. This can be NULL. * @param user_data Data to pass to the callback function. * * @return The drop-down option menu. */ GtkWidget *gaim_gtk_account_option_menu_new(GaimAccount *default_account, gboolean show_all, GCallback cb, GaimCheckAccountFunc check_account_func, gpointer user_data); /** * Check if the given path is a directory or not. If it is, then modify * the given GtkFileSelection dialog so that it displays the given path. * If the given path is not a directory, then do nothing. * * @param path The path entered in the file selection window by the user. * @param filesel The file selection window. * * @return TRUE if given path is a directory, FALSE otherwise. */ gboolean gaim_gtk_check_if_dir(const char *path, GtkFileSelection *filesel); /** * Stylizes the specified text using HTML, according to the current * font options. * * @param text The text to stylize. * @param len The intended length of the new buffer. * * @return A newly allocated string of length @a len, containing the * stylized version of @a text. * * @todo Move this to a UI-specific file. */ char *stylize(const gchar *text, int len); /** * Shows the usage options for the gaim binary. * * @param mode @c 0 for full options, or @c 1 for a short summary. * @param name The name of the binary. * * @todo Move this to the binary, when a library is formed. */ void show_usage(int mode, const char *name); #endif /* _GAIM_GTK_UTILS_H_ */