OWLNext
7.0
Borland's Object Windows Library for the modern age
Toggle main menu visibility
Loading...
Searching...
No Matches
geometrp.cpp
Go to the documentation of this file.
1
//----------------------------------------------------------------------------
2
// Borland WinSys Library
3
// Copyright (c) 1993, 1996 by Borland International, All Rights Reserved
4
//
5
/// \file
6
/// Implementation of persistent streaming for window system structure and type
7
/// encapsulation
8
//----------------------------------------------------------------------------
9
#include <
owl/pch.h
>
10
#include <
owl/defs.h
>
11
#include <
owl/geometry.h
>
12
13
namespace
owl
{
14
15
//----------------------------------------------------------------------------
16
// TRect streaming
17
//
18
19
//
20
/// Extracts a TRect object from is, the given input stream, and copies it to r.
21
/// Returns a reference to the resulting stream, allowing the usual chaining of >>
22
/// operations.
23
//
24
_OWLCFUNC
(
ipstream
&)
25
operator >>(
ipstream
& is,
TRect
& r)
26
{
27
return
is >> r.left >> r.top >> r.right >> r.bottom;
28
}
29
30
//
31
/// Inserts the given TRect object, r, into the opstream, os. Returns a reference to
32
/// the resulting stream, allowing the usual chaining of << operations.
33
//
34
_OWLCFUNC
(
opstream
&)
35
operator <<
(
opstream
& os,
const
TRect
& r)
36
{
37
return
os << r.left << r.top << r.right << r.bottom;
38
}
39
40
//----------------------------------------------------------------------------
41
// TPointL streaming
42
//
43
44
//
45
// Extract the point from the input persistent stream.
46
//
47
_OWLCFUNC
(ipstream&)
48
operator >>(
ipstream
& is,
TPointL
& p)
49
{
50
long
x;
51
is >> x;
52
p.x = x;
53
54
long
y;
55
is >> y;
56
p.y = y;
57
58
return
is;
59
}
60
61
//
62
// Insert the point into an output persistent stream.
63
//
64
_OWLCFUNC
(
opstream
&)
65
operator <<
(
opstream
& os,
const
TPointL
& p)
66
{
67
return
os << p.x << p.y;
68
}
69
70
//----------------------------------------------------------------------------
71
// TPointF streaming
72
//
73
74
//
75
// Extract a point from the persistent input stream.
76
//
77
_OWLCFUNC
(ipstream&)
78
operator >>(
ipstream
& is,
TPointF
& p)
79
{
80
return
is >> p.x >> p.y;
81
}
82
83
//
84
// Insert a point into the output persistent stream.
85
//
86
_OWLCFUNC
(
opstream
&)
87
operator <<
(
opstream
& os,
const
TPointF
& p)
88
{
89
return
os << p.
x
<< p.
y
;
90
}
91
92
//----------------------------------------------------------------------------
93
// TPoint streaming
94
//
95
96
//
97
/// Extracts a TPoint object from persistent stream is, and copies it to p. Returns
98
/// a reference to the resulting stream, allowing the usual chaining of >>
99
/// operations.
100
//
101
_OWLCFUNC
(ipstream&)
102
operator >>(
ipstream
& is,
TPoint
& p)
103
{
104
return
is >> p.x >> p.y;
105
}
106
107
//
108
/// Inserts the given TPoint object p into persistent stream os. Returns a reference
109
/// to the resulting stream, allowing the usual chaining of << operations.
110
//
111
_OWLCFUNC
(
opstream
&)
112
operator <<
(
opstream
& os,
const
TPoint
& p)
113
{
114
return
os << p.x << p.y;
115
}
116
117
//----------------------------------------------------------------------------
118
// TSize streaming
119
//
120
121
//
122
/// Extracts a TSize object from is, the given input stream, and copies it to s.
123
/// Returns a reference to the resulting stream, allowing the usual chaining of >>
124
/// operations.
125
//
126
_OWLCFUNC
(ipstream&)
127
operator >>(
ipstream
& is,
TSize
& s)
128
{
129
return
is >> s.cx >> s.cy;
130
}
131
132
//
133
/// Inserts the given TSize object s into the opstream os. Returns a reference to
134
/// the resulting stream, allowing the usual chaining of << operations.
135
//
136
_OWLCFUNC
(
opstream
&)
137
operator <<
(
opstream
& os,
const
TSize
& s)
138
{
139
return
os << s.cx << s.cy;
140
}
141
142
143
}
// OWL namespace
144
owl::TPointF
TPointF is similar to TPoint, but uses floating variables rather than integers.
Definition
geometry.h:181
owl::TPoint
TPoint is a support class, derived from tagPOINT.
Definition
geometry.h:87
owl::TPointL
TPointL is similar to TPoint, but uses long rather than int variables.
Definition
geometry.h:132
owl::TRect
TRect is a mathematical class derived from tagRect.
Definition
geometry.h:308
owl::TSize
The tagSIZE struct is defined as.
Definition
geometry.h:234
owl::ipstream
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Definition
objstrm.h:391
owl::opstream
Base class for writing streamable objects.
Definition
objstrm.h:480
geometry.h
Classes for window system geometry.
pch.h
owl
Object Windows Library (OWLNext Core).
Definition
animctrl.h:22
owl::operator<<
owl::opstream & operator<<(owl::opstream &os, const TColor &c)
Insert the color value into a persistent output stream.
Definition
color.h:498
defs.h
General definitions used by all ObjectWindows programs.
_OWLCFUNC
#define _OWLCFUNC(p)
Definition
defs.h:342
owl::tPOINTF::y
float y
Definition
geometry.h:173
owl::tPOINTF::x
float x
Definition
geometry.h:172
source
owlcore
geometrp.cpp
Generated by
1.18.0