Skip to content

Commit

Permalink
Merge branch 'master' of github.com:skyjake/Doomsday-Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Aug 25, 2013
2 parents 1b4631c + 33d0145 commit fc7e56e
Show file tree
Hide file tree
Showing 36 changed files with 793 additions and 261 deletions.
6 changes: 4 additions & 2 deletions doomsday/client/client.pro
Expand Up @@ -362,13 +362,15 @@ DENG_HEADERS += \
include/ui/widgets/gridlayout.h \
include/ui/widgets/guirootwidget.h \
include/ui/widgets/guiwidget.h \
include/ui/widgets/guiwidgetprivate.h \
include/ui/widgets/fontlinewrapping.h \
include/ui/widgets/item.h \
include/ui/widgets/labelwidget.h \
include/ui/widgets/legacywidget.h \
include/ui/widgets/lineeditwidget.h \
include/ui/widgets/listcontext.h \
include/ui/widgets/logwidget.h \
include/ui/widgets/margins.h \
include/ui/widgets/menuwidget.h \
include/ui/widgets/messagedialog.h \
include/ui/widgets/notificationwidget.h \
Expand Down Expand Up @@ -441,8 +443,7 @@ INCLUDEPATH += \

HEADERS += \
$$DENG_API_HEADERS \
$$DENG_HEADERS \
include/ui/widgets/guiwidgetprivate.h
$$DENG_HEADERS

# Platform-specific sources.
win32 {
Expand Down Expand Up @@ -685,6 +686,7 @@ SOURCES += \
src/ui/widgets/lineeditwidget.cpp \
src/ui/widgets/listcontext.cpp \
src/ui/widgets/logwidget.cpp \
src/ui/widgets/margins.cpp \
src/ui/widgets/menuwidget.cpp \
src/ui/widgets/messagedialog.cpp \
src/ui/widgets/notificationwidget.cpp \
Expand Down
17 changes: 12 additions & 5 deletions doomsday/client/data/defaultstyle.pack/colors.dei
Expand Up @@ -11,7 +11,7 @@ color background { rgb <0.0, 0.0, 0.0, 0.75> }
color accent { rgb <1.0, 0.8, 0.4> }
color glow { rgb <1.0, 1.0, 1.0, 0.14> }

color textaccent { rgb $= gui.colorMix(text.rgb, accent.rgb, 0.5) }
color textaccent { rgb $= gui.colorMix(text.rgb, accent.rgb, 0.6) }

group inverted {
color text { rgb <0.0, 0.0, 0.0> }
Expand All @@ -30,6 +30,13 @@ group label {
color dimaccent { rgb <0.85, 0.68, 0.34> }
}

group popup {
group info {
color background { rgb <1.0, 1.0, 1.0> }
color glow { rgb $= inverted.glow.rgb }
}
}

group choice {
color popup { rgb $= gui.colorAlpha(background.rgb, 1.0) }
}
Expand All @@ -54,10 +61,10 @@ group editor {
color cursor { rgb $= gui.colorAlpha(accent.rgb, 0.7) }
color hint { rgb $= textaccent.rgb }

group completion {
color background { rgb <1.0, 1.0, 1.0> }
color glow { rgb $= inverted.glow.rgb }
}
#group completion {
# color background { rgb <1.0, 1.0, 1.0> }
# color glow { rgb $= inverted.glow.rgb }
#}
}

group log {
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions doomsday/client/include/audio/audiodriver.h
Expand Up @@ -33,6 +33,11 @@
#include "api_audiod_mus.h"

#ifdef __cplusplus

#include <de/String>

de::String AudioDriver_InterfaceDescription();

extern "C" {
#endif

Expand Down
8 changes: 8 additions & 0 deletions doomsday/client/include/gl/sys_opengl.h
Expand Up @@ -213,6 +213,14 @@ boolean Sys_GLCheckError(void);

#ifdef __cplusplus
} // extern "C"

/**
* Information about the OpenGL driver and its capabilities.
*
* @return Styled text.
*/
de::String Sys_GLDescription();

#endif

#endif /* LIBDENG_SYSTEM_OPENGL_H */
9 changes: 9 additions & 0 deletions doomsday/client/include/ui/widgets/aboutdialog.h
Expand Up @@ -26,8 +26,17 @@
*/
class AboutDialog : public DialogWidget
{
Q_OBJECT

public:
AboutDialog();

protected slots:
void showGLInfo();
void showAudioInfo();

private:
DENG2_PRIVATE(d)
};

#endif // DENG_CLIENT_ABOUTDIALOG_H
1 change: 0 additions & 1 deletion doomsday/client/include/ui/widgets/choicewidget.h
Expand Up @@ -63,7 +63,6 @@ class ChoiceWidget : public ButtonWidget
void setSelected(ui::Context::Pos pos);

ui::Context::Pos selected() const;

ui::Item const &selectedItem() const;

public slots:
Expand Down
Expand Up @@ -115,8 +115,8 @@ class ContextWidgetOrganizer
ui::Context const &context() const;

GuiWidget *itemWidget(ui::Context::Pos pos) const;

GuiWidget *itemWidget(ui::Item const &item) const;
GuiWidget *itemWidget(de::String const &label) const;

private:
DENG2_PRIVATE(d)
Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/include/ui/widgets/documentwidget.h
Expand Up @@ -32,6 +32,8 @@
* DocumentWidget can be configured to expand horizontally, or it can use a
* certain determined fixed width (see DocumentWidget::setWidthPolicy()).
*
* By default, the height of the widget is determined by its content size.
*
* The assumption is that the source document is largely static so that once
* prepared, the GL resources can be reused as many times as possible.
*/
Expand Down
12 changes: 4 additions & 8 deletions doomsday/client/include/ui/widgets/guiwidget.h
Expand Up @@ -26,6 +26,7 @@

#include "../uidefs.h"
#include "ui/style.h"
#include "margins.h"
#include "guiwidgetprivate.h"

class GuiRootWidget;
Expand Down Expand Up @@ -150,6 +151,9 @@ class GuiWidget : public QObject, public de::Widget
*/
de::RuleRectangle const &rule() const;

ui::Margins &margins();
ui::Margins const &margins() const;

de::Rectanglef normalizedRect() const;

/**
Expand All @@ -162,20 +166,12 @@ class GuiWidget : public QObject, public de::Widget

void setFont(de::DotPath const &id);
void setTextColor(de::DotPath const &id);
void setMargin(de::DotPath const &id);
void setMargin(ui::Direction dir, de::DotPath const &id);
void setMargins(de::DotPath const &leftId,
de::DotPath const &topId,
de::DotPath const &rightId,
de::DotPath const &bottomId);
void set(Background const &bg);

de::Font const &font() const;
de::ColorBank::Color textColor() const;
de::ColorBank::Colorf textColorf() const;

de::Rule const &margin(ui::Direction dir = ui::Left) const;

/**
* Determines whether the contents of the widget are supposed to be clipped
* to its boundaries. The Widget::ContentClipping behavior flag is used for
Expand Down
77 changes: 77 additions & 0 deletions doomsday/client/include/ui/widgets/margins.h
@@ -0,0 +1,77 @@
/** @file margins.h Margin rules for widgets.
*
* @authors Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free 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 2 of the License, or (at your
* option) any later version. This program 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 this program; if not, see:
* http://www.gnu.org/licenses</small>
*/

#ifndef DENG_CLIENT_UI_MARGINS_H
#define DENG_CLIENT_UI_MARGINS_H

#include <de/Rule>
#include <de/DotPath>

#include "../uidefs.h"

namespace ui {

/**
* Margin rules for a widget.
*/
class Margins
{
public:
DENG2_DEFINE_AUDIENCE(Change, void marginsChanged())

public:
Margins(de::String const &defaultMargin = "gap");

void setLeft (de::DotPath const &leftMarginId);
void setRight (de::DotPath const &rightMarginId);
void setTop (de::DotPath const &topMarginId);
void setBottom(de::DotPath const &bottomMarginId);
void set (ui::Direction dir, de::DotPath const &marginId);
void set (de::DotPath const &marginId);

void setLeft (de::Rule const &rule);
void setRight (de::Rule const &rule);
void setTop (de::Rule const &rule);
void setBottom(de::Rule const &rule);
void set (ui::Direction dir, de::Rule const &rule);
void set (de::Rule const &rule);

de::Rule const &left() const;
de::Rule const &right() const;
de::Rule const &top() const;
de::Rule const &bottom() const;

/**
* The "width" of the margins is the sum of the left and right margins.
*/
de::Rule const &width() const;

/**
* The "height" of the margins is the sim of the top and bottom margins.
*/
de::Rule const &height() const;

de::Rule const &margin(ui::Direction dir) const;

private:
DENG2_PRIVATE(d)
};

} // namespace ui

#endif // DENG_CLIENT_UI_MARGINS_H
6 changes: 6 additions & 0 deletions doomsday/client/include/ui/widgets/popupwidget.h
Expand Up @@ -85,6 +85,12 @@ class PopupWidget : public GuiWidget
*/
void setClickToClose(bool clickCloses);

/**
* Sets the style of the popup to the one used for informational popups
* rather than interactive (the default) ones.
*/
void useInfoStyle();

// Events.
void viewResized();
void update();
Expand Down
12 changes: 8 additions & 4 deletions doomsday/client/src/audio/audiodriver.cpp
Expand Up @@ -413,13 +413,13 @@ static void selectInterfaces(audiodriverid_t defaultDriverId)
AudioDriver_Music_Set(AUDIOP_SFX_INTERFACE, AudioDriver_SFX());
}

void AudioDriver_PrintInterfaces(void)
de::String AudioDriver_InterfaceDescription()
{
LOG_INFO(_E(b) "Audio configuration" _E(2) " (by decreasing priority):");

de::String str;
QTextStream os(&str);

os << _E(b) "Audio configuration" _E(2) " (by decreasing priority):\n" _E(.)_E(.);

for(int i = MAX_AUDIO_INTERFACES - 1; i >= 0; --i)
{
audiointerface_t* a = &activeInterfaces[i];
Expand All @@ -434,8 +434,12 @@ void AudioDriver_PrintInterfaces(void)
<< Str_Text(AudioDriver_InterfaceName(a->i.sfx)) << "\n";
}
}
return str.rightStrip();
}

LOG_MSG("%s") << str.rightStrip();
void AudioDriver_PrintInterfaces(void)
{
LOG_MSG("%s") << AudioDriver_InterfaceDescription();
}

/*
Expand Down
30 changes: 15 additions & 15 deletions doomsday/client/src/gl/sys_opengl.cpp
Expand Up @@ -176,31 +176,25 @@ static void initialize(void)
#endif
}

static void printGLUInfo(void)
{
GLfloat fVals[2];
GLint iVal;
#define TABBED(A, B) _E(Ta) " " A " " _E(Tb) << B << "\n"

de::String Sys_GLDescription()
{
DENG_ASSERT_IN_MAIN_THREAD();
DENG_ASSERT_GL_CONTEXT_ACTIVE();

LOG_MSG(_E(b) "OpenGL information:");

de::String str;
QTextStream os(&str);

#define TABBED(A, B) _E(Ta) " " A " " _E(Tb) << B << "\n"
os << _E(b) "OpenGL information:\n" << _E(.);

os << TABBED("Version:", (char const *) glGetString(GL_VERSION));
os << TABBED("Renderer:", (char const *) glGetString(GL_RENDERER));
os << TABBED("Vendor:", (char const *) glGetString(GL_VENDOR));

LOG_MSG("%s") << str.rightStrip();

str.clear();
os.setString(&str);
os << _E(T`) "Capabilities:\n";

os << "Capabilities:\n";
GLint iVal;

#ifdef USE_TEXTURE_COMPRESSION_S3
if(GL_state.extensions.texCompressionS3)
Expand All @@ -226,19 +220,25 @@ static void printGLUInfo(void)
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &iVal);
os << TABBED("Maximum texture size:", iVal);

GLfloat fVals[2];
glGetFloatv(GL_LINE_WIDTH_GRANULARITY, fVals);
os << TABBED("Line width granularity:", fVals[0]);

glGetFloatv(GL_LINE_WIDTH_RANGE, fVals);
os << TABBED("Line width range:", fVals[0] << "..." << fVals[1]);

LOG_MSG("%s") << str.rightStrip();

Sys_GLPrintExtensions();
return str.rightStrip();

#undef TABBED
}

static void printGLUInfo(void)
{
LOG_MSG("%s") << Sys_GLDescription();

Sys_GLPrintExtensions();
}

#if 0
#ifdef WIN32
static void testMultisampling(HDC hDC)
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/clientwindow.cpp
Expand Up @@ -123,7 +123,7 @@ public IGameChangeObserver
background->setImage(style.images().image("window.background"));
background->setImageFit(ui::FitToSize);
background->setSizePolicy(ui::Filled, ui::Filled);
background->setMargin("");
background->margins().set("");
background->rule()
.setInput(Rule::Left, root.viewLeft())
.setInput(Rule::Top, root.viewTop())
Expand Down

0 comments on commit fc7e56e

Please sign in to comment.