diff options
| author | Joakim Verona | 2011-07-18 01:26:27 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-07-18 01:26:27 +0200 |
| commit | e9e9f8a3ff2ed8851e8ef1997d3a3911dbecd00d (patch) | |
| tree | e86f8c262138738eee7172e27e4cbf6bcb3273e8 | |
| parent | b0ec5b0839c3f2687b4dddc385ae22b72f96db99 (diff) | |
| download | emacs-e9e9f8a3ff2ed8851e8ef1997d3a3911dbecd00d.tar.gz emacs-e9e9f8a3ff2ed8851e8ef1997d3a3911dbecd00d.zip | |
cleanups
| -rw-r--r-- | lisp/xwidget.el | 9 | ||||
| -rw-r--r-- | src/dispextern.h | 6 | ||||
| -rw-r--r-- | src/dispnew.c | 14 | ||||
| -rw-r--r-- | src/emacs.c | 1 | ||||
| -rw-r--r-- | src/emacsgtkfixed.c | 6 | ||||
| -rw-r--r-- | src/gtkutil.c | 4 | ||||
| -rw-r--r-- | src/keyboard.c | 5 | ||||
| -rw-r--r-- | src/window.c | 1 | ||||
| -rw-r--r-- | src/xdisp.c | 43 | ||||
| -rw-r--r-- | src/xterm.c | 18 | ||||
| -rw-r--r-- | src/xwidget.c | 147 | ||||
| -rw-r--r-- | src/xwidget.h | 2 |
12 files changed, 105 insertions, 151 deletions
diff --git a/lisp/xwidget.el b/lisp/xwidget.el index 3ef379c4ffe..967577a4e98 100644 --- a/lisp/xwidget.el +++ b/lisp/xwidget.el | |||
| @@ -97,4 +97,13 @@ defaults to the string looking like a url around the cursor position." | |||
| 97 | ;; (declare-function xwidget-resize-internal "xwidget.c" ) | 97 | ;; (declare-function xwidget-resize-internal "xwidget.c" ) |
| 98 | ;; check-declare-function? | 98 | ;; check-declare-function? |
| 99 | 99 | ||
| 100 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
| 101 | (defun xwidget-cleanup () | ||
| 102 | ;;its still pretty easy to trigger bugs with xwidgets. | ||
| 103 | ;;this function tries to implement a workaround | ||
| 104 | (interactive) | ||
| 105 | (xwidget-delete-zombies) ;;kill xviews who should have been deleted but stull linger | ||
| 106 | (redraw-display);;redraw display otherwise ghost of zombies will remain to haunt the screen | ||
| 107 | ) | ||
| 108 | |||
| 100 | (provide 'xwidget) | 109 | (provide 'xwidget) |
diff --git a/src/dispextern.h b/src/dispextern.h index ec1bdab815c..b8ef4656220 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -23,6 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 23 | #define DISPEXTERN_H_INCLUDED | 23 | #define DISPEXTERN_H_INCLUDED |
| 24 | 24 | ||
| 25 | #ifdef HAVE_X_WINDOWS | 25 | #ifdef HAVE_X_WINDOWS |
| 26 | |||
| 26 | #include <X11/Xlib.h> | 27 | #include <X11/Xlib.h> |
| 27 | #ifdef USE_X_TOOLKIT | 28 | #ifdef USE_X_TOOLKIT |
| 28 | #include <X11/Intrinsic.h> | 29 | #include <X11/Intrinsic.h> |
| @@ -118,7 +119,7 @@ enum window_part | |||
| 118 | 119 | ||
| 119 | /* If GLYPH_DEBUG is non-zero, additional checks are activated. Turn | 120 | /* If GLYPH_DEBUG is non-zero, additional checks are activated. Turn |
| 120 | it off by defining the macro GLYPH_DEBUG to zero. */ | 121 | it off by defining the macro GLYPH_DEBUG to zero. */ |
| 121 | #define GLYPH_DEBUG 1 | 122 | |
| 122 | #ifndef GLYPH_DEBUG | 123 | #ifndef GLYPH_DEBUG |
| 123 | #define GLYPH_DEBUG 0 | 124 | #define GLYPH_DEBUG 0 |
| 124 | #endif | 125 | #endif |
| @@ -436,7 +437,7 @@ struct glyph | |||
| 436 | int img_id; | 437 | int img_id; |
| 437 | 438 | ||
| 438 | struct xwidget* xwidget; | 439 | struct xwidget* xwidget; |
| 439 | 440 | ||
| 440 | /* Sub-structure for type == STRETCH_GLYPH. */ | 441 | /* Sub-structure for type == STRETCH_GLYPH. */ |
| 441 | struct | 442 | struct |
| 442 | { | 443 | { |
| @@ -2396,7 +2397,6 @@ struct it | |||
| 2396 | /* If what == IT_XWIDGET*/ | 2397 | /* If what == IT_XWIDGET*/ |
| 2397 | struct xwidget* xwidget; | 2398 | struct xwidget* xwidget; |
| 2398 | 2399 | ||
| 2399 | |||
| 2400 | /* Values from `slice' property. */ | 2400 | /* Values from `slice' property. */ |
| 2401 | struct it_slice slice; | 2401 | struct it_slice slice; |
| 2402 | 2402 | ||
diff --git a/src/dispnew.c b/src/dispnew.c index bfd4b3a7ecf..7b20979e45d 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -295,7 +295,6 @@ static void add_frame_display_history (struct frame *, int); | |||
| 295 | has been constructed. PAUSED_P non-zero means that the update | 295 | has been constructed. PAUSED_P non-zero means that the update |
| 296 | has been interrupted for pending input. */ | 296 | has been interrupted for pending input. */ |
| 297 | 297 | ||
| 298 | |||
| 299 | static void | 298 | static void |
| 300 | add_window_display_history (struct window *w, const char *msg, int paused_p) | 299 | add_window_display_history (struct window *w, const char *msg, int paused_p) |
| 301 | { | 300 | { |
| @@ -305,7 +304,7 @@ add_window_display_history (struct window *w, const char *msg, int paused_p) | |||
| 305 | history_idx = 0; | 304 | history_idx = 0; |
| 306 | buf = redisplay_history[history_idx].trace; | 305 | buf = redisplay_history[history_idx].trace; |
| 307 | ++history_idx; | 306 | ++history_idx; |
| 308 | /* glyph debug seems broken | 307 | |
| 309 | sprintf (buf, "%d: window %p (`%s')%s\n", | 308 | sprintf (buf, "%d: window %p (`%s')%s\n", |
| 310 | history_tick++, | 309 | history_tick++, |
| 311 | w, | 310 | w, |
| @@ -314,9 +313,8 @@ add_window_display_history (struct window *w, const char *msg, int paused_p) | |||
| 314 | ? SSDATA (BVAR (XBUFFER (w->buffer), name)) | 313 | ? SSDATA (BVAR (XBUFFER (w->buffer), name)) |
| 315 | : "???"), | 314 | : "???"), |
| 316 | paused_p ? " ***paused***" : ""); | 315 | paused_p ? " ***paused***" : ""); |
| 317 | */ | ||
| 318 | strcat (buf, msg); | ||
| 319 | 316 | ||
| 317 | strcat (buf, msg); | ||
| 320 | } | 318 | } |
| 321 | 319 | ||
| 322 | 320 | ||
| @@ -3383,7 +3381,6 @@ update_single_window (struct window *w, int force_p) | |||
| 3383 | { | 3381 | { |
| 3384 | if (w->must_be_updated_p) | 3382 | if (w->must_be_updated_p) |
| 3385 | { | 3383 | { |
| 3386 | printf("window %d must be updated\n"); | ||
| 3387 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 3384 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 3388 | 3385 | ||
| 3389 | /* Record that this is not a frame-based redisplay. */ | 3386 | /* Record that this is not a frame-based redisplay. */ |
| @@ -3740,10 +3737,9 @@ update_window (struct window *w, int force_p) | |||
| 3740 | add_window_display_history (w, w->current_matrix->method, paused_p); | 3737 | add_window_display_history (w, w->current_matrix->method, paused_p); |
| 3741 | #endif | 3738 | #endif |
| 3742 | 3739 | ||
| 3743 | 3740 | // if ((XWINDOW(FRAME_SELECTED_WINDOW (SELECTED_FRAME()))) == (w)) | |
| 3744 | if ((XWINDOW(FRAME_SELECTED_WINDOW (SELECTED_FRAME()))) == (w)) | 3741 | xwidget_end_redisplay(w, w->current_matrix); |
| 3745 | xwidget_end_redisplay(w->current_matrix); | 3742 | |
| 3746 | |||
| 3747 | clear_glyph_matrix (desired_matrix); | 3743 | clear_glyph_matrix (desired_matrix); |
| 3748 | 3744 | ||
| 3749 | return paused_p; | 3745 | return paused_p; |
diff --git a/src/emacs.c b/src/emacs.c index 1de10c0b5dc..ecf372d40ad 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -49,7 +49,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 49 | #include "window.h" | 49 | #include "window.h" |
| 50 | 50 | ||
| 51 | #include "xwidget.h" | 51 | #include "xwidget.h" |
| 52 | |||
| 53 | #include "systty.h" | 52 | #include "systty.h" |
| 54 | #include "blockinput.h" | 53 | #include "blockinput.h" |
| 55 | #include "syssignal.h" | 54 | #include "syssignal.h" |
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index e7d1690605c..5a0e57d0146 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c | |||
| @@ -42,8 +42,6 @@ static void emacs_fixed_get_preferred_height (GtkWidget *widget, | |||
| 42 | gint *natural); | 42 | gint *natural); |
| 43 | G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED) | 43 | G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED) |
| 44 | 44 | ||
| 45 | |||
| 46 | |||
| 47 | void aloc_callback(GtkWidget* child, GtkWidget* fixed){ | 45 | void aloc_callback(GtkWidget* child, GtkWidget* fixed){ |
| 48 | GtkAllocation child_allocation; | 46 | GtkAllocation child_allocation; |
| 49 | GtkRequisition child_requisition; | 47 | GtkRequisition child_requisition; |
| @@ -76,7 +74,7 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget, | |||
| 76 | parent_class = g_type_class_peek_parent (klass); | 74 | parent_class = g_type_class_peek_parent (klass); |
| 77 | parent_class->size_allocate (widget, allocation); | 75 | parent_class->size_allocate (widget, allocation); |
| 78 | 76 | ||
| 79 | 77 | ||
| 80 | //then modify allocations | 78 | //then modify allocations |
| 81 | gtk_container_foreach (widget, | 79 | gtk_container_foreach (widget, |
| 82 | aloc_callback, | 80 | aloc_callback, |
| @@ -97,9 +95,7 @@ emacs_fixed_class_init (EmacsFixedClass *klass) | |||
| 97 | 95 | ||
| 98 | widget_class->get_preferred_width = emacs_fixed_get_preferred_width; | 96 | widget_class->get_preferred_width = emacs_fixed_get_preferred_width; |
| 99 | widget_class->get_preferred_height = emacs_fixed_get_preferred_height; | 97 | widget_class->get_preferred_height = emacs_fixed_get_preferred_height; |
| 100 | |||
| 101 | widget_class->size_allocate = emacs_fixed_gtk_widget_size_allocate; | 98 | widget_class->size_allocate = emacs_fixed_gtk_widget_size_allocate; |
| 102 | |||
| 103 | g_type_class_add_private (klass, sizeof (EmacsFixedPrivate)); | 99 | g_type_class_add_private (klass, sizeof (EmacsFixedPrivate)); |
| 104 | } | 100 | } |
| 105 | 101 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 1a16246f2b8..c4b5feb9f25 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1078,10 +1078,6 @@ delete_cb (GtkWidget *widget, | |||
| 1078 | /* Create and set up the GTK widgets for frame F. | 1078 | /* Create and set up the GTK widgets for frame F. |
| 1079 | Return 0 if creation failed, non-zero otherwise. */ | 1079 | Return 0 if creation failed, non-zero otherwise. */ |
| 1080 | 1080 | ||
| 1081 | |||
| 1082 | |||
| 1083 | |||
| 1084 | |||
| 1085 | int | 1081 | int |
| 1086 | xg_create_frame_widgets (FRAME_PTR f) | 1082 | xg_create_frame_widgets (FRAME_PTR f) |
| 1087 | { | 1083 | { |
diff --git a/src/keyboard.c b/src/keyboard.c index 60c6283dab5..62de68cbf74 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -5906,8 +5906,6 @@ make_lispy_event (struct input_event *event) | |||
| 5906 | return apply_modifiers (event->modifiers, event->arg); | 5906 | return apply_modifiers (event->modifiers, event->arg); |
| 5907 | return event->arg; | 5907 | return event->arg; |
| 5908 | 5908 | ||
| 5909 | |||
| 5910 | |||
| 5911 | case USER_SIGNAL_EVENT: | 5909 | case USER_SIGNAL_EVENT: |
| 5912 | /* A user signal. */ | 5910 | /* A user signal. */ |
| 5913 | { | 5911 | { |
| @@ -11548,8 +11546,6 @@ syms_of_keyboard (void) | |||
| 11548 | Qxwidget_event = intern ("xwidget-event"); | 11546 | Qxwidget_event = intern ("xwidget-event"); |
| 11549 | staticpro (&Qxwidget_event); | 11547 | staticpro (&Qxwidget_event); |
| 11550 | 11548 | ||
| 11551 | |||
| 11552 | |||
| 11553 | DEFSYM (QCenable, ":enable"); | 11549 | DEFSYM (QCenable, ":enable"); |
| 11554 | DEFSYM (QCvisible, ":visible"); | 11550 | DEFSYM (QCvisible, ":visible"); |
| 11555 | DEFSYM (QChelp, ":help"); | 11551 | DEFSYM (QChelp, ":help"); |
| @@ -11567,7 +11563,6 @@ syms_of_keyboard (void) | |||
| 11567 | DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar"); | 11563 | DEFSYM (Qvertical_scroll_bar, "vertical-scroll-bar"); |
| 11568 | DEFSYM (Qmenu_bar, "menu-bar"); | 11564 | DEFSYM (Qmenu_bar, "menu-bar"); |
| 11569 | 11565 | ||
| 11570 | |||
| 11571 | #if defined (HAVE_MOUSE) || defined (HAVE_GPM) | 11566 | #if defined (HAVE_MOUSE) || defined (HAVE_GPM) |
| 11572 | DEFSYM (Qmouse_fixup_help_message, "mouse-fixup-help-message"); | 11567 | DEFSYM (Qmouse_fixup_help_message, "mouse-fixup-help-message"); |
| 11573 | #endif | 11568 | #endif |
diff --git a/src/window.c b/src/window.c index d39efa8071d..14ebc89e04e 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -51,7 +51,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 51 | #endif | 51 | #endif |
| 52 | 52 | ||
| 53 | #include "xwidget.h" | 53 | #include "xwidget.h" |
| 54 | |||
| 55 | Lisp_Object Qwindowp, Qwindow_live_p; | 54 | Lisp_Object Qwindowp, Qwindow_live_p; |
| 56 | static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; | 55 | static Lisp_Object Qwindow_configuration_p, Qrecord_window_buffer; |
| 57 | static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; | 56 | static Lisp_Object Qwindow_deletable_p, Qdelete_window, Qdisplay_buffer; |
diff --git a/src/xdisp.c b/src/xdisp.c index 8003eb3e9d5..cd87d00d8d0 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -315,7 +315,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 315 | #include "font.h" | 315 | #include "font.h" |
| 316 | 316 | ||
| 317 | #include "xwidget.h" | 317 | #include "xwidget.h" |
| 318 | |||
| 319 | #ifndef FRAME_X_OUTPUT | 318 | #ifndef FRAME_X_OUTPUT |
| 320 | #define FRAME_X_OUTPUT(f) ((f)->output_data.x) | 319 | #define FRAME_X_OUTPUT(f) ((f)->output_data.x) |
| 321 | #endif | 320 | #endif |
| @@ -4083,7 +4082,7 @@ handle_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4083 | if (CONSP (spec) | 4082 | if (CONSP (spec) |
| 4084 | /* Simple specerties. */ | 4083 | /* Simple specerties. */ |
| 4085 | && !EQ (XCAR (spec), Qimage) | 4084 | && !EQ (XCAR (spec), Qimage) |
| 4086 | && !EQ (XCAR (spec), Qxwidget) | 4085 | && !EQ (XCAR (spec), Qxwidget) |
| 4087 | && !EQ (XCAR (spec), Qspace) | 4086 | && !EQ (XCAR (spec), Qspace) |
| 4088 | && !EQ (XCAR (spec), Qwhen) | 4087 | && !EQ (XCAR (spec), Qwhen) |
| 4089 | && !EQ (XCAR (spec), Qslice) | 4088 | && !EQ (XCAR (spec), Qslice) |
| @@ -4189,7 +4188,6 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4189 | Lisp_Object location, value; | 4188 | Lisp_Object location, value; |
| 4190 | struct text_pos start_pos = *position; | 4189 | struct text_pos start_pos = *position; |
| 4191 | int valid_p; | 4190 | int valid_p; |
| 4192 | //printf("handle_single_display_spec:\n"); | ||
| 4193 | 4191 | ||
| 4194 | /* If SPEC is a list of the form `(when FORM . VALUE)', evaluate FORM. | 4192 | /* If SPEC is a list of the form `(when FORM . VALUE)', evaluate FORM. |
| 4195 | If the result is non-nil, use VALUE instead of SPEC. */ | 4193 | If the result is non-nil, use VALUE instead of SPEC. */ |
| @@ -4497,22 +4495,13 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4497 | LOCATION specifies where to display: `left-margin', | 4495 | LOCATION specifies where to display: `left-margin', |
| 4498 | `right-margin' or nil. */ | 4496 | `right-margin' or nil. */ |
| 4499 | 4497 | ||
| 4500 | /* | ||
| 4501 | printf("handle_single_display_spec xwidgetp:%d imagep:%d spacep:%d display_replaced_before_p:%d stringp:%d\n", | ||
| 4502 | XWIDGETP(value), | ||
| 4503 | valid_image_p (value), | ||
| 4504 | (CONSP (value) && EQ (XCAR (value), Qspace)), | ||
| 4505 | display_replaced_before_p, | ||
| 4506 | STRINGP (value)); | ||
| 4507 | */ | ||
| 4508 | valid_p = (STRINGP (value) | 4498 | valid_p = (STRINGP (value) |
| 4509 | #ifdef HAVE_WINDOW_SYSTEM | 4499 | #ifdef HAVE_WINDOW_SYSTEM |
| 4510 | || ((it ? FRAME_WINDOW_P (it->f) : frame_window_p) | 4500 | || ((it ? FRAME_WINDOW_P (it->f) : frame_window_p) |
| 4511 | && valid_image_p (value)) | 4501 | && valid_image_p (value)) |
| 4512 | #endif /* not HAVE_WINDOW_SYSTEM */ | 4502 | #endif /* not HAVE_WINDOW_SYSTEM */ |
| 4513 | || (CONSP (value) && EQ (XCAR (value), Qspace)) | 4503 | || (CONSP (value) && EQ (XCAR (value), Qspace)) |
| 4514 | || XWIDGETP(value) | 4504 | || XWIDGETP(value)); |
| 4515 | ); | ||
| 4516 | 4505 | ||
| 4517 | if (valid_p && !display_replaced_p) | 4506 | if (valid_p && !display_replaced_p) |
| 4518 | { | 4507 | { |
| @@ -4586,7 +4575,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4586 | *position = start_pos; | 4575 | *position = start_pos; |
| 4587 | 4576 | ||
| 4588 | it->xwidget = lookup_xwidget(value); | 4577 | it->xwidget = lookup_xwidget(value); |
| 4589 | } | 4578 | } |
| 4590 | #ifdef HAVE_WINDOW_SYSTEM | 4579 | #ifdef HAVE_WINDOW_SYSTEM |
| 4591 | else //if nothing else, its an image | 4580 | else //if nothing else, its an image |
| 4592 | { | 4581 | { |
| @@ -4612,7 +4601,6 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, | |||
| 4612 | return 0; | 4601 | return 0; |
| 4613 | } | 4602 | } |
| 4614 | 4603 | ||
| 4615 | |||
| 4616 | /* Check if PROP is a display property value whose text should be | 4604 | /* Check if PROP is a display property value whose text should be |
| 4617 | treated as intangible. OVERLAY is the overlay from which PROP | 4605 | treated as intangible. OVERLAY is the overlay from which PROP |
| 4618 | came, or nil if it came from a text property. CHARPOS and BYTEPOS | 4606 | came, or nil if it came from a text property. CHARPOS and BYTEPOS |
| @@ -5306,7 +5294,6 @@ push_it (struct it *it, struct text_pos *position) | |||
| 5306 | case GET_FROM_XWIDGET: | 5294 | case GET_FROM_XWIDGET: |
| 5307 | p->u.xwidget.object = it->object; | 5295 | p->u.xwidget.object = it->object; |
| 5308 | break; | 5296 | break; |
| 5309 | |||
| 5310 | } | 5297 | } |
| 5311 | p->position = position ? *position : it->position; | 5298 | p->position = position ? *position : it->position; |
| 5312 | p->current = it->current; | 5299 | p->current = it->current; |
| @@ -11846,7 +11833,7 @@ debug_method_add (struct window *w, char const *fmt, ...) | |||
| 11846 | } | 11833 | } |
| 11847 | 11834 | ||
| 11848 | strncpy (method + len, buffer, remaining); | 11835 | strncpy (method + len, buffer, remaining); |
| 11849 | /* glyph debug broken | 11836 | |
| 11850 | if (trace_redisplay_p) | 11837 | if (trace_redisplay_p) |
| 11851 | fprintf (stderr, "%p (%s): %s\n", | 11838 | fprintf (stderr, "%p (%s): %s\n", |
| 11852 | w, | 11839 | w, |
| @@ -11855,7 +11842,6 @@ debug_method_add (struct window *w, char const *fmt, ...) | |||
| 11855 | ? SSDATA (BVAR (XBUFFER (w->buffer), name)) | 11842 | ? SSDATA (BVAR (XBUFFER (w->buffer), name)) |
| 11856 | : "no buffer"), | 11843 | : "no buffer"), |
| 11857 | buffer); | 11844 | buffer); |
| 11858 | */ | ||
| 11859 | } | 11845 | } |
| 11860 | 11846 | ||
| 11861 | #endif /* GLYPH_DEBUG */ | 11847 | #endif /* GLYPH_DEBUG */ |
| @@ -12223,9 +12209,6 @@ redisplay_internal (void) | |||
| 12223 | frames. Zero means, only selected_window is considered. */ | 12209 | frames. Zero means, only selected_window is considered. */ |
| 12224 | int consider_all_windows_p; | 12210 | int consider_all_windows_p; |
| 12225 | 12211 | ||
| 12226 | //printf(">>>>redisplay\n"); | ||
| 12227 | // xwidget_start_redisplay(); | ||
| 12228 | |||
| 12229 | TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p)); | 12212 | TRACE ((stderr, "redisplay_internal %d\n", redisplaying_p)); |
| 12230 | 12213 | ||
| 12231 | /* No redisplay if running in batch mode or frame is not yet fully | 12214 | /* No redisplay if running in batch mode or frame is not yet fully |
| @@ -12944,9 +12927,6 @@ redisplay_internal (void) | |||
| 12944 | end_of_redisplay: | 12927 | end_of_redisplay: |
| 12945 | unbind_to (count, Qnil); | 12928 | unbind_to (count, Qnil); |
| 12946 | RESUME_POLLING; | 12929 | RESUME_POLLING; |
| 12947 | //xwidget_end_redisplay(); | ||
| 12948 | |||
| 12949 | //printf("<<<<redisplay\n"); | ||
| 12950 | } | 12930 | } |
| 12951 | 12931 | ||
| 12952 | 12932 | ||
| @@ -15397,7 +15377,6 @@ try_window (Lisp_Object window, struct text_pos pos, int flags) | |||
| 15397 | struct glyph_row *last_text_row = NULL; | 15377 | struct glyph_row *last_text_row = NULL; |
| 15398 | struct frame *f = XFRAME (w->frame); | 15378 | struct frame *f = XFRAME (w->frame); |
| 15399 | 15379 | ||
| 15400 | |||
| 15401 | /* Make POS the new window start. */ | 15380 | /* Make POS the new window start. */ |
| 15402 | set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos)); | 15381 | set_marker_both (w->start, Qnil, CHARPOS (pos), BYTEPOS (pos)); |
| 15403 | 15382 | ||
| @@ -15408,7 +15387,6 @@ try_window (Lisp_Object window, struct text_pos pos, int flags) | |||
| 15408 | /* Initialize iterator and info to start at POS. */ | 15387 | /* Initialize iterator and info to start at POS. */ |
| 15409 | start_display (&it, w, pos); | 15388 | start_display (&it, w, pos); |
| 15410 | 15389 | ||
| 15411 | |||
| 15412 | /* Display all lines of W. */ | 15390 | /* Display all lines of W. */ |
| 15413 | while (it.current_y < it.last_visible_y) | 15391 | while (it.current_y < it.last_visible_y) |
| 15414 | { | 15392 | { |
| @@ -17117,7 +17095,7 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) | |||
| 17117 | glyph->face_id, | 17095 | glyph->face_id, |
| 17118 | glyph->left_box_line_p, | 17096 | glyph->left_box_line_p, |
| 17119 | glyph->right_box_line_p); | 17097 | glyph->right_box_line_p); |
| 17120 | 17098 | ||
| 17121 | // printf("dump xwidget glyph\n"); | 17099 | // printf("dump xwidget glyph\n"); |
| 17122 | } | 17100 | } |
| 17123 | } | 17101 | } |
| @@ -17495,8 +17473,7 @@ compute_line_metrics (struct it *it) | |||
| 17495 | struct glyph_row *row = it->glyph_row; | 17473 | struct glyph_row *row = it->glyph_row; |
| 17496 | if(row->used[TEXT_AREA] > 1000){ | 17474 | if(row->used[TEXT_AREA] > 1000){ |
| 17497 | printf("compute_line_metrics %d %d %d\n", row->used[TEXT_AREA], it->f->text_cols, row->end.pos.charpos); | 17475 | printf("compute_line_metrics %d %d %d\n", row->used[TEXT_AREA], it->f->text_cols, row->end.pos.charpos); |
| 17498 | printf("row->used[TEXT_AREA] seems weirdly big! therefore dont compute_line_metrics\n"); | 17476 | printf("row->used[TEXT_AREA] seems weirdly big! emacs will crash soon\n"); |
| 17499 | return; | ||
| 17500 | } | 17477 | } |
| 17501 | if (FRAME_WINDOW_P (it->f)) | 17478 | if (FRAME_WINDOW_P (it->f)) |
| 17502 | { | 17479 | { |
| @@ -21227,8 +21204,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, | |||
| 21227 | return OK_PIXELS (width_p ? img->width : img->height); | 21204 | return OK_PIXELS (width_p ? img->width : img->height); |
| 21228 | } | 21205 | } |
| 21229 | 21206 | ||
| 21230 | if (FRAME_WINDOW_P (it->f) | 21207 | if (FRAME_WINDOW_P (it->f) && valid_xwidget_p (prop)) |
| 21231 | && valid_xwidget_p (prop)) | ||
| 21232 | { | 21208 | { |
| 21233 | printf("calc_pixel_width_or_height: return dummy size FIXME\n"); | 21209 | printf("calc_pixel_width_or_height: return dummy size FIXME\n"); |
| 21234 | return OK_PIXELS (width_p ? 100 : 100); | 21210 | return OK_PIXELS (width_p ? 100 : 100); |
| @@ -21740,7 +21716,6 @@ fill_xwidget_glyph_string (struct glyph_string *s) | |||
| 21740 | //assert_valid_xwidget_id ( s->xwidget, "fill_xwidget_glyph_string"); | 21716 | //assert_valid_xwidget_id ( s->xwidget, "fill_xwidget_glyph_string"); |
| 21741 | } | 21717 | } |
| 21742 | 21718 | ||
| 21743 | |||
| 21744 | /* Fill glyph string S from a sequence of stretch glyphs. | 21719 | /* Fill glyph string S from a sequence of stretch glyphs. |
| 21745 | 21720 | ||
| 21746 | START is the index of the first glyph to consider, | 21721 | START is the index of the first glyph to consider, |
| @@ -22919,8 +22894,8 @@ produce_xwidget_glyph (struct it *it) | |||
| 22919 | glyph->ascent = glyph_ascent; | 22894 | glyph->ascent = glyph_ascent; |
| 22920 | glyph->descent = it->descent; | 22895 | glyph->descent = it->descent; |
| 22921 | glyph->voffset = it->voffset; | 22896 | glyph->voffset = it->voffset; |
| 22922 | glyph->type = XWIDGET_GLYPH; | 22897 | glyph->type = XWIDGET_GLYPH; |
| 22923 | 22898 | ||
| 22924 | glyph->multibyte_p = it->multibyte_p; | 22899 | glyph->multibyte_p = it->multibyte_p; |
| 22925 | glyph->left_box_line_p = it->start_of_box_run_p; | 22900 | glyph->left_box_line_p = it->start_of_box_run_p; |
| 22926 | glyph->right_box_line_p = it->end_of_box_run_p; | 22901 | glyph->right_box_line_p = it->end_of_box_run_p; |
diff --git a/src/xterm.c b/src/xterm.c index 58b326fc227..a7bdffa8bf3 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -2624,7 +2624,6 @@ x_draw_glyph_string (struct glyph_string *s) | |||
| 2624 | { | 2624 | { |
| 2625 | int relief_drawn_p = 0; | 2625 | int relief_drawn_p = 0; |
| 2626 | 2626 | ||
| 2627 | //printf("x_draw_glyph_string: %d\n",s->first_glyph->type); | ||
| 2628 | /* If S draws into the background of its successors, draw the | 2627 | /* If S draws into the background of its successors, draw the |
| 2629 | background of the successors first so that S can draw into it. | 2628 | background of the successors first so that S can draw into it. |
| 2630 | This makes S->next use XDrawString instead of XDrawImageString. */ | 2629 | This makes S->next use XDrawString instead of XDrawImageString. */ |
| @@ -2685,7 +2684,6 @@ x_draw_glyph_string (struct glyph_string *s) | |||
| 2685 | case XWIDGET_GLYPH: | 2684 | case XWIDGET_GLYPH: |
| 2686 | //erase xwidget background | 2685 | //erase xwidget background |
| 2687 | x_draw_glyph_string_background (s, 0); | 2686 | x_draw_glyph_string_background (s, 0); |
| 2688 | //x_draw_xwidget_glyph_string draws phantom xwidgets only, live xwidgets are drawn in an expose handler | ||
| 2689 | x_draw_xwidget_glyph_string (s); | 2687 | x_draw_xwidget_glyph_string (s); |
| 2690 | break; | 2688 | break; |
| 2691 | 2689 | ||
| @@ -5834,7 +5832,6 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 5834 | inev.ie.kind = NO_EVENT; | 5832 | inev.ie.kind = NO_EVENT; |
| 5835 | inev.ie.arg = Qnil; | 5833 | inev.ie.arg = Qnil; |
| 5836 | 5834 | ||
| 5837 | |||
| 5838 | if (pending_event_wait.eventtype == event.type) | 5835 | if (pending_event_wait.eventtype == event.type) |
| 5839 | pending_event_wait.eventtype = 0; /* Indicates we got it. */ | 5836 | pending_event_wait.eventtype = 0; /* Indicates we got it. */ |
| 5840 | 5837 | ||
| @@ -6321,15 +6318,11 @@ handle_one_xevent (struct x_display_info *dpyinfo, XEvent *eventptr, | |||
| 6321 | Lisp_Object c; | 6318 | Lisp_Object c; |
| 6322 | 6319 | ||
| 6323 | #ifdef USE_GTK | 6320 | #ifdef USE_GTK |
| 6324 | |||
| 6325 | /* Don't pass keys to GTK. A Tab will shift focus to the | 6321 | /* Don't pass keys to GTK. A Tab will shift focus to the |
| 6326 | tool bar in GTK 2.4. Keys will still go to menus and | 6322 | tool bar in GTK 2.4. Keys will still go to menus and |
| 6327 | dialogs because in that case popup_activated is TRUE | 6323 | dialogs because in that case popup_activated is TRUE |
| 6328 | (see above). | 6324 | (see above). */ |
| 6329 | */ | ||
| 6330 | *finish = X_EVENT_DROP; | 6325 | *finish = X_EVENT_DROP; |
| 6331 | |||
| 6332 | |||
| 6333 | #endif | 6326 | #endif |
| 6334 | 6327 | ||
| 6335 | event.xkey.state | 6328 | event.xkey.state |
| @@ -7221,7 +7214,7 @@ x_draw_hollow_cursor (struct window *w, struct glyph_row *row) | |||
| 7221 | cursor_glyph = get_phys_cursor_glyph (w); | 7214 | cursor_glyph = get_phys_cursor_glyph (w); |
| 7222 | if (cursor_glyph == NULL) | 7215 | if (cursor_glyph == NULL) |
| 7223 | return; | 7216 | return; |
| 7224 | 7217 | ||
| 7225 | /* Compute frame-relative coordinates for phys cursor. */ | 7218 | /* Compute frame-relative coordinates for phys cursor. */ |
| 7226 | get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h); | 7219 | get_phys_cursor_geometry (w, row, cursor_glyph, &x, &y, &h); |
| 7227 | wd = w->phys_cursor_width; | 7220 | wd = w->phys_cursor_width; |
| @@ -7266,7 +7259,6 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text | |||
| 7266 | printf("tried avoiding xwidget cursor\n"); | 7259 | printf("tried avoiding xwidget cursor\n"); |
| 7267 | return; //experimental avoidance of cursor on xwidget | 7260 | return; //experimental avoidance of cursor on xwidget |
| 7268 | } | 7261 | } |
| 7269 | |||
| 7270 | /* If on an image, draw like a normal cursor. That's usually better | 7262 | /* If on an image, draw like a normal cursor. That's usually better |
| 7271 | visible than drawing a bar, esp. if the image is large so that | 7263 | visible than drawing a bar, esp. if the image is large so that |
| 7272 | the bar might not be in the window. */ | 7264 | the bar might not be in the window. */ |
| @@ -9899,9 +9891,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name) | |||
| 9899 | | G_LOG_FLAG_RECURSION, my_log_handler, NULL); | 9891 | | G_LOG_FLAG_RECURSION, my_log_handler, NULL); |
| 9900 | #ifdef HAVE_CLUTTER | 9892 | #ifdef HAVE_CLUTTER |
| 9901 | gtk_clutter_init (&argc, &argv2); | 9893 | gtk_clutter_init (&argc, &argv2); |
| 9902 | #else | 9894 | #else |
| 9903 | gtk_init (&argc, &argv2); | 9895 | gtk_init (&argc, &argv2); |
| 9904 | #endif | 9896 | #endif |
| 9905 | g_log_remove_handler ("GLib", id); | 9897 | g_log_remove_handler ("GLib", id); |
| 9906 | 9898 | ||
| 9907 | /* gtk_init does set_locale. We must fix locale after calling it. */ | 9899 | /* gtk_init does set_locale. We must fix locale after calling it. */ |
| @@ -10507,7 +10499,7 @@ static struct redisplay_interface x_redisplay_interface = | |||
| 10507 | x_write_glyphs, | 10499 | x_write_glyphs, |
| 10508 | x_insert_glyphs, | 10500 | x_insert_glyphs, |
| 10509 | x_clear_end_of_line, | 10501 | x_clear_end_of_line, |
| 10510 | x_scroll_run, //maybe xwidgets dont work too well with scrolling by blitting | 10502 | x_scroll_run, |
| 10511 | x_after_update_window_line, | 10503 | x_after_update_window_line, |
| 10512 | x_update_window_begin, | 10504 | x_update_window_begin, |
| 10513 | x_update_window_end, | 10505 | x_update_window_end, |
diff --git a/src/xwidget.c b/src/xwidget.c index 44e1d327729..6a0d3ee4340 100644 --- a/src/xwidget.c +++ b/src/xwidget.c | |||
| @@ -102,7 +102,7 @@ | |||
| 102 | //would need to be hashtables or something | 102 | //would need to be hashtables or something |
| 103 | 103 | ||
| 104 | #define MAX_XWIDGETS 100 | 104 | #define MAX_XWIDGETS 100 |
| 105 | struct xwidget_view xwidget_views[MAX_XWIDGETS]; | 105 | struct xwidget_view xwidget_views[MAX_XWIDGETS]; |
| 106 | 106 | ||
| 107 | //TODO embryo of lisp allocators for xwidgets | 107 | //TODO embryo of lisp allocators for xwidgets |
| 108 | //TODO xwidget* should be Lisp_xwidget* | 108 | //TODO xwidget* should be Lisp_xwidget* |
| @@ -129,12 +129,12 @@ Lisp_Object Qxwidget_info; | |||
| 129 | Lisp_Object Qxwidget_resize; | 129 | Lisp_Object Qxwidget_resize; |
| 130 | Lisp_Object Qxwidget_send_keyboard_event; | 130 | Lisp_Object Qxwidget_send_keyboard_event; |
| 131 | 131 | ||
| 132 | Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, | 132 | Lisp_Object Qbutton, Qtoggle, Qslider, Qsocket, Qcairo, |
| 133 | Qwebkit_osr, QCplist; | 133 | Qwebkit_osr, QCplist; |
| 134 | 134 | ||
| 135 | 135 | ||
| 136 | extern Lisp_Object QCtype; | 136 | extern Lisp_Object QCtype; |
| 137 | extern Lisp_Object QCwidth, QCheight; | 137 | extern Lisp_Object QCwidth, QCheight; |
| 138 | 138 | ||
| 139 | struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window *w); | 139 | struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window *w); |
| 140 | Lisp_Object xwidget_spec_value ( Lisp_Object spec, Lisp_Object key, int *found); | 140 | Lisp_Object xwidget_spec_value ( Lisp_Object spec, Lisp_Object key, int *found); |
| @@ -145,7 +145,7 @@ DEFUN ("make-xwidget", Fmake_xwidget, Smake_xwidget, 7, 7, 0, | |||
| 145 | ) | 145 | ) |
| 146 | (Lisp_Object beg, Lisp_Object end, | 146 | (Lisp_Object beg, Lisp_Object end, |
| 147 | Lisp_Object type, | 147 | Lisp_Object type, |
| 148 | Lisp_Object title, | 148 | Lisp_Object title, |
| 149 | Lisp_Object width, Lisp_Object height, | 149 | Lisp_Object width, Lisp_Object height, |
| 150 | Lisp_Object data) | 150 | Lisp_Object data) |
| 151 | { | 151 | { |
| @@ -158,7 +158,7 @@ DEFUN ("make-xwidget", Fmake_xwidget, Smake_xwidget, 7, 7, 0, | |||
| 158 | struct gcpro gcpro1; | 158 | struct gcpro gcpro1; |
| 159 | GCPRO1(xw); | 159 | GCPRO1(xw); |
| 160 | XSETSYMBOL(xw->type, type); | 160 | XSETSYMBOL(xw->type, type); |
| 161 | XSETSTRING(xw->title, title); | 161 | XSETSTRING(xw->title, title); |
| 162 | XSETBUFFER(xw->buffer, Fcurrent_buffer()); // conservatively gcpro xw since we call lisp | 162 | XSETBUFFER(xw->buffer, Fcurrent_buffer()); // conservatively gcpro xw since we call lisp |
| 163 | xw->height = XFASTINT(height); | 163 | xw->height = XFASTINT(height); |
| 164 | xw->width = XFASTINT(width); | 164 | xw->width = XFASTINT(width); |
| @@ -180,21 +180,21 @@ DEFUN ("make-xwidget", Fmake_xwidget, Smake_xwidget, 7, 7, 0, | |||
| 180 | gtk_window_resize( GTK_WINDOW(xw->widgetwindow_osr), xw->width, xw->height); | 180 | gtk_window_resize( GTK_WINDOW(xw->widgetwindow_osr), xw->width, xw->height); |
| 181 | xw->widget_osr = webkit_web_view_new(); | 181 | xw->widget_osr = webkit_web_view_new(); |
| 182 | 182 | ||
| 183 | gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); | 183 | gtk_widget_set_size_request (GTK_WIDGET (xw->widget_osr), xw->width, xw->height); |
| 184 | gtk_container_add (xw->widgetwindow_osr, xw->widget_osr); | 184 | gtk_container_add (xw->widgetwindow_osr, xw->widget_osr); |
| 185 | 185 | ||
| 186 | gtk_widget_show_all (GTK_WIDGET (xw->widgetwindow_osr)); | 186 | gtk_widget_show_all (GTK_WIDGET (xw->widgetwindow_osr)); |
| 187 | 187 | ||
| 188 | /* store some xwidget data in the gtk widgets for convenient retrieval in the event handlers. */ | 188 | /* store some xwidget data in the gtk widgets for convenient retrieval in the event handlers. */ |
| 189 | g_object_set_data (G_OBJECT (xw->widget_osr), XG_XWIDGET, (gpointer) (xw)); | 189 | g_object_set_data (G_OBJECT (xw->widget_osr), XG_XWIDGET, (gpointer) (xw)); |
| 190 | g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, (gpointer) (xw)); | 190 | g_object_set_data (G_OBJECT (xw->widgetwindow_osr), XG_XWIDGET, (gpointer) (xw)); |
| 191 | g_signal_connect (G_OBJECT ( xw->widgetwindow_osr), "damage-event", G_CALLBACK (webkit_osr_damage_event_callback), NULL); | 191 | g_signal_connect (G_OBJECT ( xw->widgetwindow_osr), "damage-event", G_CALLBACK (webkit_osr_damage_event_callback), NULL); |
| 192 | 192 | ||
| 193 | webkit_web_view_load_uri(WEBKIT_WEB_VIEW(xw->widget_osr), "http://www.fsf.org"); | 193 | webkit_web_view_load_uri(WEBKIT_WEB_VIEW(xw->widget_osr), "http://www.fsf.org"); |
| 194 | UNBLOCK_INPUT; | 194 | UNBLOCK_INPUT; |
| 195 | 195 | ||
| 196 | } | 196 | } |
| 197 | #endif | 197 | #endif |
| 198 | 198 | ||
| 199 | 199 | ||
| 200 | UNGCPRO; | 200 | UNGCPRO; |
| @@ -246,7 +246,7 @@ send_xembed_ready_event (struct xwidget* xw, int xembedid) | |||
| 246 | event.arg = Qnil; | 246 | event.arg = Qnil; |
| 247 | event.arg = Fcons (make_number (xembedid), event.arg); | 247 | event.arg = Fcons (make_number (xembedid), event.arg); |
| 248 | event.arg = Fcons (intern ("xembed-ready"), event.arg); | 248 | event.arg = Fcons (intern ("xembed-ready"), event.arg); |
| 249 | event.arg = Fcons (xw, event.arg); //TODO | 249 | event.arg = Fcons (xw, event.arg); //TODO |
| 250 | 250 | ||
| 251 | 251 | ||
| 252 | kbd_buffer_store_event (&event); | 252 | kbd_buffer_store_event (&event); |
| @@ -268,7 +268,7 @@ xwidget_show_view (struct xwidget_view *xv) | |||
| 268 | //printf("xwidget %d shown\n",xw->id); | 268 | //printf("xwidget %d shown\n",xw->id); |
| 269 | xv->hidden = 0; | 269 | xv->hidden = 0; |
| 270 | gtk_widget_show(GTK_WIDGET(xv->widgetwindow)); | 270 | gtk_widget_show(GTK_WIDGET(xv->widgetwindow)); |
| 271 | gtk_fixed_move (GTK_FIXED (xv->emacswindow), GTK_WIDGET (xv->widgetwindow), xv->x + xv->clip_left, xv->y + xv->clip_top); //TODO refactor | 271 | gtk_fixed_move (GTK_FIXED (xv->emacswindow), GTK_WIDGET (xv->widgetwindow), xv->x + xv->clip_left, xv->y + xv->clip_top); //TODO refactor |
| 272 | } | 272 | } |
| 273 | 273 | ||
| 274 | 274 | ||
| @@ -318,7 +318,7 @@ void xwidget_slider_changed (GtkRange *range, | |||
| 318 | 318 | ||
| 319 | printf("slider changed val:%f\n", v); | 319 | printf("slider changed val:%f\n", v); |
| 320 | 320 | ||
| 321 | 321 | ||
| 322 | //block sibling views signal handlers | 322 | //block sibling views signal handlers |
| 323 | for (int i = 0; i < MAX_XWIDGETS; i++) | 323 | for (int i = 0; i < MAX_XWIDGETS; i++) |
| 324 | { | 324 | { |
| @@ -342,7 +342,7 @@ void xwidget_slider_changed (GtkRange *range, | |||
| 342 | 342 | ||
| 343 | /* when the off-screen webkit master view changes this signal is called. | 343 | /* when the off-screen webkit master view changes this signal is called. |
| 344 | it copies the bitmap from the off-screen webkit instance */ | 344 | it copies the bitmap from the off-screen webkit instance */ |
| 345 | gboolean webkit_osr_damage_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data) | 345 | gboolean webkit_osr_damage_event_callback (GtkWidget *widget, GdkEventExpose *event, gpointer data) |
| 346 | { | 346 | { |
| 347 | //TODO this is wrong! should just oueu a redraw of onscreen widget | 347 | //TODO this is wrong! should just oueu a redraw of onscreen widget |
| 348 | struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); | 348 | struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); |
| @@ -358,7 +358,7 @@ gboolean webkit_osr_damage_event_callback (GtkWidget *widget, GdkEventExpose *ev | |||
| 358 | } | 358 | } |
| 359 | 359 | ||
| 360 | return FALSE; | 360 | return FALSE; |
| 361 | } | 361 | } |
| 362 | 362 | ||
| 363 | 363 | ||
| 364 | //for gtk3 webkit_osr | 364 | //for gtk3 webkit_osr |
| @@ -366,8 +366,8 @@ gboolean | |||
| 366 | xwidget_osr_draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) | 366 | xwidget_osr_draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) |
| 367 | { | 367 | { |
| 368 | struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); | 368 | struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); |
| 369 | struct xwidget_view* xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET_VIEW); | 369 | struct xwidget_view* xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET_VIEW); |
| 370 | 370 | ||
| 371 | // printf("xwidget_osr_draw_callback gtk3 xw.id:%d xw.type:%d window:%d vis:%d\n", | 371 | // printf("xwidget_osr_draw_callback gtk3 xw.id:%d xw.type:%d window:%d vis:%d\n", |
| 372 | // xw,xw->type, gtk_widget_get_window (widget), gtk_widget_get_visible (xw->widget_osr)); | 372 | // xw,xw->type, gtk_widget_get_window (widget), gtk_widget_get_visible (xw->widget_osr)); |
| 373 | 373 | ||
| @@ -376,7 +376,7 @@ xwidget_osr_draw_callback (GtkWidget *widget, cairo_t *cr, gpointer data) | |||
| 376 | 376 | ||
| 377 | gtk_widget_draw (xw->widget_osr, cr); | 377 | gtk_widget_draw (xw->widget_osr, cr); |
| 378 | 378 | ||
| 379 | 379 | ||
| 380 | return FALSE; | 380 | return FALSE; |
| 381 | } | 381 | } |
| 382 | 382 | ||
| @@ -386,9 +386,9 @@ xwidget_osr_button_callback ( GtkWidget *widget, | |||
| 386 | GdkEvent *event, | 386 | GdkEvent *event, |
| 387 | gpointer user_data) | 387 | gpointer user_data) |
| 388 | { | 388 | { |
| 389 | struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); | 389 | struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); |
| 390 | GdkEvent* eventcopy = gdk_event_copy(event); | 390 | GdkEvent* eventcopy = gdk_event_copy(event); |
| 391 | 391 | ||
| 392 | ((GdkEventButton*)eventcopy)->window = gtk_widget_get_window(xw->widget_osr); | 392 | ((GdkEventButton*)eventcopy)->window = gtk_widget_get_window(xw->widget_osr); |
| 393 | gtk_main_do_event(eventcopy); //TODO this will leak events. they should be deallocated later | 393 | gtk_main_do_event(eventcopy); //TODO this will leak events. they should be deallocated later |
| 394 | } | 394 | } |
| @@ -397,7 +397,7 @@ int xwidget_view_index=0; | |||
| 397 | 397 | ||
| 398 | /* initializes and does initial placement of an xwidget view on screen */ | 398 | /* initializes and does initial placement of an xwidget view on screen */ |
| 399 | struct xwidget_view* | 399 | struct xwidget_view* |
| 400 | xwidget_init_view ( | 400 | xwidget_init_view ( |
| 401 | struct xwidget *xww, | 401 | struct xwidget *xww, |
| 402 | struct glyph_string *s, | 402 | struct glyph_string *s, |
| 403 | int x, int y) | 403 | int x, int y) |
| @@ -414,11 +414,11 @@ xwidget_init_view ( | |||
| 414 | 414 | ||
| 415 | xv = &xwidget_views[xwidget_view_index]; | 415 | xv = &xwidget_views[xwidget_view_index]; |
| 416 | }while( xv->initialized == 1); //TODO yeah this can infloop if there are MAX_WIDGETS on-screen | 416 | }while( xv->initialized == 1); //TODO yeah this can infloop if there are MAX_WIDGETS on-screen |
| 417 | 417 | ||
| 418 | xv->initialized = 1; | 418 | xv->initialized = 1; |
| 419 | xv->w = s->w; | 419 | xv->w = s->w; |
| 420 | xv->model = xww; | 420 | xv->model = xww; |
| 421 | 421 | ||
| 422 | //widget creation | 422 | //widget creation |
| 423 | if(EQ(xww->type, Qbutton)) | 423 | if(EQ(xww->type, Qbutton)) |
| 424 | { | 424 | { |
| @@ -434,7 +434,7 @@ xwidget_init_view ( | |||
| 434 | //gdk_color_parse("blue",&color); //the blue color never seems to show up. something else draws a grey bg | 434 | //gdk_color_parse("blue",&color); //the blue color never seems to show up. something else draws a grey bg |
| 435 | //gtk_widget_modify_bg(xv->widget, GTK_STATE_NORMAL, &color); | 435 | //gtk_widget_modify_bg(xv->widget, GTK_STATE_NORMAL, &color); |
| 436 | g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added"); | 436 | g_signal_connect_after(xv->widget, "plug-added", G_CALLBACK(xwidget_plug_added), "plug added"); |
| 437 | g_signal_connect_after(xv->widget, "plug-removed", G_CALLBACK(xwidget_plug_removed), "plug removed"); | 437 | g_signal_connect_after(xv->widget, "plug-removed", G_CALLBACK(xwidget_plug_removed), "plug removed"); |
| 438 | } else if (EQ(xww->type, Qslider)) { | 438 | } else if (EQ(xww->type, Qslider)) { |
| 439 | xv->widget = | 439 | xv->widget = |
| 440 | //gtk_hscale_new (GTK_ADJUSTMENT(gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 10.0, 10.0))); | 440 | //gtk_hscale_new (GTK_ADJUSTMENT(gtk_adjustment_new (0.0, 0.0, 100.0, 1.0, 10.0, 10.0))); |
| @@ -443,7 +443,7 @@ xwidget_init_view ( | |||
| 443 | xv->handler_id = g_signal_connect_after(xv->widget, "value-changed", G_CALLBACK(xwidget_slider_changed), "slider changed"); | 443 | xv->handler_id = g_signal_connect_after(xv->widget, "value-changed", G_CALLBACK(xwidget_slider_changed), "slider changed"); |
| 444 | } else if (EQ(xww->type, Qcairo)) { | 444 | } else if (EQ(xww->type, Qcairo)) { |
| 445 | //Cairo view | 445 | //Cairo view |
| 446 | //uhm cairo is differentish in gtk 3. | 446 | //uhm cairo is differentish in gtk 3. |
| 447 | //gdk_cairo_create (gtk_widget_get_window (f->gwfixed)); | 447 | //gdk_cairo_create (gtk_widget_get_window (f->gwfixed)); |
| 448 | #ifdef HAVE_GOOCANVAS | 448 | #ifdef HAVE_GOOCANVAS |
| 449 | xv->widget = goo_canvas_new(); | 449 | xv->widget = goo_canvas_new(); |
| @@ -463,7 +463,7 @@ xwidget_init_view ( | |||
| 463 | "font", "Sans 24", | 463 | "font", "Sans 24", |
| 464 | NULL); | 464 | NULL); |
| 465 | goo_canvas_item_rotate (text_item, 45, 300, 300); | 465 | goo_canvas_item_rotate (text_item, 45, 300, 300); |
| 466 | 466 | ||
| 467 | #endif | 467 | #endif |
| 468 | #ifdef HAVE_CLUTTER | 468 | #ifdef HAVE_CLUTTER |
| 469 | xv->widget = gtk_clutter_embed_new ();; | 469 | xv->widget = gtk_clutter_embed_new ();; |
| @@ -483,13 +483,13 @@ xwidget_init_view ( | |||
| 483 | /* draw on the context */ | 483 | /* draw on the context */ |
| 484 | RsvgHandle *h = rsvg_handle_new_from_file ("/tmp/tst.svg", | 484 | RsvgHandle *h = rsvg_handle_new_from_file ("/tmp/tst.svg", |
| 485 | NULL); | 485 | NULL); |
| 486 | 486 | ||
| 487 | rsvg_handle_render_cairo(h, cr); | 487 | rsvg_handle_render_cairo(h, cr); |
| 488 | cairo_destroy (cr); | 488 | cairo_destroy (cr); |
| 489 | 489 | ||
| 490 | /* Show the stage: */ | 490 | /* Show the stage: */ |
| 491 | clutter_actor_show (stage); | 491 | clutter_actor_show (stage); |
| 492 | #endif | 492 | #endif |
| 493 | } else if (EQ(xww->type, Qwebkit_osr)) { | 493 | } else if (EQ(xww->type, Qwebkit_osr)) { |
| 494 | #ifdef HAVE_WEBKIT_OSR | 494 | #ifdef HAVE_WEBKIT_OSR |
| 495 | xv->widget = gtk_drawing_area_new(); | 495 | xv->widget = gtk_drawing_area_new(); |
| @@ -498,19 +498,19 @@ xwidget_init_view ( | |||
| 498 | GDK_BUTTON_PRESS_MASK | 498 | GDK_BUTTON_PRESS_MASK |
| 499 | | GDK_BUTTON_RELEASE_MASK | 499 | | GDK_BUTTON_RELEASE_MASK |
| 500 | | GDK_POINTER_MOTION_MASK); | 500 | | GDK_POINTER_MOTION_MASK); |
| 501 | g_signal_connect (G_OBJECT ( xv->widget), "draw", | 501 | g_signal_connect (G_OBJECT ( xv->widget), "draw", |
| 502 | G_CALLBACK (xwidget_osr_draw_callback), NULL); | 502 | G_CALLBACK (xwidget_osr_draw_callback), NULL); |
| 503 | g_signal_connect (G_OBJECT ( xv->widget), "button-press-event", | 503 | g_signal_connect (G_OBJECT ( xv->widget), "button-press-event", |
| 504 | G_CALLBACK (xwidget_osr_button_callback), NULL); | 504 | G_CALLBACK (xwidget_osr_button_callback), NULL); |
| 505 | g_signal_connect (G_OBJECT ( xv->widget), "button-release-event", | 505 | g_signal_connect (G_OBJECT ( xv->widget), "button-release-event", |
| 506 | G_CALLBACK (xwidget_osr_button_callback), NULL); | 506 | G_CALLBACK (xwidget_osr_button_callback), NULL); |
| 507 | g_signal_connect (G_OBJECT ( xv->widget), "motion-notify-event", | 507 | g_signal_connect (G_OBJECT ( xv->widget), "motion-notify-event", |
| 508 | G_CALLBACK (xwidget_osr_button_callback), NULL); | 508 | G_CALLBACK (xwidget_osr_button_callback), NULL); |
| 509 | #endif | 509 | #endif |
| 510 | 510 | ||
| 511 | 511 | ||
| 512 | } else return NULL; | 512 | } else return NULL; |
| 513 | 513 | ||
| 514 | //widget realization | 514 | //widget realization |
| 515 | //make container widget 1st, and put the actual widget inside the container | 515 | //make container widget 1st, and put the actual widget inside the container |
| 516 | //later, drawing should crop container window if necessary to handle case where xwidget | 516 | //later, drawing should crop container window if necessary to handle case where xwidget |
| @@ -523,7 +523,7 @@ xwidget_init_view ( | |||
| 523 | //xv->widgetwindow = GTK_CONTAINER (gtk_event_box_new ()); //doesnt help clipping gtk3 | 523 | //xv->widgetwindow = GTK_CONTAINER (gtk_event_box_new ()); //doesnt help clipping gtk3 |
| 524 | //xv->widgetwindow = GTK_CONTAINER (gtk_scrolled_window_new (NULL, NULL)); //clips in gtk3 | 524 | //xv->widgetwindow = GTK_CONTAINER (gtk_scrolled_window_new (NULL, NULL)); //clips in gtk3 |
| 525 | //xv->widgetwindow = GTK_CONTAINER (gtk_viewport_new (NULL, NULL)); | 525 | //xv->widgetwindow = GTK_CONTAINER (gtk_viewport_new (NULL, NULL)); |
| 526 | 526 | ||
| 527 | 527 | ||
| 528 | /* GtkAllocation a; */ | 528 | /* GtkAllocation a; */ |
| 529 | /* a.x=0; a.y=0; a.width=xww->width; a.height=xww->height; */ | 529 | /* a.x=0; a.y=0; a.width=xww->width; a.height=xww->height; */ |
| @@ -546,29 +546,29 @@ xwidget_init_view ( | |||
| 546 | g_object_set_data (G_OBJECT (xv->widget), XG_FRAME_DATA, (gpointer) (s->f)); //the emacs frame | 546 | g_object_set_data (G_OBJECT (xv->widget), XG_FRAME_DATA, (gpointer) (s->f)); //the emacs frame |
| 547 | g_object_set_data (G_OBJECT (xv->widget), XG_XWIDGET, (gpointer) (xww)); //the xwidget | 547 | g_object_set_data (G_OBJECT (xv->widget), XG_XWIDGET, (gpointer) (xww)); //the xwidget |
| 548 | g_object_set_data (G_OBJECT (xv->widget), XG_XWIDGET_VIEW, (gpointer) (xv)); //the xwidget | 548 | g_object_set_data (G_OBJECT (xv->widget), XG_XWIDGET_VIEW, (gpointer) (xv)); //the xwidget |
| 549 | g_object_set_data (G_OBJECT (xv->widgetwindow), XG_XWIDGET, (gpointer) (xww)); //the xwidget | 549 | g_object_set_data (G_OBJECT (xv->widgetwindow), XG_XWIDGET, (gpointer) (xww)); //the xwidget |
| 550 | g_object_set_data (G_OBJECT (xv->widgetwindow), XG_XWIDGET_VIEW, (gpointer) (xv)); //the xwidget | 550 | g_object_set_data (G_OBJECT (xv->widgetwindow), XG_XWIDGET_VIEW, (gpointer) (xv)); //the xwidget |
| 551 | 551 | ||
| 552 | 552 | ||
| 553 | gtk_widget_set_size_request (GTK_WIDGET (xv->widget), xww->width, xww->height); | 553 | gtk_widget_set_size_request (GTK_WIDGET (xv->widget), xww->width, xww->height); |
| 554 | gtk_widget_set_size_request (GTK_WIDGET (xv->widgetwindow), xww->width, xww->height); | 554 | gtk_widget_set_size_request (GTK_WIDGET (xv->widgetwindow), xww->width, xww->height); |
| 555 | gtk_fixed_put (GTK_FIXED (s->f->gwfixed), GTK_WIDGET (xv->widgetwindow), x, y); | 555 | gtk_fixed_put (GTK_FIXED (s->f->gwfixed), GTK_WIDGET (xv->widgetwindow), x, y); |
| 556 | xv->x = x; xv->y = y; | 556 | xv->x = x; xv->y = y; |
| 557 | gtk_widget_show_all (GTK_WIDGET (xv->widgetwindow)); | 557 | gtk_widget_show_all (GTK_WIDGET (xv->widgetwindow)); |
| 558 | 558 | ||
| 559 | 559 | ||
| 560 | //this seems to enable xcomposition. later we need to paint ourselves somehow, | 560 | //this seems to enable xcomposition. later we need to paint ourselves somehow, |
| 561 | //since the widget is no longer responsible for painting itself | 561 | //since the widget is no longer responsible for painting itself |
| 562 | //if(xw->type!=3) //im having trouble with compositing and sockets. hmmm. | 562 | //if(xw->type!=3) //im having trouble with compositing and sockets. hmmm. |
| 563 | //gdk_window_set_composited (xw->widget->window, TRUE); | 563 | //gdk_window_set_composited (xw->widget->window, TRUE); |
| 564 | //gdk_window_set_composited (GTK_LAYOUT (xw->widgetwindow)->bin_window, TRUE); | 564 | //gdk_window_set_composited (GTK_LAYOUT (xw->widgetwindow)->bin_window, TRUE); |
| 565 | // gtk_widget_set_double_buffered (xw->widget,FALSE); | 565 | // gtk_widget_set_double_buffered (xw->widget,FALSE); |
| 566 | // gtk_widget_set_double_buffered (xw->widgetwindow,FALSE); | 566 | // gtk_widget_set_double_buffered (xw->widgetwindow,FALSE); |
| 567 | //gdk_window_set_composited (xw->widgetwindow, TRUE); | 567 | //gdk_window_set_composited (xw->widgetwindow, TRUE); |
| 568 | //g_signal_connect_after(xw->widget, "expose-event", G_CALLBACK(xwidget_composite_draw), "widget exposed"); | 568 | //g_signal_connect_after(xw->widget, "expose-event", G_CALLBACK(xwidget_composite_draw), "widget exposed"); |
| 569 | //g_signal_connect_after(xw->widgetwindow, "expose-event", G_CALLBACK(xwidget_composite_draw_widgetwindow), "widgetwindow exposed"); | 569 | //g_signal_connect_after(xw->widgetwindow, "expose-event", G_CALLBACK(xwidget_composite_draw_widgetwindow), "widgetwindow exposed"); |
| 570 | // g_signal_connect_after(xw->widget, "damage-event", G_CALLBACK(xwidget_composite_draw), "damaged"); | 570 | // g_signal_connect_after(xw->widget, "damage-event", G_CALLBACK(xwidget_composite_draw), "damaged"); |
| 571 | 571 | ||
| 572 | //widgettype specific initialization only possible after realization | 572 | //widgettype specific initialization only possible after realization |
| 573 | if (EQ(xww->type, Qsocket)) { | 573 | if (EQ(xww->type, Qsocket)) { |
| 574 | printf ("xwid:%d socket id:%x %d\n", | 574 | printf ("xwid:%d socket id:%x %d\n", |
| @@ -608,16 +608,16 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 608 | window placement etc. | 608 | window placement etc. |
| 609 | */ | 609 | */ |
| 610 | printf ("xv init for xw %d\n", xww); | 610 | printf ("xv init for xw %d\n", xww); |
| 611 | xv = xwidget_init_view (xww, s, x, y); | 611 | xv = xwidget_init_view (xww, s, x, y); |
| 612 | } | 612 | } |
| 613 | 613 | ||
| 614 | //calculate clipping, which is used for all manner of onscreen xwidget views | 614 | //calculate clipping, which is used for all manner of onscreen xwidget views |
| 615 | //each widget border can get clipped by other emacs objects so there are four clipping variables | 615 | //each widget border can get clipped by other emacs objects so there are four clipping variables |
| 616 | clip_right = min (xww->width, WINDOW_RIGHT_EDGE_X (s->w) - x - WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH(s->w) - WINDOW_RIGHT_FRINGE_WIDTH(s->w)); | 616 | clip_right = min (xww->width, WINDOW_RIGHT_EDGE_X (s->w) - x - WINDOW_RIGHT_SCROLL_BAR_AREA_WIDTH(s->w) - WINDOW_RIGHT_FRINGE_WIDTH(s->w)); |
| 617 | clip_left = max (0, WINDOW_LEFT_EDGE_X (s->w) - x + WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(s->w) + WINDOW_LEFT_FRINGE_WIDTH(s->w)); | 617 | clip_left = max (0, WINDOW_LEFT_EDGE_X (s->w) - x + WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH(s->w) + WINDOW_LEFT_FRINGE_WIDTH(s->w)); |
| 618 | 618 | ||
| 619 | clip_bottom = min (xww->height, WINDOW_BOTTOM_EDGE_Y (s->w) - WINDOW_MODE_LINE_HEIGHT (s->w) - y); | 619 | clip_bottom = min (xww->height, WINDOW_BOTTOM_EDGE_Y (s->w) - WINDOW_MODE_LINE_HEIGHT (s->w) - y); |
| 620 | clip_top = max(0, WINDOW_TOP_EDGE_Y(s->w) -y ); | 620 | clip_top = max(0, WINDOW_TOP_EDGE_Y(s->w) -y ); |
| 621 | 621 | ||
| 622 | //we are conserned with movement of the onscreen area. the area might sit still when the widget actually moves | 622 | //we are conserned with movement of the onscreen area. the area might sit still when the widget actually moves |
| 623 | //this happens when an emacs window border moves across a widget winow | 623 | //this happens when an emacs window border moves across a widget winow |
| @@ -647,7 +647,7 @@ x_draw_xwidget_glyph_string (struct glyph_string *s) | |||
| 647 | gtk_fixed_move(GTK_FIXED(xv->widgetwindow), xv->widget, -clip_left, -clip_top); | 647 | gtk_fixed_move(GTK_FIXED(xv->widgetwindow), xv->widget, -clip_left, -clip_top); |
| 648 | printf("reclip %d %d -> %d %d clip_top:%d clip_left:%d\n",xv->clip_right, xv->clip_bottom, clip_right, clip_bottom, clip_top , clip_left); | 648 | printf("reclip %d %d -> %d %d clip_top:%d clip_left:%d\n",xv->clip_right, xv->clip_bottom, clip_right, clip_bottom, clip_top , clip_left); |
| 649 | 649 | ||
| 650 | 650 | ||
| 651 | xv->clip_right = clip_right; xv->clip_bottom = clip_bottom; xv->clip_top = clip_top;xv->clip_left = clip_left; | 651 | xv->clip_right = clip_right; xv->clip_bottom = clip_bottom; xv->clip_top = clip_top;xv->clip_left = clip_left; |
| 652 | } | 652 | } |
| 653 | //if emacs wants to repaint the area where the widget lives, queue a redraw | 653 | //if emacs wants to repaint the area where the widget lives, queue a redraw |
| @@ -692,7 +692,7 @@ DEFUN ("xwidget-webkit-get-title", Fxwidget_webkit_get_title, Sxwidget_webkit_g | |||
| 692 | 692 | ||
| 693 | 693 | ||
| 694 | 694 | ||
| 695 | #endif | 695 | #endif |
| 696 | 696 | ||
| 697 | 697 | ||
| 698 | 698 | ||
| @@ -710,7 +710,7 @@ DEFUN ("xwidget-resize", Fxwidget_resize, Sxwidget_resize, 3, 3, 0, doc: | |||
| 710 | CHECK_NUMBER (new_height); | 710 | CHECK_NUMBER (new_height); |
| 711 | w = XFASTINT (new_width); | 711 | w = XFASTINT (new_width); |
| 712 | h = XFASTINT (new_height); | 712 | h = XFASTINT (new_height); |
| 713 | 713 | ||
| 714 | 714 | ||
| 715 | printf("resize xwidget %d (%d,%d)->(%d,%d)",xw, xw->width,xw->height,w,h); | 715 | printf("resize xwidget %d (%d,%d)->(%d,%d)",xw, xw->width,xw->height,w,h); |
| 716 | xw->width=w; | 716 | xw->width=w; |
| @@ -763,13 +763,13 @@ DEFUN("xwidget-info", Fxwidget_info , Sxwidget_info, 1,1,0, doc: /* get xwidget | |||
| 763 | return info; | 763 | return info; |
| 764 | } | 764 | } |
| 765 | 765 | ||
| 766 | 766 | ||
| 767 | DEFUN("xwidget-view-info", Fxwidget_view_info , Sxwidget_view_info, 2,2,0, doc: /* get xwidget view props */) | 767 | DEFUN("xwidget-view-info", Fxwidget_view_info , Sxwidget_view_info, 2,2,0, doc: /* get xwidget view props */) |
| 768 | (Lisp_Object xwidget, Lisp_Object window) | 768 | (Lisp_Object xwidget, Lisp_Object window) |
| 769 | { | 769 | { |
| 770 | struct xwidget* xw = XXWIDGET(xwidget); | 770 | struct xwidget* xw = XXWIDGET(xwidget); |
| 771 | struct xwidget_view* xv = xwidget_view_lookup(xw, XWINDOW(window)); | 771 | struct xwidget_view* xv = xwidget_view_lookup(xw, XWINDOW(window)); |
| 772 | 772 | ||
| 773 | Lisp_Object info; | 773 | Lisp_Object info; |
| 774 | 774 | ||
| 775 | info = Fmake_vector (make_number (6), Qnil); | 775 | info = Fmake_vector (make_number (6), Qnil); |
| @@ -801,7 +801,7 @@ DEFUN("xwidget-delete-zombies", Fxwidget_delete_zombies , Sxwidget_delete_zombie | |||
| 801 | xv = &xwidget_views[i]; | 801 | xv = &xwidget_views[i]; |
| 802 | XSETWINDOW(w, xv->w); | 802 | XSETWINDOW(w, xv->w); |
| 803 | if(xv->initialized && (! (WINDOW_LIVE_P(w)))){ | 803 | if(xv->initialized && (! (WINDOW_LIVE_P(w)))){ |
| 804 | 804 | ||
| 805 | gtk_widget_destroy(GTK_WIDGET(xv->widgetwindow)); | 805 | gtk_widget_destroy(GTK_WIDGET(xv->widgetwindow)); |
| 806 | xv->initialized = 0; | 806 | xv->initialized = 0; |
| 807 | } | 807 | } |
| @@ -832,19 +832,19 @@ syms_of_xwidget (void) | |||
| 832 | DEFSYM (Qcxwidget ,":xwidget"); | 832 | DEFSYM (Qcxwidget ,":xwidget"); |
| 833 | DEFSYM (Qtitle ,":title"); | 833 | DEFSYM (Qtitle ,":title"); |
| 834 | 834 | ||
| 835 | DEFSYM (Qbutton, "button"); | 835 | DEFSYM (Qbutton, "button"); |
| 836 | DEFSYM (Qtoggle, "toggle"); | 836 | DEFSYM (Qtoggle, "toggle"); |
| 837 | DEFSYM (Qslider, "slider"); | 837 | DEFSYM (Qslider, "slider"); |
| 838 | DEFSYM (Qsocket, "socket"); | 838 | DEFSYM (Qsocket, "socket"); |
| 839 | DEFSYM (Qcairo, "cairo"); | 839 | DEFSYM (Qcairo, "cairo"); |
| 840 | DEFSYM (Qwebkit_osr ,"webkit-osr"); | 840 | DEFSYM (Qwebkit_osr ,"webkit-osr"); |
| 841 | DEFSYM (QCplist, ":plist"); | 841 | DEFSYM (QCplist, ":plist"); |
| 842 | 842 | ||
| 843 | DEFVAR_LISP ("xwidget-alist", Vxwidget_alist, doc: /*xwidgets list*/); | 843 | DEFVAR_LISP ("xwidget-alist", Vxwidget_alist, doc: /*xwidgets list*/); |
| 844 | Vxwidget_alist = Qnil; | 844 | Vxwidget_alist = Qnil; |
| 845 | DEFVAR_LISP ("xwidget-view-alist", Vxwidget_view_alist, doc: /*xwidget views list*/); | 845 | DEFVAR_LISP ("xwidget-view-alist", Vxwidget_view_alist, doc: /*xwidget views list*/); |
| 846 | Vxwidget_alist = Qnil; | 846 | Vxwidget_alist = Qnil; |
| 847 | 847 | ||
| 848 | Fprovide (intern ("xwidget-internal"), Qnil); | 848 | Fprovide (intern ("xwidget-internal"), Qnil); |
| 849 | 849 | ||
| 850 | // for (i = 0; i < MAX_XWIDGETS; i++) | 850 | // for (i = 0; i < MAX_XWIDGETS; i++) |
| @@ -937,7 +937,7 @@ struct xwidget_view* xwidget_view_lookup(struct xwidget* xw, struct window * | |||
| 937 | for (int i = 0; i < MAX_XWIDGETS; i++) | 937 | for (int i = 0; i < MAX_XWIDGETS; i++) |
| 938 | if ((xwidget_views[i].model == xw) && (xwidget_views[i].w == w)) | 938 | if ((xwidget_views[i].model == xw) && (xwidget_views[i].w == w)) |
| 939 | xv = &xwidget_views[i]; | 939 | xv = &xwidget_views[i]; |
| 940 | 940 | ||
| 941 | return xv; | 941 | return xv; |
| 942 | } | 942 | } |
| 943 | 943 | ||
| @@ -950,7 +950,7 @@ void gtk_window_get_position (GtkWindow *window, | |||
| 950 | *root_y = 0; | 950 | *root_y = 0; |
| 951 | } | 951 | } |
| 952 | 952 | ||
| 953 | 953 | ||
| 954 | 954 | ||
| 955 | struct xwidget* | 955 | struct xwidget* |
| 956 | lookup_xwidget (Lisp_Object spec) | 956 | lookup_xwidget (Lisp_Object spec) |
| @@ -960,7 +960,7 @@ lookup_xwidget (Lisp_Object spec) | |||
| 960 | So, take special care of one-shot events | 960 | So, take special care of one-shot events |
| 961 | 961 | ||
| 962 | TODO remove xwidget init from display spec. simply store an xwidget reference only and set | 962 | TODO remove xwidget init from display spec. simply store an xwidget reference only and set |
| 963 | size etc when creating the xwidget, which should happen before insertion into buffer | 963 | size etc when creating the xwidget, which should happen before insertion into buffer |
| 964 | */ | 964 | */ |
| 965 | int found = 0, found1 = 0, found2 = 0; | 965 | int found = 0, found1 = 0, found2 = 0; |
| 966 | Lisp_Object value; | 966 | Lisp_Object value; |
| @@ -1000,23 +1000,23 @@ xwidget_start_redisplay (void) | |||
| 1000 | 1000 | ||
| 1001 | /* the xwidget was touched during redisplay, so it isnt a candidate for hiding*/ | 1001 | /* the xwidget was touched during redisplay, so it isnt a candidate for hiding*/ |
| 1002 | void | 1002 | void |
| 1003 | xwidget_touch (struct xwidget_view *xw) | 1003 | xwidget_touch (struct xwidget_view *xv) |
| 1004 | { | 1004 | { |
| 1005 | xw->redisplayed = 1; | 1005 | xv->redisplayed = 1; |
| 1006 | } | 1006 | } |
| 1007 | 1007 | ||
| 1008 | int | 1008 | int |
| 1009 | xwidget_touched (struct xwidget_view *xw) | 1009 | xwidget_touched (struct xwidget_view *xv) |
| 1010 | { | 1010 | { |
| 1011 | return xw->redisplayed; | 1011 | return xv->redisplayed; |
| 1012 | } | 1012 | } |
| 1013 | 1013 | ||
| 1014 | /* redisplay has ended, now we should hide untouched xwidgets | 1014 | /* redisplay has ended, now we should hide untouched xwidgets |
| 1015 | */ | 1015 | */ |
| 1016 | void | 1016 | void |
| 1017 | xwidget_end_redisplay (struct glyph_matrix *matrix) | 1017 | xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix) |
| 1018 | { | 1018 | { |
| 1019 | 1019 | ||
| 1020 | int i; | 1020 | int i; |
| 1021 | struct xwidget *xw; | 1021 | struct xwidget *xw; |
| 1022 | int area; | 1022 | int area; |
| @@ -1045,12 +1045,11 @@ xwidget_end_redisplay (struct glyph_matrix *matrix) | |||
| 1045 | if (glyph->type == XWIDGET_GLYPH) | 1045 | if (glyph->type == XWIDGET_GLYPH) |
| 1046 | { | 1046 | { |
| 1047 | /* | 1047 | /* |
| 1048 | the only call to xwidget_end_redisplay is in dispnew and looks like: | 1048 | the only call to xwidget_end_redisplay is in dispnew |
| 1049 | if ((XWINDOW(FRAME_SELECTED_WINDOW (SELECTED_FRAME()))) == (w)) | ||
| 1050 | xwidget_end_redisplay(w->current_matrix); | 1049 | xwidget_end_redisplay(w->current_matrix); |
| 1051 | */ | 1050 | */ |
| 1052 | xwidget_touch (xwidget_view_lookup(glyph->u.xwidget, | 1051 | xwidget_touch (xwidget_view_lookup(glyph->u.xwidget, |
| 1053 | (XWINDOW(FRAME_SELECTED_WINDOW (SELECTED_FRAME()))))); | 1052 | w)); |
| 1054 | } | 1053 | } |
| 1055 | } | 1054 | } |
| 1056 | } | 1055 | } |
| @@ -1062,7 +1061,7 @@ xwidget_end_redisplay (struct glyph_matrix *matrix) | |||
| 1062 | struct xwidget_view* xv = &xwidget_views[i]; | 1061 | struct xwidget_view* xv = &xwidget_views[i]; |
| 1063 | 1062 | ||
| 1064 | //"touched" is only meaningful for the "live" window, so disregard other views | 1063 | //"touched" is only meaningful for the "live" window, so disregard other views |
| 1065 | if (xv->initialized && ( xv->w == (XWINDOW(FRAME_SELECTED_WINDOW (SELECTED_FRAME()))))) | 1064 | if (xv->initialized && ( xv->w == w)) |
| 1066 | { | 1065 | { |
| 1067 | if (xwidget_touched(xv)) | 1066 | if (xwidget_touched(xv)) |
| 1068 | xwidget_show_view (xv); | 1067 | xwidget_show_view (xv); |
| @@ -1071,5 +1070,3 @@ xwidget_end_redisplay (struct glyph_matrix *matrix) | |||
| 1071 | } | 1070 | } |
| 1072 | } | 1071 | } |
| 1073 | } | 1072 | } |
| 1074 | |||
| 1075 | |||
diff --git a/src/xwidget.h b/src/xwidget.h index 9244ff7017f..edd360969dc 100644 --- a/src/xwidget.h +++ b/src/xwidget.h | |||
| @@ -92,7 +92,7 @@ struct xwidget* xwidget_from_id(int id); | |||
| 92 | //extern int xwidget_owns_kbd; | 92 | //extern int xwidget_owns_kbd; |
| 93 | 93 | ||
| 94 | void xwidget_start_redisplay(); | 94 | void xwidget_start_redisplay(); |
| 95 | void xwidget_end_redisplay(struct glyph_matrix* matrix); | 95 | void xwidget_end_redisplay (struct window *w, struct glyph_matrix *matrix); |
| 96 | 96 | ||
| 97 | void xwidget_touch (struct xwidget_view *xw); | 97 | void xwidget_touch (struct xwidget_view *xw); |
| 98 | 98 | ||