[gdl] Document GdlDockItemButtonImage
- From: Sebastien Granjoux <sgranjoux src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdl] Document GdlDockItemButtonImage
- Date: Sat, 19 May 2012 16:52:58 +0000 (UTC)
commit 58d50d4f90a5bf3706b3849cb7b4318c7a8a4535
Author: SÃbastien Granjoux <seb sfo free fr>
Date: Sat May 19 18:42:21 2012 +0200
Document GdlDockItemButtonImage
docs/reference/gdl-docs.sgml | 1 +
gdl/gdl-dock-item-button-image.c | 51 +++++++++++++++++++++++--------------
gdl/gdl-dock-item-button-image.h | 17 +++++++++---
gdl/gdl-dock-item-grip.c | 1 +
4 files changed, 47 insertions(+), 23 deletions(-)
---
diff --git a/docs/reference/gdl-docs.sgml b/docs/reference/gdl-docs.sgml
index ffede36..64357c0 100644
--- a/docs/reference/gdl-docs.sgml
+++ b/docs/reference/gdl-docs.sgml
@@ -16,6 +16,7 @@
<xi:include href="xml/gdl-dock.xml" />
<xi:include href="xml/gdl-dock-item.xml" />
<xi:include href="xml/gdl-dock-item-grip.xml" />
+ <xi:include href="xml/gdl-dock-item-button-image.xml" />
<xi:include href="xml/gdl-dock-bar.xml" />
<xi:include href="xml/gdl-dock-placeholder.xml" />
<xi:include href="xml/gdl-dock-layout.xml" />
diff --git a/gdl/gdl-dock-item-button-image.c b/gdl/gdl-dock-item-button-image.c
index e242e28..9553456 100644
--- a/gdl/gdl-dock-item-button-image.c
+++ b/gdl/gdl-dock-item-button-image.c
@@ -1,9 +1,9 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* gdl-dock-item-button-image.c
*
* Author: Joel Holdsworth <joel airwebreathe org uk>
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
@@ -19,17 +19,30 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+
#include "gdl-dock-item-button-image.h"
#include <math.h>
+/**
+ * SECTION:gdl-dock-item-button-image
+ * @title: GdlDockItemButtonImage
+ * @short_description: A widget displaying an image used in dock grip
+ * @stability: Internal
+ * @see_also: GtlDockItemGrip
+ *
+ * The #GdlDockItemButtonImage displays a small image which could be a cross
+ * (close) or a triangle (iconify). These images are used for buttons in the
+ * #GdlDockItemGrip object.
+ */
+
+
#define ICON_SIZE 12
G_DEFINE_TYPE (GdlDockItemButtonImage,
gdl_dock_item_button_image,
GTK_TYPE_WIDGET);
-
+
static gboolean
gdl_dock_item_button_image_draw (GtkWidget *widget,
cairo_t *cr)
@@ -37,13 +50,13 @@ gdl_dock_item_button_image_draw (GtkWidget *widget,
GdlDockItemButtonImage *button_image;
GtkStyleContext *context;
GdkRGBA color;
-
+
g_return_val_if_fail (widget != NULL, 0);
button_image = GDL_DOCK_ITEM_BUTTON_IMAGE (widget);
-
+
/* Set up the pen */
cairo_set_line_width(cr, 1.0);
-
+
context = gtk_widget_get_style_context (widget);
gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &color);
color.alpha = 0.55;
@@ -59,9 +72,9 @@ gdl_dock_item_button_image_draw (GtkWidget *widget,
cairo_line_to (cr, 2.5, 4.5);
cairo_arc (cr, 4.5, 4.5, 2, M_PI, 1.5 * M_PI);
cairo_close_path (cr);
-
+
cairo_stroke (cr);
-
+
/* Draw the icon */
cairo_new_path (cr);
@@ -82,7 +95,7 @@ gdl_dock_item_button_image_draw (GtkWidget *widget,
cairo_line_to (cr, 5.5, 4.0);
cairo_close_path (cr);
break;
-
+
case GDL_DOCK_ITEM_BUTTON_IMAGE_ICONIFY:
if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_RTL) {
cairo_move_to (cr, 4.5, 7.5);
@@ -96,13 +109,13 @@ gdl_dock_item_button_image_draw (GtkWidget *widget,
cairo_close_path (cr);
}
break;
-
+
default:
break;
}
-
+
cairo_fill (cr);
-
+
return FALSE;
}
@@ -135,7 +148,7 @@ gdl_dock_item_button_image_class_init (
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
-
+
widget_class->draw =
gdl_dock_item_button_image_draw;
widget_class->get_preferred_width =
@@ -148,12 +161,12 @@ gdl_dock_item_button_image_class_init (
/**
* gdl_dock_item_button_image_new:
- * @image_type: Specifies what type of image the widget should
- * display
- *
+ * @image_type: Specifies what type of image the widget should display
+ *
* Creates a new GDL dock button image object.
- * Returns: The newly created dock item button image widget.
- **/
+ *
+ * Returns: The newly created dock item button image widget
+ */
GtkWidget*
gdl_dock_item_button_image_new (GdlDockItemButtonImageType image_type)
{
diff --git a/gdl/gdl-dock-item-button-image.h b/gdl/gdl-dock-item-button-image.h
index ce0c6fa..a17d6bd 100644
--- a/gdl/gdl-dock-item-button-image.h
+++ b/gdl/gdl-dock-item-button-image.h
@@ -1,9 +1,9 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* gdl-dock-item-button-image.h
*
* Author: Joel Holdsworth <joel airwebreathe org uk>
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
@@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+
#ifndef _GDL_DOCK_ITEM_BUTTON_IMAGE_H_
#define _GDL_DOCK_ITEM_BUTTON_IMAGE_H_
@@ -41,6 +41,15 @@ G_BEGIN_DECLS
#define GDL_DOCK_ITEM_BUTTON_IMAGE_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), GDL_TYPE_DOCK_ITEM_BUTTON_IMAGE, GdlDockItemButtonImageClass))
+
+/**
+ * GdlDockItemButtonImageType:
+ * @GDL_DOCK_ITEM_BUTTON_IMAGE_CLOSE: Display a small cross
+ * @GDL_DOCK_ITEM_BUTTON_IMAGE_ICONIFY: Display a small triangle
+ *
+ * Define the image displayed.
+ *
+ */
/* Data Types & Structures */
typedef enum {
GDL_DOCK_ITEM_BUTTON_IMAGE_CLOSE,
@@ -52,7 +61,7 @@ typedef struct _GdlDockItemButtonImageClass GdlDockItemButtonImageClass;
struct _GdlDockItemButtonImage {
GtkWidget parent;
-
+
GdlDockItemButtonImageType image_type;
};
diff --git a/gdl/gdl-dock-item-grip.c b/gdl/gdl-dock-item-grip.c
index 7634458..7c702f9 100644
--- a/gdl/gdl-dock-item-grip.c
+++ b/gdl/gdl-dock-item-grip.c
@@ -44,6 +44,7 @@
* SECTION:gdl-dock-item-grip
* @title: GdlDockItemGrip
* @short_description: A grip for dock widgets.
+ * @see_also: GtlDockItem, GdlDockItemButtonImage
*
* This widget contains an area where the user can click to drag the dock item
* and two buttons. The first button allows to iconify the dock item.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]