Skip to content
Freeman Zhang edited this page Apr 29, 2015 · 5 revisions

Use libCppEvent

There's no doubt how important an event/delegate ("signal/slot" in Qt/libsigc++) mechanism implementation is in a GUI toolkit and there're already some successful C++ implementations, for example:

  • Qt
  • ligsigc++
  • boost(signal2)

And also many excellent articles about fast delegate in C++ on the web. For example:

BlendInt use libCppEvent to provide an object-oriented event/delegate framework. An event, for example, a button click event, can be connected to an view object:

  button.clicked().connect(obj, &ViewObject::DoSth);

When you click a button in the window, the method ViewObject::DoSth() of obj will be called.

The event can be disconnected:

  button.clicked().disconnect(obj, &ViewObject::DoSth);

Here is a quick guide of how to use libCppEvent.

The source code of libCppEvent in BlendInt:

Folder Remark
/include/blendint/cppevent Header
/lib/cppevent Source

Tiny introduction of events

Declaring Events

Connecting Events

Arguments

Event Chaining

Virtual Events

Table of Contents

  1. Home
  2. Roadmap
  3. Known Issues
  4. Build from Source
  5. Using BlendInt
    • H/W Requirements
    • Fontconfig and Fonts
    • Compile with BlendInt
      • "Hello World" example
      • Eclipse
      • Xcode
    • Tips
      • Use BlendInt in real time app
      • Use BlendInt in non-real time app
  6. Gallery
  7. Programming Guide
    • Basic Class Diagrams
    • Layout
    • Draw
      • Draw with OpenGL APIs
      • Draw with Predefined Shaders
    • Use event framework
    • Process HID events from window system
    • Memory Management
    • MVC for ListView/TreeView
    • Off-screen Render with FBO
    • Write your custom Widget
    • Write your custom Container
    • Themes
  8. API Reference
  9. Development
  10. FAQ
Clone this wiki locally