The Gnome Chemistry Utils
0.14.12
Main Page
Namespaces
Classes
Files
File List
File Members
libs
gcp
text-object.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
3
/*
4
* GChemPaint libray
5
* text-object.h
6
*
7
* Copyright (C) 2002-2009 Jean Bréfort <jean.brefort@normalesup.org>
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License as
11
* published by the Free Software Foundation; either version 3 of the
12
* License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
22
* USA
23
*/
24
25
#ifndef GCHEMPAINT_TEXT_OBJECT_H
26
#define GCHEMPAINT_TEXT_OBJECT_H
27
28
#include <
gcu/object.h
>
29
#include <
gcu/macros.h
>
30
#include <
gccv/structs.h
>
31
#include <
gccv/text-client.h
>
32
#include <
gccv/text-tag.h
>
33
#include <pango/pango-layout.h>
34
#include <string>
35
36
namespace
gccv
{
37
class
Text;
38
}
39
41
namespace
gcp
{
42
43
class
TextEditor;
44
50
class
TextObject
:
public
gcu::Object
,
public
gccv::TextClient
51
{
52
public
:
58
TextObject
(
gcu::TypeId
Type);
66
TextObject
(
double
x,
double
y,
gcu::TypeId
Type);
70
virtual
~
TextObject
();
71
78
void
GetSize
(
double
& x,
double
& y) {x = m_length; y = m_height;}
83
xmlNodePtr SaveSelected ();
89
void
LoadSelected (xmlNodePtr node);
96
virtual
bool
OnChanged (
bool
save) = 0;
103
bool
SaveNode (xmlDocPtr xml, xmlNodePtr node)
const
;
109
bool
Load (xmlNodePtr node);
117
void
Move (
double
x,
double
y,
double
z = 0);
124
bool
IsLocked
() {
return
m_bLoading;}
131
void
GetSelectionBounds
(
unsigned
&start,
unsigned
&end) {start = m_StartSel; end = m_EndSel;}
135
std::string
GetBuffer
() {
return
m_buf;}
142
virtual
std::string GetProperty (
unsigned
property)
const
;
143
144
// virtual methods for the gccv:TextClient interface
147
void
SelectionChanged (
unsigned
start,
unsigned
end);
150
void
TextChanged (
unsigned
pos);
151
152
protected
:
156
double
m_x
;
160
double
m_y
;
164
double
m_length
;
168
double
m_height
;
172
int
m_ascent
;
176
int
m_InsertOffset
;
180
std::string
m_buf
;
184
bool
m_bLoading
;
188
unsigned
m_StartSel
;
192
unsigned
m_EndSel
;
197
bool
m_RealSave
;
198
199
//GCU_PROT_PROP (GtkAnchorType, Anchor)
206
GCU_PROT_PROP
(
gccv::TextTagList
, TagList)
207
208
219
GCU_PROP
(
TextEditor
*, Editor)
220
227
GCU_PROT_PROP
(
gccv
::
Text
*, TextItem)
228
};
229
230
}
// namespace gcp
231
232
#endif //GCHEMPAINT_TEXT_OBJECT_H
gcp::TextObject::m_ascent
int m_ascent
Definition:
text-object.h:172
gcp::TextObject::GetSelectionBounds
void GetSelectionBounds(unsigned &start, unsigned &end)
Definition:
text-object.h:131
gcp
GChemPaint specific C++ classes.
gcp::TextObject::m_buf
std::string m_buf
Definition:
text-object.h:180
gcp::Text
Definition:
gcp/text.h:41
gccv::TextTagList
TextTag list.
Definition:
text-tag.h:978
gcp::TextObject::m_EndSel
unsigned m_EndSel
Definition:
text-object.h:192
gcp::TextObject::m_InsertOffset
int m_InsertOffset
Definition:
text-object.h:176
gcu::TypeId
unsigned TypeId
Definition:
object.h:95
structs.h
gcp::TextObject::m_RealSave
bool m_RealSave
Definition:
text-object.h:197
text-tag.h
macros.h
gcp::TextObject::m_bLoading
bool m_bLoading
Definition:
text-object.h:184
gcu::Object
Definition:
object.h:158
gcp::TextObject::m_y
double m_y
Definition:
text-object.h:160
text-client.h
gccv
Gnome Chemistry Canvas library namespace.
Definition:
gcp/application.h:36
GCU_PROT_PROP
#define GCU_PROT_PROP(type, member)
Definition:
macros.h:174
gcp::TextObject::m_x
double m_x
Definition:
text-object.h:156
gcp::TextObject::IsLocked
bool IsLocked()
Definition:
text-object.h:124
gcp::TextEditor
Text editor.
Definition:
text-editor.h:37
object.h
gcp::TextObject::m_height
double m_height
Definition:
text-object.h:168
gcp::TextObject::m_length
double m_length
Definition:
text-object.h:164
gcp::TextObject
Definition:
text-object.h:50
gcp::TextObject::GetBuffer
std::string GetBuffer()
Definition:
text-object.h:135
GCU_PROP
#define GCU_PROP(type, member)
Definition:
macros.h:50
gccv::TextClient
ItemClient for text items.
Definition:
text-client.h:40
gcp::TextObject::GetSize
void GetSize(double &x, double &y)
Definition:
text-object.h:78
gcp::TextObject::m_StartSel
unsigned m_StartSel
Definition:
text-object.h:188
Generated by
1.8.11