merge with master
[platform/framework/native/uifw.git] / inc / FGraphics.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FGraphics.h
20  * @brief       This is the header file for the %Graphics namespace.
21  *
22  * This header file contains the declarations of the %Graphics namespace.
23  *
24  */
25
26 #ifndef _FGRAPHICS_H_
27 #define _FGRAPHICS_H_
28
29 #include "FGrpPoint.h"
30 #include "FGrpFloatPoint.h"
31
32 #include "FGrpDimension.h"
33 #include "FGrpFloatDimension.h"
34
35 #include "FGrpRectangle.h"
36 #include "FGrpFloatRectangle.h"
37
38 #include "FGrpFloatMatrix4.h"
39 #include "FGrpFloatVector4.h"
40 #include "FGrpFloatPoint3.h"
41
42 #include "FGrpColor.h"
43
44 #include "FGrpPixelFormat.h"
45
46 #include "FGrpBufferInfo.h"
47
48 #include "FGrpBitmapCommon.h"
49 #include "FGrpBitmap.h"
50
51 #include "FGrpCanvasCommon.h"
52 #include "FGrpCanvas.h"
53
54 #include "FGrpFontCommon.h"
55 #include "FGrpFont.h"
56
57 #include "FGrpTextElement.h"
58 #include "FGrpEnrichedText.h"
59
60 #include "FGrpCoordinateSystem.h"
61
62 /**
63  * @namespace Tizen::Graphics
64  * @brief       This namespace contains classes for drawing-related functionalities.
65  *
66  * @since       2.0
67  *
68  * @remarks     @b Header @b %file: @b \#include @b <FGraphics.h> @n
69  *                      @b Library : @b osp-uifw
70  *
71  * The %Graphics namespace provides enhanced two-dimensional graphics,
72  * text, and imaging capabilities.
73  * It supports comprehensive features for rendering geometric primitives, text, and images
74  * in a flexible framework for developing rich user
75  * interfaces, sophisticated drawing applications, and image editors.
76  * This namespace provides additional features such as Bitmap, Font, and Color to enhance the rendered graphics.
77  * The user can also use basic data types, Point, Rectangle, and Dimension to construct 2D graphic objects, such as
78  * polygons.
79  * @n
80  * For more information on the %Graphics namespace features, see <a href="../org.tizen.native.appprogramming/html/guide/graphics/graphics_namespace.htm">Graphics Guide</a>.
81  *
82  * The following diagram illustrates the relationships between the classes belonging to the %Graphics namespace.
83  * @image html graphics_namespace_class_relationship.png
84  *
85  * The following example demonstrates how to use the %Graphics namespace.
86  *
87  *      @code
88 #include <FBase.h>
89 #include <FGraphics.h>
90
91 using namespace Tizen::Base;
92 using namespace Tizen::Graphics;
93
94 bool
95 MyClass::GraphicsSample(Canvas& canvas)
96 {
97     result r = E_SUCCESS;
98
99     // Sets the background color of the canvas and then clears it
100     canvas.SetBackgroundColor(Color(0xFF, 0xFF, 0xFF));
101     canvas.Clear();
102
103     // Sets the foreground color of this canvas
104     canvas.SetForegroundColor(Color::GetColor(COLOR_ID_GREEN));
105
106     // Draws shapes
107     canvas.DrawEllipse(Rectangle(50, 50, 50, 80));
108     canvas.DrawLine(Point(100, 100), Point(150, 150));
109     canvas.DrawArc(Rectangle(10, 200, 50, 50), 30, 60, ARC_STYLE_PIE);
110
111     {
112         // Creates an instance of Font
113         Font font;
114         r = font.Construct(FONT_STYLE_PLAIN, 32);
115         if (IsFailed(r))
116         {
117             return false;
118         }
119
120         // Sets the canvas font
121         canvas.SetFont(font);
122     }
123
124     // Draws text at the specified location
125     canvas.DrawText(Point(50, 50), String(L"Hello World"));
126
127     // Shows the drawing as a result on the device screen
128     canvas.Show();
129
130     return true;
131
132 }
133  *      @endcode
134  *
135  *
136  *
137  *
138  */
139 namespace Tizen { namespace Graphics
140 {
141
142 } } // Tizen::Graphics
143
144 #endif // _FGRAPHICS_H_