Skip to content

Commit

Permalink
Refactor|Client|libgui: Started revising window architecture
Browse files Browse the repository at this point in the history
Began a large refactoring where the window architecture is
"re-imagined" with proper separation of concerns, and generic portions
are relocated to libgui. Hopefully after this window management is
finally up to Doomsday 2 standards.

In this commit DisplayMode, DDKEYs, and the persistent window state
management have been moved to libgui. Canvas's mouse and keyboard
event production has been abstracted behind Mouse/KeyEventSource,
so that instead of events they produce notifications.

Note: Not finished at all -- barely compiles on OS X, likely fails on
other platforms.
  • Loading branch information
skyjake committed Apr 4, 2013
1 parent e4ea14e commit 5f41510
Show file tree
Hide file tree
Showing 35 changed files with 2,666 additions and 1,005 deletions.
79 changes: 1 addition & 78 deletions doomsday/api/dd_share.h
Expand Up @@ -302,84 +302,7 @@ enum {

///@}

//------------------------------------------------------------------------
//
// Key Codes
//
//------------------------------------------------------------------------

/// @defgroup input Input

/**
* @defgroup keyConstants Key Constants
* @ingroup input
* Most key data is regular ASCII so key constants correspond to ASCII codes.
*/
///@{
#define DDKEY_ESCAPE 27
#define DDKEY_RETURN 13
#define DDKEY_TAB 9
#define DDKEY_BACKSPACE 127
#define DDKEY_EQUALS 0x3d
#define DDKEY_MINUS 0x2d
#define DDKEY_BACKSLASH 0x5C

// Extended keys (above 127).
enum {
DDKEY_RIGHTARROW = 0x80,
DDKEY_LEFTARROW,
DDKEY_UPARROW,
DDKEY_DOWNARROW,
DDKEY_F1,
DDKEY_F2,
DDKEY_F3,
DDKEY_F4,
DDKEY_F5,
DDKEY_F6,
DDKEY_F7,
DDKEY_F8,
DDKEY_F9,
DDKEY_F10,
DDKEY_F11,
DDKEY_F12,
DDKEY_NUMLOCK,
DDKEY_CAPSLOCK,
DDKEY_SCROLL,
DDKEY_NUMPAD7,
DDKEY_NUMPAD8,
DDKEY_NUMPAD9,
DDKEY_NUMPAD4,
DDKEY_NUMPAD5,
DDKEY_NUMPAD6,
DDKEY_NUMPAD1,
DDKEY_NUMPAD2,
DDKEY_NUMPAD3,
DDKEY_NUMPAD0,
DDKEY_DECIMAL,
DDKEY_PAUSE,
DDKEY_RSHIFT,
DDKEY_LSHIFT = DDKEY_RSHIFT,
DDKEY_RCTRL,
DDKEY_LCTRL = DDKEY_RCTRL,
DDKEY_RALT,
DDKEY_LALT = DDKEY_RALT,
DDKEY_INS,
DDKEY_DEL,
DDKEY_PGUP,
DDKEY_PGDN,
DDKEY_HOME,
DDKEY_END,
DDKEY_SUBTRACT, ///< '-' on numeric keypad.
DDKEY_ADD, ///< '+' on numeric keypad.
DDKEY_PRINT,
DDKEY_ENTER, ///< on the numeric keypad.
DDKEY_DIVIDE, ///< '/' on numeric keypad.
DDKEY_MULTIPLY, ///< '*' on the numeric keypad.
DDKEY_SECTION, ///< §
DD_HIGHEST_KEYCODE
};
///@}

#include <de/gui/ddkey.h>

//------------------------------------------------------------------------
//
Expand Down
43 changes: 3 additions & 40 deletions doomsday/client/client.pro
Expand Up @@ -65,21 +65,6 @@ else:macx {
else {
# Generic Unix.
!freebsd-*: LIBS += -ldl
LIBS += -lX11

# DisplayMode uses the Xrandr and XFree86-VideoMode extensions.
!deng_nodisplaymode {
# Check that the X11 extensions exist.
!system(pkg-config --exists xxf86vm) {
error(Missing dependency: X11 XFree86 video mode extension library (development headers). Alternatively disable display mode functionality with: CONFIG+=deng_nodisplaymode)
}
!system(pkg-config --exists xrandr) {
error(Missing dependency: X11 RandR extension library (development headers). Alternatively disable display mode functionality with: CONFIG+=deng_nodisplaymode)
}

QMAKE_CXXFLAGS += $$system(pkg-config xrandr xxf86vm --cflags)
LIBS += $$system(pkg-config xrandr xxf86vm --libs)
}
}

# Source Files ---------------------------------------------------------------
Expand Down Expand Up @@ -351,17 +336,13 @@ DENG_HEADERS += \
include/ui/b_util.h \
include/ui/busyvisual.h \
include/ui/busywidget.h \
include/ui/canvas.h \
include/ui/canvaswindow.h \
include/ui/clientwindow.h \
include/ui/dd_input.h \
include/ui/dd_ui.h \
include/ui/displaymode.h \
include/ui/displaymode_native.h \
include/ui/fi_main.h \
include/ui/finaleinterpreter.h \
include/ui/guiwidget.h \
include/ui/joystick.h \
include/ui/keycode.h \
include/ui/legacywidget.h \
include/ui/mouse_qt.h \
include/ui/nativeui.h \
Expand All @@ -370,7 +351,6 @@ DENG_HEADERS += \
include/ui/ui2_main.h \
include/ui/ui_main.h \
include/ui/ui_panel.h \
include/ui/window.h \
include/ui/windowsystem.h \
include/ui/zonedebug.h \
include/updater.h \
Expand Down Expand Up @@ -407,8 +387,6 @@ win32 {
src/windows/directinput.cpp \
src/windows/joystick_win32.cpp \
src/windows/mouse_win32.cpp

!deng_nodisplaymode: SOURCES += src/windows/displaymode_win32.cpp
}
else:unix {
# Common Unix (including Mac OS X).
Expand All @@ -430,21 +408,10 @@ macx {
OBJECTIVE_SOURCES += \
src/macx/MusicPlayer.m

!deng_nodisplaymode: OBJECTIVE_SOURCES += src/macx/displaymode_macx.mm

INCLUDEPATH += $$DENG_MAC_INCLUDE_DIR
}
else:unix {
!deng_nodisplaymode {
# Unix (non-Mac) only.
SOURCES += \
src/unix/displaymode_x11.cpp \
src/unix/imKStoUCS.c
}
}

deng_nodisplaymode {
SOURCES += src/ui/displaymode_dummy.c
# Unix (non-Mac) only.
}

# Platform-independent sources.
Expand Down Expand Up @@ -633,14 +600,11 @@ SOURCES += \
src/ui/b_util.cpp \
src/ui/busyvisual.cpp \
src/ui/busywidget.cpp \
src/ui/canvas.cpp \
src/ui/canvaswindow.cpp \
src/ui/clientwindow.cpp \
src/ui/dd_input.cpp \
src/ui/displaymode.cpp \
src/ui/fi_main.cpp \
src/ui/finaleinterpreter.cpp \
src/ui/guiwidget.cpp \
src/ui/keycode.cpp \
src/ui/legacywidget.cpp \
src/ui/mouse_qt.cpp \
src/ui/nativeui.cpp \
Expand All @@ -649,7 +613,6 @@ SOURCES += \
src/ui/ui2_main.cpp \
src/ui/ui_main.cpp \
src/ui/ui_panel.cpp \
src/ui/window.cpp \
src/ui/windowsystem.cpp \
src/ui/zonedebug.cpp \
src/updater/downloaddialog.cpp \
Expand Down
168 changes: 0 additions & 168 deletions doomsday/client/include/ui/canvas.h

This file was deleted.

0 comments on commit 5f41510

Please sign in to comment.