@@ -170,6 +170,23 @@ def add_textbox(self, left, top, width, height):
170170 textbox = self ._shape_factory (sp )
171171 return textbox
172172
173+ def add_custom_geometry (self , left , top , width , height ):
174+ """
175+ Add a custom geometry shpane of specified size at specified position
176+ on slide.
177+ """
178+ sp = self ._add_cust_geom_sp (left , top , width , height )
179+ cust_geom = self ._shape_factory (sp )
180+ return cust_geom
181+
182+ def add_groupshape (self , left , top , width , height ):
183+ """
184+ Add groupshape of specified size at specified position on slide.
185+ """
186+ sp = self ._add_groupshape_sp (left , top , width , height )
187+ groupshape = self ._shape_factory (sp )
188+ return groupshape
189+
173190 def clone_layout_placeholders (self , slide_layout ):
174191 """
175192 Add placeholder shapes based on those in *slide_layout*. Z-order of
@@ -284,6 +301,24 @@ def _add_textbox_sp(self, x, y, cx, cy):
284301 sp = self ._grpSp .add_textbox (id_ , name , x , y , cx , cy )
285302 return sp
286303
304+ def _add_cust_geom_sp (self , x , y , cx , cy ):
305+ """
306+ Return a newly-added custom geometry ``<p:sp>`` element
307+ """
308+ id_ = self ._next_shape_id
309+ name = 'CustGeom %s' % id_
310+ sp = self ._grpSp .add_custom_geometry (id_ , name , x , y , cx , cy )
311+ return sp
312+
313+ def _add_groupshape_sp (self , x , y , cx , cy ):
314+ """
315+
316+ """
317+ id_ = self ._next_shape_id
318+ name = 'GroupShape %d' % (id_ - 1 )
319+ sp = self ._grpSp .add_groupshape (id_ , name , x , y , cx , cy )
320+ return sp
321+
287322 def _clone_layout_placeholder (self , layout_placeholder ):
288323 """
289324 Add a new placeholder shape based on the slide layout placeholder
0 commit comments