├── .clang-format ├── .commitlintrc.json ├── .github └── workflows │ └── ccpp.yml ├── .gitignore ├── .travis.yml ├── .vscode └── settings.json ├── CHANGELOG.md ├── CHANGELOG.zh-cn.md ├── LICENSE ├── README.md ├── README.zh-cn.md ├── UWP ├── UWP.vcxproj └── UWP.vcxproj.filters ├── demo ├── app │ └── assets │ │ ├── images │ │ └── lcui-logo.png │ │ └── views │ │ ├── documentation.xml │ │ ├── home.xml │ │ └── main.xml ├── demo.vcxproj ├── demo.vcxproj.filters ├── demo.vcxproj.user ├── include │ └── ui.h ├── src │ ├── main.c │ ├── navigation.c │ ├── scss │ │ └── demo.scss │ └── ui │ │ ├── helpers │ │ └── ui_helper.c │ │ └── views │ │ ├── documentation-view.c │ │ ├── home-view.c │ │ ├── message-view.c │ │ ├── navbar.c │ │ └── notification-view.c └── xmake.lua ├── dist └── app │ └── assets │ ├── fonts │ └── iconfont.ttf │ └── stylesheets │ └── lc-design.css ├── docs ├── components │ ├── alerts.md │ ├── buttons.md │ ├── checkbox.md │ ├── dropdowns.md │ ├── forms.md │ ├── list-group.md │ ├── message.md │ ├── modal.md │ ├── notification.md │ ├── radio.md │ ├── rate.md │ ├── scrollbar.md │ ├── spinners.md │ ├── switch.md │ └── tooltips.md ├── content │ ├── icons.md │ └── typography.md ├── getting-started │ └── introduction.md ├── images │ └── preview.png └── layout │ ├── grid.md │ └── overview.md ├── include ├── LCDesign.h └── LCDesign │ ├── build.h │ └── ui │ ├── components.h │ ├── components │ ├── alert.h │ ├── checkbox.h │ ├── dropdown.h │ ├── icon.h │ ├── img.h │ ├── label.h │ ├── message.h │ ├── modal.h │ ├── notification.h │ ├── password.h │ ├── radio-group.h │ ├── radio.h │ ├── rate.h │ ├── spinner.h │ ├── switch.h │ ├── tooltip.h │ └── typography.h │ ├── dismiss.h │ └── toggle.h ├── lcpkg.json ├── main.sln ├── main.vcxproj ├── main.vcxproj.filters ├── package-lock.json ├── package.json ├── scripts ├── build-bin.bat ├── build-bin.js ├── build-demo-bin.bat ├── build-demo-bin.js ├── build-demo-docs.py ├── build-font.js ├── demo.js └── msbuild.js ├── src ├── main.c ├── scss │ ├── _alert.scss │ ├── _buttons.scss │ ├── _checkbox.scss │ ├── _close.scss │ ├── _dropdown.scss │ ├── _font.scss │ ├── _forms.scss │ ├── _functions.scss │ ├── _grid.scss │ ├── _iconfont.scss │ ├── _list-group.scss │ ├── _message.scss │ ├── _mixins.scss │ ├── _modal.scss │ ├── _nav.scss │ ├── _navbar.scss │ ├── _notification.scss │ ├── _radio.scss │ ├── _rate.scss │ ├── _reboot.scss │ ├── _switch.scss │ ├── _tooltip.scss │ ├── _type.scss │ ├── _utilities.scss │ ├── _variables.scss │ ├── font │ │ ├── _ubuntu.scss │ │ └── _windows.scss │ ├── iconfont │ │ ├── _core.scss │ │ ├── _extras.scss │ │ ├── _icons.scss │ │ └── _path.scss │ ├── lc-design.scss │ ├── mixins │ │ ├── _alert.scss │ │ ├── _background-variant.scss │ │ ├── _border-radius.scss │ │ ├── _box-shadow.scss │ │ ├── _buttons.scss │ │ ├── _float.scss │ │ ├── _forms.scss │ │ ├── _gradients.scss │ │ ├── _grid-framework.scss │ │ ├── _grid.scss │ │ ├── _hover.scss │ │ ├── _list-group.scss │ │ ├── _nav-divider.scss │ │ ├── _text-emphasis.scss │ │ └── _text.scss │ └── utilities │ │ ├── _background.scss │ │ ├── _float.scss │ │ ├── _layout.scss │ │ ├── _spacing.scss │ │ └── _text.scss └── ui │ ├── components │ ├── alert.c │ ├── checkbox.c │ ├── dropdown.c │ ├── icon.c │ ├── img.c │ ├── label.c │ ├── message.c │ ├── modal.c │ ├── notification.c │ ├── password.c │ ├── radio-group.c │ ├── radio.c │ ├── rate.c │ ├── spinner.c │ ├── switch.c │ ├── tooltip.c │ └── typography.c │ ├── dismiss.c │ └── toggle.c └── xmake.lua /.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | BasedOnStyle: Google 3 | IndentWidth: 8 4 | AlignAfterOpenBracket: Align 5 | AlignOperands: true 6 | AlignTrailingComments: true 7 | AllowAllParametersOfDeclarationOnNextLine: false 8 | AllowShortIfStatementsOnASingleLine: false 9 | AlwaysBreakBeforeMultilineStrings: false 10 | AllowShortFunctionsOnASingleLine: None 11 | BinPackArguments: true 12 | BinPackParameters: true 13 | BreakBeforeBraces: Linux 14 | ColumnLimit: 80 15 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 16 | ConstructorInitializerIndentWidth: 72 17 | Cpp11BracedListStyle: false 18 | IndentCaseLabels: false 19 | IndentWrappedFunctionNames: false 20 | MaxEmptyLinesToKeep: 1 21 | NamespaceIndentation: All 22 | PointerAlignment: Right 23 | ReflowComments: true 24 | SpaceAfterCStyleCast: false 25 | SpaceBeforeAssignmentOperators: true 26 | SpaceBeforeParens: ControlStatements 27 | SpaceInEmptyParentheses: false 28 | SpacesBeforeTrailingComments: 4 29 | SpacesInAngles: false 30 | SpacesInCStyleCastParentheses: false 31 | SpacesInContainerLiterals: false 32 | SpacesInParentheses: false 33 | SpacesInSquareBrackets: false 34 | SortIncludes: false 35 | UseTab: ForContinuationAndIndentation 36 | -------------------------------------------------------------------------------- /.commitlintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "header-min-length": [2, "always", 1], 4 | "header-max-length": [2, "always", 72], 5 | "subject-case": [0] 6 | }, 7 | "extends": ["@commitlint/config-conventional"] 8 | } 9 | -------------------------------------------------------------------------------- /.github/workflows/ccpp.yml: -------------------------------------------------------------------------------- 1 | name: C/C++ CI 2 | 3 | on: [push] 4 | 5 | jobs: 6 | build: 7 | 8 | runs-on: ubuntu-latest 9 | 10 | steps: 11 | - uses: actions/checkout@v1 12 | - name: install xmake 13 | uses: xmake-io/github-action-setup-xmake@v1.0.1 14 | - name: install LCUI 15 | run: | 16 | wget https://github.com/lc-soft/LCUI/archive/develop.zip -O LCUI-develop.zip 17 | unzip LCUI-develop.zip 18 | rm LCUI-develop.zip 19 | cd LCUI-develop 20 | sh ./autogen.sh 21 | ./configure 22 | make 23 | sudo make install 24 | - name: install Python packages 25 | run: pip install misaka pygments 26 | - name: install Node.js packages 27 | run: npm install 28 | - name: build 29 | run: | 30 | xmake config -o build/xmake 31 | npm run build 32 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | dist/lib 3 | .vs 4 | *.pdb 5 | *.ipdb 6 | *.iobj 7 | *.exe 8 | *.log 9 | *.lib 10 | *.dll 11 | *.d 12 | *.tlog 13 | .xmake 14 | demo/app/assets/stylesheets 15 | demo/app/assets/fonts 16 | demo/app/assets/views 17 | demo/build 18 | vendor 19 | build 20 | lcpkg 21 | demo/app/demo 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | dist: bionic 2 | language: c 3 | compiler: 4 | - gcc 5 | 6 | before_install: 7 | - mkdir .tmp 8 | - cd .tmp 9 | - bash <(curl -fsSL https://raw.githubusercontent.com/tboox/xmake/master/scripts/get.sh) 10 | - source ~/.xmake/profile 11 | - wget https://github.com/lc-soft/LCUI/archive/develop.zip -O LCUI-develop.zip 12 | - unzip LCUI-develop.zip 13 | - rm LCUI-develop.zip 14 | - cd LCUI-develop 15 | - sh ./autogen.sh 16 | - ./configure 17 | - make 18 | - sudo make install 19 | - cd ../.. 20 | - rm -rf .tmp 21 | - npm install 22 | - pip install misaka pygments 23 | 24 | before_script: 25 | - ./node_modules/.bin/commitlint-travis 26 | 27 | script: 28 | - xmake config -o build/xmake 29 | - npm run build 30 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // 将设置放入此文件中以覆盖默认值和用户设置。 2 | { 3 | "[xml]": { 4 | "editor.insertSpaces": true, 5 | "editor.tabSize": 2 6 | }, 7 | "[scss]": { 8 | "editor.insertSpaces": true, 9 | "editor.tabSize": 2 10 | }, 11 | "[c]": { 12 | "editor.insertSpaces": false, 13 | "editor.tabSize": 8 14 | }, 15 | "[javascript]": { 16 | "editor.insertSpaces": true, 17 | "editor.tabSize": 2 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # [1.1.0](https://github.com/lc-ui/lcui.css/compare/v1.0.0...v1.1.0) (2020-03-02) 2 | 3 | 4 | ### Bug Fixes 5 | 6 | * the dropdown menu should be destroyed along with the target ([2d5a89b](https://github.com/lc-ui/lcui.css/commit/2d5a89b)) 7 | 8 | 9 | ### Features 10 | 11 | * add hr widget ([b3df646](https://github.com/lc-ui/lcui.css/commit/b3df646)) 12 | * add LCDesign_GetVersion() ([8dbd846](https://github.com/lc-ui/lcui.css/commit/8dbd846)) 13 | * migrate to LCUI 2.0.0 ([e7e0ace](https://github.com/lc-ui/lcui.css/commit/e7e0ace)) 14 | 15 | 16 | 17 | # [1.0.0](https://github.com/lc-ui/lcui.css/compare/v0.1.2...v1.0.0) (2019-10-08) 18 | 19 | 20 | ### Bug Fixes 21 | 22 | * .active style pollution ([25c64d4](https://github.com/lc-ui/lcui.css/commit/25c64d4)) 23 | * remove unsupported "!important" keyword ([f212f54](https://github.com/lc-ui/lcui.css/commit/f212f54)) 24 | 25 | 26 | ### Features 27 | 28 | * add checkbox ([b4d6b63](https://github.com/lc-ui/lcui.css/commit/b4d6b63)) 29 | * add layout utilities ([d5a55ec](https://github.com/lc-ui/lcui.css/commit/d5a55ec)) 30 | * add message ([343a3df](https://github.com/lc-ui/lcui.css/commit/343a3df)) 31 | * add notification ([a8885c5](https://github.com/lc-ui/lcui.css/commit/a8885c5)) 32 | * add radio ([b259bad](https://github.com/lc-ui/lcui.css/commit/b259bad)) 33 | * add rate ([e036f13](https://github.com/lc-ui/lcui.css/commit/e036f13)) 34 | * add spinners ([70ff5ef](https://github.com/lc-ui/lcui.css/commit/70ff5ef)) 35 | * add switch ([b28c219](https://github.com/lc-ui/lcui.css/commit/b28c219)) 36 | * add toasts ([cbac3a4](https://github.com/lc-ui/lcui.css/commit/cbac3a4)) 37 | * add tooltip ([ea4b744](https://github.com/lc-ui/lcui.css/commit/ea4b744)) 38 | * enable rounded border ([c59f6f8](https://github.com/lc-ui/lcui.css/commit/c59f6f8)) 39 | * update main view style ([c0a8b23](https://github.com/lc-ui/lcui.css/commit/c0a8b23)) 40 | * use text instead of textview ([9f557f6](https://github.com/lc-ui/lcui.css/commit/9f557f6)) 41 | 42 | 43 | 44 | ## [0.1.2](https://github.com/lc-ui/lcui.css/compare/v0.1.1...v0.1.2) (2019-03-10) 45 | 46 | 47 | ### Bug Fixes 48 | 49 | * **icon:** Icon_SetName() does not remove old icon class ([57e275e](https://github.com/lc-ui/lcui.css/commit/57e275e)) 50 | 51 | 52 | ### Features 53 | 54 | * upgrade mdi version ([bcc4eb5](https://github.com/lc-ui/lcui.css/commit/bcc4eb5)) 55 | 56 | 57 | 58 | ## [0.1.1](https://github.com/lc-ui/lcui.css/compare/v0.1.0-alpha...v0.1.1) (2018-11-28) 59 | 60 | 61 | ### Performance Improvements 62 | 63 | * update font-family for ubuntu ([f76f81d](https://github.com/lc-ui/lcui.css/commit/f76f81d)) 64 | 65 | 66 | 67 | # 0.1.0-alpha (2018-03-19) 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /CHANGELOG.zh-cn.md: -------------------------------------------------------------------------------- 1 | # [1.1.0](https://github.com/lc-ui/lcui.css/compare/v1.0.0...v1.1.0) (2020-03-02) 2 | 3 | ### 问题修复 4 | 5 | * 下拉菜单应该与目标一同销毁,避免非法内存访问 ([2d5a89b](https://github.com/lc-ui/lcui.css/commit/2d5a89b)) 6 | 7 | ### 新功能 8 | 9 | * 添加 hr 部件 ([b3df646](https://github.com/lc-ui/lcui.css/commit/b3df646)) 10 | * 添加 LCDesign_GetVersion() ([8dbd846](https://github.com/lc-ui/lcui.css/commit/8dbd846)) 11 | * 迁移至 LCUI 2.0.0 ([e7e0ace](https://github.com/lc-ui/lcui.css/commit/e7e0ace)) 12 | 13 | 14 | # [1.0.0](https://github.com/lc-ui/lcui.css/compare/v0.1.2...v1.0.0) (2019-10-07) 15 | 16 | ### 问题修复 17 | 18 | * .active 样式污染 ([25c64d4](https://github.com/lc-ui/lcui.css/commit/25c64d4)) 19 | * 移除不受支持的 "!important" 关键字 ([f212f54](https://github.com/lc-ui/lcui.css/commit/f212f54)) 20 | 21 | ### 新功能 22 | 23 | * 添加多选框(Checkbox)组件 ([b4d6b63](https://github.com/lc-ui/lcui.css/commit/b4d6b63)) 24 | * 添加布局相关的实用类 ([d5a55ec](https://github.com/lc-ui/lcui.css/commit/d5a55ec)) 25 | * 添加全局提示(Message)组件 ([343a3df](https://github.com/lc-ui/lcui.css/commit/343a3df)) 26 | * 添加通知提醒框(Notification)组件 ([a8885c5](https://github.com/lc-ui/lcui.css/commit/a8885c5)) 27 | * 添加单选框(Radio)组件 ([b259bad](https://github.com/lc-ui/lcui.css/commit/b259bad)) 28 | * 添加评分(Rate)组件 ([e036f13](https://github.com/lc-ui/lcui.css/commit/e036f13)) 29 | * 添加加载中(Spinner)组件 ([70ff5ef](https://github.com/lc-ui/lcui.css/commit/70ff5ef)) 30 | * 添加开关(Switch)组件 ([b28c219](https://github.com/lc-ui/lcui.css/commit/b28c219)) 31 | * 添加提示(Tooltip)组件 ([ea4b744](https://github.com/lc-ui/lcui.css/commit/ea4b744)) 32 | * 启用圆角边框 ([c59f6f8](https://github.com/lc-ui/lcui.css/commit/c59f6f8)) 33 | * 更新主视图样式 ([c0a8b23](https://github.com/lc-ui/lcui.css/commit/c0a8b23)) 34 | * 使用 text 代替 textview ([9f557f6](https://github.com/lc-ui/lcui.css/commit/9f557f6)) 35 | 36 | ## [0.1.2](https://github.com/lc-ui/lcui.css/compare/v0.1.1...v0.1.2) (2019-03-10) 37 | 38 | ### 问题修复 39 | 40 | * **icon:** Icon_SetName() 未移除老的图标类 ([57e275e](https://github.com/lc-ui/lcui.css/commit/57e275e)) 41 | 42 | 43 | ### 新功能 44 | 45 | * 升级 mdi 图标字体的版本 ([bcc4eb5](https://github.com/lc-ui/lcui.css/commit/bcc4eb5)) 46 | 47 | 48 | ## [0.1.1](https://github.com/lc-ui/lcui.css/compare/v0.1.0-alpha...v0.1.1) (2018-11-28) 49 | 50 | 51 | ### 改进 52 | 53 | * 更新适用于 Ubuntu 系统的 font-family 样式 ([f76f81d](https://github.com/lc-ui/lcui.css/commit/f76f81d)) 54 | 55 | # 0.1.0-alpha (2018-03-19) 56 | 57 | 第一个版本 58 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 LC's UI 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /UWP/UWP.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /demo/app/assets/images/lcui-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcui-dev/lc-design/947830bf412941baf4eb2a0763c9ff37fa0a3819/demo/app/assets/images/lcui-logo.png -------------------------------------------------------------------------------- /demo/app/assets/views/home.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | LC Design 7 | 8 | A UI component framework for building LCUI application. 9 | 10 | 11 | LC Design is an open source toolkit for developing with XML, CSS, and C. Quickly prototype your ideas or build your entire app with our Sass variables and mixins, simple grid system, common prebuilt components. 12 | 13 | 14 | Get started 15 | Download 16 | 17 | 18 | Currently v.1.1.0 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /demo/app/assets/views/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | LC 8 | 9 | 10 | Home 11 | 12 | 13 | Documentation 14 | 15 | 16 | 17 | 18 | 19 | 100% 20 | 21 | 22 | 23 | Zoom level 24 | 100% 25 | 125% 26 | 150% 27 | 175% 28 | 200% 29 | 30 | 31 | 32 | 33 | 34 | Download 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /demo/demo.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | 源文件 20 | 21 | 22 | 源文件 23 | 24 | 25 | 源文件 26 | 27 | 28 | 源文件 29 | 30 | 31 | 源文件 32 | 33 | 34 | 源文件 35 | 36 | 37 | 源文件 38 | 39 | 40 | 源文件 41 | 42 | 43 | 44 | 45 | 头文件 46 | 47 | 48 | -------------------------------------------------------------------------------- /demo/demo.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(ProjectDir)app\ 5 | WindowsLocalDebugger 6 | 7 | 8 | $(ProjectDir)app\ 9 | WindowsLocalDebugger 10 | 11 | 12 | $(ProjectDir)app\ 13 | WindowsLocalDebugger 14 | 15 | 16 | $(ProjectDir)app\ 17 | WindowsLocalDebugger 18 | 19 | -------------------------------------------------------------------------------- /demo/include/ui.h: -------------------------------------------------------------------------------- 1 | #define ID_SIDEBAR_LINKS "demo-sidebar-links" 2 | #define ID_NAVBAR_LINKS "demo-navbar-links" 3 | #define ID_LINK_NAV_HOME "navbar-link-home" 4 | #define ID_LINK_NAV_DOCS "navbar-link-docs" 5 | #define ID_LINK_GETTING_STARTED "doc-link-getting-strted" 6 | 7 | typedef enum NavigationPointId { 8 | NAV_NONE, 9 | NAV_HOME, 10 | NAV_DOCS, 11 | NAV_TOTAL_NUM 12 | } NavigationPointId; 13 | 14 | void ActiveLink(LCUI_Widget parent, const char *link_id); 15 | 16 | void Navbar_Init(void); 17 | void Navigation_Init(void); 18 | 19 | void DocumentationView_Init(void); 20 | void DocumentationView_Free(void); 21 | void HomeView_Init(void); 22 | void HomeView_Free(void); 23 | 24 | void UI_InitMessageView(void); 25 | void UI_InitNotificationView(void); 26 | -------------------------------------------------------------------------------- /demo/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "ui.h" 8 | 9 | int main(int argc, char **argv) 10 | { 11 | LCUI_Widget root, pack; 12 | 13 | LCUI_Init(); 14 | LCDesign_Init(); 15 | LCUIDisplay_SetSize(1280, 800); 16 | root = LCUIWidget_GetRoot(); 17 | pack = LCUIBuilder_LoadFile("assets/views/main.xml"); 18 | if (!pack) { 19 | return -1; 20 | } 21 | Logger_SetLevel(LOGGER_LEVEL_ALL); 22 | Widget_Append(root, pack); 23 | Widget_Unwrap(pack); 24 | Widget_SetTitleW(root, L"LC Design - A UI component framework for building LCUI application."); 25 | Navigation_Init(); 26 | UI_InitMessageView(); 27 | UI_InitNotificationView(); 28 | Navbar_Init(); 29 | return LCUI_Main(); 30 | } 31 | -------------------------------------------------------------------------------- /demo/src/navigation.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "ui.h" 6 | 7 | #define PATH_LEN 256 8 | 9 | typedef struct NavigationPointRec_ { 10 | void(*init)(void); 11 | void(*free)(void); 12 | } NavigationPointRec, *NavigationPoint; 13 | 14 | static struct { 15 | LCUI_Widget active; 16 | NavigationPoint point; 17 | NavigationPointRec points[NAV_TOTAL_NUM]; 18 | } nav; 19 | 20 | static LCUI_Widget GetNavigationItem(LCUI_Widget link) 21 | { 22 | for (; link; link = link->parent) { 23 | if (Widget_HasClass(link, "nav-item")) { 24 | return link; 25 | } 26 | } 27 | return NULL; 28 | } 29 | 30 | static NavigationPointId GetNavigationPointId(const char *name) 31 | { 32 | if (strcmp(name, "home") == 0) { 33 | return NAV_HOME; 34 | } else if (strcmp(name, "docs") == 0) { 35 | return NAV_DOCS; 36 | } 37 | return NAV_NONE; 38 | } 39 | 40 | static NavigationPointId Navigation_GetPointId(LCUI_Widget link) 41 | { 42 | const char *name; 43 | 44 | name = Widget_GetAttribute(link, "nav-point"); 45 | if (!name) { 46 | return NAV_NONE; 47 | } 48 | return GetNavigationPointId(name); 49 | } 50 | 51 | static void Navgation_BeforeActivePoint(LCUI_Widget link, NavigationPointId id) 52 | { 53 | if (nav.point) { 54 | nav.point->free(); 55 | nav.point = NULL; 56 | } 57 | if (nav.active) { 58 | Widget_RemoveClass(nav.active, "active"); 59 | nav.active = NULL; 60 | } 61 | Widget_AddClass(link, "active"); 62 | } 63 | 64 | static void Navgation_ActivePoint(LCUI_Widget link, NavigationPointId id) 65 | { 66 | if (id == NAV_NONE) { 67 | return; 68 | } 69 | Navgation_BeforeActivePoint(link, id); 70 | nav.point = &nav.points[id]; 71 | nav.point->init(); 72 | nav.active = link; 73 | Widget_AddClass(link, "active"); 74 | } 75 | 76 | static void OnViewLoaded(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 77 | { 78 | const char *link_id; 79 | NavigationPointId id; 80 | LCUI_Widget link = GetNavigationItem(e->target); 81 | 82 | if (link) { 83 | id = Navigation_GetPointId(link); 84 | } else { 85 | if (arg) { 86 | id = GetNavigationPointId(arg); 87 | } else { 88 | id = Navigation_GetPointId(arg); 89 | } 90 | switch (id) { 91 | case NAV_HOME: 92 | link_id = ID_LINK_NAV_HOME; 93 | break; 94 | case NAV_DOCS: 95 | link_id = ID_LINK_NAV_DOCS; 96 | break; 97 | default:return; 98 | } 99 | link = GetNavigationItem(LCUIWidget_GetById(link_id)); 100 | } 101 | Navgation_ActivePoint(link, id); 102 | } 103 | 104 | static void OnClickNavbarLink(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 105 | { 106 | int id; 107 | LCUI_Widget link; 108 | 109 | link = GetNavigationItem(e->target); 110 | id = Navigation_GetPointId(link); 111 | if (id == NAV_NONE) { 112 | return; 113 | } 114 | Navgation_BeforeActivePoint(link, id); 115 | } 116 | 117 | void Navigation_Init(void) 118 | { 119 | LCUI_Widget root = LCUIWidget_GetRoot(); 120 | LCUI_Widget navbar = LCUIWidget_GetById(ID_NAVBAR_LINKS); 121 | 122 | Widget_BindEvent(navbar, "click", OnClickNavbarLink, NULL, NULL); 123 | Widget_BindEvent(root, "loaded.anchor", OnViewLoaded, NULL, NULL); 124 | ActiveLink(navbar, ID_LINK_NAV_HOME); 125 | nav.points[NAV_HOME].init = HomeView_Init; 126 | nav.points[NAV_HOME].free = HomeView_Free; 127 | nav.points[NAV_DOCS].init = DocumentationView_Init; 128 | nav.points[NAV_DOCS].free = DocumentationView_Free; 129 | } 130 | -------------------------------------------------------------------------------- /demo/src/ui/helpers/ui_helper.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "ui.h" 6 | 7 | void ActiveLink(LCUI_Widget parent, const char *link_id) 8 | { 9 | LCUI_Widget link; 10 | LCUI_WidgetEventRec ev = { 0 }; 11 | 12 | if (!link_id) { 13 | return; 14 | } 15 | link = LCUIWidget_GetById(link_id); 16 | if (!link) { 17 | return; 18 | } 19 | ev.type = LCUI_WEVENT_CLICK; 20 | ev.button.button = 1; 21 | Widget_TriggerEvent(link, &ev, NULL); 22 | } 23 | -------------------------------------------------------------------------------- /demo/src/ui/views/documentation-view.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "ui.h" 5 | 6 | static struct { 7 | LCUI_Widget active_item; 8 | } self; 9 | 10 | static void OnClickSidebarLink(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 11 | { 12 | LinkedListNode *node; 13 | LCUI_Widget link, subnav; 14 | 15 | for (link = e->target; link; link = link->parent) { 16 | if (Widget_HasClass(link, "nav-item")) { 17 | break; 18 | } 19 | if (!Widget_HasClass(link, "nav-header")) { 20 | continue; 21 | } 22 | subnav = Widget_GetNext(link); 23 | if (!subnav) { 24 | continue; 25 | } 26 | for (LinkedList_Each(node, &subnav->children)) { 27 | link = node->data; 28 | if (Widget_HasClass(link, "nav-item")) { 29 | break; 30 | } 31 | } 32 | break; 33 | } 34 | if (!link) { 35 | return; 36 | } 37 | if (self.active_item) { 38 | Widget_RemoveClass(self.active_item, "active"); 39 | } 40 | Widget_AddClass(link, "active"); 41 | self.active_item = link; 42 | } 43 | 44 | void DocumentationView_Init(void) 45 | { 46 | LCUI_Widget sidebar = LCUIWidget_GetById(ID_SIDEBAR_LINKS); 47 | 48 | Widget_BindEvent(sidebar, "click", OnClickSidebarLink, NULL, NULL); 49 | ActiveLink(sidebar, ID_LINK_GETTING_STARTED); 50 | } 51 | 52 | void DocumentationView_Free(void) 53 | { 54 | self.active_item = NULL; 55 | } 56 | -------------------------------------------------------------------------------- /demo/src/ui/views/home-view.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "ui.h" 4 | 5 | void HomeView_Init(void) 6 | { 7 | 8 | } 9 | 10 | void HomeView_Free(void) 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /demo/src/ui/views/message-view.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static LCUI_WidgetPrototype message_view_proto; 5 | 6 | static void OpenNormalMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 7 | { 8 | LCDesign_OpenInfoMessage(L"This is a normal message", 3000); 9 | } 10 | 11 | static void OpenSuccessMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 12 | { 13 | LCDesign_OpenSuccessMessage(L"This is a success message", 3000); 14 | } 15 | 16 | static void OpenWarningMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 17 | { 18 | LCDesign_OpenWarningMessage(L"This is a warning message", 3000); 19 | } 20 | 21 | static void OpenErrorMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 22 | { 23 | LCDesign_OpenErrorMessage(L"This is a error message", 3000); 24 | } 25 | 26 | static void OpenCustomDurationMessage(LCUI_Widget w, LCUI_WidgetEvent e, 27 | void *arg) 28 | { 29 | LCDesign_OpenSuccessMessage(L"This is a prompt message for success, " 30 | L"and it will disappear in 10 seconds", 31 | 10000); 32 | } 33 | 34 | static void OpenLoadingMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 35 | { 36 | LCDesign_OpenLoadingMessage(L"Action in progress..", 3000); 37 | } 38 | 39 | static void MessageView_OnReady(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 40 | { 41 | Dict *dict; 42 | LCUI_Widget btn; 43 | 44 | dict = Widget_CollectReferences(w); 45 | btn = Dict_FetchValue(dict, "open-normal-message"); 46 | Widget_BindEvent(btn, "click", OpenNormalMessage, NULL, NULL); 47 | 48 | btn = Dict_FetchValue(dict, "open-success-message"); 49 | Widget_BindEvent(btn, "click", OpenSuccessMessage, NULL, NULL); 50 | 51 | btn = Dict_FetchValue(dict, "open-warning-message"); 52 | Widget_BindEvent(btn, "click", OpenWarningMessage, NULL, NULL); 53 | 54 | btn = Dict_FetchValue(dict, "open-error-message"); 55 | Widget_BindEvent(btn, "click", OpenErrorMessage, NULL, NULL); 56 | 57 | btn = Dict_FetchValue(dict, "open-custom-duration-message"); 58 | Widget_BindEvent(btn, "click", OpenCustomDurationMessage, NULL, NULL); 59 | 60 | btn = Dict_FetchValue(dict, "open-loading-message"); 61 | Widget_BindEvent(btn, "click", OpenLoadingMessage, NULL, NULL); 62 | 63 | Dict_Release(dict); 64 | Widget_UnbindEvent(w, "ready", MessageView_OnReady); 65 | } 66 | 67 | static void MessageView_OnInit(LCUI_Widget w) 68 | { 69 | Widget_BindEvent(w, "ready", MessageView_OnReady, NULL, NULL); 70 | } 71 | 72 | void UI_InitMessageView(void) 73 | { 74 | message_view_proto = LCUIWidget_NewPrototype("message-view", NULL); 75 | message_view_proto->init = MessageView_OnInit; 76 | } 77 | -------------------------------------------------------------------------------- /demo/src/ui/views/navbar.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "ui.h" 8 | 9 | #define BTN_CHANGE_SCALE "btn-change-global-scale" 10 | #define DROPDOWN_SCALE "dropdown-global-scale" 11 | 12 | static void OnChangeScale(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 13 | { 14 | float scale; 15 | char txt_scale[64]; 16 | LCUI_Widget text, btn = e->data; 17 | const char *value = Widget_GetAttribute(e->target, "value"); 18 | 19 | if (!value || sscanf(value, "%f", &scale) != 1) { 20 | return; 21 | } 22 | text = Widget_GetChild(btn, 0); 23 | if (scale >= 1.0f && scale <= 2.0f) { 24 | LCUIMetrics_SetScale(scale); 25 | sprintf(txt_scale, "%g%%", scale * 100); 26 | TextView_SetText(text, txt_scale); 27 | LCUIWidget_RefreshStyle(); 28 | } 29 | } 30 | 31 | void Navbar_Init(void) 32 | { 33 | LCUI_Widget dropdown, btn; 34 | 35 | btn = LCUIWidget_GetById(BTN_CHANGE_SCALE); 36 | dropdown = LCUIWidget_GetById(DROPDOWN_SCALE); 37 | Widget_BindEvent(dropdown, "change.dropdown", OnChangeScale, btn, NULL);; 38 | } 39 | -------------------------------------------------------------------------------- /demo/xmake.lua: -------------------------------------------------------------------------------- 1 | add_rules("mode.debug", "mode.release") 2 | set_warnings("all") 3 | 4 | lcpkg_dir = "./lcpkg/installed/$(arch)-$(os)" 5 | lcpkg_incdir = lcpkg_dir.."/include" 6 | lcpkg_pkgdir = lcpkg_dir 7 | if is_mode("debug") then 8 | lcpkg_pkgdir = lcpkg_dir.."/debug" 9 | end 10 | lcpkg_libdir = lcpkg_pkgdir.."/lib" 11 | lcpkg_bindir = lcpkg_pkgdir.."/bin" 12 | add_includedirs("include", "../include", lcpkg_incdir) 13 | add_linkdirs(lcpkg_libdir, "/usr/local/lib", "/usr/lib") 14 | 15 | target("demo") 16 | set_kind("binary") 17 | set_default(false) 18 | set_targetdir("app/") 19 | add_deps("shared") 20 | add_files("src/**.c") 21 | 22 | before_build(function (target) 23 | if val("plat") == "windows" then 24 | os.cp(lcpkg_bindir .. target.filename("*", "shared"), "$(scriptdir)/app/") 25 | end 26 | os.trycp("dist/app/assets/*", "$(scriptdir)/app/assets") 27 | end) 28 | 29 | if is_mode("release") then 30 | set_symbols("hidden") 31 | end 32 | 33 | if not is_os("windows") then 34 | add_rpathdirs("/usr/local/lib") 35 | end 36 | -------------------------------------------------------------------------------- /dist/app/assets/fonts/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcui-dev/lc-design/947830bf412941baf4eb2a0763c9ff37fa0a3819/dist/app/assets/fonts/iconfont.ttf -------------------------------------------------------------------------------- /docs/components/alerts.md: -------------------------------------------------------------------------------- 1 | # Alerts 2 | 3 | Provide contextual feedback messages for typical user actions with the handful of available and flexible alert messages. 4 | 5 | ## Examples 6 | 7 | Alerts are available for any length of text, as well as an optional dismiss button. For proper styling, use one of the eight required contextual classes (e.g., .alert-success). 8 | 9 | ``` alerts-demo-xml 10 | 11 | This is a primary alert—check it out! 12 | 13 | 14 | This is a secondary alert—check it out! 15 | 16 | 17 | This is a success alert—check it out! 18 | 19 | 20 | This is a danger alert—check it out! 21 | 22 | 23 | This is a warning alert—check it out! 24 | 25 | 26 | This is a info alert—check it out! 27 | 28 | 29 | This is a light alert—check it out! 30 | 31 | 32 | This is a dark alert—check it out! 33 | 34 | ``` 35 | 36 | ## Dismissing 37 | 38 | Add a dismiss button and the `.alert-dismissible` class, which adds extra padding to the right of the alert and positions the `.close` button. 39 | 40 | On the dismiss button, add the `data-dismiss="alert"` attribute, which triggers the C functionality. 41 | 42 | ``` alerts-demo-xml 43 | 44 | Holy guacamole! 45 | You should check in on some of those fields below. 46 | 47 | 48 | ``` 49 | -------------------------------------------------------------------------------- /docs/components/buttons.md: -------------------------------------------------------------------------------- 1 | # Buttons 2 | 3 | Use LCUI's custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more. 4 | 5 | ## Examples 6 | 7 | LCUI includes several predefined button styles, each serving its own semantic purpose, with a few extras thrown in for more control. 8 | 9 | ``` buttons-demo-xml 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ``` 21 | 22 | ## Outline buttons 23 | 24 | In need of a button, but not the hefty background colors they bring? Replace the default modifier classes with the `.btn-outline-*` ones to remove all background images and colors on any button. 25 | 26 | ``` buttons-demo-xml 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | ``` 36 | 37 | ## Sizes 38 | 39 | Fancy larger or smaller buttons? Add `.btn-lg` or `.btn-sm` for additional sizes. 40 | 41 | ``` buttons-demo-xml 42 | 43 | 44 | 45 | ``` 46 | 47 | ``` buttons-demo-xml 48 | 49 | 50 | 51 | ``` 52 | 53 | Create block level buttons—those that span the full width of a parent—by adding `.btn-block`. 54 | 55 | ``` block-buttons-demo-xml 56 | 57 | 58 | 59 | ``` 60 | -------------------------------------------------------------------------------- /docs/components/checkbox.md: -------------------------------------------------------------------------------- 1 | # Checkbox 2 | 3 | Make multiple selections in a set of options, or mark the status of an option. 4 | 5 | ## Basic 6 | 7 | ``` checkbox-basic-demo-xml 8 | CheckBox 9 | ``` 10 | 11 | ## Disabled 12 | 13 | ``` checkbox-disabled-demo-xml 14 |

15 | Disabled 16 |

17 |

18 | Disabled Checked 19 |

20 | ``` 21 | -------------------------------------------------------------------------------- /docs/components/dropdowns.md: -------------------------------------------------------------------------------- 1 | # Dropdowns 2 | 3 | Toggle contextual overlays for displaying lists of links and more with the LCUI dropdown component. 4 | 5 | ## Overview 6 | 7 | Dropdowns are toggleable, contextual overlays for displaying lists of links and more. They’re toggled by clicking, not by hovering; this is an intentional design decision. 8 | 9 | ## Examples 10 | 11 | ``` dropdowns-demo-xml 12 | 13 | Dropdown button 14 | 15 | 16 | 17 | Action 18 | Another action 19 | Something else here 20 | 21 | ``` 22 | 23 | ## Menu headers 24 | 25 | Add a header to label sections of actions in any dropdown menu. 26 | 27 | ``` static-dropdowns-demo-xml 28 | 29 | 30 | Action 31 | Another action 32 | 33 | ``` 34 | 35 | ## Menu dividers 36 | 37 | Separate groups of related menu items with a divider. 38 | 39 | ``` static-dropdowns-demo-xml 40 | 41 | Action 42 | Another action 43 | Something else here 44 | 45 | Separated link 46 | 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/components/forms.md: -------------------------------------------------------------------------------- 1 | # Forms 2 | 3 | Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms. 4 | 5 | ## Examples 6 | 7 | Here’s a quick example to demonstrate Bootstrap’s form styles. Keep reading for documentation on required classes, form layout, and more. 8 | 9 | ``` forms-demo-xml 10 | 11 | 12 | Email address 13 | 14 | We'll never share your email with anyone else. 15 | 16 | 17 | Password 18 | 19 | 20 | 21 | Submit 22 | 23 | 24 | ``` 25 | 26 | ## Sizing 27 | 28 | Set heights using classes like `.form-control-lg` and `.form-control-sm`. 29 | 30 | ``` forms-sizing-demo-xml 31 | 32 | 33 | 34 | ``` 35 | -------------------------------------------------------------------------------- /docs/components/list-group.md: -------------------------------------------------------------------------------- 1 | # List group 2 | 3 | List groups are a flexible and powerful component for displaying a series of content. Modify and extend them to support just about any content within. 4 | 5 | ## Basic example 6 | 7 | The most basic list group is an unordered list with list items and the proper classes. Build upon it with the options that follow, or with your own CSS as needed. 8 | 9 | ``` list-group-demo-xml 10 | 11 | Cras justo odio 12 | Dapibus ac facilisis in 13 | Morbi leo risus 14 | Porta ac consectetur ac 15 | Vestibulum at eros 16 | 17 | ``` 18 | 19 | ## Links and buttons 20 | 21 | Use `a`s or `button`s to create actionable list group items with hover, disabled, and active states by adding `.list-group-item-action`. We separate these pseudo-classes to ensure list groups made of non-interactive elements don’t provide a click or tap affordance. 22 | 23 | Be sure to **not use the standard** `.btn` **classes here**. 24 | 25 | ``` list-group-demo-xml 26 | 27 | 28 | Cras justo odio 29 | 30 | Dapibus ac facilisis in 31 | Morbi leo risus 32 | Porta ac consectetur ac 33 | Vestibulum at eros 34 | 35 | ``` 36 | 37 | With `button`s, you can also make use of the `disabled` attribute instead of the `.disabled` class. 38 | 39 | ``` list-group-demo-xml 40 | 41 | 42 | Cras justo odio 43 | 44 | Dapibus ac facilisis in 45 | Morbi leo risus 46 | Porta ac consectetur ac 47 | Vestibulum at eros 48 | 49 | ``` 50 | 51 | ## Flush 52 | 53 | Add `.list-group-flush` to remove some borders and rounded corners to render list group items edge-to-edge in a parent container (e.g., cards). 54 | 55 | ``` list-group-demo-xml 56 | 57 | Cras justo odio 58 | Dapibus ac facilisis in 59 | Morbi leo risus 60 | Porta ac consectetur ac 61 | Vestibulum at eros 62 | 63 | ``` 64 | 65 | ## Contextual classes 66 | 67 | Use contextual classes to style list items with a stateful background and color. 68 | 69 | ``` list-group-demo-xml 70 | 71 | Dapibus ac facilisis in 72 | This is a primary list group item 73 | This is a secondary list group item 74 | This is a success list group item 75 | This is a danger list group item 76 | This is a warning list group item 77 | This is a info list group item 78 | This is a light list group item 79 | This is a dark list group item 80 | 81 | ``` 82 | -------------------------------------------------------------------------------- /docs/components/message.md: -------------------------------------------------------------------------------- 1 | # Message 2 | 3 | Display global messages as feedback in response to user operations. 4 | 5 | ## Normal prompt 6 | 7 | Normal message for information. 8 | 9 | ``` embedded-xml 10 | 11 | 12 | 13 | ``` 14 | 15 | ``` c 16 | #include 17 | #include 18 | #include 19 | 20 | static void OpenMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 21 | { 22 | LCDesign_OpenInfoMessage(L"This is a normal message", 3000); 23 | } 24 | 25 | // ... other code 26 | 27 | LCUI_Widget btn = LCUIWidget_GetById("btn-open-message"); 28 | Widget_BindEvent(btn, "click", OpenMessage, NULL, NULL); 29 | 30 | // ... other code 31 | ``` 32 | 33 | ## Other types of message 34 | 35 | Messages of success, error and warning types. 36 | 37 | ``` embedded-xml 38 | 39 | 40 | 41 | 42 | 43 | ``` 44 | 45 | ``` c 46 | #include 47 | #include 48 | #include 49 | 50 | static void OpenSuccessMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 51 | { 52 | LCDesign_OpenSuccessMessage(L"This is a success message", 3000); 53 | } 54 | 55 | static void OpenWarningMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 56 | { 57 | LCDesign_OpenWarningMessage(L"This is a warning message", 3000); 58 | } 59 | 60 | static void OpenErrorMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 61 | { 62 | LCDesign_OpenErrorMessage(L"This is a error message", 3000); 63 | } 64 | 65 | // ... other code 66 | 67 | LCUI_Widget btn; 68 | 69 | btn = LCUIWidget_GetById("btn-open-success-message"); 70 | Widget_BindEvent(btn, "click", OpenSuccessMessage, NULL, NULL); 71 | 72 | btn = LCUIWidget_GetById("btn-open-warning-message"); 73 | Widget_BindEvent(btn, "click", OpenWarningMessage, NULL, NULL); 74 | 75 | btn = LCUIWidget_GetById("btn-open-error-message"); 76 | Widget_BindEvent(btn, "click", OpenErrorMessage, NULL, NULL); 77 | 78 | // ... other code 79 | ``` 80 | 81 | ## Customize duration 82 | 83 | Customize message display duration to `10s`. 84 | 85 | ``` embedded-xml 86 | 87 | 88 | 89 | ``` 90 | 91 | ``` c 92 | #include 93 | #include 94 | #include 95 | 96 | static void OpenMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 97 | { 98 | LCDesign_OpenSuccessMessage(L"This is a prompt message for success, " 99 | L"and it will disappear in 10 seconds", 100 | 10000); 101 | } 102 | 103 | // ... other code 104 | 105 | LCUI_Widget btn = LCUIWidget_GetById("btn-open-message"); 106 | Widget_BindEvent(btn, "click", OpenMessage, NULL, NULL); 107 | 108 | // ... other code 109 | ``` 110 | 111 | ## Message with loading indicator 112 | 113 | Display a global loading indicator, which is dismissed by itself asynchronously. 114 | 115 | ``` embedded-xml 116 | 117 | 118 | 119 | ``` 120 | 121 | ``` c 122 | #include 123 | #include 124 | #include 125 | 126 | static void OpenMessage(LCUI_Widget w, LCUI_WidgetEvent e, void *arg) 127 | { 128 | LCDesign_OpenLoadingMessage(L"Action in progress..", 3000); 129 | } 130 | 131 | // ... other code 132 | 133 | LCUI_Widget btn = LCUIWidget_GetById("btn-open-message"); 134 | Widget_BindEvent(btn, "click", OpenMessage, NULL, NULL); 135 | 136 | // ... other code 137 | ``` 138 | -------------------------------------------------------------------------------- /docs/components/radio.md: -------------------------------------------------------------------------------- 1 | # Radio 2 | 3 | Select one of a set of options. 4 | 5 | ## Basic 6 | 7 | ``` radio-basic-demo-xml 8 | Radio 9 | ``` 10 | 11 | ## Disabled 12 | 13 | ``` radio-disabled-demo-xml 14 | Disabled 15 | Disabled 16 | ``` 17 | 18 | ## Group 19 | 20 | ``` radio-group-demo-xml 21 | 22 | A 23 | B 24 | C 25 | D 26 | 27 | ``` 28 | -------------------------------------------------------------------------------- /docs/components/rate.md: -------------------------------------------------------------------------------- 1 | # Rate 2 | 3 | Rate component can be used to show evaluation, and it provide a quick rating operation on something. 4 | 5 | ## Basic 6 | 7 | The simplest usage. 8 | 9 | ``` rate-basic-demo-xml 10 | 11 | ``` 12 | 13 | ## Readonly 14 | 15 | Set the `disabled` attribute to disable mouse interaction. 16 | 17 | ``` rate-readonly-demo-xml 18 | 19 | ``` 20 | 21 | ## Other star count 22 | 23 | The default number of stars is 5, you can set it with the `count` attribute. 24 | 25 | ``` rate-count-demo-xml 26 | 27 | ``` 28 | 29 | ## Other icon 30 | 31 | Replace the default star to other iconfont. 32 | 33 | ``` rate-icon-demo-xml 34 | 35 | 36 | 37 | ``` 38 | 39 | ## Other character 40 | 41 | Replace the default star to other character like alphabet, digit or even Chinese word. 42 | 43 | ``` rate-character-demo-xml 44 | 45 | 46 | 47 | ``` 48 | -------------------------------------------------------------------------------- /docs/components/scrollbar.md: -------------------------------------------------------------------------------- 1 | # Scrollbar 2 | 3 | A scrollbar is an widget in which continuous text, pictures, or any other content can be scrolled in a predetermined direction (up, down, left, or right) on a container widget so that all of the content can be viewed. 4 | 5 | ## Examples 6 | 7 | ``` scrollbar-demo-xml 8 | 9 | 10 |

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

11 | 12 |

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

13 | 14 |

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

15 | 16 |

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

17 | 18 |

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

19 | 20 |

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

21 | 22 |

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

23 | 24 |

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

25 | 26 |

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

27 | 28 |

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

29 | 30 |

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

31 | 32 |

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

33 | 34 |

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

35 | 36 |

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

37 | 38 |

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

39 | 40 |

Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.

41 | 42 |

Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

43 | 44 |

Aenean lacinia bibendum nulla sed consectetur. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Donec sed odio dui. Donec ullamcorper nulla non metus auctor fringilla.

45 |
46 | 47 |
48 | ``` 49 | -------------------------------------------------------------------------------- /docs/components/spinners.md: -------------------------------------------------------------------------------- 1 | # Spinners 2 | 3 | Indicate the loading state of a component or page with spinners. 4 | 5 | ## About 6 | 7 | “spinners” can be used to show the loading state in your projects. They’re built only with HTML and CSS, meaning you don’t need any C code to create them. Their appearance, alignment, and sizing can be easily customized with ourutility classes. 8 | 9 | ## Border spinner 10 | 11 | Use the border spinners for a lightweight loading indicator. 12 | 13 | ``` spinners-demo-xml 14 | 15 | 16 | ``` 17 | 18 | ## Colors 19 | 20 | The border spinner uses `currentColor` for its `color`, meaning you can customize the color with text color utilities. You can use any of our text color utilities on the standard spinner. 21 | 22 | ``` colors-spinners-demo-xml 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | ``` 45 | 46 | ## Alignment 47 | 48 | Spinners in LC Design are built with `px`, `currentColor`, and `display: inline-block`. This means they can easily be resized, recolored, and quickly aligned. 49 | 50 | ### Margin 51 | 52 | Use margin utilities like .m-5 for easy spacing. 53 | 54 | ``` margin-spinners-demo-xml 55 | 56 | ``` 57 | 58 | ### Placement 59 | 60 | Use flexbox utilities, float utilities to place spinners exactly where you need them in any situation. 61 | 62 | #### Flex 63 | 64 | ``` flex-spinners-demo-xml 65 | 66 | 67 | 68 | ``` 69 | 70 | ## Size 71 | 72 | Set `size="small"` attribute to make a smaller spinner. 73 | 74 | ``` size-spinners-demo-xml 75 | 76 | ``` 77 | 78 | Or, use custom CSS or inline styles to change the dimensions as needed. 79 | 80 | ``` style-spinners-demo-xml 81 | 82 | ``` 83 | -------------------------------------------------------------------------------- /docs/components/switch.md: -------------------------------------------------------------------------------- 1 | # Switch 2 | 3 | Represent the switching between two states or on-off state. 4 | 5 | ## Basic 6 | 7 | ``` switch-basic-demo-xml 8 | Subscribe to weekly newsletter 9 | ``` 10 | 11 | ## Text & icon 12 | 13 | With text and icon. 14 | 15 | ``` switch-text-icon-demo-xml 16 |

17 | 18 |

19 |

20 | 21 |

22 |

23 | 24 |

25 | ``` 26 | 27 | ## Disabled 28 | 29 | ``` switch-text-icon-demo-xml 30 |

31 | Disabled 32 |

33 |

34 | Disabled Checked 35 |

36 | ``` 37 | -------------------------------------------------------------------------------- /docs/components/tooltips.md: -------------------------------------------------------------------------------- 1 | # Tooltips 2 | 3 | Documentation and examples for adding custom tooltips with CSS and C using data-attributes for local title storage. 4 | 5 | ## Examples 6 | 7 | Hover over the buttons below to see the four tooltips directions: top, right, bottom, and left. 8 | 9 | ``` tooltips-demo-xml 10 | 13 | 16 | 19 | 22 | ``` 23 | -------------------------------------------------------------------------------- /docs/content/icons.md: -------------------------------------------------------------------------------- 1 | # Icons 2 | 3 | Icons are single-element and pure CSS icons, LCUI's icons are from the Material Design Icons. 4 | 5 | ## Examples 6 | 7 | Icon and text are the same, we can use the `icon` widget to display it, just as in the example below. For highlight the icons effect, the icons example has been increased in size, and added a border. 8 | 9 | ``` icons-demo-xml 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | ``` 99 | -------------------------------------------------------------------------------- /docs/content/typography.md: -------------------------------------------------------------------------------- 1 | # Typography 2 | 3 | Typography sets default styles for headings, paragraphs, semantic text, blockquote and lists elements. 4 | 5 | ## Headings 6 | 7 | All HTML headings, `h1` through `h6`, are available. 8 | 9 | ``` headings-demo-xml 10 |

h1. LCUI heading

11 |

h2. LCUI heading

12 |

h3. LCUI heading

13 |

h4. LCUI heading

14 |
h5. LCUI heading
15 |
h6. LCUI heading
16 | ``` 17 | 18 | `.h1` through `.h6` classes are also available, for when you want to match the font styling of a heading but cannot use the associated HTML element. 19 | 20 | ``` headings-demo-xml 21 |

h1. LCUI heading

22 |

h2. LCUI heading

23 |

h3. LCUI heading

24 |

h4. LCUI heading

25 |

h5. LCUI heading

26 |

h6. LCUI heading

27 | ``` 28 | 29 | ## Paragraphs 30 | 31 | ``` paragraphs-demo-xml 32 |

你好, こんにちは, 안녕하세요

33 |

Chinese (Simplified)

34 |

革命不是请客吃饭,不是做文章,不是绘画绣花,不能那样雅致,那样从容不迫,“文质彬彬”,那样“温良恭俭让”。革命就是暴动,是一个阶级推翻一个阶级的暴烈的行动。

35 |

Chinese (Tranditional)

36 |

山不在高,有仙則名;水不在深,有龍則靈。斯是陋室,惟吾德馨。苔痕上階綠,草色入簾青;談笑有鴻儒,往來無白丁。可以調素琴,閱金經。無絲竹之亂耳,無案牘之勞形。南陽諸葛廬,西蜀子雲亭。孔子云:「何陋之有?」

37 |

Japanese

38 |

祇園精舎の鐘の声、諸行無常の響きあり。沙羅双樹の花の色、盛者必衰の理をあらはす。おごれる人も久しからず。ただ春の夜の夢のごとし。たけき者も遂にはほろびぬ、ひとへ‌​に風の前の塵に同じ。

39 |

Korean

40 |

나라말이 중국과 달라, 한문・한자와 서로 통하지 아니하므로, 어리석은 백성들이 말하고자 하는 바가 있어도, 끝내 제 뜻을 펴지 못하는 사람이 많다. 내가 이를 불쌍히 여겨, 새로 스물 여덟 글자를 만드니, 사람마다 하여금 쉽게 익혀, 날마다 씀에 편하게 하고자 할 따름이다.

41 | ``` 42 | 43 | ## Blockquote 44 | 45 | ``` blockquote-demo-xml 46 |
47 |

The advance of technology is based on making it fit in so that you don't really even notice it, so it's part of everyday life.

48 | - Bill Gates 49 |
50 | ``` 51 | -------------------------------------------------------------------------------- /docs/getting-started/introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | LC Design is a UI component framework for building LCUI application, it provides basic styles for typography and elements, simple layout system, CSS components and utilities. Its CSS code is based Bootstrap, so its usage is basically the same as Boostrap. 4 | 5 | ## Installation 6 | 7 | Install with LCPkg: 8 | 9 | ``` shell 10 | lcpkg install github.com/lc-ui/lc-desgin 11 | ``` 12 | 13 | Or, you can download the compiled package: 14 | 15 | ``` embedded-xml 16 | 17 | Download LC Design 18 | 19 | ``` 20 | 21 | ### CSS 22 | 23 | Copy the files from the dist directory to your project directory, and configure your project assets include path. 24 | 25 | ``` xml 26 | 27 | ``` 28 | 29 | ### C Dependencies 30 | 31 | Copy **include** and **lib** directory from the **dist** directory to you project **vendor** directory, and configure your project compiler settings. 32 | 33 | ## Starter template 34 | 35 | main.xml: 36 | 37 | ``` xml 38 | 39 | 40 | 41 | 42 |

Hello, world!

43 |
44 |
45 | ``` 46 | 47 | main.c: 48 | 49 | ``` c 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | int main(int argc, char **argv) 56 | { 57 | LCUI_Widget root, pack; 58 | 59 | LCUI_Init(); 60 | LCDesgin_Init(); 61 | root = LCUIWidget_GetRoot(); 62 | pack = LCUIBuilder_LoadFile("main.xml"); 63 | if(!pack) { 64 | return -1; 65 | } 66 | Widget_Append(root, pack); 67 | Widget_Unwrap(pack); 68 | return LCUI_Main(); 69 | } 70 | ``` 71 | 72 | That's all you need for overall app requirements. Visit the Layout docs or our official examples to start laying out your app’s content and components. 73 | -------------------------------------------------------------------------------- /docs/images/preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lcui-dev/lc-design/947830bf412941baf4eb2a0763c9ff37fa0a3819/docs/images/preview.png -------------------------------------------------------------------------------- /docs/layout/grid.md: -------------------------------------------------------------------------------- 1 | # Grid system 2 | 3 | Use our simple grid to build layouts of some sizes thanks to a twelve column system, Sass variables and mixins, and predefined classes. 4 | 5 | ## Examples 6 | 7 | ``` grid-demo-xml 8 | 9 | 10 | 11 | 1 of 2 12 | 13 | 14 | 2 of 2 15 | 16 | 17 | 18 | 19 | 1 of 3 20 | 21 | 22 | 2 of 3 23 | 24 | 25 | 3 of 3 26 | 27 | 28 | 29 | 30 | 1 of 4 31 | 32 | 33 | 2 of 4 34 | 35 | 36 | 3 of 4 37 | 38 | 39 | 4 of 4 40 | 41 | 42 | 43 | 44 | 1 of 6 45 | 46 | 47 | 2 of 6 48 | 49 | 50 | 3 of 6 51 | 52 | 53 | 4 of 6 54 | 55 | 56 | 5 of 6 57 | 58 | 59 | 6 of 6 60 | 61 | 62 | 63 | ``` 64 | -------------------------------------------------------------------------------- /docs/layout/overview.md: -------------------------------------------------------------------------------- 1 | # Overview 2 | 3 | Components and options for laying out your LCUI project, including wrapping containers, a simple grid system. 4 | 5 | ## Containers 6 | 7 | Containers are the most basic layout element LCUI and are required when using our default grid system. Choose from a fixed-width container or fluid-width. 8 | 9 | While containers can be nested, most layouts do not require a nested container. 10 | 11 | ``` layout-demo-xml 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | ``` 21 | 22 | Use `.container-fluid` for a full width container, spanning the entire width of the viewport. 23 | 24 | ``` layout-demo-xml 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | ``` 34 | -------------------------------------------------------------------------------- /include/LCDesign.h: -------------------------------------------------------------------------------- 1 | /* 2 | * LCDesign.h -- LCUI.css main header file. 3 | * 4 | * Copyright (c) 2018, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_H_ 32 | #define LCDESIGN_H_ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | LCDESIGN_API void LCDesign_Init(void); 40 | 41 | LCDESIGN_API const char *LCDesign_GetVersion(void); 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /include/LCDesign/build.h: -------------------------------------------------------------------------------- 1 | /* 2 | * build.h -- Build related macro definitions 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_BUILD_H 32 | #define LCDESIGN_BUILD_H 33 | 34 | #if defined(__GNUC__) 35 | #define LCDESIGN_API 36 | #else /* newer compiler */ 37 | #ifdef LCDESIGN_EXPORTS 38 | #define LCDESIGN_API __declspec(dllexport) 39 | #else 40 | #define LCDESIGN_API 41 | #endif 42 | #endif 43 | 44 | #define LCDESIGN_VERSION_STRING "1.1.0" 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components.h: -------------------------------------------------------------------------------- 1 | /* 2 | * components.h -- UI components operation set. 3 | * 4 | * Copyright (c) 2018-2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_UI_COMPONETS_H 32 | #define LCDESIGN_UI_COMPONETS_H 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/alert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * alert.h -- Provide contextual feedback messages for typical user actions 3 | * with the handful of available and flexible alert messages. 4 | * 5 | * Copyright (c) 2018, Liu chao All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of LCUI nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef LCDESIGN_ALERT_H_ 33 | #define LCDESIGN_ALERT_H_ 34 | 35 | LCDESIGN_API void LCDesign_InitAlert(void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/checkbox.h: -------------------------------------------------------------------------------- 1 | /* 2 | * checkbox.h -- Checkbox, used to make multiple selections in a set of 3 | * options, or mark the status of an option. 4 | * 5 | * Copyright (c) 2019, Liu chao All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of LCUI nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef LCDESIGN_CHECKBOX_H_ 33 | #define LCDESIGN_CHECKBOX_H_ 34 | 35 | LCDESIGN_API void LCDesign_InitCheckBox(void); 36 | 37 | LCDESIGN_API LCUI_BOOL CheckBox_IsChecked(LCUI_Widget w); 38 | 39 | LCDESIGN_API void CheckBox_SetChecked(LCUI_Widget w, LCUI_BOOL checked); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/dropdown.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dropdown.h -- Dropdowns are toggleable, contextual overlays for displaying 3 | * lists of links and more. 4 | * 5 | * Copyright (c) 2018, Liu chao All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of LCUI nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef LCDESIGN_DROPDOWN_H_ 33 | #define LCDESIGN_DROPDOWN_H_ 34 | 35 | LCDESIGN_API void LCDesign_InitDropdown( void ); 36 | 37 | LCDESIGN_API void Dropdown_Hide( LCUI_Widget w ); 38 | 39 | LCDESIGN_API void Dropdown_Show( LCUI_Widget w ); 40 | 41 | LCDESIGN_API void Dropdown_BindTarget( LCUI_Widget w, LCUI_Widget target ); 42 | 43 | LCDESIGN_API void Dropdown_Toggle( LCUI_Widget w ); 44 | 45 | LCDESIGN_API void Dropdown_SetPosition( LCUI_Widget w, LCUI_StyleValue position ); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/icon.h: -------------------------------------------------------------------------------- 1 | /* 2 | * icon.h -- Icon component. 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_ICON_H_ 32 | #define LCDESIGN_ICON_H_ 33 | 34 | LCDESIGN_API int Icon_SetName(LCUI_Widget w, const char *name); 35 | 36 | LCDESIGN_API void LCDesign_InitIcon(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/img.h: -------------------------------------------------------------------------------- 1 | /* 2 | * icon.h -- Image component. 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_IMG_H_ 32 | #define LCDESIGN_IMG_H_ 33 | 34 | LCDESIGN_API void LCDesign_InitImg(void); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/label.h: -------------------------------------------------------------------------------- 1 | /* 2 | * label.h -- Label component, Label component, which is used to represents 3 | * a caption for an item in a user interface. 4 | * 5 | * Copyright (c) 2018, Liu chao All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of LCUI nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef LCDESIGN_LABEL_H_ 33 | #define LCDESIGN_LABEL_H_ 34 | 35 | LCDESIGN_API void LCDesign_InitLabel(void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/message.h: -------------------------------------------------------------------------------- 1 | /* 2 | * message.h -- Display global messages as feedback in response to user 3 | * operations. 4 | * 5 | * Copyright (c) 2019, Liu chao All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of LCUI nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef LCDESIGN_MESSAGE_H 33 | #define LCDESIGN_MESSAGE_H 34 | 35 | typedef struct LCDesign_MessageConfigRec_ { 36 | /** Customized Icon */ 37 | LCUI_Widget icon; 38 | 39 | /** content of the message */ 40 | const wchar_t *content; 41 | 42 | /** time(milliseconds) before auto-dismiss, don't dismiss if set to 0 */ 43 | long duration; 44 | } LCDesign_MessageConfigRec, *LCDesign_MessageConfig; 45 | 46 | LCDESIGN_API void LCDesign_SetMessageContainer(LCUI_Widget w); 47 | 48 | LCDESIGN_API LCUI_Widget LCDesign_OpenMessage(LCDesign_MessageConfig config); 49 | 50 | LCDESIGN_API void LCDesign_CloseMessage(LCUI_Widget message); 51 | 52 | LCDESIGN_API LCUI_Widget LCDesign_OpenSuccessMessage(const wchar_t *content, 53 | long duration); 54 | 55 | LCDESIGN_API LCUI_Widget LCDesign_OpenInfoMessage(const wchar_t *content, 56 | long duration); 57 | 58 | LCDESIGN_API LCUI_Widget LCDesign_OpenWarningMessage(const wchar_t *content, 59 | long duration); 60 | 61 | LCDESIGN_API LCUI_Widget LCDesign_OpenErrorMessage(const wchar_t *content, 62 | long duration); 63 | 64 | LCDESIGN_API LCUI_Widget LCDesign_OpenLoadingMessage(const wchar_t *content, 65 | long duration); 66 | 67 | LCDESIGN_API void LCDesign_InitMessage(void); 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/modal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * modal.h -- Modal component for adding dialogs. 3 | * 4 | * Copyright (c) 2018, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_MODAL_H_ 32 | #define LCDESIGN_MODAL_H_ 33 | 34 | LCDESIGN_API void LCDesign_InitModal(void); 35 | 36 | LCDESIGN_API void Modal_Show(LCUI_Widget w); 37 | 38 | LCDESIGN_API void Modal_Hide(LCUI_Widget w); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/notification.h: -------------------------------------------------------------------------------- 1 | /* 2 | * notification.c -- Display a notification message globally. 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_NOTIFICATION_H 32 | #define LCDESIGN_NOTIFICATION_H 33 | 34 | typedef struct LCDesign_NotificationConfigRec_ { 35 | /** Customized Icon */ 36 | LCUI_Widget icon; 37 | 38 | /** The title of notification box (required) */ 39 | const wchar_t *title; 40 | 41 | /** The content of notification box (required) */ 42 | const wchar_t *description; 43 | 44 | /** Position of Notification, can be one of top-left, top-right, 45 | * bottom-left, bottom-right */ 46 | const char *placement; 47 | 48 | /** time(milliseconds) before auto-dismiss, don't dismiss if set to 0 */ 49 | long duration; 50 | } LCDesign_NotificationConfigRec, *LCDesign_NotificationConfig; 51 | 52 | LCDESIGN_API void LCDesign_SetNotificationContainer(LCUI_Widget w); 53 | 54 | LCDESIGN_API LCUI_Widget 55 | LCDesign_OpenNotification(LCDesign_NotificationConfig config); 56 | 57 | LCDESIGN_API void LCDesign_CloseNotification(LCUI_Widget message); 58 | 59 | LCDESIGN_API LCUI_Widget LCDesign_OpenNormalNotification(const wchar_t *title, 60 | const wchar_t *description, 61 | const char *placement, 62 | long duration); 63 | 64 | LCDESIGN_API LCUI_Widget LCDesign_OpenSuccessNotification( 65 | const wchar_t *title, const wchar_t *description, const char *placement, 66 | long duration); 67 | 68 | LCDESIGN_API LCUI_Widget LCDesign_OpenInfoNotification(const wchar_t *title, 69 | const wchar_t *description, 70 | const char *placement, 71 | long duration); 72 | 73 | LCDESIGN_API LCUI_Widget LCDesign_OpenWarningNotification( 74 | const wchar_t *title, const wchar_t *description, const char *placement, 75 | long duration); 76 | 77 | LCDESIGN_API LCUI_Widget LCDesign_OpenErrorNotification(const wchar_t *title, 78 | const wchar_t *description, 79 | const char *placement, 80 | long duration); 81 | 82 | LCDESIGN_API void LCDesign_InitNotification(void); 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/password.h: -------------------------------------------------------------------------------- 1 | /* 2 | * password.h -- Password input box. 3 | * 4 | * Copyright (c) 2018, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_PASSWORD_H_ 32 | #define LCDESIGN_PASSWORD_H_ 33 | 34 | LCDESIGN_API void LCDesign_InitPassword(void); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/radio-group.h: -------------------------------------------------------------------------------- 1 | /* 2 | * radio-group.h -- Radio group 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_RADIO_GROUP_H_ 32 | #define LCDESIGN_RADIO_GROUP_H_ 33 | 34 | int RadioGroup_SetCheckedRadio(LCUI_Widget w, LCUI_Widget radio); 35 | 36 | int RadioGroup_SetValue(LCUI_Widget w, const char *value); 37 | 38 | const char *RadioGroup_GetValue(LCUI_Widget w); 39 | 40 | void LCDesign_InitRadioGroup(void); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/radio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * radio.h -- Radio, used to select one of a set of options. 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_RADIO_H_ 32 | #define LCDESIGN_RADIO_H_ 33 | 34 | void Radio_SetChecked(LCUI_Widget w, LCUI_BOOL checked); 35 | 36 | void LCDesign_InitRadio(void); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/rate.h: -------------------------------------------------------------------------------- 1 | /* 2 | * rate.h -- Rate component. 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_RATE_H_ 32 | #define LCDESIGN_RATE_H_ 33 | 34 | void Rate_SetValue(LCUI_Widget w, unsigned value); 35 | 36 | unsigned Rate_GetValue(LCUI_Widget w); 37 | 38 | void Rate_SetCount(LCUI_Widget w, unsigned count); 39 | 40 | void Rate_SetIcon(LCUI_Widget w, const char *void_icon, const char *icon); 41 | 42 | void Rate_SetCharacter(LCUI_Widget w, const wchar_t ch); 43 | 44 | void LCDesign_InitRate(void); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/spinner.h: -------------------------------------------------------------------------------- 1 | /* 2 | * spinner.h -- Spinner, used to indicate the loading state of a component 3 | * or page. 4 | * 5 | * Copyright (c) 2019, Liu chao All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of LCUI nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef LCDESIGN_SPINNER_H_ 33 | #define LCDESIGN_SPINNER_H_ 34 | 35 | LCDESIGN_API void LCDesign_InitSpinner(void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/switch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * switch.h -- Switch, used to represent the switching between two states or 3 | * on-off state. 4 | * 5 | * Copyright (c) 2019, Liu chao All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions are met: 9 | * 10 | * * Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * * Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * * Neither the name of LCUI nor the names of its contributors may be used 16 | * to endorse or promote products derived from this software without 17 | * specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | * POSSIBILITY OF SUCH DAMAGE. 30 | */ 31 | 32 | #ifndef LCDESIGN_SWITCH_H_ 33 | #define LCDESIGN_SWITCH_H_ 34 | 35 | LCDESIGN_API void LCDesign_InitSwitch(void); 36 | 37 | LCDESIGN_API LCUI_BOOL Switch_IsChecked(LCUI_Widget w); 38 | 39 | LCDESIGN_API void Switch_SetChecked(LCUI_Widget w, LCUI_BOOL checked); 40 | 41 | LCDESIGN_API void Switch_SetCheckedText(LCUI_Widget w, const char *text); 42 | 43 | LCDESIGN_API void Switch_SetUncheckedText(LCUI_Widget w, const char *text); 44 | 45 | LCDESIGN_API void Switch_SetCheckedIcon(LCUI_Widget w, const char *icon_name); 46 | 47 | LCDESIGN_API void Switch_SetUncheckedIcon(LCUI_Widget w, const char *icon_name); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/tooltip.h: -------------------------------------------------------------------------------- 1 | /* 2 | * tooltip.h -- Tooltip 3 | * 4 | * Copyright (c) 2019, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_TOOLTIP_H_ 32 | #define LCDESIGN_TOOLTIP_H_ 33 | 34 | LCDESIGN_API void LCDesign_InitTooltip(void); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/LCDesign/ui/components/typography.h: -------------------------------------------------------------------------------- 1 | /* 2 | * typography.h -- Including headings, body text, and more. 3 | * 4 | * Copyright (c) 2018, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_TYPOGRAPHY_H_ 32 | #define LCDESIGN_TYPOGRAPHY_H_ 33 | 34 | LCDESIGN_API void LCDesign_InitTypograhy(void); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/LCDesign/ui/dismiss.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dismiss.c -- The widget dismissal controller. 3 | * 4 | * Copyright (c) 2018, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_DISMISS_H_ 32 | #define LCDESIGN_DISMISS_H_ 33 | 34 | LCDESIGN_API void LCDesign_InitDismiss( void ); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /include/LCDesign/ui/toggle.h: -------------------------------------------------------------------------------- 1 | /* 2 | * toggle.h -- The widget status toggle controller. 3 | * 4 | * Copyright (c) 2018, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef LCDESIGN_TOGGLE_H_ 32 | #define LCDESIGN_TOGGLE_H_ 33 | 34 | LCDESIGN_API void LCDesign_InitToggle( void ); 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /lcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lc-design", 3 | "version": "1.1.0", 4 | "description": "A UI component framework for building LCUI application.", 5 | "author": "Liu", 6 | "arch": [ 7 | "x86", 8 | "x64" 9 | ], 10 | "platform": [ 11 | "windows", 12 | "uwp" 13 | ], 14 | "mode": [ 15 | "debug", 16 | "release" 17 | ], 18 | "package": { 19 | "entry": { 20 | "lib": "build/${arch}-${platform}/${mode}", 21 | "bin": "build/${arch}-${platform}/${mode}", 22 | "content": "dist", 23 | "include": { 24 | "input": "include", 25 | "recursive": true 26 | } 27 | } 28 | }, 29 | "dependencies": { 30 | "LCUI": { 31 | "version": "v2.0.0", 32 | "uri": "github:lc-soft/LCUI", 33 | "resolved": { 34 | "all": "https://github.com/lc-soft/LCUI/releases/download/v2.0.0/LCUI-2.0.0_x86-windows.lcpkg.zip", 35 | "x64-uwp": "https://github.com/lc-soft/LCUI/releases/download/v2.0.0/LCUI-2.0.0_x64-uwp.lcpkg.zip", 36 | "x64-windows": "https://github.com/lc-soft/LCUI/releases/download/v2.0.0/LCUI-2.0.0_x64-windows.lcpkg.zip", 37 | "x86-uwp": "https://github.com/lc-soft/LCUI/releases/download/v2.0.0/LCUI-2.0.0_x86-uwp.lcpkg.zip", 38 | "x86-windows": "https://github.com/lc-soft/LCUI/releases/download/v2.0.0/LCUI-2.0.0_x86-windows.lcpkg.zip" 39 | }, 40 | "linkage": "auto" 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /main.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.26228.9 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LCUIEx", "main.vcxproj", "{23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}" 7 | EndProject 8 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "demo", "demo\demo.vcxproj", "{14D805BA-861B-41A1-B7EC-714B1915F400}" 9 | ProjectSection(ProjectDependencies) = postProject 10 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921} = {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921} 11 | EndProjectSection 12 | EndProject 13 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UWP", "UWP\UWP.vcxproj", "{02864F77-72F5-4001-9CD8-5DD05B0416AD}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|ARM = Debug|ARM 18 | Debug|x64 = Debug|x64 19 | Debug|x86 = Debug|x86 20 | Release|ARM = Release|ARM 21 | Release|x64 = Release|x64 22 | Release|x86 = Release|x86 23 | EndGlobalSection 24 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 25 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Debug|ARM.ActiveCfg = Debug|Win32 26 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Debug|x64.ActiveCfg = Debug|x64 27 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Debug|x64.Build.0 = Debug|x64 28 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Debug|x86.ActiveCfg = Debug|Win32 29 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Debug|x86.Build.0 = Debug|Win32 30 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Release|ARM.ActiveCfg = Release|Win32 31 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Release|x64.ActiveCfg = Release|x64 32 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Release|x64.Build.0 = Release|x64 33 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Release|x86.ActiveCfg = Release|Win32 34 | {23C02A9A-8ABC-4556-9F78-3E7C6BAF9921}.Release|x86.Build.0 = Release|Win32 35 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Debug|ARM.ActiveCfg = Debug|Win32 36 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Debug|x64.ActiveCfg = Debug|x64 37 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Debug|x64.Build.0 = Debug|x64 38 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Debug|x86.ActiveCfg = Debug|Win32 39 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Debug|x86.Build.0 = Debug|Win32 40 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Release|ARM.ActiveCfg = Release|Win32 41 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Release|x64.ActiveCfg = Release|x64 42 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Release|x64.Build.0 = Release|x64 43 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Release|x86.ActiveCfg = Release|Win32 44 | {14D805BA-861B-41A1-B7EC-714B1915F400}.Release|x86.Build.0 = Release|Win32 45 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Debug|ARM.ActiveCfg = Debug|ARM 46 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Debug|ARM.Build.0 = Debug|ARM 47 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Debug|x64.ActiveCfg = Debug|x64 48 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Debug|x64.Build.0 = Debug|x64 49 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Debug|x86.ActiveCfg = Debug|Win32 50 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Debug|x86.Build.0 = Debug|Win32 51 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Release|ARM.ActiveCfg = Release|ARM 52 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Release|ARM.Build.0 = Release|ARM 53 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Release|x64.ActiveCfg = Release|x64 54 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Release|x64.Build.0 = Release|x64 55 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Release|x86.ActiveCfg = Release|Win32 56 | {02864F77-72F5-4001-9CD8-5DD05B0416AD}.Release|x86.Build.0 = Release|Win32 57 | EndGlobalSection 58 | GlobalSection(SolutionProperties) = preSolution 59 | HideSolutionNode = FALSE 60 | EndGlobalSection 61 | GlobalSection(ExtensibilityGlobals) = postSolution 62 | SolutionGuid = {97CB5E96-72AB-46B1-9A62-C58DA3A04251} 63 | EndGlobalSection 64 | EndGlobal 65 | -------------------------------------------------------------------------------- /main.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lc-design", 3 | "version": "1.1.0", 4 | "description": "A UI component framework for building LCUI application.", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1", 8 | "demo": "node ./scripts/demo.js", 9 | "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0", 10 | "version": "npm run dist && git add -A dist/assets && conventional-changelog -p angular -i CHANGELOG.md -s -r 0 && git add CHANGELOG.md", 11 | "dist": "npm-run-all build-css build-font", 12 | "build": "npm-run-all build-css build-font build-bin build-demo", 13 | "build-bin": "node ./scripts/build-bin.js", 14 | "build-css": "node-sass --output dist/app/assets/stylesheets --output-style expanded src/scss/lc-design.scss", 15 | "build-font": "node ./scripts/build-font.js", 16 | "build-demo": "npm-run-all build-demo-bin build-demo-assets", 17 | "build-demo-assets": "npm-run-all build-demo-css build-demo-docs", 18 | "build-demo-bin": "node ./scripts/build-demo-bin.js", 19 | "build-demo-css": "node-sass --output demo/app/assets/stylesheets --output-style expanded demo/src/scss/demo.scss", 20 | "build-demo-docs": "python ./scripts/build-demo-docs.py" 21 | }, 22 | "repository": { 23 | "type": "git", 24 | "url": "git+https://github.com/lc-ui/lcui.css.git" 25 | }, 26 | "keywords": [ 27 | "css", 28 | "sass", 29 | "lcui", 30 | "framework" 31 | ], 32 | "author": "lc-soft (https://lc-soft.io)", 33 | "license": "MIT", 34 | "bugs": { 35 | "url": "https://github.com/lc-ui/lcui.css/issues" 36 | }, 37 | "homepage": "https://github.com/lc-ui/lcui.css#readme", 38 | "devDependencies": { 39 | "@commitlint/cli": "^8.2.0", 40 | "@commitlint/config-conventional": "^8.2.0", 41 | "@commitlint/travis-cli": "^8.2.0", 42 | "iconv-lite": "^0.4.19", 43 | "node-sass": "^4.13.1", 44 | "npm-run-all": "^4.1.1" 45 | }, 46 | "dependencies": { 47 | "@mdi/font": "^3.2.89" 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /scripts/build-bin.bat: -------------------------------------------------------------------------------- 1 | set "VSCMD_START_DIR=%CD%" 2 | call %1 3 | msbuild main.sln -nologo -t:Rebuild -p:Configuration=Release /p:Platform=x86 /t:LCUIEx 4 | -------------------------------------------------------------------------------- /scripts/build-bin.js: -------------------------------------------------------------------------------- 1 | var msbuild = require('./msbuild') 2 | var child_process = require('child_process') 3 | 4 | if (msbuild.exists()) { 5 | msbuild.exec('.\\scripts\\build-bin') 6 | } else { 7 | child_process.exec('xmake', function (err, stdout, stderr) { 8 | console.log(stdout) 9 | console.log(stderr) 10 | }) 11 | } 12 | 13 | -------------------------------------------------------------------------------- /scripts/build-demo-bin.bat: -------------------------------------------------------------------------------- 1 | set "VSCMD_START_DIR=%CD%" 2 | call %1 3 | msbuild main.sln -nologo -t:Rebuild -p:Configuration=Release /p:Platform=x86 /t:demo 4 | -------------------------------------------------------------------------------- /scripts/build-demo-bin.js: -------------------------------------------------------------------------------- 1 | var msbuild = require('./msbuild') 2 | var child_process = require('child_process') 3 | 4 | if (process.platform == 'win32' && msbuild.exists()) { 5 | msbuild.exec('.\\scripts\\build-demo-bin') 6 | } else { 7 | child_process.exec('xmake build demo', function (err, stdout, stderr) { 8 | console.log(stdout) 9 | console.log(stderr) 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /scripts/build-font.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs') 2 | const fontdir = 'dist/app/assets/fonts/' 3 | 4 | if (!fs.existsSync(fontdir)) { 5 | fs.mkdirSync(fontdir) 6 | } 7 | 8 | fs.createReadStream('./node_modules/@mdi/font/fonts/materialdesignicons-webfont.ttf') 9 | .pipe(fs.createWriteStream(fontdir + 'iconfont.ttf')) 10 | -------------------------------------------------------------------------------- /scripts/demo.js: -------------------------------------------------------------------------------- 1 | var child_process = require('child_process') 2 | 3 | child_process.exec('./demo', { cwd: 'demo/app' }, function (err, stdout, stderr) { 4 | console.log(stdout) 5 | console.log(stderr) 6 | }) 7 | 8 | -------------------------------------------------------------------------------- /scripts/msbuild.js: -------------------------------------------------------------------------------- 1 | const { execSync, spawnSync } = require('child_process') 2 | 3 | function getVisualStudioPath() { 4 | const options = { encoding: 'ASCII' } 5 | const key = 'HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\SxS\\VS7' 6 | const lines = execSync('reg query ' + key, options).split('\n') 7 | 8 | for (let i = 0; i < lines.length; ++i) { 9 | let values = lines[i].trim().split(' ') 10 | if (values.length > 2) { 11 | if (values[0] === '15.0') { 12 | return values[2] 13 | } 14 | } 15 | } 16 | return null 17 | } 18 | 19 | function getVSDevCmdPath() { 20 | const path = getVisualStudioPath() 21 | 22 | if (path) { 23 | return `${path}VC\\Auxiliary\\Build\\vcvars64.bat` 24 | } 25 | return null 26 | } 27 | 28 | module.exports = { 29 | exec(filename, options) { 30 | const path = getVSDevCmdPath() 31 | 32 | if (!path) { 33 | return null 34 | } 35 | return spawnSync('cmd', ['/c', filename, path], { stdio: 'inherit', ...options }) 36 | }, 37 | exists() { 38 | return process.platform == 'win32' && !!getVSDevCmdPath() 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * main.c -- LCUI.css main source file. 3 | * 4 | * Copyright (c) 2018, Liu chao All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * * Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * * Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * * Neither the name of LCUI nor the names of its contributors may be used 15 | * to endorse or promote products derived from this software without 16 | * specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #include 32 | #include 33 | 34 | const char *LCDesign_GetVersion(void) 35 | { 36 | return LCDESIGN_VERSION_STRING; 37 | } 38 | 39 | void LCDesign_Init(void) 40 | { 41 | LCDesign_InitAlert(); 42 | LCDesign_InitCheckBox(); 43 | LCDesign_InitRadio(); 44 | LCDesign_InitRadioGroup(); 45 | LCDesign_InitLabel(); 46 | LCDesign_InitIcon(); 47 | LCDesign_InitImg(); 48 | LCDesign_InitRate(); 49 | LCDesign_InitTooltip(); 50 | LCDesign_InitSpinner(); 51 | LCDesign_InitSwitch(); 52 | LCDesign_InitPassword(); 53 | LCDesign_InitTypograhy(); 54 | LCDesign_InitModal(); 55 | LCDesign_InitDropdown(); 56 | LCDesign_InitToggle(); 57 | LCDesign_InitDismiss(); 58 | LCDesign_InitMessage(); 59 | LCDesign_InitNotification(); 60 | } 61 | -------------------------------------------------------------------------------- /src/scss/_alert.scss: -------------------------------------------------------------------------------- 1 | // 2 | // Base styles 3 | // 4 | 5 | .alert { 6 | position: relative; 7 | padding: $alert-padding-y $alert-padding-x; 8 | margin-bottom: $alert-margin-bottom; 9 | border: $alert-border-width solid transparent; 10 | @include border-radius($alert-border-radius); 11 | } 12 | 13 | // Headings for larger alerts 14 | .alert-heading { 15 | // Specified to prevent conflicts of changing $headings-color 16 | color: inherit; 17 | } 18 | 19 | // Provide class for links that match alerts 20 | .alert-link { 21 | font-weight: $alert-link-font-weight; 22 | } 23 | 24 | 25 | // Dismissible alerts 26 | // 27 | // Expand the right padding and account for the close button's positioning. 28 | 29 | .alert-dismissible { 30 | padding-right: ($close-font-size + $alert-padding-x * 2); 31 | 32 | // Adjust close link position 33 | .close { 34 | top: 0; 35 | right: 0; 36 | position: absolute; 37 | padding: $alert-padding-y $alert-padding-x; 38 | } 39 | } 40 | 41 | 42 | // Alternate styles 43 | // 44 | // Generate contextual modifier classes for colorizing the alert. 45 | 46 | @each $color, $value in $theme-colors { 47 | .alert-#{$color} { 48 | @include alert-variant(theme-color-level($color, -10), theme-color-level($color, -7), theme-color-level($color, 6)); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/scss/_buttons.scss: -------------------------------------------------------------------------------- 1 | .btn { 2 | $color: theme-color(); 3 | 4 | display: inline-block; 5 | font-weight: $btn-font-weight; 6 | text-align: center; 7 | white-space: nowrap; 8 | @include text-default-style; 9 | @include button-size($input-btn-padding-y, $input-btn-padding-x, $font-size-base, $input-btn-line-height, $btn-border-radius); 10 | border: $btn-border-width solid $btn-border-color; 11 | background-color: #fff; 12 | 13 | @include text { 14 | display: inline-block; 15 | } 16 | &:hover, &:focus { 17 | border-color: $color; 18 | background-color: #fff; 19 | 20 | @include text { 21 | color: $color; 22 | } 23 | } 24 | &:active, &.active { 25 | border-color: darken($color, 10%); 26 | background-color: #fff; 27 | 28 | @include text { 29 | color: darken($color, 10%); 30 | } 31 | } 32 | &:focus { 33 | box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .2); 34 | } 35 | } 36 | 37 | 38 | // 39 | // Alternate buttons 40 | // 41 | 42 | @each $color, $value in map-merge($colors, $theme-colors) { 43 | .btn-#{$color} { 44 | @include button-variant($value, $value); 45 | } 46 | .btn-outline-#{$color} { 47 | @if $color == "light" { 48 | @include button-outline-variant($value, $gray-900); 49 | } @else { 50 | @include button-outline-variant($value, $white); 51 | } 52 | } 53 | } 54 | 55 | .btn.btn-link { 56 | $color: theme-color(); 57 | 58 | border-color: transparent; 59 | background-color: transparent; 60 | 61 | @include text { 62 | color: $color; 63 | } 64 | &:hover { 65 | @include text { 66 | color: lighten($color, 10%); 67 | } 68 | } 69 | &:active, &.active { 70 | @include text { 71 | color: darken($color, 10%); 72 | } 73 | } 74 | &:focus { 75 | box-shadow: 0 0 0 $input-btn-focus-width rgba($color, .2); 76 | } 77 | } 78 | 79 | // 80 | // Button Sizes 81 | // 82 | 83 | .btn-lg { 84 | @include button-size($input-btn-padding-y-lg, $input-btn-padding-x-lg, $font-size-lg, $input-btn-line-height-lg, $btn-border-radius-lg); 85 | } 86 | 87 | .btn-sm { 88 | @include button-size($input-btn-padding-y-sm, $input-btn-padding-x-sm, $font-size-sm, $input-btn-line-height-sm, $btn-border-radius-sm); 89 | } 90 | 91 | 92 | // 93 | // Block button 94 | // 95 | 96 | .btn-block { 97 | display: block; 98 | width: 100%; 99 | } 100 | -------------------------------------------------------------------------------- /src/scss/_checkbox.scss: -------------------------------------------------------------------------------- 1 | .checkbox-inner { 2 | width: $checkbox-size; 3 | height: $checkbox-size; 4 | border: $checkbox-border-width solid $checkbox-border-color; 5 | display: inline-block; 6 | vertical-align: middle; 7 | 8 | @include border-radius($border-radius); 9 | } 10 | 11 | .checkbox-inner-icon { 12 | color: #fff; 13 | font-size: $checkbox-size - 2px; 14 | text-align: center; 15 | line-height: $checkbox-size - $checkbox-border-width * 2; 16 | display: none; 17 | } 18 | 19 | .checkbox-text { 20 | padding: 0 map-get($spacers, 2); 21 | } 22 | 23 | checkbox { 24 | display: inline-block; 25 | margin-right: map-get($spacers, 2); 26 | 27 | &:hover .checkbox-inner { 28 | border-color: $checkbox-checked-color; 29 | } 30 | 31 | &.checked { 32 | .checkbox-inner { 33 | border-color: $checkbox-checked-color; 34 | background-color: $checkbox-checked-color; 35 | } 36 | .checkbox-inner-icon { 37 | display: block; 38 | } 39 | } 40 | &:disabled { 41 | .checkbox-inner { 42 | border-color: $checkbox-border-color; 43 | background-color: $checkbox-disabled-bg; 44 | } 45 | .checkbox-inner-icon { 46 | color: $checkbox-disabled-color; 47 | } 48 | .checkbox-text { 49 | color: $checkbox-disabled-color; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/scss/_close.scss: -------------------------------------------------------------------------------- 1 | .close { 2 | opacity: .5; 3 | @include text { 4 | line-height: 1; 5 | color: $close-color; 6 | font-size: $close-font-size; 7 | font-weight: $close-font-weight; 8 | } 9 | @include float-right; 10 | @include hover-focus { 11 | @include text { 12 | color: $close-color; 13 | opacity: .75; 14 | } 15 | } 16 | } 17 | 18 | button.close { 19 | padding: 0; 20 | border: 0; 21 | background-color: transparent; 22 | } 23 | -------------------------------------------------------------------------------- /src/scss/_dropdown.scss: -------------------------------------------------------------------------------- 1 | .dropdown-menu { 2 | top: 100%; 3 | left: 0; 4 | position: absolute; 5 | z-index: $zindex-dropdown; 6 | display: none; // none by default, but block on "open" of the menu 7 | min-width: $dropdown-min-width; 8 | padding: $dropdown-padding-y 0; 9 | margin: $dropdown-spacer 0 0; // override default ul 10 | font-size: $font-size-base; // Redeclare because nesting can cause inheritance issues 11 | color: $body-color; 12 | text-align: left; // Ensures proper alignment if parent has it changed (e.g., modal footer) 13 | background-color: $dropdown-bg; 14 | border: $dropdown-border-width solid $dropdown-border-color; 15 | @include box-shadow($dropdown-box-shadow); 16 | 17 | &.show { 18 | display: block; 19 | } 20 | } 21 | 22 | // Dividers (basically an `
`) within the dropdown 23 | .dropdown-divider { 24 | @include nav-divider($dropdown-divider-bg); 25 | } 26 | 27 | // Links, buttons, and more within the dropdown menu 28 | .dropdown-item { 29 | display: block; 30 | width: 100%; 31 | padding: $dropdown-item-padding-y $dropdown-item-padding-x; 32 | font-weight: $font-weight-normal; 33 | color: $dropdown-link-color; 34 | white-space: nowrap; 35 | background-color: transparent; 36 | border: 0; 37 | 38 | @include hover-focus { 39 | color: $dropdown-link-hover-color; 40 | @include gradient-bg($dropdown-link-hover-bg); 41 | } 42 | 43 | &.active, 44 | &:active { 45 | color: $dropdown-link-active-color; 46 | @include gradient-bg($dropdown-link-active-bg); 47 | } 48 | 49 | &.disabled, 50 | &:disabled { 51 | color: $dropdown-link-disabled-color; 52 | background-color: transparent; 53 | // Remove CSS gradients if they're enabled 54 | @if $enable-gradients { 55 | background-image: none; 56 | } 57 | } 58 | } 59 | 60 | .dropdown-menu.show { 61 | display: block; 62 | } 63 | 64 | // Dropdown section headers 65 | .dropdown-header { 66 | display: block; 67 | padding: $dropdown-padding-y $dropdown-item-padding-x; 68 | margin-bottom: 0; // for use with heading elements 69 | font-size: $font-size-sm; 70 | color: $dropdown-header-color; 71 | white-space: nowrap; // as with > li > a 72 | } 73 | -------------------------------------------------------------------------------- /src/scss/_font.scss: -------------------------------------------------------------------------------- 1 | @import "font/windows"; 2 | @import "font/ubuntu"; 3 | -------------------------------------------------------------------------------- /src/scss/_functions.scss: -------------------------------------------------------------------------------- 1 | // Functions 2 | // 3 | // Utility mixins and functions for evalutating source code across our variables, maps, and mixins. 4 | 5 | // Retreive color Sass maps 6 | @function color($key: "blue") { 7 | @return map-get($colors, $key); 8 | } 9 | 10 | @function theme-color($key: "primary") { 11 | @return map-get($theme-colors, $key); 12 | } 13 | 14 | // Color contrast 15 | @function color-yiq($color) { 16 | $r: red($color); 17 | $g: green($color); 18 | $b: blue($color); 19 | 20 | $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000; 21 | 22 | @if ($yiq >= 200) { 23 | @return $yiq-text-dark; 24 | } @else { 25 | @return $yiq-text-light; 26 | } 27 | } 28 | 29 | @function gray($key: "100") { 30 | @return map-get($grays, $key); 31 | } 32 | 33 | // Request a theme color level 34 | @function theme-color-level($color-name: "primary", $level: 0) { 35 | $color: theme-color($color-name); 36 | $color-base: if($level > 0, #000, #fff); 37 | $level: abs($level); 38 | 39 | @return mix($color-base, $color, $level * $theme-color-interval); 40 | } 41 | 42 | @function rem2px($value) { 43 | @return 14px * $value; 44 | } 45 | -------------------------------------------------------------------------------- /src/scss/_grid.scss: -------------------------------------------------------------------------------- 1 | // Container widths 2 | // 3 | // Set the container width, and override it for fixed navbars in media queries. 4 | 5 | @if $enable-grid-classes { 6 | .container { 7 | @include make-container(); 8 | max-width: $container-default-max-width; 9 | } 10 | } 11 | 12 | // Fluid container 13 | // 14 | // Utilizes the mixin meant for fixed width containers, but with 100% width for 15 | // fluid, full width layouts. 16 | 17 | @if $enable-grid-classes { 18 | .container-fluid { 19 | @include make-container(); 20 | } 21 | } 22 | 23 | // Row 24 | // 25 | // Rows contain and clear the floats of your columns. 26 | 27 | @if $enable-grid-classes { 28 | .row { 29 | @include make-row(); 30 | } 31 | } 32 | 33 | // Columns 34 | // 35 | // Common styles for small and large grid columns 36 | 37 | @if $enable-grid-classes { 38 | @include make-grid-columns(); 39 | } -------------------------------------------------------------------------------- /src/scss/_iconfont.scss: -------------------------------------------------------------------------------- 1 | $mdi-font-size-base: 16px; 2 | $mdi-css-prefix: icon; 3 | 4 | @import "../../node_modules/@mdi/font/scss/variables"; 5 | @import "../../node_modules/@mdi/font/scss/functions"; 6 | @import "iconfont/path"; 7 | @import "iconfont/core"; 8 | @import "iconfont/icons"; 9 | @import "iconfont/extras"; 10 | -------------------------------------------------------------------------------- /src/scss/_list-group.scss: -------------------------------------------------------------------------------- 1 | // Base class 2 | // 3 | // Easily usable on