Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
411a0988
Commit
411a0988
authored
Nov 24, 2015
by
agriche
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
https://github.com/DIP-SEM/OpenBoard
into dev
parents
ab4ae943
20ebdf3c
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
84 additions
and
96 deletions
+84
-96
UBDisplayManager.cpp
src/core/UBDisplayManager.cpp
+5
-5
UBCustomCaptureWindow.cpp
src/desktop/UBCustomCaptureWindow.cpp
+2
-1
UBDesktopAnnotationController.cpp
src/desktop/UBDesktopAnnotationController.cpp
+1
-1
UBGraphicsMediaItem.cpp
src/domain/UBGraphicsMediaItem.cpp
+6
-44
UBGraphicsMediaItem.h
src/domain/UBGraphicsMediaItem.h
+0
-16
UBGraphicsMediaItemDelegate.cpp
src/domain/UBGraphicsMediaItemDelegate.cpp
+1
-1
UBPlatformUtils.h
src/frameworks/UBPlatformUtils.h
+1
-0
UBPlatformUtils_linux.cpp
src/frameworks/UBPlatformUtils_linux.cpp
+8
-2
UBPlatformUtils_mac.mm
src/frameworks/UBPlatformUtils_mac.mm
+53
-26
UBPlatformUtils_win.cpp
src/frameworks/UBPlatformUtils_win.cpp
+7
-0
No files found.
src/core/UBDisplayManager.cpp
View file @
411a0988
...
...
@@ -158,7 +158,7 @@ void UBDisplayManager::setDisplayWidget(QWidget* pDisplayWidget)
mDisplayWidget
=
pDisplayWidget
;
mDisplayWidget
->
setGeometry
(
mDesktop
->
screenGeometry
(
mDisplayScreenIndex
));
if
(
UBSettings
::
settings
()
->
appUseMultiscreen
->
get
().
toBool
())
mDisplayWidget
->
showFullScreen
(
);
UBPlatformUtils
::
showFullScreen
(
mDisplayWidget
);
}
}
...
...
@@ -209,14 +209,14 @@ void UBDisplayManager::positionScreens()
{
mControlWidget
->
hide
();
mControlWidget
->
setGeometry
(
mDesktop
->
screenGeometry
(
mControlScreenIndex
));
mControlWidget
->
showFullScreen
(
);
UBPlatformUtils
::
showFullScreen
(
mControlWidget
);
}
if
(
mDisplayWidget
&&
mDisplayScreenIndex
>
-
1
)
{
mDisplayWidget
->
hide
();
mDisplayWidget
->
setGeometry
(
mDesktop
->
screenGeometry
(
mDisplayScreenIndex
));
mDisplayWidget
->
showFullScreen
(
);
UBPlatformUtils
::
showFullScreen
(
mDisplayWidget
);
}
else
if
(
mDisplayWidget
)
{
...
...
@@ -234,7 +234,7 @@ void UBDisplayManager::positionScreens()
{
QWidget
*
previous
=
mPreviousDisplayWidgets
.
at
(
psi
);
previous
->
setGeometry
(
mDesktop
->
screenGeometry
(
mPreviousScreenIndexes
.
at
(
psi
)));
previous
->
showFullScreen
(
);
UBPlatformUtils
::
showFullScreen
(
previous
);
}
}
...
...
@@ -280,7 +280,7 @@ void UBDisplayManager::blackout()
foreach
(
UBBlackoutWidget
*
blackoutWidget
,
mBlackoutWidgets
)
{
blackoutWidget
->
showFullScreen
(
);
UBPlatformUtils
::
showFullScreen
(
blackoutWidget
);
}
}
...
...
src/desktop/UBCustomCaptureWindow.cpp
View file @
411a0988
...
...
@@ -30,6 +30,7 @@
#include "UBCustomCaptureWindow.h"
#include "frameworks/UBPlatformUtils.h"
#include "gui/UBRubberBand.h"
#include "core/memcheck.h"
...
...
@@ -74,7 +75,7 @@ int UBCustomCaptureWindow::execute(const QPixmap &pScreenPixmap)
int
currentScreen
=
desktop
->
screenNumber
(
QCursor
::
pos
());
setGeometry
(
desktop
->
screenGeometry
(
currentScreen
));
showFullScreen
(
);
UBPlatformUtils
::
showFullScreen
(
this
);
setWindowOpacity
(
1.0
);
return
exec
();
...
...
src/desktop/UBDesktopAnnotationController.cpp
View file @
411a0988
...
...
@@ -332,7 +332,7 @@ void UBDesktopAnnotationController::showWindow()
UBDrawingController
::
drawingController
()
->
setStylusTool
(
mDesktopStylusTool
);
#ifndef Q_OS_LINUX
mTransparentDrawingView
->
showFullScreen
(
);
UBPlatformUtils
::
showFullScreen
(
mTransparentDrawingView
);
#else
// this is necessary to avoid unity to hide the panels
mTransparentDrawingView
->
show
();
...
...
src/domain/UBGraphicsMediaItem.cpp
View file @
411a0988
...
...
@@ -50,13 +50,8 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
update
();
//mMediaObject = new Phonon::MediaObject(this);
mMediaObject
=
new
QMediaPlayer
(
this
);
//playlist = new QMediaPlaylist;
//mMediaObject->setPlaylist(playlist);
QString
mediaPath
=
pMediaFileUrl
.
toString
();
if
(
""
==
mediaPath
)
mediaPath
=
pMediaFileUrl
.
toLocalFile
();
...
...
@@ -65,50 +60,27 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
{
mMediaType
=
mediaType_Video
;
//mAudioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this);
QAudioFormat
format
;
// to define
format
.
setByteOrder
(
QAudioFormat
::
LittleEndian
);
format
.
setSampleType
(
QAudioFormat
::
UnSignedInt
);
//mAudioOutput = new QAudioOutput(format, this);
mAudioOutput
=
new
QMediaPlayer
;
mMediaObject
->
setNotifyInterval
(
50
);
//mMediaObject->setTickInterval(50);
mMediaObject
->
setPosition
(
50
);
//mVideoWidget = new Phonon::VideoWidget(); // owned and destructed by the scene ...
mVideoWidget
=
new
QVideoWidget
();
// owned and destructed by the scene ...
//Phonon::createPath(mMediaObject, mVideoWidget);
mMediaObject
->
setVideoOutput
(
mVideoWidget
);
if
(
mVideoWidget
->
sizeHint
()
==
QSize
(
1
,
1
)){
mVideoWidget
->
resize
(
320
,
240
);
}
//mVideoWidget->setMinimumSize(140,26);
mVideoWidget
->
setMinimumSize
(
320
,
240
);
haveLinkedImage
=
true
;
// DEBUGGING VIDEO
//*****************
qDebug
()
<<
"UBGraphicsMediaItem.cpp:"
<<
mVideoWidget
<<
"setMinimumSize(140,26)"
;
}
else
if
(
mediaPath
.
toLower
().
contains
(
"audios"
))
{
mMediaType
=
mediaType_Audio
;
QAudioFormat
format
;
format
.
setByteOrder
(
QAudioFormat
::
LittleEndian
);
format
.
setSampleType
(
QAudioFormat
::
UnSignedInt
);
// mAudioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
//mAudioOutput = new QMediaPlayer(format, this);
mAudioOutput
=
new
QMediaPlayer
;
//mMediaObject->setTickInterval(1000);
mMediaObject
->
setNotifyInterval
(
1000
);
mAudioWidget
=
new
QWidget
();
mAudioWidget
->
resize
(
320
,
26
);
mAudioWidget
->
setMinimumSize
(
150
,
26
);
...
...
@@ -116,10 +88,6 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
haveLinkedImage
=
false
;
}
//Phonon::createPath(mMediaObject, mAudioOutput);
//mSource = Phonon::MediaSource(pMediaFileUrl);
//mMediaObject->setCurrentSource(mSource);
mMediaObject
->
setMedia
(
pMediaFileUrl
);
...
...
@@ -147,7 +115,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
setData
(
UBGraphicsItemData
::
itemLayerType
,
QVariant
(
itemLayerType
::
ObjectItem
));
//Necessary to set if we want z value to be assigned correctly
connect
(
Delegate
(),
SIGNAL
(
showOnDisplayChanged
(
bool
)),
this
,
SLOT
(
showOnDisplayChanged
(
bool
)));
connect
(
mMediaObject
,
SIGNAL
(
hasVideo
Changed
(
bool
)),
this
,
SLOT
(
hasMediaChanged
(
bool
)));
connect
(
mMediaObject
,
SIGNAL
(
videoAvailable
Changed
(
bool
)),
this
,
SLOT
(
hasMediaChanged
(
bool
)));
}
...
...
@@ -192,12 +160,8 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
absoluteMediaFilename
=
mMediaFileUrl
.
toLocalFile
();
if
(
absoluteMediaFilename
.
length
()
>
0
)
//mMediaObject->setCurrentSource(QMediaSource(absoluteMediaFilename));
mMediaObject
->
setMedia
(
QUrl
::
fromLocalFile
(
absoluteMediaFilename
));
}
}
...
...
@@ -230,7 +194,7 @@ void UBGraphicsMediaItem::toggleMute()
void
UBGraphicsMediaItem
::
setMute
(
bool
bMute
)
{
mMuted
=
bMute
;
m
AudioOutpu
t
->
setMuted
(
mMuted
);
m
MediaObjec
t
->
setMuted
(
mMuted
);
mMutedByUserAction
=
mMuted
;
sIsMutedByDefault
=
mMuted
;
}
...
...
@@ -240,7 +204,6 @@ void UBGraphicsMediaItem::hasMediaChanged(bool hasMedia)
{
if
(
hasMedia
&&
mMediaObject
->
isSeekable
())
{
//mMediaObject->seek(mInitialPos);
mMediaObject
->
setPosition
(
mInitialPos
);
UBGraphicsMediaItemDelegate
*
med
=
dynamic_cast
<
UBGraphicsMediaItemDelegate
*>
(
Delegate
());
...
...
@@ -268,12 +231,12 @@ void UBGraphicsMediaItem::showOnDisplayChanged(bool shown)
if
(
!
shown
)
{
mMuted
=
true
;
m
AudioOutpu
t
->
setMuted
(
mMuted
);
m
MediaObjec
t
->
setMuted
(
mMuted
);
}
else
if
(
!
mMutedByUserAction
)
{
mMuted
=
false
;
m
AudioOutpu
t
->
setMuted
(
mMuted
);
m
MediaObjec
t
->
setMuted
(
mMuted
);
}
}
...
...
@@ -357,7 +320,6 @@ void UBGraphicsMediaItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QPointF
eventPos
=
mapFromScene
(
event
->
scenePos
());
QPointF
translation
=
eventPos
-
mouseMovePos
;
//translate(translation.x(), translation.y());
setPos
(
translation
.
x
(),
translation
.
y
());
}
...
...
src/domain/UBGraphicsMediaItem.h
View file @
411a0988
...
...
@@ -30,9 +30,6 @@
#include <QtWidgets/QGraphicsView>
#include "UBGraphicsProxyWidget.h"
//#include <phonon/AudioOutput>
//#include <phonon/MediaObject>
//#include <phonon/VideoWidget>
#include <QAudioOutput>
#include <QMediaObject>
...
...
@@ -73,9 +70,7 @@ public:
virtual
void
mediaFileUrl
(
QUrl
url
){
mMediaFileUrl
=
url
;}
//Phonon::MediaObject* mediaObject() const
QMediaPlayer
*
mediaObject
()
const
{
return
mMediaObject
;
}
...
...
@@ -92,9 +87,7 @@ public:
return
mMuted
;
}
// Phonon::VideoWidget* videoWidget() const
QVideoWidget
*
videoWidget
()
const
{
return
mVideoWidget
;
}
...
...
@@ -129,17 +122,8 @@ protected:
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
clearSource
();
//Phonon::MediaObject *mMediaObject;
//Phonon::VideoWidget *mVideoWidget;
//Phonon::AudioOutput *mAudioOutput;
//Phonon::MediaSource mSource;
QMediaPlayer
*
mMediaObject
;
QMediaPlaylist
*
playlist
;
QVideoWidget
*
mVideoWidget
;
// QAudioOutput *mAudioOutput;
QMediaPlayer
*
mAudioOutput
;
QMediaService
*
mSource
;
QWidget
*
mAudioWidget
;
...
...
src/domain/UBGraphicsMediaItemDelegate.cpp
View file @
411a0988
...
...
@@ -252,7 +252,7 @@ void UBGraphicsMediaItemDelegate::togglePlayPause()
media
->
play
();
}
else
if
(
media
->
error
())
if
(
media
->
error
())
qDebug
()
<<
"Error appeared."
<<
media
->
errorString
();
}
...
...
src/frameworks/UBPlatformUtils.h
View file @
411a0988
...
...
@@ -204,6 +204,7 @@ public:
static
QString
urlFromClipboard
();
static
QStringList
availableTranslations
();
static
void
setFrontProcess
();
static
void
showFullScreen
(
QWidget
*
pWidget
);
#ifdef Q_OS_OSX
static
void
SetMacLocaleByIdentifier
(
const
QString
&
id
);
...
...
src/frameworks/UBPlatformUtils_linux.cpp
View file @
411a0988
...
...
@@ -31,7 +31,6 @@
#include <QApplication>
#include <unistd.h>
#include <X11/Xlib.h>
#include <X11/keysym.h>
#include "frameworks/UBFileSystemUtils.h"
...
...
@@ -430,7 +429,14 @@ QString UBPlatformUtils::urlFromClipboard()
return
qsRet
;
}
void
UBPlatformUtils
::
setFrontProcess
()
{
// not used in Linux
}
void
UBPlatformUtils
::
showFullScreen
(
QWidget
*
pWidget
)
{
pWidget
->
showFullScreen
();
}
src/frameworks/UBPlatformUtils_mac.mm
View file @
411a0988
...
...
@@ -65,7 +65,7 @@ void UBPlatformUtils::init()
//originalSetSystemUIMode = APEPatchCreate((const void *)SetSystemUIMode, (const void *)emptySetSystemUIMode);
setDesktopMode(false);
//
setDesktopMode(false);
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
...
...
@@ -93,20 +93,24 @@ void UBPlatformUtils::init()
void UBPlatformUtils::setDesktopMode(bool desktop)
{ /*
#ifndef OS_NEWER_THAN_OR_EQUAL_TO_1010
//OSStatus (*functor)(SystemUIMode, SystemUIOptions) = (OSStatus (*)(SystemUIMode, SystemUIOptions))originalSetSystemUIMode;
{
if (desktop)
{
functor(kUIModeNormal, 0);
//qDebug() << "setDesktopMode called. desktop = " << desktop;
@try {
// temporarily disabled due to bug: when switching to desktop mode (and calling this),
// openboard switches right back to the board mode. clicking again on desktop mode works.
/*if (desktop) {
[NSApp setPresentationOptions:NSApplicationPresentationAutoHideMenuBar | NSApplicationPresentationAutoHideDock];
}
else*/
[NSApp setPresentationOptions:NSApplicationPresentationHideMenuBar | NSApplicationPresentationHideDock];
}
else
{
functor(kUIModeAllHidden, 0)
;
@catch(NSException * exception)
{
qDebug() << "Error setting presentation options"
;
}
#endif
*/
}
...
...
@@ -533,29 +537,35 @@ QString UBPlatformUtils::urlFromClipboard()
void UBPlatformUtils::SetMacLocaleByIdentifier(const QString& id)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@autoreleasepool {
// convert id from QString to CFString
// TODO: clean this up
const QByteArray utf8 = id.toUtf8();
const char* cString = utf8.constData();
NSString * ns = [[NSString alloc] initWithUTF8String:cString];
const char * strName = id.toLatin1().data()
;
CFStringRef iName = (__bridge CFStringRef)ns
;
CFStringRef iName = CFStringCreateWithCString(NULL, strName, kCFStringEncodingISOLatin1 );
CFStringRef keys[] = { kTISPropertyInputSourceCategory,
kTISPropertyInputSourceID };
CFStringRef values[] = { kTISCategoryKeyboardInputSource,
iName };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 2
, NULL, NULL);
CFStringRef keys[] = {
kTISPropertyInputSourceID };
CFStringRef values[] = {
iName };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 1
, NULL, NULL);
// get list of current enabled keyboard layouts. dict filters the list
CFArrayRef kbds = TISCreateInputSourceList(dict, true);
if (kbds!=NULL)
{
if (CFArrayGetCount(kbds)!=0)
{
// get list of current enabled keyboard layouts. dict filters the list
// false specifies that we search only through the active input sources
CFArrayRef kbds = TISCreateInputSourceList(dict, false);
if (kbds && CFArrayGetCount(kbds) == 0)
// if not found in the active sources, we search again through all sources installed
kbds = TISCreateInputSourceList(dict, true);
if (kbds && CFArrayGetCount(kbds)!=0) {
TISInputSourceRef klRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, 0);
if (klRef!=NULL)
TISSelectInputSource(klRef);
}
}
[pool drain];
}
/**
...
...
@@ -568,6 +578,23 @@ void UBPlatformUtils::setFrontProcess()
// activate the application, forcing focus on it
[app activateWithOptions: NSApplicationActivateIgnoringOtherApps];
// other option:NSApplicationActivateAllWindows. This won't steal focus from another app, e.g
// other option:
NSApplicationActivateAllWindows. This won't steal focus from another app, e.g
// if the user is doing something else while waiting for OpenBoard to load
}
/**
* @brief Full-screen a QWidget. Specific behaviour is platform-dependent.
* @param pWidget the QWidget to maximize
*/
void UBPlatformUtils::showFullScreen(QWidget *pWidget)
{
pWidget->showMaximized();
/* On OS X, we want to hide the Dock and menu bar (aka "kiosk mode"). Qt's default behaviour
* when full-screening a QWidget is to set the dock and menu bar to auto-hide.
* Since it is impossible to later set different presentation options (i.e Hide dock & menu bar)
* to NSApplication, we have to avoid calling QWidget::showFullScreen on OSX.
*/
}
src/frameworks/UBPlatformUtils_win.cpp
View file @
411a0988
...
...
@@ -427,4 +427,11 @@ QString UBPlatformUtils::urlFromClipboard()
void
UBPlatformUtils
::
setFrontProcess
()
{
// not used in Windows
}
void
UBPlatformUtils
::
showFullScreen
(
QWidget
*
pWidget
)
{
pWidget
->
showFullScreen
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment