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
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
|
# CruUI

## overview
CruUI is a UI library.
It is **under construction**. It can be built with _CMake_.
## build
CruUI uses [_vcpkg_](https://github.com/microsoft/vcpkg) to manage dependencies. Vcpkg is already checked out as a submodule in `vcpkg` directory at root of the project.
You need to bootstrap vcpkg and then use it to install following packages:
- `ms-gsl`
- `fmt`
- `gtest`
Remember to install package with correct _triplet_ as the target you want to build against.
Then use _CMake_ to configure and build. Remember to set correct toolchain as in _vcpkg_ documents for _CMake_ to find packages.
There is also a automatic python script used in CI. Use python3 to run `tool/win_build.py` to build on Windows. Run with `-h` to see options. For convenience to avoid environment setup it uses _Visual Studio_ generator.
Check the code or fire a issue if you have any problem.
## structure of repository
- `include/` contains public headers.
- `src/` contains the main codes including headers and sources.
- `test/` contains unit tests. Only targets in this directories need `gtest`.
- `demo/` contains sources of demo excutable targets. They are mostly used for integrated tests but can also be used for demonstration.
- `docs` contains docs-related things.
- `tools/` contains some codes of tools like code generators.
- `tools/cppmerge` contains a _python_ script program that merges all cpp headers and sources into one **single** header and source. **Not use now**.
- `migrate-1/` contains _python_ scripts that migrate all header and source files into CamelCase. **Not use after migration**.
- `tools/build.py` is a python3 script to build the source code.
- `snippets/` contains useful snippets file for _Visual Studio_, you can import it. **No longer use any more**, because now I develop CruUI in VS Code.
- `drafts/` contains draft codes during refactor etc. They are not in main source but I think might be used in the future.
- `CMakeSettings.json` is a file that helps _Visual Studio_ to config CMake and setup intellisense.
## project structure
Test and Linux module is not developed now.

## jibber jabber
Time: 2019.12.13 2:51
After finishing No.∞ refactor of CruUI at midnight, I would like to jibber jabber about it while waiting for my instant noodles getting "cooked" in boiled water.
Why would I build a GUI library like this?
I started this project because GUI is the first practical area I stepped into in programing, which appeals to me constantly. When I was in high school and began to touch programing, my technology teacher told us GUI is simple as long as you get over algorithm. After quite years, I finally experience programing GUI by myself finding out that it's not true. GUI is the most complicated and error-prone aspect in programing. It has no fixed design and there have been so many splendid framework in GUI such as elegant React (I use it in frontend of my web app Timeline), complicated Angular, innovative Flutter, tradditional Win32 and WinForm, sophisticated WPF, bulky Qt, progressive GTK, original UWP and so on. I'm going to imitate, learn from and conclude from them to improve my design and program capacity. I think it's a fair challenge. What's more, GUI is what you can see with your eyes directly. If I want, I could try to make it beautiful and charmful. I really enjoy fluent and gorgeous animation effect.
Question 2: why C++?
After building my web app in Typescript and C#, I finally find home in C++. It's my "mother" language as I learned it with my first programing book _C++ Primer_. C++ has no virtual machine like most current languages. What about Rust? I admit it is great but it is just too "young", which you may think is my prejudice (however I do love it as well). C++'s feature is diverse and it has no prejudice on the way you should write in. It is inclusive and contains my primary feelings.
Oh, at the end, I have to say that this jibber-jabber is longer than I thought when I let it flow. Well, it's worth it at least, I think. I'll put it here in this project CruUI as one of my colorful memories about it.
|