]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-avatar-image.c
Merge commit 'jtellier/video-call-button-sensitivity'
[empathy.git] / libempathy-gtk / empathy-avatar-image.c
index 6b378b606a224a6152b096a9ee919bea13342964..f7898e1bdf324a7c027ec1f7885626c0ce4906f2 100644 (file)
  *
  * 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.
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA  02110-1301  USA
  *
  * Authors: Xavier Claessens <xclaesse@gmail.com>
  */
 
 #include "config.h"
 
-#include <glib/gi18n.h>
+#include <glib/gi18n-lib.h>
 #include <gdk/gdkkeysyms.h>
 #include <gdk/gdk.h>
 #include <gtk/gtk.h>
 #include "empathy-avatar-image.h"
 #include "empathy-ui-utils.h"
 
+/**
+ * SECTION:empathy-avatar-image
+ * @title: EmpathyAvatarImage
+ * @short_description: A widget to display an avatar
+ * @include: libempathy-gtk/empathy-avatar-image.h
+ *
+ * #EmpathyAvatarImage is a widget which displays an avatar.
+ */
+
+/**
+ * EmpathyAvatarImage:
+ * @parent: parent object
+ *
+ * Widget which displays an avatar.
+ */
+
 #define MAX_SMALL 64
 #define MAX_LARGE 400
 
@@ -216,7 +232,7 @@ avatar_image_button_press_event (GtkWidget *widget, GdkEventButton *event)
        gtk_image_set_from_pixbuf (GTK_IMAGE (image), pixbuf);
        g_object_unref (pixbuf);
 
-       gdk_window_get_origin (priv->image->window, &x, &y);
+       gdk_window_get_origin (gtk_widget_get_window (priv->image), &x, &y);
 
        x = x - (popup_width - width) / 2;
        y = y - (popup_height - height) / 2;
@@ -251,6 +267,13 @@ avatar_image_button_release_event (GtkWidget *widget, GdkEventButton *event)
        return TRUE;
 }
 
+/**
+ * empathy_avatar_image_new:
+ *
+ * Creates a new #EmpathyAvatarImage.
+ *
+ * Return value: a new #EmpathyAvatarImage
+ */
 GtkWidget *
 empathy_avatar_image_new (void)
 {
@@ -261,6 +284,13 @@ empathy_avatar_image_new (void)
        return GTK_WIDGET (avatar_image);
 }
 
+/**
+ * empathy_avatar_image_set:
+ * @avatar_image: an #EmpathyAvatarImage
+ * @avatar: the #EmpathyAvatar to set @avatar_image to
+ *
+ * Sets @avatar_image to display the avatar indicated by @avatar.
+ */
 void
 empathy_avatar_image_set (EmpathyAvatarImage *avatar_image,
                          EmpathyAvatar      *avatar)
@@ -276,7 +306,7 @@ empathy_avatar_image_set (EmpathyAvatarImage *avatar_image,
        }
 
        if (avatar) {
-               priv->pixbuf = empathy_pixbuf_from_data (avatar->data, avatar->len, NULL);
+               priv->pixbuf = empathy_pixbuf_from_data (avatar->data, avatar->len);
        }
 
        if (!priv->pixbuf) {