projects
/
m17n
/
m17n-lib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Sinhala.
[m17n/m17n-lib.git]
/
example
/
medit.c
diff --git
a/example/medit.c
b/example/medit.c
index
5680253
..
e1477df
100644
(file)
--- a/
example/medit.c
+++ b/
example/medit.c
@@
-334,8
+334,8
@@
update_top (int pos)
top.from = info.line_from;
top.to = info.line_to;
top.y0 = 0;
top.from = info.line_from;
top.to = info.line_to;
top.y0 = 0;
- top.y1 = info.this.height;
- top.ascent = - info.this.y;
+ top.y1 = info.metrics.height;
+ top.ascent = - info.metrics.y;
}
}
@@
-382,21
+382,21
@@
redraw (int y0, int y1, int clear, int scroll_bar)
from = line->from;
y = line->y0;
from = line->from;
y = line->y0;
- info.this.height = line->y1 - y;
- info.this.y = - line->ascent;
+ info.metrics.height = line->y1 - y;
+ info.metrics.y = - line->ascent;
info.line_to = line->to;
info.line_to = line->to;
- while (from < nchars && y + info.this.height <= y0)
+ while (from < nchars && y + info.metrics.height <= y0)
{
{
- y += info.this.height;
+ y += info.metrics.height;
from = info.line_to;
GLYPH_INFO (from, from, info);
}
from = info.line_to;
GLYPH_INFO (from, from, info);
}
- y0 = y - info.this.y;
+ y0 = y - info.metrics.y;
to = from;
while (to < nchars && y < y1)
{
GLYPH_INFO (to, to, info);
to = from;
while (to < nchars && y < y1)
{
GLYPH_INFO (to, to, info);
- y += info.this.height;
+ y += info.metrics.height;
to = info.line_to;
}
if (to == nchars)
to = info.line_to;
}
if (to == nchars)
@@
-408,10
+408,10
@@
redraw (int y0, int y1, int clear, int scroll_bar)
while (to < nchars)
{
GLYPH_INFO (to, to, info);
while (to < nchars)
{
GLYPH_INFO (to, to, info);
- if (y + info.this.height >= win_height)
+ if (y + info.metrics.height >= win_height)
break;
to = info.line_to;
break;
to = info.line_to;
- y += info.this.height;
+ y += info.metrics.height;
}
update_scroll_bar (top.from, to);
}
}
update_scroll_bar (top.from, to);
}
@@
-481,7
+481,7
@@
redraw_cursor (int clear)
if (control.orientation_reversed)
x += win_width - cursor.logical_width;
if (control.orientation_reversed)
x += win_width - cursor.logical_width;
- CLEAR_AREA (x, cur.y0, cursor.logical_width, cursor.this.height);
+ CLEAR_AREA (x, cur.y0, cursor.logical_width, cursor.metrics.height);
}
DRAW_TEXT (cursor.x, cur.y0 + cur.ascent, cursor.from, cursor.to);
}
}
DRAW_TEXT (cursor.x, cur.y0 + cur.ascent, cursor.from, cursor.to);
}
@@
-501,7
+501,7
@@
update_cursor (int pos, int full)
{
/* CUR is inaccurate. We can trust only TOP. */
GLYPH_INFO (top.from, pos, cursor);
{
/* CUR is inaccurate. We can trust only TOP. */
GLYPH_INFO (top.from, pos, cursor);
- cur.y0 = top.ascent + cursor.y + cursor.this.y;
+ cur.y0 = top.ascent + cursor.y + cursor.metrics.y;
}
else if (pos < cur.from)
{
}
else if (pos < cur.from)
{
@@
-509,7
+509,7
@@
update_cursor (int pos, int full)
TEXT_EXTENTS (from, cur.from, rect);
GLYPH_INFO (from, pos, cursor);
TEXT_EXTENTS (from, cur.from, rect);
GLYPH_INFO (from, pos, cursor);
- cur.y0 -= (rect.height + rect.y) - (cursor.y + cursor.this.y);
+ cur.y0 -= (rect.height + rect.y) - (cursor.y + cursor.metrics.y);
}
else if (pos < cur.to)
{
}
else if (pos < cur.to)
{
@@
-518,13
+518,13
@@
update_cursor (int pos, int full)
else
{
GLYPH_INFO (cur.from, pos, cursor);
else
{
GLYPH_INFO (cur.from, pos, cursor);
- cur.y0 += cur.ascent + cursor.y + cursor.this.y;
+ cur.y0 += cur.ascent + cursor.y + cursor.metrics.y;
}
cur.from = cursor.line_from;
cur.to = cursor.line_to;
}
cur.from = cursor.line_from;
cur.to = cursor.line_to;
- cur.y1 = cur.y0 + cursor.this.height;
- cur.ascent = - cursor.this.y;
+ cur.y1 = cur.y0 + cursor.metrics.height;
+ cur.ascent = - cursor.metrics.y;
}
}
@@
-550,34
+550,28
@@
update_selection ()
sel_start.ascent = - rect.y;
GLYPH_INFO (pos, from, info);
if (pos < info.line_from)
sel_start.ascent = - rect.y;
GLYPH_INFO (pos, from, info);
if (pos < info.line_from)
- sel_start.y0 += - rect.y + info.y + info.this.y;
+ sel_start.y0 += - rect.y + info.y + info.metrics.y;
}
else
{
GLYPH_INFO (top.from, from, info);
}
else
{
GLYPH_INFO (top.from, from, info);
- sel_start.y0 = top.ascent + info.y + info.this.y;
+ sel_start.y0 = top.ascent + info.y + info.metrics.y;
}
}
- sel_start.ascent = -info.this.y;
- sel_start.y1 = sel_start.y0 + info.this.height;
+ sel_start.ascent = -info.metrics.y;
+ sel_start.y1 = sel_start.y0 + info.metrics.height;
sel_start.from = info.line_from;
sel_start.to = info.line_to;
if (to <= sel_start.to)
{
sel_end = sel_start;
sel_start.from = info.line_from;
sel_start.to = info.line_to;
if (to <= sel_start.to)
{
sel_end = sel_start;
- if (to >= sel_end.to)
- {
- GLYPH_INFO (sel_start.from, to, info);
- sel_end.y1 = sel_end.y0 + info.y + info.this.height;
- sel_end.to = info.line_to;
- }
}
else
{
GLYPH_INFO (sel_start.from, to, info);
}
else
{
GLYPH_INFO (sel_start.from, to, info);
- sel_end.y0 = sel_start.y0 + sel_start.ascent + info.y + info.this.y;
- sel_end.y1 = sel_end.y0 + info.this.height;
- sel_end.ascent = - info.this.y;
+ sel_end.y0 = sel_start.y0 + sel_start.ascent + info.y + info.metrics.y;
+ sel_end.y1 = sel_end.y0 + info.metrics.height;
+ sel_end.ascent = - info.metrics.y;
sel_end.from = info.line_from;
sel_end.to = info.line_to;
}
sel_end.from = info.line_from;
sel_end.to = info.line_to;
}
@@
-1133,6
+1127,7
@@
ExposeProc (Widget w, XEvent *event, String *str, Cardinal *num)
update_top (0);
update_cursor (0, 1);
redraw (0, win_height, 0, 1);
update_top (0);
update_cursor (0, 1);
redraw (0, win_height, 0, 1);
+ if (current_input_method >= 0)
{
int idx = current_input_method;
{
int idx = current_input_method;
@@
-1351,9
+1346,9
@@
ScrollProc (Widget w, XtPointer client_data, XtPointer position)
{
pos = bol (from - 1, 0);
GLYPH_INFO (pos, from - 1, info);
{
pos = bol (from - 1, 0);
GLYPH_INFO (pos, from - 1, info);
- if (height + info.this.height > win_height)
+ if (height + info.metrics.height > win_height)
break;
break;
- height += info.this.height;
+ height += info.metrics.height;
from = info.line_from;
}
if (cursor_pos >= top.to)
from = info.line_from;
}
if (cursor_pos >= top.to)
@@
-1363,9
+1358,9
@@
ScrollProc (Widget w, XtPointer client_data, XtPointer position)
while (cursor_pos < nchars)
{
GLYPH_INFO (pos, pos, info);
while (cursor_pos < nchars)
{
GLYPH_INFO (pos, pos, info);
- if (height + info.this.height > win_height)
+ if (height + info.metrics.height > win_height)
break;
break;
- height += info.this.height;
+ height += info.metrics.height;
cursor_pos = pos;
pos = info.line_to;
}
cursor_pos = pos;
pos = info.line_to;
}
@@
-1379,10
+1374,10
@@
ScrollProc (Widget w, XtPointer client_data, XtPointer position)
while (from < nchars)
{
GLYPH_INFO (from, from, info);
while (from < nchars)
{
GLYPH_INFO (from, from, info);
- if (height + info.this.height > win_height
+ if (height + info.metrics.height > win_height
|| info.line_to >= nchars)
break;
|| info.line_to >= nchars)
break;
- height += info.this.height;
+ height += info.metrics.height;
from = info.line_to;
}
if (from == nchars)
from = info.line_to;
}
if (from == nchars)