#ifdef HAVE_XWIDGETS
//currently this is needed to detect xwidget movement reliably. or probably not.
- //printf("scrolling_window\n");
return 0;
#endif
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
{
GtkAllocation *allocation){
//for xwidgets
-
//TODO 1st call base class method
EmacsFixedClass *klass;
GtkWidgetClass *parent_class;
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);
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);
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);
#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 */
#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;
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
glyph->left_box_line_p,
glyph->right_box_line_p);
- // printf("dump xwidget glyph\n");
}
#endif
}
#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
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.
#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); \
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);
#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
#ifdef HAVE_XWIDGETS
if (cursor_glyph->type == XWIDGET_GLYPH){
- printf("tried avoiding xwidget cursor\n");
return; //experimental avoidance of cursor on xwidget
}
#endif
/* 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 ;