android-sdk: Reworks the callback code, partially finished

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1827 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-08-24 11:53:37 +00:00
parent b4eba2dfa3
commit 784d4d6330
3 changed files with 372 additions and 194 deletions

View File

@ -39,7 +39,7 @@
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item2> </Item2>
</RequiredPackages> </RequiredPackages>
<Units Count="32"> <Units Count="34">
<Unit0> <Unit0>
<Filename Value="android_bindings_generator.pas"/> <Filename Value="android_bindings_generator.pas"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
@ -48,7 +48,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="15" Y="14"/> <CursorPos X="15" Y="14"/>
<UsageCount Value="47"/> <UsageCount Value="61"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit0> </Unit0>
<Unit1> <Unit1>
@ -61,7 +61,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="3" Y="39"/> <CursorPos X="3" Y="39"/>
<UsageCount Value="47"/> <UsageCount Value="61"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<LoadedDesigner Value="True"/> <LoadedDesigner Value="True"/>
</Unit1> </Unit1>
@ -71,7 +71,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="51"/> <TopLine Value="51"/>
<CursorPos X="25" Y="24"/> <CursorPos X="25" Y="24"/>
<UsageCount Value="14"/> <UsageCount Value="12"/>
</Unit2> </Unit2>
<Unit3> <Unit3>
<Filename Value="../../../p-tools/turbochessclock4android/androidutil.pas"/> <Filename Value="../../../p-tools/turbochessclock4android/androidutil.pas"/>
@ -79,7 +79,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="15"/> <UsageCount Value="13"/>
</Unit3> </Unit3>
<Unit4> <Unit4>
<Filename Value="../../../p-tools/turbochessclock4android/androidview.pas"/> <Filename Value="../../../p-tools/turbochessclock4android/androidview.pas"/>
@ -87,7 +87,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="82" Y="10"/> <CursorPos X="82" Y="10"/>
<UsageCount Value="15"/> <UsageCount Value="13"/>
</Unit4> </Unit4>
<Unit5> <Unit5>
<Filename Value="../../../p-tools/turbochessclock4android/androiddialog.pas"/> <Filename Value="../../../p-tools/turbochessclock4android/androiddialog.pas"/>
@ -95,7 +95,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="15"/> <UsageCount Value="13"/>
</Unit5> </Unit5>
<Unit6> <Unit6>
<Filename Value="../../../p-tools/turbochessclock4android/androidinputevent.pas"/> <Filename Value="../../../p-tools/turbochessclock4android/androidinputevent.pas"/>
@ -103,14 +103,14 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="9"/> <UsageCount Value="7"/>
</Unit6> </Unit6>
<Unit7> <Unit7>
<Filename Value="../../../p-tools/turbochessclock4android/android/src/com/pascal/turbochessclock/AndroidMenu.java"/> <Filename Value="../../../p-tools/turbochessclock4android/android/src/com/pascal/turbochessclock/AndroidMenu.java"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="54"/> <TopLine Value="54"/>
<CursorPos X="87" Y="37"/> <CursorPos X="87" Y="37"/>
<UsageCount Value="16"/> <UsageCount Value="14"/>
<DefaultSyntaxHighlighter Value="Java"/> <DefaultSyntaxHighlighter Value="Java"/>
</Unit7> </Unit7>
<Unit8> <Unit8>
@ -119,9 +119,9 @@
<UnitName Value="android_sdk_bindings_gen"/> <UnitName Value="android_sdk_bindings_gen"/>
<EditorIndex Value="3"/> <EditorIndex Value="3"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="528"/> <TopLine Value="677"/>
<CursorPos X="132" Y="552"/> <CursorPos X="1" Y="692"/>
<UsageCount Value="47"/> <UsageCount Value="61"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit8> </Unit8>
<Unit9> <Unit9>
@ -130,7 +130,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="1" Y="60"/> <CursorPos X="1" Y="60"/>
<UsageCount Value="15"/> <UsageCount Value="13"/>
</Unit9> </Unit9>
<Unit10> <Unit10>
<Filename Value="../../../p-tools/turbochessclock4android/androidpipescomm.pas"/> <Filename Value="../../../p-tools/turbochessclock4android/androidpipescomm.pas"/>
@ -138,14 +138,14 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="9"/> <UsageCount Value="7"/>
</Unit10> </Unit10>
<Unit11> <Unit11>
<Filename Value="../../../fpcbuild/fpcsrc/rtl/objpas/sysutils/sysstrh.inc"/> <Filename Value="../../../fpcbuild/fpcsrc/rtl/objpas/sysutils/sysstrh.inc"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="92"/> <TopLine Value="92"/>
<CursorPos X="18" Y="116"/> <CursorPos X="18" Y="116"/>
<UsageCount Value="9"/> <UsageCount Value="7"/>
<DefaultSyntaxHighlighter Value="Delphi"/> <DefaultSyntaxHighlighter Value="Delphi"/>
</Unit11> </Unit11>
<Unit12> <Unit12>
@ -153,7 +153,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="232"/> <TopLine Value="232"/>
<CursorPos X="111" Y="259"/> <CursorPos X="111" Y="259"/>
<UsageCount Value="15"/> <UsageCount Value="13"/>
<DefaultSyntaxHighlighter Value="Java"/> <DefaultSyntaxHighlighter Value="Java"/>
</Unit12> </Unit12>
<Unit13> <Unit13>
@ -162,7 +162,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="127"/> <TopLine Value="127"/>
<CursorPos X="17" Y="161"/> <CursorPos X="17" Y="161"/>
<UsageCount Value="13"/> <UsageCount Value="11"/>
</Unit13> </Unit13>
<Unit14> <Unit14>
<Filename Value="sdk_level_7/android_all.pas"/> <Filename Value="sdk_level_7/android_all.pas"/>
@ -170,7 +170,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="12"/> <UsageCount Value="10"/>
</Unit14> </Unit14>
<Unit15> <Unit15>
<Filename Value="../../../p-tools/systeminfo4android/javalang.pas"/> <Filename Value="../../../p-tools/systeminfo4android/javalang.pas"/>
@ -178,7 +178,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="10"/> <UsageCount Value="8"/>
</Unit15> </Unit15>
<Unit16> <Unit16>
<Filename Value="../../../p-tools/systeminfo4android/androidtimer.pas"/> <Filename Value="../../../p-tools/systeminfo4android/androidtimer.pas"/>
@ -186,23 +186,23 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="3" Y="20"/> <CursorPos X="3" Y="20"/>
<UsageCount Value="10"/> <UsageCount Value="8"/>
</Unit16> </Unit16>
<Unit17> <Unit17>
<Filename Value="sdk_level_7/AndroidAll.java"/> <Filename Value="sdk_level_7/AndroidAll.java"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="441"/> <TopLine Value="441"/>
<CursorPos X="16" Y="441"/> <CursorPos X="16" Y="441"/>
<UsageCount Value="12"/> <UsageCount Value="10"/>
<DefaultSyntaxHighlighter Value="Java"/> <DefaultSyntaxHighlighter Value="Java"/>
</Unit17> </Unit17>
<Unit18> <Unit18>
<Filename Value="sdk_level_7/android_all.txt"/> <Filename Value="sdk_level_7/android_all.txt"/>
<EditorIndex Value="4"/> <EditorIndex Value="4"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="14"/> <TopLine Value="92"/>
<CursorPos X="28" Y="51"/> <CursorPos X="64" Y="131"/>
<UsageCount Value="16"/> <UsageCount Value="23"/>
<Loaded Value="True"/> <Loaded Value="True"/>
<DefaultSyntaxHighlighter Value="None"/> <DefaultSyntaxHighlighter Value="None"/>
</Unit18> </Unit18>
@ -212,14 +212,14 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="501"/> <TopLine Value="501"/>
<CursorPos X="54" Y="525"/> <CursorPos X="54" Y="525"/>
<UsageCount Value="10"/> <UsageCount Value="8"/>
</Unit19> </Unit19>
<Unit20> <Unit20>
<Filename Value="../../../test/androidlcl/android/src/com/pascal/androidlcl/AndroidAll.java"/> <Filename Value="../../../test/androidlcl/android/src/com/pascal/androidlcl/AndroidAll.java"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="365"/> <TopLine Value="365"/>
<CursorPos X="38" Y="381"/> <CursorPos X="38" Y="381"/>
<UsageCount Value="10"/> <UsageCount Value="8"/>
<DefaultSyntaxHighlighter Value="Java"/> <DefaultSyntaxHighlighter Value="Java"/>
</Unit20> </Unit20>
<Unit21> <Unit21>
@ -229,7 +229,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="1"/>
<CursorPos X="26" Y="9"/> <CursorPos X="26" Y="9"/>
<UsageCount Value="16"/> <UsageCount Value="23"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit21> </Unit21>
<Unit22> <Unit22>
@ -237,7 +237,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="53"/> <TopLine Value="53"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="10"/> <UsageCount Value="8"/>
<DefaultSyntaxHighlighter Value="Java"/> <DefaultSyntaxHighlighter Value="Java"/>
</Unit22> </Unit22>
<Unit23> <Unit23>
@ -246,9 +246,9 @@
<IsVisibleTab Value="True"/> <IsVisibleTab Value="True"/>
<EditorIndex Value="5"/> <EditorIndex Value="5"/>
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1"/> <TopLine Value="404"/>
<CursorPos X="1" Y="13"/> <CursorPos X="21" Y="144"/>
<UsageCount Value="16"/> <UsageCount Value="23"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit23> </Unit23>
<Unit24> <Unit24>
@ -258,7 +258,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="38"/> <TopLine Value="38"/>
<CursorPos X="15" Y="62"/> <CursorPos X="15" Y="62"/>
<UsageCount Value="16"/> <UsageCount Value="23"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit24> </Unit24>
<Unit25> <Unit25>
@ -267,7 +267,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="74"/> <TopLine Value="74"/>
<CursorPos X="1" Y="1"/> <CursorPos X="1" Y="1"/>
<UsageCount Value="10"/> <UsageCount Value="8"/>
</Unit25> </Unit25>
<Unit26> <Unit26>
<Filename Value="../../../lazarus/lcl/arrow.pp"/> <Filename Value="../../../lazarus/lcl/arrow.pp"/>
@ -276,7 +276,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="21"/> <TopLine Value="21"/>
<CursorPos X="3" Y="45"/> <CursorPos X="3" Y="45"/>
<UsageCount Value="12"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit26> </Unit26>
<Unit27> <Unit27>
@ -286,7 +286,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="388"/> <TopLine Value="388"/>
<CursorPos X="3" Y="412"/> <CursorPos X="3" Y="412"/>
<UsageCount Value="12"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit27> </Unit27>
<Unit28> <Unit28>
@ -296,7 +296,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1952"/> <TopLine Value="1952"/>
<CursorPos X="26" Y="1976"/> <CursorPos X="26" Y="1976"/>
<UsageCount Value="12"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit28> </Unit28>
<Unit29> <Unit29>
@ -306,7 +306,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="1025"/> <TopLine Value="1025"/>
<CursorPos X="32" Y="1049"/> <CursorPos X="32" Y="1049"/>
<UsageCount Value="12"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit29> </Unit29>
<Unit30> <Unit30>
@ -316,7 +316,7 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="606"/> <TopLine Value="606"/>
<CursorPos X="3" Y="630"/> <CursorPos X="3" Y="630"/>
<UsageCount Value="12"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit30> </Unit30>
<Unit31> <Unit31>
@ -326,131 +326,141 @@
<WindowIndex Value="0"/> <WindowIndex Value="0"/>
<TopLine Value="31"/> <TopLine Value="31"/>
<CursorPos X="3" Y="56"/> <CursorPos X="3" Y="56"/>
<UsageCount Value="12"/> <UsageCount Value="19"/>
<Loaded Value="True"/> <Loaded Value="True"/>
</Unit31> </Unit31>
<Unit32>
<Filename Value="../../../lazarus/lcl/interfaces/wince/winceobject.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="301"/>
<CursorPos X="12" Y="339"/>
<UsageCount Value="9"/>
</Unit32>
<Unit33>
<Filename Value="../../../lazarus/lcl/interfaces/carbon/carbonobject.inc"/>
<WindowIndex Value="0"/>
<TopLine Value="520"/>
<CursorPos X="44" Y="552"/>
<UsageCount Value="9"/>
</Unit33>
</Units> </Units>
<JumpHistory Count="30" HistoryIndex="29"> <JumpHistory Count="29" HistoryIndex="28">
<Position1> <Position1>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="131" Column="29" TopLine="91"/>
</Position1>
<Position2>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="280" Column="1" TopLine="258"/>
</Position2>
<Position3>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="854" Column="5" TopLine="815"/>
</Position3>
<Position4>
<Filename Value="../../../lazarus/lcl/arrow.pp"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position4>
<Position5>
<Filename Value="../../../lazarus/lcl/extctrls.pp"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position5>
<Position6>
<Filename Value="../../../lazarus/lcl/comctrls.pp"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position6>
<Position7>
<Filename Value="../../../lazarus/lcl/extctrls.pp"/>
<Caret Line="555" Column="3" TopLine="531"/>
</Position7>
<Position8>
<Filename Value="../../../lazarus/lcl/extctrls.pp"/>
<Caret Line="252" Column="3" TopLine="228"/>
</Position8>
<Position9>
<Filename Value="../../../lazarus/lcl/extctrls.pp"/>
<Caret Line="710" Column="31" TopLine="686"/>
</Position9>
<Position10>
<Filename Value="../../../lazarus/lcl/extctrls.pp"/>
<Caret Line="653" Column="30" TopLine="629"/>
</Position10>
<Position11>
<Filename Value="../../../lazarus/lcl/extctrls.pp"/>
<Caret Line="595" Column="32" TopLine="571"/>
</Position11>
<Position12>
<Filename Value="../../../lazarus/lcl/grids.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position12>
<Position13>
<Filename Value="../../../lazarus/lcl/grids.pas"/>
<Caret Line="1335" Column="26" TopLine="1311"/>
</Position13>
<Position14>
<Filename Value="../../../lazarus/lcl/grids.pas"/>
<Caret Line="1150" Column="30" TopLine="1126"/>
</Position14>
<Position15>
<Filename Value="../../../lazarus/lcl/grids.pas"/>
<Caret Line="630" Column="31" TopLine="606"/>
</Position15>
<Position16>
<Filename Value="../../../lazarus/lcl/grids.pas"/>
<Caret Line="1531" Column="33" TopLine="1507"/>
</Position16>
<Position17>
<Filename Value="../../../lazarus/lcl/grids.pas"/>
<Caret Line="1465" Column="33" TopLine="1441"/>
</Position17>
<Position18>
<Filename Value="../../../lazarus/lcl/grids.pas"/>
<Caret Line="1150" Column="32" TopLine="1126"/>
</Position18>
<Position19>
<Filename Value="../../../lazarus/lcl/comctrls.pp"/>
<Caret Line="1764" Column="3" TopLine="1688"/>
</Position19>
<Position20>
<Filename Value="../../../lazarus/lcl/comctrls.pp"/>
<Caret Line="121" Column="3" TopLine="97"/>
</Position20>
<Position21>
<Filename Value="../../../lazarus/lcl/comctrls.pp"/>
<Caret Line="1976" Column="26" TopLine="1952"/>
</Position21>
<Position22>
<Filename Value="../../../lazarus/lcl/stdctrls.pp"/>
<Caret Line="165" Column="3" TopLine="141"/>
</Position22>
<Position23>
<Filename Value="../../../lazarus/lcl/stdctrls.pp"/>
<Caret Line="1290" Column="29" TopLine="1266"/>
</Position23>
<Position24>
<Filename Value="../../../lazarus/lcl/stdctrls.pp"/>
<Caret Line="1194" Column="31" TopLine="1170"/>
</Position24>
<Position25>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="39" Column="16" TopLine="14"/>
</Position25>
<Position26>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="51" Column="12" TopLine="14"/>
</Position26>
<Position27>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="89" Column="12" TopLine="49"/>
</Position27>
<Position28>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="109" Column="20" TopLine="69"/>
</Position28>
<Position29>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="552" Column="1" TopLine="525"/>
</Position29>
<Position30>
<Filename Value="android_sdk_bindings_gen.pas"/> <Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="402" Column="39" TopLine="379"/> <Caret Line="402" Column="39" TopLine="379"/>
</Position30> </Position1>
<Position2>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="30" Column="29" TopLine="6"/>
</Position2>
<Position3>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="39" Column="20" TopLine="6"/>
</Position3>
<Position4>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="41" Column="20" TopLine="15"/>
</Position4>
<Position5>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="867" Column="11" TopLine="831"/>
</Position5>
<Position6>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="857" Column="11" TopLine="843"/>
</Position6>
<Position7>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="886" Column="23" TopLine="862"/>
</Position7>
<Position8>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="889" Column="16" TopLine="878"/>
</Position8>
<Position9>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="876" Column="3" TopLine="863"/>
</Position9>
<Position10>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="852" Column="3" TopLine="834"/>
</Position10>
<Position11>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="877" Column="8" TopLine="853"/>
</Position11>
<Position12>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="849" Column="1" TopLine="834"/>
</Position12>
<Position13>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="429" Column="3" TopLine="410"/>
</Position13>
<Position14>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="432" Column="1" TopLine="410"/>
</Position14>
<Position15>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="35" Column="1" TopLine="16"/>
</Position15>
<Position16>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="44" Column="41" TopLine="15"/>
</Position16>
<Position17>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="32" Column="1" TopLine="1"/>
</Position17>
<Position18>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="93" Column="19" TopLine="52"/>
</Position18>
<Position19>
<Filename Value="sdk_level_7/android_all.txt"/>
<Caret Line="207" Column="1" TopLine="166"/>
</Position19>
<Position20>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="844" Column="58" TopLine="815"/>
</Position20>
<Position21>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="8" Column="51" TopLine="1"/>
</Position21>
<Position22>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="14" Column="19" TopLine="1"/>
</Position22>
<Position23>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="63" Column="19" TopLine="22"/>
</Position23>
<Position24>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="235" Column="21" TopLine="194"/>
</Position24>
<Position25>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="40" Column="15" TopLine="16"/>
</Position25>
<Position26>
<Filename Value="android_sdk_bindings_gen.pas"/>
<Caret Line="842" Column="3" TopLine="835"/>
</Position26>
<Position27>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="330" Column="61" TopLine="318"/>
</Position27>
<Position28>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="1" Column="1" TopLine="1"/>
</Position28>
<Position29>
<Filename Value="../../../lazarus/lcl/interfaces/android/android_all.pas"/>
<Caret Line="14" Column="19" TopLine="1"/>
</Position29>
</JumpHistory> </JumpHistory>
</ProjectOptions> </ProjectOptions>
<CompilerOptions> <CompilerOptions>

View File

@ -22,6 +22,18 @@ type
FClassNum, FMethodNum: Integer; FClassNum, FMethodNum: Integer;
FIsGlobalObject: Boolean; FIsGlobalObject: Boolean;
FGlobalObject: string; FGlobalObject: string;
//
// ProcessMethodReturnValue
FMethodReturnPas, FDeclarationBase: string;
FDeclarationIsFunction: Boolean;
// ProcessMethodName
FMethodName: string;
// ProcessMethodParameters
FPascalParams, FJavaParams: string;
FHasStringParam: Boolean;
FPasOutputImplCurLine: Integer;
FCallbackTypePas: string;
//
procedure GeneratePascalFile(ASourceFile: string; ADest: TStringList); procedure GeneratePascalFile(ASourceFile: string; ADest: TStringList);
procedure GenerateJavaFile(ASourceFile: string; ADest: TStringList); procedure GenerateJavaFile(ASourceFile: string; ADest: TStringList);
procedure ProcessModelFile(ASourceFile, APasOutputFile, AJavaOutputFile: string); procedure ProcessModelFile(ASourceFile, APasOutputFile, AJavaOutputFile: string);
@ -30,7 +42,13 @@ type
procedure ProcessModelMethod(ASourceLine: string; AIsField: Boolean); procedure ProcessModelMethod(ASourceLine: string; AIsField: Boolean);
procedure ProcessModelConstructor(ASourceLine: string); procedure ProcessModelConstructor(ASourceLine: string);
procedure ProcessModelConst(ASourceLine: string); procedure ProcessModelConst(ASourceLine: string);
procedure ProcessModelCallbackSetterCaller(ASourceLine: string); procedure ProcessModelCallbackSetter(ASourceLine: string);
procedure ProcessModelType(ASourceLine: string);
//
procedure ProcessMethodReturnValue(ASourceLine: string; var lReaderPos: Integer);
procedure ProcessMethodName(ASourceLine: string; var lReaderPos: Integer);
procedure ProcessMethodParameters(ASourceLine: string; var lReaderPos: Integer; AAddParamRead: Boolean = True);
//
function GetNextWord(ALine: string; var AStartPos: Integer): string; function GetNextWord(ALine: string; var AStartPos: Integer): string;
function GetPascalTypeName(ABaseName: string): string; function GetPascalTypeName(ABaseName: string): string;
function PassByReference(ABaseName: string): Boolean; function PassByReference(ABaseName: string): Boolean;
@ -314,9 +332,9 @@ begin
end; end;
// Callbacks // Callbacks
if lCurWord = 'callbacksettercaller' then if lCurWord = 'callbacksetter' then
begin begin
ProcessModelCallbackSetterCaller(ASourceLine); ProcessModelCallbackSetter(ASourceLine);
Exit; Exit;
end; end;
@ -326,6 +344,13 @@ begin
ProcessModelMethod(ASourceLine, True); ProcessModelMethod(ASourceLine, True);
Exit; Exit;
end; end;
// Types
if lCurWord = 'type' then
begin
ProcessModelType(ASourceLine);
Exit;
end;
end; end;
procedure TAndroidSDKBindingsGen.ProcessModelClass(ASourceLine: string; AIsInterface: Boolean); procedure TAndroidSDKBindingsGen.ProcessModelClass(ASourceLine: string; AIsInterface: Boolean);
@ -401,7 +426,6 @@ var
lMethodReturn, lMethodReturnPas, lMethodName, lParamType, lParamTypePas, lParamName, lParamPrefix: string; lMethodReturn, lMethodReturnPas, lMethodName, lParamType, lParamTypePas, lParamName, lParamPrefix: string;
lMethodReturnJavaIdentifier: string; lMethodReturnJavaIdentifier: string;
DeclarationBase, TmpStr, lIDString: string; DeclarationBase, TmpStr, lIDString: string;
FPasOutputImplCurLine: Integer;
lJavaParamVar, lJavaParams, lJavaParamSelf: string; lJavaParamVar, lJavaParams, lJavaParamSelf: string;
// For adding the var for string params // For adding the var for string params
HasStringParam: Boolean = False; HasStringParam: Boolean = False;
@ -571,7 +595,6 @@ var
lMethodName, lParamType, lParamTypePas, lParamName: string; lMethodName, lParamType, lParamTypePas, lParamName: string;
lConstructorPasParams, lConstructorJavaParams, lParamPrefix, lJavaParamVar: string; lConstructorPasParams, lConstructorJavaParams, lParamPrefix, lJavaParamVar: string;
DeclarationBase, lIDString: string; DeclarationBase, lIDString: string;
FPasOutputImplCurLine: Integer;
HasActivityParam: Boolean = False; HasActivityParam: Boolean = False;
begin begin
if ASourceLine = '' then Exit; if ASourceLine = '' then Exit;
@ -667,31 +690,34 @@ begin
lConstName := GetNextWord(ASourceLine, lReaderPos); lConstName := GetNextWord(ASourceLine, lReaderPos);
lConstName := GetNextWord(ASourceLine, lReaderPos); lConstName := GetNextWord(ASourceLine, lReaderPos);
lConstValue := GetNextWord(ASourceLine, lReaderPos); lConstValue := GetNextWord(ASourceLine, lReaderPos);
lConstValue := GetNextWord(ASourceLine, lReaderPos);
// Method type and name // Method type and name
FPasOutputConsts.Add(Format(' %s = %s;', [lConstName, lConstValue])); FPasOutputConsts.Add(Format(' %s = %s;', [lConstName, lConstValue]));
end; end;
// callbacksettercaller setOnClickListener callOnClickListener OnClickCallback = procedure (v: TView) of object; // old declaration: callbacksettercaller setOnClickListener callOnClickListener OnClickCallback = procedure (v: TView) of object;
procedure TAndroidSDKBindingsGen.ProcessModelCallbackSetterCaller(ASourceLine: string); // new declaration: callbacksetter void setOnClickListener($View.OnClickListener l)
procedure TAndroidSDKBindingsGen.ProcessModelCallbackSetter(ASourceLine: string);
var var
lReaderPos: Integer = 1; lReaderPos: Integer = 1;
lCurWord: string; lCurWord: string;
lSetterName, lCallerName, lCallbackName, lCallbackDeclaration: string; lSetterName, lCallerName, lCallbackName, lCallbackDeclaration: string;
lIDSetter, lIDStart, lIDFinished: String; lIDSetter, lIDStart, lIDFinished: String;
lJavaParamSelf: string; lJavaParamSelf: string;
lStr: String;
begin begin
if ASourceLine = '' then Exit; if ASourceLine = '' then Exit;
lSetterName := GetNextWord(ASourceLine, lReaderPos); lStr := GetNextWord(ASourceLine, lReaderPos);
lSetterName := GetNextWord(ASourceLine, lReaderPos);
lCallerName := GetNextWord(ASourceLine, lReaderPos);
lCallbackDeclaration := Copy(ASourceLine, lReaderPos, Length(ASourceLine));
lCallbackDeclaration := Trim(lCallbackDeclaration);
lCallbackName := GetNextWord(ASourceLine, lReaderPos);
ProcessMethodReturnValue(ASourceLine, lReaderPos);
ProcessMethodName(ASourceLine, lReaderPos);
ProcessMethodParameters(ASourceLine, lReaderPos);
lSetterName := FMethodName;
lIDSetter := GetIDString(lSetterName); lIDSetter := GetIDString(lSetterName);
lCallbackName := Copy(lSetterName, 4, Length(lSetterName)); // remove the "set" from the setter name
lCallerName := 'call' + lCallbackName;
AddOutputIDs(lIDSetter); AddOutputIDs(lIDSetter);
Inc(FMethodNum); Inc(FMethodNum);
lIDStart := GetIDString(lCallbackName + '_Start'); lIDStart := GetIDString(lCallbackName + '_Start');
@ -701,28 +727,26 @@ begin
AddOutputIDs(lIDFinished); AddOutputIDs(lIDFinished);
Inc(FMethodNum); Inc(FMethodNum);
FPasOutputTypes.Add(' T' + lCallbackDeclaration); FPasOutputClasses.Add( ' public');
FPasOutputClasses.Add(Format(' %s: %s;', [lCallbackName, FCallbackTypePas]));
FPasOutputClasses.Add(Format(' procedure %s(ACallback: %s);', [lSetterName, FCallbackTypePas]));
FPasOutputClasses.Add(Format(' procedure %s();', [lCallerName]));
FPasOutputClasses.Add( ' public');
FPasOutputClasses.Add(' public'); FPasOutputImpl.Add(Format('procedure %s.%s(ACallback: %s);', [FClassNamePas, lSetterName, FCallbackTypePas]));
FPasOutputClasses.Add(' ' + lCallbackName + ': T' + lCallbackName + ';'); FPasOutputImpl.Add( 'begin');
FPasOutputClasses.Add(' procedure ' + lSetterName + '(ACallback: T' + lCallbackName + ');'); FPasOutputImpl.Add( ' OnClickListener := ACallback;');
FPasOutputClasses.Add(' procedure ' + lCallerName + '();'); FPasOutputImpl.Add( ' vAndroidPipesComm.SendByte(ShortInt(amkUICommand));');
FPasOutputClasses.Add(' public'); FPasOutputImpl.Add( ' vAndroidPipesComm.SendInt(' + lIDSetter + ');');
FPasOutputImpl.Add( ' vAndroidPipesComm.SendInt(Index); // Self, Java Index');
FPasOutputImpl.Add('procedure ' + FClassNamePas + '.' + lSetterName + '(ACallback: T' + lCallbackName + ');'); FPasOutputImpl.Add( ' vAndroidPipesComm.SendInt(PtrInt(Self)); // Self, Pascal pointer');
FPasOutputImpl.Add('begin'); FPasOutputImpl.Add( ' vAndroidPipesComm.WaitForReturn();');
FPasOutputImpl.Add(' OnClickListener := ACallback;'); FPasOutputImpl.Add( 'end;');
FPasOutputImpl.Add(' vAndroidPipesComm.SendByte(ShortInt(amkUICommand));'); FPasOutputImpl.Add( '');
FPasOutputImpl.Add(' vAndroidPipesComm.SendInt(' + lIDSetter + ');'); FPasOutputImpl.Add(Format('procedure %s.%s();', [FClassNamePas, lCallerName]));
FPasOutputImpl.Add(' vAndroidPipesComm.SendInt(Index); // Self, Java Index'); FPasOutputImpl.Add( 'begin');
FPasOutputImpl.Add(' vAndroidPipesComm.SendInt(PtrInt(Self)); // Self, Pascal pointer'); FPasOutputImpl.Add( ' if Assigned(OnClickListener) then OnClickListener(Self);');
FPasOutputImpl.Add(' vAndroidPipesComm.WaitForReturn();'); FPasOutputImpl.Add( 'end;');
FPasOutputImpl.Add('end;');
FPasOutputImpl.Add('');
FPasOutputImpl.Add('procedure ' + FClassNamePas + '.' + lCallerName + '();');
FPasOutputImpl.Add('begin');
FPasOutputImpl.Add(' if Assigned(OnClickListener) then OnClickListener(Self);');
FPasOutputImpl.Add('end;');
// Method type and name // Method type and name
FPasOutputMessages.Add(' ' + lIDStart + ':'); FPasOutputMessages.Add(' ' + lIDStart + ':');
@ -803,12 +827,148 @@ begin
break;*) break;*)
end; end;
// type View.OnClickListener = void onClick(View v)
procedure TAndroidSDKBindingsGen.ProcessModelType(ASourceLine: string);
var
lReaderPos: Integer = 1;
lCurWord: string;
lStr, lCallbackDeclaration, lPascalType: String;
begin
if ASourceLine = '' then Exit;
lStr := GetNextWord(ASourceLine, lReaderPos);
lStr := GetNextWord(ASourceLine, lReaderPos);
lPascalType := GetPascalTypeName(lStr);
ProcessMethodReturnValue(ASourceLine, lReaderPos);
ProcessMethodName(ASourceLine, lReaderPos);
ProcessMethodParameters(ASourceLine, lReaderPos, False);
if FDeclarationIsFunction then
FPasOutputTypes.Add(Format(' %s = %s (%s): %s of object;', [lPascalType, FDeclarationBase, FPascalParams, FMethodReturnPas]))
else
FPasOutputTypes.Add(Format(' %s = %s (%s) of object;', [lPascalType, FDeclarationBase, FPascalParams]));
end;
procedure TAndroidSDKBindingsGen.ProcessMethodReturnValue(ASourceLine: string;
var lReaderPos: Integer);
var
lMethodReturn: String;
begin
// Method type and name
lMethodReturn := GetNextWord(ASourceLine, lReaderPos);
FMethodReturnPas := GetPascalTypeName(lMethodReturn);
if lMethodReturn = 'void' then
begin
FDeclarationBase := 'procedure';
FDeclarationIsFunction := False;
end
else
begin
FDeclarationBase := 'function';
FDeclarationIsFunction := True;
end;
end;
procedure TAndroidSDKBindingsGen.ProcessMethodName(ASourceLine: string;
var lReaderPos: Integer);
begin
FMethodName := GetNextWord(ASourceLine, lReaderPos);
end;
// callbacksetter void setOnClickListener($View.OnClickListener l)
// $ indicates that this parameter should be skipped
procedure TAndroidSDKBindingsGen.ProcessMethodParameters(ASourceLine: string;
var lReaderPos: Integer; AAddParamRead: Boolean);
var
lParamNum: Integer = 1;
TmpStr: String;
lParamType, lPascalMethodModifiers: String;
lParamTypePas, lParamName, lParamPrefix: String;
lJavaParams, lJavaParamVar: String;
StringParamCount: Integer = 0;
begin
// Add all parameters
TmpStr := '';
lJavaParams := '';
FHasStringParam := False;
FCallbackTypePas := '';
repeat
lParamType := GetNextWord(ASourceLine, lReaderPos);
if lParamType = '' then Break;
// Method modifiers
if (lParamType = 'virtual') or (lParamType = 'override') then Continue;
if (lParamType = 'overload') then
begin
lPascalMethodModifiers := ' overload;';
Continue;
end;
// Parameter to skip because it is a callback name, just write $,
if lParamType[1] = '$' then
begin
TmpStr := TmpStr + '$, ';
FCallbackTypePas := GetPascalTypeName(lParamType);
FCallbackTypePas := StringReplace(FCallbackTypePas, '$', '', [rfReplaceAll]);
lParamType := GetNextWord(ASourceLine, lReaderPos);
Continue;
end;
lParamTypePas := GetPascalTypeName(lParamType);
lParamName := GetNextWord(ASourceLine, lReaderPos);
if PassByReference(lParamType) then lParamPrefix := 'var '
else lParamPrefix := '';
if lParamName = '' then Break;
TmpStr := TmpStr + lParamPrefix + lParamName + ': ' + lParamTypePas + '; ';
if AAddParamRead then
begin
// Pascal parameter sending
if lParamTypePas = 'string' then
begin
FHasStringParam := True;
Inc(StringParamCount);
FPasOutputImpl.Insert(FPasOutputImplCurLine+1, Format(' lString_%d := TString.Create(%s);', [StringParamCount, lParamName]));
FPasOutputImpl.Add(Format(' vAndroidPipesComm.SendInt(lString_%d.Index); // text', [StringParamCount]));
end
else if IsBasicJavaType(lParamType) then
FPasOutputImpl.Add(' vAndroidPipesComm.SendInt(Integer(' + lParamName + '));')
else // for objects
FPasOutputImpl.Add(' vAndroidPipesComm.SendInt(Integer(' + lParamName + '.Index));');
// Java parameter reading
lJavaParamVar := Format('l%s_%d', [ConvertPointToUnderline(lParamType), lParamNum]);
FJavaOutputMethods.Add(Format(' %s = MyAndroidPipesComm.%s();',
[GetJavaTypeLocalVar(lParamType), GetJavaTypeReader(lParamType)]));
FJavaOutputMethods.Add(Format(' %s = %s;',
[lJavaParamVar, GetJavaTypeConverter(lParamType)]));
lJavaParams := lJavaParams + lJavaParamVar + ', ';
Inc(lParamNum);
end;
until lParamName = '';
// Remove the last ; for the parameters, if necessary
if (Length(TmpStr) > 0) and (TmpStr[Length(TmpStr)-1] = ';') then
TmpStr := System.Copy(TmpStr, 0, Length(TmpStr)-2);
FPascalParams := TmpStr;
// And for Java params too
FJavaParams := System.Copy(lJavaParams, 0, Length(lJavaParams)-2);
end;
{ Reads one word in a string, starting at AStartPos (1-based index) { Reads one word in a string, starting at AStartPos (1-based index)
and going up to a space or comma or ( or ) or another separator } and going up to a space or comma or ( or ) or another separator }
function TAndroidSDKBindingsGen.GetNextWord(ALine: string; function TAndroidSDKBindingsGen.GetNextWord(ALine: string;
var AStartPos: Integer): string; var AStartPos: Integer): string;
const const
WordSeparators = [' ','(',')','[',']','{','}','%',',',';',':',#9{TAB}]; WordSeparators = [' ','(',')','[',']','{','}','%',',',';',':','=',#9{TAB}];
var var
lState: Integer = 0; lState: Integer = 0;
begin begin

View File

@ -30,6 +30,12 @@ field int widthPixels
field float xdpi field float xdpi
field float ydpi field float ydpi
#
# android.content.*
#
{DialogInterface}
type DialogInterface.OnClickListener = void onClick(DialogInterface dialog, int which)
# #
# android.app.* # android.app.*
# #
@ -73,6 +79,7 @@ method AlertDialog.Builder setMessage (CharSequence message)
#public AlertDialog.Builder setOnKeyListener (DialogInterface.OnKeyListener onKeyListener) #public AlertDialog.Builder setOnKeyListener (DialogInterface.OnKeyListener onKeyListener)
#public AlertDialog.Builder setPositiveButton (int textId, DialogInterface.OnClickListener listener) #public AlertDialog.Builder setPositiveButton (int textId, DialogInterface.OnClickListener listener)
#public AlertDialog.Builder setPositiveButton (CharSequence text, DialogInterface.OnClickListener listener) #public AlertDialog.Builder setPositiveButton (CharSequence text, DialogInterface.OnClickListener listener)
# callbacksetter AlertDialog.Builder setPositiveButton (CharSequence text, DialogInterface.OnClickListener $listener)
#public AlertDialog.Builder setSingleChoiceItems (CharSequence[] items, int checkedItem, DialogInterface.OnClickListener listener) #public AlertDialog.Builder setSingleChoiceItems (CharSequence[] items, int checkedItem, DialogInterface.OnClickListener listener)
#public AlertDialog.Builder setSingleChoiceItems (ListAdapter adapter, int checkedItem, DialogInterface.OnClickListener listener) #public AlertDialog.Builder setSingleChoiceItems (ListAdapter adapter, int checkedItem, DialogInterface.OnClickListener listener)
#public AlertDialog.Builder setSingleChoiceItems (int itemsId, int checkedItem, DialogInterface.OnClickListener listener) #public AlertDialog.Builder setSingleChoiceItems (int itemsId, int checkedItem, DialogInterface.OnClickListener listener)
@ -104,6 +111,7 @@ method void addView(View child, ViewGroup.LayoutParams params); overload;
method void addView(View child, int aindex); overload; method void addView(View child, int aindex); overload;
method void addView(View child); overload; method void addView(View child); overload;
method void addView(View child, int width, int height); overload; method void addView(View child, int width, int height); overload;
type View.OnClickListener = void onClick(View v)
[LinearLayout] ViewGroup [LinearLayout] ViewGroup
constructor Create(Activity); constructor Create(Activity);
@ -120,7 +128,7 @@ constructor Create(int param_width, int param_height, int param_x, int param_y);
[TextView] View [TextView] View
constructor Create(Activity); virtual; constructor Create(Activity); virtual;
method void setText(CharSequence AText); virtual; method void setText(CharSequence AText); virtual;
callbacksettercaller setOnClickListener callOnClickListener OnClickListener = procedure (v: TView) of object; callbacksetter void setOnClickListener($View.OnClickListener l)
method void setTextSize(int unit_; float size); method void setTextSize(int unit_; float size);
method CharSequence getText() method CharSequence getText()