mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 16:40:50 +00:00
Tidied
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8567 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
29b391060f
commit
1c09cb7345
1 changed files with 23 additions and 17 deletions
|
@ -296,7 +296,7 @@ GSCharIndexForGlyphInChunk(GSGlyphChunk *chunk, unsigned index)
|
||||||
+ (GSIArrayItemAtIndex(&chunk->glyphs, index).ext).offset;
|
+ (GSIArrayItemAtIndex(&chunk->glyphs, index).ext).offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GSGlyphChunk*
|
static unsigned
|
||||||
GSChunkForCharIndex(GSIArray chunks, unsigned charIndex)
|
GSChunkForCharIndex(GSIArray chunks, unsigned charIndex)
|
||||||
{
|
{
|
||||||
unsigned pos;
|
unsigned pos;
|
||||||
|
@ -314,13 +314,16 @@ GSChunkForCharIndex(GSIArray chunks, unsigned charIndex)
|
||||||
GSGlyphChunk *chunk = GSCreateGlyphChunk(0);
|
GSGlyphChunk *chunk = GSCreateGlyphChunk(0);
|
||||||
|
|
||||||
GSIArrayInsertItem(chunks, (GSIArrayItem)(void*)chunk, 0);
|
GSIArrayInsertItem(chunks, (GSIArrayItem)(void*)chunk, 0);
|
||||||
return chunk;
|
return 0;
|
||||||
}
|
}
|
||||||
pos--;
|
else
|
||||||
return (GSGlyphChunk*)(GSIArrayItemAtIndex(chunks, pos).ptr);
|
{
|
||||||
|
pos--;
|
||||||
|
}
|
||||||
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GSGlyphChunk*
|
static unsigned
|
||||||
GSChunkForGlyphIndex(GSIArray chunks, unsigned glyphIndex)
|
GSChunkForGlyphIndex(GSIArray chunks, unsigned glyphIndex)
|
||||||
{
|
{
|
||||||
unsigned pos;
|
unsigned pos;
|
||||||
|
@ -338,10 +341,12 @@ GSChunkForGlyphIndex(GSIArray chunks, unsigned glyphIndex)
|
||||||
GSGlyphChunk *chunk = GSCreateGlyphChunk(0);
|
GSGlyphChunk *chunk = GSCreateGlyphChunk(0);
|
||||||
|
|
||||||
GSIArrayInsertItem(chunks, (GSIArrayItem)(void*)chunk, 0);
|
GSIArrayInsertItem(chunks, (GSIArrayItem)(void*)chunk, 0);
|
||||||
return chunk;
|
|
||||||
}
|
}
|
||||||
pos--;
|
else
|
||||||
return (GSGlyphChunk*)(GSIArrayItemAtIndex(chunks, pos).ptr);
|
{
|
||||||
|
pos--;
|
||||||
|
}
|
||||||
|
return pos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1091,8 +1096,10 @@ invalidatedRange.length);
|
||||||
isValidIndex: (BOOL*)flag
|
isValidIndex: (BOOL*)flag
|
||||||
{
|
{
|
||||||
GSGlyphChunk *chunk;
|
GSGlyphChunk *chunk;
|
||||||
|
unsigned pos;
|
||||||
|
|
||||||
chunk = GSChunkForGlyphIndex(glyphChunks, index);
|
pos = GSChunkForGlyphIndex(glyphChunks, index);
|
||||||
|
chunk = (GSGlyphChunk*)(GSIArrayItemAtIndex(glyphChunks, pos).ptr);
|
||||||
while (chunk->glyphIndex + GSIArrayCount(&chunk->glyphs) < index)
|
while (chunk->glyphIndex + GSIArrayCount(&chunk->glyphs) < index)
|
||||||
{
|
{
|
||||||
break; // FIXME - should try to extend layout?
|
break; // FIXME - should try to extend layout?
|
||||||
|
@ -1115,8 +1122,10 @@ invalidatedRange.length);
|
||||||
{
|
{
|
||||||
GSGlyphChunk *chunk;
|
GSGlyphChunk *chunk;
|
||||||
unsigned glyphCount;
|
unsigned glyphCount;
|
||||||
|
unsigned pos;
|
||||||
|
|
||||||
chunk = GSChunkForGlyphIndex(glyphChunks, index);
|
pos = GSChunkForGlyphIndex(glyphChunks, index);
|
||||||
|
chunk = (GSGlyphChunk*)(GSIArrayItemAtIndex(glyphChunks, pos).ptr);
|
||||||
glyphCount = GSIArrayCount(&chunk->glyphs);
|
glyphCount = GSIArrayCount(&chunk->glyphs);
|
||||||
if (glyphCount <= index)
|
if (glyphCount <= index)
|
||||||
{
|
{
|
||||||
|
@ -1125,7 +1134,8 @@ invalidatedRange.length);
|
||||||
* if the glyph index given is too large.
|
* if the glyph index given is too large.
|
||||||
*/
|
*/
|
||||||
[self glyphAtIndex: index];
|
[self glyphAtIndex: index];
|
||||||
chunk = GSChunkForGlyphIndex(glyphChunks, index);
|
pos = GSChunkForGlyphIndex(glyphChunks, index);
|
||||||
|
chunk = (GSGlyphChunk*)(GSIArrayItemAtIndex(glyphChunks, pos).ptr);
|
||||||
glyphCount = GSIArrayCount(&chunk->glyphs);
|
glyphCount = GSIArrayCount(&chunk->glyphs);
|
||||||
}
|
}
|
||||||
index -= chunk->glyphIndex;
|
index -= chunk->glyphIndex;
|
||||||
|
@ -1151,7 +1161,6 @@ invalidatedRange.length);
|
||||||
if (toFetch > 0)
|
if (toFetch > 0)
|
||||||
{
|
{
|
||||||
GSGlyphChunk *chunk;
|
GSGlyphChunk *chunk;
|
||||||
GSGlyphChunk tmp;
|
|
||||||
unsigned chunkIndex;
|
unsigned chunkIndex;
|
||||||
unsigned pos;
|
unsigned pos;
|
||||||
|
|
||||||
|
@ -1164,11 +1173,8 @@ invalidatedRange.length);
|
||||||
* Use binary search to locate the first chunk, and set pos to
|
* Use binary search to locate the first chunk, and set pos to
|
||||||
* indicate the first glyph in the chunk that we are interested in.
|
* indicate the first glyph in the chunk that we are interested in.
|
||||||
*/
|
*/
|
||||||
tmp.glyphIndex = glyphRange.location;
|
chunkIndex = GSChunkForGlyphIndex(glyphChunks, glyphRange.location);
|
||||||
chunkIndex = GSIArrayInsertionPosition(glyphChunks,
|
chunk = (GSGlyphChunk*)(GSIArrayItemAtIndex(glyphChunks, chunkIndex).ptr);
|
||||||
(GSIArrayItem)(void*)&tmp, glyphIndexSort);
|
|
||||||
chunk = (GSGlyphChunk*)(GSIArrayItemAtIndex(glyphChunks,
|
|
||||||
--chunkIndex).ptr);
|
|
||||||
pos = glyphRange.location - chunk->glyphIndex;
|
pos = glyphRange.location - chunk->glyphIndex;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue