Sha256: 8109df32ffe95de569d6e84c3aad92e5f8da105c0a8eaf3d9e1658c878f5a1c1

Contents?: true

Size: 1.64 KB

Versions: 1

Compression:

Stored size: 1.64 KB

Contents

# Wx::SF::Serializer - Wx class serializer extensions
# Copyright (c) M.J.N. Corino, The Netherlands

class Wx::Point

  include Wx::SF::Serializable

  properties :x, :y

end

class Wx::RealPoint

  include Wx::SF::Serializable

  properties :x, :y

end

class Wx::Size

  include Wx::SF::Serializable

  properties :width, :height

end

class Wx::Rect

  include Wx::SF::Serializable

  properties :x, :y, :width, :height

end

class Wx::Enum

  include Wx::SF::Serializable

  property :value => ->(enum) { enum.to_i }

  def self.create_for_deserialize(data)
    self.new(data[:value] || 0)
  end

end

class Wx::Colour

  include Wx::SF::Serializable

  property :colour => ->(col, *val) { col.set(*val.first) unless val.empty?; [col.red, col.green, col.blue, col.alpha] }

end

# need to add this Enum explicitly as it was initially defined before we extended the Wx::Enum class above
class Wx::BrushStyle

  property :value => ->(enum) { enum.to_i }

  include Wx::SF::Serializable

end

class Wx::Brush

  include Wx::SF::Serializable

  property :colour, :style

end

# need to add this Enum explicitly as it was initially defined before we extended the Wx::Enum class above
class Wx::PenStyle

  property :value => ->(enum) { enum.to_i }

  include Wx::SF::Serializable

end

class Wx::Pen

  include Wx::SF::Serializable

  property :colour, :width, :style

end

class Wx::Font

  include Wx::SF::Serializable

  property font_info: ->(font, *info) { font.set_native_font_info_user_desc(info.shift) unless info.empty?; font.get_native_font_info_user_desc }

end

class Wx::BitmapType

  property :value => ->(enum) { enum.to_i }

  include Wx::SF::Serializable

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wxruby3-shapes-0.9.0.pre.beta.3 lib/wx/shapes/serialize/wx.rb