Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorrachytski <siarhei.rachytski@gmail.com>2012-11-09 17:40:13 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:46:45 +0300
commitbcc94857d7b9f092148dea4a2a9b90c592f43a75 (patch)
tree7bf4c63e9b28fd0b00dfdcffcada9bb2c637b935 /gui
parent771f47410fa67f271cf425a2b1a9a0ed6119b4ea (diff)
renamed yg into graphics.
Diffstat (limited to 'gui')
-rw-r--r--gui/button.cpp20
-rw-r--r--gui/button.hpp8
-rw-r--r--gui/controller.cpp14
-rw-r--r--gui/controller.hpp24
-rw-r--r--gui/element.cpp14
-rw-r--r--gui/element.hpp26
-rw-r--r--gui/gui.pro4
-rw-r--r--gui/text_view.cpp14
-rw-r--r--gui/text_view.hpp6
9 files changed, 65 insertions, 65 deletions
diff --git a/gui/button.cpp b/gui/button.cpp
index 2be19483cf..785e3e2384 100644
--- a/gui/button.cpp
+++ b/gui/button.cpp
@@ -1,5 +1,5 @@
#include "button.hpp"
-#include "../yg/overlay_renderer.hpp"
+#include "../graphics/overlay_renderer.hpp"
namespace gui
{
@@ -9,7 +9,7 @@ namespace gui
tp.m_depth = p.m_depth + 1;
tp.m_pivot = p.m_pivot;
- tp.m_position = yg::EPosCenter;
+ tp.m_position = graphics::EPosCenter;
tp.m_text = p.m_text;
m_textView.reset(new TextView(tp));
@@ -18,11 +18,11 @@ namespace gui
setMinHeight(p.m_minHeight);
setText(p.m_text);
- setFont(EActive, yg::FontDesc(12, yg::Color(0, 0, 0, 255)));
- setFont(EPressed, yg::FontDesc(12, yg::Color(0, 0, 0, 255)));
+ setFont(EActive, graphics::FontDesc(12, graphics::Color(0, 0, 0, 255)));
+ setFont(EPressed, graphics::FontDesc(12, graphics::Color(0, 0, 0, 255)));
- setColor(EActive, yg::Color(yg::Color(192, 192, 192, 255)));
- setColor(EPressed, yg::Color(yg::Color(64, 64, 64, 255)));
+ setColor(EActive, graphics::Color(graphics::Color(192, 192, 192, 255)));
+ setColor(EPressed, graphics::Color(graphics::Color(64, 64, 64, 255)));
}
void Button::setOnClickListener(TOnClickListener const & l)
@@ -128,7 +128,7 @@ namespace gui
return m_boundRects;
}
- void Button::draw(yg::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const
+ void Button::draw(graphics::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const
{
if (!isVisible())
return;
@@ -137,7 +137,7 @@ namespace gui
r->drawRoundedRectangle(roughBoundRect(), 10 * k, color(state()), depth());
- yg::FontDesc desc = font(state());
+ graphics::FontDesc desc = font(state());
desc.m_size *= k;
m_textView->draw(r, m);
@@ -149,13 +149,13 @@ namespace gui
Element::setPivot(pv);
}
- void Button::setFont(EState state, yg::FontDesc const & font)
+ void Button::setFont(EState state, graphics::FontDesc const & font)
{
m_textView->setFont(state, font);
Element::setFont(state, font);
}
- void Button::setColor(EState state, yg::Color const & c)
+ void Button::setColor(EState state, graphics::Color const & c)
{
m_textView->setColor(state, c);
Element::setColor(state, c);
diff --git a/gui/button.hpp b/gui/button.hpp
index 5eedad1ad8..fb5e5d5f68 100644
--- a/gui/button.hpp
+++ b/gui/button.hpp
@@ -7,7 +7,7 @@
#include "../std/string.hpp"
#include "../std/scoped_ptr.hpp"
-namespace yg
+namespace graphics
{
class OverlayElement;
@@ -55,8 +55,8 @@ namespace gui
void setOnClickListener(TOnClickListener const & l);
void setPivot(m2::PointD const & pv);
- void setFont(EState state, yg::FontDesc const & font);
- void setColor(EState state, yg::Color const & c);
+ void setFont(EState state, graphics::FontDesc const & font);
+ void setColor(EState state, graphics::Color const & c);
void setText(string const & text);
string const & text() const;
@@ -73,7 +73,7 @@ namespace gui
/// @{
vector<m2::AnyRectD> const & boundRects() const;
- void draw(yg::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const;
+ void draw(graphics::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const;
/// @}
};
diff --git a/gui/controller.cpp b/gui/controller.cpp
index 65a7267f96..45155aa945 100644
--- a/gui/controller.cpp
+++ b/gui/controller.cpp
@@ -1,9 +1,9 @@
#include "controller.hpp"
#include "element.hpp"
-#include "../map/drawer_yg.hpp"
+#include "../map/drawer.hpp"
-#include "../yg/overlay.hpp"
+#include "../graphics/overlay.hpp"
#include "../std/bind.hpp"
@@ -19,8 +19,8 @@ namespace gui
Controller::RenderParams::RenderParams(double visualScale,
TInvalidateFn invalidateFn,
- yg::GlyphCache * glyphCache,
- yg::gl::Screen * cacheScreen)
+ graphics::GlyphCache * glyphCache,
+ graphics::gl::Screen * cacheScreen)
: m_VisualScale(visualScale),
m_InvalidateFn(invalidateFn),
m_GlyphCache(glyphCache),
@@ -158,7 +158,7 @@ namespace gui
PurgeElements();
}
- void Controller::DrawFrame(yg::gl::Screen * screen)
+ void Controller::DrawFrame(graphics::gl::Screen * screen)
{
screen->beginFrame();
@@ -178,7 +178,7 @@ namespace gui
m_InvalidateFn();
}
- yg::GlyphCache * Controller::GetGlyphCache() const
+ graphics::GlyphCache * Controller::GetGlyphCache() const
{
return m_GlyphCache;
}
@@ -201,7 +201,7 @@ namespace gui
return m_bundle;
}
- yg::gl::Screen * Controller::GetCacheScreen() const
+ graphics::gl::Screen * Controller::GetCacheScreen() const
{
return m_CacheScreen;
}
diff --git a/gui/controller.hpp b/gui/controller.hpp
index f6b7e2c83f..37956b91ab 100644
--- a/gui/controller.hpp
+++ b/gui/controller.hpp
@@ -8,7 +8,7 @@
#include "../base/strings_bundle.hpp"
-namespace yg
+namespace graphics
{
class GlyphCache;
class OverlayElement;
@@ -37,7 +37,7 @@ namespace gui
/// element that has focus.
shared_ptr<Element> m_focusedElement;
- typedef list<shared_ptr<yg::OverlayElement> > base_list_t;
+ typedef list<shared_ptr<graphics::OverlayElement> > base_list_t;
typedef list<shared_ptr<Element> > elem_list_t;
elem_list_t m_Elements;
@@ -52,13 +52,13 @@ namespace gui
double m_VisualScale;
/// GlyphCache for text rendering by GUI elements.
- yg::GlyphCache * m_GlyphCache;
+ graphics::GlyphCache * m_GlyphCache;
/// Localized strings for GUI.
StringsBundle const * m_bundle;
/// Screen, which is used to cache gui::Elements into display lists.
- yg::gl::Screen * m_CacheScreen;
+ graphics::gl::Screen * m_CacheScreen;
/// Should we call the onTapEnded when the tap finished(we should
/// not if the tap was cancelled while moving).
@@ -83,13 +83,13 @@ namespace gui
{
double m_VisualScale;
TInvalidateFn m_InvalidateFn;
- yg::GlyphCache * m_GlyphCache;
- yg::gl::Screen * m_CacheScreen;
+ graphics::GlyphCache * m_GlyphCache;
+ graphics::gl::Screen * m_CacheScreen;
RenderParams();
RenderParams(double visualScale,
TInvalidateFn invalidateFn,
- yg::GlyphCache * glyphCache,
- yg::gl::Screen * cacheScreen);
+ graphics::GlyphCache * glyphCache,
+ graphics::gl::Screen * cacheScreen);
};
/// Attach GUI Controller to the renderer
@@ -109,12 +109,12 @@ namespace gui
/// Get localized strings bundle
StringsBundle const * GetStringsBundle() const;
/// Get GlyphCache
- yg::GlyphCache * GetGlyphCache() const;
- /// Get yg::gl::Screen, which is used to cache gui::Element's
+ graphics::GlyphCache * GetGlyphCache() const;
+ /// Get graphics::gl::Screen, which is used to cache gui::Element's
/// into display lists.
- yg::gl::Screen * GetCacheScreen() const;
+ graphics::gl::Screen * GetCacheScreen() const;
/// Redraw GUI
- void DrawFrame(yg::gl::Screen * screen);
+ void DrawFrame(graphics::gl::Screen * screen);
/// Calling gui::Element::update for every element.
void UpdateElements();
/// Calling gui::Element::purge for every element.
diff --git a/gui/element.cpp b/gui/element.cpp
index acc3d10928..c183e01602 100644
--- a/gui/element.cpp
+++ b/gui/element.cpp
@@ -1,7 +1,7 @@
#include "element.hpp"
#include "controller.hpp"
-#include "../yg/overlay_renderer.hpp"
+#include "../graphics/overlay_renderer.hpp"
#include "../base/logging.hpp"
@@ -24,22 +24,22 @@ namespace gui
return m_state;
}
- void Element::setFont(EState state, yg::FontDesc const & font)
+ void Element::setFont(EState state, graphics::FontDesc const & font)
{
m_fonts[state] = font;
}
- yg::FontDesc const & Element::font(EState state) const
+ graphics::FontDesc const & Element::font(EState state) const
{
return m_fonts[state];
}
- void Element::setColor(EState state, yg::Color const & c)
+ void Element::setColor(EState state, graphics::Color const & c)
{
m_colors[state] = c;
}
- yg::Color const & Element::color(EState state) const
+ graphics::Color const & Element::color(EState state) const
{
return m_colors[state];
}
@@ -81,12 +81,12 @@ namespace gui
}
}
- yg::OverlayElement * Element::clone(math::Matrix<double, 3, 3> const & m) const
+ graphics::OverlayElement * Element::clone(math::Matrix<double, 3, 3> const & m) const
{
return 0;
}
- void Element::draw(yg::gl::OverlayRenderer *r, math::Matrix<double, 3, 3> const & m) const
+ void Element::draw(graphics::gl::OverlayRenderer *r, math::Matrix<double, 3, 3> const & m) const
{
for (unsigned i = 0; i < boundRects().size(); ++i)
r->drawRectangle(boundRects()[i], color(state()), depth());
diff --git a/gui/element.hpp b/gui/element.hpp
index 7a1f55a8b2..88ba5dc624 100644
--- a/gui/element.hpp
+++ b/gui/element.hpp
@@ -2,13 +2,13 @@
#include "../geometry/point2d.hpp"
-#include "../yg/overlay_element.hpp"
-#include "../yg/color.hpp"
-#include "../yg/font_desc.hpp"
+#include "../graphics/overlay_element.hpp"
+#include "../graphics/color.hpp"
+#include "../graphics/font_desc.hpp"
#include "../std/map.hpp"
-namespace yg
+namespace graphics
{
namespace gl
{
@@ -20,7 +20,7 @@ namespace gui
{
class Controller;
- class Element : public yg::OverlayElement
+ class Element : public graphics::OverlayElement
{
public:
@@ -40,8 +40,8 @@ namespace gui
EState m_state;
- mutable map<EState, yg::FontDesc> m_fonts;
- mutable map<EState, yg::Color> m_colors;
+ mutable map<EState, graphics::FontDesc> m_fonts;
+ mutable map<EState, graphics::Color> m_colors;
public:
@@ -52,11 +52,11 @@ namespace gui
void setState(EState state);
EState state() const;
- virtual void setFont(EState state, yg::FontDesc const & font);
- yg::FontDesc const & font(EState state) const;
+ virtual void setFont(EState state, graphics::FontDesc const & font);
+ graphics::FontDesc const & font(EState state) const;
- virtual void setColor(EState state, yg::Color const & c);
- yg::Color const & color(EState state) const;
+ virtual void setColor(EState state, graphics::Color const & c);
+ graphics::Color const & color(EState state) const;
/// Implement this method to handle single tap on the GUI element.
virtual bool onTapStarted(m2::PointD const & pt);
@@ -67,8 +67,8 @@ namespace gui
void invalidate();
double visualScale() const;
- yg::OverlayElement * clone(math::Matrix<double, 3, 3> const & m) const;
- void draw(yg::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const;
+ graphics::OverlayElement * clone(math::Matrix<double, 3, 3> const & m) const;
+ void draw(graphics::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const;
int visualRank() const;
virtual void cache();
diff --git a/gui/gui.pro b/gui/gui.pro
index ad122da3e1..19d0ba2661 100644
--- a/gui/gui.pro
+++ b/gui/gui.pro
@@ -1,11 +1,11 @@
-# GUI library on top of YG
+# GUI library on top of Graphics
TARGET = gui
TEMPLATE = lib
CONFIG += staticlib
ROOT_DIR = ..
-DEPENDENCIES = yg geometry coding base expat
+DEPENDENCIES = graphics geometry coding base expat
include($$ROOT_DIR/common.pri)
diff --git a/gui/text_view.cpp b/gui/text_view.cpp
index 68ec235b3c..68ce7742d8 100644
--- a/gui/text_view.cpp
+++ b/gui/text_view.cpp
@@ -8,11 +8,11 @@ namespace gui
{
setText(p.m_text);
- setFont(EActive, yg::FontDesc(12, yg::Color(0, 0, 0, 255)));
- setFont(EPressed, yg::FontDesc(12, yg::Color(0, 0, 0, 255)));
+ setFont(EActive, graphics::FontDesc(12, graphics::Color(0, 0, 0, 255)));
+ setFont(EPressed, graphics::FontDesc(12, graphics::Color(0, 0, 0, 255)));
- setColor(EActive, yg::Color(yg::Color(192, 192, 192, 255)));
- setColor(EPressed, yg::Color(yg::Color(64, 64, 64, 255)));
+ setColor(EActive, graphics::Color(graphics::Color(192, 192, 192, 255)));
+ setColor(EPressed, graphics::Color(graphics::Color(64, 64, 64, 255)));
}
void TextView::setText(string const & text)
@@ -32,7 +32,7 @@ namespace gui
void TextView::cache()
{
- yg::StraightTextElement::Params params;
+ graphics::StraightTextElement::Params params;
params.m_depth = depth();
params.m_fontDesc = font(state());
params.m_fontDesc.m_size *= visualScale();
@@ -45,10 +45,10 @@ namespace gui
params.m_delimiters = "\n";
params.m_useAllParts = true;
- m_elem.reset(new yg::StraightTextElement(params));
+ m_elem.reset(new graphics::StraightTextElement(params));
}
- void TextView::draw(yg::gl::OverlayRenderer *r, math::Matrix<double, 3, 3> const & m) const
+ void TextView::draw(graphics::gl::OverlayRenderer *r, math::Matrix<double, 3, 3> const & m) const
{
checkDirtyDrawing();
m_elem->draw(r, m);
diff --git a/gui/text_view.hpp b/gui/text_view.hpp
index 459089e7b9..8ec2d6933d 100644
--- a/gui/text_view.hpp
+++ b/gui/text_view.hpp
@@ -4,7 +4,7 @@
#include "../geometry/any_rect2d.hpp"
-#include "../yg/straight_text_element.hpp"
+#include "../graphics/straight_text_element.hpp"
#include "element.hpp"
@@ -15,7 +15,7 @@ namespace gui
{
private:
- shared_ptr<yg::StraightTextElement> m_elem;
+ shared_ptr<graphics::StraightTextElement> m_elem;
string m_text;
@@ -36,7 +36,7 @@ namespace gui
string const & text() const;
vector<m2::AnyRectD> const & boundRects() const;
- void draw(yg::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const;
+ void draw(graphics::gl::OverlayRenderer * r, math::Matrix<double, 3, 3> const & m) const;
bool onTapStarted(m2::PointD const & pt);
bool onTapMoved(m2::PointD const & pt);