~ubuntu-branches/ubuntu/feisty/gnumeric/feisty-201105201650

« back to all changes in this revision

Viewing changes to src/sheet-object.h

  • Committer: Bazaar Package Importer
  • Author(s): Gauvain Pocentek
  • Date: 2006-11-14 14:02:03 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20061114140203-iv3j2aii3vch6isl
Tags: 1.7.2-1ubuntu1
* Merge with debian experimental:
  - debian/control, debian/*-gtk-*, debian/rules,
    debian/shlibs.local: Xubuntu changes for
    gtk/gnome multibuild.
  - run intltool-update in po*
  - Build Depend on intltool

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
 
1
/* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2
2
#ifndef GNUMERIC_SHEET_OBJECT_H
3
3
#define GNUMERIC_SHEET_OBJECT_H
4
4
 
7
7
#include <libgnomeprint/gnome-print.h>
8
8
#include <gsf/gsf-output.h>
9
9
 
 
10
/***********************************************************
 
11
 * Move to goffice during 1.7 */
 
12
 
 
13
typedef enum {
 
14
        GOD_ANCHOR_DIR_UNKNOWN    = 0xFF,
 
15
        GOD_ANCHOR_DIR_UP_LEFT    = 0x00,
 
16
        GOD_ANCHOR_DIR_UP_RIGHT   = 0x01,
 
17
        GOD_ANCHOR_DIR_DOWN_LEFT  = 0x10,
 
18
        GOD_ANCHOR_DIR_DOWN_RIGHT = 0x11,
 
19
 
 
20
        GOD_ANCHOR_DIR_NONE_MASK  = 0x00,
 
21
        GOD_ANCHOR_DIR_H_MASK     = 0x01,
 
22
        GOD_ANCHOR_DIR_RIGHT      = 0x01,
 
23
        GOD_ANCHOR_DIR_V_MASK     = 0x10,
 
24
        GOD_ANCHOR_DIR_DOWN       = 0x10
 
25
} GODrawingAnchorDir;
 
26
typedef struct _GODrawingAnchor {
 
27
        int                     pos_pts [4];    /* position in points */
 
28
        GODrawingAnchorDir      direction;
 
29
} GODrawingAnchor;
 
30
/***********************************************************/
 
31
 
10
32
typedef enum {
11
33
        SO_ANCHOR_UNKNOWN                       = 0x00,
12
34
        SO_ANCHOR_PERCENTAGE_FROM_COLROW_START  = 0x10,
19
41
        /* only allowed for Anchors 2-3 to support fixed size */
20
42
        SO_ANCHOR_PTS_ABSOLUTE                  = 0x30
21
43
} SheetObjectAnchorType;
22
 
 
23
 
typedef enum {
24
 
        SO_DIR_UNKNOWN    = 0xFF,
25
 
        SO_DIR_UP_LEFT    = 0x00,
26
 
        SO_DIR_UP_RIGHT   = 0x01,
27
 
        SO_DIR_DOWN_LEFT  = 0x10,
28
 
        SO_DIR_DOWN_RIGHT = 0x11,
29
 
 
30
 
        SO_DIR_NONE_MASK  = 0x00,
31
 
        SO_DIR_H_MASK     = 0x01,
32
 
        SO_DIR_RIGHT      = 0x01,
33
 
        SO_DIR_V_MASK     = 0x10,
34
 
        SO_DIR_DOWN       = 0x10
35
 
} SheetObjectDirection;
36
 
 
37
44
struct _SheetObjectAnchor {
38
 
        GnmRange        cell_bound; /* cellpos containg corners */
39
 
        float   offset [4];
40
 
        SheetObjectAnchorType type [4];
41
 
        SheetObjectDirection direction;
 
45
        GODrawingAnchor base;
 
46
 
 
47
        GnmRange                cell_bound; /* cellpos containg corners */
 
48
        float                   offset [4];
 
49
        SheetObjectAnchorType   type [4];
42
50
};
43
51
 
44
52
#define SHEET_OBJECT_TYPE     (sheet_object_get_type ())
68
76
                                          GnomePrintContext *ctx,
69
77
                                          double width, double height);
70
78
void         sheet_object_get_editor     (SheetObject *so, SheetControl *sc);
 
79
void         sheet_object_populate_menu  (SheetObject *so, GPtrArray *actions);
 
80
 
71
81
void         sheet_object_update_bounds  (SheetObject *so, GnmCellPos const *p);
72
82
void         sheet_object_default_size   (SheetObject *so, double *w, double *h);
73
83
gint         sheet_object_adjust_stacking(SheetObject *so, gint positions);
83
93
SheetObjectAnchor const *sheet_object_get_anchor (SheetObject const *so);
84
94
void sheet_object_position_pts_get (SheetObject const *so, double *coords);
85
95
 
 
96
void sheet_object_invalidate_sheet       (SheetObject *so,
 
97
                                          Sheet const *sheet);
 
98
 
86
99
/* Object Management */
87
100
void    sheet_objects_relocate   (GnmExprRelocateInfo const *rinfo, gboolean update,
88
101
                                  GnmRelocUndo *undo);
100
113
                                 GnmRange const *cell_bound,
101
114
                                 float const    offset [4],
102
115
                                 SheetObjectAnchorType const type [4],
103
 
                                 SheetObjectDirection direction);
 
116
                                 GODrawingAnchorDir direction);
104
117
void sheet_object_anchor_cpy    (SheetObjectAnchor *dst,
105
118
                                 SheetObjectAnchor const *src);
106
119
 
107
120
/* Image rendering */
108
121
GtkTargetList *sheet_object_get_target_list (SheetObject const *so);
109
122
void sheet_object_write_image   (SheetObject const *so, 
110
 
                                 const char *format,
 
123
                                 char const *format,
111
124
                                 double resolution,
112
125
                                 GsfOutput *output, 
113
126
                                 GError **err);
115
128
/* Object export */
116
129
GtkTargetList *sheet_object_exportable_get_target_list (SheetObject const *so);
117
130
void sheet_object_write_object  (SheetObject const *so, 
118
 
                                 const char *format,
 
131
                                 char const *format,
119
132
                                 GsfOutput *output, GError **err);
120
133
 
 
134
/* cairo rendering */
 
135
void sheet_object_draw_cairo (SheetObject const *so, gpointer *data);
 
136
 
121
137
/* management routine to register all the builtin object types */
122
138
void sheet_objects_init (void);
123
 
 
124
139
#endif /* GNUMERIC_SHEET_OBJECT_H */