~valavanisalex/ubuntu/precise/inkscape/fix-943984

« back to all changes in this revision

Viewing changes to inkscape-0.47pre1/src/box3d-context.h

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2009-07-02 17:09:45 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: james.westby@ubuntu.com-20090702170945-nn6d6zswovbwju1t
Tags: 0.47~pre1-0ubuntu1
* New upstream release.
  - Don't constrain maximization on small resolution devices (pre0)
    (LP: #348842)
  - Fixes segfault on startup (pre0)
    (LP: #391149)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __SP_BOX3D_CONTEXT_H__
 
2
#define __SP_BOX3D_CONTEXT_H__
 
3
 
 
4
/*
 
5
 * 3D box drawing context
 
6
 *
 
7
 * Author:
 
8
 *   Lauris Kaplinski <lauris@kaplinski.com>
 
9
 *
 
10
 * Copyright (C) 2000 Lauris Kaplinski
 
11
 * Copyright (C) 2000-2001 Ximian, Inc.
 
12
 * Copyright (C) 2002 Lauris Kaplinski
 
13
 * Copyright (C) 2007 Maximilian Albert <Anhalter42@gmx.de>
 
14
 *
 
15
 * Released under GNU GPL
 
16
 */
 
17
 
 
18
#include <sigc++/sigc++.h>
 
19
#include "event-context.h"
 
20
#include "proj_pt.h"
 
21
#include "vanishing-point.h"
 
22
 
 
23
#define SP_TYPE_BOX3D_CONTEXT            (sp_box3d_context_get_type ())
 
24
#define SP_BOX3D_CONTEXT(obj)            (GTK_CHECK_CAST ((obj), SP_TYPE_BOX3D_CONTEXT, Box3DContext))
 
25
#define SP_BOX3D_CONTEXT_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), SP_TYPE_BOX3D_CONTEXT, Box3DContextClass))
 
26
#define SP_IS_BOX3D_CONTEXT(obj)         (GTK_CHECK_TYPE ((obj), SP_TYPE_BOX3D_CONTEXT))
 
27
#define SP_IS_BOX3D_CONTEXT_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), SP_TYPE_BOX3D_CONTEXT))
 
28
 
 
29
class Box3DContext;
 
30
class Box3DContextClass;
 
31
 
 
32
struct Box3DContext : public SPEventContext {
 
33
    SPItem *item;
 
34
    Geom::Point center;
 
35
 
 
36
    /**
 
37
     * save three corners while dragging:
 
38
     * 1) the starting point (already done by the event_context)
 
39
     * 2) drag_ptB --> the opposite corner of the front face (before pressing shift)
 
40
     * 3) drag_ptC --> the "extruded corner" (which coincides with the mouse pointer location
 
41
     *    if we are ctrl-dragging but is constrained to the perspective line from drag_ptC
 
42
     *    to the vanishing point Y otherwise)
 
43
     */
 
44
    Geom::Point drag_origin;
 
45
    Geom::Point drag_ptB;
 
46
    Geom::Point drag_ptC;
 
47
 
 
48
    Proj::Pt3 drag_origin_proj;
 
49
    Proj::Pt3 drag_ptB_proj;
 
50
    Proj::Pt3 drag_ptC_proj;
 
51
 
 
52
    bool ctrl_dragged; /* whether we are ctrl-dragging */
 
53
    bool extruded; /* whether shift-dragging already occured (i.e. the box is already extruded) */
 
54
 
 
55
    Box3D::VPDrag * _vpdrag;
 
56
 
 
57
    sigc::connection sel_changed_connection;
 
58
 
 
59
    Inkscape::MessageContext *_message_context;
 
60
};
 
61
 
 
62
struct Box3DContextClass {
 
63
    SPEventContextClass parent_class;
 
64
};
 
65
 
 
66
/* Standard Gtk function */
 
67
 
 
68
GtkType sp_box3d_context_get_type (void);
 
69
 
 
70
void sp_box3d_context_update_lines(SPEventContext *ec);
 
71
 
 
72
#endif /* __SP_BOX3D_CONTEXT_H__ */
 
73
 
 
74
/*
 
75
  Local Variables:
 
76
  mode:c++
 
77
  c-file-style:"stroustrup"
 
78
  c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
 
79
  indent-tabs-mode:nil
 
80
  fill-column:99
 
81
  End:
 
82
*/
 
83
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :