UNIXworkcode

1 /******************************************************************************* 2 * * 3 * rangeset.h -- Nirvana Editor rangest header * 4 * * 5 * Copyright (C) 1999 Mark Edel * 6 * * 7 * This is free software; you can redistribute it and/or modify it under the * 8 * terms of the GNU General Public License as published by the Free Software * 9 * Foundation; either version 2 of the License, or (at your option) any later * 10 * version. In addition, you may distribute version of this program linked to * 11 * Motif or Open Motif. See README for details. * 12 * * 13 * This software is distributed in the hope that it will be useful, but WITHOUT * 14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * 15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * 16 * for more details. * 17 * * 18 * You should have received a copy of the GNU General Public License along with * 19 * software; if not, write to the Free Software Foundation, Inc., 59 Temple * 20 * Place, Suite 330, Boston, MA 02111-1307 USA * 21 * * 22 * Nirvana Text Editor * 23 * Sep 26, 2002 * 24 * * 25 * Written by Tony Balinski with contributions from Andrew Hood * 26 * * 27 * Modifications: * 28 * * 29 * * 30 *******************************************************************************/ 31 #ifndef rangeset_h_DEFINED 32 #define rangeset_h_DEFINED 33 34 #include <Xm/Xm.h> 35 #include <X11/Xft/Xft.h> 36 37 #define N_RANGESETS 63 38 39 typedef struct _Range Range; 40 typedef struct _Rangeset Rangeset; 41 42 void RangesetRefreshRange(Rangeset *rangeset, int start, int end); 43 void RangesetEmpty(Rangeset *rangeset); 44 void RangesetInit(Rangeset *rangeset, int label, textBuffer *buf); 45 int RangesetChangeModifyResponse(Rangeset *rangeset, char *name); 46 int RangesetFindRangeNo(Rangeset *rangeset, int index, int *start, int *end); 47 int RangesetFindRangeOfPos(Rangeset *rangeset, int pos, int incl_end); 48 int RangesetCheckRangeOfPos(Rangeset *rangeset, int pos); 49 int RangesetInverse(Rangeset *p); 50 int RangesetAdd(Rangeset *origSet, Rangeset *plusSet); 51 int RangesetAddBetween(Rangeset *rangeset, int start, int end); 52 int RangesetRemove(Rangeset *origSet, Rangeset *minusSet); 53 int RangesetRemoveBetween(Rangeset *rangeset, int start, int end); 54 int RangesetGetNRanges(Rangeset *rangeset); 55 void RangesetGetInfo(Rangeset *rangeset, int *defined, int *label, 56 int *count, char **color, char **name, char **mode); 57 RangesetTable *RangesetTableAlloc(textBuffer *buf); 58 RangesetTable *RangesetTableFree(RangesetTable *table); 59 RangesetTable *RangesetTableClone(RangesetTable *srcTable, 60 textBuffer *destBuffer); 61 int RangesetFindIndex(RangesetTable *table, int label, int must_be_active); 62 int RangesetLabelOK(int label); 63 int RangesetCreate(RangesetTable *table); 64 int nRangesetsAvailable(RangesetTable *table); 65 Rangeset *RangesetForget(RangesetTable *table, int label); 66 Rangeset *RangesetFetch(RangesetTable *table, int label); 67 unsigned char * RangesetGetList(RangesetTable *table); 68 void RangesetTableUpdatePos(RangesetTable *table, int pos, int n_ins, int n_del); 69 void RangesetBufModifiedCB(int pos, int nInserted, int nDeleted, int nRestyled, 70 const char *deletedText, void *cbArg); 71 int RangesetIndex1ofPos(RangesetTable *table, int pos, int needs_color); 72 int RangesetAssignColorName(Rangeset *rangeset, char *color_name); 73 int RangesetAssignColorPixel(Rangeset *rangeset, XftColor color, int ok); 74 char *RangesetGetName(Rangeset *rangeset); 75 int RangesetAssignName(Rangeset *rangeset, char *name); 76 int RangesetGetColorValid(Rangeset *rangeset, XftColor *color); 77 char *RangesetTableGetColorName(RangesetTable *table, int index); 78 int RangesetTableGetColorValid(RangesetTable *table, int index, XftColor *color, Rangeset **rs); 79 Rangeset* RangesetTableAssignColorPixel(RangesetTable *table, int index, XftColor color, 80 int ok); 81 XftColor* RangesetGetColor(Rangeset *rangeset); 82 83 #endif /* rangeset_h_DEFINED */ 84