LCOV - code coverage report
Current view: top level - eq - systemWindow.cpp (source / functions) Hit Total Coverage
Test: Equalizer Lines: 22 43 51.2 %
Date: 2017-12-16 05:07:20 Functions: 11 19 57.9 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2005-2017, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                          Daniel Nachbaur <danielnachbaur@gmail.com>
       4             :  *                          Maxim Makhinya
       5             :  *
       6             :  * This library is free software; you can redistribute it and/or modify it under
       7             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       8             :  * by the Free Software Foundation.
       9             :  *
      10             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      11             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      12             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      13             :  * details.
      14             :  *
      15             :  * You should have received a copy of the GNU Lesser General Public License
      16             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      17             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      18             :  */
      19             : 
      20             : #include "systemWindow.h"
      21             : 
      22             : #include "notifierInterface.h"
      23             : #include <co/objectOCommand.h>
      24             : #include <eq/fabric/sizeEvent.h>
      25             : 
      26             : namespace eq
      27             : {
      28           3 : SystemWindow::SystemWindow(NotifierInterface& parent,
      29           3 :                            const WindowSettings& settings)
      30             :     : _parent(parent)
      31           3 :     , _settings(settings)
      32             : {
      33           3 : }
      34             : 
      35           3 : SystemWindow::~SystemWindow()
      36             : {
      37           3 : }
      38             : 
      39           1 : void SystemWindow::setPixelViewport(const PixelViewport& pvp)
      40             : {
      41           1 :     _settings.setPixelViewport(pvp);
      42           1 : }
      43             : 
      44           6 : const PixelViewport& SystemWindow::getPixelViewport() const
      45             : {
      46           6 :     return _settings.getPixelViewport();
      47             : }
      48             : 
      49           1 : uint32_t SystemWindow::getColorFormat() const
      50             : {
      51           1 :     return _settings.getColorFormat();
      52             : }
      53             : 
      54           0 : void SystemWindow::setName(const std::string& name)
      55             : {
      56           0 :     _settings.setName(name);
      57           0 : }
      58             : 
      59           3 : const std::string& SystemWindow::getName() const
      60             : {
      61           3 :     return _settings.getName();
      62             : }
      63             : 
      64          75 : int32_t SystemWindow::getIAttribute(const WindowSettings::IAttribute attr) const
      65             : {
      66          75 :     return _settings.getIAttribute(attr);
      67             : }
      68             : 
      69           3 : const SystemWindow* SystemWindow::getSharedContextWindow() const
      70             : {
      71           3 :     return _settings.getSharedContextWindow();
      72             : }
      73             : 
      74           0 : EventOCommand SystemWindow::sendError(const uint32_t error)
      75             : {
      76           0 :     return _parent.sendError(error);
      77             : }
      78             : 
      79           1 : bool SystemWindow::processEvent(const EventType type)
      80             : {
      81           1 :     return _parent.processEvent(type);
      82             : }
      83             : 
      84           0 : bool SystemWindow::processEvent(const EventType type, SizeEvent& event)
      85             : {
      86           0 :     switch (type)
      87             :     {
      88             :     case EVENT_WINDOW_HIDE:
      89           0 :         setPixelViewport(PixelViewport(0, 0, 0, 0));
      90           0 :         break;
      91             : 
      92             :     case EVENT_WINDOW_EXPOSE:
      93             :     case EVENT_WINDOW_SHOW:
      94             :     case EVENT_WINDOW_RESIZE:
      95           0 :         setPixelViewport(PixelViewport(event.x, event.y, event.w, event.h));
      96           0 :         break;
      97             : 
      98             :     default:
      99           0 :         break;
     100             :     }
     101             : 
     102           0 :     return _parent.processEvent(type, event);
     103             : }
     104             : 
     105           0 : bool SystemWindow::processEvent(const EventType type, PointerEvent& event)
     106             : {
     107           0 :     return _parent.processEvent(type, event);
     108             : }
     109             : 
     110           0 : bool SystemWindow::processEvent(const EventType type, KeyEvent& event)
     111             : {
     112           0 :     return _parent.processEvent(type, event);
     113             : }
     114             : 
     115           0 : bool SystemWindow::processEvent(AxisEvent& event)
     116             : {
     117           0 :     return _parent.processEvent(event);
     118             : }
     119             : 
     120           0 : bool SystemWindow::processEvent(ButtonEvent& event)
     121             : {
     122           0 :     return _parent.processEvent(event);
     123             : }
     124          30 : }

Generated by: LCOV version 1.11