Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
a728270f
G
Graphic Ui
项目概览
OpenHarmony
/
Graphic Ui
大约 1 年 前同步成功
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Graphic Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a728270f
编写于
5月 13, 2021
作者:
O
openharmony_ci
提交者:
Gitee
5月 13, 2021
浏览文件
操作
浏览文件
下载
差异文件
!146 【图形】单例整改
Merge pull request !146 from 邓志豪/weekly_20210510
上级
1eeeac68
abc3617c
变更
57
显示空白变更内容
内联
并排
Showing
57 changed file
with
267 addition
and
151 deletion
+267
-151
BUILD.gn
BUILD.gn
+3
-0
frameworks/animator/animator_manager.cpp
frameworks/animator/animator_manager.cpp
+6
-0
frameworks/animator/animator_manager.h
frameworks/animator/animator_manager.h
+1
-5
frameworks/common/image_decode_ability.cpp
frameworks/common/image_decode_ability.cpp
+24
-0
frameworks/common/input_device_manager.cpp
frameworks/common/input_device_manager.cpp
+6
-0
frameworks/common/screen.cpp
frameworks/common/screen.cpp
+6
-0
frameworks/components/root_view.cpp
frameworks/components/root_view.cpp
+6
-0
frameworks/core/render_manager.cpp
frameworks/core/render_manager.cpp
+6
-0
frameworks/core/render_manager.h
frameworks/core/render_manager.h
+1
-5
frameworks/core/task_manager.cpp
frameworks/core/task_manager.cpp
+5
-0
frameworks/dfx/event_injector.cpp
frameworks/dfx/event_injector.cpp
+6
-0
frameworks/dfx/performance_task.cpp
frameworks/dfx/performance_task.cpp
+25
-0
frameworks/dfx/performance_task.h
frameworks/dfx/performance_task.h
+1
-5
frameworks/dfx/ui_dump_dom_tree.cpp
frameworks/dfx/ui_dump_dom_tree.cpp
+6
-0
frameworks/dfx/ui_screenshot.cpp
frameworks/dfx/ui_screenshot.cpp
+6
-0
frameworks/dock/focus_manager.cpp
frameworks/dock/focus_manager.cpp
+6
-0
frameworks/dock/screen_device_proxy.cpp
frameworks/dock/screen_device_proxy.cpp
+6
-0
frameworks/dock/screen_device_proxy.h
frameworks/dock/screen_device_proxy.h
+1
-5
frameworks/dock/vibrator_manager.cpp
frameworks/dock/vibrator_manager.cpp
+26
-0
frameworks/draw/draw_arc.cpp
frameworks/draw/draw_arc.cpp
+5
-0
frameworks/draw/draw_arc.h
frameworks/draw/draw_arc.h
+1
-5
frameworks/draw/draw_utils.cpp
frameworks/draw/draw_utils.cpp
+6
-0
frameworks/draw/draw_utils.h
frameworks/draw/draw_utils.h
+1
-5
frameworks/font/ui_line_break.cpp
frameworks/font/ui_line_break.cpp
+6
-1
frameworks/font/ui_line_break.h
frameworks/font/ui_line_break.h
+1
-8
frameworks/font/ui_multi_font_manager.cpp
frameworks/font/ui_multi_font_manager.cpp
+6
-0
frameworks/font/ui_multi_font_manager.h
frameworks/font/ui_multi_font_manager.h
+1
-6
frameworks/font/ui_text_shaping.cpp
frameworks/font/ui_text_shaping.cpp
+6
-0
frameworks/font/ui_text_shaping.h
frameworks/font/ui_text_shaping.h
+1
-5
frameworks/imgdecode/cache_manager.cpp
frameworks/imgdecode/cache_manager.cpp
+6
-0
frameworks/imgdecode/cache_manager.h
frameworks/imgdecode/cache_manager.h
+1
-5
frameworks/imgdecode/file_img_decoder.cpp
frameworks/imgdecode/file_img_decoder.cpp
+6
-0
frameworks/imgdecode/file_img_decoder.h
frameworks/imgdecode/file_img_decoder.h
+1
-5
frameworks/themes/theme_manager.cpp
frameworks/themes/theme_manager.cpp
+6
-0
interfaces/innerkits/common/image_decode_ability.h
interfaces/innerkits/common/image_decode_ability.h
+1
-5
interfaces/innerkits/common/input_device_manager.h
interfaces/innerkits/common/input_device_manager.h
+1
-5
interfaces/innerkits/common/task_manager.h
interfaces/innerkits/common/task_manager.h
+1
-5
interfaces/innerkits/dock/focus_manager.h
interfaces/innerkits/dock/focus_manager.h
+1
-5
interfaces/innerkits/dock/vibrator_manager.h
interfaces/innerkits/dock/vibrator_manager.h
+1
-5
interfaces/kits/common/screen.h
interfaces/kits/common/screen.h
+1
-5
interfaces/kits/components/root_view.h
interfaces/kits/components/root_view.h
+1
-5
interfaces/kits/dfx/event_injector.h
interfaces/kits/dfx/event_injector.h
+1
-5
interfaces/kits/dfx/ui_dump_dom_tree.h
interfaces/kits/dfx/ui_dump_dom_tree.h
+1
-5
interfaces/kits/dfx/ui_screenshot.h
interfaces/kits/dfx/ui_screenshot.h
+1
-5
interfaces/kits/themes/theme_manager.h
interfaces/kits/themes/theme_manager.h
+1
-5
test/framework/include/ui_test_app.h
test/framework/include/ui_test_app.h
+2
-10
test/framework/src/ui_test_app.cpp
test/framework/src/ui_test_app.cpp
+12
-0
tools/qt/simulator/drivers/display/monitor.cpp
tools/qt/simulator/drivers/display/monitor.cpp
+11
-1
tools/qt/simulator/drivers/display/monitor.h
tools/qt/simulator/drivers/display/monitor.h
+1
-10
tools/qt/simulator/drivers/indev/key_input.cpp
tools/qt/simulator/drivers/indev/key_input.cpp
+6
-0
tools/qt/simulator/drivers/indev/key_input.h
tools/qt/simulator/drivers/indev/key_input.h
+1
-5
tools/qt/simulator/drivers/indev/mouse_input.cpp
tools/qt/simulator/drivers/indev/mouse_input.cpp
+6
-0
tools/qt/simulator/drivers/indev/mouse_input.h
tools/qt/simulator/drivers/indev/mouse_input.h
+1
-5
tools/qt/simulator/drivers/indev/mousewheel_input.cpp
tools/qt/simulator/drivers/indev/mousewheel_input.cpp
+6
-0
tools/qt/simulator/drivers/indev/mousewheel_input.h
tools/qt/simulator/drivers/indev/mousewheel_input.h
+1
-5
tools/qt/simulator/uitest/UITest.pro
tools/qt/simulator/uitest/UITest.pro
+5
-0
ui.gni
ui.gni
+3
-0
未找到文件。
BUILD.gn
浏览文件 @
a728270f
...
...
@@ -62,6 +62,7 @@ shared_library("ui") {
"frameworks/animator/easing_equation.cpp",
"frameworks/animator/interpolation.cpp",
"frameworks/common/graphic_startup.cpp",
"frameworks/common/image_decode_ability.cpp",
"frameworks/common/image.cpp",
"frameworks/common/input_device_manager.cpp",
"frameworks/common/screen.cpp",
...
...
@@ -108,6 +109,7 @@ shared_library("ui") {
"frameworks/default_resource/check_box_res.cpp",
"frameworks/dfx/event_injector.cpp",
"frameworks/dfx/key_event_injector.cpp",
"frameworks/dfx/performance_task.cpp",
"frameworks/dfx/point_event_injector.cpp",
"frameworks/dfx/ui_dump_dom_tree.cpp",
"frameworks/dfx/ui_screenshot.cpp",
...
...
@@ -118,6 +120,7 @@ shared_library("ui") {
"frameworks/dock/pointer_input_device.cpp",
"frameworks/dock/rotate_input_device.cpp",
"frameworks/dock/screen_device_proxy.cpp",
"frameworks/dock/vibrator_manager.cpp",
"frameworks/dock/virtual_input_device.cpp",
"frameworks/draw/draw_arc.cpp",
"frameworks/draw/draw_curve.cpp",
...
...
frameworks/animator/animator_manager.cpp
浏览文件 @
a728270f
...
...
@@ -19,6 +19,12 @@
#include "hal_tick.h"
namespace
OHOS
{
AnimatorManager
*
AnimatorManager
::
GetInstance
()
{
static
AnimatorManager
animatorManager
;
return
&
animatorManager
;
}
void
AnimatorManager
::
Init
()
{
Task
::
Init
();
...
...
frameworks/animator/animator_manager.h
浏览文件 @
a728270f
...
...
@@ -58,11 +58,7 @@ public:
* @since 1.0
* @version 1.0
*/
static
AnimatorManager
*
GetInstance
()
{
static
AnimatorManager
animatorManager
;
return
&
animatorManager
;
}
static
AnimatorManager
*
GetInstance
();
void
Init
()
override
;
...
...
frameworks/common/image_decode_ability.cpp
0 → 100644
浏览文件 @
a728270f
/*
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "common/image_decode_ability.h"
namespace
OHOS
{
ImageDecodeAbility
&
ImageDecodeAbility
::
GetInstance
()
{
static
ImageDecodeAbility
instance
;
return
instance
;
}
}
// namespace OHOS
\ No newline at end of file
frameworks/common/input_device_manager.cpp
浏览文件 @
a728270f
...
...
@@ -18,6 +18,12 @@
#include "gfx_utils/graphic_log.h"
namespace
OHOS
{
InputDeviceManager
*
InputDeviceManager
::
GetInstance
()
{
static
InputDeviceManager
instance
;
return
&
instance
;
}
void
InputDeviceManager
::
Init
()
{
if
(
INDEV_READ_PERIOD
>
0
)
{
...
...
frameworks/common/screen.cpp
浏览文件 @
a728270f
...
...
@@ -21,6 +21,12 @@
#include "securec.h"
namespace
OHOS
{
Screen
&
Screen
::
GetInstance
()
{
static
Screen
instance
;
return
instance
;
}
uint16_t
Screen
::
GetWidth
()
{
return
BaseGfxEngine
::
GetInstance
()
->
GetScreenWidth
();
...
...
frameworks/components/root_view.cpp
浏览文件 @
a728270f
...
...
@@ -43,6 +43,12 @@ RootView::RootView()
InitDrawContext
();
}
RootView
*
RootView
::
GetInstance
()
{
static
RootView
instance
;
return
&
instance
;
}
RootView
::~
RootView
()
{
DestroyDrawContext
();
...
...
frameworks/core/render_manager.cpp
浏览文件 @
a728270f
...
...
@@ -28,6 +28,12 @@ RenderManager::RenderManager() : fps_(0.f), needResetFPS_(true), onFPSChangedLis
RenderManager
::~
RenderManager
()
{}
RenderManager
&
RenderManager
::
GetInstance
()
{
static
RenderManager
instance
;
return
instance
;
}
void
RenderManager
::
Init
()
{
Task
::
Init
();
...
...
frameworks/core/render_manager.h
浏览文件 @
a728270f
...
...
@@ -35,11 +35,7 @@ static constexpr uint16_t MILLISECONDS_PER_SECOND = 1000;
class
RenderManager
:
public
Task
{
public:
static
RenderManager
&
GetInstance
()
{
static
RenderManager
instance
;
return
instance
;
}
static
RenderManager
&
GetInstance
();
void
Init
()
override
;
...
...
frameworks/core/task_manager.cpp
浏览文件 @
a728270f
...
...
@@ -19,6 +19,11 @@
#include "hal_tick.h"
namespace
OHOS
{
TaskManager
*
TaskManager
::
GetInstance
()
{
static
TaskManager
taskManager
;
return
&
taskManager
;
}
void
TaskManager
::
Add
(
Task
*
task
)
{
if
(
task
==
nullptr
)
{
...
...
frameworks/dfx/event_injector.cpp
浏览文件 @
a728270f
...
...
@@ -35,6 +35,12 @@ EventInjector::~EventInjector()
}
}
EventInjector
*
EventInjector
::
GetInstance
()
{
static
EventInjector
instance
;
return
&
instance
;
}
bool
EventInjector
::
RegisterEventInjector
(
EventDataType
type
)
{
switch
(
type
)
{
...
...
frameworks/dfx/performance_task.cpp
0 → 100644
浏览文件 @
a728270f
/*
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "dfx/performance_task.h"
#if ENABLE_DEBUG && ENABLE_DEBUG_PERFORMANCE_TRACE
namespace
OHOS
{
PerformanceTask
*
PerformanceTask
::
GetInstance
()
{
static
PerformanceTask
instance
;
return
&
instance
;
}
}
#endif
frameworks/dfx/performance_task.h
浏览文件 @
a728270f
...
...
@@ -24,11 +24,7 @@
namespace
OHOS
{
class
PerformanceTask
:
public
Task
{
public:
static
PerformanceTask
*
GetInstance
()
{
static
PerformanceTask
instance
;
return
&
instance
;
}
static
PerformanceTask
*
GetInstance
();
void
Init
()
override
{
...
...
frameworks/dfx/ui_dump_dom_tree.cpp
浏览文件 @
a728270f
...
...
@@ -36,6 +36,12 @@
#endif // ENABLE_DEBUG
namespace
OHOS
{
#if ENABLE_DEBUG
UIDumpDomTree
*
UIDumpDomTree
::
GetInstance
()
{
static
UIDumpDomTree
instance
;
return
&
instance
;
}
void
UIDumpDomTree
::
AddNameField
(
UIViewType
type
,
cJSON
*
usr
)
const
{
if
(
usr
==
nullptr
)
{
...
...
frameworks/dfx/ui_screenshot.cpp
浏览文件 @
a728270f
...
...
@@ -135,6 +135,12 @@ UIScreenshot::~UIScreenshot()
}
}
UIScreenshot
*
UIScreenshot
::
GetInstance
()
{
static
UIScreenshot
instance
;
return
&
instance
;
}
bool
UIScreenshot
::
ScreenshotToFile
(
const
char
*
path
)
{
if
(
screenshotListener_
==
nullptr
)
{
...
...
frameworks/dock/focus_manager.cpp
浏览文件 @
a728270f
...
...
@@ -19,6 +19,12 @@
#include "gfx_utils/graphic_math.h"
namespace
OHOS
{
FocusManager
*
FocusManager
::
GetInstance
()
{
static
FocusManager
instance
;
return
&
instance
;
}
bool
FocusManager
::
RequestFocus
(
UIView
*
view
)
{
if
(
view
==
nullptr
||
view
==
focusView_
||
!
view
->
IsFocusable
()
||
...
...
frameworks/dock/screen_device_proxy.cpp
浏览文件 @
a728270f
...
...
@@ -19,6 +19,12 @@
#include "securec.h"
namespace
OHOS
{
ScreenDeviceProxy
*
ScreenDeviceProxy
::
GetInstance
()
{
static
ScreenDeviceProxy
instance
;
return
&
instance
;
}
void
ScreenDeviceProxy
::
Flush
()
{}
void
ScreenDeviceProxy
::
OnFlushReady
()
...
...
frameworks/dock/screen_device_proxy.h
浏览文件 @
a728270f
...
...
@@ -31,11 +31,7 @@ namespace OHOS {
/** @brief A display device proxy */
class
ScreenDeviceProxy
:
public
HeapBase
{
public:
static
ScreenDeviceProxy
*
GetInstance
()
{
static
ScreenDeviceProxy
instance
;
return
&
instance
;
}
static
ScreenDeviceProxy
*
GetInstance
();
void
SetDevice
(
ScreenDevice
*
device
)
{
...
...
frameworks/dock/vibrator_manager.cpp
0 → 100644
浏览文件 @
a728270f
/*
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "dock/vibrator_manager.h"
#if ENABLE_VIBRATOR
namespace
OHOS
{
VibratorManager
*
VibratorManager
::
GetInstance
()
{
static
VibratorManager
instance
;
return
&
instance
;
}
}
// namespace OHOS
#endif
frameworks/draw/draw_arc.cpp
浏览文件 @
a728270f
...
...
@@ -19,6 +19,11 @@
namespace
OHOS
{
#define IS_IN_DEGREERANE(d, s, e) ((s) <= (e)) ? (((d) >= (s)) && ((d) <= (e))) : (((d) >= (s)) || ((d) <= (e)))
DrawArc
*
DrawArc
::
GetInstance
()
{
static
DrawArc
drawArc
;
return
&
drawArc
;
}
void
DrawArc
::
DrawImg
(
BufferInfo
&
gfxDstBuffer
,
const
Point
&
imgPos
,
...
...
frameworks/draw/draw_arc.h
浏览文件 @
a728270f
...
...
@@ -26,11 +26,7 @@
namespace
OHOS
{
class
DrawArc
:
public
HeapBase
{
public:
static
DrawArc
*
GetInstance
()
{
static
DrawArc
drawArc
;
return
&
drawArc
;
}
static
DrawArc
*
GetInstance
();
void
GetDrawRange
(
int16_t
&
start
,
int16_t
&
end
);
...
...
frameworks/draw/draw_utils.cpp
浏览文件 @
a728270f
...
...
@@ -165,6 +165,12 @@ TriangleEdge::TriangleEdge(int16_t x1, int16_t y1, int16_t x2, int16_t y2)
TriangleEdge
::~
TriangleEdge
()
{}
DrawUtils
*
DrawUtils
::
GetInstance
()
{
static
DrawUtils
instance
;
return
&
instance
;
}
void
DrawUtils
::
DrawColorAreaBySides
(
BufferInfo
&
gfxDstBuffer
,
const
Rect
&
mask
,
const
ColorType
&
color
,
...
...
frameworks/draw/draw_utils.h
浏览文件 @
a728270f
...
...
@@ -161,11 +161,7 @@ enum {
class
DrawUtils
:
public
HeapBase
{
public:
static
DrawUtils
*
GetInstance
()
{
static
DrawUtils
instance
;
return
&
instance
;
}
static
DrawUtils
*
GetInstance
();
void
DrawColorArea
(
BufferInfo
&
gfxDstBuffer
,
const
Rect
&
area
,
const
Rect
&
mask
,
const
ColorType
&
color
,
OpacityType
opa
)
const
;
...
...
frameworks/font/ui_line_break.cpp
浏览文件 @
a728270f
...
...
@@ -22,7 +22,6 @@
using
namespace
U_ICU_NAMESPACE
;
namespace
OHOS
{
UILineBreakEngine
*
UILineBreakEngine
::
instance_
=
nullptr
;
static
void
*
MemAlloc
(
const
void
*
context
,
size_t
size
)
{
return
UIMalloc
(
size
);
...
...
@@ -41,6 +40,12 @@ static void* MemRealloc(const void* context, void* mem, size_t size)
return
UIRealloc
(
mem
,
size
);
}
UILineBreakEngine
&
UILineBreakEngine
::
GetInstance
()
{
static
UILineBreakEngine
instance
;
return
instance
;
}
uint16_t
UILineBreakEngine
::
GetNextBreakPos
(
UILineBreakProxy
&
record
)
{
const
UChar
*
str
=
reinterpret_cast
<
const
UChar
*>
(
record
.
GetStr
());
...
...
frameworks/font/ui_line_break.h
浏览文件 @
a728270f
...
...
@@ -40,13 +40,7 @@ public:
* @since 3.0
* @version 5.0
*/
static
UILineBreakEngine
&
GetInstance
()
{
if
(
instance_
==
nullptr
)
{
instance_
=
new
UILineBreakEngine
();
}
return
*
instance_
;
}
static
UILineBreakEngine
&
GetInstance
();
/**
* @brief 初始化换行引擎,加载换行规则文件
...
...
@@ -142,7 +136,6 @@ private:
void
LoadRule
();
static
constexpr
const
int32_t
LINE_BREAK_STATE_START
=
1
;
static
constexpr
const
int32_t
LINE_BREAK_STATE_STOP
=
0
;
static
UILineBreakEngine
*
instance_
;
bool
initSuccess_
;
char
*
addr_
;
int32_t
size_
;
...
...
frameworks/font/ui_multi_font_manager.cpp
浏览文件 @
a728270f
...
...
@@ -119,6 +119,12 @@ void UIMultiFontManager::UpdateScript(UITextLanguageFontParam& fonts)
}
}
UIMultiFontManager
*
UIMultiFontManager
::
GetInstance
()
{
static
UIMultiFontManager
instance
;
return
&
instance
;
}
void
UIMultiFontManager
::
ClearSearchFontList
()
{
uint8_t
totalFontId
=
UIFontBuilder
::
GetInstance
()
->
GetTotalFontId
();
...
...
frameworks/font/ui_multi_font_manager.h
浏览文件 @
a728270f
...
...
@@ -32,12 +32,7 @@ public:
*
* @return UIMultiFontManager*
*/
static
UIMultiFontManager
*
GetInstance
()
{
static
UIMultiFontManager
instance
;
return
&
instance
;
}
static
UIMultiFontManager
*
GetInstance
();
void
ClearSearchFontList
();
int8_t
SetSearchFontList
(
uint8_t
fontListId
,
uint8_t
*
fontIds
,
uint8_t
size
);
int8_t
GetSearchFontList
(
uint8_t
fontListId
,
uint8_t
**
fontIds
);
...
...
frameworks/font/ui_text_shaping.cpp
浏览文件 @
a728270f
...
...
@@ -17,6 +17,12 @@
#include "font/ui_text_shaping.h"
namespace
OHOS
{
UITextShaping
*
UITextShaping
::
GetInstance
()
{
static
UITextShaping
instance
;
return
&
instance
;
}
bool
UITextShaping
::
IsSameTTFId
(
uint8_t
fontId
,
uint32_t
unicode
)
{
// Need to be implemented
...
...
frameworks/font/ui_text_shaping.h
浏览文件 @
a728270f
...
...
@@ -48,11 +48,7 @@ public:
* @brief Get the Instance object
* @return UITextShaping* the static instance
*/
static
UITextShaping
*
GetInstance
()
{
static
UITextShaping
instance
;
return
&
instance
;
}
static
UITextShaping
*
GetInstance
();
static
bool
IsSameTTFId
(
uint8_t
fontId
,
uint32_t
unicode
);
};
// class UITextShaping
...
...
frameworks/imgdecode/cache_manager.cpp
浏览文件 @
a728270f
...
...
@@ -83,6 +83,12 @@ RetCode CacheEntry::SetSrc(const char* path)
return
RetCode
::
OK
;
}
CacheManager
&
CacheManager
::
GetInstance
()
{
static
CacheManager
instance
;
return
instance
;
}
RetCode
CacheManager
::
Init
(
uint16_t
size
)
{
if
((
size
==
0
)
||
(
size
>
MAX_CACHE_ENTRY_NUM
))
{
...
...
frameworks/imgdecode/cache_manager.h
浏览文件 @
a728270f
...
...
@@ -64,11 +64,7 @@ private:
class
CacheManager
:
public
HeapBase
{
public:
static
CacheManager
&
GetInstance
()
{
static
CacheManager
instance
;
return
instance
;
}
static
CacheManager
&
GetInstance
();
RetCode
Init
(
uint16_t
size
);
...
...
frameworks/imgdecode/file_img_decoder.cpp
浏览文件 @
a728270f
...
...
@@ -19,6 +19,12 @@
#include "imgdecode/image_load.h"
namespace
OHOS
{
FileImgDecoder
&
FileImgDecoder
::
GetInstance
()
{
static
FileImgDecoder
instance
;
return
instance
;
}
RetCode
FileImgDecoder
::
Open
(
ImgResDsc
&
dsc
)
{
#ifdef _WIN32
...
...
frameworks/imgdecode/file_img_decoder.h
浏览文件 @
a728270f
...
...
@@ -33,11 +33,7 @@ enum class RetCode {
class
FileImgDecoder
:
public
HeapBase
{
public:
static
FileImgDecoder
&
GetInstance
()
{
static
FileImgDecoder
instance
;
return
instance
;
}
static
FileImgDecoder
&
GetInstance
();
struct
ImgResDsc
{
FileImgDecoder
*
decoder
;
...
...
frameworks/themes/theme_manager.cpp
浏览文件 @
a728270f
...
...
@@ -16,6 +16,12 @@
#include "themes/theme_manager.h"
namespace
OHOS
{
ThemeManager
&
ThemeManager
::
GetInstance
()
{
static
ThemeManager
instance
;
return
instance
;
}
void
ThemeManager
::
SetCurrent
(
Theme
*
theme
)
{
if
(
theme_
!=
nullptr
)
{
...
...
interfaces/innerkits/common/image_decode_ability.h
浏览文件 @
a728270f
...
...
@@ -26,11 +26,7 @@ enum {
};
class
ImageDecodeAbility
:
public
HeapBase
{
public:
static
ImageDecodeAbility
&
GetInstance
()
{
static
ImageDecodeAbility
instance
;
return
instance
;
}
static
ImageDecodeAbility
&
GetInstance
();
void
SetImageDecodeAbility
(
uint32_t
imageType
)
{
...
...
interfaces/innerkits/common/input_device_manager.h
浏览文件 @
a728270f
...
...
@@ -30,11 +30,7 @@ public:
* @brief Get instance of InputDeviceManager.
* @returns Instance of InputDeviceManager
*/
static
InputDeviceManager
*
GetInstance
()
{
static
InputDeviceManager
instance
;
return
&
instance
;
}
static
InputDeviceManager
*
GetInstance
();
void
Init
()
override
;
...
...
interfaces/innerkits/common/task_manager.h
浏览文件 @
a728270f
...
...
@@ -28,11 +28,7 @@ public:
* @brief return TaskManager's singleton
* @return TaskManager*
*/
static
TaskManager
*
GetInstance
()
{
static
TaskManager
taskManager
;
return
&
taskManager
;
}
static
TaskManager
*
GetInstance
();
/**
* @brief add task to task manager
...
...
interfaces/innerkits/dock/focus_manager.h
浏览文件 @
a728270f
...
...
@@ -42,11 +42,7 @@ public:
* @since 5.0
* @version 3.0
*/
static
FocusManager
*
GetInstance
()
{
static
FocusManager
instance
;
return
&
instance
;
}
static
FocusManager
*
GetInstance
();
/**
* @brief Clear the focus.
...
...
interfaces/innerkits/dock/vibrator_manager.h
浏览文件 @
a728270f
...
...
@@ -47,11 +47,7 @@ public:
* @since 5.0
* @version 3.0
*/
static
VibratorManager
*
GetInstance
()
{
static
VibratorManager
instance
;
return
&
instance
;
}
static
VibratorManager
*
GetInstance
();
void
RegisterVibratorFunc
(
VibratorFunc
vibratorFunc
)
{
...
...
interfaces/kits/common/screen.h
浏览文件 @
a728270f
...
...
@@ -51,11 +51,7 @@ public:
* @brief Obtains a singleton <b>Screen</b> instance.
* @return Returns the <b>Screen</b> instance.
*/
static
Screen
&
GetInstance
()
{
static
Screen
instance
;
return
instance
;
}
static
Screen
&
GetInstance
();
/**
* @brief Obtains the width of this screen.
...
...
interfaces/kits/components/root_view.h
浏览文件 @
a728270f
...
...
@@ -74,11 +74,7 @@ public:
* @since 1.0
* @version 1.0
*/
static
RootView
*
GetInstance
()
{
static
RootView
instance
;
return
&
instance
;
}
static
RootView
*
GetInstance
();
#if ENABLE_WINDOW
/**
...
...
interfaces/kits/dfx/event_injector.h
浏览文件 @
a728270f
...
...
@@ -70,11 +70,7 @@ public:
* @since 1.0
* @version 1.0
*/
static
EventInjector
*
GetInstance
()
{
static
EventInjector
instance
;
return
&
instance
;
}
static
EventInjector
*
GetInstance
();
/**
* @brief Registers an event injector of a specified type.
...
...
interfaces/kits/dfx/ui_dump_dom_tree.h
浏览文件 @
a728270f
...
...
@@ -70,11 +70,7 @@ public:
* @since 1.0
* @version 1.0
*/
static
UIDumpDomTree
*
GetInstance
()
{
static
UIDumpDomTree
instance
;
return
&
instance
;
}
static
UIDumpDomTree
*
GetInstance
();
/**
* @brief Exports information about a DOM tree starting from a specified DOM node and saves the information to
...
...
interfaces/kits/dfx/ui_screenshot.h
浏览文件 @
a728270f
...
...
@@ -64,11 +64,7 @@ public:
* @since 1.0
* @version 1.0
*/
static
UIScreenshot
*
GetInstance
()
{
static
UIScreenshot
instance
;
return
&
instance
;
}
static
UIScreenshot
*
GetInstance
();
/**
* @brief Takes a screenshot and saves it to a file.
...
...
interfaces/kits/themes/theme_manager.h
浏览文件 @
a728270f
...
...
@@ -51,11 +51,7 @@ public:
*
* @return Returns the singleton instance of the <b>ThemeManager</b> class.
*/
static
ThemeManager
&
GetInstance
()
{
static
ThemeManager
instance
;
return
instance
;
}
static
ThemeManager
&
GetInstance
();
/**
* @brief Sets the current screen theme for this application.
...
...
test/framework/include/ui_test_app.h
浏览文件 @
a728270f
...
...
@@ -29,11 +29,7 @@ namespace {
}
class
UITestApp
{
public:
static
UITestApp
*
GetInstance
()
{
static
UITestApp
instance
;
return
&
instance
;
}
static
UITestApp
*
GetInstance
();
void
Start
();
void
Init
();
...
...
@@ -56,11 +52,7 @@ private:
class
UIAutoTestApp
{
public:
static
UIAutoTestApp
*
GetInstance
()
{
static
UIAutoTestApp
instance
;
return
&
instance
;
}
static
UIAutoTestApp
*
GetInstance
();
void
Start
();
private:
UIAutoTestApp
()
{}
...
...
test/framework/src/ui_test_app.cpp
浏览文件 @
a728270f
...
...
@@ -27,6 +27,12 @@
#endif
namespace
OHOS
{
UITestApp
*
UITestApp
::
GetInstance
()
{
static
UITestApp
instance
;
return
&
instance
;
}
void
UITestApp
::
Start
()
{
if
(
rootView_
==
nullptr
)
{
...
...
@@ -107,6 +113,12 @@ UITestApp::~UITestApp()
}
}
UIAutoTestApp
*
UIAutoTestApp
::
GetInstance
()
{
static
UIAutoTestApp
instance
;
return
&
instance
;
}
void
UIAutoTestApp
::
Start
()
{
EventInjector
::
GetInstance
()
->
RegisterEventInjector
(
EventDataType
::
POINT_TYPE
);
...
...
tools/qt/simulator/drivers/display/monitor.cpp
浏览文件 @
a728270f
/*
/*
* Copyright (c) 2020-2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -35,6 +35,16 @@
namespace
OHOS
{
bool
Monitor
::
isRegister_
=
false
;
Monitor
*
Monitor
::
GetInstance
()
{
static
Monitor
instance
;
if
(
!
isRegister_
)
{
BaseGfxEngine
::
InitGfxEngine
(
&
instance
);
isRegister_
=
true
;
}
return
&
instance
;
}
void
Monitor
::
InitHal
()
{
#if USE_MOUSE
...
...
tools/qt/simulator/drivers/display/monitor.h
浏览文件 @
a728270f
...
...
@@ -26,16 +26,7 @@ class Monitor : public QObject, public BaseGfxEngine {
public:
Monitor
()
:
defaultColor_
(
0x44
)
{}
virtual
~
Monitor
()
{}
static
Monitor
*
GetInstance
()
{
static
Monitor
instance
;
if
(
!
isRegister_
)
{
BaseGfxEngine
::
InitGfxEngine
(
&
instance
);
isRegister_
=
true
;
}
return
&
instance
;
}
static
Monitor
*
GetInstance
();
void
InitHal
();
void
InitFontEngine
();
void
InitImageDecodeAbility
();
...
...
tools/qt/simulator/drivers/indev/key_input.cpp
浏览文件 @
a728270f
...
...
@@ -27,6 +27,12 @@ static uint16_t g_lastKeyId = 0;
static
uint16_t
g_lastKeyState
=
INVALID_KEY_STATE
;
}
// namespace
KeyInput
*
KeyInput
::
GetInstance
()
{
static
KeyInput
keyInput
;
return
&
keyInput
;
}
bool
KeyInput
::
Read
(
DeviceData
&
data
)
{
data
.
keyId
=
g_lastKeyId
;
...
...
tools/qt/simulator/drivers/indev/key_input.h
浏览文件 @
a728270f
...
...
@@ -27,11 +27,7 @@ class KeyInput : public KeyInputDevice {
public:
KeyInput
()
{}
virtual
~
KeyInput
()
{}
static
KeyInput
*
GetInstance
()
{
static
KeyInput
keyInput
;
return
&
keyInput
;
}
static
KeyInput
*
GetInstance
();
bool
Read
(
DeviceData
&
data
)
override
;
void
KeyHandler
(
QKeyEvent
*
event
);
...
...
tools/qt/simulator/drivers/indev/mouse_input.cpp
浏览文件 @
a728270f
...
...
@@ -19,6 +19,12 @@
namespace
OHOS
{
#if USE_MOUSE
MouseInput
*
MouseInput
::
GetInstance
()
{
static
MouseInput
mouseInput
;
return
&
mouseInput
;
}
bool
MouseInput
::
Read
(
DeviceData
&
data
)
{
data
.
point
.
x
=
lastX_
;
...
...
tools/qt/simulator/drivers/indev/mouse_input.h
浏览文件 @
a728270f
...
...
@@ -27,11 +27,7 @@ class MouseInput : public PointerInputDevice {
public:
MouseInput
()
:
leftButtonDown_
(
false
),
lastX_
(
0
),
lastY_
(
0
)
{}
virtual
~
MouseInput
()
{}
static
MouseInput
*
GetInstance
()
{
static
MouseInput
mouseInput
;
return
&
mouseInput
;
}
static
MouseInput
*
GetInstance
();
bool
Read
(
DeviceData
&
data
)
override
;
void
MouseHandler
(
QMouseEvent
*
event
);
...
...
tools/qt/simulator/drivers/indev/mousewheel_input.cpp
浏览文件 @
a728270f
...
...
@@ -22,6 +22,12 @@ static int16_t g_rotate = 0;
namespace
OHOS
{
#if USE_MOUSEWHEEL
#if ENABLE_ROTATE_INPUT
MousewheelInput
*
MousewheelInput
::
GetInstance
()
{
static
MousewheelInput
mousewheelInput
;
return
&
mousewheelInput
;
}
bool
MousewheelInput
::
Read
(
DeviceData
&
data
)
{
data
.
rotate
=
g_rotate
;
...
...
tools/qt/simulator/drivers/indev/mousewheel_input.h
浏览文件 @
a728270f
...
...
@@ -26,11 +26,7 @@ class MousewheelInput : public RotateInputDevice {
public:
MousewheelInput
()
{}
virtual
~
MousewheelInput
()
{}
static
MousewheelInput
*
GetInstance
()
{
static
MousewheelInput
mousewheelInput
;
return
&
mousewheelInput
;
}
static
MousewheelInput
*
GetInstance
();
bool
Read
(
DeviceData
&
data
)
override
;
void
MousewheelHandler
(
QWheelEvent
*
event
);
};
...
...
tools/qt/simulator/uitest/UITest.pro
浏览文件 @
a728270f
...
...
@@ -36,6 +36,7 @@ SOURCES += \
..
/../../../
frameworks
/
animator
/
easing_equation
.
cpp
\
..
/../../../
frameworks
/
animator
/
interpolation
.
cpp
\
..
/../../../
frameworks
/
common
/
graphic_startup
.
cpp
\
..
/../../../
frameworks
/
common
/
image_decode_ability
.
cpp
\
..
/../../../
frameworks
/
common
/
image
.
cpp
\
..
/../../../
frameworks
/
common
/
input_device_manager
.
cpp
\
..
/../../../
frameworks
/
common
/
screen
.
cpp
\
...
...
@@ -81,12 +82,15 @@ SOURCES += \
..
/../../../
frameworks
/
default_resource
/
check_box_res
.
cpp
\
..
/../../../
frameworks
/
dfx
/
event_injector
.
cpp
\
..
/../../../
frameworks
/
dfx
/
key_event_injector
.
cpp
\
..
/../../../
frameworks
/
dfx
/
performance_task
.
cpp
\
..
/../../../
frameworks
/
dfx
/
point_event_injector
.
cpp
\
..
/../../../
frameworks
/
dfx
/
ui_dump_dom_tree
.
cpp
\
..
/../../../
frameworks
/
dock
/
input_device
.
cpp
\
..
/../../../
frameworks
/
dock
/
key_input_device
.
cpp
\
..
/../../../
frameworks
/
dock
/
pointer_input_device
.
cpp
\
..
/../../../
frameworks
/
dock
/
rotate_input_device
.
cpp
\
..
/../../../
frameworks
/
dock
/
screen_device_proxy
.
cpp
\
..
/../../../
frameworks
/
dock
/
vibrator_manager
.
cpp
\
..
/../../../
frameworks
/
dock
/
virtual_input_device
.
cpp
\
..
/../../../
frameworks
/
engines
/
gfx
/
gfx_engine_manager
.
cpp
\
..
/../../../
frameworks
/
draw
/
draw_arc
.
cpp
\
...
...
@@ -121,6 +125,7 @@ SOURCES += \
..
/../../../../
utils
/
frameworks
/
color
.
cpp
\
..
/../../../../
utils
/
frameworks
/
geometry2d
.
cpp
\
..
/../../../../
utils
/
frameworks
/
graphic_math
.
cpp
\
..
/../../../../
utils
/
frameworks
/
graphic_performance
.
cpp
\
..
/../../../../
utils
/
frameworks
/
hal_tick
.
cpp
\
..
/../../../../
utils
/
frameworks
/
mem_api
.
cpp
\
..
/../../../../
utils
/
frameworks
/
style
.
cpp
\
...
...
ui.gni
浏览文件 @
a728270f
...
...
@@ -22,6 +22,7 @@ graphic_ui_sources = [
"$GRAPHIC_UI_PATH/frameworks/animator/easing_equation.cpp",
"$GRAPHIC_UI_PATH/frameworks/animator/interpolation.cpp",
"$GRAPHIC_UI_PATH/frameworks/common/graphic_startup.cpp",
"$GRAPHIC_UI_PATH/frameworks/common/image_decode_ability.cpp",
"$GRAPHIC_UI_PATH/frameworks/common/image.cpp",
"$GRAPHIC_UI_PATH/frameworks/common/input_device_manager.cpp",
"$GRAPHIC_UI_PATH/frameworks/common/screen.cpp",
...
...
@@ -67,12 +68,14 @@ graphic_ui_sources = [
"$GRAPHIC_UI_PATH/frameworks/default_resource/check_box_res.cpp",
"$GRAPHIC_UI_PATH/frameworks/dfx/event_injector.cpp",
"$GRAPHIC_UI_PATH/frameworks/dfx/key_event_injector.cpp",
"$GRAPHIC_UI_PATH/frameworks/dfx/performance_task.cpp",
"$GRAPHIC_UI_PATH/frameworks/dfx/point_event_injector.cpp",
"$GRAPHIC_UI_PATH/frameworks/dfx/ui_dump_dom_tree.cpp",
"$GRAPHIC_UI_PATH/frameworks/dock/input_device.cpp",
"$GRAPHIC_UI_PATH/frameworks/dock/key_input_device.cpp",
"$GRAPHIC_UI_PATH/frameworks/dock/pointer_input_device.cpp",
"$GRAPHIC_UI_PATH/frameworks/dock/screen_device_proxy.cpp",
"$GRAPHIC_UI_PATH/frameworks/dock/vibrator_manager.cpp",
"$GRAPHIC_UI_PATH/frameworks/dock/virtual_input_device.cpp",
"$GRAPHIC_UI_PATH/frameworks/draw/draw_arc.cpp",
"$GRAPHIC_UI_PATH/frameworks/draw/draw_curve.cpp",
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录