]> git.0d.be Git - empathy.git/blobdiff - libempathy-gtk/empathy-avatar-image.c
Merge branch 'master' into tp-tube
[empathy.git] / libempathy-gtk / empathy-avatar-image.c
index cc4ecbf458e8a64136f083a16bc26be8f10f70f3..e5513231bf82c83cc97b29717d7f344812ab349d 100644 (file)
@@ -1,7 +1,7 @@
 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 /*
  * Copyright (C) 2006-2007 Imendio AB
- * Copyright (C) 2007 Collabora Ltd.
+ * Copyright (C) 2007-2008 Collabora Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
 
 #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 <gdk/gdkx.h>
 
-#include <libempathy/empathy-debug.h>
-
+#include <libempathy/empathy-utils.h>
 #include "empathy-avatar-image.h"
 #include "empathy-ui-utils.h"
 
-#define DEBUG_DOMAIN "AvatarImage"
+/**
+ * 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.
+ */
 
-#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_AVATAR_IMAGE, EmpathyAvatarImagePriv))
+/**
+ * EmpathyAvatarImage:
+ * @parent: parent object
+ *
+ * Widget which displays an avatar.
+ */
 
-#define MAX_SMALL  48
+#define MAX_SMALL 64
 #define MAX_LARGE 400
 
+#define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyAvatarImage)
 typedef struct {
        GtkWidget   *image;
        GtkWidget   *popup;
@@ -77,10 +89,10 @@ empathy_avatar_image_class_init (EmpathyAvatarImageClass *klass)
 static void
 empathy_avatar_image_init (EmpathyAvatarImage *avatar_image)
 {
-       EmpathyAvatarImagePriv *priv;
-
-       priv = GET_PRIV (avatar_image);
+       EmpathyAvatarImagePriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (avatar_image,
+               EMPATHY_TYPE_AVATAR_IMAGE, EmpathyAvatarImagePriv);
 
+       avatar_image->priv = priv;
        priv->image = gtk_image_new ();
        gtk_container_add (GTK_CONTAINER (avatar_image), priv->image);
        empathy_avatar_image_set (avatar_image, NULL);
@@ -255,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)
 {
@@ -265,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)