PCE version 4C man_modulenamespaceid_tablemodified current_idOIxNclass/fragmentN referenceC hash_tablerefersizeOIxNbothIsNM.fragment.S.initialiseCman_method_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherit diagnosticsdefaultsbugsOIxNM.fragment.S.initialiseRICdateOIx3 N initialisenCstringOIx^Create a fragment on the specified text_buffer object. The fragment starts are <-start and is <-length (may be 0) characters long. <-style is a logical indicating the category of the fragment (e.g. title, example, glossary, refers_to, ...). The visual implication of a style-name is determined using `editor ->style' and/or `list_browser ->style'.nnnnnsNM.fragment.S.endOIxNM.fragment.S.endRIOIx,U*NendnnnCchainsizeOIxIENM.fragment.G.endXnnnsNM.fragment.S.insertOI xNM.fragment.S.insertRIOI x,U(NinsertnOI xEInsert text in the fragment. The fragment actually invokes `text_buffer ->insert' with the properly translated arguments. If the index is @default, the text is appended to the fragment. For example, the PceEmacs shell mode uses a fragment to insert the output of the sub-process. See xpce/prolog/lib/emacs/shell_mode.pl.nnnnnsNM.fragment.G.previousOI xNM.fragment.G.previousRIOI x,NpreviousnnnOIxIENM.fragment.G.nextXnnnsNM.fragment.G.endOIxNM.fragment.G.endRIOIx,U*NendnOIxgThe <-end is defined as <-start + <-length. Modifying the <-end modifies the <-length of the fragment.nnnnnsNV.fragment.nextCman_variable_card identifiermodule last_modifiednamesummary descriptionsee_alsoinheritdefaultsOIxNV.fragment.nextRIOIx,U)PNnextnOIxMThese variables together with `text_buffer <-first_fragment' and `text_buffer <-last_fragment' define the double linked list of fragments that is sorted on <-start. These methods are normally not used to analyse the available fragments. See `text_buffer <-find_all_fragments' and `text_buffer<-find_fragment' for locating fragments.nnnsN C.fragmentCman_class_card identifiermodule last_modifiednamesummary descriptionsee_alsoinherituser_interfacebugsOIxN C.fragmentRIOIx.lNfragmentnOIxA fragment object describes part of a text_buffer object. Fragments are maintained by the text_buffer they are associated with and move along with edit operations, so they keep pointing to the same text. Fragments have been implemented to allow for annotation of textual information. Besides defining a range of characters, fragments define their visual appearance when displayed by an editor. The location of fragments in a text can be visualised by a text_margin object associated with an editor object. This visualisation is done using icons (image objects). Fragments may be used to realise multiple fonts, styles and colours in editor objects. Another use for fragments is to make fragments of the text `active', e.g. allow the user to follow a link from the specified fragment (hyper-text). Finally, fragments may be used as text-markers. The following fragment turns the selection of an editor into bold font: demo :- send(new(V, view), open), send(V, style, bold, style(bold := @on)), send(V, key_binding, '\C-b', message(@prolog, make_bold, V?editor)). make_bold(E) :- get(E, selection_start, Start), get(E, selection_end, End), Len is End - Start, new(_, fragment(E, Start, Len, bold)).OIxI eN($class/editor$V.editor.selected_fragmenteN$class/editor$V.editor.margineN$class/style$C.styleeN.$class/editor$V.editor.selected_fragment_styleeN$class/editor$V.editor.styleseN*$class/editor$M.editor.S.selected_fragmenteN5$class/text_buffer$M.text_buffer.G.find_all_fragmentsEN$class/font$C.fonteN$class/editor$C.editoreN $class/text_buffer$C.text_buffereN $class/text_margin$C.text_marginXnnnsNM.fragment.G.nextOIxNM.fragment.G.nextRIOIx0eNnextnOIxReturn the next/previous fragment of the double linked fragment list for which code succeeds. If code is omitted, these methods return the next/previous fragment of the list. While executing the condition, @arg1 is bound the candidate fragment. Execution may *not* alter the fragment list of the associated <-text_buffer. If no fragment can be found in the indicated direction, these methods fail.nnnnnsNM.fragment.S.overlapOIxNM.fragment.S.overlapRIOIx,U*NoverlapnOIxSucceed if the fragment overlaps the specified index, overlaps with the specified fragment or with a range starting at `point <-x' to `point<-y'. Often used in combination with `text_buffer<-find' to find a fragment overlapping the caret.nnnnnsNM.fragment.S.startOIxNM.fragment.S.startRIOI x/U!NstartnOI!xStart index (0-based). If `move_end' equals @off, the end-point is not moved. Otherwise the end-point is moved by the same amount (<-length is not changed).nnnnnsNM.fragment.S.unlinkOI"xNM.fragment.S.unlinkRIOI#x,cNunlinknOI$xbUnlinks the fragment from the <-text_buffer and inform the possible related editors of the change.nnnnnsNM.fragment.S.includeOI%xNM.fragment.S.includeRIOI&x/UNincludenOI'xhDefine whether start and end are included. If text insertion takes place exactly on the corresponding end of the fragment, the fragment is expanded if include equals @on or left untouched if include equals @off. `What' defaults to `both' (include both start and end). `include' defaults to @on. Initially neither of the ends is included. See also ->insert.nnnnnsNV.fragment.styleOI(xNV.fragment.styleRIOI)x,U*rNstylenOI*xLogical name of the fragment. This logical name expresses the semantics of the text inside it (title, example, ...). Using `editor ->style' the user specifies how fragments of this style are visualised.OI+xIEN'$class/text_margin$V.text_margin.stylesXnnsNV.fragment.previousOI,xNV.fragment.previousRIOI-x,U(NpreviousnnnOI.xIENV.fragment.nextXnsNM.fragment.S.does_includeOI/xNM.fragment.S.does_includeRIOI0x/U0N does_includennnOI1xIENM.fragment.S.includeXnnnXaCnumber O I2xx