aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJoakim Verona2015-01-21 22:43:14 +0100
committerJoakim Verona2015-01-21 22:43:14 +0100
commit0609e9003dbbc67425ff0659c94f2b5fd994b4d2 (patch)
treefee52e30939150dc248cdded36e60b26ec20e8fa /src
parentc8f2ca7d672acfab85825eba24bbc96024659ede (diff)
downloademacs-0609e9003dbbc67425ff0659c94f2b5fd994b4d2.tar.gz
emacs-0609e9003dbbc67425ff0659c94f2b5fd994b4d2.zip
cleanup
Diffstat (limited to 'src')
-rw-r--r--src/dispnew.c1
-rw-r--r--src/emacsgtkfixed.c38
-rw-r--r--src/keyboard.c1
-rw-r--r--src/xdisp.c12
-rw-r--r--src/xterm.c1
-rw-r--r--src/xwidget.c37
6 files changed, 4 insertions, 86 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 3c0f110446b..8c48ae065ac 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4140,7 +4140,6 @@ scrolling_window (struct window *w, bool header_line_p)
4140 4140
4141#ifdef HAVE_XWIDGETS 4141#ifdef HAVE_XWIDGETS
4142 //currently this is needed to detect xwidget movement reliably. or probably not. 4142 //currently this is needed to detect xwidget movement reliably. or probably not.
4143 //printf("scrolling_window\n");
4144 return 0; 4143 return 0;
4145#endif 4144#endif
4146 4145
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index f5d42b8d861..d52a1399bac 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -70,25 +70,6 @@ static void emacs_fixed_get_preferred_height (GtkWidget *widget,
70G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED) 70G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED)
71 71
72#ifdef HAVE_XWIDGETS 72#ifdef HAVE_XWIDGETS
73/* void aloc_callback(GtkWidget* child, GtkWidget* fixed){ */
74/* GtkAllocation child_allocation; */
75/* GtkRequisition child_requisition; */
76
77/* //TODO */
78/* // if child is an xwidget, find its clipping area and modify allocation */
79
80/* struct xwidget_view* xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (child), XG_XWIDGET_VIEW); */
81/* printf("aloc callback %d %s\n", xv, gtk_widget_get_name(child)); */
82/* if(xv){ */
83/* printf(" allocation modification for xw\n"); */
84/* gtk_widget_get_allocation(child, &child_allocation); */
85/* child_allocation.width = xv->clip_right; */
86/* child_allocation.height = xv->clip_bottom - xv->clip_top; */
87/* gtk_widget_size_allocate (child, &child_allocation); */
88/* //TODO find a way to remove this feeble workaround */
89/* } */
90
91/* } */
92 73
93struct GtkFixedPrivateL 74struct GtkFixedPrivateL
94{ 75{
@@ -99,7 +80,6 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget,
99 GtkAllocation *allocation){ 80 GtkAllocation *allocation){
100 //for xwidgets 81 //for xwidgets
101 82
102
103 //TODO 1st call base class method 83 //TODO 1st call base class method
104 EmacsFixedClass *klass; 84 EmacsFixedClass *klass;
105 GtkWidgetClass *parent_class; 85 GtkWidgetClass *parent_class;
@@ -110,7 +90,6 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget,
110 GList *children; 90 GList *children;
111 struct xwidget_view* xv; 91 struct xwidget_view* xv;
112 92
113 // printf(" emacs_fixed_gtk_widget_size_allocate\n");
114 klass = EMACS_FIXED_GET_CLASS (widget); 93 klass = EMACS_FIXED_GET_CLASS (widget);
115 parent_class = g_type_class_peek_parent (klass); 94 parent_class = g_type_class_peek_parent (klass);
116 parent_class->size_allocate (widget, allocation); 95 parent_class->size_allocate (widget, allocation);
@@ -118,17 +97,6 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget,
118 priv = G_TYPE_INSTANCE_GET_PRIVATE (widget, 97 priv = G_TYPE_INSTANCE_GET_PRIVATE (widget,
119 GTK_TYPE_FIXED, 98 GTK_TYPE_FIXED,
120 struct GtkFixedPrivateL); 99 struct GtkFixedPrivateL);
121 //fixed->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixed, GTK_TYPE_FIXED, GtkFixedPrivate);
122 //then modify allocations
123 /* gtk_container_foreach (widget, */
124 /* aloc_callback, */
125 /* widget); */
126
127 //begin copy paste extravaganza!!!
128
129 //GtkFixed *fixed = GTK_FIXED (widget);
130 //GtkFixedPrivate *priv = fixed->priv;
131
132 100
133 gtk_widget_set_allocation (widget, allocation); 101 gtk_widget_set_allocation (widget, allocation);
134 102
@@ -167,15 +135,9 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget,
167 135
168 136
169 xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (child->widget), XG_XWIDGET_VIEW); 137 xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (child->widget), XG_XWIDGET_VIEW);
170 //printf("aloc callback %d %s\n", xv, gtk_widget_get_name(child));
171 if(xv){ 138 if(xv){
172 //gtk_widget_get_allocation(child, &child_allocation);
173 child_allocation.width = xv->clip_right; 139 child_allocation.width = xv->clip_right;
174 child_allocation.height = xv->clip_bottom - xv->clip_top; 140 child_allocation.height = xv->clip_bottom - xv->clip_top;
175 //gtk_widget_size_allocate (child, &child_allocation);
176 //TODO find a way to remove this feeble workaround
177 // printf(" allocation internal modification for xw %d %d,%d\n",xv, child_allocation.width, child_allocation.height);
178
179 } 141 }
180 gtk_widget_size_allocate (child->widget, &child_allocation); 142 gtk_widget_size_allocate (child->widget, &child_allocation);
181 143
diff --git a/src/keyboard.c b/src/keyboard.c
index dbae12b79f1..e9ecd8cbd3d 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -6081,7 +6081,6 @@ make_lispy_event (struct input_event *event)
6081#ifdef HAVE_XWIDGETS 6081#ifdef HAVE_XWIDGETS
6082 case XWIDGET_EVENT: 6082 case XWIDGET_EVENT:
6083 { 6083 {
6084 printf("cool, an xwidget event arrived in make_lispy_event!\n");
6085 return Fcons (Qxwidget_event,event->arg); 6084 return Fcons (Qxwidget_event,event->arg);
6086 } 6085 }
6087#endif /* HAVE_XWIDGETS */ 6086#endif /* HAVE_XWIDGETS */
diff --git a/src/xdisp.c b/src/xdisp.c
index f6795415bcb..5e57e0588cf 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -5219,7 +5219,6 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object,
5219#ifdef HAVE_XWIDGETS 5219#ifdef HAVE_XWIDGETS
5220 else if (valid_xwidget_spec_p(value)) 5220 else if (valid_xwidget_spec_p(value))
5221 { 5221 {
5222 //printf("handle_single_display_spec: im an xwidget!!\n");
5223 it->what = IT_XWIDGET; 5222 it->what = IT_XWIDGET;
5224 it->method = GET_FROM_XWIDGET; 5223 it->method = GET_FROM_XWIDGET;
5225 it->position = start_pos; 5224 it->position = start_pos;
@@ -8050,9 +8049,6 @@ static int
8050next_element_from_xwidget (struct it *it) 8049next_element_from_xwidget (struct it *it)
8051{ 8050{
8052 it->what = IT_XWIDGET; 8051 it->what = IT_XWIDGET;
8053 //assert_valid_xwidget_id(it->xwidget_id,"next_element_from_xwidget");
8054 //this is shaky because why do we set "what" if we dont set the other parts??
8055 //printf("xwidget_id %d: in next_element_from_xwidget: FIXME \n", it->xwidget_id);
8056 return 1; 8052 return 1;
8057} 8053}
8058#endif 8054#endif
@@ -18676,7 +18672,6 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area)
18676 glyph->left_box_line_p, 18672 glyph->left_box_line_p,
18677 glyph->right_box_line_p); 18673 glyph->right_box_line_p);
18678 18674
18679 // printf("dump xwidget glyph\n");
18680 } 18675 }
18681#endif 18676#endif
18682} 18677}
@@ -24099,7 +24094,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop,
24099#ifdef HAVE_XWIDGETS 24094#ifdef HAVE_XWIDGETS
24100 if (FRAME_WINDOW_P (it->f) && valid_xwidget_spec_p (prop)) 24095 if (FRAME_WINDOW_P (it->f) && valid_xwidget_spec_p (prop))
24101 { 24096 {
24102 printf("calc_pixel_width_or_height: return dummy size FIXME\n"); 24097 //TODO dont return dummy size
24103 return OK_PIXELS (width_p ? 100 : 100); 24098 return OK_PIXELS (width_p ? 100 : 100);
24104 } 24099 }
24105#endif 24100#endif
@@ -24612,13 +24607,11 @@ static void
24612fill_xwidget_glyph_string (struct glyph_string *s) 24607fill_xwidget_glyph_string (struct glyph_string *s)
24613{ 24608{
24614 eassert (s->first_glyph->type == XWIDGET_GLYPH); 24609 eassert (s->first_glyph->type == XWIDGET_GLYPH);
24615 printf("fill_xwidget_glyph_string: width:%d \n",s->first_glyph->pixel_width);
24616 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); 24610 s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id);
24617 s->font = s->face->font; 24611 s->font = s->face->font;
24618 s->width = s->first_glyph->pixel_width; 24612 s->width = s->first_glyph->pixel_width;
24619 s->ybase += s->first_glyph->voffset; 24613 s->ybase += s->first_glyph->voffset;
24620 s->xwidget = s->first_glyph->u.xwidget; 24614 s->xwidget = s->first_glyph->u.xwidget;
24621 //assert_valid_xwidget_id ( s->xwidget, "fill_xwidget_glyph_string");
24622} 24615}
24623#endif 24616#endif
24624/* Fill glyph string S from a sequence of stretch glyphs. 24617/* Fill glyph string S from a sequence of stretch glyphs.
@@ -24960,7 +24953,6 @@ compute_overhangs_and_x (struct glyph_string *s, int x, int backward_p)
24960#define BUILD_XWIDGET_GLYPH_STRING(START, END, HEAD, TAIL, HL, X, LAST_X) \ 24953#define BUILD_XWIDGET_GLYPH_STRING(START, END, HEAD, TAIL, HL, X, LAST_X) \
24961 do \ 24954 do \
24962 { \ 24955 { \
24963 printf("BUILD_XWIDGET_GLYPH_STRING\n"); \
24964 s = (struct glyph_string *) alloca (sizeof *s); \ 24956 s = (struct glyph_string *) alloca (sizeof *s); \
24965 INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL); \ 24957 INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL); \
24966 fill_xwidget_glyph_string (s); \ 24958 fill_xwidget_glyph_string (s); \
@@ -25798,7 +25790,6 @@ produce_xwidget_glyph (struct it *it)
25798 struct xwidget* xw; 25790 struct xwidget* xw;
25799 struct face *face; 25791 struct face *face;
25800 int glyph_ascent, crop; 25792 int glyph_ascent, crop;
25801 printf("produce_xwidget_glyph:\n");
25802 eassert (it->what == IT_XWIDGET); 25793 eassert (it->what == IT_XWIDGET);
25803 25794
25804 face = FACE_FROM_ID (it->f, it->face_id); 25795 face = FACE_FROM_ID (it->f, it->face_id);
@@ -27615,7 +27606,6 @@ get_window_cursor_type (struct window *w, struct glyph *glyph, int *width,
27615 27606
27616#ifdef HAVE_XWIDGETS 27607#ifdef HAVE_XWIDGETS
27617 if (glyph != NULL && glyph->type == XWIDGET_GLYPH){ 27608 if (glyph != NULL && glyph->type == XWIDGET_GLYPH){
27618 //printf("attempt xwidget cursor avoidance in get_window_cursor_type\n");
27619 return NO_CURSOR; 27609 return NO_CURSOR;
27620 } 27610 }
27621#endif 27611#endif
diff --git a/src/xterm.c b/src/xterm.c
index 40043dc9430..abceefb1b0e 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8028,7 +8028,6 @@ x_draw_bar_cursor (struct window *w, struct glyph_row *row, int width, enum text
8028 8028
8029#ifdef HAVE_XWIDGETS 8029#ifdef HAVE_XWIDGETS
8030 if (cursor_glyph->type == XWIDGET_GLYPH){ 8030 if (cursor_glyph->type == XWIDGET_GLYPH){
8031 printf("tried avoiding xwidget cursor\n");
8032 return; //experimental avoidance of cursor on xwidget 8031 return; //experimental avoidance of cursor on xwidget
8033 } 8032 }
8034#endif 8033#endif
diff --git a/src/xwidget.c b/src/xwidget.c
index 708053cbe65..780bc2105dc 100644
--- a/src/xwidget.c
+++ b/src/xwidget.c
@@ -581,45 +581,14 @@ xwidget_osr_event_forward (GtkWidget *widget,
581 /* copy events that arrive at the outer widget to the offscreen widget */ 581 /* copy events that arrive at the outer widget to the offscreen widget */
582 struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); 582 struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET);
583 GdkEvent* eventcopy = gdk_event_copy(event); 583 GdkEvent* eventcopy = gdk_event_copy(event);
584 //GdkEvent* eventcopy = gdk_event_new(GDK_BUTTON_PRESS);
585
586
587 //((GdkEventAny*)eventcopy)->window = gtk_widget_get_window(xw->widget_osr);
588 //eventcopy->any.window = gtk_widget_get_window(GTK_WIDGET (xw->widgetwindow_osr));
589 //((GdkEventAny*)eventcopy)->window = gtk_widget_get_window(xwgir_create_debug);
590
591
592
593 eventcopy->any.window = gtk_widget_get_window(xw->widget_osr);// works 584 eventcopy->any.window = gtk_widget_get_window(xw->widget_osr);// works
594 //eventcopy->any.window = gtk_widget_get_window(xw->widgetwindow_osr);//nothing happens
595 //eventcopy->any.window = gtk_widget_get_window(gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW(xw->widgetscrolledwindow_osr)));
596 //eventcopy->any.window = gtk_widget_get_window(xw->widgetscrolledwindow_osr); //nothing happens
597 //eventcopy->any.send_event = TRUE;
598 //gtk_scrolled_window_scroll_child (xw->widgetscrolledwindow_osr, GTK_SCROLL_STEP_DOWN, FALSE); // private
599
600
601
602 //eventcopy->any.window = gtk_button_get_event_window(GTK_BUTTON(xw->widget_osr));//gtk_widget_get_window(xwgir_create_debug);
603 //eventcopy->button.x=200; eventcopy->button.y=200;
604 //event->button.button = GDK_BUTTON_PRIMARY; //debug
605
606 //eventcopy->any.window = xw->widgetwindow_osr;//gtk_widget_get_window(xwgir_create_debug);
607 /* eventcopy->any.send_event = TRUE; */
608 /* eventcopy->button.time = GDK_CURRENT_TIME; */
609 /* eventcopy->button.device = event->button.device; */
610
611 585
612 printf("xwidget_osr_event_forward redirect event to window:%d\n", ((GdkEventAny*)eventcopy)->window); 586 /* printf("xwidget_osr_event_forward redirect event to window:%d\n", ((GdkEventAny*)eventcopy)->window); */
613 printf("A type:%d x:%f y:%f \n", event->type, event->button.x, event->button.y); 587 /* printf("A type:%d x:%f y:%f \n", event->type, event->button.x, event->button.y); */
614 printf("B type:%d x:%f y:%f \n", eventcopy->type, eventcopy->button.x, eventcopy->button.y); 588 /* printf("B type:%d x:%f y:%f \n", eventcopy->type, eventcopy->button.x, eventcopy->button.y); */
615 //gtk_button_get_event_window(xwgir_create_debug); 589 //gtk_button_get_event_window(xwgir_create_debug);
616 gtk_main_do_event(eventcopy); //TODO this will leak events. they should be deallocated later, perhaps in xwgir_event_callback 590 gtk_main_do_event(eventcopy); //TODO this will leak events. they should be deallocated later, perhaps in xwgir_event_callback
617 //printf("gtk_widget_event:%d\n",gtk_widget_event(xw->widget_osr, eventcopy));
618 //gdk_event_put(eventcopy);
619 //gdk_event_queue_append(eventcopy);
620 //gdk_event_free(eventcopy);
621 return TRUE; //dont propagate this event furter 591 return TRUE; //dont propagate this event furter
622 //return FALSE; //dont propagate this event furter
623} 592}
624 593
625GIRepository *girepository ; 594GIRepository *girepository ;