全志A40i使用demo


全志源码包中附带的qtdemo源码,适用于linux、android
资源截图
代码片段和文件信息
#include “unicodeandutf8.h“

int enc_get_utf8_size(const unsigned char pInput)
{
    unsigned char c = pInput;
    if(c< 0x80) return 0;
    if(c>=0x80 && c<0xC0) return -1;
    if(c>=0xC0 && c<0xE0) return 2;
    if(c>=0xE0 && c<0xF0) return 3;
    if(c>=0xF0 && c<0xF8) return 4;
    if(c>=0xF8 && c<0xFC) return 5;
    if(c>=0xFC) return 6;
}
int enc_utf8_to_unicode_one(const unsigned char* pInput unsigned long *Unic)
{
    assert(pInput != NULL && Unic != NULL);
    char b1 b2 b3 b4 b5 b6;
    *Unic = 0x0;
    int utfbytes = enc_get_utf8_size(*pInput);
    unsigned char *pOutput = (unsigned char *) Unic;
    switch ( utfbytes )
    {
        case 0:
            *pOutput     = *pInput;
            utfbytes    += 1;
            break;
        case 2:
            b1 = *pInput;
            b2 = *(pInput + 1);
            if ( (b2 & 0xE0) != 0x80 )
                return 0;
            *pOutput     = (b1 << 6) + (b2 & 0x3F);
            *(pOutput+1) = (b1 >> 2) & 0x07;
            break;
        case 3:
            b1 = *pInput;
            b2 = *(pInput + 1);
            b3 = *(pInput + 2);
            if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80) )
                return 0;
            *pOutput     = (b2 << 6) + (b3 & 0x3F);
            *(pOutput+1) = (b1 << 4) + ((b2 >> 2) & 0x0F);
            break;
        case 4:
            b1 = *pInput;
            b2 = *(pInput + 1);
            b3 = *(pInput + 2);
            b4 = *(pInput + 3);
            if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80)
                    || ((b4 & 0xC0) != 0x80) )
                return 0;
            *pOutput     = (b3 << 6) + (b4 & 0x3F);
            *(pOutput+1) = (b2 << 4) + ((b3 >> 2) & 0x0F);
            *(pOutput+2) = ((b1 << 2) & 0x1C)  + ((b2 >> 4) & 0x03);
            break;
        case 5:
            b1 = *pInput;
            b2 = *(pInput + 1);
            b3 = *(pInput + 2);
            b4 = *(pInput + 3);
            b5 = *(pInput + 4);
            if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80)
                    || ((b4 & 0xC0) != 0x80) || ((b5 & 0xC0) != 0x80) )
                return 0;
            *pOutput     = (b4 << 6) + (b5 & 0x3F);
            *(pOutput+1) = (b3 << 4) + ((b4 >> 2) & 0x0F);
            *(pOutput+2) = (b2 << 2) + ((b3 >> 4) & 0x03);
            *(pOutput+3) = (b1 << 6);
            break;
        case 6:
            b1 = *pInput;
            b2 = *(pInput + 1);
            b3 = *(pInput + 2);
            b4 = *(pInput + 3);
            b5 = *(pInput + 4);
            b6 = *(pInput + 5);
            if ( ((b2 & 0xC0) != 0x80) || ((b3 & 0xC0) != 0x80)
                    || ((b4 & 0xC0) != 0x80) || ((b5 & 0xC0) != 0x80)
                    || ((b6 & 0xC0) != 0x80) )
                return 0;
            *pOutput     = (b5 << 6) + (b6 & 0x3F);
            *(pOutput+1) = (b5 << 4) + ((b6 >> 2) & 0x0F);
            *(pOutput+2) = (b3 

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-03-07 14:52  ui_qt
     文件        1333  2018-07-03 14:05  ui_qt.gitignore
     文件          81  2018-07-03 14:05  ui_qtApushqt.bat
     文件          99  2018-07-03 14:05  ui_qtApushqt_run.bat
     目录           0  2019-03-07 15:19  ui_qtuild
     文件       27960  2019-03-07 14:41  ui_qtuildabout.o
     文件       13976  2019-03-07 14:42  ui_qtuildadas.o
     文件       13080  2019-03-07 14:42  ui_qtuildcprojectionpicture.o
     文件       14484  2019-03-07 14:42  ui_qtuilddashboard.o
     文件       21344  2019-03-07 14:42  ui_qtuildfrmmessagebox.o
     文件       20300  2019-03-07 14:41  ui_qtuildfront_adas_setting.o
     文件       14508  2019-03-07 14:41  ui_qtuildfront_camera_setting.o
     文件        7544  2019-03-07 15:19  ui_qtuildmain.o
     文件        5752  2019-03-07 14:42  ui_qtuildmidwindow.o
     文件        3735  2019-03-07 14:42  ui_qtuildmoc_about.cpp
     文件        7124  2019-03-07 14:42  ui_qtuildmoc_about.o
     文件        4644  2019-03-07 14:42  ui_qtuildmoc_adas.cpp
     文件        7524  2019-03-07 14:42  ui_qtuildmoc_adas.o
     文件        4105  2019-03-07 14:42  ui_qtuildmoc_cprojectionpicture.cpp
     文件        9560  2019-03-07 14:42  ui_qtuildmoc_cprojectionpicture.o
     文件        3305  2019-03-07 14:42  ui_qtuildmoc_dashboard.cpp
     文件        6876  2019-03-07 14:42  ui_qtuildmoc_dashboard.o
     文件        3370  2019-03-07 14:42  ui_qtuildmoc_frmmessagebox.cpp
     文件        6968  2019-03-07 14:42  ui_qtuildmoc_frmmessagebox.o
     文件        4733  2019-03-07 14:42  ui_qtuildmoc_front_adas_setting.cpp
     文件        7752  2019-03-07 14:42  ui_qtuildmoc_front_adas_setting.o
     文件        4911  2019-03-07 14:42  ui_qtuildmoc_front_camera_setting.cpp
     文件        7916  2019-03-07 14:42  ui_qtuildmoc_front_camera_setting.o
     文件        5855  2019-03-07 14:52  ui_qtuildmoc_main_desktop.cpp
     文件        8520  2019-03-07 14:52  ui_qtuildmoc_main_desktop.o
     文件        6372  2019-03-07 14:42  ui_qtuildmoc_midwindow.cpp
............此处省略632个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)