Back to index

unity  6.0.0
Protected Member Functions | Private Member Functions
GestureEngineTest Class Reference

List of all members.

Protected Member Functions

virtual void SetUp ()
void PerformPinch (GestureEngine &gesture_engine, float peak_radius)

Private Member Functions

void GenerateWindows ()

Detailed Description

Definition at line 30 of file test_gesture_engine.cpp.


Member Function Documentation

void GestureEngineTest::GenerateWindows ( ) [inline, private]

Definition at line 73 of file test_gesture_engine.cpp.

                         {
    /* remove windows from previous test */
    for (auto window : screen_mock->_client_list_stacking) {
      delete window;
    }
    screen_mock->_client_list_stacking.clear();

    /* and generate new ones */
    CompWindowMock *window;

    /* the root window */
    window = new CompWindowMock;
    /* x, y, width, height, border */
    window->_geometry.set(0, 0, screen_mock->width(), screen_mock->height(), 0);
    window->_serverGeometry = window->_geometry;
    window->_actions = 0;
    window->_state = 0;
    screen_mock->_client_list_stacking.push_back(window);

    /* middle window */
    window = new CompWindowMock;
    window->_geometry.set(10, 10, 400, 400, 0);
    window->_serverGeometry = window->_geometry;
    window->_actions = CompWindowActionMoveMask;
    window->_state = 0;
    screen_mock->_client_list_stacking.push_back(window);

    /* top-level window */
    window = new CompWindowMock;
    window->_geometry.set(500, 500, 410, 410, 0);
    window->_serverGeometry = window->_geometry;
    window->_actions = CompWindowActionMoveMask;
    window->_state = 0;
    screen_mock->_client_list_stacking.push_back(window);

    screen_mock->_client_list = screen_mock->_client_list_stacking;
    std::reverse(screen_mock->_client_list.begin(),
                 screen_mock->_client_list.end());
  }

Here is the call graph for this function:

Here is the caller graph for this function:

void GestureEngineTest::PerformPinch ( GestureEngine gesture_engine,
float  peak_radius 
) [inline, protected]

Definition at line 39 of file test_gesture_engine.cpp.

                                                                      {
    CompWindowMock *middle_window = screen_mock->_client_list_stacking[1];

    GeisAdapterMock::GeisTouchData touch_data;
    touch_data.id = 1;
    touch_data.touches = 3;
    touch_data.window = 123;
    touch_data.focus_x = 100; /* hits the middle window */
    touch_data.focus_y = 100;
    gesture_engine.OnTouchStart(&touch_data);

    GeisAdapterMock::GeisPinchData pinch_data;
    pinch_data.id = 1;
    pinch_data.touches = 3;
    pinch_data.window = 123;
    pinch_data.focus_x = 100; /* hits the middle window */
    pinch_data.focus_y = 100;
    pinch_data.radius = 1.0;
    gesture_engine.OnPinchStart(&pinch_data);

    touch_data.focus_x += 10;
    touch_data.focus_y += 20;
    gesture_engine.OnTouchUpdate(&touch_data);

    pinch_data.focus_x += 10;
    pinch_data.focus_y += 20;
    pinch_data.radius = peak_radius;
    gesture_engine.OnPinchUpdate(&pinch_data);

    gesture_engine.OnTouchFinish(&touch_data);
    gesture_engine.OnPinchFinish(&pinch_data);
  }

Here is the call graph for this function:

virtual void GestureEngineTest::SetUp ( ) [inline, protected, virtual]

Definition at line 32 of file test_gesture_engine.cpp.

Here is the call graph for this function:


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