Changeset 478
- Timestamp:
- 03/24/08 17:21:38 (7 months ago)
- Files:
-
- trunk/wrap/APILookupGLib.txt (modified) (3 diffs)
- trunk/wrap/APILookupGObject.txt (modified) (2 diffs)
- trunk/wrap/APILookupGdk.txt (modified) (5 diffs)
- trunk/wrap/APILookupGtk.txt (modified) (11 diffs)
- trunk/wrap/APILookupPango.txt (modified) (2 diffs)
- trunk/wrap/APILookupSourceView.txt (modified) (1 diff)
- trunk/wrap/utils/GtkWrapper.d (modified) (2 diffs)
- trunk/wrap/utils/convparms.d (modified) (5 diffs)
- trunk/wrap/utils/funct.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wrap/APILookupGLib.txt
r477 r478 877 877 } 878 878 879 public int run() 880 { 881 string line = readLine(file); 882 while( line !is null ) 879 version(Tango) 880 { 881 public int run() 883 882 { 884 ++lineCount; 885 //writefln("Spawn.ReadFile.run line (%s) ========== >>>%s<<<", lineCount, line); 886 //printf("Spawn.ReadFile.run line (%d) ========== >>>%.*s<<<", lineCount, line); 887 if ( read !is null ) 883 string line = readLine(file); 884 while( line !is null ) 888 885 { 889 read(line); 886 ++lineCount; 887 if ( read !is null ) 888 { 889 read(line); 890 } 891 line = readLine(file); 890 892 } 891 line = readLine(file);893 return 0; 892 894 } 893 return 0; 895 } 896 else 897 { 898 public override int run() 899 { 900 string line = readLine(file); 901 while( line !is null ) 902 { 903 ++lineCount; 904 //writefln("Spawn.ReadFile.run line (%s) ========== >>>%s<<<", lineCount, line); 905 //printf("Spawn.ReadFile.run line (%d) ========== >>>%.*s<<<", lineCount, line); 906 if ( read !is null ) 907 { 908 read(line); 909 } 910 line = readLine(file); 911 } 912 return 0; 913 } 894 914 } 895 915 } … … 1159 1179 prefix: g_ 1160 1180 import: glib.Str 1181 1182 nocode: g_mem_chunk_print 1183 1184 code: start 1185 /** 1186 * Warning 1187 * g_mem_chunk_print has been deprecated since version 2.10 and should not be used in newly-written code. Use the slice 1188 * allocator instead 1189 * Outputs debugging information for a GMemChunk. 1190 * It outputs the name of the GMemChunk (set with g_mem_chunk_new()), 1191 * the number of bytes used, and the number of blocks of memory allocated. 1192 */ 1193 version(Tango) 1194 { 1195 public void print() 1196 { 1197 // void g_mem_chunk_print (GMemChunk *mem_chunk); 1198 g_mem_chunk_print(gMemChunk); 1199 } 1200 } 1201 else 1202 { 1203 public override void print() 1204 { 1205 // void g_mem_chunk_print (GMemChunk *mem_chunk); 1206 g_mem_chunk_print(gMemChunk); 1207 } 1208 } 1209 code: end 1161 1210 outFile: MemoryChunk 1162 1211 … … 1300 1349 import: glib.Tuples 1301 1350 structWrap: GTuples* Tuples 1351 1352 nocode: g_relation_print 1353 1354 code: start 1355 /** 1356 * Outputs information about all records in a GRelation, as well as the indexes. 1357 * It is for debugging. 1358 */ 1359 version(Tango) 1360 { 1361 public void print() 1362 { 1363 // void g_relation_print (GRelation *relation); 1364 g_relation_print(gRelation); 1365 } 1366 } 1367 else 1368 { 1369 public override void print() 1370 { 1371 // void g_relation_print (GRelation *relation); 1372 g_relation_print(gRelation); 1373 } 1374 } 1375 code: end 1302 1376 outFile: Relation 1303 1377 trunk/wrap/APILookupGObject.txt
r474 r478 173 173 { 174 174 //writefln("ObjectG.this\n"); 175 setDataFull("GObject",cast(void*)this);175 objectGSetDataFull("GObject",cast(void*)this); 176 176 } 177 177 } … … 183 183 * data = a pointer 184 184 */ 185 public: void setDataFull(string key, gpointer data)185 public: void objectGSetDataFull(string key, gpointer data) 186 186 { 187 187 //writefln("setData objectG=%X data=%X type %s",gObject,data,key); trunk/wrap/APILookupGdk.txt
r474 r478 246 246 import: pango.PgLayout 247 247 structWrap: PangoLayout* PgLayout 248 249 override: getData 248 250 249 251 code: start … … 560 562 structWrap: GdkColormap* Colormap 561 563 564 override: toString 565 562 566 code: start 563 567 … … 599 603 this(); 600 604 //printf("Color.this uint %X\n",rgb); 601 set( ((rgb&0xFFFF)),((rgb&0xFFFF00000000)>>32),(rgb&0xFFFF0000)>>16);605 set( cast(ushort)((rgb&0xFFFF)),cast(ushort)((rgb&0xFFFF00000000)>>32),cast(ushort)((rgb&0xFFFF0000)>>16)); 602 606 } 603 607 … … 607 611 this(); 608 612 //printf("Color.this int %X\n",rgb); 609 set8( cast( byte)((rgb&0xFF0000)>>16),cast(byte)((rgb&0x00FF00)>>8),cast(byte)(rgb&0xFF));613 set8( cast(ubyte)((rgb&0xFF0000)>>16),cast(ubyte)((rgb&0x00FF00)>>8),cast(ubyte)(rgb&0xFF)); 610 614 } 611 615 … … 654 658 //printf("Color.set %X %X %X\n",red,green,blue); 655 659 656 gdkColor.red = red * 257;657 gdkColor.green = green * 257;658 gdkColor.blue = blue * 257;660 gdkColor.red = cast(ushort)(red * 257); 661 gdkColor.green = cast(ushort)(green * 257); 662 gdkColor.blue = cast(ushort)(blue * 257); 659 663 gdkColor.pixel = (red << 16) | (green << 8 ) | blue; 660 664 //printf("set8 pixel = %X\n", gdkColor.pixel); trunk/wrap/APILookupGtk.txt
r475 r478 783 783 import: gdk.Screen 784 784 structWrap: GdkScreen* Screen 785 786 override: getScreen 787 785 788 outFile: Invisible 786 789 … … 1061 1064 import: gtk.Window 1062 1065 1066 override: getScreen 1067 1063 1068 code: start 1064 1069 /** … … 1168 1173 import: gtk.Window 1169 1174 structWrap: GtkWindow* Window 1175 1176 override: getName 1177 override: setName 1178 1170 1179 outFile: AboutDialog 1171 1180 … … 2592 2601 import: glib.Str 2593 2602 structWrap: GtkTreePath* TreePath 2603 2604 override: toString 2594 2605 2595 2606 nocode: gtk_tree_path_new … … 3805 3816 import: gtk.AccelGroup 3806 3817 structWrap: GtkWidget* Widget 3818 3807 3819 # method conflict with parent method 3808 3820 nocode: gtk_menu_item_activate … … 3811 3823 # replace the method 3812 3824 # TODO create a method rename instead of replacing the entire code 3825 3826 override: select 3827 override: deselect 3828 3813 3829 code: start 3814 3830 … … 4173 4189 structWrap: GtkWidget* Widget 4174 4190 4191 override: setTooltipText 4192 override: setTooltipMarkup 4193 4175 4194 code: start 4176 4195 /** … … 4181 4200 * tipPrivate = a private text 4182 4201 */ 4183 void setTooltip(string tipText, string tipPrivate)4202 override void setTooltip(string tipText, string tipPrivate) 4184 4203 { 4185 4204 Tooltips tt = new Tooltips(); … … 5148 5167 * Removes all children and resizes the table to 1,1 5149 5168 */ 5150 void removeAll()5169 override void removeAll() 5151 5170 { 5152 5171 super.removeAll(); … … 5868 5887 prefix: gtk_ 5869 5888 import: glib.Str 5889 5890 override: setData 5891 override: getData 5870 5892 5871 5893 code: star … … 6011 6033 import: gtk.BuildableT 6012 6034 6035 override: unref 6036 override: destroy 6037 override: set 6038 6013 6039 code: start 6014 6040 // add the Buildable capabilities trunk/wrap/APILookupPango.txt
r474 r478 216 216 structWrap: PangoFontDescription* PgFontDescription 217 217 218 override: toString 219 218 220 code: start 219 221 … … 333 335 import: glib.Str 334 336 structWrap: PangoColor* PgColor 337 override: toString 335 338 outFile: PgColor 336 339 trunk/wrap/APILookupSourceView.txt
r474 r478 85 85 * a GtkSourceBuffer 86 86 */ 87 public SourceBuffer getBuffer()87 public override SourceBuffer getBuffer() 88 88 { 89 89 // GtkSourceBuffer* gtk_text_view_get_buffer (GtkTextView *text_view); trunk/wrap/utils/GtkWrapper.d
r474 r478 525 525 char[] keys = " file text struct realStruct ctorStruct class template interface extend implements prefix strictPrefix" 526 526 " openFile mergeFile closeFile outFile" 527 " copy import import(tango) structWrap alias moduleAlias "527 " copy import import(tango) structWrap alias moduleAlias override" 528 528 " noprefix nostruct nocode nosignal" 529 529 " code interfaceCode" … … 561 561 case "alias": loadAA(convParms.aliases, defReader, errors); break; 562 562 case "moduleAlias": loadAA(convParms.mAliases, defReader, errors); break; 563 case "override": convParms.overrides ~= defReader.getValue(); break; 563 564 case "text": 564 565 convParms.text ~= loadTextMultiLine("text"); trunk/wrap/utils/convparms.d
r386 r478 21 21 //debug = omitCode; 22 22 //debug = omitSignal; 23 //debug = overrides; 23 24 24 25 public struct ConvParms … … 51 52 public char[][char[]] aliases; 52 53 public char[][char[]] mAliases; 54 public char[][] overrides; /// list of functions that need override for gtkD to work with dmd 2 53 55 public char[] classCode; /// any valid D code to be copied to the final GtkD class 54 56 public char[] interfaceCode; /// any valid D code to be copied to the final GtkD interface … … 82 84 aliases = clear(); 83 85 mAliases = clear(); 86 overrides.length = 0; 84 87 classCode.length = 0; 85 88 interfaceCode.length = 0; … … 169 172 text ~= "\n * \t- "~key~" -> "~aliases[key]; 170 173 } 174 text ~= "\n * overrides:"; 175 foreach ( char[] over ; overrides ) 176 { 177 text ~= "\n * \t- "~over; 178 } 171 179 text ~= "\n */\n\n"; 172 180 return text; … … 209 217 } 210 218 219 public bool needsOverride(char[] functionName) 220 { 221 bool needed = false; 222 int i=0; 223 while ( !needed && i<overrides.length ) 224 { 225 needed = functionName == overrides[i]; 226 debug(overrides)writefln("\t (%s) %s ?= %s", needed, functionName, overrides[i]); 227 ++i; 228 } 229 debug(overrides)writefln("\t (%s) %s %s", i, (needed?"override >>>>>>>":"no override <<<<<"), functionName); 230 return needed; 231 } 232 211 233 public bool omitCode(char[] codeName) 212 234 { trunk/wrap/utils/funct.d
r474 r478 412 412 convName ~= convParms.outFile; 413 413 } 414 char[] overr; 415 if (convParms.needsOverride(convName)) 416 { 417 overr = "override "; 418 } 414 419 if ( convParms.strct.length>0 415 420 && parmsType.length > 0 … … 417 422 ) 418 423 { 419 dec = "public "~ typeWrap~" "~convName~"(";420 } 421 else 422 { 423 dec = "public static "~ typeWrap~" "~convName~"(";424 dec = "public "~overr~typeWrap~" "~convName~"("; 425 } 426 else 427 { 428 dec = "public static "~overr~typeWrap~" "~convName~"("; 424 429 } 425 430 ctor = false;
