root_view.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2015 The ClanLib Team
4 **
5 ** This software is provided 'as-is', without any express or implied
6 ** warranty. In no event will the authors be held liable for any damages
7 ** arising from the use of this software.
8 **
9 ** Permission is granted to anyone to use this software for any purpose,
10 ** including commercial applications, and to alter it and redistribute it
11 ** freely, subject to the following restrictions:
12 **
13 ** 1. The origin of this software must not be misrepresented; you must not
14 ** claim that you wrote the original software. If you use this software
15 ** in a product, an acknowledgment in the product documentation would be
16 ** appreciated but is not required.
17 ** 2. Altered source versions must be plainly marked as such, and must not be
18 ** misrepresented as being the original software.
19 ** 3. This notice may not be removed or altered from any source distribution.
20 **
21 ** Note: Some of the libraries ClanLib may link to may have additional
22 ** requirements or restrictions.
23 **
24 ** File Author(s):
25 **
26 ** Magnus Norddahl
27 */
28 
29 #pragma once
30 
31 #include "view.h"
32 #include "../Events/activation_change_event.h"
33 
34 namespace clan
35 {
37  class RootView : public View
38  {
39  public:
40 
41  protected:
43  void layout(Canvas &canvas);
44 
46  void render(Canvas &canvas);
47 
50 
52  virtual bool root_hidden() const = 0;
53 
55  virtual void set_root_hidden(bool value) = 0;
56 
60  virtual Canvas get_root_canvas() const = 0;
61 
63  virtual void set_root_needs_render() = 0;
64 
66  virtual void layout_local() = 0;
67 
69  virtual Pointf root_to_screen_pos(const Pointf &pos) = 0;
70 
72  virtual Pointf root_from_screen_pos(const Pointf &pos) = 0;
73 
74  private:
75  friend class View;
76  friend class ViewImpl;
77  friend class PositionedLayout;
78  };
79 }
virtual void set_root_needs_render()=0
Signals this view needs to be rendered again.
2D (x,y) point structure - Float
Definition: point.h:73
friend class ViewImpl
Definition: root_view.h:76
2D Graphics Canvas
Definition: canvas.h:73
Base class for views participating as a root view in the user interface.
Definition: root_view.h:38
virtual Pointf root_to_screen_pos(const Pointf &pos)=0
Map from local content to screen coordinates.
void dispatch_activation_change(ActivationChangeType type)
Dispatch activation change event to all views.
View for an area of the user interface.
Definition: view.h:62
virtual Pointf root_from_screen_pos(const Pointf &pos)=0
Map from screen to local content coordinates.
void layout(Canvas &canvas)
Layout root view.
void render(Canvas &canvas)
Renders view into the specified canvas.
virtual void layout_local()=0
Layout local root.
virtual bool root_hidden() const =0
Test if view is set to hidden.
Definition: clanapp.h:36
ActivationChangeType
Window activation change.
Definition: activation_change_event.h:37
virtual void set_root_hidden(bool value)=0
Hides a view from layout and rendering.
virtual Canvas get_root_canvas() const =0
friend class PositionedLayout
Definition: root_view.h:77