# ZFFramework **Repository Path**: jtela/ZFFramework ## Basic Information - **Project Name**: ZFFramework - **Description**: cross-platform C++ application framework, do 80% work at 20% cost - **Primary Language**: C++ - **License**: MIT - **Default Branch**: master - **Homepage**: http://zfframework.com - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 4 - **Created**: 2021-03-06 - **Last Updated**: 2021-03-06 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Introduction welcome to ZFFramework, a cross-platform, lightweight, mid-level application framework in C++ everything here starts with "ZF", which stands for "Zero Framework" * it's not a traditional framework, can be loaded like a dynamic library, plug and play * designed to be able to run at any platform that supplies C++03 compatible implementation Homepage: * Online docs: http://ZFFramework.com * Github repo: https://github.com/ZFFramework/ZFFramework [](https://travis-ci.com/ZFFramework/ZFFramework) NOTE: this repo would keep clean (remove unnecessary history) and update frequently, if you want stable or history version, please refer to [ZFFrameworkDist](https://github.com/ZFFrameworkDist/ZFFramework) # Main features * minimum requirement * powerful reflection, serialzation, styleable logic * for how powerful ZFFramework is, you may refer to [Feature page](https://zfframework.github.io/doc/_doc_tag__feature.html) * automatic lua binding, no extra bind code or config are necessary * automatic UI serialization * stateful property animation * enhanced global event observer * fully modularization, "core + protocol + dynamic implementation" design support any platform if you are able to supply a native C++ implementation, most of implementation can be replaced easily, and implementation is required only if its owner module being used * easy to communicate with native code even to embed UI elements and native UI elements with each other * UI module to write cross-platform UI easily * built-in auto scale logic to support multiple screen size you have no need to write size-dependent code in both app and implementation # Quick overview * this piece of code shows how to show a hello world on UI and log output ```cpp #include "ZFUIWidget.h" // for common UI module ZFMAIN_ENTRY(params) // app starts from here { // show a hello world to log output zfLogT() << "hello wolrd"; // show a window (full screen by default) zfblockedAlloc(ZFUIWindow, window); window->windowShow(); // show a hello world as a text view zfblockedAlloc(ZFUITextView, textView); window->childAdd(textView); textView->layoutParam()->layoutAlign(ZFUIAlign::e_LeftInner); textView->text("hello world"); // button and click (as observer) zfblockedAlloc(ZFUIButtonBasic, button); window->childAdd(button); button->layoutParam()->layoutAlign(ZFUIAlign::e_RightInner); button->buttonLabelText("click me"); ZFLISTENER_LOCAL(onClick, { ZFUIButtonBasic *button = userData->objectHolded(); zfLogTrimT() << "button clicked:" << button; zfLogTrimT() << "sender:" << listenerData.sender(); }) button->onClick(onClick, button->objectHolder()); return 0; } ``` * this piece of code shows equivalent lua code to use ZFFramework, all the lua bindings are automatically done by reflection! ```lua zfLog('hello world') local window = ZFUIWindow() window:windowShow() local textView = zfAlloc('ZFUITextView') window:childAdd(textView) textView:layoutParam():layoutAlign(ZFUIAlign.e_LeftInner()) textView:text('hello wolrd') local button = ZFUIButtonBasic.ClassData():newInstance() window:childAdd(button) button:layoutParam():layoutAlign(ZFUIAlign.e_RightInner()) button:buttonLabelText('click me') button:onClick( function (listenerData, userData) zfLog('button clicked: %s', userData:objectHolded()) zfLog('sender: %s', listenerData:sender()) end, button:objectHolder()) ``` * and here are screenshot of demo 2048 game built by ZFFramework:
![]() |
![]() |
![]() |
![]() |
![]() |