From 0609e9003dbbc67425ff0659c94f2b5fd994b4d2 Mon Sep 17 00:00:00 2001 From: Joakim Verona Date: Wed, 21 Jan 2015 22:43:14 +0100 Subject: [PATCH] cleanup --- src/dispnew.c | 1 - src/emacsgtkfixed.c | 38 -------------------------------------- src/keyboard.c | 1 - src/xdisp.c | 12 +----------- src/xterm.c | 1 - src/xwidget.c | 37 +++---------------------------------- 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) #ifdef HAVE_XWIDGETS //currently this is needed to detect xwidget movement reliably. or probably not. - //printf("scrolling_window\n"); return 0; #endif 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, G_DEFINE_TYPE (EmacsFixed, emacs_fixed, GTK_TYPE_FIXED) #ifdef HAVE_XWIDGETS -/* void aloc_callback(GtkWidget* child, GtkWidget* fixed){ */ -/* GtkAllocation child_allocation; */ -/* GtkRequisition child_requisition; */ - -/* //TODO */ -/* // if child is an xwidget, find its clipping area and modify allocation */ - -/* struct xwidget_view* xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (child), XG_XWIDGET_VIEW); */ -/* printf("aloc callback %d %s\n", xv, gtk_widget_get_name(child)); */ -/* if(xv){ */ -/* printf(" allocation modification for xw\n"); */ -/* gtk_widget_get_allocation(child, &child_allocation); */ -/* child_allocation.width = xv->clip_right; */ -/* child_allocation.height = xv->clip_bottom - xv->clip_top; */ -/* gtk_widget_size_allocate (child, &child_allocation); */ -/* //TODO find a way to remove this feeble workaround */ -/* } */ - -/* } */ struct GtkFixedPrivateL { @@ -99,7 +80,6 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation){ //for xwidgets - //TODO 1st call base class method EmacsFixedClass *klass; GtkWidgetClass *parent_class; @@ -110,7 +90,6 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget, GList *children; struct xwidget_view* xv; - // printf(" emacs_fixed_gtk_widget_size_allocate\n"); klass = EMACS_FIXED_GET_CLASS (widget); parent_class = g_type_class_peek_parent (klass); parent_class->size_allocate (widget, allocation); @@ -118,17 +97,6 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget, priv = G_TYPE_INSTANCE_GET_PRIVATE (widget, GTK_TYPE_FIXED, struct GtkFixedPrivateL); - //fixed->priv = G_TYPE_INSTANCE_GET_PRIVATE (fixed, GTK_TYPE_FIXED, GtkFixedPrivate); - //then modify allocations - /* gtk_container_foreach (widget, */ - /* aloc_callback, */ - /* widget); */ - - //begin copy paste extravaganza!!! - - //GtkFixed *fixed = GTK_FIXED (widget); - //GtkFixedPrivate *priv = fixed->priv; - gtk_widget_set_allocation (widget, allocation); @@ -167,15 +135,9 @@ static void emacs_fixed_gtk_widget_size_allocate (GtkWidget *widget, xv = (struct xwidget_view*) g_object_get_data (G_OBJECT (child->widget), XG_XWIDGET_VIEW); - //printf("aloc callback %d %s\n", xv, gtk_widget_get_name(child)); if(xv){ - //gtk_widget_get_allocation(child, &child_allocation); child_allocation.width = xv->clip_right; child_allocation.height = xv->clip_bottom - xv->clip_top; - //gtk_widget_size_allocate (child, &child_allocation); - //TODO find a way to remove this feeble workaround - // printf(" allocation internal modification for xw %d %d,%d\n",xv, child_allocation.width, child_allocation.height); - } gtk_widget_size_allocate (child->widget, &child_allocation); 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) #ifdef HAVE_XWIDGETS case XWIDGET_EVENT: { - printf("cool, an xwidget event arrived in make_lispy_event!\n"); return Fcons (Qxwidget_event,event->arg); } #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, #ifdef HAVE_XWIDGETS else if (valid_xwidget_spec_p(value)) { - //printf("handle_single_display_spec: im an xwidget!!\n"); it->what = IT_XWIDGET; it->method = GET_FROM_XWIDGET; it->position = start_pos; @@ -8050,9 +8049,6 @@ static int next_element_from_xwidget (struct it *it) { it->what = IT_XWIDGET; - //assert_valid_xwidget_id(it->xwidget_id,"next_element_from_xwidget"); - //this is shaky because why do we set "what" if we dont set the other parts?? - //printf("xwidget_id %d: in next_element_from_xwidget: FIXME \n", it->xwidget_id); return 1; } #endif @@ -18676,7 +18672,6 @@ dump_glyph (struct glyph_row *row, struct glyph *glyph, int area) glyph->left_box_line_p, glyph->right_box_line_p); - // printf("dump xwidget glyph\n"); } #endif } @@ -24099,7 +24094,7 @@ calc_pixel_width_or_height (double *res, struct it *it, Lisp_Object prop, #ifdef HAVE_XWIDGETS if (FRAME_WINDOW_P (it->f) && valid_xwidget_spec_p (prop)) { - printf("calc_pixel_width_or_height: return dummy size FIXME\n"); + //TODO dont return dummy size return OK_PIXELS (width_p ? 100 : 100); } #endif @@ -24612,13 +24607,11 @@ static void fill_xwidget_glyph_string (struct glyph_string *s) { eassert (s->first_glyph->type == XWIDGET_GLYPH); - printf("fill_xwidget_glyph_string: width:%d \n",s->first_glyph->pixel_width); s->face = FACE_FROM_ID (s->f, s->first_glyph->face_id); s->font = s->face->font; s->width = s->first_glyph->pixel_width; s->ybase += s->first_glyph->voffset; s->xwidget = s->first_glyph->u.xwidget; - //assert_valid_xwidget_id ( s->xwidget, "fill_xwidget_glyph_string"); } #endif /* 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) #define BUILD_XWIDGET_GLYPH_STRING(START, END, HEAD, TAIL, HL, X, LAST_X) \ do \ { \ - printf("BUILD_XWIDGET_GLYPH_STRING\n"); \ s = (struct glyph_string *) alloca (sizeof *s); \ INIT_GLYPH_STRING (s, NULL, w, row, area, START, HL); \ fill_xwidget_glyph_string (s); \ @@ -25798,7 +25790,6 @@ produce_xwidget_glyph (struct it *it) struct xwidget* xw; struct face *face; int glyph_ascent, crop; - printf("produce_xwidget_glyph:\n"); eassert (it->what == IT_XWIDGET); 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, #ifdef HAVE_XWIDGETS if (glyph != NULL && glyph->type == XWIDGET_GLYPH){ - //printf("attempt xwidget cursor avoidance in get_window_cursor_type\n"); return NO_CURSOR; } #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 #ifdef HAVE_XWIDGETS if (cursor_glyph->type == XWIDGET_GLYPH){ - printf("tried avoiding xwidget cursor\n"); return; //experimental avoidance of cursor on xwidget } #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, /* copy events that arrive at the outer widget to the offscreen widget */ struct xwidget* xw = (struct xwidget*) g_object_get_data (G_OBJECT (widget), XG_XWIDGET); GdkEvent* eventcopy = gdk_event_copy(event); - //GdkEvent* eventcopy = gdk_event_new(GDK_BUTTON_PRESS); - - - //((GdkEventAny*)eventcopy)->window = gtk_widget_get_window(xw->widget_osr); - //eventcopy->any.window = gtk_widget_get_window(GTK_WIDGET (xw->widgetwindow_osr)); - //((GdkEventAny*)eventcopy)->window = gtk_widget_get_window(xwgir_create_debug); - - - eventcopy->any.window = gtk_widget_get_window(xw->widget_osr);// works - //eventcopy->any.window = gtk_widget_get_window(xw->widgetwindow_osr);//nothing happens - //eventcopy->any.window = gtk_widget_get_window(gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW(xw->widgetscrolledwindow_osr))); - //eventcopy->any.window = gtk_widget_get_window(xw->widgetscrolledwindow_osr); //nothing happens - //eventcopy->any.send_event = TRUE; - //gtk_scrolled_window_scroll_child (xw->widgetscrolledwindow_osr, GTK_SCROLL_STEP_DOWN, FALSE); // private - - - - //eventcopy->any.window = gtk_button_get_event_window(GTK_BUTTON(xw->widget_osr));//gtk_widget_get_window(xwgir_create_debug); - //eventcopy->button.x=200; eventcopy->button.y=200; - //event->button.button = GDK_BUTTON_PRIMARY; //debug - - //eventcopy->any.window = xw->widgetwindow_osr;//gtk_widget_get_window(xwgir_create_debug); - /* eventcopy->any.send_event = TRUE; */ - /* eventcopy->button.time = GDK_CURRENT_TIME; */ - /* eventcopy->button.device = event->button.device; */ - - printf("xwidget_osr_event_forward redirect event to window:%d\n", ((GdkEventAny*)eventcopy)->window); - printf("A type:%d x:%f y:%f \n", event->type, event->button.x, event->button.y); - printf("B type:%d x:%f y:%f \n", eventcopy->type, eventcopy->button.x, eventcopy->button.y); + /* printf("xwidget_osr_event_forward redirect event to window:%d\n", ((GdkEventAny*)eventcopy)->window); */ + /* printf("A type:%d x:%f y:%f \n", event->type, event->button.x, event->button.y); */ + /* printf("B type:%d x:%f y:%f \n", eventcopy->type, eventcopy->button.x, eventcopy->button.y); */ //gtk_button_get_event_window(xwgir_create_debug); gtk_main_do_event(eventcopy); //TODO this will leak events. they should be deallocated later, perhaps in xwgir_event_callback - //printf("gtk_widget_event:%d\n",gtk_widget_event(xw->widget_osr, eventcopy)); - //gdk_event_put(eventcopy); - //gdk_event_queue_append(eventcopy); - //gdk_event_free(eventcopy); return TRUE; //dont propagate this event furter - //return FALSE; //dont propagate this event furter } GIRepository *girepository ; -- 2.11.4.GIT