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
89ca4c40
Commit
89ca4c40
authored
Sep 05, 2012
by
Anatoly Mihalchenko
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'anatoly_dev' into develop
parents
4406082d
ff6332a6
Changes
17
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
177 additions
and
117 deletions
+177
-117
UBWidgetUniboardAPI.cpp
src/api/UBWidgetUniboardAPI.cpp
+1
-1
UBBoardController.cpp
src/board/UBBoardController.cpp
+4
-4
UBDesktopAnnotationController.cpp
src/desktop/UBDesktopAnnotationController.cpp
+1
-1
UBGraphicsGroupContainerItem.cpp
src/domain/UBGraphicsGroupContainerItem.cpp
+4
-1
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+16
-3
UBGraphicsItemDelegate.h
src/domain/UBGraphicsItemDelegate.h
+1
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+49
-83
UBGraphicsScene.h
src/domain/UBGraphicsScene.h
+8
-4
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+7
-2
UBGraphicsTextItemDelegate.h
src/domain/UBGraphicsTextItemDelegate.h
+1
-0
UBItem.cpp
src/domain/UBItem.cpp
+43
-0
UBItem.h
src/domain/UBItem.h
+1
-0
UBCoreGraphicsScene.cpp
src/frameworks/UBCoreGraphicsScene.cpp
+1
-0
UBPlatformUtils.h
src/frameworks/UBPlatformUtils.h
+5
-0
UBPlatformUtils_mac.mm
src/frameworks/UBPlatformUtils_mac.mm
+30
-0
UBKeyboardPalette.cpp
src/gui/UBKeyboardPalette.cpp
+4
-1
UBKeyboardPalette_mac.cpp
src/gui/UBKeyboardPalette_mac.cpp
+1
-17
No files found.
src/api/UBWidgetUniboardAPI.cpp
View file @
89ca4c40
...
...
@@ -250,7 +250,7 @@ void UBWidgetUniboardAPI::eraseLineTo(const qreal x, const qreal y, const qreal
void
UBWidgetUniboardAPI
::
clear
()
{
if
(
mScene
)
mScene
->
clear
ItemsAndAnnotations
(
);
mScene
->
clear
Content
(
UBGraphicsScene
::
clearItemsAndAnnotations
);
}
...
...
src/board/UBBoardController.cpp
View file @
89ca4c40
...
...
@@ -683,7 +683,7 @@ void UBBoardController::clearScene()
if
(
mActiveScene
)
{
freezeW3CWidgets
(
true
);
mActiveScene
->
clear
ItemsAndAnnotations
(
);
mActiveScene
->
clear
Content
(
UBGraphicsScene
::
clearItemsAndAnnotations
);
updateActionStates
();
}
}
...
...
@@ -694,7 +694,7 @@ void UBBoardController::clearSceneItems()
if
(
mActiveScene
)
{
freezeW3CWidgets
(
true
);
mActiveScene
->
clear
Items
(
);
mActiveScene
->
clear
Content
(
UBGraphicsScene
::
clearItems
);
updateActionStates
();
}
}
...
...
@@ -704,7 +704,7 @@ void UBBoardController::clearSceneAnnotation()
{
if
(
mActiveScene
)
{
mActiveScene
->
clear
Annotations
(
);
mActiveScene
->
clear
Content
(
UBGraphicsScene
::
clearAnnotations
);
updateActionStates
();
}
}
...
...
@@ -713,7 +713,7 @@ void UBBoardController::clearSceneBackground()
{
if
(
mActiveScene
)
{
mActiveScene
->
clear
Background
(
);
mActiveScene
->
clear
Content
(
UBGraphicsScene
::
clearBackground
);
updateActionStates
();
}
}
...
...
src/desktop/UBDesktopAnnotationController.cpp
View file @
89ca4c40
...
...
@@ -274,7 +274,7 @@ void UBDesktopAnnotationController::eraseDesktopAnnotations()
{
if
(
mTransparentDrawingScene
)
{
mTransparentDrawingScene
->
clear
Annotations
(
);
mTransparentDrawingScene
->
clear
Content
(
UBGraphicsScene
::
clearAnnotations
);
}
}
...
...
src/domain/UBGraphicsGroupContainerItem.cpp
View file @
89ca4c40
...
...
@@ -78,7 +78,10 @@ void UBGraphicsGroupContainerItem::addToGroup(QGraphicsItem *item)
QTransform
newItemTransform
(
itemTransform
);
item
->
setPos
(
mapFromItem
(
item
,
0
,
0
));
if
(
item
->
scene
())
{
item
->
scene
()
->
removeItem
(
item
);
}
if
(
corescene
())
corescene
()
->
removeItemFromDeletion
(
item
);
item
->
setParentItem
(
this
);
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
89ca4c40
...
...
@@ -387,9 +387,22 @@ void UBGraphicsItemDelegate::remove(bool canUndo)
UBGraphicsScene
*
scene
=
dynamic_cast
<
UBGraphicsScene
*>
(
mDelegated
->
scene
());
if
(
scene
)
{
foreach
(
DelegateButton
*
button
,
mButtons
)
scene
->
removeItem
(
button
);
// bool shownOnDisplay = mDelegated->data(UBGraphicsItemData::ItemLayerType).toInt() != UBItemLayerType::Control;
// showHide(shownOnDisplay);
// updateFrame();
// updateButtons();
if
(
mFrame
&&
!
mFrame
->
scene
()
&&
mDelegated
->
scene
())
{
mDelegated
->
scene
()
->
addItem
(
mFrame
);
}
mFrame
->
setAntiScale
(
mAntiScaleRatio
);
mFrame
->
positionHandles
();
updateButtons
(
true
);
foreach
(
DelegateButton
*
button
,
mButtons
)
{
scene
->
removeItem
(
button
);
}
scene
->
removeItem
(
mFrame
);
/* this is performed because when removing delegated from scene while it contains flash content, segfault happens because of QGraphicsScene::removeItem() */
...
...
src/domain/UBGraphicsItemDelegate.h
View file @
89ca4c40
...
...
@@ -244,6 +244,7 @@ class UBGraphicsItemDelegate : public QObject
UBGraphicsToolBarItem
*
getToolBarItem
()
const
{
return
mToolBarItem
;
}
qreal
antiScaleRatio
()
const
{
return
mAntiScaleRatio
;
}
virtual
void
update
()
{
positionHandles
();}
signals
:
void
showOnDisplayChanged
(
bool
shown
);
...
...
src/domain/UBGraphicsScene.cpp
View file @
89ca4c40
...
...
@@ -1064,106 +1064,72 @@ UBItem* UBGraphicsScene::deepCopy() const
return
sceneDeepCopy
();
}
void
UBGraphicsScene
::
clear
ItemsAndAnnotations
(
)
void
UBGraphicsScene
::
clear
Content
(
clearCase
pCase
)
{
deselectAllItems
();
QSet
<
QGraphicsItem
*>
emptyList
;
QSet
<
QGraphicsItem
*>
removedItems
;
QList
<
QGraphicsItem
*>
sceneItems
=
items
();
foreach
(
QGraphicsItem
*
item
,
sceneItems
)
{
if
(
!
mTools
.
contains
(
item
)
&&
!
isBackgroundObject
(
item
))
{
removeItem
(
item
);
removedItems
<<
item
;
}
}
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
update
(
sceneRect
());
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
removedItems
,
emptyList
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
}
void
UBGraphicsScene
::
clearItems
()
{
deselectAllItems
();
switch
(
pCase
)
{
case
clearBackground
:
removeItem
(
mBackgroundObject
);
removedItems
<<
mBackgroundObject
;
break
;
QSet
<
QGraphicsItem
*>
emptyList
;
QSet
<
QGraphicsItem
*>
removedItems
;
case
clearItemsAndAnnotations
:
case
clearItems
:
case
clearAnnotations
:
foreach
(
QGraphicsItem
*
item
,
items
())
{
QList
<
QGraphicsItem
*>
sceneItems
=
items
();
foreach
(
QGraphicsItem
*
item
,
sceneItems
)
{
bool
isGroup
=
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
item
)
!=
NULL
;
bool
isPolygon
=
qgraphicsitem_cast
<
UBGraphicsPolygonItem
*>
(
item
)
!=
NULL
;
bool
isStrokesGroup
=
qgraphicsitem_cast
<
UBGraphicsStrokesGroup
*>
(
item
)
!=
NULL
;
bool
isGroup
=
item
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
;
bool
isStrokesGroup
=
item
->
type
()
==
UBGraphicsStrokesGroup
::
Type
;
if
(
!
isGroup
&&
!
isPolygon
&&
!
isStrokesGroup
&&
!
mTools
.
contains
(
item
)
&&
!
isBackgroundObject
(
item
))
{
removeItem
(
item
);
removedItems
<<
item
;
}
UBGraphicsGroupContainerItem
*
itemGroup
=
item
->
parentItem
()
?
qgraphicsitem_cast
<
UBGraphicsGroupContainerItem
*>
(
item
->
parentItem
())
:
0
;
UBGraphicsItemDelegate
*
curDelegate
=
UBGraphicsItem
::
Delegate
(
item
);
if
(
!
curDelegate
)
{
continue
;
}
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
update
(
sceneRect
());
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
removedItems
,
emptyList
);
UBApplication
::
undoStack
->
push
(
uc
);
bool
shouldDelete
=
false
;
switch
(
static_cast
<
int
>
(
pCase
))
{
case
clearAnnotations
:
shouldDelete
=
isStrokesGroup
;
break
;
case
clearItems
:
shouldDelete
=
!
isGroup
&&
!
isBackgroundObject
(
item
)
&&
!
isStrokesGroup
;
break
;
case
clearItemsAndAnnotations
:
shouldDelete
=
!
isGroup
&&
!
isBackgroundObject
(
item
);
break
;
}
setDocumentUpdated
();
}
void
UBGraphicsScene
::
clearAnnotations
()
{
QSet
<
QGraphicsItem
*>
emptyList
;
QSet
<
QGraphicsItem
*>
removedItems
;
if
(
shouldDelete
)
{
if
(
itemGroup
)
{
itemGroup
->
removeFromGroup
(
item
);
if
(
itemGroup
->
childItems
().
count
()
==
1
)
{
itemGroup
->
destroy
();
}
itemGroup
->
Delegate
()
->
update
();
}
QList
<
QGraphicsItem
*>
sceneItems
=
items
();
foreach
(
QGraphicsItem
*
item
,
sceneItems
)
{
UBGraphicsStrokesGroup
*
pi
=
qgraphicsitem_cast
<
UBGraphicsStrokesGroup
*>
(
item
);
if
(
pi
)
{
removeItem
(
item
);
curDelegate
->
remove
(
false
);
removedItems
<<
item
;
}
}
break
;
}
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2 ?) to trigger repaint
update
(
sceneRect
());
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
removedItems
,
emptyList
);
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
removedItems
,
QSet
<
QGraphicsItem
*>
()
);
UBApplication
::
undoStack
->
push
(
uc
);
}
setDocumentUpdated
();
}
void
UBGraphicsScene
::
clearBackground
()
{
if
(
mBackgroundObject
){
removeItem
(
mBackgroundObject
);
if
(
enableUndoRedoStack
)
{
//should be deleted after scene own undo stack implemented
UBGraphicsItemUndoCommand
*
uc
=
new
UBGraphicsItemUndoCommand
(
this
,
mBackgroundObject
,
NULL
);
UBApplication
::
undoStack
->
push
(
uc
);
}
if
(
pCase
==
clearBackground
)
{
mBackgroundObject
=
0
;
}
update
(
sceneRect
());
setDocumentUpdated
();
}
...
...
@@ -1357,8 +1323,8 @@ UBGraphicsW3CWidgetItem* UBGraphicsScene::addOEmbed(const QUrl& pContentUrl, con
UBGraphicsGroupContainerItem
*
UBGraphicsScene
::
createGroup
(
QList
<
QGraphicsItem
*>
items
)
{
UBGraphicsGroupContainerItem
*
groupItem
=
new
UBGraphicsGroupContainerItem
();
addItem
(
groupItem
);
addItem
(
groupItem
);
foreach
(
QGraphicsItem
*
item
,
items
)
{
if
(
item
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
)
{
QList
<
QGraphicsItem
*>
childItems
=
item
->
childItems
();
...
...
src/domain/UBGraphicsScene.h
View file @
89ca4c40
...
...
@@ -101,6 +101,13 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
public
:
enum
clearCase
{
clearItemsAndAnnotations
=
0
,
clearAnnotations
,
clearItems
,
clearBackground
};
// tmp stub for divide addings scene objects from undo mechanism implementation
void
setURStackEnable
(
bool
set
=
true
)
{
enableUndoRedoStack
=
set
;}
bool
isURStackIsEnabled
(){
return
enableUndoRedoStack
;}
...
...
@@ -114,10 +121,7 @@ class UBGraphicsScene: public UBCoreGraphicsScene, public UBItem
UBGraphicsScene
*
sceneDeepCopy
()
const
;
void
clearItemsAndAnnotations
();
void
clearItems
();
void
clearAnnotations
();
void
clearBackground
();
void
clearContent
(
clearCase
pCase
=
clearItemsAndAnnotations
);
bool
inputDevicePress
(
const
QPointF
&
scenePos
,
const
qreal
&
pressure
=
1
.
0
);
bool
inputDeviceMove
(
const
QPointF
&
scenePos
,
const
qreal
&
pressure
=
1
.
0
);
...
...
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
89ca4c40
...
...
@@ -263,6 +263,11 @@ void UBGraphicsTextItemDelegate::setEditable(bool editable)
mDelegated
->
setData
(
UBGraphicsItemData
::
ItemEditable
,
QVariant
(
false
));
}
}
void
UBGraphicsTextItemDelegate
::
remove
(
bool
canUndo
)
{
UBGraphicsItemDelegate
::
remove
(
canUndo
);
}
bool
UBGraphicsTextItemDelegate
::
isEditable
()
{
return
mDelegated
->
data
(
UBGraphicsItemData
::
ItemEditable
).
toBool
();
...
...
src/domain/UBGraphicsTextItemDelegate.h
View file @
89ca4c40
...
...
@@ -46,6 +46,7 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
public
slots
:
void
contentsChanged
();
virtual
void
setEditable
(
bool
);
virtual
void
remove
(
bool
canUndo
);
protected
:
virtual
void
buildButtons
();
...
...
src/domain/UBItem.cpp
View file @
89ca4c40
...
...
@@ -17,6 +17,15 @@
#include "core/memcheck.h"
#include "domain/UBGraphicsPixmapItem.h"
#include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsSvgItem.h"
#include "domain/UBGraphicsMediaItem.h"
#include "domain/UBGraphicsStrokesGroup.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "domain/UBGraphicsWidgetItem.h"
#include "tools/UBGraphicsCurtainItem.h"
UBItem
::
UBItem
()
:
mUuid
(
QUuid
())
,
mRenderingQuality
(
UBItem
::
RenderingQualityNormal
)
...
...
@@ -44,3 +53,37 @@ bool UBGraphicsItem::isRotatable(QGraphicsItem *item)
{
return
item
->
data
(
UBGraphicsItemData
::
ItemRotatable
).
toBool
();
}
UBGraphicsItemDelegate
*
UBGraphicsItem
::
Delegate
(
QGraphicsItem
*
pItem
)
{
UBGraphicsItemDelegate
*
result
=
0
;
switch
(
static_cast
<
int
>
(
pItem
->
type
()))
{
case
UBGraphicsPixmapItem
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsPixmapItem
*>
(
pItem
))
->
Delegate
();
break
;
case
UBGraphicsTextItem
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsTextItem
*>
(
pItem
))
->
Delegate
();
break
;
case
UBGraphicsSvgItem
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsSvgItem
*>
(
pItem
))
->
Delegate
();
break
;
case
UBGraphicsMediaItem
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsMediaItem
*>
(
pItem
))
->
Delegate
();
break
;
case
UBGraphicsStrokesGroup
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsStrokesGroup
*>
(
pItem
))
->
Delegate
();
break
;
case
UBGraphicsGroupContainerItem
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsGroupContainerItem
*>
(
pItem
))
->
Delegate
();
break
;
case
UBGraphicsWidgetItem
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsWidgetItem
*>
(
pItem
))
->
Delegate
();
break
;
case
UBGraphicsCurtainItem
:
:
Type
:
result
=
(
static_cast
<
UBGraphicsCurtainItem
*>
(
pItem
))
->
Delegate
();
break
;
}
return
result
;
}
src/domain/UBItem.h
View file @
89ca4c40
...
...
@@ -108,6 +108,7 @@ public:
static
bool
isRotatable
(
QGraphicsItem
*
item
);
static
bool
isFlippable
(
QGraphicsItem
*
item
);
static
UBGraphicsItemDelegate
*
Delegate
(
QGraphicsItem
*
pItem
);
virtual
UBGraphicsItemDelegate
*
Delegate
()
const
=
0
;
virtual
void
remove
()
=
0
;
...
...
src/frameworks/UBCoreGraphicsScene.cpp
View file @
89ca4c40
...
...
@@ -73,6 +73,7 @@ void UBCoreGraphicsScene::removeItem(QGraphicsItem* item, bool forceDelete)
QGraphicsScene
::
removeItem
(
item
);
if
(
forceDelete
)
{
qDebug
()
<<
"force delete is "
<<
forceDelete
;
deleteItem
(
item
);
}
setModified
(
true
);
...
...
src/frameworks/UBPlatformUtils.h
View file @
89ca4c40
...
...
@@ -171,6 +171,7 @@ class UBPlatformUtils
static
int
nKeyboardLayouts
;
static
UBKeyboardLocale
**
keyboardLayouts
;
public
:
static
void
init
();
static
void
destroy
();
...
...
@@ -192,6 +193,10 @@ public:
static
UBKeyboardLocale
**
getKeyboardLayouts
(
int
&
nCount
);
static
QString
urlFromClipboard
();
static
QStringList
availableTranslations
();
#ifdef Q_WS_MAC
static
void
SetMacLocaleByIdentifier
(
const
QString
&
id
);
#endif
};
...
...
src/frameworks/UBPlatformUtils_mac.mm
View file @
89ca4c40
...
...
@@ -440,6 +440,9 @@ void UBPlatformUtils::initializeKeyboardLayouts()
int count = CFArrayGetCount(kbds);
QList<UBKeyboardLocale*> result;
qDebug() << "initializeKeyboardLayouts";
qDebug() << "Found system locales: " << count;
for(int i=0; i<count; i++)
{
TISInputSourceRef keyLayoutRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, i);
...
...
@@ -530,6 +533,8 @@ void UBPlatformUtils::initializeKeyboardLayouts()
const QString resName = ":/images/flags/" + name + ".png";
QIcon *iconLang = new QIcon(resName);
qDebug() << "Locale: " << ID << ", name: " << name;
result.append(new UBKeyboardLocale(fullName, name, ID, iconLang, keybt));
}
...
...
@@ -565,3 +570,28 @@ QString UBPlatformUtils::urlFromClipboard()
*/
return qsRet;
}
void UBPlatformUtils::SetMacLocaleByIdentifier(const QString& id)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
const char * strName = id.toAscii().data();
CFStringRef iName = CFStringCreateWithCString(NULL, strName, kCFStringEncodingMacRoman );
CFStringRef keys[] = { kTISPropertyInputSourceCategory, kTISPropertyInputSourceID };
CFStringRef values[] = { kTISCategoryKeyboardInputSource, iName };
CFDictionaryRef dict = CFDictionaryCreate(NULL, (const void **)keys, (const void **)values, 2, NULL, NULL);
CFArrayRef kbds = TISCreateInputSourceList(dict, true);
if (kbds!=NULL)
{
if (CFArrayGetCount(kbds)!=0)
{
TISInputSourceRef klRef = (TISInputSourceRef)CFArrayGetValueAtIndex(kbds, 0);
if (klRef!=NULL)
TISSelectInputSource(klRef);
}
}
[pool drain];
}
src/gui/UBKeyboardPalette.cpp
View file @
89ca4c40
...
...
@@ -60,6 +60,9 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
createCtrlButtons
();
nCurrentLocale
=
UBSettings
::
settings
()
->
KeyboardLocale
->
get
().
toInt
();
if
(
nCurrentLocale
<
0
||
nCurrentLocale
>=
nLocalesCount
)
nCurrentLocale
=
0
;
if
(
locales
!=
NULL
)
setInput
(
locales
[
nCurrentLocale
]);
setContentsMargins
(
22
,
22
,
22
,
22
);
...
...
src/gui/UBKeyboardPalette_mac.cpp
View file @
89ca4c40
...
...
@@ -57,22 +57,6 @@ void UBKeyboardPalette::createCtrlButtons()
ctrlButtons
[
8
]
=
new
UBLocaleButton
(
this
);
}
void
SetMacLocaleByIdentifier
(
const
QString
&
id
)
{
const
char
*
strName
=
id
.
toAscii
().
data
();
CFStringRef
iName
=
CFStringCreateWithCString
(
NULL
,
strName
,
kCFStringEncodingMacRoman
);
CFStringRef
keys
[]
=
{
kTISPropertyInputSourceCategory
,
kTISPropertyInputSourceID
};
CFStringRef
values
[]
=
{
kTISCategoryKeyboardInputSource
,
iName
};
CFDictionaryRef
dict
=
CFDictionaryCreate
(
NULL
,
(
const
void
**
)
keys
,
(
const
void
**
)
values
,
2
,
NULL
,
NULL
);
CFArrayRef
kbds
=
TISCreateInputSourceList
(
dict
,
true
);
if
(
CFArrayGetCount
(
kbds
)
!=
0
)
{
TISInputSourceRef
klRef
=
(
TISInputSourceRef
)
CFArrayGetValueAtIndex
(
kbds
,
0
);
if
(
klRef
!=
NULL
)
TISSelectInputSource
(
klRef
);
}
}
void
UBKeyboardPalette
::
checkLayout
()
...
...
@@ -107,6 +91,6 @@ void UBKeyboardPalette::onActivated(bool)
void
UBKeyboardPalette
::
onLocaleChanged
(
UBKeyboardLocale
*
locale
)
{
SetMacLocaleByIdentifier
(
locale
->
id
);
UBPlatformUtils
::
SetMacLocaleByIdentifier
(
locale
->
id
);
}
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