format code

This commit is contained in:
xianjimli 2020-08-20 10:14:39 +08:00
parent 72c3618e26
commit bc94a34a82
22 changed files with 388 additions and 283 deletions

View File

@ -0,0 +1,25 @@
<keyboard theme="keyboard" x="0" y="bottom" w="100%" h="40%">
<column style="placeholder" x="0" y="0" w="100%" h="30">
<button name="close" style="close" x="r:1" y="1" w="28" h="28" text="x" />
</column>
<pages x="0" y="30" w="100%" h="-30" active="0">
<view name="upper" x="0" y="0" w="100%" h="100%" children_layout="default(r=4,c=4,s=2,m=4)">
<button repeat="300" name="1" text="1"/>
<button repeat="300" name="2" text="2"/>
<button repeat="300" name="3" text="3"/>
<button repeat="300" name="4" text="4"/>
<button repeat="300" name="5" text="5"/>
<button repeat="300" name="6" text="6"/>
<button repeat="300" name="7" text="7"/>
<button repeat="300" name="8" text="8"/>
<button repeat="300" name="9" text="9"/>
<button repeat="300" name="-" style="highlight" text="-"/>
<button repeat="300" name="0" text="0"/>
<button repeat="300" name="key:backspace" style="highlight"><image draw_type="icon" image="backspace" x="center" y="middle" w="100%" h="100%"/></button>
<button name="clear" text="Clear"/>
<button name="cancel" text="Cancel"/>
<button name="close" text="Close"/>
<button name="back" text="Back"/>
</view>
</pages>
</keyboard>

View File

@ -0,0 +1,101 @@
TK_CONST_DATA_ALIGN(const unsigned char ui_kb_foo[]) = {
0x04,0x00,0x01,0x01,0xa0,0x07,0x00,0x00,0x00,0x00,0x00,0x00,0x6b,0x62,0x5f,0x66,0x6f,0x6f,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x12,0x12,0x22,0x11,0x6b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,
0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,
0x79,0x3d,0x62,0x6f,0x74,0x74,0x6f,0x6d,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x34,0x30,
0x25,0x29,0x00,0x74,0x68,0x65,0x6d,0x65,0x00,0x6b,0x65,0x79,0x62,0x6f,0x61,0x72,0x64,0x00,0x00,0x63,
0x6f,0x6c,0x75,0x6d,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,
0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,
0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,
0x25,0x2c,0x68,0x3d,0x33,0x30,0x29,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x70,0x6c,0x61,0x63,0x65,0x68,
0x6f,0x6c,0x64,0x65,0x72,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x73,0x65,0x6c,0x66,0x5f,
0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x72,0x3a,0x31,
0x2c,0x79,0x3d,0x31,0x2c,0x77,0x3d,0x32,0x38,0x2c,0x68,0x3d,0x32,0x38,0x29,0x00,0x6e,0x61,0x6d,0x65,
0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x74,
0x65,0x78,0x74,0x00,0x78,0x00,0x00,0x00,0x00,0x70,0x61,0x67,0x65,0x73,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x1e,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0xe2,0xff,0xff,0xff,0x73,0x65,0x6c,
0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,0x30,
0x2c,0x79,0x3d,0x33,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x2d,0x33,0x30,0x29,0x00,
0x61,0x63,0x74,0x69,0x76,0x65,0x00,0x30,0x00,0x00,0x76,0x69,0x65,0x77,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x73,0x65,
0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,
0x30,0x2c,0x79,0x3d,0x30,0x2c,0x77,0x3d,0x31,0x30,0x30,0x25,0x2c,0x68,0x3d,0x31,0x30,0x30,0x25,0x29,
0x00,0x6e,0x61,0x6d,0x65,0x00,0x75,0x70,0x70,0x65,0x72,0x00,0x63,0x68,0x69,0x6c,0x64,0x72,0x65,0x6e,
0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x72,0x3d,0x34,0x2c,
0x63,0x3d,0x34,0x2c,0x73,0x3d,0x32,0x2c,0x6d,0x3d,0x34,0x29,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x31,0x00,
0x74,0x65,0x78,0x74,0x00,0x31,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,
0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x32,0x00,0x74,0x65,0x78,0x74,0x00,
0x32,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,
0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x33,0x00,0x74,0x65,0x78,0x74,0x00,0x33,0x00,0x00,0x00,0x62,
0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x34,0x00,0x74,0x65,0x78,0x74,0x00,0x34,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x35,0x00,
0x74,0x65,0x78,0x74,0x00,0x35,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,
0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x36,0x00,0x74,0x65,0x78,0x74,0x00,
0x36,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,
0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x37,0x00,0x74,0x65,0x78,0x74,0x00,0x37,0x00,0x00,0x00,0x62,
0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,
0x6d,0x65,0x00,0x38,0x00,0x74,0x65,0x78,0x74,0x00,0x38,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x39,0x00,
0x74,0x65,0x78,0x74,0x00,0x39,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,
0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x2d,0x00,0x73,0x74,0x79,0x6c,0x65,
0x00,0x68,0x69,0x67,0x68,0x6c,0x69,0x67,0x68,0x74,0x00,0x74,0x65,0x78,0x74,0x00,0x2d,0x00,0x00,0x00,
0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,
0x61,0x6d,0x65,0x00,0x30,0x00,0x74,0x65,0x78,0x74,0x00,0x30,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,
0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x72,0x65,0x70,0x65,0x61,0x74,0x00,0x33,0x30,0x30,0x00,0x6e,0x61,0x6d,0x65,0x00,0x6b,
0x65,0x79,0x3a,0x62,0x61,0x63,0x6b,0x73,0x70,0x61,0x63,0x65,0x00,0x73,0x74,0x79,0x6c,0x65,0x00,0x68,
0x69,0x67,0x68,0x6c,0x69,0x67,0x68,0x74,0x00,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x64,0x00,0x00,0x00,0x73,0x65,
0x6c,0x66,0x5f,0x6c,0x61,0x79,0x6f,0x75,0x74,0x00,0x64,0x65,0x66,0x61,0x75,0x6c,0x74,0x28,0x78,0x3d,
0x63,0x65,0x6e,0x74,0x65,0x72,0x2c,0x79,0x3d,0x6d,0x69,0x64,0x64,0x6c,0x65,0x2c,0x77,0x3d,0x31,0x30,
0x30,0x25,0x2c,0x68,0x3d,0x31,0x30,0x30,0x25,0x29,0x00,0x64,0x72,0x61,0x77,0x5f,0x74,0x79,0x70,0x65,
0x00,0x69,0x63,0x6f,0x6e,0x00,0x69,0x6d,0x61,0x67,0x65,0x00,0x62,0x61,0x63,0x6b,0x73,0x70,0x61,0x63,
0x65,0x00,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x6c,
0x65,0x61,0x72,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x6c,0x65,0x61,0x72,0x00,0x00,0x00,0x62,0x75,0x74,
0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x63,0x61,0x6e,0x63,0x65,0x6c,0x00,0x74,0x65,0x78,
0x74,0x00,0x43,0x61,0x6e,0x63,0x65,0x6c,0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,
0x61,0x6d,0x65,0x00,0x63,0x6c,0x6f,0x73,0x65,0x00,0x74,0x65,0x78,0x74,0x00,0x43,0x6c,0x6f,0x73,0x65,
0x00,0x00,0x00,0x62,0x75,0x74,0x74,0x6f,0x6e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x6e,0x61,0x6d,0x65,0x00,0x62,0x61,0x63,0x6b,
0x00,0x74,0x65,0x78,0x74,0x00,0x42,0x61,0x63,0x6b,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};/*2000*/

Binary file not shown.

View File

@ -24,7 +24,7 @@
#ifdef WIN32
#include "win_iconv.inc"
#define WITH_ICONV 1
#endif/*WIN32*/
#endif /*WIN32*/
#if defined(LINUX) || defined(MACOS)
#include <iconv.h>

View File

@ -46,10 +46,10 @@
typedef bool_t bool;
typedef uint32_t uint32;
#define lengthof(array) (sizeof (array) / sizeof ((array)[0]))
#define lengthof(array) (sizeof(array) / sizeof((array)[0]))
#define HIGHBIT (0x80)
#define IS_HIGHBIT_SET(ch) ((unsigned char)(ch) & HIGHBIT)
#define IS_HIGHBIT_SET(ch) ((unsigned char)(ch)&HIGHBIT)
/*
* The pg_wchar type
@ -165,7 +165,8 @@ typedef unsigned int pg_wchar;
#define LC_JISX0212 0x94 /* Japanese Kanji (JIS X 0212) */
#define LC_CNS11643_1 0x95 /* CNS 11643-1992 Plane 1 */
#define LC_CNS11643_2 0x96 /* CNS 11643-1992 Plane 2 */
#define LC_JISX0213_1 0x97/* Japanese Kanji (JIS X 0213 Plane 1) (not
#define LC_JISX0213_1 \
0x97 /* Japanese Kanji (JIS X 0213 Plane 1) (not
* supported) */
#define LC_BIG5_1 0x98 /* Plane 1 Chinese traditional (not supported) */
#define LC_BIG5_2 0x99 /* Plane 1 Chinese traditional (not supported) */
@ -180,10 +181,8 @@ typedef unsigned int pg_wchar;
#define LCPRV1_A 0x9a
#define LCPRV1_B 0x9b
#define IS_LCPRV1(c) ((unsigned char)(c) == LCPRV1_A || (unsigned char)(c) == LCPRV1_B)
#define IS_LCPRV1_A_RANGE(c) \
((unsigned char)(c) >= 0xa0 && (unsigned char)(c) <= 0xdf)
#define IS_LCPRV1_B_RANGE(c) \
((unsigned char)(c) >= 0xe0 && (unsigned char)(c) <= 0xef)
#define IS_LCPRV1_A_RANGE(c) ((unsigned char)(c) >= 0xa0 && (unsigned char)(c) <= 0xdf)
#define IS_LCPRV1_B_RANGE(c) ((unsigned char)(c) >= 0xe0 && (unsigned char)(c) <= 0xef)
/*
* Postgres-specific prefix bytes for "private" multibyte encodings
@ -192,43 +191,52 @@ typedef unsigned int pg_wchar;
#define LCPRV2_A 0x9c
#define LCPRV2_B 0x9d
#define IS_LCPRV2(c) ((unsigned char)(c) == LCPRV2_A || (unsigned char)(c) == LCPRV2_B)
#define IS_LCPRV2_A_RANGE(c) \
((unsigned char)(c) >= 0xf0 && (unsigned char)(c) <= 0xf4)
#define IS_LCPRV2_B_RANGE(c) \
((unsigned char)(c) >= 0xf5 && (unsigned char)(c) <= 0xfe)
#define IS_LCPRV2_A_RANGE(c) ((unsigned char)(c) >= 0xf0 && (unsigned char)(c) <= 0xf4)
#define IS_LCPRV2_B_RANGE(c) ((unsigned char)(c) >= 0xf5 && (unsigned char)(c) <= 0xfe)
/*
* Charset IDs for private single byte encodings (0xa0-0xef)
*/
#define LC_SISHENG 0xa0/* Chinese SiSheng characters for
#define LC_SISHENG \
0xa0 /* Chinese SiSheng characters for
* PinYin/ZhuYin (not supported) */
#define LC_IPA 0xa1/* IPA (International Phonetic Association)
#define LC_IPA \
0xa1 /* IPA (International Phonetic Association)
* (not supported) */
#define LC_VISCII_LOWER 0xa2/* Vietnamese VISCII1.1 lower-case (not
#define LC_VISCII_LOWER \
0xa2 /* Vietnamese VISCII1.1 lower-case (not
* supported) */
#define LC_VISCII_UPPER 0xa3/* Vietnamese VISCII1.1 upper-case (not
#define LC_VISCII_UPPER \
0xa3 /* Vietnamese VISCII1.1 upper-case (not
* supported) */
#define LC_ARABIC_DIGIT 0xa4 /* Arabic digit (not supported) */
#define LC_ARABIC_1_COLUMN 0xa5 /* Arabic 1-column (not supported) */
#define LC_ASCII_RIGHT_TO_LEFT 0xa6 /* ASCII (left half of ISO8859-1) with
#define LC_ASCII_RIGHT_TO_LEFT \
0xa6 /* ASCII (left half of ISO8859-1) with
* right-to-left direction (not
* supported) */
#define LC_LAO 0xa7/* Lao characters (ISO10646 0E80..0EDF) (not
#define LC_LAO \
0xa7 /* Lao characters (ISO10646 0E80..0EDF) (not
* supported) */
#define LC_ARABIC_2_COLUMN 0xa8 /* Arabic 1-column (not supported) */
/*
* Charset IDs for private multibyte encodings (0xf0-0xff)
*/
#define LC_INDIAN_1_COLUMN 0xf0/* Indian charset for 1-column width glyphs
#define LC_INDIAN_1_COLUMN \
0xf0 /* Indian charset for 1-column width glyphs
* (not supported) */
#define LC_TIBETAN_1_COLUMN 0xf1/* Tibetan 1-column width glyphs (not
#define LC_TIBETAN_1_COLUMN \
0xf1 /* Tibetan 1-column width glyphs (not
* supported) */
#define LC_UNICODE_SUBSET_2 0xf2/* Unicode characters of the range
#define LC_UNICODE_SUBSET_2 \
0xf2 /* Unicode characters of the range
* U+2500..U+33FF. (not supported) */
#define LC_UNICODE_SUBSET_3 0xf3/* Unicode characters of the range
#define LC_UNICODE_SUBSET_3 \
0xf3 /* Unicode characters of the range
* U+E000..U+FFFF. (not supported) */
#define LC_UNICODE_SUBSET 0xf4/* Unicode characters of the range
#define LC_UNICODE_SUBSET \
0xf4 /* Unicode characters of the range
* U+0100..U+24FF. (not supported) */
#define LC_ETHIOPIC 0xf5 /* Ethiopic characters (not supported) */
#define LC_CNS11643_3 0xf6 /* CNS 11643-1992 Plane 3 */
@ -236,7 +244,8 @@ typedef unsigned int pg_wchar;
#define LC_CNS11643_5 0xf8 /* CNS 11643-1992 Plane 5 */
#define LC_CNS11643_6 0xf9 /* CNS 11643-1992 Plane 6 */
#define LC_CNS11643_7 0xfa /* CNS 11643-1992 Plane 7 */
#define LC_INDIAN_2_COLUMN 0xfb/* Indian charset for 2-column width glyphs
#define LC_INDIAN_2_COLUMN \
0xfb /* Indian charset for 2-column width glyphs
* (not supported) */
#define LC_TIBETAN 0xfc /* Tibetan (not supported) */
/* #define FREE 0xfd free (unused) */
@ -265,8 +274,7 @@ typedef unsigned int pg_wchar;
* encoding IDs are effectively part of libpq's ABI as far as 8.2 initdb and
* psql are concerned.
*/
typedef enum pg_enc
{
typedef enum pg_enc {
PG_SQL_ASCII = 0, /* SQL/ASCII */
PG_EUC_JP, /* EUC for Japanese */
PG_EUC_CN, /* EUC for Chinese */
@ -322,14 +330,12 @@ typedef enum pg_enc
* Please use these tests before access to pg_encconv_tbl[]
* or to other places...
*/
#define PG_VALID_BE_ENCODING(_enc) \
((_enc) >= 0 && (_enc) <= PG_ENCODING_BE_LAST)
#define PG_VALID_BE_ENCODING(_enc) ((_enc) >= 0 && (_enc) <= PG_ENCODING_BE_LAST)
#define PG_ENCODING_IS_CLIENT_ONLY(_enc) \
((_enc) > PG_ENCODING_BE_LAST && (_enc) < _PG_LAST_ENCODING_)
#define PG_VALID_ENCODING(_enc) \
((_enc) >= 0 && (_enc) < _PG_LAST_ENCODING_)
#define PG_VALID_ENCODING(_enc) ((_enc) >= 0 && (_enc) < _PG_LAST_ENCODING_)
/* On FE are possible all encodings */
#define PG_VALID_FE_ENCODING(_enc) PG_VALID_ENCODING(_enc)
@ -342,9 +348,8 @@ typedef enum pg_enc
* if (PG_VALID_ENCODING(encoding))
* pg_enc2name_tbl[ encoding ];
*/
typedef struct pg_enc2name
{
const char *name;
typedef struct pg_enc2name {
const char* name;
pg_enc encoding;
#ifdef WIN32
unsigned codepage; /* codepage for WIN32 */
@ -356,10 +361,9 @@ extern const pg_enc2name pg_enc2name_tbl[];
/*
* Encoding names for gettext
*/
typedef struct pg_enc2gettext
{
typedef struct pg_enc2gettext {
pg_enc encoding;
const char *name;
const char* name;
} pg_enc2gettext;
extern const pg_enc2gettext pg_enc2gettext_tbl[];
@ -367,24 +371,19 @@ extern const pg_enc2gettext pg_enc2gettext_tbl[];
/*
* pg_wchar stuff
*/
typedef int (*mb2wchar_with_len_converter) (const unsigned char *from,
pg_wchar *to,
int len);
typedef int (*mb2wchar_with_len_converter)(const unsigned char* from, pg_wchar* to, int len);
typedef int (*wchar2mb_with_len_converter) (const pg_wchar *from,
unsigned char *to,
int len);
typedef int (*wchar2mb_with_len_converter)(const pg_wchar* from, unsigned char* to, int len);
typedef int (*mblen_converter) (const unsigned char *mbstr);
typedef int (*mblen_converter)(const unsigned char* mbstr);
typedef int (*mbdisplaylen_converter) (const unsigned char *mbstr);
typedef int (*mbdisplaylen_converter)(const unsigned char* mbstr);
typedef bool (*mbcharacter_incrementer) (unsigned char *mbstr, int len);
typedef bool (*mbcharacter_incrementer)(unsigned char* mbstr, int len);
typedef int (*mbverifier) (const unsigned char *mbstr, int len);
typedef int (*mbverifier)(const unsigned char* mbstr, int len);
typedef struct
{
typedef struct {
mb2wchar_with_len_converter mb2wchar_with_len; /* convert a multibyte
* string to a wchar */
wchar2mb_with_len_converter wchar2mb_with_len; /* convert a wchar
@ -409,8 +408,7 @@ extern const pg_wchar_tbl pg_wchar_table[];
*
* UTF-8 to local code conversion map
*/
typedef struct
{
typedef struct {
uint32 utf; /* UTF-8 */
uint32 code; /* local code */
} pg_utf_to_local;
@ -418,8 +416,7 @@ typedef struct
/*
* local code to UTF-8 conversion map
*/
typedef struct
{
typedef struct {
uint32 code; /* local code */
uint32 utf; /* UTF-8 */
} pg_local_to_utf;
@ -427,8 +424,7 @@ typedef struct
/*
* UTF-8 to local code conversion map (for combined characters)
*/
typedef struct
{
typedef struct {
uint32 utf1; /* UTF-8 code 1 */
uint32 utf2; /* UTF-8 code 2 */
uint32 code; /* local code */
@ -437,8 +433,7 @@ typedef struct
/*
* local code to UTF-8 conversion map (for combined characters)
*/
typedef struct
{
typedef struct {
uint32 code; /* local code */
uint32 utf1; /* UTF-8 code 1 */
uint32 utf2; /* UTF-8 code 2 */
@ -449,7 +444,7 @@ typedef struct
*
* if function returns zero, it does not know how to convert the code
*/
typedef uint32 (*utf_local_conversion_func) (uint32 code);
typedef uint32 (*utf_local_conversion_func)(uint32 code);
/*
* Support macro for encoding conversion functions to validate their
@ -457,75 +452,58 @@ typedef uint32 (*utf_local_conversion_func) (uint32 code);
* here, but we don't want to do that because this header file is also
* used by frontends.)
*/
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding,destencoding) \
check_encoding_conversion_args(PG_GETARG_INT32(0), \
PG_GETARG_INT32(1), \
PG_GETARG_INT32(4), \
(srcencoding), \
(destencoding))
#define CHECK_ENCODING_CONVERSION_ARGS(srcencoding, destencoding) \
check_encoding_conversion_args(PG_GETARG_INT32(0), PG_GETARG_INT32(1), PG_GETARG_INT32(4), \
(srcencoding), (destencoding))
/*
* These functions are considered part of libpq's exported API and
* are also declared in libpq-fe.h.
*/
extern int pg_char_to_encoding(const char *name);
extern const char *pg_encoding_to_char(int encoding);
extern int pg_char_to_encoding(const char* name);
extern const char* pg_encoding_to_char(int encoding);
extern int pg_valid_server_encoding_id(int encoding);
extern int pg_utf_mblen(const unsigned char *);
extern int pg_utf_mblen(const unsigned char*);
extern unsigned short BIG5toCNS(unsigned short big5, unsigned char *lc);
extern unsigned short BIG5toCNS(unsigned short big5, unsigned char* lc);
extern unsigned short CNStoBIG5(unsigned short cns, unsigned char lc);
extern void UtfToLocal(const unsigned char *utf, int len,
unsigned char *iso,
const pg_utf_to_local *map, int mapsize,
const pg_utf_to_local_combined *cmap, int cmapsize,
utf_local_conversion_func conv_func,
int encoding);
extern void LocalToUtf(const unsigned char *iso, int len,
unsigned char *utf,
const pg_local_to_utf *map, int mapsize,
const pg_local_to_utf_combined *cmap, int cmapsize,
utf_local_conversion_func conv_func,
int encoding);
extern void UtfToLocal(const unsigned char* utf, int len, unsigned char* iso,
const pg_utf_to_local* map, int mapsize,
const pg_utf_to_local_combined* cmap, int cmapsize,
utf_local_conversion_func conv_func, int encoding);
extern void LocalToUtf(const unsigned char* iso, int len, unsigned char* utf,
const pg_local_to_utf* map, int mapsize,
const pg_local_to_utf_combined* cmap, int cmapsize,
utf_local_conversion_func conv_func, int encoding);
extern bool pg_verifymbstr(const char *mbstr, int len, bool noError);
extern bool pg_verify_mbstr(int encoding, const char *mbstr, int len,
bool noError);
extern int pg_verify_mbstr_len(int encoding, const char *mbstr, int len,
bool noError);
extern bool pg_verifymbstr(const char* mbstr, int len, bool noError);
extern bool pg_verify_mbstr(int encoding, const char* mbstr, int len, bool noError);
extern int pg_verify_mbstr_len(int encoding, const char* mbstr, int len, bool noError);
extern void check_encoding_conversion_args(int src_encoding,
int dest_encoding,
int len,
int expected_src_encoding,
int expected_dest_encoding);
extern void check_encoding_conversion_args(int src_encoding, int dest_encoding, int len,
int expected_src_encoding, int expected_dest_encoding);
extern void report_invalid_encoding(int encoding, const char *mbstr, int len) ;
extern void report_untranslatable_char(int src_encoding, int dest_encoding,
const char *mbstr, int len) ;
extern void report_invalid_encoding(int encoding, const char* mbstr, int len);
extern void report_untranslatable_char(int src_encoding, int dest_encoding, const char* mbstr,
int len);
extern void local2local(const unsigned char *l, unsigned char *p, int len,
int src_encoding, int dest_encoding, const unsigned char *tab);
extern void pg_ascii2mic(const unsigned char *l, unsigned char *p, int len);
extern void pg_mic2ascii(const unsigned char *mic, unsigned char *p, int len);
extern void latin2mic(const unsigned char *l, unsigned char *p, int len,
int lc, int encoding);
extern void mic2latin(const unsigned char *mic, unsigned char *p, int len,
int lc, int encoding);
extern void latin2mic_with_table(const unsigned char *l, unsigned char *p,
int len, int lc, int encoding,
const unsigned char *tab);
extern void mic2latin_with_table(const unsigned char *mic, unsigned char *p,
int len, int lc, int encoding,
const unsigned char *tab);
extern void local2local(const unsigned char* l, unsigned char* p, int len, int src_encoding,
int dest_encoding, const unsigned char* tab);
extern void pg_ascii2mic(const unsigned char* l, unsigned char* p, int len);
extern void pg_mic2ascii(const unsigned char* mic, unsigned char* p, int len);
extern void latin2mic(const unsigned char* l, unsigned char* p, int len, int lc, int encoding);
extern void mic2latin(const unsigned char* mic, unsigned char* p, int len, int lc, int encoding);
extern void latin2mic_with_table(const unsigned char* l, unsigned char* p, int len, int lc,
int encoding, const unsigned char* tab);
extern void mic2latin_with_table(const unsigned char* mic, unsigned char* p, int len, int lc,
int encoding, const unsigned char* tab);
extern bool pg_utf8_islegal(const unsigned char *source, int length);
extern bool pg_utf8_islegal(const unsigned char* source, int length);
#ifdef WIN32
extern WCHAR *pgwin32_message_to_UTF16(const char *str, int len, int *utf16len);
extern WCHAR* pgwin32_message_to_UTF16(const char* str, int len, int* utf16len);
#endif
#endif /* PG_WCHAR_H */

View File

@ -455,9 +455,7 @@ ret_t conf_node_set_value(conf_node_t* node, const value_t* v) {
}
break;
}
default: {
return RET_NOT_IMPL;
}
default: { return RET_NOT_IMPL; }
}
node->node_type = CONF_NODE_SIMPLE;
@ -521,9 +519,7 @@ ret_t conf_node_get_value(conf_node_t* node, value_t* v) {
value_set_str(v, node->value.small_str);
break;
}
default: {
return RET_NOT_IMPL;
}
default: { return RET_NOT_IMPL; }
}
return RET_OK;
@ -560,7 +556,7 @@ static conf_node_t* conf_doc_get_node(conf_doc_t* doc, const char* path,
iter = conf_node_find_child_by_index(node, index);
if (iter == NULL) {
if (index == conf_node_count_children(node)) {
if(index == 0) {
if (index == 0) {
node->node_type = CONF_NODE_ARRAY;
}
/*append*/

View File

@ -144,7 +144,7 @@ static ret_t candidates_relayout_children(widget_t* widget) {
canvas_set_font(c, font, font_size);
for (i = 0; i < nr; i++) {
iter = children[i];
child_w = candidates_calc_child_width(c, iter) + child_margin* 2;
child_w = candidates_calc_child_width(c, iter) + child_margin * 2;
if (iter->text.size) {
widget_set_visible(iter, TRUE, FALSE);
} else {

View File

@ -311,15 +311,15 @@ static ret_t input_engine_t9ext_set_lang(input_engine_t* engine, const char* lan
event_t e = event_init(EVT_IM_LANG_CHANGED, engine->im);
log_debug("input_engine_t9ext_set_lang: %s\n", lang);
if(tk_str_eq (lang, "123")){
if (tk_str_eq(lang, "123")) {
t9->mode = INPUT_MODE_DIGIT;
}else if (tk_str_eq (lang, "abc")){
} else if (tk_str_eq(lang, "abc")) {
t9->mode = INPUT_MODE_LOWER;
}else if (tk_str_eq (lang, "ABC")){
} else if (tk_str_eq(lang, "ABC")) {
t9->mode = INPUT_MODE_UPPER;
}else if (tk_str_eq (lang, "pinyin")){
} else if (tk_str_eq(lang, "pinyin")) {
t9->mode = INPUT_MODE_ZH;
}else {
} else {
log_debug("not support lang:%s\n", lang);
}

View File

@ -424,7 +424,7 @@ static ret_t edit_update_status(widget_t* widget) {
}
} else {
if (edit->cancelable) {
if(!wstr_equal(&(edit->saved_text), &(widget->text))) {
if (!wstr_equal(&(edit->saved_text), &(widget->text))) {
widget_set_state(widget, WIDGET_STATE_CHANGED);
return RET_OK;
}

View File

@ -68,7 +68,9 @@ TEST(ConfNode, set_get_str) {
ASSERT_EQ(conf_doc_set(doc, "names.[2]", value_set_str(&v, "anny")), RET_OK);
ASSERT_EQ(conf_doc_save_json(doc, &str), RET_OK);
ASSERT_STREQ(str.str, "{\n \"names\" : [\n \"jim\",\n \"tom\",\n \"anny\"\n ]\n}");
ASSERT_STREQ(
str.str,
"{\n \"names\" : [\n \"jim\",\n \"tom\",\n \"anny\"\n ]\n}");
conf_doc_destroy(doc);
}

View File

@ -9,4 +9,3 @@ TEST(Encoding, basic) {
ASSERT_EQ(encoding_gbk_to_utf8(gbk, strlen(gbk), utf8, sizeof(utf8)), RET_OK);
ASSERT_STREQ(str, utf8);
}

View File

@ -49,7 +49,8 @@ TEST(ScrollBar, to_xml) {
str_init(&str, 1024);
ASSERT_EQ(widget_to_xml(w, &str), RET_OK);
ASSERT_EQ(string(str.str), string("<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<scroll_bar_d x=\"10\" y=\"20\" w=\"30\" h=\"400\" "
ASSERT_EQ(string(str.str), string("<?xml version='1.0' encoding='UTF-8' standalone='yes' "
"?>\r\n<scroll_bar_d x=\"10\" y=\"20\" w=\"30\" h=\"400\" "
"animatable=\"true\">\n</scroll_bar_d>\n"));
str_reset(&str);

View File

@ -83,7 +83,6 @@ TEST(SList, tail_pop) {
ASSERT_EQ(slist_append(s, TO_POINTER(4)), RET_OK);
ASSERT_EQ(slist_append(s, TO_POINTER(5)), RET_OK);
ASSERT_EQ(TO_INT(slist_tail_pop(s)), 5);
ASSERT_EQ(TO_INT(slist_head_pop(s)), 1);

View File

@ -33,10 +33,9 @@ TEST(SpinBox, to_xml) {
str_init(&str, 1024);
ASSERT_EQ(widget_to_xml(w1, &str), RET_OK);
ASSERT_EQ(
string(str.str),
string(
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<spin_box x=\"10\" y=\"20\" w=\"30\" h=\"40\" focusable=\"true\" min=\"0\" max=\"1024\" "
ASSERT_EQ(string(str.str),
string("<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<spin_box x=\"10\" "
"y=\"20\" w=\"30\" h=\"40\" focusable=\"true\" min=\"0\" max=\"1024\" "
"input_type=\"0\" readonly=\"false\" auto_fix=\"false\" left_margin=\"2\" "
"right_margin=\"21\" top_margin=\"2\" bottom_margin=\"2\" action_text=\"done\" "
"password_visible=\"false\">\n</spin_box>\n"));

View File

@ -17,7 +17,9 @@ TEST(UISerializer, basic) {
str_init(&str, 1024);
widget_to_xml(w, &str);
ASSERT_EQ(string(str.str), "<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" w=\"30\" h=\"40\">\n</button>\n");
ASSERT_EQ(string(str.str),
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" "
"w=\"30\" h=\"40\">\n</button>\n");
str_reset(&str);
widget_destroy(w);
@ -31,7 +33,8 @@ TEST(UISerializer, repeat) {
widget_to_xml(w, &str);
ASSERT_EQ(string(str.str),
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" w=\"30\" h=\"40\" repeat=\"100\">\n</button>\n");
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" "
"w=\"30\" h=\"40\" repeat=\"100\">\n</button>\n");
str_reset(&str);
widget_destroy(w);
@ -45,7 +48,8 @@ TEST(UISerializer, layout_self) {
widget_to_xml(w, &str);
ASSERT_EQ(string(str.str),
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" w=\"30\" h=\"40\" "
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" "
"w=\"30\" h=\"40\" "
"self_layout=\"default(x=r:100,y=m:10,w=0,h=10%)\">\n</button>\n");
str_reset(&str);
@ -61,7 +65,8 @@ TEST(UISerializer, layout_self1) {
widget_to_xml(w, &str);
ASSERT_EQ(string(str.str),
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" w=\"30\" h=\"40\" "
"<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>\r\n<button x=\"10\" y=\"20\" "
"w=\"30\" h=\"40\" "
"self_layout=\"default(x=c:100,y=b:10,w=0,h=10%)\">\n</button>\n");
str_reset(&str);

View File

@ -47,7 +47,7 @@ ret_t font_gen(font_t* font, uint16_t font_size, const char* str, const char* ou
uint32_t size = font_gen_buff(font, font_size, str, &wbuffer);
if(strstr(output_filename, ".bin") != NULL) {
if (strstr(output_filename, ".bin") != NULL) {
file_write(output_filename, wbuffer.data, size);
} else {
output_res_c_source(output_filename, theme, ASSET_TYPE_FONT, ASSET_TYPE_FONT_BMP, wbuffer.data,