Add F3 key to record scenario

During ecore_shutdown, when the refcount reached 0, the scenario record
has to be done. The problem is that the ecore termination never happens
because of ecore modules loaded during init that references ecore
refcount.
The solution, until this is fixed, is to trigger the scenario recording
from a key press.
This commit is contained in:
Daniel Zaoui 2016-02-28 14:55:21 +02:00
parent 7989552b29
commit 83b9e632dc
1 changed files with 43 additions and 0 deletions

View File

@ -14,6 +14,7 @@
#define TSUITE_MAX_PATH 1024
#define SHOT_KEY_STR "F2"
#define SAVE_KEY_STR "F3"
#define IMAGE_FILENAME_EXT ".png"
/* START - EET Handling code */
@ -905,6 +906,18 @@ evas_event_feed_key_down(Evas *e, const char *keyname, const char *key,
return;
}
if (!strcmp(key, SAVE_KEY_STR))
{
if (_hook_setting)
{
if (vr_list && _hook_setting->recording)
write_events(_hook_setting->file_name, vr_list);
#ifdef DEBUG_TSUITE
printf("Save events: %s timestamp=<%u>\n", __func__, timestamp);
#endif
}
return;
}
if (vr_list && _hook_setting->recording)
{ /* Construct duplicate strings, free them when list if freed */
@ -941,6 +954,15 @@ evas_event_feed_key_up(Evas *e, const char *keyname, const char *key,
return; /* Take screenshot done on key-down */
}
if (!strcmp(key, SAVE_KEY_STR))
{
#ifdef DEBUG_TSUITE
printf("Save events: %s timestamp=<%u>\n", __func__, timestamp);
#endif
orig(e, keyname, key, string, compose, timestamp, data);
return; /* Save events done on key-down */
}
int evt = { tsuite_event_type_get(EVAS_CALLBACK_KEY_UP) };
#ifdef DEBUG_TSUITE
printf("Calling %s timestamp=<%u>\n", __func__, timestamp);
@ -988,6 +1010,18 @@ evas_event_feed_key_down_with_keycode(Evas *e, const char *keyname, const char *
return;
}
if (!strcmp(key, SAVE_KEY_STR))
{
if (_hook_setting)
{
if (vr_list && _hook_setting->recording)
write_events(_hook_setting->file_name, vr_list);
#ifdef DEBUG_TSUITE
printf("Save events: %s timestamp=<%u>\n", __func__, timestamp);
#endif
}
return;
}
if (vr_list && _hook_setting->recording)
{ /* Construct duplicate strings, free them when list if freed */
@ -1025,6 +1059,15 @@ evas_event_feed_key_up_with_keycode(Evas *e, const char *keyname, const char *ke
return; /* Take screenshot done on key-down */
}
if (!strcmp(key, SAVE_KEY_STR))
{
#ifdef DEBUG_TSUITE
printf("Save events: %s timestamp=<%u>\n", __func__, timestamp);
#endif
orig(e, keyname, key, string, compose, timestamp, data, keycode);
return; /* Save events done on key-down */
}
int evt = TSUITE_EVENT_KEY_UP_WITH_KEYCODE;
#ifdef DEBUG_TSUITE
printf("Calling %s timestamp=<%u>\n", __func__, timestamp);