Annotation of Amaya/amaya/XLinkedit.c, revision 1.1
1.1 ! cvs 1: /*
! 2: *
! 3: * (c) COPYRIGHT MIT and INRIA, 2000
! 4: * Please first read the full copyright statement in file COPYRIGHT.
! 5: *
! 6: */
! 7:
! 8: /*
! 9: * This module contains editing functions for handling XLink hypertext links
! 10: *
! 11: * Author: V. Quint
! 12: *
! 13: */
! 14:
! 15: /* Included headerfiles */
! 16: #define THOT_EXPORT
! 17: #include "amaya.h"
! 18: #include "XLink.h"
! 19:
! 20: /*----------------------------------------------------------------------
! 21: SetXLinkTypeSimple attach an attribute xlink:type="simple" to element el
! 22: ----------------------------------------------------------------------*/
! 23: #ifdef __STDC__
! 24: void SetXLinkTypeSimple (Element el, Document doc, ThotBool withUndo)
! 25: #else /* __STDC__ */
! 26: void SetXLinkTypeSimple (el, doc, withUndo)
! 27: Element el;
! 28: Document doc;
! 29: ThotBool withUndo;
! 30:
! 31: #endif /* __STDC__ */
! 32: {
! 33: AttributeType attrType;
! 34: Attribute attr;
! 35: SSchema XLinkSchema;
! 36: ThotBool new;
! 37:
! 38: XLinkSchema = TtaGetSSchema (TEXT("XLink"), doc);
! 39: attrType.AttrSSchema = XLinkSchema;
! 40: attrType.AttrTypeNum = XLink_ATTR_type;
! 41: attr = TtaGetAttribute (el, attrType);
! 42: if (attr == NULL)
! 43: {
! 44: attr = TtaNewAttribute (attrType);
! 45: TtaAttachAttribute (el, attr, doc);
! 46: new = TRUE;
! 47: }
! 48: else
! 49: {
! 50: new = FALSE;
! 51: if (withUndo)
! 52: TtaRegisterAttributeReplace (attr, el, doc);
! 53: }
! 54: TtaSetAttributeValue (attr, XLink_ATTR_type_VAL_simple, el, doc);
! 55: if (new && withUndo)
! 56: TtaRegisterAttributeCreate (attr, el, doc);
! 57: }
! 58:
! 59: /*----------------------------------------------------------------------
! 60: XLinkPasted
! 61: An element has been pasted.
! 62: If it has some XLink attributes, update the link.
! 63: -----------------------------------------------------------------------*/
! 64: #ifdef __STDC__
! 65: void XLinkPasted (NotifyElement *event)
! 66: #else /* __STDC__*/
! 67: void XLinkPasted(event)
! 68: NotifyElement *event;
! 69: #endif /* __STDC__*/
! 70: {
! 71: /****
! 72: @@@@@@ Refer to function ElementPasted from HTMLedit.c *****
! 73: ****/
! 74: }
Webmaster