提交 3b066410 编写于 作者: L liuyuxiang-bear 提交者: benb365

Description: modify code problems

IssueNo: https://gitee.com/openharmony/graphic_ui/issues/I5001O
Feature or Bugfix: Bugfix
Binary Source:No
Signed-off-by: Nbenb365 <liuyongchang1@huawei.com>
上级 6e07b71e
......@@ -114,7 +114,7 @@ For details about how to use components and APIs of graphics, see the examples p
## Repositories Involved<a name="section1371113476307"></a>
[Graphic subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/graphics-subsystem.md)
[Graphic subsystem](https://gitee.com/openharmony/docs/blob/master/en/readme/graphics.md)
[graphic_wms](https://gitee.com/openharmony/graphic_wms/blob/master/README.md)
......
......@@ -251,4 +251,4 @@ int16_t EasingEquation::SineEaseInOut(int16_t startPos, int16_t endPos, uint16_t
}
return SineEaseOut(halfStep, endPos, curTime - halfTime, halfTime);
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -21,4 +21,4 @@ ImageDecodeAbility& ImageDecodeAbility::GetInstance()
static ImageDecodeAbility instance;
return instance;
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -69,4 +69,4 @@ void InputDeviceManager::Clear()
{
deviceList_.Clear();
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -222,4 +222,4 @@ uint16_t TextAdapter::GetCount()
return 0;
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -55,4 +55,4 @@ void UIAbstractClock::UpdateClock(bool clockInit)
{
Invalidate();
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -25,7 +25,7 @@ class UIAbstractScrollBar : public HeapBase {
public:
UIAbstractScrollBar();
virtual ~UIAbstractScrollBar() {};
virtual ~UIAbstractScrollBar() {}
virtual void SetPosition(int16_t x, int16_t y, int16_t width, int16_t height) {}
......@@ -55,6 +55,7 @@ public:
{
return opacity_;
}
protected:
uint8_t opacity_ = OPA_TRANSPARENT;
float scrollProgress_ = 0;
......
......@@ -210,4 +210,4 @@ void UIArcLabel::MeasureArcTextInfo()
arcTextInfo_.direct, orientation_);
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -197,4 +197,4 @@ void UIYAxis::DrawAxisMark(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea
index++;
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -28,7 +28,7 @@
namespace OHOS {
class UIDialogLabelButton : public UILabelButton {
public:
UIDialogLabelButton(UIDialog* dialog)
explicit UIDialogLabelButton(UIDialog* dialog)
{
dialog_ = dialog;
}
......@@ -51,7 +51,7 @@ private:
class UIDialogClickListener : public UIView::OnClickListener {
public:
UIDialogClickListener(UIDialog* dialog)
explicit UIDialogClickListener(UIDialog* dialog)
{
dialog_ = dialog;
}
......@@ -691,4 +691,4 @@ ColorType UIDialog::GetButtonColor(DialogButtonType buttonType) const
}
#endif // ENABLE_DEBUG
} // namespace OHOS
#endif // ENABLE_WINDOW
\ No newline at end of file
#endif // ENABLE_WINDOW
......@@ -380,4 +380,4 @@ void UILabel::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea)
labelText_->OnDraw(gfxDstBuffer, invalidatedArea, GetOrigRect(),
GetContentRect(), offsetX_, style, ellipsisIndex_, opa);
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -863,7 +863,7 @@ void UIList::CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDista
}
}
/* this is a temporary impementation just used for list and will be replaced later,
/* this is a temporary implementation just used for list and will be replaced later,
we assume size of all items in scroll are equal for now. */
void UIList::FixDistance(int16_t& distanceX, int16_t& distanceY)
{
......
......@@ -60,4 +60,4 @@ void UIRepeatButton::SetEvent(const ClickEvent& event)
{
event_ = event;
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -131,7 +131,7 @@ Surface* UISurfaceView::GetSurface() const
bool UISurfaceView::OnPreDraw(Rect& invalidatedArea) const
{
// need fill transpant color
// need fill transparent color
return false;
}
......@@ -150,9 +150,9 @@ void UISurfaceView::Draw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea)
reinterpret_cast<const ColorType*>(acquireBuffer->GetVirAddr()));
surface_->ReleaseBuffer(acquireBuffer);
} else {
// fill with transpant color
// fill with transparent color
DrawUtils::GetInstance()->DrawTranspantArea(gfxDstBuffer, GetRect(), invalidatedArea);
}
}
} // namespace OHOS
#endif // ENABLE_WINDOW
\ No newline at end of file
#endif // ENABLE_WINDOW
......@@ -91,4 +91,4 @@ void UITextureMapper::Callback()
Rotate(rotateCur_, pivot_);
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -95,7 +95,7 @@ void UIToggleButton::OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedAre
Rect contentRect = GetContentRect();
Rect trunc = invalidatedArea;
bool isIntersect = trunc.Intersect(trunc, contentRect);
if (isIntersect == false) {
if (!isIntersect) {
return;
}
Style styleUnSelect = StyleDefault::GetBackgroundTransparentStyle();
......@@ -144,4 +144,4 @@ void UIToggleButton::OnStop(UIView& view)
Invalidate();
}
#endif
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -717,4 +717,4 @@ void UIVideo::SliderAnimatorCallback::Callback(UIView* view)
}
} // namespace OHOS
#endif // VERSION_LITE
\ No newline at end of file
#endif // VERSION_LITE
......@@ -1351,7 +1351,7 @@ ImageInfo* GetCheckBoxOnInfo()
{
/* 56 : check box width */
g_checkBoxOn.header.width = 56;
/* 56 : check box heigh */
/* 56 : check box height */
g_checkBoxOn.header.height = 56;
/* 5 : check box cf format */
g_checkBoxOn.header.colorMode = ARGB8888;
......@@ -1367,7 +1367,7 @@ ImageInfo* GetCheckBoxOffInfo()
{
/* 56 : check box width */
g_checkBoxOff.header.width = 56;
/* 56 : check box heigh */
/* 56 : check box height */
g_checkBoxOff.header.height = 56;
/* 5 : check box cf format */
g_checkBoxOff.header.colorMode = ARGB8888;
......@@ -1376,4 +1376,4 @@ ImageInfo* GetCheckBoxOffInfo()
g_checkBoxOff.data = CHECK_BOX_OFF_MAP;
return &g_checkBoxOff;
}
}
\ No newline at end of file
}
......@@ -79,4 +79,4 @@ uint8_t KeyEventInjector::GetLeftSize() const
return MAX_LIST_SIZE - dataList_.Size();
}
}
#endif // ENABLE_DEBUG
\ No newline at end of file
#endif // ENABLE_DEBUG
......@@ -38,4 +38,4 @@ private:
}
#endif // ENABLE_DEBUG
#endif // GRAPHIC_LITE_KEY_EVENT_INJECTOR
\ No newline at end of file
#endif // GRAPHIC_LITE_KEY_EVENT_INJECTOR
......@@ -169,4 +169,4 @@ bool UIScreenshot::ScreenshotToFile(const char* path)
return true;
}
} // namespace OHOS
#endif // ENABLE_DEBUG
\ No newline at end of file
#endif // ENABLE_DEBUG
......@@ -34,4 +34,4 @@ void UIViewBounds::SetShowState(bool show)
}
}
} // namespace OHOS
#endif // ENABLE_DEBUG
\ No newline at end of file
#endif // ENABLE_DEBUG
......@@ -260,4 +260,4 @@ bool FocusManager::GetNextFocus(UIView* focusedView, UIView*& candidate, UIViewG
return childFocusable;
}
}
#endif
\ No newline at end of file
#endif
......@@ -25,4 +25,4 @@ bool OHOSInputDevice::Read(DeviceData& data)
return false;
}
}
#endif // ENABLE_WINDOW
\ No newline at end of file
#endif // ENABLE_WINDOW
......@@ -131,7 +131,7 @@ public:
* @param srcLineNumber Indicates the number of source memory rows
* @param srcColorMode Indicates the source memory color format
* @param color 32-bit XRGB8888 value
* (valid when the source memory is in a format with only alph information such as A1)
* (valid when the source memory is in a format with only alpha information such as A1)
* @param opa Indicates the transparency
* @param dst Indicates the start address of destination memory
* @param dstStride Indicates the number of bytes in a single row of destination memory
......@@ -166,7 +166,7 @@ public:
* @param transformMatrix Indicates the transformation matrix
* @param opa Indicates the transparency
* @param color 32-bit XRGB8888 value
* (valid when the source memory is in a format with only alph information such as A1)
* (valid when the source memory is in a format with only alpha information such as A1)
* @param mask Indicates the masking rectangle, and the content beyond the rectangle is not drawn
* @param dst Indicates the start address of destination memory
* @param dstStride Indicates the number of bytes in a single row of destination memory
......
......@@ -194,6 +194,7 @@ public:
bool GetScreenBitmapBuffer(uint8_t* dest, uint32_t size);
;
private:
ScreenDeviceProxy() {}
virtual ~ScreenDeviceProxy() {}
......
......@@ -30,4 +30,4 @@ private:
static constexpr uint16_t INTERPOLATION_RANGE = 1024;
};
} // namespace OHOS
#endif // GRAPHIC_LITE_DRAW_CURVE_H
\ No newline at end of file
#endif // GRAPHIC_LITE_DRAW_CURVE_H
......@@ -726,4 +726,4 @@ void DrawRect::DrawRectRadiusBiggerThanBorderCon4(BufferInfo& gfxDstBuffer, cons
Rect bottomBorderRect(col3X + 1, row5Y, col4X - 1, row6Y);
DrawUtils::GetInstance()->DrawColorArea(gfxDstBuffer, bottomBorderRect, dirtyRect, style.borderColor_, opa);
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -26,8 +26,8 @@ namespace OHOS {
/** @brief Class for drawing rectangle. */
class DrawRect : public HeapBase {
public:
DrawRect() {};
~DrawRect() {};
DrawRect() {}
~DrawRect() {}
static void Draw(BufferInfo& gfxDstBuffer, const Rect& rect, const Rect& dirtyRect,
const Style& style, OpacityType opaScale);
......
......@@ -123,4 +123,4 @@ DrawTriangle::Edge DrawTriangle::InitEdge(const Point& startP, const Point& endP
edge.dPoint.y = MATH_ABS(edge.dPoint.y);
return edge;
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -28,9 +28,9 @@
namespace OHOS {
bool UIFont::setFontAllocFlag_ = false;
UIFont::UIFont() : instance_(nullptr), defaultInstance_(nullptr){};
UIFont::UIFont() : instance_(nullptr), defaultInstance_(nullptr){}
UIFont::~UIFont(){};
UIFont::~UIFont(){}
UIFont* UIFont::GetInstance()
{
......
......@@ -88,4 +88,4 @@ LangTextParam* UIFontBuilder::GetLangTextDefaultParamTable()
}
return langTextDefaultParamTable_;
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -70,4 +70,4 @@ private:
ListHead lruList_ = {};
};
} // namespace OHOS
#endif /* UI_FONT_CACHE_H */
\ No newline at end of file
#endif /* UI_FONT_CACHE_H */
......@@ -82,4 +82,4 @@ private:
};
}
#endif
#endif
\ No newline at end of file
#endif
......@@ -54,4 +54,4 @@ public:
}; // class UITextShaping
} // namespace OHOS
#endif // ENABLE_SHAPING
#endif // GRAPHIC_LITE_TEXT_SHAPING_H
\ No newline at end of file
#endif // GRAPHIC_LITE_TEXT_SHAPING_H
......@@ -56,8 +56,8 @@ public:
RetCode ReadToCache(ImgResDsc& dsc);
private:
FileImgDecoder() {};
~FileImgDecoder() {};
FileImgDecoder() {}
~FileImgDecoder() {}
bool IsImgValidMode(uint8_t colorMode)
{
......@@ -75,4 +75,4 @@ private:
FileImgDecoder& operator=(FileImgDecoder&&) = delete;
};
}
#endif
\ No newline at end of file
#endif
......@@ -205,4 +205,4 @@ bool ImageLoad::GetImageInfo(int32_t fd, uint32_t size, ImageInfo& imageInfo)
UIFree(buffer);
return ret;
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -41,4 +41,4 @@ private:
static bool UnzipImage(uint8_t* imageBuffer, uint32_t size, ImageInfo& imageInfo);
};
} // namespace OHOS
#endif // GRAPHIC_LITE_IMAGE_LOAD_H
\ No newline at end of file
#endif // GRAPHIC_LITE_IMAGE_LOAD_H
......@@ -502,4 +502,4 @@ void FlexLayout::LayoutVertical()
delete[] columnsChildNum;
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -115,4 +115,4 @@ void GridLayout::LayoutVertical()
}
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -47,4 +47,4 @@ void ListLayout::OnChildChanged()
SetWidth(rect.GetWidth() + rect.GetLeft());
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -60,4 +60,4 @@ void Theme::InitSliderStyle()
{
sliderKnobStyle_ = StyleDefault::GetPickerBackgroundStyle();
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -26,4 +26,4 @@ void ThemeManager::SetCurrent(Theme* theme)
{
theme_ = theme;
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -41,4 +41,4 @@ void Window::DestoryWindow(Window* window)
delete windowImpl;
}
}
}
\ No newline at end of file
}
......@@ -213,7 +213,8 @@ void WindowImpl::UpdateHalDisplayBuffer()
if (surface == nullptr) {
return;
}
surface->Lock((void**)&gfxAlloc_.virAddr, (void**)&gfxAlloc_.phyAddr, &gfxAlloc_.stride);
surface->Lock(reinterpret_cast<void**>(&gfxAlloc_.virAddr),
reinterpret_cast<void**>(&gfxAlloc_.phyAddr), &gfxAlloc_.stride);
}
}
......
......@@ -50,6 +50,7 @@ public:
void RemoveFromDisplay();
BufferInfo* GetBufferInfo();
private:
void UpdateHalDisplayBuffer();
......@@ -68,4 +69,4 @@ private:
AllocationInfo gfxAlloc_;
};
}
#endif
\ No newline at end of file
#endif
......@@ -106,4 +106,4 @@ private:
};
} // namespace OHOS
#endif
#endif // GRAPHIC_LITE_FOCUS_MANAGER_H
\ No newline at end of file
#endif // GRAPHIC_LITE_FOCUS_MANAGER_H
......@@ -27,7 +27,7 @@ public:
/** @brief Constructor */
RotateInputDevice();
/** @brief Destructor */
virtual ~RotateInputDevice(){};
virtual ~RotateInputDevice(){}
void SetRotateInputThreshold(int16_t threshold)
{
......@@ -43,4 +43,4 @@ protected:
} // namespace OHOS
#endif // GRAPHIC_LITE_ROTATE_INPUT_DEVICE_H
#endif
\ No newline at end of file
#endif
......@@ -65,4 +65,4 @@ private:
};
} // namespace OHOS
#endif
#endif // GRAPHIC_LITE_VIBRATOR_MANAGER_H
\ No newline at end of file
#endif // GRAPHIC_LITE_VIBRATOR_MANAGER_H
......@@ -173,6 +173,7 @@ public:
}
baseEngine_ = gfxEngine;
}
protected:
static BaseGfxEngine* baseEngine_;
uint16_t width_ = HORIZONTAL_RESOLUTION;
......
......@@ -69,4 +69,4 @@ private:
int32_t dynamicFontFd_;
};
} // namespce OHOS
#endif // UI_FONT_BITMAP_H
\ No newline at end of file
#endif // UI_FONT_BITMAP_H
......@@ -44,6 +44,7 @@ public:
UITextLanguageFontParam* uiTextLangFontsTable_;
LangTextParam* langTextDefaultParamTable_;
private:
UIFontBuilder();
~UIFontBuilder() {}
......@@ -52,4 +53,4 @@ private:
uint16_t totalTextId_;
};
}
#endif // GRAPHIC_LITE_UI_FONT_BUILDER_H
\ No newline at end of file
#endif // GRAPHIC_LITE_UI_FONT_BUILDER_H
......@@ -92,4 +92,4 @@ private:
virtual ~Screen() {}
};
} // namespace OHOS
#endif // GRAPHIC_LITE_SCREEN_H
\ No newline at end of file
#endif // GRAPHIC_LITE_SCREEN_H
......@@ -122,4 +122,4 @@ protected:
uint32_t lastRun_; /* last run time */
};
} // namespace OHOS
#endif // GRAPHIC_LITE_TASK_H
\ No newline at end of file
#endif // GRAPHIC_LITE_TASK_H
......@@ -380,4 +380,4 @@ private:
uint8_t verticalAlign_ : 4; // UITextLanguageAlignment
};
} // namespace OHOS
#endif // GRAPHIC_LITE_TEXT_H
\ No newline at end of file
#endif // GRAPHIC_LITE_TEXT_H
......@@ -87,7 +87,7 @@ public:
* @version 1.0
*/
virtual UIView* GetView(UIView* inView, int16_t index) = 0;
virtual void DeleteView(UIView*& view)
{
delete view;
......
......@@ -291,6 +291,7 @@ public:
* @version 6.0
*/
void RestoreDrawContext();
private:
friend class RenderManager;
friend class UIViewGroup;
......
......@@ -177,7 +177,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual uint16_t GetCount() override;
uint16_t GetCount() override;
/**
* @brief Sets the width of UILabel constructed by the adapter.
......@@ -253,6 +253,7 @@ public:
{
formatter_ = formatter;
}
protected:
virtual UILabel* GetTextView(UIView* inView, int16_t index);
virtual UILabel* CreateUILabel(UIView* inView);
......
......@@ -402,7 +402,7 @@ protected:
endValueY_ = 0;
}
virtual void Callback(UIView* view) override;
void Callback(UIView* view) override;
uint16_t curtTime_;
uint16_t dragTimes_;
......@@ -446,7 +446,7 @@ protected:
void StartAnimator(int16_t dragDistanceX, int16_t dragDistanceY);
virtual void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY){};
virtual void CalculateReboundDistance(int16_t& dragDistanceX, int16_t& dragDistanceY){}
int16_t GetMaxDelta() const;
......
......@@ -315,7 +315,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void OnPostDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override;
void OnPostDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override;
/**
* @brief Sets the working mode for this analog clock.
......
......@@ -119,7 +119,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void SetStyle(Style& style) override
void SetStyle(Style& style) override
{
UIView::SetStyle(style);
}
......@@ -344,7 +344,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override;
void OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override;
/**
* @brief Stores the attribute information about this arc text to draw.
......@@ -374,7 +374,7 @@ protected:
void RefreshArcLabel();
private:
virtual void ReMeasure() override;
void ReMeasure() override;
void MeasureArcTextInfo();
void DrawArcText(BufferInfo& gfxDstBuffer, const Rect& mask, OpacityType opaScale);
......
......@@ -67,7 +67,7 @@ public:
* @since 1.0
* @version 1.0
*/
UIButton(const char* id) : UIButton()
explicit UIButton(const char* id) : UIButton()
{
id_ = id;
}
......@@ -313,7 +313,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual Rect GetContentRect() override
Rect GetContentRect() override
{
Rect contentRect;
Style* style = buttonStyles_[state_];
......@@ -340,7 +340,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void SetStyle(Style& style) override
void SetStyle(Style& style) override
{
UIView::SetStyle(style);
}
......@@ -412,6 +412,7 @@ public:
enableAnimation_ = enable;
}
#endif
protected:
Image* defaultImgSrc_;
Image* triggeredImgSrc_;
......
......@@ -54,6 +54,7 @@ class UICheckBox : public UIView, public AnimatorCallback {
#else
class UICheckBox : public UIView {
#endif
public:
/**
* @brief Enumerates the states of a check box.
......@@ -84,7 +85,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual ~UICheckBox() {};
virtual ~UICheckBox() {}
/**
* @brief Represents a listener for changes of a check box.
......
......@@ -245,4 +245,4 @@ private:
};
}
#endif // GRAPHIC_LITE_UI_DIALOG_H
#endif // ENABLE_WINDOW
\ No newline at end of file
#endif // ENABLE_WINDOW
......@@ -436,7 +436,7 @@ protected:
virtual ~ImageAnimatorCallback() {}
virtual void Callback(UIView* view) override;
void Callback(UIView* view) override;
void Reset()
{
......
......@@ -307,6 +307,7 @@ protected:
TransformMap* drawTransMap_ = nullptr;
Matrix4<float>* contentMatrix_ = nullptr;
bool transMapInvalid_ = true;
private:
void ReMeasure() override;
#if (ENABLE_GIF == 1)
......
......@@ -187,7 +187,7 @@ public:
* @since 1.0
* @version 1.0
*/
UIList(uint8_t direction);
explicit UIList(uint8_t direction);
/**
* @brief A destructor used to delete the <b>UIList</b> instance.
......@@ -236,7 +236,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void MoveChildByOffset(int16_t x, int16_t y) override;
void MoveChildByOffset(int16_t x, int16_t y) override;
/**
* @brief Scrolls to change the index of the first row or column of the current view.
......
......@@ -536,6 +536,7 @@ protected:
TextAdapter* textAdapter_;
uint16_t maxCount_;
PickerListScrollListener* listListener_;
private:
friend class PickerListScrollListener;
bool RefreshValues(const char* value[], uint16_t count);
......
......@@ -62,7 +62,7 @@ public:
*
* @brief Default constructor
*/
UIRadioButton(const char* name);
explicit UIRadioButton(const char* name);
/**
* @brief A destructor used to delete the <b>UIRadioButton</b> instance.
......
......@@ -111,7 +111,7 @@ public:
* @param [in] event click event.
* @return Returns <b>true</b> if the event is consumed; returns <b>false</b> otherwise.
*/
virtual bool OnClickEvent(const ClickEvent& event) override;
bool OnClickEvent(const ClickEvent& event) override;
/**
* @fn void UIRepeatButton::OnReleaseEvent(const ReleaseEvent& event)
......@@ -120,7 +120,7 @@ public:
*
* @param [in] event release event.
*/
virtual bool OnReleaseEvent(const ReleaseEvent& event) override;
bool OnReleaseEvent(const ReleaseEvent& event) override;
/**
* @fn void UIRepeatButton::OnLongPressEvent(const ReleaseEvent& event)
......@@ -129,7 +129,7 @@ public:
*
* @param [in] event long press event.
*/
virtual bool OnLongPressEvent(const LongPressEvent& event) override;
bool OnLongPressEvent(const LongPressEvent& event) override;
/**
* @fn void UIRepeatButton::HandleTickEvent()
......@@ -145,7 +145,7 @@ private:
static UIRepeatButton* repeatButton_;
uint32_t timerRepeatID_;
virtual void OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override;
void OnDraw(BufferInfo& gfxDstBuffer, const Rect& invalidatedArea) override;
inline void SetEvent(const ClickEvent& event);
};
} // namespace OHOS
......
......@@ -336,7 +336,7 @@ protected:
private:
static constexpr uint8_t MAX_ROTATE_FACTOR = 128;
int16_t knobWidth_;
bool knobStyleAllocFlag_;
Style* knobStyle_;
......
......@@ -149,7 +149,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void Remove(UIView* view) override;
void Remove(UIView* view) override;
/**
* @brief Sets the index for the current tab.
......
......@@ -298,14 +298,14 @@ public:
private:
class UIPickerListener : public UIPicker::SelectedListener {
public:
UIPickerListener(UITimePicker* timePicker)
explicit UIPickerListener(UITimePicker* timePicker)
{
timePicker_ = timePicker;
}
~UIPickerListener() {}
virtual void OnPickerStoped(UIPicker& picker) override
void OnPickerStoped(UIPicker& picker) override
{
if (timePicker_ != nullptr) {
timePicker_->TimeSelectedCallback();
......
......@@ -108,7 +108,7 @@ public:
protected:
void CalculateSize() override;
#if DEFAULT_ANIMATION
virtual void Callback(UIView* view) override;
void Callback(UIView* view) override;
void OnStop(UIView& view) override;
#endif
......
......@@ -242,7 +242,7 @@ public:
* @since 5.0
* @version 3.0
*/
virtual ~VideoPlayerListener() {};
virtual ~VideoPlayerListener() {}
/**
* @brief Called when the playback is complete.
......@@ -495,4 +495,4 @@ private:
} // namespace OHOS
#endif // VERSION_LITE
#endif // GRAPHIC_LITE_UI_VIDEO_H
\ No newline at end of file
#endif // GRAPHIC_LITE_UI_VIDEO_H
......@@ -426,7 +426,7 @@ public:
* @since 1.0
* @version 1.0
*/
UIView(const char* id) : UIView()
explicit UIView(const char* id) : UIView()
{
id_ = id;
}
......
......@@ -123,7 +123,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void GetTargetView(const Point& point, UIView** last) override;
void GetTargetView(const Point& point, UIView** last) override;
/**
* @brief Obtains the current view and target view based on specified coordinates. The obtained current view
......@@ -138,7 +138,7 @@ public:
* @since 5.0
* @version 3.0
*/
virtual void GetTargetView(const Point& point, UIView** current, UIView** target) override;
void GetTargetView(const Point& point, UIView** current, UIView** target) override;
/**
* @brief Moves all child views.
......
......@@ -170,6 +170,7 @@ public:
*/
void SetWindowId(uint8_t windowId);
#endif
private:
EventInjector() : pointEventInjector_(nullptr), keyEventInjector_(nullptr) {}
virtual ~EventInjector();
......
......@@ -75,6 +75,7 @@ public:
* @version 1.0
*/
bool ScreenshotToFile(const char* path);
private:
UIScreenshotListener* screenshotListener_;
......
......@@ -83,4 +83,4 @@ private:
};
} // namespace OHOS
#endif // ENABLE_DEBUG
#endif // GRAPHIC_LITE_UI_VIEW_BOUNDS_H
\ No newline at end of file
#endif // GRAPHIC_LITE_UI_VIEW_BOUNDS_H
......@@ -104,6 +104,7 @@ public:
{
timeStamp_ = timeStamp;
}
protected:
TimeType timeStamp_;
Point curPos_;
......
......@@ -59,7 +59,7 @@ public:
*/
RotateEvent(int16_t rotate) : rotate_(static_cast<int16_t>(rotate * ROTATE_SENSITIVITY)) {} // Rotation direction
~RotateEvent() {};
~RotateEvent() {}
/**
* @brief Obtains the number reported by a <b>RotateEvent</b>.
......@@ -77,4 +77,4 @@ private:
int16_t rotate_;
};
} // namespace OHOS
#endif // GRAPHIC_LITE_ROTATE_EVENT_H
\ No newline at end of file
#endif // GRAPHIC_LITE_ROTATE_EVENT_H
......@@ -378,4 +378,4 @@ struct FileCommonHeader {
};
#pragma pack()
} // namespace OHOS
#endif /* UI_FONT_HEADER_H */
\ No newline at end of file
#endif /* UI_FONT_HEADER_H */
......@@ -110,7 +110,8 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void LayoutChildren(bool needInvalidate = false) override;
void LayoutChildren(bool needInvalidate = false) override;
private:
void LayoutHorizontal();
void LayoutVertical();
......
......@@ -90,7 +90,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual void LayoutChildren(bool needInvalidate = false) override;
void LayoutChildren(bool needInvalidate = false) override;
private:
void LayoutHorizontal();
......
......@@ -73,7 +73,7 @@ public:
* @since 1.0
* @version 1.0
*/
virtual ~Theme(){};
virtual ~Theme(){}
/**
* @brief Obtains the basic style.
......
......@@ -223,4 +223,4 @@ public:
virtual int32_t GetWindowId() = 0;
};
}
#endif
\ No newline at end of file
#endif
......@@ -40,4 +40,4 @@ private:
UILabel* testCaseLabel_;
};
} // namespace OHOS
#endif // TEST_CASE_LIST_ADAPTER_H
\ No newline at end of file
#endif // TEST_CASE_LIST_ADAPTER_H
......@@ -112,4 +112,4 @@ protected:
int16_t positionY_ = 0;
};
} // namespace OHOS
#endif
\ No newline at end of file
#endif
......@@ -38,4 +38,4 @@ private:
static List<TestCaseInfo> testCaseList_;
};
} // namespace OHOS
#endif
\ No newline at end of file
#endif
......@@ -198,4 +198,4 @@ int16_t TestCaseListAdapter::GetItemHeightWithMargin(int16_t index)
{
return TESTCASE_BUTTON_HEIGHT + STYLE_BORDER_WIDTH_VALUE * 2; // 2: two borders on both sides
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -307,4 +307,4 @@ void UITestAnimator::OnFPSChanged(float newFPS)
fpsLabel_->SetText(reinterpret_cast<char*>(buf));
fpsLabel_->Invalidate();
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -72,7 +72,7 @@ protected:
class UITestAnimator : public UITest, public UIView::OnClickListener, public SysInfo::OnFPSChangedListener {
public:
UITestAnimator() {}
~UITestAnimator(){};
~UITestAnimator(){}
void SetUp() override;
void TearDown() override;
const UIView* GetTestView() override;
......
......@@ -164,4 +164,4 @@ void UITestAntiAliasing::UIKit_Anti_Aliasing_Test_Line_001()
group->Add(canvas);
container_->Add(group);
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -197,4 +197,4 @@ void UITestArcLabel::UIKit_UIArcLabel_Test_Align_003()
positionY_ += RADIUS + GAP + TITLE_HEIGHT;
}
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -174,7 +174,10 @@ const UIView* UITestBUTTON::GetTestView()
return container_;
}
UIViewGroup* UITestBUTTON::CreateButtonGroup(int16_t posX, int16_t posY, int16_t width, int16_t height,
UIViewGroup* UITestBUTTON::CreateButtonGroup(int16_t posX,
int16_t posY,
int16_t width,
int16_t height,
UICheckBox::OnChangeListener** listener,
UIViewType type,
const char* name)
......@@ -202,7 +205,7 @@ UIViewGroup* UITestBUTTON::CreateButtonGroup(int16_t posX, int16_t posY, int16_t
}
group->Add(checkBox);
checkBox->SetOnChangeListener(*listener);
checkBox->SetPosition(100, 0, width, height); // 100: posX 0: posY
checkBox->SetPosition(100, 0, width, height); // 100: posX 0: posY
if (checkBox->GetState() == UICheckBox::SELECTED) {
label1->SetText("ON");
} else {
......@@ -243,14 +246,14 @@ void UITestBUTTON::UIKit_Radio_Button_Test_001()
label->SetText("radiobutton功能");
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
// 40: posX 160 posY 100 width 100 height
UIViewGroup* group = CreateButtonGroup(40, 160, 100, 100, &radioChangeListener_,
UIViewType::UI_RADIO_BUTTON, "bb");
UIViewGroup* group =
CreateButtonGroup(40, 160, 100, 100, &radioChangeListener_, UIViewType::UI_RADIO_BUTTON, "bb");
// 250: posX 160 posY 100 width 100 height
UIViewGroup* group1 = CreateButtonGroup(250, 160, 100, 100, &radioChangeListener1_,
UIViewType::UI_RADIO_BUTTON, "bb");
UIViewGroup* group1 =
CreateButtonGroup(250, 160, 100, 100, &radioChangeListener1_, UIViewType::UI_RADIO_BUTTON, "bb");
// 500: posX 160 posY 100 width 100 height
UIViewGroup* group2 = CreateButtonGroup(500, 160, 100, 100, &radioChangeListener2_,
UIViewType::UI_RADIO_BUTTON, "bb");
UIViewGroup* group2 =
CreateButtonGroup(500, 160, 100, 100, &radioChangeListener2_, UIViewType::UI_RADIO_BUTTON, "bb");
container_->Add(group);
container_->Add(group1);
container_->Add(group2);
......@@ -269,14 +272,13 @@ void UITestBUTTON::UIKit_Toggle_Button_Test_001()
label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
// 40: posX 300 posY 100 width 100 height
UIViewGroup* group = CreateButtonGroup(40, 300, 100, 100, &toggleChangeListener_,
UIViewType::UI_TOGGLE_BUTTON);
UIViewGroup* group = CreateButtonGroup(40, 300, 100, 100, &toggleChangeListener_, UIViewType::UI_TOGGLE_BUTTON);
// 250: posX 300 posY 100 width 100 height
UIViewGroup* group1 = CreateButtonGroup(250, 300, 100, 100, &toggleChangeListener1_,
UIViewType::UI_TOGGLE_BUTTON);
UIViewGroup* group1 =
CreateButtonGroup(250, 300, 100, 100, &toggleChangeListener1_, UIViewType::UI_TOGGLE_BUTTON);
// 500: posX 300 posY 100 width 100 height
UIViewGroup* group2 = CreateButtonGroup(500, 300, 100, 100, &toggleChangeListener2_,
UIViewType::UI_TOGGLE_BUTTON);
UIViewGroup* group2 =
CreateButtonGroup(500, 300, 100, 100, &toggleChangeListener2_, UIViewType::UI_TOGGLE_BUTTON);
container_->Add(group);
container_->Add(group1);
container_->Add(group2);
......@@ -561,7 +563,7 @@ public:
uiView_->SetHeight(height_);
uiView_->SetVisible(visible_);
uiView_->SetTouchable(touchable_);
((UIButton*)uiView_)->Invalidate();
(reinterpret_cast<UIButton*>(uiView_))->Invalidate();
return true;
}
......@@ -577,9 +579,9 @@ private:
#if DEFAULT_ANIMATION
class TestBtnAnimationListener : public UIView::OnClickListener {
public:
TestBtnAnimationListener(UIView* uiView, bool enableAnimation)
: uiView_(uiView),
enableAnimation_(enableAnimation) {}
TestBtnAnimationListener(UIView* uiView, bool enableAnimation) : uiView_(uiView), enableAnimation_(enableAnimation)
{
}
~TestBtnAnimationListener() {}
......@@ -637,56 +639,63 @@ void UITestBUTTON::UIKit_Button_Test_002(UIScrollView* container, UIButton* butt
UILabelButton* button8 = GetTestUIButton("隐藏", 430, 940, button); // 430: x-coordinate, 940: y-coordinate
if (clickEnableVisiableListener_ == nullptr) {
clickEnableVisiableListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnOnClickVisableListener((UIView*)button, false));
static_cast<UIView::OnClickListener*>(
new TestBtnOnClickVisableListener(reinterpret_cast<UIView*>(button), false));
}
button8->SetOnClickListener(clickEnableVisiableListener_);
UILabelButton* button9 = GetTestUIButton("显示", 430, 990, button); // 430: x-coordinate, 990: y-coordinate
if (clickDisableVisiableListener_ == nullptr) {
clickDisableVisiableListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnOnClickVisableListener((UIView*)button, true));
static_cast<UIView::OnClickListener*>(
new TestBtnOnClickVisableListener(reinterpret_cast<UIView*>(button), true));
}
button9->SetOnClickListener(clickDisableVisiableListener_);
UILabelButton* button10 = GetTestUIButton("可触摸 ", 520, 940, button); // 520: x-coordinate, 940: y-coordinate
if (clickEnableTouchableListener_ == nullptr) {
clickEnableTouchableListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnOnClickTouchableListener((UIView*)button, true));
static_cast<UIView::OnClickListener*>(
new TestBtnOnClickTouchableListener(reinterpret_cast<UIView*>(button), true));
}
button10->SetOnClickListener(clickEnableTouchableListener_);
UILabelButton* button11 = GetTestUIButton("不可触摸", 520, 990, button); // 520: x-coordinate, 990: y-coordinate
if (clickDisableTouchableListener_ == nullptr) {
clickDisableTouchableListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnOnClickTouchableListener((UIView*)button, false));
static_cast<UIView::OnClickListener*>(
new TestBtnOnClickTouchableListener(reinterpret_cast<UIView*>(button), false));
}
button11->SetOnClickListener(clickDisableTouchableListener_);
UILabelButton* button12 = GetTestUIButton("变白", 160, 1040, button); // 160: x-coordinate, 1040: y-coordinate
if (clickColorToWhiteListener_ == nullptr) {
clickColorToWhiteListener_ = static_cast<UIView::OnClickListener*>(
new TestBtnOnClickChangeColorListener((UIView*)button, 0xFF, 0xFF, 0xFF));
new TestBtnOnClickChangeColorListener(reinterpret_cast<UIView*>(button), 0xFF, 0xFF, 0xFF));
}
button12->SetOnClickListener(clickColorToWhiteListener_);
UILabelButton* button13 = GetTestUIButton("变红", 160, 1090, button); // 160: x-coordinate, 1090: y-coordinate
if (clickColorToRedListener_ == nullptr) {
clickColorToRedListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnOnClickChangeColorListener((UIView*)button, 0xFF, 0, 0));
static_cast<UIView::OnClickListener*>(
new TestBtnOnClickChangeColorListener(reinterpret_cast<UIView*>(button), 0xFF, 0, 0));
}
button13->SetOnClickListener(clickColorToRedListener_);
UILabelButton* button14 = GetTestUIButton("色彩还原", 250, 1040, button); // 250: x-coordinate, 1040: y-coordinate
if (clickRevetColorListener_ == nullptr) {
clickRevetColorListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnOnClickRevertColorListener((UIView*)button));
static_cast<UIView::OnClickListener*>(
new TestBtnOnClickRevertColorListener(reinterpret_cast<UIView*>(button)));
}
button14->SetOnClickListener(clickRevetColorListener_);
UILabelButton* button15 = GetTestUIButton("全部还原", 250, 1090, button); // 250: x-coordinate, 1090: y-coordinate
if (clickRevetToOriginListener_ == nullptr) {
clickRevetToOriginListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnOnClickRevertToOriginStateListener((UIView*)button));
static_cast<UIView::OnClickListener*>(
new TestBtnOnClickRevertToOriginStateListener(reinterpret_cast<UIView*>(button)));
}
button15->SetOnClickListener(clickRevetToOriginListener_);
......@@ -703,14 +712,15 @@ void UITestBUTTON::UIKit_Button_Test_002(UIScrollView* container, UIButton* butt
UILabelButton* button16 = GetTestUIButton("开启动效", 340, 1040, button); // 340: x-coordinate, 1040: y-coordinate
if (enableAnimationListener_ == nullptr) {
enableAnimationListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnAnimationListener((UIView*)button, true));
static_cast<UIView::OnClickListener*>(
new TestBtnAnimationListener(reinterpret_cast<UIView*>(button), true));
}
button16->SetOnClickListener(enableAnimationListener_);
UILabelButton* button17 = GetTestUIButton("关闭动效", 340, 1090, button); // 340: x-coordinate, 1090: y-coordinate
if (disableAnimationListener_ == nullptr) {
disableAnimationListener_ =
static_cast<UIView::OnClickListener*>(new TestBtnAnimationListener((UIView*)button, false));
disableAnimationListener_ = static_cast<UIView::OnClickListener*>(
new TestBtnAnimationListener(reinterpret_cast<UIView*>(button), false));
}
button17->EnableButtonAnimation(false);
button17->SetOnClickListener(disableAnimationListener_);
......@@ -749,7 +759,8 @@ void UITestBUTTON::UIKit_Button_Test_001()
UILabelButton* button4 = GetTestUIButton("左移", 250, 940, button); // 250: x-coordinate, 940: y-coordinate
if (clickLeftListener_ == nullptr) {
clickLeftListener_ = static_cast<UIView::OnClickListener*>(new TestBtnOnClickPositionChangeListener(
(UIView*)button, TestBtnOnClickPositionChangeListener::MoveType::MOVE_LEFT, CHANGE_SIZE));
reinterpret_cast<UIView*>(button),
TestBtnOnClickPositionChangeListener::MoveType::MOVE_LEFT, CHANGE_SIZE));
}
button4->SetOnClickListener(clickLeftListener_);
......@@ -757,7 +768,8 @@ void UITestBUTTON::UIKit_Button_Test_001()
button5->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
if (clickRightListener_ == nullptr) {
clickRightListener_ = static_cast<UIView::OnClickListener*>(new TestBtnOnClickPositionChangeListener(
(UIView*)button, TestBtnOnClickPositionChangeListener::MoveType::MOVE_RIGHT, CHANGE_SIZE));
reinterpret_cast<UIView*>(button),
TestBtnOnClickPositionChangeListener::MoveType::MOVE_RIGHT, CHANGE_SIZE));
}
button5->SetOnClickListener(clickRightListener_);
......@@ -765,14 +777,16 @@ void UITestBUTTON::UIKit_Button_Test_001()
button6->SetFont(DEFAULT_VECTOR_FONT_FILENAME, FONT_DEFAULT_SIZE);
if (clickUpListener_ == nullptr) {
clickUpListener_ = static_cast<UIView::OnClickListener*>(new TestBtnOnClickPositionChangeListener(
(UIView*)button, TestBtnOnClickPositionChangeListener::MoveType::MOVE_TOP, CHANGE_SIZE));
reinterpret_cast<UIView*>(button),
TestBtnOnClickPositionChangeListener::MoveType::MOVE_TOP, CHANGE_SIZE));
}
button6->SetOnClickListener(clickUpListener_);
UILabelButton* button7 = GetTestUIButton("下移", 340, 990, button); // 340: x-coordinate, 990: y-coordinate
if (clickDownListener_ == nullptr) {
clickDownListener_ = static_cast<UIView::OnClickListener*>(new TestBtnOnClickPositionChangeListener(
(UIView*)button, TestBtnOnClickPositionChangeListener::MoveType::MOVE_BOTTOM, CHANGE_SIZE));
reinterpret_cast<UIView*>(button),
TestBtnOnClickPositionChangeListener::MoveType::MOVE_BOTTOM, CHANGE_SIZE));
}
button7->SetOnClickListener(clickDownListener_);
......
......@@ -222,4 +222,4 @@ void UITestChartPillar::SetLastPos(UIView* view)
lastX_ = view->GetX();
lastY_ = view->GetY() + view->GetHeight();
}
} // namespace OHOS
\ No newline at end of file
} // namespace OHOS
......@@ -106,7 +106,7 @@ bool UITestClip::OnClick(UIView& view, const ClickEvent& event)
ClipImage(imageView2_, path);
imageView2_->Invalidate();
}
return true;
}
......
......@@ -69,4 +69,4 @@ private:
UIScrollView* container_ = nullptr;
};
} // namespace OHOS
#endif
\ No newline at end of file
#endif
......@@ -76,7 +76,7 @@ private:
class TestUIDialogOnCancelListener : public UIView::OnClickListener {
public:
TestUIDialogOnCancelListener(UILabel* label)
explicit TestUIDialogOnCancelListener(UILabel* label)
{
dialog_ = nullptr;
label_ = label;
......@@ -490,4 +490,4 @@ bool UITestDialog::ClickExpand(UIView &view, const ClickEvent& event)
return true;
}
} // namespace OHOS
#endif // ENABLE_WINDOW
\ No newline at end of file
#endif // ENABLE_WINDOW
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册