Git Product home page Git Product logo

gacui's Introduction

GacUI

GPU Accelerated C++ User Interface, with WYSIWYG developing tools, XML supports, built-in data binding and MVVM features.

License

Read the LICENSE first.

This project is licensed under the License repo.

Source code in this repo is for reference only, please use the source code in the Release repo.

You are welcome to contribute to this repo by opening pull requests.

Document

For Home Page: click here

For Gaclib: click here

For GacUI: click here

gaclib.net is a mirror to github pages above.

Content of This Project

  • The Tutorial shows how to start using this marvelous GUI library.
  • The Demos section shows you all demos using this GUI library.

Notice

Using this library requires you to use C++ source files directly in

All other files are for library development only.

Content

This GUI library provides the following features:

  • Develop your GUI using pure C++, Workflow script, XML or even JavaScript (under construction).
  • Cross-platform abilities.
  • Rich control library. Container controls supports MVC and virtual list mode.
  • Control template system. You can write your own.
  • GPU acceleration.
  • XML resource supports.
    • You can use the provided GacGen.exe to generate multiple XML files with binary resources (images) into a compressed binary format.
    • This program will also generate C++ code behind for you. You can fill event handlers (but we suggest you use MVVM and Data Binding instead) in generated C++ files.
    • If you update your UI, GacGen.exe will merge your modification in C++ code and modification in XML together to generate new C++ code behind. Your update will still exist.
      • NOTE: You will see a very obvious mark USERIMPL(/* ... */) in the generated code. Here is where you want to add your code. All your modification outside of these places will be discarded on the next GacGen.exe run.
  • MVVM and Data Binding.
    • You can define interfaces that required to build your own MVVM pattern in XML and GacGen.exe will generate the C++ interface declaration for you.
    • You can also use Workflow expressions in Data Binding and statements in event handlers (instead of writing C++ code in code behind).

https://gankra.github.io/blah/text-hates-you/
https://lord.io/text-editing-hates-you-too/

gacui's People

Contributors

dimon4eg avatar jackboosy avatar pzhlkj6612 avatar roodkcab avatar vczh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gacui's Issues

关于文本输入

会加入类似这里文本输入的效果吗。
看了下notepad++的源码,发现使用了Scintilla,然后看了这个例子,发现合成窗口是在光标下方出现的。
想问下如果要实现SciTE或者notepad++里的合成窗口直接跟在当前输入行后面要怎么做。以及,Gaclib会支持这个吗。

65 Errors 407 Warnings...

用Visual Studio 2015 CTP 6直接打开的GacStudio.sln....难道是我打开方式不对。。。。
啊,好吧。。我改掉了new的宏定义。。这样就编译成功了,1407个Warning。。WX4.。。。

Table control 能否实现aggregatable接口

想把多个table界面写到不同的xml里去,发现必须要在table上套一层实现了aggregatable的控件(custom/tabpage),which只能
<Instance name=""> <Instance ref.Class="LoginWindow"> <CustomControl> <Table> </Table> ...
不想把多个界面的Workflow都写在一个Resource文件里

Windows 10 VS2015 生成文件过大

环境:Windows 10 10586.104 64bit, Visual Studio 2015 Community.
在release里下载的0.7.8的zip,编译gaclib和gacliblite的静态链接库,结果一个188588KB,一个82956KB
然后我试着编译了一下hello world 的cppxml demo,静态编译最终生成的可执行文件15208KB,都快赶上qt的静态大小了。。
不过运行是完全正常的
是不是我的环境配置的有问题?还是本来就这么大?因为听说

一个空白的GacLib程序静态链接crt只需要700k可执行文件大小。。。

image
image

GacUI是否支持透明窗口

GDI+ 结合 updateLayeredwindow可以实现透明窗口的效果,GacUI 是否也支持透明窗口的D2D渲染?看了下代码和样例,只大概看明白了 D3D结合D2D绘制窗口过程,没有发现透明窗口支持部分

DPI support

Please add HiDPI support~
if gacui supports game engine that'll be great.

ViewModel-eval 赋值给Member时空指针异常

在Resource里组合多个页面时

<Window Text="GacPass" ClientSize="x:480 y:320">
  <gacpass:RegisterWindow Visible-bind="not ViewModel.MainPasswordSet" ViewModel-eval="ViewModel.RegisterViewModel"></gacpass:RegisterWindow>
  <gacpass:LoginWindow Visible-bind="ViewModel.MainPasswordSet and not ViewModel.LoggedIn"></gacpass:LoginWindow>
  <gacpass:CodeBookWindow Visible-bind="ViewModel.MainPasswordSet and ViewModel.LoggedIn"></gacpass:CodeBookWindow>
</Window>

ViewModel.RegisterViewModel只能当参数(ref.Parameter)传给RegisterWindow,但是使用ref.Members就会空指针

CHECK_ERROR(thisValue != nullptr, L"The this pointer cannot be null.");

如果想用Members该怎么写呢?

请教XML写法

轮子哥,单纯看demo没法完整掌握GacUI的XML文件的写法,而GacUI也没有相关的文档,感觉入门挺困难的,没法快速上手,不知道轮子哥有没有开发能直接生成GacUI的XML文件的编辑器之类的工具?手写太麻烦了,而且还容易出错。没有类似工具的话,请问怎么才能较快的掌握GacUI的用法?连文档都没有实在痛苦啊(可别说http://www.gaclib.net/Document.html#~/这个是文档)。

Dock Control

用QT弄了个这种UI,dock还挺麻烦的,而且qt的性能不是很高。

image

不如GacUI一起实现了吧,xml直接加控件~~~just like RibbonUI

mvvm转场动画如何实现?

同一个window下的两个界面visbile-bind到一个bool上之后,界面马上就切换了,想做一个转场动画,要怎么实现呢?

Object 序列化

如果可以直接将Object直接序列化到文件并可以反序列化的话,就可以省去存储的代码了。更进一步的话workflow定义出来的就是orm的接口,这样GacUI本身就是数据库的一层皮,还能跨平台,简直就是福音。

稍微看了下,有一些疑惑

我稍微看了一下源码,并没有深入,但发现有很多重新发明的轮子,比如 FileStream, Array 这样的东东,想知道作者这样设计的意图是什么?为什么不使用标准库呢?
Resource.xml 里是完全新的语法,而且不知道里面的脚本到底是啥语言?真希望能自定义脚本引擎,用上 javascript, lua 之类熟悉的东西。
现在感觉这个库的学习成本有点高啊,怕怕。

Animation performance issues

表现为鼠标在窗口内移动时帧率急剧下降,但是不动时帧率正常(录制有dither,但是实际是基本跑满60FPS的)
bug2

Multi Platform Support

看到组织 repo 列表里有几个其他平台的 port,但好像近期都没有动静 ,这些 repo 还会继续维护吗?
在 todo 里面看到了
但是为什么 todo 有一行 Ncurses on Ubuntu?
以及 Linux 兼容不能只做 X11,还应该有 Wayland

请教轮子哥

如果我们要做一个GUI桌面应用程序,
我们为什么不选nwjs或者electron?
(暂时不考虑发行文件的体积的问题)

released静态库过大

您好

环境:win7 32位,VS2017
问题1:用Windows SDK 10.0.16299.0编译会有使用SDK头文件错误的error。
问题2:换用Windows SDK 10.0.17134.0编译可以通过但VS2017编译缓慢且电脑比较卡,编译出来的静态库GacUI.lib--336M GacUIComplete.lib--104M GacUILite.lib--99.4M

GacUI能动态链接吗?

轮子哥,我把GacUI的Demo都编译过了,发现Demo都是静态链接GacUI的,能不能把GacUI编译成dll然后动态链接啊,感觉静态链接的话二进制文件比较大

WindowsController::GetExecutablePath 分配内存过大

MSDN

The Windows API has many functions that also have Unicode versions to permit an extended-length >path for a maximum total path length of 32,767 characters.

而源代码中分配了 65536 characters:

WString GetExecutablePath()
{
        Array<wchar_t> buffer(65536);
        GetModuleFileName(NULL, &buffer[0], (DWORD)buffer.Count());
        return &buffer[0];
}

而且有个小建议就是,可以一点一点试大小(MSDN评论里面的。。),毕竟长路径情况太少了。。。

使用的编译问题

有个小客户端项目需要用C++写,想了想就下载了GacUI,但是用Visual Studio 2017打开后,编译提示:
Severity Code Description Project File Line Suppression State
Error C1001 An internal error has occurred in the compiler. GacStudio C:\Users\sekkit\Downloads\GacUI-master\Tools\GacStudio\GacStudio\c1xx 1

是要用Win7才可以吗,本人是Win10 1803. 如果实在不行就用小duilib的库了,其实那种也很方便。

PS: 本人最想要的是可以选择Win2k,WinXP的luna和Win7的aeroglass主题风格,这些能不能以后内置到库里面去。Win8/10的风格实在难以接受。

Guassian Blur(Win7 aeroglass, Mac/iOS UI blur) Feature

Built-in blur effect would be cool.
With shader that can be achieved easily in Game Engines. But ordinary desktop's GUI depends on OS implementation.
Is it possible to implement high performance - high quality Blur effect just can be easily enabled by a xml tag?

可不可以提供dll文件

可不可以提供dll文件和c语言的头文件~
这样对于只使用C开发的人来说就方便多啦~

我看到SDL2也是这么干的

64位编译后随机崩溃

环境:
Windows 8.1 x64
Visual Studio 2015 RC
关闭了全程序优化
Release/Debug均有同样问题

基本上所有64位编译的程序都有问题,32位的就没有

重现方法:
是打开程序快速随机点击操作,通常1分钟内程序就会崩溃

比如:

异常:

0x00007FFACD218B9C (KernelBase.dll) (Controls.Button.CheckAndRadio.exe 中)处有未经处理的异常: 0xC0000002:  未运行请求的操作。。

堆栈:

 KernelBase.dll!00007ffacd218b9c()  未知
 d2d1.dll!00007ffac643c361()    未知
 d2d1.dll!00007ffac668fe25()    未知
 d2d1.dll!00007ffac666f2b1()    未知
 d2d1.dll!00007ffac666ef7f()    未知
 d2d1.dll!00007ffac666bd51()    未知
>Controls.Button.CheckAndRadio.exe!vl::presentation::elements_windows_d2d::GuiSolidLabelElementRenderer::Render(vl::presentation::Rect bounds) 行 11675    C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32119  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsComposition::Render(vl::presentation::Size offset) 行 32136  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsHost::Render() 行 36534  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::compositions::GuiGraphicsHost::GlobalTimer() 行 36469 C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::windows::WindowsCallbackService::InvokeGlobalTimer() 行 2686  C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::windows::GodProc(HWND__ * hwnd, unsigned int uMsg, unsigned __int64 wParam, __int64 lParam) 行 5555   C++
 [外部代码] 
 Controls.Button.CheckAndRadio.exe!vl::presentation::windows::WindowsController::Run(vl::presentation::INativeWindow * window) 行 5336 C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::controls::GuiApplication::Run(vl::presentation::controls::GuiWindow * _mainWindow) 行 155 C++
 Controls.Button.CheckAndRadio.exe!GuiMain() 行 112    C++
 Controls.Button.CheckAndRadio.exe!vl::presentation::controls::GuiApplicationInitialize() 行 437   C++
 Controls.Button.CheckAndRadio.exe!RendererMainDirect2D() 行 12997 C++
 Controls.Button.CheckAndRadio.exe!WinMainDirect2D(HINSTANCE__ * hInstance, void (void) * RendererMain) 行 235 C++
 Controls.Button.CheckAndRadio.exe!SetupWindowsDirect2DRenderer() 行 249   C++
 [外部代码]

另外最小化之后占用内存快速上升,已经按照 vczh/gac#4 提供的方法解决了。

谢谢!

技术交流:请教轮子哥,如何使无边框窗口响应窗口管理器

轮子哥,您好。我最近在尝试使用Qt制作无边框的窗口,我用setWindowFlags(Qt::Window | Qt::FramelessWindowHint)去掉了窗口边框,并且我使用Qt的事件过滤器截取了Windows事件,我在WM_NCHITTEST事件里处理了鼠标指针的变化以及实现了窗口拖动。我用DwmExtendFrameIntoClientArea(hwnd, {-1,-1,-1,-1})带回了窗口的边框阴影,可是我发现我的无边框窗口无法响应Win+←、Win+→、Win+↑以及Win+↓,也无法在拖动到桌面顶端的时候自动最大化,感觉像是无法响应“窗口管理器”(如果有这么一个东西的话)。GacUI也是自己搞的边框,用起来跟原生的边框一模一样,请问您是调用了什么API,来实现这种与“窗口管理器”的对接?

DPI auto re-size and right-click support

It seems GacUI currently doesn't support DPI auto resize.
For example, the Controls.DatePicker.DateAndLocale demo:
qq 20150406093747

One other thing, the textbox and the scroll bar doesn't have a right-click menu. Yes I know it is Direct2D, but I think maybe it should still have the right-click support as a native widget does?

对Alt键的处理问题

如果窗口使用了Template的效果但是没有Tab就像是Demo里面Template.Window.CustomizedBorder一样时,直接按下Alt键会导致崩溃;如果有使用Tab比如Demo里面Persistant.LoadFromXml.ControlTemplate则会在Tab上显示数字标号(不过现在好像还不能当快捷键用),不会崩溃。

----------------Edit---------------
此处描述不当,请见之后回复

Glitch in layout system

录制帧率不高,不过足够表现问题了,实际情形是鼠标移动时每一帧都在抖动。。
猜测 为 HiDPI 支持的问题,缩放为125%时发生
bug

不支持windows10?

弄了半天发现win10下运行编译好的几个exe毫无反映,似乎是还没有支持win10?

Cannot run in Windows7

I fixed the issue by skipping APIs in non-supported OS: WinNativeDpiAwareness.cpp.

Code in the Release repo has been updated, but a new version is not made. Please download the source code from the Release repo directly, instead of downloading the latest release.

Windows 10的新补丁会根据用户选择导致暂时不支持高DPI的GacUI程序出现问题

本来我以为按照MSDN的要求,不写manifest就是模糊的,至少还可以正确使用。不过Windows 1809好像不这么想了,他会问用户要不要让程序不模糊,如果选要,那就会进入一种奇怪的状态(常见情况是菜单点不了)。目前大家只能用manifest强行禁止Windows尝试解决这个问题,保持模糊。等到我支持完高DPI之后就不会有这个问题了。

高DPI是GacUI 1.0的一部分,仅对Direct2D开放。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.