Ejemplo n.º 1
0
    def __init__(self, title= None, doc = document, style=None):
        #Add a slide to the global counter
        if 'slide' in doc._global_counter:
            doc._global_counter['slide'] += 1
        else:
            doc._global_counter['slide'] = 0
        #Init group counter
        document._global_counter['group'] = 0

        out = {'title':title, 'contents': {},
               'num':doc._global_counter['slide']+1,
               'groups': [],
               'style': style,
               'htmlout': '', #store rendered htmlelements inside the slide
               'animout': [], #store svg rendered part of animatesvg
               'scriptout': '', #store javascript defined in element['script']
               'cpt_anim': 0,
               'element_keys': [] #list to store elements id in order
               }

        self.id = gcs()
        document._contents[self.id] = out

        if title!= None:
            bptitle( title )
Ejemplo n.º 2
0
    def __init__(self, title=None, doc=document, style=None):
        #Add a slide to the global counter
        if 'slide' in doc._global_counter:
            doc._global_counter['slide'] += 1
        else:
            doc._global_counter['slide'] = 0
        #Init group counter
        document._global_counter['group'] = 0

        out = {
            'title': title,
            'contents': {},
            'num': doc._global_counter['slide'] + 1,
            'groups': [],
            'style': style,
            'htmlout': '',  #store rendered htmlelements inside the slide
            'animout': [],  #store svg rendered part of animatesvg
            'scriptout': '',  #store javascript defined in element['script']
            'cpt_anim': 0,
            'element_keys': []  #list to store elements id in order
        }

        self.id = gcs()
        document._contents[self.id] = out

        if title != None:
            bptitle(title)
Ejemplo n.º 3
0
    def __init__(self, title= None, **kwargs):

        #Add a slide to the global counter
        if 'slide' in document._global_counter:
            document._global_counter['slide'] += 1
        else:
            document._global_counter['slide'] = 0
        #Init group counter
        document._global_counter['group'] = 0

        #check args from THEME
        self.args = check_function_args(slide, kwargs)

        out = {'title':title,
               'contents': {},
               'num':document._global_counter['slide']+1,
               'groups': [],
               "args": self.args,
               'htmlout': '', #store rendered htmlelements inside the slide
               'animout': [], #store svg rendered part of animatesvg
               'scriptout': '', #store javascript defined in element['script']
               'cpt_anim': 0,
               'element_keys': [] #list to store elements id in order
               }

        #The id for this slide
        self.id = gcs()


        #Change from dict to class
        self.tmpout = out
        self.contents = out['contents']
        self.element_keys = out['element_keys']
        self.cpt_anim = 0
        self.num = out['num']
        self.title = title

        #Store all outputs
        self.svgout = []
        self.htmlout = []
        self.scriptout = []
        self.animout = []
        self.svgheader = ''
        self.svgfooter = '\n</svg>\n'

        self.cpt_anim = 0
        self.groups = []

        #Add the slide to the document contents list
        document._contents[self.id] = out
        document._slides[self.id] = self

        if title!= None:
            from beampy.modules.title import title as bptitle
            bptitle( title )
            self.ytop = float(convert_unit(self.title.reserved_y))
        else:
            self.ytop = 0
Ejemplo n.º 4
0
    def __init__(self, title=None, **kwargs):

        # Add a slide to the global counter
        if 'slide' in document._global_counter:
            document._global_counter['slide'] += 1
        else:
            document._global_counter['slide'] = 0
        # Init group counter
        document._global_counter['group'] = 0

        # check args from THEME
        self.args = check_function_args(slide, kwargs)

        # The id for this slide
        self.id = gcs()
        self.slide_num = document._global_counter['slide']

        # Change from dict to class
        self.tmpout = ''
        self.contents = {}
        self.element_keys = []
        self.cpt_anim = 0
        self.num = document._global_counter['slide']+1
        self.title = title
        self.curwidth = document._width
        self.num_layers = 0 # Store the number of layers in this slide

        # Store all outputs
        self.svgout = []
        self.svgdefout = []  # Store module definition for slide
        self.htmlout = {}  # Html is a dict, each key dict is a layer htmlout[0] = [html, html, html] etc...
        self.scriptout = []
        self.animout = []
        self.svgheader = ''
        self.svgfooter = '\n</svg>\n'
        self.svglayers = {}  # Store slide final svg (without svg defs stored in self.svgdefout) for the given layer

        # Do we need to render the THEME layout on this slide
        self.render_layout = True

        # Add the slide to the document contents list
        document._slides[self.id] = self

        # Manage groups inside one slide the lower level of group is 0 and correspond
        # to the main slide
        self.groupsid = {}
        self.cur_group_level = -1
        g0 = group(x=0, y=0, width=document._width, height=document._height)
        self.groupsid[0] = [g0.id]  # store groups id objects in this list

        if title is not None:
            from beampy.modules.title import title as bptitle
            self.title_element = bptitle(title)
            self.ytop = float(convert_unit(self.title.reserved_y))
        else:
            self.ytop = 0
            self.title_element = None

        # Add ytop to the slide main group
        g0.yoffset = self.ytop
Ejemplo n.º 5
0
def slide(title= None, doc = document, style=None):
    """
        Function to add a slide to the presentation
    """

    #Add a slide to the global counter
    if 'slide' in doc._global_counter:
        doc._global_counter['slide'] += 1
    else:
        doc._global_counter['slide'] = 0

    out = {'title':title, 'contents':[],
           'num':doc._global_counter['slide']+1,
           'groups': [],
           'style': style}

    document._contents[gcs()] = out
    
    if title!= None:
        bptitle( title )
Ejemplo n.º 6
0
    def __init__(self, title=None, **kwargs):

        #Add a slide to the global counter
        if 'slide' in document._global_counter:
            document._global_counter['slide'] += 1
        else:
            document._global_counter['slide'] = 0
        #Init group counter
        document._global_counter['group'] = 0

        #check args from THEME
        self.args = check_function_args(slide, kwargs)

        out = {
            'title': title,
            'contents': {},
            'num': document._global_counter['slide'] + 1,
            'groups': [],
            "args": self.args,
            'htmlout': '',  #store rendered htmlelements inside the slide
            'animout': [],  #store svg rendered part of animatesvg
            'scriptout': '',  #store javascript defined in element['script']
            'cpt_anim': 0,
            'element_keys': []  #list to store elements id in order
        }

        #The id for this slide
        self.id = gcs()
        self.slide_num = document._global_counter['slide']

        #Change from dict to class
        self.tmpout = out
        self.contents = out['contents']
        self.element_keys = out['element_keys']
        self.cpt_anim = 0
        self.num = out['num']
        self.title = title

        #Store all outputs
        self.svgout = []
        self.htmlout = []
        self.scriptout = []
        self.animout = []
        self.svgheader = ''
        self.svgfooter = '\n</svg>\n'

        #Do we need to render the THEME layout on this slide
        self.render_layout = True

        #If we want to add background slide decodaration like header-bar or footer informations
        self.cpt_anim = 0
        self.groups = []

        #Add the slide to the document contents list
        document._contents[self.id] = out
        document._slides[self.id] = self

        if title != None:
            from beampy.modules.title import title as bptitle
            bptitle(title)
            self.ytop = float(convert_unit(self.title.reserved_y))
        else:
            self.ytop = 0