#A4# #Color# ## #A color either defined by a color string or by a tuple with three elements (r, g, b) with type float 0.0 ... 1.0 or range int 0 ... 65535# #alpha# ## ## #double: alpha color component [0 .. 1.0]# #blue# ## ## #double: blue color component [0 .. 1.0]# #green# ## ## #double: green color component [0 .. 1.0]# #red# ## ## #double: red color component [0 .. 1.0]# #ConnectionPoint# ## #One of the major features of Dia are connectable objects. They work by this type accessible through dia.Object.connections[].# #connected# ## ## #List of Object: read-only list of connected objects# #directions# ## ## #Preferred directions away from the object (e.g. DIR_NORTH=0x1)# #flags# ## ## #Flags, e.g. CP_FLAGS_MAIN (=0x3)# #object# ## ## #Object: the object owning this connection point# #pos# ## ## #Point: read-only position of the connection point# #Diagram# ## #Subclass of dia.DiagramData (at least in the C implementation) adding interfacing the GUI elements.# #data# ## ## #Backward-compatible base-class access# #displays# ## ## #The list of current displays of this diagram.# #filename# ## ## #Filename in utf-8 encoding.# #modified# ## ## #Modification state.# #selected# ## ## #The current object selection.# #unsaved# ## ## #True if the diagram was not saved yet.# #add_update# ## ## #add_update(real: top, real: left, real: bottom, real: right) -> None. Add the given rectangle to the update queue.# #add_update_all# ## ## #add_update_all() -> None. Add the diagram visible area to the update queue.# #connect_after# ## ## #connect_after(string: signal_name, Callback: func) -> None. Listen to diagram events in ['removed', 'selection_changed'].# #display# ## ## #display() -> Display. Create a new display of the diagram.# #find_clicked_object# ## ## #find_clicked_object(real[2]: point, real: distance) -> Object. Find an object in the given distance of the given point.# #find_closest_connectionpoint# ## ## #find_closest_connectionpoint(real: x, real: y[, Object: o]) -> (real: dist, ConnectionPoint: cp). Given a point and an optional object to exclude, return the distance and closest connection point or None.# #find_closest_handle# ## ## #find_closest_handle(real[2]: point) -> (real: distance, Handle: h, Object: o). Find the closest handle from point and return a tuple of the search results. Handle and Object might be None.# #flush# ## ## #flush() -> None. If no display update is queued, queue update.# #get_sorted_selected# ## ## #get_sorted_selected() -> list. Return the current selection sorted by Z-Order.# #get_sorted_selected_remove# ## ## #get_sorted_selected_remove() -> list. Return sorted selection and remove it from the diagram.# #group_selected# ## ## #group_selected() -> None. Turn the current selection into a group object.# #is_selected# ## ## #is_selected(Object: o) -> bool. True if the given object is already selected.# #remove_all_selected# ## ## #remove_all_selected() -> None. Delete all selected objects.# #save# ## ## #save(string: filename) -> None. Save the diagram under the given filename.# #select# ## ## #select(Object: o) -> None. Add the given object to the selection.# #ungroup_selected# ## ## #ungroup_selected() -> None. Split all groups in the current selection into single objects.# #unselect# ## ## #unselect(Object: o) -> None. Remove the given object from the selection)# #update_connections# ## ## #update_connections(Object: o) -> None. Update all connections of the given object. Might move connected objects.# #update_extents# ## ## #update_extents() -> None. Force recaculation of the diagram extents.# #DiagramData# ## #The 'low level' diagram object. It contains everything to manipulate diagrams from im- and export filters as well as from the UI. It does not provide any access to GUI elements related to the diagram.Use the subclass dia.Diagram object for such matters.# #active_layer# ## ## #Layer currently active in the diagram.# #bg_color# ## ## #Color of the diagram's background.# #extents# ## ## #Rectangle covering all object's bounding boxes.# #grid_visible# ## ## #bool: visibility of the grid.# #grid_width# ## ## #Tuple(real: x, real: y) : describing the grid size.# #hguides# ## ## #List of real: horizontal guides.# #layers# ## ## #Read-only list of the diagrams layers.# #paper# ## ## #Paperinfo of the diagram.# #selected# ## ## #List of Object: current selection.# #vguides# ## ## #List of real: vertical guides.# #add_layer# ## ## #add_layer(Layer: layer[, int: position]) -> Layer. Add a layer to the diagram at the top or the given position counting from bottom.# #connect_after# ## ## #connect_after(string: signal_name, Callback: func) -> None. Listen to diagram events in ['object_add', 'object_remove'].# #delete_layer# ## ## #delete_layer(Layer: layer) -> None. Remove the given layer from the diagram.# #get_sorted_selected# ## ## #get_sorted_selected() -> list. Return the current selection sorted by Z-Order.# #lower_layer# ## ## #lower_layer() -> None. Move the layer towards the bottom.# #raise_layer# ## ## #raise_layer() -> None. Move the layer towards the top.# #set_active_layer# ## ## #set_active_layer(Layer: layer) -> None. Make the given layer the active one.# #update_extents# ## ## #update_extents() -> None. Recalculation of the diagram extents.# #Display# ## #A Diagram can have multiple displays but every Display has just one Diagram.# #diagram# ## ## #Diagram displayed.# #origin# ## ## #Point in diagram coordinates of the top-left corner of the visible area.# #visible# ## ## #Tuple(real: top, real: left, real: bottom, real: right) : visible area# #zoom_factor# ## ## #Real: zoom-factor# #add_update_all# ## ## #add_update_all() -> None. Add the diagram visible area to the update queue.# #close# ## ## #close() -> None. Close the display possibly asking to save.# #flush# ## ## #flush() -> None. If no display update is queued, queue update.# #resize_canvas# ## ## #resize_canvas(int: width, int: height) -> None. BEWARE: Changing the drawing area but not the window size.# #scroll# ## ## #scroll(real: dx, real: dy) -> None. Scroll the visible area by the given delta.# #scroll_down# ## ## #scroll_down() -> None. Scroll downwards by a fixed amount.# #scroll_left# ## ## #scroll_left() -> None. Scroll to the left by a fixed amount.# #scroll_right# ## ## #scroll_right() -> None. Scroll to the right by a fixed amount.# #scroll_up# ## ## #scroll_up() -> None. Scroll upwards by a fixed amount.# #set_origion# ## ## #set_origion(real: x, real, y) -> None. Move the given diagram point to the top-left corner of the visible area.# #set_title# ## ## #set_title(string: title) -> None. Temporary change of the diagram title.# #zoom# ## ## #zoom(real[2]: point, real: factor) -> None. Zoom around the given point.# #Error# ## #The error object is just a helper to redirect errors to messages# #write# ## ## ## #ExportFilter# ## #returned by dia.register_export() but not used otherwise yet.# #name# ## ## #The description for the filter.# #unique_name# ## ## #A unique name within filters to allow disambiguation.# #Handle# ## #A handle is used to connect objects or for object resizing.# #connect_type# ## ## #NONCONNECTABLE=0.# #connected_to# ## ## #The connected ConnectionPoint object or None.# #id# ## ## #Can be used to derive preferred directions from it.# #pos# ## ## #The position of the connection point.# #type# ## ## #NON_MOVABLE=0, MAJOR_CONTROL=1, MINOR_CONTROL=2# #connect# ## ## #connect(ConnectionPoint: cp) -> None. Connect object A's handle with object B's connection point. To disconnect a handle pass in None.# #Layer# ## #A Layer is part of a Diagram and can contain objects.# #extents# ## ## #Rectangle covering all object's bounding boxes.# #name# ## ## #The name of the layer.# #objects# ## ## #The list of objects in the layer.# #visible# ## ## #The visibility of the layer.# #add_object# ## ## #add_object(Object: o[, int: position]) -> None. Add the object to the layer at the top or the given position counting from bottom.# #destroy# ## ## #Release the layer. Must not be called when already added to a diagram.# #find_closest_connection_point# ## ## #find_closest_connectionpoint(real: x, real: y[, Object: o]) -> (real: dist, ConnectionPoint: cp). Given a point and an optional object to exclude return the distance and the closest connection point or None.# #find_closest_object# ## ## #find_closest_object(real: x, real: y, real: maxdist) -> Object. Find an object in the given maximum distance of the given point.# #find_objects_in_rectangle# ## ## #find_objects_in_rectangle(real: top, real left, real: bottom, real: right) -> Objects Returns a list of objects found in the given rectangle.# #object_get_index# ## ## #object_get_index(Object: o) -> int. Returns the index of the object in the layers list of objects.# #remove_object# ## ## #remove_object(Object: o) -> None Remove the object from the layer and delete it.# #render# ## ## #render(dia.Renderer: r) -> None. Render the layer with the given renderer# #update_extents# ## ## #update_extents() -> None. Force recaculation of the layer extents.# #Object# ## #The main building block of diagrams.# #bounding_box# ## ## #Box covering all the object.# #connections# ## ## #Vector of connection points.# #handles# ## ## #Vector of handles.# #parent# ## ## #The parent object when parenting is in place, None otherwise.# #properties# ## ## #Dictionary of object properties.# #copy# ## ## #copy() -> Object. Create a new object copy.# #destroy# ## ## #destroy() -> None. Release the object. Must not be called when already added to a group or layer.# #distance_from# ## ## #distance_from(real: x, real: y) -> real. Calculate the object's distance from the given point.# #draw# ## ## #draw(dia.Renderer: r) -> None. Draw the object with the given renderer# #get_object_menu# ## ## #get_object_menu() -> Tuple. Returns a named list of Menuitem(s).# #move# ## ## #move(real: x, real: y) -> None. Move the entire object. The given point is the new object.obj_pos.# #move_handle# ## ## #move_handle(Handle: h, (real: x, real: y)[int: reason, int: modifiers]) -> None. Move the given handle of the object to the given position# #ObjectType# ## #The dia.Object factory. Allows to create objects of the specific type. Use: factory = get_object_type(<type name>) to get a grip on it.# #name# ## ## #string: the unique type indentifier of the object type.# #version# ## ## #int: version number# #create# ## ## #create(real: x, real: y) -> (Object: o, Handle: h1, Handle: h2) Create a new object of this type. Returns a tuple containing the new object and up to two handles.# #Rectangle# ## #The dia.Rectangle does not only provide access trough it's members but also via a sequence interface.# #bottom# ## ## #int or double: lower edge y coordinate# #left# ## ## #int or double: left edge x coordinate# #right# ## ## #int or double: right edge x coordinate# #top# ## ## #int or double: upper edge y coordinate# ## ## ## ## #1..n# ## ## ## ## ## ## #0..n# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #Arrow# ## #Dia's line objects usually ends with an dia.Arrow# #length# ## ## #double: length along the line# #type# ## ## #int: the shape of the arrow# #width# ## ## #double: corresponding to line width# #BezPoint# ## #A dia.Point, a bezier type and two control points (dia.Point) make a bezier point.# #p1# ## ## #Point: first control point for CURVETO# #p2# ## ## #Point: second control point for CURVETO# #p3# ## ## #Point: target point for CURVETO# #type# ## ## #int: MOVETO, LINETO using p1 only; CURVETO all 3 points# #Font# ## #Provides access to some objects font property.# #family# ## ## #string: family name of the font# #name# ## ## #string: legacy name of the font# #style# ## ## #int: style flags# #Image# ## #dia.Image gets passed into DiaRenderer.draw_image# #filename# ## ## #string: utf-8 encoded filename of the image# #height# ## ## #int: pixel height of the image# #mask_data# ## ## #string: array of alpha pixel values# #rgb_data# ## ## #string: array of packed rgb pixel values# #uri# ## ## #string: Uniform Resource Identifier of the image# #width# ## ## #int: pixel width of the image# #Point# #sequence# #The dia.Point does not only provide access trough it's members but also via a sequence interface.# #x# ## ## #double: coordinate horizontal part# #y# ## ## #double: coordinate vertical part# #Properties# ## #A dictionary interface to dia.Object's standard properties. Many propertiescan be get and set through this. If there is a specific method to change anobjects property like o.move() or o.move_handle() use that instead.# #get# ## ## ## #has_key# ## ## ## #keys# ## ## ## #Property# ## #Interface to so called StdProps, the mechanism to control most of Dia's canvas objects properties. # #name# ## ## #string: the name of the property# #type# ## ## #string: the type name of the object# #value# ## ## #various: the value is of type char, bool, dict, int, real, string, Text, Point, BezPoint, Rect, Arrow, Color or a tuple or list, possibly containing tuple of varying types.# #visible# ## ## #bool: visibility of the property# #Text# ## #Many objects (dia.Object) having text to display provide this property.# #color# ## ## #Color: color of the text# #font# ## ## #Font: read-only reference to font used# #height# ## ## #real: height of the font# #position# ## ## #Point: alignment position of the text# #text# ## ## #string: text data# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #one of# ## ## ## ## #dictionary lookup# ## ## ## ## ## ## ## ## #delivers the active display or None# ## ## ## ## ## ## ## ## #0..n# #object factory key lookup# ## ## ## ## #the list of diagrams# ## ## ## ## ## ## ## ## ## ## ## #0..n# ## ## ## ## #1..n# ## ## ## ## ## ## ## ## ## ## ## ## #dia# ## #The dia module allows to write Python plug-ins for Dia [https://wiki.gnome.org/Apps/Dia/Python] This modules is designed to run Python scripts embedded in Dia. To make your script accessible to Dia you have to put it into $HOME/.dia/python and let it call one of the register_*() functions. It is possible to write import filters [register_import()] and export filters [register_export()], as well as scripts to manipulate existing diagrams or create new ones [register_action()]. For stand-alone Python bindings to Dia see http://mail.gnome.org/archives/dia-list/2007-March/msg00092.html# #active_display# ## ## #active_display() -> Display. Delivers the currently active display 'dia.Display' or None# #diagrams# ## ## #diagrams() -> List of Diagram. Returns the list of currently open diagrams# #get_object_type# ## ## #get_object_type(string: type) -> ObjectType. From a type name like "Standard - Line" return the factory to create objects of that type, see: DiaObjectType# #group_create# ## ## #group_create(List of Object: objs) -> Object. Create a group containing the given list of dia.Object(s)# #load# ## ## #load(string: name) -> Diagram. Loads a diagram from the given filename# #message# ## ## #message(int: type, string: msg) -> None. Popup a dialog with given message# #new# ## ## #new(string: name) -> Diagram. Create an empty diagram# #register_action# ## ## #register_action(string: action, string: description, string: menupath, Callback: func) -> None. Register a callback function which appears in the menu. Depending on the menu path used during registrationthe callback gets called with the current DiaDiagramData object# #register_callback# ## ## #register_callback(string: description, string: menupath, Callback: func) -> None. Register a callback function which appears in the menu. Depending on the menu path used during registrationthe callback gets called with the current DiaDiagramData object# #register_export# ## ## #register_export(string: name, string: extension, Renderer: r) -> None. Allows to register an export filter written in Python. It needs to conform to the DiaRenderer interface.# #register_import# ## ## #register_import(string: name, string: extension, Callback: func) -> None. Allows to register an import filter written in Python, that is mainly a callback function which fills thegiven DiaDiagramData from the given filename# #register_plugin# ## ## #register_plugin(string: filename) -> None. Registers a single plug-in given its filename, that is load a dynamic module.# #registered_sheets# ## ## #registered_sheets() -> List of registered sheets. A list of all registered sheets.# #registered_types# ## ## #registered_types() -> Dict of ObjectType indexed by their name. A dictionary of all registered object factories, aka. DiaObjectType# #update_all# ## ## #update_all() -> None. Force an asynchronous update of all existing diagram displays# #Paperinfo# ## #dia.Paperinfo is part of dia.DiagramData describing the paper# #height# ## ## #real: height of the drawable area (sans margins)# #is_portrait# ## ## #int: paper orientation# #name# ## ## #string: paper name, e.g. A4 or Letter# #scaling# ## ## #real: factor to zoom the diagram on the paper# #width# ## ## #real: width of the drawable area (sans margins)# ## ## ## ## ## #Matrix# ## #Dia's matrix to do affine transformation# #x0# ## ## #double# #xx# ## ## #double# #xy# ## ## #double# #y0# ## ## #double# #yx# ## ## #double# #yy# ## ## #double# ## ## ## ## ## #Menuitem# ## #dia.Menuitem is holding menu functions for dia.Object# #active# ## ## #boolean: if it is callable# #text# ## ## #string: what would be written in the menu# #call# ## ## #call() -> None. Invoke the menuitem callback on object.# #Sheet# #read-only# #returned by dia.register_export() but not used otherwise yet.# #description# ## ## #The description for the sheet.# #filename# ## ## #The filename for the sheet.# #name# ## ## #The name for the sheet.# #objects# ## ## #The list of sheet objects referenced by the sheet.# #user# ## ## #The sheet scope is user provided, not system.# #returns# ## ## ## ## #list of sheets# ## ## ## ## #list of object types# ## ## ## ##