1bafb9395Sopenharmony_ci/* 2bafb9395Sopenharmony_ci * Copyright (c) 2020-2021 Huawei Device Co., Ltd. 3bafb9395Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4bafb9395Sopenharmony_ci * you may not use this file except in compliance with the License. 5bafb9395Sopenharmony_ci * You may obtain a copy of the License at 6bafb9395Sopenharmony_ci * 7bafb9395Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8bafb9395Sopenharmony_ci * 9bafb9395Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10bafb9395Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11bafb9395Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12bafb9395Sopenharmony_ci * See the License for the specific language governing permissions and 13bafb9395Sopenharmony_ci * limitations under the License. 14bafb9395Sopenharmony_ci */ 15bafb9395Sopenharmony_ci 16bafb9395Sopenharmony_ci/** 17bafb9395Sopenharmony_ci * @addtogroup Graphic 18bafb9395Sopenharmony_ci * @{ 19bafb9395Sopenharmony_ci * 20bafb9395Sopenharmony_ci * @brief Defines a lightweight graphics system that provides basic UI and container views, 21bafb9395Sopenharmony_ci * including buttons, images, labels, lists, animators, scroll views, swipe views, and layouts. 22bafb9395Sopenharmony_ci * This system also provides the Design for X (DFX) capability to implement features such as 23bafb9395Sopenharmony_ci * view rendering, animation, and input event distribution. 24bafb9395Sopenharmony_ci * 25bafb9395Sopenharmony_ci * @since 1.0 26bafb9395Sopenharmony_ci * @version 1.0 27bafb9395Sopenharmony_ci */ 28bafb9395Sopenharmony_ci 29bafb9395Sopenharmony_ci/** 30bafb9395Sopenharmony_ci * @file graphic_config.h 31bafb9395Sopenharmony_ci * 32bafb9395Sopenharmony_ci * @brief Provides configuration items required for graphics. 33bafb9395Sopenharmony_ci * 34bafb9395Sopenharmony_ci * @since 1.0 35bafb9395Sopenharmony_ci * @version 1.0 36bafb9395Sopenharmony_ci */ 37bafb9395Sopenharmony_ci 38bafb9395Sopenharmony_ci#ifndef GRAPHIC_LITE_GRAPHIC_CONFIG_H 39bafb9395Sopenharmony_ci#define GRAPHIC_LITE_GRAPHIC_CONFIG_H 40bafb9395Sopenharmony_ci 41bafb9395Sopenharmony_ci#if defined(ENABLE_OHOS_GRAPHIC_UTILS_PRODUCT_CONFIG) && (ENABLE_OHOS_GRAPHIC_UTILS_PRODUCT_CONFIG == 1) 42bafb9395Sopenharmony_ci#include "product_graphic_lite_config.h" 43bafb9395Sopenharmony_ci#endif 44bafb9395Sopenharmony_ci 45bafb9395Sopenharmony_ci#include "gfx_utils/graphic_types.h" 46bafb9395Sopenharmony_ci 47bafb9395Sopenharmony_cinamespace OHOS { 48bafb9395Sopenharmony_ci/** 49bafb9395Sopenharmony_ci * Defines three graphics library versions: lightweight, standard, and extended versions. 50bafb9395Sopenharmony_ci * The three versions have different requirements on the memory and hardware. 51bafb9395Sopenharmony_ci * The standard version is enabled by default. 52bafb9395Sopenharmony_ci * 53bafb9395Sopenharmony_ci * The macros of the versions are defined as follows: 54bafb9395Sopenharmony_ci * Name | Version Description 55bafb9395Sopenharmony_ci * ------------------- | ---------- 56bafb9395Sopenharmony_ci * VERSION_LITE | Lightweight version 57bafb9395Sopenharmony_ci * VERSION_STANDARD | Standard version 58bafb9395Sopenharmony_ci * VERSION_EXTENDED | Extended version 59bafb9395Sopenharmony_ci */ 60bafb9395Sopenharmony_ci#ifdef __LITEOS_M__ 61bafb9395Sopenharmony_ci#define VERSION_LITE 62bafb9395Sopenharmony_ci#elif defined _WIN32 || defined __APPLE__ 63bafb9395Sopenharmony_ci#define VERSION_LITE 64bafb9395Sopenharmony_ci#else 65bafb9395Sopenharmony_ci#define VERSION_STANDARD 66bafb9395Sopenharmony_ci#endif 67bafb9395Sopenharmony_ci 68bafb9395Sopenharmony_ci/* Defines some configurations and their default values on LiteOS and other system platforms. */ 69bafb9395Sopenharmony_ci#ifndef ENABLE_FIXED_POINT 70bafb9395Sopenharmony_ci#define ENABLE_FIXED_POINT 1 71bafb9395Sopenharmony_ci#endif 72bafb9395Sopenharmony_ci 73bafb9395Sopenharmony_ci/** 74bafb9395Sopenharmony_ci * @brief Multi-Font type, which is disabled by default on LiteOS. 75bafb9395Sopenharmony_ci */ 76bafb9395Sopenharmony_ci#ifndef ENABLE_MULTI_FONT 77bafb9395Sopenharmony_ci#define ENABLE_MULTI_FONT 1 78bafb9395Sopenharmony_ci#endif 79bafb9395Sopenharmony_ci 80bafb9395Sopenharmony_ci/** 81bafb9395Sopenharmony_ci * @brief checkBox iamge, which default value = 1 means use the default image, 82bafb9395Sopenharmony_ci * if haven't use checkBox image could set value = 0 to reduce the build resources. 83bafb9395Sopenharmony_ci */ 84bafb9395Sopenharmony_ci#ifndef ENABLE_DEFAULT_CHECKBOX_IMAGE 85bafb9395Sopenharmony_ci#define ENABLE_DEFAULT_CHECKBOX_IMAGE 1 86bafb9395Sopenharmony_ci#endif 87bafb9395Sopenharmony_ci 88bafb9395Sopenharmony_ci/** 89bafb9395Sopenharmony_ci * @brief For vector type font, enable different font size or font family for label. 90bafb9395Sopenharmony_ci */ 91bafb9395Sopenharmony_ci#ifndef ENABLE_SPANNABLE_STRING 92bafb9395Sopenharmony_ci#define ENABLE_SPANNABLE_STRING 0 93bafb9395Sopenharmony_ci#endif 94bafb9395Sopenharmony_ci 95bafb9395Sopenharmony_ci#ifdef __LITEOS_M__ 96bafb9395Sopenharmony_ci/** 97bafb9395Sopenharmony_ci * @brief Font shaping, which is disabled by default on LiteOS. 98bafb9395Sopenharmony_ci * Cannot take effect without ENABLE_ICU. 99bafb9395Sopenharmony_ci */ 100bafb9395Sopenharmony_ci#ifndef ENABLE_SHAPING 101bafb9395Sopenharmony_ci#define ENABLE_SHAPING 0 102bafb9395Sopenharmony_ci#endif 103bafb9395Sopenharmony_ci/** 104bafb9395Sopenharmony_ci * @brief Advanced algorithm for line breaks, which is disabled by default on LiteOS. 105bafb9395Sopenharmony_ci */ 106bafb9395Sopenharmony_ci#ifndef ENABLE_ICU 107bafb9395Sopenharmony_ci#define ENABLE_ICU 0 108bafb9395Sopenharmony_ci#endif 109bafb9395Sopenharmony_ci/** 110bafb9395Sopenharmony_ci * @brief Multi-window, which does not take effect on LiteOS. 111bafb9395Sopenharmony_ci */ 112bafb9395Sopenharmony_ci#ifndef ENABLE_WINDOW 113bafb9395Sopenharmony_ci#define ENABLE_WINDOW 0 114bafb9395Sopenharmony_ci#endif 115bafb9395Sopenharmony_ci/** 116bafb9395Sopenharmony_ci * @brief Display buffer for rendering data refresh, which is disabled by default on LiteOS. 117bafb9395Sopenharmony_ci */ 118bafb9395Sopenharmony_ci#ifndef ENABLE_FRAME_BUFFER 119bafb9395Sopenharmony_ci#define ENABLE_FRAME_BUFFER 1 120bafb9395Sopenharmony_ci#endif 121bafb9395Sopenharmony_ci/** 122bafb9395Sopenharmony_ci * @brief Vector type font, which is enabled by default on LiteOS. 123bafb9395Sopenharmony_ci */ 124bafb9395Sopenharmony_ci#ifndef ENABLE_VECTOR_FONT 125bafb9395Sopenharmony_ci#define ENABLE_VECTOR_FONT 1 126bafb9395Sopenharmony_ci#endif 127bafb9395Sopenharmony_ci/** 128bafb9395Sopenharmony_ci * @brief Bitmap type font, which is disabled by default on LiteOS. 129bafb9395Sopenharmony_ci */ 130bafb9395Sopenharmony_ci#ifndef ENABLE_BITMAP_FONT 131bafb9395Sopenharmony_ci#define ENABLE_BITMAP_FONT 0 132bafb9395Sopenharmony_ci#endif 133bafb9395Sopenharmony_ci/** 134bafb9395Sopenharmony_ci * @brief Static Bitmap type font, which is disabled by default on LiteOS. 135bafb9395Sopenharmony_ci */ 136bafb9395Sopenharmony_ci#ifndef ENABLE_STATIC_FONT 137bafb9395Sopenharmony_ci#define ENABLE_STATIC_FONT 0 138bafb9395Sopenharmony_ci#endif 139bafb9395Sopenharmony_ci 140bafb9395Sopenharmony_ci/** 141bafb9395Sopenharmony_ci * @brief Use bitmap font for TextId multi language convert, use vector font for glyphs. 142bafb9395Sopenharmony_ci * Normally you do not need to enable this macro 143bafb9395Sopenharmony_ci */ 144bafb9395Sopenharmony_ci#ifndef ENABLE_MIX_FONT 145bafb9395Sopenharmony_ci#define ENABLE_MIX_FONT 0 146bafb9395Sopenharmony_ci#endif 147bafb9395Sopenharmony_ci 148bafb9395Sopenharmony_ci/** 149bafb9395Sopenharmony_ci * @brief JPEG and PNG, which is disabled by default on LiteOS. 150bafb9395Sopenharmony_ci */ 151bafb9395Sopenharmony_ci#ifndef ENABLE_JPEG 152bafb9395Sopenharmony_ci#define ENABLE_JPEG 0 153bafb9395Sopenharmony_ci#endif 154bafb9395Sopenharmony_ci#ifndef ENABLE_PNG 155bafb9395Sopenharmony_ci#define ENABLE_PNG 0 156bafb9395Sopenharmony_ci#endif 157bafb9395Sopenharmony_ci 158bafb9395Sopenharmony_ci/** 159bafb9395Sopenharmony_ci * @brief GIF, which is disabled by default on LiteOS. 160bafb9395Sopenharmony_ci */ 161bafb9395Sopenharmony_ci#ifndef ENABLE_GIF 162bafb9395Sopenharmony_ci#define ENABLE_GIF 0 163bafb9395Sopenharmony_ci#endif 164bafb9395Sopenharmony_ci 165bafb9395Sopenharmony_ci/** 166bafb9395Sopenharmony_ci * @brief Fully rectangle render everytime, which is disabled by default on LiteOS. 167bafb9395Sopenharmony_ci */ 168bafb9395Sopenharmony_ci#ifndef FULLY_RENDER 169bafb9395Sopenharmony_ci#define FULLY_RENDER 0 170bafb9395Sopenharmony_ci#endif 171bafb9395Sopenharmony_ci/** 172bafb9395Sopenharmony_ci * @brief Graphics rendering hardware acceleration, which is enabled by default on LiteOS. 173bafb9395Sopenharmony_ci */ 174bafb9395Sopenharmony_ci#ifndef ENABLE_HARDWARE_ACCELERATION 175bafb9395Sopenharmony_ci#define ENABLE_HARDWARE_ACCELERATION 1 176bafb9395Sopenharmony_ci#endif 177bafb9395Sopenharmony_ci/** 178bafb9395Sopenharmony_ci * @brief Graphics rendering hardware acceleration for text, which is disabled by default on LiteOS. 179bafb9395Sopenharmony_ci */ 180bafb9395Sopenharmony_ci#ifndef ENABLE_HARDWARE_ACCELERATION_FOR_TEXT 181bafb9395Sopenharmony_ci#define ENABLE_HARDWARE_ACCELERATION_FOR_TEXT 0 182bafb9395Sopenharmony_ci#endif 183bafb9395Sopenharmony_ci/** 184bafb9395Sopenharmony_ci * @brief Graphics rendering accelerated by gfx_engines, which is disabled by default on LiteOS. 185bafb9395Sopenharmony_ci */ 186bafb9395Sopenharmony_ci#ifndef ENABLE_GFX_ENGINES 187bafb9395Sopenharmony_ci#define ENABLE_GFX_ENGINES 0 188bafb9395Sopenharmony_ci#endif 189bafb9395Sopenharmony_ci/** 190bafb9395Sopenharmony_ci * @brief ARM NEON ability, which is disabled by default on LiteOS. 191bafb9395Sopenharmony_ci */ 192bafb9395Sopenharmony_ci#ifndef ENABLE_ARM_NEON 193bafb9395Sopenharmony_ci#define ENABLE_ARM_NEON 0 194bafb9395Sopenharmony_ci#endif 195bafb9395Sopenharmony_ci#elif defined _WIN32 || defined __APPLE__ 196bafb9395Sopenharmony_ci/** 197bafb9395Sopenharmony_ci * @brief Multi-window, which is disabled by default on WIN32. 198bafb9395Sopenharmony_ci */ 199bafb9395Sopenharmony_ci#ifndef ENABLE_WINDOW 200bafb9395Sopenharmony_ci#define ENABLE_WINDOW 0 201bafb9395Sopenharmony_ci#endif 202bafb9395Sopenharmony_ci/** 203bafb9395Sopenharmony_ci * @brief Display buffer for rendering data refresh, which is disabled by default on WIN32. 204bafb9395Sopenharmony_ci */ 205bafb9395Sopenharmony_ci#ifndef ENABLE_FRAME_BUFFER 206bafb9395Sopenharmony_ci#define ENABLE_FRAME_BUFFER 0 207bafb9395Sopenharmony_ci#endif 208bafb9395Sopenharmony_ci 209bafb9395Sopenharmony_ci#ifndef ENABLE_JPEG 210bafb9395Sopenharmony_ci#define ENABLE_JPEG 1 211bafb9395Sopenharmony_ci#endif 212bafb9395Sopenharmony_ci#ifndef ENABLE_PNG 213bafb9395Sopenharmony_ci#define ENABLE_PNG 1 214bafb9395Sopenharmony_ci#endif 215bafb9395Sopenharmony_ci/** 216bafb9395Sopenharmony_ci * @brief ARM NEON ability, which is disabled by default on WIN32. 217bafb9395Sopenharmony_ci */ 218bafb9395Sopenharmony_ci#ifndef ENABLE_ARM_NEON 219bafb9395Sopenharmony_ci#define ENABLE_ARM_NEON 0 220bafb9395Sopenharmony_ci#endif 221bafb9395Sopenharmony_ci/** 222bafb9395Sopenharmony_ci * @brief Graphics rendering hardware acceleration, which is disabled by default on WIN32. 223bafb9395Sopenharmony_ci */ 224bafb9395Sopenharmony_ci#ifndef ENABLE_HARDWARE_ACCELERATION 225bafb9395Sopenharmony_ci#define ENABLE_HARDWARE_ACCELERATION 0 226bafb9395Sopenharmony_ci#endif 227bafb9395Sopenharmony_ci/** 228bafb9395Sopenharmony_ci * @brief Graphics rendering hardware acceleration for text, which is disabled by default on WIN32. 229bafb9395Sopenharmony_ci */ 230bafb9395Sopenharmony_ci#ifndef ENABLE_HARDWARE_ACCELERATION_FOR_TEXT 231bafb9395Sopenharmony_ci#define ENABLE_HARDWARE_ACCELERATION_FOR_TEXT 0 232bafb9395Sopenharmony_ci#endif 233bafb9395Sopenharmony_ci/** 234bafb9395Sopenharmony_ci * @brief Graphics rendering accelerated by gfx_engines, which is disabled by default on WIN32. 235bafb9395Sopenharmony_ci */ 236bafb9395Sopenharmony_ci#ifndef ENABLE_GFX_ENGINES 237bafb9395Sopenharmony_ci#define ENABLE_GFX_ENGINES 0 238bafb9395Sopenharmony_ci#endif 239bafb9395Sopenharmony_ci 240bafb9395Sopenharmony_ci#else 241bafb9395Sopenharmony_ci/** 242bafb9395Sopenharmony_ci * @brief Multi-window, which is enabled by default on other platforms. 243bafb9395Sopenharmony_ci */ 244bafb9395Sopenharmony_ci#ifndef ENABLE_WINDOW 245bafb9395Sopenharmony_ci#define ENABLE_WINDOW 1 246bafb9395Sopenharmony_ci#endif 247bafb9395Sopenharmony_ci/** 248bafb9395Sopenharmony_ci * @brief Display buffer for rendering data refresh, which is disabled by default on other platforms. 249bafb9395Sopenharmony_ci */ 250bafb9395Sopenharmony_ci#ifndef ENABLE_FRAME_BUFFER 251bafb9395Sopenharmony_ci#define ENABLE_FRAME_BUFFER 0 252bafb9395Sopenharmony_ci#endif 253bafb9395Sopenharmony_ci 254bafb9395Sopenharmony_ci#ifndef ENABLE_JPEG 255bafb9395Sopenharmony_ci#define ENABLE_JPEG 1 256bafb9395Sopenharmony_ci#endif 257bafb9395Sopenharmony_ci#ifndef ENABLE_PNG 258bafb9395Sopenharmony_ci#define ENABLE_PNG 1 259bafb9395Sopenharmony_ci#endif 260bafb9395Sopenharmony_ci/** 261bafb9395Sopenharmony_ci * @brief ARM NEON ability, which is enabled by default on other platforms. 262bafb9395Sopenharmony_ci */ 263bafb9395Sopenharmony_ci#ifndef ENABLE_ARM_NEON 264bafb9395Sopenharmony_ci#define ENABLE_ARM_NEON 1 265bafb9395Sopenharmony_ci#endif 266bafb9395Sopenharmony_ci/** 267bafb9395Sopenharmony_ci * @brief Graphics rendering hardware acceleration, which is disabled by default on other platforms. 268bafb9395Sopenharmony_ci */ 269bafb9395Sopenharmony_ci#ifndef ENABLE_HARDWARE_ACCELERATION 270bafb9395Sopenharmony_ci#define ENABLE_HARDWARE_ACCELERATION 0 271bafb9395Sopenharmony_ci#endif 272bafb9395Sopenharmony_ci/** 273bafb9395Sopenharmony_ci * @brief Graphics rendering hardware acceleration for text, which is disabled by default on other platforms. 274bafb9395Sopenharmony_ci */ 275bafb9395Sopenharmony_ci#ifndef ENABLE_HARDWARE_ACCELERATION_FOR_TEXT 276bafb9395Sopenharmony_ci#define ENABLE_HARDWARE_ACCELERATION_FOR_TEXT 0 277bafb9395Sopenharmony_ci#endif 278bafb9395Sopenharmony_ci/** 279bafb9395Sopenharmony_ci * @brief Graphics rendering accelerated by gfx_engines, which is enabled by default on other platforms. 280bafb9395Sopenharmony_ci */ 281bafb9395Sopenharmony_ci#ifndef ENABLE_GFX_ENGINES 282bafb9395Sopenharmony_ci#define ENABLE_GFX_ENGINES 1 283bafb9395Sopenharmony_ci#endif // ENABLE_GFX_ENGINES 284bafb9395Sopenharmony_ci#endif 285bafb9395Sopenharmony_ci 286bafb9395Sopenharmony_ci#ifndef ENABLE_ROTATE_INPUT 287bafb9395Sopenharmony_ci#define ENABLE_ROTATE_INPUT 1 288bafb9395Sopenharmony_ci#endif 289bafb9395Sopenharmony_ci 290bafb9395Sopenharmony_ci#ifndef ENABLE_VIBRATOR 291bafb9395Sopenharmony_ci#define ENABLE_VIBRATOR 1 292bafb9395Sopenharmony_ci#endif 293bafb9395Sopenharmony_ci 294bafb9395Sopenharmony_ci#ifndef ENABLE_FOCUS_MANAGER 295bafb9395Sopenharmony_ci#define ENABLE_FOCUS_MANAGER 1 296bafb9395Sopenharmony_ci#endif 297bafb9395Sopenharmony_ci 298bafb9395Sopenharmony_ci/** 299bafb9395Sopenharmony_ci * @brief Graphics local rendering, which is disabled by default. 300bafb9395Sopenharmony_ci */ 301bafb9395Sopenharmony_ci#ifndef LOCAL_RENDER 302bafb9395Sopenharmony_ci#define LOCAL_RENDER 0 303bafb9395Sopenharmony_ci#endif 304bafb9395Sopenharmony_ci 305bafb9395Sopenharmony_ci/** 306bafb9395Sopenharmony_ci * @brief Actually use ARM NEON optimization. 307bafb9395Sopenharmony_ci * __ARM_NEON__ and __ARM_NEON are set by the compiler according to the compilation option -mfpu=neon 308bafb9395Sopenharmony_ci */ 309bafb9395Sopenharmony_ci#if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && ENABLE_ARM_NEON == 1 310bafb9395Sopenharmony_ci#define ARM_NEON_OPT 311bafb9395Sopenharmony_ci#endif 312bafb9395Sopenharmony_ci 313bafb9395Sopenharmony_ci/** 314bafb9395Sopenharmony_ci * @brief Graphics bottom-layer RGBA, which is enabled by default. 315bafb9395Sopenharmony_ci */ 316bafb9395Sopenharmony_ci#ifndef ENABLE_BUFFER_RGBA 317bafb9395Sopenharmony_ci#define ENABLE_BUFFER_RGBA 1 318bafb9395Sopenharmony_ci#endif 319bafb9395Sopenharmony_ci/** 320bafb9395Sopenharmony_ci * @brief Debug mode, which is disabled by default. 321bafb9395Sopenharmony_ci */ 322bafb9395Sopenharmony_ci#ifndef ENABLE_DEBUG 323bafb9395Sopenharmony_ci#define ENABLE_DEBUG 1 324bafb9395Sopenharmony_ci#endif 325bafb9395Sopenharmony_ci/** 326bafb9395Sopenharmony_ci * @brief Memory hook, which is enabled by default. The system memory allocation is taken over after it is enabled. 327bafb9395Sopenharmony_ci */ 328bafb9395Sopenharmony_ci#ifndef ENABLE_MEMORY_HOOKS 329bafb9395Sopenharmony_ci#define ENABLE_MEMORY_HOOKS 0 330bafb9395Sopenharmony_ci#endif 331bafb9395Sopenharmony_ci/** 332bafb9395Sopenharmony_ci * @brief Function for monitoring the image refresh frame rate, which is disabled by default. 333bafb9395Sopenharmony_ci */ 334bafb9395Sopenharmony_ci#ifndef ENABLE_FPS_SUPPORT 335bafb9395Sopenharmony_ci#define ENABLE_FPS_SUPPORT 0 336bafb9395Sopenharmony_ci#endif 337bafb9395Sopenharmony_ci/** 338bafb9395Sopenharmony_ci * @brief Anti-aliasing, which is enabled by default. 339bafb9395Sopenharmony_ci */ 340bafb9395Sopenharmony_ci#ifndef ENABLE_ANTIALIAS 341bafb9395Sopenharmony_ci#define ENABLE_ANTIALIAS 1 342bafb9395Sopenharmony_ci#endif 343bafb9395Sopenharmony_ci/** 344bafb9395Sopenharmony_ci * @brief Rectangle anti-aliasing, which is disabled by default. 345bafb9395Sopenharmony_ci */ 346bafb9395Sopenharmony_ci#ifndef ENABLE_RECT_ANTIALIAS 347bafb9395Sopenharmony_ci#define ENABLE_RECT_ANTIALIAS 0 348bafb9395Sopenharmony_ci#endif 349bafb9395Sopenharmony_ci/** 350bafb9395Sopenharmony_ci * @brief Font color mode, which is disabled by default. 351bafb9395Sopenharmony_ci * After it is enabled, the font color mode is set to <b>4</b> to accelerate font rendering. 352bafb9395Sopenharmony_ci */ 353bafb9395Sopenharmony_ci#ifndef ENABLE_SPEC_FONT 354bafb9395Sopenharmony_ci#define ENABLE_SPEC_FONT 0 355bafb9395Sopenharmony_ci#endif 356bafb9395Sopenharmony_ci/** 357bafb9395Sopenharmony_ci * @brief Log function of a graphics subsystem, which is disabled by default 358bafb9395Sopenharmony_ci */ 359bafb9395Sopenharmony_ci#ifndef ENABLE_GRAPHIC_LOG 360bafb9395Sopenharmony_ci#define ENABLE_GRAPHIC_LOG 0 361bafb9395Sopenharmony_ci#endif 362bafb9395Sopenharmony_ci/** 363bafb9395Sopenharmony_ci * @brief Performance tracking for debugging, which is disabled by default. 364bafb9395Sopenharmony_ci */ 365bafb9395Sopenharmony_ci#ifndef ENABLE_DEBUG_PERFORMANCE_TRACE 366bafb9395Sopenharmony_ci#define ENABLE_DEBUG_PERFORMANCE_TRACE 0 367bafb9395Sopenharmony_ci#endif 368bafb9395Sopenharmony_ci/** 369bafb9395Sopenharmony_ci * @brief Function for receiving input events in screen-off mode, which is disabled by default. 370bafb9395Sopenharmony_ci */ 371bafb9395Sopenharmony_ci#ifndef ENABLE_AOD 372bafb9395Sopenharmony_ci#define ENABLE_AOD 0 373bafb9395Sopenharmony_ci#endif 374bafb9395Sopenharmony_ci 375bafb9395Sopenharmony_ci/** 376bafb9395Sopenharmony_ci * @brief Defines the log level. A smaller value indicates a higher priority. 377bafb9395Sopenharmony_ci * Logs whose priorities are higher than a specified level can be recorded. 378bafb9395Sopenharmony_ci * Log levels: 379bafb9395Sopenharmony_ci * NONE: disabling logs 380bafb9395Sopenharmony_ci * FATAL: fatal level 381bafb9395Sopenharmony_ci * ERROR: error level 382bafb9395Sopenharmony_ci * WARN: warning level 383bafb9395Sopenharmony_ci * INFO: info level 384bafb9395Sopenharmony_ci * DEBUG: debugging level 385bafb9395Sopenharmony_ci */ 386bafb9395Sopenharmony_ci#ifndef GRAPHIC_LOG_LEVEL 387bafb9395Sopenharmony_ci#define GRAPHIC_LOG_LEVEL 5 388bafb9395Sopenharmony_ci#endif 389bafb9395Sopenharmony_ci/** 390bafb9395Sopenharmony_ci * @brief Defines the color depth of graphics rendering. The default value is <b>32</b> bits. 391bafb9395Sopenharmony_ci * The value can be <b>16</b> or <b>32</b>. 392bafb9395Sopenharmony_ci */ 393bafb9395Sopenharmony_ci#ifndef COLOR_DEPTH 394bafb9395Sopenharmony_ci#define COLOR_DEPTH 32 395bafb9395Sopenharmony_ci#endif 396bafb9395Sopenharmony_ci 397bafb9395Sopenharmony_ci/** 398bafb9395Sopenharmony_ci * @brief Represents the code number of the layer pixel format. 399bafb9395Sopenharmony_ci * 0: LAYER_PF_ARGB1555 400bafb9395Sopenharmony_ci * 1: LAYER_PF_ARGB8888 401bafb9395Sopenharmony_ci * Other: LAYER_PF_ARGB8888 402bafb9395Sopenharmony_ci */ 403bafb9395Sopenharmony_ci#ifndef LAYER_PF_CODE 404bafb9395Sopenharmony_ci#define LAYER_PF_CODE 1 405bafb9395Sopenharmony_ci#endif 406bafb9395Sopenharmony_ci 407bafb9395Sopenharmony_ci#if LAYER_PF_CODE == 0 408bafb9395Sopenharmony_ci#define LAYER_PF_ARGB1555 409bafb9395Sopenharmony_ci#elif LAYER_PF_CODE == 1 410bafb9395Sopenharmony_ci#define LAYER_PF_ARGB8888 411bafb9395Sopenharmony_ci#else 412bafb9395Sopenharmony_ci#define LAYER_PF_ARGB8888 413bafb9395Sopenharmony_ci#endif 414bafb9395Sopenharmony_ci 415bafb9395Sopenharmony_ci/** 416bafb9395Sopenharmony_ci * @brief Defines whether the C library math function is supported. 417bafb9395Sopenharmony_ci * 0: Unsupport 418bafb9395Sopenharmony_ci * 1: Support 419bafb9395Sopenharmony_ci */ 420bafb9395Sopenharmony_ci#ifndef ENABLE_CMATH 421bafb9395Sopenharmony_ci#define ENABLE_CMATH 1 422bafb9395Sopenharmony_ci#endif 423bafb9395Sopenharmony_ci 424bafb9395Sopenharmony_ci/** 425bafb9395Sopenharmony_ci * @brief Defines the file name of default vector font. 426bafb9395Sopenharmony_ci */ 427bafb9395Sopenharmony_ci#if ENABLE_VECTOR_FONT 428bafb9395Sopenharmony_ci 429bafb9395Sopenharmony_ci#ifndef DEFAULT_VECTOR_FONT_FILENAME 430bafb9395Sopenharmony_ci#define DEFAULT_VECTOR_FONT_FILENAME "SourceHanSansSC-Regular.otf" 431bafb9395Sopenharmony_ci#endif // DEFAULT_VECTOR_FONT_FILENAME 432bafb9395Sopenharmony_ci 433bafb9395Sopenharmony_ci#else // ENABLE_VECTOR_FONT 434bafb9395Sopenharmony_ci 435bafb9395Sopenharmony_ci#ifndef DEFAULT_VECTOR_FONT_FILENAME 436bafb9395Sopenharmony_ci#define DEFAULT_VECTOR_FONT_FILENAME "SourceHanSansSC-Regular" 437bafb9395Sopenharmony_ci#endif // DEFAULT_VECTOR_FONT_FILENAME 438bafb9395Sopenharmony_ci 439bafb9395Sopenharmony_ci#endif // ENABLE_VECTOR_FONT 440bafb9395Sopenharmony_ci 441bafb9395Sopenharmony_ci/* Default font size. The default value is <b>18</b>. */ 442bafb9395Sopenharmony_cistatic constexpr uint8_t DEFAULT_VECTOR_FONT_SIZE = 18; 443bafb9395Sopenharmony_ci/* Max font search number for UiMultiFontManager. */ 444bafb9395Sopenharmony_cistatic constexpr uint8_t MAX_FONT_SEARCH_NUM = 26; 445bafb9395Sopenharmony_ci/* Defines the file name of default line break rule. */ 446bafb9395Sopenharmony_ci#ifndef DEFAULT_LINE_BREAK_RULE_FILENAME 447bafb9395Sopenharmony_ci#define DEFAULT_LINE_BREAK_RULE_FILENAME "line_cj.brk" 448bafb9395Sopenharmony_ci#endif 449bafb9395Sopenharmony_ci 450bafb9395Sopenharmony_ci#ifndef DEFAULT_MAX_CACHE_ENTRY_NUM 451bafb9395Sopenharmony_ci#define DEFAULT_MAX_CACHE_ENTRY_NUM 64 452bafb9395Sopenharmony_ci#endif // DEFAULT_MAX_CACHE_ENTRY_NUM 453bafb9395Sopenharmony_ci 454bafb9395Sopenharmony_ci/* Defines some configurations and their default values on LiteOS and other system platforms. */ 455bafb9395Sopenharmony_ci#ifdef __LITEOS_M__ 456bafb9395Sopenharmony_ci 457bafb9395Sopenharmony_ci/* Resolution width of a graphics display screen. The default value is <b>454</b>. */ 458bafb9395Sopenharmony_ci#ifndef HORIZONTAL_RESOLUTION 459bafb9395Sopenharmony_ci#define HORIZONTAL_RESOLUTION 454 460bafb9395Sopenharmony_ci#endif 461bafb9395Sopenharmony_ci 462bafb9395Sopenharmony_ci/* Resolution height of a graphics display screen. The default value is <b>454</b>. */ 463bafb9395Sopenharmony_ci#ifndef VERTICAL_RESOLUTION 464bafb9395Sopenharmony_ci#define VERTICAL_RESOLUTION 454 465bafb9395Sopenharmony_ci#endif // VERTICAL_RESOLUTION 466bafb9395Sopenharmony_ci 467bafb9395Sopenharmony_ci#elif defined _WIN32 || defined __APPLE__ // __LITEOS_M__ 468bafb9395Sopenharmony_ci 469bafb9395Sopenharmony_ci/* Resolution width of a graphics display screen. The default value is <b>454</b>. */ 470bafb9395Sopenharmony_ci#ifndef HORIZONTAL_RESOLUTION 471bafb9395Sopenharmony_ci#define HORIZONTAL_RESOLUTION 960 472bafb9395Sopenharmony_ci#endif 473bafb9395Sopenharmony_ci 474bafb9395Sopenharmony_ci/* Resolution height of a graphics display screen. The default value is <b>454</b>. */ 475bafb9395Sopenharmony_ci#ifndef VERTICAL_RESOLUTION 476bafb9395Sopenharmony_ci#define VERTICAL_RESOLUTION 480 477bafb9395Sopenharmony_ci#endif 478bafb9395Sopenharmony_ci 479bafb9395Sopenharmony_ci#else 480bafb9395Sopenharmony_ci 481bafb9395Sopenharmony_ci/* Resolution width of a graphics display screen. The default value is <b>960</b>. */ 482bafb9395Sopenharmony_ci#ifndef HORIZONTAL_RESOLUTION 483bafb9395Sopenharmony_ci#define HORIZONTAL_RESOLUTION 960 484bafb9395Sopenharmony_ci#endif 485bafb9395Sopenharmony_ci 486bafb9395Sopenharmony_ci/* Resolution height of a graphics display screen. The default value is <b>480</b>. */ 487bafb9395Sopenharmony_ci#ifndef VERTICAL_RESOLUTION 488bafb9395Sopenharmony_ci#define VERTICAL_RESOLUTION 480 489bafb9395Sopenharmony_ci#endif 490bafb9395Sopenharmony_ci 491bafb9395Sopenharmony_ci#endif 492bafb9395Sopenharmony_ci 493bafb9395Sopenharmony_ci#ifndef VERSION_LITE 494bafb9395Sopenharmony_cistatic constexpr const char* MEDIA_IMAGE_PLAY_CENTER = "/user/data/videoplayer_play_center.png"; 495bafb9395Sopenharmony_cistatic constexpr const char* MEDIA_IMAGE_PLAY = "/user/data/videoplayer_play.png"; 496bafb9395Sopenharmony_cistatic constexpr const char* MEDIA_IMAGE_PAUSE = "/user/data/videoplayer_pause.png"; 497bafb9395Sopenharmony_cistatic constexpr const char* MEDIA_IMAGE_VOLUME = "/user/data/videoplayer_volume.png"; 498bafb9395Sopenharmony_cistatic constexpr const char* MEDIA_IMAGE_MUTE = "/user/data/videoplayer_mute.png"; 499bafb9395Sopenharmony_ci#endif 500bafb9395Sopenharmony_ci 501bafb9395Sopenharmony_ci/* Defines some configurations and their default values on LiteOS and other system platforms. */ 502bafb9395Sopenharmony_ci#if defined QT_COMPILER 503bafb9395Sopenharmony_ci/* Default file path for DOM tree logs */ 504bafb9395Sopenharmony_cistatic constexpr const char* DEFAULT_DUMP_DOM_TREE_PATH = ".\\dump_dom_tree.json"; 505bafb9395Sopenharmony_ci 506bafb9395Sopenharmony_ci/* Default file path for font */ 507bafb9395Sopenharmony_ci#ifndef VECTOR_FONT_DIR 508bafb9395Sopenharmony_ci#define VECTOR_FONT_DIR "..\\..\\simulator\\font\\" 509bafb9395Sopenharmony_ci#endif 510bafb9395Sopenharmony_ci 511bafb9395Sopenharmony_ci#elif defined _WIN32 // QT_COMPILER 512bafb9395Sopenharmony_ci 513bafb9395Sopenharmony_ci/* Default file path for DOM tree logs */ 514bafb9395Sopenharmony_cistatic constexpr const char* DEFAULT_DUMP_DOM_TREE_PATH = ".\\dump_dom_tree.json"; 515bafb9395Sopenharmony_ci/* Default file path for font */ 516bafb9395Sopenharmony_ci#ifndef VECTOR_FONT_DIR 517bafb9395Sopenharmony_ci#define VECTOR_FONT_DIR "..\\..\\tools\\font\\font_tool\\font_tool\\font\\" 518bafb9395Sopenharmony_ci#endif 519bafb9395Sopenharmony_ci 520bafb9395Sopenharmony_ci#elif defined __LITEOS_M__ // QT_COMPILER 521bafb9395Sopenharmony_ci 522bafb9395Sopenharmony_ci/* Default file path for screenshots */ 523bafb9395Sopenharmony_cistatic constexpr const char* DEFAULT_SCREENSHOT_PATH = "user/log/screenshot.bin"; 524bafb9395Sopenharmony_ci/* Default file path for DOM tree logs */ 525bafb9395Sopenharmony_cistatic constexpr const char* DEFAULT_DUMP_DOM_TREE_PATH = "user/log/dump_dom_tree.json"; 526bafb9395Sopenharmony_ci/* Default file path for font */ 527bafb9395Sopenharmony_ci#ifndef VECTOR_FONT_DIR 528bafb9395Sopenharmony_ci#define VECTOR_FONT_DIR "/user/data/" 529bafb9395Sopenharmony_ci#endif 530bafb9395Sopenharmony_ci 531bafb9395Sopenharmony_ci#else // QT_COMPILER 532bafb9395Sopenharmony_ci 533bafb9395Sopenharmony_ci/* Default file path for screenshots */ 534bafb9395Sopenharmony_cistatic constexpr const char* DEFAULT_SCREENSHOT_PATH = "/storage/screenshot.bin"; 535bafb9395Sopenharmony_ci/* Default file path for DOM tree logs */ 536bafb9395Sopenharmony_cistatic constexpr const char* DEFAULT_DUMP_DOM_TREE_PATH = "/storage/dump_dom_tree.json"; 537bafb9395Sopenharmony_ci/* Default file path for font */ 538bafb9395Sopenharmony_ci#ifndef VECTOR_FONT_DIR 539bafb9395Sopenharmony_ci#define VECTOR_FONT_DIR "/user/data/" 540bafb9395Sopenharmony_ci#endif 541bafb9395Sopenharmony_ci 542bafb9395Sopenharmony_ci#endif // QT_COMPILER 543bafb9395Sopenharmony_ci/* Default task execution period. The default value is <b>16</b> ms. */ 544bafb9395Sopenharmony_cistatic constexpr uint8_t DEFAULT_TASK_PERIOD = 16; 545bafb9395Sopenharmony_ci/* Window manager execution period. The default value is <b>16</b> ms. */ 546bafb9395Sopenharmony_cistatic constexpr uint8_t WMS_MAIN_TASK_PERIOD = 16; 547bafb9395Sopenharmony_ci/* Maximum number of cached images. The default value is <b>5</b>. */ 548bafb9395Sopenharmony_ci#ifndef IMG_CACHE_SIZE 549bafb9395Sopenharmony_ci#define IMG_CACHE_SIZE 5 550bafb9395Sopenharmony_ci#endif 551bafb9395Sopenharmony_cistatic constexpr uint8_t INDEV_READ_PERIOD = 10; /* Input event read cycle. The default value is <b>10</b> ms. */ 552bafb9395Sopenharmony_ci/* Drag distance threshold of a drag event. The default value is <b>10px</b>. */ 553bafb9395Sopenharmony_cistatic constexpr uint8_t INDEV_DRAG_LIMIT = 10; 554bafb9395Sopenharmony_ci/* Maximum depth of view nesting. The default value is <b>64</b>. */ 555bafb9395Sopenharmony_cistatic constexpr uint8_t COMPONENT_NESTING_DEPTH = 64; 556bafb9395Sopenharmony_ci/* Long-press event threshold. The default value is <b>1000</b> ms. */ 557bafb9395Sopenharmony_cistatic constexpr uint16_t INDEV_LONG_PRESS_TIME = 1000; 558bafb9395Sopenharmony_ci/* Delay for reporting a press event on a draggable object. The default value is <b>100</b> ms. */ 559bafb9395Sopenharmony_cistatic constexpr uint16_t INDEV_PRESS_TIME_IN_DRAG = 100; 560bafb9395Sopenharmony_ci/* Maximum number of bytes in a text that can be continuously displayed. The default value is <b>4096</b> bytes. */ 561bafb9395Sopenharmony_cistatic constexpr uint16_t MAX_TEXT_LENGTH = 4096; 562bafb9395Sopenharmony_ci/* Maximum value of the graphic display range. The default value is <b>16383px</b>. */ 563bafb9395Sopenharmony_cistatic constexpr int32_t COORD_MAX = 16383; 564bafb9395Sopenharmony_ci/* Minimum value of the graphic display range. The default value is <b>-16384px</b>. */ 565bafb9395Sopenharmony_cistatic constexpr int32_t COORD_MIN = -16384; 566bafb9395Sopenharmony_cistatic constexpr uint32_t HARFBUZ_CACHE_LENGTH = 0x19000; // 100K 567bafb9395Sopenharmony_cistatic constexpr uint16_t MAX_LINE_WIDTH = 128; 568bafb9395Sopenharmony_ci/* Maximum length of a QR code string. The default value is <b>2048</b>. */ 569bafb9395Sopenharmony_cistatic constexpr uint32_t QRCODE_VAL_MAX = 2048; 570bafb9395Sopenharmony_ci 571bafb9395Sopenharmony_ci/* Rotate sensitivity factor. The default value is <b>1.0<b> time. */ 572bafb9395Sopenharmony_cistatic constexpr float ROTATE_SENSITIVITY = 1.0; 573bafb9395Sopenharmony_ci/* Rotate sensitivity factor of UISwipeView. The default value is <b>2.8<b> time. */ 574bafb9395Sopenharmony_cistatic constexpr float DEFAULT_SWIPE_VIEW_ROTATE_FACTOR = 2.8; 575bafb9395Sopenharmony_ci/* Rotate sensitivity factor of UIList. The default value is <b>1.2<b> time. */ 576bafb9395Sopenharmony_cistatic constexpr float DEFAULT_LIST_ROTATE_FACTOR = 1.2; 577bafb9395Sopenharmony_ci/* Rotate sensitivity factor of UIPicker. The default value is <b>1.2<b> time. */ 578bafb9395Sopenharmony_cistatic constexpr float DEFAULT_PICKER_ROTATE_FACTOR = 1.2; 579bafb9395Sopenharmony_ci/* Rotate sensitivity factor of UIScrollView. The default value is <b>2.0<b> time. */ 580bafb9395Sopenharmony_cistatic constexpr float DEFAULT_SCROLL_VIEW_ROTATE_FACTOR = 2.0; 581bafb9395Sopenharmony_ci#ifdef _WIN32 582bafb9395Sopenharmony_ci/* Rotate sensitivity factor of UISlider. The default value is <b>-1<b> time. */ 583bafb9395Sopenharmony_cistatic constexpr float DEFAULT_SLIDER_ROTATE_FACTOR = -1; 584bafb9395Sopenharmony_ci#else 585bafb9395Sopenharmony_ci/* Rotate sensitivity factor of UISlider. The default value is <b>-0.05<b> time. */ 586bafb9395Sopenharmony_cistatic constexpr float DEFAULT_SLIDER_ROTATE_FACTOR = -0.05; 587bafb9395Sopenharmony_ci#endif 588bafb9395Sopenharmony_ci/* When rotating the crown, a vibration is triggered every 30 pixels. */ 589bafb9395Sopenharmony_cistatic constexpr uint8_t DEFAULT_SCROLL_VIEW_VIBRATION_LEN = 30; 590bafb9395Sopenharmony_ci/* calculate drag throw distance when rotating, last rotate distance * ROTATE_DISTANCE_COEFFICIENT */ 591bafb9395Sopenharmony_cistatic constexpr uint8_t ABSTRACT_ROTATE_DISTANCE_COEFF = 20; 592bafb9395Sopenharmony_cistatic constexpr uint8_t SCROLLVIEW_ROTATE_DISTANCE_COEFF = 20; 593bafb9395Sopenharmony_cistatic constexpr uint8_t PICKERVIEW_ROTATE_DISTANCE_COEFF = 20; 594bafb9395Sopenharmony_cistatic constexpr uint8_t LIST_ROTATE_DISTANCE_COEFF = 20; 595bafb9395Sopenharmony_ci/* calculate rotate throw threshold when rotating the crown, width or height / DEFAULT_ROTATE_THROW_THRESHOLD */ 596bafb9395Sopenharmony_cistatic constexpr uint8_t ABSTRACT_ROTATE_THROW_THRESHOLD = 4; 597bafb9395Sopenharmony_cistatic constexpr uint8_t SCROLLVIEW_ROTATE_THROW_THRESHOLD = 4; 598bafb9395Sopenharmony_cistatic constexpr uint8_t PICKERVIEW_ROTATE_THROW_THRESHOLD = 4; 599bafb9395Sopenharmony_cistatic constexpr uint8_t LIST_ROTATE_THROW_THRESHOLD = 4; 600bafb9395Sopenharmony_ci} // namespace OHOS 601bafb9395Sopenharmony_ci#endif // GRAPHIC_LITE_GRAPHIC_CONFIG_H 602