~ubuntu-branches/debian/sid/goocanvas/sid

« back to all changes in this revision

Viewing changes to src/goocanvasmodel.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2006-08-28 11:47:12 UTC
  • Revision ID: james.westby@ubuntu.com-20060828114712-ejoo9vy6ckao9cvs
Tags: upstream-0.4
ImportĀ upstreamĀ versionĀ 0.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * GooCanvas. Copyright (C) 2005 Damon Chaplin.
 
3
 * Released under the GNU LGPL license. See COPYING for details.
 
4
 *
 
5
 * goocanvasmodel.c - interface for canvas model.
 
6
 */
 
7
 
 
8
/**
 
9
 * SECTION:goocanvasmodel
 
10
 * @Title: GooCanvasModel
 
11
 * @Short_Description: the canvas model interface.
 
12
 *
 
13
 * GooCanvasModel defines the interface that canvas models must implement.
 
14
 *
 
15
 * Currently it consists of a single method which returns the root canvas
 
16
 * item.
 
17
 */
 
18
#include <config.h>
 
19
#include <gtk/gtk.h>
 
20
#include "goocanvasmodel.h"
 
21
 
 
22
 
 
23
static void goo_canvas_model_base_init (gpointer g_class);
 
24
 
 
25
 
 
26
GType
 
27
goo_canvas_model_get_type (void)
 
28
{
 
29
  static GType canvas_model_type = 0;
 
30
 
 
31
  if (!canvas_model_type)
 
32
    {
 
33
      static const GTypeInfo canvas_model_info =
 
34
      {
 
35
        sizeof (GooCanvasModelIface), /* class_size */
 
36
        goo_canvas_model_base_init,   /* base_init */
 
37
        NULL,                         /* base_finalize */
 
38
      };
 
39
 
 
40
      canvas_model_type = g_type_register_static (G_TYPE_INTERFACE,
 
41
                                                  "GooCanvasModel",
 
42
                                                  &canvas_model_info, 0);
 
43
 
 
44
      g_type_interface_add_prerequisite (canvas_model_type, G_TYPE_OBJECT);
 
45
    }
 
46
 
 
47
  return canvas_model_type;
 
48
}
 
49
 
 
50
 
 
51
static void
 
52
goo_canvas_model_base_init (gpointer g_class)
 
53
{
 
54
 
 
55
}
 
56
 
 
57
 
 
58
/**
 
59
 * goo_canvas_model_get_root_item:
 
60
 * @model: a #GooCanvasModel.
 
61
 * 
 
62
 * Returns the root canvas item of the model.
 
63
 * 
 
64
 * Returns: the root canvas item.
 
65
 **/
 
66
GooCanvasItem*
 
67
goo_canvas_model_get_root_item       (GooCanvasModel *model)
 
68
{
 
69
  return GOO_CANVAS_MODEL_GET_IFACE (model)->get_root_item (model);
 
70
}