mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:00:48 +00:00
(_glyphDumpRuns,
helpers::generateRunsToCharacter:, helpers::generateGlyphsUpToCharacter:, helpers::generateGlyphsUpToGlyph:, helpers::glyphForCharacter:index:positions::, getGlyphs:range:, characterRangeForGlyphRange:actualGlyphRange:, glyphRangeForCharacterRange:actualCharacterRange:, invalidateGlyphsForCharacterRange:changeInLength:actualCharacterRange:, insertTextContainer:atIndex:): Removed compiler warning about signed/unsigned comparision. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17041 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5eb434c3fd
commit
47f3feff6c
1 changed files with 39 additions and 29 deletions
|
@ -163,7 +163,7 @@ Private method used internally by GSLayoutManager for sanity checking.
|
||||||
printf(" level %i, continued %i\n", h->level, h->continued);
|
printf(" level %i, continued %i\n", h->level, h->continued);
|
||||||
if (h->head.complete)
|
if (h->head.complete)
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
printf("glyphs:\n");
|
printf("glyphs:\n");
|
||||||
for (i = 0;i < h->head.glyph_length;i++)
|
for (i = 0;i < h->head.glyph_length;i++)
|
||||||
printf("%5i %04x u%04x ",
|
printf("%5i %04x u%04x ",
|
||||||
|
@ -378,10 +378,8 @@ static glyph_run_t *run_insert(glyph_run_head_t **context)
|
||||||
glyph_run_head_t *context[SKIP_LIST_DEPTH];
|
glyph_run_head_t *context[SKIP_LIST_DEPTH];
|
||||||
int positions[SKIP_LIST_DEPTH];
|
int positions[SKIP_LIST_DEPTH];
|
||||||
glyph_run_head_t *h;
|
glyph_run_head_t *h;
|
||||||
int pos;
|
unsigned int pos;
|
||||||
|
unsigned int length;
|
||||||
int length;
|
|
||||||
|
|
||||||
int level;
|
int level;
|
||||||
|
|
||||||
|
|
||||||
|
@ -575,10 +573,9 @@ not completely accurate).
|
||||||
|
|
||||||
-(void) _generateGlyphsUpToCharacter: (unsigned int)last
|
-(void) _generateGlyphsUpToCharacter: (unsigned int)last
|
||||||
{
|
{
|
||||||
int length;
|
unsigned int length;
|
||||||
BOOL dummy;
|
BOOL dummy;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Trying to do anything here while the text storage has unprocessed edits
|
Trying to do anything here while the text storage has unprocessed edits
|
||||||
(ie. an edit count>0) breaks things badly, and in strange ways. Thus, we
|
(ie. an edit count>0) breaks things badly, and in strange ways. Thus, we
|
||||||
|
@ -613,7 +610,7 @@ not completely accurate).
|
||||||
|
|
||||||
-(void) _generateGlyphsUpToGlyph: (unsigned int)last
|
-(void) _generateGlyphsUpToGlyph: (unsigned int)last
|
||||||
{
|
{
|
||||||
int length;
|
unsigned int length;
|
||||||
|
|
||||||
if (!_textStorage)
|
if (!_textStorage)
|
||||||
return;
|
return;
|
||||||
|
@ -632,7 +629,7 @@ not completely accurate).
|
||||||
positions: (unsigned int *)rpos : (unsigned int *)rcpos
|
positions: (unsigned int *)rpos : (unsigned int *)rcpos
|
||||||
{
|
{
|
||||||
glyph_run_t *r;
|
glyph_run_t *r;
|
||||||
int pos, cpos;
|
unsigned int pos, cpos;
|
||||||
int lo, hi, mid, i;
|
int lo, hi, mid, i;
|
||||||
|
|
||||||
r = run_for_character_index(target, glyphs, &pos, &cpos);
|
r = run_for_character_index(target, glyphs, &pos, &cpos);
|
||||||
|
@ -726,12 +723,18 @@ not completely accurate).
|
||||||
- (unsigned int) getGlyphs: (NSGlyph *)glyphArray
|
- (unsigned int) getGlyphs: (NSGlyph *)glyphArray
|
||||||
range: (NSRange)glyphRange
|
range: (NSRange)glyphRange
|
||||||
{
|
{
|
||||||
int pos = glyphRange.location + glyphRange.length - 1;
|
|
||||||
glyph_run_t *r;
|
glyph_run_t *r;
|
||||||
NSGlyph *g;
|
NSGlyph *g;
|
||||||
int num;
|
unsigned int pos;
|
||||||
int i, j, k;
|
unsigned int num;
|
||||||
|
unsigned int i, j, k;
|
||||||
|
|
||||||
|
if (glyphRange.length == 0)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
pos = NSMaxRange(glyphRange) - 1;
|
||||||
if (glyphs->glyph_length <= pos)
|
if (glyphs->glyph_length <= pos)
|
||||||
{
|
{
|
||||||
[self _generateGlyphsUpToGlyph: pos];
|
[self _generateGlyphsUpToGlyph: pos];
|
||||||
|
@ -761,7 +764,7 @@ not completely accurate).
|
||||||
else
|
else
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
k = glyphRange.location + glyphRange.length - pos;
|
k = NSMaxRange(glyphRange) - pos;
|
||||||
if (k > r->head.glyph_length)
|
if (k > r->head.glyph_length)
|
||||||
k = r->head.glyph_length;
|
k = r->head.glyph_length;
|
||||||
if (k <= j)
|
if (k <= j)
|
||||||
|
@ -814,11 +817,19 @@ not completely accurate).
|
||||||
- (NSRange) characterRangeForGlyphRange: (NSRange)glyphRange
|
- (NSRange) characterRangeForGlyphRange: (NSRange)glyphRange
|
||||||
actualGlyphRange: (NSRange *)actualGlyphRange
|
actualGlyphRange: (NSRange *)actualGlyphRange
|
||||||
{
|
{
|
||||||
int cpos, pos = glyphRange.location + glyphRange.length - 1;
|
|
||||||
glyph_run_t *r;
|
glyph_run_t *r;
|
||||||
NSRange real_range, char_range;
|
NSRange real_range, char_range;
|
||||||
int i, j;
|
unsigned int cpos, pos;
|
||||||
|
unsigned j;
|
||||||
|
|
||||||
|
if (NSMaxRange(glyphRange) == 0)
|
||||||
|
{
|
||||||
|
if (actualGlyphRange)
|
||||||
|
*actualGlyphRange = glyphRange;
|
||||||
|
return NSMakeRange(0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
pos = NSMaxRange(glyphRange) - 1;
|
||||||
if (glyphs->glyph_length <= pos)
|
if (glyphs->glyph_length <= pos)
|
||||||
{
|
{
|
||||||
[self _generateGlyphsUpToGlyph: pos];
|
[self _generateGlyphsUpToGlyph: pos];
|
||||||
|
@ -845,6 +856,7 @@ not completely accurate).
|
||||||
{
|
{
|
||||||
glyph_run_t *r2;
|
glyph_run_t *r2;
|
||||||
unsigned int adj, cadj;
|
unsigned int adj, cadj;
|
||||||
|
int i;
|
||||||
|
|
||||||
i = glyphRange.location - pos;
|
i = glyphRange.location - pos;
|
||||||
r2 = r;
|
r2 = r;
|
||||||
|
@ -886,6 +898,7 @@ not completely accurate).
|
||||||
glyph_run_t *r2;
|
glyph_run_t *r2;
|
||||||
unsigned int adj, cadj;
|
unsigned int adj, cadj;
|
||||||
unsigned int last = 0;
|
unsigned int last = 0;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
i = glyphRange.location + glyphRange.length - 1 - pos;
|
i = glyphRange.location + glyphRange.length - 1 - pos;
|
||||||
r2 = r;
|
r2 = r;
|
||||||
|
@ -917,8 +930,8 @@ not completely accurate).
|
||||||
{
|
{
|
||||||
NSRange char_range, glyph_range;
|
NSRange char_range, glyph_range;
|
||||||
glyph_run_t *r;
|
glyph_run_t *r;
|
||||||
int cpos, pos = charRange.location + charRange.length - 1;
|
unsigned int cpos, pos;
|
||||||
int i, target;
|
unsigned int i, target;
|
||||||
|
|
||||||
/* TODO: should this really be valid?
|
/* TODO: should this really be valid?
|
||||||
|
|
||||||
|
@ -944,6 +957,7 @@ not completely accurate).
|
||||||
return NSMakeRange(0, 0);
|
return NSMakeRange(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pos = NSMaxRange(charRange) - 1;
|
||||||
[self _generateGlyphsUpToCharacter: pos];
|
[self _generateGlyphsUpToCharacter: pos];
|
||||||
if (glyphs->char_length <= pos)
|
if (glyphs->char_length <= pos)
|
||||||
{
|
{
|
||||||
|
@ -959,7 +973,7 @@ not completely accurate).
|
||||||
glyph_range.location = i + pos;
|
glyph_range.location = i + pos;
|
||||||
char_range.location = r->glyphs[i].char_offset + cpos;
|
char_range.location = r->glyphs[i].char_offset + cpos;
|
||||||
|
|
||||||
target = charRange.location + charRange.length - 1;
|
target = NSMaxRange(charRange) - 1;
|
||||||
r = [self _glyphForCharacter: target
|
r = [self _glyphForCharacter: target
|
||||||
index: &i
|
index: &i
|
||||||
positions: &pos : &cpos];
|
positions: &pos : &cpos];
|
||||||
|
@ -996,20 +1010,16 @@ places where we switch.
|
||||||
actualCharacterRange: (NSRange *)actualRange
|
actualCharacterRange: (NSRange *)actualRange
|
||||||
{
|
{
|
||||||
BOOL trailing;
|
BOOL trailing;
|
||||||
|
|
||||||
int cpos;
|
|
||||||
int ts_length;
|
|
||||||
int gap;
|
|
||||||
|
|
||||||
int position[SKIP_LIST_DEPTH];
|
|
||||||
glyph_run_head_t *context[SKIP_LIST_DEPTH];
|
glyph_run_head_t *context[SKIP_LIST_DEPTH];
|
||||||
glyph_run_head_t *h;
|
glyph_run_head_t *h;
|
||||||
glyph_run_t *r;
|
glyph_run_t *r;
|
||||||
int level;
|
|
||||||
|
|
||||||
int ch;
|
|
||||||
|
|
||||||
NSRange rng;
|
NSRange rng;
|
||||||
|
int position[SKIP_LIST_DEPTH];
|
||||||
|
unsigned int cpos;
|
||||||
|
unsigned int ts_length;
|
||||||
|
int gap;
|
||||||
|
int level;
|
||||||
|
unsigned int ch;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -2222,7 +2232,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
|
||||||
- (void) insertTextContainer: (NSTextContainer *)aTextContainer
|
- (void) insertTextContainer: (NSTextContainer *)aTextContainer
|
||||||
atIndex: (unsigned int)index
|
atIndex: (unsigned int)index
|
||||||
{
|
{
|
||||||
int i;
|
unsigned int i;
|
||||||
|
|
||||||
if (index < num_textcontainers)
|
if (index < num_textcontainers)
|
||||||
[self _invalidateLayoutFromContainer: index];
|
[self _invalidateLayoutFromContainer: index];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue