Beispiel #1
0
static bool draw_transition(bool (*view_start)(int, int), bool (*view_end)(int, int), enum transition_t transition)
{
  static int cur_x = ET024006_WIDTH;
  static bool altern = true;
  const int inc = 25;

  cur_x -= inc;
  if (cur_x < 0)
    cur_x = 0;

  switch (transition)
  {
  case TRANSITION_FROM_LEFT_TO_RIGHT:
    if (altern)
      view_start(cur_x - ET024006_WIDTH, 0);
    else
      view_end(cur_x, 0);
    break;
  case TRANSITION_FROM_RIGHT_TO_LEFT:
    if (altern)
      view_start(ET024006_WIDTH - cur_x, 0);
    else
      view_end(-cur_x, 0);
    break;
  }

  altern = !altern;

  if (cur_x)
    return false;

  cur_x = ET024006_WIDTH;
  return true;
}
void digital_clock_cn_view_display(struct view *view) {
	struct position *start = view_start(view);
	struct digital_clock_cn *clock = to_digital_clock_cn(view);

	do_display_digital_clock_cn(clock);
	view_set_end(view, start);
}