# HG changeset patch # User Frank Benoit # Date 1200915527 -3600 # Node ID 021f78dcc1603134b61a5b9a60e0c55860c6e510 # Parent e32a6d7506c939f8709f60cbef9ab2dbd11119b4 added some resource files diff -r e32a6d7506c9 -r 021f78dcc160 dsss.conf --- a/dsss.conf Mon Jan 21 01:40:01 2008 +0100 +++ b/dsss.conf Mon Jan 21 12:38:47 2008 +0100 @@ -36,5 +36,8 @@ [dwtexamples/helloworld/HelloWorld4.d] [dwtexamples/helloworld/HelloWorld5.d] [dwtexamples/addressbook/AddressBook.d] + [dwtexamples/controlexample/ControlExample.d] +buildflags+=-Jdwtexamples/controlexample + diff -r e32a6d7506c9 -r 021f78dcc160 dwt/dwthelper/ByteArrayInputStream.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwt/dwthelper/ByteArrayInputStream.d Mon Jan 21 12:38:47 2008 +0100 @@ -0,0 +1,70 @@ +/* language convertion www.dsource.org/project/tioport */ +module dwt.dwthelper.ByteArrayInputStream; + +import dwt.dwthelper.InputStream; + +public class ByteArrayInputStream : dwt.dwthelper.InputStream.InputStream { + + alias dwt.dwthelper.InputStream.InputStream.read read; + alias dwt.dwthelper.InputStream.InputStream.skip skip; + alias dwt.dwthelper.InputStream.InputStream.available available; + alias dwt.dwthelper.InputStream.InputStream.close close; + alias dwt.dwthelper.InputStream.InputStream.mark mark; + alias dwt.dwthelper.InputStream.InputStream.reset reset; + alias dwt.dwthelper.InputStream.InputStream.markSupported markSupported; + + protected byte[] buf; + protected int pos; + protected int fld_mark = 0; + //protected int count; + public this ( byte[] aBuf ){ + this.buf = aBuf; + } + + public this ( byte[] aBuf, int offset, int length_ESCAPE ){ + this.buf = new JArrayByte( aBuf[ offset .. offset+length_ESCAPE ] ); + } + + public synchronized int read(){ + if( pos >= this.buf.length ){ + return -1; + } + int result = this.buf.index(pos); + pos++; + return result & 0xFF; + } + + public synchronized int read( byte[] b, int off, int len ){ + return super.read( b, off, len ); + } + + public synchronized long skip( long n ){ + pos += n; + return 0L; + } + + public synchronized int available(){ + if( pos >= this.buf.length ){ + return 0; + } + return this.buf.length - pos; + } + + public bool markSupported(){ + return false; + } + + public void mark( int readAheadLimit ){ + } + + public synchronized void reset(){ + pos = 0; + } + + public void close(){ + } + + +} + + diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/addressbook/addressbook.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtexamples/addressbook/addressbook.properties Mon Jan 21 12:38:47 2008 +0100 @@ -0,0 +1,69 @@ +############################################################################### +# Copyright (c) 2000, 2003 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +Last_name = Last Name +First_name = First Name +Business_phone = Business Phone +Home_phone = Home Phone +Email = Email +Fax = Fax +Close_save = The address book contents have changed.\nDo you want to save the changes? +New_title = Untitled +Column = Column: +Book_extension = .adr +Book_filter_name = Address Books +All_filter_name = All Files +File = File +Does_not_exist = does not exist. +File_not_found = File not found: +IO_error_read = IO error reading text file: +IO_error_write = IO error writing text file: +IO_error_close = IO error closing text file: +Title_bar = Address Book - +Save_as_title = Save As +Query_overwrite = already exists.\nDo you want to replace it? +File_menu_title = &File +New_contact = &New Contact...\tCtrl+N +Edit_contact = &Edit Contact...\tCtrl+E +New_address_book = New Address &Book\tCtrl+B +Open_address_book = &Open Address Book...\tCtrl+O +Save_address_book = &Save Address Book\tCtrl+S +Save_book_as = Save &Address Book As...\tCtrl+A +Exit = E&xit +Edit_menu_title = &Edit +Edit = &Edit...\tCtrl+E +Copy = &Copy\tCtrl+C +Paste = &Paste\tCtrl+V +Delete = De&lete\tDel +Sort = &Sort +Search_menu_title = &Search +Find = &Find...\tCtrl+F +Find_next = Find &Next...\tF3 +Pop_up_new = &New... +Pop_up_edit = &Edit... +Pop_up_copy = &Copy +Pop_up_paste = &Paste +Pop_up_delete = &Delete +Pop_up_find = &Find... +Help_menu_title = &Help +About = &About Address Book... +About_1 = About +About_2 = \nversion 1.0 +OK = OK +Cancel = Cancel +Search_dialog_title = Find +Dialog_find_what = Fi&nd what: +Dialog_match_case = Match &case +Dialog_match_word = Match &whole word +Dialog_direction = Direction +Dialog_dir_up = &Up +Dialog_dir_down = &Down +Dialog_find = &Find +Cannot_find = Cannot find \ No newline at end of file diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/ControlExample.d --- a/dwtexamples/controlexample/ControlExample.d Mon Jan 21 01:40:01 2008 +0100 +++ b/dwtexamples/controlexample/ControlExample.d Mon Jan 21 12:38:47 2008 +0100 @@ -37,7 +37,7 @@ import dwt.widgets.TabFolder; import dwt.widgets.TabItem; import dwt.dwthelper.ResourceBundle; - +import dwt.dwthelper.ByteArrayInputStream; import dwtexamples.controlexample.Tab; import dwtexamples.controlexample.ButtonTab; @@ -86,6 +86,14 @@ "target.gif", //$NON-NLS-1$ "backgroundImage.png", //$NON-NLS-1$ "parentBackgroundImage.png"]; //$NON-NLS-1$ + + static const ubyte[][] imageData = [ + cast(ubyte[]) import( "closedFolder.gif" ), + cast(ubyte[]) import( "openFolder.gif" ), + cast(ubyte[]) import( "target.gif" ), + cast(ubyte[]) import( "backgroundImage.png" ), + cast(ubyte[]) import( "parentBackgroundImage.png" ) + ]; static const int[] imageTypes = [ DWT.ICON, DWT.ICON, @@ -233,7 +241,7 @@ images = new Image[imageLocations.length]; for (int i = 0; i < imageLocations.length; ++i) { - InputStream sourceStream = clazz.getResourceAsStream(imageLocations[i]); + InputStream sourceStream = new ByteArrayInputStream( imageData[i] ); ImageData source = new ImageData(sourceStream); if (imageTypes[i] is DWT.ICON) { ImageData mask = source.getTransparencyMask(); diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/backgroundImage.png Binary file dwtexamples/controlexample/backgroundImage.png has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/bold.bmp Binary file dwtexamples/controlexample/bold.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/bold_mask.bmp Binary file dwtexamples/controlexample/bold_mask.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/closedFolder.gif Binary file dwtexamples/controlexample/closedFolder.gif has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/controlexample.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtexamples/controlexample/controlexample.properties Mon Jan 21 12:38:47 2008 +0100 @@ -0,0 +1,247 @@ +############################################################################### +# Copyright (c) 2000, 2005 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +error.CouldNotLoadResources = Unable to load resources +window.title = SWT Controls +custom.window.title = SWT Custom Controls + +Text_Buttons = Text Buttons +Size = Size +Alignment = Alignment +Left = Left +Right = Right +Up = Up +Down = Down +Center = Center +One = One +Two = Two +Three = Three +Image_Buttons = Image Buttons +Image_Text_Buttons = Image and Text Buttons +Control_Example = Control Example +Parameters = Parameters +Other = Other +Enabled = Enabled +Visible = Visible +BackgroundImage = Background Image +Preferred = Preferred +Styles = Styles +Menu_Styles = Menu Styles +MenuItem_Styles = MenuItem Styles +Background_Mode = Background Mode on Parent +Listeners = Listeners +Select_Listeners = Select Listeners +Listen = Listen +Clear = Clear +Set_Get = Set/Get API +Parameter_Info = {0} e.g. {1} +Info_int = 4 +Info_intA = 0,1,2 +Info_long = 4 +Info_longA = 0,1,2 +Info_char = c +Info_charA = a,b,c +Info_boolean = true +Info_booleanA = true,true,false +Info_String = hello +Info_StringA = hello,there +Info_Point = 0,0 +Info_TabItem = Tab 0 +Info_TabItemA = Tab 0,Tab 2 +Info_TableItem = Index:2 +Info_TableItemA = Index:2,Index:4 +Info_TreeItem = Node 1 +Info_TreeItemA = Node 1,Node 3 +Select_All = Select All +Deselect_All = Deselect All +OK = OK +FillDamage = Fill Damaged Area With Color +Title_Text = Title Text +Text_Labels = Text Labels +Image_Labels = Image Labels +Custom_Labels = Custom Labels +Custom_Combo = Custom Combo +One_Two_Three = One Two Three +Text_ToolBar = Text ToolBar +Image_ToolBar = Image ToolBar +ImageText_ToolBar = Image and Text ToolBar +Maximum = Maximum +Minimum = Minimum +Selection = Selection +Increment = Increment +Page_Increment = Page Increment +Thumb = Thumb +Digits = Digits +Tree_With_Images = Tree With Images +Dialog_Type = Dialog Type +Create_Dialog = Create Dialog +Button_Styles = Button Styles +Icon_Styles = Icon Styles +Modal_Styles = Modal Styles +File_Dialog_Styles = File Dialog Styles +Item_Styles = Item Styles +Dialog_Result = Dialog Result +ColorDialog = ColorDialog +DirectoryDialog = DirectoryDialog +FileDialog = FileDialog +FontDialog = FontDialog +PrintDialog = PrintDialog +MessageBox = MessageBox +Multi_line = A multi line text widget. +Example_string = The quick brown fox jumps over the lazy dog. +Header_Visible = Header Visible +Sort_Indicator = Sort Indicator +Header_Images = Header Images +Sub_Images = Sub Images +Lines_Visible = Lines Visible +Moveable_Columns = Moveable Columns +Multiple_Columns = Multiple Columns +Locked = Locked +Combo_child = Combo Child +Node_1 = Node 1 +Node_2 = Node 2 +Node_3 = Node 3 +Node_4 = Node 4 +Node_1_1 = Node 1.1 +Node_2_1 = Node 2.1 +Node_3_1 = Node 3.1 +Node_2_2 = Node 2.2 +Node_2_2_1 = Node 2.2.1 +Parent = Parent +No_Parent = No Parent +Decoration_Styles = Decoration Styles +Create_Shell = Create Shell +Close_All_Shells = Close All Shells +Push = Push +Radio = Radio +Check = Check +Cascade = Cascade +Drop_Down = Drop Down +Images_failed = Warning: Failed to load images +readme_txt = readme.txt +Index = Index: +Title = Title: +Close = Close +Result = Result: {0} +FilterName_0 = Text Files +FilterName_1 = Batch Files +FilterName_2 = Doc Files +FilterName_3 = All Files +TableTitle_0 = Name +TableTitle_1 = Type +TableTitle_2 = Size +TableTitle_3 = Modified +TableLine0_0 = +TableLine0_1 = classes +TableLine0_2 = 0 +TableLine0_3 = today +TableLine1_0 = +TableLine1_1 = databases +TableLine1_2 = 2556 +TableLine1_3 = tomorrow +TableLine2_0 = +TableLine2_1 = images +TableLine2_2 = 91571 +TableLine2_3 = yesterday +ListData0_0 = Line 1 +ListData0_1 = Line 2 +ListData0_2 = Line 3 +ListData0_3 = Line 4 +ListData0_4 = Line 5 +ListData0_5 = Line 6 +ListData0_6 = Line 7 +ListData0_7 = Line 8 +ListData0_8 = Longest Line In List +ListData1_0 = Apples +ListData1_1 = Oranges +ListData1_2 = Bananas +ListData1_3 = Grapefruit +ListData1_4 = Peaches +ListData1_5 = Kiwi +ListData1_6 = Apricots +ListData1_7 = Strawberries +ListData1_8 = The Longest String +DropDownData_0 = Apples +DropDownData_1 = Oranges +DropDownData_2 = +DropDownData_3 = Grapefruit +DropDownData_4 = Peaches +DropDownData_5 = Kiwi +DropDownData_6 = +DropDownData_7 = Strawberries +DropDownData_8 = The Longest String +Colors = Colors and Font +Change = &Change... +Defaults = &Defaults +Foreground_Color = Foreground Color +Background_Color = Background Color +Font = Font +Item_Foreground_Color = Item 0 Foreground Color +Item_Background_Color = Item 0 Background Color +Item_Font = Item 0 Font +Cell_Foreground_Color = Item 0 Col 1 Foreground Color +Cell_Background_Color = Item 0 Col 1 Background Color +Cell_Font = Item 0 Col 1 Font +Wrap_Text = Jack and Jill went up the hill to fetch a pail of water, \ + Jack fell down and broke his crown and Jill came tumbling after! +Foreground_Style = Foreground +Background_Style = Background +StyledText_Styles = Text Styles +StyledText_Style_Instructions = Select text, then style. +Bold = Bold +Italic = Italic +Underline = Underline +Strikeout = Strikeout +Fill_X = Horizontal Fill +Fill_Y = Vertical Fill +Pack_Columns = Pack Columns +TabItem1_0 = Tab 0 +TabItem1_1 = Tab 1 +TabItem1_2 = Tab 2 +TabItem_content = TabItem Content +CTabItem1_0 = CTabItem 0 +CTabItem1_1 = CTabItem 1 +CTabItem1_2 = CTabItem 2 has a long name +CItem_Colors = CTabItem Colors +CTabItem_content = CTabItem Content +Set_Simple_Tabs = Simple Tabs +Set_Single_Tabs = Single Tab +Set_Min_Visible = Minimize +Set_Max_Visible = Maximize +Set_Unselected_Close_Visible = Close on Unselected Tabs +Set_Unselected_Image_Visible = Image on Unselected Tabs +Selection_Foreground_Color = Selection Foreground Color +Selection_Background_Color = Selection Background Color +Set_Image = Set Image +TableTree_column = Column +MenuItem_Cut = Cu&t Ctrl+X +MenuItem_Copy = &Copy Ctrl+C +MenuItem_Paste = &Paste Ctrl+V +MenuItem_SelectAll = Select &All Ctrl+A +Orientation = Orientation +Default = Default (Inherit) +Images = Images +Accelerators = Accelerators +Mnemonics = Mnemonics +SubMenu = Sub-Menu +SubSubMenu = Sub-Sub-Menu +1Radio = Radio1 +2Radio = Radio2 +1RadioWithMnemonic = Radio&1 +2RadioWithMnemonic = Radio&2 +PushWithMnemonic = &Push +RadioWithMnemonic = &Radio +CheckWithMnemonic = &Check +CascadeWithMnemonic = C&ascade +PopupMenuHere = Popup Menu Here +LinkText=Visit the Eclipse.org project and the SWT homepage. +Tooltip = Tooltip: {0} +Item1_Text = "What is your favorite button?" +Item2_Text = "What is your favorite icon?" \ No newline at end of file diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/italic.bmp Binary file dwtexamples/controlexample/italic.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/italic_mask.bmp Binary file dwtexamples/controlexample/italic_mask.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/openFolder.gif Binary file dwtexamples/controlexample/openFolder.gif has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/parentBackgroundImage.png Binary file dwtexamples/controlexample/parentBackgroundImage.png has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/red.bmp Binary file dwtexamples/controlexample/red.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/red_mask.bmp Binary file dwtexamples/controlexample/red_mask.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/strikeout.bmp Binary file dwtexamples/controlexample/strikeout.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/strikeout_mask.bmp Binary file dwtexamples/controlexample/strikeout_mask.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/target.gif Binary file dwtexamples/controlexample/target.gif has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/underline.bmp Binary file dwtexamples/controlexample/underline.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/underline_mask.bmp Binary file dwtexamples/controlexample/underline_mask.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/yellow.bmp Binary file dwtexamples/controlexample/yellow.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/controlexample/yellow_mask.bmp Binary file dwtexamples/controlexample/yellow_mask.bmp has changed diff -r e32a6d7506c9 -r 021f78dcc160 dwtexamples/helloworld/helloworld.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtexamples/helloworld/helloworld.properties Mon Jan 21 12:38:47 2008 +0100 @@ -0,0 +1,11 @@ +############################################################################### +# Copyright (c) 2000, 2003 IBM Corporation and others. +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# IBM Corporation - initial API and implementation +############################################################################### +Hello_world = Hello World \ No newline at end of file