arfonzo's Haiku stuff: RuBe

I'm working on some Ruby bindings for the Haiku API. Check out news and progress here. I'll have something for your downloading pleasures, soon. Patience, my pretties.

5 May, 2012

  • BWindows are now supported, and have been tested briefly... yippee!
  • Here's a screenshot, creating a BApplication and BWindow, and displaying the BWindow via BWindow.Show().
  • 3 May, 2012

  • Here's an irb session playing with Haiku's BString (extra debug cruft left out):
  • irb(main):001:0> require 'ruBe'
    => true
    irb(main):002:0> stringA = RuBe::BString.new("This is a BString test.")
    => #<RuBe::BString:0x1828c408>
    irb(main):003:0> stringA.methods
    => [:String, :Length, :CountChars, :CountBytes, :IsEmpty, :Adopt, :SetTo, :SetToChars, :AdoptChars, :SetToFormat, :CopyInto, :CopyCharsInto, :Append, :AppendChars, :Prepend, :PrependChars, :Insert, :InsertChars, :Truncate, :TruncateChars, :Remove, :RemoveChars, :RemoveFirst, :RemoveLast, :RemoveAll, :RemoveSet, :RemoveCharsSet, :MoveInto, :MoveCharsInto, :<, :<=, :==, :>=, :>, :Compare, :CompareChars, :ICompare, :FindFirst, :FindFirstChars, :FindLast, :FindLastChars, :IFindFirst, :IFindLast, :ReplaceFirst, :ReplaceLast, :ReplaceAll, :Replace, :ReplaceAllChars, :ReplaceChars, :IReplaceFirst, :IReplaceLast, :IReplaceAll, :IReplace, :ReplaceSet, :ReplaceCharsSet, :ByteAt, :CharAt, :LockBuffer, :UnlockBuffer, :ToLower, :ToUpper, :Capitalize, :CapitalizeEachWord, :CharacterEscape, :CharacterDeescape, :Trim, :<<, :nil?, :===, :=~, :!~, :eql?, :class, :clone, :dup, :taint, :tainted?, :untaint, :untrust, :untrusted?, :trust, :freeze, :frozen?, :to_s, :inspect, :methods, :singleton_methods, :protected_methods, :private_methods, :public_methods, :instance_variables, :instance_variable_get, :instance_variable_set, :instance_variable_defined?, :instance_of?, :kind_of?, :is_a?, :tap, :send, :public_send, :respond_to?, :extend, :display, :method, :public_method, :define_singleton_method, :hash, :__id__, :object_id, :to_enum, :enum_for, :gem, :equal?, :!, :!=, :instance_eval, :instance_exec, :__send__]
    irb(main):004:0> stringA.String
    => "This is a BString test."
    irb(main):005:0> stringA.Append(".. or is it?")
    => #<RuBe::BString:0x1823b460>
    irb(main):006:0> stringA.String
    => "This is a BString test... or is it?"
    irb(main):007:0>

    2 May, 2012

  • Ruby test, BApplication and BAlert: screenshot.
  • Here's some sample ruby test code that currently works:
  • require 'ruBe'
    
    begin
    	app = RuBe::BApplication.new("application/x-vnd.RuBe-Test1")
    	puts "Calling BApplication.ObscureCursor()... Cursor will be hidden until moved."
    	app.ObscureCursor
    
    	puts "Starting RuBe BApplication..."
    	app.Run
    	puts "RuBe BApplication terminated."
    	
    	puts "Displaying BAlert..."
    	alert = RuBe::BAlert.new("RuBe Test 1", "Avast, matey!", "Ahoy.")
    	alert.Go
    end