1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 22:28:02 +01:00

Small fix.

This commit is contained in:
dan
2000-06-24 22:43:07 +00:00
parent 19a92de3e6
commit b50d6e566c

View File

@@ -20,6 +20,23 @@
#include <ctype.h> #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) void wgdbFree(void *ptr)
{ {
if(!ptr) printf("err... cannot "); if(!ptr) printf("err... cannot ");
@@ -28,11 +45,7 @@ void wgdbFree(void *ptr)
} }
typedef enum {ctText=0, ctImage=1} ChunkType; /* Why single-linked and not say double-linked?
typedef enum { dtDelete=0, dtBackSpace } DeleteType;
typedef enum {wrWord=0, wrChar=1, wrNone=2} Wrapping;
/* Why singly-linked and not say doubly-linked?
99% of the time (draw, append), the "prior" 99% of the time (draw, append), the "prior"
member would have been a useless memory and CPU overhead, member would have been a useless memory and CPU overhead,
and deletes _are_ relatively infrequent. 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. */ doing things the hard way will be incurred... but seldomly. */
/* a Chunk is a singly-linked list of chunks containing: /* a Chunk is a single-linked list of chunks containing:
o text with a given format * o text with a given format
o or an image * o or an image
o but NOT both */ * o but NOT both
*/
typedef struct _Chunk { typedef struct _Chunk {
char *text; /* the text in the chunk */ char *text; /* the text in the chunk */
WMPixmap *pixmap; /* OR the pixmap it holds */ WMPixmap *pixmap; /* OR the pixmap it holds */
@@ -67,9 +81,10 @@ typedef struct _Chunk {
/* a Paragraph is a singly-linked list of paragraphs containing: /* a Paragraph is a singly-linked list of paragraphs containing:
o a list of chunks in that paragraph * o a list of chunks in that paragraph
o the formats for that paragraph * o the formats for that paragraph
o its (draw) position relative to the entire document */ * o its (draw) position relative to the entire document
*/
typedef struct _Paragraph { typedef struct _Paragraph {
Chunk *chunks; /* the list of text and/or image chunks */ Chunk *chunks; /* the list of text and/or image chunks */
short fmargin; /* the start position of the first line */ short fmargin; /* the start position of the first line */
@@ -101,7 +116,8 @@ static char *default_bullet[] = {
".XX..o", ".XX..o",
".....o", ".....o",
" ...oo", " ...oo",
" ooo "}; " ooo "
};
/* this is really a shrunk down version of the original /* this is really a shrunk down version of the original
"broken" icon... I did not draw it, I simply shrunk it */ "broken" icon... I did not draw it, I simply shrunk it */
@@ -134,7 +150,8 @@ static char *default_bullet[] = {
"............**@)!)>->...", "............**@)!)>->...",
"........................", "........................",
"........................", "........................",
"........................"}; "........................"
};
typedef struct W_Text { typedef struct W_Text {
W_Class widgetClass; /* the class number of this widget */ W_Class widgetClass; /* the class number of this widget */
@@ -175,7 +192,7 @@ typedef struct W_Text {
short clheight; /* the height of the "line" clicked on */ short clheight; /* the height of the "line" clicked on */
short clwidth; /* the width 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 */ 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 monoFont:1; /* whether to ignore "rich" commands */
@@ -207,6 +224,7 @@ typedef struct W_Text {
/* max on a line */ /* max on a line */
#define MAX_CHUNX 64 #define MAX_CHUNX 64
#define MIN_DOC_WIDTH 200 #define MIN_DOC_WIDTH 200
typedef struct _LocalMargins { typedef struct _LocalMargins {
short left, right, first, body; short left, right, first, body;
} LocalMargins; } LocalMargins;