зеркало из https://github.com/mozilla/gecko-dev.git
more image and compositor work. A lot of this is based on patches from
Michael O'Reilly <michael@metal.iinet.net.au>
This commit is contained in:
Родитель
c882a0d86c
Коммит
38dd0c7d6e
|
@ -143,14 +143,20 @@ _IMGCB_NewPixmap(IMGCB* img_cb, jint op, void *dpy_cx, jint width, jint height,
|
||||||
img_header->width,
|
img_header->width,
|
||||||
img_header->height,
|
img_header->height,
|
||||||
visual_depth);
|
visual_depth);
|
||||||
if (mask)
|
printf("\tNewpixmap: width, height = %d, %d\n",
|
||||||
mask_client_data->gdk_pixmap =
|
img_header->width,
|
||||||
gdk_pixmap_new((GdkWindow *)fe_drawable->drawable,
|
|
||||||
mask_header->width,
|
|
||||||
mask_header->height,
|
|
||||||
1);
|
|
||||||
printf("\tNewpixmap: width, height = %d, %d\n", img_header->width,
|
|
||||||
img_header->height);
|
img_header->height);
|
||||||
|
if (mask)
|
||||||
|
{
|
||||||
|
mask_client_data->gdk_pixmap =
|
||||||
|
gdk_pixmap_new((GdkWindow *)fe_drawable->drawable,
|
||||||
|
mask_header->width,
|
||||||
|
mask_header->height,
|
||||||
|
1);
|
||||||
|
printf("Newbitmap: width, height = %d, %d\n",
|
||||||
|
mask_header->width,
|
||||||
|
mask_header->height);
|
||||||
|
}
|
||||||
|
|
||||||
/* Fill in the pixmap client_data. */
|
/* Fill in the pixmap client_data. */
|
||||||
image->client_data = (void *)img_client_data;
|
image->client_data = (void *)img_client_data;
|
||||||
|
@ -216,8 +222,8 @@ _IMGCB_UpdatePixmap(IMGCB* img_cb, jint op, void* dpy_cx, IL_Pixmap* pixmap,
|
||||||
bits = (unsigned char *)pixmap->bits + widthBytes * y_offset;
|
bits = (unsigned char *)pixmap->bits + widthBytes * y_offset;
|
||||||
|
|
||||||
x_image = XCreateImage(dpy, visual,
|
x_image = XCreateImage(dpy, visual,
|
||||||
(pixmap_depth == 1 ? 1 : visual_depth),
|
((pixmap_depth == 1) ? 1 : visual_depth),
|
||||||
(pixmap_depth == 1 ? XYPixmap : ZPixmap),
|
((pixmap_depth == 1) ? XYPixmap : ZPixmap),
|
||||||
x_offset, /* offset */
|
x_offset, /* offset */
|
||||||
bits,
|
bits,
|
||||||
width,
|
width,
|
||||||
|
@ -313,8 +319,6 @@ _IMGCB_DisplayPixmap(IMGCB* img_cb, jint op, void* dpy_cx, IL_Pixmap* image,
|
||||||
|
|
||||||
GdkPixmap *img_x_pixmap=NULL, *mask_x_pixmap=NULL;
|
GdkPixmap *img_x_pixmap=NULL, *mask_x_pixmap=NULL;
|
||||||
GdkGC *gc;
|
GdkGC *gc;
|
||||||
GdkGCValues gcv;
|
|
||||||
GdkGCValuesMask flags;
|
|
||||||
XP_Bool tiling_required = FALSE;
|
XP_Bool tiling_required = FALSE;
|
||||||
GdkWindow * window = (GdkWindow *)fe_drawable->drawable;
|
GdkWindow * window = (GdkWindow *)fe_drawable->drawable;
|
||||||
|
|
||||||
|
@ -324,75 +328,76 @@ _IMGCB_DisplayPixmap(IMGCB* img_cb, jint op, void* dpy_cx, IL_Pixmap* image,
|
||||||
/* Check for zero display area. */
|
/* Check for zero display area. */
|
||||||
if (width == 0 || height == 0)
|
if (width == 0 || height == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* Retrieve the server pixmaps. */
|
/* Retrieve the server pixmaps. */
|
||||||
img_client_data = (fe_PixmapClientData *)image->client_data;
|
img_client_data = (fe_PixmapClientData *)image->client_data;
|
||||||
if (!img_client_data)
|
if (!img_client_data)
|
||||||
return;
|
return;
|
||||||
img_x_pixmap = img_client_data->gdk_pixmap;
|
img_x_pixmap = img_client_data->gdk_pixmap;
|
||||||
if (!img_x_pixmap)
|
if (!img_x_pixmap)
|
||||||
return;
|
return;
|
||||||
if (mask) {
|
if (mask) {
|
||||||
mask_client_data = (fe_PixmapClientData *)mask->client_data;
|
mask_client_data = (fe_PixmapClientData *)mask->client_data;
|
||||||
mask_x_pixmap = mask_client_data->gdk_pixmap;
|
mask_x_pixmap = mask_client_data->gdk_pixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Determine whether tiling is required. */
|
/* Determine whether tiling is required. */
|
||||||
if ((x_offset + width > img_width) || (y_offset + height > img_height))
|
if ((x_offset + width > img_width) || (y_offset + height > img_height))
|
||||||
tiling_required = TRUE;
|
tiling_required = TRUE;
|
||||||
|
|
||||||
/* Compute the offset into the drawable of the image origin. */
|
/* Compute the offset into the drawable of the image origin. */
|
||||||
img_x_offset = x - find_html_view(context)->doc_x +
|
img_x_offset = x - find_html_view(context)->doc_x +
|
||||||
fe_drawable->x_origin;
|
fe_drawable->x_origin;
|
||||||
img_y_offset = y - find_html_view(context)->doc_y +
|
img_y_offset = y - find_html_view(context)->doc_y +
|
||||||
fe_drawable->y_origin;
|
fe_drawable->y_origin;
|
||||||
|
|
||||||
/* Compute the offset into the drawable for the area to be drawn. */
|
/* Compute the offset into the drawable for the area to be drawn. */
|
||||||
rect_x_offset = img_x_offset + x_offset;
|
rect_x_offset = img_x_offset + x_offset;
|
||||||
rect_y_offset = img_y_offset + y_offset;
|
rect_y_offset = img_y_offset + y_offset;
|
||||||
|
|
||||||
/* Do the actual drawing. There are several cases to be dealt with:
|
/* Do the actual drawing. There are several cases to be dealt with:
|
||||||
transparent vs non-transparent, tiled vs non-tiled and clipped by
|
transparent vs non-transparent, tiled vs non-tiled and clipped by
|
||||||
compositor's clip region vs not clipped. */
|
compositor's clip region vs not clipped. */
|
||||||
memset(&gcv, ~0, sizeof (gcv));
|
|
||||||
|
printf("Display: mask %p, tiling %d, clip %p\n", mask,
|
||||||
printf("Display: mask %p, tiling %d, clip %p\n", mask,
|
tiling_required, fe_drawable->clip_region);
|
||||||
tiling_required, fe_drawable->clip_region);
|
|
||||||
|
|
||||||
|
gc = gdk_gc_new(window);
|
||||||
gc = gdk_gc_new(window);
|
if (mask)
|
||||||
if (mask)
|
{
|
||||||
gdk_gc_set_clip_mask(gc, mask_x_pixmap);
|
gdk_gc_set_clip_mask(gc, mask_x_pixmap);
|
||||||
|
gdk_gc_set_clip_origin(gc, rect_x_offset, rect_y_offset);
|
||||||
gdk_gc_set_ts_origin(gc, x_offset, y_offset);
|
}
|
||||||
gdk_gc_set_clip_origin(gc, rect_x_offset, rect_y_offset);
|
|
||||||
|
#if 0
|
||||||
if (fe_drawable->clip_region) { /* This is a bad hack */
|
if (fe_drawable->clip_region) { /* This is a bad hack */
|
||||||
GdkRegionPrivate * hack = gdk_region_new();
|
GdkRegionPrivate * hack = gdk_region_new();
|
||||||
FE_CopyRegion((Region)fe_drawable->clip_region,
|
FE_CopyRegion((Region)fe_drawable->clip_region,
|
||||||
hack->xregion );
|
hack->xregion );
|
||||||
gdk_gc_set_clip_region(gc, hack);
|
gdk_gc_set_clip_region(gc, hack);
|
||||||
gdk_region_destroy(hack);
|
gdk_region_destroy(hack);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
if (tiling_required)
|
if (tiling_required)
|
||||||
gdk_draw_rectangle(drawable, gc, TRUE,
|
gdk_draw_rectangle(drawable, gc, TRUE,
|
||||||
rect_x_offset, rect_y_offset, width,
|
rect_x_offset, rect_y_offset, width,
|
||||||
height);
|
height);
|
||||||
else {
|
else {
|
||||||
printf("draw_pixmap (xo %d, yo %d, rxo %d, ryo %d, w %d, h %d)\n",
|
printf("draw_pixmap (xo %d, yo %d, rxo %d, ryo %d, w %d, h %d)\n",
|
||||||
x_offset, y_offset,
|
x_offset, y_offset,
|
||||||
rect_x_offset, rect_y_offset,
|
rect_x_offset, rect_y_offset,
|
||||||
width, height);
|
width, height);
|
||||||
gdk_draw_pixmap(drawable, gc, img_x_pixmap,
|
gdk_draw_pixmap(drawable, gc, img_x_pixmap,
|
||||||
x_offset, y_offset,
|
x_offset, y_offset,
|
||||||
rect_x_offset, rect_y_offset,
|
rect_x_offset, rect_y_offset,
|
||||||
width, height);
|
width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clean up. */
|
/* Clean up. */
|
||||||
gdk_gc_destroy(gc);
|
gdk_gc_destroy(gc);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
JMC_PUBLIC_API(void)
|
JMC_PUBLIC_API(void)
|
||||||
|
|
|
@ -51,14 +51,18 @@ FE_HandleLayerEvent(MWContext *context,
|
||||||
{
|
{
|
||||||
case CL_EVENT_MOUSE_MOVE:
|
case CL_EVENT_MOUSE_MOVE:
|
||||||
html_view_handle_pointer_motion_for_layer(view, layer, event);
|
html_view_handle_pointer_motion_for_layer(view, layer, event);
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case CL_EVENT_MOUSE_BUTTON_DOWN:
|
case CL_EVENT_MOUSE_BUTTON_DOWN:
|
||||||
html_view_handle_button_press_for_layer(view, layer, event);
|
html_view_handle_button_press_for_layer(view, layer, event);
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case CL_EVENT_MOUSE_BUTTON_UP:
|
case CL_EVENT_MOUSE_BUTTON_UP:
|
||||||
html_view_handle_button_release_for_layer(view, layer, event);
|
html_view_handle_button_release_for_layer(view, layer, event);
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,7 +102,8 @@ INTL_ResourceCharSet()
|
||||||
int16
|
int16
|
||||||
INTL_DefaultDocCharSetID(MWContext *cxt)
|
INTL_DefaultDocCharSetID(MWContext *cxt)
|
||||||
{
|
{
|
||||||
printf("INTL_DefaultDocCharSetID (empty)\n");
|
printf("INTL_DefaultDocCharSetID\n");
|
||||||
|
return (CS_LATIN1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -70,4 +70,5 @@ moz_history_view_create(MozFrame *parent_frame,
|
||||||
if (view == NULL) return NULL;
|
if (view == NULL) return NULL;
|
||||||
|
|
||||||
moz_history_view_init(view, parent_frame, context);
|
moz_history_view_init(view, parent_frame, context);
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
|
@ -377,18 +377,25 @@ html_view_event_handler(GtkWidget *widget,
|
||||||
if (view->scrolled_window->allocation.width !=
|
if (view->scrolled_window->allocation.width !=
|
||||||
view->s_width ||
|
view->s_width ||
|
||||||
view->scrolled_window->allocation.height !=
|
view->scrolled_window->allocation.height !=
|
||||||
view->s_height) {
|
view->s_height ||
|
||||||
|
view->s_depth != gnomefe_depth) {
|
||||||
event->configure.width = view->s_width =
|
event->configure.width = view->s_width =
|
||||||
view->scrolled_window->allocation.width;
|
view->scrolled_window->allocation.width;
|
||||||
event->configure.height = view->s_height =
|
event->configure.height = view->s_height =
|
||||||
view->scrolled_window->allocation.height;
|
view->scrolled_window->allocation.height;
|
||||||
/* Fall thru... */
|
/* Fall thru... */
|
||||||
|
return TRUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
{
|
||||||
|
return FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
case GDK_CONFIGURE:
|
case GDK_CONFIGURE:
|
||||||
printf ("configure %d,%d\n", event->configure.width, event->configure.height);
|
printf ("html_view_event_handler: configure %d,%d\n",
|
||||||
|
event->configure.width, event->configure.height);
|
||||||
/* We only need the composited area without the scrollbars. However,
|
/* We only need the composited area without the scrollbars. However,
|
||||||
since the scrollbars can become managed and then unmanaged during
|
since the scrollbars can become managed and then unmanaged during
|
||||||
layout, it is not worth the effort of keeping track of when they
|
layout, it is not worth the effort of keeping track of when they
|
||||||
|
@ -398,21 +405,25 @@ html_view_event_handler(GtkWidget *widget,
|
||||||
CL_ResizeCompositorWindow(context->compositor,
|
CL_ResizeCompositorWindow(context->compositor,
|
||||||
event->configure.width,
|
event->configure.width,
|
||||||
event->configure.height);
|
event->configure.height);
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case GDK_MOTION_NOTIFY:
|
case GDK_MOTION_NOTIFY:
|
||||||
html_view_handle_pointer_motion(view, event);
|
html_view_handle_pointer_motion(view, event);
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case GDK_BUTTON_PRESS:
|
case GDK_BUTTON_PRESS:
|
||||||
html_view_handle_button_press(view, event);
|
html_view_handle_button_press(view, event);
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case GDK_BUTTON_RELEASE:
|
case GDK_BUTTON_RELEASE:
|
||||||
html_view_handle_button_release(view, event);
|
html_view_handle_button_release(view, event);
|
||||||
|
return TRUE;
|
||||||
break;
|
break;
|
||||||
case GDK_2BUTTON_PRESS:
|
case GDK_2BUTTON_PRESS:
|
||||||
default:
|
default:
|
||||||
|
return FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -50,7 +50,7 @@ struct _MozHTMLView {
|
||||||
int32 sw_width, sw_height;
|
int32 sw_width, sw_height;
|
||||||
|
|
||||||
GtkWidget *scrolled_window;
|
GtkWidget *scrolled_window;
|
||||||
int s_width, s_height;
|
int s_width, s_height, s_depth;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void moz_html_view_init(MozHTMLView *view, MozFrame *parent_frame, MWContext *context);
|
extern void moz_html_view_init(MozHTMLView *view, MozFrame *parent_frame, MWContext *context);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче