| GL Studio C++ Runtime API

Public Types | Public Member Functions | Protected Attributes | List of all members
EventCompressor< T > Class Template Reference

`#include <events.h>`

## Public Types
typedef DisplayObject *(T::* | EventSenderCbType) (DisplayEvent *ev)
| Typedef for a event callback function pointer.

## Public Member Functions
void | Active (bool val)
bool | Active ()
| EventCompressor (T *objectPtr, EventSenderCbType cb)
bool | CompressEvent (const DisplayEvent &ev)
void | SendAnyCompressedEvents ()
| Passes along the resulting compressed event to the target object's callback function.

## Protected Attributes
MouseEvent | _lastCompressedEvent
| The result of event compression, i.e. what all the other events boiled down to.
bool | _lastEventWasCompressed
| If true, the event we're passing along was compressed.
EventSenderCbType | _handleCb
| The callback function that will process this event.
T * | _objectPtr
| The object containing the callback function.
bool | _sendingCompressed
| Flag set to avoid compressing an already compressed event (infinite loop).
bool | _active
| If active, events will be compressed, i.e. multiple MOUSE_DRAG will be boiled down to one equivalent MOUSE_DRAG.

## Detailed Description

template<class T>
class disti::EventCompressor< T >

Event Compressor

## Constructor & Destructor Documentation

## ◆ EventCompressor()

EventCompressor | ( | T * | objectPtr,
|  | EventSenderCbType | cb
| ) |  |
| inline

Construct a new EventCompressor object to compress events for the given object.

Parameters

  objectPtr | The object to receive compressed events, contains the callback function.
  cb | The callback function to receive compressed events.

## Member Function Documentation

## ◆ Active() [1/2]

bool Active | ( |  | ) |
| inline

Returns
  The current active state of event compression.

## ◆ Active() [2/2]

void Active | ( | bool | val | ) |
| inline

Set the current active state for event compression.

Parameters

  val | The new active state to set.

## ◆ CompressEvent()

bool CompressEvent | ( | const DisplayEvent & | ev | ) |
| inline

Caller should stop processing this event if returns true Caller MUST call SendAnyCompressedEvents() before drawing to make sure any saved events are processed.

Parameters

  ev | The event to compress.

Returns
  True if event was compressed.

The documentation for this class was generated from the following files:

- display_frame.h
- events.h