diff options
| author | Joakim Verona | 2011-08-13 16:20:57 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-08-13 16:20:57 +0200 |
| commit | 8aa09b5b6afe5210ed341754f4addd663dc77151 (patch) | |
| tree | d9df2f0bf62e9ccf073fdbb953be0fb749a85d99 | |
| parent | 3637e3bf04cc1e54850a877c6535a075caad7e5e (diff) | |
| parent | 08fff70c6eab76f935d6827e3fd030ec40457f1d (diff) | |
| download | emacs-8aa09b5b6afe5210ed341754f4addd663dc77151.tar.gz emacs-8aa09b5b6afe5210ed341754f4addd663dc77151.zip | |
usptream + doc
| -rw-r--r-- | README.xwidget | 113 | ||||
| -rw-r--r-- | src/ChangeLog | 14 | ||||
| -rw-r--r-- | src/xdisp.c | 43 |
3 files changed, 104 insertions, 66 deletions
diff --git a/README.xwidget b/README.xwidget index f30ae3e2445..31b36c6a3b2 100644 --- a/README.xwidget +++ b/README.xwidget | |||
| @@ -27,7 +27,7 @@ necessary to support the Emacs window paradigm. | |||
| 27 | ** building | 27 | ** building |
| 28 | bzr co bzr+ssh://bzr.savannah.gnu.org/emacs/xwidget/ | 28 | bzr co bzr+ssh://bzr.savannah.gnu.org/emacs/xwidget/ |
| 29 | #the below compiler flags shouldn't be strictly necessary | 29 | #the below compiler flags shouldn't be strictly necessary |
| 30 | export CFLAGS=" -g -DGLYPH_DEBUG=1" | 30 | export CFLAGS=" -g" |
| 31 | ./configure --with-xwidgets --enable-asserts --with-x-toolkit=gtk3 | 31 | ./configure --with-xwidgets --enable-asserts --with-x-toolkit=gtk3 |
| 32 | make -j4 | 32 | make -j4 |
| 33 | gdb -ex run src/emacs | 33 | gdb -ex run src/emacs |
| @@ -203,9 +203,55 @@ This app will work by providing a socket that an app plugs into. The | |||
| 203 | socket window is copied efficientlp by means of composition to a | 203 | socket window is copied efficientlp by means of composition to a |
| 204 | number of other windows, that then are plugged into the different | 204 | number of other windows, that then are plugged into the different |
| 205 | Emacs sockets. | 205 | Emacs sockets. |
| 206 | ** old notes from x_draw_xwidget_glyph_string | ||
| 207 | |||
| 208 | BUG it seems this method for some reason is called with bad s->x and s->y sometimes. | ||
| 209 | When this happens the xwidget doesnt move on screen as it should. | ||
| 210 | This mightbe because of x_scroll_run. Emacs decides to scroll the screen by blitting sometimes. | ||
| 211 | then emacs doesnt try to actualy call the paint routines, which means this here code will never | ||
| 212 | run so the xwidget wont know it has been moved. | ||
| 213 | |||
| 214 | Solved temporarily by never optimizing in try_window_reusing_current_matrix(). | ||
| 215 | |||
| 216 | BUG the phantoming code doesnt work very well when the live xwidget is off screen. | ||
| 217 | you will get weirdo display artefacts. Composition ought to solve this, since that means the live window is | ||
| 218 | always available in an off-screen buffer. My current attempt at composition doesnt work properly however. | ||
| 219 | |||
| 220 | //allocation debugging. the correct values cant be expected to show upp immediately, but eventually they should get to be ok | ||
| 221 | // this is because we dont know when the container gets around to doing layout | ||
| 222 | //GtkAllocation galloc; | ||
| 223 | //gtk_widget_get_allocation(GTK_WIDGET (xv->widgetwindow), &galloc); | ||
| 224 | //printf("allocation %d %d , %d %d\n", galloc.x,galloc.y,galloc.width,galloc.height); | ||
| 225 | |||
| 226 | |||
| 227 | *** old notes about the old live/phantom scheme | ||
| 228 | |||
| 229 | //TODO: | ||
| 230 | // 1) always draw live xwidget in slected window | ||
| 231 | // (2) if there were no live instances of the xwidget in selected window, also draw it live) | ||
| 232 | // 3) if there was a live xwidget previously, now phantom it. | ||
| 233 | |||
| 234 | else | ||
| 235 | { | ||
| 236 | //ok, we are painting the xwidgets in non-selected window, so draw a phantom | ||
| 237 | //printf("draw phantom xwidget at:%d %d\n",x,y); | ||
| 238 | //xwidget_composite_draw_phantom (xw, x, y, clipx, clipy); //TODO MVC there will be very few cases of phantoming | ||
| 239 | } | ||
| 240 | |||
| 241 | |||
| 242 | atm this works as follows: only check if xwidgets are displayed in the | ||
| 243 | "selected window". if not, hide them or phantom them. | ||
| 244 | |||
| 245 | this means valid cases like xwidgets being displayed only once in | ||
| 246 | non-selected windows, does not work well. they should also be visible | ||
| 247 | in that case not phantomed. | ||
| 248 | |||
| 206 | * ToDo:s | 249 | * ToDo:s |
| 207 | ** new annoying trace | 250 | ** DONE new annoying trace |
| 251 | CLOSED: [2011-08-13 Sat 16:16] | ||
| 208 | maybe related to scroll inhibiting or cursor inhibiting code. | 252 | maybe related to scroll inhibiting or cursor inhibiting code. |
| 253 | It appears actually to be related to GLYPH_DEBUG=1. this flag is no | ||
| 254 | longer needed. | ||
| 209 | *** the trace | 255 | *** the trace |
| 210 | Breakpoint 1, abort () at emacs.c:383 | 256 | Breakpoint 1, abort () at emacs.c:383 |
| 211 | 383 kill (getpid (), SIGABRT); | 257 | 383 kill (getpid (), SIGABRT); |
| @@ -725,7 +771,8 @@ rather than gwfixed. | |||
| 725 | 771 | ||
| 726 | *** DONE support configure | 772 | *** DONE support configure |
| 727 | CLOSED: [2011-07-12 Tue 18:48] | 773 | CLOSED: [2011-07-12 Tue 18:48] |
| 728 | *** TODO ifdef all xwidget code | 774 | *** DONE ifdef all xwidget code |
| 775 | CLOSED: [2011-08-13 Sat 16:19] | ||
| 729 | so you can reliably disable the code at compiletime | 776 | so you can reliably disable the code at compiletime |
| 730 | ** DONE translate clicks | 777 | ** DONE translate clicks |
| 731 | CLOSED: [2011-07-03 Sun 22:12] | 778 | CLOSED: [2011-07-03 Sun 22:12] |
| @@ -1021,10 +1068,19 @@ and then compare by resizing in Epiphany, which is also webkit based. | |||
| 1021 | CLOSED: [2011-08-01 Mon 22:38] | 1068 | CLOSED: [2011-08-01 Mon 22:38] |
| 1022 | was rather hurried. end result is that the lisp layer only really | 1069 | was rather hurried. end result is that the lisp layer only really |
| 1023 | allows for one webkit session. | 1070 | allows for one webkit session. |
| 1024 | *** TODO extract DOM so SHR can render it | 1071 | *** TODO extract DOM to lisp |
| 1025 | then the SHR html renderer from Gnus could render the DOM as created | 1072 | then the SHR html renderer from Gnus could render the DOM as created |
| 1026 | by Webkit. | 1073 | by Webkit. |
| 1027 | *** TODO C-X b in other buffer from webkit | 1074 | |
| 1075 | made a simple oxperimental DOM tree traverser. It can be expanded to | ||
| 1076 | return a lisp representation, LDOM. | ||
| 1077 | |||
| 1078 | in order to bring lisp and DOM closer together the LDOM can include a | ||
| 1079 | mapping to the originating DOM node. so, find a node in LDOM, and the | ||
| 1080 | cell maps to the original DOM. but since the LDOM is a copy it can get | ||
| 1081 | out of sync. DOM events might help. | ||
| 1082 | *** DONE C-X b in other buffer from webkit | ||
| 1083 | CLOSED: [2011-08-12 Fri 22:20] | ||
| 1028 | bafflingly resets the webkit view to the top. Maybe the window | 1084 | bafflingly resets the webkit view to the top. Maybe the window |
| 1029 | reconfiguration hook code? further mystification is added because it | 1085 | reconfiguration hook code? further mystification is added because it |
| 1030 | only seems to happen with ido mode enabled. | 1086 | only seems to happen with ido mode enabled. |
| @@ -1033,6 +1089,7 @@ in comparison with image-mode which does the right thing, I discovered | |||
| 1033 | that image-mode has special code to handle scrolling. the browser mode | 1089 | that image-mode has special code to handle scrolling. the browser mode |
| 1034 | and image mode has some similarities. | 1090 | and image mode has some similarities. |
| 1035 | 1091 | ||
| 1092 | I made some delegation code frrom webkit mode to image mode. | ||
| 1036 | ** TODO xwidget image display spec compatibility | 1093 | ** TODO xwidget image display spec compatibility |
| 1037 | some history: the first version of the xwidget display spec was | 1094 | some history: the first version of the xwidget display spec was |
| 1038 | the same as an image spec. This turned out not to be fantastic because | 1095 | the same as an image spec. This turned out not to be fantastic because |
| @@ -1147,46 +1204,6 @@ defined controls. | |||
| 1147 | Added: [2011-08-11 Thu 10:53] | 1204 | Added: [2011-08-11 Thu 10:53] |
| 1148 | 1205 | ||
| 1149 | 1206 | ||
| 1150 | * old notes from x_draw_xwidget_glyph_string | 1207 | ** TODO SEB |
| 1151 | 1208 | the SEB site does something funny so I can't insert text in fields | |
| 1152 | BUG it seems this method for some reason is called with bad s->x and s->y sometimes. | ||
| 1153 | When this happens the xwidget doesnt move on screen as it should. | ||
| 1154 | This mightbe because of x_scroll_run. Emacs decides to scroll the screen by blitting sometimes. | ||
| 1155 | then emacs doesnt try to actualy call the paint routines, which means this here code will never | ||
| 1156 | run so the xwidget wont know it has been moved. | ||
| 1157 | |||
| 1158 | Solved temporarily by never optimizing in try_window_reusing_current_matrix(). | ||
| 1159 | |||
| 1160 | BUG the phantoming code doesnt work very well when the live xwidget is off screen. | ||
| 1161 | you will get weirdo display artefacts. Composition ought to solve this, since that means the live window is | ||
| 1162 | always available in an off-screen buffer. My current attempt at composition doesnt work properly however. | ||
| 1163 | |||
| 1164 | //allocation debugging. the correct values cant be expected to show upp immediately, but eventually they should get to be ok | ||
| 1165 | // this is because we dont know when the container gets around to doing layout | ||
| 1166 | //GtkAllocation galloc; | ||
| 1167 | //gtk_widget_get_allocation(GTK_WIDGET (xv->widgetwindow), &galloc); | ||
| 1168 | //printf("allocation %d %d , %d %d\n", galloc.x,galloc.y,galloc.width,galloc.height); | ||
| 1169 | |||
| 1170 | |||
| 1171 | *** old notes about the old live/phantom scheme | ||
| 1172 | |||
| 1173 | //TODO: | ||
| 1174 | // 1) always draw live xwidget in slected window | ||
| 1175 | // (2) if there were no live instances of the xwidget in selected window, also draw it live) | ||
| 1176 | // 3) if there was a live xwidget previously, now phantom it. | ||
| 1177 | |||
| 1178 | else | ||
| 1179 | { | ||
| 1180 | //ok, we are painting the xwidgets in non-selected window, so draw a phantom | ||
| 1181 | //printf("draw phantom xwidget at:%d %d\n",x,y); | ||
| 1182 | //xwidget_composite_draw_phantom (xw, x, y, clipx, clipy); //TODO MVC there will be very few cases of phantoming | ||
| 1183 | } | ||
| 1184 | |||
| 1185 | |||
| 1186 | atm this works as follows: only check if xwidgets are displayed in the | ||
| 1187 | "selected window". if not, hide them or phantom them. | ||
| 1188 | |||
| 1189 | this means valid cases like xwidgets being displayed only once in | ||
| 1190 | non-selected windows, does not work well. they should also be visible | ||
| 1191 | in that case not phantomed. | ||
| 1192 | 1209 | ||
diff --git a/src/ChangeLog b/src/ChangeLog index af9586037d7..5c65159a841 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,17 @@ | |||
| 1 | 2011-08-12 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * xdisp.c (iterate_out_of_display_property): xassert that | ||
| 4 | IT->position is set to within IT->object's boundaries. Break from | ||
| 5 | the loop as soon as EOB is reached; avoids infloops in redisplay | ||
| 6 | when IT->position is set up wrongly due to some bug. Set | ||
| 7 | IT->current to match the bidi iterator unconditionally. | ||
| 8 | (push_display_prop): Allow GET_FROM_STRING as IT->method on | ||
| 9 | entry. Force push_it to save on the stack the current | ||
| 10 | buffer/string position, to be restored by pop_it. Fix flags in | ||
| 11 | the iterator structure wrt the object coming from a display | ||
| 12 | property, as `line-prefix' and `wrap-prefix' are not ``replacing'' | ||
| 13 | properties. (Bug#9284) | ||
| 14 | |||
| 1 | 2011-08-09 Andreas Schwab <schwab@linux-m68k.org> | 15 | 2011-08-09 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 16 | ||
| 3 | * fontset.c (fontset_get_font_group): Add proper type checks. | 17 | * fontset.c (fontset_get_font_group): Add proper type checks. |
diff --git a/src/xdisp.c b/src/xdisp.c index b58c8da8203..ea5d1ae34c8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5356,6 +5356,8 @@ iterate_out_of_display_property (struct it *it) | |||
| 5356 | EMACS_INT eob = (buffer_p ? ZV : it->end_charpos); | 5356 | EMACS_INT eob = (buffer_p ? ZV : it->end_charpos); |
| 5357 | EMACS_INT bob = (buffer_p ? BEGV : 0); | 5357 | EMACS_INT bob = (buffer_p ? BEGV : 0); |
| 5358 | 5358 | ||
| 5359 | xassert (eob >= CHARPOS (it->position) && CHARPOS (it->position) >= bob); | ||
| 5360 | |||
| 5359 | /* Maybe initialize paragraph direction. If we are at the beginning | 5361 | /* Maybe initialize paragraph direction. If we are at the beginning |
| 5360 | of a new paragraph, next_element_from_buffer may not have a | 5362 | of a new paragraph, next_element_from_buffer may not have a |
| 5361 | chance to do that. */ | 5363 | chance to do that. */ |
| @@ -5364,7 +5366,8 @@ iterate_out_of_display_property (struct it *it) | |||
| 5364 | /* prev_stop can be zero, so check against BEGV as well. */ | 5366 | /* prev_stop can be zero, so check against BEGV as well. */ |
| 5365 | while (it->bidi_it.charpos >= bob | 5367 | while (it->bidi_it.charpos >= bob |
| 5366 | && it->prev_stop <= it->bidi_it.charpos | 5368 | && it->prev_stop <= it->bidi_it.charpos |
| 5367 | && it->bidi_it.charpos < CHARPOS (it->position)) | 5369 | && it->bidi_it.charpos < CHARPOS (it->position) |
| 5370 | && it->bidi_it.charpos < eob) | ||
| 5368 | bidi_move_to_visually_next (&it->bidi_it); | 5371 | bidi_move_to_visually_next (&it->bidi_it); |
| 5369 | /* Record the stop_pos we just crossed, for when we cross it | 5372 | /* Record the stop_pos we just crossed, for when we cross it |
| 5370 | back, maybe. */ | 5373 | back, maybe. */ |
| @@ -5373,14 +5376,11 @@ iterate_out_of_display_property (struct it *it) | |||
| 5373 | /* If we ended up not where pop_it put us, resync IT's | 5376 | /* If we ended up not where pop_it put us, resync IT's |
| 5374 | positional members with the bidi iterator. */ | 5377 | positional members with the bidi iterator. */ |
| 5375 | if (it->bidi_it.charpos != CHARPOS (it->position)) | 5378 | if (it->bidi_it.charpos != CHARPOS (it->position)) |
| 5376 | { | 5379 | SET_TEXT_POS (it->position, it->bidi_it.charpos, it->bidi_it.bytepos); |
| 5377 | SET_TEXT_POS (it->position, | 5380 | if (buffer_p) |
| 5378 | it->bidi_it.charpos, it->bidi_it.bytepos); | 5381 | it->current.pos = it->position; |
| 5379 | if (buffer_p) | 5382 | else |
| 5380 | it->current.pos = it->position; | 5383 | it->current.string_pos = it->position; |
| 5381 | else | ||
| 5382 | it->current.string_pos = it->position; | ||
| 5383 | } | ||
| 5384 | } | 5384 | } |
| 5385 | 5385 | ||
| 5386 | /* Restore IT's settings from IT->stack. Called, for example, when no | 5386 | /* Restore IT's settings from IT->stack. Called, for example, when no |
| @@ -18161,16 +18161,25 @@ cursor_row_p (struct glyph_row *row) | |||
| 18161 | 18161 | ||
| 18162 | 18162 | ||
| 18163 | 18163 | ||
| 18164 | /* Push the display property PROP so that it will be rendered at the | 18164 | /* Push the property PROP so that it will be rendered at the current |
| 18165 | current position in IT. Return 1 if PROP was successfully pushed, | 18165 | position in IT. Return 1 if PROP was successfully pushed, 0 |
| 18166 | 0 otherwise. */ | 18166 | otherwise. Called from handle_line_prefix to handle the |
| 18167 | `line-prefix' and `wrap-prefix' properties. */ | ||
| 18167 | 18168 | ||
| 18168 | static int | 18169 | static int |
| 18169 | push_display_prop (struct it *it, Lisp_Object prop) | 18170 | push_display_prop (struct it *it, Lisp_Object prop) |
| 18170 | { | 18171 | { |
| 18171 | xassert (it->method == GET_FROM_BUFFER); | 18172 | struct text_pos pos = |
| 18173 | (it->method == GET_FROM_STRING) ? it->current.string_pos : it->current.pos; | ||
| 18172 | 18174 | ||
| 18173 | push_it (it, NULL); | 18175 | xassert (it->method == GET_FROM_BUFFER |
| 18176 | || it->method == GET_FROM_STRING); | ||
| 18177 | |||
| 18178 | /* We need to save the current buffer/string position, so it will be | ||
| 18179 | restored by pop_it, because iterate_out_of_display_property | ||
| 18180 | depends on that being set correctly, but some situations leave | ||
| 18181 | it->position not yet set when this function is called. */ | ||
| 18182 | push_it (it, &pos); | ||
| 18174 | 18183 | ||
| 18175 | if (STRINGP (prop)) | 18184 | if (STRINGP (prop)) |
| 18176 | { | 18185 | { |
| @@ -18189,11 +18198,9 @@ push_display_prop (struct it *it, Lisp_Object prop) | |||
| 18189 | it->stop_charpos = 0; | 18198 | it->stop_charpos = 0; |
| 18190 | it->prev_stop = 0; | 18199 | it->prev_stop = 0; |
| 18191 | it->base_level_stop = 0; | 18200 | it->base_level_stop = 0; |
| 18192 | it->string_from_display_prop_p = 1; | ||
| 18193 | it->from_disp_prop_p = 1; | ||
| 18194 | 18201 | ||
| 18195 | /* Force paragraph direction to be that of the parent | 18202 | /* Force paragraph direction to be that of the parent |
| 18196 | buffer. */ | 18203 | buffer/string. */ |
| 18197 | if (it->bidi_p && it->bidi_it.paragraph_dir == R2L) | 18204 | if (it->bidi_p && it->bidi_it.paragraph_dir == R2L) |
| 18198 | it->paragraph_embedding = it->bidi_it.paragraph_dir; | 18205 | it->paragraph_embedding = it->bidi_it.paragraph_dir; |
| 18199 | else | 18206 | else |
| @@ -18206,7 +18213,7 @@ push_display_prop (struct it *it, Lisp_Object prop) | |||
| 18206 | it->bidi_it.string.s = NULL; | 18213 | it->bidi_it.string.s = NULL; |
| 18207 | it->bidi_it.string.schars = it->end_charpos; | 18214 | it->bidi_it.string.schars = it->end_charpos; |
| 18208 | it->bidi_it.string.bufpos = IT_CHARPOS (*it); | 18215 | it->bidi_it.string.bufpos = IT_CHARPOS (*it); |
| 18209 | it->bidi_it.string.from_disp_str = 1; | 18216 | it->bidi_it.string.from_disp_str = it->string_from_display_prop_p; |
| 18210 | it->bidi_it.string.unibyte = !it->multibyte_p; | 18217 | it->bidi_it.string.unibyte = !it->multibyte_p; |
| 18211 | bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it); | 18218 | bidi_init_it (0, 0, FRAME_WINDOW_P (it->f), &it->bidi_it); |
| 18212 | } | 18219 | } |