mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-22 14:08:06 +01:00
Small fix.
This commit is contained in:
@@ -20,6 +20,23 @@
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
typedef enum {
|
||||
ctText=0,
|
||||
ctImage=1
|
||||
} ChunkType;
|
||||
|
||||
typedef enum {
|
||||
dtDelete=0,
|
||||
dtBackSpace
|
||||
} DeleteType;
|
||||
|
||||
typedef enum {
|
||||
wrWord=0,
|
||||
wrChar=1,
|
||||
wrNone=2
|
||||
} Wrapping;
|
||||
|
||||
|
||||
void wgdbFree(void *ptr)
|
||||
{
|
||||
if(!ptr) printf("err... cannot ");
|
||||
@@ -28,11 +45,7 @@ void wgdbFree(void *ptr)
|
||||
}
|
||||
|
||||
|
||||
typedef enum {ctText=0, ctImage=1} ChunkType;
|
||||
typedef enum { dtDelete=0, dtBackSpace } DeleteType;
|
||||
typedef enum {wrWord=0, wrChar=1, wrNone=2} Wrapping;
|
||||
|
||||
/* Why singly-linked and not say doubly-linked?
|
||||
/* Why single-linked and not say double-linked?
|
||||
99% of the time (draw, append), the "prior"
|
||||
member would have been a useless memory and CPU overhead,
|
||||
and deletes _are_ relatively infrequent.
|
||||
@@ -40,10 +53,11 @@ typedef enum {wrWord=0, wrChar=1, wrNone=2} Wrapping;
|
||||
doing things the hard way will be incurred... but seldomly. */
|
||||
|
||||
|
||||
/* a Chunk is a singly-linked list of chunks containing:
|
||||
o text with a given format
|
||||
o or an image
|
||||
o but NOT both */
|
||||
/* a Chunk is a single-linked list of chunks containing:
|
||||
* o text with a given format
|
||||
* o or an image
|
||||
* o but NOT both
|
||||
*/
|
||||
typedef struct _Chunk {
|
||||
char *text; /* the text in the chunk */
|
||||
WMPixmap *pixmap; /* OR the pixmap it holds */
|
||||
@@ -60,16 +74,17 @@ typedef struct _Chunk {
|
||||
ushort sStart;
|
||||
ushort sEnd;
|
||||
ushort RESERVED:10;
|
||||
struct _Chunk *next;/*the next member in this list */
|
||||
struct _Chunk *next; /*the next member in this list */
|
||||
|
||||
}Chunk;
|
||||
} Chunk;
|
||||
|
||||
|
||||
|
||||
/* a Paragraph is a singly-linked list of paragraphs containing:
|
||||
o a list of chunks in that paragraph
|
||||
o the formats for that paragraph
|
||||
o its (draw) position relative to the entire document */
|
||||
* o a list of chunks in that paragraph
|
||||
* o the formats for that paragraph
|
||||
* o its (draw) position relative to the entire document
|
||||
*/
|
||||
typedef struct _Paragraph {
|
||||
Chunk *chunks; /* the list of text and/or image chunks */
|
||||
short fmargin; /* the start position of the first line */
|
||||
@@ -80,12 +95,12 @@ typedef struct _Paragraph {
|
||||
|
||||
Pixmap drawbuffer; /* the pixmap onto which the (entire)
|
||||
paragraph will be drawn */
|
||||
WMPixmap *bulletPix;/* the pixmap to use for bulleting */
|
||||
WMPixmap *bulletPix; /* the pixmap to use for bulleting */
|
||||
int top; /* the top of the paragraph relative to document */
|
||||
int bottom; /* the bottom of the paragraph relative to document */
|
||||
int width; /* the width of the paragraph */
|
||||
int height; /* the height of the paragraph */
|
||||
WMAlignment align:2;/* justification of this paragraph */
|
||||
WMAlignment align:2; /* justification of this paragraph */
|
||||
ushort RESERVED:14;
|
||||
|
||||
struct _Paragraph *next; /* the next member in this list */
|
||||
@@ -101,11 +116,12 @@ static char *default_bullet[] = {
|
||||
".XX..o",
|
||||
".....o",
|
||||
" ...oo",
|
||||
" ooo "};
|
||||
" ooo "
|
||||
};
|
||||
|
||||
/* this is really a shrunk down version of the original
|
||||
"broken" icon... I did not draw it, I simply shrunk it */
|
||||
static char * unk_xpm[] = {
|
||||
static char * unk_xpm[] = {
|
||||
"24 24 17 1",
|
||||
" c None", ". c #0B080C", "+ c #13A015", "@ c #5151B8",
|
||||
"# c #992719", "$ c #5B1C20", "% c #1DF51D", "& c #D1500D", "* c #2F304A",
|
||||
@@ -134,7 +150,8 @@ static char *default_bullet[] = {
|
||||
"............**@)!)>->...",
|
||||
"........................",
|
||||
"........................",
|
||||
"........................"};
|
||||
"........................"
|
||||
};
|
||||
|
||||
typedef struct W_Text {
|
||||
W_Class widgetClass; /* the class number of this widget */
|
||||
@@ -175,9 +192,9 @@ typedef struct W_Text {
|
||||
short clheight; /* the height of the "line" clicked on */
|
||||
short clwidth; /* the width of the "line" clicked on */
|
||||
|
||||
WMReliefType relief:2; /* the relief to display with */
|
||||
WMReliefType relief:3; /* the relief to display with */
|
||||
Wrapping wrapping:2; /* the type of wrapping to use in drawing */
|
||||
WMAlignment dAlignment:2;/* default justification */
|
||||
WMAlignment dAlignment:2; /* default justification */
|
||||
ushort monoFont:1; /* whether to ignore "rich" commands */
|
||||
ushort fixedPitch:1; /* assume each char in dFont is the same size */
|
||||
ushort editable:1; /* whether to accept user changes or not*/
|
||||
@@ -185,13 +202,13 @@ typedef struct W_Text {
|
||||
ushort cursorShown:1; /* whether the cursor is currently being shown */
|
||||
ushort frozen:1; /* whether screen updates are to be made */
|
||||
ushort focused:1; /* whether this instance has input focus */
|
||||
ushort pointerGrabbed:1;/* whether this instance has the pointer */
|
||||
ushort pointerGrabbed:1; /* whether this instance has the pointer */
|
||||
ushort buttonHeld:1; /* the user is still holding down the button */
|
||||
ushort ignoreNewLine:1; /* whether to ignore the newline character */
|
||||
ushort waitingForSelection:1; /* whether there is a pending paste event */
|
||||
ushort ownsSelection:1; /* whether it ownz the current selection */
|
||||
ushort findingClickPoint:1;/* whether the search for a clickpoint is on */
|
||||
ushort foundClickPoint:1;/* whether the clickpoint has been found */
|
||||
ushort findingClickPoint:1; /* whether the search for a clickpoint is on */
|
||||
ushort foundClickPoint:1; /* whether the clickpoint has been found */
|
||||
ushort hasVscroller:1; /* whether to enable the vertical scroller */
|
||||
ushort hasHscroller:1; /* whether to enable the horizontal scroller */
|
||||
ushort RESERVED:10;
|
||||
@@ -207,6 +224,7 @@ typedef struct W_Text {
|
||||
/* max on a line */
|
||||
#define MAX_CHUNX 64
|
||||
#define MIN_DOC_WIDTH 200
|
||||
|
||||
typedef struct _LocalMargins {
|
||||
short left, right, first, body;
|
||||
} LocalMargins;
|
||||
@@ -216,7 +234,7 @@ typedef struct _MyTextItems {
|
||||
WMPixmap *pix;
|
||||
short chars;
|
||||
short x;
|
||||
Chunk *chunk;/* used for "click" events */
|
||||
Chunk *chunk; /* used for "click" events */
|
||||
short start; /* ditto... where in the chunk we start (ie. wrapped chunk) */
|
||||
ushort type:1;
|
||||
ushort RESERVED:15;
|
||||
|
||||
Reference in New Issue
Block a user