rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Loading...
Searching...
No Matches
files_events.c File Reference

FILES' touch events: the rows, the scroll bars, the headers and the footer of the panes, NEW's choice, the DELETE question, the INFO box, the progress box and the keyboard. files_screen.c holds the state; files_int.h is what the screen's three files share. More...

#include <stdio.h>
#include <string.h>
#include "files_screen.h"
#include "ui_textkey.h"
#include "files_int.h"

Functions

static bool tap_begin (const touch_event_t *e)
 A DOWN takes the press, unless another contact holds it.
static bool tap_mine (const touch_event_t *e)
 Whether e is the held contact's.
static bool tap_far (const touch_event_t *e)
 Whether e is further than the slop from the press, in x or y.
static bool tap_on (const touch_event_t *e, gfx_rect_t r)
 Whether the release e is a tap on r: inside it, never further than the slop from its press, made by the finger (not TOUCH_FLAG_NO_TAP).
static gfx_rect_t row_rect (int i, int r)
 Row r on screen of pane i, the whole pitch a finger hits.
void fs_cancel_press (void)
 Drop a press under way: the touch stream lost an event.
static int hit_panes (int x, int y)
 What of the panes and the footer is at (x, y).
static void panes_down (const touch_event_t *e)
 A DOWN on the panes: the control under it pressed, a bar's thumb taken.
static void panes_move (const touch_event_t *e)
 A MOVE of the held contact: a bar dragged, a list scrolled.
static void panes_up (const touch_event_t *e)
 The release of the held contact on the panes: the control it pressed acts when it is a tap on it.
static void panes_event (const touch_event_t *e)
 Pane and footer events.
static int box_event (const touch_event_t *e, const gfx_rect_t *btns, const int *hits, int n)
 The events of a box with buttons: the DELETE question, INFO, the progress box and NEW's choice. A press arms a button; the release of the same contact on it acts.
static void new_event (const touch_event_t *e)
 NEW's choice: a row tapped opens the keyboard; a press anywhere else above the alert band closes the choice and acts on nothing. A press on the band does nothing, as it does with an alert showing there.
void fs_event (const touch_event_t *e)
 One touch event, in the screen's coordinates.

Detailed Description

FILES' touch events: the rows, the scroll bars, the headers and the footer of the panes, NEW's choice, the DELETE question, the INFO box, the progress box and the keyboard. files_screen.c holds the state; files_int.h is what the screen's three files share.

A button or a row is a tap: the press arms it and the release acts, when the same contact lifts inside it no further than DRAG_SLOP from where it came down. One contact holds the screen from its DOWN to its UP; another presses nothing and ends nothing. A list scrolls by a drag that starts on it, and by its scroll bar.

SPDX-License-Identifier: MIT

Function Documentation

◆ box_event()

int box_event ( const touch_event_t * e,
const gfx_rect_t * btns,
const int * hits,
int n )
static

The events of a box with buttons: the DELETE question, INFO, the progress box and NEW's choice. A press arms a button; the release of the same contact on it acts.

Parameters
ethe event
btnsthe buttons
hitseach one's fs_hit_t
nhow many
Returns
the fs_hit_t of a button tapped, FS_HIT_NONE otherwise

◆ fs_event()

void fs_event ( const touch_event_t * e)

One touch event, in the screen's coordinates.

Parameters
ethe event

◆ hit_panes()

int hit_panes ( int x,
int y )
static

What of the panes and the footer is at (x, y).

Parameters
xthe point
ythe point
Returns
an fs_hit_t; s.press_pane and s.press_row for a row or a bar

◆ new_event()

void new_event ( const touch_event_t * e)
static

NEW's choice: a row tapped opens the keyboard; a press anywhere else above the alert band closes the choice and acts on nothing. A press on the band does nothing, as it does with an alert showing there.

Parameters
ethe event

◆ panes_down()

void panes_down ( const touch_event_t * e)
static

A DOWN on the panes: the control under it pressed, a bar's thumb taken.

Parameters
ethe DOWN

◆ panes_event()

void panes_event ( const touch_event_t * e)
static

Pane and footer events.

Parameters
ethe event

◆ panes_move()

void panes_move ( const touch_event_t * e)
static

A MOVE of the held contact: a bar dragged, a list scrolled.

Parameters
ethe MOVE

◆ panes_up()

void panes_up ( const touch_event_t * e)
static

The release of the held contact on the panes: the control it pressed acts when it is a tap on it.

Parameters
ethe UP

◆ row_rect()

gfx_rect_t row_rect ( int i,
int r )
static

Row r on screen of pane i, the whole pitch a finger hits.

Parameters
ithe pane
rthe row on screen, 0 to FS_ROWS - 1
Returns
its rectangle

◆ tap_begin()

bool tap_begin ( const touch_event_t * e)
static

A DOWN takes the press, unless another contact holds it.

Parameters
ethe DOWN
Returns
true when this contact holds the press now

◆ tap_far()

bool tap_far ( const touch_event_t * e)
static

Whether e is further than the slop from the press, in x or y.

Parameters
ethe event
Returns
true past DRAG_SLOP

◆ tap_mine()

bool tap_mine ( const touch_event_t * e)
static

Whether e is the held contact's.

Parameters
ethe event
Returns
true for the contact that holds the press

◆ tap_on()

bool tap_on ( const touch_event_t * e,
gfx_rect_t r )
static

Whether the release e is a tap on r: inside it, never further than the slop from its press, made by the finger (not TOUCH_FLAG_NO_TAP).

Parameters
ethe release
rthe control
Returns
true for a tap on it