您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ update_screen_locked函数代码示例

51自学网 2021-06-03 09:15:49
  C++
这篇教程C++ update_screen_locked函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中update_screen_locked函数的典型用法代码示例。如果您正苦于以下问题:C++ update_screen_locked函数的具体用法?C++ update_screen_locked怎么用?C++ update_screen_locked使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了update_screen_locked函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: pthread_mutex_lock

void ScreenRecoveryUI::SetProgress(float fraction){    pthread_mutex_lock(&updateMutex);    if (fraction < 0.0) fraction = 0.0;    if (fraction > 1.0) fraction = 1.0;    if (progressBarType == DETERMINATE && fraction > progress) {        // Skip updates that aren't visibly different.        int width = gr_get_width(progressBarEmpty);        float scale = width * progressScopeSize;        if ((int) (progress * scale) != (int) (fraction * scale)) {            progress = fraction;            update_screen_locked();        }    }    pthread_mutex_unlock(&updateMutex);}
开发者ID:TheNameIsNigel,项目名称:poc_bootable_recovery,代码行数:16,


示例2: pthread_mutex_lock

int ScreenRecoveryUI::SelectMenu(int sel) {    pthread_mutex_lock(&updateMutex);    if (show_menu) {        int old_sel = menu_sel;        menu_sel = sel;        // Wrap at top and bottom.        if (menu_sel < 0) menu_sel = menu_items - 1;        if (menu_sel >= menu_items) menu_sel = 0;        sel = menu_sel;        if (menu_sel != old_sel) update_screen_locked();    }    pthread_mutex_unlock(&updateMutex);    return sel;}
开发者ID:XperiaMultiROM,项目名称:android_bootable_recovery,代码行数:16,


示例3: ui_print

void ui_print(const char *fmt, ...){    char buf[256];    va_list ap;    char *locale_fmt = "";    locale_fmt = ui_translate(fmt);    va_start(ap, locale_fmt);    vsnprintf(buf, 256, locale_fmt, ap);    va_end(ap);    if (ui_log_stdout)        fputs(buf, stdout);    // if we are running 'ui nice' mode, we do not want to force a screen update    // for this line if not necessary.    ui_niced = 0;    if (ui_nice) {        struct timeval curtime;        gettimeofday(&curtime, NULL);        long ms = delta_milliseconds(lastupdate, curtime);        if (ms < NICE_INTERVAL && ms >= 0) {            ui_niced = 1;            return;        }    }    // This can get called before ui_init(), so be careful.    pthread_mutex_lock(&gUpdateMutex);    gettimeofday(&lastupdate, NULL);    if (text_rows > 0 && text_cols > 0) {        char *ptr;        for (ptr = buf; *ptr != '/0'; ++ptr) {            if (*ptr == '/n' || text_col >= text_cols) {                text[text_row][text_col] = '/0';                text_col = 0;                text_row = (text_row + 1) % text_rows;                if (text_row == text_top) text_top = (text_top + 1) % text_rows;            }            if (*ptr != '/n') text[text_row][text_col++] = *ptr;        }        text[text_row][text_col] = '/0';        update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);}
开发者ID:ShunYea,项目名称:bootable_recovery,代码行数:46,


示例4: pthread_mutex_lock

void ScreenRecoveryUI::StartMenu(const char* const * headers, const char* const * items,                                 int initial_selection) {    pthread_mutex_lock(&updateMutex);    if (text_rows_ > 0 && text_cols_ > 0) {        menu_headers_ = headers;        size_t i = 0;        for (; i < text_rows_ && items[i] != nullptr; ++i) {            strncpy(menu_[i], items[i], text_cols_ - 1);            menu_[i][text_cols_ - 1] = '/0';        }        menu_items = i;        show_menu = true;        menu_sel = initial_selection;        update_screen_locked();    }    pthread_mutex_unlock(&updateMutex);}
开发者ID:CanaryOS,项目名称:android_bootable_recovery,代码行数:17,


示例5: ui_start_menu

int ui_start_menu(const char** headers, char** items, int initial_selection) {#ifdef PHILZ_TOUCH_RECOVERY    ui_friendly_log(0);#endif    int i;    pthread_mutex_lock(&gUpdateMutex);    if (text_rows > 0 && text_cols > 0) {        for (i = 0; i < text_rows; ++i) {            if (headers[i] == NULL) break;            int offset = 1;#ifdef PHILZ_TOUCH_RECOVERY            if (i == 0)                offset = ui_menu_header_offset();#endif            strncpy(menu[i], headers[i], text_cols - offset);            menu[i][text_cols - offset] = '/0';        }        menu_top = i;        for (; i < MENU_MAX_ROWS; ++i) {            if (items[i-menu_top] == NULL) break;            strcpy(menu[i], MENU_ITEM_HEADER);            strncpy(menu[i] + MENU_ITEM_HEADER_LENGTH, items[i-menu_top], MENU_MAX_COLS - 1 - MENU_ITEM_HEADER_LENGTH);            menu[i][MENU_MAX_COLS-1] = '/0';        }        if (gShowBackButton && !ui_root_menu) {            strcpy(menu[i], " - +++++Go Back+++++");            ++i;        }        menu_items = i - menu_top;        show_menu = 1;        menu_sel = menu_show_start = initial_selection;        update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);    if (gShowBackButton && !ui_root_menu) {        return menu_items - 1;    }    return menu_items;}
开发者ID:Hachamacha,项目名称:philz,代码行数:43,


示例6: ui_menu_select

int ui_menu_select(int sel) {    int old_sel;    pthread_mutex_lock(&gUpdateMutex);    if (show_menu > 0) {        menu_sel = sel;        if (menu_sel < 0) {	    menu_sel = 0;	    old_sel = ui_scroll_menu(-1);	}        if (menu_sel > menu_items-1) {	    menu_sel = menu_items-1;	    old_sel = ui_scroll_menu(1);	}        sel = menu_sel;        if (old_sel) update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);    return sel;}
开发者ID:bpedman,项目名称:android_bootable_recovery,代码行数:19,


示例7: ui_menu_select

int ui_menu_select(int sel) {    int old_sel;    pthread_mutex_lock(&gUpdateMutex);    if (show_menu > 0) {        old_sel = menu_sel;        menu_sel = sel;/*        if (menu_sel < 0) menu_sel = 0;          if (menu_sel >= menu_items) menu_sel = menu_items-1;//        if (menu_sel < 0) menu_sel = menu_items-1;//        if (menu_sel >= menu_items) menu_sel = 0;        if (menu_sel < menu_show_start && menu_show_start > 0) {            menu_show_start--;        }        if (menu_sel - menu_show_start + menu_top >= text_rows) {            menu_show_start++;        }        sel = menu_sel;        if (menu_sel != old_sel) update_screen_locked();*/        if (menu_sel < 0) menu_sel = menu_items + menu_sel;        if (menu_sel >= menu_items) menu_sel = menu_sel - menu_items;        if (menu_sel < menu_show_start && menu_show_start > 0) {            menu_show_start = menu_sel;        }        if (menu_sel - menu_show_start + menu_top >= text_rows) {            menu_show_start = menu_sel + menu_top - text_rows + 1;        }        sel = menu_sel;        if (menu_sel != old_sel) update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);    return sel;}
开发者ID:RonGokhale,项目名称:Amon-Ra-Style-Recovery-Optimus_Lineup,代码行数:43,


示例8: pthread_mutex_lock

void ScreenRecoveryUI::SetBackground(Icon icon){    pthread_mutex_lock(&updateMutex);    // Adjust the offset to account for the positioning of the    // base image on the screen.    if (backgroundIcon[icon] != NULL) {        gr_surface bg = backgroundIcon[icon];        gr_surface text = backgroundText[icon];        overlay_offset_x = install_overlay_offset_x + (gr_fb_width() - gr_get_width(bg)) / 2;        overlay_offset_y = install_overlay_offset_y +            (gr_fb_height() - (gr_get_height(bg) + gr_get_height(text) + 40)) / 2;    }    currentIcon = icon;    update_screen_locked();    pthread_mutex_unlock(&updateMutex);}
开发者ID:Abhinav1997,项目名称:Team-Win-Recovery-Project,代码行数:19,


示例9: ui_menu_select

int ui_menu_select(int sel) {    int old_sel;    pthread_mutex_lock(&gUpdateMutex);    if (show_menu > 0) {        old_sel = menu_sel;        menu_sel = sel;        if (menu_sel < 0) menu_sel = menu_items + menu_sel;        if (menu_sel >= menu_items) menu_sel = menu_sel - menu_items;        //move the display starting point up the screen as the selection moves up        if (menu_show_start > 0 && menu_sel < menu_show_start) menu_show_start = menu_sel;        //move display starting point down one past the end of the current screen as the selection moves back end of screen        if (menu_sel - menu_show_start + menu_top >= text_rows) menu_show_start = menu_sel + menu_top - text_rows + 1;        sel = menu_sel;        if (menu_sel != old_sel) update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);    return sel;}
开发者ID:Hashcode,项目名称:android_device_safestrap-common,代码行数:21,


示例10: pthread_mutex_lock

void ScreenRecoveryUI::StartMenu(const char* const * headers, const char* const * items,                                 int initial_selection) {    int i = 0;    pthread_mutex_lock(&updateMutex);    if (text_rows > 0 && text_cols > 0) {        for (; i < kMaxMenuRows; ++i) {            if (items[i] == NULL) break;            strncpy(menu[i], items[i], text_cols-1);            menu[i][text_cols-1] = '/0';        }        menu_items = i;        show_menu = 1;        menu_sel = initial_selection;        if (menu_show_start <= menu_sel - max_menu_rows ||                menu_show_start > menu_sel) {            menu_show_start = menu_sel;        }        update_screen_locked();    }    pthread_mutex_unlock(&updateMutex);}
开发者ID:daddy366,项目名称:anarchy-bootable,代码行数:21,


示例11: pthread_mutex_lock

int ScreenRecoveryUI::SelectMenu(int sel) {    int wrapped = 0;    pthread_mutex_lock(&updateMutex);    if (show_menu) {        int old_sel = menu_sel;        menu_sel = sel;        // Wrap at top and bottom.        if (rainbow) {            if (menu_sel > old_sel) {                move_rainbow(1);            } else if (menu_sel < old_sel) {                move_rainbow(-1);            }        }        if (menu_sel < 0) {            wrapped = -1;            menu_sel = menu_items - 1;        }        if (menu_sel >= menu_items) {            wrapped = 1;            menu_sel = 0;        }        sel = menu_sel;        if (wrapped != 0) {            if (wrap_count / wrapped > 0) {                wrap_count += wrapped;            } else {                wrap_count = wrapped;            }            if (wrap_count / wrapped >= 5) {                wrap_count = 0;                OMGRainbows();            }        }        if (menu_sel != old_sel) update_screen_locked();    }    pthread_mutex_unlock(&updateMutex);    return sel;}
开发者ID:Cryptic-lollipop,项目名称:bootable,代码行数:40,


示例12: pthread_mutex_lock

int ScreenRecoveryUI::SelectMenu(int sel) {    int old_sel;    pthread_mutex_lock(&updateMutex);    if (show_menu > 0) {        old_sel = menu_sel;        menu_sel = sel;#if 0 //wschen 2012-07-10        if (menu_sel < 0) menu_sel = 0;        if (menu_sel >= menu_items) menu_sel = menu_items-1;#else        if (menu_sel < 0) {            menu_sel = menu_items - 1;        } else if (menu_sel >= menu_items) {            menu_sel = 0;        }#endif        sel = menu_sel;        if (menu_sel != old_sel) update_screen_locked();    }    pthread_mutex_unlock(&updateMutex);    return sel;}
开发者ID:xfzlgy,项目名称:iq450_H2_mt6589,代码行数:22,


示例13: ui_start_menu

void ui_start_menu(char** headers, char** items, int sel) {    int i;    pthread_mutex_lock(&gUpdateMutex);    if (text_rows > 0 && text_cols > 0) {        for (i = 0; i < text_rows; ++i) {            if (headers[i] == NULL) break;            strncpy(menu[i], headers[i], text_cols-1);            menu[i][text_cols-1] = '/0';        }        menu_top = i;        for (; i < text_rows; ++i) {            if (items[i-menu_top] == NULL) break;            strncpy(menu[i], items[i-menu_top], text_cols-1);            menu[i][text_cols-1] = '/0';        }        menu_items = i - menu_top;        show_menu = 1;        menu_sel = sel;        update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);}
开发者ID:teamprestigeww,项目名称:android_bootable_recovery,代码行数:22,


示例14: ui_start_menu

int ui_start_menu(char** headers, char** items) {    int i;    pthread_mutex_lock(&gUpdateMutex);    if (text_rows > 0 && text_cols > 0) {        for (i = 0; i < text_rows; ++i) {            if (headers[i] == NULL) break;            strncpy(menu[i], headers[i], text_cols-1);            menu[i][text_cols-1] = '/0';        }        menu_top = i;        for (; i < MENU_MAX_ROWS; ++i) {            if (items[i-menu_top] == NULL) break;            if (items[i-menu_top][0] != 0)            	strcpy(menu[i], MENU_ITEM_HEADER);            else            	strcpy(menu[i], MENU_ITEM_HEADER_DIV);            strncpy(menu[i] + MENU_ITEM_HEADER_LENGTH, items[i-menu_top], text_cols-1 - MENU_ITEM_HEADER_LENGTH);            menu[i][text_cols-1] = '/0';        }        if (gShowBackButton) {            strcpy(menu[i], " - +++++Go Back+++++");            ++i;        }        menu_items = i - menu_top;        show_menu = 1;        menu_sel = menu_show_start = 0;        update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);    if (gShowBackButton) {        return menu_items - 1;    }    return menu_items;}
开发者ID:eugene373,项目名称:Vibrant-recovery-2.2,代码行数:37,


示例15: ui_init

void ui_init(void){    gr_init();    ev_init();    text_col = text_row = 0;    text_rows = gr_fb_height() / CHAR_HEIGHT;    if (text_rows > MAX_ROWS) text_rows = MAX_ROWS;    text_top = 1;    text_cols = gr_fb_width() / CHAR_WIDTH;    if (text_cols > MAX_COLS - 1) text_cols = MAX_COLS - 1;    int i;    for (i = 0; BITMAPS[i].name != NULL; ++i) {        int result = res_create_surface(BITMAPS[i].name, BITMAPS[i].surface);        if (result < 0) {            if (result == -2) {                LOGI("Bitmap %s missing header/n", BITMAPS[i].name);            } else {                LOGE("Missing bitmap %s/n(Code %d)/n", BITMAPS[i].name, result);            }            *BITMAPS[i].surface = NULL;        }    }    pthread_t t;    pthread_create(&t, NULL, progress_thread, NULL);    pthread_create(&t, NULL, input_thread, NULL);    pthread_mutex_lock(&gUpdateMutex);    show_text = !show_text;    update_screen_locked();    pthread_mutex_unlock(&gUpdateMutex);}
开发者ID:teamprestigeww,项目名称:android_bootable_recovery,代码行数:36,


示例16: fputs

void ScreenRecoveryUI::PrintV(const char* fmt, bool copy_to_stdout, va_list ap) {    std::string str;    android::base::StringAppendV(&str, fmt, ap);    if (copy_to_stdout) {        fputs(str.c_str(), stdout);    }    pthread_mutex_lock(&updateMutex);    if (text_rows_ > 0 && text_cols_ > 0) {        for (const char* ptr = str.c_str(); *ptr != '/0'; ++ptr) {            if (*ptr == '/n' || text_col_ >= text_cols_) {                text_[text_row_][text_col_] = '/0';                text_col_ = 0;                text_row_ = (text_row_ + 1) % text_rows_;                if (text_row_ == text_top_) text_top_ = (text_top_ + 1) % text_rows_;            }            if (*ptr != '/n') text_[text_row_][text_col_++] = *ptr;        }        text_[text_row_][text_col_] = '/0';        update_screen_locked();    }    pthread_mutex_unlock(&updateMutex);}
开发者ID:CanaryOS,项目名称:android_bootable_recovery,代码行数:24,


示例17: ui_start_menu

int ui_start_menu(char** headers, char** items, int initial_selection) {    int i;    pthread_mutex_lock(&gUpdateMutex);    if (text_rows > 0 && text_cols > 0) {        for (i = 0; i < text_rows; ++i) {            if (headers[i] == NULL) break;            strncpy(menu[i], headers[i], text_cols-1);            menu[i][text_cols-1] = '/0';        }        menu_top = i;        for (; i < MENU_MAX_ROWS; ++i) {            if (items[i-menu_top] == NULL) break;            strcpy(menu[i], MENU_ITEM_HEADER);            strncpy(menu[i] + MENU_ITEM_HEADER_LENGTH, items[i-menu_top], MENU_MAX_COLS - 1 - MENU_ITEM_HEADER_LENGTH);            menu[i][MENU_MAX_COLS-1] = '/0';        }        if (gShowBackButton && ui_menu_level > 0) {            strcpy(menu[i], " < Go Back");            ++i;        }                strcpy(menu[i], " ");        ++i;        menu_items = i - menu_top;        show_menu = 1;        menu_sel = menu_show_start = initial_selection;        update_screen_locked();    }    pthread_mutex_unlock(&gUpdateMutex);    if (gShowBackButton && ui_menu_level > 0) {        return menu_items - 1;    }    return menu_items;}
开发者ID:simone201,项目名称:neak_bootable_recovery,代码行数:36,


示例18: input_callback

static int input_callback(int fd, short revents, void *data){    struct input_event ev;    int ret;    int fake_key = 0;    ret = ev_get_input(fd, revents, &ev);    if (ret)        return -1;#ifdef BOARD_TOUCH_RECOVERY    if (touch_handle_input(fd, ev))      return 0;#endif    if (ev.type == EV_SYN) {        return 0;    } else if (ev.type == EV_REL) {        if (ev.code == REL_Y) {            // accumulate the up or down motion reported by            // the trackball.  When it exceeds a threshold            // (positive or negative), fake an up/down            // key event.            rel_sum += ev.value;            if (rel_sum > 3) {                fake_key = 1;                ev.type = EV_KEY;                ev.code = KEY_DOWN;                ev.value = 1;                rel_sum = 0;            } else if (rel_sum < -3) {                fake_key = 1;                ev.type = EV_KEY;                ev.code = KEY_UP;                ev.value = 1;                rel_sum = 0;            }        }    } else {        rel_sum = 0;    }    if (ev.type != EV_KEY || ev.code > KEY_MAX)        return 0;    if (ev.value == 2) {        boardEnableKeyRepeat = 0;    }    pthread_mutex_lock(&key_queue_mutex);    if (!fake_key) {        // our "fake" keys only report a key-down event (no        // key-up), so don't record them in the key_pressed        // table.        key_pressed[ev.code] = ev.value;    }    const int queue_max = sizeof(key_queue) / sizeof(key_queue[0]);    if (ev.value > 0 && key_queue_len < queue_max) {        key_queue[key_queue_len++] = ev.code;        if (boardEnableKeyRepeat) {            struct timeval now;            gettimeofday(&now, NULL);            key_press_time[ev.code] = (now.tv_sec * 1000) + (now.tv_usec / 1000);            key_last_repeat[ev.code] = 0;        }        pthread_cond_signal(&key_queue_cond);    }    pthread_mutex_unlock(&key_queue_mutex);    if (ev.value > 0 && device_toggle_display(key_pressed, ev.code)) {        pthread_mutex_lock(&gUpdateMutex);        show_text = !show_text;        if (show_text) show_text_ever = 1;        update_screen_locked();        pthread_mutex_unlock(&gUpdateMutex);    }    if (ev.value > 0 && device_reboot_now(key_pressed, ev.code)) {        android_reboot(ANDROID_RB_RESTART, 0, 0);    }    return 0;}
开发者ID:Android-Butter,项目名称:butter_bootable_recovery,代码行数:86,


示例19: ev_get

// Reads input events, handles special hot keys, and adds to the key queue.static void *input_thread(void *cookie){    int rel_sum = 0;    int fake_key = 0;    for (;;) {        // wait for the next key event        struct input_event ev;        do {            ev_get(&ev, 0);            if (ev.type == EV_SYN) {                continue;            } else if (ev.type == EV_REL) {                if (ev.code == REL_Y) {                    // accumulate the up or down motion reported by                    // the trackball.  When it exceeds a threshold                    // (positive or negative), fake an up/down                    // key event.                    rel_sum += ev.value;                    if (rel_sum > 3) {                        fake_key = 1;                        ev.type = EV_KEY;                        ev.code = KEY_DOWN;                        ev.value = 1;                        rel_sum = 0;                    } else if (rel_sum < -3) {                        fake_key = 1;                        ev.type = EV_KEY;                        ev.code = KEY_UP;                        ev.value = 1;                        rel_sum = 0;                    }                }            } else {                rel_sum = 0;            }        } while (ev.type != EV_KEY || ev.code > KEY_MAX);        pthread_mutex_lock(&key_queue_mutex);        if (!fake_key) {            // our "fake" keys only report a key-down event (no            // key-up), so don't record them in the key_pressed            // table.            key_pressed[ev.code] = ev.value;        }        fake_key = 0;        const int queue_max = sizeof(key_queue) / sizeof(key_queue[0]);        if (ev.value > 0 && key_queue_len < queue_max) {            key_queue[key_queue_len++] = ev.code;            pthread_cond_signal(&key_queue_cond);        }        pthread_mutex_unlock(&key_queue_mutex);        if (ev.value > 0 && device_toggle_display(key_pressed, ev.code)) {            pthread_mutex_lock(&gUpdateMutex);            show_text = !show_text;            update_screen_locked();            pthread_mutex_unlock(&gUpdateMutex);        }        if (ev.value > 0 && device_reboot_now(key_pressed, ev.code)) {            reboot(RB_AUTOBOOT);        }    }    return NULL;}
开发者ID:teamprestigeww,项目名称:android_bootable_recovery,代码行数:67,


示例20: ev_get

// Reads input events, handles special hot keys, and adds to the key queue.static void *input_thread(void *cookie){    int rel_sum = 0;    int fake_key = 0;    for (;;) {        // wait for the next key event        struct input_event ev;        do {            ev_get(&ev, 0);			if (ev.value == 1) {/* <[email
C++ update_simple_mode函数代码示例
C++ update_screen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。