Browse Source

add lglw_time_get_millisec()

pull/1639/head
bsp2 6 years ago
parent
commit
4094a7a90e
3 changed files with 34 additions and 2 deletions
  1. +3
    -0
      dep/lglw/lglw.h
  2. +16
    -1
      dep/lglw/lglw_linux.c
  3. +15
    -1
      dep/lglw/lglw_windows.c

+ 3
- 0
dep/lglw/lglw.h View File

@@ -265,6 +265,9 @@ void lglw_timer_stop (lglw_t _lglw);
// Set periodic timer callback // Set periodic timer callback
void lglw_timer_callback_set (lglw_t _lglw, lglw_timer_fxn_t _cbk); void lglw_timer_callback_set (lglw_t _lglw, lglw_timer_fxn_t _cbk);


// Get milliseconds since init
uint32_t lglw_time_get_millisec (lglw_t _lglw);

// Set file drag'n'drop callback // Set file drag'n'drop callback
void lglw_dropfiles_callback_set (lglw_t _lglw, lglw_dropfiles_fxn_t _cbk); void lglw_dropfiles_callback_set (lglw_t _lglw, lglw_dropfiles_fxn_t _cbk);




+ 16
- 1
dep/lglw/lglw_linux.c View File

@@ -24,7 +24,8 @@
* ---- info : This is part of the "lglw" package. * ---- info : This is part of the "lglw" package.
* ---- * ----
* ---- created: 04Aug2018 * ---- created: 04Aug2018
* ---- changed: 05Aug2018, 06Aug2018, 07Aug2018, 08Aug2018, 09Aug2018, 18Aug2018, 10Oct2018, 16Oct2018
* ---- changed: 05Aug2018, 06Aug2018, 07Aug2018, 08Aug2018, 09Aug2018, 18Aug2018, 10Oct2018
* ---- 16Oct2018, 19May2019
* ---- * ----
* ---- * ----
*/ */
@@ -1984,6 +1985,20 @@ static void loc_process_timer(lglw_int_t *lglw) {
} }




// ---------------------------------------------------------------------------- lglw_time_get_millisec
uint32_t lglw_time_get_millisec(lglw_t _lglw) {
uint32_t r = 0u;
LGLW(_lglw);

if(NULL != lglw)
{
r = loc_millisec_delta(lglw);
}
return r;
}


// ---------------------------------------------------------------------------- loc_enable_dropfiles // ---------------------------------------------------------------------------- loc_enable_dropfiles
static void loc_enable_dropfiles(lglw_int_t *lglw, lglw_bool_t _bEnable) { static void loc_enable_dropfiles(lglw_int_t *lglw, lglw_bool_t _bEnable) {




+ 15
- 1
dep/lglw/lglw_windows.c View File

@@ -25,7 +25,7 @@
* ---- * ----
* ---- created: 04Aug2018 * ---- created: 04Aug2018
* ---- changed: 05Aug2018, 06Aug2018, 07Aug2018, 08Aug2018, 09Aug2018, 18Aug2018, 07Mar2019 * ---- changed: 05Aug2018, 06Aug2018, 07Aug2018, 08Aug2018, 09Aug2018, 18Aug2018, 07Mar2019
* ---- 10Mar2019
* ---- 10Mar2019, 19May2019
* ---- * ----
* ---- * ----
* ---- * ----
@@ -1102,6 +1102,20 @@ void lglw_timer_callback_set(lglw_t _lglw, lglw_timer_fxn_t _cbk) {
} }




// ---------------------------------------------------------------------------- lglw_time_get_millisec
uint32_t lglw_time_get_millisec(lglw_t _lglw) {
uint32_t r = 0u;
LGLW(_lglw);

if(NULL != lglw)
{
r = GetTickCount();
}
return r;
}


// ---------------------------------------------------------------------------- loc_enable_dropfiles // ---------------------------------------------------------------------------- loc_enable_dropfiles
static void loc_enable_dropfiles(lglw_int_t *lglw, lglw_bool_t _bEnable) { static void loc_enable_dropfiles(lglw_int_t *lglw, lglw_bool_t _bEnable) {
if(NULL != lglw->win.hwnd) if(NULL != lglw->win.hwnd)


Loading…
Cancel
Save