diff --git a/qtox.pro b/qtox.pro
index a96874acf..2dcc32948 100644
--- a/qtox.pro
+++ b/qtox.pro
@@ -472,4 +472,5 @@ SOURCES += \
src/widget/about/aboutuser.cpp \
src/widget/form/groupinviteform.cpp \
src/widget/tool/profileimporter.cpp \
- src/widget/passwordedit.cpp
+ src/widget/passwordedit.cpp \
+ src/video/videomode.cpp
diff --git a/src/video/videomode.cpp b/src/video/videomode.cpp
new file mode 100644
index 000000000..fa4f2194e
--- /dev/null
+++ b/src/video/videomode.cpp
@@ -0,0 +1,75 @@
+/*
+ Copyright © 2015-2016 by The qTox Project
+
+ This file is part of qTox, a Qt-based graphical interface for Tox.
+
+ qTox is libre software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ qTox is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with qTox. If not, see .
+*/
+
+#include "videomode.h"
+
+/**
+@struct VideoMode
+@brief Describes a video mode supported by a device.
+
+@var unsigned short VideoMode::width, VideoMode::height
+@brief Displayed video resolution (NOT frame resolution).
+
+@var unsigned short VideoMode::x, VideoMode::y
+@brief Coordinates of upper-left corner.
+
+@var float VideoMode::FPS
+@brief Frames per second supported by the device at this resolution
+*/
+
+VideoMode::VideoMode(int width, int height, int x, int y, int FPS, int format) :
+ width(width), height(height), x(x), y(y),
+ FPS(FPS), pixel_format(format)
+{
+}
+
+VideoMode::VideoMode(QRect rect) :
+ width(rect.width()), height(rect.height()),
+ x(rect.x()), y(rect.y()),
+ FPS(0), pixel_format(0)
+{
+}
+
+QRect VideoMode::toRect() const
+{
+ return QRect(x, y, width, height);
+}
+
+bool VideoMode::operator==(const VideoMode &other) const
+{
+ return width == other.width
+ && height == other.height
+ && x == other.x
+ && y == other.y
+ && FPS == other.FPS
+ && pixel_format == other.pixel_format;
+}
+
+uint32_t VideoMode::norm(const VideoMode &other) const
+{
+ return abs(this->width-other.width) + abs(this->height-other.height);
+}
+
+/**
+@brief All zeros means a default/unspecified mode
+*/
+VideoMode::operator bool() const
+{
+ return width || height || FPS;
+}
diff --git a/src/video/videomode.h b/src/video/videomode.h
index 0fc4fb05d..61a4e1df5 100644
--- a/src/video/videomode.h
+++ b/src/video/videomode.h
@@ -17,60 +17,29 @@
along with qTox. If not, see .
*/
-
#ifndef VIDEOMODE_H
#define VIDEOMODE_H
#include
#include
-/// Describes a video mode supported by a device
struct VideoMode
{
- unsigned short width, height; ///< Displayed video resolution (NOT frame resolution)
- unsigned short x, y; ///< Coordinates of upper-left corner
- float FPS; ///< Max frames per second supported by the device at this resolution
+ unsigned short width, height;
+ unsigned short x, y;
+ float FPS;
uint32_t pixel_format;
VideoMode(int width = 0, int height = 0, int x = 0, int y = 0,
- int FPS = 0, int format = 0) :
- width(width), height(height), x(x), y(y),
- FPS(FPS), pixel_format(format)
- {
- }
+ int FPS = 0, int format = 0);
- VideoMode(QRect rect) :
- width(rect.width()), height(rect.height()),
- x(rect.x()), y(rect.y()),
- FPS(0), pixel_format(0)
- {
- }
+ VideoMode(QRect rect);
- QRect toRect() const
- {
- return QRect(x, y, width, height);
- }
+ QRect toRect() const;
- /// All zeros means a default/unspecified mode
- operator bool() const
- {
- return width || height || FPS;
- }
-
- bool operator==(const VideoMode& other) const
- {
- return width == other.width
- && height == other.height
- && x == other.x
- && y == other.y
- && FPS == other.FPS
- && pixel_format == other.pixel_format;
- }
-
- uint32_t norm(const VideoMode& other) const
- {
- return abs(this->width-other.width) + abs(this->height-other.height);
- }
+ operator bool() const;
+ bool operator==(const VideoMode& other) const;
+ uint32_t norm(const VideoMode& other) const;
};
#endif // VIDEOMODE_H