Class: UIC::Application::Presentation

Inherits:
Presentation show all
Extended by:
ElementBacked::ClassMethods
Includes:
ElementBacked
Defined in:
lib/ruic/presentation.rb

Overview

An Application::Presentation is a UIC::Presentation that is associated with a specific .uia application. In addition to normal Presentation methods it adds methods related to its presence in the application.

Instance Attribute Summary collapse

Attributes included from ElementBacked

#el, #owner

Attributes included from XMLFileBacked

#doc

Attributes included from FileBacked

#file, #file_content

Instance Method Summary collapse

Methods included from ElementBacked::ClassMethods

xmlattribute

Methods inherited from Presentation

#aliases, #anchor_points, #asset_by_id, #assets, #at, #attribute_linked?, #behaviors, #cameras, #child_assets, #components, #effects, #errors, #errors?, #find, #generate_custom_classes, #get_attribute, #groups, #has_slide?, #hierarchy, #image_paths, #image_usage, #images, #layers, #lights, #master?, #materials, #models, #on_doc_loaded, #owning_component, #parent_asset, #paths, #rebuild_caches_from_document, #referenced_files, #replace_asset, #scene, #set_attribute, #slide_index, #slides_for, #texts, #to_xml, #unlink_attribute

Methods included from XMLFileBacked

#file=, #save!, #save_as, #to_xml

Methods included from FileBacked

#absolute_path, #file_found?, #filename, #relative_path, #save!, #save_as

Constructor Details

#initialize(application, el) ⇒ Presentation

Returns a new instance of Presentation.

Parameters:

  • application (Application)

    the UIC::Application object owning this presentation.

  • el (Nokogiri::XML::Element)

    the XML element in the .uia representing this presentation.



672
673
674
675
676
# File 'lib/ruic/presentation.rb', line 672

def initialize(application,el)
	self.owner = application
	self.el    = el
	super( application.absolute_path(src) )
end

Instance Attribute Details

#activeBoolean

Returns Is the presentation initially active in the application?.

Returns:

  • (Boolean)

    Is the presentation initially active in the application?



666
667
668
# File 'lib/ruic/presentation.rb', line 666

xmlattribute :active, ->(val){ val=="True" || val=="" } do |new_val|
	new_val ? 'True' : 'False'
end

#idString

Returns the id of the presentation asset in the .uia.

Returns:

  • (String)

    the id of the presentation asset in the .uia



654
655
656
657
658
# File 'lib/ruic/presentation.rb', line 654

xmlattribute :id do |new_id|
	main_preso = app.main_presentation
	super(new_id)
	app.main_presentation=self if main_preso==self
end

#srcString

Returns the path to the presentation file.

Returns:

  • (String)

    the path to the presentation file



662
# File 'lib/ruic/presentation.rb', line 662

xmlattribute :src

Instance Method Details

#path_to(el, from = nil) ⇒ Object

Overrides Presentation#path_to to prefix all absolute paths with the #id



680
681
682
# File 'lib/ruic/presentation.rb', line 680

def path_to( el, from=nil )
	from ? super : "#{id}:#{super}"
end